Compare commits
598 commits
main
...
v4-dev-xmr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b51219bac | ||
|
|
ce778dd7d0 | ||
|
|
0c678f9ff4 | ||
|
|
80aefd862c | ||
|
|
2ed7504783 | ||
|
|
aeccf0e270 | ||
|
|
17521ed43a | ||
|
|
da458176f3 | ||
|
|
67c2f2c965 | ||
|
|
e7cbb59d53 | ||
|
|
dfe4810199 | ||
|
|
4e6c981f4e | ||
|
|
2e8f70f5a1 | ||
|
|
0f1069a32e | ||
|
|
f8da510367 | ||
|
|
37186db5fc | ||
|
|
6b788acf63 | ||
|
|
cafcca31ac | ||
|
|
b633c2befe | ||
|
|
4540436f3d | ||
|
|
3768b6e5b6 | ||
|
|
264a412589 | ||
|
|
1141a51789 | ||
|
|
ccee913e59 | ||
|
|
378f3939c8 | ||
|
|
bb99676a8a | ||
|
|
9fbf50c3ce | ||
|
|
984aacc32f | ||
|
|
b0e7e02ab6 | ||
|
|
fcfd2ce4b2 | ||
|
|
fca04236ad | ||
|
|
810de41bc3 | ||
|
|
307c08af42 | ||
|
|
4620b9838b | ||
|
|
d1e0610a45 | ||
|
|
f1b2ed93df | ||
|
|
4fc35bdc3c | ||
|
|
5db105e587 | ||
|
|
1897b4cd89 | ||
|
|
17bb67dd5b | ||
|
|
fbfaba5bb8 | ||
|
|
53542dc027 | ||
|
|
8e59752ee1 | ||
|
|
22168e9b15 | ||
|
|
6f58383f5a | ||
|
|
90ad4ffc82 | ||
|
|
b45b5e9e65 | ||
|
|
c9876ed15b | ||
|
|
b26768ee42 | ||
|
|
9260427a34 | ||
|
|
398ddedac7 | ||
|
|
57e045f0ab | ||
|
|
631b5d4df1 | ||
|
|
13486b8e27 | ||
|
|
aed84c9430 | ||
|
|
7eee78c517 | ||
|
|
bfb773d64b | ||
|
|
2d8c02eb10 | ||
|
|
ffa88deb85 | ||
|
|
6bc18dc113 | ||
|
|
e567b9a7ab | ||
|
|
e5b5881f8c | ||
|
|
052f72d360 | ||
|
|
764184fc43 | ||
|
|
b46f05a948 | ||
|
|
ae87f8f7ce | ||
|
|
5fd0c239bc | ||
|
|
4bdaa2604f | ||
|
|
5795e421ac | ||
|
|
d3cb97ad71 | ||
|
|
c41897ca98 | ||
|
|
6ddedbff77 | ||
|
|
4bbc32dda7 | ||
|
|
fb12b0bd6a | ||
|
|
45bf55e4ba | ||
|
|
e2e6e867f8 | ||
|
|
49d5756f01 | ||
|
|
03ec5342e0 | ||
|
|
896e444895 | ||
|
|
9e9e1e61d5 | ||
|
|
dec3d86514 | ||
|
|
43f7befe36 | ||
|
|
44d54eb578 | ||
|
|
f1acc7f1d8 | ||
|
|
b3aa3958da | ||
|
|
3063d74b86 | ||
|
|
ecf7db731f | ||
|
|
39e9cced88 | ||
|
|
30641eb346 | ||
|
|
bbfd22f924 | ||
|
|
5664e728b4 | ||
|
|
465135a0f8 | ||
|
|
f808026e5b | ||
|
|
76d4f728a0 | ||
|
|
1266103171 | ||
|
|
3f0b15cca6 | ||
|
|
76958761f2 | ||
|
|
9a094d44ef | ||
|
|
71e5b7ca2b | ||
|
|
23cf931c7f | ||
|
|
09df15cc3c | ||
|
|
1a90b8a418 | ||
|
|
35de511cb3 | ||
|
|
d8c189df59 | ||
|
|
5f1bc4a756 | ||
|
|
a7d5923470 | ||
|
|
084795db82 | ||
|
|
c0401ebfa0 | ||
|
|
d29b05c775 | ||
|
|
4b30fe622c | ||
|
|
efabff3a74 | ||
|
|
59b65a2cb8 | ||
|
|
5f3fa833c9 | ||
|
|
cec8e5ddc3 | ||
|
|
5d310db486 | ||
|
|
61b5efbaf7 | ||
|
|
a1b2071fe0 | ||
|
|
171da55628 | ||
|
|
b1ae785f40 | ||
|
|
f86149807d | ||
|
|
a716fb03f9 | ||
|
|
d9f4bcf6ff | ||
|
|
c049713382 | ||
|
|
1b48122641 | ||
|
|
5d066caace | ||
|
|
429a84ff33 | ||
|
|
91d0a65243 | ||
|
|
c437735b6c | ||
|
|
ca68277976 | ||
|
|
a03b2feff2 | ||
|
|
24572b1577 | ||
|
|
d9b4426b07 | ||
|
|
d9cccf476b | ||
|
|
b25e6d5fa9 | ||
|
|
80fc8d9f76 | ||
|
|
e0cd05019e | ||
|
|
3cd2cd25b7 | ||
|
|
6c051294aa | ||
|
|
ff1d751e36 | ||
|
|
d106b01dec | ||
|
|
f927a95b6c | ||
|
|
e45fbe7f72 | ||
|
|
16aa05752b | ||
|
|
34208778ba | ||
|
|
400364c7fd | ||
|
|
30c3cd45a2 | ||
|
|
6994dacee4 | ||
|
|
dfefd48c34 | ||
|
|
31eb108811 | ||
|
|
b31046aab3 | ||
|
|
c86b74fe88 | ||
|
|
be18957933 | ||
|
|
8acd7c9fbe | ||
|
|
b0a0c56788 | ||
|
|
ab0aec397e | ||
|
|
63b8a6ffdd | ||
|
|
7539cfb29c | ||
|
|
dc2f1e68cd | ||
|
|
1bd1d78a78 | ||
|
|
3be585990c | ||
|
|
1c37a2ba77 | ||
|
|
39282bcc9d | ||
|
|
5f2480a90a | ||
|
|
c0aa405632 | ||
|
|
e6ab4ad86a | ||
|
|
af4419b723 | ||
|
|
f083759d03 | ||
|
|
89dc9750ec | ||
|
|
e0f89dc90b | ||
|
|
30d375b33f | ||
|
|
6879a3c51d | ||
|
|
d44a1e105e | ||
|
|
81d3e2b917 | ||
|
|
1abe9264aa | ||
|
|
f530ab7549 | ||
|
|
0ec2ce44b4 | ||
|
|
cc49a5b506 | ||
|
|
99013a5c54 | ||
|
|
38bcf108c9 | ||
|
|
f40e1b651b | ||
|
|
ad8d3a6c54 | ||
|
|
9a6cfeb36e | ||
|
|
ea01c29294 | ||
|
|
234dd96abf | ||
|
|
c49b084158 | ||
|
|
b2ef98f154 | ||
|
|
04dbb6c24c | ||
|
|
5a9fc2938c | ||
|
|
c995886c0f | ||
|
|
9b241e630c | ||
|
|
920dc619a4 | ||
|
|
f6b74b8b41 | ||
|
|
2e991732de | ||
|
|
2314247825 | ||
|
|
3349eb6a41 | ||
|
|
6c04d186e2 | ||
|
|
7de8582657 | ||
|
|
242f75cd1f | ||
|
|
78a51cb12f | ||
|
|
89be07b51f | ||
|
|
4f44a2afd0 | ||
|
|
7b5e48d307 | ||
|
|
c3572ceca9 | ||
|
|
7c6a0db820 | ||
|
|
5b8163301c | ||
|
|
e9f039d1fe | ||
|
|
ba6d5e802b | ||
|
|
8429acf460 | ||
|
|
3caea1ca02 | ||
|
|
7ac763bcdc | ||
|
|
8bc6dcd280 | ||
|
|
288b9b82b5 | ||
|
|
ac3c2e2356 | ||
|
|
24d5a1e996 | ||
|
|
35310454b1 | ||
|
|
7a9bbd4489 | ||
|
|
fdb596b2c3 | ||
|
|
ce23903a76 | ||
|
|
ac48bbe081 | ||
|
|
f4a7888af5 | ||
|
|
4e685e70b7 | ||
|
|
b287736327 | ||
|
|
6f4d9fff02 | ||
|
|
daa01aacb5 | ||
|
|
58dd4cc66c | ||
|
|
a8eb919f44 | ||
|
|
700c6036aa | ||
|
|
7a6da5e3e7 | ||
|
|
109ad5db90 | ||
|
|
4a0ddb02db | ||
|
|
0f26be5ff3 | ||
|
|
842b0d2ae4 | ||
|
|
32932d27d5 | ||
|
|
4a26e51540 | ||
|
|
0f3eda8254 | ||
|
|
30e7df6cca | ||
|
|
f1827ce9cd | ||
|
|
eb1df3e079 | ||
|
|
df91d2cab0 | ||
|
|
d2f9fbd055 | ||
|
|
bad48dc3b9 | ||
|
|
86f2c01459 | ||
|
|
955c437f32 | ||
|
|
eb720f20ff | ||
|
|
53eace04df | ||
|
|
1c9e203c52 | ||
|
|
5f79b75ea8 | ||
|
|
195585f5a6 | ||
|
|
fa8a7eca06 | ||
|
|
52fdab8d70 | ||
|
|
b3601aae5b | ||
|
|
456194da11 | ||
|
|
fb4c8eacb0 | ||
|
|
5d10e4a58e | ||
|
|
fce3370843 | ||
|
|
345d68cdbb | ||
|
|
a1d8ed4413 | ||
|
|
4111242cbb | ||
|
|
e82888daf4 | ||
|
|
015aaf3c3d | ||
|
|
22f75ca2e3 | ||
|
|
5f267b1854 | ||
|
|
0f6cb9139f | ||
|
|
f3aed77dc7 | ||
|
|
d8691fcd5a | ||
|
|
566c829a1c | ||
|
|
e51a09a2b8 | ||
|
|
8876866399 | ||
|
|
d63b651f37 | ||
|
|
1fef25b777 | ||
|
|
63dbe4705d | ||
|
|
5f00bba652 | ||
|
|
c06a1f305d | ||
|
|
1b16736a72 | ||
|
|
ec637483f2 | ||
|
|
971738b4b5 | ||
|
|
33f47771ca | ||
|
|
6d9256d2b1 | ||
|
|
f93e58eddb | ||
|
|
e344ed4446 | ||
|
|
f79d14f7c8 | ||
|
|
748b1b9a5a | ||
|
|
5ecccd1171 | ||
|
|
92fe8445b1 | ||
|
|
9c7ee5e554 | ||
|
|
f5c7da4c78 | ||
|
|
7a678fc64f | ||
|
|
a66d9a3d50 | ||
|
|
9d0097013a | ||
|
|
4853c5b527 | ||
|
|
c4355e4a6b | ||
|
|
0321c632ed | ||
|
|
e33e344410 | ||
|
|
9f7fc4ac2b | ||
|
|
f5ec0dbf74 | ||
|
|
d848c32297 | ||
|
|
05cfefd32b | ||
|
|
04b8219c18 | ||
|
|
341ad62517 | ||
|
|
5053725870 | ||
|
|
04c1ecd79d | ||
|
|
abc17a4858 | ||
|
|
4d863effdb | ||
|
|
5455e30048 | ||
|
|
c1a75a7d8f | ||
|
|
adb08ca33a | ||
|
|
5f15f8cdbd | ||
|
|
6edeaa4291 | ||
|
|
fe9384c216 | ||
|
|
ddc58343d3 | ||
|
|
706bd3602d | ||
|
|
0cf29baf63 | ||
|
|
8cc9defbc0 | ||
|
|
1b575c27cd | ||
|
|
f7ed579d91 | ||
|
|
0225c1173b | ||
|
|
467c961976 | ||
|
|
b30c68f8a1 | ||
|
|
573c10f099 | ||
|
|
effe4e9588 | ||
|
|
dabd458b4b | ||
|
|
0c8d8a48e1 | ||
|
|
03fec36b44 | ||
|
|
138e8da421 | ||
|
|
45c99f7130 | ||
|
|
8b6dd449d7 | ||
|
|
ac5685d368 | ||
|
|
81e8f52fcb | ||
|
|
d65977a991 | ||
|
|
90fef3086d | ||
|
|
9b71d9817d | ||
|
|
3b5283602c | ||
|
|
cc3ca2586f | ||
|
|
906a5de548 | ||
|
|
61276d0881 | ||
|
|
0ca1ec6fc3 | ||
|
|
f852dff122 | ||
|
|
efb3fc402e | ||
|
|
81ba76bb3c | ||
|
|
39ac525f6e | ||
|
|
fa7510c6af | ||
|
|
69f36286f9 | ||
|
|
52c13233a3 | ||
|
|
642d1001e3 | ||
|
|
473d36ff38 | ||
|
|
4a7cbd5b9f | ||
|
|
c40b71318c | ||
|
|
037bad148c | ||
|
|
0bd57ce212 | ||
|
|
8c4b61e30c | ||
|
|
c77ec4fb06 | ||
|
|
4ea685a001 | ||
|
|
0d35f10842 | ||
|
|
6daae47cc0 | ||
|
|
0f0a8c364d | ||
|
|
7ca811315f | ||
|
|
1884b8a421 | ||
|
|
92525e9ec4 | ||
|
|
6c46493803 | ||
|
|
f737c73a27 | ||
|
|
411922b14d | ||
|
|
21041eecb7 | ||
|
|
fbf294a605 | ||
|
|
0d1aee6a2f | ||
|
|
3c0cf9365b | ||
|
|
0e09c6b831 | ||
|
|
80d842b501 | ||
|
|
55945dcc36 | ||
|
|
42714733b6 | ||
|
|
35d5cbf4fd | ||
|
|
0d08c74d2f | ||
|
|
00b0e0a9b7 | ||
|
|
16a82e7e99 | ||
|
|
e2530bf312 | ||
|
|
2d54fa9c3f | ||
|
|
97e2e0da7c | ||
|
|
b77af55325 | ||
|
|
52aceee0ab | ||
|
|
70de5e8398 | ||
|
|
52762f83d8 | ||
|
|
dca1ab7d87 | ||
|
|
b07b6f743c | ||
|
|
0d148d8854 | ||
|
|
c24aaa6cbf | ||
|
|
301ee1972d | ||
|
|
593574d510 | ||
|
|
d61bba584f | ||
|
|
7aa1722a97 | ||
|
|
340009e6de | ||
|
|
bdd8752994 | ||
|
|
e0a2d5890d | ||
|
|
136afcf59b | ||
|
|
eb1e1cfb49 | ||
|
|
5be0fe8820 | ||
|
|
a0bb417691 | ||
|
|
590c1baeeb | ||
|
|
f12ae8cea2 | ||
|
|
6b7ca1234b | ||
|
|
0aa6a81c11 | ||
|
|
7629daedc1 | ||
|
|
dd96b832f7 | ||
|
|
29f585365f | ||
|
|
f55566e36b | ||
|
|
7ecfa6a343 | ||
|
|
7453733ff6 | ||
|
|
dd6b8682a6 | ||
|
|
8e935b60c8 | ||
|
|
9be7aac831 | ||
|
|
f830450ca8 | ||
|
|
b0b8d3c982 | ||
|
|
90d4b72e06 | ||
|
|
ea1d09c444 | ||
|
|
7bd70e54f2 | ||
|
|
ed4a4e6081 | ||
|
|
087d0ea1e1 | ||
|
|
8cf6c209d8 | ||
|
|
db19e8c706 | ||
|
|
510a446be6 | ||
|
|
327bfca418 | ||
|
|
be452a0ed3 | ||
|
|
23a78f0ab1 | ||
|
|
6c9640c245 | ||
|
|
1260b4fb3f | ||
|
|
d521e147f9 | ||
|
|
f47243460e | ||
|
|
91a9fd96b9 | ||
|
|
5e304b60a1 | ||
|
|
4c74d58f26 | ||
|
|
cd64a164f1 | ||
|
|
1f2b048312 | ||
|
|
caf889e49e | ||
|
|
b5ba078b12 | ||
|
|
cdfba0be4a | ||
|
|
61cc86d68d | ||
|
|
846b603413 | ||
|
|
791b1943f2 | ||
|
|
8741eed7a5 | ||
|
|
afc9cae32c | ||
|
|
d08567797f | ||
|
|
acb2b7061c | ||
|
|
9ed860ef24 | ||
|
|
28758a03f0 | ||
|
|
f732bf025a | ||
|
|
68ddcec057 | ||
|
|
6d5739320e | ||
|
|
5d39e36083 | ||
|
|
269e5351aa | ||
|
|
ef1c7aadbc | ||
|
|
dd181e91bd | ||
|
|
bab999701c | ||
|
|
41b8ce278b | ||
|
|
de94f6003f | ||
|
|
3a3b0a4eae | ||
|
|
c4e5aa0d32 | ||
|
|
7652d326e4 | ||
|
|
6381c63fb1 | ||
|
|
9e1ef5623f | ||
|
|
9519b9e055 | ||
|
|
94395af932 | ||
|
|
81d5e6eb1b | ||
|
|
38d055e7fb | ||
|
|
727c1684bb | ||
|
|
e538b9f23e | ||
|
|
116da0b746 | ||
|
|
c387223720 | ||
|
|
81fa902454 | ||
|
|
d55f6c3073 | ||
|
|
e5a3ee5e9c | ||
|
|
3695c3a1fb | ||
|
|
2892675f65 | ||
|
|
9abaafa546 | ||
|
|
c93fdec2f0 | ||
|
|
8c3a1298f7 | ||
|
|
fb6266a8df | ||
|
|
96d4a64944 | ||
|
|
cf07b5a7ab | ||
|
|
f6b00cda24 | ||
|
|
af0786b10f | ||
|
|
d5266dc995 | ||
|
|
397359154c | ||
|
|
cd58245f10 | ||
|
|
e4d4c5d0bc | ||
|
|
8f95b26d65 | ||
|
|
e1cd51e4fb | ||
|
|
dcdd9be0b3 | ||
|
|
48e86c5796 | ||
|
|
d59aa2c702 | ||
|
|
22f6a4beea | ||
|
|
470adc3f16 | ||
|
|
e01103e3f9 | ||
|
|
9322cc83bc | ||
|
|
0f376c1107 | ||
|
|
b66abdf3b1 | ||
|
|
1bee3c03cf | ||
|
|
a2a38058af | ||
|
|
41fd25abe1 | ||
|
|
f233e05acc | ||
|
|
eeea633150 | ||
|
|
a5d280365b | ||
|
|
c26e68427c | ||
|
|
68ab243ffa | ||
|
|
cac30c0722 | ||
|
|
def8173e7b | ||
|
|
921f17a650 | ||
|
|
636204974b | ||
|
|
c6cbae6b2a | ||
|
|
4e4a1febb0 | ||
|
|
f2185b9b5f | ||
|
|
a894ea3a51 | ||
|
|
0ad0985ac0 | ||
|
|
d361194a99 | ||
|
|
3d72b94ee9 | ||
|
|
d395dfaafc | ||
|
|
e61d609bc0 | ||
|
|
23d7dd6dbd | ||
|
|
be80d26cdb | ||
|
|
22f6b373f9 | ||
|
|
a92f838c8d | ||
|
|
e76fce5852 | ||
|
|
c121778b49 | ||
|
|
4376d92ea7 | ||
|
|
de163b337c | ||
|
|
5f44e01dab | ||
|
|
1c5e1cb3c9 | ||
|
|
b165aff2f7 | ||
|
|
1bdeab8159 | ||
|
|
1da3aa3103 | ||
|
|
6587e5cf80 | ||
|
|
6c9f833a90 | ||
|
|
24abed1336 | ||
|
|
5bf876cb0f | ||
|
|
911b72cf78 | ||
|
|
e0d0f5a1c6 | ||
|
|
5baad13902 | ||
|
|
d9a8b8ea80 | ||
|
|
1161bff6eb | ||
|
|
a84a05a56a | ||
|
|
9d075734cb | ||
|
|
9508c4c11b | ||
|
|
01a71532d9 | ||
|
|
621391255b | ||
|
|
c6dd1a7d93 | ||
|
|
fe777292b5 | ||
|
|
67be130c7b | ||
|
|
be7198a05b | ||
|
|
f72d2511ba | ||
|
|
4251c23f71 | ||
|
|
fc745a3ec8 | ||
|
|
e9d8c1a9dd | ||
|
|
36ea7e7421 | ||
|
|
aa7b055064 | ||
|
|
add38103ad | ||
|
|
5c65ea6a38 | ||
|
|
27287a6884 | ||
|
|
cc5292f510 | ||
|
|
7da9729a62 | ||
|
|
605704d7f5 | ||
|
|
68932330f0 | ||
|
|
78f47133e9 | ||
|
|
c50c1e9d23 | ||
|
|
10f91729aa | ||
|
|
57ff6ee9ef | ||
|
|
77973cd7fb | ||
|
|
41eea9edc4 | ||
|
|
060880296a | ||
|
|
1c7cb61072 | ||
|
|
3bf08d87c9 | ||
|
|
8fda884ad3 | ||
|
|
c0b2f72a06 | ||
|
|
12532dc913 | ||
|
|
3ab0441667 | ||
|
|
60f31b32f8 | ||
|
|
77212386c0 | ||
|
|
e34ba3532f | ||
|
|
72a1437dae | ||
|
|
413c313644 | ||
|
|
c9159ccf05 | ||
|
|
9ba80d31d4 | ||
|
|
86a97d197e | ||
|
|
87527d8149 | ||
|
|
be8ef5f655 | ||
|
|
86de1d3875 | ||
|
|
dad0765ed3 | ||
|
|
f2b9055c2b | ||
|
|
a5179125b0 | ||
|
|
1a8886b7f7 | ||
|
|
ba641ae507 | ||
|
|
11c40217cf | ||
|
|
3b6c5ee620 | ||
|
|
d30039c1a9 | ||
|
|
a46866c950 | ||
|
|
146cfa21a3 | ||
|
|
5e9fd345da | ||
|
|
b2e9341b8c | ||
|
|
58a1c6ef92 | ||
|
|
fad6dda456 | ||
|
|
60ba89b9a7 | ||
|
|
8d109b62ba |
514 changed files with 22131 additions and 18777 deletions
|
|
@ -1,17 +1,14 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/env',
|
'@babel/preset-env',
|
||||||
{
|
{
|
||||||
loose: true,
|
loose: true,
|
||||||
modules: false,
|
bugfixes: true,
|
||||||
exclude: ['transform-typeof-symbol']
|
modules: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
plugins: [
|
|
||||||
'@babel/plugin-proposal-object-rest-spread'
|
|
||||||
],
|
|
||||||
env: {
|
env: {
|
||||||
test: {
|
test: {
|
||||||
plugins: [ 'istanbul' ]
|
plugins: [ 'istanbul' ]
|
||||||
|
|
|
||||||
50
.bundlewatch.config.json
Normal file
50
.bundlewatch.config.json
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-grid.css",
|
||||||
|
"maxSize": "7 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-grid.min.css",
|
||||||
|
"maxSize": "6.25 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-reboot.css",
|
||||||
|
"maxSize": "2 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap-reboot.min.css",
|
||||||
|
"maxSize": "2 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap.css",
|
||||||
|
"maxSize": "25.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/css/bootstrap.min.css",
|
||||||
|
"maxSize": "23.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.bundle.js",
|
||||||
|
"maxSize": "48 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.bundle.min.js",
|
||||||
|
"maxSize": "21.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.js",
|
||||||
|
"maxSize": "25.5 kB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./dist/js/bootstrap.min.js",
|
||||||
|
"maxSize": "14.75 kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ci": {
|
||||||
|
"trackBranches": [
|
||||||
|
"main",
|
||||||
|
"v4-dev"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
**/vendor/
|
**/vendor/
|
||||||
/_gh_pages/
|
/_gh_pages/
|
||||||
/js/coverage/
|
/js/coverage/
|
||||||
/package.js
|
/site/static/sw.js
|
||||||
|
|
|
||||||
280
.eslintrc.json
280
.eslintrc.json
|
|
@ -1,233 +1,63 @@
|
||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"parser": "babel-eslint",
|
"extends": [
|
||||||
"env": {
|
"plugin:import/errors",
|
||||||
"browser": true,
|
"plugin:import/warnings",
|
||||||
"es6": true
|
"plugin:unicorn/recommended",
|
||||||
},
|
"xo/esnext",
|
||||||
"extends": ["eslint:recommended"],
|
"xo/browser"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
// Possible Errors
|
|
||||||
"no-await-in-loop": "error",
|
|
||||||
"no-extra-parens": "error",
|
|
||||||
"no-prototype-builtins": "error",
|
|
||||||
"no-template-curly-in-string": "error",
|
|
||||||
"valid-jsdoc": "error",
|
|
||||||
|
|
||||||
// Best Practices
|
|
||||||
"accessor-pairs": "error",
|
|
||||||
"array-callback-return": "error",
|
|
||||||
"block-scoped-var": "error",
|
|
||||||
"class-methods-use-this": "off",
|
|
||||||
"complexity": "error",
|
|
||||||
"consistent-return": "error",
|
|
||||||
"curly": "error",
|
|
||||||
"default-case": "error",
|
|
||||||
"dot-location": ["error", "property"],
|
|
||||||
"dot-notation": "error",
|
|
||||||
"eqeqeq": "error",
|
|
||||||
"guard-for-in": "error",
|
|
||||||
"no-alert": "error",
|
|
||||||
"no-caller": "error",
|
|
||||||
"no-div-regex": "error",
|
|
||||||
"no-else-return": "error",
|
|
||||||
"no-empty-function": "error",
|
|
||||||
"no-eq-null": "error",
|
|
||||||
"no-eval": "error",
|
|
||||||
"no-extend-native": "error",
|
|
||||||
"no-extra-bind": "error",
|
|
||||||
"no-extra-label": "error",
|
|
||||||
"no-floating-decimal": "error",
|
|
||||||
"no-implicit-coercion": "error",
|
|
||||||
"no-implicit-globals": "error",
|
|
||||||
"no-implied-eval": "error",
|
|
||||||
"no-invalid-this": "off",
|
|
||||||
"no-iterator": "error",
|
|
||||||
"no-labels": "error",
|
|
||||||
"no-lone-blocks": "error",
|
|
||||||
"no-loop-func": "error",
|
|
||||||
"no-magic-numbers": ["error", {
|
|
||||||
"ignore": [-1, 0, 1],
|
|
||||||
"ignoreArrayIndexes": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-multi-spaces": ["error", {
|
|
||||||
"ignoreEOLComments": true,
|
|
||||||
"exceptions": {
|
|
||||||
"AssignmentExpression": true,
|
|
||||||
"ArrowFunctionExpression": true,
|
|
||||||
"CallExpression": true,
|
|
||||||
"VariableDeclarator": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-multi-str": "error",
|
|
||||||
"no-new": "error",
|
|
||||||
"no-new-func": "error",
|
|
||||||
"no-new-wrappers": "error",
|
|
||||||
"no-octal-escape": "error",
|
|
||||||
"no-param-reassign": "off",
|
|
||||||
"no-proto": "error",
|
|
||||||
"no-restricted-properties": "error",
|
|
||||||
"no-return-assign": "error",
|
|
||||||
"no-return-await": "error",
|
|
||||||
"no-script-url": "error",
|
|
||||||
"no-self-compare": "error",
|
|
||||||
"no-sequences": "error",
|
|
||||||
"no-throw-literal": "error",
|
|
||||||
"no-unmodified-loop-condition": "error",
|
|
||||||
"no-unused-expressions": "error",
|
|
||||||
"no-useless-call": "error",
|
|
||||||
"no-useless-concat": "error",
|
|
||||||
"no-useless-return": "error",
|
|
||||||
"no-void": "error",
|
|
||||||
"no-warning-comments": "off",
|
|
||||||
"no-with": "error",
|
|
||||||
"prefer-promise-reject-errors": "error",
|
|
||||||
"radix": "error",
|
|
||||||
"require-await": "error",
|
|
||||||
"vars-on-top": "error",
|
|
||||||
"wrap-iife": "error",
|
|
||||||
"yoda": "error",
|
|
||||||
|
|
||||||
// Strict Mode
|
|
||||||
"strict": "error",
|
|
||||||
|
|
||||||
// Variables
|
|
||||||
"init-declarations": "off",
|
|
||||||
"no-catch-shadow": "error",
|
|
||||||
"no-label-var": "error",
|
|
||||||
"no-restricted-globals": "error",
|
|
||||||
"no-shadow": "off",
|
|
||||||
"no-shadow-restricted-names": "error",
|
|
||||||
"no-undef-init": "error",
|
|
||||||
"no-undefined": "error",
|
|
||||||
"no-use-before-define": "off",
|
|
||||||
|
|
||||||
// Node.js and CommonJS
|
|
||||||
"callback-return": "off",
|
|
||||||
"global-require": "error",
|
|
||||||
"handle-callback-err": "error",
|
|
||||||
"no-mixed-requires": "error",
|
|
||||||
"no-new-require": "error",
|
|
||||||
"no-path-concat": "error",
|
|
||||||
"no-process-env": "error",
|
|
||||||
"no-process-exit": "error",
|
|
||||||
"no-restricted-modules": "error",
|
|
||||||
"no-sync": "error",
|
|
||||||
|
|
||||||
// Stylistic Issues
|
|
||||||
"array-bracket-spacing": "error",
|
|
||||||
"block-spacing": "error",
|
|
||||||
"brace-style": "error",
|
|
||||||
"camelcase": "error",
|
|
||||||
"capitalized-comments": "off",
|
"capitalized-comments": "off",
|
||||||
"comma-dangle": "error",
|
"indent": [
|
||||||
"comma-spacing": "error",
|
"error",
|
||||||
"comma-style": "error",
|
2,
|
||||||
"computed-property-spacing": "error",
|
{
|
||||||
"consistent-this": "error",
|
"MemberExpression": "off",
|
||||||
"eol-last": "error",
|
"SwitchCase": 1
|
||||||
"func-call-spacing": "error",
|
}
|
||||||
"func-name-matching": "error",
|
],
|
||||||
"func-names": "off",
|
"max-params": [
|
||||||
"func-style": ["error", "declaration"],
|
"warn",
|
||||||
"id-blacklist": "error",
|
5
|
||||||
"id-length": "off",
|
],
|
||||||
"id-match": "error",
|
"new-cap": [
|
||||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
"error",
|
||||||
"jsx-quotes": "error",
|
{
|
||||||
"key-spacing": "off",
|
"properties": false
|
||||||
"keyword-spacing": "error",
|
}
|
||||||
"linebreak-style": ["error", "unix"],
|
],
|
||||||
"line-comment-position": "off",
|
"no-console": "error",
|
||||||
"lines-around-comment": "off",
|
|
||||||
"lines-around-directive": "error",
|
|
||||||
"max-depth": ["error", 10],
|
|
||||||
"max-len": "off",
|
|
||||||
"max-lines": "off",
|
|
||||||
"max-nested-callbacks": "error",
|
|
||||||
"max-params": "off",
|
|
||||||
"max-statements": "off",
|
|
||||||
"max-statements-per-line": "error",
|
|
||||||
"multiline-ternary": "off",
|
|
||||||
"new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }],
|
|
||||||
"newline-after-var": "off",
|
|
||||||
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
|
|
||||||
"new-parens": "error",
|
|
||||||
"no-array-constructor": "error",
|
|
||||||
"no-bitwise": "error",
|
|
||||||
"no-continue": "off",
|
|
||||||
"no-inline-comments": "off",
|
|
||||||
"no-lonely-if": "error",
|
|
||||||
"no-mixed-operators": "off",
|
"no-mixed-operators": "off",
|
||||||
"no-multi-assign": "error",
|
|
||||||
"no-multiple-empty-lines": "error",
|
|
||||||
"nonblock-statement-body-position": "error",
|
|
||||||
"no-negated-condition": "off",
|
"no-negated-condition": "off",
|
||||||
"no-nested-ternary": "error",
|
"object-curly-spacing": [
|
||||||
"no-new-object": "error",
|
"error",
|
||||||
"no-plusplus": "off",
|
"always"
|
||||||
"no-restricted-syntax": "error",
|
],
|
||||||
"no-tabs": "error",
|
"prefer-named-capture-group": "off",
|
||||||
"no-ternary": "off",
|
"semi": [
|
||||||
"no-trailing-spaces": "error",
|
"error",
|
||||||
"no-underscore-dangle": "off",
|
"never"
|
||||||
"no-unneeded-ternary": "error",
|
],
|
||||||
"no-whitespace-before-property": "error",
|
"unicorn/consistent-function-scoping": "off",
|
||||||
"object-curly-newline": ["error", { "minProperties": 1 }],
|
"unicorn/explicit-length-check": "off",
|
||||||
"object-curly-spacing": ["error", "always"],
|
"unicorn/import-index": "off",
|
||||||
"object-property-newline": "error",
|
"unicorn/no-array-callback-reference": "off",
|
||||||
"one-var": ["error", "never"],
|
"unicorn/no-for-loop": "off",
|
||||||
"one-var-declaration-per-line": "error",
|
"unicorn/no-null": "off",
|
||||||
"operator-assignment": "error",
|
"unicorn/no-unused-properties": "error",
|
||||||
"operator-linebreak": "error",
|
"unicorn/no-useless-undefined": "off",
|
||||||
"padded-blocks": ["error", "never"],
|
"unicorn/prefer-array-find": "off",
|
||||||
"padding-line-between-statements": "off",
|
"unicorn/prefer-dom-node-dataset": "off",
|
||||||
"quote-props": ["error", "as-needed"],
|
"unicorn/prefer-includes": "off",
|
||||||
"quotes": ["error", "single"],
|
"unicorn/prefer-math-trunc": "off",
|
||||||
"require-jsdoc": "off",
|
"unicorn/prefer-dom-node-append": "off",
|
||||||
"semi": ["error", "never"],
|
"unicorn/prefer-dom-node-remove": "off",
|
||||||
"semi-spacing": "error",
|
"unicorn/prefer-number-properties": "off",
|
||||||
"sort-keys": "off",
|
"unicorn/prefer-optional-catch-binding": "off",
|
||||||
"sort-vars": "error",
|
"unicorn/prefer-query-selector": "off",
|
||||||
"space-before-blocks": "error",
|
"unicorn/prefer-reflect-apply": "off",
|
||||||
"space-before-function-paren": ["error", {
|
"unicorn/prefer-set-has": "off",
|
||||||
"anonymous": "always",
|
"unicorn/prevent-abbreviations": "off"
|
||||||
"named": "never"
|
|
||||||
}],
|
|
||||||
"space-in-parens": "error",
|
|
||||||
"space-infix-ops": "error",
|
|
||||||
"space-unary-ops": "error",
|
|
||||||
"spaced-comment": "error",
|
|
||||||
"template-tag-spacing": "error",
|
|
||||||
"unicode-bom": "error",
|
|
||||||
"wrap-regex": "off",
|
|
||||||
|
|
||||||
// ECMAScript 6
|
|
||||||
"arrow-body-style": ["error", "as-needed"],
|
|
||||||
"arrow-parens": "error",
|
|
||||||
"arrow-spacing": "error",
|
|
||||||
"generator-star-spacing": "error",
|
|
||||||
"no-confusing-arrow": "error",
|
|
||||||
"no-duplicate-imports": "error",
|
|
||||||
"no-restricted-imports": "error",
|
|
||||||
"no-useless-computed-key": "error",
|
|
||||||
"no-useless-constructor": "error",
|
|
||||||
"no-useless-rename": "error",
|
|
||||||
"no-var": "error",
|
|
||||||
"object-shorthand": "error",
|
|
||||||
"prefer-arrow-callback": "error",
|
|
||||||
"prefer-const": "error",
|
|
||||||
"prefer-destructuring": "off",
|
|
||||||
"prefer-numeric-literals": "error",
|
|
||||||
"prefer-rest-params": "error",
|
|
||||||
"prefer-spread": "error",
|
|
||||||
"prefer-template": "error",
|
|
||||||
"rest-spread-spacing": "error",
|
|
||||||
"sort-imports": "error",
|
|
||||||
"symbol-description": "error",
|
|
||||||
"template-curly-spacing": "error",
|
|
||||||
"yield-star-spacing": "error"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
.gitattributes
vendored
14
.gitattributes
vendored
|
|
@ -1,18 +1,8 @@
|
||||||
# Enforce Unix newlines
|
# Enforce Unix newlines
|
||||||
*.css text eol=lf
|
* text=auto eol=lf
|
||||||
*.html text eol=lf
|
|
||||||
*.js text eol=lf
|
|
||||||
*.json text eol=lf
|
|
||||||
*.md text eol=lf
|
|
||||||
*.rb text eol=lf
|
|
||||||
*.scss text eol=lf
|
|
||||||
*.svg text eol=lf
|
|
||||||
*.txt text eol=lf
|
|
||||||
*.xml text eol=lf
|
|
||||||
*.yml text eol=lf
|
|
||||||
|
|
||||||
# Don't diff or textually merge source maps
|
# Don't diff or textually merge source maps
|
||||||
*.map binary
|
*.map binary
|
||||||
|
|
||||||
bootstrap.css linguist-vendored=false
|
bootstrap.css linguist-vendored=false
|
||||||
bootstrap.js linguist-vendored=false
|
bootstrap.js linguist-vendored=false
|
||||||
|
|
|
||||||
62
.github/CONTRIBUTING.md
vendored
62
.github/CONTRIBUTING.md
vendored
|
|
@ -19,7 +19,8 @@ and [submitting pull requests](#pull-requests), but please respect the following
|
||||||
restrictions:
|
restrictions:
|
||||||
|
|
||||||
* Please **do not** use the issue tracker for personal support requests. Stack
|
* Please **do not** use the issue tracker for personal support requests. Stack
|
||||||
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag), [Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
|
Overflow ([`bootstrap-4`](https://stackoverflow.com/questions/tagged/bootstrap-4) tag),
|
||||||
|
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
|
||||||
|
|
||||||
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||||
respect the opinions of others.
|
respect the opinions of others.
|
||||||
|
|
@ -57,15 +58,14 @@ Good bug reports are extremely helpful, so thanks!
|
||||||
|
|
||||||
Guidelines for bug reports:
|
Guidelines for bug reports:
|
||||||
|
|
||||||
0. **Validate and lint your code** — [validate your HTML](https://html5.validator.nu/)
|
0. **[validate your HTML](https://html5.validator.nu/)** to ensure your
|
||||||
and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
|
|
||||||
problem isn't caused by a simple error in your own code.
|
problem isn't caused by a simple error in your own code.
|
||||||
|
|
||||||
1. **Use the GitHub issue search** — check if the issue has already been
|
1. **Use the GitHub issue search** — check if the issue has already been
|
||||||
reported.
|
reported.
|
||||||
|
|
||||||
2. **Check if the issue has been fixed** — try to reproduce it using the
|
2. **Check if the issue has been fixed** — try to reproduce it using the
|
||||||
latest `master` or development branch in the repository.
|
latest `master` or `v4-dev` branch in the repository.
|
||||||
|
|
||||||
3. **Isolate the problem** — ideally create a [reduced test
|
3. **Isolate the problem** — ideally create a [reduced test
|
||||||
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
case](https://css-tricks.com/reduced-test-cases/) and a live example.
|
||||||
|
|
@ -102,16 +102,12 @@ Example:
|
||||||
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
|
Sometimes bugs reported to us are actually caused by bugs in the browser(s) themselves, not bugs in Bootstrap per se.
|
||||||
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](https://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
|
When feasible, we aim to report such upstream bugs to the relevant browser vendor(s), and then list them on our [Wall of Browser Bugs](https://getbootstrap.com/browser-bugs/) and [document them in MDN](https://developer.mozilla.org/en-US/docs/Web).
|
||||||
|
|
||||||
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
| Vendor(s) | Browser(s) | Rendering engine | Bug reporting website(s) | Notes |
|
||||||
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
| ------------- | ---------------------------- | ---------------- | ------------------------------------------------------ | -------------------------------------------------------- |
|
||||||
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
|
| Mozilla | Firefox | Gecko | https://bugzilla.mozilla.org/enter_bug.cgi | "Core" is normally the right product option to choose. |
|
||||||
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit <br> https://bugreport.apple.com/ | In Apple's bug reporter, choose "Safari" as the product. |
|
| Apple | Safari | WebKit | https://bugs.webkit.org/enter_bug.cgi?product=WebKit | In Apple's bug reporter, choose "Safari" as the product. |
|
||||||
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
|
| Google, Opera | Chrome, Chromium, Opera v15+ | Blink | https://bugs.chromium.org/p/chromium/issues/list | Click the "New issue" button. |
|
||||||
| Microsoft | Edge | EdgeHTML | https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ | |
|
| Microsoft | Edge | Blink | https://developer.microsoft.com/en-us/microsoft-edge/ | Go to "Help > Send Feedback" from the browser |
|
||||||
|
|
||||||
### Issues bots
|
|
||||||
|
|
||||||
[@twbs-lmvtfy](https://github.com/twbs-lmvtfy) is a Bootstrap bot that hangs out in our GitHub issue tracker and automatically checks for HTML validation errors in live examples (e.g. jsFiddles, JS Bins, Bootplys, Plunks, CodePens, etc.) posted in issue comments. If it finds any errors, it will post a follow-up comment on the issue and point out the errors. If this happens with an example you've posted, please fix the errors and post an updated live example. If you opened a bug report, please check whether the bug still occurs with your revised, valid live example. If the bug no longer occurs, it was probably due to your invalid HTML rather than something in Bootstrap and we'd appreciate it if you could close out the GitHub issue.
|
|
||||||
|
|
||||||
|
|
||||||
## Feature requests
|
## Feature requests
|
||||||
|
|
@ -128,23 +124,25 @@ Good pull requests—patches, improvements, new features—are a fantastic
|
||||||
help. They should remain focused in scope and avoid containing unrelated
|
help. They should remain focused in scope and avoid containing unrelated
|
||||||
commits.
|
commits.
|
||||||
|
|
||||||
**Please ask first** before embarking on any significant pull request (e.g.
|
**Please ask first** before embarking on any **significant** pull request (e.g.
|
||||||
implementing features, refactoring code, porting to a different language),
|
implementing features, refactoring code, porting to a different language),
|
||||||
otherwise you risk spending a lot of time working on something that the
|
otherwise you risk spending a lot of time working on something that the
|
||||||
project's developers might not want to merge into the project.
|
project's developers might not want to merge into the project. For trivial
|
||||||
|
things, or things that don't require a lot of your time, you can go ahead and
|
||||||
|
make a PR.
|
||||||
|
|
||||||
Please adhere to the [coding guidelines](#code-guidelines) used throughout the
|
Please adhere to the [coding guidelines](#code-guidelines) used throughout the
|
||||||
project (indentation, accurate comments, etc.) and any other requirements
|
project (indentation, accurate comments, etc.) and any other requirements
|
||||||
(such as test coverage).
|
(such as test coverage).
|
||||||
|
|
||||||
**Do not edit `bootstrap.css`, or `bootstrap.js`
|
**Do not edit `bootstrap.css` or `bootstrap.js`, and do not commit
|
||||||
directly!** Those files are automatically generated. You should edit the
|
any dist files (`dist/` or `js/dist`).** Those files are automatically generated by our build tools. You should
|
||||||
source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/master/scss)
|
edit the source files in [`/bootstrap/scss/`](https://github.com/twbs/bootstrap/tree/v4-dev/scss)
|
||||||
and/or [`/bootstrap/js/`](https://github.com/twbs/bootstrap/tree/master/js) instead.
|
and/or [`/bootstrap/js/src/`](https://github.com/twbs/bootstrap/tree/v4-dev/js/src) instead.
|
||||||
|
|
||||||
Similarly, when contributing to Bootstrap's documentation, you should edit the
|
Similarly, when contributing to Bootstrap's documentation, you should edit the
|
||||||
documentation source files in
|
documentation source files in
|
||||||
[the `/bootstrap/docs/` directory of the `master` branch](https://github.com/twbs/bootstrap/tree/master/docs).
|
[the `/bootstrap/site/content/docs/` directory of the `v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev/site/content/docs).
|
||||||
**Do not edit the `gh-pages` branch.** That branch is generated from the
|
**Do not edit the `gh-pages` branch.** That branch is generated from the
|
||||||
documentation source files and is managed separately by the Bootstrap Core Team.
|
documentation source files and is managed separately by the Bootstrap Core Team.
|
||||||
|
|
||||||
|
|
@ -166,8 +164,8 @@ included in the project:
|
||||||
2. If you cloned a while ago, get the latest changes from upstream:
|
2. If you cloned a while ago, get the latest changes from upstream:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git checkout master
|
git checkout v4-dev
|
||||||
git pull upstream master
|
git pull upstream v4-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Create a new topic branch (off the main project development branch) to
|
3. Create a new topic branch (off the main project development branch) to
|
||||||
|
|
@ -186,7 +184,7 @@ included in the project:
|
||||||
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
5. Locally merge (or rebase) the upstream development branch into your topic branch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git pull [--rebase] upstream master
|
git pull [--rebase] upstream v4-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Push your topic branch up to your fork:
|
6. Push your topic branch up to your fork:
|
||||||
|
|
@ -196,12 +194,12 @@ included in the project:
|
||||||
```
|
```
|
||||||
|
|
||||||
7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/)
|
7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/)
|
||||||
with a clear title and description against the `master` branch.
|
with a clear title and description against the `v4-dev` branch.
|
||||||
|
|
||||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
|
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
|
||||||
license your work under the terms of the [MIT License](LICENSE) (if it
|
license your work under the terms of the [MIT License](../LICENSE) (if it
|
||||||
includes code changes) and under the terms of the
|
includes code changes) and under the terms of the
|
||||||
[Creative Commons Attribution 3.0 Unported License](docs/LICENSE)
|
[Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/)
|
||||||
(if it includes documentation changes).
|
(if it includes documentation changes).
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -209,7 +207,7 @@ includes code changes) and under the terms of the
|
||||||
|
|
||||||
### HTML
|
### HTML
|
||||||
|
|
||||||
[Adhere to the Code Guide.](http://codeguide.co/#html)
|
[Adhere to the Code Guide.](https://codeguide.co/#html)
|
||||||
|
|
||||||
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
|
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags).
|
||||||
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
|
- Use CDNs and HTTPS for third-party JS when possible. We don't use protocol-relative URLs in this case because they break when viewing the page locally via `file://`.
|
||||||
|
|
@ -217,10 +215,10 @@ includes code changes) and under the terms of the
|
||||||
|
|
||||||
### CSS
|
### CSS
|
||||||
|
|
||||||
[Adhere to the Code Guide.](http://codeguide.co/#css)
|
[Adhere to the Code Guide.](https://codeguide.co/#css)
|
||||||
|
|
||||||
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
|
||||||
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://a11yproject.com/posts/never-remove-css-outlines/) for more details.
|
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details.
|
||||||
|
|
||||||
### JS
|
### JS
|
||||||
|
|
||||||
|
|
@ -237,7 +235,7 @@ Run `npm run test` before committing to ensure your changes follow our coding st
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
By contributing your code, you agree to license your contribution under the [MIT License](LICENSE).
|
By contributing your code, you agree to license your contribution under the [MIT License](../LICENSE).
|
||||||
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](docs/LICENSE).
|
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/).
|
||||||
|
|
||||||
Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.
|
Prior to v3.1.0, Bootstrap's code was released under the Apache License v2.0.
|
||||||
|
|
|
||||||
11
.github/ISSUE_TEMPLATE/bug.md
vendored
11
.github/ISSUE_TEMPLATE/bug.md
vendored
|
|
@ -1,11 +0,0 @@
|
||||||
Before opening:
|
|
||||||
|
|
||||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
|
||||||
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
|
||||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
|
||||||
|
|
||||||
Bug reports must include:
|
|
||||||
|
|
||||||
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
|
|
||||||
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
|
|
||||||
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
|
||||||
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -1,17 +1,20 @@
|
||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Tell us about a bug you may have identified in Bootstrap.
|
about: Tell us about a bug you may have identified in Bootstrap.
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Before opening:
|
Before opening:
|
||||||
|
|
||||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||||
- [Validate](https://html5.validator.nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems
|
- [Validate](https://html5.validator.nu/) any HTML to avoid common problems
|
||||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md)
|
||||||
|
|
||||||
Bug reports must include:
|
Bug reports must include:
|
||||||
|
|
||||||
- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
|
- Operating system and version (Windows, macOS, Android, iOS)
|
||||||
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
|
- Browser and version (Chrome, Firefox, Safari, Internet Explorer, Microsoft Edge, Opera, Android Browser)
|
||||||
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
- A [reduced test case](https://css-tricks.com/reduced-test-cases/) or suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
|
||||||
|
|
|
||||||
9
.github/ISSUE_TEMPLATE/feature.md
vendored
9
.github/ISSUE_TEMPLATE/feature.md
vendored
|
|
@ -1,9 +0,0 @@
|
||||||
Before opening:
|
|
||||||
|
|
||||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
|
||||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
|
||||||
|
|
||||||
Feature requests must include:
|
|
||||||
|
|
||||||
- As much detail as possible for what we should add and why it's important to Bootstrap
|
|
||||||
- Relevant links to prior art, screenshots, or live demos whenever possible
|
|
||||||
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
|
@ -1,13 +1,16 @@
|
||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for a new feature in Bootstrap.
|
about: Suggest an idea for a new feature in Bootstrap.
|
||||||
|
title: ''
|
||||||
|
labels: feature
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Before opening:
|
Before opening:
|
||||||
|
|
||||||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue)
|
||||||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md)
|
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md)
|
||||||
|
|
||||||
Feature requests must include:
|
Feature requests must include:
|
||||||
|
|
||||||
|
|
|
||||||
44
.github/workflows/browserstack.yml
vendored
Normal file
44
.github/workflows/browserstack.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
name: BrowserStack
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
browserstack:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'twbs/bootstrap' && (!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]'))
|
||||||
|
timeout-minutes: 30
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run dist
|
||||||
|
|
||||||
|
- name: Run BrowserStack tests
|
||||||
|
run: npm run js-test-cloud
|
||||||
|
env:
|
||||||
|
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
|
||||||
|
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
|
||||||
45
.github/workflows/bundlewatch.yml
vendored
Normal file
45
.github/workflows/bundlewatch.yml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
name: Bundlewatch
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bundlewatch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run dist
|
||||||
|
|
||||||
|
- name: Run bundlewatch
|
||||||
|
run: npm run bundlewatch
|
||||||
|
env:
|
||||||
|
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
|
||||||
|
CI_BRANCH_BASE: v4-dev
|
||||||
36
.github/workflows/codeql.yml
vendored
Normal file
36
.github/workflows/codeql.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v4-dev
|
||||||
|
- "!dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- v4-dev
|
||||||
|
schedule:
|
||||||
|
- cron: "0 2 * * 5"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: "javascript"
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
39
.github/workflows/css.yml
vendored
Normal file
39
.github/workflows/css.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
name: CSS
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
css:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build CSS
|
||||||
|
run: npm run css
|
||||||
30
.github/workflows/dart-sass.yml
vendored
Normal file
30
.github/workflows/dart-sass.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: CSS (Dart Sass)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
css:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Build CSS with Dart Sass
|
||||||
|
run: |
|
||||||
|
npx --package sass@latest sass --version
|
||||||
|
npx --package sass@latest sass --style expanded --source-map --embed-sources --no-error-css scss/:dist-sass/css/
|
||||||
|
ls -Al dist-sass/css
|
||||||
41
.github/workflows/docs.yml
vendored
Normal file
41
.github/workflows/docs.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
name: Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- run: java -version
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Test docs
|
||||||
|
run: npm run docs
|
||||||
54
.github/workflows/js.yml
vendored
Normal file
54
.github/workflows/js.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
name: JS Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
name: Node ${{ matrix.node }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node: [10, 12, 14]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ matrix.node }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run dist
|
||||||
|
run: npm run js
|
||||||
|
|
||||||
|
- name: Run JS tests
|
||||||
|
run: npm run js-test
|
||||||
|
|
||||||
|
- name: Run Coveralls
|
||||||
|
uses: coverallsapp/github-action@master
|
||||||
|
if: matrix.node == 14
|
||||||
|
with:
|
||||||
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
path-to-lcov: "./js/coverage/lcov.info"
|
||||||
39
.github/workflows/lint.yml
vendored
Normal file
39
.github/workflows/lint.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- "dependabot/**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_COLOR: 2
|
||||||
|
NODE: 14
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "${{ env.NODE }}"
|
||||||
|
|
||||||
|
- name: Set up npm cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
${{ runner.os }}-node-v${{ env.NODE }}-
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
12
.gitignore
vendored
12
.gitignore
vendored
|
|
@ -1,12 +1,7 @@
|
||||||
# Ignore docs files
|
# Ignore docs files
|
||||||
/_gh_pages/
|
/_gh_pages/
|
||||||
/site/.jekyll-metadata
|
# Hugo folders
|
||||||
/site/docs/**/dist/
|
/resources/
|
||||||
|
|
||||||
# Ignore ruby/bundler files
|
|
||||||
/.bundle/
|
|
||||||
/vendor/
|
|
||||||
/.ruby-version
|
|
||||||
|
|
||||||
# Numerous always-ignore extensions
|
# Numerous always-ignore extensions
|
||||||
*.diff
|
*.diff
|
||||||
|
|
@ -33,6 +28,9 @@
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
nbproject
|
nbproject
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
/.vscode/
|
||||||
|
# Local Netlify folder
|
||||||
|
.netlify
|
||||||
|
|
||||||
# Komodo
|
# Komodo
|
||||||
.komodotools
|
.komodotools
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@
|
||||||
**/dist/
|
**/dist/
|
||||||
**/vendor/
|
**/vendor/
|
||||||
/_gh_pages/
|
/_gh_pages/
|
||||||
|
/js/coverage/
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,14 @@
|
||||||
"stylelint-config-twbs-bootstrap/scss"
|
"stylelint-config-twbs-bootstrap/scss"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"property-blacklist": [
|
"declaration-property-value-disallowed-list": {
|
||||||
|
"border": "none",
|
||||||
|
"outline": "none"
|
||||||
|
},
|
||||||
|
"function-disallowed-list": [
|
||||||
|
"calc"
|
||||||
|
],
|
||||||
|
"property-disallowed-list": [
|
||||||
"border-radius",
|
"border-radius",
|
||||||
"border-top-left-radius",
|
"border-top-left-radius",
|
||||||
"border-top-right-radius",
|
"border-top-right-radius",
|
||||||
|
|
|
||||||
25
.travis.yml
25
.travis.yml
|
|
@ -1,25 +0,0 @@
|
||||||
addons:
|
|
||||||
chrome: stable
|
|
||||||
language: node_js
|
|
||||||
git:
|
|
||||||
depth: 3
|
|
||||||
node_js:
|
|
||||||
- "6"
|
|
||||||
- "8"
|
|
||||||
install:
|
|
||||||
- bundle install --deployment --jobs=3 --retry=3 --clean
|
|
||||||
- npm install
|
|
||||||
before_script:
|
|
||||||
- google-chrome-stable --product-version
|
|
||||||
script:
|
|
||||||
- npm test || travis_terminate 1
|
|
||||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" ]]; then npm run check-broken-links; fi
|
|
||||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" && "$TRAVIS_EVENT_TYPE" = "push" && ! `git log --format=%B --no-merges -n 1 | grep '\[skip browser\]'` ]]; then npm run js-test-cloud; fi
|
|
||||||
after_success:
|
|
||||||
- if [[ "$TRAVIS_NODE_VERSION" = "8" ]]; then npm run coveralls; fi
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
- vendor/bundle
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
|
|
@ -40,7 +40,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
|
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct/>
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org/
|
|
||||||
[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
|
||||||
|
|
|
||||||
9
Gemfile
9
Gemfile
|
|
@ -1,9 +0,0 @@
|
||||||
source 'https://rubygems.org'
|
|
||||||
|
|
||||||
group :development, :test do
|
|
||||||
gem 'jekyll', '~> 3.8.5'
|
|
||||||
gem 'jekyll-redirect-from', '~> 0.14.0'
|
|
||||||
gem 'jekyll-sitemap', '~> 1.2.0'
|
|
||||||
gem 'jekyll-toc', '~> 0.9.1'
|
|
||||||
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
|
|
||||||
end
|
|
||||||
82
Gemfile.lock
82
Gemfile.lock
|
|
@ -1,82 +0,0 @@
|
||||||
GEM
|
|
||||||
remote: https://rubygems.org/
|
|
||||||
specs:
|
|
||||||
addressable (2.6.0)
|
|
||||||
public_suffix (>= 2.0.2, < 4.0)
|
|
||||||
colorator (1.1.0)
|
|
||||||
concurrent-ruby (1.1.4)
|
|
||||||
em-websocket (0.5.1)
|
|
||||||
eventmachine (>= 0.12.9)
|
|
||||||
http_parser.rb (~> 0.6.0)
|
|
||||||
eventmachine (1.2.7)
|
|
||||||
eventmachine (1.2.7-x64-mingw32)
|
|
||||||
ffi (1.10.0)
|
|
||||||
ffi (1.10.0-x64-mingw32)
|
|
||||||
forwardable-extended (2.6.0)
|
|
||||||
http_parser.rb (0.6.0)
|
|
||||||
i18n (0.9.5)
|
|
||||||
concurrent-ruby (~> 1.0)
|
|
||||||
jekyll (3.8.5)
|
|
||||||
addressable (~> 2.4)
|
|
||||||
colorator (~> 1.0)
|
|
||||||
em-websocket (~> 0.5)
|
|
||||||
i18n (~> 0.7)
|
|
||||||
jekyll-sass-converter (~> 1.0)
|
|
||||||
jekyll-watch (~> 2.0)
|
|
||||||
kramdown (~> 1.14)
|
|
||||||
liquid (~> 4.0)
|
|
||||||
mercenary (~> 0.3.3)
|
|
||||||
pathutil (~> 0.9)
|
|
||||||
rouge (>= 1.7, < 4)
|
|
||||||
safe_yaml (~> 1.0)
|
|
||||||
jekyll-redirect-from (0.14.0)
|
|
||||||
jekyll (~> 3.3)
|
|
||||||
jekyll-sass-converter (1.5.2)
|
|
||||||
sass (~> 3.4)
|
|
||||||
jekyll-sitemap (1.2.0)
|
|
||||||
jekyll (~> 3.3)
|
|
||||||
jekyll-toc (0.9.1)
|
|
||||||
nokogiri (~> 1.8)
|
|
||||||
jekyll-watch (2.1.2)
|
|
||||||
listen (~> 3.0)
|
|
||||||
kramdown (1.17.0)
|
|
||||||
liquid (4.0.1)
|
|
||||||
listen (3.1.5)
|
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
|
||||||
ruby_dep (~> 1.2)
|
|
||||||
mercenary (0.3.6)
|
|
||||||
mini_portile2 (2.4.0)
|
|
||||||
nokogiri (1.10.1)
|
|
||||||
mini_portile2 (~> 2.4.0)
|
|
||||||
nokogiri (1.10.1-x64-mingw32)
|
|
||||||
mini_portile2 (~> 2.4.0)
|
|
||||||
pathutil (0.16.2)
|
|
||||||
forwardable-extended (~> 2.6)
|
|
||||||
public_suffix (3.0.3)
|
|
||||||
rb-fsevent (0.10.3)
|
|
||||||
rb-inotify (0.10.0)
|
|
||||||
ffi (~> 1.0)
|
|
||||||
rouge (3.3.0)
|
|
||||||
ruby_dep (1.5.0)
|
|
||||||
safe_yaml (1.0.4)
|
|
||||||
sass (3.7.3)
|
|
||||||
sass-listen (~> 4.0.0)
|
|
||||||
sass-listen (4.0.0)
|
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
|
||||||
wdm (0.1.1)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
x64-mingw32
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
jekyll (~> 3.8.5)
|
|
||||||
jekyll-redirect-from (~> 0.14.0)
|
|
||||||
jekyll-sitemap (~> 1.2.0)
|
|
||||||
jekyll-toc (~> 0.9.1)
|
|
||||||
wdm (~> 0.1.1)
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
1.17.3
|
|
||||||
4
LICENSE
4
LICENSE
|
|
@ -1,7 +1,7 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2011-2019 Twitter, Inc.
|
Copyright (c) 2011-2021 Twitter, Inc.
|
||||||
Copyright (c) 2011-2019 The Bootstrap Authors
|
Copyright (c) 2011-2021 The Bootstrap Authors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
85
README.md
85
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://getbootstrap.com/">
|
<a href="https://getbootstrap.com/">
|
||||||
<img src="https://getbootstrap.com/docs/4.3/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72">
|
<img src="https://getbootstrap.com/docs/4.5/assets/brand/bootstrap-solid.svg" alt="Bootstrap logo" width="72" height="72">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
|
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
|
||||||
<br>
|
<br>
|
||||||
<a href="https://getbootstrap.com/docs/4.3/"><strong>Explore Bootstrap docs »</strong></a>
|
<a href="https://getbootstrap.com/docs/4.5/"><strong>Explore Bootstrap docs »</strong></a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=bug.md">Report bug</a>
|
<a href="https://github.com/twbs/bootstrap/issues/new?template=bug_report.md">Report bug</a>
|
||||||
·
|
·
|
||||||
<a href="https://github.com/twbs/bootstrap/issues/new?template=feature.md&labels=feature">Request feature</a>
|
<a href="https://github.com/twbs/bootstrap/issues/new?template=feature_request.md">Request feature</a>
|
||||||
·
|
·
|
||||||
<a href="https://themes.getbootstrap.com/">Themes</a>
|
<a href="https://themes.getbootstrap.com/">Themes</a>
|
||||||
·
|
·
|
||||||
|
|
@ -41,33 +41,33 @@
|
||||||
|
|
||||||
Several quick start options are available:
|
Several quick start options are available:
|
||||||
|
|
||||||
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.3.1.zip)
|
- [Download the latest release.](https://github.com/twbs/bootstrap/archive/v4.5.3.zip)
|
||||||
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
|
||||||
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
|
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
|
||||||
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.3.1`
|
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@4.5.3`
|
||||||
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.3.1`
|
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:4.5.3`
|
||||||
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
|
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`
|
||||||
|
|
||||||
Read the [Getting started page](https://getbootstrap.com/docs/4.3/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
Read the [Getting started page](https://getbootstrap.com/docs/4.5/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
|
||||||
|
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
[](https://bootstrap-slack.herokuapp.com/)
|
[](https://bootstrap-slack.herokuapp.com/)
|
||||||
[](https://travis-ci.org/twbs/bootstrap)
|
[](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Av4-dev)
|
||||||
[](https://www.npmjs.com/package/bootstrap)
|
[](https://www.npmjs.com/package/bootstrap)
|
||||||
[](https://rubygems.org/gems/bootstrap)
|
[](https://rubygems.org/gems/bootstrap)
|
||||||
[](https://atmospherejs.com/twbs/bootstrap)
|
[](https://atmospherejs.com/twbs/bootstrap)
|
||||||
[](https://packagist.org/packages/twbs/bootstrap)
|
[](https://packagist.org/packages/twbs/bootstrap)
|
||||||
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
[](https://www.nuget.org/packages/bootstrap/absoluteLatest)
|
||||||
[](https://david-dm.org/twbs/bootstrap?type=peer)
|
[](https://david-dm.org/twbs/bootstrap?type=peer)
|
||||||
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
[](https://david-dm.org/twbs/bootstrap?type=dev)
|
||||||
[](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
[](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
|
||||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
|
[](https://github.com/twbs/bootstrap/blob/v4-dev/dist/css/bootstrap.min.css)
|
||||||
[](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
|
[](https://github.com/twbs/bootstrap/blob/v4-dev/dist/js/bootstrap.min.js)
|
||||||
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
|
||||||
[](#backers)
|
[](#backers)
|
||||||
[](#sponsors)
|
[](#sponsors)
|
||||||
|
|
||||||
|
|
||||||
## What's included
|
## What's included
|
||||||
|
|
@ -106,43 +106,38 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified
|
||||||
|
|
||||||
## Bugs and feature requests
|
## Bugs and feature requests
|
||||||
|
|
||||||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
|
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new).
|
||||||
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
|
Bootstrap's documentation, included in this repo in the root directory, is built with [Hugo](https://gohugo.io/) and publicly hosted on GitHub Pages at <https://getbootstrap.com/>. The docs may also be run locally.
|
||||||
|
|
||||||
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/docs/4.3/assets/js/src/search.js` file.
|
Documentation search is powered by [Algolia's DocSearch](https://community.algolia.com/docsearch/). Working on our search? Be sure to set `debug: true` in `site/assets/js/search.js`.
|
||||||
|
|
||||||
### Running documentation locally
|
### Running documentation locally
|
||||||
|
|
||||||
1. Run through the [tooling setup](https://getbootstrap.com/docs/4.3/getting-started/build-tools/#tooling-setup) to install Jekyll (the site builder) and other Ruby dependencies with `bundle install`.
|
1. Run `npm install` to install the Node.js dependencies, including Hugo (the site builder).
|
||||||
2. Run `npm install` to install Node.js dependencies.
|
2. Run `npm run test` (or a specific npm script) to rebuild distributed CSS and JavaScript files, as well as our docs assets.
|
||||||
3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
|
3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
|
||||||
4. Open `http://localhost:9001` in your browser, and voilà.
|
4. Open `http://localhost:9001/` in your browser, and voilà.
|
||||||
|
|
||||||
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).
|
Learn more about using Hugo by reading its [documentation](https://gohugo.io/documentation/).
|
||||||
|
|
||||||
### Documentation for previous releases
|
### Documentation for previous releases
|
||||||
|
|
||||||
- For v2.3.2: <https://getbootstrap.com/2.3.2/>
|
You can find all our previous releases docs on <https://getbootstrap.com/docs/versions/>.
|
||||||
- For v3.3.x: <https://getbootstrap.com/docs/3.3/>
|
|
||||||
- For v3.4.0: <https://getbootstrap.com/docs/3.4/>
|
|
||||||
- For v4.0.x: <https://getbootstrap.com/docs/4.0/>
|
|
||||||
- For v4.1.x: <https://getbootstrap.com/docs/4.1/>
|
|
||||||
- For v4.2.x: <https://getbootstrap.com/docs/4.2/>
|
|
||||||
|
|
||||||
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/v4-dev/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
|
||||||
|
|
||||||
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
|
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/v4-dev/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo).
|
||||||
|
|
||||||
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
|
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/v4-dev/.editorconfig) for easy use in common text editors. Read more and download plugins at <https://editorconfig.org/>.
|
||||||
|
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
|
|
@ -186,13 +181,6 @@ See [the Releases section of our GitHub project](https://github.com/twbs/bootstr
|
||||||
Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!
|
Thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers!
|
||||||
|
|
||||||
|
|
||||||
## Backers
|
|
||||||
|
|
||||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)]
|
|
||||||
|
|
||||||
[](https://opencollective.com/bootstrap#backers)
|
|
||||||
|
|
||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bootstrap#sponsor)]
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bootstrap#sponsor)]
|
||||||
|
|
@ -209,6 +197,13 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
||||||
[](https://opencollective.com/bootstrap/sponsor/9/website)
|
[](https://opencollective.com/bootstrap/sponsor/9/website)
|
||||||
|
|
||||||
|
|
||||||
|
## Backers
|
||||||
|
|
||||||
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bootstrap#backer)]
|
||||||
|
|
||||||
|
[](https://opencollective.com/bootstrap#backers)
|
||||||
|
|
||||||
|
|
||||||
## Copyright and license
|
## Copyright and license
|
||||||
|
|
||||||
Code and documentation copyright 2011-2019 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE).
|
Code and documentation copyright 2011-2021 the [Bootstrap Authors](https://github.com/twbs/bootstrap/graphs/contributors) and [Twitter, Inc.](https://twitter.com) Code released under the [MIT License](https://github.com/twbs/bootstrap/blob/main/LICENSE). Docs released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/).
|
||||||
|
|
|
||||||
7
SECURITY.md
Normal file
7
SECURITY.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Reporting Security Issues
|
||||||
|
|
||||||
|
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
|
||||||
|
|
||||||
|
To report a security issue, email [security@getbootstrap.com](mailto:security@getbootstrap.com) and include the word "SECURITY" in the subject line.
|
||||||
|
|
||||||
|
We'll endeavor to respond quickly, and will keep you updated throughout the process.
|
||||||
68
_config.yml
68
_config.yml
|
|
@ -1,68 +0,0 @@
|
||||||
# Dependencies
|
|
||||||
markdown: kramdown
|
|
||||||
highlighter: rouge
|
|
||||||
|
|
||||||
kramdown:
|
|
||||||
auto_ids: true
|
|
||||||
|
|
||||||
# Permalinks
|
|
||||||
permalink: pretty
|
|
||||||
|
|
||||||
# Server
|
|
||||||
source: "site"
|
|
||||||
destination: ./_gh_pages
|
|
||||||
host: "localhost"
|
|
||||||
port: 9001
|
|
||||||
baseurl: ""
|
|
||||||
url: "https://getbootstrap.com"
|
|
||||||
encoding: UTF-8
|
|
||||||
exclude:
|
|
||||||
- docs/4.3/assets/scss/
|
|
||||||
|
|
||||||
plugins:
|
|
||||||
- jekyll-redirect-from
|
|
||||||
- jekyll-sitemap
|
|
||||||
- jekyll-toc
|
|
||||||
|
|
||||||
# Social
|
|
||||||
title: Bootstrap
|
|
||||||
description: "The most popular HTML, CSS, and JS library in the world."
|
|
||||||
twitter: getbootstrap
|
|
||||||
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
|
|
||||||
social_image_path: /docs/4.3/assets/brand/bootstrap-social.png
|
|
||||||
social_logo_path: /docs/4.3/assets/brand/bootstrap-social-logo.png
|
|
||||||
|
|
||||||
# Custom variables
|
|
||||||
current_version: 4.3.1
|
|
||||||
current_ruby_version: 4.3.1
|
|
||||||
docs_version: 4.3
|
|
||||||
repo: "https://github.com/twbs/bootstrap"
|
|
||||||
slack: "https://bootstrap-slack.herokuapp.com"
|
|
||||||
opencollective: "https://opencollective.com/bootstrap"
|
|
||||||
blog: "https://blog.getbootstrap.com"
|
|
||||||
expo: "https://expo.getbootstrap.com"
|
|
||||||
themes: "https://themes.getbootstrap.com"
|
|
||||||
|
|
||||||
download:
|
|
||||||
source: "https://github.com/twbs/bootstrap/archive/v4.3.1.zip"
|
|
||||||
dist: "https://github.com/twbs/bootstrap/releases/download/v4.3.1/bootstrap-4.3.1-dist.zip"
|
|
||||||
|
|
||||||
cdn:
|
|
||||||
# See https://www.srihash.org for info on how to generate the hashes
|
|
||||||
css: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
|
||||||
css_hash: "sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
|
|
||||||
js: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
|
|
||||||
js_hash: "sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
|
|
||||||
js_bundle: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
|
|
||||||
js_bundle_hash: "sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
|
|
||||||
jquery: "https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
|
||||||
jquery_hash: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
|
||||||
popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
|
|
||||||
popper_hash: "sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
|
|
||||||
|
|
||||||
toc:
|
|
||||||
min_level: 2
|
|
||||||
max_level: 4
|
|
||||||
no_toc_section_class:
|
|
||||||
- "bd-callout"
|
|
||||||
- "bd-example"
|
|
||||||
|
|
@ -8,13 +8,7 @@
|
||||||
},
|
},
|
||||||
"extends": "../.eslintrc.json",
|
"extends": "../.eslintrc.json",
|
||||||
"rules": {
|
"rules": {
|
||||||
"consistent-return": "off",
|
|
||||||
"func-style": "off",
|
|
||||||
"no-console": "off",
|
"no-console": "off",
|
||||||
"no-magic-numbers": "off",
|
"strict": "error"
|
||||||
"no-process-env": "off",
|
|
||||||
"no-process-exit": "off",
|
|
||||||
"no-sync": "off",
|
|
||||||
"spaced-comment": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ function getBanner(pluginFilename) {
|
||||||
return `/*!
|
return `/*!
|
||||||
* Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
* Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
||||||
* Copyright 2011-${year} ${pkg.author}
|
* Copyright 2011-${year} ${pkg.author}
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/`
|
*/`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,26 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Script to build our plugins to use them separately.
|
* Script to build our plugins to use them separately.
|
||||||
* Copyright 2019 The Bootstrap Authors
|
* Copyright 2020-2021 The Bootstrap Authors
|
||||||
* Copyright 2019 Twitter, Inc.
|
* Copyright 2020-2021 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const rollup = require('rollup')
|
const rollup = require('rollup')
|
||||||
const babel = require('rollup-plugin-babel')
|
const { babel } = require('@rollup/plugin-babel')
|
||||||
const banner = require('./banner.js')
|
const banner = require('./banner.js')
|
||||||
|
|
||||||
const TEST = process.env.NODE_ENV === 'test'
|
const TEST = process.env.NODE_ENV === 'test'
|
||||||
const plugins = [
|
const plugins = [
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**', // Only transpile our source code
|
// Only transpile our source code
|
||||||
externalHelpersWhitelist: [ // Include only required helpers
|
exclude: 'node_modules/**',
|
||||||
'defineProperties',
|
// Include the helpers in each file, at most one copy of each
|
||||||
'createClass',
|
babelHelpers: 'bundled'
|
||||||
'inheritsLoose',
|
|
||||||
'defineProperty',
|
|
||||||
'objectSpread'
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
const bsPlugins = {
|
const bsPlugins = {
|
||||||
|
|
@ -41,7 +39,7 @@ const bsPlugins = {
|
||||||
}
|
}
|
||||||
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
|
const rootPath = TEST ? '../js/coverage/dist/' : '../js/dist/'
|
||||||
|
|
||||||
function build(plugin) {
|
const build = async plugin => {
|
||||||
console.log(`Building ${plugin} plugin...`)
|
console.log(`Building ${plugin} plugin...`)
|
||||||
|
|
||||||
const external = ['jquery', 'popper.js']
|
const external = ['jquery', 'popper.js']
|
||||||
|
|
@ -63,23 +61,32 @@ function build(plugin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const pluginFilename = `${plugin.toLowerCase()}.js`
|
const pluginFilename = `${plugin.toLowerCase()}.js`
|
||||||
|
const bundle = await rollup.rollup({
|
||||||
rollup.rollup({
|
|
||||||
input: bsPlugins[plugin],
|
input: bsPlugins[plugin],
|
||||||
plugins,
|
plugins,
|
||||||
external
|
external
|
||||||
}).then((bundle) => {
|
|
||||||
bundle.write({
|
|
||||||
banner: banner(pluginFilename),
|
|
||||||
format: 'umd',
|
|
||||||
name: plugin,
|
|
||||||
sourcemap: true,
|
|
||||||
globals,
|
|
||||||
file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
|
|
||||||
})
|
|
||||||
.then(() => console.log(`Building ${plugin} plugin... Done!`))
|
|
||||||
.catch((err) => console.error(`${plugin}: ${err}`))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await bundle.write({
|
||||||
|
banner: banner(pluginFilename),
|
||||||
|
format: 'umd',
|
||||||
|
name: plugin,
|
||||||
|
sourcemap: true,
|
||||||
|
globals,
|
||||||
|
file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`Building ${plugin} plugin... Done!`)
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(bsPlugins).forEach((plugin) => build(plugin))
|
const main = async () => {
|
||||||
|
try {
|
||||||
|
await Promise.all(Object.keys(bsPlugins).map(plugin => build(plugin)))
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Script to update version number references in the project.
|
* Script to update version number references in the project.
|
||||||
* Copyright 2017-2019 The Bootstrap Authors
|
* Copyright 2017-2021 The Bootstrap Authors
|
||||||
* Copyright 2017-2019 Twitter, Inc.
|
* Copyright 2017-2021 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
@ -17,11 +17,11 @@ sh.config.fatal = true
|
||||||
|
|
||||||
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
|
||||||
function regExpQuote(string) {
|
function regExpQuote(string) {
|
||||||
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
|
return string.replace(/[$()*+.?[\\\]^{|}-]/g, '\\$&')
|
||||||
}
|
}
|
||||||
|
|
||||||
function regExpQuoteReplacement(string) {
|
function regExpQuoteReplacement(string) {
|
||||||
return string.replace(/[$]/g, '$$')
|
return string.replace(/\$/g, '$$')
|
||||||
}
|
}
|
||||||
|
|
||||||
const DRY_RUN = false
|
const DRY_RUN = false
|
||||||
|
|
@ -30,18 +30,21 @@ function walkAsync(directory, excludedDirectories, fileCallback, errback) {
|
||||||
if (excludedDirectories.has(path.parse(directory).base)) {
|
if (excludedDirectories.has(path.parse(directory).base)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.readdir(directory, (err, names) => {
|
fs.readdir(directory, (err, names) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
errback(err)
|
errback(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
names.forEach((name) => {
|
|
||||||
|
names.forEach(name => {
|
||||||
const filepath = path.join(directory, name)
|
const filepath = path.join(directory, name)
|
||||||
fs.lstat(filepath, (err, stats) => {
|
fs.lstat(filepath, (err, stats) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
process.nextTick(errback, err)
|
process.nextTick(errback, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stats.isDirectory()) {
|
if (stats.isDirectory()) {
|
||||||
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
|
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
|
||||||
} else if (stats.isFile()) {
|
} else if (stats.isFile()) {
|
||||||
|
|
@ -55,18 +58,19 @@ function walkAsync(directory, excludedDirectories, fileCallback, errback) {
|
||||||
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
|
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
|
||||||
original = new RegExp(regExpQuote(original), 'g')
|
original = new RegExp(regExpQuote(original), 'g')
|
||||||
replacement = regExpQuoteReplacement(replacement)
|
replacement = regExpQuoteReplacement(replacement)
|
||||||
const updateFile = DRY_RUN ? (filepath) => {
|
const updateFile = DRY_RUN ? filepath => {
|
||||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||||
console.log(`FILE: ${filepath}`)
|
console.log(`FILE: ${filepath}`)
|
||||||
} else {
|
} else {
|
||||||
console.log(`EXCLUDED:${filepath}`)
|
console.log(`EXCLUDED:${filepath}`)
|
||||||
}
|
}
|
||||||
} : (filepath) => {
|
} : filepath => {
|
||||||
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
if (allowedExtensions.has(path.parse(filepath).ext)) {
|
||||||
sh.sed('-i', original, replacement, filepath)
|
sh.sed('-i', original, replacement, filepath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
walkAsync(directory, excludedDirectories, updateFile, (err) => {
|
|
||||||
|
walkAsync(directory, excludedDirectories, updateFile, err => {
|
||||||
console.error('ERROR while traversing directory!:')
|
console.error('ERROR while traversing directory!:')
|
||||||
console.error(err)
|
console.error(err)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
|
@ -79,10 +83,12 @@ function main(args) {
|
||||||
console.error('Got arguments:', args)
|
console.error('Got arguments:', args)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldVersion = args[0]
|
const oldVersion = args[0]
|
||||||
const newVersion = args[1]
|
const newVersion = args[1]
|
||||||
const EXCLUDED_DIRS = new Set([
|
const EXCLUDED_DIRS = new Set([
|
||||||
'.git',
|
'.git',
|
||||||
|
'_gh_pages',
|
||||||
'node_modules',
|
'node_modules',
|
||||||
'vendor'
|
'vendor'
|
||||||
])
|
])
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
* Remember to use the same vendor files as the CDN ones,
|
* Remember to use the same vendor files as the CDN ones,
|
||||||
* otherwise the hashes won't match!
|
* otherwise the hashes won't match!
|
||||||
*
|
*
|
||||||
* Copyright 2017-2019 The Bootstrap Authors
|
* Copyright 2017-2021 The Bootstrap Authors
|
||||||
* Copyright 2017-2019 Twitter, Inc.
|
* Copyright 2017-2021 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
@ -21,11 +21,11 @@ const pkg = require('../package.json')
|
||||||
|
|
||||||
sh.config.fatal = true
|
sh.config.fatal = true
|
||||||
|
|
||||||
const configFile = path.join(__dirname, '../_config.yml')
|
const configFile = path.join(__dirname, '../config.yml')
|
||||||
|
|
||||||
// Array of objects which holds the files to generate SRI hashes for.
|
// Array of objects which holds the files to generate SRI hashes for.
|
||||||
// `file` is the path from the root folder
|
// `file` is the path from the root folder
|
||||||
// `configPropertyName` is the _config.yml variable's name of the file
|
// `configPropertyName` is the config.yml variable's name of the file
|
||||||
const files = [
|
const files = [
|
||||||
{
|
{
|
||||||
file: 'dist/css/bootstrap.min.css',
|
file: 'dist/css/bootstrap.min.css',
|
||||||
|
|
@ -40,7 +40,7 @@ const files = [
|
||||||
configPropertyName: 'js_bundle_hash'
|
configPropertyName: 'js_bundle_hash'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery-slim.min.js`,
|
file: `site/static/docs/${pkg.config.version_short}/assets/js/vendor/jquery.slim.min.js`,
|
||||||
configPropertyName: 'jquery_hash'
|
configPropertyName: 'jquery_hash'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +49,7 @@ const files = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
files.forEach((file) => {
|
files.forEach(file => {
|
||||||
fs.readFile(file.file, 'utf8', (err, data) => {
|
fs.readFile(file.file, 'utf8', (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err
|
throw err
|
||||||
|
|
@ -61,6 +61,6 @@ files.forEach((file) => {
|
||||||
|
|
||||||
console.log(`${file.configPropertyName}: ${integrity}`)
|
console.log(`${file.configPropertyName}: ${integrity}`)
|
||||||
|
|
||||||
sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile)
|
sh.sed('-i', new RegExp(`^(\\s+${file.configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
module.exports = (ctx) => ({
|
module.exports = ctx => {
|
||||||
map: ctx.file.dirname.includes('examples') ? false : {
|
return {
|
||||||
inline: false,
|
map: ctx.file.dirname.includes('examples') ?
|
||||||
annotation: true,
|
false :
|
||||||
sourcesContent: true
|
{
|
||||||
},
|
inline: false,
|
||||||
plugins: {
|
annotation: true,
|
||||||
autoprefixer: {
|
sourcesContent: true
|
||||||
cascade: false
|
},
|
||||||
|
plugins: {
|
||||||
|
autoprefixer: {
|
||||||
|
cascade: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,20 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const babel = require('rollup-plugin-babel')
|
const { babel } = require('@rollup/plugin-babel')
|
||||||
const resolve = require('rollup-plugin-node-resolve')
|
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||||
const banner = require('./banner.js')
|
const banner = require('./banner.js')
|
||||||
|
|
||||||
const BUNDLE = process.env.BUNDLE === 'true'
|
const BUNDLE = process.env.BUNDLE === 'true'
|
||||||
|
|
||||||
let fileDest = 'bootstrap.js'
|
let fileDest = 'bootstrap.js'
|
||||||
const external = ['jquery', 'popper.js']
|
const external = ['jquery', 'popper.js']
|
||||||
const plugins = [
|
const plugins = [
|
||||||
babel({
|
babel({
|
||||||
exclude: 'node_modules/**', // Only transpile our source code
|
// Only transpile our source code
|
||||||
externalHelpersWhitelist: [ // Include only required helpers
|
exclude: 'node_modules/**',
|
||||||
'defineProperties',
|
// Include the helpers in the bundle, at most one copy of each
|
||||||
'createClass',
|
babelHelpers: 'bundled'
|
||||||
'inheritsLoose',
|
|
||||||
'defineProperty',
|
|
||||||
'objectSpread'
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
const globals = {
|
const globals = {
|
||||||
|
|
@ -31,11 +27,11 @@ if (BUNDLE) {
|
||||||
// Remove last entry in external array to bundle Popper
|
// Remove last entry in external array to bundle Popper
|
||||||
external.pop()
|
external.pop()
|
||||||
delete globals['popper.js']
|
delete globals['popper.js']
|
||||||
plugins.push(resolve())
|
plugins.push(nodeResolve())
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
input: path.resolve(__dirname, '../js/src/index.js'),
|
input: path.resolve(__dirname, '../js/index.js'),
|
||||||
output: {
|
output: {
|
||||||
banner,
|
banner,
|
||||||
file: path.resolve(__dirname, `../dist/js/${fileDest}`),
|
file: path.resolve(__dirname, `../dist/js/${fileDest}`),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
#
|
#
|
||||||
# Usage
|
# Usage
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
@ -18,35 +21,35 @@ end=$'\e[0m'
|
||||||
current_version=$(node -p "require('./package.json').version")
|
current_version=$(node -p "require('./package.json').version")
|
||||||
|
|
||||||
if [[ $# -lt 1 ]]; then
|
if [[ $# -lt 1 ]]; then
|
||||||
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" $red $end
|
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" "$red" "$end"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Pulling latest changes, just to be sure
|
# Pulling latest changes, just to be sure
|
||||||
printf "\n%s=======================================================%s" $magenta $end
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||||
printf "\n%sPulling latest changes...%s" $magenta $end
|
printf "\n%sPulling latest changes...%s" "$magenta" "$end"
|
||||||
printf "\n%s=======================================================\n\n%s" $magenta $end
|
printf "\n%s=======================================================\n\n%s" "$magenta" "$end"
|
||||||
git pull origin v4-dev
|
git pull origin v4-dev
|
||||||
|
|
||||||
# Update version number
|
# Update version number
|
||||||
printf "\n%s=======================================================%s" $magenta $end
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||||
printf "\n%sUpdating version number...%s" $magenta $end
|
printf "\n%sUpdating version number...%s" "$magenta" "$end"
|
||||||
printf "\n%s=======================================================\n%s" $magenta $end
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||||
npm run release-version "$current_version" "$1"
|
npm run release-version "$current_version" "$1"
|
||||||
|
|
||||||
# Build release
|
# Build release
|
||||||
printf "\n%s=======================================================%s" $magenta $end
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||||
printf "\n%sBuilding release...%s" $magenta $end
|
printf "\n%sBuilding release...%s" "$magenta" "$end"
|
||||||
printf "\n%s=======================================================\n%s" $magenta $end
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||||
npm run release
|
npm run release
|
||||||
|
|
||||||
# Copy the contents of the built docs site over to `bs-docs` repo
|
# Copy the contents of the built docs site over to `bs-docs` repo
|
||||||
printf "\n%s=======================================================%s" $magenta $end
|
printf "\n%s=======================================================%s" "$magenta" "$end"
|
||||||
printf "\n%sCopy it over...%s" $magenta $end
|
printf "\n%sCopy it over...%s" "$magenta" "$end"
|
||||||
printf "\n%s=======================================================\n%s" $magenta $end
|
printf "\n%s=======================================================\n%s" "$magenta" "$end"
|
||||||
cp -rf _gh_pages/. ../bs-docs/
|
cp -rf _gh_pages/. ../bs-docs/
|
||||||
printf "\nDone!\n"
|
printf "\nDone!\n"
|
||||||
|
|
||||||
printf "\n%s=======================================================%s" $green $end
|
printf "\n%s=======================================================%s" "$green" "$end"
|
||||||
printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
|
printf "\n%sSuccess, $1 is ready to review and publish.%s" "$green" "$end"
|
||||||
printf "\n%s=======================================================\n\n%s" $green $end
|
printf "\n%s=======================================================\n\n%s" "$green" "$end"
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ plugins:
|
||||||
- minifyStyles: true
|
- minifyStyles: true
|
||||||
- moveElemsAttrsToGroup: true
|
- moveElemsAttrsToGroup: true
|
||||||
- moveGroupAttrsToElems: true
|
- moveGroupAttrsToElems: true
|
||||||
|
- removeAttrs:
|
||||||
|
attrs:
|
||||||
|
- "data-name"
|
||||||
- removeComments: true
|
- removeComments: true
|
||||||
- removeDesc: true
|
- removeDesc: true
|
||||||
- removeDoctype: true
|
- removeDoctype: true
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Script to run vnu-jar if Java is available.
|
* Script to run vnu-jar if Java is available.
|
||||||
* Copyright 2017-2019 The Bootstrap Authors
|
* Copyright 2017-2021 The Bootstrap Authors
|
||||||
* Copyright 2017-2019 Twitter, Inc.
|
* Copyright 2017-2021 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
@ -18,7 +18,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const is32bitJava = !stderr.match(/64-Bit/)
|
const is32bitJava = !/64-Bit/.test(stderr)
|
||||||
|
|
||||||
// vnu-jar accepts multiple ignores joined with a `|`.
|
// vnu-jar accepts multiple ignores joined with a `|`.
|
||||||
// Also note that the ignores are regular expressions.
|
// Also note that the ignores are regular expressions.
|
||||||
|
|
@ -36,9 +36,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||||
'The “time” input type is not supported in all browsers.*',
|
'The “time” input type is not supported in all browsers.*',
|
||||||
// IE11 doesn't recognise <main> / give the element an implicit "main" landmark.
|
// IE11 doesn't recognise <main> / give the element an implicit "main" landmark.
|
||||||
// Explicit role="main" is redundant for other modern browsers, but still valid.
|
// Explicit role="main" is redundant for other modern browsers, but still valid.
|
||||||
'The “main” role is unnecessary for element “main”.',
|
'The “main” role is unnecessary for element “main”.'
|
||||||
// Ignore the wrong lanuage code warnings for now; they happen randomly.
|
|
||||||
'This document appears to be written in.*'
|
|
||||||
].join('|')
|
].join('|')
|
||||||
|
|
||||||
const args = [
|
const args = [
|
||||||
|
|
@ -46,6 +44,8 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
|
||||||
vnu,
|
vnu,
|
||||||
'--asciiquotes',
|
'--asciiquotes',
|
||||||
'--skip-non-html',
|
'--skip-non-html',
|
||||||
|
// Ignore the language code warnings
|
||||||
|
'--no-langdetect',
|
||||||
'--Werror',
|
'--Werror',
|
||||||
`--filterpattern "${ignores}"`,
|
`--filterpattern "${ignores}"`,
|
||||||
'_gh_pages/',
|
'_gh_pages/',
|
||||||
|
|
|
||||||
88
build/zip-examples.js
Normal file
88
build/zip-examples.js
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Script to create the built examples zip archive;
|
||||||
|
* requires the `zip` command to be present!
|
||||||
|
* Copyright 2020-2021 The Bootstrap Authors
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
|
const sh = require('shelljs')
|
||||||
|
|
||||||
|
const pkg = require('../package.json')
|
||||||
|
|
||||||
|
const versionShort = pkg.config.version_short
|
||||||
|
const distFolder = `bootstrap-${pkg.version}-examples`
|
||||||
|
const rootDocsDir = '_gh_pages'
|
||||||
|
const docsDir = `${rootDocsDir}/docs/${versionShort}/`
|
||||||
|
|
||||||
|
// these are the files we need in the examples
|
||||||
|
const cssFiles = [
|
||||||
|
'bootstrap.min.css',
|
||||||
|
'bootstrap.min.css.map'
|
||||||
|
]
|
||||||
|
const jsFiles = [
|
||||||
|
'bootstrap.bundle.min.js',
|
||||||
|
'bootstrap.bundle.min.js.map'
|
||||||
|
]
|
||||||
|
const imgFiles = [
|
||||||
|
'bootstrap-outline.svg',
|
||||||
|
'bootstrap-solid.svg'
|
||||||
|
]
|
||||||
|
|
||||||
|
sh.config.fatal = true
|
||||||
|
|
||||||
|
if (!sh.test('-d', rootDocsDir)) {
|
||||||
|
throw new Error(`The "${rootDocsDir}" folder does not exist, did you forget building the docs?`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// switch to the root dir
|
||||||
|
sh.cd(path.join(__dirname, '..'))
|
||||||
|
|
||||||
|
// remove any previously created folder/zip with the same name
|
||||||
|
sh.rm('-rf', [distFolder, `${distFolder}.zip`])
|
||||||
|
|
||||||
|
// create any folders so that `cp` works
|
||||||
|
sh.mkdir('-p', [
|
||||||
|
distFolder,
|
||||||
|
`${distFolder}/assets/brand/`,
|
||||||
|
`${distFolder}/assets/dist/css/`,
|
||||||
|
`${distFolder}/assets/dist/js/`
|
||||||
|
])
|
||||||
|
|
||||||
|
sh.cp('-Rf', `${docsDir}/examples/*`, distFolder)
|
||||||
|
|
||||||
|
cssFiles.forEach(file => {
|
||||||
|
sh.cp('-f', `${docsDir}/dist/css/${file}`, `${distFolder}/assets/dist/css/`)
|
||||||
|
})
|
||||||
|
|
||||||
|
jsFiles.forEach(file => {
|
||||||
|
sh.cp('-f', `${docsDir}/dist/js/${file}`, `${distFolder}/assets/dist/js/`)
|
||||||
|
})
|
||||||
|
|
||||||
|
imgFiles.forEach(file => {
|
||||||
|
sh.cp('-f', `${docsDir}/assets/brand/${file}`, `${distFolder}/assets/brand/`)
|
||||||
|
})
|
||||||
|
|
||||||
|
sh.rm(`${distFolder}/index.html`)
|
||||||
|
|
||||||
|
// get all examples' HTML files
|
||||||
|
sh.find(`${distFolder}/**/*.html`).forEach(file => {
|
||||||
|
const fileContents = sh.cat(file)
|
||||||
|
.toString()
|
||||||
|
.replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../')
|
||||||
|
.replace(/"..\/dist\//g, '"../assets/dist/')
|
||||||
|
.replace(/(<link href="\.\.\/.*) integrity=".*>/g, '$1>')
|
||||||
|
.replace(/(<script src="\.\.\/.*) integrity=".*>/g, '$1></script>')
|
||||||
|
.replace(/( +)<!-- favicons(.|\n)+<style>/i, ' <style>')
|
||||||
|
new sh.ShellString(fileContents).to(file)
|
||||||
|
})
|
||||||
|
|
||||||
|
// create the zip file
|
||||||
|
sh.exec(`zip -r9 "${distFolder}.zip" "${distFolder}"`)
|
||||||
|
|
||||||
|
// remove the folder we created
|
||||||
|
sh.rm('-rf', distFolder)
|
||||||
79
config.yml
Normal file
79
config.yml
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
languageCode: "en"
|
||||||
|
title: "Bootstrap"
|
||||||
|
baseURL: "https://getbootstrap.com"
|
||||||
|
enableInlineShortcodes: true
|
||||||
|
|
||||||
|
markup:
|
||||||
|
goldmark:
|
||||||
|
renderer:
|
||||||
|
unsafe: true
|
||||||
|
highlight:
|
||||||
|
noClasses: false
|
||||||
|
tableOfContents:
|
||||||
|
startLevel: 2
|
||||||
|
endLevel: 6
|
||||||
|
|
||||||
|
buildDrafts: true
|
||||||
|
buildFuture: true
|
||||||
|
|
||||||
|
enableRobotsTXT: true
|
||||||
|
metaDataFormat: "yaml"
|
||||||
|
disableKinds: ["404", "taxonomy", "taxonomyTerm", "RSS"]
|
||||||
|
|
||||||
|
publishDir: "_gh_pages"
|
||||||
|
|
||||||
|
module:
|
||||||
|
mounts:
|
||||||
|
- source: dist
|
||||||
|
target: static/docs/4.5/dist
|
||||||
|
- source: site/assets
|
||||||
|
target: assets
|
||||||
|
- source: site/content
|
||||||
|
target: content
|
||||||
|
- source: site/data
|
||||||
|
target: data
|
||||||
|
- source: site/layouts
|
||||||
|
target: layouts
|
||||||
|
- source: site/static
|
||||||
|
target: static
|
||||||
|
- source: site/static/docs/4.5/assets/img/favicons/apple-touch-icon.png
|
||||||
|
target: static/apple-touch-icon.png
|
||||||
|
- source: site/static/docs/4.5/assets/img/favicons/favicon.ico
|
||||||
|
target: static/favicon.ico
|
||||||
|
|
||||||
|
params:
|
||||||
|
description: "The most popular HTML, CSS, and JS library in the world."
|
||||||
|
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
|
||||||
|
social_image_path: /docs/4.5/assets/brand/bootstrap-social.png
|
||||||
|
social_logo_path: /docs/4.5/assets/brand/bootstrap-social-logo.png
|
||||||
|
|
||||||
|
current_version: "4.5.3"
|
||||||
|
current_ruby_version: "4.5.3"
|
||||||
|
docs_version: "4.5"
|
||||||
|
github_org: "https://github.com/twbs"
|
||||||
|
repo: "https://github.com/twbs/bootstrap"
|
||||||
|
twitter: "getbootstrap"
|
||||||
|
slack: "https://bootstrap-slack.herokuapp.com/"
|
||||||
|
opencollective: "https://opencollective.com/bootstrap"
|
||||||
|
blog: "https://blog.getbootstrap.com/"
|
||||||
|
expo: "https://expo.getbootstrap.com/"
|
||||||
|
themes: "https://themes.getbootstrap.com/"
|
||||||
|
icons: "https://icons.getbootstrap.com/"
|
||||||
|
|
||||||
|
download:
|
||||||
|
source: "https://github.com/twbs/bootstrap/archive/v4.5.3.zip"
|
||||||
|
dist: "https://github.com/twbs/bootstrap/releases/download/v4.5.3/bootstrap-4.5.3-dist.zip"
|
||||||
|
dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.5.3/bootstrap-4.5.3-examples.zip"
|
||||||
|
|
||||||
|
cdn:
|
||||||
|
# See https://www.srihash.org for info on how to generate the hashes
|
||||||
|
css: "https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
|
||||||
|
css_hash: "sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
|
||||||
|
js: "https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js"
|
||||||
|
js_hash: "sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s"
|
||||||
|
js_bundle: "https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"
|
||||||
|
js_bundle_hash: "sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
|
||||||
|
jquery: "https://code.jquery.com/jquery-3.5.1.slim.min.js"
|
||||||
|
jquery_hash: "sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
|
||||||
|
popper: "https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
|
||||||
|
popper_hash: "sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
|
||||||
187
dist/css/bootstrap-grid.css
vendored
187
dist/css/bootstrap-grid.css
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap Grid v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap Grid v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
* Copyright 2011-2019 Twitter, Inc.
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
html {
|
html {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
@ -15,7 +15,12 @@ html {
|
||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container,
|
||||||
|
.container-fluid,
|
||||||
|
.container-sm,
|
||||||
|
.container-md,
|
||||||
|
.container-lg,
|
||||||
|
.container-xl {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
|
|
@ -24,37 +29,29 @@ html {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
.container {
|
.container, .container-sm {
|
||||||
max-width: 540px;
|
max-width: 540px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.container {
|
.container, .container-sm, .container-md {
|
||||||
max-width: 720px;
|
max-width: 720px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
.container {
|
.container, .container-sm, .container-md, .container-lg {
|
||||||
max-width: 960px;
|
max-width: 960px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
.container {
|
.container, .container-sm, .container-md, .container-lg, .container-xl {
|
||||||
max-width: 1140px;
|
max-width: 1140px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-fluid {
|
|
||||||
width: 100%;
|
|
||||||
padding-right: 15px;
|
|
||||||
padding-left: 15px;
|
|
||||||
margin-right: auto;
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -95,6 +92,42 @@ html {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.row-cols-1 > * {
|
||||||
|
-ms-flex: 0 0 100%;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-cols-2 > * {
|
||||||
|
-ms-flex: 0 0 50%;
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-cols-3 > * {
|
||||||
|
-ms-flex: 0 0 33.333333%;
|
||||||
|
flex: 0 0 33.333333%;
|
||||||
|
max-width: 33.333333%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-cols-4 > * {
|
||||||
|
-ms-flex: 0 0 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-cols-5 > * {
|
||||||
|
-ms-flex: 0 0 20%;
|
||||||
|
flex: 0 0 20%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-cols-6 > * {
|
||||||
|
-ms-flex: 0 0 16.666667%;
|
||||||
|
flex: 0 0 16.666667%;
|
||||||
|
max-width: 16.666667%;
|
||||||
|
}
|
||||||
|
|
||||||
.col-auto {
|
.col-auto {
|
||||||
-ms-flex: 0 0 auto;
|
-ms-flex: 0 0 auto;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
@ -301,6 +334,36 @@ html {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.row-cols-sm-1 > * {
|
||||||
|
-ms-flex: 0 0 100%;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.row-cols-sm-2 > * {
|
||||||
|
-ms-flex: 0 0 50%;
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
.row-cols-sm-3 > * {
|
||||||
|
-ms-flex: 0 0 33.333333%;
|
||||||
|
flex: 0 0 33.333333%;
|
||||||
|
max-width: 33.333333%;
|
||||||
|
}
|
||||||
|
.row-cols-sm-4 > * {
|
||||||
|
-ms-flex: 0 0 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
.row-cols-sm-5 > * {
|
||||||
|
-ms-flex: 0 0 20%;
|
||||||
|
flex: 0 0 20%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
.row-cols-sm-6 > * {
|
||||||
|
-ms-flex: 0 0 16.666667%;
|
||||||
|
flex: 0 0 16.666667%;
|
||||||
|
max-width: 16.666667%;
|
||||||
|
}
|
||||||
.col-sm-auto {
|
.col-sm-auto {
|
||||||
-ms-flex: 0 0 auto;
|
-ms-flex: 0 0 auto;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
@ -473,6 +536,36 @@ html {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.row-cols-md-1 > * {
|
||||||
|
-ms-flex: 0 0 100%;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.row-cols-md-2 > * {
|
||||||
|
-ms-flex: 0 0 50%;
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
.row-cols-md-3 > * {
|
||||||
|
-ms-flex: 0 0 33.333333%;
|
||||||
|
flex: 0 0 33.333333%;
|
||||||
|
max-width: 33.333333%;
|
||||||
|
}
|
||||||
|
.row-cols-md-4 > * {
|
||||||
|
-ms-flex: 0 0 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
.row-cols-md-5 > * {
|
||||||
|
-ms-flex: 0 0 20%;
|
||||||
|
flex: 0 0 20%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
.row-cols-md-6 > * {
|
||||||
|
-ms-flex: 0 0 16.666667%;
|
||||||
|
flex: 0 0 16.666667%;
|
||||||
|
max-width: 16.666667%;
|
||||||
|
}
|
||||||
.col-md-auto {
|
.col-md-auto {
|
||||||
-ms-flex: 0 0 auto;
|
-ms-flex: 0 0 auto;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
@ -645,6 +738,36 @@ html {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.row-cols-lg-1 > * {
|
||||||
|
-ms-flex: 0 0 100%;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.row-cols-lg-2 > * {
|
||||||
|
-ms-flex: 0 0 50%;
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
.row-cols-lg-3 > * {
|
||||||
|
-ms-flex: 0 0 33.333333%;
|
||||||
|
flex: 0 0 33.333333%;
|
||||||
|
max-width: 33.333333%;
|
||||||
|
}
|
||||||
|
.row-cols-lg-4 > * {
|
||||||
|
-ms-flex: 0 0 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
.row-cols-lg-5 > * {
|
||||||
|
-ms-flex: 0 0 20%;
|
||||||
|
flex: 0 0 20%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
.row-cols-lg-6 > * {
|
||||||
|
-ms-flex: 0 0 16.666667%;
|
||||||
|
flex: 0 0 16.666667%;
|
||||||
|
max-width: 16.666667%;
|
||||||
|
}
|
||||||
.col-lg-auto {
|
.col-lg-auto {
|
||||||
-ms-flex: 0 0 auto;
|
-ms-flex: 0 0 auto;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
@ -817,6 +940,36 @@ html {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
.row-cols-xl-1 > * {
|
||||||
|
-ms-flex: 0 0 100%;
|
||||||
|
flex: 0 0 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.row-cols-xl-2 > * {
|
||||||
|
-ms-flex: 0 0 50%;
|
||||||
|
flex: 0 0 50%;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
.row-cols-xl-3 > * {
|
||||||
|
-ms-flex: 0 0 33.333333%;
|
||||||
|
flex: 0 0 33.333333%;
|
||||||
|
max-width: 33.333333%;
|
||||||
|
}
|
||||||
|
.row-cols-xl-4 > * {
|
||||||
|
-ms-flex: 0 0 25%;
|
||||||
|
flex: 0 0 25%;
|
||||||
|
max-width: 25%;
|
||||||
|
}
|
||||||
|
.row-cols-xl-5 > * {
|
||||||
|
-ms-flex: 0 0 20%;
|
||||||
|
flex: 0 0 20%;
|
||||||
|
max-width: 20%;
|
||||||
|
}
|
||||||
|
.row-cols-xl-6 > * {
|
||||||
|
-ms-flex: 0 0 16.666667%;
|
||||||
|
flex: 0 0 16.666667%;
|
||||||
|
max-width: 16.666667%;
|
||||||
|
}
|
||||||
.col-xl-auto {
|
.col-xl-auto {
|
||||||
-ms-flex: 0 0 auto;
|
-ms-flex: 0 0 auto;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
|
||||||
2
dist/css/bootstrap-grid.css.map
vendored
2
dist/css/bootstrap-grid.css.map
vendored
File diff suppressed because one or more lines are too long
10
dist/css/bootstrap-grid.min.css
vendored
10
dist/css/bootstrap-grid.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-grid.min.css.map
vendored
2
dist/css/bootstrap-grid.min.css.map
vendored
File diff suppressed because one or more lines are too long
31
dist/css/bootstrap-reboot.css
vendored
31
dist/css/bootstrap-reboot.css
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap Reboot v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
* Copyright 2011-2019 Twitter, Inc.
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
*/
|
*/
|
||||||
*,
|
*,
|
||||||
|
|
@ -33,7 +33,7 @@ body {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
[tabindex="-1"]:focus {
|
[tabindex="-1"]:focus:not(:focus-visible) {
|
||||||
outline: 0 !important;
|
outline: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,20 +133,16 @@ a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:not([href]):not([tabindex]) {
|
a:not([href]):not([class]) {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
|
a:not([href]):not([class]):hover {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:not([href]):not([tabindex]):focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre,
|
pre,
|
||||||
code,
|
code,
|
||||||
kbd,
|
kbd,
|
||||||
|
|
@ -159,6 +155,7 @@ pre {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
-ms-overflow-style: scrollbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
|
|
@ -189,6 +186,7 @@ caption {
|
||||||
|
|
||||||
th {
|
th {
|
||||||
text-align: inherit;
|
text-align: inherit;
|
||||||
|
text-align: -webkit-match-parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
|
|
@ -226,6 +224,10 @@ select {
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[role="button"] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
}
|
}
|
||||||
|
|
@ -258,13 +260,6 @@ input[type="checkbox"] {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="date"],
|
|
||||||
input[type="time"],
|
|
||||||
input[type="datetime-local"],
|
|
||||||
input[type="month"] {
|
|
||||||
-webkit-appearance: listbox;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
|
|
|
||||||
2
dist/css/bootstrap-reboot.css.map
vendored
2
dist/css/bootstrap-reboot.css.map
vendored
File diff suppressed because one or more lines are too long
10
dist/css/bootstrap-reboot.min.css
vendored
10
dist/css/bootstrap-reboot.min.css
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap Reboot v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors
|
* Copyright 2011-2020 The Bootstrap Authors
|
||||||
* Copyright 2011-2019 Twitter, Inc.
|
* Copyright 2011-2020 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([class]){color:inherit;text-decoration:none}a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit;text-align:-webkit-match-parent}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||||
2
dist/css/bootstrap-reboot.min.css.map
vendored
2
dist/css/bootstrap-reboot.min.css.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
10
dist/css/bootstrap.min.css
vendored
10
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css.map
vendored
2
dist/css/bootstrap.min.css.map
vendored
File diff suppressed because one or more lines are too long
2226
dist/js/bootstrap.bundle.js
vendored
2226
dist/js/bootstrap.bundle.js
vendored
File diff suppressed because it is too large
Load diff
2
dist/js/bootstrap.bundle.js.map
vendored
2
dist/js/bootstrap.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/js/bootstrap.bundle.min.js
vendored
8
dist/js/bootstrap.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.bundle.min.js.map
vendored
2
dist/js/bootstrap.bundle.min.js.map
vendored
File diff suppressed because one or more lines are too long
2123
dist/js/bootstrap.js
2123
dist/js/bootstrap.js
File diff suppressed because it is too large
Load diff
2
dist/js/bootstrap.js.map
vendored
2
dist/js/bootstrap.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/js/bootstrap.min.js
vendored
8
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.min.js.map
vendored
2
dist/js/bootstrap.min.js.map
vendored
File diff suppressed because one or more lines are too long
104
js/dist/alert.js
vendored
104
js/dist/alert.js
vendored
|
|
@ -1,33 +1,22 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap alert.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap alert.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Alert = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -35,34 +24,25 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'alert';
|
var NAME = 'alert';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.alert';
|
var DATA_KEY = 'bs.alert';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var Selector = {
|
var SELECTOR_DISMISS = '[data-dismiss="alert"]';
|
||||||
DISMISS: '[data-dismiss="alert"]'
|
var EVENT_CLOSE = "close" + EVENT_KEY;
|
||||||
};
|
var EVENT_CLOSED = "closed" + EVENT_KEY;
|
||||||
var Event = {
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
CLOSE: "close" + EVENT_KEY,
|
var CLASS_NAME_ALERT = 'alert';
|
||||||
CLOSED: "closed" + EVENT_KEY,
|
var CLASS_NAME_FADE = 'fade';
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_SHOW = 'show';
|
||||||
};
|
/**
|
||||||
var ClassName = {
|
* ------------------------------------------------------------------------
|
||||||
ALERT: 'alert',
|
* Class Definition
|
||||||
FADE: 'fade',
|
* ------------------------------------------------------------------------
|
||||||
SHOW: 'show'
|
*/
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Alert = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Alert =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Alert(element) {
|
function Alert(element) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
} // Getters
|
} // Getters
|
||||||
|
|
@ -88,13 +68,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
} // Private
|
} // Private
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getRootElement = function _getRootElement(element) {
|
_proto._getRootElement = function _getRootElement(element) {
|
||||||
var selector = Util.getSelectorFromElement(element);
|
var selector = Util__default['default'].getSelectorFromElement(element);
|
||||||
var parent = false;
|
var parent = false;
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
|
|
@ -102,43 +82,43 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
parent = $(element).closest("." + ClassName.ALERT)[0];
|
parent = $__default['default'](element).closest("." + CLASS_NAME_ALERT)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
|
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
|
||||||
var closeEvent = $.Event(Event.CLOSE);
|
var closeEvent = $__default['default'].Event(EVENT_CLOSE);
|
||||||
$(element).trigger(closeEvent);
|
$__default['default'](element).trigger(closeEvent);
|
||||||
return closeEvent;
|
return closeEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._removeElement = function _removeElement(element) {
|
_proto._removeElement = function _removeElement(element) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
$(element).removeClass(ClassName.SHOW);
|
$__default['default'](element).removeClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
if (!$(element).hasClass(ClassName.FADE)) {
|
if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) {
|
||||||
this._destroyElement(element);
|
this._destroyElement(element);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(element);
|
||||||
$(element).one(Util.TRANSITION_END, function (event) {
|
$__default['default'](element).one(Util__default['default'].TRANSITION_END, function (event) {
|
||||||
return _this._destroyElement(element, event);
|
return _this._destroyElement(element, event);
|
||||||
}).emulateTransitionEnd(transitionDuration);
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._destroyElement = function _destroyElement(element) {
|
_proto._destroyElement = function _destroyElement(element) {
|
||||||
$(element).detach().trigger(Event.CLOSED).remove();
|
$__default['default'](element).detach().trigger(EVENT_CLOSED).remove();
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
Alert._jQueryInterface = function _jQueryInterface(config) {
|
Alert._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $element = $(this);
|
var $element = $__default['default'](this);
|
||||||
var data = $element.data(DATA_KEY);
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
|
@ -178,22 +158,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* jQuery
|
* jQuery
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Alert._jQueryInterface;
|
$__default['default'].fn[NAME] = Alert._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Alert;
|
$__default['default'].fn[NAME].Constructor = Alert;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Alert._jQueryInterface;
|
return Alert._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Alert;
|
return Alert;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=alert.js.map
|
//# sourceMappingURL=alert.js.map
|
||||||
|
|
|
||||||
2
js/dist/alert.js.map
vendored
2
js/dist/alert.js.map
vendored
File diff suppressed because one or more lines are too long
190
js/dist/button.js
vendored
190
js/dist/button.js
vendored
|
|
@ -1,32 +1,21 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap button.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap button.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||||
(global = global || self, global.Button = factory(global.jQuery));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.jQuery));
|
||||||
}(this, function ($) { 'use strict';
|
}(this, (function ($) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -34,39 +23,34 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'button';
|
var NAME = 'button';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.button';
|
var DATA_KEY = 'bs.button';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var ClassName = {
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
ACTIVE: 'active',
|
var CLASS_NAME_BUTTON = 'btn';
|
||||||
BUTTON: 'btn',
|
var CLASS_NAME_FOCUS = 'focus';
|
||||||
FOCUS: 'focus'
|
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
|
||||||
};
|
var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
|
||||||
var Selector = {
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
|
||||||
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
|
||||||
DATA_TOGGLE: '[data-toggle="buttons"]',
|
var SELECTOR_INPUT = 'input:not([type="hidden"])';
|
||||||
INPUT: 'input:not([type="hidden"])',
|
var SELECTOR_ACTIVE = '.active';
|
||||||
ACTIVE: '.active',
|
var SELECTOR_BUTTON = '.btn';
|
||||||
BUTTON: '.btn'
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
};
|
var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY);
|
||||||
var Event = {
|
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
/**
|
||||||
FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
|
* ------------------------------------------------------------------------
|
||||||
/**
|
* Class Definition
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Class Definition
|
*/
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Button = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Button =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Button(element) {
|
function Button(element) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
|
this.shouldAvoidTriggerChange = false;
|
||||||
} // Getters
|
} // Getters
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -76,31 +60,33 @@
|
||||||
_proto.toggle = function toggle() {
|
_proto.toggle = function toggle() {
|
||||||
var triggerChangeEvent = true;
|
var triggerChangeEvent = true;
|
||||||
var addAriaPressed = true;
|
var addAriaPressed = true;
|
||||||
var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
|
var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0];
|
||||||
|
|
||||||
if (rootElement) {
|
if (rootElement) {
|
||||||
var input = this._element.querySelector(Selector.INPUT);
|
var input = this._element.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
if (input.type === 'radio') {
|
if (input.type === 'radio') {
|
||||||
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
|
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||||
triggerChangeEvent = false;
|
triggerChangeEvent = false;
|
||||||
} else {
|
} else {
|
||||||
var activeElement = rootElement.querySelector(Selector.ACTIVE);
|
var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
|
||||||
|
|
||||||
if (activeElement) {
|
if (activeElement) {
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
$__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
if (triggerChangeEvent) {
|
||||||
if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
|
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||||
return;
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||||
|
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
input.checked = !this._element.classList.contains(ClassName.ACTIVE);
|
if (!this.shouldAvoidTriggerChange) {
|
||||||
$(input).trigger('change');
|
$__default['default'](input).trigger('change');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input.focus();
|
input.focus();
|
||||||
|
|
@ -108,30 +94,35 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addAriaPressed) {
|
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||||
this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
|
if (addAriaPressed) {
|
||||||
}
|
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
|
||||||
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
if (triggerChangeEvent) {
|
||||||
$(this._element).toggleClass(ClassName.ACTIVE);
|
$__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
Button._jQueryInterface = function _jQueryInterface(config) {
|
Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var $element = $__default['default'](this);
|
||||||
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Button(this);
|
data = new Button(this);
|
||||||
$(this).data(DATA_KEY, data);
|
$element.data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.shouldAvoidTriggerChange = avoidTriggerChange;
|
||||||
|
|
||||||
if (config === 'toggle') {
|
if (config === 'toggle') {
|
||||||
data[config]();
|
data[config]();
|
||||||
}
|
}
|
||||||
|
|
@ -154,18 +145,61 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||||
event.preventDefault();
|
|
||||||
var button = event.target;
|
var button = event.target;
|
||||||
|
var initialButton = button;
|
||||||
|
|
||||||
if (!$(button).hasClass(ClassName.BUTTON)) {
|
if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) {
|
||||||
button = $(button).closest(Selector.BUTTON);
|
button = $__default['default'](button).closest(SELECTOR_BUTTON)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
Button._jQueryInterface.call($(button), 'toggle');
|
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||||
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
event.preventDefault(); // work around Firefox bug #1540995
|
||||||
var button = $(event.target).closest(Selector.BUTTON)[0];
|
} else {
|
||||||
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
var inputBtn = button.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
|
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||||
|
event.preventDefault(); // work around Firefox bug #1540995
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
|
||||||
|
Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
|
||||||
|
var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0];
|
||||||
|
$__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
|
||||||
|
});
|
||||||
|
$__default['default'](window).on(EVENT_LOAD_DATA_API, function () {
|
||||||
|
// ensure correct active class is set to match the controls' actual values/states
|
||||||
|
// find all checkboxes/readio buttons inside data-toggle groups
|
||||||
|
var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
|
||||||
|
|
||||||
|
for (var i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
var button = buttons[i];
|
||||||
|
var input = button.querySelector(SELECTOR_INPUT);
|
||||||
|
|
||||||
|
if (input.checked || input.hasAttribute('checked')) {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE);
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
} // find all button toggles
|
||||||
|
|
||||||
|
|
||||||
|
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
|
for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
|
||||||
|
var _button = buttons[_i];
|
||||||
|
|
||||||
|
if (_button.getAttribute('aria-pressed') === 'true') {
|
||||||
|
_button.classList.add(CLASS_NAME_ACTIVE);
|
||||||
|
} else {
|
||||||
|
_button.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -173,15 +207,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Button._jQueryInterface;
|
$__default['default'].fn[NAME] = Button._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Button;
|
$__default['default'].fn[NAME].Constructor = Button;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Button._jQueryInterface;
|
return Button._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Button;
|
return Button;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=button.js.map
|
//# sourceMappingURL=button.js.map
|
||||||
|
|
|
||||||
2
js/dist/button.js.map
vendored
2
js/dist/button.js.map
vendored
File diff suppressed because one or more lines are too long
317
js/dist/carousel.js
vendored
317
js/dist/carousel.js
vendored
|
|
@ -1,67 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap carousel.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap carousel.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Carousel = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -69,11 +26,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'carousel';
|
var NAME = 'carousel';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.carousel';
|
var DATA_KEY = 'bs.carousel';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
|
||||||
|
|
||||||
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
|
||||||
|
|
@ -97,62 +54,50 @@
|
||||||
wrap: 'boolean',
|
wrap: 'boolean',
|
||||||
touch: 'boolean'
|
touch: 'boolean'
|
||||||
};
|
};
|
||||||
var Direction = {
|
var DIRECTION_NEXT = 'next';
|
||||||
NEXT: 'next',
|
var DIRECTION_PREV = 'prev';
|
||||||
PREV: 'prev',
|
var DIRECTION_LEFT = 'left';
|
||||||
LEFT: 'left',
|
var DIRECTION_RIGHT = 'right';
|
||||||
RIGHT: 'right'
|
var EVENT_SLIDE = "slide" + EVENT_KEY;
|
||||||
};
|
var EVENT_SLID = "slid" + EVENT_KEY;
|
||||||
var Event = {
|
var EVENT_KEYDOWN = "keydown" + EVENT_KEY;
|
||||||
SLIDE: "slide" + EVENT_KEY,
|
var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY;
|
||||||
SLID: "slid" + EVENT_KEY,
|
var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY;
|
||||||
KEYDOWN: "keydown" + EVENT_KEY,
|
var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY;
|
||||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY;
|
||||||
MOUSELEAVE: "mouseleave" + EVENT_KEY,
|
var EVENT_TOUCHEND = "touchend" + EVENT_KEY;
|
||||||
TOUCHSTART: "touchstart" + EVENT_KEY,
|
var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY;
|
||||||
TOUCHMOVE: "touchmove" + EVENT_KEY,
|
var EVENT_POINTERUP = "pointerup" + EVENT_KEY;
|
||||||
TOUCHEND: "touchend" + EVENT_KEY,
|
var EVENT_DRAG_START = "dragstart" + EVENT_KEY;
|
||||||
POINTERDOWN: "pointerdown" + EVENT_KEY,
|
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||||
POINTERUP: "pointerup" + EVENT_KEY,
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
DRAG_START: "dragstart" + EVENT_KEY,
|
var CLASS_NAME_CAROUSEL = 'carousel';
|
||||||
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_SLIDE = 'slide';
|
||||||
};
|
var CLASS_NAME_RIGHT = 'carousel-item-right';
|
||||||
var ClassName = {
|
var CLASS_NAME_LEFT = 'carousel-item-left';
|
||||||
CAROUSEL: 'carousel',
|
var CLASS_NAME_NEXT = 'carousel-item-next';
|
||||||
ACTIVE: 'active',
|
var CLASS_NAME_PREV = 'carousel-item-prev';
|
||||||
SLIDE: 'slide',
|
var CLASS_NAME_POINTER_EVENT = 'pointer-event';
|
||||||
RIGHT: 'carousel-item-right',
|
var SELECTOR_ACTIVE = '.active';
|
||||||
LEFT: 'carousel-item-left',
|
var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
|
||||||
NEXT: 'carousel-item-next',
|
var SELECTOR_ITEM = '.carousel-item';
|
||||||
PREV: 'carousel-item-prev',
|
var SELECTOR_ITEM_IMG = '.carousel-item img';
|
||||||
ITEM: 'carousel-item',
|
var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
|
||||||
POINTER_EVENT: 'pointer-event'
|
var SELECTOR_INDICATORS = '.carousel-indicators';
|
||||||
};
|
var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
|
||||||
var Selector = {
|
var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
|
||||||
ACTIVE: '.active',
|
|
||||||
ACTIVE_ITEM: '.active.carousel-item',
|
|
||||||
ITEM: '.carousel-item',
|
|
||||||
ITEM_IMG: '.carousel-item img',
|
|
||||||
NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
|
|
||||||
INDICATORS: '.carousel-indicators',
|
|
||||||
DATA_SLIDE: '[data-slide], [data-slide-to]',
|
|
||||||
DATA_RIDE: '[data-ride="carousel"]'
|
|
||||||
};
|
|
||||||
var PointerType = {
|
var PointerType = {
|
||||||
TOUCH: 'touch',
|
TOUCH: 'touch',
|
||||||
PEN: 'pen'
|
PEN: 'pen'
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
var Carousel =
|
var Carousel = /*#__PURE__*/function () {
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Carousel(element, config) {
|
function Carousel(element, config) {
|
||||||
this._items = null;
|
this._items = null;
|
||||||
this._interval = null;
|
this._interval = null;
|
||||||
|
|
@ -164,7 +109,7 @@
|
||||||
this.touchDeltaX = 0;
|
this.touchDeltaX = 0;
|
||||||
this._config = this._getConfig(config);
|
this._config = this._getConfig(config);
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS);
|
this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
|
||||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
|
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
|
||||||
|
|
||||||
|
|
@ -177,21 +122,22 @@
|
||||||
// Public
|
// Public
|
||||||
_proto.next = function next() {
|
_proto.next = function next() {
|
||||||
if (!this._isSliding) {
|
if (!this._isSliding) {
|
||||||
this._slide(Direction.NEXT);
|
this._slide(DIRECTION_NEXT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.nextWhenVisible = function nextWhenVisible() {
|
_proto.nextWhenVisible = function nextWhenVisible() {
|
||||||
// Don't call next when the page isn't visible
|
var $element = $__default['default'](this._element); // Don't call next when the page isn't visible
|
||||||
// or the carousel or its parent isn't visible
|
// or the carousel or its parent isn't visible
|
||||||
if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
|
|
||||||
|
if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {
|
||||||
this.next();
|
this.next();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.prev = function prev() {
|
_proto.prev = function prev() {
|
||||||
if (!this._isSliding) {
|
if (!this._isSliding) {
|
||||||
this._slide(Direction.PREV);
|
this._slide(DIRECTION_PREV);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -200,8 +146,8 @@
|
||||||
this._isPaused = true;
|
this._isPaused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._element.querySelector(Selector.NEXT_PREV)) {
|
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||||
Util.triggerTransitionEnd(this._element);
|
Util__default['default'].triggerTransitionEnd(this._element);
|
||||||
this.cycle(true);
|
this.cycle(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,7 +173,7 @@
|
||||||
_proto.to = function to(index) {
|
_proto.to = function to(index) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||||
|
|
||||||
var activeIndex = this._getItemIndex(this._activeElement);
|
var activeIndex = this._getItemIndex(this._activeElement);
|
||||||
|
|
||||||
|
|
@ -236,7 +182,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._isSliding) {
|
if (this._isSliding) {
|
||||||
$(this._element).one(Event.SLID, function () {
|
$__default['default'](this._element).one(EVENT_SLID, function () {
|
||||||
return _this.to(index);
|
return _this.to(index);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
@ -248,14 +194,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
|
var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
|
||||||
|
|
||||||
this._slide(direction, this._items[index]);
|
this._slide(direction, this._items[index]);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$(this._element).off(EVENT_KEY);
|
$__default['default'](this._element).off(EVENT_KEY);
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._items = null;
|
this._items = null;
|
||||||
this._config = null;
|
this._config = null;
|
||||||
this._element = null;
|
this._element = null;
|
||||||
|
|
@ -268,8 +214,8 @@
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, Default, config);
|
config = _extends({}, Default, config);
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -280,7 +226,8 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var direction = absDeltax / this.touchDeltaX; // swipe left
|
var direction = absDeltax / this.touchDeltaX;
|
||||||
|
this.touchDeltaX = 0; // swipe left
|
||||||
|
|
||||||
if (direction > 0) {
|
if (direction > 0) {
|
||||||
this.prev();
|
this.prev();
|
||||||
|
|
@ -296,15 +243,15 @@
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
if (this._config.keyboard) {
|
if (this._config.keyboard) {
|
||||||
$(this._element).on(Event.KEYDOWN, function (event) {
|
$__default['default'](this._element).on(EVENT_KEYDOWN, function (event) {
|
||||||
return _this2._keydown(event);
|
return _this2._keydown(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._config.pause === 'hover') {
|
if (this._config.pause === 'hover') {
|
||||||
$(this._element).on(Event.MOUSEENTER, function (event) {
|
$__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) {
|
||||||
return _this2.pause(event);
|
return _this2.pause(event);
|
||||||
}).on(Event.MOUSELEAVE, function (event) {
|
}).on(EVENT_MOUSELEAVE, function (event) {
|
||||||
return _this2.cycle(event);
|
return _this2.cycle(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -365,27 +312,27 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, function (e) {
|
$__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
|
||||||
return e.preventDefault();
|
return e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this._pointerEvent) {
|
if (this._pointerEvent) {
|
||||||
$(this._element).on(Event.POINTERDOWN, function (event) {
|
$__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) {
|
||||||
return start(event);
|
return start(event);
|
||||||
});
|
});
|
||||||
$(this._element).on(Event.POINTERUP, function (event) {
|
$__default['default'](this._element).on(EVENT_POINTERUP, function (event) {
|
||||||
return end(event);
|
return end(event);
|
||||||
});
|
});
|
||||||
|
|
||||||
this._element.classList.add(ClassName.POINTER_EVENT);
|
this._element.classList.add(CLASS_NAME_POINTER_EVENT);
|
||||||
} else {
|
} else {
|
||||||
$(this._element).on(Event.TOUCHSTART, function (event) {
|
$__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) {
|
||||||
return start(event);
|
return start(event);
|
||||||
});
|
});
|
||||||
$(this._element).on(Event.TOUCHMOVE, function (event) {
|
$__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) {
|
||||||
return move(event);
|
return move(event);
|
||||||
});
|
});
|
||||||
$(this._element).on(Event.TOUCHEND, function (event) {
|
$__default['default'](this._element).on(EVENT_TOUCHEND, function (event) {
|
||||||
return end(event);
|
return end(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -406,19 +353,17 @@
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.next();
|
this.next();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getItemIndex = function _getItemIndex(element) {
|
_proto._getItemIndex = function _getItemIndex(element) {
|
||||||
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM)) : [];
|
this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
|
||||||
return this._items.indexOf(element);
|
return this._items.indexOf(element);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
_proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
|
||||||
var isNextDirection = direction === Direction.NEXT;
|
var isNextDirection = direction === DIRECTION_NEXT;
|
||||||
var isPrevDirection = direction === Direction.PREV;
|
var isPrevDirection = direction === DIRECTION_PREV;
|
||||||
|
|
||||||
var activeIndex = this._getItemIndex(activeElement);
|
var activeIndex = this._getItemIndex(activeElement);
|
||||||
|
|
||||||
|
|
@ -429,7 +374,7 @@
|
||||||
return activeElement;
|
return activeElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
var delta = direction === Direction.PREV ? -1 : 1;
|
var delta = direction === DIRECTION_PREV ? -1 : 1;
|
||||||
var itemIndex = (activeIndex + delta) % this._items.length;
|
var itemIndex = (activeIndex + delta) % this._items.length;
|
||||||
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
||||||
};
|
};
|
||||||
|
|
@ -437,27 +382,27 @@
|
||||||
_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
_proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||||
var targetIndex = this._getItemIndex(relatedTarget);
|
var targetIndex = this._getItemIndex(relatedTarget);
|
||||||
|
|
||||||
var fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM));
|
var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
|
||||||
|
|
||||||
var slideEvent = $.Event(Event.SLIDE, {
|
var slideEvent = $__default['default'].Event(EVENT_SLIDE, {
|
||||||
relatedTarget: relatedTarget,
|
relatedTarget: relatedTarget,
|
||||||
direction: eventDirectionName,
|
direction: eventDirectionName,
|
||||||
from: fromIndex,
|
from: fromIndex,
|
||||||
to: targetIndex
|
to: targetIndex
|
||||||
});
|
});
|
||||||
$(this._element).trigger(slideEvent);
|
$__default['default'](this._element).trigger(slideEvent);
|
||||||
return slideEvent;
|
return slideEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
|
||||||
if (this._indicatorsElement) {
|
if (this._indicatorsElement) {
|
||||||
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE));
|
var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE));
|
||||||
$(indicators).removeClass(ClassName.ACTIVE);
|
$__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE);
|
||||||
|
|
||||||
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
|
||||||
|
|
||||||
if (nextIndicator) {
|
if (nextIndicator) {
|
||||||
$(nextIndicator).addClass(ClassName.ACTIVE);
|
$__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -465,7 +410,7 @@
|
||||||
_proto._slide = function _slide(direction, element) {
|
_proto._slide = function _slide(direction, element) {
|
||||||
var _this4 = this;
|
var _this4 = this;
|
||||||
|
|
||||||
var activeElement = this._element.querySelector(Selector.ACTIVE_ITEM);
|
var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
|
||||||
|
|
||||||
var activeElementIndex = this._getItemIndex(activeElement);
|
var activeElementIndex = this._getItemIndex(activeElement);
|
||||||
|
|
||||||
|
|
@ -478,17 +423,17 @@
|
||||||
var orderClassName;
|
var orderClassName;
|
||||||
var eventDirectionName;
|
var eventDirectionName;
|
||||||
|
|
||||||
if (direction === Direction.NEXT) {
|
if (direction === DIRECTION_NEXT) {
|
||||||
directionalClassName = ClassName.LEFT;
|
directionalClassName = CLASS_NAME_LEFT;
|
||||||
orderClassName = ClassName.NEXT;
|
orderClassName = CLASS_NAME_NEXT;
|
||||||
eventDirectionName = Direction.LEFT;
|
eventDirectionName = DIRECTION_LEFT;
|
||||||
} else {
|
} else {
|
||||||
directionalClassName = ClassName.RIGHT;
|
directionalClassName = CLASS_NAME_RIGHT;
|
||||||
orderClassName = ClassName.PREV;
|
orderClassName = CLASS_NAME_PREV;
|
||||||
eventDirectionName = Direction.RIGHT;
|
eventDirectionName = DIRECTION_RIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||||
this._isSliding = false;
|
this._isSliding = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -512,18 +457,18 @@
|
||||||
|
|
||||||
this._setActiveIndicatorElement(nextElement);
|
this._setActiveIndicatorElement(nextElement);
|
||||||
|
|
||||||
var slidEvent = $.Event(Event.SLID, {
|
var slidEvent = $__default['default'].Event(EVENT_SLID, {
|
||||||
relatedTarget: nextElement,
|
relatedTarget: nextElement,
|
||||||
direction: eventDirectionName,
|
direction: eventDirectionName,
|
||||||
from: activeElementIndex,
|
from: activeElementIndex,
|
||||||
to: nextElementIndex
|
to: nextElementIndex
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.SLIDE)) {
|
if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||||
$(nextElement).addClass(orderClassName);
|
$__default['default'](nextElement).addClass(orderClassName);
|
||||||
Util.reflow(nextElement);
|
Util__default['default'].reflow(nextElement);
|
||||||
$(activeElement).addClass(directionalClassName);
|
$__default['default'](activeElement).addClass(directionalClassName);
|
||||||
$(nextElement).addClass(directionalClassName);
|
$__default['default'](nextElement).addClass(directionalClassName);
|
||||||
var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
|
var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
|
||||||
|
|
||||||
if (nextElementInterval) {
|
if (nextElementInterval) {
|
||||||
|
|
@ -533,20 +478,20 @@
|
||||||
this._config.interval = this._config.defaultInterval || this._config.interval;
|
this._config.interval = this._config.defaultInterval || this._config.interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(activeElement);
|
||||||
$(activeElement).one(Util.TRANSITION_END, function () {
|
$__default['default'](activeElement).one(Util__default['default'].TRANSITION_END, function () {
|
||||||
$(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
|
$__default['default'](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE);
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
|
$__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE + " " + orderClassName + " " + directionalClassName);
|
||||||
_this4._isSliding = false;
|
_this4._isSliding = false;
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
return $(_this4._element).trigger(slidEvent);
|
return $__default['default'](_this4._element).trigger(slidEvent);
|
||||||
}, 0);
|
}, 0);
|
||||||
}).emulateTransitionEnd(transitionDuration);
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE);
|
$__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE);
|
||||||
$(nextElement).addClass(ClassName.ACTIVE);
|
$__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE);
|
||||||
this._isSliding = false;
|
this._isSliding = false;
|
||||||
$(this._element).trigger(slidEvent);
|
$__default['default'](this._element).trigger(slidEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCycling) {
|
if (isCycling) {
|
||||||
|
|
@ -557,19 +502,19 @@
|
||||||
|
|
||||||
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
Carousel._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var data = $__default['default'](this).data(DATA_KEY);
|
||||||
|
|
||||||
var _config = _objectSpread({}, Default, $(this).data());
|
var _config = _extends({}, Default, $__default['default'](this).data());
|
||||||
|
|
||||||
if (typeof config === 'object') {
|
if (typeof config === 'object') {
|
||||||
_config = _objectSpread({}, _config, config);
|
_config = _extends({}, _config, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
var action = typeof config === 'string' ? config : _config.slide;
|
var action = typeof config === 'string' ? config : _config.slide;
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Carousel(this, _config);
|
data = new Carousel(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$__default['default'](this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'number') {
|
if (typeof config === 'number') {
|
||||||
|
|
@ -588,19 +533,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
|
||||||
var selector = Util.getSelectorFromElement(this);
|
var selector = Util__default['default'].getSelectorFromElement(this);
|
||||||
|
|
||||||
if (!selector) {
|
if (!selector) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var target = $(selector)[0];
|
var target = $__default['default'](selector)[0];
|
||||||
|
|
||||||
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = _objectSpread({}, $(target).data(), $(this).data());
|
var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
|
||||||
|
|
||||||
var slideIndex = this.getAttribute('data-slide-to');
|
var slideIndex = this.getAttribute('data-slide-to');
|
||||||
|
|
||||||
|
|
@ -608,10 +553,10 @@
|
||||||
config.interval = false;
|
config.interval = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel._jQueryInterface.call($(target), config);
|
Carousel._jQueryInterface.call($__default['default'](target), config);
|
||||||
|
|
||||||
if (slideIndex) {
|
if (slideIndex) {
|
||||||
$(target).data(DATA_KEY).to(slideIndex);
|
$__default['default'](target).data(DATA_KEY).to(slideIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -638,12 +583,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
|
||||||
$(window).on(Event.LOAD_DATA_API, function () {
|
$__default['default'](window).on(EVENT_LOAD_DATA_API, function () {
|
||||||
var carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE));
|
var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
|
||||||
|
|
||||||
for (var i = 0, len = carousels.length; i < len; i++) {
|
for (var i = 0, len = carousels.length; i < len; i++) {
|
||||||
var $carousel = $(carousels[i]);
|
var $carousel = $__default['default'](carousels[i]);
|
||||||
|
|
||||||
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
Carousel._jQueryInterface.call($carousel, $carousel.data());
|
||||||
}
|
}
|
||||||
|
|
@ -654,15 +599,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Carousel._jQueryInterface;
|
$__default['default'].fn[NAME] = Carousel._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Carousel;
|
$__default['default'].fn[NAME].Constructor = Carousel;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Carousel._jQueryInterface;
|
return Carousel._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Carousel;
|
return Carousel;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=carousel.js.map
|
//# sourceMappingURL=carousel.js.map
|
||||||
|
|
|
||||||
2
js/dist/carousel.js.map
vendored
2
js/dist/carousel.js.map
vendored
File diff suppressed because one or more lines are too long
226
js/dist/collapse.js
vendored
226
js/dist/collapse.js
vendored
|
|
@ -1,67 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap collapse.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap collapse.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Collapse = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -69,11 +26,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'collapse';
|
var NAME = 'collapse';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.collapse';
|
var DATA_KEY = 'bs.collapse';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var Default = {
|
var Default = {
|
||||||
toggle: true,
|
toggle: true,
|
||||||
parent: ''
|
parent: ''
|
||||||
|
|
@ -82,47 +39,36 @@
|
||||||
toggle: 'boolean',
|
toggle: 'boolean',
|
||||||
parent: '(string|element)'
|
parent: '(string|element)'
|
||||||
};
|
};
|
||||||
var Event = {
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
SHOW: "show" + EVENT_KEY,
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
SHOWN: "shown" + EVENT_KEY,
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
HIDE: "hide" + EVENT_KEY,
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_SHOW = 'show';
|
||||||
};
|
var CLASS_NAME_COLLAPSE = 'collapse';
|
||||||
var ClassName = {
|
var CLASS_NAME_COLLAPSING = 'collapsing';
|
||||||
SHOW: 'show',
|
var CLASS_NAME_COLLAPSED = 'collapsed';
|
||||||
COLLAPSE: 'collapse',
|
var DIMENSION_WIDTH = 'width';
|
||||||
COLLAPSING: 'collapsing',
|
var DIMENSION_HEIGHT = 'height';
|
||||||
COLLAPSED: 'collapsed'
|
var SELECTOR_ACTIVES = '.show, .collapsing';
|
||||||
};
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]';
|
||||||
var Dimension = {
|
/**
|
||||||
WIDTH: 'width',
|
* ------------------------------------------------------------------------
|
||||||
HEIGHT: 'height'
|
* Class Definition
|
||||||
};
|
* ------------------------------------------------------------------------
|
||||||
var Selector = {
|
*/
|
||||||
ACTIVES: '.show, .collapsing',
|
|
||||||
DATA_TOGGLE: '[data-toggle="collapse"]'
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Collapse = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Collapse =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Collapse(element, config) {
|
function Collapse(element, config) {
|
||||||
this._isTransitioning = false;
|
this._isTransitioning = false;
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._config = this._getConfig(config);
|
this._config = this._getConfig(config);
|
||||||
this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
|
this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
|
||||||
var toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
|
var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||||
var elem = toggleList[i];
|
var elem = toggleList[i];
|
||||||
var selector = Util.getSelectorFromElement(elem);
|
var selector = Util__default['default'].getSelectorFromElement(elem);
|
||||||
var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
|
var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
|
||||||
return foundElem === element;
|
return foundElem === element;
|
||||||
});
|
});
|
||||||
|
|
@ -150,7 +96,7 @@
|
||||||
|
|
||||||
// Public
|
// Public
|
||||||
_proto.toggle = function toggle() {
|
_proto.toggle = function toggle() {
|
||||||
if ($(this._element).hasClass(ClassName.SHOW)) {
|
if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
this.hide();
|
this.hide();
|
||||||
} else {
|
} else {
|
||||||
this.show();
|
this.show();
|
||||||
|
|
@ -160,7 +106,7 @@
|
||||||
_proto.show = function show() {
|
_proto.show = function show() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) {
|
if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,12 +114,12 @@
|
||||||
var activesData;
|
var activesData;
|
||||||
|
|
||||||
if (this._parent) {
|
if (this._parent) {
|
||||||
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES)).filter(function (elem) {
|
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
|
||||||
if (typeof _this._config.parent === 'string') {
|
if (typeof _this._config.parent === 'string') {
|
||||||
return elem.getAttribute('data-parent') === _this._config.parent;
|
return elem.getAttribute('data-parent') === _this._config.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return elem.classList.contains(ClassName.COLLAPSE);
|
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (actives.length === 0) {
|
if (actives.length === 0) {
|
||||||
|
|
@ -182,64 +128,64 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actives) {
|
if (actives) {
|
||||||
activesData = $(actives).not(this._selector).data(DATA_KEY);
|
activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY);
|
||||||
|
|
||||||
if (activesData && activesData._isTransitioning) {
|
if (activesData && activesData._isTransitioning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var startEvent = $.Event(Event.SHOW);
|
var startEvent = $__default['default'].Event(EVENT_SHOW);
|
||||||
$(this._element).trigger(startEvent);
|
$__default['default'](this._element).trigger(startEvent);
|
||||||
|
|
||||||
if (startEvent.isDefaultPrevented()) {
|
if (startEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actives) {
|
if (actives) {
|
||||||
Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
|
Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide');
|
||||||
|
|
||||||
if (!activesData) {
|
if (!activesData) {
|
||||||
$(actives).data(DATA_KEY, null);
|
$__default['default'](actives).data(DATA_KEY, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var dimension = this._getDimension();
|
var dimension = this._getDimension();
|
||||||
|
|
||||||
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
|
$__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
|
||||||
this._element.style[dimension] = 0;
|
this._element.style[dimension] = 0;
|
||||||
|
|
||||||
if (this._triggerArray.length) {
|
if (this._triggerArray.length) {
|
||||||
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
|
$__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setTransitioning(true);
|
this.setTransitioning(true);
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
$(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
|
$__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||||
_this._element.style[dimension] = '';
|
_this._element.style[dimension] = '';
|
||||||
|
|
||||||
_this.setTransitioning(false);
|
_this.setTransitioning(false);
|
||||||
|
|
||||||
$(_this._element).trigger(Event.SHOWN);
|
$__default['default'](_this._element).trigger(EVENT_SHOWN);
|
||||||
};
|
};
|
||||||
|
|
||||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||||
var scrollSize = "scroll" + capitalizedDimension;
|
var scrollSize = "scroll" + capitalizedDimension;
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._element);
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
this._element.style[dimension] = this._element[scrollSize] + "px";
|
this._element.style[dimension] = this._element[scrollSize] + "px";
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.hide = function hide() {
|
_proto.hide = function hide() {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) {
|
if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var startEvent = $.Event(Event.HIDE);
|
var startEvent = $__default['default'].Event(EVENT_HIDE);
|
||||||
$(this._element).trigger(startEvent);
|
$__default['default'](this._element).trigger(startEvent);
|
||||||
|
|
||||||
if (startEvent.isDefaultPrevented()) {
|
if (startEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -248,20 +194,20 @@
|
||||||
var dimension = this._getDimension();
|
var dimension = this._getDimension();
|
||||||
|
|
||||||
this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
|
this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
|
||||||
Util.reflow(this._element);
|
Util__default['default'].reflow(this._element);
|
||||||
$(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
|
$__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW);
|
||||||
var triggerArrayLength = this._triggerArray.length;
|
var triggerArrayLength = this._triggerArray.length;
|
||||||
|
|
||||||
if (triggerArrayLength > 0) {
|
if (triggerArrayLength > 0) {
|
||||||
for (var i = 0; i < triggerArrayLength; i++) {
|
for (var i = 0; i < triggerArrayLength; i++) {
|
||||||
var trigger = this._triggerArray[i];
|
var trigger = this._triggerArray[i];
|
||||||
var selector = Util.getSelectorFromElement(trigger);
|
var selector = Util__default['default'].getSelectorFromElement(trigger);
|
||||||
|
|
||||||
if (selector !== null) {
|
if (selector !== null) {
|
||||||
var $elem = $([].slice.call(document.querySelectorAll(selector)));
|
var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector)));
|
||||||
|
|
||||||
if (!$elem.hasClass(ClassName.SHOW)) {
|
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||||
$(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
|
$__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -272,12 +218,12 @@
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
_this2.setTransitioning(false);
|
_this2.setTransitioning(false);
|
||||||
|
|
||||||
$(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
|
$__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
|
||||||
};
|
};
|
||||||
|
|
||||||
this._element.style[dimension] = '';
|
this._element.style[dimension] = '';
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._element);
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.setTransitioning = function setTransitioning(isTransitioning) {
|
_proto.setTransitioning = function setTransitioning(isTransitioning) {
|
||||||
|
|
@ -285,7 +231,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._config = null;
|
this._config = null;
|
||||||
this._parent = null;
|
this._parent = null;
|
||||||
this._element = null;
|
this._element = null;
|
||||||
|
|
@ -295,16 +241,16 @@
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, Default, config);
|
config = _extends({}, Default, config);
|
||||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||||
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getDimension = function _getDimension() {
|
_proto._getDimension = function _getDimension() {
|
||||||
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
|
var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH);
|
||||||
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
|
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getParent = function _getParent() {
|
_proto._getParent = function _getParent() {
|
||||||
|
|
@ -312,7 +258,7 @@
|
||||||
|
|
||||||
var parent;
|
var parent;
|
||||||
|
|
||||||
if (Util.isElement(this._config.parent)) {
|
if (Util__default['default'].isElement(this._config.parent)) {
|
||||||
parent = this._config.parent; // It's a jQuery object
|
parent = this._config.parent; // It's a jQuery object
|
||||||
|
|
||||||
if (typeof this._config.parent.jquery !== 'undefined') {
|
if (typeof this._config.parent.jquery !== 'undefined') {
|
||||||
|
|
@ -324,40 +270,40 @@
|
||||||
|
|
||||||
var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
|
var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
|
||||||
var children = [].slice.call(parent.querySelectorAll(selector));
|
var children = [].slice.call(parent.querySelectorAll(selector));
|
||||||
$(children).each(function (i, element) {
|
$__default['default'](children).each(function (i, element) {
|
||||||
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
_this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
|
||||||
});
|
});
|
||||||
return parent;
|
return parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
|
||||||
var isOpen = $(element).hasClass(ClassName.SHOW);
|
var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
if (triggerArray.length) {
|
if (triggerArray.length) {
|
||||||
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
$__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
|
||||||
}
|
}
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
|
||||||
var selector = Util.getSelectorFromElement(element);
|
var selector = Util__default['default'].getSelectorFromElement(element);
|
||||||
return selector ? document.querySelector(selector) : null;
|
return selector ? document.querySelector(selector) : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
Collapse._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this);
|
var $element = $__default['default'](this);
|
||||||
var data = $this.data(DATA_KEY);
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config ? config : {});
|
var _config = _extends({}, Default, $element.data(), typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
if (!data && _config.toggle && /show|hide/.test(config)) {
|
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||||
_config.toggle = false;
|
_config.toggle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Collapse(this, _config);
|
data = new Collapse(this, _config);
|
||||||
$this.data(DATA_KEY, data);
|
$element.data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -391,17 +337,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
||||||
if (event.currentTarget.tagName === 'A') {
|
if (event.currentTarget.tagName === 'A') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
var $trigger = $(this);
|
var $trigger = $__default['default'](this);
|
||||||
var selector = Util.getSelectorFromElement(this);
|
var selector = Util__default['default'].getSelectorFromElement(this);
|
||||||
var selectors = [].slice.call(document.querySelectorAll(selector));
|
var selectors = [].slice.call(document.querySelectorAll(selector));
|
||||||
$(selectors).each(function () {
|
$__default['default'](selectors).each(function () {
|
||||||
var $target = $(this);
|
var $target = $__default['default'](this);
|
||||||
var data = $target.data(DATA_KEY);
|
var data = $target.data(DATA_KEY);
|
||||||
var config = data ? 'toggle' : $trigger.data();
|
var config = data ? 'toggle' : $trigger.data();
|
||||||
|
|
||||||
|
|
@ -414,15 +360,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Collapse._jQueryInterface;
|
$__default['default'].fn[NAME] = Collapse._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Collapse;
|
$__default['default'].fn[NAME].Constructor = Collapse;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Collapse._jQueryInterface;
|
return Collapse._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Collapse;
|
return Collapse;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=collapse.js.map
|
//# sourceMappingURL=collapse.js.map
|
||||||
|
|
|
||||||
2
js/dist/collapse.js.map
vendored
2
js/dist/collapse.js.map
vendored
File diff suppressed because one or more lines are too long
359
js/dist/dropdown.js
vendored
359
js/dist/dropdown.js
vendored
|
|
@ -1,68 +1,25 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap dropdown.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap dropdown.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||||
(global = global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
|
||||||
}(this, function ($, Popper, Util) { 'use strict';
|
}(this, (function ($, Popper, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
|
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||||
var descriptor = props[i];
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -70,11 +27,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'dropdown';
|
var NAME = 'dropdown';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.dropdown';
|
var DATA_KEY = 'bs.dropdown';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||||
|
|
||||||
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
|
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
|
||||||
|
|
@ -88,67 +45,55 @@
|
||||||
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||||
|
|
||||||
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
|
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
|
||||||
var Event = {
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
HIDE: "hide" + EVENT_KEY,
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
SHOW: "show" + EVENT_KEY,
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
SHOWN: "shown" + EVENT_KEY,
|
var EVENT_CLICK = "click" + EVENT_KEY;
|
||||||
CLICK: "click" + EVENT_KEY,
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY + DATA_API_KEY;
|
||||||
KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
|
var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY + DATA_API_KEY;
|
||||||
KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_DISABLED = 'disabled';
|
||||||
};
|
var CLASS_NAME_SHOW = 'show';
|
||||||
var ClassName = {
|
var CLASS_NAME_DROPUP = 'dropup';
|
||||||
DISABLED: 'disabled',
|
var CLASS_NAME_DROPRIGHT = 'dropright';
|
||||||
SHOW: 'show',
|
var CLASS_NAME_DROPLEFT = 'dropleft';
|
||||||
DROPUP: 'dropup',
|
var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
|
||||||
DROPRIGHT: 'dropright',
|
var CLASS_NAME_POSITION_STATIC = 'position-static';
|
||||||
DROPLEFT: 'dropleft',
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]';
|
||||||
MENURIGHT: 'dropdown-menu-right',
|
var SELECTOR_FORM_CHILD = '.dropdown form';
|
||||||
MENULEFT: 'dropdown-menu-left',
|
var SELECTOR_MENU = '.dropdown-menu';
|
||||||
POSITION_STATIC: 'position-static'
|
var SELECTOR_NAVBAR_NAV = '.navbar-nav';
|
||||||
};
|
var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
|
||||||
var Selector = {
|
var PLACEMENT_TOP = 'top-start';
|
||||||
DATA_TOGGLE: '[data-toggle="dropdown"]',
|
var PLACEMENT_TOPEND = 'top-end';
|
||||||
FORM_CHILD: '.dropdown form',
|
var PLACEMENT_BOTTOM = 'bottom-start';
|
||||||
MENU: '.dropdown-menu',
|
var PLACEMENT_BOTTOMEND = 'bottom-end';
|
||||||
NAVBAR_NAV: '.navbar-nav',
|
var PLACEMENT_RIGHT = 'right-start';
|
||||||
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
var PLACEMENT_LEFT = 'left-start';
|
||||||
};
|
|
||||||
var AttachmentMap = {
|
|
||||||
TOP: 'top-start',
|
|
||||||
TOPEND: 'top-end',
|
|
||||||
BOTTOM: 'bottom-start',
|
|
||||||
BOTTOMEND: 'bottom-end',
|
|
||||||
RIGHT: 'right-start',
|
|
||||||
RIGHTEND: 'right-end',
|
|
||||||
LEFT: 'left-start',
|
|
||||||
LEFTEND: 'left-end'
|
|
||||||
};
|
|
||||||
var Default = {
|
var Default = {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
flip: true,
|
flip: true,
|
||||||
boundary: 'scrollParent',
|
boundary: 'scrollParent',
|
||||||
reference: 'toggle',
|
reference: 'toggle',
|
||||||
display: 'dynamic'
|
display: 'dynamic',
|
||||||
|
popperConfig: null
|
||||||
};
|
};
|
||||||
var DefaultType = {
|
var DefaultType = {
|
||||||
offset: '(number|string|function)',
|
offset: '(number|string|function)',
|
||||||
flip: 'boolean',
|
flip: 'boolean',
|
||||||
boundary: '(string|element)',
|
boundary: '(string|element)',
|
||||||
reference: '(string|element)',
|
reference: '(string|element)',
|
||||||
display: 'string'
|
display: 'string',
|
||||||
/**
|
popperConfig: '(null|object)'
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
var Dropdown =
|
var Dropdown = /*#__PURE__*/function () {
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Dropdown(element, config) {
|
function Dropdown(element, config) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._popper = null;
|
this._popper = null;
|
||||||
|
|
@ -164,13 +109,11 @@
|
||||||
|
|
||||||
// Public
|
// Public
|
||||||
_proto.toggle = function toggle() {
|
_proto.toggle = function toggle() {
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
|
if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this._element);
|
var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
var isActive = $(this._menu).hasClass(ClassName.SHOW);
|
|
||||||
|
|
||||||
Dropdown._clearMenus();
|
Dropdown._clearMenus();
|
||||||
|
|
||||||
|
|
@ -178,23 +121,38 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.show(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto.show = function show(usePopper) {
|
||||||
|
if (usePopper === void 0) {
|
||||||
|
usePopper = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var relatedTarget = {
|
var relatedTarget = {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
};
|
};
|
||||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
var showEvent = $__default['default'].Event(EVENT_SHOW, relatedTarget);
|
||||||
$(parent).trigger(showEvent);
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
|
$__default['default'](parent).trigger(showEvent);
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented()) {
|
if (showEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
} // Disable totally Popper.js for Dropdown in Navbar
|
} // Disable totally Popper.js for Dropdown in Navbar
|
||||||
|
|
||||||
|
|
||||||
if (!this._inNavbar) {
|
if (!this._inNavbar && usePopper) {
|
||||||
/**
|
/**
|
||||||
* Check for Popper dependency
|
* Check for Popper dependency
|
||||||
* Popper - https://popper.js.org
|
* Popper - https://popper.js.org
|
||||||
*/
|
*/
|
||||||
if (typeof Popper === 'undefined') {
|
if (typeof Popper__default['default'] === 'undefined') {
|
||||||
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
|
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,7 +160,7 @@
|
||||||
|
|
||||||
if (this._config.reference === 'parent') {
|
if (this._config.reference === 'parent') {
|
||||||
referenceElement = parent;
|
referenceElement = parent;
|
||||||
} else if (Util.isElement(this._config.reference)) {
|
} else if (Util__default['default'].isElement(this._config.reference)) {
|
||||||
referenceElement = this._config.reference; // Check if it's jQuery element
|
referenceElement = this._config.reference; // Check if it's jQuery element
|
||||||
|
|
||||||
if (typeof this._config.reference.jquery !== 'undefined') {
|
if (typeof this._config.reference.jquery !== 'undefined') {
|
||||||
|
|
@ -214,75 +172,57 @@
|
||||||
|
|
||||||
|
|
||||||
if (this._config.boundary !== 'scrollParent') {
|
if (this._config.boundary !== 'scrollParent') {
|
||||||
$(parent).addClass(ClassName.POSITION_STATIC);
|
$__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
|
this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
|
||||||
} // If this is a touch-enabled device we add extra
|
} // If this is a touch-enabled device we add extra
|
||||||
// empty mouseover listeners to the body's immediate children;
|
// empty mouseover listeners to the body's immediate children;
|
||||||
// only needed because of broken event delegation on iOS
|
// only needed because of broken event delegation on iOS
|
||||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||||
|
|
||||||
|
|
||||||
if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {
|
if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||||
$(document.body).children().on('mouseover', null, $.noop);
|
$__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.focus();
|
this._element.focus();
|
||||||
|
|
||||||
this._element.setAttribute('aria-expanded', true);
|
this._element.setAttribute('aria-expanded', true);
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW);
|
$__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
|
$__default['default'](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_SHOWN, relatedTarget));
|
||||||
};
|
|
||||||
|
|
||||||
_proto.show = function show() {
|
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var relatedTarget = {
|
|
||||||
relatedTarget: this._element
|
|
||||||
};
|
|
||||||
var showEvent = $.Event(Event.SHOW, relatedTarget);
|
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this._element);
|
|
||||||
|
|
||||||
$(parent).trigger(showEvent);
|
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW);
|
|
||||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.hide = function hide() {
|
_proto.hide = function hide() {
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {
|
if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var relatedTarget = {
|
var relatedTarget = {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
};
|
};
|
||||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
var hideEvent = $__default['default'].Event(EVENT_HIDE, relatedTarget);
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this._element);
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
$(parent).trigger(hideEvent);
|
$__default['default'](parent).trigger(hideEvent);
|
||||||
|
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW);
|
if (this._popper) {
|
||||||
$(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
this._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
$__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW);
|
||||||
|
$__default['default'](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_HIDDEN, relatedTarget));
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
$(this._element).off(EVENT_KEY);
|
$__default['default'](this._element).off(EVENT_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
this._menu = null;
|
this._menu = null;
|
||||||
|
|
||||||
|
|
@ -305,7 +245,7 @@
|
||||||
_proto._addEventListeners = function _addEventListeners() {
|
_proto._addEventListeners = function _addEventListeners() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK, function (event) {
|
$__default['default'](this._element).on(EVENT_CLICK, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
|
|
@ -314,8 +254,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
|
config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config);
|
||||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -324,7 +264,7 @@
|
||||||
var parent = Dropdown._getParentFromElement(this._element);
|
var parent = Dropdown._getParentFromElement(this._element);
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
this._menu = parent.querySelector(Selector.MENU);
|
this._menu = parent.querySelector(SELECTOR_MENU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -332,28 +272,24 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getPlacement = function _getPlacement() {
|
_proto._getPlacement = function _getPlacement() {
|
||||||
var $parentDropdown = $(this._element.parentNode);
|
var $parentDropdown = $__default['default'](this._element.parentNode);
|
||||||
var placement = AttachmentMap.BOTTOM; // Handle dropup
|
var placement = PLACEMENT_BOTTOM; // Handle dropup
|
||||||
|
|
||||||
if ($parentDropdown.hasClass(ClassName.DROPUP)) {
|
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||||
placement = AttachmentMap.TOP;
|
placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
|
||||||
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||||
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
placement = PLACEMENT_RIGHT;
|
||||||
placement = AttachmentMap.TOPEND;
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||||
}
|
placement = PLACEMENT_LEFT;
|
||||||
} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
|
} else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||||
placement = AttachmentMap.RIGHT;
|
placement = PLACEMENT_BOTTOMEND;
|
||||||
} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
|
|
||||||
placement = AttachmentMap.LEFT;
|
|
||||||
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
|
||||||
placement = AttachmentMap.BOTTOMEND;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return placement;
|
return placement;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._detectNavbar = function _detectNavbar() {
|
_proto._detectNavbar = function _detectNavbar() {
|
||||||
return $(this._element).closest('.navbar').length > 0;
|
return $__default['default'](this._element).closest('.navbar').length > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getOffset = function _getOffset() {
|
_proto._getOffset = function _getOffset() {
|
||||||
|
|
@ -363,7 +299,7 @@
|
||||||
|
|
||||||
if (typeof this._config.offset === 'function') {
|
if (typeof this._config.offset === 'function') {
|
||||||
offset.fn = function (data) {
|
offset.fn = function (data) {
|
||||||
data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -384,9 +320,8 @@
|
||||||
preventOverflow: {
|
preventOverflow: {
|
||||||
boundariesElement: this._config.boundary
|
boundariesElement: this._config.boundary
|
||||||
}
|
}
|
||||||
} // Disable Popper.js if we have a static display
|
}
|
||||||
|
}; // Disable Popper.js if we have a static display
|
||||||
};
|
|
||||||
|
|
||||||
if (this._config.display === 'static') {
|
if (this._config.display === 'static') {
|
||||||
popperConfig.modifiers.applyStyle = {
|
popperConfig.modifiers.applyStyle = {
|
||||||
|
|
@ -394,19 +329,19 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return popperConfig;
|
return _extends({}, popperConfig, this._config.popperConfig);
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
Dropdown._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var data = $__default['default'](this).data(DATA_KEY);
|
||||||
|
|
||||||
var _config = typeof config === 'object' ? config : null;
|
var _config = typeof config === 'object' ? config : null;
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Dropdown(this, _config);
|
data = new Dropdown(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$__default['default'](this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -424,12 +359,12 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE));
|
var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
|
||||||
|
|
||||||
for (var i = 0, len = toggles.length; i < len; i++) {
|
for (var i = 0, len = toggles.length; i < len; i++) {
|
||||||
var parent = Dropdown._getParentFromElement(toggles[i]);
|
var parent = Dropdown._getParentFromElement(toggles[i]);
|
||||||
|
|
||||||
var context = $(toggles[i]).data(DATA_KEY);
|
var context = $__default['default'](toggles[i]).data(DATA_KEY);
|
||||||
var relatedTarget = {
|
var relatedTarget = {
|
||||||
relatedTarget: toggles[i]
|
relatedTarget: toggles[i]
|
||||||
};
|
};
|
||||||
|
|
@ -444,16 +379,16 @@
|
||||||
|
|
||||||
var dropdownMenu = context._menu;
|
var dropdownMenu = context._menu;
|
||||||
|
|
||||||
if (!$(parent).hasClass(ClassName.SHOW)) {
|
if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
|
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE, relatedTarget);
|
var hideEvent = $__default['default'].Event(EVENT_HIDE, relatedTarget);
|
||||||
$(parent).trigger(hideEvent);
|
$__default['default'](parent).trigger(hideEvent);
|
||||||
|
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -462,18 +397,23 @@
|
||||||
|
|
||||||
|
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if ('ontouchstart' in document.documentElement) {
|
||||||
$(document.body).children().off('mouseover', null, $.noop);
|
$__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggles[i].setAttribute('aria-expanded', 'false');
|
toggles[i].setAttribute('aria-expanded', 'false');
|
||||||
$(dropdownMenu).removeClass(ClassName.SHOW);
|
|
||||||
$(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget));
|
if (context._popper) {
|
||||||
|
context._popper.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
$__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW);
|
||||||
|
$__default['default'](parent).removeClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_HIDDEN, relatedTarget));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
Dropdown._getParentFromElement = function _getParentFromElement(element) {
|
||||||
var parent;
|
var parent;
|
||||||
var selector = Util.getSelectorFromElement(element);
|
var selector = Util__default['default'].getSelectorFromElement(element);
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
parent = document.querySelector(selector);
|
parent = document.querySelector(selector);
|
||||||
|
|
@ -491,32 +431,37 @@
|
||||||
// - If key is other than escape
|
// - If key is other than escape
|
||||||
// - If key is not up or down => not a dropdown command
|
// - If key is not up or down => not a dropdown command
|
||||||
// - If trigger inside the menu => not a dropdown command
|
// - If trigger inside the menu => not a dropdown command
|
||||||
if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var parent = Dropdown._getParentFromElement(this);
|
||||||
|
|
||||||
|
var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
|
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var parent = Dropdown._getParentFromElement(this);
|
|
||||||
|
|
||||||
var isActive = $(parent).hasClass(ClassName.SHOW);
|
|
||||||
|
|
||||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
var toggle = parent.querySelector(Selector.DATA_TOGGLE);
|
$__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
|
||||||
$(toggle).trigger('focus');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).trigger('click');
|
$__default['default'](this).trigger('click');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS));
|
var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
|
||||||
|
return $__default['default'](item).is(':visible');
|
||||||
|
});
|
||||||
|
|
||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -567,12 +512,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
Dropdown._jQueryInterface.call($(this), 'toggle');
|
Dropdown._jQueryInterface.call($__default['default'](this), 'toggle');
|
||||||
}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
|
}).on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
|
|
@ -581,15 +526,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Dropdown._jQueryInterface;
|
$__default['default'].fn[NAME] = Dropdown._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Dropdown;
|
$__default['default'].fn[NAME].Constructor = Dropdown;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Dropdown._jQueryInterface;
|
return Dropdown._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Dropdown;
|
return Dropdown;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=dropdown.js.map
|
//# sourceMappingURL=dropdown.js.map
|
||||||
|
|
|
||||||
2
js/dist/dropdown.js.map
vendored
2
js/dist/dropdown.js.map
vendored
File diff suppressed because one or more lines are too long
3
js/dist/index.js
vendored
3
js/dist/index.js
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): index.js
|
* Bootstrap (v4.5.3): index.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
@ -20,4 +20,3 @@
|
||||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||||
}
|
}
|
||||||
})($);
|
})($);
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
1
js/dist/index.js.map
vendored
1
js/dist/index.js.map
vendored
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.1.2): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"],"file":"index.js"}
|
|
||||||
418
js/dist/modal.js
vendored
418
js/dist/modal.js
vendored
|
|
@ -1,67 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap modal.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap modal.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Modal = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -69,11 +26,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'modal';
|
var NAME = 'modal';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.modal';
|
var DATA_KEY = 'bs.modal';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
|
||||||
|
|
||||||
var Default = {
|
var Default = {
|
||||||
|
|
@ -88,49 +45,42 @@
|
||||||
focus: 'boolean',
|
focus: 'boolean',
|
||||||
show: 'boolean'
|
show: 'boolean'
|
||||||
};
|
};
|
||||||
var Event = {
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
HIDE: "hide" + EVENT_KEY,
|
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
SHOW: "show" + EVENT_KEY,
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
SHOWN: "shown" + EVENT_KEY,
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
FOCUSIN: "focusin" + EVENT_KEY,
|
var EVENT_FOCUSIN = "focusin" + EVENT_KEY;
|
||||||
RESIZE: "resize" + EVENT_KEY,
|
var EVENT_RESIZE = "resize" + EVENT_KEY;
|
||||||
CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
|
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||||
KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
|
var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY;
|
||||||
MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
|
var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY;
|
||||||
MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
|
var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY;
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
};
|
var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
|
||||||
var ClassName = {
|
var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
|
||||||
SCROLLABLE: 'modal-dialog-scrollable',
|
var CLASS_NAME_BACKDROP = 'modal-backdrop';
|
||||||
SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
|
var CLASS_NAME_OPEN = 'modal-open';
|
||||||
BACKDROP: 'modal-backdrop',
|
var CLASS_NAME_FADE = 'fade';
|
||||||
OPEN: 'modal-open',
|
var CLASS_NAME_SHOW = 'show';
|
||||||
FADE: 'fade',
|
var CLASS_NAME_STATIC = 'modal-static';
|
||||||
SHOW: 'show'
|
var SELECTOR_DIALOG = '.modal-dialog';
|
||||||
};
|
var SELECTOR_MODAL_BODY = '.modal-body';
|
||||||
var Selector = {
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]';
|
||||||
DIALOG: '.modal-dialog',
|
var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
|
||||||
MODAL_BODY: '.modal-body',
|
var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
||||||
DATA_TOGGLE: '[data-toggle="modal"]',
|
var SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||||
DATA_DISMISS: '[data-dismiss="modal"]',
|
/**
|
||||||
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
* ------------------------------------------------------------------------
|
||||||
STICKY_CONTENT: '.sticky-top'
|
* Class Definition
|
||||||
/**
|
* ------------------------------------------------------------------------
|
||||||
* ------------------------------------------------------------------------
|
*/
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Modal = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Modal =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Modal(element, config) {
|
function Modal(element, config) {
|
||||||
this._config = this._getConfig(config);
|
this._config = this._getConfig(config);
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._dialog = element.querySelector(Selector.DIALOG);
|
this._dialog = element.querySelector(SELECTOR_DIALOG);
|
||||||
this._backdrop = null;
|
this._backdrop = null;
|
||||||
this._isShown = false;
|
this._isShown = false;
|
||||||
this._isBodyOverflowing = false;
|
this._isBodyOverflowing = false;
|
||||||
|
|
@ -154,14 +104,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
this._isTransitioning = true;
|
this._isTransitioning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var showEvent = $.Event(Event.SHOW, {
|
var showEvent = $__default['default'].Event(EVENT_SHOW, {
|
||||||
relatedTarget: relatedTarget
|
relatedTarget: relatedTarget
|
||||||
});
|
});
|
||||||
$(this._element).trigger(showEvent);
|
$__default['default'](this._element).trigger(showEvent);
|
||||||
|
|
||||||
if (this._isShown || showEvent.isDefaultPrevented()) {
|
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -179,12 +129,12 @@
|
||||||
|
|
||||||
this._setResizeEvent();
|
this._setResizeEvent();
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
|
$__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||||
return _this.hide(event);
|
return _this.hide(event);
|
||||||
});
|
});
|
||||||
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
|
$__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
|
||||||
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
|
$__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
|
||||||
if ($(event.target).is(_this._element)) {
|
if ($__default['default'](event.target).is(_this._element)) {
|
||||||
_this._ignoreBackdropClick = true;
|
_this._ignoreBackdropClick = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -206,15 +156,15 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE);
|
var hideEvent = $__default['default'].Event(EVENT_HIDE);
|
||||||
$(this._element).trigger(hideEvent);
|
$__default['default'](this._element).trigger(hideEvent);
|
||||||
|
|
||||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isShown = false;
|
this._isShown = false;
|
||||||
var transition = $(this._element).hasClass(ClassName.FADE);
|
var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE);
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
this._isTransitioning = true;
|
this._isTransitioning = true;
|
||||||
|
|
@ -224,14 +174,14 @@
|
||||||
|
|
||||||
this._setResizeEvent();
|
this._setResizeEvent();
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN);
|
$__default['default'](document).off(EVENT_FOCUSIN);
|
||||||
$(this._element).removeClass(ClassName.SHOW);
|
$__default['default'](this._element).removeClass(CLASS_NAME_SHOW);
|
||||||
$(this._element).off(Event.CLICK_DISMISS);
|
$__default['default'](this._element).off(EVENT_CLICK_DISMISS);
|
||||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
|
$__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._element);
|
||||||
$(this._element).one(Util.TRANSITION_END, function (event) {
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, function (event) {
|
||||||
return _this2._hideModal(event);
|
return _this2._hideModal(event);
|
||||||
}).emulateTransitionEnd(transitionDuration);
|
}).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -241,16 +191,16 @@
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||||
return $(htmlElement).off(EVENT_KEY);
|
return $__default['default'](htmlElement).off(EVENT_KEY);
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
|
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||||
* Do not move `document` in `htmlElements` array
|
* Do not move `document` in `htmlElements` array
|
||||||
* It will remove `Event.CLICK_DATA_API` event that should remain
|
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN);
|
$__default['default'](document).off(EVENT_FOCUSIN);
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._config = null;
|
this._config = null;
|
||||||
this._element = null;
|
this._element = null;
|
||||||
this._dialog = null;
|
this._dialog = null;
|
||||||
|
|
@ -268,15 +218,53 @@
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, Default, config);
|
config = _extends({}, Default, config);
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._showElement = function _showElement(relatedTarget) {
|
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var transition = $(this._element).hasClass(ClassName.FADE);
|
if (this._config.backdrop === 'static') {
|
||||||
|
var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED);
|
||||||
|
$__default['default'](this._element).trigger(hideEventPrevented);
|
||||||
|
|
||||||
|
if (hideEventPrevented.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
this._element.style.overflowY = 'hidden';
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_STATIC);
|
||||||
|
|
||||||
|
var modalTransitionDuration = Util__default['default'].getTransitionDurationFromElement(this._dialog);
|
||||||
|
$__default['default'](this._element).off(Util__default['default'].TRANSITION_END);
|
||||||
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, function () {
|
||||||
|
_this3._element.classList.remove(CLASS_NAME_STATIC);
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
$__default['default'](_this3._element).one(Util__default['default'].TRANSITION_END, function () {
|
||||||
|
_this3._element.style.overflowY = '';
|
||||||
|
}).emulateTransitionEnd(_this3._element, modalTransitionDuration);
|
||||||
|
}
|
||||||
|
}).emulateTransitionEnd(modalTransitionDuration);
|
||||||
|
|
||||||
|
this._element.focus();
|
||||||
|
} else {
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._showElement = function _showElement(relatedTarget) {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
|
var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE);
|
||||||
|
var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
|
||||||
|
|
||||||
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||||
// Don't move modal's DOM position
|
// Don't move modal's DOM position
|
||||||
|
|
@ -289,84 +277,88 @@
|
||||||
|
|
||||||
this._element.setAttribute('aria-modal', true);
|
this._element.setAttribute('aria-modal', true);
|
||||||
|
|
||||||
if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {
|
this._element.setAttribute('role', 'dialog');
|
||||||
this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0;
|
|
||||||
|
if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||||
|
modalBody.scrollTop = 0;
|
||||||
} else {
|
} else {
|
||||||
this._element.scrollTop = 0;
|
this._element.scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
Util.reflow(this._element);
|
Util__default['default'].reflow(this._element);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).addClass(ClassName.SHOW);
|
$__default['default'](this._element).addClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
if (this._config.focus) {
|
if (this._config.focus) {
|
||||||
this._enforceFocus();
|
this._enforceFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
var shownEvent = $.Event(Event.SHOWN, {
|
var shownEvent = $__default['default'].Event(EVENT_SHOWN, {
|
||||||
relatedTarget: relatedTarget
|
relatedTarget: relatedTarget
|
||||||
});
|
});
|
||||||
|
|
||||||
var transitionComplete = function transitionComplete() {
|
var transitionComplete = function transitionComplete() {
|
||||||
if (_this3._config.focus) {
|
if (_this4._config.focus) {
|
||||||
_this3._element.focus();
|
_this4._element.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
_this3._isTransitioning = false;
|
_this4._isTransitioning = false;
|
||||||
$(_this3._element).trigger(shownEvent);
|
$__default['default'](_this4._element).trigger(shownEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._dialog);
|
||||||
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this._dialog).one(Util__default['default'].TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
transitionComplete();
|
transitionComplete();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._enforceFocus = function _enforceFocus() {
|
_proto._enforceFocus = function _enforceFocus() {
|
||||||
var _this4 = this;
|
var _this5 = this;
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN) // Guard against infinite focus loop
|
$__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||||
.on(Event.FOCUSIN, function (event) {
|
.on(EVENT_FOCUSIN, function (event) {
|
||||||
if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
|
if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) {
|
||||||
_this4._element.focus();
|
_this5._element.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||||
var _this5 = this;
|
var _this6 = this;
|
||||||
|
|
||||||
if (this._isShown && this._config.keyboard) {
|
if (this._isShown) {
|
||||||
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
$__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
_this5.hide();
|
_this6.hide();
|
||||||
|
} else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
_this6._triggerBackdropTransition();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!this._isShown) {
|
} else if (!this._isShown) {
|
||||||
$(this._element).off(Event.KEYDOWN_DISMISS);
|
$__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setResizeEvent = function _setResizeEvent() {
|
_proto._setResizeEvent = function _setResizeEvent() {
|
||||||
var _this6 = this;
|
var _this7 = this;
|
||||||
|
|
||||||
if (this._isShown) {
|
if (this._isShown) {
|
||||||
$(window).on(Event.RESIZE, function (event) {
|
$__default['default'](window).on(EVENT_RESIZE, function (event) {
|
||||||
return _this6.handleUpdate(event);
|
return _this7.handleUpdate(event);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(window).off(Event.RESIZE);
|
$__default['default'](window).off(EVENT_RESIZE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._hideModal = function _hideModal() {
|
_proto._hideModal = function _hideModal() {
|
||||||
var _this7 = this;
|
var _this8 = this;
|
||||||
|
|
||||||
this._element.style.display = 'none';
|
this._element.style.display = 'none';
|
||||||
|
|
||||||
|
|
@ -374,43 +366,45 @@
|
||||||
|
|
||||||
this._element.removeAttribute('aria-modal');
|
this._element.removeAttribute('aria-modal');
|
||||||
|
|
||||||
|
this._element.removeAttribute('role');
|
||||||
|
|
||||||
this._isTransitioning = false;
|
this._isTransitioning = false;
|
||||||
|
|
||||||
this._showBackdrop(function () {
|
this._showBackdrop(function () {
|
||||||
$(document.body).removeClass(ClassName.OPEN);
|
$__default['default'](document.body).removeClass(CLASS_NAME_OPEN);
|
||||||
|
|
||||||
_this7._resetAdjustments();
|
_this8._resetAdjustments();
|
||||||
|
|
||||||
_this7._resetScrollbar();
|
_this8._resetScrollbar();
|
||||||
|
|
||||||
$(_this7._element).trigger(Event.HIDDEN);
|
$__default['default'](_this8._element).trigger(EVENT_HIDDEN);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._removeBackdrop = function _removeBackdrop() {
|
_proto._removeBackdrop = function _removeBackdrop() {
|
||||||
if (this._backdrop) {
|
if (this._backdrop) {
|
||||||
$(this._backdrop).remove();
|
$__default['default'](this._backdrop).remove();
|
||||||
this._backdrop = null;
|
this._backdrop = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||||
var _this8 = this;
|
var _this9 = this;
|
||||||
|
|
||||||
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
|
var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||||
|
|
||||||
if (this._isShown && this._config.backdrop) {
|
if (this._isShown && this._config.backdrop) {
|
||||||
this._backdrop = document.createElement('div');
|
this._backdrop = document.createElement('div');
|
||||||
this._backdrop.className = ClassName.BACKDROP;
|
this._backdrop.className = CLASS_NAME_BACKDROP;
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
this._backdrop.classList.add(animate);
|
this._backdrop.classList.add(animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._backdrop).appendTo(document.body);
|
$__default['default'](this._backdrop).appendTo(document.body);
|
||||||
$(this._element).on(Event.CLICK_DISMISS, function (event) {
|
$__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) {
|
||||||
if (_this8._ignoreBackdropClick) {
|
if (_this9._ignoreBackdropClick) {
|
||||||
_this8._ignoreBackdropClick = false;
|
_this9._ignoreBackdropClick = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -418,18 +412,14 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this8._config.backdrop === 'static') {
|
_this9._triggerBackdropTransition();
|
||||||
_this8._element.focus();
|
|
||||||
} else {
|
|
||||||
_this8.hide();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
Util.reflow(this._backdrop);
|
Util__default['default'].reflow(this._backdrop);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._backdrop).addClass(ClassName.SHOW);
|
$__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -440,23 +430,23 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
var backdropTransitionDuration = Util__default['default'].getTransitionDurationFromElement(this._backdrop);
|
||||||
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
$__default['default'](this._backdrop).one(Util__default['default'].TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
|
||||||
} else if (!this._isShown && this._backdrop) {
|
} else if (!this._isShown && this._backdrop) {
|
||||||
$(this._backdrop).removeClass(ClassName.SHOW);
|
$__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
var callbackRemove = function callbackRemove() {
|
var callbackRemove = function callbackRemove() {
|
||||||
_this8._removeBackdrop();
|
_this9._removeBackdrop();
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
|
var _backdropTransitionDuration = Util__default['default'].getTransitionDurationFromElement(this._backdrop);
|
||||||
|
|
||||||
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
$__default['default'](this._backdrop).one(Util__default['default'].TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
|
||||||
} else {
|
} else {
|
||||||
callbackRemove();
|
callbackRemove();
|
||||||
}
|
}
|
||||||
|
|
@ -488,66 +478,66 @@
|
||||||
|
|
||||||
_proto._checkScrollbar = function _checkScrollbar() {
|
_proto._checkScrollbar = function _checkScrollbar() {
|
||||||
var rect = document.body.getBoundingClientRect();
|
var rect = document.body.getBoundingClientRect();
|
||||||
this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
|
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
|
||||||
this._scrollbarWidth = this._getScrollbarWidth();
|
this._scrollbarWidth = this._getScrollbarWidth();
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setScrollbar = function _setScrollbar() {
|
_proto._setScrollbar = function _setScrollbar() {
|
||||||
var _this9 = this;
|
var _this10 = this;
|
||||||
|
|
||||||
if (this._isBodyOverflowing) {
|
if (this._isBodyOverflowing) {
|
||||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||||
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||||
var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
|
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||||
var stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)); // Adjust fixed content padding
|
var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
|
||||||
|
|
||||||
$(fixedContent).each(function (index, element) {
|
$__default['default'](fixedContent).each(function (index, element) {
|
||||||
var actualPadding = element.style.paddingRight;
|
var actualPadding = element.style.paddingRight;
|
||||||
var calculatedPadding = $(element).css('padding-right');
|
var calculatedPadding = $__default['default'](element).css('padding-right');
|
||||||
$(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
|
$__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
|
||||||
}); // Adjust sticky content margin
|
}); // Adjust sticky content margin
|
||||||
|
|
||||||
$(stickyContent).each(function (index, element) {
|
$__default['default'](stickyContent).each(function (index, element) {
|
||||||
var actualMargin = element.style.marginRight;
|
var actualMargin = element.style.marginRight;
|
||||||
var calculatedMargin = $(element).css('margin-right');
|
var calculatedMargin = $__default['default'](element).css('margin-right');
|
||||||
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
|
$__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
|
||||||
}); // Adjust body padding
|
}); // Adjust body padding
|
||||||
|
|
||||||
var actualPadding = document.body.style.paddingRight;
|
var actualPadding = document.body.style.paddingRight;
|
||||||
var calculatedPadding = $(document.body).css('padding-right');
|
var calculatedPadding = $__default['default'](document.body).css('padding-right');
|
||||||
$(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
|
$__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document.body).addClass(ClassName.OPEN);
|
$__default['default'](document.body).addClass(CLASS_NAME_OPEN);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._resetScrollbar = function _resetScrollbar() {
|
_proto._resetScrollbar = function _resetScrollbar() {
|
||||||
// Restore fixed content padding
|
// Restore fixed content padding
|
||||||
var fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT));
|
var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
|
||||||
$(fixedContent).each(function (index, element) {
|
$__default['default'](fixedContent).each(function (index, element) {
|
||||||
var padding = $(element).data('padding-right');
|
var padding = $__default['default'](element).data('padding-right');
|
||||||
$(element).removeData('padding-right');
|
$__default['default'](element).removeData('padding-right');
|
||||||
element.style.paddingRight = padding ? padding : '';
|
element.style.paddingRight = padding ? padding : '';
|
||||||
}); // Restore sticky content
|
}); // Restore sticky content
|
||||||
|
|
||||||
var elements = [].slice.call(document.querySelectorAll("" + Selector.STICKY_CONTENT));
|
var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
|
||||||
$(elements).each(function (index, element) {
|
$__default['default'](elements).each(function (index, element) {
|
||||||
var margin = $(element).data('margin-right');
|
var margin = $__default['default'](element).data('margin-right');
|
||||||
|
|
||||||
if (typeof margin !== 'undefined') {
|
if (typeof margin !== 'undefined') {
|
||||||
$(element).css('margin-right', margin).removeData('margin-right');
|
$__default['default'](element).css('margin-right', margin).removeData('margin-right');
|
||||||
}
|
}
|
||||||
}); // Restore body padding
|
}); // Restore body padding
|
||||||
|
|
||||||
var padding = $(document.body).data('padding-right');
|
var padding = $__default['default'](document.body).data('padding-right');
|
||||||
$(document.body).removeData('padding-right');
|
$__default['default'](document.body).removeData('padding-right');
|
||||||
document.body.style.paddingRight = padding ? padding : '';
|
document.body.style.paddingRight = padding ? padding : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getScrollbarWidth = function _getScrollbarWidth() {
|
_proto._getScrollbarWidth = function _getScrollbarWidth() {
|
||||||
// thx d.walsh
|
// thx d.walsh
|
||||||
var scrollDiv = document.createElement('div');
|
var scrollDiv = document.createElement('div');
|
||||||
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
|
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
|
||||||
document.body.appendChild(scrollDiv);
|
document.body.appendChild(scrollDiv);
|
||||||
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
|
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
|
||||||
document.body.removeChild(scrollDiv);
|
document.body.removeChild(scrollDiv);
|
||||||
|
|
@ -557,13 +547,13 @@
|
||||||
|
|
||||||
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var data = $__default['default'](this).data(DATA_KEY);
|
||||||
|
|
||||||
var _config = _objectSpread({}, Default, $(this).data(), typeof config === 'object' && config ? config : {});
|
var _config = _extends({}, Default, $__default['default'](this).data(), typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Modal(this, _config);
|
data = new Modal(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$__default['default'](this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -599,36 +589,36 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
var _this10 = this;
|
var _this11 = this;
|
||||||
|
|
||||||
var target;
|
var target;
|
||||||
var selector = Util.getSelectorFromElement(this);
|
var selector = Util__default['default'].getSelectorFromElement(this);
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
target = document.querySelector(selector);
|
target = document.querySelector(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
|
var config = $__default['default'](target).data(DATA_KEY) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data());
|
||||||
|
|
||||||
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
if (this.tagName === 'A' || this.tagName === 'AREA') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
var $target = $(target).one(Event.SHOW, function (showEvent) {
|
var $target = $__default['default'](target).one(EVENT_SHOW, function (showEvent) {
|
||||||
if (showEvent.isDefaultPrevented()) {
|
if (showEvent.isDefaultPrevented()) {
|
||||||
// Only register focus restorer if modal will actually get shown
|
// Only register focus restorer if modal will actually get shown
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$target.one(Event.HIDDEN, function () {
|
$target.one(EVENT_HIDDEN, function () {
|
||||||
if ($(_this10).is(':visible')) {
|
if ($__default['default'](_this11).is(':visible')) {
|
||||||
_this10.focus();
|
_this11.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Modal._jQueryInterface.call($(target), config, this);
|
Modal._jQueryInterface.call($__default['default'](target), config, this);
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -636,15 +626,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Modal._jQueryInterface;
|
$__default['default'].fn[NAME] = Modal._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Modal;
|
$__default['default'].fn[NAME].Constructor = Modal;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Modal._jQueryInterface;
|
return Modal._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Modal;
|
return Modal;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=modal.js.map
|
//# sourceMappingURL=modal.js.map
|
||||||
|
|
|
||||||
2
js/dist/modal.js.map
vendored
2
js/dist/modal.js.map
vendored
File diff suppressed because one or more lines are too long
136
js/dist/popover.js
vendored
136
js/dist/popover.js
vendored
|
|
@ -1,73 +1,26 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap popover.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap popover.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./tooltip.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './tooltip.js'], factory) :
|
||||||
(global = global || self, global.Popover = factory(global.jQuery, global.Tooltip));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.jQuery, global.Tooltip));
|
||||||
}(this, function ($, Tooltip) { 'use strict';
|
}(this, (function ($, Tooltip) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Tooltip = Tooltip && Tooltip.hasOwnProperty('default') ? Tooltip['default'] : Tooltip;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _inheritsLoose(subClass, superClass) {
|
|
||||||
subClass.prototype = Object.create(superClass.prototype);
|
|
||||||
subClass.prototype.constructor = subClass;
|
|
||||||
subClass.__proto__ = superClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -75,32 +28,28 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'popover';
|
var NAME = 'popover';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.popover';
|
var DATA_KEY = 'bs.popover';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var CLASS_PREFIX = 'bs-popover';
|
var CLASS_PREFIX = 'bs-popover';
|
||||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||||
|
|
||||||
var Default = _objectSpread({}, Tooltip.Default, {
|
var Default = _extends({}, Tooltip__default['default'].Default, {
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
content: '',
|
content: '',
|
||||||
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
||||||
});
|
});
|
||||||
|
|
||||||
var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
|
var DefaultType = _extends({}, Tooltip__default['default'].DefaultType, {
|
||||||
content: '(string|element|function)'
|
content: '(string|element|function)'
|
||||||
});
|
});
|
||||||
|
|
||||||
var ClassName = {
|
var CLASS_NAME_FADE = 'fade';
|
||||||
FADE: 'fade',
|
var CLASS_NAME_SHOW = 'show';
|
||||||
SHOW: 'show'
|
var SELECTOR_TITLE = '.popover-header';
|
||||||
};
|
var SELECTOR_CONTENT = '.popover-body';
|
||||||
var Selector = {
|
|
||||||
TITLE: '.popover-header',
|
|
||||||
CONTENT: '.popover-body'
|
|
||||||
};
|
|
||||||
var Event = {
|
var Event = {
|
||||||
HIDE: "hide" + EVENT_KEY,
|
HIDE: "hide" + EVENT_KEY,
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
HIDDEN: "hidden" + EVENT_KEY,
|
||||||
|
|
@ -112,17 +61,14 @@
|
||||||
FOCUSOUT: "focusout" + EVENT_KEY,
|
FOCUSOUT: "focusout" + EVENT_KEY,
|
||||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
* Class Definition
|
||||||
|
* ------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
var Popover =
|
var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||||
/*#__PURE__*/
|
|
||||||
function (_Tooltip) {
|
|
||||||
_inheritsLoose(Popover, _Tooltip);
|
_inheritsLoose(Popover, _Tooltip);
|
||||||
|
|
||||||
function Popover() {
|
function Popover() {
|
||||||
|
|
@ -137,18 +83,18 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||||
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
$__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.getTipElement = function getTipElement() {
|
_proto.getTipElement = function getTipElement() {
|
||||||
this.tip = this.tip || $(this.config.template)[0];
|
this.tip = this.tip || $__default['default'](this.config.template)[0];
|
||||||
return this.tip;
|
return this.tip;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.setContent = function setContent() {
|
_proto.setContent = function setContent() {
|
||||||
var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
|
var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events
|
||||||
|
|
||||||
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
|
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
|
||||||
|
|
||||||
var content = this._getContent();
|
var content = this._getContent();
|
||||||
|
|
||||||
|
|
@ -156,8 +102,8 @@
|
||||||
content = content.call(this.element);
|
content = content.call(this.element);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setElementContent($tip.find(Selector.CONTENT), content);
|
this.setElementContent($tip.find(SELECTOR_CONTENT), content);
|
||||||
$tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
|
$tip.removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||||
} // Private
|
} // Private
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -166,7 +112,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._cleanTipClass = function _cleanTipClass() {
|
_proto._cleanTipClass = function _cleanTipClass() {
|
||||||
var $tip = $(this.getTipElement());
|
var $tip = $__default['default'](this.getTipElement());
|
||||||
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||||
|
|
||||||
if (tabClass !== null && tabClass.length > 0) {
|
if (tabClass !== null && tabClass.length > 0) {
|
||||||
|
|
@ -177,7 +123,7 @@
|
||||||
|
|
||||||
Popover._jQueryInterface = function _jQueryInterface(config) {
|
Popover._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var data = $__default['default'](this).data(DATA_KEY);
|
||||||
|
|
||||||
var _config = typeof config === 'object' ? config : null;
|
var _config = typeof config === 'object' ? config : null;
|
||||||
|
|
||||||
|
|
@ -187,7 +133,7 @@
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Popover(this, _config);
|
data = new Popover(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$__default['default'](this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -239,7 +185,7 @@
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
return Popover;
|
return Popover;
|
||||||
}(Tooltip);
|
}(Tooltip__default['default']);
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* jQuery
|
* jQuery
|
||||||
|
|
@ -247,15 +193,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$.fn[NAME] = Popover._jQueryInterface;
|
$__default['default'].fn[NAME] = Popover._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Popover;
|
$__default['default'].fn[NAME].Constructor = Popover;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Popover._jQueryInterface;
|
return Popover._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Popover;
|
return Popover;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=popover.js.map
|
//# sourceMappingURL=popover.js.map
|
||||||
|
|
|
||||||
2
js/dist/popover.js.map
vendored
2
js/dist/popover.js.map
vendored
File diff suppressed because one or more lines are too long
196
js/dist/scrollspy.js
vendored
196
js/dist/scrollspy.js
vendored
|
|
@ -1,67 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap scrollspy.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap scrollspy.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.ScrollSpy = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ScrollSpy = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -69,11 +26,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'scrollspy';
|
var NAME = 'scrollspy';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.scrollspy';
|
var DATA_KEY = 'bs.scrollspy';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var Default = {
|
var Default = {
|
||||||
offset: 10,
|
offset: 10,
|
||||||
method: 'auto',
|
method: 'auto',
|
||||||
|
|
@ -84,53 +41,40 @@
|
||||||
method: 'string',
|
method: 'string',
|
||||||
target: '(string|element)'
|
target: '(string|element)'
|
||||||
};
|
};
|
||||||
var Event = {
|
var EVENT_ACTIVATE = "activate" + EVENT_KEY;
|
||||||
ACTIVATE: "activate" + EVENT_KEY,
|
var EVENT_SCROLL = "scroll" + EVENT_KEY;
|
||||||
SCROLL: "scroll" + EVENT_KEY,
|
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY + DATA_API_KEY;
|
||||||
LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
|
||||||
};
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
var ClassName = {
|
var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
|
||||||
DROPDOWN_ITEM: 'dropdown-item',
|
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||||
DROPDOWN_MENU: 'dropdown-menu',
|
var SELECTOR_NAV_LINKS = '.nav-link';
|
||||||
ACTIVE: 'active'
|
var SELECTOR_NAV_ITEMS = '.nav-item';
|
||||||
};
|
var SELECTOR_LIST_ITEMS = '.list-group-item';
|
||||||
var Selector = {
|
var SELECTOR_DROPDOWN = '.dropdown';
|
||||||
DATA_SPY: '[data-spy="scroll"]',
|
var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
|
||||||
ACTIVE: '.active',
|
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||||
NAV_LIST_GROUP: '.nav, .list-group',
|
var METHOD_OFFSET = 'offset';
|
||||||
NAV_LINKS: '.nav-link',
|
var METHOD_POSITION = 'position';
|
||||||
NAV_ITEMS: '.nav-item',
|
/**
|
||||||
LIST_ITEMS: '.list-group-item',
|
* ------------------------------------------------------------------------
|
||||||
DROPDOWN: '.dropdown',
|
* Class Definition
|
||||||
DROPDOWN_ITEMS: '.dropdown-item',
|
* ------------------------------------------------------------------------
|
||||||
DROPDOWN_TOGGLE: '.dropdown-toggle'
|
*/
|
||||||
};
|
|
||||||
var OffsetMethod = {
|
|
||||||
OFFSET: 'offset',
|
|
||||||
POSITION: 'position'
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var ScrollSpy = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var ScrollSpy =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function ScrollSpy(element, config) {
|
function ScrollSpy(element, config) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||||
this._config = this._getConfig(config);
|
this._config = this._getConfig(config);
|
||||||
this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
|
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
|
||||||
this._offsets = [];
|
this._offsets = [];
|
||||||
this._targets = [];
|
this._targets = [];
|
||||||
this._activeTarget = null;
|
this._activeTarget = null;
|
||||||
this._scrollHeight = 0;
|
this._scrollHeight = 0;
|
||||||
$(this._scrollElement).on(Event.SCROLL, function (event) {
|
$__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) {
|
||||||
return _this._process(event);
|
return _this._process(event);
|
||||||
});
|
});
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -145,16 +89,16 @@
|
||||||
_proto.refresh = function refresh() {
|
_proto.refresh = function refresh() {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
|
var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
|
||||||
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
|
||||||
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
|
var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
|
||||||
this._offsets = [];
|
this._offsets = [];
|
||||||
this._targets = [];
|
this._targets = [];
|
||||||
this._scrollHeight = this._getScrollHeight();
|
this._scrollHeight = this._getScrollHeight();
|
||||||
var targets = [].slice.call(document.querySelectorAll(this._selector));
|
var targets = [].slice.call(document.querySelectorAll(this._selector));
|
||||||
targets.map(function (element) {
|
targets.map(function (element) {
|
||||||
var target;
|
var target;
|
||||||
var targetSelector = Util.getSelectorFromElement(element);
|
var targetSelector = Util__default['default'].getSelectorFromElement(element);
|
||||||
|
|
||||||
if (targetSelector) {
|
if (targetSelector) {
|
||||||
target = document.querySelector(targetSelector);
|
target = document.querySelector(targetSelector);
|
||||||
|
|
@ -165,7 +109,7 @@
|
||||||
|
|
||||||
if (targetBCR.width || targetBCR.height) {
|
if (targetBCR.width || targetBCR.height) {
|
||||||
// TODO (fat): remove sketch reliance on jQuery position/offset
|
// TODO (fat): remove sketch reliance on jQuery position/offset
|
||||||
return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
|
return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,8 +126,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
$(this._scrollElement).off(EVENT_KEY);
|
$__default['default'](this._scrollElement).off(EVENT_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
this._scrollElement = null;
|
this._scrollElement = null;
|
||||||
this._config = null;
|
this._config = null;
|
||||||
|
|
@ -196,20 +140,20 @@
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, Default, typeof config === 'object' && config ? config : {});
|
config = _extends({}, Default, typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
if (typeof config.target !== 'string') {
|
if (typeof config.target !== 'string' && Util__default['default'].isElement(config.target)) {
|
||||||
var id = $(config.target).attr('id');
|
var id = $__default['default'](config.target).attr('id');
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
id = Util.getUID(NAME);
|
id = Util__default['default'].getUID(NAME);
|
||||||
$(config.target).attr('id', id);
|
$__default['default'](config.target).attr('id', id);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.target = "#" + id;
|
config.target = "#" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.typeCheckConfig(NAME, config, DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -254,9 +198,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var offsetLength = this._offsets.length;
|
for (var i = this._offsets.length; i--;) {
|
||||||
|
|
||||||
for (var i = offsetLength; i--;) {
|
|
||||||
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
|
var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
|
||||||
|
|
||||||
if (isActiveTarget) {
|
if (isActiveTarget) {
|
||||||
|
|
@ -274,44 +216,44 @@
|
||||||
return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
|
return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
|
||||||
});
|
});
|
||||||
|
|
||||||
var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
|
var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(','))));
|
||||||
|
|
||||||
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||||
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
|
$link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE);
|
||||||
$link.addClass(ClassName.ACTIVE);
|
$link.addClass(CLASS_NAME_ACTIVE);
|
||||||
} else {
|
} else {
|
||||||
// Set triggered link as active
|
// Set triggered link as active
|
||||||
$link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
|
$link.addClass(CLASS_NAME_ACTIVE); // Set triggered links parents as active
|
||||||
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||||
|
|
||||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
|
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE); // Handle special case when .nav-link is inside .nav-item
|
||||||
|
|
||||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
|
$link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
$__default['default'](this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||||
relatedTarget: target
|
relatedTarget: target
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._clear = function _clear() {
|
_proto._clear = function _clear() {
|
||||||
[].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
|
[].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
|
||||||
return node.classList.contains(ClassName.ACTIVE);
|
return node.classList.contains(CLASS_NAME_ACTIVE);
|
||||||
}).forEach(function (node) {
|
}).forEach(function (node) {
|
||||||
return node.classList.remove(ClassName.ACTIVE);
|
return node.classList.remove(CLASS_NAME_ACTIVE);
|
||||||
});
|
});
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var data = $__default['default'](this).data(DATA_KEY);
|
||||||
|
|
||||||
var _config = typeof config === 'object' && config;
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new ScrollSpy(this, _config);
|
data = new ScrollSpy(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$__default['default'](this).data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -345,12 +287,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(window).on(Event.LOAD_DATA_API, function () {
|
$__default['default'](window).on(EVENT_LOAD_DATA_API, function () {
|
||||||
var scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY));
|
var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
|
||||||
var scrollSpysLength = scrollSpys.length;
|
var scrollSpysLength = scrollSpys.length;
|
||||||
|
|
||||||
for (var i = scrollSpysLength; i--;) {
|
for (var i = scrollSpysLength; i--;) {
|
||||||
var $spy = $(scrollSpys[i]);
|
var $spy = $__default['default'](scrollSpys[i]);
|
||||||
|
|
||||||
ScrollSpy._jQueryInterface.call($spy, $spy.data());
|
ScrollSpy._jQueryInterface.call($spy, $spy.data());
|
||||||
}
|
}
|
||||||
|
|
@ -361,15 +303,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = ScrollSpy._jQueryInterface;
|
$__default['default'].fn[NAME] = ScrollSpy._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = ScrollSpy;
|
$__default['default'].fn[NAME].Constructor = ScrollSpy;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return ScrollSpy._jQueryInterface;
|
return ScrollSpy._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return ScrollSpy;
|
return ScrollSpy;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=scrollspy.js.map
|
//# sourceMappingURL=scrollspy.js.map
|
||||||
|
|
|
||||||
2
js/dist/scrollspy.js.map
vendored
2
js/dist/scrollspy.js.map
vendored
File diff suppressed because one or more lines are too long
164
js/dist/tab.js
vendored
164
js/dist/tab.js
vendored
|
|
@ -1,33 +1,22 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap tab.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap tab.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Tab = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -35,44 +24,35 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'tab';
|
var NAME = 'tab';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.tab';
|
var DATA_KEY = 'bs.tab';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var DATA_API_KEY = '.data-api';
|
var DATA_API_KEY = '.data-api';
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var Event = {
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
HIDE: "hide" + EVENT_KEY,
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
SHOW: "show" + EVENT_KEY,
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
SHOWN: "shown" + EVENT_KEY,
|
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
|
||||||
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
|
var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
|
||||||
};
|
var CLASS_NAME_ACTIVE = 'active';
|
||||||
var ClassName = {
|
var CLASS_NAME_DISABLED = 'disabled';
|
||||||
DROPDOWN_MENU: 'dropdown-menu',
|
var CLASS_NAME_FADE = 'fade';
|
||||||
ACTIVE: 'active',
|
var CLASS_NAME_SHOW = 'show';
|
||||||
DISABLED: 'disabled',
|
var SELECTOR_DROPDOWN = '.dropdown';
|
||||||
FADE: 'fade',
|
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||||
SHOW: 'show'
|
var SELECTOR_ACTIVE = '.active';
|
||||||
};
|
var SELECTOR_ACTIVE_UL = '> li > .active';
|
||||||
var Selector = {
|
var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
|
||||||
DROPDOWN: '.dropdown',
|
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||||
NAV_LIST_GROUP: '.nav, .list-group',
|
var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
|
||||||
ACTIVE: '.active',
|
/**
|
||||||
ACTIVE_UL: '> li > .active',
|
* ------------------------------------------------------------------------
|
||||||
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
|
* Class Definition
|
||||||
DROPDOWN_TOGGLE: '.dropdown-toggle',
|
* ------------------------------------------------------------------------
|
||||||
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
|
*/
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Tab = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Tab =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Tab(element) {
|
function Tab(element) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
} // Getters
|
} // Getters
|
||||||
|
|
@ -84,33 +64,33 @@
|
||||||
_proto.show = function show() {
|
_proto.show = function show() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) {
|
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default['default'](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var target;
|
var target;
|
||||||
var previous;
|
var previous;
|
||||||
var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0];
|
var listElement = $__default['default'](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];
|
||||||
var selector = Util.getSelectorFromElement(this._element);
|
var selector = Util__default['default'].getSelectorFromElement(this._element);
|
||||||
|
|
||||||
if (listElement) {
|
if (listElement) {
|
||||||
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
|
var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
|
||||||
previous = $.makeArray($(listElement).find(itemSelector));
|
previous = $__default['default'].makeArray($__default['default'](listElement).find(itemSelector));
|
||||||
previous = previous[previous.length - 1];
|
previous = previous[previous.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
var hideEvent = $.Event(Event.HIDE, {
|
var hideEvent = $__default['default'].Event(EVENT_HIDE, {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
});
|
});
|
||||||
var showEvent = $.Event(Event.SHOW, {
|
var showEvent = $__default['default'].Event(EVENT_SHOW, {
|
||||||
relatedTarget: previous
|
relatedTarget: previous
|
||||||
});
|
});
|
||||||
|
|
||||||
if (previous) {
|
if (previous) {
|
||||||
$(previous).trigger(hideEvent);
|
$__default['default'](previous).trigger(hideEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).trigger(showEvent);
|
$__default['default'](this._element).trigger(showEvent);
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -123,14 +103,14 @@
|
||||||
this._activate(this._element, listElement);
|
this._activate(this._element, listElement);
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
var hiddenEvent = $.Event(Event.HIDDEN, {
|
var hiddenEvent = $__default['default'].Event(EVENT_HIDDEN, {
|
||||||
relatedTarget: _this._element
|
relatedTarget: _this._element
|
||||||
});
|
});
|
||||||
var shownEvent = $.Event(Event.SHOWN, {
|
var shownEvent = $__default['default'].Event(EVENT_SHOWN, {
|
||||||
relatedTarget: previous
|
relatedTarget: previous
|
||||||
});
|
});
|
||||||
$(previous).trigger(hiddenEvent);
|
$__default['default'](previous).trigger(hiddenEvent);
|
||||||
$(_this._element).trigger(shownEvent);
|
$__default['default'](_this._element).trigger(shownEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
|
|
@ -141,7 +121,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
} // Private
|
} // Private
|
||||||
;
|
;
|
||||||
|
|
@ -149,17 +129,17 @@
|
||||||
_proto._activate = function _activate(element, container, callback) {
|
_proto._activate = function _activate(element, container, callback) {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector.ACTIVE_UL) : $(container).children(Selector.ACTIVE);
|
var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default['default'](container).find(SELECTOR_ACTIVE_UL) : $__default['default'](container).children(SELECTOR_ACTIVE);
|
||||||
var active = activeElements[0];
|
var active = activeElements[0];
|
||||||
var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE);
|
var isTransitioning = callback && active && $__default['default'](active).hasClass(CLASS_NAME_FADE);
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
return _this2._transitionComplete(element, active, callback);
|
return _this2._transitionComplete(element, active, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (active && isTransitioning) {
|
if (active && isTransitioning) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(active);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(active);
|
||||||
$(active).removeClass(ClassName.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](active).removeClass(CLASS_NAME_SHOW).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
@ -167,11 +147,11 @@
|
||||||
|
|
||||||
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
|
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
|
||||||
if (active) {
|
if (active) {
|
||||||
$(active).removeClass(ClassName.ACTIVE);
|
$__default['default'](active).removeClass(CLASS_NAME_ACTIVE);
|
||||||
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
|
var dropdownChild = $__default['default'](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
|
||||||
|
|
||||||
if (dropdownChild) {
|
if (dropdownChild) {
|
||||||
$(dropdownChild).removeClass(ClassName.ACTIVE);
|
$__default['default'](dropdownChild).removeClass(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active.getAttribute('role') === 'tab') {
|
if (active.getAttribute('role') === 'tab') {
|
||||||
|
|
@ -179,24 +159,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(element).addClass(ClassName.ACTIVE);
|
$__default['default'](element).addClass(CLASS_NAME_ACTIVE);
|
||||||
|
|
||||||
if (element.getAttribute('role') === 'tab') {
|
if (element.getAttribute('role') === 'tab') {
|
||||||
element.setAttribute('aria-selected', true);
|
element.setAttribute('aria-selected', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.reflow(element);
|
Util__default['default'].reflow(element);
|
||||||
|
|
||||||
if (element.classList.contains(ClassName.FADE)) {
|
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||||
element.classList.add(ClassName.SHOW);
|
element.classList.add(CLASS_NAME_SHOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
if (element.parentNode && $__default['default'](element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||||
var dropdownElement = $(element).closest(Selector.DROPDOWN)[0];
|
var dropdownElement = $__default['default'](element).closest(SELECTOR_DROPDOWN)[0];
|
||||||
|
|
||||||
if (dropdownElement) {
|
if (dropdownElement) {
|
||||||
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE));
|
var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));
|
||||||
$(dropdownToggleList).addClass(ClassName.ACTIVE);
|
$__default['default'](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
element.setAttribute('aria-expanded', true);
|
element.setAttribute('aria-expanded', true);
|
||||||
|
|
@ -210,7 +190,7 @@
|
||||||
|
|
||||||
Tab._jQueryInterface = function _jQueryInterface(config) {
|
Tab._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this);
|
var $this = $__default['default'](this);
|
||||||
var data = $this.data(DATA_KEY);
|
var data = $this.data(DATA_KEY);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
|
@ -244,10 +224,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
Tab._jQueryInterface.call($(this), 'show');
|
Tab._jQueryInterface.call($__default['default'](this), 'show');
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -255,15 +235,15 @@
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Tab._jQueryInterface;
|
$__default['default'].fn[NAME] = Tab._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Tab;
|
$__default['default'].fn[NAME].Constructor = Tab;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Tab._jQueryInterface;
|
return Tab._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Tab;
|
return Tab;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=tab.js.map
|
//# sourceMappingURL=tab.js.map
|
||||||
|
|
|
||||||
2
js/dist/tab.js.map
vendored
2
js/dist/tab.js.map
vendored
File diff suppressed because one or more lines are too long
210
js/dist/toast.js
vendored
210
js/dist/toast.js
vendored
|
|
@ -1,67 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap toast.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap toast.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', './util.js'], factory) :
|
||||||
(global = global || self, global.Toast = factory(global.jQuery, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.jQuery, global.Util));
|
||||||
}(this, function ($, Util) { 'use strict';
|
}(this, (function ($, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
var descriptor = props[i];
|
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -69,23 +26,19 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'toast';
|
var NAME = 'toast';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.toast';
|
var DATA_KEY = 'bs.toast';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var Event = {
|
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||||
CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
|
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||||
HIDE: "hide" + EVENT_KEY,
|
var EVENT_HIDDEN = "hidden" + EVENT_KEY;
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
var EVENT_SHOW = "show" + EVENT_KEY;
|
||||||
SHOW: "show" + EVENT_KEY,
|
var EVENT_SHOWN = "shown" + EVENT_KEY;
|
||||||
SHOWN: "shown" + EVENT_KEY
|
var CLASS_NAME_FADE = 'fade';
|
||||||
};
|
var CLASS_NAME_HIDE = 'hide';
|
||||||
var ClassName = {
|
var CLASS_NAME_SHOW = 'show';
|
||||||
FADE: 'fade',
|
var CLASS_NAME_SHOWING = 'showing';
|
||||||
HIDE: 'hide',
|
|
||||||
SHOW: 'show',
|
|
||||||
SHOWING: 'showing'
|
|
||||||
};
|
|
||||||
var DefaultType = {
|
var DefaultType = {
|
||||||
animation: 'boolean',
|
animation: 'boolean',
|
||||||
autohide: 'boolean',
|
autohide: 'boolean',
|
||||||
|
|
@ -96,19 +49,14 @@
|
||||||
autohide: true,
|
autohide: true,
|
||||||
delay: 500
|
delay: 500
|
||||||
};
|
};
|
||||||
var Selector = {
|
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
|
||||||
DATA_DISMISS: '[data-dismiss="toast"]'
|
/**
|
||||||
/**
|
* ------------------------------------------------------------------------
|
||||||
* ------------------------------------------------------------------------
|
* Class Definition
|
||||||
* Class Definition
|
* ------------------------------------------------------------------------
|
||||||
* ------------------------------------------------------------------------
|
*/
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Toast = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Toast =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Toast(element, config) {
|
function Toast(element, config) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
this._config = this._getConfig(config);
|
this._config = this._getConfig(config);
|
||||||
|
|
@ -124,106 +72,118 @@
|
||||||
_proto.show = function show() {
|
_proto.show = function show() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
$(this._element).trigger(Event.SHOW);
|
var showEvent = $__default['default'].Event(EVENT_SHOW);
|
||||||
|
$__default['default'](this._element).trigger(showEvent);
|
||||||
|
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._clearTimeout();
|
||||||
|
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
this._element.classList.add(ClassName.FADE);
|
this._element.classList.add(CLASS_NAME_FADE);
|
||||||
}
|
}
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
_this._element.classList.remove(ClassName.SHOWING);
|
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||||
|
|
||||||
_this._element.classList.add(ClassName.SHOW);
|
_this._element.classList.add(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
$(_this._element).trigger(Event.SHOWN);
|
$__default['default'](_this._element).trigger(EVENT_SHOWN);
|
||||||
|
|
||||||
if (_this._config.autohide) {
|
if (_this._config.autohide) {
|
||||||
_this.hide();
|
_this._timeout = setTimeout(function () {
|
||||||
|
_this.hide();
|
||||||
|
}, _this._config.delay);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this._element.classList.remove(ClassName.HIDE);
|
this._element.classList.remove(CLASS_NAME_HIDE);
|
||||||
|
|
||||||
this._element.classList.add(ClassName.SHOWING);
|
Util__default['default'].reflow(this._element);
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
||||||
|
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._element);
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.hide = function hide(withoutTimeout) {
|
_proto.hide = function hide() {
|
||||||
var _this2 = this;
|
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||||
|
|
||||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).trigger(Event.HIDE);
|
var hideEvent = $__default['default'].Event(EVENT_HIDE);
|
||||||
|
$__default['default'](this._element).trigger(hideEvent);
|
||||||
|
|
||||||
if (withoutTimeout) {
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
this._close();
|
return;
|
||||||
} else {
|
|
||||||
this._timeout = setTimeout(function () {
|
|
||||||
_this2._close();
|
|
||||||
}, this._config.delay);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._close();
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
clearTimeout(this._timeout);
|
this._clearTimeout();
|
||||||
this._timeout = null;
|
|
||||||
|
|
||||||
if (this._element.classList.contains(ClassName.SHOW)) {
|
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||||
this._element.classList.remove(ClassName.SHOW);
|
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).off(Event.CLICK_DISMISS);
|
$__default['default'](this._element).off(EVENT_CLICK_DISMISS);
|
||||||
$.removeData(this._element, DATA_KEY);
|
$__default['default'].removeData(this._element, DATA_KEY);
|
||||||
this._element = null;
|
this._element = null;
|
||||||
this._config = null;
|
this._config = null;
|
||||||
} // Private
|
} // Private
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
config = _objectSpread({}, Default, $(this._element).data(), typeof config === 'object' && config ? config : {});
|
config = _extends({}, Default, $__default['default'](this._element).data(), typeof config === 'object' && config ? config : {});
|
||||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setListeners = function _setListeners() {
|
_proto._setListeners = function _setListeners() {
|
||||||
var _this3 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () {
|
$__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||||
return _this3.hide(true);
|
return _this2.hide();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._close = function _close() {
|
_proto._close = function _close() {
|
||||||
var _this4 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
_this4._element.classList.add(ClassName.HIDE);
|
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||||
|
|
||||||
$(_this4._element).trigger(Event.HIDDEN);
|
$__default['default'](_this3._element).trigger(EVENT_HIDDEN);
|
||||||
};
|
};
|
||||||
|
|
||||||
this._element.classList.remove(ClassName.SHOW);
|
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||||
|
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this._element);
|
||||||
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this._element).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._clearTimeout = function _clearTimeout() {
|
||||||
|
clearTimeout(this._timeout);
|
||||||
|
this._timeout = null;
|
||||||
} // Static
|
} // Static
|
||||||
;
|
;
|
||||||
|
|
||||||
Toast._jQueryInterface = function _jQueryInterface(config) {
|
Toast._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $element = $(this);
|
var $element = $__default['default'](this);
|
||||||
var data = $element.data(DATA_KEY);
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
var _config = typeof config === 'object' && config;
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
@ -269,15 +229,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$.fn[NAME] = Toast._jQueryInterface;
|
$__default['default'].fn[NAME] = Toast._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Toast;
|
$__default['default'].fn[NAME].Constructor = Toast;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Toast._jQueryInterface;
|
return Toast._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Toast;
|
return Toast;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=toast.js.map
|
//# sourceMappingURL=toast.js.map
|
||||||
|
|
|
||||||
2
js/dist/toast.js.map
vendored
2
js/dist/toast.js.map
vendored
File diff suppressed because one or more lines are too long
395
js/dist/tooltip.js
vendored
395
js/dist/tooltip.js
vendored
|
|
@ -1,72 +1,24 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap tooltip.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap tooltip.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
|
||||||
(global = global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.jQuery, global.Popper, global.Util));
|
||||||
}(this, function ($, Popper, Util) { 'use strict';
|
}(this, (function ($, Popper, Util) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
|
|
||||||
Util = Util && Util.hasOwnProperty('default') ? Util['default'] : Util;
|
|
||||||
|
|
||||||
function _defineProperties(target, props) {
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
for (var i = 0; i < props.length; i++) {
|
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
||||||
var descriptor = props[i];
|
var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
|
||||||
descriptor.enumerable = descriptor.enumerable || false;
|
|
||||||
descriptor.configurable = true;
|
|
||||||
if ("value" in descriptor) descriptor.writable = true;
|
|
||||||
Object.defineProperty(target, descriptor.key, descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) {
|
|
||||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
||||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
||||||
return Constructor;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _defineProperty(obj, key, value) {
|
|
||||||
if (key in obj) {
|
|
||||||
Object.defineProperty(obj, key, {
|
|
||||||
value: value,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
obj[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _objectSpread(target) {
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
var source = arguments[i] != null ? arguments[i] : {};
|
|
||||||
var ownKeys = Object.keys(source);
|
|
||||||
|
|
||||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
||||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
||||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
ownKeys.forEach(function (key) {
|
|
||||||
_defineProperty(target, key, source[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): tools/sanitizer.js
|
* Bootstrap (v4.5.3): tools/sanitizer.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
|
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
|
||||||
|
|
@ -90,7 +42,7 @@
|
||||||
h5: [],
|
h5: [],
|
||||||
h6: [],
|
h6: [],
|
||||||
i: [],
|
i: [],
|
||||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
||||||
li: [],
|
li: [],
|
||||||
ol: [],
|
ol: [],
|
||||||
p: [],
|
p: [],
|
||||||
|
|
@ -103,21 +55,21 @@
|
||||||
strong: [],
|
strong: [],
|
||||||
u: [],
|
u: [],
|
||||||
ul: []
|
ul: []
|
||||||
/**
|
|
||||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
||||||
*
|
|
||||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
};
|
||||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
|
/**
|
||||||
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||||
|
*
|
||||||
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
|
*/
|
||||||
|
|
||||||
|
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
|
||||||
/**
|
/**
|
||||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||||
*
|
*
|
||||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
||||||
|
|
||||||
function allowedAttribute(attr, allowedAttributeList) {
|
function allowedAttribute(attr, allowedAttributeList) {
|
||||||
var attrName = attr.nodeName.toLowerCase();
|
var attrName = attr.nodeName.toLowerCase();
|
||||||
|
|
@ -134,7 +86,7 @@
|
||||||
return attrRegex instanceof RegExp;
|
return attrRegex instanceof RegExp;
|
||||||
}); // Check if a regular expression validates the attribute.
|
}); // Check if a regular expression validates the attribute.
|
||||||
|
|
||||||
for (var i = 0, l = regExp.length; i < l; i++) {
|
for (var i = 0, len = regExp.length; i < len; i++) {
|
||||||
if (attrName.match(regExp[i])) {
|
if (attrName.match(regExp[i])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +128,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var i = 0, len = elements.length; i < len; i++) {
|
for (var i = 0, len = elements.length; i < len; i++) {
|
||||||
var _ret = _loop(i, len);
|
var _ret = _loop(i);
|
||||||
|
|
||||||
if (_ret === "continue") continue;
|
if (_ret === "continue") continue;
|
||||||
}
|
}
|
||||||
|
|
@ -184,6 +136,11 @@
|
||||||
return createdDocument.body.innerHTML;
|
return createdDocument.body.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
|
|
@ -191,10 +148,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var NAME = 'tooltip';
|
var NAME = 'tooltip';
|
||||||
var VERSION = '4.3.1';
|
var VERSION = '4.5.3';
|
||||||
var DATA_KEY = 'bs.tooltip';
|
var DATA_KEY = 'bs.tooltip';
|
||||||
var EVENT_KEY = "." + DATA_KEY;
|
var EVENT_KEY = "." + DATA_KEY;
|
||||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
|
||||||
var CLASS_PREFIX = 'bs-tooltip';
|
var CLASS_PREFIX = 'bs-tooltip';
|
||||||
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
|
||||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
|
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
|
||||||
|
|
@ -213,7 +170,8 @@
|
||||||
boundary: '(string|element)',
|
boundary: '(string|element)',
|
||||||
sanitize: 'boolean',
|
sanitize: 'boolean',
|
||||||
sanitizeFn: '(null|function)',
|
sanitizeFn: '(null|function)',
|
||||||
whiteList: 'object'
|
whiteList: 'object',
|
||||||
|
popperConfig: '(null|object)'
|
||||||
};
|
};
|
||||||
var AttachmentMap = {
|
var AttachmentMap = {
|
||||||
AUTO: 'auto',
|
AUTO: 'auto',
|
||||||
|
|
@ -237,12 +195,11 @@
|
||||||
boundary: 'scrollParent',
|
boundary: 'scrollParent',
|
||||||
sanitize: true,
|
sanitize: true,
|
||||||
sanitizeFn: null,
|
sanitizeFn: null,
|
||||||
whiteList: DefaultWhitelist
|
whiteList: DefaultWhitelist,
|
||||||
};
|
popperConfig: null
|
||||||
var HoverState = {
|
|
||||||
SHOW: 'show',
|
|
||||||
OUT: 'out'
|
|
||||||
};
|
};
|
||||||
|
var HOVER_STATE_SHOW = 'show';
|
||||||
|
var HOVER_STATE_OUT = 'out';
|
||||||
var Event = {
|
var Event = {
|
||||||
HIDE: "hide" + EVENT_KEY,
|
HIDE: "hide" + EVENT_KEY,
|
||||||
HIDDEN: "hidden" + EVENT_KEY,
|
HIDDEN: "hidden" + EVENT_KEY,
|
||||||
|
|
@ -255,37 +212,23 @@
|
||||||
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
MOUSEENTER: "mouseenter" + EVENT_KEY,
|
||||||
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
MOUSELEAVE: "mouseleave" + EVENT_KEY
|
||||||
};
|
};
|
||||||
var ClassName = {
|
var CLASS_NAME_FADE = 'fade';
|
||||||
FADE: 'fade',
|
var CLASS_NAME_SHOW = 'show';
|
||||||
SHOW: 'show'
|
var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
||||||
};
|
var SELECTOR_ARROW = '.arrow';
|
||||||
var Selector = {
|
var TRIGGER_HOVER = 'hover';
|
||||||
TOOLTIP: '.tooltip',
|
var TRIGGER_FOCUS = 'focus';
|
||||||
TOOLTIP_INNER: '.tooltip-inner',
|
var TRIGGER_CLICK = 'click';
|
||||||
ARROW: '.arrow'
|
var TRIGGER_MANUAL = 'manual';
|
||||||
};
|
/**
|
||||||
var Trigger = {
|
* ------------------------------------------------------------------------
|
||||||
HOVER: 'hover',
|
* Class Definition
|
||||||
FOCUS: 'focus',
|
* ------------------------------------------------------------------------
|
||||||
CLICK: 'click',
|
*/
|
||||||
MANUAL: 'manual'
|
|
||||||
/**
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
* Class Definition
|
|
||||||
* ------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
};
|
var Tooltip = /*#__PURE__*/function () {
|
||||||
|
|
||||||
var Tooltip =
|
|
||||||
/*#__PURE__*/
|
|
||||||
function () {
|
|
||||||
function Tooltip(element, config) {
|
function Tooltip(element, config) {
|
||||||
/**
|
if (typeof Popper__default['default'] === 'undefined') {
|
||||||
* Check for Popper dependency
|
|
||||||
* Popper - https://popper.js.org
|
|
||||||
*/
|
|
||||||
if (typeof Popper === 'undefined') {
|
|
||||||
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
|
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
|
||||||
} // private
|
} // private
|
||||||
|
|
||||||
|
|
@ -326,11 +269,11 @@
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
var context = $(event.currentTarget).data(dataKey);
|
var context = $__default['default'](event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
$(event.currentTarget).data(dataKey, context);
|
$__default['default'](event.currentTarget).data(dataKey, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
context._activeTrigger.click = !context._activeTrigger.click;
|
context._activeTrigger.click = !context._activeTrigger.click;
|
||||||
|
|
@ -341,7 +284,7 @@
|
||||||
context._leave(null, context);
|
context._leave(null, context);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
|
if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW)) {
|
||||||
this._leave(null, this);
|
this._leave(null, this);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -353,12 +296,12 @@
|
||||||
|
|
||||||
_proto.dispose = function dispose() {
|
_proto.dispose = function dispose() {
|
||||||
clearTimeout(this._timeout);
|
clearTimeout(this._timeout);
|
||||||
$.removeData(this.element, this.constructor.DATA_KEY);
|
$__default['default'].removeData(this.element, this.constructor.DATA_KEY);
|
||||||
$(this.element).off(this.constructor.EVENT_KEY);
|
$__default['default'](this.element).off(this.constructor.EVENT_KEY);
|
||||||
$(this.element).closest('.modal').off('hide.bs.modal');
|
$__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
|
||||||
|
|
||||||
if (this.tip) {
|
if (this.tip) {
|
||||||
$(this.tip).remove();
|
$__default['default'](this.tip).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isEnabled = null;
|
this._isEnabled = null;
|
||||||
|
|
@ -366,7 +309,7 @@
|
||||||
this._hoverState = null;
|
this._hoverState = null;
|
||||||
this._activeTrigger = null;
|
this._activeTrigger = null;
|
||||||
|
|
||||||
if (this._popper !== null) {
|
if (this._popper) {
|
||||||
this._popper.destroy();
|
this._popper.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,29 +322,29 @@
|
||||||
_proto.show = function show() {
|
_proto.show = function show() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if ($(this.element).css('display') === 'none') {
|
if ($__default['default'](this.element).css('display') === 'none') {
|
||||||
throw new Error('Please use show on visible elements');
|
throw new Error('Please use show on visible elements');
|
||||||
}
|
}
|
||||||
|
|
||||||
var showEvent = $.Event(this.constructor.Event.SHOW);
|
var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);
|
||||||
|
|
||||||
if (this.isWithContent() && this._isEnabled) {
|
if (this.isWithContent() && this._isEnabled) {
|
||||||
$(this.element).trigger(showEvent);
|
$__default['default'](this.element).trigger(showEvent);
|
||||||
var shadowRoot = Util.findShadowRoot(this.element);
|
var shadowRoot = Util__default['default'].findShadowRoot(this.element);
|
||||||
var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
|
var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tip = this.getTipElement();
|
var tip = this.getTipElement();
|
||||||
var tipId = Util.getUID(this.constructor.NAME);
|
var tipId = Util__default['default'].getUID(this.constructor.NAME);
|
||||||
tip.setAttribute('id', tipId);
|
tip.setAttribute('id', tipId);
|
||||||
this.element.setAttribute('aria-describedby', tipId);
|
this.element.setAttribute('aria-describedby', tipId);
|
||||||
this.setContent();
|
this.setContent();
|
||||||
|
|
||||||
if (this.config.animation) {
|
if (this.config.animation) {
|
||||||
$(tip).addClass(ClassName.FADE);
|
$__default['default'](tip).addClass(CLASS_NAME_FADE);
|
||||||
}
|
}
|
||||||
|
|
||||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||||
|
|
@ -412,43 +355,21 @@
|
||||||
|
|
||||||
var container = this._getContainer();
|
var container = this._getContainer();
|
||||||
|
|
||||||
$(tip).data(this.constructor.DATA_KEY, this);
|
$__default['default'](tip).data(this.constructor.DATA_KEY, this);
|
||||||
|
|
||||||
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
|
if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||||
$(tip).appendTo(container);
|
$__default['default'](tip).appendTo(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this.element).trigger(this.constructor.Event.INSERTED);
|
$__default['default'](this.element).trigger(this.constructor.Event.INSERTED);
|
||||||
this._popper = new Popper(this.element, tip, {
|
this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
|
||||||
placement: attachment,
|
$__default['default'](tip).addClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
|
||||||
modifiers: {
|
|
||||||
offset: this._getOffset(),
|
|
||||||
flip: {
|
|
||||||
behavior: this.config.fallbackPlacement
|
|
||||||
},
|
|
||||||
arrow: {
|
|
||||||
element: Selector.ARROW
|
|
||||||
},
|
|
||||||
preventOverflow: {
|
|
||||||
boundariesElement: this.config.boundary
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onCreate: function onCreate(data) {
|
|
||||||
if (data.originalPlacement !== data.placement) {
|
|
||||||
_this._handlePopperPlacementChange(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onUpdate: function onUpdate(data) {
|
|
||||||
return _this._handlePopperPlacementChange(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
|
|
||||||
// empty mouseover listeners to the body's immediate children;
|
// empty mouseover listeners to the body's immediate children;
|
||||||
// only needed because of broken event delegation on iOS
|
// only needed because of broken event delegation on iOS
|
||||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||||
|
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if ('ontouchstart' in document.documentElement) {
|
||||||
$(document.body).children().on('mouseover', null, $.noop);
|
$__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
|
|
@ -458,16 +379,16 @@
|
||||||
|
|
||||||
var prevHoverState = _this._hoverState;
|
var prevHoverState = _this._hoverState;
|
||||||
_this._hoverState = null;
|
_this._hoverState = null;
|
||||||
$(_this.element).trigger(_this.constructor.Event.SHOWN);
|
$__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);
|
||||||
|
|
||||||
if (prevHoverState === HoverState.OUT) {
|
if (prevHoverState === HOVER_STATE_OUT) {
|
||||||
_this._leave(null, _this);
|
_this._leave(null, _this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(this.tip);
|
||||||
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](this.tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
@ -478,10 +399,10 @@
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
|
|
||||||
var tip = this.getTipElement();
|
var tip = this.getTipElement();
|
||||||
var hideEvent = $.Event(this.constructor.Event.HIDE);
|
var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);
|
||||||
|
|
||||||
var complete = function complete() {
|
var complete = function complete() {
|
||||||
if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
|
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||||
tip.parentNode.removeChild(tip);
|
tip.parentNode.removeChild(tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -489,7 +410,7 @@
|
||||||
|
|
||||||
_this2.element.removeAttribute('aria-describedby');
|
_this2.element.removeAttribute('aria-describedby');
|
||||||
|
|
||||||
$(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
$__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);
|
||||||
|
|
||||||
if (_this2._popper !== null) {
|
if (_this2._popper !== null) {
|
||||||
_this2._popper.destroy();
|
_this2._popper.destroy();
|
||||||
|
|
@ -500,26 +421,26 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(this.element).trigger(hideEvent);
|
$__default['default'](this.element).trigger(hideEvent);
|
||||||
|
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
|
$__default['default'](tip).removeClass(CLASS_NAME_SHOW); // If this is a touch-enabled device we remove the extra
|
||||||
// empty mouseover listeners we added for iOS support
|
// empty mouseover listeners we added for iOS support
|
||||||
|
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if ('ontouchstart' in document.documentElement) {
|
||||||
$(document.body).children().off('mouseover', null, $.noop);
|
$__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._activeTrigger[Trigger.CLICK] = false;
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
||||||
this._activeTrigger[Trigger.FOCUS] = false;
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
||||||
this._activeTrigger[Trigger.HOVER] = false;
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
||||||
|
|
||||||
if ($(this.tip).hasClass(ClassName.FADE)) {
|
if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE)) {
|
||||||
var transitionDuration = Util.getTransitionDurationFromElement(tip);
|
var transitionDuration = Util__default['default'].getTransitionDurationFromElement(tip);
|
||||||
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
$__default['default'](tip).one(Util__default['default'].TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
|
||||||
} else {
|
} else {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
@ -539,29 +460,29 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
|
||||||
$(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
$__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.getTipElement = function getTipElement() {
|
_proto.getTipElement = function getTipElement() {
|
||||||
this.tip = this.tip || $(this.config.template)[0];
|
this.tip = this.tip || $__default['default'](this.config.template)[0];
|
||||||
return this.tip;
|
return this.tip;
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.setContent = function setContent() {
|
_proto.setContent = function setContent() {
|
||||||
var tip = this.getTipElement();
|
var tip = this.getTipElement();
|
||||||
this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle());
|
this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
|
||||||
$(tip).removeClass(ClassName.FADE + " " + ClassName.SHOW);
|
$__default['default'](tip).removeClass(CLASS_NAME_FADE + " " + CLASS_NAME_SHOW);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto.setElementContent = function setElementContent($element, content) {
|
_proto.setElementContent = function setElementContent($element, content) {
|
||||||
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
|
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
|
||||||
// Content is a DOM node or a jQuery
|
// Content is a DOM node or a jQuery
|
||||||
if (this.config.html) {
|
if (this.config.html) {
|
||||||
if (!$(content).parent().is($element)) {
|
if (!$__default['default'](content).parent().is($element)) {
|
||||||
$element.empty().append(content);
|
$element.empty().append(content);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$element.text($(content).text());
|
$element.text($__default['default'](content).text());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -589,14 +510,43 @@
|
||||||
} // Private
|
} // Private
|
||||||
;
|
;
|
||||||
|
|
||||||
_proto._getOffset = function _getOffset() {
|
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
|
var defaultBsConfig = {
|
||||||
|
placement: attachment,
|
||||||
|
modifiers: {
|
||||||
|
offset: this._getOffset(),
|
||||||
|
flip: {
|
||||||
|
behavior: this.config.fallbackPlacement
|
||||||
|
},
|
||||||
|
arrow: {
|
||||||
|
element: SELECTOR_ARROW
|
||||||
|
},
|
||||||
|
preventOverflow: {
|
||||||
|
boundariesElement: this.config.boundary
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCreate: function onCreate(data) {
|
||||||
|
if (data.originalPlacement !== data.placement) {
|
||||||
|
_this3._handlePopperPlacementChange(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUpdate: function onUpdate(data) {
|
||||||
|
return _this3._handlePopperPlacementChange(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||||
|
};
|
||||||
|
|
||||||
|
_proto._getOffset = function _getOffset() {
|
||||||
|
var _this4 = this;
|
||||||
|
|
||||||
var offset = {};
|
var offset = {};
|
||||||
|
|
||||||
if (typeof this.config.offset === 'function') {
|
if (typeof this.config.offset === 'function') {
|
||||||
offset.fn = function (data) {
|
offset.fn = function (data) {
|
||||||
data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
|
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -611,11 +561,11 @@
|
||||||
return document.body;
|
return document.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Util.isElement(this.config.container)) {
|
if (Util__default['default'].isElement(this.config.container)) {
|
||||||
return $(this.config.container);
|
return $__default['default'](this.config.container);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $(document).find(this.config.container);
|
return $__default['default'](document).find(this.config.container);
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getAttachment = function _getAttachment(placement) {
|
_proto._getAttachment = function _getAttachment(placement) {
|
||||||
|
|
@ -623,32 +573,35 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._setListeners = function _setListeners() {
|
_proto._setListeners = function _setListeners() {
|
||||||
var _this4 = this;
|
var _this5 = this;
|
||||||
|
|
||||||
var triggers = this.config.trigger.split(' ');
|
var triggers = this.config.trigger.split(' ');
|
||||||
triggers.forEach(function (trigger) {
|
triggers.forEach(function (trigger) {
|
||||||
if (trigger === 'click') {
|
if (trigger === 'click') {
|
||||||
$(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
|
$__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||||
return _this4.toggle(event);
|
return _this5.toggle(event);
|
||||||
});
|
});
|
||||||
} else if (trigger !== Trigger.MANUAL) {
|
} else if (trigger !== TRIGGER_MANUAL) {
|
||||||
var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
|
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||||
var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
|
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||||
$(_this4.element).on(eventIn, _this4.config.selector, function (event) {
|
$__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {
|
||||||
return _this4._enter(event);
|
return _this5._enter(event);
|
||||||
}).on(eventOut, _this4.config.selector, function (event) {
|
}).on(eventOut, _this5.config.selector, function (event) {
|
||||||
return _this4._leave(event);
|
return _this5._leave(event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(this.element).closest('.modal').on('hide.bs.modal', function () {
|
|
||||||
if (_this4.element) {
|
this._hideModalHandler = function () {
|
||||||
_this4.hide();
|
if (_this5.element) {
|
||||||
}
|
_this5.hide();
|
||||||
});
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
|
||||||
|
|
||||||
if (this.config.selector) {
|
if (this.config.selector) {
|
||||||
this.config = _objectSpread({}, this.config, {
|
this.config = _extends({}, this.config, {
|
||||||
trigger: 'manual',
|
trigger: 'manual',
|
||||||
selector: ''
|
selector: ''
|
||||||
});
|
});
|
||||||
|
|
@ -668,24 +621,24 @@
|
||||||
|
|
||||||
_proto._enter = function _enter(event, context) {
|
_proto._enter = function _enter(event, context) {
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
context = context || $(event.currentTarget).data(dataKey);
|
context = context || $__default['default'](event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
$(event.currentTarget).data(dataKey, context);
|
$__default['default'](event.currentTarget).data(dataKey, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
|
if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {
|
||||||
context._hoverState = HoverState.SHOW;
|
context._hoverState = HOVER_STATE_SHOW;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearTimeout(context._timeout);
|
clearTimeout(context._timeout);
|
||||||
context._hoverState = HoverState.SHOW;
|
context._hoverState = HOVER_STATE_SHOW;
|
||||||
|
|
||||||
if (!context.config.delay || !context.config.delay.show) {
|
if (!context.config.delay || !context.config.delay.show) {
|
||||||
context.show();
|
context.show();
|
||||||
|
|
@ -693,7 +646,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
context._timeout = setTimeout(function () {
|
context._timeout = setTimeout(function () {
|
||||||
if (context._hoverState === HoverState.SHOW) {
|
if (context._hoverState === HOVER_STATE_SHOW) {
|
||||||
context.show();
|
context.show();
|
||||||
}
|
}
|
||||||
}, context.config.delay.show);
|
}, context.config.delay.show);
|
||||||
|
|
@ -701,15 +654,15 @@
|
||||||
|
|
||||||
_proto._leave = function _leave(event, context) {
|
_proto._leave = function _leave(event, context) {
|
||||||
var dataKey = this.constructor.DATA_KEY;
|
var dataKey = this.constructor.DATA_KEY;
|
||||||
context = context || $(event.currentTarget).data(dataKey);
|
context = context || $__default['default'](event.currentTarget).data(dataKey);
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
context = new this.constructor(event.currentTarget, this._getDelegateConfig());
|
||||||
$(event.currentTarget).data(dataKey, context);
|
$__default['default'](event.currentTarget).data(dataKey, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
|
context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context._isWithActiveTrigger()) {
|
if (context._isWithActiveTrigger()) {
|
||||||
|
|
@ -717,7 +670,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
clearTimeout(context._timeout);
|
clearTimeout(context._timeout);
|
||||||
context._hoverState = HoverState.OUT;
|
context._hoverState = HOVER_STATE_OUT;
|
||||||
|
|
||||||
if (!context.config.delay || !context.config.delay.hide) {
|
if (!context.config.delay || !context.config.delay.hide) {
|
||||||
context.hide();
|
context.hide();
|
||||||
|
|
@ -725,7 +678,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
context._timeout = setTimeout(function () {
|
context._timeout = setTimeout(function () {
|
||||||
if (context._hoverState === HoverState.OUT) {
|
if (context._hoverState === HOVER_STATE_OUT) {
|
||||||
context.hide();
|
context.hide();
|
||||||
}
|
}
|
||||||
}, context.config.delay.hide);
|
}, context.config.delay.hide);
|
||||||
|
|
@ -742,13 +695,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._getConfig = function _getConfig(config) {
|
_proto._getConfig = function _getConfig(config) {
|
||||||
var dataAttributes = $(this.element).data();
|
var dataAttributes = $__default['default'](this.element).data();
|
||||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||||
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
||||||
delete dataAttributes[dataAttr];
|
delete dataAttributes[dataAttr];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
|
||||||
|
|
||||||
if (typeof config.delay === 'number') {
|
if (typeof config.delay === 'number') {
|
||||||
config.delay = {
|
config.delay = {
|
||||||
|
|
@ -765,7 +718,7 @@
|
||||||
config.content = config.content.toString();
|
config.content = config.content.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||||
|
|
||||||
if (config.sanitize) {
|
if (config.sanitize) {
|
||||||
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
|
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
|
||||||
|
|
@ -789,7 +742,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._cleanTipClass = function _cleanTipClass() {
|
_proto._cleanTipClass = function _cleanTipClass() {
|
||||||
var $tip = $(this.getTipElement());
|
var $tip = $__default['default'](this.getTipElement());
|
||||||
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
|
||||||
|
|
||||||
if (tabClass !== null && tabClass.length) {
|
if (tabClass !== null && tabClass.length) {
|
||||||
|
|
@ -798,8 +751,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
|
||||||
var popperInstance = popperData.instance;
|
this.tip = popperData.instance.popper;
|
||||||
this.tip = popperInstance.popper;
|
|
||||||
|
|
||||||
this._cleanTipClass();
|
this._cleanTipClass();
|
||||||
|
|
||||||
|
|
@ -814,7 +766,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(tip).removeClass(ClassName.FADE);
|
$__default['default'](tip).removeClass(CLASS_NAME_FADE);
|
||||||
this.config.animation = false;
|
this.config.animation = false;
|
||||||
this.hide();
|
this.hide();
|
||||||
this.show();
|
this.show();
|
||||||
|
|
@ -824,7 +776,8 @@
|
||||||
|
|
||||||
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
Tooltip._jQueryInterface = function _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var data = $(this).data(DATA_KEY);
|
var $element = $__default['default'](this);
|
||||||
|
var data = $element.data(DATA_KEY);
|
||||||
|
|
||||||
var _config = typeof config === 'object' && config;
|
var _config = typeof config === 'object' && config;
|
||||||
|
|
||||||
|
|
@ -834,7 +787,7 @@
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Tooltip(this, _config);
|
data = new Tooltip(this, _config);
|
||||||
$(this).data(DATA_KEY, data);
|
$element.data(DATA_KEY, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
|
|
@ -893,15 +846,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$.fn[NAME] = Tooltip._jQueryInterface;
|
$__default['default'].fn[NAME] = Tooltip._jQueryInterface;
|
||||||
$.fn[NAME].Constructor = Tooltip;
|
$__default['default'].fn[NAME].Constructor = Tooltip;
|
||||||
|
|
||||||
$.fn[NAME].noConflict = function () {
|
$__default['default'].fn[NAME].noConflict = function () {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
$__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
|
||||||
return Tooltip._jQueryInterface;
|
return Tooltip._jQueryInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
return Tooltip;
|
return Tooltip;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=tooltip.js.map
|
//# sourceMappingURL=tooltip.js.map
|
||||||
|
|
|
||||||
2
js/dist/tooltip.js.map
vendored
2
js/dist/tooltip.js.map
vendored
File diff suppressed because one or more lines are too long
61
js/dist/util.js
vendored
61
js/dist/util.js
vendored
|
|
@ -1,20 +1,22 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap util.js v4.3.1 (https://getbootstrap.com/)
|
* Bootstrap util.js v4.5.3 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
|
||||||
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
|
||||||
(global = global || self, global.Util = factory(global.jQuery));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Util = factory(global.jQuery));
|
||||||
}(this, function ($) { 'use strict';
|
}(this, (function ($) { 'use strict';
|
||||||
|
|
||||||
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
||||||
|
|
||||||
|
var $__default = /*#__PURE__*/_interopDefaultLegacy($);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): util.js
|
* Bootstrap (v4.5.3): util.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,6 +30,10 @@
|
||||||
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||||
|
|
||||||
function toType(obj) {
|
function toType(obj) {
|
||||||
|
if (obj === null || typeof obj === 'undefined') {
|
||||||
|
return "" + obj;
|
||||||
|
}
|
||||||
|
|
||||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,11 +42,11 @@
|
||||||
bindType: TRANSITION_END,
|
bindType: TRANSITION_END,
|
||||||
delegateType: TRANSITION_END,
|
delegateType: TRANSITION_END,
|
||||||
handle: function handle(event) {
|
handle: function handle(event) {
|
||||||
if ($(event.target).is(this)) {
|
if ($__default['default'](event.target).is(this)) {
|
||||||
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined; // eslint-disable-line no-undefined
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +55,7 @@
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
var called = false;
|
var called = false;
|
||||||
$(this).one(Util.TRANSITION_END, function () {
|
$__default['default'](this).one(Util.TRANSITION_END, function () {
|
||||||
called = true;
|
called = true;
|
||||||
});
|
});
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
@ -61,8 +67,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTransitionEndSupport() {
|
function setTransitionEndSupport() {
|
||||||
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
$__default['default'].fn.emulateTransitionEnd = transitionEndEmulator;
|
||||||
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
$__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
|
@ -75,7 +81,6 @@
|
||||||
TRANSITION_END: 'bsTransitionEnd',
|
TRANSITION_END: 'bsTransitionEnd',
|
||||||
getUID: function getUID(prefix) {
|
getUID: function getUID(prefix) {
|
||||||
do {
|
do {
|
||||||
// eslint-disable-next-line no-bitwise
|
|
||||||
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
|
||||||
} while (document.getElementById(prefix));
|
} while (document.getElementById(prefix));
|
||||||
|
|
||||||
|
|
@ -91,7 +96,7 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return document.querySelector(selector) ? selector : null;
|
return document.querySelector(selector) ? selector : null;
|
||||||
} catch (err) {
|
} catch (_) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -101,8 +106,8 @@
|
||||||
} // Get transition-duration of the element
|
} // Get transition-duration of the element
|
||||||
|
|
||||||
|
|
||||||
var transitionDuration = $(element).css('transition-duration');
|
var transitionDuration = $__default['default'](element).css('transition-duration');
|
||||||
var transitionDelay = $(element).css('transition-delay');
|
var transitionDelay = $__default['default'](element).css('transition-delay');
|
||||||
var floatTransitionDuration = parseFloat(transitionDuration);
|
var floatTransitionDuration = parseFloat(transitionDuration);
|
||||||
var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
|
var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
|
||||||
|
|
||||||
|
|
@ -119,9 +124,8 @@
|
||||||
return element.offsetHeight;
|
return element.offsetHeight;
|
||||||
},
|
},
|
||||||
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
||||||
$(element).trigger(TRANSITION_END);
|
$__default['default'](element).trigger(TRANSITION_END);
|
||||||
},
|
},
|
||||||
// TODO: Remove in v5
|
|
||||||
supportsTransitionEnd: function supportsTransitionEnd() {
|
supportsTransitionEnd: function supportsTransitionEnd() {
|
||||||
return Boolean(TRANSITION_END);
|
return Boolean(TRANSITION_END);
|
||||||
},
|
},
|
||||||
|
|
@ -162,11 +166,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return Util.findShadowRoot(element.parentNode);
|
return Util.findShadowRoot(element.parentNode);
|
||||||
|
},
|
||||||
|
jQueryDetection: function jQueryDetection() {
|
||||||
|
if (typeof $__default['default'] === 'undefined') {
|
||||||
|
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
|
||||||
|
}
|
||||||
|
|
||||||
|
var version = $__default['default'].fn.jquery.split(' ')[0].split('.');
|
||||||
|
var minMajor = 1;
|
||||||
|
var ltMajor = 2;
|
||||||
|
var minMinor = 9;
|
||||||
|
var minPatch = 1;
|
||||||
|
var maxMajor = 4;
|
||||||
|
|
||||||
|
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
||||||
|
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Util.jQueryDetection();
|
||||||
setTransitionEndSupport();
|
setTransitionEndSupport();
|
||||||
|
|
||||||
return Util;
|
return Util;
|
||||||
|
|
||||||
}));
|
})));
|
||||||
//# sourceMappingURL=util.js.map
|
//# sourceMappingURL=util.js.map
|
||||||
|
|
|
||||||
2
js/dist/util.js.map
vendored
2
js/dist/util.js.map
vendored
File diff suppressed because one or more lines are too long
34
js/index.js
Normal file
34
js/index.js
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
* Bootstrap (v4.5.3): index.js
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
|
* --------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Alert from './src/alert'
|
||||||
|
import Button from './src/button'
|
||||||
|
import Carousel from './src/carousel'
|
||||||
|
import Collapse from './src/collapse'
|
||||||
|
import Dropdown from './src/dropdown'
|
||||||
|
import Modal from './src/modal'
|
||||||
|
import Popover from './src/popover'
|
||||||
|
import Scrollspy from './src/scrollspy'
|
||||||
|
import Tab from './src/tab'
|
||||||
|
import Toast from './src/toast'
|
||||||
|
import Tooltip from './src/tooltip'
|
||||||
|
import Util from './src/util'
|
||||||
|
|
||||||
|
export {
|
||||||
|
Util,
|
||||||
|
Alert,
|
||||||
|
Button,
|
||||||
|
Carousel,
|
||||||
|
Collapse,
|
||||||
|
Dropdown,
|
||||||
|
Modal,
|
||||||
|
Popover,
|
||||||
|
Scrollspy,
|
||||||
|
Tab,
|
||||||
|
Toast,
|
||||||
|
Tooltip
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): alert.js
|
* Bootstrap (v4.5.3): alert.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,28 +14,22 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'alert'
|
const NAME = 'alert'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.alert'
|
const DATA_KEY = 'bs.alert'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DISMISS = '[data-dismiss="alert"]'
|
||||||
DISMISS : '[data-dismiss="alert"]'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Event = {
|
const EVENT_CLOSE = `close${EVENT_KEY}`
|
||||||
CLOSE : `close${EVENT_KEY}`,
|
const EVENT_CLOSED = `closed${EVENT_KEY}`
|
||||||
CLOSED : `closed${EVENT_KEY}`,
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_ALERT = 'alert'
|
||||||
ALERT : 'alert',
|
const CLASS_NAME_FADE = 'fade'
|
||||||
FADE : 'fade',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -80,30 +74,30 @@ class Alert {
|
||||||
|
|
||||||
_getRootElement(element) {
|
_getRootElement(element) {
|
||||||
const selector = Util.getSelectorFromElement(element)
|
const selector = Util.getSelectorFromElement(element)
|
||||||
let parent = false
|
let parent = false
|
||||||
|
|
||||||
if (selector) {
|
if (selector) {
|
||||||
parent = document.querySelector(selector)
|
parent = document.querySelector(selector)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
parent = $(element).closest(`.${ClassName.ALERT}`)[0]
|
parent = $(element).closest(`.${CLASS_NAME_ALERT}`)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent
|
return parent
|
||||||
}
|
}
|
||||||
|
|
||||||
_triggerCloseEvent(element) {
|
_triggerCloseEvent(element) {
|
||||||
const closeEvent = $.Event(Event.CLOSE)
|
const closeEvent = $.Event(EVENT_CLOSE)
|
||||||
|
|
||||||
$(element).trigger(closeEvent)
|
$(element).trigger(closeEvent)
|
||||||
return closeEvent
|
return closeEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
_removeElement(element) {
|
_removeElement(element) {
|
||||||
$(element).removeClass(ClassName.SHOW)
|
$(element).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
if (!$(element).hasClass(ClassName.FADE)) {
|
if (!$(element).hasClass(CLASS_NAME_FADE)) {
|
||||||
this._destroyElement(element)
|
this._destroyElement(element)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -111,14 +105,14 @@ class Alert {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(element)
|
const transitionDuration = Util.getTransitionDurationFromElement(element)
|
||||||
|
|
||||||
$(element)
|
$(element)
|
||||||
.one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))
|
.one(Util.TRANSITION_END, event => this._destroyElement(element, event))
|
||||||
.emulateTransitionEnd(transitionDuration)
|
.emulateTransitionEnd(transitionDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
_destroyElement(element) {
|
_destroyElement(element) {
|
||||||
$(element)
|
$(element)
|
||||||
.detach()
|
.detach()
|
||||||
.trigger(Event.CLOSED)
|
.trigger(EVENT_CLOSED)
|
||||||
.remove()
|
.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +121,7 @@ class Alert {
|
||||||
static _jQueryInterface(config) {
|
static _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
const $element = $(this)
|
const $element = $(this)
|
||||||
let data = $element.data(DATA_KEY)
|
let data = $element.data(DATA_KEY)
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Alert(this)
|
data = new Alert(this)
|
||||||
|
|
@ -158,8 +152,8 @@ class Alert {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).on(
|
$(document).on(
|
||||||
Event.CLICK_DATA_API,
|
EVENT_CLICK_DATA_API,
|
||||||
Selector.DISMISS,
|
SELECTOR_DISMISS,
|
||||||
Alert._handleDismiss(new Alert())
|
Alert._handleDismiss(new Alert())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -169,9 +163,9 @@ $(document).on(
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Alert._jQueryInterface
|
$.fn[NAME] = Alert._jQueryInterface
|
||||||
$.fn[NAME].Constructor = Alert
|
$.fn[NAME].Constructor = Alert
|
||||||
$.fn[NAME].noConflict = () => {
|
$.fn[NAME].noConflict = () => {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
return Alert._jQueryInterface
|
return Alert._jQueryInterface
|
||||||
}
|
}
|
||||||
|
|
|
||||||
152
js/src/button.js
152
js/src/button.js
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): button.js
|
* Bootstrap (v4.5.3): button.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -13,32 +13,29 @@ import $ from 'jquery'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'button'
|
const NAME = 'button'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.button'
|
const DATA_KEY = 'bs.button'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_ACTIVE = 'active'
|
||||||
ACTIVE : 'active',
|
const CLASS_NAME_BUTTON = 'btn'
|
||||||
BUTTON : 'btn',
|
const CLASS_NAME_FOCUS = 'focus'
|
||||||
FOCUS : 'focus'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'
|
||||||
DATA_TOGGLE_CARROT : '[data-toggle^="button"]',
|
const SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'
|
||||||
DATA_TOGGLE : '[data-toggle="buttons"]',
|
const SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'
|
||||||
INPUT : 'input:not([type="hidden"])',
|
const SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'
|
||||||
ACTIVE : '.active',
|
const SELECTOR_INPUT = 'input:not([type="hidden"])'
|
||||||
BUTTON : '.btn'
|
const SELECTOR_ACTIVE = '.active'
|
||||||
}
|
const SELECTOR_BUTTON = '.btn'
|
||||||
|
|
||||||
const Event = {
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,
|
const EVENT_FOCUS_BLUR_DATA_API = `focus${EVENT_KEY}${DATA_API_KEY} ` +
|
||||||
FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +
|
|
||||||
`blur${EVENT_KEY}${DATA_API_KEY}`
|
`blur${EVENT_KEY}${DATA_API_KEY}`
|
||||||
}
|
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -49,6 +46,7 @@ const Event = {
|
||||||
class Button {
|
class Button {
|
||||||
constructor(element) {
|
constructor(element) {
|
||||||
this._element = element
|
this._element = element
|
||||||
|
this.shouldAvoidTriggerChange = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
|
@ -62,36 +60,33 @@ class Button {
|
||||||
toggle() {
|
toggle() {
|
||||||
let triggerChangeEvent = true
|
let triggerChangeEvent = true
|
||||||
let addAriaPressed = true
|
let addAriaPressed = true
|
||||||
const rootElement = $(this._element).closest(
|
const rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0]
|
||||||
Selector.DATA_TOGGLE
|
|
||||||
)[0]
|
|
||||||
|
|
||||||
if (rootElement) {
|
if (rootElement) {
|
||||||
const input = this._element.querySelector(Selector.INPUT)
|
const input = this._element.querySelector(SELECTOR_INPUT)
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
if (input.type === 'radio') {
|
if (input.type === 'radio') {
|
||||||
if (input.checked &&
|
if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
||||||
this._element.classList.contains(ClassName.ACTIVE)) {
|
|
||||||
triggerChangeEvent = false
|
triggerChangeEvent = false
|
||||||
} else {
|
} else {
|
||||||
const activeElement = rootElement.querySelector(Selector.ACTIVE)
|
const activeElement = rootElement.querySelector(SELECTOR_ACTIVE)
|
||||||
|
|
||||||
if (activeElement) {
|
if (activeElement) {
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE)
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
if (triggerChangeEvent) {
|
||||||
if (input.hasAttribute('disabled') ||
|
// if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
|
||||||
rootElement.hasAttribute('disabled') ||
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||||
input.classList.contains('disabled') ||
|
input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE)
|
||||||
rootElement.classList.contains('disabled')) {
|
}
|
||||||
return
|
|
||||||
|
if (!this.shouldAvoidTriggerChange) {
|
||||||
|
$(input).trigger('change')
|
||||||
}
|
}
|
||||||
input.checked = !this._element.classList.contains(ClassName.ACTIVE)
|
|
||||||
$(input).trigger('change')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input.focus()
|
input.focus()
|
||||||
|
|
@ -99,13 +94,14 @@ class Button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addAriaPressed) {
|
if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
|
||||||
this._element.setAttribute('aria-pressed',
|
if (addAriaPressed) {
|
||||||
!this._element.classList.contains(ClassName.ACTIVE))
|
this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (triggerChangeEvent) {
|
if (triggerChangeEvent) {
|
||||||
$(this._element).toggleClass(ClassName.ACTIVE)
|
$(this._element).toggleClass(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,15 +112,18 @@ class Button {
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
||||||
static _jQueryInterface(config) {
|
static _jQueryInterface(config, avoidTriggerChange) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
let data = $(this).data(DATA_KEY)
|
const $element = $(this)
|
||||||
|
let data = $element.data(DATA_KEY)
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Button(this)
|
data = new Button(this)
|
||||||
$(this).data(DATA_KEY, data)
|
$element.data(DATA_KEY, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data.shouldAvoidTriggerChange = avoidTriggerChange
|
||||||
|
|
||||||
if (config === 'toggle') {
|
if (config === 'toggle') {
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
|
|
@ -139,22 +138,61 @@ class Button {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {
|
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
let button = event.target
|
let button = event.target
|
||||||
|
const initialButton = button
|
||||||
|
|
||||||
if (!$(button).hasClass(ClassName.BUTTON)) {
|
if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
|
||||||
button = $(button).closest(Selector.BUTTON)
|
button = $(button).closest(SELECTOR_BUTTON)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
Button._jQueryInterface.call($(button), 'toggle')
|
if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
|
||||||
|
event.preventDefault() // work around Firefox bug #1540995
|
||||||
|
} else {
|
||||||
|
const inputBtn = button.querySelector(SELECTOR_INPUT)
|
||||||
|
|
||||||
|
if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
|
||||||
|
event.preventDefault() // work around Firefox bug #1540995
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {
|
||||||
|
Button._jQueryInterface.call($(button), 'toggle', initialButton.tagName === 'INPUT')
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {
|
.on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, event => {
|
||||||
const button = $(event.target).closest(Selector.BUTTON)[0]
|
const button = $(event.target).closest(SELECTOR_BUTTON)[0]
|
||||||
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))
|
$(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||||
|
// ensure correct active class is set to match the controls' actual values/states
|
||||||
|
|
||||||
|
// find all checkboxes/readio buttons inside data-toggle groups
|
||||||
|
let buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS))
|
||||||
|
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
const button = buttons[i]
|
||||||
|
const input = button.querySelector(SELECTOR_INPUT)
|
||||||
|
if (input.checked || input.hasAttribute('checked')) {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE)
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// find all button toggles
|
||||||
|
buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
|
for (let i = 0, len = buttons.length; i < len; i++) {
|
||||||
|
const button = buttons[i]
|
||||||
|
if (button.getAttribute('aria-pressed') === 'true') {
|
||||||
|
button.classList.add(CLASS_NAME_ACTIVE)
|
||||||
|
} else {
|
||||||
|
button.classList.remove(CLASS_NAME_ACTIVE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* jQuery
|
* jQuery
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): carousel.js
|
* Bootstrap (v4.5.3): carousel.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,84 +14,75 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'carousel'
|
const NAME = 'carousel'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.carousel'
|
const DATA_KEY = 'bs.carousel'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key
|
const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key
|
||||||
const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key
|
const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key
|
||||||
const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch
|
const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch
|
||||||
const SWIPE_THRESHOLD = 40
|
const SWIPE_THRESHOLD = 40
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
interval : 5000,
|
interval: 5000,
|
||||||
keyboard : true,
|
keyboard: true,
|
||||||
slide : false,
|
slide: false,
|
||||||
pause : 'hover',
|
pause: 'hover',
|
||||||
wrap : true,
|
wrap: true,
|
||||||
touch : true
|
touch: true
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
interval : '(number|boolean)',
|
interval: '(number|boolean)',
|
||||||
keyboard : 'boolean',
|
keyboard: 'boolean',
|
||||||
slide : '(boolean|string)',
|
slide: '(boolean|string)',
|
||||||
pause : '(string|boolean)',
|
pause: '(string|boolean)',
|
||||||
wrap : 'boolean',
|
wrap: 'boolean',
|
||||||
touch : 'boolean'
|
touch: 'boolean'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Direction = {
|
const DIRECTION_NEXT = 'next'
|
||||||
NEXT : 'next',
|
const DIRECTION_PREV = 'prev'
|
||||||
PREV : 'prev',
|
const DIRECTION_LEFT = 'left'
|
||||||
LEFT : 'left',
|
const DIRECTION_RIGHT = 'right'
|
||||||
RIGHT : 'right'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Event = {
|
const EVENT_SLIDE = `slide${EVENT_KEY}`
|
||||||
SLIDE : `slide${EVENT_KEY}`,
|
const EVENT_SLID = `slid${EVENT_KEY}`
|
||||||
SLID : `slid${EVENT_KEY}`,
|
const EVENT_KEYDOWN = `keydown${EVENT_KEY}`
|
||||||
KEYDOWN : `keydown${EVENT_KEY}`,
|
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`
|
||||||
MOUSEENTER : `mouseenter${EVENT_KEY}`,
|
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`
|
||||||
MOUSELEAVE : `mouseleave${EVENT_KEY}`,
|
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`
|
||||||
TOUCHSTART : `touchstart${EVENT_KEY}`,
|
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`
|
||||||
TOUCHMOVE : `touchmove${EVENT_KEY}`,
|
const EVENT_TOUCHEND = `touchend${EVENT_KEY}`
|
||||||
TOUCHEND : `touchend${EVENT_KEY}`,
|
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`
|
||||||
POINTERDOWN : `pointerdown${EVENT_KEY}`,
|
const EVENT_POINTERUP = `pointerup${EVENT_KEY}`
|
||||||
POINTERUP : `pointerup${EVENT_KEY}`,
|
const EVENT_DRAG_START = `dragstart${EVENT_KEY}`
|
||||||
DRAG_START : `dragstart${EVENT_KEY}`,
|
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||||
LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_CAROUSEL = 'carousel'
|
||||||
CAROUSEL : 'carousel',
|
const CLASS_NAME_ACTIVE = 'active'
|
||||||
ACTIVE : 'active',
|
const CLASS_NAME_SLIDE = 'slide'
|
||||||
SLIDE : 'slide',
|
const CLASS_NAME_RIGHT = 'carousel-item-right'
|
||||||
RIGHT : 'carousel-item-right',
|
const CLASS_NAME_LEFT = 'carousel-item-left'
|
||||||
LEFT : 'carousel-item-left',
|
const CLASS_NAME_NEXT = 'carousel-item-next'
|
||||||
NEXT : 'carousel-item-next',
|
const CLASS_NAME_PREV = 'carousel-item-prev'
|
||||||
PREV : 'carousel-item-prev',
|
const CLASS_NAME_POINTER_EVENT = 'pointer-event'
|
||||||
ITEM : 'carousel-item',
|
|
||||||
POINTER_EVENT : 'pointer-event'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_ACTIVE = '.active'
|
||||||
ACTIVE : '.active',
|
const SELECTOR_ACTIVE_ITEM = '.active.carousel-item'
|
||||||
ACTIVE_ITEM : '.active.carousel-item',
|
const SELECTOR_ITEM = '.carousel-item'
|
||||||
ITEM : '.carousel-item',
|
const SELECTOR_ITEM_IMG = '.carousel-item img'
|
||||||
ITEM_IMG : '.carousel-item img',
|
const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'
|
||||||
NEXT_PREV : '.carousel-item-next, .carousel-item-prev',
|
const SELECTOR_INDICATORS = '.carousel-indicators'
|
||||||
INDICATORS : '.carousel-indicators',
|
const SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'
|
||||||
DATA_SLIDE : '[data-slide], [data-slide-to]',
|
const SELECTOR_DATA_RIDE = '[data-ride="carousel"]'
|
||||||
DATA_RIDE : '[data-ride="carousel"]'
|
|
||||||
}
|
|
||||||
|
|
||||||
const PointerType = {
|
const PointerType = {
|
||||||
TOUCH : 'touch',
|
TOUCH: 'touch',
|
||||||
PEN : 'pen'
|
PEN: 'pen'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,20 +92,20 @@ const PointerType = {
|
||||||
*/
|
*/
|
||||||
class Carousel {
|
class Carousel {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._items = null
|
this._items = null
|
||||||
this._interval = null
|
this._interval = null
|
||||||
this._activeElement = null
|
this._activeElement = null
|
||||||
this._isPaused = false
|
this._isPaused = false
|
||||||
this._isSliding = false
|
this._isSliding = false
|
||||||
this.touchTimeout = null
|
this.touchTimeout = null
|
||||||
this.touchStartX = 0
|
this.touchStartX = 0
|
||||||
this.touchDeltaX = 0
|
this.touchDeltaX = 0
|
||||||
|
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._element = element
|
this._element = element
|
||||||
this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)
|
this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS)
|
||||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
||||||
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)
|
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)
|
||||||
|
|
||||||
this._addEventListeners()
|
this._addEventListeners()
|
||||||
}
|
}
|
||||||
|
|
@ -133,22 +124,23 @@ class Carousel {
|
||||||
|
|
||||||
next() {
|
next() {
|
||||||
if (!this._isSliding) {
|
if (!this._isSliding) {
|
||||||
this._slide(Direction.NEXT)
|
this._slide(DIRECTION_NEXT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nextWhenVisible() {
|
nextWhenVisible() {
|
||||||
|
const $element = $(this._element)
|
||||||
// Don't call next when the page isn't visible
|
// Don't call next when the page isn't visible
|
||||||
// or the carousel or its parent isn't visible
|
// or the carousel or its parent isn't visible
|
||||||
if (!document.hidden &&
|
if (!document.hidden &&
|
||||||
($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {
|
($element.is(':visible') && $element.css('visibility') !== 'hidden')) {
|
||||||
this.next()
|
this.next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prev() {
|
prev() {
|
||||||
if (!this._isSliding) {
|
if (!this._isSliding) {
|
||||||
this._slide(Direction.PREV)
|
this._slide(DIRECTION_PREV)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,7 +149,7 @@ class Carousel {
|
||||||
this._isPaused = true
|
this._isPaused = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._element.querySelector(Selector.NEXT_PREV)) {
|
if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
|
||||||
Util.triggerTransitionEnd(this._element)
|
Util.triggerTransitionEnd(this._element)
|
||||||
this.cycle(true)
|
this.cycle(true)
|
||||||
}
|
}
|
||||||
|
|
@ -177,6 +169,8 @@ class Carousel {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._config.interval && !this._isPaused) {
|
if (this._config.interval && !this._isPaused) {
|
||||||
|
this._updateInterval()
|
||||||
|
|
||||||
this._interval = setInterval(
|
this._interval = setInterval(
|
||||||
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
|
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
|
||||||
this._config.interval
|
this._config.interval
|
||||||
|
|
@ -185,7 +179,7 @@ class Carousel {
|
||||||
}
|
}
|
||||||
|
|
||||||
to(index) {
|
to(index) {
|
||||||
this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
|
this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||||
|
|
||||||
const activeIndex = this._getItemIndex(this._activeElement)
|
const activeIndex = this._getItemIndex(this._activeElement)
|
||||||
|
|
||||||
|
|
@ -194,7 +188,7 @@ class Carousel {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._isSliding) {
|
if (this._isSliding) {
|
||||||
$(this._element).one(Event.SLID, () => this.to(index))
|
$(this._element).one(EVENT_SLID, () => this.to(index))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,9 +198,9 @@ class Carousel {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const direction = index > activeIndex
|
const direction = index > activeIndex ?
|
||||||
? Direction.NEXT
|
DIRECTION_NEXT :
|
||||||
: Direction.PREV
|
DIRECTION_PREV
|
||||||
|
|
||||||
this._slide(direction, this._items[index])
|
this._slide(direction, this._items[index])
|
||||||
}
|
}
|
||||||
|
|
@ -215,13 +209,13 @@ class Carousel {
|
||||||
$(this._element).off(EVENT_KEY)
|
$(this._element).off(EVENT_KEY)
|
||||||
$.removeData(this._element, DATA_KEY)
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
|
||||||
this._items = null
|
this._items = null
|
||||||
this._config = null
|
this._config = null
|
||||||
this._element = null
|
this._element = null
|
||||||
this._interval = null
|
this._interval = null
|
||||||
this._isPaused = null
|
this._isPaused = null
|
||||||
this._isSliding = null
|
this._isSliding = null
|
||||||
this._activeElement = null
|
this._activeElement = null
|
||||||
this._indicatorsElement = null
|
this._indicatorsElement = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,6 +239,8 @@ class Carousel {
|
||||||
|
|
||||||
const direction = absDeltax / this.touchDeltaX
|
const direction = absDeltax / this.touchDeltaX
|
||||||
|
|
||||||
|
this.touchDeltaX = 0
|
||||||
|
|
||||||
// swipe left
|
// swipe left
|
||||||
if (direction > 0) {
|
if (direction > 0) {
|
||||||
this.prev()
|
this.prev()
|
||||||
|
|
@ -258,14 +254,13 @@ class Carousel {
|
||||||
|
|
||||||
_addEventListeners() {
|
_addEventListeners() {
|
||||||
if (this._config.keyboard) {
|
if (this._config.keyboard) {
|
||||||
$(this._element)
|
$(this._element).on(EVENT_KEYDOWN, event => this._keydown(event))
|
||||||
.on(Event.KEYDOWN, (event) => this._keydown(event))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._config.pause === 'hover') {
|
if (this._config.pause === 'hover') {
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.on(Event.MOUSEENTER, (event) => this.pause(event))
|
.on(EVENT_MOUSEENTER, event => this.pause(event))
|
||||||
.on(Event.MOUSELEAVE, (event) => this.cycle(event))
|
.on(EVENT_MOUSELEAVE, event => this.cycle(event))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._config.touch) {
|
if (this._config.touch) {
|
||||||
|
|
@ -278,7 +273,7 @@ class Carousel {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const start = (event) => {
|
const start = event => {
|
||||||
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
this.touchStartX = event.originalEvent.clientX
|
this.touchStartX = event.originalEvent.clientX
|
||||||
} else if (!this._pointerEvent) {
|
} else if (!this._pointerEvent) {
|
||||||
|
|
@ -286,7 +281,7 @@ class Carousel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const move = (event) => {
|
const move = event => {
|
||||||
// ensure swiping with one touch and not pinching
|
// ensure swiping with one touch and not pinching
|
||||||
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
||||||
this.touchDeltaX = 0
|
this.touchDeltaX = 0
|
||||||
|
|
@ -295,7 +290,7 @@ class Carousel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const end = (event) => {
|
const end = event => {
|
||||||
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||||
this.touchDeltaX = event.originalEvent.clientX - this.touchStartX
|
this.touchDeltaX = event.originalEvent.clientX - this.touchStartX
|
||||||
}
|
}
|
||||||
|
|
@ -314,20 +309,23 @@ class Carousel {
|
||||||
if (this.touchTimeout) {
|
if (this.touchTimeout) {
|
||||||
clearTimeout(this.touchTimeout)
|
clearTimeout(this.touchTimeout)
|
||||||
}
|
}
|
||||||
this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)
|
|
||||||
|
this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())
|
$(this._element.querySelectorAll(SELECTOR_ITEM_IMG))
|
||||||
if (this._pointerEvent) {
|
.on(EVENT_DRAG_START, e => e.preventDefault())
|
||||||
$(this._element).on(Event.POINTERDOWN, (event) => start(event))
|
|
||||||
$(this._element).on(Event.POINTERUP, (event) => end(event))
|
|
||||||
|
|
||||||
this._element.classList.add(ClassName.POINTER_EVENT)
|
if (this._pointerEvent) {
|
||||||
|
$(this._element).on(EVENT_POINTERDOWN, event => start(event))
|
||||||
|
$(this._element).on(EVENT_POINTERUP, event => end(event))
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_POINTER_EVENT)
|
||||||
} else {
|
} else {
|
||||||
$(this._element).on(Event.TOUCHSTART, (event) => start(event))
|
$(this._element).on(EVENT_TOUCHSTART, event => start(event))
|
||||||
$(this._element).on(Event.TOUCHMOVE, (event) => move(event))
|
$(this._element).on(EVENT_TOUCHMOVE, event => move(event))
|
||||||
$(this._element).on(Event.TOUCHEND, (event) => end(event))
|
$(this._element).on(EVENT_TOUCHEND, event => end(event))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -350,35 +348,35 @@ class Carousel {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getItemIndex(element) {
|
_getItemIndex(element) {
|
||||||
this._items = element && element.parentNode
|
this._items = element && element.parentNode ?
|
||||||
? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))
|
[].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) :
|
||||||
: []
|
[]
|
||||||
return this._items.indexOf(element)
|
return this._items.indexOf(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
_getItemByDirection(direction, activeElement) {
|
_getItemByDirection(direction, activeElement) {
|
||||||
const isNextDirection = direction === Direction.NEXT
|
const isNextDirection = direction === DIRECTION_NEXT
|
||||||
const isPrevDirection = direction === Direction.PREV
|
const isPrevDirection = direction === DIRECTION_PREV
|
||||||
const activeIndex = this._getItemIndex(activeElement)
|
const activeIndex = this._getItemIndex(activeElement)
|
||||||
const lastItemIndex = this._items.length - 1
|
const lastItemIndex = this._items.length - 1
|
||||||
const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
|
const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
|
||||||
isNextDirection && activeIndex === lastItemIndex
|
isNextDirection && activeIndex === lastItemIndex
|
||||||
|
|
||||||
if (isGoingToWrap && !this._config.wrap) {
|
if (isGoingToWrap && !this._config.wrap) {
|
||||||
return activeElement
|
return activeElement
|
||||||
}
|
}
|
||||||
|
|
||||||
const delta = direction === Direction.PREV ? -1 : 1
|
const delta = direction === DIRECTION_PREV ? -1 : 1
|
||||||
const itemIndex = (activeIndex + delta) % this._items.length
|
const itemIndex = (activeIndex + delta) % this._items.length
|
||||||
|
|
||||||
return itemIndex === -1
|
return itemIndex === -1 ?
|
||||||
? this._items[this._items.length - 1] : this._items[itemIndex]
|
this._items[this._items.length - 1] : this._items[itemIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||||
const targetIndex = this._getItemIndex(relatedTarget)
|
const targetIndex = this._getItemIndex(relatedTarget)
|
||||||
const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))
|
const fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM))
|
||||||
const slideEvent = $.Event(Event.SLIDE, {
|
const slideEvent = $.Event(EVENT_SLIDE, {
|
||||||
relatedTarget,
|
relatedTarget,
|
||||||
direction: eventDirectionName,
|
direction: eventDirectionName,
|
||||||
from: fromIndex,
|
from: fromIndex,
|
||||||
|
|
@ -392,24 +390,40 @@ class Carousel {
|
||||||
|
|
||||||
_setActiveIndicatorElement(element) {
|
_setActiveIndicatorElement(element) {
|
||||||
if (this._indicatorsElement) {
|
if (this._indicatorsElement) {
|
||||||
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))
|
const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE))
|
||||||
$(indicators)
|
$(indicators).removeClass(CLASS_NAME_ACTIVE)
|
||||||
.removeClass(ClassName.ACTIVE)
|
|
||||||
|
|
||||||
const nextIndicator = this._indicatorsElement.children[
|
const nextIndicator = this._indicatorsElement.children[
|
||||||
this._getItemIndex(element)
|
this._getItemIndex(element)
|
||||||
]
|
]
|
||||||
|
|
||||||
if (nextIndicator) {
|
if (nextIndicator) {
|
||||||
$(nextIndicator).addClass(ClassName.ACTIVE)
|
$(nextIndicator).addClass(CLASS_NAME_ACTIVE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_updateInterval() {
|
||||||
|
const element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||||
|
|
||||||
|
if (!element) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const elementInterval = parseInt(element.getAttribute('data-interval'), 10)
|
||||||
|
|
||||||
|
if (elementInterval) {
|
||||||
|
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
|
||||||
|
this._config.interval = elementInterval
|
||||||
|
} else {
|
||||||
|
this._config.interval = this._config.defaultInterval || this._config.interval
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_slide(direction, element) {
|
_slide(direction, element) {
|
||||||
const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)
|
const activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM)
|
||||||
const activeElementIndex = this._getItemIndex(activeElement)
|
const activeElementIndex = this._getItemIndex(activeElement)
|
||||||
const nextElement = element || activeElement &&
|
const nextElement = element || activeElement &&
|
||||||
this._getItemByDirection(direction, activeElement)
|
this._getItemByDirection(direction, activeElement)
|
||||||
const nextElementIndex = this._getItemIndex(nextElement)
|
const nextElementIndex = this._getItemIndex(nextElement)
|
||||||
const isCycling = Boolean(this._interval)
|
const isCycling = Boolean(this._interval)
|
||||||
|
|
@ -418,17 +432,17 @@ class Carousel {
|
||||||
let orderClassName
|
let orderClassName
|
||||||
let eventDirectionName
|
let eventDirectionName
|
||||||
|
|
||||||
if (direction === Direction.NEXT) {
|
if (direction === DIRECTION_NEXT) {
|
||||||
directionalClassName = ClassName.LEFT
|
directionalClassName = CLASS_NAME_LEFT
|
||||||
orderClassName = ClassName.NEXT
|
orderClassName = CLASS_NAME_NEXT
|
||||||
eventDirectionName = Direction.LEFT
|
eventDirectionName = DIRECTION_LEFT
|
||||||
} else {
|
} else {
|
||||||
directionalClassName = ClassName.RIGHT
|
directionalClassName = CLASS_NAME_RIGHT
|
||||||
orderClassName = ClassName.PREV
|
orderClassName = CLASS_NAME_PREV
|
||||||
eventDirectionName = Direction.RIGHT
|
eventDirectionName = DIRECTION_RIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {
|
if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE)) {
|
||||||
this._isSliding = false
|
this._isSliding = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -450,15 +464,16 @@ class Carousel {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._setActiveIndicatorElement(nextElement)
|
this._setActiveIndicatorElement(nextElement)
|
||||||
|
this._activeElement = nextElement
|
||||||
|
|
||||||
const slidEvent = $.Event(Event.SLID, {
|
const slidEvent = $.Event(EVENT_SLID, {
|
||||||
relatedTarget: nextElement,
|
relatedTarget: nextElement,
|
||||||
direction: eventDirectionName,
|
direction: eventDirectionName,
|
||||||
from: activeElementIndex,
|
from: activeElementIndex,
|
||||||
to: nextElementIndex
|
to: nextElementIndex
|
||||||
})
|
})
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.SLIDE)) {
|
if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
|
||||||
$(nextElement).addClass(orderClassName)
|
$(nextElement).addClass(orderClassName)
|
||||||
|
|
||||||
Util.reflow(nextElement)
|
Util.reflow(nextElement)
|
||||||
|
|
@ -466,23 +481,15 @@ class Carousel {
|
||||||
$(activeElement).addClass(directionalClassName)
|
$(activeElement).addClass(directionalClassName)
|
||||||
$(nextElement).addClass(directionalClassName)
|
$(nextElement).addClass(directionalClassName)
|
||||||
|
|
||||||
const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)
|
|
||||||
if (nextElementInterval) {
|
|
||||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
|
|
||||||
this._config.interval = nextElementInterval
|
|
||||||
} else {
|
|
||||||
this._config.interval = this._config.defaultInterval || this._config.interval
|
|
||||||
}
|
|
||||||
|
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
|
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
|
||||||
|
|
||||||
$(activeElement)
|
$(activeElement)
|
||||||
.one(Util.TRANSITION_END, () => {
|
.one(Util.TRANSITION_END, () => {
|
||||||
$(nextElement)
|
$(nextElement)
|
||||||
.removeClass(`${directionalClassName} ${orderClassName}`)
|
.removeClass(`${directionalClassName} ${orderClassName}`)
|
||||||
.addClass(ClassName.ACTIVE)
|
.addClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
$(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)
|
$(activeElement).removeClass(`${CLASS_NAME_ACTIVE} ${orderClassName} ${directionalClassName}`)
|
||||||
|
|
||||||
this._isSliding = false
|
this._isSliding = false
|
||||||
|
|
||||||
|
|
@ -490,8 +497,8 @@ class Carousel {
|
||||||
})
|
})
|
||||||
.emulateTransitionEnd(transitionDuration)
|
.emulateTransitionEnd(transitionDuration)
|
||||||
} else {
|
} else {
|
||||||
$(activeElement).removeClass(ClassName.ACTIVE)
|
$(activeElement).removeClass(CLASS_NAME_ACTIVE)
|
||||||
$(nextElement).addClass(ClassName.ACTIVE)
|
$(nextElement).addClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
this._isSliding = false
|
this._isSliding = false
|
||||||
$(this._element).trigger(slidEvent)
|
$(this._element).trigger(slidEvent)
|
||||||
|
|
@ -532,6 +539,7 @@ class Carousel {
|
||||||
if (typeof data[action] === 'undefined') {
|
if (typeof data[action] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${action}"`)
|
throw new TypeError(`No method named "${action}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[action]()
|
data[action]()
|
||||||
} else if (_config.interval && _config.ride) {
|
} else if (_config.interval && _config.ride) {
|
||||||
data.pause()
|
data.pause()
|
||||||
|
|
@ -549,7 +557,7 @@ class Carousel {
|
||||||
|
|
||||||
const target = $(selector)[0]
|
const target = $(selector)[0]
|
||||||
|
|
||||||
if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {
|
if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -579,11 +587,10 @@ class Carousel {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document)
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler)
|
||||||
.on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)
|
|
||||||
|
|
||||||
$(window).on(Event.LOAD_DATA_API, () => {
|
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||||
const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))
|
const carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE))
|
||||||
for (let i = 0, len = carousels.length; i < len; i++) {
|
for (let i = 0, len = carousels.length; i < len; i++) {
|
||||||
const $carousel = $(carousels[i])
|
const $carousel = $(carousels[i])
|
||||||
Carousel._jQueryInterface.call($carousel, $carousel.data())
|
Carousel._jQueryInterface.call($carousel, $carousel.data())
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): collapse.js
|
* Bootstrap (v4.5.3): collapse.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,47 +14,39 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'collapse'
|
const NAME = 'collapse'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.collapse'
|
const DATA_KEY = 'bs.collapse'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
toggle : true,
|
toggle: true,
|
||||||
parent : ''
|
parent: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
toggle : 'boolean',
|
toggle: 'boolean',
|
||||||
parent : '(string|element)'
|
parent: '(string|element)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Event = {
|
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||||
SHOW : `show${EVENT_KEY}`,
|
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||||
SHOWN : `shown${EVENT_KEY}`,
|
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show',
|
const CLASS_NAME_COLLAPSE = 'collapse'
|
||||||
COLLAPSE : 'collapse',
|
const CLASS_NAME_COLLAPSING = 'collapsing'
|
||||||
COLLAPSING : 'collapsing',
|
const CLASS_NAME_COLLAPSED = 'collapsed'
|
||||||
COLLAPSED : 'collapsed'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Dimension = {
|
const DIMENSION_WIDTH = 'width'
|
||||||
WIDTH : 'width',
|
const DIMENSION_HEIGHT = 'height'
|
||||||
HEIGHT : 'height'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_ACTIVES = '.show, .collapsing'
|
||||||
ACTIVES : '.show, .collapsing',
|
const SELECTOR_DATA_TOGGLE = '[data-toggle="collapse"]'
|
||||||
DATA_TOGGLE : '[data-toggle="collapse"]'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -65,19 +57,19 @@ const Selector = {
|
||||||
class Collapse {
|
class Collapse {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._isTransitioning = false
|
this._isTransitioning = false
|
||||||
this._element = element
|
this._element = element
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._triggerArray = [].slice.call(document.querySelectorAll(
|
this._triggerArray = [].slice.call(document.querySelectorAll(
|
||||||
`[data-toggle="collapse"][href="#${element.id}"],` +
|
`[data-toggle="collapse"][href="#${element.id}"],` +
|
||||||
`[data-toggle="collapse"][data-target="#${element.id}"]`
|
`[data-toggle="collapse"][data-target="#${element.id}"]`
|
||||||
))
|
))
|
||||||
|
|
||||||
const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
|
const toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
for (let i = 0, len = toggleList.length; i < len; i++) {
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
||||||
const elem = toggleList[i]
|
const elem = toggleList[i]
|
||||||
const selector = Util.getSelectorFromElement(elem)
|
const selector = Util.getSelectorFromElement(elem)
|
||||||
const filterElement = [].slice.call(document.querySelectorAll(selector))
|
const filterElement = [].slice.call(document.querySelectorAll(selector))
|
||||||
.filter((foundElem) => foundElem === element)
|
.filter(foundElem => foundElem === element)
|
||||||
|
|
||||||
if (selector !== null && filterElement.length > 0) {
|
if (selector !== null && filterElement.length > 0) {
|
||||||
this._selector = selector
|
this._selector = selector
|
||||||
|
|
@ -109,7 +101,7 @@ class Collapse {
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
if ($(this._element).hasClass(ClassName.SHOW)) {
|
if ($(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
this.hide()
|
this.hide()
|
||||||
} else {
|
} else {
|
||||||
this.show()
|
this.show()
|
||||||
|
|
@ -118,7 +110,7 @@ class Collapse {
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
if (this._isTransitioning ||
|
if (this._isTransitioning ||
|
||||||
$(this._element).hasClass(ClassName.SHOW)) {
|
$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,13 +118,13 @@ class Collapse {
|
||||||
let activesData
|
let activesData
|
||||||
|
|
||||||
if (this._parent) {
|
if (this._parent) {
|
||||||
actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))
|
actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES))
|
||||||
.filter((elem) => {
|
.filter(elem => {
|
||||||
if (typeof this._config.parent === 'string') {
|
if (typeof this._config.parent === 'string') {
|
||||||
return elem.getAttribute('data-parent') === this._config.parent
|
return elem.getAttribute('data-parent') === this._config.parent
|
||||||
}
|
}
|
||||||
|
|
||||||
return elem.classList.contains(ClassName.COLLAPSE)
|
return elem.classList.contains(CLASS_NAME_COLLAPSE)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (actives.length === 0) {
|
if (actives.length === 0) {
|
||||||
|
|
@ -147,7 +139,7 @@ class Collapse {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const startEvent = $.Event(Event.SHOW)
|
const startEvent = $.Event(EVENT_SHOW)
|
||||||
$(this._element).trigger(startEvent)
|
$(this._element).trigger(startEvent)
|
||||||
if (startEvent.isDefaultPrevented()) {
|
if (startEvent.isDefaultPrevented()) {
|
||||||
return
|
return
|
||||||
|
|
@ -163,14 +155,14 @@ class Collapse {
|
||||||
const dimension = this._getDimension()
|
const dimension = this._getDimension()
|
||||||
|
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.removeClass(ClassName.COLLAPSE)
|
.removeClass(CLASS_NAME_COLLAPSE)
|
||||||
.addClass(ClassName.COLLAPSING)
|
.addClass(CLASS_NAME_COLLAPSING)
|
||||||
|
|
||||||
this._element.style[dimension] = 0
|
this._element.style[dimension] = 0
|
||||||
|
|
||||||
if (this._triggerArray.length) {
|
if (this._triggerArray.length) {
|
||||||
$(this._triggerArray)
|
$(this._triggerArray)
|
||||||
.removeClass(ClassName.COLLAPSED)
|
.removeClass(CLASS_NAME_COLLAPSED)
|
||||||
.attr('aria-expanded', true)
|
.attr('aria-expanded', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,15 +170,14 @@ class Collapse {
|
||||||
|
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.removeClass(ClassName.COLLAPSING)
|
.removeClass(CLASS_NAME_COLLAPSING)
|
||||||
.addClass(ClassName.COLLAPSE)
|
.addClass(`${CLASS_NAME_COLLAPSE} ${CLASS_NAME_SHOW}`)
|
||||||
.addClass(ClassName.SHOW)
|
|
||||||
|
|
||||||
this._element.style[dimension] = ''
|
this._element.style[dimension] = ''
|
||||||
|
|
||||||
this.setTransitioning(false)
|
this.setTransitioning(false)
|
||||||
|
|
||||||
$(this._element).trigger(Event.SHOWN)
|
$(this._element).trigger(EVENT_SHOWN)
|
||||||
}
|
}
|
||||||
|
|
||||||
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
|
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
|
||||||
|
|
@ -202,11 +193,11 @@ class Collapse {
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
if (this._isTransitioning ||
|
if (this._isTransitioning ||
|
||||||
!$(this._element).hasClass(ClassName.SHOW)) {
|
!$(this._element).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const startEvent = $.Event(Event.HIDE)
|
const startEvent = $.Event(EVENT_HIDE)
|
||||||
$(this._element).trigger(startEvent)
|
$(this._element).trigger(startEvent)
|
||||||
if (startEvent.isDefaultPrevented()) {
|
if (startEvent.isDefaultPrevented()) {
|
||||||
return
|
return
|
||||||
|
|
@ -219,9 +210,8 @@ class Collapse {
|
||||||
Util.reflow(this._element)
|
Util.reflow(this._element)
|
||||||
|
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.addClass(ClassName.COLLAPSING)
|
.addClass(CLASS_NAME_COLLAPSING)
|
||||||
.removeClass(ClassName.COLLAPSE)
|
.removeClass(`${CLASS_NAME_COLLAPSE} ${CLASS_NAME_SHOW}`)
|
||||||
.removeClass(ClassName.SHOW)
|
|
||||||
|
|
||||||
const triggerArrayLength = this._triggerArray.length
|
const triggerArrayLength = this._triggerArray.length
|
||||||
if (triggerArrayLength > 0) {
|
if (triggerArrayLength > 0) {
|
||||||
|
|
@ -231,8 +221,8 @@ class Collapse {
|
||||||
|
|
||||||
if (selector !== null) {
|
if (selector !== null) {
|
||||||
const $elem = $([].slice.call(document.querySelectorAll(selector)))
|
const $elem = $([].slice.call(document.querySelectorAll(selector)))
|
||||||
if (!$elem.hasClass(ClassName.SHOW)) {
|
if (!$elem.hasClass(CLASS_NAME_SHOW)) {
|
||||||
$(trigger).addClass(ClassName.COLLAPSED)
|
$(trigger).addClass(CLASS_NAME_COLLAPSED)
|
||||||
.attr('aria-expanded', false)
|
.attr('aria-expanded', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -244,9 +234,9 @@ class Collapse {
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
this.setTransitioning(false)
|
this.setTransitioning(false)
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.removeClass(ClassName.COLLAPSING)
|
.removeClass(CLASS_NAME_COLLAPSING)
|
||||||
.addClass(ClassName.COLLAPSE)
|
.addClass(CLASS_NAME_COLLAPSE)
|
||||||
.trigger(Event.HIDDEN)
|
.trigger(EVENT_HIDDEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.style[dimension] = ''
|
this._element.style[dimension] = ''
|
||||||
|
|
@ -264,10 +254,10 @@ class Collapse {
|
||||||
dispose() {
|
dispose() {
|
||||||
$.removeData(this._element, DATA_KEY)
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
|
||||||
this._config = null
|
this._config = null
|
||||||
this._parent = null
|
this._parent = null
|
||||||
this._element = null
|
this._element = null
|
||||||
this._triggerArray = null
|
this._triggerArray = null
|
||||||
this._isTransitioning = null
|
this._isTransitioning = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -284,8 +274,8 @@ class Collapse {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getDimension() {
|
_getDimension() {
|
||||||
const hasWidth = $(this._element).hasClass(Dimension.WIDTH)
|
const hasWidth = $(this._element).hasClass(DIMENSION_WIDTH)
|
||||||
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT
|
return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
_getParent() {
|
_getParent() {
|
||||||
|
|
@ -302,10 +292,9 @@ class Collapse {
|
||||||
parent = document.querySelector(this._config.parent)
|
parent = document.querySelector(this._config.parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
const selector =
|
const selector = `[data-toggle="collapse"][data-parent="${this._config.parent}"]`
|
||||||
`[data-toggle="collapse"][data-parent="${this._config.parent}"]`
|
|
||||||
|
|
||||||
const children = [].slice.call(parent.querySelectorAll(selector))
|
const children = [].slice.call(parent.querySelectorAll(selector))
|
||||||
|
|
||||||
$(children).each((i, element) => {
|
$(children).each((i, element) => {
|
||||||
this._addAriaAndCollapsedClass(
|
this._addAriaAndCollapsedClass(
|
||||||
Collapse._getTargetFromElement(element),
|
Collapse._getTargetFromElement(element),
|
||||||
|
|
@ -317,11 +306,11 @@ class Collapse {
|
||||||
}
|
}
|
||||||
|
|
||||||
_addAriaAndCollapsedClass(element, triggerArray) {
|
_addAriaAndCollapsedClass(element, triggerArray) {
|
||||||
const isOpen = $(element).hasClass(ClassName.SHOW)
|
const isOpen = $(element).hasClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
if (triggerArray.length) {
|
if (triggerArray.length) {
|
||||||
$(triggerArray)
|
$(triggerArray)
|
||||||
.toggleClass(ClassName.COLLAPSED, !isOpen)
|
.toggleClass(CLASS_NAME_COLLAPSED, !isOpen)
|
||||||
.attr('aria-expanded', isOpen)
|
.attr('aria-expanded', isOpen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -335,27 +324,28 @@ class Collapse {
|
||||||
|
|
||||||
static _jQueryInterface(config) {
|
static _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
const $this = $(this)
|
const $element = $(this)
|
||||||
let data = $this.data(DATA_KEY)
|
let data = $element.data(DATA_KEY)
|
||||||
const _config = {
|
const _config = {
|
||||||
...Default,
|
...Default,
|
||||||
...$this.data(),
|
...$element.data(),
|
||||||
...typeof config === 'object' && config ? config : {}
|
...(typeof config === 'object' && config ? config : {})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data && _config.toggle && /show|hide/.test(config)) {
|
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
||||||
_config.toggle = false
|
_config.toggle = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Collapse(this, _config)
|
data = new Collapse(this, _config)
|
||||||
$this.data(DATA_KEY, data)
|
$element.data(DATA_KEY, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'string') {
|
if (typeof config === 'string') {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -368,7 +358,7 @@ class Collapse {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
||||||
if (event.currentTarget.tagName === 'A') {
|
if (event.currentTarget.tagName === 'A') {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
@ -380,8 +370,8 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
|
|
||||||
$(selectors).each(function () {
|
$(selectors).each(function () {
|
||||||
const $target = $(this)
|
const $target = $(this)
|
||||||
const data = $target.data(DATA_KEY)
|
const data = $target.data(DATA_KEY)
|
||||||
const config = data ? 'toggle' : $trigger.data()
|
const config = data ? 'toggle' : $trigger.data()
|
||||||
Collapse._jQueryInterface.call($target, config)
|
Collapse._jQueryInterface.call($target, config)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): dropdown.js
|
* Bootstrap (v4.5.3): dropdown.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -15,75 +15,66 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'dropdown'
|
const NAME = 'dropdown'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.dropdown'
|
const DATA_KEY = 'bs.dropdown'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||||
const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key
|
const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key
|
||||||
const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key
|
const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key
|
||||||
const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key
|
const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key
|
||||||
const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key
|
const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key
|
||||||
const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)
|
||||||
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)
|
||||||
|
|
||||||
const Event = {
|
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||||
SHOW : `show${EVENT_KEY}`,
|
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||||
SHOWN : `shown${EVENT_KEY}`,
|
const EVENT_CLICK = `click${EVENT_KEY}`
|
||||||
CLICK : `click${EVENT_KEY}`,
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,
|
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`
|
||||||
KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,
|
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`
|
||||||
KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_DISABLED = 'disabled'
|
||||||
DISABLED : 'disabled',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show',
|
const CLASS_NAME_DROPUP = 'dropup'
|
||||||
DROPUP : 'dropup',
|
const CLASS_NAME_DROPRIGHT = 'dropright'
|
||||||
DROPRIGHT : 'dropright',
|
const CLASS_NAME_DROPLEFT = 'dropleft'
|
||||||
DROPLEFT : 'dropleft',
|
const CLASS_NAME_MENURIGHT = 'dropdown-menu-right'
|
||||||
MENURIGHT : 'dropdown-menu-right',
|
const CLASS_NAME_POSITION_STATIC = 'position-static'
|
||||||
MENULEFT : 'dropdown-menu-left',
|
|
||||||
POSITION_STATIC : 'position-static'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]'
|
||||||
DATA_TOGGLE : '[data-toggle="dropdown"]',
|
const SELECTOR_FORM_CHILD = '.dropdown form'
|
||||||
FORM_CHILD : '.dropdown form',
|
const SELECTOR_MENU = '.dropdown-menu'
|
||||||
MENU : '.dropdown-menu',
|
const SELECTOR_NAVBAR_NAV = '.navbar-nav'
|
||||||
NAVBAR_NAV : '.navbar-nav',
|
const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
||||||
VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
|
|
||||||
}
|
|
||||||
|
|
||||||
const AttachmentMap = {
|
const PLACEMENT_TOP = 'top-start'
|
||||||
TOP : 'top-start',
|
const PLACEMENT_TOPEND = 'top-end'
|
||||||
TOPEND : 'top-end',
|
const PLACEMENT_BOTTOM = 'bottom-start'
|
||||||
BOTTOM : 'bottom-start',
|
const PLACEMENT_BOTTOMEND = 'bottom-end'
|
||||||
BOTTOMEND : 'bottom-end',
|
const PLACEMENT_RIGHT = 'right-start'
|
||||||
RIGHT : 'right-start',
|
const PLACEMENT_LEFT = 'left-start'
|
||||||
RIGHTEND : 'right-end',
|
|
||||||
LEFT : 'left-start',
|
|
||||||
LEFTEND : 'left-end'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
offset : 0,
|
offset: 0,
|
||||||
flip : true,
|
flip: true,
|
||||||
boundary : 'scrollParent',
|
boundary: 'scrollParent',
|
||||||
reference : 'toggle',
|
reference: 'toggle',
|
||||||
display : 'dynamic'
|
display: 'dynamic',
|
||||||
|
popperConfig: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
offset : '(number|string|function)',
|
offset: '(number|string|function)',
|
||||||
flip : 'boolean',
|
flip: 'boolean',
|
||||||
boundary : '(string|element)',
|
boundary: '(string|element)',
|
||||||
reference : '(string|element)',
|
reference: '(string|element)',
|
||||||
display : 'string'
|
display: 'string',
|
||||||
|
popperConfig: '(null|object)'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -94,10 +85,10 @@ const DefaultType = {
|
||||||
|
|
||||||
class Dropdown {
|
class Dropdown {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._element = element
|
this._element = element
|
||||||
this._popper = null
|
this._popper = null
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._menu = this._getMenuElement()
|
this._menu = this._getMenuElement()
|
||||||
this._inNavbar = this._detectNavbar()
|
this._inNavbar = this._detectNavbar()
|
||||||
|
|
||||||
this._addEventListeners()
|
this._addEventListeners()
|
||||||
|
|
@ -120,12 +111,11 @@ class Dropdown {
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const parent = Dropdown._getParentFromElement(this._element)
|
const isActive = $(this._menu).hasClass(CLASS_NAME_SHOW)
|
||||||
const isActive = $(this._menu).hasClass(ClassName.SHOW)
|
|
||||||
|
|
||||||
Dropdown._clearMenus()
|
Dropdown._clearMenus()
|
||||||
|
|
||||||
|
|
@ -133,10 +123,19 @@ class Dropdown {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.show(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
show(usePopper = false) {
|
||||||
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const relatedTarget = {
|
const relatedTarget = {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
}
|
}
|
||||||
const showEvent = $.Event(Event.SHOW, relatedTarget)
|
const showEvent = $.Event(EVENT_SHOW, relatedTarget)
|
||||||
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
$(parent).trigger(showEvent)
|
$(parent).trigger(showEvent)
|
||||||
|
|
||||||
|
|
@ -144,14 +143,14 @@ class Dropdown {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable totally Popper.js for Dropdown in Navbar
|
// Totally disable Popper for Dropdowns in Navbar
|
||||||
if (!this._inNavbar) {
|
if (!this._inNavbar && usePopper) {
|
||||||
/**
|
/**
|
||||||
* Check for Popper dependency
|
* Check for Popper dependency
|
||||||
* Popper - https://popper.js.org
|
* Popper - https://popper.js.org
|
||||||
*/
|
*/
|
||||||
if (typeof Popper === 'undefined') {
|
if (typeof Popper === 'undefined') {
|
||||||
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)')
|
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)')
|
||||||
}
|
}
|
||||||
|
|
||||||
let referenceElement = this._element
|
let referenceElement = this._element
|
||||||
|
|
@ -171,8 +170,9 @@ class Dropdown {
|
||||||
// to allow the menu to "escape" the scroll parent's boundaries
|
// to allow the menu to "escape" the scroll parent's boundaries
|
||||||
// https://github.com/twbs/bootstrap/issues/24251
|
// https://github.com/twbs/bootstrap/issues/24251
|
||||||
if (this._config.boundary !== 'scrollParent') {
|
if (this._config.boundary !== 'scrollParent') {
|
||||||
$(parent).addClass(ClassName.POSITION_STATIC)
|
$(parent).addClass(CLASS_NAME_POSITION_STATIC)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())
|
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,51 +181,28 @@ class Dropdown {
|
||||||
// only needed because of broken event delegation on iOS
|
// only needed because of broken event delegation on iOS
|
||||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||||
if ('ontouchstart' in document.documentElement &&
|
if ('ontouchstart' in document.documentElement &&
|
||||||
$(parent).closest(Selector.NAVBAR_NAV).length === 0) {
|
$(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
|
||||||
$(document.body).children().on('mouseover', null, $.noop)
|
$(document.body).children().on('mouseover', null, $.noop)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.focus()
|
this._element.focus()
|
||||||
this._element.setAttribute('aria-expanded', true)
|
this._element.setAttribute('aria-expanded', true)
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW)
|
$(this._menu).toggleClass(CLASS_NAME_SHOW)
|
||||||
$(parent)
|
$(parent)
|
||||||
.toggleClass(ClassName.SHOW)
|
.toggleClass(CLASS_NAME_SHOW)
|
||||||
.trigger($.Event(Event.SHOWN, relatedTarget))
|
.trigger($.Event(EVENT_SHOWN, relatedTarget))
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const relatedTarget = {
|
|
||||||
relatedTarget: this._element
|
|
||||||
}
|
|
||||||
const showEvent = $.Event(Event.SHOW, relatedTarget)
|
|
||||||
const parent = Dropdown._getParentFromElement(this._element)
|
|
||||||
|
|
||||||
$(parent).trigger(showEvent)
|
|
||||||
|
|
||||||
if (showEvent.isDefaultPrevented()) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW)
|
|
||||||
$(parent)
|
|
||||||
.toggleClass(ClassName.SHOW)
|
|
||||||
.trigger($.Event(Event.SHOWN, relatedTarget))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {
|
if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const relatedTarget = {
|
const relatedTarget = {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
}
|
}
|
||||||
const hideEvent = $.Event(Event.HIDE, relatedTarget)
|
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||||
const parent = Dropdown._getParentFromElement(this._element)
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
$(parent).trigger(hideEvent)
|
$(parent).trigger(hideEvent)
|
||||||
|
|
@ -234,10 +211,14 @@ class Dropdown {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._menu).toggleClass(ClassName.SHOW)
|
if (this._popper) {
|
||||||
|
this._popper.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this._menu).toggleClass(CLASS_NAME_SHOW)
|
||||||
$(parent)
|
$(parent)
|
||||||
.toggleClass(ClassName.SHOW)
|
.toggleClass(CLASS_NAME_SHOW)
|
||||||
.trigger($.Event(Event.HIDDEN, relatedTarget))
|
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
|
|
@ -261,7 +242,7 @@ class Dropdown {
|
||||||
// Private
|
// Private
|
||||||
|
|
||||||
_addEventListeners() {
|
_addEventListeners() {
|
||||||
$(this._element).on(Event.CLICK, (event) => {
|
$(this._element).on(EVENT_CLICK, event => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.toggle()
|
this.toggle()
|
||||||
|
|
@ -289,29 +270,30 @@ class Dropdown {
|
||||||
const parent = Dropdown._getParentFromElement(this._element)
|
const parent = Dropdown._getParentFromElement(this._element)
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
this._menu = parent.querySelector(Selector.MENU)
|
this._menu = parent.querySelector(SELECTOR_MENU)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._menu
|
return this._menu
|
||||||
}
|
}
|
||||||
|
|
||||||
_getPlacement() {
|
_getPlacement() {
|
||||||
const $parentDropdown = $(this._element.parentNode)
|
const $parentDropdown = $(this._element.parentNode)
|
||||||
let placement = AttachmentMap.BOTTOM
|
let placement = PLACEMENT_BOTTOM
|
||||||
|
|
||||||
// Handle dropup
|
// Handle dropup
|
||||||
if ($parentDropdown.hasClass(ClassName.DROPUP)) {
|
if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
|
||||||
placement = AttachmentMap.TOP
|
placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ?
|
||||||
if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
PLACEMENT_TOPEND :
|
||||||
placement = AttachmentMap.TOPEND
|
PLACEMENT_TOP
|
||||||
}
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
|
||||||
} else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
|
placement = PLACEMENT_RIGHT
|
||||||
placement = AttachmentMap.RIGHT
|
} else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
|
||||||
} else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
|
placement = PLACEMENT_LEFT
|
||||||
placement = AttachmentMap.LEFT
|
} else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
|
||||||
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
|
placement = PLACEMENT_BOTTOMEND
|
||||||
placement = AttachmentMap.BOTTOMEND
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return placement
|
return placement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,10 +305,10 @@ class Dropdown {
|
||||||
const offset = {}
|
const offset = {}
|
||||||
|
|
||||||
if (typeof this._config.offset === 'function') {
|
if (typeof this._config.offset === 'function') {
|
||||||
offset.fn = (data) => {
|
offset.fn = data => {
|
||||||
data.offsets = {
|
data.offsets = {
|
||||||
...data.offsets,
|
...data.offsets,
|
||||||
...this._config.offset(data.offsets, this._element) || {}
|
...(this._config.offset(data.offsets, this._element) || {})
|
||||||
}
|
}
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
@ -352,14 +334,17 @@ class Dropdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable Popper.js if we have a static display
|
// Disable Popper if we have a static display
|
||||||
if (this._config.display === 'static') {
|
if (this._config.display === 'static') {
|
||||||
popperConfig.modifiers.applyStyle = {
|
popperConfig.modifiers.applyStyle = {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return popperConfig
|
return {
|
||||||
|
...popperConfig,
|
||||||
|
...this._config.popperConfig
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
@ -378,6 +363,7 @@ class Dropdown {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -389,7 +375,7 @@ class Dropdown {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
|
const toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE))
|
||||||
|
|
||||||
for (let i = 0, len = toggles.length; i < len; i++) {
|
for (let i = 0, len = toggles.length; i < len; i++) {
|
||||||
const parent = Dropdown._getParentFromElement(toggles[i])
|
const parent = Dropdown._getParentFromElement(toggles[i])
|
||||||
|
|
@ -407,7 +393,7 @@ class Dropdown {
|
||||||
}
|
}
|
||||||
|
|
||||||
const dropdownMenu = context._menu
|
const dropdownMenu = context._menu
|
||||||
if (!$(parent).hasClass(ClassName.SHOW)) {
|
if (!$(parent).hasClass(CLASS_NAME_SHOW)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -417,7 +403,7 @@ class Dropdown {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideEvent = $.Event(Event.HIDE, relatedTarget)
|
const hideEvent = $.Event(EVENT_HIDE, relatedTarget)
|
||||||
$(parent).trigger(hideEvent)
|
$(parent).trigger(hideEvent)
|
||||||
if (hideEvent.isDefaultPrevented()) {
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
continue
|
continue
|
||||||
|
|
@ -431,10 +417,14 @@ class Dropdown {
|
||||||
|
|
||||||
toggles[i].setAttribute('aria-expanded', 'false')
|
toggles[i].setAttribute('aria-expanded', 'false')
|
||||||
|
|
||||||
$(dropdownMenu).removeClass(ClassName.SHOW)
|
if (context._popper) {
|
||||||
|
context._popper.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(dropdownMenu).removeClass(CLASS_NAME_SHOW)
|
||||||
$(parent)
|
$(parent)
|
||||||
.removeClass(ClassName.SHOW)
|
.removeClass(CLASS_NAME_SHOW)
|
||||||
.trigger($.Event(Event.HIDDEN, relatedTarget))
|
.trigger($.Event(EVENT_HIDDEN, relatedTarget))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -458,34 +448,38 @@ class Dropdown {
|
||||||
// - If key is other than escape
|
// - If key is other than escape
|
||||||
// - If key is not up or down => not a dropdown command
|
// - If key is not up or down => not a dropdown command
|
||||||
// - If trigger inside the menu => not a dropdown command
|
// - If trigger inside the menu => not a dropdown command
|
||||||
if (/input|textarea/i.test(event.target.tagName)
|
if (/input|textarea/i.test(event.target.tagName) ?
|
||||||
? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&
|
event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&
|
||||||
(event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||
|
(event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||
|
||||||
$(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
$(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const parent = Dropdown._getParentFromElement(this)
|
||||||
|
const isActive = $(parent).hasClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
|
if (!isActive && event.which === ESCAPE_KEYCODE) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
|
||||||
if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {
|
if (!isActive || (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const parent = Dropdown._getParentFromElement(this)
|
|
||||||
const isActive = $(parent).hasClass(ClassName.SHOW)
|
|
||||||
|
|
||||||
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
|
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
const toggle = parent.querySelector(Selector.DATA_TOGGLE)
|
$(parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus')
|
||||||
$(toggle).trigger('focus')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).trigger('click')
|
$(this).trigger('click')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))
|
const items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS))
|
||||||
|
.filter(item => $(item).is(':visible'))
|
||||||
|
|
||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
return
|
return
|
||||||
|
|
@ -516,15 +510,15 @@ class Dropdown {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
|
.on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown._dataApiKeydownHandler)
|
||||||
.on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)
|
.on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler)
|
||||||
.on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)
|
.on(`${EVENT_CLICK_DATA_API} ${EVENT_KEYUP_DATA_API}`, Dropdown._clearMenus)
|
||||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
Dropdown._jQueryInterface.call($(this), 'toggle')
|
Dropdown._jQueryInterface.call($(this), 'toggle')
|
||||||
})
|
})
|
||||||
.on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {
|
.on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -541,5 +535,4 @@ $.fn[NAME].noConflict = () => {
|
||||||
return Dropdown._jQueryInterface
|
return Dropdown._jQueryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default Dropdown
|
export default Dropdown
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
import $ from 'jquery'
|
|
||||||
import Alert from './alert'
|
|
||||||
import Button from './button'
|
|
||||||
import Carousel from './carousel'
|
|
||||||
import Collapse from './collapse'
|
|
||||||
import Dropdown from './dropdown'
|
|
||||||
import Modal from './modal'
|
|
||||||
import Popover from './popover'
|
|
||||||
import Scrollspy from './scrollspy'
|
|
||||||
import Tab from './tab'
|
|
||||||
import Toast from './toast'
|
|
||||||
import Tooltip from './tooltip'
|
|
||||||
import Util from './util'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
* Bootstrap (v4.3.1): index.js
|
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
(() => {
|
|
||||||
if (typeof $ === 'undefined') {
|
|
||||||
throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
|
|
||||||
}
|
|
||||||
|
|
||||||
const version = $.fn.jquery.split(' ')[0].split('.')
|
|
||||||
const minMajor = 1
|
|
||||||
const ltMajor = 2
|
|
||||||
const minMinor = 9
|
|
||||||
const minPatch = 1
|
|
||||||
const maxMajor = 4
|
|
||||||
|
|
||||||
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
|
|
||||||
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
|
|
||||||
export {
|
|
||||||
Util,
|
|
||||||
Alert,
|
|
||||||
Button,
|
|
||||||
Carousel,
|
|
||||||
Collapse,
|
|
||||||
Dropdown,
|
|
||||||
Modal,
|
|
||||||
Popover,
|
|
||||||
Scrollspy,
|
|
||||||
Tab,
|
|
||||||
Toast,
|
|
||||||
Tooltip
|
|
||||||
}
|
|
||||||
275
js/src/modal.js
275
js/src/modal.js
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): modal.js
|
* Bootstrap (v4.5.3): modal.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,59 +14,55 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'modal'
|
const NAME = 'modal'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.modal'
|
const DATA_KEY = 'bs.modal'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
backdrop : true,
|
backdrop: true,
|
||||||
keyboard : true,
|
keyboard: true,
|
||||||
focus : true,
|
focus: true,
|
||||||
show : true
|
show: true
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
backdrop : '(boolean|string)',
|
backdrop: '(boolean|string)',
|
||||||
keyboard : 'boolean',
|
keyboard: 'boolean',
|
||||||
focus : 'boolean',
|
focus: 'boolean',
|
||||||
show : 'boolean'
|
show: 'boolean'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Event = {
|
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||||
SHOW : `show${EVENT_KEY}`,
|
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||||
SHOWN : `shown${EVENT_KEY}`,
|
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||||
FOCUSIN : `focusin${EVENT_KEY}`,
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`
|
||||||
RESIZE : `resize${EVENT_KEY}`,
|
const EVENT_RESIZE = `resize${EVENT_KEY}`
|
||||||
CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,
|
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
|
||||||
KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
|
||||||
MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY}`
|
||||||
MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'
|
||||||
SCROLLABLE : 'modal-dialog-scrollable',
|
const CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'
|
||||||
SCROLLBAR_MEASURER : 'modal-scrollbar-measure',
|
const CLASS_NAME_BACKDROP = 'modal-backdrop'
|
||||||
BACKDROP : 'modal-backdrop',
|
const CLASS_NAME_OPEN = 'modal-open'
|
||||||
OPEN : 'modal-open',
|
const CLASS_NAME_FADE = 'fade'
|
||||||
FADE : 'fade',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show'
|
const CLASS_NAME_STATIC = 'modal-static'
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DIALOG = '.modal-dialog'
|
||||||
DIALOG : '.modal-dialog',
|
const SELECTOR_MODAL_BODY = '.modal-body'
|
||||||
MODAL_BODY : '.modal-body',
|
const SELECTOR_DATA_TOGGLE = '[data-toggle="modal"]'
|
||||||
DATA_TOGGLE : '[data-toggle="modal"]',
|
const SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]'
|
||||||
DATA_DISMISS : '[data-dismiss="modal"]',
|
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'
|
||||||
FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
|
const SELECTOR_STICKY_CONTENT = '.sticky-top'
|
||||||
STICKY_CONTENT : '.sticky-top'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -76,15 +72,15 @@ const Selector = {
|
||||||
|
|
||||||
class Modal {
|
class Modal {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._element = element
|
this._element = element
|
||||||
this._dialog = element.querySelector(Selector.DIALOG)
|
this._dialog = element.querySelector(SELECTOR_DIALOG)
|
||||||
this._backdrop = null
|
this._backdrop = null
|
||||||
this._isShown = false
|
this._isShown = false
|
||||||
this._isBodyOverflowing = false
|
this._isBodyOverflowing = false
|
||||||
this._ignoreBackdropClick = false
|
this._ignoreBackdropClick = false
|
||||||
this._isTransitioning = false
|
this._isTransitioning = false
|
||||||
this._scrollbarWidth = 0
|
this._scrollbarWidth = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
|
@ -108,11 +104,11 @@ class Modal {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
this._isTransitioning = true
|
this._isTransitioning = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const showEvent = $.Event(Event.SHOW, {
|
const showEvent = $.Event(EVENT_SHOW, {
|
||||||
relatedTarget
|
relatedTarget
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -133,13 +129,13 @@ class Modal {
|
||||||
this._setResizeEvent()
|
this._setResizeEvent()
|
||||||
|
|
||||||
$(this._element).on(
|
$(this._element).on(
|
||||||
Event.CLICK_DISMISS,
|
EVENT_CLICK_DISMISS,
|
||||||
Selector.DATA_DISMISS,
|
SELECTOR_DATA_DISMISS,
|
||||||
(event) => this.hide(event)
|
event => this.hide(event)
|
||||||
)
|
)
|
||||||
|
|
||||||
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {
|
$(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, () => {
|
||||||
$(this._element).one(Event.MOUSEUP_DISMISS, (event) => {
|
$(this._element).one(EVENT_MOUSEUP_DISMISS, event => {
|
||||||
if ($(event.target).is(this._element)) {
|
if ($(event.target).is(this._element)) {
|
||||||
this._ignoreBackdropClick = true
|
this._ignoreBackdropClick = true
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +154,7 @@ class Modal {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideEvent = $.Event(Event.HIDE)
|
const hideEvent = $.Event(EVENT_HIDE)
|
||||||
|
|
||||||
$(this._element).trigger(hideEvent)
|
$(this._element).trigger(hideEvent)
|
||||||
|
|
||||||
|
|
@ -167,7 +163,7 @@ class Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isShown = false
|
this._isShown = false
|
||||||
const transition = $(this._element).hasClass(ClassName.FADE)
|
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
this._isTransitioning = true
|
this._isTransitioning = true
|
||||||
|
|
@ -176,19 +172,18 @@ class Modal {
|
||||||
this._setEscapeEvent()
|
this._setEscapeEvent()
|
||||||
this._setResizeEvent()
|
this._setResizeEvent()
|
||||||
|
|
||||||
$(document).off(Event.FOCUSIN)
|
$(document).off(EVENT_FOCUSIN)
|
||||||
|
|
||||||
$(this._element).removeClass(ClassName.SHOW)
|
$(this._element).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
$(this._element).off(Event.CLICK_DISMISS)
|
|
||||||
$(this._dialog).off(Event.MOUSEDOWN_DISMISS)
|
|
||||||
|
|
||||||
|
$(this._element).off(EVENT_CLICK_DISMISS)
|
||||||
|
$(this._dialog).off(EVENT_MOUSEDOWN_DISMISS)
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
$(this._element)
|
$(this._element)
|
||||||
.one(Util.TRANSITION_END, (event) => this._hideModal(event))
|
.one(Util.TRANSITION_END, event => this._hideModal(event))
|
||||||
.emulateTransitionEnd(transitionDuration)
|
.emulateTransitionEnd(transitionDuration)
|
||||||
} else {
|
} else {
|
||||||
this._hideModal()
|
this._hideModal()
|
||||||
|
|
@ -197,26 +192,26 @@ class Modal {
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
[window, this._element, this._dialog]
|
[window, this._element, this._dialog]
|
||||||
.forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))
|
.forEach(htmlElement => $(htmlElement).off(EVENT_KEY))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
|
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||||
* Do not move `document` in `htmlElements` array
|
* Do not move `document` in `htmlElements` array
|
||||||
* It will remove `Event.CLICK_DATA_API` event that should remain
|
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||||
*/
|
*/
|
||||||
$(document).off(Event.FOCUSIN)
|
$(document).off(EVENT_FOCUSIN)
|
||||||
|
|
||||||
$.removeData(this._element, DATA_KEY)
|
$.removeData(this._element, DATA_KEY)
|
||||||
|
|
||||||
this._config = null
|
this._config = null
|
||||||
this._element = null
|
this._element = null
|
||||||
this._dialog = null
|
this._dialog = null
|
||||||
this._backdrop = null
|
this._backdrop = null
|
||||||
this._isShown = null
|
this._isShown = null
|
||||||
this._isBodyOverflowing = null
|
this._isBodyOverflowing = null
|
||||||
this._ignoreBackdropClick = null
|
this._ignoreBackdropClick = null
|
||||||
this._isTransitioning = null
|
this._isTransitioning = null
|
||||||
this._scrollbarWidth = null
|
this._scrollbarWidth = null
|
||||||
}
|
}
|
||||||
|
|
||||||
handleUpdate() {
|
handleUpdate() {
|
||||||
|
|
@ -234,8 +229,41 @@ class Modal {
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_triggerBackdropTransition() {
|
||||||
|
const hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED)
|
||||||
|
|
||||||
|
$(this._element).trigger(hideEventPrevented)
|
||||||
|
if (hideEventPrevented.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||||
|
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
this._element.style.overflowY = 'hidden'
|
||||||
|
}
|
||||||
|
|
||||||
|
this._element.classList.add(CLASS_NAME_STATIC)
|
||||||
|
|
||||||
|
const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||||
|
$(this._element).off(Util.TRANSITION_END)
|
||||||
|
|
||||||
|
$(this._element).one(Util.TRANSITION_END, () => {
|
||||||
|
this._element.classList.remove(CLASS_NAME_STATIC)
|
||||||
|
if (!isModalOverflowing) {
|
||||||
|
$(this._element).one(Util.TRANSITION_END, () => {
|
||||||
|
this._element.style.overflowY = ''
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(this._element, modalTransitionDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(modalTransitionDuration)
|
||||||
|
this._element.focus()
|
||||||
|
}
|
||||||
|
|
||||||
_showElement(relatedTarget) {
|
_showElement(relatedTarget) {
|
||||||
const transition = $(this._element).hasClass(ClassName.FADE)
|
const transition = $(this._element).hasClass(CLASS_NAME_FADE)
|
||||||
|
const modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null
|
||||||
|
|
||||||
if (!this._element.parentNode ||
|
if (!this._element.parentNode ||
|
||||||
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
||||||
|
|
@ -246,9 +274,10 @@ class Modal {
|
||||||
this._element.style.display = 'block'
|
this._element.style.display = 'block'
|
||||||
this._element.removeAttribute('aria-hidden')
|
this._element.removeAttribute('aria-hidden')
|
||||||
this._element.setAttribute('aria-modal', true)
|
this._element.setAttribute('aria-modal', true)
|
||||||
|
this._element.setAttribute('role', 'dialog')
|
||||||
|
|
||||||
if ($(this._dialog).hasClass(ClassName.SCROLLABLE)) {
|
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
|
||||||
this._dialog.querySelector(Selector.MODAL_BODY).scrollTop = 0
|
modalBody.scrollTop = 0
|
||||||
} else {
|
} else {
|
||||||
this._element.scrollTop = 0
|
this._element.scrollTop = 0
|
||||||
}
|
}
|
||||||
|
|
@ -257,13 +286,13 @@ class Modal {
|
||||||
Util.reflow(this._element)
|
Util.reflow(this._element)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).addClass(ClassName.SHOW)
|
$(this._element).addClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
if (this._config.focus) {
|
if (this._config.focus) {
|
||||||
this._enforceFocus()
|
this._enforceFocus()
|
||||||
}
|
}
|
||||||
|
|
||||||
const shownEvent = $.Event(Event.SHOWN, {
|
const shownEvent = $.Event(EVENT_SHOWN, {
|
||||||
relatedTarget
|
relatedTarget
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -271,12 +300,13 @@ class Modal {
|
||||||
if (this._config.focus) {
|
if (this._config.focus) {
|
||||||
this._element.focus()
|
this._element.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isTransitioning = false
|
this._isTransitioning = false
|
||||||
$(this._element).trigger(shownEvent)
|
$(this._element).trigger(shownEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transition) {
|
if (transition) {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)
|
||||||
|
|
||||||
$(this._dialog)
|
$(this._dialog)
|
||||||
.one(Util.TRANSITION_END, transitionComplete)
|
.one(Util.TRANSITION_END, transitionComplete)
|
||||||
|
|
@ -288,8 +318,8 @@ class Modal {
|
||||||
|
|
||||||
_enforceFocus() {
|
_enforceFocus() {
|
||||||
$(document)
|
$(document)
|
||||||
.off(Event.FOCUSIN) // Guard against infinite focus loop
|
.off(EVENT_FOCUSIN) // Guard against infinite focus loop
|
||||||
.on(Event.FOCUSIN, (event) => {
|
.on(EVENT_FOCUSIN, event => {
|
||||||
if (document !== event.target &&
|
if (document !== event.target &&
|
||||||
this._element !== event.target &&
|
this._element !== event.target &&
|
||||||
$(this._element).has(event.target).length === 0) {
|
$(this._element).has(event.target).length === 0) {
|
||||||
|
|
@ -299,23 +329,25 @@ class Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
_setEscapeEvent() {
|
_setEscapeEvent() {
|
||||||
if (this._isShown && this._config.keyboard) {
|
if (this._isShown) {
|
||||||
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
|
$(this._element).on(EVENT_KEYDOWN_DISMISS, event => {
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
this.hide()
|
this.hide()
|
||||||
|
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||||
|
this._triggerBackdropTransition()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (!this._isShown) {
|
} else if (!this._isShown) {
|
||||||
$(this._element).off(Event.KEYDOWN_DISMISS)
|
$(this._element).off(EVENT_KEYDOWN_DISMISS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_setResizeEvent() {
|
_setResizeEvent() {
|
||||||
if (this._isShown) {
|
if (this._isShown) {
|
||||||
$(window).on(Event.RESIZE, (event) => this.handleUpdate(event))
|
$(window).on(EVENT_RESIZE, event => this.handleUpdate(event))
|
||||||
} else {
|
} else {
|
||||||
$(window).off(Event.RESIZE)
|
$(window).off(EVENT_RESIZE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,12 +355,13 @@ class Modal {
|
||||||
this._element.style.display = 'none'
|
this._element.style.display = 'none'
|
||||||
this._element.setAttribute('aria-hidden', true)
|
this._element.setAttribute('aria-hidden', true)
|
||||||
this._element.removeAttribute('aria-modal')
|
this._element.removeAttribute('aria-modal')
|
||||||
|
this._element.removeAttribute('role')
|
||||||
this._isTransitioning = false
|
this._isTransitioning = false
|
||||||
this._showBackdrop(() => {
|
this._showBackdrop(() => {
|
||||||
$(document.body).removeClass(ClassName.OPEN)
|
$(document.body).removeClass(CLASS_NAME_OPEN)
|
||||||
this._resetAdjustments()
|
this._resetAdjustments()
|
||||||
this._resetScrollbar()
|
this._resetScrollbar()
|
||||||
$(this._element).trigger(Event.HIDDEN)
|
$(this._element).trigger(EVENT_HIDDEN)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -340,12 +373,12 @@ class Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
_showBackdrop(callback) {
|
_showBackdrop(callback) {
|
||||||
const animate = $(this._element).hasClass(ClassName.FADE)
|
const animate = $(this._element).hasClass(CLASS_NAME_FADE) ?
|
||||||
? ClassName.FADE : ''
|
CLASS_NAME_FADE : ''
|
||||||
|
|
||||||
if (this._isShown && this._config.backdrop) {
|
if (this._isShown && this._config.backdrop) {
|
||||||
this._backdrop = document.createElement('div')
|
this._backdrop = document.createElement('div')
|
||||||
this._backdrop.className = ClassName.BACKDROP
|
this._backdrop.className = CLASS_NAME_BACKDROP
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
this._backdrop.classList.add(animate)
|
this._backdrop.classList.add(animate)
|
||||||
|
|
@ -353,16 +386,18 @@ class Modal {
|
||||||
|
|
||||||
$(this._backdrop).appendTo(document.body)
|
$(this._backdrop).appendTo(document.body)
|
||||||
|
|
||||||
$(this._element).on(Event.CLICK_DISMISS, (event) => {
|
$(this._element).on(EVENT_CLICK_DISMISS, event => {
|
||||||
if (this._ignoreBackdropClick) {
|
if (this._ignoreBackdropClick) {
|
||||||
this._ignoreBackdropClick = false
|
this._ignoreBackdropClick = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.target !== event.currentTarget) {
|
if (event.target !== event.currentTarget) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._config.backdrop === 'static') {
|
if (this._config.backdrop === 'static') {
|
||||||
this._element.focus()
|
this._triggerBackdropTransition()
|
||||||
} else {
|
} else {
|
||||||
this.hide()
|
this.hide()
|
||||||
}
|
}
|
||||||
|
|
@ -372,7 +407,7 @@ class Modal {
|
||||||
Util.reflow(this._backdrop)
|
Util.reflow(this._backdrop)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._backdrop).addClass(ClassName.SHOW)
|
$(this._backdrop).addClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
return
|
return
|
||||||
|
|
@ -389,7 +424,7 @@ class Modal {
|
||||||
.one(Util.TRANSITION_END, callback)
|
.one(Util.TRANSITION_END, callback)
|
||||||
.emulateTransitionEnd(backdropTransitionDuration)
|
.emulateTransitionEnd(backdropTransitionDuration)
|
||||||
} else if (!this._isShown && this._backdrop) {
|
} else if (!this._isShown && this._backdrop) {
|
||||||
$(this._backdrop).removeClass(ClassName.SHOW)
|
$(this._backdrop).removeClass(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
const callbackRemove = () => {
|
const callbackRemove = () => {
|
||||||
this._removeBackdrop()
|
this._removeBackdrop()
|
||||||
|
|
@ -398,7 +433,7 @@ class Modal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this._element).hasClass(ClassName.FADE)) {
|
if ($(this._element).hasClass(CLASS_NAME_FADE)) {
|
||||||
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
||||||
|
|
||||||
$(this._backdrop)
|
$(this._backdrop)
|
||||||
|
|
@ -418,8 +453,7 @@ class Modal {
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
_adjustDialog() {
|
_adjustDialog() {
|
||||||
const isModalOverflowing =
|
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
|
||||||
this._element.scrollHeight > document.documentElement.clientHeight
|
|
||||||
|
|
||||||
if (!this._isBodyOverflowing && isModalOverflowing) {
|
if (!this._isBodyOverflowing && isModalOverflowing) {
|
||||||
this._element.style.paddingLeft = `${this._scrollbarWidth}px`
|
this._element.style.paddingLeft = `${this._scrollbarWidth}px`
|
||||||
|
|
@ -437,7 +471,7 @@ class Modal {
|
||||||
|
|
||||||
_checkScrollbar() {
|
_checkScrollbar() {
|
||||||
const rect = document.body.getBoundingClientRect()
|
const rect = document.body.getBoundingClientRect()
|
||||||
this._isBodyOverflowing = rect.left + rect.right < window.innerWidth
|
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth
|
||||||
this._scrollbarWidth = this._getScrollbarWidth()
|
this._scrollbarWidth = this._getScrollbarWidth()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -445,8 +479,8 @@ class Modal {
|
||||||
if (this._isBodyOverflowing) {
|
if (this._isBodyOverflowing) {
|
||||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||||
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
|
||||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||||
const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))
|
const stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT))
|
||||||
|
|
||||||
// Adjust fixed content padding
|
// Adjust fixed content padding
|
||||||
$(fixedContent).each((index, element) => {
|
$(fixedContent).each((index, element) => {
|
||||||
|
|
@ -474,12 +508,12 @@ class Modal {
|
||||||
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
|
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document.body).addClass(ClassName.OPEN)
|
$(document.body).addClass(CLASS_NAME_OPEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
_resetScrollbar() {
|
_resetScrollbar() {
|
||||||
// Restore fixed content padding
|
// Restore fixed content padding
|
||||||
const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))
|
const fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT))
|
||||||
$(fixedContent).each((index, element) => {
|
$(fixedContent).each((index, element) => {
|
||||||
const padding = $(element).data('padding-right')
|
const padding = $(element).data('padding-right')
|
||||||
$(element).removeData('padding-right')
|
$(element).removeData('padding-right')
|
||||||
|
|
@ -487,7 +521,7 @@ class Modal {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Restore sticky content
|
// Restore sticky content
|
||||||
const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))
|
const elements = [].slice.call(document.querySelectorAll(`${SELECTOR_STICKY_CONTENT}`))
|
||||||
$(elements).each((index, element) => {
|
$(elements).each((index, element) => {
|
||||||
const margin = $(element).data('margin-right')
|
const margin = $(element).data('margin-right')
|
||||||
if (typeof margin !== 'undefined') {
|
if (typeof margin !== 'undefined') {
|
||||||
|
|
@ -503,7 +537,7 @@ class Modal {
|
||||||
|
|
||||||
_getScrollbarWidth() { // thx d.walsh
|
_getScrollbarWidth() { // thx d.walsh
|
||||||
const scrollDiv = document.createElement('div')
|
const scrollDiv = document.createElement('div')
|
||||||
scrollDiv.className = ClassName.SCROLLBAR_MEASURER
|
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER
|
||||||
document.body.appendChild(scrollDiv)
|
document.body.appendChild(scrollDiv)
|
||||||
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
|
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth
|
||||||
document.body.removeChild(scrollDiv)
|
document.body.removeChild(scrollDiv)
|
||||||
|
|
@ -518,7 +552,7 @@ class Modal {
|
||||||
const _config = {
|
const _config = {
|
||||||
...Default,
|
...Default,
|
||||||
...$(this).data(),
|
...$(this).data(),
|
||||||
...typeof config === 'object' && config ? config : {}
|
...(typeof config === 'object' && config ? config : {})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
|
@ -530,6 +564,7 @@ class Modal {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config](relatedTarget)
|
data[config](relatedTarget)
|
||||||
} else if (_config.show) {
|
} else if (_config.show) {
|
||||||
data.show(relatedTarget)
|
data.show(relatedTarget)
|
||||||
|
|
@ -544,7 +579,7 @@ class Modal {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
$(document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
let target
|
let target
|
||||||
const selector = Util.getSelectorFromElement(this)
|
const selector = Util.getSelectorFromElement(this)
|
||||||
|
|
||||||
|
|
@ -552,8 +587,8 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
target = document.querySelector(selector)
|
target = document.querySelector(selector)
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = $(target).data(DATA_KEY)
|
const config = $(target).data(DATA_KEY) ?
|
||||||
? 'toggle' : {
|
'toggle' : {
|
||||||
...$(target).data(),
|
...$(target).data(),
|
||||||
...$(this).data()
|
...$(this).data()
|
||||||
}
|
}
|
||||||
|
|
@ -562,13 +597,13 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
const $target = $(target).one(Event.SHOW, (showEvent) => {
|
const $target = $(target).one(EVENT_SHOW, showEvent => {
|
||||||
if (showEvent.isDefaultPrevented()) {
|
if (showEvent.isDefaultPrevented()) {
|
||||||
// Only register focus restorer if modal will actually get shown
|
// Only register focus restorer if modal will actually get shown
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$target.one(Event.HIDDEN, () => {
|
$target.one(EVENT_HIDDEN, () => {
|
||||||
if ($(this).is(':visible')) {
|
if ($(this).is(':visible')) {
|
||||||
this.focus()
|
this.focus()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): popover.js
|
* Bootstrap (v4.5.3): popover.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,20 +14,20 @@ import Tooltip from './tooltip'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'popover'
|
const NAME = 'popover'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.popover'
|
const DATA_KEY = 'bs.popover'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
const CLASS_PREFIX = 'bs-popover'
|
const CLASS_PREFIX = 'bs-popover'
|
||||||
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
|
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
...Tooltip.Default,
|
...Tooltip.Default,
|
||||||
placement : 'right',
|
placement: 'right',
|
||||||
trigger : 'click',
|
trigger: 'click',
|
||||||
content : '',
|
content: '',
|
||||||
template : '<div class="popover" role="tooltip">' +
|
template: '<div class="popover" role="tooltip">' +
|
||||||
'<div class="arrow"></div>' +
|
'<div class="arrow"></div>' +
|
||||||
'<h3 class="popover-header"></h3>' +
|
'<h3 class="popover-header"></h3>' +
|
||||||
'<div class="popover-body"></div></div>'
|
'<div class="popover-body"></div></div>'
|
||||||
|
|
@ -35,30 +35,26 @@ const Default = {
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
...Tooltip.DefaultType,
|
...Tooltip.DefaultType,
|
||||||
content : '(string|element|function)'
|
content: '(string|element|function)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_FADE = 'fade'
|
||||||
FADE : 'fade',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_TITLE = '.popover-header'
|
||||||
TITLE : '.popover-header',
|
const SELECTOR_CONTENT = '.popover-body'
|
||||||
CONTENT : '.popover-body'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Event = {
|
const Event = {
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
HIDE: `hide${EVENT_KEY}`,
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
HIDDEN: `hidden${EVENT_KEY}`,
|
||||||
SHOW : `show${EVENT_KEY}`,
|
SHOW: `show${EVENT_KEY}`,
|
||||||
SHOWN : `shown${EVENT_KEY}`,
|
SHOWN: `shown${EVENT_KEY}`,
|
||||||
INSERTED : `inserted${EVENT_KEY}`,
|
INSERTED: `inserted${EVENT_KEY}`,
|
||||||
CLICK : `click${EVENT_KEY}`,
|
CLICK: `click${EVENT_KEY}`,
|
||||||
FOCUSIN : `focusin${EVENT_KEY}`,
|
FOCUSIN: `focusin${EVENT_KEY}`,
|
||||||
FOCUSOUT : `focusout${EVENT_KEY}`,
|
FOCUSOUT: `focusout${EVENT_KEY}`,
|
||||||
MOUSEENTER : `mouseenter${EVENT_KEY}`,
|
MOUSEENTER: `mouseenter${EVENT_KEY}`,
|
||||||
MOUSELEAVE : `mouseleave${EVENT_KEY}`
|
MOUSELEAVE: `mouseleave${EVENT_KEY}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -117,14 +113,15 @@ class Popover extends Tooltip {
|
||||||
const $tip = $(this.getTipElement())
|
const $tip = $(this.getTipElement())
|
||||||
|
|
||||||
// We use append for html objects to maintain js events
|
// We use append for html objects to maintain js events
|
||||||
this.setElementContent($tip.find(Selector.TITLE), this.getTitle())
|
this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle())
|
||||||
let content = this._getContent()
|
let content = this._getContent()
|
||||||
if (typeof content === 'function') {
|
if (typeof content === 'function') {
|
||||||
content = content.call(this.element)
|
content = content.call(this.element)
|
||||||
}
|
}
|
||||||
this.setElementContent($tip.find(Selector.CONTENT), content)
|
|
||||||
|
|
||||||
$tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
|
this.setElementContent($tip.find(SELECTOR_CONTENT), content)
|
||||||
|
|
||||||
|
$tip.removeClass(`${CLASS_NAME_FADE} ${CLASS_NAME_SHOW}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
|
@ -162,6 +159,7 @@ class Popover extends Tooltip {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): scrollspy.js
|
* Bootstrap (v4.5.3): scrollspy.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,53 +14,43 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'scrollspy'
|
const NAME = 'scrollspy'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.scrollspy'
|
const DATA_KEY = 'bs.scrollspy'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
offset : 10,
|
offset: 10,
|
||||||
method : 'auto',
|
method: 'auto',
|
||||||
target : ''
|
target: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
offset : 'number',
|
offset: 'number',
|
||||||
method : 'string',
|
method: 'string',
|
||||||
target : '(string|element)'
|
target: '(string|element)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Event = {
|
const EVENT_ACTIVATE = `activate${EVENT_KEY}`
|
||||||
ACTIVATE : `activate${EVENT_KEY}`,
|
const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
||||||
SCROLL : `scroll${EVENT_KEY}`,
|
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
||||||
LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
|
||||||
DROPDOWN_ITEM : 'dropdown-item',
|
const CLASS_NAME_ACTIVE = 'active'
|
||||||
DROPDOWN_MENU : 'dropdown-menu',
|
|
||||||
ACTIVE : 'active'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DATA_SPY = '[data-spy="scroll"]'
|
||||||
DATA_SPY : '[data-spy="scroll"]',
|
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
|
||||||
ACTIVE : '.active',
|
const SELECTOR_NAV_LINKS = '.nav-link'
|
||||||
NAV_LIST_GROUP : '.nav, .list-group',
|
const SELECTOR_NAV_ITEMS = '.nav-item'
|
||||||
NAV_LINKS : '.nav-link',
|
const SELECTOR_LIST_ITEMS = '.list-group-item'
|
||||||
NAV_ITEMS : '.nav-item',
|
const SELECTOR_DROPDOWN = '.dropdown'
|
||||||
LIST_ITEMS : '.list-group-item',
|
const SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'
|
||||||
DROPDOWN : '.dropdown',
|
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
|
||||||
DROPDOWN_ITEMS : '.dropdown-item',
|
|
||||||
DROPDOWN_TOGGLE : '.dropdown-toggle'
|
|
||||||
}
|
|
||||||
|
|
||||||
const OffsetMethod = {
|
const METHOD_OFFSET = 'offset'
|
||||||
OFFSET : 'offset',
|
const METHOD_POSITION = 'position'
|
||||||
POSITION : 'position'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -70,18 +60,18 @@ const OffsetMethod = {
|
||||||
|
|
||||||
class ScrollSpy {
|
class ScrollSpy {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._element = element
|
this._element = element
|
||||||
this._scrollElement = element.tagName === 'BODY' ? window : element
|
this._scrollElement = element.tagName === 'BODY' ? window : element
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +
|
this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS},` +
|
||||||
`${this._config.target} ${Selector.LIST_ITEMS},` +
|
`${this._config.target} ${SELECTOR_LIST_ITEMS},` +
|
||||||
`${this._config.target} ${Selector.DROPDOWN_ITEMS}`
|
`${this._config.target} ${SELECTOR_DROPDOWN_ITEMS}`
|
||||||
this._offsets = []
|
this._offsets = []
|
||||||
this._targets = []
|
this._targets = []
|
||||||
this._activeTarget = null
|
this._activeTarget = null
|
||||||
this._scrollHeight = 0
|
this._scrollHeight = 0
|
||||||
|
|
||||||
$(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))
|
$(this._scrollElement).on(EVENT_SCROLL, event => this._process(event))
|
||||||
|
|
||||||
this.refresh()
|
this.refresh()
|
||||||
this._process()
|
this._process()
|
||||||
|
|
@ -100,14 +90,14 @@ class ScrollSpy {
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
const autoMethod = this._scrollElement === this._scrollElement.window
|
const autoMethod = this._scrollElement === this._scrollElement.window ?
|
||||||
? OffsetMethod.OFFSET : OffsetMethod.POSITION
|
METHOD_OFFSET : METHOD_POSITION
|
||||||
|
|
||||||
const offsetMethod = this._config.method === 'auto'
|
const offsetMethod = this._config.method === 'auto' ?
|
||||||
? autoMethod : this._config.method
|
autoMethod : this._config.method
|
||||||
|
|
||||||
const offsetBase = offsetMethod === OffsetMethod.POSITION
|
const offsetBase = offsetMethod === METHOD_POSITION ?
|
||||||
? this._getScrollTop() : 0
|
this._getScrollTop() : 0
|
||||||
|
|
||||||
this._offsets = []
|
this._offsets = []
|
||||||
this._targets = []
|
this._targets = []
|
||||||
|
|
@ -117,7 +107,7 @@ class ScrollSpy {
|
||||||
const targets = [].slice.call(document.querySelectorAll(this._selector))
|
const targets = [].slice.call(document.querySelectorAll(this._selector))
|
||||||
|
|
||||||
targets
|
targets
|
||||||
.map((element) => {
|
.map(element => {
|
||||||
let target
|
let target
|
||||||
const targetSelector = Util.getSelectorFromElement(element)
|
const targetSelector = Util.getSelectorFromElement(element)
|
||||||
|
|
||||||
|
|
@ -135,11 +125,12 @@ class ScrollSpy {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
})
|
})
|
||||||
.filter((item) => item)
|
.filter(item => item)
|
||||||
.sort((a, b) => a[0] - b[0])
|
.sort((a, b) => a[0] - b[0])
|
||||||
.forEach((item) => {
|
.forEach(item => {
|
||||||
this._offsets.push(item[0])
|
this._offsets.push(item[0])
|
||||||
this._targets.push(item[1])
|
this._targets.push(item[1])
|
||||||
})
|
})
|
||||||
|
|
@ -149,14 +140,14 @@ class ScrollSpy {
|
||||||
$.removeData(this._element, DATA_KEY)
|
$.removeData(this._element, DATA_KEY)
|
||||||
$(this._scrollElement).off(EVENT_KEY)
|
$(this._scrollElement).off(EVENT_KEY)
|
||||||
|
|
||||||
this._element = null
|
this._element = null
|
||||||
this._scrollElement = null
|
this._scrollElement = null
|
||||||
this._config = null
|
this._config = null
|
||||||
this._selector = null
|
this._selector = null
|
||||||
this._offsets = null
|
this._offsets = null
|
||||||
this._targets = null
|
this._targets = null
|
||||||
this._activeTarget = null
|
this._activeTarget = null
|
||||||
this._scrollHeight = null
|
this._scrollHeight = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
|
@ -164,15 +155,16 @@ class ScrollSpy {
|
||||||
_getConfig(config) {
|
_getConfig(config) {
|
||||||
config = {
|
config = {
|
||||||
...Default,
|
...Default,
|
||||||
...typeof config === 'object' && config ? config : {}
|
...(typeof config === 'object' && config ? config : {})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config.target !== 'string') {
|
if (typeof config.target !== 'string' && Util.isElement(config.target)) {
|
||||||
let id = $(config.target).attr('id')
|
let id = $(config.target).attr('id')
|
||||||
if (!id) {
|
if (!id) {
|
||||||
id = Util.getUID(NAME)
|
id = Util.getUID(NAME)
|
||||||
$(config.target).attr('id', id)
|
$(config.target).attr('id', id)
|
||||||
}
|
}
|
||||||
|
|
||||||
config.target = `#${id}`
|
config.target = `#${id}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,8 +174,8 @@ class ScrollSpy {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getScrollTop() {
|
_getScrollTop() {
|
||||||
return this._scrollElement === window
|
return this._scrollElement === window ?
|
||||||
? this._scrollElement.pageYOffset : this._scrollElement.scrollTop
|
this._scrollElement.pageYOffset : this._scrollElement.scrollTop
|
||||||
}
|
}
|
||||||
|
|
||||||
_getScrollHeight() {
|
_getScrollHeight() {
|
||||||
|
|
@ -194,16 +186,14 @@ class ScrollSpy {
|
||||||
}
|
}
|
||||||
|
|
||||||
_getOffsetHeight() {
|
_getOffsetHeight() {
|
||||||
return this._scrollElement === window
|
return this._scrollElement === window ?
|
||||||
? window.innerHeight : this._scrollElement.getBoundingClientRect().height
|
window.innerHeight : this._scrollElement.getBoundingClientRect().height
|
||||||
}
|
}
|
||||||
|
|
||||||
_process() {
|
_process() {
|
||||||
const scrollTop = this._getScrollTop() + this._config.offset
|
const scrollTop = this._getScrollTop() + this._config.offset
|
||||||
const scrollHeight = this._getScrollHeight()
|
const scrollHeight = this._getScrollHeight()
|
||||||
const maxScroll = this._config.offset +
|
const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight()
|
||||||
scrollHeight -
|
|
||||||
this._getOffsetHeight()
|
|
||||||
|
|
||||||
if (this._scrollHeight !== scrollHeight) {
|
if (this._scrollHeight !== scrollHeight) {
|
||||||
this.refresh()
|
this.refresh()
|
||||||
|
|
@ -215,6 +205,7 @@ class ScrollSpy {
|
||||||
if (this._activeTarget !== target) {
|
if (this._activeTarget !== target) {
|
||||||
this._activate(target)
|
this._activate(target)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,8 +215,7 @@ class ScrollSpy {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const offsetLength = this._offsets.length
|
for (let i = this._offsets.length; i--;) {
|
||||||
for (let i = offsetLength; i--;) {
|
|
||||||
const isActiveTarget = this._activeTarget !== this._targets[i] &&
|
const isActiveTarget = this._activeTarget !== this._targets[i] &&
|
||||||
scrollTop >= this._offsets[i] &&
|
scrollTop >= this._offsets[i] &&
|
||||||
(typeof this._offsets[i + 1] === 'undefined' ||
|
(typeof this._offsets[i + 1] === 'undefined' ||
|
||||||
|
|
@ -244,32 +234,39 @@ class ScrollSpy {
|
||||||
|
|
||||||
const queries = this._selector
|
const queries = this._selector
|
||||||
.split(',')
|
.split(',')
|
||||||
.map((selector) => `${selector}[data-target="${target}"],${selector}[href="${target}"]`)
|
.map(selector => `${selector}[data-target="${target}"],${selector}[href="${target}"]`)
|
||||||
|
|
||||||
const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))
|
const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))
|
||||||
|
|
||||||
if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
|
if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||||
$link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)
|
$link.closest(SELECTOR_DROPDOWN)
|
||||||
$link.addClass(ClassName.ACTIVE)
|
.find(SELECTOR_DROPDOWN_TOGGLE)
|
||||||
|
.addClass(CLASS_NAME_ACTIVE)
|
||||||
|
$link.addClass(CLASS_NAME_ACTIVE)
|
||||||
} else {
|
} else {
|
||||||
// Set triggered link as active
|
// Set triggered link as active
|
||||||
$link.addClass(ClassName.ACTIVE)
|
$link.addClass(CLASS_NAME_ACTIVE)
|
||||||
// Set triggered links parents as active
|
// Set triggered links parents as active
|
||||||
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||||
$link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)
|
$link.parents(SELECTOR_NAV_LIST_GROUP)
|
||||||
|
.prev(`${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`)
|
||||||
|
.addClass(CLASS_NAME_ACTIVE)
|
||||||
// Handle special case when .nav-link is inside .nav-item
|
// Handle special case when .nav-link is inside .nav-item
|
||||||
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE)
|
$link.parents(SELECTOR_NAV_LIST_GROUP)
|
||||||
|
.prev(SELECTOR_NAV_ITEMS)
|
||||||
|
.children(SELECTOR_NAV_LINKS)
|
||||||
|
.addClass(CLASS_NAME_ACTIVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._scrollElement).trigger(Event.ACTIVATE, {
|
$(this._scrollElement).trigger(EVENT_ACTIVATE, {
|
||||||
relatedTarget: target
|
relatedTarget: target
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
_clear() {
|
_clear() {
|
||||||
[].slice.call(document.querySelectorAll(this._selector))
|
[].slice.call(document.querySelectorAll(this._selector))
|
||||||
.filter((node) => node.classList.contains(ClassName.ACTIVE))
|
.filter(node => node.classList.contains(CLASS_NAME_ACTIVE))
|
||||||
.forEach((node) => node.classList.remove(ClassName.ACTIVE))
|
.forEach(node => node.classList.remove(CLASS_NAME_ACTIVE))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
@ -288,6 +285,7 @@ class ScrollSpy {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -300,8 +298,8 @@ class ScrollSpy {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(window).on(Event.LOAD_DATA_API, () => {
|
$(window).on(EVENT_LOAD_DATA_API, () => {
|
||||||
const scrollSpys = [].slice.call(document.querySelectorAll(Selector.DATA_SPY))
|
const scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY))
|
||||||
const scrollSpysLength = scrollSpys.length
|
const scrollSpysLength = scrollSpys.length
|
||||||
|
|
||||||
for (let i = scrollSpysLength; i--;) {
|
for (let i = scrollSpysLength; i--;) {
|
||||||
|
|
|
||||||
103
js/src/tab.js
103
js/src/tab.js
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): tab.js
|
* Bootstrap (v4.5.3): tab.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,38 +14,32 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'tab'
|
const NAME = 'tab'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.tab'
|
const DATA_KEY = 'bs.tab'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const DATA_API_KEY = '.data-api'
|
const DATA_API_KEY = '.data-api'
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const Event = {
|
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||||
SHOW : `show${EVENT_KEY}`,
|
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||||
SHOWN : `shown${EVENT_KEY}`,
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||||
CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'
|
||||||
DROPDOWN_MENU : 'dropdown-menu',
|
const CLASS_NAME_ACTIVE = 'active'
|
||||||
ACTIVE : 'active',
|
const CLASS_NAME_DISABLED = 'disabled'
|
||||||
DISABLED : 'disabled',
|
const CLASS_NAME_FADE = 'fade'
|
||||||
FADE : 'fade',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DROPDOWN = '.dropdown'
|
||||||
DROPDOWN : '.dropdown',
|
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
|
||||||
NAV_LIST_GROUP : '.nav, .list-group',
|
const SELECTOR_ACTIVE = '.active'
|
||||||
ACTIVE : '.active',
|
const SELECTOR_ACTIVE_UL = '> li > .active'
|
||||||
ACTIVE_UL : '> li > .active',
|
const SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'
|
||||||
DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
|
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
|
||||||
DROPDOWN_TOGGLE : '.dropdown-toggle',
|
const SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'
|
||||||
DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -69,27 +63,27 @@ class Tab {
|
||||||
show() {
|
show() {
|
||||||
if (this._element.parentNode &&
|
if (this._element.parentNode &&
|
||||||
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
|
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
|
||||||
$(this._element).hasClass(ClassName.ACTIVE) ||
|
$(this._element).hasClass(CLASS_NAME_ACTIVE) ||
|
||||||
$(this._element).hasClass(ClassName.DISABLED)) {
|
$(this._element).hasClass(CLASS_NAME_DISABLED)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let target
|
let target
|
||||||
let previous
|
let previous
|
||||||
const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]
|
const listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]
|
||||||
const selector = Util.getSelectorFromElement(this._element)
|
const selector = Util.getSelectorFromElement(this._element)
|
||||||
|
|
||||||
if (listElement) {
|
if (listElement) {
|
||||||
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE
|
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE
|
||||||
previous = $.makeArray($(listElement).find(itemSelector))
|
previous = $.makeArray($(listElement).find(itemSelector))
|
||||||
previous = previous[previous.length - 1]
|
previous = previous[previous.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideEvent = $.Event(Event.HIDE, {
|
const hideEvent = $.Event(EVENT_HIDE, {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
})
|
})
|
||||||
|
|
||||||
const showEvent = $.Event(Event.SHOW, {
|
const showEvent = $.Event(EVENT_SHOW, {
|
||||||
relatedTarget: previous
|
relatedTarget: previous
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -114,11 +108,11 @@ class Tab {
|
||||||
)
|
)
|
||||||
|
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
const hiddenEvent = $.Event(Event.HIDDEN, {
|
const hiddenEvent = $.Event(EVENT_HIDDEN, {
|
||||||
relatedTarget: this._element
|
relatedTarget: this._element
|
||||||
})
|
})
|
||||||
|
|
||||||
const shownEvent = $.Event(Event.SHOWN, {
|
const shownEvent = $.Event(EVENT_SHOWN, {
|
||||||
relatedTarget: previous
|
relatedTarget: previous
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -141,12 +135,12 @@ class Tab {
|
||||||
// Private
|
// Private
|
||||||
|
|
||||||
_activate(element, container, callback) {
|
_activate(element, container, callback) {
|
||||||
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')
|
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?
|
||||||
? $(container).find(Selector.ACTIVE_UL)
|
$(container).find(SELECTOR_ACTIVE_UL) :
|
||||||
: $(container).children(Selector.ACTIVE)
|
$(container).children(SELECTOR_ACTIVE)
|
||||||
|
|
||||||
const active = activeElements[0]
|
const active = activeElements[0]
|
||||||
const isTransitioning = callback && (active && $(active).hasClass(ClassName.FADE))
|
const isTransitioning = callback && (active && $(active).hasClass(CLASS_NAME_FADE))
|
||||||
const complete = () => this._transitionComplete(
|
const complete = () => this._transitionComplete(
|
||||||
element,
|
element,
|
||||||
active,
|
active,
|
||||||
|
|
@ -157,7 +151,7 @@ class Tab {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(active)
|
const transitionDuration = Util.getTransitionDurationFromElement(active)
|
||||||
|
|
||||||
$(active)
|
$(active)
|
||||||
.removeClass(ClassName.SHOW)
|
.removeClass(CLASS_NAME_SHOW)
|
||||||
.one(Util.TRANSITION_END, complete)
|
.one(Util.TRANSITION_END, complete)
|
||||||
.emulateTransitionEnd(transitionDuration)
|
.emulateTransitionEnd(transitionDuration)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -167,14 +161,14 @@ class Tab {
|
||||||
|
|
||||||
_transitionComplete(element, active, callback) {
|
_transitionComplete(element, active, callback) {
|
||||||
if (active) {
|
if (active) {
|
||||||
$(active).removeClass(ClassName.ACTIVE)
|
$(active).removeClass(CLASS_NAME_ACTIVE)
|
||||||
|
|
||||||
const dropdownChild = $(active.parentNode).find(
|
const dropdownChild = $(active.parentNode).find(
|
||||||
Selector.DROPDOWN_ACTIVE_CHILD
|
SELECTOR_DROPDOWN_ACTIVE_CHILD
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
if (dropdownChild) {
|
if (dropdownChild) {
|
||||||
$(dropdownChild).removeClass(ClassName.ACTIVE)
|
$(dropdownChild).removeClass(CLASS_NAME_ACTIVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active.getAttribute('role') === 'tab') {
|
if (active.getAttribute('role') === 'tab') {
|
||||||
|
|
@ -182,24 +176,24 @@ class Tab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(element).addClass(ClassName.ACTIVE)
|
$(element).addClass(CLASS_NAME_ACTIVE)
|
||||||
if (element.getAttribute('role') === 'tab') {
|
if (element.getAttribute('role') === 'tab') {
|
||||||
element.setAttribute('aria-selected', true)
|
element.setAttribute('aria-selected', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.reflow(element)
|
Util.reflow(element)
|
||||||
|
|
||||||
if (element.classList.contains(ClassName.FADE)) {
|
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||||
element.classList.add(ClassName.SHOW)
|
element.classList.add(CLASS_NAME_SHOW)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
|
if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
|
||||||
const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]
|
const dropdownElement = $(element).closest(SELECTOR_DROPDOWN)[0]
|
||||||
|
|
||||||
if (dropdownElement) {
|
if (dropdownElement) {
|
||||||
const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector.DROPDOWN_TOGGLE))
|
const dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE))
|
||||||
|
|
||||||
$(dropdownToggleList).addClass(ClassName.ACTIVE)
|
$(dropdownToggleList).addClass(CLASS_NAME_ACTIVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
element.setAttribute('aria-expanded', true)
|
element.setAttribute('aria-expanded', true)
|
||||||
|
|
@ -226,6 +220,7 @@ class Tab {
|
||||||
if (typeof data[config] === 'undefined') {
|
if (typeof data[config] === 'undefined') {
|
||||||
throw new TypeError(`No method named "${config}"`)
|
throw new TypeError(`No method named "${config}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[config]()
|
data[config]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -239,7 +234,7 @@ class Tab {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document)
|
$(document)
|
||||||
.on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
.on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
Tab._jQueryInterface.call($(this), 'show')
|
Tab._jQueryInterface.call($(this), 'show')
|
||||||
})
|
})
|
||||||
|
|
|
||||||
133
js/src/toast.js
133
js/src/toast.js
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): toast.js
|
* Bootstrap (v4.5.3): toast.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -14,42 +14,36 @@ import Util from './util'
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const NAME = 'toast'
|
const NAME = 'toast'
|
||||||
const VERSION = '4.3.1'
|
const VERSION = '4.5.3'
|
||||||
const DATA_KEY = 'bs.toast'
|
const DATA_KEY = 'bs.toast'
|
||||||
const EVENT_KEY = `.${DATA_KEY}`
|
const EVENT_KEY = `.${DATA_KEY}`
|
||||||
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
||||||
|
|
||||||
const Event = {
|
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
|
||||||
CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,
|
const EVENT_HIDE = `hide${EVENT_KEY}`
|
||||||
HIDE : `hide${EVENT_KEY}`,
|
const EVENT_HIDDEN = `hidden${EVENT_KEY}`
|
||||||
HIDDEN : `hidden${EVENT_KEY}`,
|
const EVENT_SHOW = `show${EVENT_KEY}`
|
||||||
SHOW : `show${EVENT_KEY}`,
|
const EVENT_SHOWN = `shown${EVENT_KEY}`
|
||||||
SHOWN : `shown${EVENT_KEY}`
|
|
||||||
}
|
|
||||||
|
|
||||||
const ClassName = {
|
const CLASS_NAME_FADE = 'fade'
|
||||||
FADE : 'fade',
|
const CLASS_NAME_HIDE = 'hide'
|
||||||
HIDE : 'hide',
|
const CLASS_NAME_SHOW = 'show'
|
||||||
SHOW : 'show',
|
const CLASS_NAME_SHOWING = 'showing'
|
||||||
SHOWING : 'showing'
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefaultType = {
|
const DefaultType = {
|
||||||
animation : 'boolean',
|
animation: 'boolean',
|
||||||
autohide : 'boolean',
|
autohide: 'boolean',
|
||||||
delay : 'number'
|
delay: 'number'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
animation : true,
|
animation: true,
|
||||||
autohide : true,
|
autohide: true,
|
||||||
delay : 500
|
delay: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
const Selector = {
|
const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'
|
||||||
DATA_DISMISS : '[data-dismiss="toast"]'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
|
|
@ -60,7 +54,7 @@ const Selector = {
|
||||||
class Toast {
|
class Toast {
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
this._element = element
|
this._element = element
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._timeout = null
|
this._timeout = null
|
||||||
this._setListeners()
|
this._setListeners()
|
||||||
}
|
}
|
||||||
|
|
@ -82,25 +76,35 @@ class Toast {
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
$(this._element).trigger(Event.SHOW)
|
const showEvent = $.Event(EVENT_SHOW)
|
||||||
|
|
||||||
|
$(this._element).trigger(showEvent)
|
||||||
|
if (showEvent.isDefaultPrevented()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this._clearTimeout()
|
||||||
|
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
this._element.classList.add(ClassName.FADE)
|
this._element.classList.add(CLASS_NAME_FADE)
|
||||||
}
|
}
|
||||||
|
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
this._element.classList.remove(ClassName.SHOWING)
|
this._element.classList.remove(CLASS_NAME_SHOWING)
|
||||||
this._element.classList.add(ClassName.SHOW)
|
this._element.classList.add(CLASS_NAME_SHOW)
|
||||||
|
|
||||||
$(this._element).trigger(Event.SHOWN)
|
$(this._element).trigger(EVENT_SHOWN)
|
||||||
|
|
||||||
if (this._config.autohide) {
|
if (this._config.autohide) {
|
||||||
this.hide()
|
this._timeout = setTimeout(() => {
|
||||||
|
this.hide()
|
||||||
|
}, this._config.delay)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.classList.remove(ClassName.HIDE)
|
this._element.classList.remove(CLASS_NAME_HIDE)
|
||||||
this._element.classList.add(ClassName.SHOWING)
|
Util.reflow(this._element)
|
||||||
|
this._element.classList.add(CLASS_NAME_SHOWING)
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
|
@ -112,35 +116,33 @@ class Toast {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hide(withoutTimeout) {
|
hide() {
|
||||||
if (!this._element.classList.contains(ClassName.SHOW)) {
|
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).trigger(Event.HIDE)
|
const hideEvent = $.Event(EVENT_HIDE)
|
||||||
|
|
||||||
if (withoutTimeout) {
|
$(this._element).trigger(hideEvent)
|
||||||
this._close()
|
if (hideEvent.isDefaultPrevented()) {
|
||||||
} else {
|
return
|
||||||
this._timeout = setTimeout(() => {
|
|
||||||
this._close()
|
|
||||||
}, this._config.delay)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._close()
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
clearTimeout(this._timeout)
|
this._clearTimeout()
|
||||||
this._timeout = null
|
|
||||||
|
|
||||||
if (this._element.classList.contains(ClassName.SHOW)) {
|
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||||
this._element.classList.remove(ClassName.SHOW)
|
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this._element).off(Event.CLICK_DISMISS)
|
$(this._element).off(EVENT_CLICK_DISMISS)
|
||||||
|
|
||||||
$.removeData(this._element, DATA_KEY)
|
$.removeData(this._element, DATA_KEY)
|
||||||
this._element = null
|
this._element = null
|
||||||
this._config = null
|
this._config = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
|
@ -149,7 +151,7 @@ class Toast {
|
||||||
config = {
|
config = {
|
||||||
...Default,
|
...Default,
|
||||||
...$(this._element).data(),
|
...$(this._element).data(),
|
||||||
...typeof config === 'object' && config ? config : {}
|
...(typeof config === 'object' && config ? config : {})
|
||||||
}
|
}
|
||||||
|
|
||||||
Util.typeCheckConfig(
|
Util.typeCheckConfig(
|
||||||
|
|
@ -162,20 +164,16 @@ class Toast {
|
||||||
}
|
}
|
||||||
|
|
||||||
_setListeners() {
|
_setListeners() {
|
||||||
$(this._element).on(
|
$(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
|
||||||
Event.CLICK_DISMISS,
|
|
||||||
Selector.DATA_DISMISS,
|
|
||||||
() => this.hide(true)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_close() {
|
_close() {
|
||||||
const complete = () => {
|
const complete = () => {
|
||||||
this._element.classList.add(ClassName.HIDE)
|
this._element.classList.add(CLASS_NAME_HIDE)
|
||||||
$(this._element).trigger(Event.HIDDEN)
|
$(this._element).trigger(EVENT_HIDDEN)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.classList.remove(ClassName.SHOW)
|
this._element.classList.remove(CLASS_NAME_SHOW)
|
||||||
if (this._config.animation) {
|
if (this._config.animation) {
|
||||||
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
|
||||||
|
|
||||||
|
|
@ -187,13 +185,18 @@ class Toast {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_clearTimeout() {
|
||||||
|
clearTimeout(this._timeout)
|
||||||
|
this._timeout = null
|
||||||
|
}
|
||||||
|
|
||||||
// Static
|
// Static
|
||||||
|
|
||||||
static _jQueryInterface(config) {
|
static _jQueryInterface(config) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
const $element = $(this)
|
const $element = $(this)
|
||||||
let data = $element.data(DATA_KEY)
|
let data = $element.data(DATA_KEY)
|
||||||
const _config = typeof config === 'object' && config
|
const _config = typeof config === 'object' && config
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = new Toast(this, _config)
|
data = new Toast(this, _config)
|
||||||
|
|
@ -217,9 +220,9 @@ class Toast {
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$.fn[NAME] = Toast._jQueryInterface
|
$.fn[NAME] = Toast._jQueryInterface
|
||||||
$.fn[NAME].Constructor = Toast
|
$.fn[NAME].Constructor = Toast
|
||||||
$.fn[NAME].noConflict = () => {
|
$.fn[NAME].noConflict = () => {
|
||||||
$.fn[NAME] = JQUERY_NO_CONFLICT
|
$.fn[NAME] = JQUERY_NO_CONFLICT
|
||||||
return Toast._jQueryInterface
|
return Toast._jQueryInterface
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
* Bootstrap (v4.3.1): tools/sanitizer.js
|
* Bootstrap (v4.5.3): tools/sanitizer.js
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ export const DefaultWhitelist = {
|
||||||
h5: [],
|
h5: [],
|
||||||
h6: [],
|
h6: [],
|
||||||
i: [],
|
i: [],
|
||||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
|
||||||
li: [],
|
li: [],
|
||||||
ol: [],
|
ol: [],
|
||||||
p: [],
|
p: [],
|
||||||
|
|
@ -57,14 +57,14 @@ export const DefaultWhitelist = {
|
||||||
*
|
*
|
||||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
*/
|
*/
|
||||||
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||||
*
|
*
|
||||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||||
*/
|
*/
|
||||||
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
|
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i
|
||||||
|
|
||||||
function allowedAttribute(attr, allowedAttributeList) {
|
function allowedAttribute(attr, allowedAttributeList) {
|
||||||
const attrName = attr.nodeName.toLowerCase()
|
const attrName = attr.nodeName.toLowerCase()
|
||||||
|
|
@ -77,10 +77,10 @@ function allowedAttribute(attr, allowedAttributeList) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)
|
const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp)
|
||||||
|
|
||||||
// Check if a regular expression validates the attribute.
|
// Check if a regular expression validates the attribute.
|
||||||
for (let i = 0, l = regExp.length; i < l; i++) {
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
||||||
if (attrName.match(regExp[i])) {
|
if (attrName.match(regExp[i])) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||||
const attributeList = [].slice.call(el.attributes)
|
const attributeList = [].slice.call(el.attributes)
|
||||||
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
||||||
|
|
||||||
attributeList.forEach((attr) => {
|
attributeList.forEach(attr => {
|
||||||
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
if (!allowedAttribute(attr, whitelistedAttributes)) {
|
||||||
el.removeAttribute(attr.nodeName)
|
el.removeAttribute(attr.nodeName)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue