@ulu/frontend 0.2.0-beta.1 → 0.2.0-beta.10

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.
Files changed (163) hide show
  1. package/dist/README.md +12 -0
  2. package/dist/{types/js → es}/core/component.d.ts +3 -9
  3. package/dist/es/core/component.d.ts.map +1 -0
  4. package/dist/es/core/component.js +134 -0
  5. package/dist/{types/js → es}/core/events.d.ts +1 -1
  6. package/dist/es/core/events.d.ts.map +1 -0
  7. package/dist/es/core/events.js +45 -0
  8. package/dist/es/core/index.d.ts +4 -0
  9. package/dist/{types/js/ui → es/core}/index.d.ts.map +1 -1
  10. package/dist/{types/js → es}/core/settings.d.ts +1 -1
  11. package/dist/es/core/settings.d.ts.map +1 -0
  12. package/dist/es/core/settings.js +44 -0
  13. package/dist/es/index.d.ts +4 -0
  14. package/dist/{types/js → es}/index.d.ts.map +1 -1
  15. package/dist/es/index.js +125 -0
  16. package/dist/{types/js → es}/ui/breakpoints.d.ts +5 -3
  17. package/dist/es/ui/breakpoints.d.ts.map +1 -0
  18. package/dist/es/ui/breakpoints.js +194 -0
  19. package/dist/{types/js → es}/ui/collapsible.d.ts +28 -7
  20. package/dist/es/ui/collapsible.d.ts.map +1 -0
  21. package/dist/es/ui/collapsible.js +140 -0
  22. package/dist/{types/js → es}/ui/details-group.d.ts +1 -1
  23. package/dist/es/ui/details-group.d.ts.map +1 -0
  24. package/dist/es/ui/details-group.js +49 -0
  25. package/dist/{types/js → es}/ui/dialog.d.ts +3 -3
  26. package/dist/es/ui/dialog.d.ts.map +1 -0
  27. package/dist/es/ui/dialog.js +112 -0
  28. package/dist/{types/js → es}/ui/flipcard.d.ts +1 -1
  29. package/dist/es/ui/flipcard.d.ts.map +1 -0
  30. package/dist/es/ui/flipcard.js +97 -0
  31. package/dist/{types/js → es}/ui/grid.d.ts +2 -2
  32. package/dist/es/ui/grid.d.ts.map +1 -0
  33. package/dist/es/ui/grid.js +18 -0
  34. package/dist/{types/js → es}/ui/index.d.ts +22 -21
  35. package/dist/{types/js/core → es/ui}/index.d.ts.map +1 -1
  36. package/dist/{types/js → es}/ui/modal-builder.d.ts +21 -16
  37. package/dist/es/ui/modal-builder.d.ts.map +1 -0
  38. package/dist/es/ui/modal-builder.js +136 -0
  39. package/dist/es/ui/overflow-scroller-pager.d.ts.map +1 -0
  40. package/dist/es/ui/overflow-scroller-pager.js +28 -0
  41. package/dist/{types/js → es}/ui/overflow-scroller.d.ts +3 -3
  42. package/dist/es/ui/overflow-scroller.d.ts.map +1 -0
  43. package/dist/es/ui/overflow-scroller.js +90 -0
  44. package/dist/es/ui/page.d.ts.map +1 -0
  45. package/dist/es/ui/page.js +7 -0
  46. package/dist/{types/js → es}/ui/popover.d.ts +3 -3
  47. package/dist/es/ui/popover.d.ts.map +1 -0
  48. package/dist/es/ui/popover.js +77 -0
  49. package/dist/es/ui/print-details.d.ts.map +1 -0
  50. package/dist/es/ui/print-details.js +22 -0
  51. package/dist/es/ui/print.d.ts.map +1 -0
  52. package/dist/es/ui/print.js +34 -0
  53. package/dist/{types/js → es}/ui/programmatic-modal.d.ts +1 -1
  54. package/dist/es/ui/programmatic-modal.d.ts.map +1 -0
  55. package/dist/es/ui/programmatic-modal.js +55 -0
  56. package/dist/{types/js → es}/ui/proxy-click.d.ts +4 -4
  57. package/dist/es/ui/proxy-click.d.ts.map +1 -0
  58. package/dist/es/ui/proxy-click.js +44 -0
  59. package/dist/{types/js → es}/ui/resizer.d.ts +16 -16
  60. package/dist/es/ui/resizer.d.ts.map +1 -0
  61. package/dist/es/ui/resizer.js +242 -0
  62. package/dist/{types/js → es}/ui/scroll-slider.d.ts +1 -1
  63. package/dist/es/ui/scroll-slider.d.ts.map +1 -0
  64. package/dist/es/ui/scroll-slider.js +29 -0
  65. package/dist/{types/js → es}/ui/scrollpoint.d.ts +79 -11
  66. package/dist/es/ui/scrollpoint.d.ts.map +1 -0
  67. package/dist/es/ui/scrollpoint.js +178 -0
  68. package/dist/{types/js → es}/ui/slider.d.ts +11 -8
  69. package/dist/es/ui/slider.d.ts.map +1 -0
  70. package/dist/es/ui/slider.js +290 -0
  71. package/dist/{types/js → es}/ui/tabs.d.ts +2 -2
  72. package/dist/es/ui/tabs.d.ts.map +1 -0
  73. package/dist/es/ui/tabs.js +64 -0
  74. package/dist/{types/js → es}/ui/theme-toggle.d.ts +4 -4
  75. package/dist/es/ui/theme-toggle.d.ts.map +1 -0
  76. package/dist/es/ui/theme-toggle.js +190 -0
  77. package/dist/{types/js → es}/ui/tooltip.d.ts +5 -5
  78. package/dist/es/ui/tooltip.d.ts.map +1 -0
  79. package/dist/es/ui/tooltip.js +184 -0
  80. package/dist/{types/js → es}/utils/class-logger.d.ts +4 -4
  81. package/dist/es/utils/class-logger.d.ts.map +1 -0
  82. package/dist/es/utils/class-logger.js +37 -0
  83. package/dist/es/utils/css.d.ts.map +1 -0
  84. package/dist/es/utils/css.js +6 -0
  85. package/dist/{types/js → es}/utils/dom.d.ts +1 -1
  86. package/dist/es/utils/dom.d.ts.map +1 -0
  87. package/dist/es/utils/dom.js +29 -0
  88. package/dist/es/utils/file-save.d.ts.map +1 -0
  89. package/dist/es/utils/file-save.js +46 -0
  90. package/dist/{types/js → es}/utils/floating-ui.d.ts +1 -1
  91. package/dist/es/utils/floating-ui.d.ts.map +1 -0
  92. package/dist/es/utils/floating-ui.js +46 -0
  93. package/dist/es/utils/font-awesome.d.ts.map +1 -0
  94. package/dist/es/utils/font-awesome.js +13 -0
  95. package/dist/es/utils/id.d.ts.map +1 -0
  96. package/dist/es/utils/id.js +11 -0
  97. package/dist/{types/js → es}/utils/index.d.ts +7 -7
  98. package/dist/{types/js → es}/utils/index.d.ts.map +1 -1
  99. package/dist/es/utils/pause-youtube-video.d.ts.map +1 -0
  100. package/dist/es/utils/pause-youtube-video.js +27 -0
  101. package/dist/umd/style.css +1 -0
  102. package/dist/umd/ulu-frontend.umd.js +70 -0
  103. package/lib/js/ui/breakpoints.js +13 -5
  104. package/lib/js/ui/index.js +4 -0
  105. package/lib/js/ui/modal-builder.js +5 -3
  106. package/lib/js/ui/slider.js +22 -13
  107. package/lib/scss/_element.scss +10 -4
  108. package/lib/scss/components/_accordion.scss +1 -7
  109. package/lib/scss/components/_button.scss +11 -2
  110. package/lib/scss/components/_card.scss +5 -6
  111. package/lib/scss/components/_form-theme.scss +3 -3
  112. package/lib/scss/components/_menu-stack.scss +1 -0
  113. package/lib/scss/components/_modal.scss +13 -13
  114. package/lib/scss/helpers/_utilities.scss +0 -3
  115. package/package.json +54 -45
  116. package/dist/style.css +0 -1
  117. package/dist/types/js/core/component.d.ts.map +0 -1
  118. package/dist/types/js/core/events.d.ts.map +0 -1
  119. package/dist/types/js/core/index.d.ts +0 -4
  120. package/dist/types/js/core/settings.d.ts.map +0 -1
  121. package/dist/types/js/index.d.ts +0 -4
  122. package/dist/types/js/ui/breakpoints.d.ts.map +0 -1
  123. package/dist/types/js/ui/collapsible.d.ts.map +0 -1
  124. package/dist/types/js/ui/details-group.d.ts.map +0 -1
  125. package/dist/types/js/ui/dialog.d.ts.map +0 -1
  126. package/dist/types/js/ui/flipcard.d.ts.map +0 -1
  127. package/dist/types/js/ui/grid.d.ts.map +0 -1
  128. package/dist/types/js/ui/modal-builder.d.ts.map +0 -1
  129. package/dist/types/js/ui/overflow-scroller-pager.d.ts.map +0 -1
  130. package/dist/types/js/ui/overflow-scroller.d.ts.map +0 -1
  131. package/dist/types/js/ui/page.d.ts.map +0 -1
  132. package/dist/types/js/ui/popover.d.ts.map +0 -1
  133. package/dist/types/js/ui/print-details.d.ts.map +0 -1
  134. package/dist/types/js/ui/print.d.ts.map +0 -1
  135. package/dist/types/js/ui/programmatic-modal.d.ts.map +0 -1
  136. package/dist/types/js/ui/proxy-click.d.ts.map +0 -1
  137. package/dist/types/js/ui/resizer.d.ts.map +0 -1
  138. package/dist/types/js/ui/scroll-slider.d.ts.map +0 -1
  139. package/dist/types/js/ui/scrollpoint.d.ts.map +0 -1
  140. package/dist/types/js/ui/slider.d.ts.map +0 -1
  141. package/dist/types/js/ui/tabs.d.ts.map +0 -1
  142. package/dist/types/js/ui/theme-toggle.d.ts.map +0 -1
  143. package/dist/types/js/ui/tooltip.d.ts.map +0 -1
  144. package/dist/types/js/utils/class-logger.d.ts.map +0 -1
  145. package/dist/types/js/utils/css.d.ts.map +0 -1
  146. package/dist/types/js/utils/dom.d.ts.map +0 -1
  147. package/dist/types/js/utils/file-save.d.ts.map +0 -1
  148. package/dist/types/js/utils/floating-ui.d.ts.map +0 -1
  149. package/dist/types/js/utils/font-awesome.d.ts.map +0 -1
  150. package/dist/types/js/utils/id.d.ts.map +0 -1
  151. package/dist/types/js/utils/pause-youtube-video.d.ts.map +0 -1
  152. package/dist/ulu-frontend.es.js +0 -5737
  153. package/dist/ulu-frontend.umd.js +0 -77
  154. package/lib/scss/components/_card-before-no-position-relative.TRASH.scss +0 -576
  155. /package/dist/{types/js → es}/ui/overflow-scroller-pager.d.ts +0 -0
  156. /package/dist/{types/js → es}/ui/page.d.ts +0 -0
  157. /package/dist/{types/js → es}/ui/print-details.d.ts +0 -0
  158. /package/dist/{types/js → es}/ui/print.d.ts +0 -0
  159. /package/dist/{types/js → es}/utils/css.d.ts +0 -0
  160. /package/dist/{types/js → es}/utils/file-save.d.ts +0 -0
  161. /package/dist/{types/js → es}/utils/font-awesome.d.ts +0 -0
  162. /package/dist/{types/js → es}/utils/id.d.ts +0 -0
  163. /package/dist/{types/js → es}/utils/pause-youtube-video.d.ts +0 -0
