@fewangsit/wangsvue-fats 1.0.1-alpha.68 → 1.0.1-alpha.69
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/animation/index.es.js +9 -8
- package/assetinfo/index.d.ts +5 -4
- package/assetinfo/index.es.js +113 -97
- package/backgroundimagecropper/index.es.js +14 -12
- package/button/index.es.js +58 -48
- package/buttonbulkaction/index.es.js +67 -59
- package/buttondownload/index.es.js +18 -18
- package/buttonradio/index.es.js +11 -11
- package/buttonscan/index.es.js +1 -1
- package/buttonsearch/index.es.js +14 -14
- package/buttonselectuser/index.es.js +29 -29
- package/checkbox/index.es.js +5 -5
- package/config/defaultProps.es.js +3 -4
- package/datatable/index.es.js +470 -465
- package/datepicker/index.es.js +17 -17
- package/daypicker/index.es.js +21 -21
- package/dialog/index.es.js +17 -15
- package/dialogbasictransferlog/index.es.js +89 -89
- package/dialogconfirm/index.es.js +33 -33
- package/dialogdamagelog/index.es.js +89 -89
- package/dialogform/index.es.js +16 -16
- package/dialogfulltransferlog/index.es.js +96 -96
- package/dialoglinkedasset/index.es.js +48 -48
- package/dialogprintqr/index.es.js +70 -70
- package/dialogreportdamage/index.es.js +57 -57
- package/dialogreportmissing/index.es.js +94 -86
- package/dialogselecttree/index.es.js +18 -16
- package/dialogselectuser/index.es.js +16 -16
- package/directives/index.d.ts +1 -0
- package/directives/index.es.js +1 -0
- package/directives/safeHtml.d.ts +16 -0
- package/directives/safeHtml.es.js +12 -0
- package/disposalreport/index.es.js +1 -1
- package/disposalreportbulkaction/index.es.js +40 -41
- package/disposalreportdialogselectasset/index.es.js +72 -72
- package/disposalreporttable/index.es.js +108 -108
- package/disposalreporttablefilter/index.es.js +16 -17
- package/dropdown/index.es.js +120 -117
- package/fieldwrapper/index.es.js +7 -7
- package/fileupload/index.es.js +35 -31
- package/hardwaresync/index.es.js +12 -12
- package/headercell/index.es.js +4 -4
- package/icon/index.es.js +26 -25
- package/imagecompressor/index.es.js +143 -143
- package/imageinputinfo/index.es.js +13 -13
- package/inlinemessage/index.es.js +12 -12
- package/inputbadge/index.es.js +42 -43
- package/inputnumber/index.es.js +7 -7
- package/inputpassword/index.es.js +9 -9
- package/inputrangenumber/index.es.js +16 -16
- package/inputsearch/index.es.js +18 -18
- package/inputtext/index.es.js +33 -33
- package/litedropdown/index.es.js +48 -40
- package/menuitem/index.es.js +27 -26
- package/multirow/index.es.js +16 -16
- package/multiselect/index.es.js +86 -83
- package/package.json +1 -1
- package/plugins/basei18n.d.ts +2 -2
- package/plugins/basei18n.es.js +48 -42
- package/stats.html +1 -1
- package/style.css +1 -1
- package/tabmenu/index.es.js +14 -9
- package/tagtype/index.es.js +33 -30
- package/textarea/index.es.js +3 -3
- package/toggledarkmode/store/index.d.ts +7 -0
- package/toggleswitch/index.es.js +3 -3
- package/treesearchinput/index.es.js +11 -11
- package/username/index.es.js +39 -39
- package/utils/baseToast.util.es.js +23 -22
- package/utils/index.es.js +1 -2
- package/utils/textFormatter.util.d.ts +32 -0
- package/utils/textFormatter.util.es.js +38 -10
- package/validatormessage/index.es.js +1 -1
- package/vendor/dompurify/dist/purify.es.es.js +553 -0
- package/wangsvue-fats.d.ts +2 -1
- package/wangsvue-fats.es.js +190 -186
- package/wangsvue-fats.esm.browser.js +17750 -17086
- package/wangsvue-fats.system.js +73 -72
package/dropdown/index.es.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { s as
|
|
9
|
-
import {
|
|
10
|
-
import { _ as
|
|
1
|
+
import { defineComponent as le, onMounted as oe, computed as u, inject as I, ref as ae, shallowRef as T, reactive as te, watch as w, createBlock as m, openBlock as s, withCtx as r, createVNode as d, normalizeClass as ie, createCommentVNode as j, unref as i, renderSlot as p, mergeProps as D, createSlots as re, normalizeProps as v, guardReactiveProps as c, createElementVNode as ne, toDisplayString as k, createElementBlock as E, Fragment as R, createTextVNode as K, nextTick as se } from "vue";
|
|
2
|
+
import { u as de } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
|
+
import { u as ue } from "../plugins/basei18n.es.js";
|
|
4
|
+
import { u as pe } from "../plugins/WangsVue.es.js";
|
|
5
|
+
import { f as fe } from "../utils/filterOptions.util.es.js";
|
|
6
|
+
import { m as me } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
7
|
+
import { a as ve } from "../utils/textFormatter.util.es.js";
|
|
8
|
+
import { s as ce } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
|
|
9
|
+
import { s as z } from "../vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js";
|
|
10
|
+
import { _ as ge } from "../badge/index.es.js";
|
|
11
|
+
import { _ as ye } from "../fieldwrapper/index.es.js";
|
|
11
12
|
import { _ as B } from "../icon/index.es.js";
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { i as
|
|
15
|
-
import { c as
|
|
16
|
-
const
|
|
13
|
+
import { _ as be } from "../inputgroup/index.es.js";
|
|
14
|
+
import { _ as Ve } from "../validatormessage/index.es.js";
|
|
15
|
+
import { i as F } from "../vendor/lodash-es/isEqual.es.js";
|
|
16
|
+
import { c as W } from "../vendor/lodash-es/cloneDeep.es.js";
|
|
17
|
+
const Ee = /* @__PURE__ */ le({
|
|
17
18
|
__name: "Dropdown",
|
|
18
19
|
props: {
|
|
19
20
|
modelValue: { type: [String, Number, Boolean, Object], default: void 0 },
|
|
@@ -44,124 +45,126 @@ const Te = /* @__PURE__ */ ee({
|
|
|
44
45
|
panelMaxContent: { type: Boolean, default: !1 }
|
|
45
46
|
},
|
|
46
47
|
emits: ["update:modelValue", "show", "fieldInfoClick"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
setup(q, { expose: A, emit: G }) {
|
|
49
|
+
const l = q, O = G;
|
|
50
|
+
oe(() => {
|
|
51
|
+
Y();
|
|
51
52
|
});
|
|
52
|
-
const { locale: f, defaultProps:
|
|
53
|
+
const { t: M } = ue(), { locale: f, defaultProps: H } = pe("Dropdown"), U = u(() => me(l, H)), n = I("preset", {}).dropdown, J = I(
|
|
53
54
|
"preset",
|
|
54
55
|
{}
|
|
55
|
-
).inputgroupaddon, g =
|
|
56
|
-
value:
|
|
57
|
-
}),
|
|
58
|
-
var
|
|
59
|
-
return f.emptySelectionErrorMessage.replace("{label}",
|
|
56
|
+
).inputgroupaddon, g = ae(), y = T(!1), b = T(!1), C = u(() => l.invalid || !!o.errorMessage), o = te({
|
|
57
|
+
value: l.initialValue !== void 0 ? l.initialValue : l.modelValue
|
|
58
|
+
}), Q = u(() => {
|
|
59
|
+
var e;
|
|
60
|
+
return f.emptySelectionErrorMessage.replace("{label}", l.label).replace(
|
|
60
61
|
"{formattedLabel}",
|
|
61
|
-
(
|
|
62
|
+
(e = ve(l.label)) == null ? void 0 : e.toLowerCase()
|
|
62
63
|
);
|
|
63
|
-
}), V = u(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
e.
|
|
64
|
+
}), V = u(
|
|
65
|
+
() => fe(l.options).map((e) => typeof e == "string" ? M(e) : { ...e, label: M(e.label) })
|
|
66
|
+
), X = u(() => {
|
|
67
|
+
var e;
|
|
68
|
+
return l.loading ? f.loadingPlaceholder : l.placeholder ?? ((e = f.inputPlaceholder) == null ? void 0 : e.replace("{label}", l.label ?? "").replace("{lowercaseLabel}", (l.label ?? "").toLowerCase()));
|
|
69
|
+
}), Y = () => {
|
|
70
|
+
l.useValidator && (Object.assign(
|
|
68
71
|
o,
|
|
69
|
-
|
|
70
|
-
),
|
|
71
|
-
},
|
|
72
|
-
const { value: a } =
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
72
|
+
de(l.fieldName ?? "dropdown", (e) => !(e != null && e !== "") && l.mandatory ? typeof l.validatorMessage == "object" && "empty" in l.validatorMessage ? l.validatorMessage.empty : l.validatorMessage ?? Q.value : se(Z))
|
|
73
|
+
), l.initialValue !== void 0 && (o.value = l.initialValue), l.invalid && o.validate());
|
|
74
|
+
}, Z = () => l.validatorMessage && l.invalid ? l.validatorMessage : !0, _ = (e) => {
|
|
75
|
+
const { value: a } = e;
|
|
76
|
+
l.unselectOnReselect ? b.value = !0 : O("update:modelValue", a);
|
|
77
|
+
}, $ = () => {
|
|
78
|
+
if (l.optionValue) {
|
|
79
|
+
const e = V.value.find((a) => {
|
|
77
80
|
if (typeof a != "string")
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
return l.dataKey ? o.value[l.dataKey] === a[l.optionValue ?? ""][l.dataKey] : F(
|
|
82
|
+
W(a[l.optionValue ?? ""]),
|
|
83
|
+
W(o.value)
|
|
81
84
|
);
|
|
82
85
|
});
|
|
83
|
-
if (
|
|
84
|
-
return l
|
|
85
|
-
} else if (o.value && typeof o.value == "object" &&
|
|
86
|
-
return o.value[
|
|
86
|
+
if (e && typeof e != "string")
|
|
87
|
+
return e[l.optionLabel ?? ""];
|
|
88
|
+
} else if (o.value && typeof o.value == "object" && l.optionLabel && l.optionLabel in o.value)
|
|
89
|
+
return o.value[l.optionLabel];
|
|
87
90
|
return o.value;
|
|
88
|
-
},
|
|
91
|
+
}, x = () => {
|
|
89
92
|
g.value && g.value.show();
|
|
90
93
|
};
|
|
91
|
-
return
|
|
92
|
-
() =>
|
|
93
|
-
(
|
|
94
|
-
o.value =
|
|
94
|
+
return w(
|
|
95
|
+
() => l.initialValue,
|
|
96
|
+
(e) => {
|
|
97
|
+
o.value = e;
|
|
95
98
|
},
|
|
96
99
|
{ once: !0 }
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
99
|
-
(
|
|
100
|
-
o.value =
|
|
100
|
+
), w(
|
|
101
|
+
() => l.modelValue,
|
|
102
|
+
(e) => {
|
|
103
|
+
o.value = e;
|
|
101
104
|
}
|
|
102
|
-
),
|
|
105
|
+
), w(
|
|
103
106
|
() => o.value,
|
|
104
|
-
(
|
|
107
|
+
(e, a) => {
|
|
105
108
|
setTimeout(() => {
|
|
106
|
-
|
|
109
|
+
l.unselectOnReselect && b.value && (F(e, a) && e !== void 0 && (o.value = void 0), b.value = !1, O("update:modelValue", o.value));
|
|
107
110
|
}, 0);
|
|
108
111
|
}
|
|
109
|
-
),
|
|
110
|
-
showOverlay:
|
|
111
|
-
}), (
|
|
112
|
-
info:
|
|
113
|
-
label:
|
|
114
|
-
mandatory:
|
|
115
|
-
"show-optional-text":
|
|
116
|
-
onInfoClick: a[3] || (a[3] = (
|
|
112
|
+
), A({
|
|
113
|
+
showOverlay: x
|
|
114
|
+
}), (e, a) => (s(), m(ye, {
|
|
115
|
+
info: e.fieldInfo,
|
|
116
|
+
label: l.label,
|
|
117
|
+
mandatory: l.mandatory,
|
|
118
|
+
"show-optional-text": e.showOptionalText,
|
|
119
|
+
onInfoClick: a[3] || (a[3] = (h) => e.$emit("fieldInfoClick"))
|
|
117
120
|
}, {
|
|
118
121
|
default: r(() => [
|
|
119
|
-
d(
|
|
120
|
-
class:
|
|
122
|
+
d(be, {
|
|
123
|
+
class: ie([
|
|
121
124
|
{
|
|
122
|
-
"grid grid-cols-[max-content,1fr,max-content]":
|
|
123
|
-
"grid grid-cols-[1fr,max-content]": !
|
|
124
|
-
"grid grid-cols-[max-content,1fr]":
|
|
125
|
+
"grid grid-cols-[max-content,1fr,max-content]": e.$slots["addon-left"] && e.$slots["addon-right"],
|
|
126
|
+
"grid grid-cols-[1fr,max-content]": !e.$slots["addon-left"] && e.$slots["addon-right"],
|
|
127
|
+
"grid grid-cols-[max-content,1fr]": e.$slots["addon-left"] && !e.$slots["addon-right"]
|
|
125
128
|
}
|
|
126
129
|
]),
|
|
127
|
-
disabled:
|
|
128
|
-
invalid:
|
|
129
|
-
ring:
|
|
130
|
+
disabled: l.disabled,
|
|
131
|
+
invalid: C.value,
|
|
132
|
+
ring: e.inputBorder
|
|
130
133
|
}, {
|
|
131
134
|
default: r(() => {
|
|
132
|
-
var
|
|
135
|
+
var h, S, P, L, N;
|
|
133
136
|
return [
|
|
134
|
-
|
|
137
|
+
e.$slots["addon-left"] ? (s(), m(i(z), {
|
|
135
138
|
key: 0,
|
|
136
|
-
disabled:
|
|
139
|
+
disabled: l.disabled
|
|
137
140
|
}, {
|
|
138
141
|
default: r(() => [
|
|
139
|
-
p(
|
|
142
|
+
p(e.$slots, "addon-left")
|
|
140
143
|
]),
|
|
141
144
|
_: 3
|
|
142
|
-
}, 8, ["disabled"])) :
|
|
143
|
-
d(i(
|
|
145
|
+
}, 8, ["disabled"])) : j("", !0),
|
|
146
|
+
d(i(ce), D({
|
|
144
147
|
ref_key: "dropdown",
|
|
145
148
|
ref: g
|
|
146
|
-
},
|
|
149
|
+
}, l, {
|
|
147
150
|
modelValue: o.value,
|
|
148
151
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => o.value = t),
|
|
149
|
-
"aria-describedby":
|
|
150
|
-
"filter-placeholder": e.filterPlaceholder || i(f).filterPlaceholder,
|
|
151
|
-
invalid:
|
|
152
|
+
"aria-describedby": l.label + "error",
|
|
153
|
+
"filter-placeholder": e.$t(l.filterPlaceholder || i(f).filterPlaceholder),
|
|
154
|
+
invalid: C.value,
|
|
152
155
|
options: V.value,
|
|
153
|
-
placeholder:
|
|
156
|
+
placeholder: e.$t(X.value),
|
|
154
157
|
pt: {
|
|
155
|
-
list: (
|
|
156
|
-
panel: (
|
|
157
|
-
virtualScroller: (
|
|
158
|
-
wrapper: (
|
|
158
|
+
list: (h = i(n)) == null ? void 0 : h.list({ props: l }),
|
|
159
|
+
panel: (S = i(n)) == null ? void 0 : S.panel({ props: l }),
|
|
160
|
+
virtualScroller: (P = i(n)) == null ? void 0 : P.virtualScroller({ props: l }),
|
|
161
|
+
wrapper: (L = i(n)) == null ? void 0 : L.wrapper({ props: l })
|
|
159
162
|
},
|
|
160
|
-
"virtual-scroller-options": ((
|
|
161
|
-
onChange:
|
|
163
|
+
"virtual-scroller-options": ((N = V.value) == null ? void 0 : N.length) > 10 ? { itemSize: 32 } : void 0,
|
|
164
|
+
onChange: _,
|
|
162
165
|
onHide: a[1] || (a[1] = (t) => y.value = !1),
|
|
163
|
-
onShow: a[2] || (a[2] = (t) => (
|
|
164
|
-
}),
|
|
166
|
+
onShow: a[2] || (a[2] = (t) => (e.$emit("show"), y.value = !0))
|
|
167
|
+
}), re({
|
|
165
168
|
dropdownicon: r(() => [
|
|
166
169
|
d(B, v(c(i(n).dropdownicon({ state: { isShowOverlay: y.value } }))), null, 16)
|
|
167
170
|
]),
|
|
@@ -173,57 +176,57 @@ const Te = /* @__PURE__ */ ee({
|
|
|
173
176
|
]),
|
|
174
177
|
_: 2
|
|
175
178
|
}, [
|
|
176
|
-
|
|
179
|
+
e.loading ? {
|
|
177
180
|
name: "value",
|
|
178
181
|
fn: r(({ placeholder: t }) => [
|
|
179
|
-
|
|
182
|
+
ne("span", v(c(i(n).loadingplaceholder)), k(e.$t(t)), 17)
|
|
180
183
|
]),
|
|
181
184
|
key: "0"
|
|
182
185
|
} : {
|
|
183
186
|
name: "value",
|
|
184
187
|
fn: r((t) => [
|
|
185
|
-
(
|
|
188
|
+
(U.value.allowNullOption ? t.value !== void 0 : t.value != null) ? p(e.$slots, "value", {
|
|
186
189
|
key: 0,
|
|
187
190
|
originalValue: t.value,
|
|
188
|
-
value:
|
|
191
|
+
value: e.$t($())
|
|
189
192
|
}, () => [
|
|
190
|
-
|
|
191
|
-
label:
|
|
192
|
-
}), null, 16, ["label"])) : (s(),
|
|
193
|
-
|
|
193
|
+
e.valueType === "badge" ? (s(), m(ge, D({ key: 0 }, e.badgeValueProps, {
|
|
194
|
+
label: e.$t($())
|
|
195
|
+
}), null, 16, ["label"])) : (s(), E(R, { key: 1 }, [
|
|
196
|
+
K(k(e.$t($())), 1)
|
|
194
197
|
], 64))
|
|
195
|
-
]) : (s(),
|
|
196
|
-
|
|
198
|
+
]) : (s(), E(R, { key: 1 }, [
|
|
199
|
+
K(k(e.$t(t.placeholder)), 1)
|
|
197
200
|
], 64))
|
|
198
201
|
]),
|
|
199
202
|
key: "1"
|
|
200
203
|
},
|
|
201
|
-
|
|
204
|
+
e.$slots.option ? {
|
|
202
205
|
name: "option",
|
|
203
206
|
fn: r(({ option: t }) => [
|
|
204
|
-
p(
|
|
207
|
+
p(e.$slots, "option", { option: t })
|
|
205
208
|
]),
|
|
206
209
|
key: "2"
|
|
207
210
|
} : void 0,
|
|
208
|
-
|
|
211
|
+
e.$slots.footer ? {
|
|
209
212
|
name: "footer",
|
|
210
|
-
fn: r(({ value: t, options:
|
|
211
|
-
p(
|
|
212
|
-
options:
|
|
213
|
+
fn: r(({ value: t, options: ee }) => [
|
|
214
|
+
p(e.$slots, "footer", {
|
|
215
|
+
options: ee,
|
|
213
216
|
value: t
|
|
214
217
|
})
|
|
215
218
|
]),
|
|
216
219
|
key: "3"
|
|
217
220
|
} : void 0
|
|
218
221
|
]), 1040, ["modelValue", "aria-describedby", "filter-placeholder", "invalid", "options", "placeholder", "pt", "virtual-scroller-options"]),
|
|
219
|
-
|
|
222
|
+
e.$slots["addon-right"] ? (s(), m(i(z), {
|
|
220
223
|
key: 1,
|
|
221
224
|
pt: {
|
|
222
|
-
root: i(
|
|
225
|
+
root: i(J).root({
|
|
223
226
|
props: {
|
|
224
227
|
class: [
|
|
225
228
|
{
|
|
226
|
-
"!text-general-200":
|
|
229
|
+
"!text-general-200": l.disabled
|
|
227
230
|
}
|
|
228
231
|
]
|
|
229
232
|
}
|
|
@@ -231,16 +234,16 @@ const Te = /* @__PURE__ */ ee({
|
|
|
231
234
|
}
|
|
232
235
|
}, {
|
|
233
236
|
default: r(() => [
|
|
234
|
-
p(
|
|
237
|
+
p(e.$slots, "addon-right")
|
|
235
238
|
]),
|
|
236
239
|
_: 3
|
|
237
|
-
}, 8, ["pt"])) :
|
|
240
|
+
}, 8, ["pt"])) : j("", !0)
|
|
238
241
|
];
|
|
239
242
|
}),
|
|
240
243
|
_: 3
|
|
241
244
|
}, 8, ["class", "disabled", "invalid", "ring"]),
|
|
242
|
-
d(
|
|
243
|
-
id:
|
|
245
|
+
d(Ve, {
|
|
246
|
+
id: l.label + "error",
|
|
244
247
|
message: o.errorMessage
|
|
245
248
|
}, null, 8, ["id", "message"])
|
|
246
249
|
]),
|
|
@@ -249,5 +252,5 @@ const Te = /* @__PURE__ */ ee({
|
|
|
249
252
|
}
|
|
250
253
|
});
|
|
251
254
|
export {
|
|
252
|
-
|
|
255
|
+
Ee as _
|
|
253
256
|
};
|
package/fieldwrapper/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, useSlots as b, computed as w, createElementBlock as l, renderSlot as p, openBlock as o, normalizeProps as t, mergeProps as r, createCommentVNode as a, Fragment as g, createTextVNode as v, createBlock as C, toDisplayString as i, unref as u } from "vue";
|
|
2
2
|
import { u as B } from "../plugins/WangsVue.es.js";
|
|
3
3
|
import { m as P } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
4
4
|
import { _ as h } from "../icon/index.es.js";
|
|
5
|
-
const
|
|
5
|
+
const V = /* @__PURE__ */ y({
|
|
6
6
|
__name: "FieldWrapper",
|
|
7
7
|
props: {
|
|
8
8
|
label: {},
|
|
@@ -15,19 +15,19 @@ const T = /* @__PURE__ */ $({
|
|
|
15
15
|
},
|
|
16
16
|
emits: ["infoClick"],
|
|
17
17
|
setup(k) {
|
|
18
|
-
const n = k, f = b(), { defaultProps:
|
|
18
|
+
const n = k, f = b(), { defaultProps: $, locale: d } = B("FieldWrapper"), s = w(() => P(n, $));
|
|
19
19
|
return (e, m) => e.$attrs["use-field-wrapper"] != !1 ? (o(), l("div", t(r({ key: 0 }, e.$preset.fieldwrapper.root)), [
|
|
20
20
|
e.label || f["label-addon"] ? (o(), l("label", t(r({ key: 0 }, e.$preset.fieldwrapper.label({ props: n, slots: f }))), [
|
|
21
21
|
e.label ? (o(), l(g, { key: 0 }, [
|
|
22
|
-
v(i(e.label) + " ", 1),
|
|
23
|
-
e.mandatory && s.value.showAsterisk ? (o(), l("span", t(r({ key: 0 }, e.$preset.fieldwrapper.arterisksign)), i(u(d).labelRequired), 17)) : a("", !0),
|
|
22
|
+
v(i(e.$t(e.label)) + " ", 1),
|
|
23
|
+
e.mandatory && s.value.showAsterisk ? (o(), l("span", t(r({ key: 0 }, e.$preset.fieldwrapper.arterisksign)), i(e.$t(u(d).labelRequired)), 17)) : a("", !0),
|
|
24
24
|
e.info ? (o(), C(h, r({
|
|
25
25
|
key: 1,
|
|
26
26
|
info: e.info,
|
|
27
27
|
"tooltip-pos": s.value.tooltipPos,
|
|
28
28
|
onClick: m[0] || (m[0] = (W) => e.$emit("infoClick"))
|
|
29
29
|
}, e.$preset.fieldwrapper.info, { icon: "info" }), null, 16, ["info", "tooltip-pos"])) : a("", !0),
|
|
30
|
-
e.mandatory == !1 && s.value.showOptionalText ? (o(), l("span", t(r({ key: 2 }, e.$preset.fieldwrapper.optionaltext)), i(u(d).labelOptional), 17)) : a("", !0)
|
|
30
|
+
e.mandatory == !1 && s.value.showOptionalText ? (o(), l("span", t(r({ key: 2 }, e.$preset.fieldwrapper.optionaltext)), i(e.$t(u(d).labelOptional)), 17)) : a("", !0)
|
|
31
31
|
], 64)) : a("", !0),
|
|
32
32
|
p(e.$slots, "label-addon")
|
|
33
33
|
], 16)) : a("", !0),
|
|
@@ -36,5 +36,5 @@ const T = /* @__PURE__ */ $({
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
V as _
|
|
40
40
|
};
|
package/fileupload/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as D, mergeModels as
|
|
1
|
+
import { defineComponent as D, mergeModels as U, useModel as G, inject as Y, shallowRef as g, ref as z, reactive as H, computed as Z, onMounted as J, watch as k, createBlock as A, openBlock as f, unref as m, mergeProps as y, withCtx as M, createTextVNode as b, toDisplayString as h, createElementVNode as C, normalizeClass as B, createVNode as w, createCommentVNode as x, createElementBlock as F, withModifiers as Q, normalizeProps as W, Fragment as N } from "vue";
|
|
2
2
|
import { u as X } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
3
|
import { u as ee } from "../utils/baseToast.util.es.js";
|
|
4
4
|
import { s as ae } from "../vendor/primevue/fileupload/fileupload.esm.es.js";
|
|
@@ -8,7 +8,7 @@ import { _ as ie } from "../button/index.es.js";
|
|
|
8
8
|
import { _ as oe } from "../validatormessage/index.es.js";
|
|
9
9
|
const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-general-100'" }, re = 1048576, ge = /* @__PURE__ */ D({
|
|
10
10
|
__name: "FileUpload",
|
|
11
|
-
props: /* @__PURE__ */
|
|
11
|
+
props: /* @__PURE__ */ U({
|
|
12
12
|
accept: {},
|
|
13
13
|
disabled: { type: Boolean },
|
|
14
14
|
maxFileSize: {},
|
|
@@ -33,9 +33,9 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
33
33
|
modelValue: {},
|
|
34
34
|
modelModifiers: {}
|
|
35
35
|
}),
|
|
36
|
-
emits: /* @__PURE__ */
|
|
37
|
-
setup(
|
|
38
|
-
const V = ee(), r = G(
|
|
36
|
+
emits: /* @__PURE__ */ U(["select", "update:modelValue", "upload", "error"], ["update:modelValue"]),
|
|
37
|
+
setup(S, { emit: R }) {
|
|
38
|
+
const V = ee(), r = G(S, "modelValue"), a = S, E = R, { fileupload: c = {} } = Y("preset", {}), i = g(), t = g(), o = g(), _ = z(), n = H({ value: void 0 }), q = Z(() => !!n.errorMessage || (u.value ? u.value.length > 0 : !1)), d = g(!1);
|
|
39
39
|
J(() => {
|
|
40
40
|
a.useValidator && Object.assign(
|
|
41
41
|
n,
|
|
@@ -61,11 +61,11 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
61
61
|
try {
|
|
62
62
|
if (!e.files || e.files.length === 0)
|
|
63
63
|
return;
|
|
64
|
-
a.multiple ? (o.value = e.files, i.value = e.files.map((s) => s.name),
|
|
64
|
+
a.multiple ? (o.value = e.files, i.value = e.files.map((s) => s.name), E("select", e.files)) : (o.value = e.files[0], i.value = (l = e.files[0]) == null ? void 0 : l.name, E("select", e.files[0]));
|
|
65
65
|
} catch (s) {
|
|
66
66
|
console.error(s);
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, T = (e, l) => {
|
|
69
69
|
a.disabled || d.value || (u.value = void 0, new Promise((s, p) => {
|
|
70
70
|
try {
|
|
71
71
|
l(), s();
|
|
@@ -84,16 +84,16 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
84
84
|
}, u = z(), P = (e) => {
|
|
85
85
|
u.value = e;
|
|
86
86
|
}, K = (e, l, s) => {
|
|
87
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
87
|
+
(e.key === "Enter" || e.key === " ") && T(l, s);
|
|
88
88
|
};
|
|
89
|
-
return
|
|
89
|
+
return k(o, (e) => {
|
|
90
90
|
n.value = e, r.value = e, u.value = void 0, t.value = void 0;
|
|
91
|
-
}),
|
|
92
|
-
Array.isArray(e) && a.multiple ? (o.value = e, i.value = e.map((l) => l.name)) : e instanceof File ? (o.value = e, i.value = e.name) : (o.value = void 0, i.value = void 0), n.value = e, "messages" in
|
|
93
|
-
}),
|
|
91
|
+
}), k(r, (e) => {
|
|
92
|
+
Array.isArray(e) && a.multiple ? (o.value = e, i.value = e.map((l) => l.name)) : e instanceof File ? (o.value = e, i.value = e.name) : (o.value = void 0, i.value = void 0), n.value = e, "messages" in _.value && (_.value.messages = []), u.value = void 0, t.value = void 0;
|
|
93
|
+
}), k(u, (e) => {
|
|
94
94
|
if (e && e.length > 0) {
|
|
95
95
|
const l = e[0].replace("{2}", a.accept || "").replace("{2.1}", a.fileExtensions || "");
|
|
96
|
-
l.includes("Invalid file size") &&
|
|
96
|
+
l.includes("Invalid file size") && E("error", "FILE_SIZE_TOO_LARGE"), j(l), a.useErrorToast && V.add({
|
|
97
97
|
message: l,
|
|
98
98
|
severity: "error"
|
|
99
99
|
}), o.value = void 0, i.value = void 0;
|
|
@@ -101,14 +101,16 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
101
101
|
t.value = void 0;
|
|
102
102
|
}), (e, l) => (f(), A(m(ae), y(a, {
|
|
103
103
|
ref_key: "fileUpload",
|
|
104
|
-
ref:
|
|
104
|
+
ref: _,
|
|
105
|
+
"cancel-label": e.$t("Cancel"),
|
|
105
106
|
"file-limit": e.multiple ? void 0 : 1,
|
|
106
107
|
pt: { input: { style: "display: none" } },
|
|
108
|
+
"upload-label": e.$t(a.uploadLabel),
|
|
107
109
|
onSelect: L,
|
|
108
110
|
onUpload: l[0] || (l[0] = (s) => e.$emit("upload", s))
|
|
109
111
|
}), {
|
|
110
112
|
header: M(({ files: s, chooseCallback: p, clearCallback: v }) => [
|
|
111
|
-
|
|
113
|
+
C("div", {
|
|
112
114
|
class: B([{ "grid-cols-[auto,max-content]": a.withUpload }, "grid gap-3 items-end"])
|
|
113
115
|
}, [
|
|
114
116
|
w(le, y(m(c).wrapper, {
|
|
@@ -123,12 +125,12 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
123
125
|
invalid: q.value,
|
|
124
126
|
"model-value": Array.isArray(i.value) ? i.value.join(", ") : i.value,
|
|
125
127
|
placeholder: a.placeholder,
|
|
126
|
-
onClick: (
|
|
127
|
-
onKeydown: Q((
|
|
128
|
+
onClick: ($) => T(p, v),
|
|
129
|
+
onKeydown: Q(($) => K($, p, v), ["prevent"])
|
|
128
130
|
}, {
|
|
129
|
-
"addon-left": M(() =>
|
|
130
|
-
h("
|
|
131
|
-
])
|
|
131
|
+
"addon-left": M(() => [
|
|
132
|
+
b(h(e.$t("Browse")), 1)
|
|
133
|
+
]),
|
|
132
134
|
_: 2
|
|
133
135
|
}, 1032, ["disabled", "input-class", "invalid", "model-value", "placeholder", "onClick", "onKeydown"]),
|
|
134
136
|
a.fileExtensions || a.fileRequirements || n.errorMessage || t.value || a.validatorMessage ? (f(), F("div", {
|
|
@@ -143,32 +145,34 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
|
|
|
143
145
|
message: t.value ?? n.errorMessage
|
|
144
146
|
}, null, 8, ["class", "message"]),
|
|
145
147
|
a.fileExtensions || a.fileRequirements ? (f(), F("div", W(y({ key: 0 }, m(c).requirements)), [
|
|
146
|
-
|
|
147
|
-
e.fileRequirements ? (f(), F(
|
|
148
|
-
h(
|
|
149
|
-
], 64)) : (f(), F(
|
|
150
|
-
h(
|
|
148
|
+
C("small", te, [
|
|
149
|
+
e.fileRequirements ? (f(), F(N, { key: 0 }, [
|
|
150
|
+
b(h(e.$t(e.fileRequirements)), 1)
|
|
151
|
+
], 64)) : (f(), F(N, { key: 1 }, [
|
|
152
|
+
b(h(e.$t(
|
|
153
|
+
a.maxFileSize ? `${a.fileExtensions}. max file ${Math.round(a.maxFileSize / re)} MB` : `${a.fileExtensions} file`
|
|
154
|
+
)), 1)
|
|
151
155
|
], 64))
|
|
152
156
|
])
|
|
153
|
-
], 16)) :
|
|
154
|
-
], 2)) :
|
|
157
|
+
], 16)) : x("", !0)
|
|
158
|
+
], 2)) : x("", !0)
|
|
155
159
|
]),
|
|
156
160
|
_: 2
|
|
157
161
|
}, 1040, ["error-messages", "label", "mandatory"]),
|
|
158
162
|
a.withUpload ? (f(), A(ie, y({ key: 0 }, m(c).buttonupload({ props: a }), {
|
|
159
163
|
disabled: a.disabled || d.value || !o.value,
|
|
160
164
|
label: a.uploadLabel,
|
|
161
|
-
onClick: (
|
|
165
|
+
onClick: ($) => O(s, v),
|
|
162
166
|
severity: "success",
|
|
163
167
|
type: "button"
|
|
164
|
-
}), null, 16, ["disabled", "label", "onClick"])) :
|
|
168
|
+
}), null, 16, ["disabled", "label", "onClick"])) : x("", !0)
|
|
165
169
|
], 2)
|
|
166
170
|
]),
|
|
167
171
|
content: M(({ messages: s }) => [
|
|
168
|
-
h(
|
|
172
|
+
b(h(P(s)), 1)
|
|
169
173
|
]),
|
|
170
174
|
_: 1
|
|
171
|
-
}, 16, ["file-limit"]));
|
|
175
|
+
}, 16, ["cancel-label", "file-limit", "upload-label"]));
|
|
172
176
|
}
|
|
173
177
|
});
|
|
174
178
|
export {
|
package/hardwaresync/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as G, onMounted as K, shallowRef as u, computed as m, ref as X, watch as ee, createBlock as g, openBlock as p, createSlots as ae, withCtx as E, createCommentVNode as b, createVNode as C, createElementVNode as V, normalizeClass as
|
|
1
|
+
import { defineComponent as G, onMounted as K, shallowRef as u, computed as m, ref as X, watch as ee, createBlock as g, openBlock as p, createSlots as ae, withCtx as E, createCommentVNode as b, createVNode as C, createElementVNode as V, normalizeClass as $, createElementBlock as ne, Fragment as te, toDisplayString as se } from "vue";
|
|
2
2
|
import { u as le } from "../utils/baseToast.util.es.js";
|
|
3
3
|
import { u as oe, W as re, g as ie } from "../buttonscan/index.es.js";
|
|
4
4
|
import { _ as R } from "../button/index.es.js";
|
|
5
5
|
import { _ as ce } from "../dialog/index.es.js";
|
|
6
|
-
import { _ as
|
|
6
|
+
import { _ as M } from "../dropdown/index.es.js";
|
|
7
7
|
import { _ as ue } from "../icon/index.es.js";
|
|
8
8
|
import { _ as de } from "../inlinemessage/index.es.js";
|
|
9
9
|
const De = /* @__PURE__ */ G({
|
|
@@ -16,15 +16,15 @@ const De = /* @__PURE__ */ G({
|
|
|
16
16
|
withoutScanBtn: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
emits: ["update:visible", "scan"],
|
|
19
|
-
setup(W, { emit:
|
|
20
|
-
const o = W, k =
|
|
19
|
+
setup(W, { emit: P }) {
|
|
20
|
+
const o = W, k = P, U = le();
|
|
21
21
|
K(() => {
|
|
22
22
|
O();
|
|
23
23
|
});
|
|
24
24
|
const {
|
|
25
25
|
device: _,
|
|
26
26
|
devices: I,
|
|
27
|
-
saveDevices:
|
|
27
|
+
saveDevices: x,
|
|
28
28
|
setDevice: Q,
|
|
29
29
|
loadDevices: z
|
|
30
30
|
} = oe(), i = {
|
|
@@ -44,7 +44,7 @@ const De = /* @__PURE__ */ G({
|
|
|
44
44
|
() => o.errorCode === "NOT_SUPPORTED_SYSTEM"
|
|
45
45
|
), H = m(() => o.searchBy === "RFID" && l.value.device), Y = m(() => o.searchBy === "QR" && r.value.device), D = m(() => !!o.searchBy && o.errorCode !== "HARDWARE_NOT_SYNCHRONIZED"), B = async (n) => {
|
|
46
46
|
try {
|
|
47
|
-
|
|
47
|
+
x(n);
|
|
48
48
|
const a = f.value.some(
|
|
49
49
|
(s) => {
|
|
50
50
|
var t, v, S;
|
|
@@ -113,7 +113,7 @@ const De = /* @__PURE__ */ G({
|
|
|
113
113
|
B(t);
|
|
114
114
|
const { error: v } = (e == null ? void 0 : e.data) ?? {};
|
|
115
115
|
v === "Driver not connected to server" ? (d.value = !1, c.value = h("DRIVER_NOT_FOUND")) : t.length || (d.value = !1, c.value = h("DEVICE_NOT_CONNECTED"));
|
|
116
|
-
} else e.status === "error_sync" && (d.value = !1, B([]),
|
|
116
|
+
} else e.status === "error_sync" && (d.value = !1, B([]), U.add({ message: "Failed to connecting scanner", severity: "error" }));
|
|
117
117
|
}, window.scannerWorker.postMessage({
|
|
118
118
|
command: "sync",
|
|
119
119
|
userId: (n = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : n._id,
|
|
@@ -168,7 +168,7 @@ const De = /* @__PURE__ */ G({
|
|
|
168
168
|
default: E(() => [
|
|
169
169
|
c.value ? (p(), g(de, {
|
|
170
170
|
key: 0,
|
|
171
|
-
class:
|
|
171
|
+
class: $(["p-[9.52px] transition"]),
|
|
172
172
|
message: c.value.detail,
|
|
173
173
|
removable: !1,
|
|
174
174
|
"show-icon": !1,
|
|
@@ -186,13 +186,13 @@ const De = /* @__PURE__ */ G({
|
|
|
186
186
|
outlined: ""
|
|
187
187
|
}, null, 8, ["disabled", "loading"]),
|
|
188
188
|
V("section", {
|
|
189
|
-
class:
|
|
189
|
+
class: $([
|
|
190
190
|
"grid grid-cols-2 gap-3 justify-start w-full",
|
|
191
191
|
{ "opacity-60 pointer-events-none": w.value }
|
|
192
192
|
]),
|
|
193
193
|
"data-ts-section": "scanner-list"
|
|
194
194
|
}, [
|
|
195
|
-
C(
|
|
195
|
+
C(M, {
|
|
196
196
|
modelValue: l.value,
|
|
197
197
|
"onUpdate:modelValue": [
|
|
198
198
|
a[0] || (a[0] = (e) => l.value = e),
|
|
@@ -202,7 +202,7 @@ const De = /* @__PURE__ */ G({
|
|
|
202
202
|
label: "RFID Scanner",
|
|
203
203
|
"option-label": "label"
|
|
204
204
|
}, null, 8, ["modelValue", "options"]),
|
|
205
|
-
C(
|
|
205
|
+
C(M, {
|
|
206
206
|
modelValue: r.value,
|
|
207
207
|
"onUpdate:modelValue": [
|
|
208
208
|
a[1] || (a[1] = (e) => r.value = e),
|
|
@@ -224,7 +224,7 @@ const De = /* @__PURE__ */ G({
|
|
|
224
224
|
C(ue, {
|
|
225
225
|
icon: (e = n.searchBy) == null ? void 0 : e.toLowerCase()
|
|
226
226
|
}, null, 8, ["icon"]),
|
|
227
|
-
V("h3", null,
|
|
227
|
+
V("h3", null, se(n.$t(`Scan ${n.searchBy}`)), 1)
|
|
228
228
|
];
|
|
229
229
|
}),
|
|
230
230
|
key: "0"
|