@ulu/frontend 0.2.0-beta.8 → 0.2.1
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/README.dev.md +36 -13
- package/README.md +3 -1
- package/dist/es/core/events.js +36 -25
- package/dist/es/core/settings.js +33 -22
- package/dist/es/index.js +92 -88
- package/dist/es/ui/dialog.js +57 -46
- package/dist/es/ui/index.d.ts +2 -0
- package/dist/es/ui/modal-builder.js +39 -28
- package/dist/es/ui/overflow-scroller.js +30 -24
- package/dist/es/ui/programmatic-modal.js +55 -0
- package/dist/es/ui/proxy-click.js +37 -26
- package/dist/es/ui/resizer.js +57 -49
- package/dist/es/ui/slider.d.ts.map +1 -1
- package/dist/es/ui/slider.js +90 -67
- package/dist/es/ui/tab-manager.d.ts +145 -0
- package/dist/es/ui/tab-manager.d.ts.map +1 -0
- package/dist/es/ui/tab-manager.js +155 -0
- package/dist/es/ui/tabs.d.ts +5 -5
- package/dist/es/ui/tabs.d.ts.map +1 -1
- package/dist/es/ui/tabs.js +34 -51
- package/dist/es/ui/theme-toggle.js +80 -69
- package/dist/es/ui/tooltip.js +53 -44
- package/dist/es/utils/floating-ui.js +35 -24
- package/dist/umd/frontend.css +1 -0
- package/dist/umd/ulu-frontend.umd.js +40 -47
- package/lib/js/exports.md +1 -0
- package/lib/js/ui/index.js +8 -0
- package/lib/js/ui/slider.js +3 -3
- package/lib/js/ui/tab-manager.js +324 -0
- package/lib/js/ui/tabs.js +33 -92
- package/lib/scss/_breakpoint.scss +3 -3
- package/lib/scss/_button.scss +3 -3
- package/lib/scss/_color.scss +3 -2
- package/lib/scss/_element.scss +10 -4
- package/lib/scss/_layout.scss +11 -4
- package/lib/scss/_selector.scss +2 -1
- package/lib/scss/_typography.scss +9 -10
- package/lib/scss/_utils.scss +52 -19
- package/lib/scss/base/_elements.scss +1 -1
- package/lib/scss/components/_basic-hero.scss +1 -1
- package/lib/scss/components/_button-verbose.scss +2 -2
- package/lib/scss/components/_callout.scss +3 -4
- package/lib/scss/components/_css-icon.scss +2 -2
- package/lib/scss/components/_data-grid.scss +5 -5
- package/lib/scss/components/_flipcard.scss +3 -2
- package/lib/scss/components/_index.scss +6 -0
- package/lib/scss/components/_panel.scss +1 -1
- package/lib/scss/components/_popover.scss +9 -6
- package/lib/scss/components/_tabs.scss +20 -5
- package/lib/scss/components/_tagged.scss +59 -0
- package/package.json +25 -35
- package/dist/umd/style.css +0 -1
- package/lib/js/ui/dialog.todo +0 -3
package/README.dev.md
CHANGED
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
# Development
|
|
1
|
+
# Development Overview
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## System Architecture
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Used for examples in docs
|
|
7
|
-
- Rebuild by running `npm run build`
|
|
5
|
+
The library is designed with a clear separation between styles (SCSS) and behavior (JavaScript). They are loosely coupled, interacting through CSS classes and data attributes in the HTML.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
* **SCSS:** Provides the styling layer. It is highly modular, with global settings (color, typography), base element styles, and individual component styles. The file `lib/scss/stylesheets/full.scss` compiles everything into a single, comprehensive stylesheet for easy consumption.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
* **JavaScript:** Provides interactivity. It is also modular, with `core` logic, `utility` functions, and `ui` components. The JavaScript is designed to be "tree-shakable," so a project using this library will only bundle the code for the components it actually uses.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
### How They Interact
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
1. **Component Structure:** Components are composed of SCSS and JavaScript files. A component might be SCSS-only (providing styles for a static element), JavaScript-only (providing some background logic), or a pair of both that work together (e.g., `_tabs.scss` and `tabs.js`).
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
- Run `npm run types` to update Typescript declarations (extracted from JS docs)
|
|
15
|
+
2. **Initialization:** For components with JavaScript, an `init` function (e.g., `tabsInit`) is typically provided. This function scans the DOM for specific elements, usually identified by a `data-ulu-component` attribute.
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
3. **Styling Agnosticism:** A key design principle is that the JavaScript is styling-agnostic. It identifies and interacts with elements exclusively through `data-ulu-*` attributes, not CSS classes. This intentional separation means you can use the provided JavaScript functionality with completely custom component styling, simply by structuring your HTML with the correct data attributes.
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
4. **Activation:** When an `init` function finds its corresponding component in the HTML, it instantiates a JavaScript class to manage its state and handle user interactions (like clicks or keyboard events).
|
|
20
|
+
|
|
21
|
+
5. **State & Styling:** While the JavaScript itself is not tied to the SCSS styling, it does manage state by adding or removing state-based CSS classes (e.g., `.is-active`). The library's SCSS uses these classes to apply styles, and you can use them in your own stylesheets as well.
|
|
22
|
+
|
|
23
|
+
In short, the SCSS defines what components and their different states *look like*, while the JavaScript is responsible for activating components and changing their states based on user interaction. This creates a flexible and efficient system.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Benchmark Notes
|
|
27
|
+
|
|
28
|
+
### Javascript
|
|
29
|
+
|
|
30
|
+
- Old Vite 4
|
|
31
|
+
- No build.target
|
|
32
|
+
- /dist/es 183kb (js, types, etc)
|
|
33
|
+
- Included aria-tablist dep
|
|
34
|
+
- Wasn't minified
|
|
35
|
+
- Current Build (Vite 7)
|
|
36
|
+
- Javascript Bundle
|
|
37
|
+
- Uncompressed: ~74.7 kB
|
|
38
|
+
- Gzip: ~30 kB (less when actually bundled with tree-shaking)
|
|
39
|
+
- About the size of jquery or a small image
|
|
40
|
+
- CSS Bundle
|
|
41
|
+
- Uncompressed: ~139 kB
|
|
42
|
+
- Gzip: ~21 kB (compresses well)
|
|
43
|
+
- In a real project not using every scss module
|
|
44
|
+
- Uncompressed: ~80-100 kB
|
|
45
|
+
- Gzip: ~13-16 kB
|
package/README.md
CHANGED
|
@@ -6,11 +6,13 @@ Versatile frontend toolkit designed for a variety of web development scenarios.
|
|
|
6
6
|
|
|
7
7
|
## key Features
|
|
8
8
|
|
|
9
|
+
- **Lightweight Footprint:** The core library is very small, with the full UMD JavaScript bundle at ~20kb (gzipped) and the complete CSS bundle at ~19kb (gzipped). With tree-shaking and modular SCSS, the final footprint in a project is often even smaller.
|
|
9
10
|
- **Target Environment:** The JavaScript "UI" modules are specifically tailored for traditional sites, such as static websites and CMS-driven platforms. However, the comprehensive SCSS modules are fully compatible and can be utilized in modern JavaScript applications built with frameworks like React or Vue.
|
|
10
11
|
- **Configuration & Consistency:** The system's main goal is to allow for highly flexible, per-site configuration while maintaining a consistent set of accessible and high-quality components.
|
|
11
12
|
- **Flexible Usage:** This library is designed as a toolkit, offering the flexibility to be used as a complete stylesheet solution or to pick and choose individual SCSS modules and components as needed.
|
|
13
|
+
- **Styling Agnostic JavaScript:** The JavaScript components use `data-*` attributes for behavior, not CSS classes. This means you can use the powerful JavaScript-driven interactions with your own custom-styled components.
|
|
12
14
|
- **Integration Adaptability:** All SCSS base selectors (for components, utilities, etc.) can be easily adjusted, making it highly adaptable for seamless integration into pre-existing systems and diverse development environments.
|
|
13
|
-
- API Documentation for both SCSS and JS with
|
|
15
|
+
- **API Documentation:** API Documentation for both SCSS and JS with demos
|
|
14
16
|
|
|
15
17
|
## Related Links
|
|
16
18
|
|
package/dist/es/core/events.js
CHANGED
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var d = Object.getOwnPropertySymbols;
|
|
3
|
+
var f = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var s = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, a = (e, n) => {
|
|
5
|
+
for (var t in n || (n = {}))
|
|
6
|
+
f.call(n, t) && s(e, t, n[t]);
|
|
7
|
+
if (d)
|
|
8
|
+
for (var t of d(n))
|
|
9
|
+
v.call(n, t) && s(e, t, n[t]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
import { debounce as l } from "@ulu/utils/performance.js";
|
|
13
|
+
import { isBrowser as p } from "@ulu/utils/browser/dom.js";
|
|
14
|
+
p() && (b(), m());
|
|
15
|
+
const r = {
|
|
5
16
|
pageModified(e) {
|
|
6
|
-
e.dispatchEvent(
|
|
17
|
+
e.dispatchEvent(i("pageModified"));
|
|
7
18
|
},
|
|
8
19
|
pageResized(e) {
|
|
9
|
-
e.dispatchEvent(
|
|
20
|
+
e.dispatchEvent(i("pageResized"));
|
|
10
21
|
},
|
|
11
22
|
beforePrint(e) {
|
|
12
|
-
e.dispatchEvent(
|
|
23
|
+
e.dispatchEvent(i("beforePrint"));
|
|
13
24
|
},
|
|
14
25
|
afterPrint(e) {
|
|
15
|
-
e.dispatchEvent(
|
|
26
|
+
e.dispatchEvent(i("afterPrint"));
|
|
16
27
|
}
|
|
17
|
-
},
|
|
18
|
-
function
|
|
19
|
-
|
|
28
|
+
}, E = Object.keys(r);
|
|
29
|
+
function o(e, n) {
|
|
30
|
+
r[e] ? r[e](n) : console.warn(`Unable to dispatch non-core event: ${e}`);
|
|
20
31
|
}
|
|
21
|
-
function
|
|
32
|
+
function c(e) {
|
|
22
33
|
return "ulu:" + e;
|
|
23
34
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
35
|
+
function h(e) {
|
|
36
|
+
return E.includes(e) ? c(e) : (console.warn(`'${e}' is not a valid core event type.`), null);
|
|
26
37
|
}
|
|
27
|
-
function
|
|
28
|
-
return new CustomEvent(
|
|
38
|
+
function i(e, n = null, t = { bubbles: !0 }) {
|
|
39
|
+
return new CustomEvent(c(e), a({ detail: n }, t));
|
|
29
40
|
}
|
|
30
|
-
function
|
|
31
|
-
window.addEventListener("resize",
|
|
41
|
+
function b() {
|
|
42
|
+
window.addEventListener("resize", l(() => o("pageResized", document), 250));
|
|
32
43
|
}
|
|
33
|
-
function
|
|
44
|
+
function m() {
|
|
34
45
|
window.addEventListener("beforeprint", () => {
|
|
35
|
-
|
|
46
|
+
o("beforePrint", document);
|
|
36
47
|
}), window.addEventListener("afterprint", () => {
|
|
37
|
-
|
|
48
|
+
o("afterPrint", document);
|
|
38
49
|
});
|
|
39
50
|
}
|
|
40
51
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
i as createUluEvent,
|
|
53
|
+
o as dispatchCoreEvent,
|
|
54
|
+
h as getCoreEventName,
|
|
55
|
+
c as getUluEventName
|
|
45
56
|
};
|
package/dist/es/core/settings.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var i = Object.getOwnPropertySymbols;
|
|
3
|
+
var g = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var o = (n, t, s) => t in n ? a(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s, c = (n, t) => {
|
|
5
|
+
for (var s in t || (t = {}))
|
|
6
|
+
g.call(t, s) && o(n, s, t[s]);
|
|
7
|
+
if (i)
|
|
8
|
+
for (var s of i(t))
|
|
9
|
+
u.call(t, s) && o(n, s, t[s]);
|
|
10
|
+
return n;
|
|
11
|
+
};
|
|
12
|
+
const r = {
|
|
2
13
|
iconClassClose: "css-icon css-icon--close",
|
|
3
14
|
iconClassDragX: "css-icon css-icon--drag-x",
|
|
4
15
|
iconClassDragBoth: "css-icon css-icon--drag-both",
|
|
@@ -6,39 +17,39 @@ const c = {
|
|
|
6
17
|
iconClassNext: "css-icon css-icon--angle-right",
|
|
7
18
|
cssvarPrefix: ""
|
|
8
19
|
};
|
|
9
|
-
let
|
|
10
|
-
function
|
|
11
|
-
return {
|
|
20
|
+
let e = c({}, r);
|
|
21
|
+
function S() {
|
|
22
|
+
return c({}, r);
|
|
12
23
|
}
|
|
13
|
-
function
|
|
14
|
-
Object.assign(
|
|
24
|
+
function d(n) {
|
|
25
|
+
Object.assign(e, n);
|
|
15
26
|
}
|
|
16
|
-
function
|
|
17
|
-
return {
|
|
27
|
+
function p() {
|
|
28
|
+
return c({}, e);
|
|
18
29
|
}
|
|
19
|
-
function
|
|
20
|
-
if (!
|
|
30
|
+
function l(n) {
|
|
31
|
+
if (!e.hasOwnProperty(n)) {
|
|
21
32
|
console.warn(`Attempted to access non-existent setting: ${n}`);
|
|
22
33
|
return;
|
|
23
34
|
}
|
|
24
|
-
return
|
|
35
|
+
return e[n];
|
|
25
36
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
37
|
+
function C(n, t) {
|
|
38
|
+
e[n] = t;
|
|
28
39
|
}
|
|
29
|
-
function
|
|
40
|
+
function x(n, t) {
|
|
30
41
|
return {
|
|
31
42
|
toString() {
|
|
32
|
-
const
|
|
33
|
-
return
|
|
43
|
+
const s = l(n);
|
|
44
|
+
return t ? t(s) : s;
|
|
34
45
|
}
|
|
35
46
|
};
|
|
36
47
|
}
|
|
37
48
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
S as getDefaultSettings,
|
|
50
|
+
l as getSetting,
|
|
51
|
+
p as getSettings,
|
|
52
|
+
C as updateSetting,
|
|
53
|
+
d as updateSettings,
|
|
54
|
+
x as wrapSettingString
|
|
44
55
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -4,120 +4,124 @@ import { ComponentInitializer as m } from "./core/component.js";
|
|
|
4
4
|
import { BreakpointManager as I } from "./ui/breakpoints.js";
|
|
5
5
|
import { Collapsible as z } from "./ui/collapsible.js";
|
|
6
6
|
import { init as D, initializer as C, setupGroup as v } from "./ui/details-group.js";
|
|
7
|
-
import { baseAttribute as
|
|
8
|
-
import { Flipcard as
|
|
9
|
-
import { init as
|
|
7
|
+
import { baseAttribute as T, closeAttribute as y, defaults as B, getDialogOptions as P, init as h, initializer as A, setDefaults as k, setupDialog as G, setupTrigger as L } from "./ui/dialog.js";
|
|
8
|
+
import { Flipcard as M, init as w, initializer as U } from "./ui/flipcard.js";
|
|
9
|
+
import { init as F, initializer as O } from "./ui/grid.js";
|
|
10
10
|
import { buildModal as N, defaults as R, init as W, initializer as K, setDefaults as j } from "./ui/modal-builder.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { init as pe } from "./ui/print.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
11
|
+
import { ProgrammaticModalManager as J } from "./ui/programmatic-modal.js";
|
|
12
|
+
import { OverflowScroller as X } from "./ui/overflow-scroller.js";
|
|
13
|
+
import { createPager as Z } from "./ui/overflow-scroller-pager.js";
|
|
14
|
+
import { init as $ } from "./ui/page.js";
|
|
15
|
+
import { Popover as te, getContentByTrigger as ie, init as re, initializer as ae, instances as oe, resolve as se } from "./ui/popover.js";
|
|
16
|
+
import { attrs as ne, init as pe } from "./ui/print-details.js";
|
|
17
|
+
import { init as ue } from "./ui/print.js";
|
|
18
|
+
import { attachHandlers as de, defaults as me, init as xe, initializer as Ie, setDefaults as ce, setupProxy as ze } from "./ui/proxy-click.js";
|
|
19
|
+
import { Resizer as De } from "./ui/resizer.js";
|
|
20
|
+
import { init as ve, initializer as be } from "./ui/scroll-slider.js";
|
|
21
|
+
import { Scrollpoint as ye, init as Be, initializer as Pe } from "./ui/scrollpoint.js";
|
|
22
|
+
import { Slider as Ae, init as ke, initializer as Ge, setupSlider as Le } from "./ui/slider.js";
|
|
23
|
+
import { TabManager as Me } from "./ui/tab-manager.js";
|
|
24
|
+
import { init as Ue, initializer as Ve, instances as Fe, setup as Oe } from "./ui/tabs.js";
|
|
25
|
+
import { defaults as Ne, init as Re, initializer as We, setDefaults as Ke, setupToggle as je } from "./ui/theme-toggle.js";
|
|
26
|
+
import { Tooltip as Je, init as Qe, initializer as Xe } from "./ui/tooltip.js";
|
|
27
|
+
import { log as Ze, logError as _e, logWarning as $e, set as et } from "./utils/class-logger.js";
|
|
28
|
+
import { dataAttributeToDatasetKey as it, resolveClasses as rt, setPositionClasses as at } from "./utils/dom.js";
|
|
29
|
+
import { FileSave as st } from "./utils/file-save.js";
|
|
30
|
+
import { createFloatingUi as nt, defaults as pt } from "./utils/floating-ui.js";
|
|
31
|
+
import { configureIcons as ut } from "./utils/font-awesome.js";
|
|
32
|
+
import { ensureId as dt, newId as mt } from "./utils/id.js";
|
|
33
|
+
import { pauseVideos as It, prepVideos as ct } from "./utils/pause-youtube-video.js";
|
|
32
34
|
export {
|
|
33
35
|
I as BreakpointManager,
|
|
34
36
|
z as Collapsible,
|
|
35
37
|
m as ComponentInitializer,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
st as FileSave,
|
|
39
|
+
M as Flipcard,
|
|
40
|
+
X as OverflowScroller,
|
|
41
|
+
te as Popover,
|
|
42
|
+
J as ProgrammaticModalManager,
|
|
43
|
+
De as Resizer,
|
|
44
|
+
ye as Scrollpoint,
|
|
45
|
+
Ae as Slider,
|
|
46
|
+
Me as TabManager,
|
|
47
|
+
Je as Tooltip,
|
|
48
|
+
Ze as classLoggerLog,
|
|
49
|
+
_e as classLoggerLogError,
|
|
50
|
+
$e as classLoggerLogWarning,
|
|
51
|
+
et as classLoggerSet,
|
|
52
|
+
nt as createFloatingUi,
|
|
49
53
|
i as createUluEvent,
|
|
50
|
-
|
|
54
|
+
it as dataAttributeToDatasetKey,
|
|
51
55
|
D as detailsGroupInit,
|
|
52
56
|
C as detailsGroupInitializer,
|
|
53
57
|
v as detailsGroupSetupGroup,
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
T as dialogBaseAttribute,
|
|
59
|
+
y as dialogCloseAttribute,
|
|
56
60
|
B as dialogDefaults,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
P as dialogGetDialogOptions,
|
|
62
|
+
h as dialogInit,
|
|
63
|
+
A as dialogInitializer,
|
|
60
64
|
k as dialogSetDefaults,
|
|
61
65
|
G as dialogSetupDialog,
|
|
62
66
|
L as dialogSetupTrigger,
|
|
63
67
|
r as dispatchCoreEvent,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
dt as ensureId,
|
|
69
|
+
w as flipcardInit,
|
|
70
|
+
U as flipcardInitializer,
|
|
71
|
+
pt as floatingUiDefaults,
|
|
72
|
+
ut as fontAwesomeConfigureIcons,
|
|
69
73
|
a as getCoreEventName,
|
|
70
74
|
l as getDefaultSettings,
|
|
71
75
|
n as getSetting,
|
|
72
76
|
p as getSettings,
|
|
73
77
|
o as getUluEventName,
|
|
74
|
-
|
|
78
|
+
F as gridInit,
|
|
75
79
|
O as gridInitializer,
|
|
76
80
|
N as modalBuilderBuildModal,
|
|
77
81
|
R as modalBuilderDefaults,
|
|
78
82
|
W as modalBuilderInit,
|
|
79
83
|
K as modalBuilderInitializer,
|
|
80
84
|
j as modalBuilderSetDefaults,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
85
|
+
mt as newId,
|
|
86
|
+
Z as overflowScrollerCreatePager,
|
|
87
|
+
$ as pageInit,
|
|
88
|
+
ie as popoverGetContentByTrigger,
|
|
89
|
+
re as popoverInit,
|
|
90
|
+
ae as popoverInitializer,
|
|
91
|
+
oe as popoverInstances,
|
|
92
|
+
se as popoverResolve,
|
|
93
|
+
ne as printDetailsAttrs,
|
|
94
|
+
pe as printDetailsInit,
|
|
95
|
+
ue as printInit,
|
|
96
|
+
de as proxyClickAttachHandlers,
|
|
97
|
+
me as proxyClickDefaults,
|
|
98
|
+
xe as proxyClickInit,
|
|
99
|
+
Ie as proxyClickInitializer,
|
|
100
|
+
ce as proxyClickSetDefaults,
|
|
101
|
+
ze as proxyClickSetupProxy,
|
|
102
|
+
rt as resolveClasses,
|
|
103
|
+
ve as scrollSliderInit,
|
|
104
|
+
be as scrollSliderInitializer,
|
|
105
|
+
Be as scrollpointInit,
|
|
106
|
+
Pe as scrollpointInitializer,
|
|
107
|
+
at as setPositionClasses,
|
|
108
|
+
ke as sliderInit,
|
|
109
|
+
Ge as sliderInitializer,
|
|
110
|
+
Le as sliderSetupSlider,
|
|
111
|
+
Ue as tabsInit,
|
|
112
|
+
Ve as tabsInitializer,
|
|
113
|
+
Fe as tabsInstances,
|
|
114
|
+
Oe as tabsSetup,
|
|
115
|
+
Ne as themeToggleDefaults,
|
|
116
|
+
Re as themeToggleInit,
|
|
117
|
+
We as themeToggleInitializer,
|
|
118
|
+
Ke as themeToggleSetDefaults,
|
|
119
|
+
je as themeToggleSetupToggle,
|
|
120
|
+
Qe as tooltipInit,
|
|
121
|
+
Xe as tooltipInitializer,
|
|
118
122
|
g as updateSetting,
|
|
119
123
|
u as updateSettings,
|
|
120
124
|
f as wrapSettingString,
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
It as youtubePauseVideos,
|
|
126
|
+
ct as youtubePrepVideos
|
|
123
127
|
};
|
package/dist/es/ui/dialog.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var f = Object.getOwnPropertySymbols;
|
|
3
|
+
var S = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var m = (e, o, t) => o in e ? O(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, g = (e, o) => {
|
|
5
|
+
for (var t in o || (o = {}))
|
|
6
|
+
S.call(o, t) && m(e, t, o[t]);
|
|
7
|
+
if (f)
|
|
8
|
+
for (var t of f(o))
|
|
9
|
+
b.call(o, t) && m(e, t, o[t]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
import { getUluEventName as v } from "../core/events.js";
|
|
13
|
+
import { ComponentInitializer as V } from "../core/component.js";
|
|
14
|
+
import { preventScroll as w, wasClickOutside as C } from "@ulu/utils/browser/dom.js";
|
|
15
|
+
import { prepVideos as D, pauseVideos as k } from "../utils/pause-youtube-video.js";
|
|
16
|
+
const L = "data-ulu-dialog", i = new V({ type: "dialog", baseAttribute: L }), x = i.getAttribute("close"), y = {
|
|
6
17
|
/**
|
|
7
18
|
* Use non-modal interface for dialog
|
|
8
19
|
*/
|
|
@@ -30,83 +41,83 @@ const b = "data-ulu-dialog", i = new v({ type: "dialog", baseAttribute: b }), F
|
|
|
30
41
|
*/
|
|
31
42
|
preventScrollShift: !0
|
|
32
43
|
};
|
|
33
|
-
let a = {
|
|
34
|
-
function
|
|
44
|
+
let a = g({}, y);
|
|
45
|
+
function P(e) {
|
|
35
46
|
a = Object.assign({}, a, e);
|
|
36
47
|
}
|
|
37
|
-
function
|
|
48
|
+
function U() {
|
|
38
49
|
i.init({
|
|
39
50
|
coreEvents: ["pageModified"],
|
|
40
51
|
withData: !0,
|
|
41
|
-
setup({ element: e, initialize:
|
|
42
|
-
|
|
52
|
+
setup({ element: e, initialize: o, data: t }) {
|
|
53
|
+
M(e, t), o();
|
|
43
54
|
}
|
|
44
55
|
}), i.init({
|
|
45
56
|
key: "trigger",
|
|
46
57
|
coreEvents: ["pageModified"],
|
|
47
58
|
withData: !0,
|
|
48
|
-
setup({ element: e, initialize:
|
|
49
|
-
|
|
59
|
+
setup({ element: e, initialize: o, data: t }) {
|
|
60
|
+
z(e, t), o();
|
|
50
61
|
}
|
|
51
62
|
});
|
|
52
63
|
}
|
|
53
|
-
function
|
|
64
|
+
function z(e, o) {
|
|
54
65
|
e.addEventListener("click", t);
|
|
55
66
|
function t(r) {
|
|
56
67
|
var c;
|
|
57
68
|
r.target.closest("a") && r.preventDefault();
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
60
|
-
console.error("Could not locate dialog (id)",
|
|
69
|
+
const n = document.getElementById(o);
|
|
70
|
+
if (!n) {
|
|
71
|
+
console.error("Could not locate dialog (id)", o);
|
|
61
72
|
return;
|
|
62
73
|
}
|
|
63
|
-
if (((c =
|
|
74
|
+
if (((c = n == null ? void 0 : n.tagName) == null ? void 0 : c.toLowerCase()) !== "dialog") {
|
|
64
75
|
console.error("Attempted to trigger non <dialog> element. Did you mean to use modal builder?");
|
|
65
76
|
return;
|
|
66
77
|
}
|
|
67
|
-
const u =
|
|
68
|
-
|
|
78
|
+
const u = A(n);
|
|
79
|
+
n[u.nonModal ? "show" : "showModal"]();
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
|
-
function
|
|
72
|
-
const t = Object.assign({}, a,
|
|
73
|
-
let
|
|
74
|
-
if (e.addEventListener(
|
|
75
|
-
let
|
|
82
|
+
function M(e, o) {
|
|
83
|
+
const t = Object.assign({}, a, o), r = document.body, { preventScrollShift: d } = t;
|
|
84
|
+
let n;
|
|
85
|
+
if (e.addEventListener(v("resizer:start"), c), e.addEventListener(v("resizer:end"), h), e.addEventListener("click", u), t.documentEnd && r.appendChild(e), t.pauseVideos && I(e), !t.nonModal && t.preventScroll) {
|
|
86
|
+
let s;
|
|
76
87
|
e.addEventListener("toggle", (l) => {
|
|
77
|
-
l.newState === "open" ?
|
|
88
|
+
l.newState === "open" ? s = w({ preventShift: d }) : s && s();
|
|
78
89
|
});
|
|
79
90
|
}
|
|
80
|
-
function u(
|
|
81
|
-
const { target: l } =
|
|
82
|
-
(!
|
|
91
|
+
function u(s) {
|
|
92
|
+
const { target: l } = s, p = l === e, E = l.closest(i.attributeSelector("close"));
|
|
93
|
+
(!n && t.clickOutsideCloses && p && C(e, s) || E) && (t.pauseVideos && j(e), e.close());
|
|
83
94
|
}
|
|
84
|
-
function c(
|
|
85
|
-
|
|
95
|
+
function c(s) {
|
|
96
|
+
n = s.pointerId;
|
|
86
97
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
function h(s) {
|
|
99
|
+
n === s.pointerId && setTimeout(() => {
|
|
100
|
+
n = null;
|
|
90
101
|
}, 0);
|
|
91
102
|
}
|
|
92
103
|
}
|
|
93
|
-
function
|
|
104
|
+
function A(e) {
|
|
94
105
|
return Object.assign({}, a, i.getData(e));
|
|
95
106
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
107
|
+
function I(e) {
|
|
108
|
+
D(e);
|
|
98
109
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
110
|
+
function j(e) {
|
|
111
|
+
k(e), e.querySelectorAll("video").forEach((t) => t.pause());
|
|
101
112
|
}
|
|
102
113
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
L as baseAttribute,
|
|
115
|
+
x as closeAttribute,
|
|
116
|
+
y as defaults,
|
|
117
|
+
A as getDialogOptions,
|
|
118
|
+
U as init,
|
|
108
119
|
i as initializer,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
P as setDefaults,
|
|
121
|
+
M as setupDialog,
|
|
122
|
+
z as setupTrigger
|
|
112
123
|
};
|
package/dist/es/ui/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { BreakpointManager } from './breakpoints.js';
|
|
2
2
|
export { Collapsible } from './collapsible.js';
|
|
3
|
+
export { ProgrammaticModalManager } from './programmatic-modal.js';
|
|
3
4
|
export { OverflowScroller } from './overflow-scroller.js';
|
|
4
5
|
export { createPager as overflowScrollerCreatePager } from './overflow-scroller-pager.js';
|
|
5
6
|
export { init as pageInit } from './page.js';
|
|
6
7
|
export { init as printInit } from './print.js';
|
|
7
8
|
export { Resizer } from './resizer.js';
|
|
9
|
+
export { TabManager } from './tab-manager.js';
|
|
8
10
|
export { init as detailsGroupInit, initializer as detailsGroupInitializer, setupGroup as detailsGroupSetupGroup } from './details-group.js';
|
|
9
11
|
export { baseAttribute as dialogBaseAttribute, closeAttribute as dialogCloseAttribute, defaults as dialogDefaults, getDialogOptions as dialogGetDialogOptions, init as dialogInit, initializer as dialogInitializer, setDefaults as dialogSetDefaults, setupDialog as dialogSetupDialog, setupTrigger as dialogSetupTrigger } from './dialog.js';
|
|
10
12
|
export { Flipcard, init as flipcardInit, initializer as flipcardInitializer } from './flipcard.js';
|