@ulu/frontend-vue 0.1.0-beta.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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/breakpoints-ClT9bfZm.js +211 -0
  4. package/dist/frontend-vue.css +1 -0
  5. package/dist/frontend-vue.js +82 -0
  6. package/dist/frontend-vue.umd.cjs +561 -0
  7. package/dist/index-P5Rwl_Dl.js +7263 -0
  8. package/dist/index.es-HlG3u0J5.js +3134 -0
  9. package/lib/_index.scss +14 -0
  10. package/lib/components/_index.scss +6 -0
  11. package/lib/components/collapsible/UluAccordion.vue +82 -0
  12. package/lib/components/collapsible/UluCollapsibleRegion.vue +278 -0
  13. package/lib/components/collapsible/UluDropdown.vue +42 -0
  14. package/lib/components/collapsible/UluModal.vue +384 -0
  15. package/lib/components/collapsible/UluOverflowPopover.vue +52 -0
  16. package/lib/components/collapsible/UluTab.vue +9 -0
  17. package/lib/components/collapsible/UluTabGroup.vue +31 -0
  18. package/lib/components/collapsible/UluTabList.vue +9 -0
  19. package/lib/components/collapsible/UluTabPanel.vue +9 -0
  20. package/lib/components/collapsible/UluTabPanels.vue +9 -0
  21. package/lib/components/elements/UluAlert.vue +81 -0
  22. package/lib/components/elements/UluBadge.vue +58 -0
  23. package/lib/components/elements/UluBadgeStack.vue +27 -0
  24. package/lib/components/elements/UluButton.vue +161 -0
  25. package/lib/components/elements/UluCallout.vue +30 -0
  26. package/lib/components/elements/UluCard.vue +241 -0
  27. package/lib/components/elements/UluDefinitionList.vue +40 -0
  28. package/lib/components/elements/UluExternalLink.vue +47 -0
  29. package/lib/components/elements/UluIcon.vue +108 -0
  30. package/lib/components/elements/UluList.vue +87 -0
  31. package/lib/components/elements/UluMain.vue +5 -0
  32. package/lib/components/elements/UluSpokeSpinner.vue +25 -0
  33. package/lib/components/elements/UluTag.vue +53 -0
  34. package/lib/components/forms/UluCheckboxMenu.vue +36 -0
  35. package/lib/components/forms/UluFileDisplay.vue +39 -0
  36. package/lib/components/forms/UluFormDropzone.vue +62 -0
  37. package/lib/components/forms/UluFormFile.vue +47 -0
  38. package/lib/components/forms/UluFormMessage.vue +20 -0
  39. package/lib/components/forms/UluFormSelect.vue +37 -0
  40. package/lib/components/forms/UluFormText.vue +32 -0
  41. package/lib/components/forms/UluSearchForm.vue +31 -0
  42. package/lib/components/index.js +54 -0
  43. package/lib/components/layout/UluAdaptiveLayout.vue +11 -0
  44. package/lib/components/layout/UluDataGrid.vue +41 -0
  45. package/lib/components/layout/UluTitleRail.vue +56 -0
  46. package/lib/components/layout/UluWhenBreakpoint.vue +86 -0
  47. package/lib/components/navigation/UluBreadcrumb.vue +72 -0
  48. package/lib/components/navigation/UluMenu.vue +105 -0
  49. package/lib/components/navigation/UluMenuStack.vue +49 -0
  50. package/lib/components/navigation/UluNavStrip.vue +48 -0
  51. package/lib/components/navigation/UluSkipLink.vue +5 -0
  52. package/lib/components/systems/facets/UluFacets.vue +380 -0
  53. package/lib/components/systems/facets/UluFacetsList.vue +39 -0
  54. package/lib/components/systems/facets/UluFacetsSearch.vue +67 -0
  55. package/lib/components/systems/facets/_facets.scss +64 -0
  56. package/lib/components/systems/index.js +17 -0
  57. package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +152 -0
  58. package/lib/components/systems/scroll-anchors/UluScrollAnchorsNav.vue +37 -0
  59. package/lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue +124 -0
  60. package/lib/components/systems/scroll-anchors/UluScrollAnchorsSection.vue +63 -0
  61. package/lib/components/systems/scroll-anchors/symbols.js +6 -0
  62. package/lib/components/systems/skeleton/UluShowSkeleton.vue +13 -0
  63. package/lib/components/systems/skeleton/UluSkeletonContent.vue +60 -0
  64. package/lib/components/systems/skeleton/UluSkeletonMedia.vue +11 -0
  65. package/lib/components/systems/skeleton/UluSkeletonTextInline.vue +9 -0
  66. package/lib/components/systems/slider/UluImageSlideShow.vue +75 -0
  67. package/lib/components/systems/slider/UluSlideShow.vue +331 -0
  68. package/lib/components/systems/slider/UluSlideShowSlide.vue +25 -0
  69. package/lib/components/systems/table-sticky/UluTableSticky.vue +793 -0
  70. package/lib/components/systems/table-sticky/UluTableStickyRows.vue +73 -0
  71. package/lib/components/systems/table-sticky/UluTableStickyTable.vue +237 -0
  72. package/lib/components/systems/table-sticky/_table-sticky.scss +185 -0
  73. package/lib/components/utils/UluCondText.vue +28 -0
  74. package/lib/components/utils/UluEmpty.vue +3 -0
  75. package/lib/components/utils/UluEmptyView.vue +3 -0
  76. package/lib/components/utils/UluPlaceholderImage.vue +53 -0
  77. package/lib/components/utils/UluPlaceholderText.vue +25 -0
  78. package/lib/components/utils/UluRouteAnnouncer.vue +83 -0
  79. package/lib/components/visualizations/UluAnimateNumber.vue +32 -0
  80. package/lib/components/visualizations/UluProgressBar.vue +94 -0
  81. package/lib/components/visualizations/UluProgressDonut.vue +97 -0
  82. package/lib/composables/index.js +10 -0
  83. package/lib/composables/useBreakpointManager.js +68 -0
  84. package/lib/composables/useIcon.js +62 -0
  85. package/lib/composables/useModifiers.js +93 -0
  86. package/lib/composables/useWindowResize.js +64 -0
  87. package/lib/index.js +10 -0
  88. package/lib/plugins/_index.scss +7 -0
  89. package/lib/plugins/breakpoints/index.js +47 -0
  90. package/lib/plugins/index.js +11 -0
  91. package/lib/plugins/modals/UluModalsDisplay.vue +59 -0
  92. package/lib/plugins/modals/api.js +76 -0
  93. package/lib/plugins/modals/index.js +60 -0
  94. package/lib/plugins/modals/useModals.js +9 -0
  95. package/lib/plugins/popovers/UluPopover.vue +189 -0
  96. package/lib/plugins/popovers/UluTooltipDisplay.vue +15 -0
  97. package/lib/plugins/popovers/UluTooltipPopover.vue +83 -0
  98. package/lib/plugins/popovers/defaults.js +108 -0
  99. package/lib/plugins/popovers/directive.js +95 -0
  100. package/lib/plugins/popovers/index.js +18 -0
  101. package/lib/plugins/popovers/manager.js +54 -0
  102. package/lib/plugins/popovers/useFollow.js +80 -0
  103. package/lib/plugins/popovers/utils.js +5 -0
  104. package/lib/plugins/toast/UluToast.vue +87 -0
  105. package/lib/plugins/toast/UluToastDisplay.vue +35 -0
  106. package/lib/plugins/toast/_toast.scss +198 -0
  107. package/lib/plugins/toast/defaults.js +30 -0
  108. package/lib/plugins/toast/index.js +17 -0
  109. package/lib/plugins/toast/store.js +71 -0
  110. package/lib/plugins/toast/useToast.js +18 -0
  111. package/lib/settings.js +119 -0
  112. package/lib/utils/dom.js +14 -0
  113. package/lib/utils/placeholder.js +6 -0
  114. package/lib/utils/vue-router.js +219 -0
  115. package/package.json +75 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jscherbe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @ulu/frontend-vue
