bt-core-app 2.2.32 → 2.2.34

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,63 +1,74 @@
1
- import { defineComponent as C, ref as m, onUnmounted as g, openBlock as o, createBlock as D, unref as u, withCtx as i, createVNode as f } from "vue";
2
- import { registerDialog as V } from "../composables/dialog-items.mjs";
3
- import { VDialog as s } from "../bt-core/core/node_modules/vuetify/lib/components/VDialog/VDialog.mjs";
4
- import { VCard as T } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
5
- import { VBtn as n } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
6
- const y = /* @__PURE__ */ C({
1
+ import { defineComponent as g, ref as n, onUnmounted as D, openBlock as f, createBlock as d, unref as u, withCtx as m, createVNode as i, createSlots as s, resolveDynamicComponent as V } from "vue";
2
+ import { registerDialog as T } from "../composables/dialog-items.mjs";
3
+ import { VDialog as k } from "../bt-core/core/node_modules/vuetify/lib/components/VDialog/VDialog.mjs";
4
+ import { VCard as h } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
5
+ import { VBtn as v } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
6
+ const O = /* @__PURE__ */ g({
7
7
  __name: "BT-Dialog-Confirm",
8
- setup(h) {
9
- const a = m(!1), t = m({});
8
+ setup(w) {
9
+ const a = n(!1), l = n({});
10
10
  let r;
11
- const x = V({
11
+ const c = T({
12
12
  dialogType: "confirm",
13
- open: (e, l) => {
14
- e.height ?? (e.height = "65vh"), e.maxWidth ?? (e.maxWidth = "350px"), e.cancelText ?? (e.cancelText = "Cancel"), e.confirmText ?? (e.confirmText = "Confirm"), e.text ?? (e.text = "Are you sure?"), t.value = e, a.value = !0, r = l;
13
+ open: (e, t) => {
14
+ e.height ?? (e.height = "65vh"), e.maxWidth ?? (e.maxWidth = "350px"), e.cancelText ?? (e.cancelText = "Cancel"), e.confirmText ?? (e.confirmText = "Confirm"), e.itemComponent == null && (e.text ?? (e.text = "Are you sure?")), l.value = e, a.value = !0, r = t;
15
15
  }
16
16
  });
17
- function d() {
17
+ function x() {
18
18
  r != null && r({
19
19
  isCancelled: !1,
20
20
  isConfirmed: !0,
21
- isError: !1
21
+ isError: !1,
22
+ result: l.value.item
22
23
  }), a.value = !1;
23
24
  }
24
- function c() {
25
+ function o() {
25
26
  r != null && r({
26
27
  isCancelled: !0,
27
28
  isConfirmed: !1,
28
29
  isError: !1
29
30
  }), a.value = !1;
30
31
  }
31
- return g(() => {
32
- x();
33
- }), (e, l) => (o(), D(u(s), {
34
- "max-width": t.value.maxWidth,
32
+ return D(() => {
33
+ c();
34
+ }), (e, t) => (f(), d(u(k), {
35
+ "max-width": l.value.maxWidth,
35
36
  modelValue: a.value,
36
- "onUpdate:modelValue": l[2] || (l[2] = (v) => a.value = v)
37
+ "onUpdate:modelValue": t[2] || (t[2] = (C) => a.value = C)
37
38
  }, {
38
- default: i(() => [
39
- f(u(T), {
40
- subtitle: t.value.subtitle,
41
- text: t.value.text,
42
- title: t.value.title
43
- }, {
44
- actions: i(() => [
45
- f(u(n), {
46
- onClick: l[0] || (l[0] = () => c()),
47
- text: t.value.cancelText
39
+ default: m(() => [
40
+ i(u(h), {
41
+ subtitle: l.value.subtitle,
42
+ text: l.value.text,
43
+ title: l.value.title
44
+ }, s({
45
+ actions: m(() => [
46
+ i(u(v), {
47
+ onClick: t[0] || (t[0] = () => o()),
48
+ text: l.value.cancelText
48
49
  }, null, 8, ["text"]),
49
- f(u(n), {
50
- onClick: l[1] || (l[1] = () => d()),
51
- text: t.value.confirmText
50
+ i(u(v), {
51
+ onClick: t[1] || (t[1] = () => x()),
52
+ text: l.value.confirmText
52
53
  }, null, 8, ["text"])
53
54
  ]),
54
- _: 1
55
- }, 8, ["subtitle", "text", "title"])
55
+ _: 2
56
+ }, [
57
+ l.value.itemComponent != null ? {
58
+ name: "default",
59
+ fn: m(() => [
60
+ (f(), d(V(l.value.itemComponent), {
61
+ item: l.value.item
62
+ }, null, 8, ["item"]))
63
+ ]),
64
+ key: "0"
65
+ } : void 0
66
+ ]), 1032, ["subtitle", "text", "title"])
56
67
  ]),
57
68
  _: 1
58
69
  }, 8, ["max-width", "modelValue"]));
59
70
  }
60
71
  });
61
72
  export {
62
- y as default
73
+ O as default
63
74
  };
@@ -1,52 +1,52 @@
1
- import { defineComponent as s, ref as n, onUnmounted as D, resolveComponent as C, openBlock as V, createBlock as T, unref as m, withCtx as i, createVNode as d } from "vue";
2
- import { registerDialog as w } from "../composables/dialog-items.mjs";
3
- import { VDialog as b } from "../bt-core/core/node_modules/vuetify/lib/components/VDialog/VDialog.mjs";
4
- import { VCard as h } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
1
+ import { defineComponent as C, ref as f, computed as D, onUnmounted as V, resolveComponent as T, openBlock as w, createBlock as b, unref as m, withCtx as i, createVNode as d } from "vue";
2
+ import { registerDialog as h } from "../composables/dialog-items.mjs";
3
+ import { VDialog as y } from "../bt-core/core/node_modules/vuetify/lib/components/VDialog/VDialog.mjs";
4
+ import { VCard as B } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
5
5
  import { VBtn as v } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
6
- const F = /* @__PURE__ */ s({
6
+ const U = /* @__PURE__ */ C({
7
7
  __name: "BT-Dialog-Date",
8
- setup(y) {
9
- const t = n(!1), l = n({}), u = n();
10
- let r;
11
- const o = w({
8
+ setup(_) {
9
+ const r = f(!1), l = f({}), t = f();
10
+ let u;
11
+ const o = h({
12
12
  dialogType: "date",
13
13
  open: (e, a) => {
14
- e.format ?? (e.format = "ccc dd/LL/yyyy"), e.height ?? (e.height = "65vh"), e.maxWidth ?? (e.maxWidth = "300px"), e.cancelText ?? (e.cancelText = "Cancel"), e.confirmText ?? (e.confirmText = "Confirm"), e.range ?? (e.range = !1), l.value = e, t.value = !0, r = a, u.value = e.startingDate;
14
+ e.format ?? (e.format = "ccc dd/LL/yyyy"), e.height ?? (e.height = "65vh"), e.maxWidth ?? (e.maxWidth = "300px"), e.cancelText ?? (e.cancelText = "Cancel"), e.confirmText ?? (e.confirmText = "Confirm"), e.range ?? (e.range = !1), l.value = e, r.value = !0, u = a, t.value = e.startingDate;
15
15
  }
16
- });
17
- function c() {
18
- r != null && r({
16
+ }), c = D(() => l.value.range ? Array.isArray(t.value) && t.value.length == 2 : t.value != null);
17
+ function g() {
18
+ u != null && u({
19
19
  isCancelled: !1,
20
20
  isConfirmed: !0,
21
21
  isError: !1,
22
- result: u.value
22
+ result: t.value
23
23
  // dateOptions.value.range !== false ? (isArrayOfLength(mSelected.value, 0) ? undefined : mSelected.value) : mSelected.value //(isLengthyArray(mSelected.value) ? mSelected.value[0] : undefined)
24
- }), t.value = !1;
24
+ }), r.value = !1;
25
25
  }
26
- function g() {
27
- r != null && r({
26
+ function x() {
27
+ u != null && u({
28
28
  isCancelled: !0,
29
29
  isConfirmed: !1,
30
30
  isError: !1
31
- }), t.value = !1;
31
+ }), r.value = !1;
32
32
  }
33
- return D(() => {
33
+ return V(() => {
34
34
  o();
35
35
  }), (e, a) => {
36
- const x = C("bt-date");
37
- return V(), T(m(b), {
36
+ const s = T("bt-date");
37
+ return w(), b(m(y), {
38
38
  "max-width": l.value.maxWidth,
39
- modelValue: t.value,
40
- "onUpdate:modelValue": a[3] || (a[3] = (f) => t.value = f)
39
+ modelValue: r.value,
40
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => r.value = n)
41
41
  }, {
42
42
  default: i(() => [
43
- d(m(h), {
43
+ d(m(B), {
44
44
  subtitle: l.value.subtitle,
45
45
  text: l.value.text,
46
46
  title: l.value.title
47
47
  }, {
48
48
  default: i(() => [
49
- d(x, {
49
+ d(s, {
50
50
  dateFrom: l.value.dateFrom,
51
51
  dateRules: l.value.dateRules,
52
52
  format: l.value.format,
@@ -55,19 +55,20 @@ const F = /* @__PURE__ */ s({
55
55
  range: l.value.range,
56
56
  startingDate: l.value.startingDate,
57
57
  useTime: l.value.useTime,
58
- modelValue: u.value,
59
- "onUpdate:modelValue": a[0] || (a[0] = (f) => u.value = f)
58
+ modelValue: t.value,
59
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => t.value = n)
60
60
  }, null, 8, ["dateFrom", "dateRules", "format", "fromNow", "horizontal", "range", "startingDate", "useTime", "modelValue"])
61
61
  ]),
62
62
  actions: i(() => [
63
63
  d(m(v), {
64
- onClick: a[1] || (a[1] = () => g()),
64
+ onClick: a[1] || (a[1] = () => x()),
65
65
  text: l.value.cancelText
66
66
  }, null, 8, ["text"]),
67
67
  d(m(v), {
68
- onClick: a[2] || (a[2] = () => c()),
68
+ onClick: a[2] || (a[2] = () => g()),
69
+ disabled: !c.value,
69
70
  text: l.value.confirmText
70
- }, null, 8, ["text"])
71
+ }, null, 8, ["disabled", "text"])
71
72
  ]),
72
73
  _: 1
73
74
  }, 8, ["subtitle", "text", "title"])
@@ -78,5 +79,5 @@ const F = /* @__PURE__ */ s({
78
79
  }
79
80
  });
80
81
  export {
81
- F as default
82
+ U as default
82
83
  };
@@ -110,9 +110,23 @@ export interface UseDialogConfirmOptions {
110
110
  cancelText?: string;
111
111
  confirmText?: string;
112
112
  height?: string;
113
+ item?: any;
114
+ itemComponent?: any;
113
115
  maxWidth?: string;
114
116
  subtitle?: string;
115
117
  text?: string;
116
118
  title?: string;
117
119
  }
118
120
  export declare function useDialogConfirm(options: UseDialogConfirmOptions): Promise<DialogReturn<string>>;
121
+ export interface UseDialogItemOptions {
122
+ cancelText?: string;
123
+ confirmText?: string;
124
+ height?: string;
125
+ item?: any;
126
+ itemComponent?: any;
127
+ maxWidth?: string;
128
+ subtitle?: string;
129
+ text?: string;
130
+ title?: string;
131
+ }
132
+ export declare function useDialogItem<T>(options: UseDialogConfirmOptions): Promise<DialogReturn<T>>;
@@ -62,10 +62,22 @@ function d(s) {
62
62
  o.open(s, e);
63
63
  });
64
64
  }
65
+ function u(s) {
66
+ const o = i == null ? void 0 : i.options.find((e) => e.dialogType == "confirm");
67
+ return o == null ? Promise.resolve({
68
+ isError: !0,
69
+ isCancelled: !1,
70
+ isConfirmed: !1,
71
+ result: void 0
72
+ }) : new Promise((e) => {
73
+ o.open(s, e);
74
+ });
75
+ }
65
76
  export {
66
77
  n as registerDialog,
67
78
  d as useDialogConfirm,
68
79
  l as useDialogDate,
80
+ u as useDialogItem,
69
81
  t as useDialogNumber,
70
82
  r as useDialogSelect,
71
83
  f as useDialogString