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.
- package/dist/components/BT-Dialog-Confirm.vue.mjs +46 -35
- package/dist/components/BT-Dialog-Date.vue.mjs +32 -31
- package/dist/composables/dialog-items.d.ts +14 -0
- package/dist/composables/dialog-items.mjs +12 -0
- package/dist/composables.mjs +183 -182
- package/dist/index.mjs +227 -226
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,63 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { registerDialog as
|
|
3
|
-
import { VDialog as
|
|
4
|
-
import { VCard as
|
|
5
|
-
import { VBtn as
|
|
6
|
-
const
|
|
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(
|
|
9
|
-
const a =
|
|
8
|
+
setup(w) {
|
|
9
|
+
const a = n(!1), l = n({});
|
|
10
10
|
let r;
|
|
11
|
-
const
|
|
11
|
+
const c = T({
|
|
12
12
|
dialogType: "confirm",
|
|
13
|
-
open: (e,
|
|
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?"),
|
|
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
|
|
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
|
|
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
|
|
32
|
-
|
|
33
|
-
}), (e,
|
|
34
|
-
"max-width":
|
|
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":
|
|
37
|
+
"onUpdate:modelValue": t[2] || (t[2] = (C) => a.value = C)
|
|
37
38
|
}, {
|
|
38
|
-
default:
|
|
39
|
-
|
|
40
|
-
subtitle:
|
|
41
|
-
text:
|
|
42
|
-
title:
|
|
43
|
-
}, {
|
|
44
|
-
actions:
|
|
45
|
-
|
|
46
|
-
onClick:
|
|
47
|
-
text:
|
|
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
|
-
|
|
50
|
-
onClick:
|
|
51
|
-
text:
|
|
50
|
+
i(u(v), {
|
|
51
|
+
onClick: t[1] || (t[1] = () => x()),
|
|
52
|
+
text: l.value.confirmText
|
|
52
53
|
}, null, 8, ["text"])
|
|
53
54
|
]),
|
|
54
|
-
_:
|
|
55
|
-
},
|
|
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
|
-
|
|
73
|
+
O as default
|
|
63
74
|
};
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { registerDialog as
|
|
3
|
-
import { VDialog as
|
|
4
|
-
import { VCard as
|
|
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
|
|
6
|
+
const U = /* @__PURE__ */ C({
|
|
7
7
|
__name: "BT-Dialog-Date",
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
const o =
|
|
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,
|
|
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
|
|
18
|
-
|
|
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:
|
|
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
|
-
}),
|
|
24
|
+
}), r.value = !1;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function x() {
|
|
27
|
+
u != null && u({
|
|
28
28
|
isCancelled: !0,
|
|
29
29
|
isConfirmed: !1,
|
|
30
30
|
isError: !1
|
|
31
|
-
}),
|
|
31
|
+
}), r.value = !1;
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return V(() => {
|
|
34
34
|
o();
|
|
35
35
|
}), (e, a) => {
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const s = T("bt-date");
|
|
37
|
+
return w(), b(m(y), {
|
|
38
38
|
"max-width": l.value.maxWidth,
|
|
39
|
-
modelValue:
|
|
40
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
39
|
+
modelValue: r.value,
|
|
40
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => r.value = n)
|
|
41
41
|
}, {
|
|
42
42
|
default: i(() => [
|
|
43
|
-
d(m(
|
|
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(
|
|
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:
|
|
59
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
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] = () =>
|
|
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] = () =>
|
|
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
|
-
|
|
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
|