@ulu/frontend 0.1.0-beta.3 → 0.1.0-beta.31
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 +210 -1
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +19 -18
- 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 +5660 -0
- package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
- package/docs-dev/demos/accordion/index.html +758 -295
- package/docs-dev/demos/basic-hero/index.html +111 -0
- package/docs-dev/demos/button/index.html +758 -295
- package/docs-dev/demos/button-verbose/index.html +5118 -0
- package/docs-dev/demos/callout/index.html +783 -307
- package/docs-dev/demos/captioned-figure/index.html +758 -295
- package/docs-dev/demos/card/index.html +819 -719
- package/docs-dev/demos/card-grid/index.html +5241 -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/css-icons/index.html +758 -295
- package/docs-dev/demos/data-grid/index.html +866 -483
- package/docs-dev/demos/data-table/index.html +783 -320
- package/docs-dev/demos/details-group/index.html +5114 -0
- package/docs-dev/demos/file-save/index.html +758 -295
- package/docs-dev/demos/flipcard/index.html +758 -295
- package/docs-dev/demos/form-theme/index.html +776 -326
- 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 +758 -295
- package/docs-dev/demos/list-inline/index.html +5100 -0
- package/docs-dev/demos/list-inline.1/index.html +4727 -0
- package/docs-dev/demos/list-lines/index.html +5090 -0
- package/docs-dev/demos/menu-stack/index.html +777 -314
- package/docs-dev/demos/modals/index.html +758 -295
- package/docs-dev/demos/nav-strip/index.html +778 -351
- package/docs-dev/demos/overlay-section/index.html +758 -295
- package/docs-dev/demos/popovers/index.html +860 -299
- package/docs-dev/demos/print/index.html +758 -295
- package/docs-dev/demos/pull-quote/index.html +758 -295
- package/docs-dev/demos/rule/index.html +758 -295
- package/docs-dev/demos/scroll-slider/index.html +72 -106
- package/docs-dev/demos/scrollpoints/index.html +758 -295
- package/docs-dev/demos/slider/index.html +12 -4
- package/docs-dev/demos/spoke-spinner/index.html +758 -295
- package/docs-dev/demos/sticky-list/index.html +5103 -0
- package/docs-dev/demos/tabs/index.html +758 -295
- package/docs-dev/demos/tag/index.html +758 -295
- package/docs-dev/demos/theme-toggle/index.html +5159 -0
- package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
- package/docs-dev/demos/tiles/index.html +758 -295
- package/docs-dev/demos/tooltip/index.html +758 -295
- package/docs-dev/guide/building-stylesheet/index.html +758 -295
- package/docs-dev/guide/developing-ulu-scss-module/index.html +758 -295
- package/docs-dev/guide/index.html +758 -295
- package/docs-dev/guide/updates-and-changes/index.html +5033 -0
- package/docs-dev/index.html +758 -295
- package/docs-dev/javascript/events/index.html +755 -294
- package/docs-dev/javascript/index.html +758 -295
- package/docs-dev/javascript/settings/index.html +5214 -0
- package/docs-dev/javascript/ui-breakpoints/index.html +755 -294
- package/docs-dev/javascript/ui-collapsible/index.html +755 -294
- package/docs-dev/javascript/ui-details-group/index.html +5214 -0
- package/docs-dev/javascript/ui-dialog/index.html +755 -294
- package/docs-dev/javascript/ui-flipcard/index.html +755 -294
- package/docs-dev/javascript/ui-grid/index.html +755 -294
- package/docs-dev/javascript/ui-modal-builder/index.html +755 -294
- package/docs-dev/javascript/ui-overflow-scroller/index.html +755 -294
- package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +755 -294
- package/docs-dev/javascript/ui-page/index.html +755 -294
- package/docs-dev/javascript/ui-popover/index.html +755 -294
- package/docs-dev/javascript/ui-print/index.html +755 -294
- package/docs-dev/javascript/ui-print-details/index.html +755 -294
- package/docs-dev/javascript/ui-programmatic-modal/index.html +755 -294
- package/docs-dev/javascript/ui-proxy-click/index.html +755 -294
- package/docs-dev/javascript/ui-resizer/index.html +755 -294
- package/docs-dev/javascript/ui-scroll-slider/index.html +755 -294
- package/docs-dev/javascript/ui-scrollpoint/index.html +755 -294
- package/docs-dev/javascript/ui-slider/index.html +755 -294
- package/docs-dev/javascript/ui-tabs/index.html +755 -294
- package/docs-dev/javascript/ui-theme-toggle/index.html +5298 -0
- package/docs-dev/javascript/ui-tooltip/index.html +755 -294
- package/docs-dev/javascript/utils-class-logger/index.html +755 -294
- package/docs-dev/javascript/utils-dom/index.html +819 -298
- package/docs-dev/javascript/utils-file-save/index.html +755 -294
- package/docs-dev/javascript/utils-floating-ui/index.html +755 -294
- package/docs-dev/javascript/utils-id/index.html +755 -294
- package/docs-dev/javascript/utils-pause-youtube-video/index.html +755 -294
- package/docs-dev/sass/base/color/index.html +755 -294
- package/docs-dev/sass/base/elements/index.html +755 -294
- package/docs-dev/sass/base/index/index.html +755 -294
- package/docs-dev/sass/base/index.html +758 -295
- package/docs-dev/sass/base/keyframes/index.html +755 -294
- package/docs-dev/sass/base/layout/index.html +755 -294
- package/docs-dev/sass/base/normalize/index.html +755 -294
- package/docs-dev/sass/base/print/index.html +755 -294
- package/docs-dev/sass/base/root/index.html +755 -294
- package/docs-dev/sass/base/typography/index.html +755 -294
- package/docs-dev/sass/components/accordion/index.html +761 -300
- package/docs-dev/sass/components/adaptive-spacing/index.html +755 -294
- package/docs-dev/sass/components/badge/index.html +763 -302
- package/docs-dev/sass/components/basic-hero/index.html +5265 -0
- package/docs-dev/sass/components/button/index.html +755 -294
- package/docs-dev/sass/components/button-verbose/index.html +813 -303
- package/docs-dev/sass/components/callout/index.html +780 -355
- package/docs-dev/sass/components/captioned-figure/index.html +878 -302
- package/docs-dev/sass/components/card/index.html +817 -313
- package/docs-dev/sass/components/card-grid/index.html +755 -294
- package/docs-dev/sass/components/css-icon/index.html +772 -304
- package/docs-dev/sass/components/data-grid/index.html +755 -294
- package/docs-dev/sass/components/data-table/index.html +951 -305
- package/docs-dev/sass/components/fill-context/index.html +755 -294
- package/docs-dev/sass/components/flipcard/index.html +791 -299
- package/docs-dev/sass/components/flipcard-grid/index.html +755 -294
- package/docs-dev/sass/components/form-theme/index.html +965 -402
- package/docs-dev/sass/components/hero/index.html +811 -302
- package/docs-dev/sass/components/horizontal-rule/index.html +755 -294
- package/docs-dev/sass/components/image-grid/index.html +755 -294
- package/docs-dev/sass/components/index/index.html +768 -304
- package/docs-dev/sass/components/index.html +758 -295
- package/docs-dev/sass/components/links/index.html +755 -294
- package/docs-dev/sass/components/list-inline/index.html +5279 -0
- package/docs-dev/sass/components/list-lines/index.html +787 -330
- package/docs-dev/sass/components/list-ordered/index.html +757 -296
- package/docs-dev/sass/components/list-unordered/index.html +755 -294
- package/docs-dev/sass/components/menu-stack/index.html +789 -315
- package/docs-dev/sass/components/modal/index.html +776 -308
- package/docs-dev/sass/components/nav-strip/index.html +767 -306
- package/docs-dev/sass/components/overlay-section/index.html +763 -302
- package/docs-dev/sass/components/pager/index.html +755 -294
- package/docs-dev/sass/components/placeholder-block/index.html +755 -294
- package/docs-dev/sass/components/popover/index.html +812 -315
- package/docs-dev/sass/components/pull-quote/index.html +767 -306
- package/docs-dev/sass/components/ratio-box/index.html +755 -294
- package/docs-dev/sass/components/rule/index.html +763 -302
- package/docs-dev/sass/components/scroll-slider/index.html +755 -294
- package/docs-dev/sass/components/skip-link/index.html +763 -302
- package/docs-dev/sass/components/slider/index.html +762 -301
- package/docs-dev/sass/components/spoke-spinner/index.html +755 -294
- package/docs-dev/sass/components/sticky-list/index.html +5483 -0
- package/docs-dev/sass/components/tabs/index.html +764 -303
- package/docs-dev/sass/components/tag/index.html +755 -294
- package/docs-dev/sass/components/tile-button/index.html +755 -294
- package/docs-dev/sass/components/tile-grid/index.html +755 -294
- package/docs-dev/sass/components/tile-grid-overlay/index.html +755 -294
- package/docs-dev/sass/components/vignette/index.html +769 -302
- package/docs-dev/sass/components/wysiwyg/index.html +755 -294
- package/docs-dev/sass/core/breakpoint/index.html +755 -294
- package/docs-dev/sass/core/button/index.html +755 -294
- package/docs-dev/sass/core/color/index.html +793 -325
- package/docs-dev/sass/core/cssvar/index.html +755 -294
- package/docs-dev/sass/core/element/index.html +755 -294
- package/docs-dev/sass/core/index.html +755 -294
- package/docs-dev/sass/core/layout/index.html +762 -301
- package/docs-dev/sass/core/path/index.html +755 -294
- package/docs-dev/sass/core/selector/index.html +755 -294
- package/docs-dev/sass/core/typography/index.html +755 -294
- package/docs-dev/sass/core/units/index.html +755 -294
- package/docs-dev/sass/core/utils/index.html +1477 -382
- package/docs-dev/sass/helpers/color/index.html +755 -294
- package/docs-dev/sass/helpers/display/index.html +755 -294
- package/docs-dev/sass/helpers/index/index.html +755 -294
- package/docs-dev/sass/helpers/index.html +758 -295
- package/docs-dev/sass/helpers/print/index.html +755 -294
- package/docs-dev/sass/helpers/typography/index.html +755 -294
- package/docs-dev/sass/helpers/units/index.html +755 -294
- package/docs-dev/sass/helpers/utilities/index.html +755 -294
- package/docs-dev/sass/index.html +758 -295
- package/js/index.js +1 -0
- package/js/settings.js +78 -0
- package/js/ui/details-group.js +121 -0
- package/js/ui/index.js +1 -0
- package/js/ui/modal-builder.js +3 -2
- package/js/ui/overflow-scroller.js +5 -4
- package/js/ui/popover.js +1 -0
- package/js/ui/programmatic-modal.js +9 -3
- package/js/ui/slider.js +7 -6
- package/js/ui/theme-toggle.js +330 -89
- package/js/utils/dom.js +43 -1
- package/js/utils/font-awesome.js +18 -0
- package/js/utils/index.js +2 -1
- package/package.json +9 -6
- package/scss/_color.scss +9 -2
- package/scss/_layout.scss +1 -4
- package/scss/_utils.scss +187 -11
- package/scss/components/README.todos +14 -0
- package/scss/components/_accordion.scss +17 -18
- package/scss/components/_badge.scss +3 -2
- package/scss/components/_basic-hero.scss +112 -0
- package/scss/components/_button-verbose.scss +66 -12
- package/scss/components/_callout.scss +43 -54
- package/scss/components/_captioned-figure.scss +23 -5
- package/scss/components/_card-grid.scss +1 -1
- package/scss/components/_card.scss +190 -70
- package/scss/components/_css-icon.scss +16 -11
- package/scss/components/_data-table.scss +41 -4
- package/scss/components/_flipcard.scss +20 -14
- package/scss/components/_form-theme.scss +135 -123
- package/scss/components/_hero.scss +9 -0
- package/scss/components/_index.scss +18 -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 +23 -19
- package/scss/components/_nav-strip.scss +25 -16
- package/scss/components/_overlay-section.scss +2 -1
- 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 +12 -12
- package/scss/components/_rule.scss +0 -1
- package/scss/components/_scroll-slider.scss +1 -1
- package/scss/components/_skip-link.scss +2 -1
- package/scss/components/_slider.scss +17 -38
- package/scss/components/_sticky-list.scss +206 -0
- package/scss/components/_tabs.scss +5 -2
- package/scss/components/_tag.scss +1 -1
- package/scss/components/_vignette.scss +1 -0
- package/types/index.d.ts +1 -0
- package/types/settings.d.ts +38 -0
- package/types/settings.d.ts.map +1 -0
- package/types/ui/details-group.d.ts +43 -0
- package/types/ui/details-group.d.ts.map +1 -0
- package/types/ui/index.d.ts +1 -0
- package/types/ui/modal-builder.d.ts +2 -2
- 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.map +1 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/slider.d.ts +2 -2
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +58 -7
- package/types/ui/theme-toggle.d.ts.map +1 -1
- package/types/utils/dom.d.ts +19 -1
- 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/js/index.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// - Will not include things that aren't used in every site (those would need to
|
|
6
6
|
// imported manually
|
|
7
7
|
|
|
8
|
+
export * as settings from "./settings.js";
|
|
8
9
|
export * as events from "./events/index.js";
|
|
9
10
|
export * as ui from "./ui/index.js";
|
|
10
11
|
export * as utils from "./utils/index.js";
|
package/js/settings.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module settings
|
|
3
|
+
* @description Manages shared configuration for the library.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Default configuration settings
|
|
7
|
+
const defaults = {
|
|
8
|
+
iconClassClose: "css-icon css-icon--close",
|
|
9
|
+
iconClassDragX: "css-icon css-icon--drag-x",
|
|
10
|
+
iconClassPrevious: "css-icon css-icon--angle-left",
|
|
11
|
+
iconClassNext: "css-icon css-icon--angle-right"
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Current configuration, initialized with defaults
|
|
15
|
+
let currentSettings = { ...defaults };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a copy of the default settings.
|
|
19
|
+
* @returns {object} A copy of the default settings object.
|
|
20
|
+
*/
|
|
21
|
+
export function getDefaultSettings() {
|
|
22
|
+
return { ...defaults };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Updates multiple configuration settings.
|
|
27
|
+
* @param {object} changes An object containing the settings to update.
|
|
28
|
+
*/
|
|
29
|
+
export function updateSettings(changes) {
|
|
30
|
+
Object.assign(currentSettings, changes);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves a copy of the current configuration settings.
|
|
35
|
+
* @returns {object} A copy of the current settings object.
|
|
36
|
+
*/
|
|
37
|
+
export function getSettings() {
|
|
38
|
+
return { ...currentSettings };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves a specific configuration setting by key.
|
|
43
|
+
* @param {string} key The key of the setting to retrieve.
|
|
44
|
+
* @returns {*} The value of the setting, or undefined if not found.
|
|
45
|
+
*/
|
|
46
|
+
export function getSetting(key) {
|
|
47
|
+
if (!currentSettings.hasOwnProperty(key)) {
|
|
48
|
+
console.warn(`Attempted to access non-existent setting: ${key}`);
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return currentSettings[key];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Updates a specific configuration setting.
|
|
56
|
+
* @param {string} key The key of the setting to update.
|
|
57
|
+
* @param {*} value The new value for the setting.
|
|
58
|
+
*/
|
|
59
|
+
export function updateSetting(key, value) {
|
|
60
|
+
currentSettings[key] = value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Creates a wrapped string representation of a configuration setting.
|
|
65
|
+
* This function returns an object with a `toString()` method that, when called,
|
|
66
|
+
* retrieves the current value of the specified setting. This allows the setting
|
|
67
|
+
* to be used as a string literal, dynamically retrieving its value.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} key The key of the setting to wrap.
|
|
70
|
+
* @returns {object} An object with a `toString()` method that returns the setting value.
|
|
71
|
+
*/
|
|
72
|
+
export function wrapSettingString(key) {
|
|
73
|
+
return {
|
|
74
|
+
toString() {
|
|
75
|
+
return getSetting(key);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ui/details-group
|
|
3
|
+
* @description Manages groups of details (ie. onlyOneOpen at a time)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { getName } from "../events/index.js";
|
|
7
|
+
import { getDatasetOptionalJson } from "../utils/dom.js";
|
|
8
|
+
|
|
9
|
+
export const attrs = {
|
|
10
|
+
init: "data-ulu-details-group-init",
|
|
11
|
+
childInit: "data-ulu-details-group-child-init",
|
|
12
|
+
group: "data-ulu-details-group",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Utils for selecting things based on attributes
|
|
16
|
+
const attrSelector = key => `[${ attrs[key] }]`;
|
|
17
|
+
const attrSelectorInitial = key => `${ attrSelector(key) }:not([${ attrs.init }])`;
|
|
18
|
+
|
|
19
|
+
const defaults = {
|
|
20
|
+
onlyOneOpen: true,
|
|
21
|
+
childSelector: ":scope > details"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Initialize everything in document
|
|
26
|
+
* - This will only initialize elements once, it is safe to call on page changes
|
|
27
|
+
*/
|
|
28
|
+
export function init() {
|
|
29
|
+
document.addEventListener(getName("pageModified"), () => setup());
|
|
30
|
+
setup();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Setup all dialog groups within context
|
|
35
|
+
* @param {HTMLElement} context [document] Element to query within
|
|
36
|
+
* @returns {Array} Array matching the groups queried with their return objects from setupGroup() [used for destroy/etc]
|
|
37
|
+
*/
|
|
38
|
+
export function setup(context = document) {
|
|
39
|
+
// Added try because we are using querySelectorAll with :scope by default
|
|
40
|
+
// which will not work in Internet Explorer or early edge (some alt. browsers too)
|
|
41
|
+
try {
|
|
42
|
+
const elements = context.querySelectorAll(attrSelectorInitial("group"));
|
|
43
|
+
return [...elements].map(setupGroup);
|
|
44
|
+
} catch(error) {
|
|
45
|
+
console.error(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {Object} DetailsGroupInstance
|
|
51
|
+
* @property {Function} destroy A function to remove event listeners and attributes.
|
|
52
|
+
* @property {HTMLElement} element The parent element.
|
|
53
|
+
* @property {Function} setupChildren A function to initialize the child details elements.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Sets up a single group of details elements to manage their behavior.
|
|
58
|
+
* @param {HTMLElement} element - The parent element containing the details elements.
|
|
59
|
+
* @returns {DetailsGroupInstance}
|
|
60
|
+
*/
|
|
61
|
+
export function setupGroup(element) {
|
|
62
|
+
const elementOptions = getDatasetOptionalJson(element, "uluDetailsGroup");
|
|
63
|
+
const options = Object.assign({}, defaults, elementOptions);
|
|
64
|
+
|
|
65
|
+
element.setAttribute(attrs.t, "");
|
|
66
|
+
setupChildren();
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Queries all current children in element
|
|
70
|
+
* @ignore
|
|
71
|
+
*/
|
|
72
|
+
function queryChildren() {
|
|
73
|
+
return element.querySelectorAll(options.childSelector);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Sets up any children not already setup in group
|
|
78
|
+
*/
|
|
79
|
+
function setupChildren() {
|
|
80
|
+
queryChildren().forEach(child => {
|
|
81
|
+
if (child.hasAttribute(attrs.childInit)) {
|
|
82
|
+
return;
|
|
83
|
+
} else {
|
|
84
|
+
child.setAttribute(attrs.childInit, "");
|
|
85
|
+
}
|
|
86
|
+
console.log(child);
|
|
87
|
+
|
|
88
|
+
child.addEventListener("toggle", toggleHandler);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Toggle handler for child details element
|
|
94
|
+
* - For things like one open at a time
|
|
95
|
+
* @ignore
|
|
96
|
+
*/
|
|
97
|
+
function toggleHandler({ target }) {
|
|
98
|
+
if (options.onlyOneOpen) {
|
|
99
|
+
if (target.open) {
|
|
100
|
+
queryChildren().forEach(child => {
|
|
101
|
+
if (child !== target && child.open) {
|
|
102
|
+
child.open = false;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Function removes all handlers and init attributes
|
|
111
|
+
*/
|
|
112
|
+
function destroy() {
|
|
113
|
+
queryChildren().forEach(child => {
|
|
114
|
+
child.removeEventListener("toggle", toggleHandler);
|
|
115
|
+
child.removeAttribute(attrs.childInit);
|
|
116
|
+
});
|
|
117
|
+
element.removeAttribute(attrs.init);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return { destroy, element, setupChildren };
|
|
121
|
+
}
|
package/js/ui/index.js
CHANGED
package/js/ui/modal-builder.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// Note this needs to be run before dialogs are initialized!
|
|
6
6
|
|
|
7
|
+
import { wrapSettingString } from "../settings.js";
|
|
7
8
|
import { getName } from "../events/index.js";
|
|
8
9
|
import { createElementFromHtml } from "@ulu/utils/browser/dom.js";
|
|
9
10
|
import { Resizer } from "./resizer.js";
|
|
@@ -37,8 +38,8 @@ export const defaults = {
|
|
|
37
38
|
print: false,
|
|
38
39
|
noMinHeight: false,
|
|
39
40
|
class: "",
|
|
40
|
-
classCloseIcon: "
|
|
41
|
-
classResizerIcon: "
|
|
41
|
+
classCloseIcon: wrapSettingString("iconClassClose"),
|
|
42
|
+
classResizerIcon: wrapSettingString("iconClassDragX"),
|
|
42
43
|
debug: false,
|
|
43
44
|
templateCloseIcon(config) {
|
|
44
45
|
return `<span class="modal__close-icon ${ config.classCloseIcon }" aria-hidden="true"></span>`;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @todo - Document that user could use something like [https://github.com/LachlanArthur/scroll-snap-api/tree/master/src] to have it go between items
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
+
import { wrapSettingString } from "../settings.js";
|
|
13
14
|
import { hasRequiredProps } from '@ulu/utils/object.js';
|
|
14
15
|
import { logError } from "../utils/class-logger.js";
|
|
15
16
|
const requiredElements = [
|
|
@@ -26,8 +27,8 @@ export class OverflowScroller {
|
|
|
26
27
|
offsetEnd: 100,
|
|
27
28
|
amount: "auto",
|
|
28
29
|
buttonClasses: ["button", "button--icon"],
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
iconClassPrevious: wrapSettingString("iconClassPrevious"),
|
|
31
|
+
iconClassNext: wrapSettingString("iconClassNext"),
|
|
31
32
|
}
|
|
32
33
|
constructor(elements, config) {
|
|
33
34
|
this.options = Object.assign({}, OverflowScroller.defaults, config);
|
|
@@ -87,10 +88,10 @@ export class OverflowScroller {
|
|
|
87
88
|
return button;
|
|
88
89
|
}
|
|
89
90
|
getControlContent(action) {
|
|
90
|
-
const classes = this.options[action === "next" ? "
|
|
91
|
+
const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
|
|
91
92
|
return `
|
|
92
93
|
<span class="hidden-visually">${ action }</span>
|
|
93
|
-
<span class="${ classes
|
|
94
|
+
<span class="${ classes }" aria-hidden="true"></span>
|
|
94
95
|
`;
|
|
95
96
|
}
|
|
96
97
|
onScroll(event) {
|
package/js/ui/popover.js
CHANGED
|
@@ -124,6 +124,7 @@ export class Popover extends Collapsible {
|
|
|
124
124
|
createFloatingInstance() {
|
|
125
125
|
const { content, anchor, contentArrow } = this.elements;
|
|
126
126
|
const floatingElements = { trigger: anchor, contentArrow, content };
|
|
127
|
+
console.log("this.floatingOptions:\n", this.floatingOptions);
|
|
127
128
|
this.floatingCleanup = createFloatingUi(floatingElements, this.floatingOptions);
|
|
128
129
|
}
|
|
129
130
|
destroyFloatingInstance() {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { getName, dispatch } from "../events/index.js";
|
|
7
7
|
import { newId } from "../utils/id.js";
|
|
8
|
+
import { getElement } from "../utils/dom.js";
|
|
8
9
|
import { buildModal } from "./modal-builder.js";
|
|
9
10
|
|
|
10
11
|
export class ProgrammaticModalManager {
|
|
@@ -43,12 +44,17 @@ export class ProgrammaticModalManager {
|
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
createAndOpen(config, afterCreate) {
|
|
46
|
-
const {
|
|
47
|
-
const content =
|
|
47
|
+
const { noClickTrigger, removeOnClose, element, classes } = config;
|
|
48
|
+
const content = getElement(element);
|
|
48
49
|
if (!content.id) {
|
|
49
50
|
content.id = newId();
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
// Added to match original jquery module api
|
|
54
|
+
if (classes) {
|
|
55
|
+
content.classList.add(...classes);
|
|
56
|
+
}
|
|
57
|
+
|
|
52
58
|
let trigger;
|
|
53
59
|
if (!noClickTrigger) {
|
|
54
60
|
trigger = this.cachedTrigger;
|
|
@@ -57,7 +63,7 @@ export class ProgrammaticModalManager {
|
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
if (!content) {
|
|
60
|
-
console.error("No element found from config.
|
|
66
|
+
console.error("No element found from config.element. ", config);
|
|
61
67
|
return;
|
|
62
68
|
}
|
|
63
69
|
const { modal } = buildModal(content, config.modal);
|
package/js/ui/slider.js
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
// https://dev.opera.com/articles/css-will-change-property/
|
|
28
28
|
// * Will Change use
|
|
29
29
|
|
|
30
|
+
import { wrapSettingString } from "../settings.js";
|
|
30
31
|
import maintain from 'ally.js/maintain/_maintain';
|
|
31
32
|
import { hasRequiredProps } from '@ulu/utils/object.js';
|
|
32
33
|
import { trimWhitespace } from "@ulu/utils/string.js";
|
|
@@ -120,9 +121,9 @@ export class Slider {
|
|
|
120
121
|
transitionDuration: 700,
|
|
121
122
|
transitionDurationExit: 400,
|
|
122
123
|
transitionTimingFunction: "ease-in-out",
|
|
123
|
-
buttonClasses: ["
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
buttonClasses: ["button", "button--icon"],
|
|
125
|
+
iconClassPrevious: wrapSettingString("iconClassPrevious"),
|
|
126
|
+
iconClassNext: wrapSettingString("iconClassNext"),
|
|
126
127
|
// transition: true
|
|
127
128
|
}
|
|
128
129
|
// constructor(container, title, trackContainer, track, slides, config, debug = false) {
|
|
@@ -454,6 +455,7 @@ export class Slider {
|
|
|
454
455
|
const button = document.createElement("button");
|
|
455
456
|
button.classList.add(this.getClass("control-button"));
|
|
456
457
|
button.classList.add(this.getClass(`control-button--${ action }`));
|
|
458
|
+
|
|
457
459
|
button.classList.add(...this.options.buttonClasses);
|
|
458
460
|
button.setAttribute("data-slider-control", action);
|
|
459
461
|
button.setAttribute("type", "button");
|
|
@@ -514,12 +516,11 @@ export class Slider {
|
|
|
514
516
|
button.addEventListener("click", this.goto.bind(this, index));
|
|
515
517
|
return button;
|
|
516
518
|
}
|
|
517
|
-
// change to css-icon
|
|
518
519
|
getControlContent(action) {
|
|
519
|
-
const classes = this.options[action === "next" ? "
|
|
520
|
+
const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
|
|
520
521
|
return `
|
|
521
522
|
<span class="hidden-visually">${ action }</span>
|
|
522
|
-
<span class="${
|
|
523
|
+
<span class="${ this.getClass("control-icon") } ${ classes }" aria-hidden="true"></span>
|
|
523
524
|
`;
|
|
524
525
|
}
|
|
525
526
|
getNavContent(number) {
|