@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
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, onMounted as ee, onUnmounted as te, ref as R, shallowRef as k, computed as H, watch as j, withDirectives as y, createElementBlock as h, openBlock as u, mergeProps as f, createBlock as E, createCommentVNode as w, createVNode as v, unref as o, Fragment as T, renderSlot as le, withCtx as V, normalizeClass as ae, vShow as $, createElementVNode as oe, normalizeProps as ne, guardReactiveProps as se, toDisplayString as P, createTextVNode as G, nextTick as ie } from "vue";
|
|
2
2
|
import { e as c } from "../event-bus/index.es.js";
|
|
3
|
-
import { u as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { u as ue } from "../plugins/basei18n.es.js";
|
|
4
|
+
import { u as re } from "../plugins/WangsVue.es.js";
|
|
5
|
+
import { m as ce } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
6
|
+
import { s as de } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
|
|
6
7
|
import { _ as A } from "../button/index.es.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
const
|
|
8
|
+
import { _ as pe } from "../icon/index.es.js";
|
|
9
|
+
import { _ as me } from "../menu/index.es.js";
|
|
10
|
+
import { _ as be } from "../menuitem/index.es.js";
|
|
11
|
+
const fe = (D, N) => {
|
|
11
12
|
const l = {
|
|
12
13
|
label: N,
|
|
13
14
|
disabled: !0
|
|
14
15
|
}, g = D.filter((d) => d.visible !== !1);
|
|
15
16
|
return g.length ? g : [l];
|
|
16
|
-
},
|
|
17
|
+
}, Be = /* @__PURE__ */ x({
|
|
17
18
|
__name: "ButtonBulkAction",
|
|
18
19
|
props: {
|
|
19
20
|
disabled: { type: Boolean },
|
|
@@ -26,39 +27,42 @@ const pe = (D, N) => {
|
|
|
26
27
|
},
|
|
27
28
|
emits: ["apply", "update:selectedData"],
|
|
28
29
|
setup(D, { emit: N }) {
|
|
29
|
-
const l = D, { defaultProps: g, locale: d } =
|
|
30
|
-
|
|
31
|
-
window.addEventListener("disableBulkAction",
|
|
32
|
-
}),
|
|
33
|
-
window.removeEventListener("disableBulkAction",
|
|
30
|
+
const l = D, { defaultProps: g, locale: d } = re("ButtonBulkAction"), p = ce(l, g), { t: J } = ue(), B = N;
|
|
31
|
+
ee(() => {
|
|
32
|
+
window.addEventListener("disableBulkAction", L), c.on("data-table:update-selected-data", _), c.on("data-table:update-total-record", U);
|
|
33
|
+
}), te(() => {
|
|
34
|
+
window.removeEventListener("disableBulkAction", L), c.off("data-table:update-total-record", _), c.off("data-table:update-selected-data", U);
|
|
34
35
|
});
|
|
35
|
-
const S = R(),
|
|
36
|
+
const S = R(), O = R(), n = k(), m = k(0), C = k(!1), M = k(!1), i = R(l.selectedData), K = H(
|
|
36
37
|
() => {
|
|
37
38
|
var e;
|
|
38
39
|
return ((e = i.value) == null ? void 0 : e.length) && !M.value && m.value > 0;
|
|
39
40
|
}
|
|
40
|
-
),
|
|
41
|
+
), z = H(() => l.options.map((e) => ({
|
|
42
|
+
...e,
|
|
43
|
+
label: J(e.label)
|
|
44
|
+
}))), Q = () => {
|
|
41
45
|
window.dispatchEvent(
|
|
42
46
|
new CustomEvent("fetchAllData", { detail: l.tableName })
|
|
43
47
|
), c.emit("data-table:select-all-record", { tableName: l.tableName });
|
|
44
|
-
},
|
|
48
|
+
}, X = () => {
|
|
45
49
|
B("update:selectedData", []), c.emit("data-table:clear-selected-data", {
|
|
46
50
|
tableName: l.tableName
|
|
47
51
|
});
|
|
48
|
-
},
|
|
52
|
+
}, L = (e) => {
|
|
49
53
|
l.tableName === e.detail.tableName && (M.value = e.detail.value);
|
|
50
|
-
},
|
|
54
|
+
}, Y = (e) => {
|
|
51
55
|
var t;
|
|
52
56
|
(t = S.value) == null || t.toggle(e);
|
|
53
|
-
},
|
|
57
|
+
}, U = (e) => {
|
|
54
58
|
l.tableName === (e == null ? void 0 : e.tableName) && (m.value = e == null ? void 0 : e.total);
|
|
55
|
-
},
|
|
59
|
+
}, _ = (e) => {
|
|
56
60
|
e.tableName === l.tableName && (i.value = e.data, B("update:selectedData", e.data ?? []));
|
|
57
|
-
},
|
|
61
|
+
}, Z = async (e) => {
|
|
58
62
|
var t, s;
|
|
59
63
|
if (e.useAdditionSlot) {
|
|
60
|
-
n.value = e, await
|
|
61
|
-
const r = (t =
|
|
64
|
+
n.value = e, await ie();
|
|
65
|
+
const r = (t = O.value) == null ? void 0 : t.children[1], a = r == null ? void 0 : r.querySelector(
|
|
62
66
|
"input"
|
|
63
67
|
);
|
|
64
68
|
a && (a == null || a.click(), a == null || a.focus());
|
|
@@ -66,59 +70,59 @@ const pe = (D, N) => {
|
|
|
66
70
|
originalEvent: void 0,
|
|
67
71
|
item: e
|
|
68
72
|
}), (s = S.value) == null || s.hide(), n.value = void 0) : e.url ? window.open(e.url, e.target) : e.route && window.history.pushState(void 0, "", e.route);
|
|
69
|
-
},
|
|
73
|
+
}, I = (e) => {
|
|
70
74
|
var t, s;
|
|
71
75
|
(s = (t = n.value) == null ? void 0 : t.command) == null || s.call(t, {
|
|
72
76
|
originalEvent: e,
|
|
73
77
|
item: n.value
|
|
74
78
|
}), n.value = void 0, B("apply");
|
|
75
79
|
};
|
|
76
|
-
return
|
|
80
|
+
return j(
|
|
77
81
|
[i, m],
|
|
78
82
|
([e, t]) => {
|
|
79
83
|
e != null && e.length || (n.value = void 0), C.value = (e == null ? void 0 : e.length) === t;
|
|
80
84
|
},
|
|
81
85
|
{ deep: !0 }
|
|
82
|
-
),
|
|
86
|
+
), j(
|
|
83
87
|
() => l.totalRecords,
|
|
84
88
|
(e) => m.value = e ?? 0,
|
|
85
89
|
{ immediate: !0 }
|
|
86
90
|
), (e, t) => {
|
|
87
|
-
var s, r, a,
|
|
91
|
+
var s, r, a, W, q, F;
|
|
88
92
|
return y((u(), h("div", f(e.$preset.buttonbulkaction.root, {
|
|
89
93
|
ref_key: "wrapper",
|
|
90
|
-
ref:
|
|
94
|
+
ref: O
|
|
91
95
|
}), [
|
|
92
|
-
o(p).selectMenuType === "overlay-panel" && ((s = i.value) != null && s.length) ? (u(), E(
|
|
96
|
+
o(p).selectMenuType === "overlay-panel" && ((s = i.value) != null && s.length) ? (u(), E(me, {
|
|
93
97
|
key: 0,
|
|
94
98
|
ref_key: "menu",
|
|
95
99
|
ref: S,
|
|
96
|
-
model:
|
|
100
|
+
model: z.value,
|
|
97
101
|
popup: ""
|
|
98
102
|
}, null, 8, ["model"])) : w("", !0),
|
|
99
103
|
o(p).selectMenuType === "dropdown" ? (u(), h(T, { key: 1 }, [
|
|
100
|
-
(r = e.selectedData) != null && r.length ? (u(), E(o(
|
|
104
|
+
(r = e.selectedData) != null && r.length ? (u(), E(o(de), {
|
|
101
105
|
key: 0,
|
|
102
106
|
disabled: l.disabled || M.value || !((a = e.selectedData) != null && a.length),
|
|
103
107
|
"model-value": n.value,
|
|
104
|
-
options: o(
|
|
105
|
-
|
|
108
|
+
options: o(fe)(
|
|
109
|
+
z.value,
|
|
106
110
|
e.$wangsvue.config.locale.components.Menu.noOptionLabel
|
|
107
111
|
),
|
|
112
|
+
placeholder: e.$t("Bulk Action"),
|
|
108
113
|
pt: e.$preset.buttonbulkaction.dropdownmenu,
|
|
109
|
-
"onUpdate:modelValue": t[0] || (t[0] = (b) =>
|
|
114
|
+
"onUpdate:modelValue": t[0] || (t[0] = (b) => Z(b)),
|
|
110
115
|
"option-label": "label",
|
|
111
|
-
outlined: ""
|
|
112
|
-
placeholder: "Bulk Action"
|
|
116
|
+
outlined: ""
|
|
113
117
|
}, {
|
|
114
118
|
dropdownicon: V(({ class: b }) => [
|
|
115
|
-
v(
|
|
116
|
-
class:
|
|
119
|
+
v(pe, {
|
|
120
|
+
class: ae([b]),
|
|
117
121
|
icon: "arrow-down"
|
|
118
122
|
}, null, 8, ["class"])
|
|
119
123
|
]),
|
|
120
124
|
option: V(({ option: b }) => [
|
|
121
|
-
v(
|
|
125
|
+
v(be, {
|
|
122
126
|
item: b,
|
|
123
127
|
"router-props": {
|
|
124
128
|
action: e.$preset.menu.action,
|
|
@@ -128,20 +132,22 @@ const pe = (D, N) => {
|
|
|
128
132
|
}, null, 8, ["item", "router-props"])
|
|
129
133
|
]),
|
|
130
134
|
_: 1
|
|
131
|
-
}, 8, ["disabled", "model-value", "options", "pt"])) : w("", !0),
|
|
132
|
-
|
|
133
|
-
y(v(A, f({ onClick:
|
|
134
|
-
[$, (
|
|
135
|
+
}, 8, ["disabled", "model-value", "options", "placeholder", "pt"])) : w("", !0),
|
|
136
|
+
le(e.$slots, "addition", { selectedOption: n.value }),
|
|
137
|
+
y(v(A, f({ onClick: I }, e.$preset.buttonbulkaction.applybutton, { label: "Apply" }), null, 16), [
|
|
138
|
+
[$, (W = n.value) == null ? void 0 : W.useAdditionSlot]
|
|
135
139
|
])
|
|
136
140
|
], 64)) : w("", !0),
|
|
137
|
-
y(
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
y(oe("span", ne(se(e.$preset.buttonbulkaction.selectionmessage)), P(e.$t(
|
|
142
|
+
o(d).currentSelectionMessage.replace(
|
|
143
|
+
"{length} {naming}",
|
|
144
|
+
`${i.value.length.toString()} ${o(p).naming}`
|
|
145
|
+
)
|
|
140
146
|
)), 17), [
|
|
141
|
-
[$, (
|
|
147
|
+
[$, (q = i.value) == null ? void 0 : q.length]
|
|
142
148
|
]),
|
|
143
149
|
y(v(A, f(
|
|
144
|
-
{ onClick:
|
|
150
|
+
{ onClick: Q },
|
|
145
151
|
e.$preset.buttonbulkaction.buttonselectall({
|
|
146
152
|
context: { selectedAll: C.value }
|
|
147
153
|
}),
|
|
@@ -149,39 +155,41 @@ const pe = (D, N) => {
|
|
|
149
155
|
), {
|
|
150
156
|
default: V(() => [
|
|
151
157
|
C.value ? (u(), h(T, { key: 1 }, [
|
|
152
|
-
|
|
158
|
+
G(P(e.$t(o(d).allRecordSelected.replace("{naming}", o(p).naming))), 1)
|
|
153
159
|
], 64)) : (u(), h(T, { key: 0 }, [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
160
|
+
G(P(e.$t(
|
|
161
|
+
o(d).selectAllRecords.replace(
|
|
162
|
+
"{totalRecords}",
|
|
163
|
+
m.value.toString()
|
|
164
|
+
)
|
|
157
165
|
)), 1)
|
|
158
166
|
], 64))
|
|
159
167
|
]),
|
|
160
168
|
_: 1
|
|
161
169
|
}, 16), [
|
|
162
|
-
[$,
|
|
170
|
+
[$, K.value]
|
|
163
171
|
]),
|
|
164
172
|
o(p).selectMenuType === "overlay-panel" ? (u(), E(A, f({
|
|
165
173
|
key: 2,
|
|
166
|
-
onClick:
|
|
174
|
+
onClick: Y
|
|
167
175
|
}, e.$preset.buttonbulkaction.bulkactiontoggle, {
|
|
168
176
|
icon: "ellipsis-h",
|
|
169
177
|
outlined: "",
|
|
170
178
|
severity: "secondary",
|
|
171
179
|
size: "small"
|
|
172
180
|
}), null, 16)) : w("", !0),
|
|
173
|
-
v(A, f({ onClick:
|
|
181
|
+
v(A, f({ onClick: X }, e.$preset.buttonbulkaction.buttonclearselection, {
|
|
174
182
|
icon: "close",
|
|
175
183
|
severity: "danger",
|
|
176
184
|
text: ""
|
|
177
185
|
}), null, 16)
|
|
178
186
|
], 16)), [
|
|
179
|
-
[$, (
|
|
187
|
+
[$, (F = i.value) == null ? void 0 : F.length]
|
|
180
188
|
]);
|
|
181
189
|
};
|
|
182
190
|
}
|
|
183
191
|
});
|
|
184
192
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
Be as _,
|
|
194
|
+
fe as f
|
|
187
195
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as F, inject as x, computed as N, ref as L, createElementBlock as v, openBlock as y, mergeProps as B, unref as C, createVNode as S, createCommentVNode as W, toDisplayString as G } from "vue";
|
|
2
2
|
import { e as r } from "../event-bus/index.es.js";
|
|
3
3
|
import { u as H } from "../plugins/WangsVue.es.js";
|
|
4
4
|
import { u as O } from "../utils/baseToast.util.es.js";
|
|
5
|
-
import { n as R, e as
|
|
5
|
+
import { n as R, e as D } from "../utils/exportToExcel.util.es.js";
|
|
6
6
|
import { m as Z } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
7
7
|
import { u as q } from "../assetinfo/index.es.js";
|
|
8
8
|
import { _ as I } from "../icon/index.es.js";
|
|
9
9
|
const J = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "inherit text-xs"
|
|
12
|
-
}, ne = /* @__PURE__ */
|
|
12
|
+
}, ne = /* @__PURE__ */ F({
|
|
13
13
|
__name: "ButtonDownload",
|
|
14
14
|
props: {
|
|
15
15
|
fileName: {},
|
|
@@ -20,8 +20,8 @@ const J = {
|
|
|
20
20
|
dataConfigs: {},
|
|
21
21
|
excelToastErrorMessage: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const l =
|
|
23
|
+
setup(_) {
|
|
24
|
+
const l = _, { setLoading: c } = q(), E = x("useToastConfig"), u = O(E), { defaultProps: P, locale: m } = H("ButtonDownload"), f = N(() => Z(l, P)), p = x("preset", {}).buttondownload, i = L({}), b = N(() => Object.entries(i.value).map(([e]) => e)), k = async (e) => {
|
|
25
25
|
const a = await e();
|
|
26
26
|
if (a instanceof Error) throw a;
|
|
27
27
|
return (a == null ? void 0 : a.data) ?? { data: [], totalRecords: 0 };
|
|
@@ -29,8 +29,8 @@ const J = {
|
|
|
29
29
|
const { fileName: e, tableName: a, multiTableNames: t, dataConfigs: o } = f.value;
|
|
30
30
|
if (o != null && o.length && A(o), t != null && t.length)
|
|
31
31
|
r.on("button-download:multi-tables", T), t.forEach((n) => {
|
|
32
|
-
const
|
|
33
|
-
r.emit("data-table:download",
|
|
32
|
+
const d = { fileName: e, tableName: n, multiTableNames: t };
|
|
33
|
+
r.emit("data-table:download", d);
|
|
34
34
|
});
|
|
35
35
|
else {
|
|
36
36
|
const n = {
|
|
@@ -45,23 +45,23 @@ const J = {
|
|
|
45
45
|
try {
|
|
46
46
|
const o = await Promise.all(
|
|
47
47
|
e.map(async (n) => {
|
|
48
|
-
const { columns:
|
|
48
|
+
const { columns: d, data: V, fetchFunction: h, tableTitle: $ } = n, w = d.filter((s) => s.visible !== !1).filter((s) => !s.excluded), j = w.map(
|
|
49
49
|
(s) => s.header ?? s.exportHeader ?? "-"
|
|
50
50
|
);
|
|
51
|
-
|
|
52
|
-
const { data:
|
|
51
|
+
c(!0, m.downloadingMessage);
|
|
52
|
+
const { data: z } = h ? await k(h) : { data: V };
|
|
53
53
|
return {
|
|
54
54
|
data: R(
|
|
55
|
-
|
|
55
|
+
z,
|
|
56
56
|
w,
|
|
57
57
|
m
|
|
58
58
|
),
|
|
59
|
-
headers:
|
|
60
|
-
tableTitle:
|
|
59
|
+
headers: j,
|
|
60
|
+
tableTitle: $
|
|
61
61
|
};
|
|
62
62
|
})
|
|
63
63
|
);
|
|
64
|
-
await
|
|
64
|
+
await D({
|
|
65
65
|
tables: o,
|
|
66
66
|
additionalTexts: l.additionalTextBelowTable,
|
|
67
67
|
fileName: g()
|
|
@@ -76,7 +76,7 @@ const J = {
|
|
|
76
76
|
group: "download"
|
|
77
77
|
});
|
|
78
78
|
} finally {
|
|
79
|
-
|
|
79
|
+
c(!1);
|
|
80
80
|
}
|
|
81
81
|
}, T = async ({
|
|
82
82
|
table: e
|
|
@@ -89,7 +89,7 @@ const J = {
|
|
|
89
89
|
const o = [];
|
|
90
90
|
l.multiTableNames.forEach((n) => {
|
|
91
91
|
o.push(i.value[n]);
|
|
92
|
-
}), await
|
|
92
|
+
}), await D({
|
|
93
93
|
tables: o,
|
|
94
94
|
additionalTexts: l.additionalTextBelowTable,
|
|
95
95
|
fileName: g()
|
|
@@ -99,12 +99,12 @@ const J = {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
return (e, a) => (y(), v("button", B({ onClick: M }, C(p).root({ props: l }), { type: "button" }), [
|
|
102
|
-
|
|
102
|
+
S(I, B(C(p).icon, {
|
|
103
103
|
icon: "download",
|
|
104
104
|
info: "Download",
|
|
105
105
|
"tooltip-pos": "bottom"
|
|
106
106
|
}), null, 16),
|
|
107
|
-
e.label ? (y(), v("span", J, G(e.label), 1)) :
|
|
107
|
+
e.label ? (y(), v("span", J, G(e.$t(e.label)), 1)) : W("", !0)
|
|
108
108
|
], 16));
|
|
109
109
|
}
|
|
110
110
|
});
|
package/buttonradio/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { h as k, defineComponent as C, inject as V, computed as S, createBlock as f, openBlock as d, unref as l, mergeProps as p, withCtx as P, createElementVNode as i, renderSlot as w, createCommentVNode as m, normalizeProps as c, guardReactiveProps as b, normalizeStyle as E, normalizeClass as z, createElementBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { i as
|
|
4
|
-
const
|
|
1
|
+
import { h as k, defineComponent as C, inject as V, computed as S, createBlock as f, openBlock as d, unref as l, mergeProps as p, withCtx as P, createElementVNode as i, renderSlot as w, createCommentVNode as m, normalizeProps as c, guardReactiveProps as b, normalizeStyle as E, normalizeClass as z, createElementBlock as $, toDisplayString as j } from "vue";
|
|
2
|
+
import { _ as q } from "../icon/index.es.js";
|
|
3
|
+
import { i as A } from "../vendor/lodash-es/isEqual.es.js";
|
|
4
|
+
const I = (r, s) => {
|
|
5
5
|
const { attrs: t, slots: a } = s || {};
|
|
6
6
|
return r.label ? k("label", t, a.default()) : a.default();
|
|
7
|
-
},
|
|
7
|
+
}, L = ["id", "aria-invalid", "checked", "disabled", "name", "readonly", "tabindex", "value"], F = /* @__PURE__ */ C({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ButtonRadio",
|
|
10
10
|
props: {
|
|
@@ -26,7 +26,7 @@ const L = (r, s) => {
|
|
|
26
26
|
},
|
|
27
27
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
28
28
|
setup(r, { emit: s }) {
|
|
29
|
-
const t = r, a = s, n = V("preset", {}).buttonradio, u = S(() => t.modelValue != null && (t.binary ? y() :
|
|
29
|
+
const t = r, a = s, n = V("preset", {}).buttonradio, u = S(() => t.modelValue != null && (t.binary ? y() : A(t.modelValue, t.value))), y = () => {
|
|
30
30
|
const { modelValue: e, value: o } = t;
|
|
31
31
|
return typeof e != "boolean" ? !!e : typeof o == "boolean" ? e === o : typeof o == "number" ? !!e == !!o : typeof o == "string" ? (e == null ? void 0 : e.toString()) === o : !1;
|
|
32
32
|
}, v = (e) => {
|
|
@@ -46,7 +46,7 @@ const L = (r, s) => {
|
|
|
46
46
|
}, g = (e) => {
|
|
47
47
|
a("blur", e);
|
|
48
48
|
};
|
|
49
|
-
return (e, o) => (d(), f(l(
|
|
49
|
+
return (e, o) => (d(), f(l(I), p(l(n).label, { label: e.label }), {
|
|
50
50
|
default: P(() => [
|
|
51
51
|
i("span", c(b(l(n).root({ props: t, state: { checked: u.value } }))), [
|
|
52
52
|
i("input", {
|
|
@@ -64,18 +64,18 @@ const L = (r, s) => {
|
|
|
64
64
|
onChange: h,
|
|
65
65
|
onFocus: B,
|
|
66
66
|
type: "radio"
|
|
67
|
-
}, null, 46,
|
|
67
|
+
}, null, 46, L),
|
|
68
68
|
i("span", c(b(l(n).box({ props: t, state: { checked: u.value } }))), [
|
|
69
69
|
i("span", c(b(l(n).icon)), null, 16)
|
|
70
70
|
], 16)
|
|
71
71
|
], 16),
|
|
72
72
|
w(e.$slots, "label", {}, () => [
|
|
73
|
-
e.label ? (d(),
|
|
73
|
+
e.label ? (d(), $("span", p({
|
|
74
74
|
key: 0,
|
|
75
75
|
"data-wv-section": "labeltext"
|
|
76
|
-
}, l(n).labeltext),
|
|
76
|
+
}, l(n).labeltext), j(e.$t(e.label)), 17)) : m("", !0)
|
|
77
77
|
]),
|
|
78
|
-
e.tooltip ? (d(), f(
|
|
78
|
+
e.tooltip ? (d(), f(q, p({
|
|
79
79
|
key: 0,
|
|
80
80
|
info: e.tooltip,
|
|
81
81
|
"tooltip-pos": e.tooltipPos
|
package/buttonscan/index.es.js
CHANGED
|
@@ -15,7 +15,7 @@ const Te = (a) => {
|
|
|
15
15
|
a.message
|
|
16
16
|
))
|
|
17
17
|
return a.message;
|
|
18
|
-
}, ie = `(function(){"use strict";let n=null,t=null,a,c,r="";self.onmessage=s=>{const e=s.data;switch(c=e.companyCode,e.command){case"sync":l(e);break;case"connect":g(e);break;case"scan":S(e);break;case"stopscan":p(e);break}};const d=s=>{let e="established";n&&n.readyState===WebSocket.OPEN?(e="reused",s.onopen(n,e),m(s.timeout)):n=new WebSocket("wss://dev-api.tagsamurai.com/rfid-reader-go"),n.onopen=()=>{r=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),e="established",n&&s.onopen(n,e),m(s.timeout)},n.onmessage=o=>{s.onmessage(o),m(s.timeout)},n.onerror=o=>{console.error("🚀 ~ Scanner Worker: openConnection ~ error:",o),s.onerror(o),n==null||n.close(),n=null,t&&clearTimeout(t)}},u=()=>{p({userId:a}),a=void 0,n&&n.close(),n=null,t&&clearTimeout(t),console.info("Socket connection has been closed!")},m=(s=0)=>{s&&(t&&clearTimeout(t),t=setTimeout(u,s))},l=({userId:s})=>{a=s,d({onopen:e=>{e.send(JSON.stringify({data:{command:"connect",userId:s,sessionId:r,companyCode:c,source:"app"},event:"reader"}))},onmessage:e=>{postMessage({status:"synced",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"sync_error",error:e})}})},g=({userId:s})=>{a=s,d({onopen:(e,o)=>{o==="established"?e.send(JSON.stringify({data:{command:"connect",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})):postMessage({status:"connection_reused"})},onmessage:e=>{postMessage({status:"connection_established",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"error_connecting",error:e})}})},S=({scanCommand:s,userId:e,serialNumber:o,jenisDevice:f})=>{a=e,d({onopen:i=>{i.send(JSON.stringify({data:{command:s,userId:e,sessionId:r,companyCode:c,source:"app",serialNumber:o,jenisDevice:f},event:"reader"})),postMessage({status:"scan_started"})},onmessage:i=>{postMessage({status:"scanned",...JSON.parse(i.data)})},onerror:i=>{postMessage({status:"scan_error",error:i})}})},p=({userId:s})=>{n&&n.readyState===WebSocket.OPEN&&(n.send(JSON.stringify({data:{command:"stopscan",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})),postMessage({status:"scan_stopped"}),console.info("Scan Process Stopped!"))}})();
|
|
18
|
+
}, ie = `(function(){"use strict";let n=null,t=null,a,c,r="";self.onmessage=s=>{const e=s.data;switch(c=e.companyCode,e.command){case"sync":l(e);break;case"connect":g(e);break;case"scan":S(e);break;case"stopscan":p(e);break}};const d=s=>{let e="established";n&&n.readyState===WebSocket.OPEN?(e="reused",s.onopen(n,e),m(s.timeout)):n=new WebSocket("wss://dev-api.tagsamurai.com/rfid-reader-go/"),n.onopen=()=>{r=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),e="established",n&&s.onopen(n,e),m(s.timeout)},n.onmessage=o=>{s.onmessage(o),m(s.timeout)},n.onerror=o=>{console.error("🚀 ~ Scanner Worker: openConnection ~ error:",o),s.onerror(o),n==null||n.close(),n=null,t&&clearTimeout(t)}},u=()=>{p({userId:a}),a=void 0,n&&n.close(),n=null,t&&clearTimeout(t),console.info("Socket connection has been closed!")},m=(s=0)=>{s&&(t&&clearTimeout(t),t=setTimeout(u,s))},l=({userId:s})=>{a=s,d({onopen:e=>{e.send(JSON.stringify({data:{command:"connect",userId:s,sessionId:r,companyCode:c,source:"app"},event:"reader"}))},onmessage:e=>{postMessage({status:"synced",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"sync_error",error:e})}})},g=({userId:s})=>{a=s,d({onopen:(e,o)=>{o==="established"?e.send(JSON.stringify({data:{command:"connect",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})):postMessage({status:"connection_reused"})},onmessage:e=>{postMessage({status:"connection_established",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"error_connecting",error:e})}})},S=({scanCommand:s,userId:e,serialNumber:o,jenisDevice:f})=>{a=e,d({onopen:i=>{i.send(JSON.stringify({data:{command:s,userId:e,sessionId:r,companyCode:c,source:"app",serialNumber:o,jenisDevice:f},event:"reader"})),postMessage({status:"scan_started"})},onmessage:i=>{postMessage({status:"scanned",...JSON.parse(i.data)})},onerror:i=>{postMessage({status:"scan_error",error:i})}})},p=({userId:s})=>{n&&n.readyState===WebSocket.OPEN&&(n.send(JSON.stringify({data:{command:"stopscan",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})),postMessage({status:"scan_stopped"}),console.info("Scan Process Stopped!"))}})();
|
|
19
19
|
`, te = typeof self < "u" && self.Blob && new Blob([ie], { type: "text/javascript;charset=utf-8" });
|
|
20
20
|
function xe(a) {
|
|
21
21
|
let u;
|
package/buttonsearch/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as x, inject as P, shallowRef as g, ref as V, createElementBlock as w, openBlock as I, mergeProps as o, unref as e, createVNode as u, withModifiers as q, createElementVNode as i, nextTick as E } from "vue";
|
|
2
2
|
import { e as N } from "../event-bus/index.es.js";
|
|
3
3
|
import { u as T } from "../plugins/WangsVue.es.js";
|
|
4
|
-
import { s as
|
|
4
|
+
import { s as j } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
|
|
5
5
|
import { _ as c } from "../icon/index.es.js";
|
|
6
6
|
const D = /* @__PURE__ */ x({
|
|
7
7
|
__name: "ButtonSearch",
|
|
@@ -9,45 +9,45 @@ const D = /* @__PURE__ */ x({
|
|
|
9
9
|
tableName: { default: "datatable" }
|
|
10
10
|
},
|
|
11
11
|
emits: ["search", "collapsed"],
|
|
12
|
-
setup(
|
|
13
|
-
const t = P("preset", {}).buttonsearch, { locale: $ } = T("ButtonSearch"),
|
|
12
|
+
setup(F) {
|
|
13
|
+
const t = P("preset", {}).buttonsearch, { locale: $ } = T("ButtonSearch"), a = g(), s = V(), r = g(!1), B = () => {
|
|
14
14
|
r.value = !0, p();
|
|
15
15
|
}, p = () => {
|
|
16
16
|
E(() => {
|
|
17
17
|
s.value && s.value.$el.focus();
|
|
18
18
|
});
|
|
19
|
-
}, C = (
|
|
20
|
-
|
|
19
|
+
}, C = (n) => {
|
|
20
|
+
a.value = n.target.value || void 0;
|
|
21
21
|
};
|
|
22
|
-
return (
|
|
22
|
+
return (n, l) => {
|
|
23
23
|
var m, v, b, f, h, d, y, k, S;
|
|
24
24
|
return r.value ? (I(), w("form", o({ key: 1 }, (b = e(t)) == null ? void 0 : b.form({ context: { showSearchInput: r.value } }), {
|
|
25
25
|
onSubmit: l[2] || (l[2] = q(
|
|
26
26
|
() => {
|
|
27
|
-
e(N).emit("search-table", { tableName:
|
|
27
|
+
e(N).emit("search-table", { tableName: n.tableName, search: a.value }), n.$emit("search", a.value);
|
|
28
28
|
},
|
|
29
29
|
["prevent"]
|
|
30
30
|
))
|
|
31
31
|
}), [
|
|
32
32
|
i("button", o({
|
|
33
33
|
onClick: l[0] || (l[0] = () => {
|
|
34
|
-
|
|
34
|
+
a.value = void 0, r.value = !1, n.$emit("collapsed"), e(N).emit("search-table", { tableName: n.tableName, search: void 0 }), n.$emit("search", void 0);
|
|
35
35
|
})
|
|
36
36
|
}, (f = e(t)) == null ? void 0 : f.collapsebutton.root({ context: { showSearchInput: r.value } }), { type: "button" }), [
|
|
37
37
|
u(c, o((h = e(t)) == null ? void 0 : h.collapsebutton.icon, { icon: "arrow-left" }), null, 16)
|
|
38
38
|
], 16),
|
|
39
|
-
u(e(
|
|
39
|
+
u(e(j), o((d = e(t)) == null ? void 0 : d.inputtext, {
|
|
40
40
|
ref_key: "inputtext",
|
|
41
41
|
ref: s,
|
|
42
|
-
"model-value":
|
|
43
|
-
placeholder: e($).searchPlaceholder,
|
|
42
|
+
"model-value": a.value,
|
|
43
|
+
placeholder: n.$t(e($).searchPlaceholder),
|
|
44
44
|
onInput: C
|
|
45
45
|
}), null, 16, ["model-value", "placeholder"]),
|
|
46
46
|
i("button", o({
|
|
47
|
-
onClick: l[1] || (l[1] = (
|
|
48
|
-
|
|
47
|
+
onClick: l[1] || (l[1] = (M) => {
|
|
48
|
+
a.value = void 0, p();
|
|
49
49
|
})
|
|
50
|
-
}, (y = e(t)) == null ? void 0 : y.resetbutton.root({ query:
|
|
50
|
+
}, (y = e(t)) == null ? void 0 : y.resetbutton.root({ query: a.value }), { type: "button" }), [
|
|
51
51
|
u(c, o((k = e(t)) == null ? void 0 : k.resetbutton.icon, { icon: "close" }), null, 16)
|
|
52
52
|
], 16),
|
|
53
53
|
i("button", o((S = e(t)) == null ? void 0 : S.hiddensubmit, { type: "submit" }), null, 16)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, computed as U, ref as
|
|
1
|
+
import { defineComponent as V, computed as U, ref as v, createElementBlock as c, openBlock as a, Fragment as y, createBlock as h, createVNode as s, createElementVNode as u, toDisplayString as m, withCtx as _ } from "vue";
|
|
2
2
|
import { _ as N } from "../badge/index.es.js";
|
|
3
3
|
import { _ as b } from "../button/index.es.js";
|
|
4
4
|
import { _ as O } from "../dialogconfirm/index.es.js";
|
|
@@ -23,38 +23,38 @@ const D = {
|
|
|
23
23
|
},
|
|
24
24
|
emits: ["update:modelValue", "confirm"],
|
|
25
25
|
setup(B, { emit: g }) {
|
|
26
|
-
const e = B,
|
|
26
|
+
const e = B, $ = g, i = U(() => e.modelValue ?? void 0), l = v(!1), r = v(!1), k = async (n) => {
|
|
27
27
|
if (e.fetchFunction)
|
|
28
|
-
return await e.fetchFunction(
|
|
28
|
+
return await e.fetchFunction(n);
|
|
29
29
|
}, w = async () => {
|
|
30
30
|
if (e.fetchOptionFunction)
|
|
31
31
|
return await e.fetchOptionFunction();
|
|
32
|
+
}, x = () => {
|
|
33
|
+
e.confirmBeforeReselect ? r.value = !0 : l.value = !0;
|
|
32
34
|
}, C = () => {
|
|
33
|
-
|
|
34
|
-
}, $ = () => {
|
|
35
|
-
x("confirm"), i.value = !0;
|
|
35
|
+
$("confirm"), l.value = !0;
|
|
36
36
|
};
|
|
37
|
-
return (
|
|
38
|
-
var
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
e.useBadge ? (
|
|
37
|
+
return (n, t) => {
|
|
38
|
+
var f, p, d;
|
|
39
|
+
return a(), c(y, null, [
|
|
40
|
+
i.value ? (a(), c("div", D, [
|
|
41
|
+
e.useBadge ? (a(), h(N, {
|
|
42
42
|
key: 0,
|
|
43
|
-
label: ((
|
|
43
|
+
label: ((f = i.value) == null ? void 0 : f.fullName) ?? ((p = i.value) == null ? void 0 : p.name),
|
|
44
44
|
format: "username"
|
|
45
|
-
}, null, 8, ["label"])) : (
|
|
45
|
+
}, null, 8, ["label"])) : (a(), c(y, { key: 1 }, [
|
|
46
46
|
s(F, {
|
|
47
47
|
class: "!text-general-200",
|
|
48
48
|
icon: "user"
|
|
49
49
|
}),
|
|
50
|
-
|
|
50
|
+
u("span", E, m(i.value.fullName ?? ((d = i.value) == null ? void 0 : d.name)), 1)
|
|
51
51
|
], 64)),
|
|
52
52
|
s(b, {
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: x,
|
|
54
54
|
class: "p-0 m-0 !min-w-0 !min-h-0 !h-max !w-max",
|
|
55
55
|
text: ""
|
|
56
56
|
}, {
|
|
57
|
-
default:
|
|
57
|
+
default: _(() => [
|
|
58
58
|
s(F, {
|
|
59
59
|
icon: "pencil",
|
|
60
60
|
severity: "primary"
|
|
@@ -62,33 +62,33 @@ const D = {
|
|
|
62
62
|
]),
|
|
63
63
|
_: 1
|
|
64
64
|
})
|
|
65
|
-
])) : (
|
|
65
|
+
])) : (a(), h(b, {
|
|
66
66
|
key: 1,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})),
|
|
67
|
+
label: n.$t("Select User"),
|
|
68
|
+
onClick: t[0] || (t[0] = (o) => l.value = !0)
|
|
69
|
+
}, null, 8, ["label"])),
|
|
70
70
|
s(S, {
|
|
71
|
-
visible:
|
|
72
|
-
"onUpdate:visible": t[1] || (t[1] = (
|
|
71
|
+
visible: l.value,
|
|
72
|
+
"onUpdate:visible": t[1] || (t[1] = (o) => l.value = o),
|
|
73
73
|
description: e.description,
|
|
74
74
|
"fetch-function": k,
|
|
75
75
|
"fetch-option-function": w,
|
|
76
76
|
header: e.header,
|
|
77
77
|
list: e.list,
|
|
78
|
-
onSelected: t[2] || (t[2] = (
|
|
78
|
+
onSelected: t[2] || (t[2] = (o) => n.$emit("update:modelValue", o)),
|
|
79
79
|
"selection-type": "single"
|
|
80
80
|
}, null, 8, ["visible", "description", "header", "list"]),
|
|
81
81
|
s(O, {
|
|
82
|
-
visible:
|
|
83
|
-
"onUpdate:visible": t[3] || (t[3] = (
|
|
82
|
+
visible: r.value,
|
|
83
|
+
"onUpdate:visible": t[3] || (t[3] = (o) => r.value = o),
|
|
84
84
|
header: e.confirmHeader ?? "-",
|
|
85
|
-
onConfirm:
|
|
85
|
+
onConfirm: C,
|
|
86
86
|
"confirm-label": "Continue",
|
|
87
87
|
severity: "danger"
|
|
88
88
|
}, {
|
|
89
|
-
body:
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
body: _(() => [
|
|
90
|
+
u("p", null, m(n.$t(e.confirmBody)), 1),
|
|
91
|
+
u("p", null, m(n.$t("Are you sure you want to continue?")), 1)
|
|
92
92
|
]),
|
|
93
93
|
_: 1
|
|
94
94
|
}, 8, ["visible", "header"])
|
package/checkbox/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as S, mergeModels as y, inject as w, useModel as N, reactive as q, onMounted as M, computed as V, watch as h, createElementBlock as L, openBlock as k, mergeProps as d, unref as u, createElementVNode as c, renderSlot as P, createVNode as I, normalizeClass as
|
|
1
|
+
import { defineComponent as S, mergeModels as y, inject as w, useModel as N, reactive as q, onMounted as M, computed as V, watch as h, createElementBlock as L, openBlock as k, mergeProps as d, unref as u, createElementVNode as c, renderSlot as P, createVNode as I, normalizeClass as $, createTextVNode as j, createBlock as A, createCommentVNode as E, toDisplayString as F } from "vue";
|
|
2
2
|
import { u as O } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
|
-
import { c as T, e as
|
|
3
|
+
import { c as T, e as x } from "../utils/object.util.es.js";
|
|
4
4
|
import { _ as B } from "../icon/index.es.js";
|
|
5
5
|
const z = ["data-p-disabled", "data-p-highlight"], D = ["id", "aria-invalid", "aria-label", "aria-labelledby", "checked", "disabled", "input-id", "name", "readonly", "required", "tabindex", "value"], Q = /* @__PURE__ */ S({
|
|
6
6
|
__name: "Checkbox",
|
|
@@ -51,7 +51,7 @@ const z = ["data-p-disabled", "data-p-highlight"], D = ["id", "aria-invalid", "a
|
|
|
51
51
|
let t;
|
|
52
52
|
e.binary && !e.triState ? t = o.value ? e.falseValue : e.trueValue : e.triState ? t = // eslint-disable-next-line no-nested-ternary
|
|
53
53
|
l.value == null ? !1 : l.value === !1 ? !0 : null : Array.isArray(e.modelValue) && (o.value ? t = e.modelValue.filter(
|
|
54
|
-
(r) =>
|
|
54
|
+
(r) => !x(r, e.value)
|
|
55
55
|
) : t = e.modelValue ? [...e.modelValue, e.value] : [e.value]), b.value = t, l.value = t, s("change", a);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
@@ -109,14 +109,14 @@ const z = ["data-p-disabled", "data-p-highlight"], D = ["id", "aria-invalid", "a
|
|
|
109
109
|
var n;
|
|
110
110
|
return [
|
|
111
111
|
I(B, {
|
|
112
|
-
class:
|
|
112
|
+
class: $([...(n = u(i)) == null ? void 0 : n.icon.class, { "text-transparent": !o.value }]),
|
|
113
113
|
icon: o.value ? "check" : v.value ? "subtract" : null
|
|
114
114
|
}, null, 8, ["class", "icon"])
|
|
115
115
|
];
|
|
116
116
|
})
|
|
117
117
|
], 16),
|
|
118
118
|
c("span", d(u(i).label({ props: e }), { "data-wv-section": "checkbox-label" }), [
|
|
119
|
-
|
|
119
|
+
j(F(a.$t(a.label)) + " ", 1),
|
|
120
120
|
a.tooltip ? (k(), A(B, d({
|
|
121
121
|
key: 0,
|
|
122
122
|
info: a.tooltip,
|