@@ -0,0 +1,190 @@
1
+ import { ComponentInitializer as M } from "../core/component.js";
2
+ import { getCoreEventName as y } from "../core/events.js";
3
+ import { resolveClasses as b } from "../utils/dom.js";
4
+ import { hasRequiredProps as q } from "@ulu/utils/object.js";
5
+ import { getElements as I } from "@ulu/utils/browser/dom.js";
6
+ const c = new M({
7
+ type: "theme-toggle",
8
+ baseAttribute: "data-ulu-theme-toggle"
9
+ }), Q = c.attributeSelector("label"), $ = c.attributeSelector("icon"), L = c.getAttribute("remote"), v = c.getAttribute("init"), S = c.getAttribute("state"), j = (e) => document.querySelectorAll(
10
+ `[${L}="${e}"]`
11
+ ), C = (e) => document.querySelectorAll(
12
+ `[${L}="${e}"]:not([${v}])`
13
+ ), T = ["target"], O = q(T), E = (e, r) => e ? r() : null, P = {
14
+ /**
15
+ * Object of each theme that should be toggle/cycled through
16
+ */
17
+ themes: {
18
+ light: {
19
+ label: "Light",
20
+ value: "light",
21
+ iconClass: "fas fa-moon",
22
+ targetClass: "theme-light",
23
+ mediaQuery: "(prefers-color-scheme: light)"
24
+ },
25
+ dark: {
26
+ label: "Dark",
27
+ iconClass: "fas fa-sun",
28
+ targetClass: "theme-dark",
29
+ mediaQuery: "(prefers-color-scheme: dark)"
30
+ }
31
+ },
32
+ /**
33
+ * Required this is the element(s) that should be changed by a specific toggle
34
+ * - The element should have data-ulu-theme-toggle-target="SOME_IDENTIFIER"
35
+ */
36
+ target: "body",
37
+ /**
38
+ * Optional group to link remote toggles (toggles that follow the main one and can toggle too)
39
+ */
40
+ group: null,
41
+ /**
42
+ * Optional callback to do something when the state changes
43
+ */
44
+ onChange(e) {
45
+ },
46
+ /**
47
+ * The initial state for this component
48
+ * - May be overridden by saved preference or media query if options are enabled
49
+ */
50
+ initialState: "light",
51
+ /**
52
+ * Check the OS systems user preference via 'preferenceQuery' option
53
+ */
54
+ checkMediaQuery: !1,
55
+ /**
56
+ * Will store the preference in local storage so it persists between page loads
57
+ */
58
+ savePreference: !1,
59
+ /**
60
+ * The key that will be used to store the preference in local storage
61
+ * - This will be used as prefix in combination with group if defined
62
+ */
63
+ storagePrefix: "ulu-theme-",
64
+ /**
65
+ * Output information to console for debugging
66
+ */
67
+ debug: !1
68
+ };
69
+ let k = { ...P };
70
+ function G(e) {
71
+ k = Object.assign({}, k, e);
72
+ }
73
+ function H() {
74
+ c.init({
75
+ coreEvents: ["pageModified"],
76
+ withData: !0,
77
+ setup({ element: e, data: r, initialize: o }) {
78
+ R(e, r), o();
79
+ }
80
+ });
81
+ }
82
+ function R(e, r) {
83
+ const o = Object.assign({}, P, r);
84
+ if (!O(o)) {
85
+ console.error(`Missing a required option: ${T.join(", ")}`);
86
+ return;
87
+ }
88
+ const t = o.group, n = { toggle: e, options: o }, u = w(o);
89
+ if (!u) {
90
+ console.error("Unable to resolve initial key");
91
+ return;
92
+ }
93
+ p(u, n), e.addEventListener("click", a), l(), document.addEventListener(y("pageModified"), l);
94
+ function s(g) {
95
+ const d = I(o.target)[0].dataset.uluThemeToggleState, f = D(d, o);
96
+ if (!f) {
97
+ console.error("Issue getting next theme key");
98
+ return;
99
+ }
100
+ p(f, { ...n, event: g });
101
+ }
102
+ function a(g) {
103
+ s(g);
104
+ }
105
+ function l() {
106
+ if (!t) return;
107
+ C(t).forEach((i) => {
108
+ i.addEventListener("click", a), c.initializeElement(i);
109
+ });
110
+ }
111
+ function m() {
112
+ if (!t) return;
113
+ C(t).forEach((i) => {
114
+ i.removeEventListener("click", a), i.removeAttribute(v, "");
115
+ });
116
+ }
117
+ function h() {
118
+ e.removeEventListener("click", a), e.removeAttribute(v, ""), m(), document.removeEventListener(y("pageModified"), l);
119
+ }
120
+ return {
121
+ destroy: h,
122
+ toggle: e,
123
+ options: o,
124
+ toggleState: s,
125
+ setState(g) {
126
+ p(g, n);
127
+ }
128
+ };
129
+ }
130
+ function p(e, r) {
131
+ if (!e) {
132
+ console.error("Missing key");
133
+ return;
134
+ }
135
+ const { toggle: o, options: t } = r, { themes: n, group: u } = t, s = {
136
+ targets: I(t.target),
137
+ toggles: [o, ...u ? j(u) : []]
138
+ };
139
+ if (!s.targets.length || !s.toggles.length) {
140
+ console.error("Issue setting state, couldn't find needed elements", s);
141
+ return;
142
+ }
143
+ const a = n[e], l = z(e, n), m = {
144
+ ...r,
145
+ key: e,
146
+ elements: s,
147
+ theme: a,
148
+ otherThemes: l
149
+ };
150
+ t.debug && c.log("Set state context", m);
151
+ const h = x(l, "targetClass"), g = x(l, "iconClass");
152
+ s.targets.forEach((i) => {
153
+ i.setAttribute(S, e), i.classList.remove(...h), i.classList.add(...b(a.targetClass));
154
+ }), s.toggles.forEach((i) => {
155
+ const d = i.querySelector(Q), f = i.querySelector($);
156
+ d && (d.textContent = a.label), f && (f.classList.remove(...g), f.classList.add(...b(a.iconClass))), i.setAttribute(S, e);
157
+ }), t.onChange && t.onChange(m), t.savePreference && localStorage.setItem(A(t), e);
158
+ }
159
+ function w(e) {
160
+ const { savePreference: r, checkMediaQuery: o, themes: t, initialState: n } = e, u = A(e), s = E(r, () => localStorage.getItem(u)), a = E(o, () => K(t)), l = s || a || n;
161
+ return e.debug && (c.log("Preference Saved", s), c.log("Media Query Preference", a), c.log("Initial State:", n)), l || c.logError("Failed to resolve initial theme (pass 'initialState' to options)"), l;
162
+ }
163
+ function K(e) {
164
+ const r = Object.entries(e).find(([o, t]) => {
165
+ if (t.mediaQuery)
166
+ return window.matchMedia(t.mediaQuery).matches;
167
+ });
168
+ return r ? r[0] : null;
169
+ }
170
+ function D(e, r) {
171
+ const { themes: o } = r, t = Object.keys(o), n = t.findIndex((s) => s === e), u = n === -1 ? 0 : (n + 1) % t.length;
172
+ return t[u];
173
+ }
174
+ function z(e, r) {
175
+ return Object.entries(r).filter(([t]) => t !== e).map(([t, n]) => n);
176
+ }
177
+ function x(e, r) {
178
+ return e.reduce((o, t) => o.concat(b(t[r])), []);
179
+ }
180
+ function A(e) {
181
+ const { storagePrefix: r, group: o } = e;
182
+ return o ? `${r}${o}` : r;
183
+ }
184
+ export {
185
+ P as defaults,
186
+ H as init,
187
+ c as initializer,
188
+ G as setDefaults,
189
+ R as setupToggle
190
+ };
@@ -1,3 +1,4 @@
1
+ import { ComponentInitializer } from '../core/component.js';
1
2
  /**
2
3
  * Initialize default popover
3
4
  */
