primo commit
This commit is contained in:
339
media/vendor/joomla-custom-elements/LICENSE
vendored
Normal file
339
media/vendor/joomla-custom-elements/LICENSE
vendored
Normal file
@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
162
media/vendor/joomla-custom-elements/css/joomla-alert.css
vendored
Normal file
162
media/vendor/joomla-custom-elements/css/joomla-alert.css
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
@charset "UTF-8";
|
||||
joomla-alert {
|
||||
--jui-alert-min-width: 250px;
|
||||
--jui-alert-padding: .5rem 1.25rem;
|
||||
--jui-alert-margin: 0 0 1rem 0;
|
||||
--jui-alert-border: 1px solid transparent;
|
||||
--jui-alert-border-radius: .25rem;
|
||||
--jui-alert-animation-duration: .5s;
|
||||
--jui-alert-animation-timing-function: ease-in-out;
|
||||
--jui-alert-button-color-dark: #000;
|
||||
--jui-alert-button-color-light: #fff;
|
||||
--jui-alert-success-color: #234423;
|
||||
--jui-alert-success-background-color: #d9e6d9;
|
||||
--jui-alert-success-border-color: #cadcca;
|
||||
--jui-alert-success-link-color: #122212;
|
||||
--jui-alert-info-color: #0c5460;
|
||||
--jui-alert-info-background-color: #d1ecf1;
|
||||
--jui-alert-info-border-color: #bee5eb;
|
||||
--jui-alert-info-link-color: #062c33;
|
||||
--jui-alert-warning-color: #7d5a29;
|
||||
--jui-alert-warning-background-color: #fcefdc;
|
||||
--jui-alert-warning-border-color: #fbe8cd;
|
||||
--jui-alert-warning-link-color: #573e1c;
|
||||
--jui-alert-danger-color: #712b29;
|
||||
--jui-alert-danger-background-color: #f7dddc;
|
||||
--jui-alert-danger-border-color: #f4cfce;
|
||||
--jui-alert-danger-link-color: #4c1d1b;
|
||||
min-width: var(--jui-alert-min-width, 250px);
|
||||
padding: var(--jui-alert-padding, .5rem 1.25rem);
|
||||
margin: var(--jui-alert-margin, 0 0 1rem 0);
|
||||
border: var(--jui-alert-border, 1px solid transparent);
|
||||
border-radius: var(--jui-alert-border-radius, .25rem);
|
||||
-webkit-animation-duration: var(--jui-alert-animation-duration, .5s);
|
||||
animation-duration: var(--jui-alert-animation-duration, .5s);
|
||||
-webkit-animation-timing-function: var(--jui-alert-animation-timing-function, ease-in-out);
|
||||
animation-timing-function: var(--jui-alert-animation-timing-function, ease-in-out);
|
||||
display: block;
|
||||
}
|
||||
|
||||
joomla-alert .joomla-alert--close {
|
||||
float: right;
|
||||
color: var(--jui-alert-button-color-dark, #000);
|
||||
text-shadow: 0 1px 0 var(--jui-alert-button-color-light, #fff);
|
||||
opacity: .5;
|
||||
background: none;
|
||||
border: 0;
|
||||
padding: .2rem 1rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
top: -.5rem;
|
||||
right: -1.25rem;
|
||||
}
|
||||
|
||||
joomla-alert .joomla-alert--close:hover, joomla-alert .joomla-alert--close:focus {
|
||||
color: var(--jui-alert-button-color-dark, #000);
|
||||
cursor: pointer;
|
||||
opacity: .75;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
joomla-alert[type="success"] {
|
||||
color: var(--jui-alert-success-color, #234423);
|
||||
background-color: var(--jui-alert-success-background-color, #d9e6d9);
|
||||
border-color: var(--jui-alert-success-border-color, #cadcca);
|
||||
}
|
||||
|
||||
joomla-alert[type="success"] hr {
|
||||
border-top-color: var(--jui-alert-success-border-color, #cadcca);
|
||||
}
|
||||
|
||||
joomla-alert[type="success"] .alert-link {
|
||||
color: var(--jui-alert-success-link-color, #122212);
|
||||
}
|
||||
|
||||
joomla-alert[type="info"] {
|
||||
color: var(--jui-alert-info-color, #0c5460);
|
||||
background-color: var(--jui-alert-info-background-color, #d1ecf1);
|
||||
border-color: var(--jui-alert-info-border-color, #bee5eb);
|
||||
}
|
||||
|
||||
joomla-alert[type="info"] hr {
|
||||
border-top-color: var(--jui-alert-info-border-color, #bee5eb);
|
||||
}
|
||||
|
||||
joomla-alert[type="info"] .alert-link {
|
||||
color: var(--jui-alert-info-link-color, #062c33);
|
||||
}
|
||||
|
||||
joomla-alert[type="warning"] {
|
||||
color: var(--jui-alert-warning-color, #7d5a29);
|
||||
background-color: var(--jui-alert-warning-background-color, #fcefdc);
|
||||
border-color: var(--jui-alert-warning-border-color, #fbe8cd);
|
||||
}
|
||||
|
||||
joomla-alert[type="warning"] hr {
|
||||
border-top-color: var(--jui-alert-warning-border-color, #fbe8cd);
|
||||
}
|
||||
|
||||
joomla-alert[type="warning"] .alert-link {
|
||||
color: var(--jui-alert-warning-link-color, #573e1c);
|
||||
}
|
||||
|
||||
joomla-alert[type="danger"] {
|
||||
color: var(--jui-alert-danger-color, #712b29);
|
||||
background-color: var(--jui-alert-danger-background-color, #f7dddc);
|
||||
border-color: var(--jui-alert-danger-border-color, #f4cfce);
|
||||
}
|
||||
|
||||
joomla-alert[type="danger"] hr {
|
||||
border-top-color: var(--jui-alert-danger-border-color, #f4cfce);
|
||||
}
|
||||
|
||||
joomla-alert[type="danger"] .alert-link {
|
||||
color: var(--jui-alert-danger-link-color, #4c1d1b);
|
||||
}
|
||||
|
||||
html[dir="rtl"] joomla-alert .joomla-alert--close, html[dir="rtl"] joomla-alert .joomla-alert-button--close {
|
||||
float: left;
|
||||
left: -1.25rem;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
@-webkit-keyframes joomla-alert-fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes joomla-alert-fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes joomla-alert-fade-out {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes joomla-alert-fade-out {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
joomla-alert {
|
||||
-webkit-animation-duration: 1ms !important;
|
||||
animation-duration: 1ms !important;
|
||||
}
|
||||
}
|
||||
1
media/vendor/joomla-custom-elements/css/joomla-alert.min.css
vendored
Normal file
1
media/vendor/joomla-custom-elements/css/joomla-alert.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-alert{--jui-alert-min-width:250px;--jui-alert-padding:.5rem 1.25rem;--jui-alert-margin:0 0 1rem 0;--jui-alert-border:1px solid transparent;--jui-alert-border-radius:.25rem;--jui-alert-animation-duration:.5s;--jui-alert-animation-timing-function:ease-in-out;--jui-alert-button-color-dark:#000;--jui-alert-button-color-light:#fff;--jui-alert-success-color:#234423;--jui-alert-success-background-color:#d9e6d9;--jui-alert-success-border-color:#cadcca;--jui-alert-success-link-color:#122212;--jui-alert-info-color:#0c5460;--jui-alert-info-background-color:#d1ecf1;--jui-alert-info-border-color:#bee5eb;--jui-alert-info-link-color:#062c33;--jui-alert-warning-color:#7d5a29;--jui-alert-warning-background-color:#fcefdc;--jui-alert-warning-border-color:#fbe8cd;--jui-alert-warning-link-color:#573e1c;--jui-alert-danger-color:#712b29;--jui-alert-danger-background-color:#f7dddc;--jui-alert-danger-border-color:#f4cfce;--jui-alert-danger-link-color:#4c1d1b;-webkit-animation-duration:var(--jui-alert-animation-duration,.5s);animation-duration:var(--jui-alert-animation-duration,.5s);-webkit-animation-timing-function:var(--jui-alert-animation-timing-function,ease-in-out);animation-timing-function:var(--jui-alert-animation-timing-function,ease-in-out);border:var(--jui-alert-border,1px solid transparent);border-radius:var(--jui-alert-border-radius,.25rem);margin:var(--jui-alert-margin,0 0 1rem 0);min-width:var(--jui-alert-min-width,250px);padding:var(--jui-alert-padding,.5rem 1.25rem);display:block}joomla-alert .joomla-alert--close{color:var(--jui-alert-button-color-dark,#000);float:right;opacity:.5;text-shadow:0 1px 0 var(--jui-alert-button-color-light,#fff);background:0 0;border:0;padding:.2rem 1rem;font-size:1.5rem;font-weight:700;line-height:1;position:relative;top:-.5rem;right:-1.25rem}joomla-alert .joomla-alert--close:focus,joomla-alert .joomla-alert--close:hover{color:var(--jui-alert-button-color-dark,#000);cursor:pointer;opacity:.75;text-decoration:none}joomla-alert[type=success]{background-color:var(--jui-alert-success-background-color,#d9e6d9);border-color:var(--jui-alert-success-border-color,#cadcca);color:var(--jui-alert-success-color,#234423)}joomla-alert[type=success] hr{border-top-color:var(--jui-alert-success-border-color,#cadcca)}joomla-alert[type=success] .alert-link{color:var(--jui-alert-success-link-color,#122212)}joomla-alert[type=info]{background-color:var(--jui-alert-info-background-color,#d1ecf1);border-color:var(--jui-alert-info-border-color,#bee5eb);color:var(--jui-alert-info-color,#0c5460)}joomla-alert[type=info] hr{border-top-color:var(--jui-alert-info-border-color,#bee5eb)}joomla-alert[type=info] .alert-link{color:var(--jui-alert-info-link-color,#062c33)}joomla-alert[type=warning]{background-color:var(--jui-alert-warning-background-color,#fcefdc);border-color:var(--jui-alert-warning-border-color,#fbe8cd);color:var(--jui-alert-warning-color,#7d5a29)}joomla-alert[type=warning] hr{border-top-color:var(--jui-alert-warning-border-color,#fbe8cd)}joomla-alert[type=warning] .alert-link{color:var(--jui-alert-warning-link-color,#573e1c)}joomla-alert[type=danger]{background-color:var(--jui-alert-danger-background-color,#f7dddc);border-color:var(--jui-alert-danger-border-color,#f4cfce);color:var(--jui-alert-danger-color,#712b29)}joomla-alert[type=danger] hr{border-top-color:var(--jui-alert-danger-border-color,#f4cfce)}joomla-alert[type=danger] .alert-link{color:var(--jui-alert-danger-link-color,#4c1d1b)}html[dir=rtl] joomla-alert .joomla-alert--close,html[dir=rtl] joomla-alert .joomla-alert-button--close{float:left;left:-1.25rem;right:auto}@-webkit-keyframes joomla-alert-fade-in{0%{opacity:0}}@keyframes joomla-alert-fade-in{0%{opacity:0}}@-webkit-keyframes joomla-alert-fade-out{0%{opacity:1}to{opacity:0}}@keyframes joomla-alert-fade-out{0%{opacity:1}to{opacity:0}}@media (prefers-reduced-motion:reduce){joomla-alert{-webkit-animation-duration:1ms!important;animation-duration:1ms!important}}
|
||||
BIN
media/vendor/joomla-custom-elements/css/joomla-alert.min.css.gz
vendored
Normal file
BIN
media/vendor/joomla-custom-elements/css/joomla-alert.min.css.gz
vendored
Normal file
Binary file not shown.
183
media/vendor/joomla-custom-elements/css/joomla-tab.css
vendored
Normal file
183
media/vendor/joomla-custom-elements/css/joomla-tab.css
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
@charset "UTF-8";
|
||||
joomla-tab {
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
joomla-tab[view="tabs"] > div[role="tablist"] {
|
||||
white-space: nowrap;
|
||||
list-style: outside none none;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: 0;
|
||||
-o-border-image: ;
|
||||
border-image: ;
|
||||
border-radius: .25rem .25rem 0 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
overflow: auto hidden;
|
||||
box-shadow: inset 0 1px #fff, 0 2px 3px -3px #00000026, inset 0 -4px #0000000d, 0 0 3px #0000000a;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] > div[role="tablist"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
joomla-tab button[role="tab"] {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
color: #0d1321;
|
||||
border: unset;
|
||||
background-color: #0000;
|
||||
padding: .75em 1em;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
position: relative;
|
||||
box-shadow: 1px 0 #0000000d;
|
||||
}
|
||||
|
||||
joomla-tab button[role="tab"][aria-expanded="true"] {
|
||||
background-color: #00000008;
|
||||
background-image: linear-gradient(#0000, #0000000d 100%);
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
box-shadow: inset 2px 0 1px -1px #00000014, inset -2px 0 1px -1px #00000014, inset 0 1px #00000005;
|
||||
}
|
||||
|
||||
joomla-tab button[aria-expanded="true"]:after {
|
||||
content: "";
|
||||
opacity: .8;
|
||||
background-color: #006898;
|
||||
height: 5px;
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
joomla-tab > joomla-tab-element {
|
||||
background-color: #fefefe;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 0 0 .25rem .25rem;
|
||||
padding: 15px;
|
||||
display: none;
|
||||
position: relative;
|
||||
box-shadow: 0 0 3px #0000000a;
|
||||
}
|
||||
|
||||
joomla-tab > joomla-tab-element[active] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] {
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > div[role="tablist"] {
|
||||
box-shadow: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: .25rem;
|
||||
flex-direction: column;
|
||||
min-width: 30%;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > div[role="tablist"] button:last-of-type {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > div[role="tablist"] button {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
color: #0d1321;
|
||||
box-shadow: none;
|
||||
background-color: #0000;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: .75em 1em;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > div[role="tablist"] button[aria-expanded="true"] {
|
||||
box-shadow: none;
|
||||
background-color: #fff;
|
||||
background-image: none;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > div[role="tablist"] button[aria-expanded="true"]:after {
|
||||
width: 5px;
|
||||
height: auto;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: -1px;
|
||||
}
|
||||
|
||||
joomla-tab[orientation="vertical"] > joomla-tab-element {
|
||||
box-shadow: none;
|
||||
border: 0;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] {
|
||||
white-space: normal;
|
||||
border-radius: .25rem;
|
||||
flex-direction: column;
|
||||
box-shadow: inset 0 1px #fff, 0 0 3px #0000000a;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] > button {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
color: #0d1321;
|
||||
border: unset;
|
||||
background-color: #f5f5f5;
|
||||
padding: .75em 1em;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
position: relative;
|
||||
box-shadow: 1px 0 #0000000d;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] > button[aria-expanded="true"], joomla-tab[view="accordion"] > button:focus {
|
||||
background-color: #00000008;
|
||||
background-image: linear-gradient(#0000, #0000000d 100%);
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] joomla-tab-element {
|
||||
padding: 15px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] joomla-tab-element[active] {
|
||||
border-bottom: 1px solid #ddd;
|
||||
display: block;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] [active] {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] button {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
joomla-tab[view="accordion"] button[aria-expanded="true"]:after {
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
1
media/vendor/joomla-custom-elements/css/joomla-tab.min.css
vendored
Normal file
1
media/vendor/joomla-custom-elements/css/joomla-tab.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@charset "UTF-8";joomla-tab{flex-direction:column;display:flex}joomla-tab[view=tabs]>div[role=tablist]{white-space:nowrap;background-color:#f5f5f5;border:1px solid #ccc;border-bottom:0;-o-border-image:;border-image:;border-radius:.25rem .25rem 0 0;margin:0;padding:0;list-style:none;display:flex;overflow:auto hidden;box-shadow:inset 0 1px #fff,0 2px 3px -3px #00000026,inset 0 -4px #0000000d,0 0 3px #0000000a}joomla-tab[view=accordion]>div[role=tablist]{display:none}joomla-tab button[role=tab]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:unset;color:#0d1321;background-color:#0000;padding:.75em 1em;text-decoration:none;display:block;position:relative;box-shadow:1px 0 #0000000d}joomla-tab button[role=tab][aria-expanded=true]{background-color:#00000008;background-image:linear-gradient(#0000,#0000000d);border-left:0;border-right:0;border-top-left-radius:0;border-top-right-radius:0;box-shadow:inset 2px 0 1px -1px #00000014,inset -2px 0 1px -1px #00000014,inset 0 1px #00000005}joomla-tab button[aria-expanded=true]:after{content:"";opacity:.8;background-color:#006898;height:5px;position:absolute;bottom:-1px;left:0;right:0}joomla-tab>joomla-tab-element{background-color:#fefefe;border:1px solid #ccc;border-radius:0 0 .25rem .25rem;padding:15px;display:none;position:relative;box-shadow:0 0 3px #0000000a}joomla-tab>joomla-tab-element[active]{display:block}joomla-tab[orientation=vertical]{flex-direction:row;align-items:flex-start}joomla-tab[orientation=vertical]>div[role=tablist]{box-shadow:none;border:1px solid #ccc;border-radius:.25rem;flex-direction:column;min-width:30%;height:auto;overflow:hidden}joomla-tab[orientation=vertical]>div[role=tablist] button:last-of-type{border-bottom:0}joomla-tab[orientation=vertical]>div[role=tablist] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:none;color:#0d1321;background-color:#0000;border-bottom:1px solid #ddd;padding:.75em 1em;text-decoration:none;display:block;position:relative}joomla-tab[orientation=vertical]>div[role=tablist] button[aria-expanded=true]{box-shadow:none;background-color:#fff;background-image:none;border-left:0;border-right:0}joomla-tab[orientation=vertical]>div[role=tablist] button[aria-expanded=true]:after{width:5px;height:auto;top:0;bottom:0;left:-1px}joomla-tab[orientation=vertical]>joomla-tab-element{box-shadow:none;border:0;padding:15px}joomla-tab[view=accordion]{white-space:normal;border-radius:.25rem;flex-direction:column;box-shadow:inset 0 1px #fff,0 0 3px #0000000a}joomla-tab[view=accordion]>button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:unset;color:#0d1321;background-color:#f5f5f5;padding:.75em 1em;text-decoration:none;display:block;position:relative;box-shadow:1px 0 #0000000d}joomla-tab[view=accordion]>button:focus,joomla-tab[view=accordion]>button[aria-expanded=true]{background-color:#00000008;background-image:linear-gradient(#0000,#0000000d)}joomla-tab[view=accordion] joomla-tab-element{padding:15px;display:none}joomla-tab[view=accordion] joomla-tab-element[active]{border-bottom:1px solid #ddd;display:block}joomla-tab[view=accordion] [active]{background-color:#fff}joomla-tab[view=accordion] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-bottom:1px solid #ddd}joomla-tab[view=accordion] button[aria-expanded=true]:after{width:5px;height:100%;top:0;left:0}
|
||||
BIN
media/vendor/joomla-custom-elements/css/joomla-tab.min.css.gz
vendored
Normal file
BIN
media/vendor/joomla-custom-elements/css/joomla-tab.min.css.gz
vendored
Normal file
Binary file not shown.
191
media/vendor/joomla-custom-elements/js/joomla-alert.js
vendored
Normal file
191
media/vendor/joomla-custom-elements/js/joomla-alert.js
vendored
Normal file
@ -0,0 +1,191 @@
|
||||
class AlertElement extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// Bindings
|
||||
this.close = this.close.bind(this);
|
||||
this.destroyCloseButton = this.destroyCloseButton.bind(this);
|
||||
this.createCloseButton = this.createCloseButton.bind(this);
|
||||
this.onMutation = this.onMutation.bind(this);
|
||||
|
||||
this.observer = new MutationObserver(this.onMutation);
|
||||
this.observer.observe(this, { attributes: false, childList: true, subtree: true });
|
||||
|
||||
// Handle the fade in animation
|
||||
this.addEventListener('animationend', (event) => {
|
||||
if (event.animationName === 'joomla-alert-fade-in' && event.target === this) {
|
||||
this.dispatchEvent(new CustomEvent('joomla.alert.shown'));
|
||||
this.style.removeProperty('animationName');
|
||||
}
|
||||
});
|
||||
|
||||
// Handle the fade out animation
|
||||
this.addEventListener('animationend', (event) => {
|
||||
if (event.animationName === 'joomla-alert-fade-out' && event.target === this) {
|
||||
this.dispatchEvent(new CustomEvent('joomla.alert.closed'));
|
||||
this.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* Attributes to monitor */
|
||||
static get observedAttributes() { return ['type', 'role', 'dismiss', 'auto-dismiss', 'close-text']; }
|
||||
|
||||
get type() { return this.getAttribute('type'); }
|
||||
|
||||
set type(value) { this.setAttribute('type', value); }
|
||||
|
||||
get role() { return this.getAttribute('role'); }
|
||||
|
||||
set role(value) { this.setAttribute('role', value); }
|
||||
|
||||
get closeText() { return this.getAttribute('close-text'); }
|
||||
|
||||
set closeText(value) { this.setAttribute('close-text', value); }
|
||||
|
||||
get dismiss() { return this.getAttribute('dismiss'); }
|
||||
|
||||
set dismiss(value) { this.setAttribute('dismiss', value); }
|
||||
|
||||
get autodismiss() { return this.getAttribute('auto-dismiss'); }
|
||||
|
||||
set autodismiss(value) { this.setAttribute('auto-dismiss', value); }
|
||||
|
||||
/* Lifecycle, element appended to the DOM */
|
||||
connectedCallback() {
|
||||
this.dispatchEvent(new CustomEvent('joomla.alert.show'));
|
||||
this.style.animationName = 'joomla-alert-fade-in';
|
||||
|
||||
// Default to info
|
||||
if (!this.type || !['info', 'warning', 'danger', 'success'].includes(this.type)) {
|
||||
this.setAttribute('type', 'info');
|
||||
}
|
||||
// Default to alert
|
||||
if (!this.role || !['alert', 'alertdialog'].includes(this.role)) {
|
||||
this.setAttribute('role', 'alert');
|
||||
}
|
||||
|
||||
// Hydrate the button
|
||||
if (this.firstElementChild && this.firstElementChild.tagName === 'BUTTON') {
|
||||
this.button = this.firstElementChild;
|
||||
if (this.button.classList.contains('joomla-alert--close')) {
|
||||
this.button.classList.add('joomla-alert--close');
|
||||
}
|
||||
if (this.button.innerHTML === '') {
|
||||
this.button.innerHTML = '<span aria-hidden="true">×</span>';
|
||||
}
|
||||
if (!this.button.hasAttribute('aria-label')) {
|
||||
this.button.setAttribute('aria-label', this.closeText);
|
||||
}
|
||||
}
|
||||
|
||||
// Append button
|
||||
if (this.hasAttribute('dismiss') && !this.button) {
|
||||
this.createCloseButton();
|
||||
}
|
||||
|
||||
if (this.hasAttribute('auto-dismiss')) {
|
||||
this.autoDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/* Lifecycle, element removed from the DOM */
|
||||
disconnectedCallback() {
|
||||
if (this.button) {
|
||||
this.button.removeEventListener('click', this.close);
|
||||
}
|
||||
this.observer.disconnect();
|
||||
}
|
||||
|
||||
/* Respond to attribute changes */
|
||||
attributeChangedCallback(attr, oldValue, newValue) {
|
||||
switch (attr) {
|
||||
case 'type':
|
||||
if (!newValue || (newValue && ['info', 'warning', 'danger', 'success'].indexOf(newValue) === -1)) {
|
||||
this.type = 'info';
|
||||
}
|
||||
break;
|
||||
case 'role':
|
||||
if (!newValue || (newValue && ['alert', 'alertdialog'].indexOf(newValue) === -1)) {
|
||||
this.role = 'alert';
|
||||
}
|
||||
break;
|
||||
case 'dismiss':
|
||||
if ((!newValue || newValue === '') && (!oldValue || oldValue === '')) {
|
||||
if (this.button && !this.hasAttribute('dismiss')) {
|
||||
this.destroyCloseButton();
|
||||
} else if (!this.button && this.hasAttribute('dismiss')) {
|
||||
this.createCloseButton();
|
||||
}
|
||||
} else if (this.button && newValue === 'false') {
|
||||
this.destroyCloseButton();
|
||||
} else if (!this.button && newValue !== 'false') {
|
||||
this.createCloseButton();
|
||||
}
|
||||
break;
|
||||
case 'close-text':
|
||||
if (!newValue || newValue !== oldValue) {
|
||||
if (this.button) {
|
||||
this.button.setAttribute('aria-label', newValue);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'auto-dismiss':
|
||||
this.autoDismiss();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Observe added elements */
|
||||
onMutation(mutationsList) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const mutation of mutationsList) {
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes.length) {
|
||||
// Make sure that the button is always the first element
|
||||
if (this.button && this.firstElementChild !== this.button) {
|
||||
this.prepend(this.button);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Method to close the alert */
|
||||
close() {
|
||||
this.dispatchEvent(new CustomEvent('joomla.alert.close'));
|
||||
this.style.animationName = 'joomla-alert-fade-out';
|
||||
}
|
||||
|
||||
/* Method to create the close button */
|
||||
createCloseButton() {
|
||||
this.button = document.createElement('button');
|
||||
this.button.setAttribute('type', 'button');
|
||||
this.button.classList.add('joomla-alert--close');
|
||||
this.button.innerHTML = '<span aria-hidden="true">×</span>';
|
||||
this.button.setAttribute('aria-label', this.closeText);
|
||||
this.insertAdjacentElement('afterbegin', this.button);
|
||||
|
||||
/* Add the required listener */
|
||||
this.button.addEventListener('click', this.close);
|
||||
}
|
||||
|
||||
/* Method to remove the close button */
|
||||
destroyCloseButton() {
|
||||
if (this.button) {
|
||||
this.button.removeEventListener('click', this.close);
|
||||
this.button.parentNode.removeChild(this.button);
|
||||
this.button = null;
|
||||
}
|
||||
}
|
||||
|
||||
/* Method to auto-dismiss */
|
||||
autoDismiss() {
|
||||
const timer = parseInt(this.getAttribute('auto-dismiss'), 10);
|
||||
setTimeout(this.close, timer >= 10 ? timer : 3000);
|
||||
}
|
||||
}
|
||||
|
||||
if (!customElements.get('joomla-alert')) {
|
||||
customElements.define('joomla-alert', AlertElement);
|
||||
}
|
||||
1
media/vendor/joomla-custom-elements/js/joomla-alert.min.js
vendored
Normal file
1
media/vendor/joomla-custom-elements/js/joomla-alert.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
class t extends HTMLElement{constructor(){super(),this.close=this.close.bind(this),this.destroyCloseButton=this.destroyCloseButton.bind(this),this.createCloseButton=this.createCloseButton.bind(this),this.onMutation=this.onMutation.bind(this),this.observer=new MutationObserver(this.onMutation),this.observer.observe(this,{attributes:!1,childList:!0,subtree:!0}),this.addEventListener("animationend",(t=>{"joomla-alert-fade-in"===t.animationName&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.shown")),this.style.removeProperty("animationName"))})),this.addEventListener("animationend",(t=>{"joomla-alert-fade-out"===t.animationName&&t.target===this&&(this.dispatchEvent(new CustomEvent("joomla.alert.closed")),this.remove())}))}static get observedAttributes(){return["type","role","dismiss","auto-dismiss","close-text"]}get type(){return this.getAttribute("type")}set type(t){this.setAttribute("type",t)}get role(){return this.getAttribute("role")}set role(t){this.setAttribute("role",t)}get closeText(){return this.getAttribute("close-text")}set closeText(t){this.setAttribute("close-text",t)}get dismiss(){return this.getAttribute("dismiss")}set dismiss(t){this.setAttribute("dismiss",t)}get autodismiss(){return this.getAttribute("auto-dismiss")}set autodismiss(t){this.setAttribute("auto-dismiss",t)}connectedCallback(){this.dispatchEvent(new CustomEvent("joomla.alert.show")),this.style.animationName="joomla-alert-fade-in",this.type&&["info","warning","danger","success"].includes(this.type)||this.setAttribute("type","info"),this.role&&["alert","alertdialog"].includes(this.role)||this.setAttribute("role","alert"),this.firstElementChild&&"BUTTON"===this.firstElementChild.tagName&&(this.button=this.firstElementChild,this.button.classList.contains("joomla-alert--close")&&this.button.classList.add("joomla-alert--close"),""===this.button.innerHTML&&(this.button.innerHTML='<span aria-hidden="true">×</span>'),this.button.hasAttribute("aria-label")||this.button.setAttribute("aria-label",this.closeText)),this.hasAttribute("dismiss")&&!this.button&&this.createCloseButton(),this.hasAttribute("auto-dismiss")&&this.autoDismiss()}disconnectedCallback(){this.button&&this.button.removeEventListener("click",this.close),this.observer.disconnect()}attributeChangedCallback(t,e,s){switch(t){case"type":(!s||s&&-1===["info","warning","danger","success"].indexOf(s))&&(this.type="info");break;case"role":(!s||s&&-1===["alert","alertdialog"].indexOf(s))&&(this.role="alert");break;case"dismiss":s&&""!==s||e&&""!==e?this.button&&"false"===s?this.destroyCloseButton():this.button||"false"===s||this.createCloseButton():this.button&&!this.hasAttribute("dismiss")?this.destroyCloseButton():!this.button&&this.hasAttribute("dismiss")&&this.createCloseButton();break;case"close-text":s&&s===e||this.button&&this.button.setAttribute("aria-label",s);break;case"auto-dismiss":this.autoDismiss()}}onMutation(t){for(const e of t)"childList"===e.type&&e.addedNodes.length&&this.button&&this.firstElementChild!==this.button&&this.prepend(this.button)}close(){this.dispatchEvent(new CustomEvent("joomla.alert.close")),this.style.animationName="joomla-alert-fade-out"}createCloseButton(){this.button=document.createElement("button"),this.button.setAttribute("type","button"),this.button.classList.add("joomla-alert--close"),this.button.innerHTML='<span aria-hidden="true">×</span>',this.button.setAttribute("aria-label",this.closeText),this.insertAdjacentElement("afterbegin",this.button),this.button.addEventListener("click",this.close)}destroyCloseButton(){this.button&&(this.button.removeEventListener("click",this.close),this.button.parentNode.removeChild(this.button),this.button=null)}autoDismiss(){const t=parseInt(this.getAttribute("auto-dismiss"),10);setTimeout(this.close,t>=10?t:3e3)}}customElements.get("joomla-alert")||customElements.define("joomla-alert",t);
|
||||
BIN
media/vendor/joomla-custom-elements/js/joomla-alert.min.js.gz
vendored
Normal file
BIN
media/vendor/joomla-custom-elements/js/joomla-alert.min.js.gz
vendored
Normal file
Binary file not shown.
487
media/vendor/joomla-custom-elements/js/joomla-tab.js
vendored
Normal file
487
media/vendor/joomla-custom-elements/js/joomla-tab.js
vendored
Normal file
@ -0,0 +1,487 @@
|
||||
class TabElement extends HTMLElement {}
|
||||
|
||||
customElements.define('joomla-tab-element', TabElement);
|
||||
|
||||
class TabsElement extends HTMLElement {
|
||||
/* Attributes to monitor */
|
||||
static get observedAttributes() { return ['recall', 'orientation', 'view', 'breakpoint']; }
|
||||
|
||||
get recall() { return this.getAttribute('recall'); }
|
||||
|
||||
set recall(value) { this.setAttribute('recall', value); }
|
||||
|
||||
get view() { return this.getAttribute('view'); }
|
||||
|
||||
set view(value) { this.setAttribute('view', value); }
|
||||
|
||||
get orientation() { return this.getAttribute('orientation'); }
|
||||
|
||||
set orientation(value) { this.setAttribute('orientation', value); }
|
||||
|
||||
get breakpoint() { return parseInt(this.getAttribute('breakpoint'), 10); }
|
||||
|
||||
set breakpoint(value) { this.setAttribute('breakpoint', value); }
|
||||
|
||||
/* Lifecycle, element created */
|
||||
constructor() {
|
||||
super();
|
||||
this.tabs = [];
|
||||
this.tabsElements = [];
|
||||
this.previousActive = null;
|
||||
|
||||
this.onMutation = this.onMutation.bind(this);
|
||||
this.keyBehaviour = this.keyBehaviour.bind(this);
|
||||
this.activateTab = this.activateTab.bind(this);
|
||||
this.deactivateTabs = this.deactivateTabs.bind(this);
|
||||
this.checkView = this.checkView.bind(this);
|
||||
|
||||
this.observer = new MutationObserver(this.onMutation);
|
||||
this.observer.observe(this, { attributes: false, childList: true, subtree: true });
|
||||
}
|
||||
|
||||
/* Lifecycle, element appended to the DOM */
|
||||
connectedCallback() {
|
||||
if (!this.orientation || (this.orientation && !['horizontal', 'vertical'].includes(this.orientation))) {
|
||||
this.orientation = 'horizontal';
|
||||
}
|
||||
|
||||
if (!this.view || (this.view && !['tabs', 'accordion'].includes(this.view))) {
|
||||
this.view = 'tabs';
|
||||
}
|
||||
|
||||
// get tab elements
|
||||
this.tabsElements = [].slice.call(this.children).filter((el) => el.tagName.toLowerCase() === 'joomla-tab-element');
|
||||
|
||||
// Sanity checks
|
||||
if (!this.tabsElements.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isNested = this.parentNode.closest('joomla-tab') instanceof HTMLElement;
|
||||
|
||||
this.hydrate();
|
||||
if (this.hasAttribute('recall') && !this.isNested) {
|
||||
this.activateFromState();
|
||||
}
|
||||
|
||||
// Activate tab from the URL hash
|
||||
if (window.location.hash) {
|
||||
const hash = window.location.hash.substr(1);
|
||||
const tabToactivate = this.tabs.filter((tab) => tab.tab.id === hash);
|
||||
if (tabToactivate.length) {
|
||||
this.activateTab(tabToactivate[0].tab, false);
|
||||
}
|
||||
}
|
||||
|
||||
// If no active tab activate the first one
|
||||
if (!this.tabs.filter((tab) => tab.tab.hasAttribute('active')).length) {
|
||||
this.activateTab(this.tabs[0].tab, false);
|
||||
}
|
||||
|
||||
this.addEventListener('keyup', this.keyBehaviour);
|
||||
|
||||
if (this.breakpoint) {
|
||||
// Convert tabs to accordian
|
||||
this.checkView();
|
||||
window.addEventListener('resize', () => {
|
||||
this.checkView();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* Lifecycle, element removed from the DOM */
|
||||
disconnectedCallback() {
|
||||
this.tabs.map((tab) => {
|
||||
tab.tabButton.removeEventListener('click', this.activateTab);
|
||||
tab.accordionButton.removeEventListener('click', this.activateTab);
|
||||
return tab;
|
||||
});
|
||||
this.removeEventListener('keyup', this.keyBehaviour);
|
||||
}
|
||||
|
||||
/* Respond to attribute changes */
|
||||
attributeChangedCallback(attr, oldValue, newValue) {
|
||||
switch (attr) {
|
||||
case 'view':
|
||||
if (!newValue || (newValue && !['tabs', 'accordion'].includes(newValue))) {
|
||||
this.view = 'tabs';
|
||||
}
|
||||
if (newValue === 'tabs' && newValue !== oldValue) {
|
||||
if (this.tabButtonContainer) this.tabButtonContainer.removeAttribute('hidden');
|
||||
this.tabs.map((tab) => tab.accordionButton.setAttribute('hidden', ''));
|
||||
} else if (newValue === 'accordion' && newValue !== oldValue) {
|
||||
if (this.tabButtonContainer) this.tabButtonContainer.setAttribute('hidden', '');
|
||||
this.tabs.map((tab) => tab.accordionButton.removeAttribute('hidden'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
hydrate() {
|
||||
// Ensure the tab links container exists
|
||||
this.tabButtonContainer = document.createElement('div');
|
||||
this.tabButtonContainer.setAttribute('role', 'tablist');
|
||||
this.insertAdjacentElement('afterbegin', this.tabButtonContainer);
|
||||
|
||||
if (this.view === 'accordion') {
|
||||
this.tabButtonContainer.setAttribute('hidden', '');
|
||||
}
|
||||
|
||||
this.tabsElements.map((tab) => {
|
||||
// Create Accordion button
|
||||
const accordionButton = document.createElement('button');
|
||||
accordionButton.setAttribute('aria-expanded', !!tab.hasAttribute('active'));
|
||||
accordionButton.setAttribute('aria-controls', tab.id);
|
||||
accordionButton.setAttribute('type', 'button');
|
||||
accordionButton.innerHTML = `<span class="accordion-title">${tab.getAttribute('name')}<span class="accordion-icon"></span></span>`;
|
||||
tab.insertAdjacentElement('beforebegin', accordionButton);
|
||||
|
||||
if (this.view === 'tabs') {
|
||||
accordionButton.setAttribute('hidden', '');
|
||||
}
|
||||
|
||||
accordionButton.addEventListener('click', this.activateTab);
|
||||
|
||||
// Create tab button
|
||||
const tabButton = document.createElement('button');
|
||||
tabButton.setAttribute('aria-expanded', !!tab.hasAttribute('active'));
|
||||
tabButton.setAttribute('aria-controls', tab.id);
|
||||
tabButton.setAttribute('role', 'tab');
|
||||
tabButton.setAttribute('type', 'button');
|
||||
tabButton.innerHTML = `${tab.getAttribute('name')}`;
|
||||
this.tabButtonContainer.appendChild(tabButton);
|
||||
|
||||
tabButton.addEventListener('click', this.activateTab);
|
||||
|
||||
if (this.view === 'tabs') {
|
||||
tab.setAttribute('role', 'tabpanel');
|
||||
} else {
|
||||
tab.setAttribute('role', 'region');
|
||||
}
|
||||
|
||||
this.tabs.push({
|
||||
tab,
|
||||
tabButton,
|
||||
accordionButton,
|
||||
});
|
||||
|
||||
return tab;
|
||||
});
|
||||
}
|
||||
|
||||
/* Update on mutation */
|
||||
onMutation(mutationsList) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const mutation of mutationsList) {
|
||||
if (mutation.type === 'childList') {
|
||||
if (mutation.addedNodes.length) {
|
||||
[].slice.call(mutation.addedNodes).map((inserted) => this.createNavs(inserted));
|
||||
// Add the tab buttons
|
||||
}
|
||||
if (mutation.removedNodes.length) {
|
||||
// Remove the tab buttons
|
||||
[].slice.call(mutation.addedNodes).map((inserted) => this.removeNavs(inserted));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
keyBehaviour(e) {
|
||||
// Only the tabs/accordion buttons, no ⌘ or Alt modifier
|
||||
if (![...this.tabs.map((el) => el.tabButton), ...this.tabs.map((el) => el.accordionButton)]
|
||||
.includes(document.activeElement)
|
||||
|| e.metaKey
|
||||
|| e.altKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
let previousTabItem;
|
||||
let nextTabItem;
|
||||
if (this.view === 'tabs') {
|
||||
const currentTabIndex = this.tabs.findIndex((tab) => tab.tab.hasAttribute('active'));
|
||||
previousTabItem = currentTabIndex - 1 >= 0
|
||||
? this.tabs[currentTabIndex - 1] : this.tabs[this.tabs.length - 1];
|
||||
nextTabItem = currentTabIndex + 1 <= this.tabs.length - 1
|
||||
? this.tabs[currentTabIndex + 1] : this.tabs[0];
|
||||
} else {
|
||||
const currentTabIndex = this.tabs.map((el) => el.accordionButton)
|
||||
.findIndex((tab) => tab === document.activeElement);
|
||||
previousTabItem = currentTabIndex - 1 >= 0
|
||||
? this.tabs[currentTabIndex - 1] : this.tabs[this.tabs.length - 1];
|
||||
nextTabItem = currentTabIndex + 1 <= this.tabs.length - 1
|
||||
? this.tabs[currentTabIndex + 1] : this.tabs[0];
|
||||
}
|
||||
|
||||
// catch left/right and up/down arrow key events
|
||||
switch (e.keyCode) {
|
||||
case 37:
|
||||
case 38:
|
||||
if (this.view === 'tabs') {
|
||||
previousTabItem.tabButton.click();
|
||||
previousTabItem.tabButton.focus();
|
||||
} else {
|
||||
previousTabItem.accordionButton.focus();
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 39:
|
||||
case 40:
|
||||
if (this.view === 'tabs') {
|
||||
nextTabItem.tabButton.click();
|
||||
nextTabItem.tabButton.focus();
|
||||
} else {
|
||||
nextTabItem.accordionButton.focus();
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
deactivateTabs() {
|
||||
this.tabs.map((tabObj) => {
|
||||
tabObj.accordionButton.removeAttribute('aria-disabled');
|
||||
tabObj.tabButton.removeAttribute('aria-expanded');
|
||||
tabObj.accordionButton.setAttribute('aria-expanded', false);
|
||||
|
||||
if (tabObj.tab.hasAttribute('active')) {
|
||||
this.dispatchCustomEvent('joomla.tab.hide', this.view === 'tabs' ? tabObj.tabButton : tabObj.accordionButton, this.previousActive);
|
||||
tabObj.tab.removeAttribute('active');
|
||||
tabObj.tab.setAttribute('tabindex', '-1');
|
||||
// Emit hidden event
|
||||
this.dispatchCustomEvent('joomla.tab.hidden', this.view === 'tabs' ? tabObj.tabButton : tabObj.accordionButton, this.previousActive);
|
||||
this.previousActive = this.view === 'tabs' ? tabObj.tabButton : tabObj.accordionButton;
|
||||
}
|
||||
return tabObj;
|
||||
});
|
||||
}
|
||||
|
||||
activateTab(input, state = true) {
|
||||
let currentTrigger;
|
||||
if (input.currentTarget) {
|
||||
currentTrigger = this.tabs.find((tab) => ((this.view === 'tabs' ? tab.tabButton : tab.accordionButton) === input.currentTarget));
|
||||
} else if (input instanceof HTMLElement) {
|
||||
currentTrigger = this.tabs.find((tab) => tab.tab === input);
|
||||
} else if (Number.isInteger(input)) {
|
||||
currentTrigger = this.tabs[input];
|
||||
}
|
||||
|
||||
if (currentTrigger) {
|
||||
// Accordion can close the active panel
|
||||
if (this.view === 'accordion' && this.tabs.find((tab) => tab.accordionButton.getAttribute('aria-expanded') === 'true') === currentTrigger) {
|
||||
if (currentTrigger.tab.hasAttribute('active')) {
|
||||
currentTrigger.tab.removeAttribute('active');
|
||||
return;
|
||||
}
|
||||
currentTrigger.tab.setAttribute('active', '');
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove current active
|
||||
this.deactivateTabs();
|
||||
// Set new active
|
||||
currentTrigger.tabButton.setAttribute('aria-expanded', true);
|
||||
currentTrigger.accordionButton.setAttribute('aria-expanded', true);
|
||||
currentTrigger.accordionButton.setAttribute('aria-disabled', true);
|
||||
currentTrigger.tab.setAttribute('active', '');
|
||||
currentTrigger.tabButton.removeAttribute('tabindex');
|
||||
this.dispatchCustomEvent('joomla.tab.show', this.view === 'tabs' ? currentTrigger.tabButton : currentTrigger.accordionButton, this.previousActive);
|
||||
if (state) {
|
||||
if (this.view === 'tabs') {
|
||||
currentTrigger.tabButton.focus();
|
||||
} else {
|
||||
currentTrigger.accordionButton.focus();
|
||||
}
|
||||
}
|
||||
if (state) this.saveState(currentTrigger.tab.id);
|
||||
this.dispatchCustomEvent('joomla.tab.shown', this.view === 'tabs' ? currentTrigger.tabButton : currentTrigger.accordionButton, this.previousActive);
|
||||
}
|
||||
}
|
||||
|
||||
// Create navigation elements for inserted tabs
|
||||
createNavs(tab) {
|
||||
if ((tab instanceof Element && tab.tagName.toLowerCase() !== 'joomla-tab-element') || ![].some.call(this.children, (el) => el === tab).length || !tab.getAttribute('name') || !tab.getAttribute('id')) return;
|
||||
const tabs = [].slice.call(this.children).filter((el) => el.tagName.toLowerCase() === 'joomla-tab-element');
|
||||
const index = tabs.findIndex((tb) => tb === tab);
|
||||
|
||||
// Create Accordion button
|
||||
const accordionButton = document.createElement('button');
|
||||
accordionButton.setAttribute('aria-expanded', !!tab.hasAttribute('active'));
|
||||
accordionButton.setAttribute('aria-controls', tab.id);
|
||||
accordionButton.setAttribute('type', 'button');
|
||||
accordionButton.innerHTML = `<span class="accordion-title">${tab.getAttribute('name')}<span class="accordion-icon"></span></span>`;
|
||||
tab.insertAdjacentElement('beforebegin', accordionButton);
|
||||
|
||||
if (this.view === 'tabs') {
|
||||
accordionButton.setAttribute('hidden', '');
|
||||
}
|
||||
|
||||
accordionButton.addEventListener('click', this.activateTab);
|
||||
|
||||
// Create tab button
|
||||
const tabButton = document.createElement('button');
|
||||
tabButton.setAttribute('aria-expanded', !!tab.hasAttribute('active'));
|
||||
tabButton.setAttribute('aria-controls', tab.id);
|
||||
tabButton.setAttribute('role', 'tab');
|
||||
tabButton.setAttribute('type', 'button');
|
||||
tabButton.innerHTML = `${tab.getAttribute('name')}`;
|
||||
if (tabs.length - 1 === index) {
|
||||
// last
|
||||
this.tabButtonContainer.appendChild(tabButton);
|
||||
this.tabs.push({
|
||||
tab,
|
||||
tabButton,
|
||||
accordionButton,
|
||||
});
|
||||
} else if (index === 0) {
|
||||
// first
|
||||
this.tabButtonContainer.insertAdjacentElement('afterbegin', tabButton);
|
||||
this.tabs.slice(0, 0, {
|
||||
tab,
|
||||
tabButton,
|
||||
accordionButton,
|
||||
});
|
||||
} else {
|
||||
// Middle
|
||||
this.tabs[index - 1].tabButton.insertAdjacentElement('afterend', tabButton);
|
||||
this.tabs.slice(index - 1, 0, {
|
||||
tab,
|
||||
tabButton,
|
||||
accordionButton,
|
||||
});
|
||||
}
|
||||
|
||||
tabButton.addEventListener('click', this.activateTab);
|
||||
}
|
||||
|
||||
// Remove navigation elements for removed tabs
|
||||
removeNavs(tab) {
|
||||
if ((tab instanceof Element && tab.tagName.toLowerCase() !== 'joomla-tab-element') || ![].some.call(this.children, (el) => el === tab).length || !tab.getAttribute('name') || !tab.getAttribute('id')) return;
|
||||
const accordionButton = tab.previousSilbingElement;
|
||||
if (accordionButton && accordionButton.tagName.toLowerCase() === 'button') {
|
||||
accordionButton.removeEventListener('click', this.keyBehaviour);
|
||||
accordionButton.parentNode.removeChild(accordionButton);
|
||||
}
|
||||
const tabButton = this.tabButtonContainer.querySelector(`[aria-controls=${accordionButton.id}]`);
|
||||
if (tabButton) {
|
||||
tabButton.removeEventListener('click', this.keyBehaviour);
|
||||
tabButton.parentNode.removeChild(tabButton);
|
||||
}
|
||||
const index = this.tabs.findIndex((tb) => tb.tabs === tab);
|
||||
if (index - 1 === 0) {
|
||||
this.tabs.shift();
|
||||
} else if (index - 1 === this.tabs.length) {
|
||||
this.tabs.pop();
|
||||
} else {
|
||||
this.tabs.splice(index - 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** Method to convert tabs to accordion and vice versa depending on screen size */
|
||||
checkView() {
|
||||
if (!this.breakpoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.body.getBoundingClientRect().width > this.breakpoint) {
|
||||
if (this.view === 'tabs') {
|
||||
return;
|
||||
}
|
||||
this.tabButtonContainer.removeAttribute('hidden');
|
||||
this.tabs.map((tab) => {
|
||||
tab.accordionButton.setAttribute('hidden', '');
|
||||
tab.accordionButton.setAttribute('role', 'tabpanel');
|
||||
if (tab.accordionButton.getAttribute('aria-expanded') === 'true') {
|
||||
tab.tab.setAttribute('active', '');
|
||||
}
|
||||
return tab;
|
||||
});
|
||||
this.setAttribute('view', 'tabs');
|
||||
} else {
|
||||
if (this.view === 'accordion') {
|
||||
return;
|
||||
}
|
||||
this.tabButtonContainer.setAttribute('hidden', '');
|
||||
this.tabs.map((tab) => {
|
||||
tab.accordionButton.removeAttribute('hidden');
|
||||
tab.accordionButton.setAttribute('role', 'region');
|
||||
return tab;
|
||||
});
|
||||
this.setAttribute('view', 'accordion');
|
||||
}
|
||||
}
|
||||
|
||||
getStorageKey() {
|
||||
return window.location.href.toString().split(window.location.host)[1].replace(/&return=[a-zA-Z0-9%]+/, '').split('#')[0];
|
||||
}
|
||||
|
||||
saveState(value) {
|
||||
const storageKey = this.getStorageKey();
|
||||
sessionStorage.setItem(storageKey, value);
|
||||
}
|
||||
|
||||
activateFromState() {
|
||||
this.hasNested = this.querySelector('joomla-tab') instanceof HTMLElement;
|
||||
// Use the sessionStorage state!
|
||||
const href = sessionStorage.getItem(this.getStorageKey());
|
||||
if (href) {
|
||||
const currentTabIndex = this.tabs.findIndex((tab) => tab.tab.id === href);
|
||||
|
||||
if (currentTabIndex >= 0) {
|
||||
this.activateTab(currentTabIndex, false);
|
||||
} else if (this.hasNested) {
|
||||
const childTabs = this.querySelector('joomla-tab');
|
||||
if (childTabs) {
|
||||
const activeTabs = [].slice.call(this.querySelectorAll('joomla-tab-element'))
|
||||
.reverse()
|
||||
.filter((activeTabEl) => activeTabEl.id === href);
|
||||
if (activeTabs.length) {
|
||||
// Activate the deepest tab
|
||||
let activeTab = activeTabs[0].closest('joomla-tab');
|
||||
[].slice.call(activeTab.querySelectorAll('joomla-tab-element'))
|
||||
.forEach((tabEl) => {
|
||||
tabEl.removeAttribute('active');
|
||||
if (tabEl.id === href) {
|
||||
tabEl.setAttribute('active', '');
|
||||
}
|
||||
});
|
||||
|
||||
// Activate all parent tabs
|
||||
while (activeTab.parentNode.closest('joomla-tab') !== this) {
|
||||
const parentTabContainer = activeTab.closest('joomla-tab');
|
||||
const parentTabEl = activeTab.parentNode.closest('joomla-tab-element');
|
||||
[].slice.call(parentTabContainer.querySelectorAll('joomla-tab-element'))
|
||||
// eslint-disable-next-line no-loop-func
|
||||
.forEach((tabEl) => {
|
||||
tabEl.removeAttribute('active');
|
||||
if (parentTabEl === tabEl) {
|
||||
tabEl.setAttribute('active', '');
|
||||
activeTab = parentTabEl;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[].slice.call(this.children)
|
||||
.filter((el) => el.tagName.toLowerCase() === 'joomla-tab-element')
|
||||
.forEach((tabEl) => {
|
||||
tabEl.removeAttribute('active');
|
||||
const isActiveChild = tabEl.querySelector('joomla-tab-element[active]');
|
||||
|
||||
if (isActiveChild) {
|
||||
this.activateTab(tabEl, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Method to dispatch events */
|
||||
dispatchCustomEvent(eventName, element, related) {
|
||||
const OriginalCustomEvent = new CustomEvent(eventName, { bubbles: true, cancelable: true });
|
||||
OriginalCustomEvent.relatedTarget = related;
|
||||
element.dispatchEvent(OriginalCustomEvent);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('joomla-tab', TabsElement);
|
||||
1
media/vendor/joomla-custom-elements/js/joomla-tab.min.js
vendored
Normal file
1
media/vendor/joomla-custom-elements/js/joomla-tab.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
media/vendor/joomla-custom-elements/js/joomla-tab.min.js.gz
vendored
Normal file
BIN
media/vendor/joomla-custom-elements/js/joomla-tab.min.js.gz
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user