Eunsu486

add bootstrap and navigation

Showing 189 changed files with 5071 additions and 0 deletions
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2011-2021 Twitter, Inc.
4 +Copyright (c) 2011-2021 The Bootstrap Authors
5 +
6 +Permission is hereby granted, free of charge, to any person obtaining a copy
7 +of this software and associated documentation files (the "Software"), to deal
8 +in the Software without restriction, including without limitation the rights
9 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 +copies of the Software, and to permit persons to whom the Software is
11 +furnished to do so, subject to the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be included in
14 +all copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 +THE SOFTWARE.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 +/*!
2 + * Bootstrap Reboot v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors
4 + * Copyright 2011-2021 Twitter, Inc.
5 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 + * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 + */
8 +*,
9 +*::before,
10 +*::after {
11 + box-sizing: border-box;
12 +}
13 +
14 +@media (prefers-reduced-motion: no-preference) {
15 + :root {
16 + scroll-behavior: smooth;
17 + }
18 +}
19 +
20 +body {
21 + margin: 0;
22 + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
23 + font-size: 1rem;
24 + font-weight: 400;
25 + line-height: 1.5;
26 + color: #212529;
27 + background-color: #fff;
28 + -webkit-text-size-adjust: 100%;
29 + -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
30 +}
31 +
32 +hr {
33 + margin: 1rem 0;
34 + color: inherit;
35 + background-color: currentColor;
36 + border: 0;
37 + opacity: 0.25;
38 +}
39 +
40 +hr:not([size]) {
41 + height: 1px;
42 +}
43 +
44 +h6, h5, h4, h3, h2, h1 {
45 + margin-top: 0;
46 + margin-bottom: 0.5rem;
47 + font-weight: 500;
48 + line-height: 1.2;
49 +}
50 +
51 +h1 {
52 + font-size: calc(1.375rem + 1.5vw);
53 +}
54 +@media (min-width: 1200px) {
55 + h1 {
56 + font-size: 2.5rem;
57 + }
58 +}
59 +
60 +h2 {
61 + font-size: calc(1.325rem + 0.9vw);
62 +}
63 +@media (min-width: 1200px) {
64 + h2 {
65 + font-size: 2rem;
66 + }
67 +}
68 +
69 +h3 {
70 + font-size: calc(1.3rem + 0.6vw);
71 +}
72 +@media (min-width: 1200px) {
73 + h3 {
74 + font-size: 1.75rem;
75 + }
76 +}
77 +
78 +h4 {
79 + font-size: calc(1.275rem + 0.3vw);
80 +}
81 +@media (min-width: 1200px) {
82 + h4 {
83 + font-size: 1.5rem;
84 + }
85 +}
86 +
87 +h5 {
88 + font-size: 1.25rem;
89 +}
90 +
91 +h6 {
92 + font-size: 1rem;
93 +}
94 +
95 +p {
96 + margin-top: 0;
97 + margin-bottom: 1rem;
98 +}
99 +
100 +abbr[title],
101 +abbr[data-bs-original-title] {
102 + -webkit-text-decoration: underline dotted;
103 + text-decoration: underline dotted;
104 + cursor: help;
105 + -webkit-text-decoration-skip-ink: none;
106 + text-decoration-skip-ink: none;
107 +}
108 +
109 +address {
110 + margin-bottom: 1rem;
111 + font-style: normal;
112 + line-height: inherit;
113 +}
114 +
115 +ol,
116 +ul {
117 + padding-left: 2rem;
118 +}
119 +
120 +ol,
121 +ul,
122 +dl {
123 + margin-top: 0;
124 + margin-bottom: 1rem;
125 +}
126 +
127 +ol ol,
128 +ul ul,
129 +ol ul,
130 +ul ol {
131 + margin-bottom: 0;
132 +}
133 +
134 +dt {
135 + font-weight: 700;
136 +}
137 +
138 +dd {
139 + margin-bottom: 0.5rem;
140 + margin-left: 0;
141 +}
142 +
143 +blockquote {
144 + margin: 0 0 1rem;
145 +}
146 +
147 +b,
148 +strong {
149 + font-weight: bolder;
150 +}
151 +
152 +small {
153 + font-size: 0.875em;
154 +}
155 +
156 +mark {
157 + padding: 0.2em;
158 + background-color: #fcf8e3;
159 +}
160 +
161 +sub,
162 +sup {
163 + position: relative;
164 + font-size: 0.75em;
165 + line-height: 0;
166 + vertical-align: baseline;
167 +}
168 +
169 +sub {
170 + bottom: -0.25em;
171 +}
172 +
173 +sup {
174 + top: -0.5em;
175 +}
176 +
177 +a {
178 + color: #0d6efd;
179 + text-decoration: underline;
180 +}
181 +a:hover {
182 + color: #0a58ca;
183 +}
184 +
185 +a:not([href]):not([class]), a:not([href]):not([class]):hover {
186 + color: inherit;
187 + text-decoration: none;
188 +}
189 +
190 +pre,
191 +code,
192 +kbd,
193 +samp {
194 + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
195 + font-size: 1em;
196 + direction: ltr /* rtl:ignore */;
197 + unicode-bidi: bidi-override;
198 +}
199 +
200 +pre {
201 + display: block;
202 + margin-top: 0;
203 + margin-bottom: 1rem;
204 + overflow: auto;
205 + font-size: 0.875em;
206 +}
207 +pre code {
208 + font-size: inherit;
209 + color: inherit;
210 + word-break: normal;
211 +}
212 +
213 +code {
214 + font-size: 0.875em;
215 + color: #d63384;
216 + word-wrap: break-word;
217 +}
218 +a > code {
219 + color: inherit;
220 +}
221 +
222 +kbd {
223 + padding: 0.2rem 0.4rem;
224 + font-size: 0.875em;
225 + color: #fff;
226 + background-color: #212529;
227 + border-radius: 0.2rem;
228 +}
229 +kbd kbd {
230 + padding: 0;
231 + font-size: 1em;
232 + font-weight: 700;
233 +}
234 +
235 +figure {
236 + margin: 0 0 1rem;
237 +}
238 +
239 +img,
240 +svg {
241 + vertical-align: middle;
242 +}
243 +
244 +table {
245 + caption-side: bottom;
246 + border-collapse: collapse;
247 +}
248 +
249 +caption {
250 + padding-top: 0.5rem;
251 + padding-bottom: 0.5rem;
252 + color: #6c757d;
253 + text-align: left;
254 +}
255 +
256 +th {
257 + text-align: inherit;
258 + text-align: -webkit-match-parent;
259 +}
260 +
261 +thead,
262 +tbody,
263 +tfoot,
264 +tr,
265 +td,
266 +th {
267 + border-color: inherit;
268 + border-style: solid;
269 + border-width: 0;
270 +}
271 +
272 +label {
273 + display: inline-block;
274 +}
275 +
276 +button {
277 + border-radius: 0;
278 +}
279 +
280 +button:focus:not(:focus-visible) {
281 + outline: 0;
282 +}
283 +
284 +input,
285 +button,
286 +select,
287 +optgroup,
288 +textarea {
289 + margin: 0;
290 + font-family: inherit;
291 + font-size: inherit;
292 + line-height: inherit;
293 +}
294 +
295 +button,
296 +select {
297 + text-transform: none;
298 +}
299 +
300 +[role=button] {
301 + cursor: pointer;
302 +}
303 +
304 +select {
305 + word-wrap: normal;
306 +}
307 +select:disabled {
308 + opacity: 1;
309 +}
310 +
311 +[list]::-webkit-calendar-picker-indicator {
312 + display: none;
313 +}
314 +
315 +button,
316 +[type=button],
317 +[type=reset],
318 +[type=submit] {
319 + -webkit-appearance: button;
320 +}
321 +button:not(:disabled),
322 +[type=button]:not(:disabled),
323 +[type=reset]:not(:disabled),
324 +[type=submit]:not(:disabled) {
325 + cursor: pointer;
326 +}
327 +
328 +::-moz-focus-inner {
329 + padding: 0;
330 + border-style: none;
331 +}
332 +
333 +textarea {
334 + resize: vertical;
335 +}
336 +
337 +fieldset {
338 + min-width: 0;
339 + padding: 0;
340 + margin: 0;
341 + border: 0;
342 +}
343 +
344 +legend {
345 + float: left;
346 + width: 100%;
347 + padding: 0;
348 + margin-bottom: 0.5rem;
349 + font-size: calc(1.275rem + 0.3vw);
350 + line-height: inherit;
351 +}
352 +@media (min-width: 1200px) {
353 + legend {
354 + font-size: 1.5rem;
355 + }
356 +}
357 +legend + * {
358 + clear: left;
359 +}
360 +
361 +::-webkit-datetime-edit-fields-wrapper,
362 +::-webkit-datetime-edit-text,
363 +::-webkit-datetime-edit-minute,
364 +::-webkit-datetime-edit-hour-field,
365 +::-webkit-datetime-edit-day-field,
366 +::-webkit-datetime-edit-month-field,
367 +::-webkit-datetime-edit-year-field {
368 + padding: 0;
369 +}
370 +
371 +::-webkit-inner-spin-button {
372 + height: auto;
373 +}
374 +
375 +[type=search] {
376 + outline-offset: -2px;
377 + -webkit-appearance: textfield;
378 +}
379 +
380 +/* rtl:raw:
381 +[type="tel"],
382 +[type="url"],
383 +[type="email"],
384 +[type="number"] {
385 + direction: ltr;
386 +}
387 +*/
388 +::-webkit-search-decoration {
389 + -webkit-appearance: none;
390 +}
391 +
392 +::-webkit-color-swatch-wrapper {
393 + padding: 0;
394 +}
395 +
396 +::file-selector-button {
397 + font: inherit;
398 +}
399 +
400 +::-webkit-file-upload-button {
401 + font: inherit;
402 + -webkit-appearance: button;
403 +}
404 +
405 +output {
406 + display: inline-block;
407 +}
408 +
409 +iframe {
410 + border: 0;
411 +}
412 +
413 +summary {
414 + display: list-item;
415 + cursor: pointer;
416 +}
417 +
418 +progress {
419 + vertical-align: baseline;
420 +}
421 +
422 +[hidden] {
423 + display: none !important;
424 +}
425 +
426 +/*# sourceMappingURL=bootstrap-reboot.css.map */
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap Reboot v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors
4 + * Copyright 2011-2021 Twitter, Inc.
5 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 + * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 + */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation 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;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}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:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),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;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[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}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 +/*# sourceMappingURL=bootstrap-reboot.min.css.map */
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap Reboot v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors
4 + * Copyright 2011-2021 Twitter, Inc.
5 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 + * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 + */
8 +*,
9 +*::before,
10 +*::after {
11 + box-sizing: border-box;
12 +}
13 +
14 +@media (prefers-reduced-motion: no-preference) {
15 + :root {
16 + scroll-behavior: smooth;
17 + }
18 +}
19 +
20 +body {
21 + margin: 0;
22 + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
23 + font-size: 1rem;
24 + font-weight: 400;
25 + line-height: 1.5;
26 + color: #212529;
27 + background-color: #fff;
28 + -webkit-text-size-adjust: 100%;
29 + -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
30 +}
31 +
32 +hr {
33 + margin: 1rem 0;
34 + color: inherit;
35 + background-color: currentColor;
36 + border: 0;
37 + opacity: 0.25;
38 +}
39 +
40 +hr:not([size]) {
41 + height: 1px;
42 +}
43 +
44 +h6, h5, h4, h3, h2, h1 {
45 + margin-top: 0;
46 + margin-bottom: 0.5rem;
47 + font-weight: 500;
48 + line-height: 1.2;
49 +}
50 +
51 +h1 {
52 + font-size: calc(1.375rem + 1.5vw);
53 +}
54 +@media (min-width: 1200px) {
55 + h1 {
56 + font-size: 2.5rem;
57 + }
58 +}
59 +
60 +h2 {
61 + font-size: calc(1.325rem + 0.9vw);
62 +}
63 +@media (min-width: 1200px) {
64 + h2 {
65 + font-size: 2rem;
66 + }
67 +}
68 +
69 +h3 {
70 + font-size: calc(1.3rem + 0.6vw);
71 +}
72 +@media (min-width: 1200px) {
73 + h3 {
74 + font-size: 1.75rem;
75 + }
76 +}
77 +
78 +h4 {
79 + font-size: calc(1.275rem + 0.3vw);
80 +}
81 +@media (min-width: 1200px) {
82 + h4 {
83 + font-size: 1.5rem;
84 + }
85 +}
86 +
87 +h5 {
88 + font-size: 1.25rem;
89 +}
90 +
91 +h6 {
92 + font-size: 1rem;
93 +}
94 +
95 +p {
96 + margin-top: 0;
97 + margin-bottom: 1rem;
98 +}
99 +
100 +abbr[title],
101 +abbr[data-bs-original-title] {
102 + -webkit-text-decoration: underline dotted;
103 + text-decoration: underline dotted;
104 + cursor: help;
105 + -webkit-text-decoration-skip-ink: none;
106 + text-decoration-skip-ink: none;
107 +}
108 +
109 +address {
110 + margin-bottom: 1rem;
111 + font-style: normal;
112 + line-height: inherit;
113 +}
114 +
115 +ol,
116 +ul {
117 + padding-right: 2rem;
118 +}
119 +
120 +ol,
121 +ul,
122 +dl {
123 + margin-top: 0;
124 + margin-bottom: 1rem;
125 +}
126 +
127 +ol ol,
128 +ul ul,
129 +ol ul,
130 +ul ol {
131 + margin-bottom: 0;
132 +}
133 +
134 +dt {
135 + font-weight: 700;
136 +}
137 +
138 +dd {
139 + margin-bottom: 0.5rem;
140 + margin-right: 0;
141 +}
142 +
143 +blockquote {
144 + margin: 0 0 1rem;
145 +}
146 +
147 +b,
148 +strong {
149 + font-weight: bolder;
150 +}
151 +
152 +small {
153 + font-size: 0.875em;
154 +}
155 +
156 +mark {
157 + padding: 0.2em;
158 + background-color: #fcf8e3;
159 +}
160 +
161 +sub,
162 +sup {
163 + position: relative;
164 + font-size: 0.75em;
165 + line-height: 0;
166 + vertical-align: baseline;
167 +}
168 +
169 +sub {
170 + bottom: -0.25em;
171 +}
172 +
173 +sup {
174 + top: -0.5em;
175 +}
176 +
177 +a {
178 + color: #0d6efd;
179 + text-decoration: underline;
180 +}
181 +a:hover {
182 + color: #0a58ca;
183 +}
184 +
185 +a:not([href]):not([class]), a:not([href]):not([class]):hover {
186 + color: inherit;
187 + text-decoration: none;
188 +}
189 +
190 +pre,
191 +code,
192 +kbd,
193 +samp {
194 + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
195 + font-size: 1em;
196 + direction: ltr ;
197 + unicode-bidi: bidi-override;
198 +}
199 +
200 +pre {
201 + display: block;
202 + margin-top: 0;
203 + margin-bottom: 1rem;
204 + overflow: auto;
205 + font-size: 0.875em;
206 +}
207 +pre code {
208 + font-size: inherit;
209 + color: inherit;
210 + word-break: normal;
211 +}
212 +
213 +code {
214 + font-size: 0.875em;
215 + color: #d63384;
216 + word-wrap: break-word;
217 +}
218 +a > code {
219 + color: inherit;
220 +}
221 +
222 +kbd {
223 + padding: 0.2rem 0.4rem;
224 + font-size: 0.875em;
225 + color: #fff;
226 + background-color: #212529;
227 + border-radius: 0.2rem;
228 +}
229 +kbd kbd {
230 + padding: 0;
231 + font-size: 1em;
232 + font-weight: 700;
233 +}
234 +
235 +figure {
236 + margin: 0 0 1rem;
237 +}
238 +
239 +img,
240 +svg {
241 + vertical-align: middle;
242 +}
243 +
244 +table {
245 + caption-side: bottom;
246 + border-collapse: collapse;
247 +}
248 +
249 +caption {
250 + padding-top: 0.5rem;
251 + padding-bottom: 0.5rem;
252 + color: #6c757d;
253 + text-align: right;
254 +}
255 +
256 +th {
257 + text-align: inherit;
258 + text-align: -webkit-match-parent;
259 +}
260 +
261 +thead,
262 +tbody,
263 +tfoot,
264 +tr,
265 +td,
266 +th {
267 + border-color: inherit;
268 + border-style: solid;
269 + border-width: 0;
270 +}
271 +
272 +label {
273 + display: inline-block;
274 +}
275 +
276 +button {
277 + border-radius: 0;
278 +}
279 +
280 +button:focus:not(:focus-visible) {
281 + outline: 0;
282 +}
283 +
284 +input,
285 +button,
286 +select,
287 +optgroup,
288 +textarea {
289 + margin: 0;
290 + font-family: inherit;
291 + font-size: inherit;
292 + line-height: inherit;
293 +}
294 +
295 +button,
296 +select {
297 + text-transform: none;
298 +}
299 +
300 +[role=button] {
301 + cursor: pointer;
302 +}
303 +
304 +select {
305 + word-wrap: normal;
306 +}
307 +select:disabled {
308 + opacity: 1;
309 +}
310 +
311 +[list]::-webkit-calendar-picker-indicator {
312 + display: none;
313 +}
314 +
315 +button,
316 +[type=button],
317 +[type=reset],
318 +[type=submit] {
319 + -webkit-appearance: button;
320 +}
321 +button:not(:disabled),
322 +[type=button]:not(:disabled),
323 +[type=reset]:not(:disabled),
324 +[type=submit]:not(:disabled) {
325 + cursor: pointer;
326 +}
327 +
328 +::-moz-focus-inner {
329 + padding: 0;
330 + border-style: none;
331 +}
332 +
333 +textarea {
334 + resize: vertical;
335 +}
336 +
337 +fieldset {
338 + min-width: 0;
339 + padding: 0;
340 + margin: 0;
341 + border: 0;
342 +}
343 +
344 +legend {
345 + float: right;
346 + width: 100%;
347 + padding: 0;
348 + margin-bottom: 0.5rem;
349 + font-size: calc(1.275rem + 0.3vw);
350 + line-height: inherit;
351 +}
352 +@media (min-width: 1200px) {
353 + legend {
354 + font-size: 1.5rem;
355 + }
356 +}
357 +legend + * {
358 + clear: right;
359 +}
360 +
361 +::-webkit-datetime-edit-fields-wrapper,
362 +::-webkit-datetime-edit-text,
363 +::-webkit-datetime-edit-minute,
364 +::-webkit-datetime-edit-hour-field,
365 +::-webkit-datetime-edit-day-field,
366 +::-webkit-datetime-edit-month-field,
367 +::-webkit-datetime-edit-year-field {
368 + padding: 0;
369 +}
370 +
371 +::-webkit-inner-spin-button {
372 + height: auto;
373 +}
374 +
375 +[type=search] {
376 + outline-offset: -2px;
377 + -webkit-appearance: textfield;
378 +}
379 +
380 +[type="tel"],
381 +[type="url"],
382 +[type="email"],
383 +[type="number"] {
384 + direction: ltr;
385 +}
386 +::-webkit-search-decoration {
387 + -webkit-appearance: none;
388 +}
389 +
390 +::-webkit-color-swatch-wrapper {
391 + padding: 0;
392 +}
393 +
394 +::file-selector-button {
395 + font: inherit;
396 +}
397 +
398 +::-webkit-file-upload-button {
399 + font: inherit;
400 + -webkit-appearance: button;
401 +}
402 +
403 +output {
404 + display: inline-block;
405 +}
406 +
407 +iframe {
408 + border: 0;
409 +}
410 +
411 +summary {
412 + display: list-item;
413 + cursor: pointer;
414 +}
415 +
416 +progress {
417 + vertical-align: baseline;
418 +}
419 +
420 +[hidden] {
421 + display: none !important;
422 +}
423 +/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap Reboot v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors
4 + * Copyright 2011-2021 Twitter, Inc.
5 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6 + * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 + */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation 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;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}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-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),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;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[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}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
8 +/*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 +/*!
2 + * Bootstrap alert.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/selector-engine.js'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./base-component.js')) :
8 + typeof define === 'function' && define.amd ? define(['./dom/selector-engine', './dom/data', './dom/event-handler', './base-component'], factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.SelectorEngine, global.Data, global.EventHandler, global.Base));
10 +}(this, (function (SelectorEngine, Data, EventHandler, BaseComponent) { 'use strict';
11 +
12 + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13 +
14 + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15 + var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16 + var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
17 +
18 + const getSelector = element => {
19 + let selector = element.getAttribute('data-bs-target');
20 +
21 + if (!selector || selector === '#') {
22 + let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
23 + // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
24 + // `document.querySelector` will rightfully complain it is invalid.
25 + // See https://github.com/twbs/bootstrap/issues/32273
26 +
27 + if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
28 + return null;
29 + } // Just in case some CMS puts out a full URL with the anchor appended
30 +
31 +
32 + if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
33 + hrefAttr = `#${hrefAttr.split('#')[1]}`;
34 + }
35 +
36 + selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
37 + }
38 +
39 + return selector;
40 + };
41 +
42 + const getElementFromSelector = element => {
43 + const selector = getSelector(element);
44 + return selector ? document.querySelector(selector) : null;
45 + };
46 +
47 + const getjQuery = () => {
48 + const {
49 + jQuery
50 + } = window;
51 +
52 + if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
53 + return jQuery;
54 + }
55 +
56 + return null;
57 + };
58 +
59 + const onDOMContentLoaded = callback => {
60 + if (document.readyState === 'loading') {
61 + document.addEventListener('DOMContentLoaded', callback);
62 + } else {
63 + callback();
64 + }
65 + };
66 +
67 + const defineJQueryPlugin = plugin => {
68 + onDOMContentLoaded(() => {
69 + const $ = getjQuery();
70 + /* istanbul ignore if */
71 +
72 + if ($) {
73 + const name = plugin.NAME;
74 + const JQUERY_NO_CONFLICT = $.fn[name];
75 + $.fn[name] = plugin.jQueryInterface;
76 + $.fn[name].Constructor = plugin;
77 +
78 + $.fn[name].noConflict = () => {
79 + $.fn[name] = JQUERY_NO_CONFLICT;
80 + return plugin.jQueryInterface;
81 + };
82 + }
83 + });
84 + };
85 +
86 + /**
87 + * --------------------------------------------------------------------------
88 + * Bootstrap (v5.0.1): alert.js
89 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
90 + * --------------------------------------------------------------------------
91 + */
92 + /**
93 + * ------------------------------------------------------------------------
94 + * Constants
95 + * ------------------------------------------------------------------------
96 + */
97 +
98 + const NAME = 'alert';
99 + const DATA_KEY = 'bs.alert';
100 + const EVENT_KEY = `.${DATA_KEY}`;
101 + const DATA_API_KEY = '.data-api';
102 + const SELECTOR_DISMISS = '[data-bs-dismiss="alert"]';
103 + const EVENT_CLOSE = `close${EVENT_KEY}`;
104 + const EVENT_CLOSED = `closed${EVENT_KEY}`;
105 + const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
106 + const CLASS_NAME_ALERT = 'alert';
107 + const CLASS_NAME_FADE = 'fade';
108 + const CLASS_NAME_SHOW = 'show';
109 + /**
110 + * ------------------------------------------------------------------------
111 + * Class Definition
112 + * ------------------------------------------------------------------------
113 + */
114 +
115 + class Alert extends BaseComponent__default['default'] {
116 + // Getters
117 + static get NAME() {
118 + return NAME;
119 + } // Public
120 +
121 +
122 + close(element) {
123 + const rootElement = element ? this._getRootElement(element) : this._element;
124 +
125 + const customEvent = this._triggerCloseEvent(rootElement);
126 +
127 + if (customEvent === null || customEvent.defaultPrevented) {
128 + return;
129 + }
130 +
131 + this._removeElement(rootElement);
132 + } // Private
133 +
134 +
135 + _getRootElement(element) {
136 + return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`);
137 + }
138 +
139 + _triggerCloseEvent(element) {
140 + return EventHandler__default['default'].trigger(element, EVENT_CLOSE);
141 + }
142 +
143 + _removeElement(element) {
144 + element.classList.remove(CLASS_NAME_SHOW);
145 + const isAnimated = element.classList.contains(CLASS_NAME_FADE);
146 +
147 + this._queueCallback(() => this._destroyElement(element), element, isAnimated);
148 + }
149 +
150 + _destroyElement(element) {
151 + if (element.parentNode) {
152 + element.parentNode.removeChild(element);
153 + }
154 +
155 + EventHandler__default['default'].trigger(element, EVENT_CLOSED);
156 + } // Static
157 +
158 +
159 + static jQueryInterface(config) {
160 + return this.each(function () {
161 + let data = Data__default['default'].get(this, DATA_KEY);
162 +
163 + if (!data) {
164 + data = new Alert(this);
165 + }
166 +
167 + if (config === 'close') {
168 + data[config](this);
169 + }
170 + });
171 + }
172 +
173 + static handleDismiss(alertInstance) {
174 + return function (event) {
175 + if (event) {
176 + event.preventDefault();
177 + }
178 +
179 + alertInstance.close(this);
180 + };
181 + }
182 +
183 + }
184 + /**
185 + * ------------------------------------------------------------------------
186 + * Data Api implementation
187 + * ------------------------------------------------------------------------
188 + */
189 +
190 +
191 + EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
192 + /**
193 + * ------------------------------------------------------------------------
194 + * jQuery
195 + * ------------------------------------------------------------------------
196 + * add .Alert to jQuery only if jQuery is present
197 + */
198 +
199 + defineJQueryPlugin(Alert);
200 +
201 + return Alert;
202 +
203 +})));
204 +//# sourceMappingURL=alert.js.map
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap base-component.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/selector-engine.js'), require('./dom/event-handler.js')) :
8 + typeof define === 'function' && define.amd ? define(['./dom/data', './dom/selector-engine', './dom/event-handler'], factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Base = factory(global.Data, global.SelectorEngine, global.EventHandler));
10 +}(this, (function (Data, SelectorEngine, EventHandler) { 'use strict';
11 +
12 + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13 +
14 + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15 + var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
16 + var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
17 +
18 + const MILLISECONDS_MULTIPLIER = 1000;
19 + const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
20 +
21 + const getTransitionDurationFromElement = element => {
22 + if (!element) {
23 + return 0;
24 + } // Get transition-duration of the element
25 +
26 +
27 + let {
28 + transitionDuration,
29 + transitionDelay
30 + } = window.getComputedStyle(element);
31 + const floatTransitionDuration = Number.parseFloat(transitionDuration);
32 + const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
33 +
34 + if (!floatTransitionDuration && !floatTransitionDelay) {
35 + return 0;
36 + } // If multiple durations are defined, take the first
37 +
38 +
39 + transitionDuration = transitionDuration.split(',')[0];
40 + transitionDelay = transitionDelay.split(',')[0];
41 + return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
42 + };
43 +
44 + const triggerTransitionEnd = element => {
45 + element.dispatchEvent(new Event(TRANSITION_END));
46 + };
47 +
48 + const isElement = obj => {
49 + if (!obj || typeof obj !== 'object') {
50 + return false;
51 + }
52 +
53 + if (typeof obj.jquery !== 'undefined') {
54 + obj = obj[0];
55 + }
56 +
57 + return typeof obj.nodeType !== 'undefined';
58 + };
59 +
60 + const getElement = obj => {
61 + if (isElement(obj)) {
62 + // it's a jQuery object or a node element
63 + return obj.jquery ? obj[0] : obj;
64 + }
65 +
66 + if (typeof obj === 'string' && obj.length > 0) {
67 + return SelectorEngine__default['default'].findOne(obj);
68 + }
69 +
70 + return null;
71 + };
72 +
73 + const emulateTransitionEnd = (element, duration) => {
74 + let called = false;
75 + const durationPadding = 5;
76 + const emulatedDuration = duration + durationPadding;
77 +
78 + function listener() {
79 + called = true;
80 + element.removeEventListener(TRANSITION_END, listener);
81 + }
82 +
83 + element.addEventListener(TRANSITION_END, listener);
84 + setTimeout(() => {
85 + if (!called) {
86 + triggerTransitionEnd(element);
87 + }
88 + }, emulatedDuration);
89 + };
90 +
91 + const execute = callback => {
92 + if (typeof callback === 'function') {
93 + callback();
94 + }
95 + };
96 +
97 + /**
98 + * --------------------------------------------------------------------------
99 + * Bootstrap (v5.0.1): base-component.js
100 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
101 + * --------------------------------------------------------------------------
102 + */
103 + /**
104 + * ------------------------------------------------------------------------
105 + * Constants
106 + * ------------------------------------------------------------------------
107 + */
108 +
109 + const VERSION = '5.0.1';
110 +
111 + class BaseComponent {
112 + constructor(element) {
113 + element = getElement(element);
114 +
115 + if (!element) {
116 + return;
117 + }
118 +
119 + this._element = element;
120 + Data__default['default'].set(this._element, this.constructor.DATA_KEY, this);
121 + }
122 +
123 + dispose() {
124 + Data__default['default'].remove(this._element, this.constructor.DATA_KEY);
125 + EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
126 + Object.getOwnPropertyNames(this).forEach(propertyName => {
127 + this[propertyName] = null;
128 + });
129 + }
130 +
131 + _queueCallback(callback, element, isAnimated = true) {
132 + if (!isAnimated) {
133 + execute(callback);
134 + return;
135 + }
136 +
137 + const transitionDuration = getTransitionDurationFromElement(element);
138 + EventHandler__default['default'].one(element, 'transitionend', () => execute(callback));
139 + emulateTransitionEnd(element, transitionDuration);
140 + }
141 + /** Static */
142 +
143 +
144 + static getInstance(element) {
145 + return Data__default['default'].get(element, this.DATA_KEY);
146 + }
147 +
148 + static get VERSION() {
149 + return VERSION;
150 + }
151 +
152 + static get NAME() {
153 + throw new Error('You have to implement the static method "NAME", for each component!');
154 + }
155 +
156 + static get DATA_KEY() {
157 + return `bs.${this.NAME}`;
158 + }
159 +
160 + static get EVENT_KEY() {
161 + return `.${this.DATA_KEY}`;
162 + }
163 +
164 + }
165 +
166 + return BaseComponent;
167 +
168 +})));
169 +//# sourceMappingURL=base-component.js.map
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap button.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/selector-engine.js'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./base-component.js')) :
8 + typeof define === 'function' && define.amd ? define(['./dom/selector-engine', './dom/data', './dom/event-handler', './base-component'], factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.SelectorEngine, global.Data, global.EventHandler, global.Base));
10 +}(this, (function (SelectorEngine, Data, EventHandler, BaseComponent) { 'use strict';
11 +
12 + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13 +
14 + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15 + var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16 + var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
17 +
18 + const getjQuery = () => {
19 + const {
20 + jQuery
21 + } = window;
22 +
23 + if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
24 + return jQuery;
25 + }
26 +
27 + return null;
28 + };
29 +
30 + const onDOMContentLoaded = callback => {
31 + if (document.readyState === 'loading') {
32 + document.addEventListener('DOMContentLoaded', callback);
33 + } else {
34 + callback();
35 + }
36 + };
37 +
38 + const defineJQueryPlugin = plugin => {
39 + onDOMContentLoaded(() => {
40 + const $ = getjQuery();
41 + /* istanbul ignore if */
42 +
43 + if ($) {
44 + const name = plugin.NAME;
45 + const JQUERY_NO_CONFLICT = $.fn[name];
46 + $.fn[name] = plugin.jQueryInterface;
47 + $.fn[name].Constructor = plugin;
48 +
49 + $.fn[name].noConflict = () => {
50 + $.fn[name] = JQUERY_NO_CONFLICT;
51 + return plugin.jQueryInterface;
52 + };
53 + }
54 + });
55 + };
56 +
57 + /**
58 + * --------------------------------------------------------------------------
59 + * Bootstrap (v5.0.1): button.js
60 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
61 + * --------------------------------------------------------------------------
62 + */
63 + /**
64 + * ------------------------------------------------------------------------
65 + * Constants
66 + * ------------------------------------------------------------------------
67 + */
68 +
69 + const NAME = 'button';
70 + const DATA_KEY = 'bs.button';
71 + const EVENT_KEY = `.${DATA_KEY}`;
72 + const DATA_API_KEY = '.data-api';
73 + const CLASS_NAME_ACTIVE = 'active';
74 + const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
75 + const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
76 + /**
77 + * ------------------------------------------------------------------------
78 + * Class Definition
79 + * ------------------------------------------------------------------------
80 + */
81 +
82 + class Button extends BaseComponent__default['default'] {
83 + // Getters
84 + static get NAME() {
85 + return NAME;
86 + } // Public
87 +
88 +
89 + toggle() {
90 + // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
91 + this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
92 + } // Static
93 +
94 +
95 + static jQueryInterface(config) {
96 + return this.each(function () {
97 + let data = Data__default['default'].get(this, DATA_KEY);
98 +
99 + if (!data) {
100 + data = new Button(this);
101 + }
102 +
103 + if (config === 'toggle') {
104 + data[config]();
105 + }
106 + });
107 + }
108 +
109 + }
110 + /**
111 + * ------------------------------------------------------------------------
112 + * Data Api implementation
113 + * ------------------------------------------------------------------------
114 + */
115 +
116 +
117 + EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
118 + event.preventDefault();
119 + const button = event.target.closest(SELECTOR_DATA_TOGGLE);
120 + let data = Data__default['default'].get(button, DATA_KEY);
121 +
122 + if (!data) {
123 + data = new Button(button);
124 + }
125 +
126 + data.toggle();
127 + });
128 + /**
129 + * ------------------------------------------------------------------------
130 + * jQuery
131 + * ------------------------------------------------------------------------
132 + * add .Button to jQuery only if jQuery is present
133 + */
134 +
135 + defineJQueryPlugin(Button);
136 +
137 + return Button;
138 +
139 +})));
140 +//# sourceMappingURL=button.js.map
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap data.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8 + typeof define === 'function' && define.amd ? define(factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Data = factory());
10 +}(this, (function () { 'use strict';
11 +
12 + /**
13 + * --------------------------------------------------------------------------
14 + * Bootstrap (v5.0.1): dom/data.js
15 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16 + * --------------------------------------------------------------------------
17 + */
18 +
19 + /**
20 + * ------------------------------------------------------------------------
21 + * Constants
22 + * ------------------------------------------------------------------------
23 + */
24 + const elementMap = new Map();
25 + var data = {
26 + set(element, key, instance) {
27 + if (!elementMap.has(element)) {
28 + elementMap.set(element, new Map());
29 + }
30 +
31 + const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
32 + // can be removed later when multiple key/instances are fine to be used
33 +
34 + if (!instanceMap.has(key) && instanceMap.size !== 0) {
35 + // eslint-disable-next-line no-console
36 + console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
37 + return;
38 + }
39 +
40 + instanceMap.set(key, instance);
41 + },
42 +
43 + get(element, key) {
44 + if (elementMap.has(element)) {
45 + return elementMap.get(element).get(key) || null;
46 + }
47 +
48 + return null;
49 + },
50 +
51 + remove(element, key) {
52 + if (!elementMap.has(element)) {
53 + return;
54 + }
55 +
56 + const instanceMap = elementMap.get(element);
57 + instanceMap.delete(key); // free up element references if there are no instances left for an element
58 +
59 + if (instanceMap.size === 0) {
60 + elementMap.delete(element);
61 + }
62 + }
63 +
64 + };
65 +
66 + return data;
67 +
68 +})));
69 +//# sourceMappingURL=data.js.map
1 +{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n"],"names":["elementMap","Map","set","element","key","instance","has","instanceMap","get","size","console","error","Array","from","keys","remove","delete"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,UAAU,GAAG,IAAIC,GAAJ,EAAnB;AAEA,aAAe;EACbC,EAAAA,GAAG,CAACC,OAAD,EAAUC,GAAV,EAAeC,QAAf,EAAyB;EAC1B,QAAI,CAACL,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5BH,MAAAA,UAAU,CAACE,GAAX,CAAeC,OAAf,EAAwB,IAAIF,GAAJ,EAAxB;EACD;;EAED,UAAMM,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB,CAL0B;EAQ1B;;EACA,QAAI,CAACI,WAAW,CAACD,GAAZ,CAAgBF,GAAhB,CAAD,IAAyBG,WAAW,CAACE,IAAZ,KAAqB,CAAlD,EAAqD;EACnD;EACAC,MAAAA,OAAO,CAACC,KAAR,CAAe,+EAA8EC,KAAK,CAACC,IAAN,CAAWN,WAAW,CAACO,IAAZ,EAAX,EAA+B,CAA/B,CAAkC,GAA/H;EACA;EACD;;EAEDP,IAAAA,WAAW,CAACL,GAAZ,CAAgBE,GAAhB,EAAqBC,QAArB;EACD,GAjBY;;EAmBbG,EAAAA,GAAG,CAACL,OAAD,EAAUC,GAAV,EAAe;EAChB,QAAIJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAJ,EAA6B;EAC3B,aAAOH,UAAU,CAACQ,GAAX,CAAeL,OAAf,EAAwBK,GAAxB,CAA4BJ,GAA5B,KAAoC,IAA3C;EACD;;EAED,WAAO,IAAP;EACD,GAzBY;;EA2BbW,EAAAA,MAAM,CAACZ,OAAD,EAAUC,GAAV,EAAe;EACnB,QAAI,CAACJ,UAAU,CAACM,GAAX,CAAeH,OAAf,CAAL,EAA8B;EAC5B;EACD;;EAED,UAAMI,WAAW,GAAGP,UAAU,CAACQ,GAAX,CAAeL,OAAf,CAApB;EAEAI,IAAAA,WAAW,CAACS,MAAZ,CAAmBZ,GAAnB,EAPmB;;EAUnB,QAAIG,WAAW,CAACE,IAAZ,KAAqB,CAAzB,EAA4B;EAC1BT,MAAAA,UAAU,CAACgB,MAAX,CAAkBb,OAAlB;EACD;EACF;;EAxCY,CAAf;;;;;;;;"}
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap manipulator.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8 + typeof define === 'function' && define.amd ? define(factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Manipulator = factory());
10 +}(this, (function () { 'use strict';
11 +
12 + /**
13 + * --------------------------------------------------------------------------
14 + * Bootstrap (v5.0.1): dom/manipulator.js
15 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16 + * --------------------------------------------------------------------------
17 + */
18 + function normalizeData(val) {
19 + if (val === 'true') {
20 + return true;
21 + }
22 +
23 + if (val === 'false') {
24 + return false;
25 + }
26 +
27 + if (val === Number(val).toString()) {
28 + return Number(val);
29 + }
30 +
31 + if (val === '' || val === 'null') {
32 + return null;
33 + }
34 +
35 + return val;
36 + }
37 +
38 + function normalizeDataKey(key) {
39 + return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
40 + }
41 +
42 + const Manipulator = {
43 + setDataAttribute(element, key, value) {
44 + element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
45 + },
46 +
47 + removeDataAttribute(element, key) {
48 + element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
49 + },
50 +
51 + getDataAttributes(element) {
52 + if (!element) {
53 + return {};
54 + }
55 +
56 + const attributes = {};
57 + Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
58 + let pureKey = key.replace(/^bs/, '');
59 + pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
60 + attributes[pureKey] = normalizeData(element.dataset[key]);
61 + });
62 + return attributes;
63 + },
64 +
65 + getDataAttribute(element, key) {
66 + return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
67 + },
68 +
69 + offset(element) {
70 + const rect = element.getBoundingClientRect();
71 + return {
72 + top: rect.top + document.body.scrollTop,
73 + left: rect.left + document.body.scrollLeft
74 + };
75 + },
76 +
77 + position(element) {
78 + return {
79 + top: element.offsetTop,
80 + left: element.offsetLeft
81 + };
82 + }
83 +
84 + };
85 +
86 + return Manipulator;
87 +
88 +})));
89 +//# sourceMappingURL=manipulator.js.map
1 +{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","Object","keys","dataset","filter","startsWith","forEach","pureKey","charAt","slice","length","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAEA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsBC,GAAG,IAAK,IAAGA,GAAG,CAACC,WAAJ,EAAkB,EAAnD,CAAP;EACD;;QAEKC,WAAW,GAAG;EAClBC,EAAAA,gBAAgB,CAACC,OAAD,EAAUN,GAAV,EAAeO,KAAf,EAAsB;EACpCD,IAAAA,OAAO,CAACE,YAAR,CAAsB,WAAUT,gBAAgB,CAACC,GAAD,CAAM,EAAtD,EAAyDO,KAAzD;EACD,GAHiB;;EAKlBE,EAAAA,mBAAmB,CAACH,OAAD,EAAUN,GAAV,EAAe;EAChCM,IAAAA,OAAO,CAACI,eAAR,CAAyB,WAAUX,gBAAgB,CAACC,GAAD,CAAM,EAAzD;EACD,GAPiB;;EASlBW,EAAAA,iBAAiB,CAACL,OAAD,EAAU;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,UAAMM,UAAU,GAAG,EAAnB;EAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYR,OAAO,CAACS,OAApB,EACGC,MADH,CACUhB,GAAG,IAAIA,GAAG,CAACiB,UAAJ,CAAe,IAAf,CADjB,EAEGC,OAFH,CAEWlB,GAAG,IAAI;EACd,UAAImB,OAAO,GAAGnB,GAAG,CAACC,OAAJ,CAAY,KAAZ,EAAmB,EAAnB,CAAd;EACAkB,MAAAA,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,CAAf,EAAkBjB,WAAlB,KAAkCgB,OAAO,CAACE,KAAR,CAAc,CAAd,EAAiBF,OAAO,CAACG,MAAzB,CAA5C;EACAV,MAAAA,UAAU,CAACO,OAAD,CAAV,GAAsBxB,aAAa,CAACW,OAAO,CAACS,OAAR,CAAgBf,GAAhB,CAAD,CAAnC;EACD,KANH;EAQA,WAAOY,UAAP;EACD,GAzBiB;;EA2BlBW,EAAAA,gBAAgB,CAACjB,OAAD,EAAUN,GAAV,EAAe;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACkB,YAAR,CAAsB,WAAUzB,gBAAgB,CAACC,GAAD,CAAM,EAAtD,CAAD,CAApB;EACD,GA7BiB;;EA+BlByB,EAAAA,MAAM,CAACnB,OAAD,EAAU;EACd,UAAMoB,IAAI,GAAGpB,OAAO,CAACqB,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GAtCiB;;EAwClBC,EAAAA,QAAQ,CAAC5B,OAAD,EAAU;EAChB,WAAO;EACLsB,MAAAA,GAAG,EAAEtB,OAAO,CAAC6B,SADR;EAELH,MAAAA,IAAI,EAAE1B,OAAO,CAAC8B;EAFT,KAAP;EAID;;EA7CiB;;;;;;;;"}
...\ No newline at end of file ...\ No newline at end of file
1 +/*!
2 + * Bootstrap selector-engine.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8 + typeof define === 'function' && define.amd ? define(factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory());
10 +}(this, (function () { 'use strict';
11 +
12 + /**
13 + * --------------------------------------------------------------------------
14 + * Bootstrap (v5.0.1): dom/selector-engine.js
15 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
16 + * --------------------------------------------------------------------------
17 + */
18 +
19 + /**
20 + * ------------------------------------------------------------------------
21 + * Constants
22 + * ------------------------------------------------------------------------
23 + */
24 + const NODE_TEXT = 3;
25 + const SelectorEngine = {
26 + find(selector, element = document.documentElement) {
27 + return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
28 + },
29 +
30 + findOne(selector, element = document.documentElement) {
31 + return Element.prototype.querySelector.call(element, selector);
32 + },
33 +
34 + children(element, selector) {
35 + return [].concat(...element.children).filter(child => child.matches(selector));
36 + },
37 +
38 + parents(element, selector) {
39 + const parents = [];
40 + let ancestor = element.parentNode;
41 +
42 + while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
43 + if (ancestor.matches(selector)) {
44 + parents.push(ancestor);
45 + }
46 +
47 + ancestor = ancestor.parentNode;
48 + }
49 +
50 + return parents;
51 + },
52 +
53 + prev(element, selector) {
54 + let previous = element.previousElementSibling;
55 +
56 + while (previous) {
57 + if (previous.matches(selector)) {
58 + return [previous];
59 + }
60 +
61 + previous = previous.previousElementSibling;
62 + }
63 +
64 + return [];
65 + },
66 +
67 + next(element, selector) {
68 + let next = element.nextElementSibling;
69 +
70 + while (next) {
71 + if (next.matches(selector)) {
72 + return [next];
73 + }
74 +
75 + next = next.nextElementSibling;
76 + }
77 +
78 + return [];
79 + }
80 +
81 + };
82 +
83 + return SelectorEngine;
84 +
85 +})));
86 +//# sourceMappingURL=selector-engine.js.map
1 +{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.1): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children)\n .filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","find","selector","element","document","documentElement","concat","Element","prototype","querySelectorAll","call","findOne","querySelector","children","filter","child","matches","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EAEA,MAAMA,SAAS,GAAG,CAAlB;QAEMC,cAAc,GAAG;EACrBC,EAAAA,IAAI,CAACC,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACjD,WAAO,GAAGC,MAAH,CAAU,GAAGC,OAAO,CAACC,SAAR,CAAkBC,gBAAlB,CAAmCC,IAAnC,CAAwCP,OAAxC,EAAiDD,QAAjD,CAAb,CAAP;EACD,GAHoB;;EAKrBS,EAAAA,OAAO,CAACT,QAAD,EAAWC,OAAO,GAAGC,QAAQ,CAACC,eAA9B,EAA+C;EACpD,WAAOE,OAAO,CAACC,SAAR,CAAkBI,aAAlB,CAAgCF,IAAhC,CAAqCP,OAArC,EAA8CD,QAA9C,CAAP;EACD,GAPoB;;EASrBW,EAAAA,QAAQ,CAACV,OAAD,EAAUD,QAAV,EAAoB;EAC1B,WAAO,GAAGI,MAAH,CAAU,GAAGH,OAAO,CAACU,QAArB,EACJC,MADI,CACGC,KAAK,IAAIA,KAAK,CAACC,OAAN,CAAcd,QAAd,CADZ,CAAP;EAED,GAZoB;;EAcrBe,EAAAA,OAAO,CAACd,OAAD,EAAUD,QAAV,EAAoB;EACzB,UAAMe,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGf,OAAO,CAACgB,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBrB,SAApF,EAA+F;EAC7F,UAAImB,QAAQ,CAACF,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9Be,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GA5BoB;;EA8BrBO,EAAAA,IAAI,CAACrB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIuB,QAAQ,GAAGtB,OAAO,CAACuB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACT,OAAT,CAAiBd,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACuB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA1CoB;;EA4CrBC,EAAAA,IAAI,CAACxB,OAAD,EAAUD,QAAV,EAAoB;EACtB,QAAIyB,IAAI,GAAGxB,OAAO,CAACyB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAIA,IAAI,CAACX,OAAL,CAAad,QAAb,CAAJ,EAA4B;EAC1B,eAAO,CAACyB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;;EAxDoB;;;;;;;;"}
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap popover.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/selector-engine.js'), require('./dom/data.js'), require('./tooltip.js')) :
8 + typeof define === 'function' && define.amd ? define(['./dom/selector-engine', './dom/data', './tooltip'], factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.SelectorEngine, global.Data, global.Tooltip));
10 +}(this, (function (SelectorEngine, Data, Tooltip) { 'use strict';
11 +
12 + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13 +
14 + var SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
15 + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
16 + var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
17 +
18 + const getjQuery = () => {
19 + const {
20 + jQuery
21 + } = window;
22 +
23 + if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
24 + return jQuery;
25 + }
26 +
27 + return null;
28 + };
29 +
30 + const onDOMContentLoaded = callback => {
31 + if (document.readyState === 'loading') {
32 + document.addEventListener('DOMContentLoaded', callback);
33 + } else {
34 + callback();
35 + }
36 + };
37 +
38 + const defineJQueryPlugin = plugin => {
39 + onDOMContentLoaded(() => {
40 + const $ = getjQuery();
41 + /* istanbul ignore if */
42 +
43 + if ($) {
44 + const name = plugin.NAME;
45 + const JQUERY_NO_CONFLICT = $.fn[name];
46 + $.fn[name] = plugin.jQueryInterface;
47 + $.fn[name].Constructor = plugin;
48 +
49 + $.fn[name].noConflict = () => {
50 + $.fn[name] = JQUERY_NO_CONFLICT;
51 + return plugin.jQueryInterface;
52 + };
53 + }
54 + });
55 + };
56 +
57 + /**
58 + * --------------------------------------------------------------------------
59 + * Bootstrap (v5.0.1): popover.js
60 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
61 + * --------------------------------------------------------------------------
62 + */
63 + /**
64 + * ------------------------------------------------------------------------
65 + * Constants
66 + * ------------------------------------------------------------------------
67 + */
68 +
69 + const NAME = 'popover';
70 + const DATA_KEY = 'bs.popover';
71 + const EVENT_KEY = `.${DATA_KEY}`;
72 + const CLASS_PREFIX = 'bs-popover';
73 + const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
74 + const Default = { ...Tooltip__default['default'].Default,
75 + placement: 'right',
76 + offset: [0, 8],
77 + trigger: 'click',
78 + content: '',
79 + template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
80 + };
81 + const DefaultType = { ...Tooltip__default['default'].DefaultType,
82 + content: '(string|element|function)'
83 + };
84 + const Event = {
85 + HIDE: `hide${EVENT_KEY}`,
86 + HIDDEN: `hidden${EVENT_KEY}`,
87 + SHOW: `show${EVENT_KEY}`,
88 + SHOWN: `shown${EVENT_KEY}`,
89 + INSERTED: `inserted${EVENT_KEY}`,
90 + CLICK: `click${EVENT_KEY}`,
91 + FOCUSIN: `focusin${EVENT_KEY}`,
92 + FOCUSOUT: `focusout${EVENT_KEY}`,
93 + MOUSEENTER: `mouseenter${EVENT_KEY}`,
94 + MOUSELEAVE: `mouseleave${EVENT_KEY}`
95 + };
96 + const CLASS_NAME_FADE = 'fade';
97 + const CLASS_NAME_SHOW = 'show';
98 + const SELECTOR_TITLE = '.popover-header';
99 + const SELECTOR_CONTENT = '.popover-body';
100 + /**
101 + * ------------------------------------------------------------------------
102 + * Class Definition
103 + * ------------------------------------------------------------------------
104 + */
105 +
106 + class Popover extends Tooltip__default['default'] {
107 + // Getters
108 + static get Default() {
109 + return Default;
110 + }
111 +
112 + static get NAME() {
113 + return NAME;
114 + }
115 +
116 + static get Event() {
117 + return Event;
118 + }
119 +
120 + static get DefaultType() {
121 + return DefaultType;
122 + } // Overrides
123 +
124 +
125 + isWithContent() {
126 + return this.getTitle() || this._getContent();
127 + }
128 +
129 + setContent() {
130 + const tip = this.getTipElement(); // we use append for html objects to maintain js events
131 +
132 + this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_TITLE, tip), this.getTitle());
133 +
134 + let content = this._getContent();
135 +
136 + if (typeof content === 'function') {
137 + content = content.call(this._element);
138 + }
139 +
140 + this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, tip), content);
141 + tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
142 + } // Private
143 +
144 +
145 + _addAttachmentClass(attachment) {
146 + this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
147 + }
148 +
149 + _getContent() {
150 + return this._element.getAttribute('data-bs-content') || this._config.content;
151 + }
152 +
153 + _cleanTipClass() {
154 + const tip = this.getTipElement();
155 + const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
156 +
157 + if (tabClass !== null && tabClass.length > 0) {
158 + tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
159 + }
160 + } // Static
161 +
162 +
163 + static jQueryInterface(config) {
164 + return this.each(function () {
165 + let data = Data__default['default'].get(this, DATA_KEY);
166 +
167 + const _config = typeof config === 'object' ? config : null;
168 +
169 + if (!data && /dispose|hide/.test(config)) {
170 + return;
171 + }
172 +
173 + if (!data) {
174 + data = new Popover(this, _config);
175 + Data__default['default'].set(this, DATA_KEY, data);
176 + }
177 +
178 + if (typeof config === 'string') {
179 + if (typeof data[config] === 'undefined') {
180 + throw new TypeError(`No method named "${config}"`);
181 + }
182 +
183 + data[config]();
184 + }
185 + });
186 + }
187 +
188 + }
189 + /**
190 + * ------------------------------------------------------------------------
191 + * jQuery
192 + * ------------------------------------------------------------------------
193 + * add .Popover to jQuery only if jQuery is present
194 + */
195 +
196 +
197 + defineJQueryPlugin(Popover);
198 +
199 + return Popover;
200 +
201 +})));
202 +//# sourceMappingURL=popover.js.map
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/*!
2 + * Bootstrap toast.js v5.0.1 (https://getbootstrap.com/)
3 + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + */
6 +(function (global, factory) {
7 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./base-component.js')) :
8 + typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './base-component'], factory) :
9 + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.Data, global.EventHandler, global.Manipulator, global.Base));
10 +}(this, (function (Data, EventHandler, Manipulator, BaseComponent) { 'use strict';
11 +
12 + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13 +
14 + var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
15 + var EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
16 + var Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
17 + var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
18 +
19 + const toType = obj => {
20 + if (obj === null || obj === undefined) {
21 + return `${obj}`;
22 + }
23 +
24 + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
25 + };
26 +
27 + const isElement = obj => {
28 + if (!obj || typeof obj !== 'object') {
29 + return false;
30 + }
31 +
32 + if (typeof obj.jquery !== 'undefined') {
33 + obj = obj[0];
34 + }
35 +
36 + return typeof obj.nodeType !== 'undefined';
37 + };
38 +
39 + const typeCheckConfig = (componentName, config, configTypes) => {
40 + Object.keys(configTypes).forEach(property => {
41 + const expectedTypes = configTypes[property];
42 + const value = config[property];
43 + const valueType = value && isElement(value) ? 'element' : toType(value);
44 +
45 + if (!new RegExp(expectedTypes).test(valueType)) {
46 + throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
47 + }
48 + });
49 + };
50 +
51 + const reflow = element => element.offsetHeight;
52 +
53 + const getjQuery = () => {
54 + const {
55 + jQuery
56 + } = window;
57 +
58 + if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
59 + return jQuery;
60 + }
61 +
62 + return null;
63 + };
64 +
65 + const onDOMContentLoaded = callback => {
66 + if (document.readyState === 'loading') {
67 + document.addEventListener('DOMContentLoaded', callback);
68 + } else {
69 + callback();
70 + }
71 + };
72 +
73 + const defineJQueryPlugin = plugin => {
74 + onDOMContentLoaded(() => {
75 + const $ = getjQuery();
76 + /* istanbul ignore if */
77 +
78 + if ($) {
79 + const name = plugin.NAME;
80 + const JQUERY_NO_CONFLICT = $.fn[name];
81 + $.fn[name] = plugin.jQueryInterface;
82 + $.fn[name].Constructor = plugin;
83 +
84 + $.fn[name].noConflict = () => {
85 + $.fn[name] = JQUERY_NO_CONFLICT;
86 + return plugin.jQueryInterface;
87 + };
88 + }
89 + });
90 + };
91 +
92 + /**
93 + * --------------------------------------------------------------------------
94 + * Bootstrap (v5.0.1): toast.js
95 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
96 + * --------------------------------------------------------------------------
97 + */
98 + /**
99 + * ------------------------------------------------------------------------
100 + * Constants
101 + * ------------------------------------------------------------------------
102 + */
103 +
104 + const NAME = 'toast';
105 + const DATA_KEY = 'bs.toast';
106 + const EVENT_KEY = `.${DATA_KEY}`;
107 + const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
108 + const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
109 + const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
110 + const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
111 + const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`;
112 + const EVENT_HIDE = `hide${EVENT_KEY}`;
113 + const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
114 + const EVENT_SHOW = `show${EVENT_KEY}`;
115 + const EVENT_SHOWN = `shown${EVENT_KEY}`;
116 + const CLASS_NAME_FADE = 'fade';
117 + const CLASS_NAME_HIDE = 'hide';
118 + const CLASS_NAME_SHOW = 'show';
119 + const CLASS_NAME_SHOWING = 'showing';
120 + const DefaultType = {
121 + animation: 'boolean',
122 + autohide: 'boolean',
123 + delay: 'number'
124 + };
125 + const Default = {
126 + animation: true,
127 + autohide: true,
128 + delay: 5000
129 + };
130 + const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
131 + /**
132 + * ------------------------------------------------------------------------
133 + * Class Definition
134 + * ------------------------------------------------------------------------
135 + */
136 +
137 + class Toast extends BaseComponent__default['default'] {
138 + constructor(element, config) {
139 + super(element);
140 + this._config = this._getConfig(config);
141 + this._timeout = null;
142 + this._hasMouseInteraction = false;
143 + this._hasKeyboardInteraction = false;
144 +
145 + this._setListeners();
146 + } // Getters
147 +
148 +
149 + static get DefaultType() {
150 + return DefaultType;
151 + }
152 +
153 + static get Default() {
154 + return Default;
155 + }
156 +
157 + static get NAME() {
158 + return NAME;
159 + } // Public
160 +
161 +
162 + show() {
163 + const showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
164 +
165 + if (showEvent.defaultPrevented) {
166 + return;
167 + }
168 +
169 + this._clearTimeout();
170 +
171 + if (this._config.animation) {
172 + this._element.classList.add(CLASS_NAME_FADE);
173 + }
174 +
175 + const complete = () => {
176 + this._element.classList.remove(CLASS_NAME_SHOWING);
177 +
178 + this._element.classList.add(CLASS_NAME_SHOW);
179 +
180 + EventHandler__default['default'].trigger(this._element, EVENT_SHOWN);
181 +
182 + this._maybeScheduleHide();
183 + };
184 +
185 + this._element.classList.remove(CLASS_NAME_HIDE);
186 +
187 + reflow(this._element);
188 +
189 + this._element.classList.add(CLASS_NAME_SHOWING);
190 +
191 + this._queueCallback(complete, this._element, this._config.animation);
192 + }
193 +
194 + hide() {
195 + if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
196 + return;
197 + }
198 +
199 + const hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
200 +
201 + if (hideEvent.defaultPrevented) {
202 + return;
203 + }
204 +
205 + const complete = () => {
206 + this._element.classList.add(CLASS_NAME_HIDE);
207 +
208 + EventHandler__default['default'].trigger(this._element, EVENT_HIDDEN);
209 + };
210 +
211 + this._element.classList.remove(CLASS_NAME_SHOW);
212 +
213 + this._queueCallback(complete, this._element, this._config.animation);
214 + }
215 +
216 + dispose() {
217 + this._clearTimeout();
218 +
219 + if (this._element.classList.contains(CLASS_NAME_SHOW)) {
220 + this._element.classList.remove(CLASS_NAME_SHOW);
221 + }
222 +
223 + super.dispose();
224 + } // Private
225 +
226 +
227 + _getConfig(config) {
228 + config = { ...Default,
229 + ...Manipulator__default['default'].getDataAttributes(this._element),
230 + ...(typeof config === 'object' && config ? config : {})
231 + };
232 + typeCheckConfig(NAME, config, this.constructor.DefaultType);
233 + return config;
234 + }
235 +
236 + _maybeScheduleHide() {
237 + if (!this._config.autohide) {
238 + return;
239 + }
240 +
241 + if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
242 + return;
243 + }
244 +
245 + this._timeout = setTimeout(() => {
246 + this.hide();
247 + }, this._config.delay);
248 + }
249 +
250 + _onInteraction(event, isInteracting) {
251 + switch (event.type) {
252 + case 'mouseover':
253 + case 'mouseout':
254 + this._hasMouseInteraction = isInteracting;
255 + break;
256 +
257 + case 'focusin':
258 + case 'focusout':
259 + this._hasKeyboardInteraction = isInteracting;
260 + break;
261 + }
262 +
263 + if (isInteracting) {
264 + this._clearTimeout();
265 +
266 + return;
267 + }
268 +
269 + const nextElement = event.relatedTarget;
270 +
271 + if (this._element === nextElement || this._element.contains(nextElement)) {
272 + return;
273 + }
274 +
275 + this._maybeScheduleHide();
276 + }
277 +
278 + _setListeners() {
279 + EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
280 + EventHandler__default['default'].on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
281 + EventHandler__default['default'].on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
282 + EventHandler__default['default'].on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
283 + EventHandler__default['default'].on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false));
284 + }
285 +
286 + _clearTimeout() {
287 + clearTimeout(this._timeout);
288 + this._timeout = null;
289 + } // Static
290 +
291 +
292 + static jQueryInterface(config) {
293 + return this.each(function () {
294 + let data = Data__default['default'].get(this, DATA_KEY);
295 +
296 + const _config = typeof config === 'object' && config;
297 +
298 + if (!data) {
299 + data = new Toast(this, _config);
300 + }
301 +
302 + if (typeof config === 'string') {
303 + if (typeof data[config] === 'undefined') {
304 + throw new TypeError(`No method named "${config}"`);
305 + }
306 +
307 + data[config](this);
308 + }
309 + });
310 + }
311 +
312 + }
313 + /**
314 + * ------------------------------------------------------------------------
315 + * jQuery
316 + * ------------------------------------------------------------------------
317 + * add .Toast to jQuery only if jQuery is present
318 + */
319 +
320 +
321 + defineJQueryPlugin(Toast);
322 +
323 + return Toast;
324 +
325 +})));
326 +//# sourceMappingURL=toast.js.map
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): alert.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + getElementFromSelector
11 +} from './util/index'
12 +import Data from './dom/data'
13 +import EventHandler from './dom/event-handler'
14 +import BaseComponent from './base-component'
15 +
16 +/**
17 + * ------------------------------------------------------------------------
18 + * Constants
19 + * ------------------------------------------------------------------------
20 + */
21 +
22 +const NAME = 'alert'
23 +const DATA_KEY = 'bs.alert'
24 +const EVENT_KEY = `.${DATA_KEY}`
25 +const DATA_API_KEY = '.data-api'
26 +
27 +const SELECTOR_DISMISS = '[data-bs-dismiss="alert"]'
28 +
29 +const EVENT_CLOSE = `close${EVENT_KEY}`
30 +const EVENT_CLOSED = `closed${EVENT_KEY}`
31 +const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
32 +
33 +const CLASS_NAME_ALERT = 'alert'
34 +const CLASS_NAME_FADE = 'fade'
35 +const CLASS_NAME_SHOW = 'show'
36 +
37 +/**
38 + * ------------------------------------------------------------------------
39 + * Class Definition
40 + * ------------------------------------------------------------------------
41 + */
42 +
43 +class Alert extends BaseComponent {
44 + // Getters
45 +
46 + static get NAME() {
47 + return NAME
48 + }
49 +
50 + // Public
51 +
52 + close(element) {
53 + const rootElement = element ? this._getRootElement(element) : this._element
54 + const customEvent = this._triggerCloseEvent(rootElement)
55 +
56 + if (customEvent === null || customEvent.defaultPrevented) {
57 + return
58 + }
59 +
60 + this._removeElement(rootElement)
61 + }
62 +
63 + // Private
64 +
65 + _getRootElement(element) {
66 + return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`)
67 + }
68 +
69 + _triggerCloseEvent(element) {
70 + return EventHandler.trigger(element, EVENT_CLOSE)
71 + }
72 +
73 + _removeElement(element) {
74 + element.classList.remove(CLASS_NAME_SHOW)
75 +
76 + const isAnimated = element.classList.contains(CLASS_NAME_FADE)
77 + this._queueCallback(() => this._destroyElement(element), element, isAnimated)
78 + }
79 +
80 + _destroyElement(element) {
81 + if (element.parentNode) {
82 + element.parentNode.removeChild(element)
83 + }
84 +
85 + EventHandler.trigger(element, EVENT_CLOSED)
86 + }
87 +
88 + // Static
89 +
90 + static jQueryInterface(config) {
91 + return this.each(function () {
92 + let data = Data.get(this, DATA_KEY)
93 +
94 + if (!data) {
95 + data = new Alert(this)
96 + }
97 +
98 + if (config === 'close') {
99 + data[config](this)
100 + }
101 + })
102 + }
103 +
104 + static handleDismiss(alertInstance) {
105 + return function (event) {
106 + if (event) {
107 + event.preventDefault()
108 + }
109 +
110 + alertInstance.close(this)
111 + }
112 + }
113 +}
114 +
115 +/**
116 + * ------------------------------------------------------------------------
117 + * Data Api implementation
118 + * ------------------------------------------------------------------------
119 + */
120 +
121 +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()))
122 +
123 +/**
124 + * ------------------------------------------------------------------------
125 + * jQuery
126 + * ------------------------------------------------------------------------
127 + * add .Alert to jQuery only if jQuery is present
128 + */
129 +
130 +defineJQueryPlugin(Alert)
131 +
132 +export default Alert
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): base-component.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import Data from './dom/data'
9 +import {
10 + emulateTransitionEnd,
11 + execute,
12 + getElement,
13 + getTransitionDurationFromElement
14 +} from './util/index'
15 +import EventHandler from './dom/event-handler'
16 +
17 +/**
18 + * ------------------------------------------------------------------------
19 + * Constants
20 + * ------------------------------------------------------------------------
21 + */
22 +
23 +const VERSION = '5.0.1'
24 +
25 +class BaseComponent {
26 + constructor(element) {
27 + element = getElement(element)
28 +
29 + if (!element) {
30 + return
31 + }
32 +
33 + this._element = element
34 + Data.set(this._element, this.constructor.DATA_KEY, this)
35 + }
36 +
37 + dispose() {
38 + Data.remove(this._element, this.constructor.DATA_KEY)
39 + EventHandler.off(this._element, this.constructor.EVENT_KEY)
40 +
41 + Object.getOwnPropertyNames(this).forEach(propertyName => {
42 + this[propertyName] = null
43 + })
44 + }
45 +
46 + _queueCallback(callback, element, isAnimated = true) {
47 + if (!isAnimated) {
48 + execute(callback)
49 + return
50 + }
51 +
52 + const transitionDuration = getTransitionDurationFromElement(element)
53 + EventHandler.one(element, 'transitionend', () => execute(callback))
54 +
55 + emulateTransitionEnd(element, transitionDuration)
56 + }
57 +
58 + /** Static */
59 +
60 + static getInstance(element) {
61 + return Data.get(element, this.DATA_KEY)
62 + }
63 +
64 + static get VERSION() {
65 + return VERSION
66 + }
67 +
68 + static get NAME() {
69 + throw new Error('You have to implement the static method "NAME", for each component!')
70 + }
71 +
72 + static get DATA_KEY() {
73 + return `bs.${this.NAME}`
74 + }
75 +
76 + static get EVENT_KEY() {
77 + return `.${this.DATA_KEY}`
78 + }
79 +}
80 +
81 +export default BaseComponent
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): button.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import { defineJQueryPlugin } from './util/index'
9 +import Data from './dom/data'
10 +import EventHandler from './dom/event-handler'
11 +import BaseComponent from './base-component'
12 +
13 +/**
14 + * ------------------------------------------------------------------------
15 + * Constants
16 + * ------------------------------------------------------------------------
17 + */
18 +
19 +const NAME = 'button'
20 +const DATA_KEY = 'bs.button'
21 +const EVENT_KEY = `.${DATA_KEY}`
22 +const DATA_API_KEY = '.data-api'
23 +
24 +const CLASS_NAME_ACTIVE = 'active'
25 +
26 +const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]'
27 +
28 +const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
29 +
30 +/**
31 + * ------------------------------------------------------------------------
32 + * Class Definition
33 + * ------------------------------------------------------------------------
34 + */
35 +
36 +class Button extends BaseComponent {
37 + // Getters
38 +
39 + static get NAME() {
40 + return NAME
41 + }
42 +
43 + // Public
44 +
45 + toggle() {
46 + // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
47 + this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))
48 + }
49 +
50 + // Static
51 +
52 + static jQueryInterface(config) {
53 + return this.each(function () {
54 + let data = Data.get(this, DATA_KEY)
55 +
56 + if (!data) {
57 + data = new Button(this)
58 + }
59 +
60 + if (config === 'toggle') {
61 + data[config]()
62 + }
63 + })
64 + }
65 +}
66 +
67 +/**
68 + * ------------------------------------------------------------------------
69 + * Data Api implementation
70 + * ------------------------------------------------------------------------
71 + */
72 +
73 +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
74 + event.preventDefault()
75 +
76 + const button = event.target.closest(SELECTOR_DATA_TOGGLE)
77 +
78 + let data = Data.get(button, DATA_KEY)
79 + if (!data) {
80 + data = new Button(button)
81 + }
82 +
83 + data.toggle()
84 +})
85 +
86 +/**
87 + * ------------------------------------------------------------------------
88 + * jQuery
89 + * ------------------------------------------------------------------------
90 + * add .Button to jQuery only if jQuery is present
91 + */
92 +
93 +defineJQueryPlugin(Button)
94 +
95 +export default Button
This diff is collapsed. Click to expand it.
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): collapse.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + getElement,
11 + getSelectorFromElement,
12 + getElementFromSelector,
13 + reflow,
14 + typeCheckConfig
15 +} from './util/index'
16 +import Data from './dom/data'
17 +import EventHandler from './dom/event-handler'
18 +import Manipulator from './dom/manipulator'
19 +import SelectorEngine from './dom/selector-engine'
20 +import BaseComponent from './base-component'
21 +
22 +/**
23 + * ------------------------------------------------------------------------
24 + * Constants
25 + * ------------------------------------------------------------------------
26 + */
27 +
28 +const NAME = 'collapse'
29 +const DATA_KEY = 'bs.collapse'
30 +const EVENT_KEY = `.${DATA_KEY}`
31 +const DATA_API_KEY = '.data-api'
32 +
33 +const Default = {
34 + toggle: true,
35 + parent: ''
36 +}
37 +
38 +const DefaultType = {
39 + toggle: 'boolean',
40 + parent: '(string|element)'
41 +}
42 +
43 +const EVENT_SHOW = `show${EVENT_KEY}`
44 +const EVENT_SHOWN = `shown${EVENT_KEY}`
45 +const EVENT_HIDE = `hide${EVENT_KEY}`
46 +const EVENT_HIDDEN = `hidden${EVENT_KEY}`
47 +const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
48 +
49 +const CLASS_NAME_SHOW = 'show'
50 +const CLASS_NAME_COLLAPSE = 'collapse'
51 +const CLASS_NAME_COLLAPSING = 'collapsing'
52 +const CLASS_NAME_COLLAPSED = 'collapsed'
53 +
54 +const WIDTH = 'width'
55 +const HEIGHT = 'height'
56 +
57 +const SELECTOR_ACTIVES = '.show, .collapsing'
58 +const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]'
59 +
60 +/**
61 + * ------------------------------------------------------------------------
62 + * Class Definition
63 + * ------------------------------------------------------------------------
64 + */
65 +
66 +class Collapse extends BaseComponent {
67 + constructor(element, config) {
68 + super(element)
69 +
70 + this._isTransitioning = false
71 + this._config = this._getConfig(config)
72 + this._triggerArray = SelectorEngine.find(
73 + `${SELECTOR_DATA_TOGGLE}[href="#${this._element.id}"],` +
74 + `${SELECTOR_DATA_TOGGLE}[data-bs-target="#${this._element.id}"]`
75 + )
76 +
77 + const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)
78 +
79 + for (let i = 0, len = toggleList.length; i < len; i++) {
80 + const elem = toggleList[i]
81 + const selector = getSelectorFromElement(elem)
82 + const filterElement = SelectorEngine.find(selector)
83 + .filter(foundElem => foundElem === this._element)
84 +
85 + if (selector !== null && filterElement.length) {
86 + this._selector = selector
87 + this._triggerArray.push(elem)
88 + }
89 + }
90 +
91 + this._parent = this._config.parent ? this._getParent() : null
92 +
93 + if (!this._config.parent) {
94 + this._addAriaAndCollapsedClass(this._element, this._triggerArray)
95 + }
96 +
97 + if (this._config.toggle) {
98 + this.toggle()
99 + }
100 + }
101 +
102 + // Getters
103 +
104 + static get Default() {
105 + return Default
106 + }
107 +
108 + static get NAME() {
109 + return NAME
110 + }
111 +
112 + // Public
113 +
114 + toggle() {
115 + if (this._element.classList.contains(CLASS_NAME_SHOW)) {
116 + this.hide()
117 + } else {
118 + this.show()
119 + }
120 + }
121 +
122 + show() {
123 + if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
124 + return
125 + }
126 +
127 + let actives
128 + let activesData
129 +
130 + if (this._parent) {
131 + actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent)
132 + .filter(elem => {
133 + if (typeof this._config.parent === 'string') {
134 + return elem.getAttribute('data-bs-parent') === this._config.parent
135 + }
136 +
137 + return elem.classList.contains(CLASS_NAME_COLLAPSE)
138 + })
139 +
140 + if (actives.length === 0) {
141 + actives = null
142 + }
143 + }
144 +
145 + const container = SelectorEngine.findOne(this._selector)
146 + if (actives) {
147 + const tempActiveData = actives.find(elem => container !== elem)
148 + activesData = tempActiveData ? Data.get(tempActiveData, DATA_KEY) : null
149 +
150 + if (activesData && activesData._isTransitioning) {
151 + return
152 + }
153 + }
154 +
155 + const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)
156 + if (startEvent.defaultPrevented) {
157 + return
158 + }
159 +
160 + if (actives) {
161 + actives.forEach(elemActive => {
162 + if (container !== elemActive) {
163 + Collapse.collapseInterface(elemActive, 'hide')
164 + }
165 +
166 + if (!activesData) {
167 + Data.set(elemActive, DATA_KEY, null)
168 + }
169 + })
170 + }
171 +
172 + const dimension = this._getDimension()
173 +
174 + this._element.classList.remove(CLASS_NAME_COLLAPSE)
175 + this._element.classList.add(CLASS_NAME_COLLAPSING)
176 +
177 + this._element.style[dimension] = 0
178 +
179 + if (this._triggerArray.length) {
180 + this._triggerArray.forEach(element => {
181 + element.classList.remove(CLASS_NAME_COLLAPSED)
182 + element.setAttribute('aria-expanded', true)
183 + })
184 + }
185 +
186 + this.setTransitioning(true)
187 +
188 + const complete = () => {
189 + this._element.classList.remove(CLASS_NAME_COLLAPSING)
190 + this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
191 +
192 + this._element.style[dimension] = ''
193 +
194 + this.setTransitioning(false)
195 +
196 + EventHandler.trigger(this._element, EVENT_SHOWN)
197 + }
198 +
199 + const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)
200 + const scrollSize = `scroll${capitalizedDimension}`
201 +
202 + this._queueCallback(complete, this._element, true)
203 + this._element.style[dimension] = `${this._element[scrollSize]}px`
204 + }
205 +
206 + hide() {
207 + if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
208 + return
209 + }
210 +
211 + const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)
212 + if (startEvent.defaultPrevented) {
213 + return
214 + }
215 +
216 + const dimension = this._getDimension()
217 +
218 + this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`
219 +
220 + reflow(this._element)
221 +
222 + this._element.classList.add(CLASS_NAME_COLLAPSING)
223 + this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)
224 +
225 + const triggerArrayLength = this._triggerArray.length
226 + if (triggerArrayLength > 0) {
227 + for (let i = 0; i < triggerArrayLength; i++) {
228 + const trigger = this._triggerArray[i]
229 + const elem = getElementFromSelector(trigger)
230 +
231 + if (elem && !elem.classList.contains(CLASS_NAME_SHOW)) {
232 + trigger.classList.add(CLASS_NAME_COLLAPSED)
233 + trigger.setAttribute('aria-expanded', false)
234 + }
235 + }
236 + }
237 +
238 + this.setTransitioning(true)
239 +
240 + const complete = () => {
241 + this.setTransitioning(false)
242 + this._element.classList.remove(CLASS_NAME_COLLAPSING)
243 + this._element.classList.add(CLASS_NAME_COLLAPSE)
244 + EventHandler.trigger(this._element, EVENT_HIDDEN)
245 + }
246 +
247 + this._element.style[dimension] = ''
248 +
249 + this._queueCallback(complete, this._element, true)
250 + }
251 +
252 + setTransitioning(isTransitioning) {
253 + this._isTransitioning = isTransitioning
254 + }
255 +
256 + // Private
257 +
258 + _getConfig(config) {
259 + config = {
260 + ...Default,
261 + ...config
262 + }
263 + config.toggle = Boolean(config.toggle) // Coerce string values
264 + typeCheckConfig(NAME, config, DefaultType)
265 + return config
266 + }
267 +
268 + _getDimension() {
269 + return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT
270 + }
271 +
272 + _getParent() {
273 + let { parent } = this._config
274 +
275 + parent = getElement(parent)
276 +
277 + const selector = `${SELECTOR_DATA_TOGGLE}[data-bs-parent="${parent}"]`
278 +
279 + SelectorEngine.find(selector, parent)
280 + .forEach(element => {
281 + const selected = getElementFromSelector(element)
282 +
283 + this._addAriaAndCollapsedClass(
284 + selected,
285 + [element]
286 + )
287 + })
288 +
289 + return parent
290 + }
291 +
292 + _addAriaAndCollapsedClass(element, triggerArray) {
293 + if (!element || !triggerArray.length) {
294 + return
295 + }
296 +
297 + const isOpen = element.classList.contains(CLASS_NAME_SHOW)
298 +
299 + triggerArray.forEach(elem => {
300 + if (isOpen) {
301 + elem.classList.remove(CLASS_NAME_COLLAPSED)
302 + } else {
303 + elem.classList.add(CLASS_NAME_COLLAPSED)
304 + }
305 +
306 + elem.setAttribute('aria-expanded', isOpen)
307 + })
308 + }
309 +
310 + // Static
311 +
312 + static collapseInterface(element, config) {
313 + let data = Data.get(element, DATA_KEY)
314 + const _config = {
315 + ...Default,
316 + ...Manipulator.getDataAttributes(element),
317 + ...(typeof config === 'object' && config ? config : {})
318 + }
319 +
320 + if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
321 + _config.toggle = false
322 + }
323 +
324 + if (!data) {
325 + data = new Collapse(element, _config)
326 + }
327 +
328 + if (typeof config === 'string') {
329 + if (typeof data[config] === 'undefined') {
330 + throw new TypeError(`No method named "${config}"`)
331 + }
332 +
333 + data[config]()
334 + }
335 + }
336 +
337 + static jQueryInterface(config) {
338 + return this.each(function () {
339 + Collapse.collapseInterface(this, config)
340 + })
341 + }
342 +}
343 +
344 +/**
345 + * ------------------------------------------------------------------------
346 + * Data Api implementation
347 + * ------------------------------------------------------------------------
348 + */
349 +
350 +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
351 + // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
352 + if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {
353 + event.preventDefault()
354 + }
355 +
356 + const triggerData = Manipulator.getDataAttributes(this)
357 + const selector = getSelectorFromElement(this)
358 + const selectorElements = SelectorEngine.find(selector)
359 +
360 + selectorElements.forEach(element => {
361 + const data = Data.get(element, DATA_KEY)
362 + let config
363 + if (data) {
364 + // update parent attribute
365 + if (data._parent === null && typeof triggerData.parent === 'string') {
366 + data._config.parent = triggerData.parent
367 + data._parent = data._getParent()
368 + }
369 +
370 + config = 'toggle'
371 + } else {
372 + config = triggerData
373 + }
374 +
375 + Collapse.collapseInterface(element, config)
376 + })
377 +})
378 +
379 +/**
380 + * ------------------------------------------------------------------------
381 + * jQuery
382 + * ------------------------------------------------------------------------
383 + * add .Collapse to jQuery only if jQuery is present
384 + */
385 +
386 +defineJQueryPlugin(Collapse)
387 +
388 +export default Collapse
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): dom/data.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +/**
9 + * ------------------------------------------------------------------------
10 + * Constants
11 + * ------------------------------------------------------------------------
12 + */
13 +
14 +const elementMap = new Map()
15 +
16 +export default {
17 + set(element, key, instance) {
18 + if (!elementMap.has(element)) {
19 + elementMap.set(element, new Map())
20 + }
21 +
22 + const instanceMap = elementMap.get(element)
23 +
24 + // make it clear we only want one instance per element
25 + // can be removed later when multiple key/instances are fine to be used
26 + if (!instanceMap.has(key) && instanceMap.size !== 0) {
27 + // eslint-disable-next-line no-console
28 + console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)
29 + return
30 + }
31 +
32 + instanceMap.set(key, instance)
33 + },
34 +
35 + get(element, key) {
36 + if (elementMap.has(element)) {
37 + return elementMap.get(element).get(key) || null
38 + }
39 +
40 + return null
41 + },
42 +
43 + remove(element, key) {
44 + if (!elementMap.has(element)) {
45 + return
46 + }
47 +
48 + const instanceMap = elementMap.get(element)
49 +
50 + instanceMap.delete(key)
51 +
52 + // free up element references if there are no instances left for an element
53 + if (instanceMap.size === 0) {
54 + elementMap.delete(element)
55 + }
56 + }
57 +}
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): dom/event-handler.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import { getjQuery } from '../util/index'
9 +
10 +/**
11 + * ------------------------------------------------------------------------
12 + * Constants
13 + * ------------------------------------------------------------------------
14 + */
15 +
16 +const namespaceRegex = /[^.]*(?=\..*)\.|.*/
17 +const stripNameRegex = /\..*/
18 +const stripUidRegex = /::\d+$/
19 +const eventRegistry = {} // Events storage
20 +let uidEvent = 1
21 +const customEvents = {
22 + mouseenter: 'mouseover',
23 + mouseleave: 'mouseout'
24 +}
25 +const customEventsRegex = /^(mouseenter|mouseleave)/i
26 +const nativeEvents = new Set([
27 + 'click',
28 + 'dblclick',
29 + 'mouseup',
30 + 'mousedown',
31 + 'contextmenu',
32 + 'mousewheel',
33 + 'DOMMouseScroll',
34 + 'mouseover',
35 + 'mouseout',
36 + 'mousemove',
37 + 'selectstart',
38 + 'selectend',
39 + 'keydown',
40 + 'keypress',
41 + 'keyup',
42 + 'orientationchange',
43 + 'touchstart',
44 + 'touchmove',
45 + 'touchend',
46 + 'touchcancel',
47 + 'pointerdown',
48 + 'pointermove',
49 + 'pointerup',
50 + 'pointerleave',
51 + 'pointercancel',
52 + 'gesturestart',
53 + 'gesturechange',
54 + 'gestureend',
55 + 'focus',
56 + 'blur',
57 + 'change',
58 + 'reset',
59 + 'select',
60 + 'submit',
61 + 'focusin',
62 + 'focusout',
63 + 'load',
64 + 'unload',
65 + 'beforeunload',
66 + 'resize',
67 + 'move',
68 + 'DOMContentLoaded',
69 + 'readystatechange',
70 + 'error',
71 + 'abort',
72 + 'scroll'
73 +])
74 +
75 +/**
76 + * ------------------------------------------------------------------------
77 + * Private methods
78 + * ------------------------------------------------------------------------
79 + */
80 +
81 +function getUidEvent(element, uid) {
82 + return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++
83 +}
84 +
85 +function getEvent(element) {
86 + const uid = getUidEvent(element)
87 +
88 + element.uidEvent = uid
89 + eventRegistry[uid] = eventRegistry[uid] || {}
90 +
91 + return eventRegistry[uid]
92 +}
93 +
94 +function bootstrapHandler(element, fn) {
95 + return function handler(event) {
96 + event.delegateTarget = element
97 +
98 + if (handler.oneOff) {
99 + EventHandler.off(element, event.type, fn)
100 + }
101 +
102 + return fn.apply(element, [event])
103 + }
104 +}
105 +
106 +function bootstrapDelegationHandler(element, selector, fn) {
107 + return function handler(event) {
108 + const domElements = element.querySelectorAll(selector)
109 +
110 + for (let { target } = event; target && target !== this; target = target.parentNode) {
111 + for (let i = domElements.length; i--;) {
112 + if (domElements[i] === target) {
113 + event.delegateTarget = target
114 +
115 + if (handler.oneOff) {
116 + // eslint-disable-next-line unicorn/consistent-destructuring
117 + EventHandler.off(element, event.type, selector, fn)
118 + }
119 +
120 + return fn.apply(target, [event])
121 + }
122 + }
123 + }
124 +
125 + // To please ESLint
126 + return null
127 + }
128 +}
129 +
130 +function findHandler(events, handler, delegationSelector = null) {
131 + const uidEventList = Object.keys(events)
132 +
133 + for (let i = 0, len = uidEventList.length; i < len; i++) {
134 + const event = events[uidEventList[i]]
135 +
136 + if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
137 + return event
138 + }
139 + }
140 +
141 + return null
142 +}
143 +
144 +function normalizeParams(originalTypeEvent, handler, delegationFn) {
145 + const delegation = typeof handler === 'string'
146 + const originalHandler = delegation ? delegationFn : handler
147 +
148 + let typeEvent = getTypeEvent(originalTypeEvent)
149 + const isNative = nativeEvents.has(typeEvent)
150 +
151 + if (!isNative) {
152 + typeEvent = originalTypeEvent
153 + }
154 +
155 + return [delegation, originalHandler, typeEvent]
156 +}
157 +
158 +function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
159 + if (typeof originalTypeEvent !== 'string' || !element) {
160 + return
161 + }
162 +
163 + if (!handler) {
164 + handler = delegationFn
165 + delegationFn = null
166 + }
167 +
168 + // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
169 + // this prevents the handler from being dispatched the same way as mouseover or mouseout does
170 + if (customEventsRegex.test(originalTypeEvent)) {
171 + const wrapFn = fn => {
172 + return function (event) {
173 + if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {
174 + return fn.call(this, event)
175 + }
176 + }
177 + }
178 +
179 + if (delegationFn) {
180 + delegationFn = wrapFn(delegationFn)
181 + } else {
182 + handler = wrapFn(handler)
183 + }
184 + }
185 +
186 + const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)
187 + const events = getEvent(element)
188 + const handlers = events[typeEvent] || (events[typeEvent] = {})
189 + const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null)
190 +
191 + if (previousFn) {
192 + previousFn.oneOff = previousFn.oneOff && oneOff
193 +
194 + return
195 + }
196 +
197 + const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''))
198 + const fn = delegation ?
199 + bootstrapDelegationHandler(element, handler, delegationFn) :
200 + bootstrapHandler(element, handler)
201 +
202 + fn.delegationSelector = delegation ? handler : null
203 + fn.originalHandler = originalHandler
204 + fn.oneOff = oneOff
205 + fn.uidEvent = uid
206 + handlers[uid] = fn
207 +
208 + element.addEventListener(typeEvent, fn, delegation)
209 +}
210 +
211 +function removeHandler(element, events, typeEvent, handler, delegationSelector) {
212 + const fn = findHandler(events[typeEvent], handler, delegationSelector)
213 +
214 + if (!fn) {
215 + return
216 + }
217 +
218 + element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))
219 + delete events[typeEvent][fn.uidEvent]
220 +}
221 +
222 +function removeNamespacedHandlers(element, events, typeEvent, namespace) {
223 + const storeElementEvent = events[typeEvent] || {}
224 +
225 + Object.keys(storeElementEvent).forEach(handlerKey => {
226 + if (handlerKey.includes(namespace)) {
227 + const event = storeElementEvent[handlerKey]
228 +
229 + removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
230 + }
231 + })
232 +}
233 +
234 +function getTypeEvent(event) {
235 + // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
236 + event = event.replace(stripNameRegex, '')
237 + return customEvents[event] || event
238 +}
239 +
240 +const EventHandler = {
241 + on(element, event, handler, delegationFn) {
242 + addHandler(element, event, handler, delegationFn, false)
243 + },
244 +
245 + one(element, event, handler, delegationFn) {
246 + addHandler(element, event, handler, delegationFn, true)
247 + },
248 +
249 + off(element, originalTypeEvent, handler, delegationFn) {
250 + if (typeof originalTypeEvent !== 'string' || !element) {
251 + return
252 + }
253 +
254 + const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)
255 + const inNamespace = typeEvent !== originalTypeEvent
256 + const events = getEvent(element)
257 + const isNamespace = originalTypeEvent.startsWith('.')
258 +
259 + if (typeof originalHandler !== 'undefined') {
260 + // Simplest case: handler is passed, remove that listener ONLY.
261 + if (!events || !events[typeEvent]) {
262 + return
263 + }
264 +
265 + removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null)
266 + return
267 + }
268 +
269 + if (isNamespace) {
270 + Object.keys(events).forEach(elementEvent => {
271 + removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))
272 + })
273 + }
274 +
275 + const storeElementEvent = events[typeEvent] || {}
276 + Object.keys(storeElementEvent).forEach(keyHandlers => {
277 + const handlerKey = keyHandlers.replace(stripUidRegex, '')
278 +
279 + if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
280 + const event = storeElementEvent[keyHandlers]
281 +
282 + removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
283 + }
284 + })
285 + },
286 +
287 + trigger(element, event, args) {
288 + if (typeof event !== 'string' || !element) {
289 + return null
290 + }
291 +
292 + const $ = getjQuery()
293 + const typeEvent = getTypeEvent(event)
294 + const inNamespace = event !== typeEvent
295 + const isNative = nativeEvents.has(typeEvent)
296 +
297 + let jQueryEvent
298 + let bubbles = true
299 + let nativeDispatch = true
300 + let defaultPrevented = false
301 + let evt = null
302 +
303 + if (inNamespace && $) {
304 + jQueryEvent = $.Event(event, args)
305 +
306 + $(element).trigger(jQueryEvent)
307 + bubbles = !jQueryEvent.isPropagationStopped()
308 + nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()
309 + defaultPrevented = jQueryEvent.isDefaultPrevented()
310 + }
311 +
312 + if (isNative) {
313 + evt = document.createEvent('HTMLEvents')
314 + evt.initEvent(typeEvent, bubbles, true)
315 + } else {
316 + evt = new CustomEvent(event, {
317 + bubbles,
318 + cancelable: true
319 + })
320 + }
321 +
322 + // merge custom information in our event
323 + if (typeof args !== 'undefined') {
324 + Object.keys(args).forEach(key => {
325 + Object.defineProperty(evt, key, {
326 + get() {
327 + return args[key]
328 + }
329 + })
330 + })
331 + }
332 +
333 + if (defaultPrevented) {
334 + evt.preventDefault()
335 + }
336 +
337 + if (nativeDispatch) {
338 + element.dispatchEvent(evt)
339 + }
340 +
341 + if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
342 + jQueryEvent.preventDefault()
343 + }
344 +
345 + return evt
346 + }
347 +}
348 +
349 +export default EventHandler
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): dom/manipulator.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +function normalizeData(val) {
9 + if (val === 'true') {
10 + return true
11 + }
12 +
13 + if (val === 'false') {
14 + return false
15 + }
16 +
17 + if (val === Number(val).toString()) {
18 + return Number(val)
19 + }
20 +
21 + if (val === '' || val === 'null') {
22 + return null
23 + }
24 +
25 + return val
26 +}
27 +
28 +function normalizeDataKey(key) {
29 + return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)
30 +}
31 +
32 +const Manipulator = {
33 + setDataAttribute(element, key, value) {
34 + element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)
35 + },
36 +
37 + removeDataAttribute(element, key) {
38 + element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)
39 + },
40 +
41 + getDataAttributes(element) {
42 + if (!element) {
43 + return {}
44 + }
45 +
46 + const attributes = {}
47 +
48 + Object.keys(element.dataset)
49 + .filter(key => key.startsWith('bs'))
50 + .forEach(key => {
51 + let pureKey = key.replace(/^bs/, '')
52 + pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)
53 + attributes[pureKey] = normalizeData(element.dataset[key])
54 + })
55 +
56 + return attributes
57 + },
58 +
59 + getDataAttribute(element, key) {
60 + return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))
61 + },
62 +
63 + offset(element) {
64 + const rect = element.getBoundingClientRect()
65 +
66 + return {
67 + top: rect.top + document.body.scrollTop,
68 + left: rect.left + document.body.scrollLeft
69 + }
70 + },
71 +
72 + position(element) {
73 + return {
74 + top: element.offsetTop,
75 + left: element.offsetLeft
76 + }
77 + }
78 +}
79 +
80 +export default Manipulator
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): dom/selector-engine.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +/**
9 + * ------------------------------------------------------------------------
10 + * Constants
11 + * ------------------------------------------------------------------------
12 + */
13 +
14 +const NODE_TEXT = 3
15 +
16 +const SelectorEngine = {
17 + find(selector, element = document.documentElement) {
18 + return [].concat(...Element.prototype.querySelectorAll.call(element, selector))
19 + },
20 +
21 + findOne(selector, element = document.documentElement) {
22 + return Element.prototype.querySelector.call(element, selector)
23 + },
24 +
25 + children(element, selector) {
26 + return [].concat(...element.children)
27 + .filter(child => child.matches(selector))
28 + },
29 +
30 + parents(element, selector) {
31 + const parents = []
32 +
33 + let ancestor = element.parentNode
34 +
35 + while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
36 + if (ancestor.matches(selector)) {
37 + parents.push(ancestor)
38 + }
39 +
40 + ancestor = ancestor.parentNode
41 + }
42 +
43 + return parents
44 + },
45 +
46 + prev(element, selector) {
47 + let previous = element.previousElementSibling
48 +
49 + while (previous) {
50 + if (previous.matches(selector)) {
51 + return [previous]
52 + }
53 +
54 + previous = previous.previousElementSibling
55 + }
56 +
57 + return []
58 + },
59 +
60 + next(element, selector) {
61 + let next = element.nextElementSibling
62 +
63 + while (next) {
64 + if (next.matches(selector)) {
65 + return [next]
66 + }
67 +
68 + next = next.nextElementSibling
69 + }
70 +
71 + return []
72 + }
73 +}
74 +
75 +export default SelectorEngine
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): offcanvas.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + getElementFromSelector,
11 + isDisabled,
12 + isVisible,
13 + typeCheckConfig
14 +} from './util/index'
15 +import { hide as scrollBarHide, reset as scrollBarReset } from './util/scrollbar'
16 +import Data from './dom/data'
17 +import EventHandler from './dom/event-handler'
18 +import BaseComponent from './base-component'
19 +import SelectorEngine from './dom/selector-engine'
20 +import Manipulator from './dom/manipulator'
21 +import Backdrop from './util/backdrop'
22 +
23 +/**
24 + * ------------------------------------------------------------------------
25 + * Constants
26 + * ------------------------------------------------------------------------
27 + */
28 +
29 +const NAME = 'offcanvas'
30 +const DATA_KEY = 'bs.offcanvas'
31 +const EVENT_KEY = `.${DATA_KEY}`
32 +const DATA_API_KEY = '.data-api'
33 +const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
34 +const ESCAPE_KEY = 'Escape'
35 +
36 +const Default = {
37 + backdrop: true,
38 + keyboard: true,
39 + scroll: false
40 +}
41 +
42 +const DefaultType = {
43 + backdrop: 'boolean',
44 + keyboard: 'boolean',
45 + scroll: 'boolean'
46 +}
47 +
48 +const CLASS_NAME_SHOW = 'show'
49 +const OPEN_SELECTOR = '.offcanvas.show'
50 +
51 +const EVENT_SHOW = `show${EVENT_KEY}`
52 +const EVENT_SHOWN = `shown${EVENT_KEY}`
53 +const EVENT_HIDE = `hide${EVENT_KEY}`
54 +const EVENT_HIDDEN = `hidden${EVENT_KEY}`
55 +const EVENT_FOCUSIN = `focusin${EVENT_KEY}`
56 +const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
57 +const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
58 +const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`
59 +
60 +const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="offcanvas"]'
61 +const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="offcanvas"]'
62 +
63 +/**
64 + * ------------------------------------------------------------------------
65 + * Class Definition
66 + * ------------------------------------------------------------------------
67 + */
68 +
69 +class Offcanvas extends BaseComponent {
70 + constructor(element, config) {
71 + super(element)
72 +
73 + this._config = this._getConfig(config)
74 + this._isShown = false
75 + this._backdrop = this._initializeBackDrop()
76 + this._addEventListeners()
77 + }
78 +
79 + // Getters
80 +
81 + static get NAME() {
82 + return NAME
83 + }
84 +
85 + static get Default() {
86 + return Default
87 + }
88 +
89 + // Public
90 +
91 + toggle(relatedTarget) {
92 + return this._isShown ? this.hide() : this.show(relatedTarget)
93 + }
94 +
95 + show(relatedTarget) {
96 + if (this._isShown) {
97 + return
98 + }
99 +
100 + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })
101 +
102 + if (showEvent.defaultPrevented) {
103 + return
104 + }
105 +
106 + this._isShown = true
107 + this._element.style.visibility = 'visible'
108 +
109 + this._backdrop.show()
110 +
111 + if (!this._config.scroll) {
112 + scrollBarHide()
113 + this._enforceFocusOnElement(this._element)
114 + }
115 +
116 + this._element.removeAttribute('aria-hidden')
117 + this._element.setAttribute('aria-modal', true)
118 + this._element.setAttribute('role', 'dialog')
119 + this._element.classList.add(CLASS_NAME_SHOW)
120 +
121 + const completeCallBack = () => {
122 + EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })
123 + }
124 +
125 + this._queueCallback(completeCallBack, this._element, true)
126 + }
127 +
128 + hide() {
129 + if (!this._isShown) {
130 + return
131 + }
132 +
133 + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)
134 +
135 + if (hideEvent.defaultPrevented) {
136 + return
137 + }
138 +
139 + EventHandler.off(document, EVENT_FOCUSIN)
140 + this._element.blur()
141 + this._isShown = false
142 + this._element.classList.remove(CLASS_NAME_SHOW)
143 + this._backdrop.hide()
144 +
145 + const completeCallback = () => {
146 + this._element.setAttribute('aria-hidden', true)
147 + this._element.removeAttribute('aria-modal')
148 + this._element.removeAttribute('role')
149 + this._element.style.visibility = 'hidden'
150 +
151 + if (!this._config.scroll) {
152 + scrollBarReset()
153 + }
154 +
155 + EventHandler.trigger(this._element, EVENT_HIDDEN)
156 + }
157 +
158 + this._queueCallback(completeCallback, this._element, true)
159 + }
160 +
161 + dispose() {
162 + this._backdrop.dispose()
163 + super.dispose()
164 + EventHandler.off(document, EVENT_FOCUSIN)
165 + }
166 +
167 + // Private
168 +
169 + _getConfig(config) {
170 + config = {
171 + ...Default,
172 + ...Manipulator.getDataAttributes(this._element),
173 + ...(typeof config === 'object' ? config : {})
174 + }
175 + typeCheckConfig(NAME, config, DefaultType)
176 + return config
177 + }
178 +
179 + _initializeBackDrop() {
180 + return new Backdrop({
181 + isVisible: this._config.backdrop,
182 + isAnimated: true,
183 + rootElement: this._element.parentNode,
184 + clickCallback: () => this.hide()
185 + })
186 + }
187 +
188 + _enforceFocusOnElement(element) {
189 + EventHandler.off(document, EVENT_FOCUSIN) // guard against infinite focus loop
190 + EventHandler.on(document, EVENT_FOCUSIN, event => {
191 + if (document !== event.target &&
192 + element !== event.target &&
193 + !element.contains(event.target)) {
194 + element.focus()
195 + }
196 + })
197 + element.focus()
198 + }
199 +
200 + _addEventListeners() {
201 + EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
202 +
203 + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
204 + if (this._config.keyboard && event.key === ESCAPE_KEY) {
205 + this.hide()
206 + }
207 + })
208 + }
209 +
210 + // Static
211 +
212 + static jQueryInterface(config) {
213 + return this.each(function () {
214 + const data = Data.get(this, DATA_KEY) || new Offcanvas(this, typeof config === 'object' ? config : {})
215 +
216 + if (typeof config !== 'string') {
217 + return
218 + }
219 +
220 + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
221 + throw new TypeError(`No method named "${config}"`)
222 + }
223 +
224 + data[config](this)
225 + })
226 + }
227 +}
228 +
229 +/**
230 + * ------------------------------------------------------------------------
231 + * Data Api implementation
232 + * ------------------------------------------------------------------------
233 + */
234 +
235 +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
236 + const target = getElementFromSelector(this)
237 +
238 + if (['A', 'AREA'].includes(this.tagName)) {
239 + event.preventDefault()
240 + }
241 +
242 + if (isDisabled(this)) {
243 + return
244 + }
245 +
246 + EventHandler.one(target, EVENT_HIDDEN, () => {
247 + // focus on trigger when it is closed
248 + if (isVisible(this)) {
249 + this.focus()
250 + }
251 + })
252 +
253 + // avoid conflict when clicking a toggler of an offcanvas, while another is open
254 + const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)
255 + if (allReadyOpen && allReadyOpen !== target) {
256 + Offcanvas.getInstance(allReadyOpen).hide()
257 + }
258 +
259 + const data = Data.get(target, DATA_KEY) || new Offcanvas(target)
260 +
261 + data.toggle(this)
262 +})
263 +
264 +EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
265 + SelectorEngine.find(OPEN_SELECTOR).forEach(el => (Data.get(el, DATA_KEY) || new Offcanvas(el)).show())
266 +})
267 +
268 +/**
269 + * ------------------------------------------------------------------------
270 + * jQuery
271 + * ------------------------------------------------------------------------
272 + */
273 +
274 +defineJQueryPlugin(Offcanvas)
275 +
276 +export default Offcanvas
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): popover.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import { defineJQueryPlugin } from './util/index'
9 +import Data from './dom/data'
10 +import SelectorEngine from './dom/selector-engine'
11 +import Tooltip from './tooltip'
12 +
13 +/**
14 + * ------------------------------------------------------------------------
15 + * Constants
16 + * ------------------------------------------------------------------------
17 + */
18 +
19 +const NAME = 'popover'
20 +const DATA_KEY = 'bs.popover'
21 +const EVENT_KEY = `.${DATA_KEY}`
22 +const CLASS_PREFIX = 'bs-popover'
23 +const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g')
24 +
25 +const Default = {
26 + ...Tooltip.Default,
27 + placement: 'right',
28 + offset: [0, 8],
29 + trigger: 'click',
30 + content: '',
31 + template: '<div class="popover" role="tooltip">' +
32 + '<div class="popover-arrow"></div>' +
33 + '<h3 class="popover-header"></h3>' +
34 + '<div class="popover-body"></div>' +
35 + '</div>'
36 +}
37 +
38 +const DefaultType = {
39 + ...Tooltip.DefaultType,
40 + content: '(string|element|function)'
41 +}
42 +
43 +const Event = {
44 + HIDE: `hide${EVENT_KEY}`,
45 + HIDDEN: `hidden${EVENT_KEY}`,
46 + SHOW: `show${EVENT_KEY}`,
47 + SHOWN: `shown${EVENT_KEY}`,
48 + INSERTED: `inserted${EVENT_KEY}`,
49 + CLICK: `click${EVENT_KEY}`,
50 + FOCUSIN: `focusin${EVENT_KEY}`,
51 + FOCUSOUT: `focusout${EVENT_KEY}`,
52 + MOUSEENTER: `mouseenter${EVENT_KEY}`,
53 + MOUSELEAVE: `mouseleave${EVENT_KEY}`
54 +}
55 +
56 +const CLASS_NAME_FADE = 'fade'
57 +const CLASS_NAME_SHOW = 'show'
58 +
59 +const SELECTOR_TITLE = '.popover-header'
60 +const SELECTOR_CONTENT = '.popover-body'
61 +
62 +/**
63 + * ------------------------------------------------------------------------
64 + * Class Definition
65 + * ------------------------------------------------------------------------
66 + */
67 +
68 +class Popover extends Tooltip {
69 + // Getters
70 +
71 + static get Default() {
72 + return Default
73 + }
74 +
75 + static get NAME() {
76 + return NAME
77 + }
78 +
79 + static get Event() {
80 + return Event
81 + }
82 +
83 + static get DefaultType() {
84 + return DefaultType
85 + }
86 +
87 + // Overrides
88 +
89 + isWithContent() {
90 + return this.getTitle() || this._getContent()
91 + }
92 +
93 + setContent() {
94 + const tip = this.getTipElement()
95 +
96 + // we use append for html objects to maintain js events
97 + this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle())
98 + let content = this._getContent()
99 + if (typeof content === 'function') {
100 + content = content.call(this._element)
101 + }
102 +
103 + this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content)
104 +
105 + tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
106 + }
107 +
108 + // Private
109 +
110 + _addAttachmentClass(attachment) {
111 + this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`)
112 + }
113 +
114 + _getContent() {
115 + return this._element.getAttribute('data-bs-content') || this._config.content
116 + }
117 +
118 + _cleanTipClass() {
119 + const tip = this.getTipElement()
120 + const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX)
121 + if (tabClass !== null && tabClass.length > 0) {
122 + tabClass.map(token => token.trim())
123 + .forEach(tClass => tip.classList.remove(tClass))
124 + }
125 + }
126 +
127 + // Static
128 +
129 + static jQueryInterface(config) {
130 + return this.each(function () {
131 + let data = Data.get(this, DATA_KEY)
132 + const _config = typeof config === 'object' ? config : null
133 +
134 + if (!data && /dispose|hide/.test(config)) {
135 + return
136 + }
137 +
138 + if (!data) {
139 + data = new Popover(this, _config)
140 + Data.set(this, DATA_KEY, data)
141 + }
142 +
143 + if (typeof config === 'string') {
144 + if (typeof data[config] === 'undefined') {
145 + throw new TypeError(`No method named "${config}"`)
146 + }
147 +
148 + data[config]()
149 + }
150 + })
151 + }
152 +}
153 +
154 +/**
155 + * ------------------------------------------------------------------------
156 + * jQuery
157 + * ------------------------------------------------------------------------
158 + * add .Popover to jQuery only if jQuery is present
159 + */
160 +
161 +defineJQueryPlugin(Popover)
162 +
163 +export default Popover
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): scrollspy.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + getSelectorFromElement,
11 + getUID,
12 + isElement,
13 + typeCheckConfig
14 +} from './util/index'
15 +import EventHandler from './dom/event-handler'
16 +import Manipulator from './dom/manipulator'
17 +import SelectorEngine from './dom/selector-engine'
18 +import BaseComponent from './base-component'
19 +
20 +/**
21 + * ------------------------------------------------------------------------
22 + * Constants
23 + * ------------------------------------------------------------------------
24 + */
25 +
26 +const NAME = 'scrollspy'
27 +const DATA_KEY = 'bs.scrollspy'
28 +const EVENT_KEY = `.${DATA_KEY}`
29 +const DATA_API_KEY = '.data-api'
30 +
31 +const Default = {
32 + offset: 10,
33 + method: 'auto',
34 + target: ''
35 +}
36 +
37 +const DefaultType = {
38 + offset: 'number',
39 + method: 'string',
40 + target: '(string|element)'
41 +}
42 +
43 +const EVENT_ACTIVATE = `activate${EVENT_KEY}`
44 +const EVENT_SCROLL = `scroll${EVENT_KEY}`
45 +const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
46 +
47 +const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
48 +const CLASS_NAME_ACTIVE = 'active'
49 +
50 +const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'
51 +const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
52 +const SELECTOR_NAV_LINKS = '.nav-link'
53 +const SELECTOR_NAV_ITEMS = '.nav-item'
54 +const SELECTOR_LIST_ITEMS = '.list-group-item'
55 +const SELECTOR_DROPDOWN = '.dropdown'
56 +const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
57 +
58 +const METHOD_OFFSET = 'offset'
59 +const METHOD_POSITION = 'position'
60 +
61 +/**
62 + * ------------------------------------------------------------------------
63 + * Class Definition
64 + * ------------------------------------------------------------------------
65 + */
66 +
67 +class ScrollSpy extends BaseComponent {
68 + constructor(element, config) {
69 + super(element)
70 + this._scrollElement = this._element.tagName === 'BODY' ? window : this._element
71 + this._config = this._getConfig(config)
72 + this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`
73 + this._offsets = []
74 + this._targets = []
75 + this._activeTarget = null
76 + this._scrollHeight = 0
77 +
78 + EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process())
79 +
80 + this.refresh()
81 + this._process()
82 + }
83 +
84 + // Getters
85 +
86 + static get Default() {
87 + return Default
88 + }
89 +
90 + static get NAME() {
91 + return NAME
92 + }
93 +
94 + // Public
95 +
96 + refresh() {
97 + const autoMethod = this._scrollElement === this._scrollElement.window ?
98 + METHOD_OFFSET :
99 + METHOD_POSITION
100 +
101 + const offsetMethod = this._config.method === 'auto' ?
102 + autoMethod :
103 + this._config.method
104 +
105 + const offsetBase = offsetMethod === METHOD_POSITION ?
106 + this._getScrollTop() :
107 + 0
108 +
109 + this._offsets = []
110 + this._targets = []
111 + this._scrollHeight = this._getScrollHeight()
112 +
113 + const targets = SelectorEngine.find(this._selector)
114 +
115 + targets.map(element => {
116 + const targetSelector = getSelectorFromElement(element)
117 + const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null
118 +
119 + if (target) {
120 + const targetBCR = target.getBoundingClientRect()
121 + if (targetBCR.width || targetBCR.height) {
122 + return [
123 + Manipulator[offsetMethod](target).top + offsetBase,
124 + targetSelector
125 + ]
126 + }
127 + }
128 +
129 + return null
130 + })
131 + .filter(item => item)
132 + .sort((a, b) => a[0] - b[0])
133 + .forEach(item => {
134 + this._offsets.push(item[0])
135 + this._targets.push(item[1])
136 + })
137 + }
138 +
139 + dispose() {
140 + EventHandler.off(this._scrollElement, EVENT_KEY)
141 + super.dispose()
142 + }
143 +
144 + // Private
145 +
146 + _getConfig(config) {
147 + config = {
148 + ...Default,
149 + ...Manipulator.getDataAttributes(this._element),
150 + ...(typeof config === 'object' && config ? config : {})
151 + }
152 +
153 + if (typeof config.target !== 'string' && isElement(config.target)) {
154 + let { id } = config.target
155 + if (!id) {
156 + id = getUID(NAME)
157 + config.target.id = id
158 + }
159 +
160 + config.target = `#${id}`
161 + }
162 +
163 + typeCheckConfig(NAME, config, DefaultType)
164 +
165 + return config
166 + }
167 +
168 + _getScrollTop() {
169 + return this._scrollElement === window ?
170 + this._scrollElement.pageYOffset :
171 + this._scrollElement.scrollTop
172 + }
173 +
174 + _getScrollHeight() {
175 + return this._scrollElement.scrollHeight || Math.max(
176 + document.body.scrollHeight,
177 + document.documentElement.scrollHeight
178 + )
179 + }
180 +
181 + _getOffsetHeight() {
182 + return this._scrollElement === window ?
183 + window.innerHeight :
184 + this._scrollElement.getBoundingClientRect().height
185 + }
186 +
187 + _process() {
188 + const scrollTop = this._getScrollTop() + this._config.offset
189 + const scrollHeight = this._getScrollHeight()
190 + const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight()
191 +
192 + if (this._scrollHeight !== scrollHeight) {
193 + this.refresh()
194 + }
195 +
196 + if (scrollTop >= maxScroll) {
197 + const target = this._targets[this._targets.length - 1]
198 +
199 + if (this._activeTarget !== target) {
200 + this._activate(target)
201 + }
202 +
203 + return
204 + }
205 +
206 + if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
207 + this._activeTarget = null
208 + this._clear()
209 + return
210 + }
211 +
212 + for (let i = this._offsets.length; i--;) {
213 + const isActiveTarget = this._activeTarget !== this._targets[i] &&
214 + scrollTop >= this._offsets[i] &&
215 + (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1])
216 +
217 + if (isActiveTarget) {
218 + this._activate(this._targets[i])
219 + }
220 + }
221 + }
222 +
223 + _activate(target) {
224 + this._activeTarget = target
225 +
226 + this._clear()
227 +
228 + const queries = this._selector.split(',')
229 + .map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`)
230 +
231 + const link = SelectorEngine.findOne(queries.join(','))
232 +
233 + if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
234 + SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
235 + .classList.add(CLASS_NAME_ACTIVE)
236 +
237 + link.classList.add(CLASS_NAME_ACTIVE)
238 + } else {
239 + // Set triggered link as active
240 + link.classList.add(CLASS_NAME_ACTIVE)
241 +
242 + SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP)
243 + .forEach(listGroup => {
244 + // Set triggered links parents as active
245 + // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
246 + SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`)
247 + .forEach(item => item.classList.add(CLASS_NAME_ACTIVE))
248 +
249 + // Handle special case when .nav-link is inside .nav-item
250 + SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS)
251 + .forEach(navItem => {
252 + SelectorEngine.children(navItem, SELECTOR_NAV_LINKS)
253 + .forEach(item => item.classList.add(CLASS_NAME_ACTIVE))
254 + })
255 + })
256 + }
257 +
258 + EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
259 + relatedTarget: target
260 + })
261 + }
262 +
263 + _clear() {
264 + SelectorEngine.find(this._selector)
265 + .filter(node => node.classList.contains(CLASS_NAME_ACTIVE))
266 + .forEach(node => node.classList.remove(CLASS_NAME_ACTIVE))
267 + }
268 +
269 + // Static
270 +
271 + static jQueryInterface(config) {
272 + return this.each(function () {
273 + const data = ScrollSpy.getInstance(this) || new ScrollSpy(this, typeof config === 'object' ? config : {})
274 +
275 + if (typeof config !== 'string') {
276 + return
277 + }
278 +
279 + if (typeof data[config] === 'undefined') {
280 + throw new TypeError(`No method named "${config}"`)
281 + }
282 +
283 + data[config]()
284 + })
285 + }
286 +}
287 +
288 +/**
289 + * ------------------------------------------------------------------------
290 + * Data Api implementation
291 + * ------------------------------------------------------------------------
292 + */
293 +
294 +EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
295 + SelectorEngine.find(SELECTOR_DATA_SPY)
296 + .forEach(spy => new ScrollSpy(spy))
297 +})
298 +
299 +/**
300 + * ------------------------------------------------------------------------
301 + * jQuery
302 + * ------------------------------------------------------------------------
303 + * add .ScrollSpy to jQuery only if jQuery is present
304 + */
305 +
306 +defineJQueryPlugin(ScrollSpy)
307 +
308 +export default ScrollSpy
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): tab.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + getElementFromSelector,
11 + isDisabled,
12 + reflow
13 +} from './util/index'
14 +import Data from './dom/data'
15 +import EventHandler from './dom/event-handler'
16 +import SelectorEngine from './dom/selector-engine'
17 +import BaseComponent from './base-component'
18 +
19 +/**
20 + * ------------------------------------------------------------------------
21 + * Constants
22 + * ------------------------------------------------------------------------
23 + */
24 +
25 +const NAME = 'tab'
26 +const DATA_KEY = 'bs.tab'
27 +const EVENT_KEY = `.${DATA_KEY}`
28 +const DATA_API_KEY = '.data-api'
29 +
30 +const EVENT_HIDE = `hide${EVENT_KEY}`
31 +const EVENT_HIDDEN = `hidden${EVENT_KEY}`
32 +const EVENT_SHOW = `show${EVENT_KEY}`
33 +const EVENT_SHOWN = `shown${EVENT_KEY}`
34 +const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
35 +
36 +const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'
37 +const CLASS_NAME_ACTIVE = 'active'
38 +const CLASS_NAME_FADE = 'fade'
39 +const CLASS_NAME_SHOW = 'show'
40 +
41 +const SELECTOR_DROPDOWN = '.dropdown'
42 +const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
43 +const SELECTOR_ACTIVE = '.active'
44 +const SELECTOR_ACTIVE_UL = ':scope > li > .active'
45 +const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'
46 +const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
47 +const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active'
48 +
49 +/**
50 + * ------------------------------------------------------------------------
51 + * Class Definition
52 + * ------------------------------------------------------------------------
53 + */
54 +
55 +class Tab extends BaseComponent {
56 + // Getters
57 +
58 + static get NAME() {
59 + return NAME
60 + }
61 +
62 + // Public
63 +
64 + show() {
65 + if ((this._element.parentNode &&
66 + this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
67 + this._element.classList.contains(CLASS_NAME_ACTIVE))) {
68 + return
69 + }
70 +
71 + let previous
72 + const target = getElementFromSelector(this._element)
73 + const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP)
74 +
75 + if (listElement) {
76 + const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE
77 + previous = SelectorEngine.find(itemSelector, listElement)
78 + previous = previous[previous.length - 1]
79 + }
80 +
81 + const hideEvent = previous ?
82 + EventHandler.trigger(previous, EVENT_HIDE, {
83 + relatedTarget: this._element
84 + }) :
85 + null
86 +
87 + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
88 + relatedTarget: previous
89 + })
90 +
91 + if (showEvent.defaultPrevented || (hideEvent !== null && hideEvent.defaultPrevented)) {
92 + return
93 + }
94 +
95 + this._activate(this._element, listElement)
96 +
97 + const complete = () => {
98 + EventHandler.trigger(previous, EVENT_HIDDEN, {
99 + relatedTarget: this._element
100 + })
101 + EventHandler.trigger(this._element, EVENT_SHOWN, {
102 + relatedTarget: previous
103 + })
104 + }
105 +
106 + if (target) {
107 + this._activate(target, target.parentNode, complete)
108 + } else {
109 + complete()
110 + }
111 + }
112 +
113 + // Private
114 +
115 + _activate(element, container, callback) {
116 + const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?
117 + SelectorEngine.find(SELECTOR_ACTIVE_UL, container) :
118 + SelectorEngine.children(container, SELECTOR_ACTIVE)
119 +
120 + const active = activeElements[0]
121 + const isTransitioning = callback && (active && active.classList.contains(CLASS_NAME_FADE))
122 +
123 + const complete = () => this._transitionComplete(element, active, callback)
124 +
125 + if (active && isTransitioning) {
126 + active.classList.remove(CLASS_NAME_SHOW)
127 + this._queueCallback(complete, element, true)
128 + } else {
129 + complete()
130 + }
131 + }
132 +
133 + _transitionComplete(element, active, callback) {
134 + if (active) {
135 + active.classList.remove(CLASS_NAME_ACTIVE)
136 +
137 + const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode)
138 +
139 + if (dropdownChild) {
140 + dropdownChild.classList.remove(CLASS_NAME_ACTIVE)
141 + }
142 +
143 + if (active.getAttribute('role') === 'tab') {
144 + active.setAttribute('aria-selected', false)
145 + }
146 + }
147 +
148 + element.classList.add(CLASS_NAME_ACTIVE)
149 + if (element.getAttribute('role') === 'tab') {
150 + element.setAttribute('aria-selected', true)
151 + }
152 +
153 + reflow(element)
154 +
155 + if (element.classList.contains(CLASS_NAME_FADE)) {
156 + element.classList.add(CLASS_NAME_SHOW)
157 + }
158 +
159 + let parent = element.parentNode
160 + if (parent && parent.nodeName === 'LI') {
161 + parent = parent.parentNode
162 + }
163 +
164 + if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
165 + const dropdownElement = element.closest(SELECTOR_DROPDOWN)
166 +
167 + if (dropdownElement) {
168 + SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement)
169 + .forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE))
170 + }
171 +
172 + element.setAttribute('aria-expanded', true)
173 + }
174 +
175 + if (callback) {
176 + callback()
177 + }
178 + }
179 +
180 + // Static
181 +
182 + static jQueryInterface(config) {
183 + return this.each(function () {
184 + const data = Data.get(this, DATA_KEY) || new Tab(this)
185 +
186 + if (typeof config === 'string') {
187 + if (typeof data[config] === 'undefined') {
188 + throw new TypeError(`No method named "${config}"`)
189 + }
190 +
191 + data[config]()
192 + }
193 + })
194 + }
195 +}
196 +
197 +/**
198 + * ------------------------------------------------------------------------
199 + * Data Api implementation
200 + * ------------------------------------------------------------------------
201 + */
202 +
203 +EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
204 + if (['A', 'AREA'].includes(this.tagName)) {
205 + event.preventDefault()
206 + }
207 +
208 + if (isDisabled(this)) {
209 + return
210 + }
211 +
212 + const data = Data.get(this, DATA_KEY) || new Tab(this)
213 + data.show()
214 +})
215 +
216 +/**
217 + * ------------------------------------------------------------------------
218 + * jQuery
219 + * ------------------------------------------------------------------------
220 + * add .Tab to jQuery only if jQuery is present
221 + */
222 +
223 +defineJQueryPlugin(Tab)
224 +
225 +export default Tab
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): toast.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import {
9 + defineJQueryPlugin,
10 + reflow,
11 + typeCheckConfig
12 +} from './util/index'
13 +import Data from './dom/data'
14 +import EventHandler from './dom/event-handler'
15 +import Manipulator from './dom/manipulator'
16 +import BaseComponent from './base-component'
17 +
18 +/**
19 + * ------------------------------------------------------------------------
20 + * Constants
21 + * ------------------------------------------------------------------------
22 + */
23 +
24 +const NAME = 'toast'
25 +const DATA_KEY = 'bs.toast'
26 +const EVENT_KEY = `.${DATA_KEY}`
27 +
28 +const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`
29 +const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`
30 +const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`
31 +const EVENT_FOCUSIN = `focusin${EVENT_KEY}`
32 +const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`
33 +const EVENT_HIDE = `hide${EVENT_KEY}`
34 +const EVENT_HIDDEN = `hidden${EVENT_KEY}`
35 +const EVENT_SHOW = `show${EVENT_KEY}`
36 +const EVENT_SHOWN = `shown${EVENT_KEY}`
37 +
38 +const CLASS_NAME_FADE = 'fade'
39 +const CLASS_NAME_HIDE = 'hide'
40 +const CLASS_NAME_SHOW = 'show'
41 +const CLASS_NAME_SHOWING = 'showing'
42 +
43 +const DefaultType = {
44 + animation: 'boolean',
45 + autohide: 'boolean',
46 + delay: 'number'
47 +}
48 +
49 +const Default = {
50 + animation: true,
51 + autohide: true,
52 + delay: 5000
53 +}
54 +
55 +const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]'
56 +
57 +/**
58 + * ------------------------------------------------------------------------
59 + * Class Definition
60 + * ------------------------------------------------------------------------
61 + */
62 +
63 +class Toast extends BaseComponent {
64 + constructor(element, config) {
65 + super(element)
66 +
67 + this._config = this._getConfig(config)
68 + this._timeout = null
69 + this._hasMouseInteraction = false
70 + this._hasKeyboardInteraction = false
71 + this._setListeners()
72 + }
73 +
74 + // Getters
75 +
76 + static get DefaultType() {
77 + return DefaultType
78 + }
79 +
80 + static get Default() {
81 + return Default
82 + }
83 +
84 + static get NAME() {
85 + return NAME
86 + }
87 +
88 + // Public
89 +
90 + show() {
91 + const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)
92 +
93 + if (showEvent.defaultPrevented) {
94 + return
95 + }
96 +
97 + this._clearTimeout()
98 +
99 + if (this._config.animation) {
100 + this._element.classList.add(CLASS_NAME_FADE)
101 + }
102 +
103 + const complete = () => {
104 + this._element.classList.remove(CLASS_NAME_SHOWING)
105 + this._element.classList.add(CLASS_NAME_SHOW)
106 +
107 + EventHandler.trigger(this._element, EVENT_SHOWN)
108 +
109 + this._maybeScheduleHide()
110 + }
111 +
112 + this._element.classList.remove(CLASS_NAME_HIDE)
113 + reflow(this._element)
114 + this._element.classList.add(CLASS_NAME_SHOWING)
115 +
116 + this._queueCallback(complete, this._element, this._config.animation)
117 + }
118 +
119 + hide() {
120 + if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
121 + return
122 + }
123 +
124 + const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)
125 +
126 + if (hideEvent.defaultPrevented) {
127 + return
128 + }
129 +
130 + const complete = () => {
131 + this._element.classList.add(CLASS_NAME_HIDE)
132 + EventHandler.trigger(this._element, EVENT_HIDDEN)
133 + }
134 +
135 + this._element.classList.remove(CLASS_NAME_SHOW)
136 + this._queueCallback(complete, this._element, this._config.animation)
137 + }
138 +
139 + dispose() {
140 + this._clearTimeout()
141 +
142 + if (this._element.classList.contains(CLASS_NAME_SHOW)) {
143 + this._element.classList.remove(CLASS_NAME_SHOW)
144 + }
145 +
146 + super.dispose()
147 + }
148 +
149 + // Private
150 +
151 + _getConfig(config) {
152 + config = {
153 + ...Default,
154 + ...Manipulator.getDataAttributes(this._element),
155 + ...(typeof config === 'object' && config ? config : {})
156 + }
157 +
158 + typeCheckConfig(NAME, config, this.constructor.DefaultType)
159 +
160 + return config
161 + }
162 +
163 + _maybeScheduleHide() {
164 + if (!this._config.autohide) {
165 + return
166 + }
167 +
168 + if (this._hasMouseInteraction || this._hasKeyboardInteraction) {
169 + return
170 + }
171 +
172 + this._timeout = setTimeout(() => {
173 + this.hide()
174 + }, this._config.delay)
175 + }
176 +
177 + _onInteraction(event, isInteracting) {
178 + switch (event.type) {
179 + case 'mouseover':
180 + case 'mouseout':
181 + this._hasMouseInteraction = isInteracting
182 + break
183 + case 'focusin':
184 + case 'focusout':
185 + this._hasKeyboardInteraction = isInteracting
186 + break
187 + default:
188 + break
189 + }
190 +
191 + if (isInteracting) {
192 + this._clearTimeout()
193 + return
194 + }
195 +
196 + const nextElement = event.relatedTarget
197 + if (this._element === nextElement || this._element.contains(nextElement)) {
198 + return
199 + }
200 +
201 + this._maybeScheduleHide()
202 + }
203 +
204 + _setListeners() {
205 + EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
206 + EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true))
207 + EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false))
208 + EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true))
209 + EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false))
210 + }
211 +
212 + _clearTimeout() {
213 + clearTimeout(this._timeout)
214 + this._timeout = null
215 + }
216 +
217 + // Static
218 +
219 + static jQueryInterface(config) {
220 + return this.each(function () {
221 + let data = Data.get(this, DATA_KEY)
222 + const _config = typeof config === 'object' && config
223 +
224 + if (!data) {
225 + data = new Toast(this, _config)
226 + }
227 +
228 + if (typeof config === 'string') {
229 + if (typeof data[config] === 'undefined') {
230 + throw new TypeError(`No method named "${config}"`)
231 + }
232 +
233 + data[config](this)
234 + }
235 + })
236 + }
237 +}
238 +
239 +/**
240 + * ------------------------------------------------------------------------
241 + * jQuery
242 + * ------------------------------------------------------------------------
243 + * add .Toast to jQuery only if jQuery is present
244 + */
245 +
246 +defineJQueryPlugin(Toast)
247 +
248 +export default Toast
This diff is collapsed. Click to expand it.
1 +/**
2 + * --------------------------------------------------------------------------
3 + * Bootstrap (v5.0.1): util/backdrop.js
4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 + * --------------------------------------------------------------------------
6 + */
7 +
8 +import EventHandler from '../dom/event-handler'
9 +import { emulateTransitionEnd, execute, getTransitionDurationFromElement, reflow, typeCheckConfig } from './index'
10 +
11 +const Default = {
12 + isVisible: true, // if false, we use the backdrop helper without adding any element to the dom
13 + isAnimated: false,
14 + rootElement: document.body, // give the choice to place backdrop under different elements
15 + clickCallback: null
16 +}
17 +
18 +const DefaultType = {
19 + isVisible: 'boolean',
20 + isAnimated: 'boolean',
21 + rootElement: 'element',
22 + clickCallback: '(function|null)'
23 +}
24 +const NAME = 'backdrop'
25 +const CLASS_NAME_BACKDROP = 'modal-backdrop'
26 +const CLASS_NAME_FADE = 'fade'
27 +const CLASS_NAME_SHOW = 'show'
28 +
29 +const EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`
30 +
31 +class Backdrop {
32 + constructor(config) {
33 + this._config = this._getConfig(config)
34 + this._isAppended = false
35 + this._element = null
36 + }
37 +
38 + show(callback) {
39 + if (!this._config.isVisible) {
40 + execute(callback)
41 + return
42 + }
43 +
44 + this._append()
45 +
46 + if (this._config.isAnimated) {
47 + reflow(this._getElement())
48 + }
49 +
50 + this._getElement().classList.add(CLASS_NAME_SHOW)
51 +
52 + this._emulateAnimation(() => {
53 + execute(callback)
54 + })
55 + }
56 +
57 + hide(callback) {
58 + if (!this._config.isVisible) {
59 + execute(callback)
60 + return
61 + }
62 +
63 + this._getElement().classList.remove(CLASS_NAME_SHOW)
64 +
65 + this._emulateAnimation(() => {
66 + this.dispose()
67 + execute(callback)
68 + })
69 + }
70 +
71 + // Private
72 +
73 + _getElement() {
74 + if (!this._element) {
75 + const backdrop = document.createElement('div')
76 + backdrop.className = CLASS_NAME_BACKDROP
77 + if (this._config.isAnimated) {
78 + backdrop.classList.add(CLASS_NAME_FADE)
79 + }
80 +
81 + this._element = backdrop
82 + }
83 +
84 + return this._element
85 + }
86 +
87 + _getConfig(config) {
88 + config = {
89 + ...Default,
90 + ...(typeof config === 'object' ? config : {})
91 + }
92 +
93 + config.rootElement = config.rootElement || document.body
94 + typeCheckConfig(NAME, config, DefaultType)
95 + return config
96 + }
97 +
98 + _append() {
99 + if (this._isAppended) {
100 + return
101 + }
102 +
103 + this._config.rootElement.appendChild(this._getElement())
104 +
105 + EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
106 + execute(this._config.clickCallback)
107 + })
108 +
109 + this._isAppended = true
110 + }
111 +
112 + dispose() {
113 + if (!this._isAppended) {
114 + return
115 + }
116 +
117 + EventHandler.off(this._element, EVENT_MOUSEDOWN)
118 +
119 + this._getElement().parentNode.removeChild(this._element)
120 + this._isAppended = false
121 + }
122 +
123 + _emulateAnimation(callback) {
124 + if (!this._config.isAnimated) {
125 + execute(callback)
126 + return
127 + }
128 +
129 + const backdropTransitionDuration = getTransitionDurationFromElement(this._getElement())
130 + EventHandler.one(this._getElement(), 'transitionend', () => execute(callback))
131 + emulateTransitionEnd(this._getElement(), backdropTransitionDuration)
132 + }
133 +}
134 +
135 +export default Backdrop
1 +import SelectorEngine from '../dom/selector-engine'
2 +
3 +/**
4 + * --------------------------------------------------------------------------
5 + * Bootstrap (v5.0.1): util/index.js
6 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
7 + * --------------------------------------------------------------------------
8 + */
9 +
10 +const MAX_UID = 1000000
11 +const MILLISECONDS_MULTIPLIER = 1000
12 +const TRANSITION_END = 'transitionend'
13 +
14 +// Shoutout AngusCroll (https://goo.gl/pxwQGp)
15 +const toType = obj => {
16 + if (obj === null || obj === undefined) {
17 + return `${obj}`
18 + }
19 +
20 + return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
21 +}
22 +
23 +/**
24 + * --------------------------------------------------------------------------
25 + * Public Util Api
26 + * --------------------------------------------------------------------------
27 + */
28 +
29 +const getUID = prefix => {
30 + do {
31 + prefix += Math.floor(Math.random() * MAX_UID)
32 + } while (document.getElementById(prefix))
33 +
34 + return prefix
35 +}
36 +
37 +const getSelector = element => {
38 + let selector = element.getAttribute('data-bs-target')
39 +
40 + if (!selector || selector === '#') {
41 + let hrefAttr = element.getAttribute('href')
42 +
43 + // The only valid content that could double as a selector are IDs or classes,
44 + // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
45 + // `document.querySelector` will rightfully complain it is invalid.
46 + // See https://github.com/twbs/bootstrap/issues/32273
47 + if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {
48 + return null
49 + }
50 +
51 + // Just in case some CMS puts out a full URL with the anchor appended
52 + if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
53 + hrefAttr = `#${hrefAttr.split('#')[1]}`
54 + }
55 +
56 + selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
57 + }
58 +
59 + return selector
60 +}
61 +
62 +const getSelectorFromElement = element => {
63 + const selector = getSelector(element)
64 +
65 + if (selector) {
66 + return document.querySelector(selector) ? selector : null
67 + }
68 +
69 + return null
70 +}
71 +
72 +const getElementFromSelector = element => {
73 + const selector = getSelector(element)
74 +
75 + return selector ? document.querySelector(selector) : null
76 +}
77 +
78 +const getTransitionDurationFromElement = element => {
79 + if (!element) {
80 + return 0
81 + }
82 +
83 + // Get transition-duration of the element
84 + let { transitionDuration, transitionDelay } = window.getComputedStyle(element)
85 +
86 + const floatTransitionDuration = Number.parseFloat(transitionDuration)
87 + const floatTransitionDelay = Number.parseFloat(transitionDelay)
88 +
89 + // Return 0 if element or transition duration is not found
90 + if (!floatTransitionDuration && !floatTransitionDelay) {
91 + return 0
92 + }
93 +
94 + // If multiple durations are defined, take the first
95 + transitionDuration = transitionDuration.split(',')[0]
96 + transitionDelay = transitionDelay.split(',')[0]
97 +
98 + return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER
99 +}
100 +
101 +const triggerTransitionEnd = element => {
102 + element.dispatchEvent(new Event(TRANSITION_END))
103 +}
104 +
105 +const isElement = obj => {
106 + if (!obj || typeof obj !== 'object') {
107 + return false
108 + }
109 +
110 + if (typeof obj.jquery !== 'undefined') {
111 + obj = obj[0]
112 + }
113 +
114 + return typeof obj.nodeType !== 'undefined'
115 +}
116 +
117 +const getElement = obj => {
118 + if (isElement(obj)) { // it's a jQuery object or a node element
119 + return obj.jquery ? obj[0] : obj
120 + }
121 +
122 + if (typeof obj === 'string' && obj.length > 0) {
123 + return SelectorEngine.findOne(obj)
124 + }
125 +
126 + return null
127 +}
128 +
129 +const emulateTransitionEnd = (element, duration) => {
130 + let called = false
131 + const durationPadding = 5
132 + const emulatedDuration = duration + durationPadding
133 +
134 + function listener() {
135 + called = true
136 + element.removeEventListener(TRANSITION_END, listener)
137 + }
138 +
139 + element.addEventListener(TRANSITION_END, listener)
140 + setTimeout(() => {
141 + if (!called) {
142 + triggerTransitionEnd(element)
143 + }
144 + }, emulatedDuration)
145 +}
146 +
147 +const typeCheckConfig = (componentName, config, configTypes) => {
148 + Object.keys(configTypes).forEach(property => {
149 + const expectedTypes = configTypes[property]
150 + const value = config[property]
151 + const valueType = value && isElement(value) ? 'element' : toType(value)
152 +
153 + if (!new RegExp(expectedTypes).test(valueType)) {
154 + throw new TypeError(
155 + `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
156 + )
157 + }
158 + })
159 +}
160 +
161 +const isVisible = element => {
162 + if (!element) {
163 + return false
164 + }
165 +
166 + if (element.style && element.parentNode && element.parentNode.style) {
167 + const elementStyle = getComputedStyle(element)
168 + const parentNodeStyle = getComputedStyle(element.parentNode)
169 +
170 + return elementStyle.display !== 'none' &&
171 + parentNodeStyle.display !== 'none' &&
172 + elementStyle.visibility !== 'hidden'
173 + }
174 +
175 + return false
176 +}
177 +
178 +const isDisabled = element => {
179 + if (!element || element.nodeType !== Node.ELEMENT_NODE) {
180 + return true
181 + }
182 +
183 + if (element.classList.contains('disabled')) {
184 + return true
185 + }
186 +
187 + if (typeof element.disabled !== 'undefined') {
188 + return element.disabled
189 + }
190 +
191 + return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'
192 +}
193 +
194 +const findShadowRoot = element => {
195 + if (!document.documentElement.attachShadow) {
196 + return null
197 + }
198 +
199 + // Can find the shadow root otherwise it'll return the document
200 + if (typeof element.getRootNode === 'function') {
201 + const root = element.getRootNode()
202 + return root instanceof ShadowRoot ? root : null
203 + }
204 +
205 + if (element instanceof ShadowRoot) {
206 + return element
207 + }
208 +
209 + // when we don't find a shadow root
210 + if (!element.parentNode) {
211 + return null
212 + }
213 +
214 + return findShadowRoot(element.parentNode)
215 +}
216 +
217 +const noop = () => {}
218 +
219 +const reflow = element => element.offsetHeight
220 +
221 +const getjQuery = () => {
222 + const { jQuery } = window
223 +
224 + if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
225 + return jQuery
226 + }
227 +
228 + return null
229 +}
230 +
231 +const onDOMContentLoaded = callback => {
232 + if (document.readyState === 'loading') {
233 + document.addEventListener('DOMContentLoaded', callback)
234 + } else {
235 + callback()
236 + }
237 +}
238 +
239 +const isRTL = () => document.documentElement.dir === 'rtl'
240 +
241 +const defineJQueryPlugin = plugin => {
242 + onDOMContentLoaded(() => {
243 + const $ = getjQuery()
244 + /* istanbul ignore if */
245 + if ($) {
246 + const name = plugin.NAME
247 + const JQUERY_NO_CONFLICT = $.fn[name]
248 + $.fn[name] = plugin.jQueryInterface
249 + $.fn[name].Constructor = plugin
250 + $.fn[name].noConflict = () => {
251 + $.fn[name] = JQUERY_NO_CONFLICT
252 + return plugin.jQueryInterface
253 + }
254 + }
255 + })
256 +}
257 +
258 +const execute = callback => {
259 + if (typeof callback === 'function') {
260 + callback()
261 + }
262 +}
263 +
264 +export {
265 + getElement,
266 + getUID,
267 + getSelectorFromElement,
268 + getElementFromSelector,
269 + getTransitionDurationFromElement,
270 + triggerTransitionEnd,
271 + isElement,
272 + emulateTransitionEnd,
273 + typeCheckConfig,
274 + isVisible,
275 + isDisabled,
276 + findShadowRoot,
277 + noop,
278 + reflow,
279 + getjQuery,
280 + onDOMContentLoaded,
281 + isRTL,
282 + defineJQueryPlugin,
283 + execute
284 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.