@ulu/frontend-vue 0.6.29 → 0.6.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"AAsEA;wBA07BqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAbjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4OAUG"}
1
+ {"version":3,"file":"UluModal.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluModal.vue"],"names":[],"mappings":"AAuEA;wBA47BqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAbjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4OAUG"}
@@ -1,10 +1,10 @@
1
- import { useSlots as J, ref as n, computed as u, watch as M, nextTick as w, onMounted as K, onBeforeUnmount as Q, createBlock as F, openBlock as d, Teleport as Z, createElementVNode as f, withModifiers as x, normalizeStyle as H, normalizeClass as r, unref as L, createElementBlock as C, createCommentVNode as g, renderSlot as m, toDisplayString as ee, createVNode as T } from "vue";
1
+ import { useSlots as G, ref as n, computed as c, watch as M, nextTick as w, onMounted as J, onBeforeUnmount as K, createBlock as F, openBlock as u, Teleport as Q, createElementVNode as d, mergeProps as Z, unref as H, withModifiers as x, createElementBlock as C, createCommentVNode as g, normalizeClass as f, renderSlot as m, toDisplayString as ee, createVNode as L, normalizeStyle as le } from "vue";
2
2
  import R from "../elements/UluIcon.vue.js";
3
- import { useModifiers as le } from "../../composables/useModifiers.js";
4
- import { preventScroll as oe, wasClickOutside as te } from "@ulu/utils/browser/dom.js";
5
- import { getSoleIframeLayout as se, youtubePrepVideos as ie, youtubePauseVideos as ae, Resizer as ne, observeDialogToggle as re } from "@ulu/frontend";
6
- import { newId as ce } from "../../utils/dom.js";
7
- const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "modal__title-text" }, pe = {
3
+ import { useModifiers as oe } from "../../composables/useModifiers.js";
4
+ import { preventScroll as te, wasClickOutside as se } from "@ulu/utils/browser/dom.js";
5
+ import { getSoleIframeLayout as ie, youtubePrepVideos as ae, youtubePauseVideos as ne, Resizer as re, observeDialogToggle as ce } from "@ulu/frontend";
6
+ import { newId as ue } from "../../utils/dom.js";
7
+ const de = ["aria-labelledby", "aria-describedby"], fe = ["id"], me = { class: "modal__title-text" }, he = {
8
8
  __name: "UluModal",
9
9
  props: {
10
10
  /**
@@ -128,21 +128,21 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
128
128
  noPauseVideos: Boolean
129
129
  },
130
130
  emits: ["update:modelValue", "close", "open"],
131
- setup(t, { emit: j }) {
132
- const c = j, e = t, D = J(), N = n(null), E = ce("ulu-modal-title"), B = n(!1), o = n(null), O = n(null), k = n(null), i = n({
131
+ setup(t, { emit: T }) {
132
+ const r = T, e = t, j = G(), D = n(null), E = ue("ulu-modal-title"), B = n(!1), o = n(null), $ = n(null), k = n(null), i = n({
133
133
  isStaticSize: !1,
134
134
  isFill: !1,
135
135
  bodyStyle: {}
136
- }), $ = u(() => e.title || D.title), v = u(() => {
136
+ }), O = c(() => e.title || j.title), v = c(() => {
137
137
  const { allowResize: l, position: s } = e;
138
138
  if (!l || !s) return !1;
139
139
  const h = ["left", "right", "center"];
140
140
  return h.includes(s) ? !0 : (console.warn(`Passed invalid position for resize (${s}), use ${h.join(", ")}`), !1);
141
- }), _ = u(() => e.position === "center" ? "type:resizeBoth" : "type:resizeHorizontal"), A = u(() => ({
141
+ }), N = c(() => e.position === "center" ? "type:resizeBoth" : "type:resizeHorizontal"), A = c(() => ({
142
142
  [e.position]: e.position,
143
143
  resize: e.allowResize,
144
144
  "no-resize": !e.allowResize,
145
- "no-header": !$.value,
145
+ "no-header": !O.value,
146
146
  "body-fills": e.bodyFills,
147
147
  "no-backdrop": e.noBackdrop,
148
148
  "no-min-height": e.noMinHeight,
@@ -152,33 +152,33 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
152
152
  "fullscreen-mobile": e.fullscreenMobile,
153
153
  "frame-ratio": i.value.isStaticSize,
154
154
  "frame-fill": i.value.isFill
155
- })), { resolvedModifiers: U } = le({
155
+ })), { resolvedModifiers: U } = oe({
156
156
  props: e,
157
157
  baseClass: "modal",
158
158
  internal: A
159
- }), X = u(() => e.labelledby ? e.labelledby : E), a = () => {
160
- c("update:modelValue", !1), c("close");
161
- }, q = () => {
162
- e.modelValue && (c("update:modelValue", !1), c("close"));
163
- }, W = (l) => {
159
+ }), X = c(() => e.labelledby ? e.labelledby : E), a = () => {
160
+ r("update:modelValue", !1), r("close");
161
+ }, _ = () => {
162
+ e.modelValue && (r("update:modelValue", !1), r("close"));
163
+ }, q = (l) => {
164
164
  if (e.clickOutsideCloses && !B.value) {
165
165
  const { target: s } = l;
166
- s === o.value && te(o.value, l) && a();
166
+ s === o.value && se(o.value, l) && a();
167
167
  }
168
168
  };
169
169
  let y = null, b = null, S = null, z = null, p = null;
170
- const Y = () => {
171
- !e.nonModal && e.preventScroll && (y = re(o.value, (l) => {
172
- l ? b = oe({ preventShift: e.preventScrollShift }) : P();
170
+ const W = () => {
171
+ !e.nonModal && e.preventScroll && (y = ce(o.value, (l) => {
172
+ l ? b = te({ preventShift: e.preventScrollShift }) : P();
173
173
  }));
174
- }, G = () => {
174
+ }, Y = () => {
175
175
  y && (y.destroy(), y = null);
176
176
  }, P = () => {
177
177
  b && (b(), b = null);
178
178
  }, I = () => {
179
179
  if (v.value) {
180
180
  const l = e.position === "center" ? { fromX: "right", fromY: "bottom", multiplier: 2 } : { fromX: e.position === "right" ? "left" : "right" };
181
- S = new ne(o.value, O.value, l), z = () => {
181
+ S = new re(o.value, $.value, l), z = () => {
182
182
  B.value = !0;
183
183
  }, p = () => {
184
184
  setTimeout(() => {
@@ -194,12 +194,12 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
194
194
  if (o.value)
195
195
  if (l) {
196
196
  if (e.autoIframe && k.value) {
197
- const s = se(k.value);
197
+ const s = ie(k.value);
198
198
  s && (s.iframe.classList.add("modal__frame-content"), s.isStaticSize ? (i.value.isStaticSize = !0, i.value.isFill = !1, i.value.bodyStyle = { aspectRatio: s.aspectRatio }) : (i.value.isFill = !0, i.value.isStaticSize = !1, i.value.bodyStyle = s.fillHeight ? { minHeight: s.fillHeight } : {}));
199
199
  }
200
- e.noPauseVideos || ie(o.value), o.value[e.nonModal ? "show" : "showModal"](), c("open");
200
+ e.noPauseVideos || ae(o.value), o.value[e.nonModal ? "show" : "showModal"](), r("open");
201
201
  } else
202
- e.noPauseVideos || (ae(o.value), o.value.querySelectorAll("video").forEach((h) => h.pause())), o.value.close(), i.value = { isStaticSize: !1, isFill: !1, bodyStyle: {} };
202
+ e.noPauseVideos || (ne(o.value), o.value.querySelectorAll("video").forEach((h) => h.pause())), o.value.close(), i.value = { isStaticSize: !1, isFill: !1, bodyStyle: {} };
203
203
  });
204
204
  }, { immediate: !0 }), M(v, (l) => {
205
205
  l ? w(() => {
@@ -209,88 +209,89 @@ const ue = ["aria-labelledby", "aria-describedby"], de = ["id"], fe = { class: "
209
209
  l !== s && (V(), w(() => {
210
210
  I();
211
211
  }));
212
+ }), J(() => {
213
+ W(), I();
212
214
  }), K(() => {
213
- Y(), I();
214
- }), Q(() => {
215
- o.value && o.value.open && o.value.close(), G(), P(), V();
216
- }), (l, s) => (d(), F(Z, {
215
+ o.value && o.value.open && o.value.close(), Y(), P(), V();
216
+ }), (l, s) => (u(), F(Q, {
217
217
  to: t.teleport === !1 ? null : t.teleport,
218
218
  disabled: t.teleport === !1
219
219
  }, [
220
- f("dialog", {
221
- class: r(["modal", [L(U), t.classes.container]]),
220
+ d("dialog", Z({
221
+ class: ["modal", [H(U), t.classes.container]],
222
222
  "aria-labelledby": X.value,
223
223
  "aria-describedby": t.describedby,
224
224
  ref_key: "container",
225
225
  ref: o,
226
- style: H({ width: N.value }),
226
+ style: { width: D.value }
227
+ }, l.$attrs, {
227
228
  onCancel: x(a, ["prevent"]),
228
- onClose: q,
229
- onClick: W
230
- }, [
231
- $.value ? (d(), C("header", {
229
+ onClose: _,
230
+ onClick: q
231
+ }), [
232
+ O.value ? (u(), C("header", {
232
233
  key: 0,
233
- class: r(["modal__header", t.classes.header])
234
+ class: f(["modal__header", t.classes.header])
234
235
  }, [
235
- f("h2", {
236
- class: r(["modal__title", t.classes.title]),
237
- id: L(E)
236
+ d("h2", {
237
+ class: f(["modal__title", t.classes.title]),
238
+ id: H(E)
238
239
  }, [
239
240
  m(l.$slots, "title", { close: a }, () => [
240
- t.titleIcon ? (d(), F(R, {
241
+ t.titleIcon ? (u(), F(R, {
241
242
  key: 0,
242
243
  class: "modal__title-icon",
243
244
  icon: t.titleIcon
244
245
  }, null, 8, ["icon"])) : g("", !0),
245
- f("span", fe, ee(t.title), 1)
246
+ d("span", me, ee(t.title), 1)
246
247
  ])
247
- ], 10, de),
248
- f("button", {
249
- class: r(["modal__close", t.classes.close]),
248
+ ], 10, fe),
249
+ d("button", {
250
+ class: f(["modal__close", t.classes.close]),
250
251
  "aria-label": "Close modal",
251
252
  onClick: a,
252
253
  autofocus: ""
253
254
  }, [
254
255
  m(l.$slots, "closeIcon", {}, () => [
255
- T(R, {
256
+ L(R, {
256
257
  class: "modal__close-icon",
257
258
  icon: t.closeIcon || "type:close"
258
259
  }, null, 8, ["icon"])
259
260
  ])
260
261
  ], 2)
261
262
  ], 2)) : g("", !0),
262
- f("div", {
263
- class: r(["modal__body", t.classes.body]),
264
- style: H(i.value.bodyStyle),
263
+ d("div", {
264
+ class: f(["modal__body", t.classes.body]),
265
+ style: le(i.value.bodyStyle),
265
266
  ref_key: "body",
266
267
  ref: k
267
268
  }, [
268
269
  m(l.$slots, "default", { close: a })
269
270
  ], 6),
270
- l.$slots.footer ? (d(), C("div", {
271
+ l.$slots.footer ? (u(), C("div", {
271
272
  key: 1,
272
- class: r(["modal__footer", t.classes.footer])
273
+ class: f(["modal__footer", t.classes.footer])
273
274
  }, [
274
275
  m(l.$slots, "footer", { close: a })
275
276
  ], 2)) : g("", !0),
276
- v.value ? (d(), C("button", {
277
+ v.value ? (u(), C("button", {
277
278
  key: 2,
278
279
  class: "modal__resizer",
279
280
  ref_key: "resizer",
280
- ref: O,
281
+ ref: $,
281
282
  type: "button"
282
283
  }, [
283
284
  m(l.$slots, "resizerIcon", {}, () => [
284
- T(R, {
285
+ L(R, {
285
286
  class: "modal__resizer-icon",
286
- icon: t.resizerIcon || _.value
287
+ icon: t.resizerIcon || N.value
287
288
  }, null, 8, ["icon"])
288
289
  ])
289
290
  ], 512)) : g("", !0)
290
- ], 46, ue)
291
+ ], 16, de)
291
292
  ], 8, ["to", "disabled"]));
292
293
  }
293
294
  };
294
295
  export {
295
- pe as default
296
+ he as default
296
297
  };