bt-core-app 2.2.28 → 2.2.30
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,28 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNested as
|
|
3
|
-
import { registerDialog as
|
|
1
|
+
import { defineComponent as w, ref as h, computed as T, onUnmounted as N, resolveComponent as O, openBlock as n, createBlock as v, unref as l, withCtx as r, createVNode as u, createElementBlock as C, createTextVNode as B, toDisplayString as E, withModifiers as V, createCommentVNode as f, createElementVNode as R, createSlots as F, Fragment as U, renderList as W, resolveDynamicComponent as G } from "vue";
|
|
2
|
+
import { useNested as Y } from "../composables/nested.mjs";
|
|
3
|
+
import { registerDialog as j } from "../composables/dialog-items.mjs";
|
|
4
4
|
import { useList as A } from "../composables/list.mjs";
|
|
5
|
-
import { isLengthyArray as
|
|
6
|
-
import
|
|
7
|
-
import { VDialog as
|
|
8
|
-
import { VCard as
|
|
9
|
-
import { VCardTitle as
|
|
10
|
-
import { VSpacer as
|
|
5
|
+
import { isLengthyArray as _, isArrayOfLength as q } from "../composables/helpers.mjs";
|
|
6
|
+
import z from "./BT-Loader.vue.mjs";
|
|
7
|
+
import { VDialog as H } from "../bt-core/core/node_modules/vuetify/lib/components/VDialog/VDialog.mjs";
|
|
8
|
+
import { VCard as I } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCard.mjs";
|
|
9
|
+
import { VCardTitle as J } from "../bt-core/core/node_modules/vuetify/lib/components/VCard/VCardTitle.mjs";
|
|
10
|
+
import { VSpacer as K } from "../bt-core/core/node_modules/vuetify/lib/components/VGrid/VSpacer.mjs";
|
|
11
11
|
import { VBtn as x } from "../bt-core/core/node_modules/vuetify/lib/components/VBtn/VBtn.mjs";
|
|
12
|
-
import { VTextField as
|
|
13
|
-
import { VList as
|
|
14
|
-
import { VSlideYTransition as
|
|
15
|
-
import { VListItem as
|
|
16
|
-
import { VListItemTitle as
|
|
17
|
-
import { VListItemSubtitle as
|
|
18
|
-
const
|
|
12
|
+
import { VTextField as Q } from "../bt-core/core/node_modules/vuetify/lib/components/VTextField/VTextField.mjs";
|
|
13
|
+
import { VList as X } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VList.mjs";
|
|
14
|
+
import { VSlideYTransition as Z } from "../bt-core/core/node_modules/vuetify/lib/components/transitions/index.mjs";
|
|
15
|
+
import { VListItem as ee } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItem.mjs";
|
|
16
|
+
import { VListItemTitle as te } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItemTitle.mjs";
|
|
17
|
+
import { VListItemSubtitle as le } from "../bt-core/core/node_modules/vuetify/lib/components/VList/VListItemSubtitle.mjs";
|
|
18
|
+
const ie = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "d-flex align-center"
|
|
21
|
-
},
|
|
21
|
+
}, ae = { class: "d-flex align-center" }, ue = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "w-100"
|
|
24
|
+
}, be = /* @__PURE__ */ w({
|
|
22
25
|
__name: "BT-Dialog-Select",
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
let d,
|
|
26
|
+
setup(re) {
|
|
27
|
+
const c = h(!1), e = h({}), s = h([]), { getValue: y } = Y();
|
|
28
|
+
let d, o = A(e.value);
|
|
26
29
|
const S = T(() => ({
|
|
27
30
|
itemText: e.value.itemTitle,
|
|
28
31
|
prefix: e.value.itemTitlePrefix,
|
|
@@ -40,7 +43,7 @@ const le = {
|
|
|
40
43
|
value: e.value.itemSubtitleProp ?? e.value.itemSubtitle
|
|
41
44
|
};
|
|
42
45
|
return t.itemText != null || t.textFilter != null || t.textFunction != null || t.value != null ? t : void 0;
|
|
43
|
-
}),
|
|
46
|
+
}), k = T(() => {
|
|
44
47
|
let t = {
|
|
45
48
|
itemText: e.value.itemActionTitle,
|
|
46
49
|
prefix: e.value.itemActionPrefix,
|
|
@@ -50,26 +53,26 @@ const le = {
|
|
|
50
53
|
value: e.value.itemActionProp ?? e.value.itemActionTitle
|
|
51
54
|
};
|
|
52
55
|
return t.itemText != null || t.textFilter != null || t.textFunction != null || t.value != null ? t : void 0;
|
|
53
|
-
}),
|
|
56
|
+
}), D = j({
|
|
54
57
|
dialogType: "items",
|
|
55
58
|
open: (t, a) => {
|
|
56
59
|
t.height ?? (t.height = "65vh"), t.maxWidth ?? (t.maxWidth = "350px"), t.cancelText ?? (t.cancelText = "Cancel"), t.confirmText ?? (t.confirmText = "Confirm"), t.onDisabled ?? (t.onDisabled = () => !1), e.value = t;
|
|
57
|
-
const
|
|
60
|
+
const m = t.selector ?? ((i) => i.id);
|
|
58
61
|
t.onGetSuccessAsync = async (i) => {
|
|
59
62
|
if (t.selected != null)
|
|
60
63
|
if (Array.isArray(t.selected))
|
|
61
|
-
|
|
64
|
+
s.value = i.data.filter((p) => {
|
|
62
65
|
var g;
|
|
63
|
-
return (g = t.selected) == null ? void 0 : g.some((M) =>
|
|
66
|
+
return (g = t.selected) == null ? void 0 : g.some((M) => m(M) == m(p));
|
|
64
67
|
});
|
|
65
68
|
else {
|
|
66
|
-
const p = i.data.filter((g) =>
|
|
67
|
-
p != null && (
|
|
69
|
+
const p = i.data.filter((g) => m(g) == m(t.selected));
|
|
70
|
+
p != null && (s.value = [p]);
|
|
68
71
|
}
|
|
69
72
|
else
|
|
70
|
-
|
|
73
|
+
s.value = [];
|
|
71
74
|
return i;
|
|
72
|
-
},
|
|
75
|
+
}, o = A(t, void 0, { isNotSetup: !0 }), o.refresh({ deepRefresh: t.refresh }), c.value = !0, d = a;
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
78
|
function L(t) {
|
|
@@ -81,7 +84,7 @@ const le = {
|
|
|
81
84
|
isConfirmed: !0,
|
|
82
85
|
isError: !1,
|
|
83
86
|
result: t.value == !0 ? t.id : void 0
|
|
84
|
-
}),
|
|
87
|
+
}), c.value = !1;
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
function P() {
|
|
@@ -89,61 +92,61 @@ const le = {
|
|
|
89
92
|
isCancelled: !1,
|
|
90
93
|
isConfirmed: !0,
|
|
91
94
|
isError: !1,
|
|
92
|
-
result: e.value.selectMode == "single" &&
|
|
93
|
-
}),
|
|
95
|
+
result: e.value.selectMode == "single" && q(s.value, 0) ? void 0 : s.value
|
|
96
|
+
}), c.value = !1;
|
|
94
97
|
}
|
|
95
98
|
function $() {
|
|
96
99
|
d != null && d({
|
|
97
100
|
isCancelled: !0,
|
|
98
101
|
isConfirmed: !1,
|
|
99
102
|
isError: !1
|
|
100
|
-
}),
|
|
103
|
+
}), c.value = !1;
|
|
101
104
|
}
|
|
102
|
-
return
|
|
103
|
-
|
|
105
|
+
return N(() => {
|
|
106
|
+
D();
|
|
104
107
|
}), (t, a) => {
|
|
105
|
-
const
|
|
106
|
-
return
|
|
108
|
+
const m = O("bt-header-option");
|
|
109
|
+
return n(), v(l(H), {
|
|
107
110
|
"max-width": e.value.maxWidth,
|
|
108
|
-
modelValue:
|
|
109
|
-
"onUpdate:modelValue": a[7] || (a[7] = (i) =>
|
|
111
|
+
modelValue: c.value,
|
|
112
|
+
"onUpdate:modelValue": a[7] || (a[7] = (i) => c.value = i)
|
|
110
113
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
|
|
114
|
+
default: r(() => [
|
|
115
|
+
u(l(I), {
|
|
113
116
|
subtitle: e.value.subtitle,
|
|
114
117
|
text: e.value.text
|
|
115
118
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
e.value.title != null ? (
|
|
118
|
-
|
|
119
|
-
default:
|
|
119
|
+
default: r(() => [
|
|
120
|
+
e.value.title != null ? (n(), C("div", ie, [
|
|
121
|
+
u(l(J), null, {
|
|
122
|
+
default: r(() => [
|
|
120
123
|
B(E(e.value.title), 1)
|
|
121
124
|
]),
|
|
122
125
|
_: 1
|
|
123
126
|
}),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
onClick: a[0] || (a[0] = V((i) => l(
|
|
127
|
+
u(l(K)),
|
|
128
|
+
u(l(x), {
|
|
129
|
+
onClick: a[0] || (a[0] = V((i) => l(o).refresh({ deepRefresh: !0 }), ["stop"])),
|
|
127
130
|
icon: "$refresh",
|
|
128
131
|
title: "Refresh list",
|
|
129
132
|
variant: "text"
|
|
130
133
|
})
|
|
131
134
|
])) : f("", !0),
|
|
132
|
-
R("div",
|
|
133
|
-
l(
|
|
135
|
+
R("div", ae, [
|
|
136
|
+
l(_)(e.value.searchProps) ? (n(), v(l(Q), {
|
|
134
137
|
key: 0,
|
|
135
138
|
autofocus: "",
|
|
136
139
|
clearable: "",
|
|
137
140
|
"hide-details": "",
|
|
138
141
|
placeholder: "Search",
|
|
139
|
-
modelValue: l(
|
|
140
|
-
"onUpdate:modelValue": a[2] || (a[2] = (i) => l(
|
|
141
|
-
},
|
|
142
|
+
modelValue: l(o).searchString.value,
|
|
143
|
+
"onUpdate:modelValue": a[2] || (a[2] = (i) => l(o).searchString.value = i)
|
|
144
|
+
}, F({ _: 2 }, [
|
|
142
145
|
e.value.title == null ? {
|
|
143
146
|
name: "append-inner",
|
|
144
|
-
fn:
|
|
145
|
-
|
|
146
|
-
onClick: a[1] || (a[1] = V((i) => l(
|
|
147
|
+
fn: r(() => [
|
|
148
|
+
u(l(x), {
|
|
149
|
+
onClick: a[1] || (a[1] = V((i) => l(o).refresh({ deepRefresh: !0 }), ["stop"])),
|
|
147
150
|
icon: "$refresh",
|
|
148
151
|
title: "Refresh list",
|
|
149
152
|
variant: "text"
|
|
@@ -152,61 +155,66 @@ const le = {
|
|
|
152
155
|
key: "0"
|
|
153
156
|
} : void 0
|
|
154
157
|
]), 1032, ["modelValue"])) : f("", !0),
|
|
155
|
-
!l(
|
|
158
|
+
!l(_)(e.value.searchProps) && e.value.title == null ? (n(), v(l(x), {
|
|
156
159
|
key: 1,
|
|
157
|
-
onClick: a[3] || (a[3] = V((i) => l(
|
|
160
|
+
onClick: a[3] || (a[3] = V((i) => l(o).refresh({ deepRefresh: !0 }), ["stop"])),
|
|
158
161
|
icon: "$refresh",
|
|
159
162
|
title: "Refresh list",
|
|
160
163
|
variant: "text"
|
|
161
164
|
})) : f("", !0)
|
|
162
165
|
]),
|
|
163
|
-
|
|
166
|
+
u(l(X), {
|
|
164
167
|
"onClick:select": L,
|
|
165
168
|
height: e.value.height,
|
|
166
169
|
lines: e.value.lines,
|
|
167
170
|
"open-strategy": "multiple",
|
|
168
171
|
"select-strategy": e.value.selectMode == "multi" ? "classic" : "single-independent",
|
|
169
|
-
selected:
|
|
170
|
-
"onUpdate:selected": a[4] || (a[4] = (i) =>
|
|
172
|
+
selected: s.value,
|
|
173
|
+
"onUpdate:selected": a[4] || (a[4] = (i) => s.value = i)
|
|
171
174
|
}, {
|
|
172
|
-
default:
|
|
173
|
-
|
|
175
|
+
default: r(() => [
|
|
176
|
+
u(l(Z), {
|
|
174
177
|
group: "",
|
|
175
178
|
"hide-on-leave": ""
|
|
176
179
|
}, {
|
|
177
|
-
default:
|
|
178
|
-
(
|
|
179
|
-
key: `${i.id ?? l(
|
|
180
|
-
value: l(
|
|
180
|
+
default: r(() => [
|
|
181
|
+
(n(!0), C(U, null, W(l(o).filteredItems.value, (i) => (n(), v(l(ee), {
|
|
182
|
+
key: `${i.id ?? l(y)(i, e.value.itemValue)}-table-list-item`,
|
|
183
|
+
value: l(y)(i, e.value.itemValue),
|
|
181
184
|
disabled: e.value.onDisabled(i)
|
|
182
|
-
},
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
185
|
+
}, F({
|
|
186
|
+
default: r(() => [
|
|
187
|
+
e.value.itemComponent != null ? (n(), v(G(e.value.itemComponent), {
|
|
188
|
+
key: 0,
|
|
189
|
+
item: i
|
|
190
|
+
}, null, 8, ["item"])) : (n(), C("div", ue, [
|
|
191
|
+
S.value != null ? (n(), v(l(te), { key: 0 }, {
|
|
192
|
+
default: r(() => [
|
|
193
|
+
u(m, {
|
|
194
|
+
option: S.value,
|
|
195
|
+
data: i
|
|
196
|
+
}, null, 8, ["option", "data"])
|
|
197
|
+
]),
|
|
198
|
+
_: 2
|
|
199
|
+
}, 1024)) : f("", !0),
|
|
200
|
+
b.value != null ? (n(), v(l(le), { key: 1 }, {
|
|
201
|
+
default: r(() => [
|
|
202
|
+
u(m, {
|
|
203
|
+
option: b.value,
|
|
204
|
+
data: i
|
|
205
|
+
}, null, 8, ["option", "data"])
|
|
206
|
+
]),
|
|
207
|
+
_: 2
|
|
208
|
+
}, 1024)) : f("", !0)
|
|
209
|
+
]))
|
|
202
210
|
]),
|
|
203
211
|
_: 2
|
|
204
212
|
}, [
|
|
205
|
-
|
|
213
|
+
e.value.itemComponent == null && k.value != null ? {
|
|
206
214
|
name: "append",
|
|
207
|
-
fn:
|
|
208
|
-
|
|
209
|
-
option:
|
|
215
|
+
fn: r(() => [
|
|
216
|
+
u(m, {
|
|
217
|
+
option: k.value,
|
|
210
218
|
data: i
|
|
211
219
|
}, null, 8, ["option", "data"])
|
|
212
220
|
]),
|
|
@@ -219,16 +227,16 @@ const le = {
|
|
|
219
227
|
]),
|
|
220
228
|
_: 1
|
|
221
229
|
}, 8, ["height", "lines", "select-strategy", "selected"]),
|
|
222
|
-
|
|
223
|
-
loadingMsg: l(
|
|
230
|
+
u(z, {
|
|
231
|
+
loadingMsg: l(o).loadingMsg.value
|
|
224
232
|
}, null, 8, ["loadingMsg"])
|
|
225
233
|
]),
|
|
226
|
-
actions:
|
|
227
|
-
|
|
234
|
+
actions: r(() => [
|
|
235
|
+
u(l(x), {
|
|
228
236
|
onClick: a[5] || (a[5] = () => $()),
|
|
229
237
|
text: e.value.cancelText
|
|
230
238
|
}, null, 8, ["text"]),
|
|
231
|
-
|
|
239
|
+
u(l(x), {
|
|
232
240
|
onClick: a[6] || (a[6] = () => P()),
|
|
233
241
|
text: e.value.confirmText
|
|
234
242
|
}, null, 8, ["text"])
|
|
@@ -242,5 +250,5 @@ const le = {
|
|
|
242
250
|
}
|
|
243
251
|
});
|
|
244
252
|
export {
|
|
245
|
-
|
|
253
|
+
be as default
|
|
246
254
|
};
|