@@ -74,23 +75,22 @@ export class Tooltip {
74
75
  options: any;
75
76
  floatingOptions: any;
76
77
  elements: any;
77
- handlers: {};
78
- isOpen: boolean;
78
+ handlers: {} | undefined;
79
+ isOpen: boolean | undefined;
79
80
  setup(): void;
80
81
  setupAccessibility(): void;
81
82
  destroy(): void;
82
83
  getInnerContent(): any;
83
- getAnchorElement(): HTMLElement;
84
+ getAnchorElement(): HTMLElement | null;
84
85
  createContentElement(): void;
85
86
  attachHandlers(): void;
86
87
  destroyHandlers(): void;
87
88
  setState(isOpen: any, event: any): void;
88
89
  createEvent(name: any, detail: any): CustomEvent<any>;
89
90
  createFloatingInstance(): void;
90
- floatingCleanup: Function;
91
+ floatingCleanup: Function | null | undefined;
91
92
  destroyFloatingInstance(): void;
92
93
  show(event: any): void;
93
94
  hide(event: any): void;
94
95
  }
95
- import { ComponentInitializer } from "../core/component.js";
96
96
  //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../lib/js/ui/tooltip.js"],"names":[],"mappings":"AAuBA;;GAEG;AACH,6BAaC;AA5BD;;GAEG;AACH,+CAGG;AAwBH;;;;GAIG;AACH;IACE;;OAEG;IACH;QACE;;;;WAIG;;QAEH;;;WAGG;;;;;QAKH;;;WAGG;qBADO,SAAO,IAAI;QAGrB;;WAEG;;QAEH;;;WAGG;;QAEH;;;WAGG;oBADO,KAAK,QAAS;QAGxB;;;WAGG;oBADO,KAAK,QAAS;QAGxB;;;WAGG;;QAEH;;WAEG;;QAUH;;;WAGG;;MAIH;IACF,kCAEE;IACF,mEAaC;IAPC,aAA+D;IAC/D,qBAAyF;IACzF,cAA+B;IAC/B,yBAAkB;IAClB,4BAAmB;IAIrB,cAIC;IACD,2BAKC;IACD,gBAGC;IACD,uBAcC;IACD,uCASC;IACD,6BAkBC;IACD,uBAiCC;IACD,wBAiBC;IACD,wCAmBC;IACD,sDAEC;IACD,+BAEC;IADC,6CAA4E;IAE9E,gCAKC;IACD,uBAEC;IACD,uBAEC;CACF;qCApRoC,sBAAsB"}
