@wssto2/vue-core 0.17.0 → 0.19.0

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/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.17.0";
2
+ export declare const version = "0.19.0";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.17.0";
1
+ const o = "0.19.0";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -0,0 +1,62 @@
1
+ import { shallowRef as c, defineComponent as p, useTemplateRef as u, watch as f, openBlock as d, createBlock as m, unref as a, withCtx as v, renderSlot as k, createCommentVNode as _ } from "vue";
2
+ import { useI18n as h } from "vue-i18n";
3
+ import { _ as b } from "./Modal.vue_vue_type_script_setup_true_lang-CZ7WrDwu.js";
4
+ function P() {
5
+ const o = c({ open: !1, options: null });
6
+ let e = null;
7
+ function l(t) {
8
+ const s = e;
9
+ e = null, o.value = { open: !1, options: o.value.options }, s?.(t);
10
+ }
11
+ return {
12
+ state: o,
13
+ pick(...[t]) {
14
+ return e?.(null), new Promise((s) => {
15
+ e = s, o.value = { open: !0, options: t ?? {} };
16
+ });
17
+ },
18
+ select: (t) => l(t),
19
+ cancel: () => l(null)
20
+ };
21
+ }
22
+ const R = /* @__PURE__ */ p({
23
+ __name: "PickerModal",
24
+ props: {
25
+ picker: {},
26
+ title: { default: void 0 },
27
+ description: { default: void 0 },
28
+ size: { default: "lg" }
29
+ },
30
+ setup(o) {
31
+ const e = o, { t: l } = h(), t = u("modal");
32
+ let s = !1, i = !1;
33
+ f(() => e.picker.state.value.open, (n) => {
34
+ n ? (s = !0, t.value?.present()) : s && (i = !0, t.value?.dismiss());
35
+ }, { flush: "post" });
36
+ function r() {
37
+ s = !1, i ? i = !1 : e.picker.cancel();
38
+ }
39
+ return (n, g) => (d(), m(a(b), {
40
+ ref_key: "modal",
41
+ ref: t,
42
+ title: e.picker.state.value.options?.title ?? e.title ?? a(l)("core.collection.pick_label"),
43
+ subtitle: e.picker.state.value.options?.description ?? e.description,
44
+ size: e.size,
45
+ grouped: "",
46
+ onDismissed: r
47
+ }, {
48
+ default: v(() => [
49
+ e.picker.state.value.options ? k(n.$slots, "default", {
50
+ options: e.picker.state.value.options,
51
+ select: e.picker.select
52
+ }, void 0, void 0, 0) : _("", !0)
53
+ ]),
54
+ _: 3
55
+ }, 8, ["title", "subtitle", "size"]));
56
+ }
57
+ }), x = (o, e) => o.thumbnail.replace("{id}", encodeURIComponent(String(e)));
58
+ export {
59
+ R as _,
60
+ P as c,
61
+ x as t
62
+ };