@ulu/frontend-vue 0.2.0-beta.6 → 0.2.0-beta.8
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/dist/components/collapsible/UluModal.vue.d.ts +6 -2
- package/dist/components/collapsible/UluModal.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluModal.vue.js +59 -57
- package/dist/utils/router.d.ts.map +1 -1
- package/dist/utils/router.js +49 -47
- package/lib/components/collapsible/UluModal.vue +10 -2
- package/lib/utils/router.js +20 -14
- package/package.json +2 -4
|
@@ -93,7 +93,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
93
93
|
*/
|
|
94
94
|
classes: {
|
|
95
95
|
type: ObjectConstructor;
|
|
96
|
-
default: () => {
|
|
96
|
+
default: () => {
|
|
97
|
+
close: string;
|
|
98
|
+
};
|
|
97
99
|
};
|
|
98
100
|
/**
|
|
99
101
|
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
|
@@ -216,7 +218,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
216
218
|
*/
|
|
217
219
|
classes: {
|
|
218
220
|
type: ObjectConstructor;
|
|
219
|
-
default: () => {
|
|
221
|
+
default: () => {
|
|
222
|
+
close: string;
|
|
223
|
+
};
|
|
220
224
|
};
|
|
221
225
|
/**
|
|
222
226
|
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"AAqEA;;IAmZM;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;;;IAOH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;IApGH;;OAEG;;IAEH;;;;OAIG;;;;;IAKH;;OAEG;;;;;IAKH;;;OAGG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;;;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;;;;;;IAOH;;OAEG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { resolveComponent as v, createBlock as b, openBlock as
|
|
1
|
+
import { resolveComponent as v, createBlock as b, openBlock as d, Teleport as S, createElementVNode as c, withModifiers as R, normalizeStyle as _, normalizeClass as r, createElementBlock as z, createCommentVNode as u, renderSlot as h, toDisplayString as I, createVNode as g, useSlots as k, computed as f } from "vue";
|
|
2
2
|
import C from "../elements/UluIcon.vue.js";
|
|
3
3
|
import { useModifiers as w } from "../../composables/useModifiers.js";
|
|
4
4
|
import { preventScroll as E, wasClickOutside as B } from "@ulu/utils/browser/dom.js";
|
|
5
5
|
import { Resizer as M } from "@ulu/frontend";
|
|
6
6
|
import { newId as V } from "../../utils/dom.js";
|
|
7
|
-
import
|
|
8
|
-
const
|
|
7
|
+
import T from "../../_virtual/_plugin-vue_export-helper.js";
|
|
8
|
+
const p = {
|
|
9
9
|
name: "UluModal",
|
|
10
10
|
components: {
|
|
11
11
|
UluIcon: C
|
|
@@ -107,7 +107,9 @@ const T = {
|
|
|
107
107
|
*/
|
|
108
108
|
classes: {
|
|
109
109
|
type: Object,
|
|
110
|
-
default: () => ({
|
|
110
|
+
default: () => ({
|
|
111
|
+
close: "button button--icon"
|
|
112
|
+
})
|
|
111
113
|
},
|
|
112
114
|
/**
|
|
113
115
|
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
|
@@ -124,7 +126,7 @@ const T = {
|
|
|
124
126
|
};
|
|
125
127
|
},
|
|
126
128
|
setup(e) {
|
|
127
|
-
const
|
|
129
|
+
const l = k(), t = f(() => e.title || l.title), o = f(() => {
|
|
128
130
|
const { allowResize: i, position: m } = e;
|
|
129
131
|
if (!i || !m) return;
|
|
130
132
|
const y = ["left", "right", "center"];
|
|
@@ -133,28 +135,28 @@ const T = {
|
|
|
133
135
|
[e.position]: e.position,
|
|
134
136
|
resize: e.allowResize,
|
|
135
137
|
"no-resize": !e.allowResize,
|
|
136
|
-
"no-header": !
|
|
138
|
+
"no-header": !t.value,
|
|
137
139
|
"body-fills": e.bodyFills,
|
|
138
140
|
"no-backdrop": e.noBackdrop,
|
|
139
141
|
"no-min-height": e.noMinHeight,
|
|
140
142
|
"non-modal": e.nonModal,
|
|
141
143
|
"resizer-active": o.value
|
|
142
|
-
})), { resolvedModifiers:
|
|
144
|
+
})), { resolvedModifiers: a } = w({
|
|
143
145
|
props: e,
|
|
144
146
|
baseClass: "modal",
|
|
145
147
|
internal: s
|
|
146
148
|
});
|
|
147
149
|
return {
|
|
148
|
-
resolvedModifiers:
|
|
149
|
-
hasHeader:
|
|
150
|
+
resolvedModifiers: a,
|
|
151
|
+
hasHeader: t,
|
|
150
152
|
resizerEnabled: o,
|
|
151
153
|
resizerIconType: n
|
|
152
154
|
};
|
|
153
155
|
},
|
|
154
156
|
computed: {
|
|
155
157
|
resolvedLabelledby() {
|
|
156
|
-
const { labelledby: e, titleId:
|
|
157
|
-
return e ||
|
|
158
|
+
const { labelledby: e, titleId: l } = this;
|
|
159
|
+
return e || l;
|
|
158
160
|
}
|
|
159
161
|
},
|
|
160
162
|
watch: {
|
|
@@ -163,8 +165,8 @@ const T = {
|
|
|
163
165
|
immediate: !0,
|
|
164
166
|
handler(e) {
|
|
165
167
|
this.$nextTick(() => {
|
|
166
|
-
const { container:
|
|
167
|
-
e ? (
|
|
168
|
+
const { container: l } = this.$refs;
|
|
169
|
+
e ? (l[this.nonModal ? "show" : "showModal"](), this.$emit("open")) : l.close();
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
172
|
},
|
|
@@ -177,8 +179,8 @@ const T = {
|
|
|
177
179
|
}) : this.destroyResizer();
|
|
178
180
|
}
|
|
179
181
|
},
|
|
180
|
-
position(e,
|
|
181
|
-
e !==
|
|
182
|
+
position(e, l) {
|
|
183
|
+
e !== l && (this.destroyResizer(), this.$nextTick(() => {
|
|
182
184
|
this.setupResizer();
|
|
183
185
|
}));
|
|
184
186
|
}
|
|
@@ -192,8 +194,8 @@ const T = {
|
|
|
192
194
|
},
|
|
193
195
|
handleClick(e) {
|
|
194
196
|
if (this.clickOutsideCloses && !this.isResizing) {
|
|
195
|
-
const { target:
|
|
196
|
-
|
|
197
|
+
const { target: l } = e, { container: t } = this.$refs;
|
|
198
|
+
l === t && B(t, e) && this.close();
|
|
197
199
|
}
|
|
198
200
|
},
|
|
199
201
|
setupPreventScroll() {
|
|
@@ -205,21 +207,21 @@ const T = {
|
|
|
205
207
|
},
|
|
206
208
|
handleToggle(e) {
|
|
207
209
|
if (!this.nonModal && this.preventScroll) {
|
|
208
|
-
const { preventScrollShift:
|
|
209
|
-
e.newState === "open" ? this.restoreScroll = E({ preventShift:
|
|
210
|
+
const { preventScrollShift: l } = this;
|
|
211
|
+
e.newState === "open" ? this.restoreScroll = E({ preventShift: l }) : this.destroyPreventScroll();
|
|
210
212
|
}
|
|
211
213
|
},
|
|
212
214
|
setupResizer() {
|
|
213
|
-
const { position: e, resizerEnabled:
|
|
214
|
-
if (
|
|
215
|
-
const { container:
|
|
216
|
-
this.resizerInstance = new M(
|
|
215
|
+
const { position: e, resizerEnabled: l } = this;
|
|
216
|
+
if (l) {
|
|
217
|
+
const { container: t, resizer: o } = this.$refs, n = e === "center" ? { fromX: "right", fromY: "bottom", multiplier: 2 } : { fromX: e === "right" ? "left" : "right" };
|
|
218
|
+
this.resizerInstance = new M(t, o, n), this.handleResizerStart = () => {
|
|
217
219
|
this.isResizing = !0;
|
|
218
220
|
}, this.handleResizerEnd = () => {
|
|
219
221
|
setTimeout(() => {
|
|
220
222
|
this.isResizing = !1;
|
|
221
223
|
}, 0);
|
|
222
|
-
},
|
|
224
|
+
}, t.addEventListener("ulu:resizer:start", this.handleResizerStart), t.addEventListener("ulu:resizer:end", this.handleResizerEnd);
|
|
223
225
|
}
|
|
224
226
|
},
|
|
225
227
|
destroyResizer() {
|
|
@@ -240,77 +242,77 @@ const T = {
|
|
|
240
242
|
ref: "resizer",
|
|
241
243
|
type: "button"
|
|
242
244
|
};
|
|
243
|
-
function H(e,
|
|
244
|
-
const
|
|
245
|
-
return
|
|
246
|
-
to:
|
|
247
|
-
disabled:
|
|
245
|
+
function H(e, l, t, o, n, s) {
|
|
246
|
+
const a = v("UluIcon");
|
|
247
|
+
return d(), b(S, {
|
|
248
|
+
to: t.teleport === !1 ? null : t.teleport,
|
|
249
|
+
disabled: t.teleport === !1
|
|
248
250
|
}, [
|
|
249
|
-
|
|
250
|
-
class:
|
|
251
|
+
c("dialog", {
|
|
252
|
+
class: r(["modal", [o.resolvedModifiers, t.classes.container]]),
|
|
251
253
|
"aria-labelledby": s.resolvedLabelledby,
|
|
252
|
-
"aria-describedby":
|
|
254
|
+
"aria-describedby": t.describedby,
|
|
253
255
|
ref: "container",
|
|
254
256
|
style: _({ width: n.containerWidth }),
|
|
255
|
-
onCancel:
|
|
256
|
-
onClose:
|
|
257
|
-
onClick:
|
|
258
|
-
onToggle:
|
|
257
|
+
onCancel: l[1] || (l[1] = R((...i) => s.close && s.close(...i), ["prevent"])),
|
|
258
|
+
onClose: l[2] || (l[2] = (...i) => s.handleDialogCloseEvent && s.handleDialogCloseEvent(...i)),
|
|
259
|
+
onClick: l[3] || (l[3] = (...i) => s.handleClick && s.handleClick(...i)),
|
|
260
|
+
onToggle: l[4] || (l[4] = (...i) => s.handleToggle && s.handleToggle(...i))
|
|
259
261
|
}, [
|
|
260
|
-
o.hasHeader ? (
|
|
262
|
+
o.hasHeader ? (d(), z("header", {
|
|
261
263
|
key: 0,
|
|
262
|
-
class:
|
|
264
|
+
class: r(["modal__header", t.classes.header])
|
|
263
265
|
}, [
|
|
264
|
-
|
|
265
|
-
class:
|
|
266
|
+
c("h2", {
|
|
267
|
+
class: r(["modal__title", t.classes.title]),
|
|
266
268
|
id: n.titleId
|
|
267
269
|
}, [
|
|
268
270
|
h(e.$slots, "title", { close: s.close }, () => [
|
|
269
|
-
|
|
271
|
+
t.titleIcon ? (d(), b(a, {
|
|
270
272
|
key: 0,
|
|
271
273
|
class: "modal__title-icon",
|
|
272
|
-
icon:
|
|
274
|
+
icon: t.titleIcon
|
|
273
275
|
}, null, 8, ["icon"])) : u("", !0),
|
|
274
|
-
|
|
276
|
+
c("span", L, I(t.title), 1)
|
|
275
277
|
])
|
|
276
278
|
], 10, P),
|
|
277
|
-
|
|
278
|
-
class: "modal__close",
|
|
279
|
+
c("button", {
|
|
280
|
+
class: r(["modal__close", t.classes.close]),
|
|
279
281
|
"aria-label": "Close modal",
|
|
280
|
-
onClick:
|
|
282
|
+
onClick: l[0] || (l[0] = (...i) => s.close && s.close(...i)),
|
|
281
283
|
autofocus: ""
|
|
282
284
|
}, [
|
|
283
285
|
h(e.$slots, "closeIcon", {}, () => [
|
|
284
|
-
g(
|
|
286
|
+
g(a, {
|
|
285
287
|
class: "modal__close-icon",
|
|
286
|
-
icon:
|
|
288
|
+
icon: t.closeIcon || "type:close"
|
|
287
289
|
}, null, 8, ["icon"])
|
|
288
290
|
])
|
|
289
|
-
])
|
|
291
|
+
], 2)
|
|
290
292
|
], 2)) : u("", !0),
|
|
291
|
-
|
|
292
|
-
class:
|
|
293
|
+
c("div", {
|
|
294
|
+
class: r(["modal__body", t.classes.body])
|
|
293
295
|
}, [
|
|
294
296
|
h(e.$slots, "default", { close: s.close })
|
|
295
297
|
], 2),
|
|
296
|
-
e.$slots.footer ? (
|
|
298
|
+
e.$slots.footer ? (d(), z("div", {
|
|
297
299
|
key: 1,
|
|
298
|
-
class:
|
|
300
|
+
class: r(["site-modal__footer", t.classes.footer])
|
|
299
301
|
}, [
|
|
300
302
|
h(e.$slots, "footer", { close: s.close })
|
|
301
303
|
], 2)) : u("", !0),
|
|
302
|
-
o.resizerEnabled ? (
|
|
304
|
+
o.resizerEnabled ? (d(), z("button", U, [
|
|
303
305
|
h(e.$slots, "resizerIcon", {}, () => [
|
|
304
|
-
g(
|
|
306
|
+
g(a, {
|
|
305
307
|
class: "modal__resizer-icon",
|
|
306
|
-
icon:
|
|
308
|
+
icon: t.resizerIcon || o.resizerIconType
|
|
307
309
|
}, null, 8, ["icon"])
|
|
308
310
|
])
|
|
309
311
|
], 512)) : u("", !0)
|
|
310
312
|
], 46, O)
|
|
311
313
|
], 8, ["to", "disabled"]);
|
|
312
314
|
}
|
|
313
|
-
const A = /* @__PURE__ */ p
|
|
315
|
+
const A = /* @__PURE__ */ T(p, [["render", H]]);
|
|
314
316
|
export {
|
|
315
317
|
A as default
|
|
316
318
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../lib/utils/router.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,qCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,uCANW,GAAC,WAET;IAAwB,SAAS,EAAzB,MAAM;IACU,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgCjC;AAED;;;;GAIG;AACH,kCAHW,KAAK,CAAC,aAAa,CAAC,GAClB,KAAK,CAAC,aAAa,CAAC,CAgBhC;AAED;;;;;;;;GAQG;AACH,0CAPW,GAAC,eACD,GAAC,WAET;IAAyB,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CA4BjC;AAED;;;;GAIG;AACH,qDAFa,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,sCAPW,MAAM,aACN,MAAM,uBAEd;IAA0B,MAAM;IACN,SAAS;CACnC,GAAU,aAAa,CAuBzB;AAED;;;;GAIG;AACH,qCAHW,MAAM,WAKhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,WAMhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,SACN,MAAM,QAYhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,2BACJ,KAAK,CAAC,MAAM,CAAC,GAAC,SAAS,CAInC;AAED;;;;;GAKG;AACH,uCAJW,MAAM,WACN,MAAM,GACL,MAAM,OAAK,CAUtB;AAUD;;;;;;;;;;GAUG;AACH,0CAPW,MAAM,WAEd;IAAwB,MAAM,EAAtB,MAAM;IACW,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgBjC;AAED;;;;;;;;GAQG;AACH,yCAHW,MAAM,GACJ,KAAK,CAAE;IAAC,KAAK,SAAS;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../lib/utils/router.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,qCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,uCANW,GAAC,WAET;IAAwB,SAAS,EAAzB,MAAM;IACU,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgCjC;AAED;;;;GAIG;AACH,kCAHW,KAAK,CAAC,aAAa,CAAC,GAClB,KAAK,CAAC,aAAa,CAAC,CAgBhC;AAED;;;;;;;;GAQG;AACH,0CAPW,GAAC,eACD,GAAC,WAET;IAAyB,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CA4BjC;AAED;;;;GAIG;AACH,qDAFa,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,sCAPW,MAAM,aACN,MAAM,uBAEd;IAA0B,MAAM;IACN,SAAS;CACnC,GAAU,aAAa,CAuBzB;AAED;;;;GAIG;AACH,qCAHW,MAAM,WAKhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,WAMhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,SACN,MAAM,QAYhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,2BACJ,KAAK,CAAC,MAAM,CAAC,GAAC,SAAS,CAInC;AAED;;;;;GAKG;AACH,uCAJW,MAAM,WACN,MAAM,GACL,MAAM,OAAK,CAUtB;AAUD;;;;;;;;;;GAUG;AACH,0CAPW,MAAM,WAEd;IAAwB,MAAM,EAAtB,MAAM;IACW,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgBjC;AAED;;;;;;;;GAQG;AACH,yCAHW,MAAM,GACJ,KAAK,CAAE;IAAC,KAAK,SAAS;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,CAmCjE"}
|
package/dist/utils/router.js
CHANGED
|
@@ -2,63 +2,63 @@ function m(t, e) {
|
|
|
2
2
|
let n = (t?.meta || {}).title;
|
|
3
3
|
return typeof n == "function" && (n = n(e || t)), n;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function w(t, e) {
|
|
6
6
|
const n = Object.assign({}, {
|
|
7
|
-
qualifier(
|
|
8
|
-
return
|
|
7
|
+
qualifier(s, c) {
|
|
8
|
+
return c ? b(s) : $(s);
|
|
9
9
|
},
|
|
10
10
|
sort: p,
|
|
11
11
|
item: {},
|
|
12
12
|
includeChildren: !1
|
|
13
|
-
}, e),
|
|
14
|
-
const
|
|
15
|
-
return n.includeChildren &&
|
|
13
|
+
}, e), r = (s, c) => c ? `${c}/${s.path}` : s.path, i = (s, c = null) => s.filter((u) => n.qualifier(u, c)).map((u) => {
|
|
14
|
+
const o = u.children ? g(u.children) : u, h = u.children ? u.children.filter((d) => d.path !== "") : !1, a = f(o, r(u, c), n.item);
|
|
15
|
+
return n.includeChildren && h.length && (a.children = i(h, a.path)), a;
|
|
16
16
|
}).sort(n.sort);
|
|
17
17
|
return i(t);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
function e(
|
|
19
|
+
function j(t) {
|
|
20
|
+
function e(l) {
|
|
21
21
|
const n = [];
|
|
22
|
-
for (const
|
|
23
|
-
const i = { ...
|
|
24
|
-
delete i.children, n.push(i),
|
|
22
|
+
for (const r of l) {
|
|
23
|
+
const i = { ...r };
|
|
24
|
+
delete i.children, n.push(i), r.children && n.push(...e(r.children));
|
|
25
25
|
}
|
|
26
26
|
return n;
|
|
27
27
|
}
|
|
28
28
|
return e(t);
|
|
29
29
|
}
|
|
30
|
-
function O(t, e,
|
|
31
|
-
const
|
|
30
|
+
function O(t, e, l) {
|
|
31
|
+
const r = Object.assign({}, {
|
|
32
32
|
includeIndex: !1,
|
|
33
33
|
item: {},
|
|
34
34
|
sort: p
|
|
35
|
-
},
|
|
36
|
-
if (
|
|
37
|
-
const d =
|
|
35
|
+
}, l), i = t.find((o) => o.path !== "/" && e.includes(o.path)), s = (o, h, a) => {
|
|
36
|
+
if (o.children) {
|
|
37
|
+
const d = o.children.find((x) => x.path.includes(e));
|
|
38
38
|
if (d)
|
|
39
|
-
return
|
|
39
|
+
return s(d, o, a + d.path);
|
|
40
40
|
}
|
|
41
|
-
return { route:
|
|
42
|
-
}, { route:
|
|
43
|
-
return
|
|
41
|
+
return { route: h, path: a };
|
|
42
|
+
}, { route: c, path: u } = s(i, i, i.path);
|
|
43
|
+
return c.children ? c.children.filter(I(r.includeIndex)).map((o) => f(o, `${u}/${o.path}`, r.item)).sort(r.sort) : (console.warn("Unable to build menu for:", e), []);
|
|
44
44
|
}
|
|
45
45
|
function g(t) {
|
|
46
46
|
return t.find((e) => e.path === "");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
48
|
+
function f(t, e = t.path, l) {
|
|
49
|
+
const r = Object.assign({}, {
|
|
50
50
|
indexMeta: !0,
|
|
51
51
|
modify: null
|
|
52
|
-
},
|
|
52
|
+
}, l);
|
|
53
53
|
let i = Object.assign({}, t.meta);
|
|
54
|
-
|
|
55
|
-
const
|
|
54
|
+
r.indexMeta && t.children && (i = Object.assign({}, i, g(t.children)?.meta));
|
|
55
|
+
const s = { ...t, meta: i }, c = {
|
|
56
56
|
path: e,
|
|
57
|
-
title: m(
|
|
57
|
+
title: m(s, t) || "Missing Title",
|
|
58
58
|
weight: i?.weight || 0,
|
|
59
59
|
meta: i
|
|
60
60
|
};
|
|
61
|
-
return
|
|
61
|
+
return r.modify && r.modify(c, t), c;
|
|
62
62
|
}
|
|
63
63
|
function b(t) {
|
|
64
64
|
return !t.path.includes("/:");
|
|
@@ -68,18 +68,18 @@ function $(t) {
|
|
|
68
68
|
return b(t) && e.length === 1;
|
|
69
69
|
}
|
|
70
70
|
function y(t, e) {
|
|
71
|
-
const { target:
|
|
71
|
+
const { target: l } = e, n = l.closest("a");
|
|
72
72
|
if (n) {
|
|
73
|
-
let
|
|
74
|
-
|
|
73
|
+
let r = n.getAttribute("href");
|
|
74
|
+
r.startsWith("/") && (t.push(r), e.preventDefault());
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
function R(t, e = M(t)) {
|
|
78
78
|
return e?.children;
|
|
79
79
|
}
|
|
80
80
|
function M(t, e) {
|
|
81
|
-
const
|
|
82
|
-
return e ?
|
|
81
|
+
const l = t.matched.length, n = l - 2;
|
|
82
|
+
return e ? l > 1 ? t.matched[0] : null : n < 0 ? null : t.matched[n];
|
|
83
83
|
}
|
|
84
84
|
function I(t) {
|
|
85
85
|
return (e) => t || e.path !== "";
|
|
@@ -93,32 +93,34 @@ function S(t, e) {
|
|
|
93
93
|
includeIndex: !1,
|
|
94
94
|
item: {},
|
|
95
95
|
sort: p
|
|
96
|
-
}, e),
|
|
97
|
-
return (R(t,
|
|
96
|
+
}, e), r = n.parent || M(t);
|
|
97
|
+
return (R(t, r) || []).filter(I(n.includeIndex)).map((s) => f(s, `${r.path}/${s.path}`, n.item)).sort(n.sort);
|
|
98
98
|
}
|
|
99
99
|
function B(t) {
|
|
100
|
-
const { matched: e, path:
|
|
101
|
-
|
|
102
|
-
return e.reduce((i, c, l) => {
|
|
103
|
-
if (c.meta?.breadcrumb === !1 || c.path === n)
|
|
100
|
+
const { matched: e, path: l } = t, n = e.reduce((i, s) => {
|
|
101
|
+
if (s.meta?.breadcrumb === !1)
|
|
104
102
|
return i;
|
|
105
|
-
const
|
|
106
|
-
return i.push(
|
|
107
|
-
title: a,
|
|
108
|
-
to: { path: u ? r : c.path },
|
|
109
|
-
current: u
|
|
110
|
-
}), n = c.path, i;
|
|
103
|
+
const c = i[i.length - 1];
|
|
104
|
+
return c && c.path === s.path || i.push(s), i;
|
|
111
105
|
}, []);
|
|
106
|
+
return n.map((i, s) => {
|
|
107
|
+
const c = s === n.length - 1, u = m(i, t);
|
|
108
|
+
return u || console.warn("Missing route title"), {
|
|
109
|
+
title: u || "Missing Title",
|
|
110
|
+
to: { path: c ? l : i.path },
|
|
111
|
+
current: c
|
|
112
|
+
};
|
|
113
|
+
});
|
|
112
114
|
}
|
|
113
115
|
export {
|
|
114
116
|
B as $createBreadcrumb,
|
|
115
117
|
S as $createSectionMenu,
|
|
116
118
|
M as $getParentRoute,
|
|
117
119
|
R as $getRouteChildren,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
w as createBaseMenu,
|
|
121
|
+
f as createMenuItem,
|
|
120
122
|
O as createSectionMenu,
|
|
121
|
-
|
|
123
|
+
j as flattenMenu,
|
|
122
124
|
g as getChildIndexRoute,
|
|
123
125
|
m as getRouteTitle,
|
|
124
126
|
$ as isStaticBaseRoute,
|
|
@@ -31,7 +31,13 @@
|
|
|
31
31
|
<span class="modal__title-text">{{ title }}</span>
|
|
32
32
|
</slot>
|
|
33
33
|
</h2>
|
|
34
|
-
<button
|
|
34
|
+
<button
|
|
35
|
+
class="modal__close"
|
|
36
|
+
:class="classes.close"
|
|
37
|
+
aria-label="Close modal"
|
|
38
|
+
@click="close"
|
|
39
|
+
autofocus
|
|
40
|
+
>
|
|
35
41
|
<slot name="closeIcon">
|
|
36
42
|
<UluIcon
|
|
37
43
|
class="modal__close-icon"
|
|
@@ -171,7 +177,9 @@
|
|
|
171
177
|
*/
|
|
172
178
|
classes: {
|
|
173
179
|
type: Object,
|
|
174
|
-
default: () => ({
|
|
180
|
+
default: () => ({
|
|
181
|
+
close: "button button--icon"
|
|
182
|
+
})
|
|
175
183
|
},
|
|
176
184
|
/**
|
|
177
185
|
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
package/lib/utils/router.js
CHANGED
|
@@ -277,29 +277,35 @@ export function $createSectionMenu(route, options) {
|
|
|
277
277
|
*/
|
|
278
278
|
export function $createBreadcrumb(route) {
|
|
279
279
|
const { matched, path: currentPath } = route;
|
|
280
|
-
let prevPath;
|
|
281
280
|
|
|
282
|
-
const
|
|
281
|
+
const filteredMatched = matched.reduce((acc, match) => {
|
|
283
282
|
if (match.meta?.breadcrumb === false) {
|
|
284
|
-
return
|
|
283
|
+
return acc;
|
|
285
284
|
}
|
|
286
285
|
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
const prevMatch = acc[acc.length - 1];
|
|
287
|
+
if (prevMatch && prevMatch.path === match.path) {
|
|
288
|
+
return acc;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
acc.push(match);
|
|
292
|
+
return acc;
|
|
293
|
+
}, []);
|
|
294
|
+
|
|
295
|
+
const crumbs = filteredMatched.map((match, index) => {
|
|
296
|
+
const isLast = index === filteredMatched.length - 1;
|
|
297
|
+
const title = getRouteTitle(match, route);
|
|
298
|
+
|
|
299
|
+
if (!title) {
|
|
300
|
+
console.warn("Missing route title");
|
|
301
|
+
}
|
|
293
302
|
|
|
294
|
-
|
|
295
|
-
title,
|
|
303
|
+
return {
|
|
304
|
+
title: title || "Missing Title",
|
|
296
305
|
to: { path: isLast ? currentPath : match.path },
|
|
297
306
|
current: isLast,
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
prevPath = match.path;
|
|
301
|
-
return arr;
|
|
302
|
-
}, []);
|
|
307
|
+
};
|
|
308
|
+
});
|
|
303
309
|
|
|
304
310
|
return crumbs;
|
|
305
311
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend-vue",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.8",
|
|
4
4
|
"description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -32,9 +32,7 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "storybook dev -p 6006",
|
|
34
34
|
"docs:build": "storybook build -o docs",
|
|
35
|
-
"build": "vite build",
|
|
36
|
-
"types_TRASH": "vue-tsc",
|
|
37
|
-
"deploy_TRASH": "rm -rf dist && npm run types && npm run build && npm run docs:build",
|
|
35
|
+
"build": "vite build --config library.vite.config.js",
|
|
38
36
|
"deploy": "npm run build && npm run docs:build",
|
|
39
37
|
"update-contexts": "rm -rf .ctx && mkdir -p .ctx/frontend && cp -R node_modules/@ulu/frontend/lib/scss node_modules/@ulu/frontend/lib/js .ctx/frontend/"
|
|
40
38
|
},
|