@@ -0,0 +1,184 @@
1
+ var f = Object.defineProperty;
2
+ var g = (l, t, e) => t in l ? f(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
+ var u = (l, t, e) => g(l, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ComponentInitializer as v } from "../core/component.js";
5
+ import { getUluEventName as E } from "../core/events.js";
6
+ import { createFloatingUi as y } from "../utils/floating-ui.js";
7
+ import { createElementFromHtml as C } from "@ulu/utils/browser/dom.js";
8
+ import { logError as p } from "../utils/class-logger.js";
9
+ import { ensureId as b, newId as w } from "../utils/id.js";
10
+ const d = new v({
11
+ type: "tooltip",
12
+ baseAttribute: "data-ulu-tooltip"
13
+ }), A = d.getAttribute("body"), H = d.attributeSelector("body"), S = d.attributeSelector("arrow");
14
+ function j() {
15
+ d.init({
16
+ coreEvents: ["pageModified"],
17
+ withData: !0,
18
+ setup({ element: l, data: t, initialize: e }) {
19
+ const n = typeof t == "object" ? t : {};
20
+ typeof t == "string" && (n.content = t), e(), new m({ trigger: l }, n);
21
+ }
22
+ });
23
+ }
24
+ const a = class a {
25
+ constructor(t, e, n) {
26
+ const { trigger: s } = t;
27
+ if (!s) {
28
+ p(this, "missing required trigger");
29
+ return;
30
+ }
31
+ this.options = Object.assign({}, a.defaults, e), this.floatingOptions = Object.assign({}, a.defaultFloatingOptions, n), this.elements = { ...t }, this.handlers = {}, this.isOpen = !1, b(s), this.setup();
32
+ }
33
+ setup() {
34
+ this.createContentElement(), this.attachHandlers(), this.setupAccessibility();
35
+ }
36
+ setupAccessibility() {
37
+ const { trigger: t, content: e } = this.elements, { accessible: n } = this.options;
38
+ n && t.setAttribute("aria-describedby", e.id);
39
+ }
40
+ destroy() {
41
+ this.destroyHandlers(), this.destroyDisplay();
42
+ }
43
+ getInnerContent() {
44
+ const { fromElement: t, content: e, isHtml: n, fromAnchor: s } = this.options;
45
+ if (e)
46
+ return e;
47
+ if (t || s) {
48
+ const o = s ? this.getAnchorElement() : document.querySelector(t);
49
+ return o ? n ? o.innerHTML : o.innerText : "";
50
+ } else
51
+ p(this, "Could not resolve inner content");
52
+ }
53
+ getAnchorElement() {
54
+ const { trigger: t } = this.elements, { href: e } = t, n = e ? e.split("#")[1] : null, s = n ? document.getElementById(n) : null;
55
+ return s || console.error("Unable to get 'fromAnchor' element", t), s;
56
+ }
57
+ createContentElement() {
58
+ const { options: t } = this, e = C(t.template(t)), n = e.querySelector(H), s = this.getInnerContent();
59
+ t.isHtml ? n.innerHTML = s : n.textContent = s, e.id = w(), t.contentClass && e.classList.add(t.contentClass), this.elements.content = e, this.elements.contentArrow = e.querySelector(S), document.body.appendChild(e);
60
+ }
61
+ attachHandlers() {
62
+ const { trigger: t } = this.elements, { showEvents: e, hideEvents: n, delay: s } = this.options;
63
+ let o = null;
64
+ const c = (i) => {
65
+ o || (o = setTimeout(() => {
66
+ this.show(i), clearTimeout(o);
67
+ }, s));
68
+ }, r = (i) => {
69
+ o && (clearTimeout(o), o = null), this.hide(i);
70
+ }, h = (i) => {
71
+ i.key === "Escape" && this.hide(i);
72
+ };
73
+ e.forEach((i) => {
74
+ t.addEventListener(i, c);
75
+ }), n.forEach((i) => {
76
+ t.addEventListener(i, r);
77
+ }), document.addEventListener("keydown", h), this.handlers = { onShow: c, onHide: r, onDocumentKeydown: h };
78
+ }
79
+ destroyHandlers() {
80
+ const { trigger: t } = this, { onShow: e, onHide: n, onDocumentKeydown: s } = this.handlers, { showEvents: o, hideEvents: c } = this.options;
81
+ e && o.forEach((r) => {
82
+ t.removeEventListener(r, e);
83
+ }), n && c.forEach((r) => {
84
+ t.removeEventListener(r, n);
85
+ }), s && document.removeEventListener("keydown", s);
86
+ }
87
+ setState(t, e) {
88
+ const n = {
89
+ instance: this,
90
+ isOpen: t,
91
+ event: e
92
+ }, { trigger: s, content: o } = this.elements, { openClass: c } = this.options, r = (h) => h.classList[t ? "add" : "remove"](c);
93
+ r(s), r(o), this.isOpen = t, this.options.onChange(n), s.dispatchEvent(this.createEvent("change", n)), this.destroyFloatingInstance(), t && this.createFloatingInstance();
94
+ }
95
+ createEvent(t, e) {
96
+ return new CustomEvent(E("tooltip:" + t), { detail: e });
97
+ }
98
+ createFloatingInstance() {
99
+ this.floatingCleanup = y(this.elements, this.floatingOptions);
100
+ }
101
+ destroyFloatingInstance() {
102
+ this.floatingCleanup && (this.floatingCleanup(), this.floatingCleanup = null);
103
+ }
104
+ show(t) {
105
+ this.setState(!0, t);
106
+ }
107
+ hide(t) {
108
+ this.setState(!1, t);
109
+ }
110
+ };
111
+ /**
112
+ * Defaults options
113
+ */
114
+ u(a, "defaults", {
115
+ /**
116
+ * Should the tooltip and content be linked accessibly
117
+ * - Note tooltips can only apply to interactive elements! (ie button, input, role="...", etc)
118
+ * @type {Boolean}
119
+ */
120
+ accessible: !0,
121
+ /**
122
+ * String/markup to insert into tooltip display
123
+ * @type {String}
124
+ */
125
+ content: null,
126
+ openClass: "is-active",
127
+ contentClass: "",
128
+ isHtml: !1,
129
+ /**
130
+ * Pull content from pre-existing content on page
131
+ * @type {String|Node}
132
+ */
133
+ fromElement: null,
134
+ /**
135
+ * If used on a link that is an anchor link it will display the content of the anchor like fromElement
136
+ */
137
+ fromAnchor: !1,
138
+ /**
139
+ * Move the content to the bottom of the document
140
+ * @type {Boolean}
141
+ */
142
+ endOfDocument: !0,
143
+ /**
144
+ * Events to show tooltip on
145
+ * @type {Array.<String>}
146
+ */
147
+ showEvents: ["pointerenter", "focus"],
148
+ /**
149
+ * Events to hide tooltip on
150
+ * @type {Array.<String>}
151
+ */
152
+ hideEvents: ["pointerleave", "blur"],
153
+ /**
154
+ * Delay when using the directive
155
+ * @type {Number}
156
+ */
157
+ delay: 500,
158
+ /**
159
+ * Template for the content display
160
+ */
161
+ template(t) {
162
+ return `
163
+ <div class="popover popover--tooltip">
164
+ <div class="popover__inner" ${A}>
165
+ </div>
166
+ <span class="popover__arrow" data-ulu-tooltip-arrow></span>
167
+ </div>
168
+ `;
169
+ },
170
+ /**
171
+ * Callback when tooltip is shown or hidden
172
+ * @type {Function}
173
+ */
174
+ onChange(t) {
175
+ }
176
+ }), u(a, "defaultFloatingOptions", {
177
+ // strategy: "fixed"
178
+ });
179
+ let m = a;
180
+ export {
181
+ m as Tooltip,
182
+ j as init,
183
+ d as initializer
184
+ };
@@ -2,23 +2,23 @@
2
2
  * Changes to make to configuration
3
3
  * @param {Object} changes
4
4
  */
5
- export function set(changes: any): void;
5
+ export function set(changes: Object): void;
6
6
  /**
7
7
  * Proxy Console.log
8
8
  * @param {Object} context Class instance (optional), will rely on classes (debug) property for output
9
9
  * @param {...any} messages
10
10
  */
11
- export function log(context: any, ...messages: any[]): void;
11
+ export function log(context: Object, ...messages: any[]): void;
12
12
  /**
13
13
  * Proxy Console.warn
14
14
  * @param {Object} context Class instance (optional), will rely on classes (debug) property for output
15
15
  * @param {...any} messages
16
16
  */
17
- export function logWarning(context: any, ...messages: any[]): void;
17
+ export function logWarning(context: Object, ...messages: any[]): void;
18
18
  /**
19
19
  * Proxy Console.error
20
20
  * @param {Object} context Class instance (optional), will rely on classes (debug) property for output
21
21
  * @param {...any} messages
22
22
  */
23
- export function logError(context: any, ...messages: any[]): void;
23
+ export function logError(context: Object, ...messages: any[]): void;
24
24
  //# sourceMappingURL=class-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-logger.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/class-logger.js"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,6BAFW,MAAM,QAIhB;AAED;;;;GAIG;AACH,6BAHW,MAAM,eACF,GAAG,EAAA,QAMjB;AAED;;;;GAIG;AACH,oCAHW,MAAM,eACF,GAAG,EAAA,QAMjB;AAED;;;;GAIG;AACH,kCAHW,MAAM,eACF,GAAG,EAAA,QAMjB"}
@@ -0,0 +1,37 @@
1
+ const n = {
2
+ debug: !1,
3
+ warningsAlways: !0,
4
+ errorsAlways: !0,
5
+ outputContext: !1
6
+ }, g = "console" in window;
7
+ function s(r) {
8
+ var o;
9
+ return g && n.debug && ((r == null ? void 0 : r.debug) || ((o = r == null ? void 0 : r.options) == null ? void 0 : o.debug) || r == null);
10
+ }
11
+ function a(r) {
12
+ var o;
13
+ return typeof r == "object" && ((o = r == null ? void 0 : r.constructor) == null ? void 0 : o.name);
14
+ }
15
+ function u(r, o, l) {
16
+ const i = a(o) || "Logger";
17
+ console[r](i, ...l), n.outputContext && console.log(`Context:
18
+ `, o);
19
+ }
20
+ function f(r) {
21
+ Object.assign(n, r);
22
+ }
23
+ function e(r, ...o) {
24
+ s(r) && u("log", r, o);
25
+ }
26
+ function w(r, ...o) {
27
+ (n.warningsAlways || s(r)) && u("warn", r, o);
28
+ }
29
+ function b(r, ...o) {
30
+ (n.errorsAlways || s(r)) && u("error", r, o);
31
+ }
32
+ export {
33
+ e as log,
34
+ b as logError,
35
+ w as logWarning,
36
+ f as set
37
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/css.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,0CAJW,MAAM,gBACN,MAAM,GACJ,MAAM,CAIlB"}
@@ -0,0 +1,6 @@
1
+ function e(t, r) {
2
+ return `--${t}-${r}`;
3
+ }
4
+ export {
5
+ e as getCustomProperty
6
+ };
@@ -14,7 +14,7 @@ export function dataAttributeToDatasetKey(attribute: any): string;
14
14
  * @param {Node} parent The grid parent <data-grid="">
15
15
  * @param {Object} classes Override the default equal heights classes
16
16
  */
17
- export function setPositionClasses(parent: Node, classes?: any): void;
17
+ export function setPositionClasses(parent: Node, classes?: Object): void;
18
18
  /**
19
19
  * Resolves a class input (string or array) into a consistent array of class names.
20
20
  * @param {string|string[]} input - The class input, which can be a string, an array of strings, or any other value.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/dom.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,2DAFa,MAAM,CAIlB;AAED;;;;;;;;;GASG;AACH,2CAHa,IAAI,YACJ,MAAM,QAmClB;AAED;;;;;;;;GAQG;AACH,8CANa,MAAM,EAAE,CAiBpB"}
@@ -0,0 +1,29 @@
1
+ import { kebabToCamel as f } from "@ulu/utils/string.js";
2
+ function c(t) {
3
+ return f(t.replace(/^data-/, ""));
4
+ }
5
+ function p(t, o = {
6
+ columnFirst: "position-column-first",
7
+ columnLast: "position-column-last",
8
+ rowFirst: "position-row-first",
9
+ rowLast: "position-row-last"
10
+ }) {
11
+ const l = [...t.children], n = [];
12
+ let e;
13
+ l.forEach((r) => {
14
+ const s = r.getBoundingClientRect().y;
15
+ e !== s && n.push([]), n[n.length - 1].push(r), e = s, r.classList.remove(...Object.values(o));
16
+ }), n.forEach((r, s) => {
17
+ s === 0 && r.forEach((i) => i.classList.add(o.rowFirst)), s == n.length - 1 && r.forEach((i) => i.classList.add(o.rowLast)), r.forEach((i, a) => {
18
+ a === 0 && i.classList.add(o.columnFirst), a == r.length - 1 && i.classList.add(o.columnLast);
19
+ });
20
+ });
21
+ }
22
+ function m(t) {
23
+ return typeof t == "string" ? t.split(" ").filter((o) => o !== "") : Array.isArray(t) ? t : t ? (console.warn("resolveClassArray: Invalid class input type.", t), []) : [];
24
+ }
25
+ export {
26
+ c as dataAttributeToDatasetKey,
27
+ m as resolveClasses,
28
+ p as setPositionClasses
29
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-save.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/file-save.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAGH;;;;;;;;GAQG;AACH;IACE;;;MAGC;IAmCD;;OAEG;IACH,qCAEC;IAvCD;;;OAGG;IACH,kBAHW,GAAC,WACD,eAAe,EAOzB;IAJC;;;wBAA4D;IAC5D,UAAgB;IAChB,WAAyD;IACzD,YAAyC;IAE3C;;OAEG;IACH,gBAEC;IACD;;OAEG;IACH,iBAEC;IACD;;;OAGG;IACH,4CAOC;CAOF"}
@@ -0,0 +1,46 @@
1
+ var l = Object.defineProperty;
2
+ var a = (s, t, e) => t in s ? l(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var i = (s, t, e) => a(s, typeof t != "symbol" ? t + "" : t, e);
4
+ const r = class r {
5
+ /**
6
+ * @param {*} data Data to put in blob file
7
+ * @param {FileSaveOptions} options Options for file, see defaults (ie. type, filename)
8
+ */
9
+ constructor(t, e) {
10
+ this.options = Object.assign({}, r.defaults, e), this.data = t, this.blob = new Blob([t], { type: this.options.type }), this.url = URL.createObjectURL(this.blob);
11
+ }
12
+ /**
13
+ * Remove the blob url
14
+ */
15
+ destroy() {
16
+ return URL.revokeObjectURL(this.url);
17
+ }
18
+ /**
19
+ * Get the blob url
20
+ */
21
+ getUrl() {
22
+ return this.url;
23
+ }
24
+ /**
25
+ * Create link element with blob as href
26
+ * @param {String} text The text to put in the link
27
+ */
28
+ createLink(t) {
29
+ const e = document.createElement("a"), n = document.createTextNode(t);
30
+ return e.setAttribute("download", this.options.filename), e.setAttribute("href", this.url), e.appendChild(n), e;
31
+ }
32
+ /**
33
+ * Check for Compatibility (optional, implement on user side)
34
+ */
35
+ static isBrowserSupported() {
36
+ return "FileReader" in window;
37
+ }
38
+ };
39
+ i(r, "defaults", {
40
+ filename: "filesave-file.txt",
41
+ type: "text/plain;charset=utf-8"
42
+ });
43
+ let o = r;
44
+ export {
45
+ o as FileSave
46
+ };
@@ -4,7 +4,7 @@
4
4
  * @param {*} options Configuration options for floatingUi
5
5
  * @returns {Function} floating cleanup function call when no longer needed
6
6
  */
7
- export function createFloatingUi(elements: any, config: any): Function;
7
+ export function createFloatingUi(elements: Object, config: any): Function;
8
8
  export namespace defaults {
9
9
  let strategy: string;
10
10
  let placement: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating-ui.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/floating-ui.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,2CAJW,MAAM,yBA2ChB"}
@@ -0,0 +1,46 @@
1
+ import { autoUpdate as d, computePosition as g, inline as y, offset as b, flip as h, shift as j, arrow as w } from "@floating-ui/dom";
2
+ const $ = {
3
+ strategy: "absolute",
4
+ placement: "bottom",
5
+ inline: !1,
6
+ offset: {
7
+ mainAxis: 16
8
+ },
9
+ shift: !0,
10
+ flip: !0,
11
+ arrow: !0
12
+ // Options for arrow (not element)
13
+ };
14
+ function O(l, n) {
15
+ const t = Object.assign({}, $, n), { placement: r, strategy: f } = t, { trigger: o, content: s, contentArrow: a } = l;
16
+ return d(o, s, () => {
17
+ g(o, s, {
18
+ placement: r,
19
+ strategy: f,
20
+ middleware: [
21
+ ...i(y, t.inline),
22
+ ...i(b, t.offset),
23
+ ...i(h, t.flip),
24
+ ...i(j, t.shift),
25
+ ...i(w, a && t.arrow, { element: a })
26
+ ]
27
+ }).then((c) => {
28
+ const { x: p, y: u, middlewareData: m, placement: x } = c, e = m.arrow;
29
+ Object.assign(s.style, {
30
+ left: `${p}px`,
31
+ top: `${u}px`
32
+ }), s.setAttribute("data-placement", x), e && Object.assign(a.style, {
33
+ // position: "absolute",
34
+ left: (e == null ? void 0 : e.x) != null ? `${e.x}px` : "",
35
+ top: (e == null ? void 0 : e.y) != null ? `${e.y}px` : ""
36
+ });
37
+ });
38
+ });
39
+ }
40
+ function i(l, n, t = {}) {
41
+ return n ? typeof n == "object" ? [l({ ...n, ...t })] : [l(t)] : [];
42
+ }
43
+ export {
44
+ O as createFloatingUi,
45
+ $ as defaults
46
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-awesome.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/font-awesome.js"],"names":[],"mappings":"AAOA;;GAEG;AACH,uCAQC"}
@@ -0,0 +1,13 @@
1
+ import { updateSettings as s } from "../core/settings.js";
2
+ function o() {
3
+ s({
4
+ iconClassClose: "fas fa-xmark",
5
+ iconClassDragX: "fas fa-solid fa-grip-lines-vertical",
6
+ // iconClassDragBoth: "fas fa-solid fa-grip", // Not really any good icons for this (no diagonal arrows, etc)
7
+ iconClassPrevious: "fas fa-solid fa-chevron-left",
8
+ iconClassNext: "fas fa-solid fa-chevron-right"
9
+ });
10
+ }
11
+ export {
12
+ o as configureIcons
13
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../lib/js/utils/id.js"],"names":[],"mappings":"AAMA;;GAEG;AACH,gCAEC;AAED;;;GAGG;AACH,kCAFW,IAAI,QAMd"}
@@ -0,0 +1,11 @@
1
+ let i = 0;
2
+ function n() {
3
+ return `ulu-uid-${++i}`;
4
+ }
5
+ function d(u) {
6
+ u.id || (u.id = n());
7
+ }
8
+ export {
9
+ d as ensureId,
10
+ n as newId
11
+ };