@ulu/frontend 0.1.0-beta.4 → 0.1.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +332 -1
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +28 -27
- package/docs-dev/assets/main.js +832 -421
- package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
- package/docs-dev/assets/placeholder/icon-check.svg +1 -0
- package/docs-dev/assets/style.css +629 -233
- package/docs-dev/changelog/index.html +6079 -0
- package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
- package/docs-dev/demos/accordion/index.html +904 -321
- package/docs-dev/demos/basic-hero/index.html +111 -0
- package/docs-dev/demos/breakpoints-manager/index.html +5246 -0
- package/docs-dev/demos/button/index.html +916 -323
- package/docs-dev/demos/button-verbose/index.html +5238 -0
- package/docs-dev/demos/callout/index.html +951 -328
- package/docs-dev/demos/captioned-figure/index.html +904 -321
- package/docs-dev/demos/card/index.html +970 -748
- package/docs-dev/demos/card-grid/index.html +5357 -0
- package/docs-dev/demos/card-new/index.html +5088 -0
- package/docs-dev/demos/card-old/index.html +5223 -0
- package/docs-dev/demos/card.1/index.html +5223 -0
- package/docs-dev/demos/card.TRASH/index.html +5541 -0
- package/docs-dev/demos/counter-list/index.html +5224 -0
- package/docs-dev/demos/css-icons/index.html +904 -321
- package/docs-dev/demos/data-grid/index.html +1014 -511
- package/docs-dev/demos/data-table/index.html +1064 -348
- package/docs-dev/demos/details-group/index.html +5267 -0
- package/docs-dev/demos/file-save/index.html +904 -321
- package/docs-dev/demos/flipcard/index.html +904 -321
- package/docs-dev/demos/form-theme/index.html +922 -352
- package/docs-dev/demos/hero/index.html +12 -4
- package/docs-dev/demos/image-grid/index.html +12 -4
- package/docs-dev/demos/index.html +904 -321
- package/docs-dev/demos/list-inline/index.html +5220 -0
- package/docs-dev/demos/list-inline.1/index.html +4727 -0
- package/docs-dev/demos/list-lines/index.html +5210 -0
- package/docs-dev/demos/menu-stack/index.html +975 -377
- package/docs-dev/demos/modals/index.html +1010 -357
- package/docs-dev/demos/nav-strip/index.html +924 -377
- package/docs-dev/demos/overlay-section/index.html +979 -326
- package/docs-dev/demos/popovers/index.html +1152 -327
- package/docs-dev/demos/print/index.html +904 -321
- package/docs-dev/demos/pull-quote/index.html +904 -321
- package/docs-dev/demos/rule/index.html +952 -357
- package/docs-dev/demos/scroll-slider/index.html +72 -106
- package/docs-dev/demos/scrollpoints/index.html +905 -322
- package/docs-dev/demos/slider/index.html +12 -4
- package/docs-dev/demos/spoke-spinner/index.html +904 -321
- package/docs-dev/demos/sticky-list/index.html +5223 -0
- package/docs-dev/demos/tabs/index.html +944 -325
- package/docs-dev/demos/tag/index.html +904 -321
- package/docs-dev/demos/theme-toggle/index.html +5279 -0
- package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
- package/docs-dev/demos/tiles/index.html +904 -321
- package/docs-dev/demos/tooltip/index.html +904 -321
- package/docs-dev/guide/building-stylesheet/index.html +904 -321
- package/docs-dev/guide/developing-ulu-scss-module/index.html +904 -321
- package/docs-dev/guide/index.html +904 -321
- package/docs-dev/guide/updates-and-changes/index.html +5033 -0
- package/docs-dev/index.html +904 -321
- package/docs-dev/javascript/events/index.html +901 -320
- package/docs-dev/javascript/index.html +904 -321
- package/docs-dev/javascript/settings/index.html +5400 -0
- package/docs-dev/javascript/ui-breakpoints/index.html +916 -335
- package/docs-dev/javascript/ui-collapsible/index.html +901 -320
- package/docs-dev/javascript/ui-details-group/index.html +5322 -0
- package/docs-dev/javascript/ui-dialog/index.html +967 -371
- package/docs-dev/javascript/ui-flipcard/index.html +964 -327
- package/docs-dev/javascript/ui-grid/index.html +913 -358
- package/docs-dev/javascript/ui-modal-builder/index.html +914 -354
- package/docs-dev/javascript/ui-overflow-scroller/index.html +901 -320
- package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +901 -320
- package/docs-dev/javascript/ui-page/index.html +901 -320
- package/docs-dev/javascript/ui-popover/index.html +911 -334
- package/docs-dev/javascript/ui-print/index.html +901 -328
- package/docs-dev/javascript/ui-print-details/index.html +901 -320
- package/docs-dev/javascript/ui-programmatic-modal/index.html +901 -320
- package/docs-dev/javascript/ui-proxy-click/index.html +990 -324
- package/docs-dev/javascript/ui-resizer/index.html +901 -320
- package/docs-dev/javascript/ui-scroll-slider/index.html +941 -328
- package/docs-dev/javascript/ui-scrollpoint/index.html +907 -333
- package/docs-dev/javascript/ui-slider/index.html +1099 -327
- package/docs-dev/javascript/ui-tabs/index.html +914 -370
- package/docs-dev/javascript/ui-theme-toggle/index.html +5410 -0
- package/docs-dev/javascript/ui-tooltip/index.html +940 -363
- package/docs-dev/javascript/utils-class-logger/index.html +901 -320
- package/docs-dev/javascript/utils-css/index.html +5224 -0
- package/docs-dev/javascript/utils-dom/index.html +1037 -334
- package/docs-dev/javascript/utils-file-save/index.html +901 -320
- package/docs-dev/javascript/utils-floating-ui/index.html +901 -320
- package/docs-dev/javascript/utils-id/index.html +901 -320
- package/docs-dev/javascript/utils-pause-youtube-video/index.html +901 -320
- package/docs-dev/javascript/utils-system/index.html +5527 -0
- package/docs-dev/sass/base/color/index.html +901 -320
- package/docs-dev/sass/base/elements/index.html +973 -392
- package/docs-dev/sass/base/index/index.html +959 -378
- package/docs-dev/sass/base/index.html +904 -321
- package/docs-dev/sass/base/keyframes/index.html +901 -320
- package/docs-dev/sass/base/layout/index.html +966 -385
- package/docs-dev/sass/base/normalize/index.html +901 -320
- package/docs-dev/sass/base/print/index.html +901 -320
- package/docs-dev/sass/base/root/index.html +901 -320
- package/docs-dev/sass/base/typography/index.html +901 -320
- package/docs-dev/sass/components/accordion/index.html +1026 -445
- package/docs-dev/sass/components/adaptive-spacing/index.html +1027 -446
- package/docs-dev/sass/components/badge/index.html +1005 -424
- package/docs-dev/sass/components/basic-hero/index.html +5385 -0
- package/docs-dev/sass/components/button/index.html +952 -371
- package/docs-dev/sass/components/button-verbose/index.html +1089 -433
- package/docs-dev/sass/components/callout/index.html +1086 -482
- package/docs-dev/sass/components/captioned-figure/index.html +1070 -374
- package/docs-dev/sass/components/card/index.html +1121 -491
- package/docs-dev/sass/components/card-grid/index.html +973 -392
- package/docs-dev/sass/components/counter-list/index.html +5458 -0
- package/docs-dev/sass/components/css-icon/index.html +1052 -464
- package/docs-dev/sass/components/data-grid/index.html +1087 -499
- package/docs-dev/sass/components/data-table/index.html +1154 -381
- package/docs-dev/sass/components/fill-context/index.html +901 -320
- package/docs-dev/sass/components/flipcard/index.html +1071 -459
- package/docs-dev/sass/components/flipcard-grid/index.html +960 -379
- package/docs-dev/sass/components/form-theme/index.html +1349 -672
- package/docs-dev/sass/components/hero/index.html +1016 -387
- package/docs-dev/sass/components/horizontal-rule/index.html +959 -378
- package/docs-dev/sass/components/image-grid/index.html +966 -385
- package/docs-dev/sass/components/index/index.html +1004 -419
- package/docs-dev/sass/components/index.html +904 -321
- package/docs-dev/sass/components/links/index.html +901 -320
- package/docs-dev/sass/components/list-inline/index.html +5399 -0
- package/docs-dev/sass/components/list-lines/index.html +1009 -432
- package/docs-dev/sass/components/list-ordered/index.html +903 -322
- package/docs-dev/sass/components/list-unordered/index.html +901 -320
- package/docs-dev/sass/components/menu-stack/index.html +1050 -456
- package/docs-dev/sass/components/modal/index.html +1032 -444
- package/docs-dev/sass/components/nav-strip/index.html +1023 -442
- package/docs-dev/sass/components/overlay-section/index.html +1010 -429
- package/docs-dev/sass/components/pager/index.html +1017 -436
- package/docs-dev/sass/components/placeholder-block/index.html +1017 -436
- package/docs-dev/sass/components/popover/index.html +1068 -451
- package/docs-dev/sass/components/pull-quote/index.html +1017 -436
- package/docs-dev/sass/components/ratio-box/index.html +969 -388
- package/docs-dev/sass/components/rule/index.html +972 -391
- package/docs-dev/sass/components/scroll-slider/index.html +1019 -450
- package/docs-dev/sass/components/skip-link/index.html +961 -380
- package/docs-dev/sass/components/slider/index.html +1023 -442
- package/docs-dev/sass/components/spoke-spinner/index.html +961 -380
- package/docs-dev/sass/components/sticky-list/index.html +5603 -0
- package/docs-dev/sass/components/tabs/index.html +1020 -439
- package/docs-dev/sass/components/tag/index.html +1064 -483
- package/docs-dev/sass/components/tile-button/index.html +1004 -423
- package/docs-dev/sass/components/tile-grid/index.html +1045 -464
- package/docs-dev/sass/components/tile-grid-overlay/index.html +940 -359
- package/docs-dev/sass/components/vignette/index.html +965 -378
- package/docs-dev/sass/components/wysiwyg/index.html +968 -387
- package/docs-dev/sass/core/breakpoint/index.html +1045 -450
- package/docs-dev/sass/core/button/index.html +1438 -857
- package/docs-dev/sass/core/color/index.html +1084 -496
- package/docs-dev/sass/core/cssvar/index.html +950 -369
- package/docs-dev/sass/core/element/index.html +1504 -782
- package/docs-dev/sass/core/index.html +901 -320
- package/docs-dev/sass/core/layout/index.html +1062 -462
- package/docs-dev/sass/core/path/index.html +953 -372
- package/docs-dev/sass/core/selector/index.html +952 -371
- package/docs-dev/sass/core/typography/index.html +1171 -590
- package/docs-dev/sass/core/units/index.html +984 -403
- package/docs-dev/sass/core/utils/index.html +1941 -500
- package/docs-dev/sass/helpers/color/index.html +901 -320
- package/docs-dev/sass/helpers/display/index.html +902 -321
- package/docs-dev/sass/helpers/index/index.html +956 -375
- package/docs-dev/sass/helpers/index.html +904 -321
- package/docs-dev/sass/helpers/print/index.html +843 -292
- package/docs-dev/sass/helpers/typography/index.html +901 -320
- package/docs-dev/sass/helpers/units/index.html +950 -369
- package/docs-dev/sass/helpers/utilities/index.html +903 -322
- package/docs-dev/sass/index.html +904 -321
- package/js/index.js +1 -0
- package/js/settings.js +95 -0
- package/js/ui/breakpoints.js +19 -16
- package/js/ui/collapsible.js +8 -1
- package/js/ui/details-group.js +112 -0
- package/js/ui/dialog.js +90 -42
- package/js/ui/dialog.todo +2 -36
- package/js/ui/flipcard.js +37 -57
- package/js/ui/grid.js +15 -13
- package/js/ui/index.js +1 -0
- package/js/ui/modal-builder.js +45 -54
- package/js/ui/overflow-scroller.js +6 -4
- package/js/ui/popover.js +38 -38
- package/js/ui/print.js +16 -25
- package/js/ui/programmatic-modal.js +9 -3
- package/js/ui/proxy-click.js +50 -36
- package/js/ui/scroll-slider.js +24 -30
- package/js/ui/scrollpoint.js +28 -64
- package/js/ui/slider.js +61 -62
- package/js/ui/tabs.js +23 -36
- package/js/ui/theme-toggle.js +331 -94
- package/js/ui/tooltip.js +27 -32
- package/js/utils/css.js +13 -0
- package/js/utils/dom.js +69 -4
- package/js/utils/font-awesome.js +18 -0
- package/js/utils/index.js +2 -1
- package/js/utils/system.js +154 -0
- package/package.json +10 -7
- package/scss/_breakpoint.scss +16 -3
- package/scss/_color.scss +9 -2
- package/scss/_element.scss +91 -0
- package/scss/_layout.scss +7 -8
- package/scss/_utils.scss +248 -13
- package/scss/components/README.todos +14 -0
- package/scss/components/_accordion.scss +18 -20
- package/scss/components/_badge.scss +3 -2
- package/scss/components/_basic-hero.scss +112 -0
- package/scss/components/_button-verbose.scss +102 -20
- package/scss/components/_callout.scss +127 -79
- package/scss/components/_captioned-figure.scss +23 -5
- package/scss/components/_card-grid.scss +1 -1
- package/scss/components/_card.scss +242 -88
- package/scss/components/_counter-list.scss +133 -0
- package/scss/components/_css-icon.scss +33 -28
- package/scss/components/_data-grid.scss +38 -9
- package/scss/components/_data-table.scss +44 -4
- package/scss/components/_flipcard.scss +21 -15
- package/scss/components/_form-theme.scss +146 -135
- package/scss/components/_hero.scss +12 -10
- package/scss/components/_index.scss +24 -0
- package/scss/components/_list-inline.scss +80 -0
- package/scss/components/_list-lines.scss +44 -33
- package/scss/components/_list-ordered.scss +0 -1
- package/scss/components/_menu-stack.scss +42 -26
- package/scss/components/_modal.scss +29 -19
- package/scss/components/_nav-strip.scss +25 -16
- package/scss/components/_overlay-section.scss +4 -6
- package/scss/components/_pager.scss +6 -6
- package/scss/components/_placeholder-block.scss +4 -4
- package/scss/components/_popover.scss +174 -73
- package/scss/components/_pull-quote.scss +13 -13
- package/scss/components/_ratio-box.scss +2 -5
- package/scss/components/_rule.scss +1 -1
- package/scss/components/_scroll-slider.scss +2 -6
- package/scss/components/_skip-link.scss +2 -1
- package/scss/components/_slider.scss +17 -38
- package/scss/components/_spoke-spinner.scss +2 -2
- package/scss/components/_sticky-list.scss +206 -0
- package/scss/components/_tabs.scss +4 -2
- package/scss/components/_tag.scss +1 -1
- package/scss/components/_vignette.scss +3 -5
- package/scss/helpers/_display.scss +15 -18
- package/scss/helpers/_print.scss +12 -7
- package/scss/helpers/_utilities.scss +42 -32
- package/types/index.d.ts +1 -0
- package/types/settings.d.ts +66 -0
- package/types/settings.d.ts.map +1 -0
- package/types/ui/breakpoints.d.ts +14 -14
- package/types/ui/breakpoints.d.ts.map +1 -1
- package/types/ui/collapsible.d.ts.map +1 -1
- package/types/ui/details-group.d.ts +38 -0
- package/types/ui/details-group.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +20 -14
- package/types/ui/dialog.d.ts.map +1 -1
- package/types/ui/flipcard.d.ts +16 -10
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +4 -6
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +1 -0
- package/types/ui/modal-builder.d.ts +8 -11
- package/types/ui/modal-builder.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +2 -2
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/popover.d.ts +6 -7
- package/types/ui/popover.d.ts.map +1 -1
- package/types/ui/print.d.ts +0 -4
- package/types/ui/print.d.ts.map +1 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +19 -3
- package/types/ui/proxy-click.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +5 -7
- package/types/ui/scroll-slider.d.ts.map +1 -1
- package/types/ui/scrollpoint.d.ts +3 -8
- package/types/ui/scrollpoint.d.ts.map +1 -1
- package/types/ui/slider.d.ts +24 -14
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +6 -8
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +51 -7
- package/types/ui/theme-toggle.d.ts.map +1 -1
- package/types/ui/tooltip.d.ts +3 -5
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/css.d.ts +11 -0
- package/types/utils/css.d.ts.map +1 -0
- package/types/utils/dom.d.ts +36 -4
- package/types/utils/dom.d.ts.map +1 -1
- package/types/utils/font-awesome.d.ts +5 -0
- package/types/utils/font-awesome.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/system.d.ts +113 -0
- package/types/utils/system.d.ts.map +1 -0
package/docs-dev/assets/main.js
CHANGED
|
@@ -73,6 +73,48 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
|
73
73
|
return baseModule().catch(handlePreloadError);
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
+
const defaults$b = {
|
|
77
|
+
iconClassClose: "css-icon css-icon--close",
|
|
78
|
+
iconClassDragX: "css-icon css-icon--drag-x",
|
|
79
|
+
iconClassPrevious: "css-icon css-icon--angle-left",
|
|
80
|
+
iconClassNext: "css-icon css-icon--angle-right"
|
|
81
|
+
};
|
|
82
|
+
let currentSettings = { ...defaults$b };
|
|
83
|
+
function getDefaultSettings() {
|
|
84
|
+
return { ...defaults$b };
|
|
85
|
+
}
|
|
86
|
+
function updateSettings(changes) {
|
|
87
|
+
Object.assign(currentSettings, changes);
|
|
88
|
+
}
|
|
89
|
+
function getSettings() {
|
|
90
|
+
return { ...currentSettings };
|
|
91
|
+
}
|
|
92
|
+
function getSetting(key2) {
|
|
93
|
+
if (!currentSettings.hasOwnProperty(key2)) {
|
|
94
|
+
console.warn(`Attempted to access non-existent setting: ${key2}`);
|
|
95
|
+
return void 0;
|
|
96
|
+
}
|
|
97
|
+
return currentSettings[key2];
|
|
98
|
+
}
|
|
99
|
+
function updateSetting(key2, value) {
|
|
100
|
+
currentSettings[key2] = value;
|
|
101
|
+
}
|
|
102
|
+
function wrapSettingString(key2) {
|
|
103
|
+
return {
|
|
104
|
+
toString() {
|
|
105
|
+
return getSetting(key2);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const settings = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
110
|
+
__proto__: null,
|
|
111
|
+
getDefaultSettings,
|
|
112
|
+
getSetting,
|
|
113
|
+
getSettings,
|
|
114
|
+
updateSetting,
|
|
115
|
+
updateSettings,
|
|
116
|
+
wrapSettingString
|
|
117
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
118
|
function debounce(callback, wait, immediate, valueThis) {
|
|
77
119
|
var timeout;
|
|
78
120
|
return function executedFunction() {
|
|
@@ -212,10 +254,34 @@ function getElement(target, context = document) {
|
|
|
212
254
|
} else if (target instanceof Element) {
|
|
213
255
|
return target;
|
|
214
256
|
} else {
|
|
215
|
-
console.warn("
|
|
257
|
+
console.warn("getElement: Invalid target type (expected String/Node)", target);
|
|
216
258
|
return null;
|
|
217
259
|
}
|
|
218
260
|
}
|
|
261
|
+
function getElements(target, context = document) {
|
|
262
|
+
if (typeof target === "string") {
|
|
263
|
+
return [...context.querySelectorAll(target)];
|
|
264
|
+
} else if (target instanceof Element) {
|
|
265
|
+
return [target];
|
|
266
|
+
} else if (Array.isArray(target) || target instanceof NodeList) {
|
|
267
|
+
return [...target];
|
|
268
|
+
} else {
|
|
269
|
+
console.warn("getElement: Invalid target type (expected String/Node/Array/Node List)", target);
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function resolveClasses(classes) {
|
|
274
|
+
if (typeof classes === "string") {
|
|
275
|
+
return classes.split(" ").filter((c) => c !== "");
|
|
276
|
+
} else if (Array.isArray(classes)) {
|
|
277
|
+
return classes;
|
|
278
|
+
} else if (!classes) {
|
|
279
|
+
return [];
|
|
280
|
+
} else {
|
|
281
|
+
console.warn("resolveClassArray: Invalid class input type.", classes);
|
|
282
|
+
return [];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
219
285
|
function addScrollbarProperty(element = document.body, container2 = window, propName = "--ulu-scrollbar-width") {
|
|
220
286
|
const scrollbarWidth = container2.innerWidth - element.clientWidth;
|
|
221
287
|
element.style.setProperty(propName, `${scrollbarWidth}px`);
|
|
@@ -226,16 +292,18 @@ const dom = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
226
292
|
getDatasetJson,
|
|
227
293
|
getDatasetOptionalJson,
|
|
228
294
|
getElement,
|
|
295
|
+
getElements,
|
|
229
296
|
regexJsonString,
|
|
297
|
+
resolveClasses,
|
|
230
298
|
setPositionClasses,
|
|
231
299
|
wasClickOutside
|
|
232
300
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
233
|
-
function init$
|
|
301
|
+
function init$h() {
|
|
234
302
|
addScrollbarProperty();
|
|
235
303
|
}
|
|
236
304
|
const page = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
237
305
|
__proto__: null,
|
|
238
|
-
init: init$
|
|
306
|
+
init: init$h
|
|
239
307
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
240
308
|
function removeArrayElement(array, element) {
|
|
241
309
|
var index2 = array.indexOf(element);
|
|
@@ -243,7 +311,7 @@ function removeArrayElement(array, element) {
|
|
|
243
311
|
array.splice(index2, 1);
|
|
244
312
|
}
|
|
245
313
|
}
|
|
246
|
-
const config = {
|
|
314
|
+
const config$1 = {
|
|
247
315
|
debug: false,
|
|
248
316
|
warningsAlways: true,
|
|
249
317
|
errorsAlways: true,
|
|
@@ -251,7 +319,7 @@ const config = {
|
|
|
251
319
|
};
|
|
252
320
|
const hasConsole = "console" in window;
|
|
253
321
|
function allow(context) {
|
|
254
|
-
return hasConsole && config.debug && ((context == null ? void 0 : context.debug) || context == null);
|
|
322
|
+
return hasConsole && config$1.debug && ((context == null ? void 0 : context.debug) || context == null);
|
|
255
323
|
}
|
|
256
324
|
function getName(context) {
|
|
257
325
|
var _a;
|
|
@@ -260,12 +328,12 @@ function getName(context) {
|
|
|
260
328
|
function output(method, context, messages) {
|
|
261
329
|
const label = getName(context) || "Logger";
|
|
262
330
|
console[method](label, ...messages);
|
|
263
|
-
if (config.outputContext) {
|
|
331
|
+
if (config$1.outputContext) {
|
|
264
332
|
console.log("Context:\n", context);
|
|
265
333
|
}
|
|
266
334
|
}
|
|
267
335
|
function set(changes) {
|
|
268
|
-
Object.assign(config, changes);
|
|
336
|
+
Object.assign(config$1, changes);
|
|
269
337
|
}
|
|
270
338
|
function log(context, ...messages) {
|
|
271
339
|
if (allow(context)) {
|
|
@@ -273,12 +341,12 @@ function log(context, ...messages) {
|
|
|
273
341
|
}
|
|
274
342
|
}
|
|
275
343
|
function logWarning(context, ...messages) {
|
|
276
|
-
if (config.warningsAlways || allow(context)) {
|
|
344
|
+
if (config$1.warningsAlways || allow(context)) {
|
|
277
345
|
output("warn", context, messages);
|
|
278
346
|
}
|
|
279
347
|
}
|
|
280
348
|
function logError$1(context, ...messages) {
|
|
281
|
-
if (config.errorsAlways || allow(context)) {
|
|
349
|
+
if (config$1.errorsAlways || allow(context)) {
|
|
282
350
|
output("error", context, messages);
|
|
283
351
|
}
|
|
284
352
|
}
|
|
@@ -566,15 +634,15 @@ const _Collapsible = class _Collapsible {
|
|
|
566
634
|
logError$1(this, "missing required elements (trigger or content)");
|
|
567
635
|
return;
|
|
568
636
|
}
|
|
569
|
-
const
|
|
637
|
+
const options = Object.assign({}, _Collapsible.defaults, config2);
|
|
570
638
|
this.elements = elements;
|
|
571
|
-
this.options =
|
|
639
|
+
this.options = options;
|
|
572
640
|
this.isOpen = false;
|
|
573
641
|
this.handlers = {};
|
|
574
642
|
ensureId(trigger);
|
|
575
643
|
ensureId(content);
|
|
576
644
|
this.debugLog(this, this);
|
|
577
|
-
if (!
|
|
645
|
+
if (!options.selfManaged) {
|
|
578
646
|
this.attachHandlers();
|
|
579
647
|
}
|
|
580
648
|
this.setup();
|
|
@@ -748,11 +816,11 @@ const _Resizer = class _Resizer {
|
|
|
748
816
|
* @param {Boolean} options.overrideMaxWidth When script is activated by handle remove the elements max-width and allow the width of the resize to exceed the max (default false)
|
|
749
817
|
* @param {Boolean} options.fromLeft The script should assume the handle is on the left side of the element
|
|
750
818
|
*/
|
|
751
|
-
constructor(container2, control,
|
|
819
|
+
constructor(container2, control, options) {
|
|
752
820
|
if (!control || !container2) {
|
|
753
821
|
logError$1(this, "Missing required elements 'control' or 'container'");
|
|
754
822
|
}
|
|
755
|
-
this.options = Object.assign({}, _Resizer.defaults,
|
|
823
|
+
this.options = Object.assign({}, _Resizer.defaults, options);
|
|
756
824
|
this.container = container2;
|
|
757
825
|
this.control = control;
|
|
758
826
|
this.handlerMousedown = this.onMousedown.bind(this);
|
|
@@ -823,16 +891,16 @@ const pauseYoutubeVideo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.d
|
|
|
823
891
|
pauseVideos: pauseVideos$1,
|
|
824
892
|
prepVideos: prepVideos$1
|
|
825
893
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
826
|
-
const attrs$
|
|
894
|
+
const attrs$d = {
|
|
827
895
|
init: "data-ulu-dialog-init",
|
|
828
896
|
dialog: "data-ulu-dialog",
|
|
829
897
|
trigger: "data-ulu-dialog-trigger",
|
|
830
898
|
close: "data-ulu-dialog-close"
|
|
831
899
|
};
|
|
832
|
-
const attrSelector$
|
|
833
|
-
const attrSelectorInitial$
|
|
834
|
-
const queryAllInitial$
|
|
835
|
-
const defaults$
|
|
900
|
+
const attrSelector$d = (key2) => `[${attrs$d[key2]}]`;
|
|
901
|
+
const attrSelectorInitial$9 = (key2) => `${attrSelector$d(key2)}:not([${attrs$d.init}])`;
|
|
902
|
+
const queryAllInitial$3 = (key2) => document.querySelectorAll(attrSelectorInitial$9(key2));
|
|
903
|
+
const defaults$a = {
|
|
836
904
|
/**
|
|
837
905
|
* Use non-modal interface for dialog
|
|
838
906
|
*/
|
|
@@ -851,23 +919,23 @@ const defaults$7 = {
|
|
|
851
919
|
*/
|
|
852
920
|
pauseVideos: true
|
|
853
921
|
};
|
|
854
|
-
let currentDefaults$
|
|
855
|
-
function setDefaults$
|
|
856
|
-
currentDefaults$
|
|
922
|
+
let currentDefaults$3 = { ...defaults$a };
|
|
923
|
+
function setDefaults$3(options) {
|
|
924
|
+
currentDefaults$3 = Object.assign({}, currentDefaults$3, options);
|
|
857
925
|
}
|
|
858
|
-
function init$
|
|
859
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
860
|
-
setup$
|
|
926
|
+
function init$g() {
|
|
927
|
+
document.addEventListener(getName$1("pageModified"), setup$d);
|
|
928
|
+
setup$d();
|
|
861
929
|
}
|
|
862
|
-
function setup$
|
|
863
|
-
const dialogs = queryAllInitial$
|
|
930
|
+
function setup$d() {
|
|
931
|
+
const dialogs = queryAllInitial$3("dialog");
|
|
864
932
|
dialogs.forEach(setupDialog);
|
|
865
|
-
const triggers = queryAllInitial$
|
|
933
|
+
const triggers = queryAllInitial$3("trigger");
|
|
866
934
|
triggers.forEach(setupTrigger$2);
|
|
867
935
|
}
|
|
868
936
|
function setupTrigger$2(trigger) {
|
|
869
937
|
trigger.addEventListener("click", handleTrigger);
|
|
870
|
-
trigger.setAttribute(attrs$
|
|
938
|
+
trigger.setAttribute(attrs$d.init, "");
|
|
871
939
|
function handleTrigger() {
|
|
872
940
|
var _a;
|
|
873
941
|
const id2 = trigger.dataset.uluDialogTrigger;
|
|
@@ -880,26 +948,26 @@ function setupTrigger$2(trigger) {
|
|
|
880
948
|
console.error("Attempted to trigger non <dialog> element. Did you mean to use modal builder?");
|
|
881
949
|
return;
|
|
882
950
|
}
|
|
883
|
-
const
|
|
884
|
-
dialog2[
|
|
951
|
+
const options = getDialogOptions(dialog2);
|
|
952
|
+
dialog2[options.nonModal ? "show" : "showModal"]();
|
|
885
953
|
}
|
|
886
954
|
}
|
|
887
955
|
function setupDialog(dialog2) {
|
|
888
|
-
const
|
|
956
|
+
const options = getDialogOptions(dialog2);
|
|
889
957
|
dialog2.addEventListener("click", handleClicks);
|
|
890
|
-
dialog2.setAttribute(attrs$
|
|
891
|
-
if (
|
|
958
|
+
dialog2.setAttribute(attrs$d.init, "");
|
|
959
|
+
if (options.documentEnd) {
|
|
892
960
|
document.body.appendChild(dialog2);
|
|
893
961
|
}
|
|
894
|
-
if (
|
|
962
|
+
if (options.pauseVideos) {
|
|
895
963
|
prepVideos(dialog2);
|
|
896
964
|
}
|
|
897
965
|
function handleClicks(event) {
|
|
898
966
|
const { target } = event;
|
|
899
967
|
const closeFromButton = target.closest("[data-ulu-dialog-close]");
|
|
900
|
-
let closeFromOutside =
|
|
968
|
+
let closeFromOutside = options.clickOutsideCloses && target === dialog2 && wasClickOutside(dialog2, event);
|
|
901
969
|
if (closeFromOutside || closeFromButton) {
|
|
902
|
-
if (
|
|
970
|
+
if (options.pauseVideos) {
|
|
903
971
|
pauseVideos(dialog2);
|
|
904
972
|
}
|
|
905
973
|
dialog2.close();
|
|
@@ -907,8 +975,8 @@ function setupDialog(dialog2) {
|
|
|
907
975
|
}
|
|
908
976
|
}
|
|
909
977
|
function getDialogOptions(dialog2) {
|
|
910
|
-
const
|
|
911
|
-
return Object.assign({}, currentDefaults$
|
|
978
|
+
const options = getDatasetJson(dialog2, "uluDialog");
|
|
979
|
+
return Object.assign({}, currentDefaults$3, options);
|
|
912
980
|
}
|
|
913
981
|
function prepVideos(dialog2) {
|
|
914
982
|
prepVideos$1(dialog2);
|
|
@@ -920,22 +988,22 @@ function pauseVideos(dialog2) {
|
|
|
920
988
|
}
|
|
921
989
|
const dialog = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
922
990
|
__proto__: null,
|
|
923
|
-
attrs: attrs$
|
|
924
|
-
defaults: defaults$
|
|
991
|
+
attrs: attrs$d,
|
|
992
|
+
defaults: defaults$a,
|
|
925
993
|
getDialogOptions,
|
|
926
|
-
init: init$
|
|
927
|
-
setDefaults: setDefaults$
|
|
928
|
-
setup: setup$
|
|
994
|
+
init: init$g,
|
|
995
|
+
setDefaults: setDefaults$3,
|
|
996
|
+
setup: setup$d,
|
|
929
997
|
setupDialog,
|
|
930
998
|
setupTrigger: setupTrigger$2
|
|
931
999
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
932
|
-
const attrs$
|
|
1000
|
+
const attrs$c = {
|
|
933
1001
|
builder: "data-ulu-modal-builder",
|
|
934
1002
|
body: "data-ulu-modal-builder-body",
|
|
935
1003
|
resizer: "data-ulu-modal-builder-resizer"
|
|
936
1004
|
};
|
|
937
|
-
const attrSelector$
|
|
938
|
-
const defaults$
|
|
1005
|
+
const attrSelector$c = (key2) => `[${attrs$c[key2]}]`;
|
|
1006
|
+
const defaults$9 = {
|
|
939
1007
|
title: null,
|
|
940
1008
|
titleIcon: null,
|
|
941
1009
|
nonModal: false,
|
|
@@ -948,8 +1016,8 @@ const defaults$6 = {
|
|
|
948
1016
|
print: false,
|
|
949
1017
|
noMinHeight: false,
|
|
950
1018
|
class: "",
|
|
951
|
-
classCloseIcon: "
|
|
952
|
-
classResizerIcon: "
|
|
1019
|
+
classCloseIcon: wrapSettingString("iconClassClose"),
|
|
1020
|
+
classResizerIcon: wrapSettingString("iconClassDragX"),
|
|
953
1021
|
debug: false,
|
|
954
1022
|
templateCloseIcon(config2) {
|
|
955
1023
|
return `<span class="modal__close-icon ${config2.classCloseIcon}" aria-hidden="true"></span>`;
|
|
@@ -983,38 +1051,38 @@ const defaults$6 = {
|
|
|
983
1051
|
${config2.titleIcon ? `<span class="modal__title-icon ${config2.titleIcon}" aria-hidden="true"></span>` : ""}
|
|
984
1052
|
<span class="modal__title-text">${config2.title}</span>
|
|
985
1053
|
</h2>
|
|
986
|
-
<button class="modal__close" aria-label="Close modal" ${attrs$
|
|
1054
|
+
<button class="modal__close" aria-label="Close modal" ${attrs$d.close} autofocus>
|
|
987
1055
|
${config2.templateCloseIcon(config2)}
|
|
988
1056
|
</button>
|
|
989
1057
|
</header>
|
|
990
1058
|
` : ""}
|
|
991
|
-
<div class="modal__body" ${attrs$
|
|
992
|
-
${config2.hasResizer ? `<div class="modal__resizer" ${attrs$
|
|
1059
|
+
<div class="modal__body" ${attrs$c.body}></div>
|
|
1060
|
+
${config2.hasResizer ? `<div class="modal__resizer" ${attrs$c.resizer}>
|
|
993
1061
|
${config2.templateResizerIcon(config2)}
|
|
994
1062
|
</div>` : ""}
|
|
995
1063
|
</div>
|
|
996
1064
|
`;
|
|
997
1065
|
}
|
|
998
1066
|
};
|
|
999
|
-
let currentDefaults$
|
|
1000
|
-
function setDefaults$
|
|
1001
|
-
currentDefaults$
|
|
1067
|
+
let currentDefaults$2 = { ...defaults$9 };
|
|
1068
|
+
function setDefaults$2(options) {
|
|
1069
|
+
currentDefaults$2 = Object.assign({}, currentDefaults$2, options);
|
|
1002
1070
|
}
|
|
1003
|
-
function init$
|
|
1004
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
1005
|
-
setup$
|
|
1071
|
+
function init$f() {
|
|
1072
|
+
document.addEventListener(getName$1("pageModified"), setup$c);
|
|
1073
|
+
setup$c();
|
|
1006
1074
|
}
|
|
1007
|
-
function setup$
|
|
1008
|
-
const builders = document.querySelectorAll(attrSelector$
|
|
1075
|
+
function setup$c() {
|
|
1076
|
+
const builders = document.querySelectorAll(attrSelector$c("builder"));
|
|
1009
1077
|
builders.forEach(setupBuilder);
|
|
1010
1078
|
}
|
|
1011
1079
|
function setupBuilder(element) {
|
|
1012
|
-
const
|
|
1013
|
-
element.removeAttribute(attrs$
|
|
1014
|
-
buildModal(element,
|
|
1080
|
+
const options = getDatasetJson(element, "uluModalBuilder");
|
|
1081
|
+
element.removeAttribute(attrs$c.builder);
|
|
1082
|
+
buildModal(element, options);
|
|
1015
1083
|
}
|
|
1016
|
-
function buildModal(content,
|
|
1017
|
-
const config2 = Object.assign({}, currentDefaults$
|
|
1084
|
+
function buildModal(content, options) {
|
|
1085
|
+
const config2 = Object.assign({}, currentDefaults$2, options);
|
|
1018
1086
|
if (config2.position !== "center" && config2.allowResize) {
|
|
1019
1087
|
config2.hasResizer = true;
|
|
1020
1088
|
}
|
|
@@ -1026,16 +1094,16 @@ function buildModal(content, options2) {
|
|
|
1026
1094
|
}
|
|
1027
1095
|
const markup = config2.template(content.id, config2);
|
|
1028
1096
|
const modal = createElementFromHtml(markup.trim());
|
|
1029
|
-
const selectChild = (key2) => modal.querySelector(attrSelector$
|
|
1030
|
-
const
|
|
1097
|
+
const selectChild = (key2) => modal.querySelector(attrSelector$c(key2));
|
|
1098
|
+
const body = selectChild("body");
|
|
1031
1099
|
const resizer2 = selectChild("resizer");
|
|
1032
1100
|
const dialogOptions = separateDialogOptions(config2);
|
|
1033
1101
|
content.removeAttribute("id");
|
|
1034
1102
|
content.removeAttribute("hidden");
|
|
1035
|
-
content.removeAttribute(attrs$
|
|
1103
|
+
content.removeAttribute(attrs$c.builder);
|
|
1036
1104
|
content.parentNode.replaceChild(modal, content);
|
|
1037
|
-
|
|
1038
|
-
modal.setAttribute(attrs$
|
|
1105
|
+
body.appendChild(content);
|
|
1106
|
+
modal.setAttribute(attrs$d.dialog, JSON.stringify(dialogOptions));
|
|
1039
1107
|
if (config2.hasResizer) {
|
|
1040
1108
|
new Resizer(modal, resizer2, {
|
|
1041
1109
|
fromLeft: config2.position === "right"
|
|
@@ -1054,7 +1122,7 @@ function buildModal(content, options2) {
|
|
|
1054
1122
|
return { modal };
|
|
1055
1123
|
}
|
|
1056
1124
|
function separateDialogOptions(config2) {
|
|
1057
|
-
return Object.keys(defaults$
|
|
1125
|
+
return Object.keys(defaults$a).reduce((acc, key2) => {
|
|
1058
1126
|
if (key2 in config2) {
|
|
1059
1127
|
acc[key2] = config2[key2];
|
|
1060
1128
|
}
|
|
@@ -1064,10 +1132,10 @@ function separateDialogOptions(config2) {
|
|
|
1064
1132
|
const modalBuilder = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1065
1133
|
__proto__: null,
|
|
1066
1134
|
buildModal,
|
|
1067
|
-
defaults: defaults$
|
|
1068
|
-
init: init$
|
|
1069
|
-
setDefaults: setDefaults$
|
|
1070
|
-
setup: setup$
|
|
1135
|
+
defaults: defaults$9,
|
|
1136
|
+
init: init$f,
|
|
1137
|
+
setDefaults: setDefaults$2,
|
|
1138
|
+
setup: setup$c,
|
|
1071
1139
|
setupBuilder
|
|
1072
1140
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1073
1141
|
const linebreaks = /(\r\n|\n|\r)/gm;
|
|
@@ -1191,50 +1259,50 @@ __publicField(_Flipcard, "defaults", {
|
|
|
1191
1259
|
}
|
|
1192
1260
|
});
|
|
1193
1261
|
let Flipcard = _Flipcard;
|
|
1194
|
-
const attrs$
|
|
1262
|
+
const attrs$b = {
|
|
1195
1263
|
init: "data-ulu-flipcard-init",
|
|
1196
1264
|
flipcard: "data-ulu-flipcard",
|
|
1197
1265
|
front: "data-ulu-flipcard-front",
|
|
1198
1266
|
back: "data-ulu-flipcard-back"
|
|
1199
1267
|
};
|
|
1200
|
-
const attrSelector$
|
|
1201
|
-
const attrSelectorInitial$
|
|
1268
|
+
const attrSelector$b = (key2) => `[${attrs$b[key2]}]`;
|
|
1269
|
+
const attrSelectorInitial$8 = (key2) => `${attrSelector$b(key2)}:not([${attrs$b.init}])`;
|
|
1202
1270
|
const instances$4 = [];
|
|
1203
|
-
function init$
|
|
1204
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
1205
|
-
setup$
|
|
1271
|
+
function init$e() {
|
|
1272
|
+
document.addEventListener(getName$1("pageModified"), setup$b);
|
|
1273
|
+
setup$b();
|
|
1206
1274
|
}
|
|
1207
|
-
function setup$
|
|
1208
|
-
const builders = document.querySelectorAll(attrSelectorInitial$
|
|
1275
|
+
function setup$b() {
|
|
1276
|
+
const builders = document.querySelectorAll(attrSelectorInitial$8("flipcard"));
|
|
1209
1277
|
builders.forEach(setupFlipcard);
|
|
1210
1278
|
}
|
|
1211
1279
|
function setupFlipcard(container2) {
|
|
1212
|
-
container2.setAttribute(attrs$
|
|
1213
|
-
const
|
|
1214
|
-
const config2 = Object.assign({},
|
|
1215
|
-
const front = container2.querySelector(attrSelectorInitial$
|
|
1216
|
-
const back = container2.querySelector(attrSelectorInitial$
|
|
1280
|
+
container2.setAttribute(attrs$b.init, "");
|
|
1281
|
+
const options = getDatasetOptionalJson(container2, "uluFlipcard");
|
|
1282
|
+
const config2 = Object.assign({}, options);
|
|
1283
|
+
const front = container2.querySelector(attrSelectorInitial$8("front"));
|
|
1284
|
+
const back = container2.querySelector(attrSelectorInitial$8("back"));
|
|
1217
1285
|
instances$4.push(new Flipcard(container2, front, back, config2));
|
|
1218
1286
|
}
|
|
1219
1287
|
const flipcard = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1220
1288
|
__proto__: null,
|
|
1221
1289
|
Flipcard,
|
|
1222
|
-
attrs: attrs$
|
|
1223
|
-
init: init$
|
|
1224
|
-
setup: setup$
|
|
1290
|
+
attrs: attrs$b,
|
|
1291
|
+
init: init$e,
|
|
1292
|
+
setup: setup$b
|
|
1225
1293
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1226
|
-
function init$
|
|
1227
|
-
document.addEventListener(getName$1("pageModified"), () => setup$
|
|
1228
|
-
document.addEventListener(getName$1("pageResized"), () => setup$
|
|
1229
|
-
setup$
|
|
1294
|
+
function init$d(selector = "[data-grid]", classes) {
|
|
1295
|
+
document.addEventListener(getName$1("pageModified"), () => setup$a(selector, classes));
|
|
1296
|
+
document.addEventListener(getName$1("pageResized"), () => setup$a(selector, classes));
|
|
1297
|
+
setup$a(selector, classes);
|
|
1230
1298
|
}
|
|
1231
|
-
function setup$
|
|
1299
|
+
function setup$a(selector, classes) {
|
|
1232
1300
|
document.querySelectorAll(selector).forEach((element) => setPositionClasses(element, classes || void 0));
|
|
1233
1301
|
}
|
|
1234
1302
|
const grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1235
1303
|
__proto__: null,
|
|
1236
|
-
init: init$
|
|
1237
|
-
setup: setup$
|
|
1304
|
+
init: init$d,
|
|
1305
|
+
setup: setup$a
|
|
1238
1306
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1239
1307
|
function createPager() {
|
|
1240
1308
|
return function pager(instance, dir) {
|
|
@@ -1348,10 +1416,10 @@ const _OverflowScroller = class _OverflowScroller {
|
|
|
1348
1416
|
return button;
|
|
1349
1417
|
}
|
|
1350
1418
|
getControlContent(action) {
|
|
1351
|
-
const classes = this.options[action === "next" ? "
|
|
1419
|
+
const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
|
|
1352
1420
|
return `
|
|
1353
1421
|
<span class="hidden-visually">${action}</span>
|
|
1354
|
-
<span class="${classes
|
|
1422
|
+
<span class="${classes}" aria-hidden="true"></span>
|
|
1355
1423
|
`;
|
|
1356
1424
|
}
|
|
1357
1425
|
onScroll(event) {
|
|
@@ -1433,8 +1501,8 @@ __publicField(_OverflowScroller, "defaults", {
|
|
|
1433
1501
|
offsetEnd: 100,
|
|
1434
1502
|
amount: "auto",
|
|
1435
1503
|
buttonClasses: ["button", "button--icon"],
|
|
1436
|
-
|
|
1437
|
-
|
|
1504
|
+
iconClassPrevious: wrapSettingString("iconClassPrevious"),
|
|
1505
|
+
iconClassNext: wrapSettingString("iconClassNext")
|
|
1438
1506
|
});
|
|
1439
1507
|
let OverflowScroller = _OverflowScroller;
|
|
1440
1508
|
const overflowScroller = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1707,10 +1775,10 @@ const computePosition$1 = async (reference, floating, config2) => {
|
|
|
1707
1775
|
middlewareData
|
|
1708
1776
|
};
|
|
1709
1777
|
};
|
|
1710
|
-
async function detectOverflow(state,
|
|
1778
|
+
async function detectOverflow(state, options) {
|
|
1711
1779
|
var _await$platform$isEle;
|
|
1712
|
-
if (
|
|
1713
|
-
|
|
1780
|
+
if (options === void 0) {
|
|
1781
|
+
options = {};
|
|
1714
1782
|
}
|
|
1715
1783
|
const {
|
|
1716
1784
|
x,
|
|
@@ -1726,7 +1794,7 @@ async function detectOverflow(state, options2) {
|
|
|
1726
1794
|
elementContext = "floating",
|
|
1727
1795
|
altBoundary = false,
|
|
1728
1796
|
padding = 0
|
|
1729
|
-
} = evaluate(
|
|
1797
|
+
} = evaluate(options, state);
|
|
1730
1798
|
const paddingObject = getPaddingObject(padding);
|
|
1731
1799
|
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
1732
1800
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
@@ -1763,9 +1831,9 @@ async function detectOverflow(state, options2) {
|
|
|
1763
1831
|
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
1764
1832
|
};
|
|
1765
1833
|
}
|
|
1766
|
-
const arrow$1 = (
|
|
1834
|
+
const arrow$1 = (options) => ({
|
|
1767
1835
|
name: "arrow",
|
|
1768
|
-
options
|
|
1836
|
+
options,
|
|
1769
1837
|
async fn(state) {
|
|
1770
1838
|
const {
|
|
1771
1839
|
x,
|
|
@@ -1779,7 +1847,7 @@ const arrow$1 = (options2) => ({
|
|
|
1779
1847
|
const {
|
|
1780
1848
|
element,
|
|
1781
1849
|
padding = 0
|
|
1782
|
-
} = evaluate(
|
|
1850
|
+
} = evaluate(options, state) || {};
|
|
1783
1851
|
if (element == null) {
|
|
1784
1852
|
return {};
|
|
1785
1853
|
}
|
|
@@ -1825,13 +1893,13 @@ const arrow$1 = (options2) => ({
|
|
|
1825
1893
|
};
|
|
1826
1894
|
}
|
|
1827
1895
|
});
|
|
1828
|
-
const flip$1 = function(
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
1896
|
+
const flip$1 = function(options) {
|
|
1897
|
+
if (options === void 0) {
|
|
1898
|
+
options = {};
|
|
1831
1899
|
}
|
|
1832
1900
|
return {
|
|
1833
1901
|
name: "flip",
|
|
1834
|
-
options
|
|
1902
|
+
options,
|
|
1835
1903
|
async fn(state) {
|
|
1836
1904
|
var _middlewareData$arrow, _middlewareData$flip;
|
|
1837
1905
|
const {
|
|
@@ -1850,7 +1918,7 @@ const flip$1 = function(options2) {
|
|
|
1850
1918
|
fallbackAxisSideDirection = "none",
|
|
1851
1919
|
flipAlignment = true,
|
|
1852
1920
|
...detectOverflowOptions
|
|
1853
|
-
} = evaluate(
|
|
1921
|
+
} = evaluate(options, state);
|
|
1854
1922
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1855
1923
|
return {};
|
|
1856
1924
|
}
|
|
@@ -1946,13 +2014,13 @@ function getRectsByLine(rects) {
|
|
|
1946
2014
|
}
|
|
1947
2015
|
return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
|
|
1948
2016
|
}
|
|
1949
|
-
const inline$1 = function(
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
2017
|
+
const inline$1 = function(options) {
|
|
2018
|
+
if (options === void 0) {
|
|
2019
|
+
options = {};
|
|
1952
2020
|
}
|
|
1953
2021
|
return {
|
|
1954
2022
|
name: "inline",
|
|
1955
|
-
options
|
|
2023
|
+
options,
|
|
1956
2024
|
async fn(state) {
|
|
1957
2025
|
const {
|
|
1958
2026
|
placement,
|
|
@@ -1965,7 +2033,7 @@ const inline$1 = function(options2) {
|
|
|
1965
2033
|
padding = 2,
|
|
1966
2034
|
x,
|
|
1967
2035
|
y
|
|
1968
|
-
} = evaluate(
|
|
2036
|
+
} = evaluate(options, state);
|
|
1969
2037
|
const nativeClientRects = Array.from(await (platform2.getClientRects == null ? void 0 : platform2.getClientRects(elements.reference)) || []);
|
|
1970
2038
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
1971
2039
|
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
@@ -2037,7 +2105,7 @@ const inline$1 = function(options2) {
|
|
|
2037
2105
|
}
|
|
2038
2106
|
};
|
|
2039
2107
|
};
|
|
2040
|
-
async function convertValueToCoords(state,
|
|
2108
|
+
async function convertValueToCoords(state, options) {
|
|
2041
2109
|
const {
|
|
2042
2110
|
placement,
|
|
2043
2111
|
platform: platform2,
|
|
@@ -2049,7 +2117,7 @@ async function convertValueToCoords(state, options2) {
|
|
|
2049
2117
|
const isVertical = getSideAxis(placement) === "y";
|
|
2050
2118
|
const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
2051
2119
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
2052
|
-
const rawValue = evaluate(
|
|
2120
|
+
const rawValue = evaluate(options, state);
|
|
2053
2121
|
let {
|
|
2054
2122
|
mainAxis,
|
|
2055
2123
|
crossAxis,
|
|
@@ -2075,13 +2143,13 @@ async function convertValueToCoords(state, options2) {
|
|
|
2075
2143
|
y: crossAxis * crossAxisMulti
|
|
2076
2144
|
};
|
|
2077
2145
|
}
|
|
2078
|
-
const offset$1 = function(
|
|
2079
|
-
if (
|
|
2080
|
-
|
|
2146
|
+
const offset$1 = function(options) {
|
|
2147
|
+
if (options === void 0) {
|
|
2148
|
+
options = 0;
|
|
2081
2149
|
}
|
|
2082
2150
|
return {
|
|
2083
2151
|
name: "offset",
|
|
2084
|
-
options
|
|
2152
|
+
options,
|
|
2085
2153
|
async fn(state) {
|
|
2086
2154
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
2087
2155
|
const {
|
|
@@ -2090,7 +2158,7 @@ const offset$1 = function(options2) {
|
|
|
2090
2158
|
placement,
|
|
2091
2159
|
middlewareData
|
|
2092
2160
|
} = state;
|
|
2093
|
-
const diffCoords = await convertValueToCoords(state,
|
|
2161
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
2094
2162
|
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
2095
2163
|
return {};
|
|
2096
2164
|
}
|
|
@@ -2105,13 +2173,13 @@ const offset$1 = function(options2) {
|
|
|
2105
2173
|
}
|
|
2106
2174
|
};
|
|
2107
2175
|
};
|
|
2108
|
-
const shift$1 = function(
|
|
2109
|
-
if (
|
|
2110
|
-
|
|
2176
|
+
const shift$1 = function(options) {
|
|
2177
|
+
if (options === void 0) {
|
|
2178
|
+
options = {};
|
|
2111
2179
|
}
|
|
2112
2180
|
return {
|
|
2113
2181
|
name: "shift",
|
|
2114
|
-
options
|
|
2182
|
+
options,
|
|
2115
2183
|
async fn(state) {
|
|
2116
2184
|
const {
|
|
2117
2185
|
x,
|
|
@@ -2134,7 +2202,7 @@ const shift$1 = function(options2) {
|
|
|
2134
2202
|
}
|
|
2135
2203
|
},
|
|
2136
2204
|
...detectOverflowOptions
|
|
2137
|
-
} = evaluate(
|
|
2205
|
+
} = evaluate(options, state);
|
|
2138
2206
|
const coords = {
|
|
2139
2207
|
x,
|
|
2140
2208
|
y
|
|
@@ -2464,13 +2532,13 @@ function getWindowScrollBarX(element) {
|
|
|
2464
2532
|
function getDocumentRect(element) {
|
|
2465
2533
|
const html = getDocumentElement(element);
|
|
2466
2534
|
const scroll = getNodeScroll(element);
|
|
2467
|
-
const
|
|
2468
|
-
const width = max(html.scrollWidth, html.clientWidth,
|
|
2469
|
-
const height = max(html.scrollHeight, html.clientHeight,
|
|
2535
|
+
const body = element.ownerDocument.body;
|
|
2536
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
2537
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
2470
2538
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
2471
2539
|
const y = -scroll.scrollTop;
|
|
2472
|
-
if (getComputedStyle$1(
|
|
2473
|
-
x += max(html.clientWidth,
|
|
2540
|
+
if (getComputedStyle$1(body).direction === "rtl") {
|
|
2541
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
2474
2542
|
}
|
|
2475
2543
|
return {
|
|
2476
2544
|
width,
|
|
@@ -2736,7 +2804,7 @@ function observeMove(element, onMove) {
|
|
|
2736
2804
|
const insetBottom = floor(root.clientHeight - (top + height));
|
|
2737
2805
|
const insetLeft = floor(left);
|
|
2738
2806
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
2739
|
-
const
|
|
2807
|
+
const options = {
|
|
2740
2808
|
rootMargin,
|
|
2741
2809
|
threshold: max(0, min(1, threshold)) || 1
|
|
2742
2810
|
};
|
|
@@ -2759,21 +2827,21 @@ function observeMove(element, onMove) {
|
|
|
2759
2827
|
}
|
|
2760
2828
|
try {
|
|
2761
2829
|
io = new IntersectionObserver(handleObserve, {
|
|
2762
|
-
...
|
|
2830
|
+
...options,
|
|
2763
2831
|
// Handle <iframe>s
|
|
2764
2832
|
root: root.ownerDocument
|
|
2765
2833
|
});
|
|
2766
2834
|
} catch (e) {
|
|
2767
|
-
io = new IntersectionObserver(handleObserve,
|
|
2835
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
2768
2836
|
}
|
|
2769
2837
|
io.observe(element);
|
|
2770
2838
|
}
|
|
2771
2839
|
refresh(true);
|
|
2772
2840
|
return cleanup;
|
|
2773
2841
|
}
|
|
2774
|
-
function autoUpdate(reference, floating, update,
|
|
2775
|
-
if (
|
|
2776
|
-
|
|
2842
|
+
function autoUpdate(reference, floating, update, options) {
|
|
2843
|
+
if (options === void 0) {
|
|
2844
|
+
options = {};
|
|
2777
2845
|
}
|
|
2778
2846
|
const {
|
|
2779
2847
|
ancestorScroll = true,
|
|
@@ -2781,7 +2849,7 @@ function autoUpdate(reference, floating, update, options2) {
|
|
|
2781
2849
|
elementResize = typeof ResizeObserver === "function",
|
|
2782
2850
|
layoutShift = typeof IntersectionObserver === "function",
|
|
2783
2851
|
animationFrame = false
|
|
2784
|
-
} =
|
|
2852
|
+
} = options;
|
|
2785
2853
|
const referenceEl = unwrapElement(reference);
|
|
2786
2854
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
2787
2855
|
ancestors.forEach((ancestor) => {
|
|
@@ -2844,11 +2912,11 @@ const shift = shift$1;
|
|
|
2844
2912
|
const flip = flip$1;
|
|
2845
2913
|
const arrow = arrow$1;
|
|
2846
2914
|
const inline = inline$1;
|
|
2847
|
-
const computePosition = (reference, floating,
|
|
2915
|
+
const computePosition = (reference, floating, options) => {
|
|
2848
2916
|
const cache = /* @__PURE__ */ new Map();
|
|
2849
2917
|
const mergedOptions = {
|
|
2850
2918
|
platform: platform$2,
|
|
2851
|
-
...
|
|
2919
|
+
...options
|
|
2852
2920
|
};
|
|
2853
2921
|
const platformWithCache = {
|
|
2854
2922
|
...mergedOptions.platform,
|
|
@@ -2859,7 +2927,7 @@ const computePosition = (reference, floating, options2) => {
|
|
|
2859
2927
|
platform: platformWithCache
|
|
2860
2928
|
});
|
|
2861
2929
|
};
|
|
2862
|
-
const defaults$
|
|
2930
|
+
const defaults$8 = {
|
|
2863
2931
|
strategy: "absolute",
|
|
2864
2932
|
placement: "bottom",
|
|
2865
2933
|
inline: false,
|
|
@@ -2872,19 +2940,19 @@ const defaults$5 = {
|
|
|
2872
2940
|
// Options for arrow (not element)
|
|
2873
2941
|
};
|
|
2874
2942
|
function createFloatingUi(elements, config2) {
|
|
2875
|
-
const
|
|
2876
|
-
const { placement, strategy } =
|
|
2943
|
+
const options = Object.assign({}, defaults$8, config2);
|
|
2944
|
+
const { placement, strategy } = options;
|
|
2877
2945
|
const { trigger, content, contentArrow } = elements;
|
|
2878
2946
|
return autoUpdate(trigger, content, () => {
|
|
2879
2947
|
computePosition(trigger, content, {
|
|
2880
2948
|
placement,
|
|
2881
2949
|
strategy,
|
|
2882
2950
|
middleware: [
|
|
2883
|
-
...addPlugin(inline,
|
|
2884
|
-
...addPlugin(offset,
|
|
2885
|
-
...addPlugin(flip,
|
|
2886
|
-
...addPlugin(shift,
|
|
2887
|
-
...addPlugin(arrow, contentArrow &&
|
|
2951
|
+
...addPlugin(inline, options.inline),
|
|
2952
|
+
...addPlugin(offset, options.offset),
|
|
2953
|
+
...addPlugin(flip, options.flip),
|
|
2954
|
+
...addPlugin(shift, options.shift),
|
|
2955
|
+
...addPlugin(arrow, contentArrow && options.arrow, { element: contentArrow })
|
|
2888
2956
|
]
|
|
2889
2957
|
}).then((data) => {
|
|
2890
2958
|
const { x, y, middlewareData, placement: placement2 } = data;
|
|
@@ -2916,46 +2984,46 @@ function addPlugin(plugin, option, overrides = {}) {
|
|
|
2916
2984
|
const floatingUi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2917
2985
|
__proto__: null,
|
|
2918
2986
|
createFloatingUi,
|
|
2919
|
-
defaults: defaults$
|
|
2987
|
+
defaults: defaults$8
|
|
2920
2988
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2921
2989
|
const instances$3 = /* @__PURE__ */ new WeakMap();
|
|
2922
2990
|
const logError = (...msgs) => console.error("@ulu (popovers):", ...msgs);
|
|
2923
|
-
const attrs$
|
|
2991
|
+
const attrs$a = {
|
|
2924
2992
|
trigger: "data-ulu-popover-trigger",
|
|
2925
2993
|
content: "data-ulu-popover-content",
|
|
2926
2994
|
arrow: "data-ulu-popover-arrow",
|
|
2927
2995
|
anchor: "data-ulu-popover-trigger-anchor"
|
|
2928
2996
|
};
|
|
2929
|
-
const attrSelector$
|
|
2997
|
+
const attrSelector$a = (key2) => `[${attrs$a[key2]}]`;
|
|
2930
2998
|
const collapsibleDefaults = {
|
|
2931
2999
|
clickOutsideCloses: true,
|
|
2932
3000
|
escapeCloses: true
|
|
2933
3001
|
};
|
|
2934
|
-
function init$
|
|
2935
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
2936
|
-
setup$
|
|
3002
|
+
function init$c() {
|
|
3003
|
+
document.addEventListener(getName$1("pageModified"), setup$9);
|
|
3004
|
+
setup$9();
|
|
2937
3005
|
}
|
|
2938
|
-
function setup$
|
|
2939
|
-
const triggers = document.querySelectorAll(attrSelector$
|
|
3006
|
+
function setup$9() {
|
|
3007
|
+
const triggers = document.querySelectorAll(attrSelector$a("trigger"));
|
|
2940
3008
|
const resolved = Array.from(triggers).filter((trigger) => !instances$3.has(trigger)).map(resolve).filter((v) => v);
|
|
2941
|
-
resolved.forEach(({ elements, options
|
|
2942
|
-
instances$3.set(elements.trigger, new Popover(elements,
|
|
3009
|
+
resolved.forEach(({ elements, options, floatingOptions }) => {
|
|
3010
|
+
instances$3.set(elements.trigger, new Popover(elements, options, floatingOptions));
|
|
2943
3011
|
});
|
|
2944
3012
|
}
|
|
2945
3013
|
function resolve(trigger) {
|
|
2946
3014
|
const raw = trigger.dataset.uluPopoverTrigger;
|
|
2947
|
-
const
|
|
3015
|
+
const options = (raw == null ? void 0 : raw.length) ? JSON.parse(raw) : {};
|
|
2948
3016
|
const content = getContentByTrigger(trigger);
|
|
2949
3017
|
const elements = {
|
|
2950
3018
|
trigger,
|
|
2951
3019
|
content,
|
|
2952
|
-
anchor: trigger.querySelector(attrSelector$
|
|
2953
|
-
contentArrow: content.querySelector(attrSelector$
|
|
3020
|
+
anchor: trigger.querySelector(attrSelector$a("anchor")) || trigger,
|
|
3021
|
+
contentArrow: content.querySelector(attrSelector$a("arrow"))
|
|
2954
3022
|
};
|
|
2955
|
-
const floatingOptions =
|
|
2956
|
-
delete
|
|
3023
|
+
const floatingOptions = options.floating || {};
|
|
3024
|
+
delete options.floating;
|
|
2957
3025
|
if (content) {
|
|
2958
|
-
return { elements, options
|
|
3026
|
+
return { elements, options, floatingOptions };
|
|
2959
3027
|
} else {
|
|
2960
3028
|
logError("Unable to make popover for", trigger);
|
|
2961
3029
|
return false;
|
|
@@ -2967,13 +3035,13 @@ function getContentByTrigger(trigger) {
|
|
|
2967
3035
|
const ariaControls = trigger.getAttribute("aria-controls");
|
|
2968
3036
|
if (ariaControls) {
|
|
2969
3037
|
content = document.getElementById(ariaControls);
|
|
2970
|
-
} else if ((_a = trigger == null ? void 0 : trigger.nextElementSibling) == null ? void 0 : _a.hasAttribute(attrs$
|
|
3038
|
+
} else if ((_a = trigger == null ? void 0 : trigger.nextElementSibling) == null ? void 0 : _a.hasAttribute(attrs$a.content)) {
|
|
2971
3039
|
content = trigger.nextElementSibling;
|
|
2972
3040
|
} else {
|
|
2973
3041
|
const children = Array.from(trigger.parentNode.children);
|
|
2974
3042
|
const triggerIndex = children.findIndex((c) => c === trigger);
|
|
2975
3043
|
const childrenAfter = children.slice(triggerIndex);
|
|
2976
|
-
content = childrenAfter.find((child) => child.matches(attrSelector$
|
|
3044
|
+
content = childrenAfter.find((child) => child.matches(attrSelector$a("content")));
|
|
2977
3045
|
}
|
|
2978
3046
|
if (!content) {
|
|
2979
3047
|
logError("Unable to resolve 'content' element for popover", trigger);
|
|
@@ -2982,8 +3050,8 @@ function getContentByTrigger(trigger) {
|
|
|
2982
3050
|
}
|
|
2983
3051
|
class Popover extends Collapsible {
|
|
2984
3052
|
constructor(elements, config2, floatingOptions) {
|
|
2985
|
-
const
|
|
2986
|
-
super(elements,
|
|
3053
|
+
const options = Object.assign({}, collapsibleDefaults, config2);
|
|
3054
|
+
super(elements, options);
|
|
2987
3055
|
this.floatingOptions = floatingOptions || {};
|
|
2988
3056
|
}
|
|
2989
3057
|
setState(isOpen, event) {
|
|
@@ -3000,6 +3068,7 @@ class Popover extends Collapsible {
|
|
|
3000
3068
|
createFloatingInstance() {
|
|
3001
3069
|
const { content, anchor, contentArrow } = this.elements;
|
|
3002
3070
|
const floatingElements = { trigger: anchor, contentArrow, content };
|
|
3071
|
+
console.log("this.floatingOptions:\n", this.floatingOptions);
|
|
3003
3072
|
this.floatingCleanup = createFloatingUi(floatingElements, this.floatingOptions);
|
|
3004
3073
|
}
|
|
3005
3074
|
destroyFloatingInstance() {
|
|
@@ -3013,34 +3082,34 @@ const popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
3013
3082
|
__proto__: null,
|
|
3014
3083
|
Popover,
|
|
3015
3084
|
getContentByTrigger,
|
|
3016
|
-
init: init$
|
|
3085
|
+
init: init$c,
|
|
3017
3086
|
instances: instances$3,
|
|
3018
3087
|
resolve,
|
|
3019
|
-
setup: setup$
|
|
3088
|
+
setup: setup$9
|
|
3020
3089
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3021
|
-
const attrs$
|
|
3090
|
+
const attrs$9 = {
|
|
3022
3091
|
trigger: "data-ulu-tooltip",
|
|
3023
3092
|
init: "data-ulu-init",
|
|
3024
3093
|
body: "data-ulu-tooltip-display-body",
|
|
3025
3094
|
arrow: "data-ulu-tooltip-arrow"
|
|
3026
3095
|
};
|
|
3027
|
-
const attrSelector$
|
|
3028
|
-
const attrSelectorInitial$
|
|
3029
|
-
function init$
|
|
3030
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
3031
|
-
setup$
|
|
3096
|
+
const attrSelector$9 = (key2) => `[${attrs$9[key2]}]`;
|
|
3097
|
+
const attrSelectorInitial$7 = (key2) => `${attrSelector$9(key2)}:not([${attrs$9.init}])`;
|
|
3098
|
+
function init$b() {
|
|
3099
|
+
document.addEventListener(getName$1("pageModified"), setup$8);
|
|
3100
|
+
setup$8();
|
|
3032
3101
|
}
|
|
3033
|
-
function setup$
|
|
3034
|
-
const triggers = document.querySelectorAll(attrSelectorInitial$
|
|
3102
|
+
function setup$8() {
|
|
3103
|
+
const triggers = document.querySelectorAll(attrSelectorInitial$7("trigger"));
|
|
3035
3104
|
triggers.forEach(setupTrigger$1);
|
|
3036
3105
|
}
|
|
3037
3106
|
function setupTrigger$1(trigger) {
|
|
3038
3107
|
const passed = getDatasetOptionalJson(trigger, "uluTooltip");
|
|
3039
|
-
const
|
|
3108
|
+
const options = typeof passed === "object" ? passed : {};
|
|
3040
3109
|
if (typeof passed === "string") {
|
|
3041
|
-
|
|
3110
|
+
options.content = passed;
|
|
3042
3111
|
}
|
|
3043
|
-
return new Tooltip({ trigger },
|
|
3112
|
+
return new Tooltip({ trigger }, options);
|
|
3044
3113
|
}
|
|
3045
3114
|
const _Tooltip = class _Tooltip {
|
|
3046
3115
|
constructor(elements, userOptions, floatingOptions) {
|
|
@@ -3098,21 +3167,21 @@ const _Tooltip = class _Tooltip {
|
|
|
3098
3167
|
return element;
|
|
3099
3168
|
}
|
|
3100
3169
|
createContentElement() {
|
|
3101
|
-
const { options
|
|
3102
|
-
const content = createElementFromHtml(
|
|
3103
|
-
const
|
|
3170
|
+
const { options } = this;
|
|
3171
|
+
const content = createElementFromHtml(options.template(options));
|
|
3172
|
+
const body = content.querySelector(attrSelector$9("body"));
|
|
3104
3173
|
const innerContent = this.getInnerContent();
|
|
3105
|
-
if (
|
|
3106
|
-
|
|
3174
|
+
if (options.isHtml) {
|
|
3175
|
+
body.innerHTML = innerContent;
|
|
3107
3176
|
} else {
|
|
3108
|
-
|
|
3177
|
+
body.textContent = innerContent;
|
|
3109
3178
|
}
|
|
3110
3179
|
content.id = newId();
|
|
3111
|
-
if (
|
|
3112
|
-
content.classList.add(
|
|
3180
|
+
if (options.contentClass) {
|
|
3181
|
+
content.classList.add(options.contentClass);
|
|
3113
3182
|
}
|
|
3114
3183
|
this.elements.content = content;
|
|
3115
|
-
this.elements.contentArrow = content.querySelector(attrSelector$
|
|
3184
|
+
this.elements.contentArrow = content.querySelector(attrSelector$9("arrow"));
|
|
3116
3185
|
document.body.appendChild(content);
|
|
3117
3186
|
}
|
|
3118
3187
|
attachHandlers() {
|
|
@@ -3256,7 +3325,7 @@ __publicField(_Tooltip, "defaults", {
|
|
|
3256
3325
|
template(_config) {
|
|
3257
3326
|
return `
|
|
3258
3327
|
<div class="popover popover--tooltip">
|
|
3259
|
-
<div class="popover__inner" ${attrs$
|
|
3328
|
+
<div class="popover__inner" ${attrs$9.body}>
|
|
3260
3329
|
</div>
|
|
3261
3330
|
<span class="popover__arrow" data-ulu-tooltip-arrow></span>
|
|
3262
3331
|
</div>
|
|
@@ -3276,8 +3345,8 @@ let Tooltip = _Tooltip;
|
|
|
3276
3345
|
const tooltip = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3277
3346
|
__proto__: null,
|
|
3278
3347
|
Tooltip,
|
|
3279
|
-
init: init$
|
|
3280
|
-
setup: setup$
|
|
3348
|
+
init: init$b,
|
|
3349
|
+
setup: setup$8,
|
|
3281
3350
|
setupTrigger: setupTrigger$1
|
|
3282
3351
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3283
3352
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -4125,16 +4194,16 @@ var platformExports = platform$1.exports;
|
|
|
4125
4194
|
data.document = _document;
|
|
4126
4195
|
return data;
|
|
4127
4196
|
}
|
|
4128
|
-
function test(data,
|
|
4197
|
+
function test(data, options) {
|
|
4129
4198
|
data.wrapper.innerHTML = "";
|
|
4130
|
-
var element = typeof
|
|
4131
|
-
var focus2 =
|
|
4199
|
+
var element = typeof options.element === "string" ? data.document.createElement(options.element) : options.element(data.wrapper, data.document);
|
|
4200
|
+
var focus2 = options.mutate && options.mutate(element, data.wrapper, data.document);
|
|
4132
4201
|
if (!focus2 && focus2 !== false) {
|
|
4133
4202
|
focus2 = element;
|
|
4134
4203
|
}
|
|
4135
4204
|
!element.parentNode && data.wrapper.appendChild(element);
|
|
4136
4205
|
focus2 && focus2.focus && focus2.focus();
|
|
4137
|
-
return
|
|
4206
|
+
return options.validate ? options.validate(element, focus2, data.document) : data.document.activeElement === focus2;
|
|
4138
4207
|
}
|
|
4139
4208
|
function after(data) {
|
|
4140
4209
|
if (data.activeElement === document.body) {
|
|
@@ -6312,16 +6381,16 @@ var focusable_quickExports = focusable_quick.exports;
|
|
|
6312
6381
|
defaultToDocument: true,
|
|
6313
6382
|
context
|
|
6314
6383
|
});
|
|
6315
|
-
var
|
|
6384
|
+
var options = {
|
|
6316
6385
|
context: element,
|
|
6317
6386
|
includeContext,
|
|
6318
6387
|
includeOnlyTabbable,
|
|
6319
6388
|
strategy
|
|
6320
6389
|
};
|
|
6321
6390
|
if (strategy === "quick") {
|
|
6322
|
-
return (0, _focusable4.default)(
|
|
6391
|
+
return (0, _focusable4.default)(options);
|
|
6323
6392
|
} else if (strategy === "strict" || strategy === "all") {
|
|
6324
|
-
return (0, _focusable2.default)(
|
|
6393
|
+
return (0, _focusable2.default)(options);
|
|
6325
6394
|
}
|
|
6326
6395
|
throw new TypeError('query/focusable requires option.strategy to be one of ["quick", "strict", "all"]');
|
|
6327
6396
|
};
|
|
@@ -8150,31 +8219,31 @@ const requiredElements = [
|
|
|
8150
8219
|
"track",
|
|
8151
8220
|
"slides"
|
|
8152
8221
|
];
|
|
8153
|
-
const attrs$
|
|
8222
|
+
const attrs$8 = {
|
|
8154
8223
|
init: "data-ulu-slider-init",
|
|
8155
8224
|
slider: "data-ulu-slider",
|
|
8156
8225
|
track: "data-ulu-slider-track",
|
|
8157
8226
|
trackContainer: "data-ulu-slider-track-container",
|
|
8158
8227
|
controls: "data-ulu-slider-control-context"
|
|
8159
8228
|
};
|
|
8160
|
-
const attrSelector$
|
|
8161
|
-
const attrSelectorInitial$
|
|
8162
|
-
const defaults$
|
|
8229
|
+
const attrSelector$8 = (key2) => `[${attrs$8[key2]}]`;
|
|
8230
|
+
const attrSelectorInitial$6 = (key2) => `${attrSelector$8(key2)}:not([${attrs$8.init}])`;
|
|
8231
|
+
const defaults$7 = {
|
|
8163
8232
|
amount: createPager()
|
|
8164
8233
|
};
|
|
8165
8234
|
const instances$2 = [];
|
|
8166
|
-
function init$
|
|
8167
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
8168
|
-
setup$
|
|
8235
|
+
function init$a() {
|
|
8236
|
+
document.addEventListener(getName$1("pageModified"), setup$7);
|
|
8237
|
+
setup$7();
|
|
8169
8238
|
}
|
|
8170
|
-
function setup$
|
|
8171
|
-
const builders = document.querySelectorAll(attrSelectorInitial$
|
|
8239
|
+
function setup$7() {
|
|
8240
|
+
const builders = document.querySelectorAll(attrSelectorInitial$6("slider"));
|
|
8172
8241
|
builders.forEach(setupSlider$1);
|
|
8173
8242
|
}
|
|
8174
8243
|
function setupSlider$1(container2) {
|
|
8175
|
-
container2.setAttribute(attrs$
|
|
8176
|
-
const
|
|
8177
|
-
const config2 = Object.assign({}, defaults$
|
|
8244
|
+
container2.setAttribute(attrs$8.init, "");
|
|
8245
|
+
const options = getDatasetOptionalJson(container2, "uluScrollSlider");
|
|
8246
|
+
const config2 = Object.assign({}, defaults$7, options);
|
|
8178
8247
|
const elements = {
|
|
8179
8248
|
container: container2,
|
|
8180
8249
|
track: container2.querySelector("[data-ulu-slider-track]"),
|
|
@@ -8189,9 +8258,9 @@ function setupSlider$1(container2) {
|
|
|
8189
8258
|
const _Slider = class _Slider {
|
|
8190
8259
|
// constructor(container, title, trackContainer, track, slides, config, debug = false) {
|
|
8191
8260
|
constructor(elements, config2, debug = false) {
|
|
8192
|
-
const
|
|
8261
|
+
const options = Object.assign({}, _Slider.defaults, config2);
|
|
8193
8262
|
this.debug = debug;
|
|
8194
|
-
this.options =
|
|
8263
|
+
this.options = options;
|
|
8195
8264
|
this.slide = null;
|
|
8196
8265
|
this.index = null;
|
|
8197
8266
|
this.transitioning = false;
|
|
@@ -8213,7 +8282,7 @@ const _Slider = class _Slider {
|
|
|
8213
8282
|
...this.createControls(elements.controlContext || elements.container),
|
|
8214
8283
|
...this.createNav(elements.navContext || elements.container)
|
|
8215
8284
|
};
|
|
8216
|
-
this.transition =
|
|
8285
|
+
this.transition = options.transition ? options.transitionFade || reduceMotion ? this.fadeTransition : this.slideTransition : this.noTransition;
|
|
8217
8286
|
this.setup();
|
|
8218
8287
|
this.goto(0, null, "init");
|
|
8219
8288
|
log(this, "Slider Instance Created", this);
|
|
@@ -8311,9 +8380,9 @@ const _Slider = class _Slider {
|
|
|
8311
8380
|
* Perform a fade on a single slide
|
|
8312
8381
|
*/
|
|
8313
8382
|
fadeSlide(slide, visible2) {
|
|
8314
|
-
const { options
|
|
8383
|
+
const { options } = this;
|
|
8315
8384
|
const { element } = slide;
|
|
8316
|
-
const duration = visible2 ?
|
|
8385
|
+
const duration = visible2 ? options.transitionDuration : options.transitionDurationExit;
|
|
8317
8386
|
return this.ensureTransitionEnds(element, duration, () => {
|
|
8318
8387
|
element.style.opacity = visible2 ? "1" : "0";
|
|
8319
8388
|
});
|
|
@@ -8529,12 +8598,11 @@ const _Slider = class _Slider {
|
|
|
8529
8598
|
button.addEventListener("click", this.goto.bind(this, index2));
|
|
8530
8599
|
return button;
|
|
8531
8600
|
}
|
|
8532
|
-
// change to css-icon
|
|
8533
8601
|
getControlContent(action) {
|
|
8534
|
-
const classes = this.options[action === "next" ? "
|
|
8602
|
+
const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
|
|
8535
8603
|
return `
|
|
8536
8604
|
<span class="hidden-visually">${action}</span>
|
|
8537
|
-
<span class="${
|
|
8605
|
+
<span class="${this.getClass("control-icon")} ${classes}" aria-hidden="true"></span>
|
|
8538
8606
|
`;
|
|
8539
8607
|
}
|
|
8540
8608
|
getNavContent(number) {
|
|
@@ -8556,18 +8624,18 @@ __publicField(_Slider, "defaults", {
|
|
|
8556
8624
|
transitionDuration: 700,
|
|
8557
8625
|
transitionDurationExit: 400,
|
|
8558
8626
|
transitionTimingFunction: "ease-in-out",
|
|
8559
|
-
buttonClasses: ["
|
|
8560
|
-
|
|
8561
|
-
|
|
8627
|
+
buttonClasses: ["button", "button--icon"],
|
|
8628
|
+
iconClassPrevious: wrapSettingString("iconClassPrevious"),
|
|
8629
|
+
iconClassNext: wrapSettingString("iconClassNext")
|
|
8562
8630
|
// transition: true
|
|
8563
8631
|
});
|
|
8564
8632
|
let Slider = _Slider;
|
|
8565
8633
|
const slider = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8566
8634
|
__proto__: null,
|
|
8567
8635
|
Slider,
|
|
8568
|
-
attrs: attrs$
|
|
8569
|
-
init: init$
|
|
8570
|
-
setup: setup$
|
|
8636
|
+
attrs: attrs$8,
|
|
8637
|
+
init: init$a,
|
|
8638
|
+
setup: setup$7,
|
|
8571
8639
|
setupSlider: setupSlider$1
|
|
8572
8640
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8573
8641
|
var ariaTablist_min = { exports: {} };
|
|
@@ -8816,9 +8884,9 @@ const AriaTablist = /* @__PURE__ */ getDefaultExportFromCjs(ariaTablist_minExpor
|
|
|
8816
8884
|
const initAttr = "data-ulu-tablist-init";
|
|
8817
8885
|
const errorHeader = "[data-ulu-tablist] error:";
|
|
8818
8886
|
const instances$1 = [];
|
|
8819
|
-
function init$
|
|
8887
|
+
function init$9(options = {}) {
|
|
8820
8888
|
const initial = () => {
|
|
8821
|
-
initWithin(document,
|
|
8889
|
+
initWithin(document, options);
|
|
8822
8890
|
instances$1.forEach(openByCurrentHash);
|
|
8823
8891
|
};
|
|
8824
8892
|
if (document.readyState === "complete") {
|
|
@@ -8826,17 +8894,17 @@ function init$7(options2 = {}) {
|
|
|
8826
8894
|
} else {
|
|
8827
8895
|
window.addEventListener("load", initial);
|
|
8828
8896
|
}
|
|
8829
|
-
document.addEventListener("pageModified", (e) => initWithin(e.target,
|
|
8897
|
+
document.addEventListener("pageModified", (e) => initWithin(e.target, options));
|
|
8830
8898
|
}
|
|
8831
|
-
function initWithin(context,
|
|
8899
|
+
function initWithin(context, options = {}) {
|
|
8832
8900
|
if (!context) {
|
|
8833
8901
|
console.warn("Missing context to initWithin, skipping init of tabs");
|
|
8834
8902
|
return;
|
|
8835
8903
|
}
|
|
8836
8904
|
const tablists = context.querySelectorAll(`[data-ulu-tablist]:not([${initAttr}])`);
|
|
8837
|
-
tablists.forEach((element) => setup$
|
|
8905
|
+
tablists.forEach((element) => setup$6(element, options));
|
|
8838
8906
|
}
|
|
8839
|
-
function setup$
|
|
8907
|
+
function setup$6(element, options = {}) {
|
|
8840
8908
|
let elementOptions = {};
|
|
8841
8909
|
if (element.dataset.uluTablist) {
|
|
8842
8910
|
try {
|
|
@@ -8845,11 +8913,11 @@ function setup$5(element, options2 = {}) {
|
|
|
8845
8913
|
console.error(errorHeader, "(JSON Parse for options)", element);
|
|
8846
8914
|
}
|
|
8847
8915
|
}
|
|
8848
|
-
const config2 = Object.assign({},
|
|
8916
|
+
const config2 = Object.assign({}, options, elementOptions);
|
|
8849
8917
|
if (config2.vertical) {
|
|
8850
8918
|
config2.allArrows = true;
|
|
8851
8919
|
}
|
|
8852
|
-
const instance = { element, options
|
|
8920
|
+
const instance = { element, options };
|
|
8853
8921
|
instance.ariaTablist = AriaTablist(element, {
|
|
8854
8922
|
onOpen(...args) {
|
|
8855
8923
|
args.unshift(instance);
|
|
@@ -8864,8 +8932,8 @@ function setup$5(element, options2 = {}) {
|
|
|
8864
8932
|
element.setAttribute(initAttr, "");
|
|
8865
8933
|
return instance;
|
|
8866
8934
|
}
|
|
8867
|
-
function openByCurrentHash({ options
|
|
8868
|
-
if (
|
|
8935
|
+
function openByCurrentHash({ options, ariaTablist }) {
|
|
8936
|
+
if (options.openByUrlHash) {
|
|
8869
8937
|
const { hash } = window.location;
|
|
8870
8938
|
if (hash && hash.length > 1) {
|
|
8871
8939
|
const possibleId = hash.substring(1);
|
|
@@ -8877,8 +8945,8 @@ function openByCurrentHash({ options: options2, ariaTablist }) {
|
|
|
8877
8945
|
}
|
|
8878
8946
|
}
|
|
8879
8947
|
}
|
|
8880
|
-
function handleOpen({ options
|
|
8881
|
-
if (
|
|
8948
|
+
function handleOpen({ options }, panel, tab) {
|
|
8949
|
+
if (options.openByUrlHash && window.history) {
|
|
8882
8950
|
window.history.replaceState(null, "", `#${tab.id}`);
|
|
8883
8951
|
}
|
|
8884
8952
|
}
|
|
@@ -8914,47 +8982,47 @@ function setHeights(element) {
|
|
|
8914
8982
|
}
|
|
8915
8983
|
const tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8916
8984
|
__proto__: null,
|
|
8917
|
-
init: init$
|
|
8985
|
+
init: init$9,
|
|
8918
8986
|
initWithin,
|
|
8919
8987
|
instances: instances$1,
|
|
8920
|
-
setup: setup$
|
|
8988
|
+
setup: setup$6
|
|
8921
8989
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8922
|
-
const attrs$
|
|
8990
|
+
const attrs$7 = {
|
|
8923
8991
|
trigger: "data-ulu-proxy-click",
|
|
8924
8992
|
init: "data-ulu-proxy-click-init"
|
|
8925
8993
|
};
|
|
8926
|
-
const attrSelector$
|
|
8927
|
-
const attrSelectorInitial$
|
|
8928
|
-
const defaults$
|
|
8994
|
+
const attrSelector$7 = (key2) => `[${attrs$7[key2]}]`;
|
|
8995
|
+
const attrSelectorInitial$5 = (key2) => `${attrSelector$7(key2)}:not([${attrs$7.init}])`;
|
|
8996
|
+
const defaults$6 = {
|
|
8929
8997
|
selector: "[data-ulu-proxy-click-source]",
|
|
8930
8998
|
selectorPreventBase: "input, select, textarea, button, a, [tabindex='-1']",
|
|
8931
8999
|
selectorPrevent: "",
|
|
8932
9000
|
mousedownDurationPrevent: 250
|
|
8933
9001
|
};
|
|
8934
|
-
let currentDefaults = { ...defaults$
|
|
8935
|
-
function setDefaults(
|
|
8936
|
-
currentDefaults = Object.assign({}, currentDefaults,
|
|
9002
|
+
let currentDefaults$1 = { ...defaults$6 };
|
|
9003
|
+
function setDefaults$1(options) {
|
|
9004
|
+
currentDefaults$1 = Object.assign({}, currentDefaults$1, options);
|
|
8937
9005
|
}
|
|
8938
|
-
function init$
|
|
8939
|
-
document.addEventListener(getName$1("pageModified"), () => setup$
|
|
8940
|
-
setup$
|
|
9006
|
+
function init$8() {
|
|
9007
|
+
document.addEventListener(getName$1("pageModified"), () => setup$5());
|
|
9008
|
+
setup$5();
|
|
8941
9009
|
}
|
|
8942
|
-
function setup$
|
|
8943
|
-
const proxies = context.querySelectorAll(attrSelectorInitial$
|
|
9010
|
+
function setup$5(context = document) {
|
|
9011
|
+
const proxies = context.querySelectorAll(attrSelectorInitial$5("trigger"));
|
|
8944
9012
|
proxies.forEach((proxy) => {
|
|
8945
9013
|
const elOptions = getDatasetOptionalJson(proxy, "siteProxyClick");
|
|
8946
|
-
const
|
|
8947
|
-
const child = proxy.querySelector(
|
|
9014
|
+
const options = Object.assign({}, currentDefaults$1, elOptions);
|
|
9015
|
+
const child = proxy.querySelector(options.selector);
|
|
8948
9016
|
if (child) {
|
|
8949
|
-
attachHandlers(proxy, child,
|
|
8950
|
-
proxy.setAttribute(attrs$
|
|
9017
|
+
attachHandlers(proxy, child, options);
|
|
9018
|
+
proxy.setAttribute(attrs$7.init, "");
|
|
8951
9019
|
} else {
|
|
8952
|
-
console.error("Unable to locate proxy click source",
|
|
9020
|
+
console.error("Unable to locate proxy click source", options.selector);
|
|
8953
9021
|
}
|
|
8954
9022
|
});
|
|
8955
9023
|
}
|
|
8956
|
-
function attachHandlers(proxy, child,
|
|
8957
|
-
const { selectorPreventBase: spb, selectorPrevent: sp } =
|
|
9024
|
+
function attachHandlers(proxy, child, options) {
|
|
9025
|
+
const { selectorPreventBase: spb, selectorPrevent: sp } = options;
|
|
8958
9026
|
const selectorPrevent = `${spb}${sp ? `, ${sp}` : ""}`;
|
|
8959
9027
|
let start, shouldProxy;
|
|
8960
9028
|
proxy.addEventListener("mousedown", ({ target, timeStamp }) => {
|
|
@@ -8965,7 +9033,7 @@ function attachHandlers(proxy, child, options2) {
|
|
|
8965
9033
|
}
|
|
8966
9034
|
});
|
|
8967
9035
|
proxy.addEventListener("mouseup", ({ timeStamp }) => {
|
|
8968
|
-
if (shouldProxy && timeStamp - start <
|
|
9036
|
+
if (shouldProxy && timeStamp - start < options.mousedownDurationPrevent) {
|
|
8969
9037
|
child.click();
|
|
8970
9038
|
}
|
|
8971
9039
|
});
|
|
@@ -8974,12 +9042,12 @@ function attachHandlers(proxy, child, options2) {
|
|
|
8974
9042
|
const proxyClick = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8975
9043
|
__proto__: null,
|
|
8976
9044
|
attachHandlers,
|
|
8977
|
-
defaults: defaults$
|
|
8978
|
-
init: init$
|
|
8979
|
-
setDefaults,
|
|
8980
|
-
setup: setup$
|
|
9045
|
+
defaults: defaults$6,
|
|
9046
|
+
init: init$8,
|
|
9047
|
+
setDefaults: setDefaults$1,
|
|
9048
|
+
setup: setup$5
|
|
8981
9049
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8982
|
-
const attrs$
|
|
9050
|
+
const attrs$6 = {
|
|
8983
9051
|
init: "data-ulu-scrollpoint-init",
|
|
8984
9052
|
/**
|
|
8985
9053
|
* Individual scrollpoint
|
|
@@ -8990,19 +9058,19 @@ const attrs$4 = {
|
|
|
8990
9058
|
// Goes on container for all items
|
|
8991
9059
|
// group: "data-ulu-scrollpoint-group"
|
|
8992
9060
|
};
|
|
8993
|
-
const attrSelector$
|
|
8994
|
-
const attrSelectorInitial$
|
|
8995
|
-
const queryAllInitial$
|
|
8996
|
-
function init$
|
|
8997
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
8998
|
-
setup$
|
|
9061
|
+
const attrSelector$6 = (key2) => `[${attrs$6[key2]}]`;
|
|
9062
|
+
const attrSelectorInitial$4 = (key2) => `${attrSelector$6(key2)}:not([${attrs$6.init}])`;
|
|
9063
|
+
const queryAllInitial$2 = (key2) => document.querySelectorAll(attrSelectorInitial$4(key2));
|
|
9064
|
+
function init$7() {
|
|
9065
|
+
document.addEventListener(getName$1("pageModified"), setup$4);
|
|
9066
|
+
setup$4();
|
|
8999
9067
|
}
|
|
9000
|
-
function setup$
|
|
9001
|
-
const elements = queryAllInitial$
|
|
9068
|
+
function setup$4() {
|
|
9069
|
+
const elements = queryAllInitial$2("point");
|
|
9002
9070
|
elements.forEach((element) => {
|
|
9003
9071
|
const elOptions = getDatasetOptionalJson(element, "uluScrollpoint");
|
|
9004
9072
|
const config2 = Object.assign({}, elOptions);
|
|
9005
|
-
element.setAttribute(attrs$
|
|
9073
|
+
element.setAttribute(attrs$6.init, "");
|
|
9006
9074
|
new Scrollpoint(element, config2);
|
|
9007
9075
|
});
|
|
9008
9076
|
}
|
|
@@ -9013,23 +9081,23 @@ const _Scrollpoint = class _Scrollpoint {
|
|
|
9013
9081
|
* @param {Object} config Options to configure the scrollpoint see Scrollpoint.defaults for more information on settings
|
|
9014
9082
|
*/
|
|
9015
9083
|
constructor(element, config2) {
|
|
9016
|
-
const
|
|
9084
|
+
const options = Object.assign({}, _Scrollpoint.defaults, config2);
|
|
9017
9085
|
if (!element) {
|
|
9018
9086
|
logError$1(this, "Missing required element");
|
|
9019
9087
|
return;
|
|
9020
9088
|
}
|
|
9021
|
-
if (
|
|
9022
|
-
|
|
9023
|
-
delete
|
|
9089
|
+
if (options.rootSelector) {
|
|
9090
|
+
options.root = document.querySelector(options.rootSelector);
|
|
9091
|
+
delete options.rootSelector;
|
|
9024
9092
|
}
|
|
9025
|
-
this.options =
|
|
9093
|
+
this.options = options;
|
|
9026
9094
|
this.observer = null;
|
|
9027
9095
|
this.lastPosition = null;
|
|
9028
9096
|
this.isActive = false;
|
|
9029
9097
|
this.element = element;
|
|
9030
9098
|
this.syncedElements = [
|
|
9031
9099
|
element,
|
|
9032
|
-
...
|
|
9100
|
+
...options.syncElements.map((target) => getElement(target))
|
|
9033
9101
|
];
|
|
9034
9102
|
this.classes = {
|
|
9035
9103
|
enter: this.getClassname("enter"),
|
|
@@ -9040,7 +9108,7 @@ const _Scrollpoint = class _Scrollpoint {
|
|
|
9040
9108
|
exitReverse: this.getClassname("exit--from-reverse")
|
|
9041
9109
|
};
|
|
9042
9110
|
this.setupObserver();
|
|
9043
|
-
if (
|
|
9111
|
+
if (options.debug) {
|
|
9044
9112
|
console.log("Scrollpoint", this);
|
|
9045
9113
|
}
|
|
9046
9114
|
}
|
|
@@ -9058,14 +9126,14 @@ const _Scrollpoint = class _Scrollpoint {
|
|
|
9058
9126
|
*/
|
|
9059
9127
|
onObserve(entries) {
|
|
9060
9128
|
const y = this.getScrollY();
|
|
9061
|
-
const { lastPosition, isActive, options
|
|
9129
|
+
const { lastPosition, isActive, options } = this;
|
|
9062
9130
|
const isForward = lastPosition === null ? null : lastPosition < y;
|
|
9063
9131
|
entries.forEach((entry) => {
|
|
9064
9132
|
const { isIntersecting } = entry;
|
|
9065
9133
|
if (isIntersecting && !isActive) {
|
|
9066
9134
|
this.setState(true, isForward);
|
|
9067
|
-
} else if (!isIntersecting && isActive &&
|
|
9068
|
-
if (isForward &&
|
|
9135
|
+
} else if (!isIntersecting && isActive && options.exit) {
|
|
9136
|
+
if (isForward && options.exitForward || !isForward && options.exitReverse) {
|
|
9069
9137
|
this.setState(false, isForward);
|
|
9070
9138
|
}
|
|
9071
9139
|
}
|
|
@@ -9218,9 +9286,9 @@ let Scrollpoint = _Scrollpoint;
|
|
|
9218
9286
|
const scrollpoint = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9219
9287
|
__proto__: null,
|
|
9220
9288
|
Scrollpoint,
|
|
9221
|
-
attrs: attrs$
|
|
9222
|
-
init: init$
|
|
9223
|
-
setup: setup$
|
|
9289
|
+
attrs: attrs$6,
|
|
9290
|
+
init: init$7,
|
|
9291
|
+
setup: setup$4
|
|
9224
9292
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9225
9293
|
function printOnly(content) {
|
|
9226
9294
|
const w = window.open();
|
|
@@ -9232,32 +9300,32 @@ function printElement(element) {
|
|
|
9232
9300
|
var content = element.innerHTML;
|
|
9233
9301
|
printOnly(content);
|
|
9234
9302
|
}
|
|
9235
|
-
const attrs$
|
|
9303
|
+
const attrs$5 = {
|
|
9236
9304
|
trigger: "data-ulu-print",
|
|
9237
9305
|
init: "data-ulu-print-init"
|
|
9238
9306
|
};
|
|
9239
|
-
const attrSelector$
|
|
9240
|
-
const attrSelectorInitial$
|
|
9241
|
-
const queryAllInitial = (key2) => document.querySelectorAll(attrSelectorInitial$
|
|
9242
|
-
const defaults$
|
|
9307
|
+
const attrSelector$5 = (key2) => `[${attrs$5[key2]}]`;
|
|
9308
|
+
const attrSelectorInitial$3 = (key2) => `${attrSelector$5(key2)}:not([${attrs$5.init}])`;
|
|
9309
|
+
const queryAllInitial$1 = (key2) => document.querySelectorAll(attrSelectorInitial$3(key2));
|
|
9310
|
+
const defaults$5 = {
|
|
9243
9311
|
/**
|
|
9244
9312
|
* Print element/selector
|
|
9245
9313
|
*/
|
|
9246
9314
|
element: null
|
|
9247
9315
|
};
|
|
9248
|
-
function init$
|
|
9249
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
9250
|
-
setup$
|
|
9316
|
+
function init$6() {
|
|
9317
|
+
document.addEventListener(getName$1("pageModified"), setup$3);
|
|
9318
|
+
setup$3();
|
|
9251
9319
|
}
|
|
9252
|
-
function setup$
|
|
9253
|
-
const triggers = queryAllInitial("trigger");
|
|
9320
|
+
function setup$3() {
|
|
9321
|
+
const triggers = queryAllInitial$1("trigger");
|
|
9254
9322
|
triggers.forEach((trigger) => {
|
|
9255
|
-
const
|
|
9256
|
-
setupTrigger(trigger,
|
|
9323
|
+
const options = getDatasetOptionalJson(trigger, "uluPrint");
|
|
9324
|
+
setupTrigger(trigger, options);
|
|
9257
9325
|
});
|
|
9258
9326
|
}
|
|
9259
|
-
function setupTrigger(trigger,
|
|
9260
|
-
const config2 = Object.assign({}, defaults$
|
|
9327
|
+
function setupTrigger(trigger, options) {
|
|
9328
|
+
const config2 = Object.assign({}, defaults$5, options);
|
|
9261
9329
|
trigger.addEventListener("click", (event) => {
|
|
9262
9330
|
if (config2.element) {
|
|
9263
9331
|
const element = getElement(config2.element);
|
|
@@ -9273,167 +9341,406 @@ function setupTrigger(trigger, options2) {
|
|
|
9273
9341
|
}
|
|
9274
9342
|
const print = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9275
9343
|
__proto__: null,
|
|
9276
|
-
attrs: attrs$
|
|
9277
|
-
init: init$
|
|
9344
|
+
attrs: attrs$5,
|
|
9345
|
+
init: init$6
|
|
9278
9346
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9279
|
-
const attrs$
|
|
9347
|
+
const attrs$4 = {
|
|
9280
9348
|
opened: "data-ulu-print-details-opened"
|
|
9281
9349
|
};
|
|
9282
|
-
const attrSelector$
|
|
9283
|
-
const defaults$
|
|
9350
|
+
const attrSelector$4 = (key2) => `[${attrs$4[key2]}]`;
|
|
9351
|
+
const defaults$4 = {
|
|
9284
9352
|
selector: "details:not([open])"
|
|
9285
9353
|
};
|
|
9286
|
-
function init$
|
|
9287
|
-
const config2 = Object.assign({}, defaults$
|
|
9354
|
+
function init$5(options) {
|
|
9355
|
+
const config2 = Object.assign({}, defaults$4, options);
|
|
9288
9356
|
document.addEventListener(getName$1("beforePrint"), () => {
|
|
9289
9357
|
document.querySelectorAll(config2.selector).forEach((details) => {
|
|
9290
9358
|
if (!details.open) {
|
|
9291
|
-
details.setAttribute(attrs$
|
|
9359
|
+
details.setAttribute(attrs$4.opened, true);
|
|
9292
9360
|
details.open = true;
|
|
9293
9361
|
}
|
|
9294
9362
|
});
|
|
9295
9363
|
});
|
|
9296
9364
|
document.addEventListener(getName$1("afterPrint"), () => {
|
|
9297
|
-
document.querySelectorAll(attrSelector$
|
|
9298
|
-
details.removeAttribute(attrs$
|
|
9365
|
+
document.querySelectorAll(attrSelector$4("opened")).forEach((details) => {
|
|
9366
|
+
details.removeAttribute(attrs$4.opened);
|
|
9299
9367
|
details.open = false;
|
|
9300
9368
|
});
|
|
9301
9369
|
});
|
|
9302
9370
|
}
|
|
9303
9371
|
const printDetails = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9304
9372
|
__proto__: null,
|
|
9305
|
-
attrs: attrs$
|
|
9306
|
-
init: init$
|
|
9373
|
+
attrs: attrs$4,
|
|
9374
|
+
init: init$5
|
|
9307
9375
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9308
|
-
const attrs$
|
|
9376
|
+
const attrs$3 = {
|
|
9309
9377
|
init: "data-ulu-scroll-slider-init",
|
|
9310
9378
|
slider: "data-ulu-scroll-slider",
|
|
9311
9379
|
track: "data-ulu-scroll-slider-track",
|
|
9312
9380
|
controls: "data-ulu-scroll-slider-control-context"
|
|
9313
9381
|
};
|
|
9314
|
-
const attrSelector$
|
|
9315
|
-
const attrSelectorInitial$
|
|
9382
|
+
const attrSelector$3 = (key2) => `[${attrs$3[key2]}]`;
|
|
9383
|
+
const attrSelectorInitial$2 = (key2) => `${attrSelector$3(key2)}:not([${attrs$3.init}])`;
|
|
9316
9384
|
const instances = [];
|
|
9317
|
-
const defaults = {
|
|
9385
|
+
const defaults$3 = {
|
|
9318
9386
|
amount: createPager()
|
|
9319
9387
|
};
|
|
9320
|
-
function init$
|
|
9321
|
-
document.addEventListener(getName$1("pageModified"), setup$
|
|
9322
|
-
setup$
|
|
9388
|
+
function init$4() {
|
|
9389
|
+
document.addEventListener(getName$1("pageModified"), setup$2);
|
|
9390
|
+
setup$2();
|
|
9323
9391
|
}
|
|
9324
|
-
function setup$
|
|
9325
|
-
const builders = document.querySelectorAll(attrSelectorInitial$
|
|
9392
|
+
function setup$2() {
|
|
9393
|
+
const builders = document.querySelectorAll(attrSelectorInitial$2("slider"));
|
|
9326
9394
|
builders.forEach(setupSlider);
|
|
9327
9395
|
}
|
|
9328
9396
|
function setupSlider(container2) {
|
|
9329
|
-
container2.setAttribute(attrs$
|
|
9330
|
-
const
|
|
9331
|
-
const config2 = Object.assign({}, defaults,
|
|
9397
|
+
container2.setAttribute(attrs$3.init, "");
|
|
9398
|
+
const options = getDatasetOptionalJson(container2, "uluScrollSlider");
|
|
9399
|
+
const config2 = Object.assign({}, defaults$3, options);
|
|
9332
9400
|
const elements = {
|
|
9333
|
-
track: container2.querySelector(attrSelector$
|
|
9334
|
-
controls: container2.querySelector(attrSelector$
|
|
9401
|
+
track: container2.querySelector(attrSelector$3("track")),
|
|
9402
|
+
controls: container2.querySelector(attrSelector$3("controls"))
|
|
9335
9403
|
};
|
|
9336
9404
|
instances.push(new OverflowScroller(elements, config2));
|
|
9337
9405
|
}
|
|
9338
9406
|
const scrollSlider = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9339
9407
|
__proto__: null,
|
|
9340
|
-
attrs: attrs$
|
|
9341
|
-
init: init$
|
|
9342
|
-
setup: setup$
|
|
9408
|
+
attrs: attrs$3,
|
|
9409
|
+
init: init$4,
|
|
9410
|
+
setup: setup$2
|
|
9343
9411
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9344
|
-
const attrs = {
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9412
|
+
const attrs$2 = {
|
|
9413
|
+
init: "data-ulu-theme-toggle-init",
|
|
9414
|
+
toggle: "data-ulu-theme-toggle",
|
|
9415
|
+
toggleIcon: "data-ulu-theme-toggle-icon",
|
|
9416
|
+
toggleLabel: "data-ulu-theme-toggle-label",
|
|
9417
|
+
toggleRemote: "data-ulu-theme-toggle-remote",
|
|
9418
|
+
state: "data-ulu-theme-toggle-state"
|
|
9348
9419
|
};
|
|
9349
|
-
const attrSelector = (key2) => `[${attrs[key2]}]`;
|
|
9350
|
-
const attrSelectorInitial = (key2) => `${attrSelector(key2)}:not([${attrs.init}])`;
|
|
9351
|
-
const
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9420
|
+
const attrSelector$2 = (key2) => `[${attrs$2[key2]}]`;
|
|
9421
|
+
const attrSelectorInitial$1 = (key2) => `${attrSelector$2(key2)}:not([${attrs$2.init}])`;
|
|
9422
|
+
const queryAllInitial = (key2) => document.querySelectorAll(attrSelectorInitial$1(key2));
|
|
9423
|
+
const queryRemotes = (group) => document.querySelectorAll(
|
|
9424
|
+
`[${attrs$2.toggleRemote}="${group}"]`
|
|
9425
|
+
);
|
|
9426
|
+
const queryRemotesInitial = (group) => document.querySelectorAll(
|
|
9427
|
+
`[${attrs$2.toggleRemote}="${group}"]:not([${attrs$2.init}])`
|
|
9428
|
+
);
|
|
9429
|
+
const debugLog = (...msgs) => console.log("Theme Toggle:", ...msgs);
|
|
9430
|
+
const requiredToggleProps = ["target"];
|
|
9431
|
+
const checkToggleProps = hasRequiredProps(requiredToggleProps);
|
|
9432
|
+
const when = (cond, fn) => cond ? fn() : null;
|
|
9433
|
+
const defaults$2 = {
|
|
9434
|
+
/**
|
|
9435
|
+
* Object of each theme that should be toggle/cycled through
|
|
9436
|
+
*/
|
|
9437
|
+
themes: {
|
|
9438
|
+
light: {
|
|
9439
|
+
label: "Light",
|
|
9440
|
+
value: "light",
|
|
9441
|
+
iconClass: "fas fa-moon",
|
|
9442
|
+
targetClass: "theme-light",
|
|
9443
|
+
mediaQuery: "(prefers-color-scheme: light)"
|
|
9444
|
+
},
|
|
9445
|
+
dark: {
|
|
9446
|
+
label: "Dark",
|
|
9447
|
+
iconClass: "fas fa-sun",
|
|
9448
|
+
targetClass: "theme-dark",
|
|
9449
|
+
mediaQuery: "(prefers-color-scheme: dark)"
|
|
9450
|
+
}
|
|
9451
|
+
},
|
|
9452
|
+
/**
|
|
9453
|
+
* Required this is the element(s) that should be changed by a specific toggle
|
|
9454
|
+
* - The element should have data-ulu-theme-toggle-target="SOME_IDENTIFIER"
|
|
9455
|
+
*/
|
|
9456
|
+
target: "body",
|
|
9457
|
+
/**
|
|
9458
|
+
* Optional group to link remote toggles (toggles that follow the main one and can toggle too)
|
|
9459
|
+
*/
|
|
9460
|
+
group: null,
|
|
9461
|
+
/**
|
|
9462
|
+
* Optional callback to do something when the state changes
|
|
9463
|
+
*/
|
|
9464
|
+
onChange(_ctx) {
|
|
9465
|
+
},
|
|
9466
|
+
/**
|
|
9467
|
+
* The initial state for this component
|
|
9468
|
+
* - May be overridden by saved preference or media query if options are enabled
|
|
9469
|
+
*/
|
|
9470
|
+
initialState: "light",
|
|
9471
|
+
/**
|
|
9472
|
+
* Check the OS systems user preference via 'preferenceQuery' option
|
|
9473
|
+
*/
|
|
9474
|
+
checkMediaQuery: false,
|
|
9475
|
+
/**
|
|
9476
|
+
* Will store the preference in local storage so it persists between page loads
|
|
9477
|
+
*/
|
|
9478
|
+
savePreference: false,
|
|
9479
|
+
/**
|
|
9480
|
+
* The key that will be used to store the preference in local storage
|
|
9481
|
+
* - This will be used as prefix in combination with group if defined
|
|
9482
|
+
*/
|
|
9483
|
+
storagePrefix: "ulu-theme-",
|
|
9484
|
+
/**
|
|
9485
|
+
* Output information to console for debugging
|
|
9486
|
+
*/
|
|
9487
|
+
debug: false
|
|
9357
9488
|
};
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
function init$1() {
|
|
9362
|
-
document.addEventListener(getName$1("beforePrint"), () => printSetup());
|
|
9363
|
-
document.addEventListener(getName$1("afterPrint"), () => printTearDown());
|
|
9364
|
-
setup();
|
|
9489
|
+
let currentDefaults = { ...defaults$2 };
|
|
9490
|
+
function setDefaults(options) {
|
|
9491
|
+
currentDefaults = Object.assign({}, currentDefaults, options);
|
|
9365
9492
|
}
|
|
9366
|
-
function
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9493
|
+
function init$3() {
|
|
9494
|
+
document.addEventListener(getName$1("pageModified"), setup$1);
|
|
9495
|
+
setup$1();
|
|
9496
|
+
}
|
|
9497
|
+
function setup$1() {
|
|
9498
|
+
queryAllInitial("toggle").forEach(setupToggle);
|
|
9499
|
+
}
|
|
9500
|
+
function setupToggle(toggle, passedOptions) {
|
|
9501
|
+
const elementOptions = getDatasetJson(toggle, "uluThemeToggle");
|
|
9502
|
+
const options = Object.assign({}, defaults$2, passedOptions, elementOptions);
|
|
9503
|
+
if (!checkToggleProps(options)) {
|
|
9504
|
+
console.error(`Missing a required option: ${requiredToggleProps.join(", ")}`);
|
|
9505
|
+
return;
|
|
9506
|
+
}
|
|
9507
|
+
const group = options.group;
|
|
9508
|
+
const ctx = { toggle, options };
|
|
9509
|
+
const initialKey = resolveInitial(options);
|
|
9510
|
+
if (!initialKey) {
|
|
9511
|
+
console.error("Unable to resolve initial key");
|
|
9512
|
+
return;
|
|
9513
|
+
}
|
|
9514
|
+
setState$1(initialKey, ctx);
|
|
9515
|
+
toggle.addEventListener("click", onToggleClick);
|
|
9516
|
+
toggle.setAttribute(attrs$2.init, "");
|
|
9517
|
+
attachRemotes();
|
|
9518
|
+
document.addEventListener(getName$1("pageModified"), attachRemotes);
|
|
9519
|
+
function toggleState(event) {
|
|
9520
|
+
const targets = getElements(options.target);
|
|
9521
|
+
const lastKey = targets[0].dataset.uluThemeToggleState;
|
|
9522
|
+
const key2 = getNextThemeKey(lastKey, options);
|
|
9523
|
+
if (!key2) {
|
|
9524
|
+
console.error("Issue getting next theme key");
|
|
9525
|
+
return;
|
|
9526
|
+
}
|
|
9527
|
+
setState$1(key2, { ...ctx, event });
|
|
9528
|
+
}
|
|
9529
|
+
function onToggleClick(event) {
|
|
9530
|
+
toggleState(event);
|
|
9531
|
+
}
|
|
9532
|
+
function attachRemotes() {
|
|
9533
|
+
if (!group) return;
|
|
9534
|
+
const remotes = queryRemotesInitial(group);
|
|
9535
|
+
remotes.forEach((remote) => {
|
|
9536
|
+
remote.addEventListener("click", onToggleClick);
|
|
9537
|
+
remote.setAttribute(attrs$2.init, "");
|
|
9538
|
+
});
|
|
9539
|
+
}
|
|
9540
|
+
function cleanupRemotes() {
|
|
9541
|
+
if (!group) return;
|
|
9542
|
+
const remotes = queryRemotesInitial(group);
|
|
9543
|
+
remotes.forEach((remote) => {
|
|
9544
|
+
remote.removeEventListener("click", onToggleClick);
|
|
9545
|
+
remote.removeAttribute(attrs$2.init, "");
|
|
9374
9546
|
});
|
|
9547
|
+
}
|
|
9548
|
+
function destroy() {
|
|
9549
|
+
toggle.removeEventListener("click", onToggleClick);
|
|
9550
|
+
toggle.removeAttribute(attrs$2.init, "");
|
|
9551
|
+
cleanupRemotes();
|
|
9552
|
+
document.removeEventListener(getName$1("pageModified"), attachRemotes);
|
|
9553
|
+
}
|
|
9554
|
+
return {
|
|
9555
|
+
destroy,
|
|
9556
|
+
toggle,
|
|
9557
|
+
options,
|
|
9558
|
+
toggleState,
|
|
9559
|
+
setState(themeKey) {
|
|
9560
|
+
setState$1(themeKey, ctx);
|
|
9561
|
+
}
|
|
9562
|
+
};
|
|
9563
|
+
}
|
|
9564
|
+
function setState$1(key2, ctx) {
|
|
9565
|
+
if (!key2) {
|
|
9566
|
+
console.error("Missing key");
|
|
9567
|
+
return;
|
|
9568
|
+
}
|
|
9569
|
+
const { toggle, options } = ctx;
|
|
9570
|
+
const { themes, group } = options;
|
|
9571
|
+
const elements = {
|
|
9572
|
+
targets: getElements(options.target),
|
|
9573
|
+
toggles: [toggle, ...group ? queryRemotes(group) : []]
|
|
9574
|
+
};
|
|
9575
|
+
if (!elements.targets.length || !elements.toggles.length) {
|
|
9576
|
+
console.error("Issue setting state, couldn't find needed elements", elements);
|
|
9577
|
+
return;
|
|
9578
|
+
}
|
|
9579
|
+
const theme = themes[key2];
|
|
9580
|
+
const otherThemes = getOtherThemes(key2, themes);
|
|
9581
|
+
const stateCtx = {
|
|
9582
|
+
...ctx,
|
|
9583
|
+
key: key2,
|
|
9584
|
+
elements,
|
|
9585
|
+
theme,
|
|
9586
|
+
otherThemes
|
|
9587
|
+
};
|
|
9588
|
+
if (options.debug) {
|
|
9589
|
+
debugLog("set state context", stateCtx);
|
|
9590
|
+
}
|
|
9591
|
+
const otherTargetClasses = concatThemeClasses(otherThemes, "targetClass");
|
|
9592
|
+
const otherIconClasses = concatThemeClasses(otherThemes, "iconClass");
|
|
9593
|
+
elements.targets.forEach((element) => {
|
|
9594
|
+
element.setAttribute(attrs$2.state, key2);
|
|
9595
|
+
element.classList.remove(...otherTargetClasses);
|
|
9596
|
+
element.classList.add(...resolveClasses(theme.targetClass));
|
|
9375
9597
|
});
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
if (sitePreference && sitePreference != currentTheme) {
|
|
9382
|
-
changeTheme(body2);
|
|
9383
|
-
} else if (machinePreference) {
|
|
9384
|
-
changeTheme(body2);
|
|
9385
|
-
}
|
|
9386
|
-
}
|
|
9387
|
-
function changeTheme(body2) {
|
|
9388
|
-
let newTheme;
|
|
9389
|
-
let oldTheme;
|
|
9390
|
-
if (body2.classList.contains(options.darkTheme)) {
|
|
9391
|
-
oldTheme = options.darkTheme;
|
|
9392
|
-
newTheme = options.lightTheme;
|
|
9393
|
-
} else if (body2.classList.contains(options.lightTheme)) {
|
|
9394
|
-
oldTheme = options.lightTheme;
|
|
9395
|
-
newTheme = options.darkTheme;
|
|
9396
|
-
}
|
|
9397
|
-
body2.classList.remove(oldTheme);
|
|
9398
|
-
body2.classList.add(newTheme);
|
|
9399
|
-
localStorage.setItem("data-theme", newTheme);
|
|
9400
|
-
currentTheme = newTheme;
|
|
9401
|
-
changeIcons();
|
|
9402
|
-
}
|
|
9403
|
-
function changeIcons(context = document) {
|
|
9404
|
-
const icons = context.querySelectorAll(attrSelectorInitial("icon"));
|
|
9405
|
-
icons.forEach((icon) => {
|
|
9406
|
-
if (currentTheme == options.lightTheme) {
|
|
9407
|
-
icon.classList = options.darkIcon;
|
|
9408
|
-
} else {
|
|
9409
|
-
icon.classList = options.lightIcon;
|
|
9598
|
+
elements.toggles.forEach((element) => {
|
|
9599
|
+
const label = element.querySelector(attrSelector$2("toggleLabel"));
|
|
9600
|
+
const icon = element.querySelector(attrSelector$2("toggleIcon"));
|
|
9601
|
+
if (label) {
|
|
9602
|
+
label.textContent = theme.label;
|
|
9410
9603
|
}
|
|
9604
|
+
if (icon) {
|
|
9605
|
+
icon.classList.remove(...otherIconClasses);
|
|
9606
|
+
icon.classList.add(...resolveClasses(theme.iconClass));
|
|
9607
|
+
}
|
|
9608
|
+
element.setAttribute(attrs$2.state, key2);
|
|
9411
9609
|
});
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
if (
|
|
9416
|
-
|
|
9417
|
-
body2.classList.add(options.lightTheme);
|
|
9610
|
+
if (options.onChange) {
|
|
9611
|
+
options.onChange(stateCtx);
|
|
9612
|
+
}
|
|
9613
|
+
if (options.savePreference) {
|
|
9614
|
+
localStorage.setItem(getStorageKey(options), key2);
|
|
9418
9615
|
}
|
|
9419
9616
|
}
|
|
9420
|
-
function
|
|
9421
|
-
const
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9617
|
+
function resolveInitial(options) {
|
|
9618
|
+
const { savePreference, checkMediaQuery, themes, initialState } = options;
|
|
9619
|
+
const storageKey = getStorageKey(options);
|
|
9620
|
+
const saved = when(savePreference, () => localStorage.getItem(storageKey));
|
|
9621
|
+
const mediaQueryPreference = when(checkMediaQuery, () => getMatchingThemeQuery(themes));
|
|
9622
|
+
const resolved = saved || mediaQueryPreference || initialState;
|
|
9623
|
+
if (options.debug) {
|
|
9624
|
+
debugLog("Preference Saved:", saved);
|
|
9625
|
+
debugLog("Media Query Preference:", mediaQueryPreference);
|
|
9626
|
+
debugLog("Initial State:", initialState);
|
|
9425
9627
|
}
|
|
9628
|
+
if (!resolved) {
|
|
9629
|
+
console.error("Failed to resolve initial theme (pass 'initialState' to options)");
|
|
9630
|
+
}
|
|
9631
|
+
return resolved;
|
|
9632
|
+
}
|
|
9633
|
+
function getMatchingThemeQuery(themes) {
|
|
9634
|
+
const found = Object.entries(themes).find(([_key, theme]) => {
|
|
9635
|
+
if (theme.mediaQuery) {
|
|
9636
|
+
return window.matchMedia(theme.mediaQuery).matches;
|
|
9637
|
+
}
|
|
9638
|
+
});
|
|
9639
|
+
return found ? found[0] : null;
|
|
9640
|
+
}
|
|
9641
|
+
function getNextThemeKey(activeKey, options) {
|
|
9642
|
+
const { themes } = options;
|
|
9643
|
+
const keys = Object.keys(themes);
|
|
9644
|
+
const index2 = keys.findIndex((theme) => theme === activeKey);
|
|
9645
|
+
const nextIndex = index2 === -1 ? 0 : (index2 + 1) % keys.length;
|
|
9646
|
+
return keys[nextIndex];
|
|
9647
|
+
}
|
|
9648
|
+
function getOtherThemes(currentKey, themes) {
|
|
9649
|
+
const all = Object.entries(themes);
|
|
9650
|
+
return all.filter(([key2]) => key2 !== currentKey).map(([_key, value]) => value);
|
|
9651
|
+
}
|
|
9652
|
+
function concatThemeClasses(themes, property) {
|
|
9653
|
+
return themes.reduce((acc, theme) => {
|
|
9654
|
+
return acc.concat(resolveClasses(theme[property]));
|
|
9655
|
+
}, []);
|
|
9656
|
+
}
|
|
9657
|
+
function getStorageKey(options) {
|
|
9658
|
+
const { storagePrefix, group } = options;
|
|
9659
|
+
return group ? `${storagePrefix}${group}` : storagePrefix;
|
|
9426
9660
|
}
|
|
9427
9661
|
const themeToggle = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9428
9662
|
__proto__: null,
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9663
|
+
attrs: attrs$2,
|
|
9664
|
+
defaults: defaults$2,
|
|
9665
|
+
init: init$3,
|
|
9666
|
+
setDefaults,
|
|
9667
|
+
setup: setup$1,
|
|
9668
|
+
setupToggle
|
|
9669
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9670
|
+
const attrs$1 = {
|
|
9671
|
+
init: "data-ulu-details-group-init",
|
|
9672
|
+
childInit: "data-ulu-details-group-child-init",
|
|
9673
|
+
group: "data-ulu-details-group"
|
|
9674
|
+
};
|
|
9675
|
+
const attrSelector$1 = (key2) => `[${attrs$1[key2]}]`;
|
|
9676
|
+
const attrSelectorInitial = (key2) => `${attrSelector$1(key2)}:not([${attrs$1.init}])`;
|
|
9677
|
+
const defaults$1 = {
|
|
9678
|
+
onlyOneOpen: true,
|
|
9679
|
+
childSelector: ":scope > details"
|
|
9680
|
+
};
|
|
9681
|
+
function init$2() {
|
|
9682
|
+
document.addEventListener(getName$1("pageModified"), () => setup());
|
|
9683
|
+
setup();
|
|
9684
|
+
}
|
|
9685
|
+
function setup(context = document) {
|
|
9686
|
+
try {
|
|
9687
|
+
const elements = context.querySelectorAll(attrSelectorInitial("group"));
|
|
9688
|
+
return [...elements].map(setupGroup);
|
|
9689
|
+
} catch (error) {
|
|
9690
|
+
console.error(error);
|
|
9691
|
+
}
|
|
9692
|
+
}
|
|
9693
|
+
function setupGroup(element) {
|
|
9694
|
+
const elementOptions = getDatasetOptionalJson(element, "uluDetailsGroup");
|
|
9695
|
+
const options = Object.assign({}, defaults$1, elementOptions);
|
|
9696
|
+
element.setAttribute(attrs$1.t, "");
|
|
9697
|
+
setupChildren();
|
|
9698
|
+
function queryChildren() {
|
|
9699
|
+
return element.querySelectorAll(options.childSelector);
|
|
9700
|
+
}
|
|
9701
|
+
function setupChildren() {
|
|
9702
|
+
queryChildren().forEach((child) => {
|
|
9703
|
+
if (child.hasAttribute(attrs$1.childInit)) {
|
|
9704
|
+
return;
|
|
9705
|
+
} else {
|
|
9706
|
+
child.setAttribute(attrs$1.childInit, "");
|
|
9707
|
+
}
|
|
9708
|
+
console.log(child);
|
|
9709
|
+
child.addEventListener("toggle", toggleHandler);
|
|
9710
|
+
});
|
|
9711
|
+
}
|
|
9712
|
+
function toggleHandler({ target }) {
|
|
9713
|
+
if (options.onlyOneOpen) {
|
|
9714
|
+
if (target.open) {
|
|
9715
|
+
queryChildren().forEach((child) => {
|
|
9716
|
+
if (child !== target && child.open) {
|
|
9717
|
+
child.open = false;
|
|
9718
|
+
}
|
|
9719
|
+
});
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
}
|
|
9723
|
+
function destroy() {
|
|
9724
|
+
queryChildren().forEach((child) => {
|
|
9725
|
+
child.removeEventListener("toggle", toggleHandler);
|
|
9726
|
+
child.removeAttribute(attrs$1.childInit);
|
|
9727
|
+
});
|
|
9728
|
+
element.removeAttribute(attrs$1.init);
|
|
9729
|
+
}
|
|
9730
|
+
return { destroy, element, setupChildren };
|
|
9731
|
+
}
|
|
9732
|
+
const detailsGroup = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9733
|
+
__proto__: null,
|
|
9734
|
+
attrs: attrs$1,
|
|
9735
|
+
init: init$2,
|
|
9736
|
+
setup,
|
|
9737
|
+
setupGroup
|
|
9432
9738
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9433
9739
|
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9434
9740
|
__proto__: null,
|
|
9435
9741
|
breakpoints,
|
|
9436
9742
|
collapsible,
|
|
9743
|
+
detailsGroup,
|
|
9437
9744
|
dialog,
|
|
9438
9745
|
flipcard,
|
|
9439
9746
|
grid,
|
|
@@ -9461,8 +9768,8 @@ const _FileSave = class _FileSave {
|
|
|
9461
9768
|
* @param {*} data Data to put in blob file
|
|
9462
9769
|
* @param {FileSaveOptions} options Options for file, see defaults (ie. type, filename)
|
|
9463
9770
|
*/
|
|
9464
|
-
constructor(data,
|
|
9465
|
-
this.options = Object.assign({}, _FileSave.defaults,
|
|
9771
|
+
constructor(data, options) {
|
|
9772
|
+
this.options = Object.assign({}, _FileSave.defaults, options);
|
|
9466
9773
|
this.data = data;
|
|
9467
9774
|
this.blob = new Blob([data], { type: this.options.type });
|
|
9468
9775
|
this.url = URL.createObjectURL(this.blob);
|
|
@@ -9507,12 +9814,25 @@ const fileSave = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
9507
9814
|
__proto__: null,
|
|
9508
9815
|
FileSave
|
|
9509
9816
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9817
|
+
function configureIcons() {
|
|
9818
|
+
updateSettings({
|
|
9819
|
+
iconClassClose: "fas fa-xmark",
|
|
9820
|
+
iconClassDragX: "fas fa-solid fa-grip-lines-vertical",
|
|
9821
|
+
iconClassPrevious: "fas fa-solid fa-chevron-left",
|
|
9822
|
+
iconClassNext: "fas fa-solid fa-chevron-right"
|
|
9823
|
+
});
|
|
9824
|
+
}
|
|
9825
|
+
const fontAwesome = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9826
|
+
__proto__: null,
|
|
9827
|
+
configureIcons
|
|
9828
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9510
9829
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9511
9830
|
__proto__: null,
|
|
9512
9831
|
classLogger,
|
|
9513
9832
|
dom,
|
|
9514
9833
|
fileSave,
|
|
9515
9834
|
floatingUi,
|
|
9835
|
+
fontAwesome,
|
|
9516
9836
|
id,
|
|
9517
9837
|
get index() {
|
|
9518
9838
|
return index;
|
|
@@ -9522,6 +9842,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
9522
9842
|
const ulu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9523
9843
|
__proto__: null,
|
|
9524
9844
|
events: index$2,
|
|
9845
|
+
settings,
|
|
9525
9846
|
ui: index$1,
|
|
9526
9847
|
utils: index
|
|
9527
9848
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -15599,9 +15920,9 @@ const instantsearch = /* @__PURE__ */ getDefaultExportFromCjs(instantsearch_prod
|
|
|
15599
15920
|
const container = document.querySelector(".site-search");
|
|
15600
15921
|
if (container) {
|
|
15601
15922
|
console.log("init");
|
|
15602
|
-
init();
|
|
15923
|
+
init$1();
|
|
15603
15924
|
}
|
|
15604
|
-
function init() {
|
|
15925
|
+
function init$1() {
|
|
15605
15926
|
const searchClient = algoliasearch(
|
|
15606
15927
|
"3PP8YC3MQX",
|
|
15607
15928
|
"ab9e8106a1317eb9a3da408229b70590"
|
|
@@ -15636,22 +15957,112 @@ function init() {
|
|
|
15636
15957
|
]);
|
|
15637
15958
|
search.start();
|
|
15638
15959
|
}
|
|
15960
|
+
const attrs = {
|
|
15961
|
+
container: "data-list-grid",
|
|
15962
|
+
toggle: "data-list-grid-toggle",
|
|
15963
|
+
toggleItemList: "data-list-grid-toggle-list",
|
|
15964
|
+
toggleItemGrid: "data-list-grid-toggle-grid"
|
|
15965
|
+
};
|
|
15966
|
+
const defaults = {
|
|
15967
|
+
activeClass: "is-active",
|
|
15968
|
+
localStorageKey: "siteListGrid",
|
|
15969
|
+
onChange() {
|
|
15970
|
+
}
|
|
15971
|
+
};
|
|
15972
|
+
let config = defaults;
|
|
15973
|
+
const attrSelector = (key2) => `[${attrs[key2]}]`;
|
|
15974
|
+
function getPreference() {
|
|
15975
|
+
return localStorage.getItem(config.localStorageKey);
|
|
15976
|
+
}
|
|
15977
|
+
function setConfig(changes) {
|
|
15978
|
+
config = Object.assign({}, defaults, changes);
|
|
15979
|
+
}
|
|
15980
|
+
function init() {
|
|
15981
|
+
const preference = getPreference();
|
|
15982
|
+
const containers = document.querySelectorAll(attrSelector("container"));
|
|
15983
|
+
if (!containers) return;
|
|
15984
|
+
containers.forEach((container2) => {
|
|
15985
|
+
const toggle = container2.querySelector(attrSelector("toggle"));
|
|
15986
|
+
if (preference) {
|
|
15987
|
+
setState(container2, preference);
|
|
15988
|
+
}
|
|
15989
|
+
if (toggle) {
|
|
15990
|
+
toggle.addEventListener("click", onToggle);
|
|
15991
|
+
}
|
|
15992
|
+
});
|
|
15993
|
+
}
|
|
15994
|
+
function setState(container2, value) {
|
|
15995
|
+
const toggle = container2.querySelector(attrSelector("toggle"));
|
|
15996
|
+
container2.setAttribute(attrs.container, value);
|
|
15997
|
+
localStorage.setItem(config.localStorageKey, value);
|
|
15998
|
+
if (toggle) {
|
|
15999
|
+
setStateToggle(toggle, value);
|
|
16000
|
+
} else {
|
|
16001
|
+
console.warn("Unable to get toggle for list grid");
|
|
16002
|
+
}
|
|
16003
|
+
if (config.onChange) {
|
|
16004
|
+
try {
|
|
16005
|
+
config.onChange(container2, value);
|
|
16006
|
+
} catch (error) {
|
|
16007
|
+
console.error(error);
|
|
16008
|
+
}
|
|
16009
|
+
}
|
|
16010
|
+
}
|
|
16011
|
+
function setStateToggle(toggle, value) {
|
|
16012
|
+
const isList = value === "list";
|
|
16013
|
+
const list = toggle.querySelector(attrSelector("toggleItemList"));
|
|
16014
|
+
const grid2 = toggle.querySelector(attrSelector("toggleItemGrid"));
|
|
16015
|
+
if (list && grid2) {
|
|
16016
|
+
list.classList[isList ? "add" : "remove"](config.activeClass);
|
|
16017
|
+
grid2.classList[isList ? "remove" : "add"](config.activeClass);
|
|
16018
|
+
} else {
|
|
16019
|
+
console.warn("Unable to get elements for setStateToggle()");
|
|
16020
|
+
}
|
|
16021
|
+
}
|
|
16022
|
+
function onToggle() {
|
|
16023
|
+
const container2 = this.closest(attrSelector("container"));
|
|
16024
|
+
if (!container2) {
|
|
16025
|
+
console.warn("Unable to find container list grid");
|
|
16026
|
+
return;
|
|
16027
|
+
}
|
|
16028
|
+
const state = container2.getAttribute(attrs.container);
|
|
16029
|
+
const to = state === "list" ? "grid" : "list";
|
|
16030
|
+
setState(container2, to);
|
|
16031
|
+
}
|
|
15639
16032
|
window.Ulu = ulu;
|
|
15640
|
-
|
|
16033
|
+
configureIcons();
|
|
16034
|
+
init$h();
|
|
16035
|
+
init$d();
|
|
16036
|
+
init$c();
|
|
15641
16037
|
init$b();
|
|
15642
|
-
init$a();
|
|
15643
16038
|
init$9();
|
|
16039
|
+
init$f();
|
|
16040
|
+
init$g();
|
|
16041
|
+
init$8();
|
|
15644
16042
|
init$7();
|
|
15645
|
-
init$d();
|
|
15646
|
-
init$e();
|
|
15647
16043
|
init$6();
|
|
15648
16044
|
init$5();
|
|
15649
16045
|
init$4();
|
|
16046
|
+
init$a();
|
|
16047
|
+
init$e();
|
|
15650
16048
|
init$3();
|
|
15651
16049
|
init$2();
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
16050
|
+
setConfig({
|
|
16051
|
+
onChange(container2, value) {
|
|
16052
|
+
const isList = value === "list";
|
|
16053
|
+
const cards = container2.querySelectorAll(".card");
|
|
16054
|
+
const cardGrid = container2.querySelector(".card-grid");
|
|
16055
|
+
if (cards) {
|
|
16056
|
+
cards.forEach((card) => {
|
|
16057
|
+
card.classList[isList ? "add" : "remove"]("card--horizontal");
|
|
16058
|
+
});
|
|
16059
|
+
}
|
|
16060
|
+
if (cardGrid) {
|
|
16061
|
+
cardGrid.classList[isList ? "add" : "remove"]("card-grid--one-column");
|
|
16062
|
+
}
|
|
16063
|
+
}
|
|
16064
|
+
});
|
|
16065
|
+
init();
|
|
15655
16066
|
{
|
|
15656
16067
|
__vitePreload(() => import("./chunks/modulepreload-polyfill.DaKOjhqt.js"), true ? [] : void 0, import.meta.url);
|
|
15657
16068
|
}
|