2
+
3
+ Vue component library for [Ulu frontend](https://jscherbe.github.io/frontend/).
4
+
5
+ - [Documentation](https://jscherbe.github.io/frontend-vue/)
6
+ - [Change Log](CHANGELOG.md)
7
+
8
+
9
+
@@ -0,0 +1,211 @@
1
+ import { l as o, r as h, a as p, g as v } from "./index-P5Rwl_Dl.js";
2
+ const k = {
3
+ iconClassClose: "css-icon css-icon--close",
4
+ iconClassDragX: "css-icon css-icon--drag-x",
5
+ iconClassDragBoth: "css-icon css-icon--drag-both",
6
+ iconClassPrevious: "css-icon css-icon--angle-left",
7
+ iconClassNext: "css-icon css-icon--angle-right",
8
+ cssvarPrefix: ""
9
+ };
10
+ let f = { ...k };
11
+ function x(s) {
12
+ if (!f.hasOwnProperty(s)) {
13
+ console.warn(`Attempted to access non-existent setting: ${s}`);
14
+ return;
15
+ }
16
+ return f[s];
17
+ }
18
+ function b(s, t) {
19
+ return {
20
+ toString() {
21
+ const e = x(s);
22
+ return t ? t(e) : e;
23
+ }
24
+ };
25
+ }
26
+ function y(s, t) {
27
+ return `--${s}-${t}`;
28
+ }
29
+ const C = (s) => y(s, "breakpoint");
30
+ window.addEventListener(v("pageResized"), () => {
31
+ a.instances.forEach((s) => s.update());
32
+ });
33
+ class a {
34
+ static instances = [];
35
+ static defaults = {
36
+ element: document?.documentElement,
37
+ valueFromPseudo: !1,
38
+ customProperty: "--breakpoint",
39
+ customProperty: b("cssvarPrefix", C),
40
+ pseudoSelector: ":before",
41
+ order: ["none", "small", "medium", "large"],
42
+ debug: !1
43
+ };
44
+ /**
45
+ * @param {Object} config Configuration object
46
+ * @param {Array} config.order Array of strings that correspond to the breakpoints setup in the styles, Breakpoints from smallest to largest, defaults to [small, medium, large]
47
+ * @param {Array} config.customProperty Property to grab breakpoint from (default is --breakpoint)
48
+ * @param {Array} config.valueFromPseudo Use the legacy method of grabbing breakpoint from pseudo element, default uses custom property
49
+ * @param {Node} config.element The element to retrieve active breakpoint from stylesheet. (default is html) For using the old pseudo method, adjust this to document.body
50
+ * @param {String} config.pseudoSelector Change pseudo selector used to get the breakpoint from the pseudo's content property
51
+ */
52
+ constructor(t) {
53
+ Object.assign(this, a.defaults, t), this.active = null, this.previous = null, this.activeIndex = null, this.resizeDirection = null, this.previousIndex = null, this.breakpoints = {}, this.onChangeCallbacks = [], this.order.forEach((e) => this.breakpoints[e] = new P(e, this)), o(this, this), this.update(), a.instances.push(this);
54
+ }
55
+ /**
56
+ * Add a callback for every time a breakpoint changes
57
+ * - Not recommended, possibly use to watch for changes, etc
58
+ * - For more control use instance.at(name) with breakpoint methods
59
+ * @param {Function} callback Function to call, passed one argument current instance which can be used to get information about breakpoints
60
+ */
61
+ onChange(t) {
62
+ this.onChangeCallbacks.push(t);
63
+ }
64
+ /**
65
+ * Remove change callback
66
+ * @param {Function} callback Function to remove
67
+ */
68
+ removeOnChange(t) {
69
+ h(this.onChangeCallbacks, t);
70
+ }
71
+ /**
72
+ * Get breakpoint from a pseudo element
73
+ */
74
+ getBreakpointInPseudo() {
75
+ return window.getComputedStyle(this.element, this.pseudoSelector).content.replace(/^"|"$/g, "");
76
+ }
77
+ /**
78
+ * Get breakpoint from a custom property
79
+ */
80
+ getBreakpointInProperty() {
81
+ return getComputedStyle(this.element).getPropertyValue(this.customProperty).trim();
82
+ }
83
+ /**
84
+ * Get breakpoint from element (design note: user could override prototype)
85
+ */
86
+ getBreakpoint() {
87
+ return this.valueFromPseudo ? this.getBreakpointInPseudo() : this.getBreakpointInProperty();
88
+ }
89
+ /**
90
+ * Updates the active breakpoint by checking the element and executes handlers on change
91
+ */
92
+ update() {
93
+ const t = this.getBreakpoint();
94
+ if (!t) {
95
+ p(this, "Unable to get current breakpoint, maybe order is incorrect? Breakpoint check skipped!");
96
+ return;
97
+ }
98
+ if (t === this.active) return;
99
+ this.previous = this.active, this.previousIndex = this.activeIndex;
100
+ const e = this.order.indexOf(t);
101
+ this.active = t, this.activeIndex = e;
102
+ const r = this.at(this.active), n = (i) => this.at(i), l = this.order.slice(e).map(n), m = this.order.slice(0, e).map(n), d = this.order.slice(0, e + 1).map(n), g = this.order.slice(e + 1).map(n), u = this.order.slice().map(n);
103
+ u.splice(e, 1), o(this, "max:", l.map((i) => i.name).join()), o(this, "min:", d.map((i) => i.name).join()), l.forEach((i) => i._setDirection("max", !0)), d.forEach((i) => i._setDirection("min", !0)), r._setDirection("only", !0), m.forEach((i) => i._setDirection("max", !1)), g.forEach((i) => i._setDirection("min", !1)), u.forEach((i) => i._setDirection("only", !1)), this.previousIndex !== null && (this.resizeDirection = this.previousIndex < e ? "up" : "down"), this.onChangeCallbacks.forEach((i) => i(this));
104
+ }
105
+ /**
106
+ * Get a breakpoint by key
107
+ * @param {String} name The name of the breakpoint to get
108
+ * @return {Breakpoint} Breakpoint to act on (see Breakpoint class)
109
+ */
110
+ at(t) {
111
+ const e = this.breakpoints[t];
112
+ return t || p(this, "Unable to find breakpoint for:", e), e;
113
+ }
114
+ }
115
+ class c {
116
+ constructor(t, e) {
117
+ this.direction = t, this.active = !1, this.on = [], this.off = [], this.breakpoint = e;
118
+ }
119
+ /**
120
+ * Change the state of the direction
121
+ */
122
+ change(t) {
123
+ this.active !== t && (t ? this._call(!0) : this.active && this._call(!1), this.active = t);
124
+ }
125
+ /**
126
+ * Calls all functions in handlers or
127
+ */
128
+ _call(t) {
129
+ (t ? this.on : this.off).forEach((r) => r()), o(this.breakpoint._manager, `Handlers called (${t ? "on" : "off"}): ${this.direction}`);
130
+ }
131
+ /**
132
+ * Returns handlers in normalized object format on/off
133
+ */
134
+ getHandlers(t) {
135
+ return typeof t != "object" ? { on: t } : t;
136
+ }
137
+ /**
138
+ * Adds a handler for the direction, optionally use object to add off state handler
139
+ * @param {Function|Object} handler Function to be executed when direction is active, read object description for on/off
140
+ * @param {Function|Object} handler.on Function to be executed when direction is active
141
+ * @param {Function|Object} handler.off Function to be executed when direction was active and is now changed to inactive
142
+ */
143
+ add(t) {
144
+ const e = this.getHandlers(t);
145
+ e.on && this.on.push(e.on), e.off && this.off.push(e.off), this.active && e.on && (e.on(), o(this.breakpoint._manager, `Handler called immediately: ${this.direction}`, e.on));
146
+ }
147
+ /**
148
+ * Removes a handler
149
+ */
150
+ remove(t) {
151
+ const e = this.getHandlers(t);
152
+ e.on && h(this.on, e.on), e.off && h(this.off, e.off);
153
+ }
154
+ }
155
+ class P {
156
+ constructor(t, e) {
157
+ this.directions = {
158
+ max: new c("max", this),
159
+ min: new c("min", this),
160
+ only: new c("only", this)
161
+ }, this._manager = e, this.name = t;
162
+ }
163
+ /**
164
+ * Private method used inrternally for managing direction activation
165
+ * - Each direction manages it's own state and handlers
166
+ * @param {String} direction The directional key
167
+ * @param {Boolean} active State of that direction to set
168
+ */
169
+ _setDirection(t, e) {
170
+ this.directions[t].change(e);
171
+ }
172
+ /**
173
+ * Attach handler to be executed from the breakpoint and to all breakpoints below.
174
+ * - If the browser resizes from a breakpoint below this breakpoint,
175
+ * and above the breakpoint name specified, this handler will fire
176
+ * @param {Function} handler Handler to be executed
177
+ */
178
+ max(t) {
179
+ this.directions.max.add(t);
180
+ }
181
+ /**
182
+ * Attach handler to be executed from the breakpoint and to all breakpoints below.
183
+ * - If the browser resizes from a breakpoint above this breakpoint,
184
+ * and below the breakpoint name specified, this handler will fire
185
+ * @param {Function} handler Handler to be executed
186
+ */
187
+ min(t) {
188
+ this.directions.min.add(t);
189
+ }
190
+ /**
191
+ * Attach a handler to fire when the breakpoint is within the key
192
+ * @param {Function} handler Handler to be executed
193
+ */
194
+ only(t) {
195
+ this.directions.only.add(t);
196
+ }
197
+ /**
198
+ * Remove handler
199
+ * @param {Function} handler Handler to be removed, extended on/off object style can be used
200
+ * @param {String} direction Remove handler only from specified direction, else search all directions
201
+ */
202
+ remove(t, e) {
203
+ (e ? [e] : ["max", "min", "only"]).forEach((n) => n.remove(t));
204
+ }
205
+ log(...t) {
206
+ t.unshift(`Breakpoint (${this.name}):`), this._manager.log.apply(this._manager, t);
207
+ }
208
+ }
209
+ export {
210
+ a as BreakpointManager
211
+ };
@@ -0,0 +1 @@
1
+ .UluFacets__more-facets{display:flex;flex-direction:column}.UluFacets__more-facets.UluCollapsibleRegion--open .UluCollapsibleRegion__content,.UluFacets__more-facets.UluCollapsibleRegion--transitioning .UluCollapsibleRegion__content{order:-1}.UluFacetsFade-enter-active,.UluFacetsFade-leave-active{transition:opacity .25s ease}.UluFacetsFade-enter-from,.UluFacetsFade-leave-to{opacity:0}.scroll-anchors__rail{border-left:3px solid rgb(220,220,220);padding-left:1rem}.scroll-anchors__indicator{position:absolute;top:0;left:0;width:3px;background-color:#000}.scroll-anchors__indicator--can-transition{transition-property:height,transform;transition-timing-function:ease-in-out;transition-duration:.25s}
@@ -0,0 +1,82 @@
1
+ import { _ as l, L as e, p as u, $ as o, q as U, s as t, O as n, t as i, u as r, v as S, D as c, U as d, T as g, M as p, w as k, e as m, V as T, W as b, x as h, a2 as F, a4 as P, a3 as A, E as w, F as y, G as M, H as v, I as x, J as B, y as D, ad as L, z as f, A as C, P as I, Q as R, f as N, R as E, h as z, X as G, Y as j, a0 as q, a1 as O, Z as V, a5 as W, a6 as H, a7 as J, a8 as K, K as Q, a9 as X, aa as Y, ab as Z, ac as _, S as $, ae as aa, af as sa, B as la, j as ea, k as ua, m as oa, n as Ua, o as ta, ag as na, ah as ia, ai as ra, C as Sa, N as ca, d as da, an as ga, as as pa, aq as ka, ap as ma, b as Ta, i as ba, c as ha, ar as Fa, ao as Pa, am as Aa, aj as wa, ak as ya, al as Ma } from "./index-P5Rwl_Dl.js";
2
+ export {
3
+ l as UluAccordion,
4
+ e as UluAdaptiveLayout,
5
+ u as UluAlert,
6
+ o as UluAnimateNumber,
7
+ U as UluBadge,
8
+ t as UluBadgeStack,
9
+ n as UluBreadcrumb,
10
+ i as UluButton,
11
+ r as UluCallout,
12
+ S as UluCard,
13
+ c as UluCheckboxMenu,
14
+ d as UluCollapsibleRegion,
15
+ g as UluCondText,
16
+ p as UluDataGrid,
17
+ k as UluDefinitionList,
18
+ m as UluDropdown,
19
+ T as UluEmpty,
20
+ b as UluEmptyView,
21
+ h as UluExternalLink,
22
+ F as UluFacets,
23
+ P as UluFacetsList,
24
+ A as UluFacetsSearch,
25
+ w as UluFileDisplay,
26
+ y as UluFormDropzone,
27
+ M as UluFormFile,
28
+ v as UluFormMessage,
29
+ x as UluFormSelect,
30
+ B as UluFormText,
31
+ D as UluIcon,
32
+ L as UluImageSlideShow,
33
+ f as UluList,
34
+ C as UluMain,
35
+ I as UluMenu,
36
+ R as UluMenuStack,
37
+ N as UluModal,
38
+ E as UluNavStrip,
39
+ z as UluOverflowPopover,
40
+ G as UluPlaceholderImage,
41
+ j as UluPlaceholderText,
42
+ q as UluProgressBar,
43
+ O as UluProgressDonut,
44
+ V as UluRouteAnnouncer,
45
+ W as UluScrollAnchors,
46
+ H as UluScrollAnchorsNav,
47
+ J as UluScrollAnchorsNavAnimated,
48
+ K as UluScrollAnchorsSection,
49
+ Q as UluSearchForm,
50
+ X as UluShowSkeleton,
51
+ Y as UluSkeletonContent,
52
+ Z as UluSkeletonMedia,
53
+ _ as UluSkeletonTextInline,
54
+ $ as UluSkipLink,
55
+ aa as UluSlideShow,
56
+ sa as UluSlideShowSlide,
57
+ la as UluSpokeSpinner,
58
+ ea as UluTab,
59
+ ua as UluTabGroup,
60
+ oa as UluTabList,
61
+ Ua as UluTabPanel,
62
+ ta as UluTabPanels,
63
+ na as UluTableSticky,
64
+ ia as UluTableStickyRows,
65
+ ra as UluTableStickyTable,
66
+ Sa as UluTag,
67
+ ca as UluTitleRail,
68
+ da as breakpointsPlugin,
69
+ ga as getDefaultSettings,
70
+ pa as getIconByType,
71
+ ka as getSetting,
72
+ ma as getSettings,
73
+ Ta as modalsPlugin,
74
+ ba as popoversPlugin,
75
+ ha as toastPlugin,
76
+ Fa as updateSetting,
77
+ Pa as updateSettings,
78
+ Aa as useBreakpointManager,
79
+ wa as useIcon,
80
+ ya as useModifiers,
81
+ Ma as useWindowResize
82
+ };