@fewangsit/wangsvue-gsts 1.0.0-alpha.39 → 1.0.0-alpha.40
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/backgroundimagecropper/index.es.js +2 -2
- package/basecalendar/index.es.js +270 -261
- package/basecalendartimezone/index.es.js +1033 -0
- package/calendar/index.es.js +62 -42
- package/datatable/index.es.js +1 -1
- package/filtercontainer/index.d.ts +6 -1
- package/filtercontainer/index.es.js +26 -25
- package/icon/index.d.ts +2 -0
- package/multiselect/index.d.ts +5 -0
- package/multiselect/index.es.js +67 -54
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +2 -2
- package/vendor/luxon/src/datetime.es.js +1845 -0
- package/vendor/luxon/src/duration.es.js +734 -0
- package/vendor/luxon/src/errors.es.js +40 -0
- package/vendor/luxon/src/impl/conversions.es.js +92 -0
- package/vendor/luxon/src/impl/diff.es.js +36 -0
- package/vendor/luxon/src/impl/digits.es.js +77 -0
- package/vendor/luxon/src/impl/english.es.js +132 -0
- package/vendor/luxon/src/impl/formats.es.js +150 -0
- package/vendor/luxon/src/impl/formatter.es.js +274 -0
- package/vendor/luxon/src/impl/invalid.es.js +11 -0
- package/vendor/luxon/src/impl/locale.es.js +293 -0
- package/vendor/luxon/src/impl/regexParser.es.js +202 -0
- package/vendor/luxon/src/impl/tokenParser.es.js +344 -0
- package/vendor/luxon/src/impl/util.es.js +217 -0
- package/vendor/luxon/src/impl/zoneUtil.es.js +19 -0
- package/vendor/luxon/src/info.es.js +180 -0
- package/vendor/luxon/src/interval.es.js +477 -0
- package/vendor/luxon/src/luxon.es.js +2 -0
- package/vendor/luxon/src/settings.es.js +150 -0
- package/vendor/luxon/src/zone.es.js +88 -0
- package/vendor/luxon/src/zones/IANAZone.es.js +181 -0
- package/vendor/luxon/src/zones/fixedOffsetZone.es.js +125 -0
- package/vendor/luxon/src/zones/invalidZone.es.js +41 -0
- package/vendor/luxon/src/zones/systemZone.es.js +47 -0
- package/wangsvue-gsts.esm.browser.js +20519 -13952
- package/wangsvue-gsts.system.js +60 -60
package/calendar/index.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, onMounted as $, ref as B, computed as v, watch as f, watchEffect as U, createBlock as T, unref as c, openBlock as w, mergeProps as C, withCtx as s, renderSlot as m, nextTick as x } from "vue";
|
|
2
2
|
import { u as L } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
3
|
import { u as O } from "../plugins/WangsVue.es.js";
|
|
4
4
|
import { a as N } from "../utils/textFormatter.util.es.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
|
|
5
|
+
import { _ as A } from "../basecalendar/index.es.js";
|
|
6
|
+
import { _ as E } from "../basecalendartimezone/index.es.js";
|
|
7
|
+
const P = /* @__PURE__ */ I({
|
|
7
8
|
__name: "Calendar",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: {},
|
|
@@ -48,75 +49,94 @@ const Y = /* @__PURE__ */ C({
|
|
|
48
49
|
exactSelection: { type: Boolean }
|
|
49
50
|
},
|
|
50
51
|
emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
|
|
51
|
-
setup(
|
|
52
|
-
|
|
53
|
-
F
|
|
54
|
-
|
|
52
|
+
setup(F, { emit: D }) {
|
|
53
|
+
var h;
|
|
54
|
+
const e = F, p = D;
|
|
55
|
+
$(() => {
|
|
56
|
+
e.dateValue != null && (t.value = u(e.dateValue), r.value = t.value, n.value++), e.epochTimeMillis != null && (t.value = u(e.epochTimeMillis), r.value = t.value, n.value++);
|
|
55
57
|
});
|
|
56
|
-
const {
|
|
57
|
-
value:
|
|
58
|
+
const i = JSON.parse(localStorage.getItem("user") || "{}"), S = (h = i == null ? void 0 : i.generalSetting) == null ? void 0 : h.timezone, { locale: b } = O("Calendar"), t = B(), n = B(0), { value: r, errorMessage: y } = e.useValidator ? L(e.fieldName ?? "date", (a) => k(a)) : {
|
|
59
|
+
value: v({
|
|
58
60
|
get: () => e.modelValue,
|
|
59
61
|
set: (a) => {
|
|
60
|
-
|
|
62
|
+
p("update:modelValue", a);
|
|
61
63
|
}
|
|
62
64
|
})
|
|
63
|
-
},
|
|
64
|
-
() => e.invalid || "errorMessage" in
|
|
65
|
-
),
|
|
66
|
-
var
|
|
67
|
-
const a =
|
|
68
|
-
return e.hourFormat ? e.hourFormat : (
|
|
69
|
-
}),
|
|
70
|
-
var l,
|
|
71
|
-
return await
|
|
72
|
-
},
|
|
65
|
+
}, V = v(
|
|
66
|
+
() => e.invalid || "errorMessage" in r && !!r.errorMessage
|
|
67
|
+
), g = v(() => {
|
|
68
|
+
var l, o;
|
|
69
|
+
const a = (l = i == null ? void 0 : i.generalSetting) == null ? void 0 : l.timeFormat;
|
|
70
|
+
return e.hourFormat ? e.hourFormat : (o = a == null ? void 0 : a.toLowerCase()) != null && o.includes("pm") ? "12" : "24";
|
|
71
|
+
}), k = async (a) => {
|
|
72
|
+
var l, o;
|
|
73
|
+
return await x(), typeof e.validatorMessage == "string" && e.invalid ? e.validatorMessage : typeof e.validatorMessage != "string" && !a && e.mandatory ? ((l = e.validatorMessage) == null ? void 0 : l.empty) ?? M() : !a && e.mandatory ? ((o = e.customValidation) == null ? void 0 : o.empty) ?? M() : !0;
|
|
74
|
+
}, M = () => {
|
|
73
75
|
var a;
|
|
74
|
-
return
|
|
76
|
+
return b.emptyInvalidText.replace("{label}", e.label).replace(
|
|
75
77
|
"{formattedLabel}",
|
|
76
78
|
(a = N(e.label)) == null ? void 0 : a.toLowerCase()
|
|
77
79
|
);
|
|
78
|
-
},
|
|
79
|
-
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (
|
|
80
|
+
}, d = (a, l) => {
|
|
81
|
+
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (r.value = l), a === "date" && e.useValidator && p("update:modelValue", l), a === "millis" && p("update:epochTimeMillis", l);
|
|
80
82
|
}, u = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
|
|
81
|
-
return
|
|
83
|
+
return f(
|
|
82
84
|
() => e.dateValue,
|
|
83
85
|
() => {
|
|
84
|
-
t.value = u(e.dateValue), e.useValidator && (
|
|
86
|
+
t.value = u(e.dateValue), e.useValidator && (r.value = t.value), n.value++;
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
once: !0
|
|
88
90
|
}
|
|
89
|
-
),
|
|
91
|
+
), f(
|
|
90
92
|
() => e.epochTimeMillis,
|
|
91
93
|
() => {
|
|
92
|
-
t.value = u(e.epochTimeMillis), e.useValidator && (
|
|
94
|
+
t.value = u(e.epochTimeMillis), e.useValidator && (r.value = t.value), n.value++;
|
|
93
95
|
}
|
|
94
|
-
),
|
|
96
|
+
), f(
|
|
95
97
|
() => e.modelValue,
|
|
96
98
|
() => {
|
|
97
|
-
t.value = e.modelValue, e.useValidator && (
|
|
99
|
+
t.value = e.modelValue, e.useValidator && (r.value = t.value);
|
|
98
100
|
}
|
|
99
|
-
),
|
|
100
|
-
t.value = e.valueFormat === "date" ?
|
|
101
|
-
}), (a, l) => (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
), U(() => {
|
|
102
|
+
t.value = e.valueFormat === "date" ? r.value : r.value ? u(r.value) : r.value;
|
|
103
|
+
}), (a, l) => c(S) ? (w(), T(E, C({
|
|
104
|
+
key: n.value + 1
|
|
105
|
+
}, e, {
|
|
106
|
+
"error-message": c(y),
|
|
107
|
+
"hour-format": g.value,
|
|
108
|
+
invalid: V.value,
|
|
105
109
|
"model-value": t.value,
|
|
106
110
|
"selection-mode": a.selectionMode || a.mode,
|
|
107
|
-
"onUpdate:epochTimeMillis": l[0] || (l[0] = (
|
|
108
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
111
|
+
"onUpdate:epochTimeMillis": l[0] || (l[0] = (o) => d("millis", o)),
|
|
112
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => d("date", o))
|
|
109
113
|
}), {
|
|
110
|
-
default:
|
|
111
|
-
|
|
114
|
+
default: s(({ onClick: o }) => [
|
|
115
|
+
m(a.$slots, "default", { onClick: o })
|
|
112
116
|
]),
|
|
113
|
-
"addon-overlay":
|
|
114
|
-
|
|
117
|
+
"addon-overlay": s(() => [
|
|
118
|
+
m(a.$slots, "addon-overlay")
|
|
119
|
+
]),
|
|
120
|
+
_: 3
|
|
121
|
+
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"])) : (w(), T(A, C({ key: n.value }, e, {
|
|
122
|
+
"error-message": c(y),
|
|
123
|
+
"hour-format": g.value,
|
|
124
|
+
invalid: V.value,
|
|
125
|
+
"model-value": t.value,
|
|
126
|
+
"selection-mode": a.selectionMode || a.mode,
|
|
127
|
+
"onUpdate:epochTimeMillis": l[2] || (l[2] = (o) => d("millis", o)),
|
|
128
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => d("date", o))
|
|
129
|
+
}), {
|
|
130
|
+
default: s(({ onClick: o }) => [
|
|
131
|
+
m(a.$slots, "default", { onClick: o })
|
|
132
|
+
]),
|
|
133
|
+
"addon-overlay": s(() => [
|
|
134
|
+
m(a.$slots, "addon-overlay")
|
|
115
135
|
]),
|
|
116
136
|
_: 3
|
|
117
137
|
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"]));
|
|
118
138
|
}
|
|
119
139
|
});
|
|
120
140
|
export {
|
|
121
|
-
|
|
141
|
+
P as _
|
|
122
142
|
};
|
package/datatable/index.es.js
CHANGED
|
@@ -1016,7 +1016,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
|
|
|
1016
1016
|
], 16);
|
|
1017
1017
|
};
|
|
1018
1018
|
}
|
|
1019
|
-
}), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-
|
|
1019
|
+
}), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-e75977eb"]]);
|
|
1020
1020
|
export {
|
|
1021
1021
|
Ol as D
|
|
1022
1022
|
};
|
|
@@ -26,7 +26,7 @@ type BaseSelectField<OptionsQueryParams extends QueryParams> = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Represents a function type for fetching options based on query parameters.
|
|
28
28
|
*
|
|
29
|
-
* @template
|
|
29
|
+
* @template OptionsQueryParams - The type of query parameters, extending `QueryParams`. Defaults to `any`.
|
|
30
30
|
*
|
|
31
31
|
* This function can have one of the following signatures:
|
|
32
32
|
* - A synchronous function that takes query parameters and returns an array of `Option` objects.
|
|
@@ -43,6 +43,11 @@ type BaseSelectField<OptionsQueryParams extends QueryParams> = {
|
|
|
43
43
|
args: OptionsQueryParams,
|
|
44
44
|
): Option[] | Promise<Option[]> | Promise<AxiosResponse<FetchOptionResponse>>;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Whether to fetch options when the component is mounted. Useful when the dropdown/multiselect has an initial value.
|
|
48
|
+
* For now, this is only applicable to quickfilter, though filtercontainer support can be added.
|
|
49
|
+
*/
|
|
50
|
+
fetchOnMount?: boolean;
|
|
46
51
|
optionField?: keyof OptionsQueryParams; // @example - actionOptions
|
|
47
52
|
params?: OptionsQueryParams; // Additional QueryParams for the fetchOptionFn
|
|
48
53
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as R, ref as N, shallowRef as k, onMounted as G, onBeforeUnmount as I, watch as Q, withDirectives as z, createElementBlock as S, openBlock as h, mergeProps as b, withModifiers as X, unref as w, createElementVNode as Y, Fragment as B, renderList as Z, createBlock as _, renderSlot as ee, createVNode as M, vShow as te, withCtx as ae } from "vue";
|
|
2
2
|
import { _ as oe } from "../buttonselecttree/index.es.js";
|
|
3
3
|
import { a as re } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
4
4
|
import { e as p } from "../event-bus/index.es.js";
|
|
5
5
|
import { u as se } from "../plugins/WangsVue.es.js";
|
|
6
6
|
import { g as L, s as ne } from "../utils/object.util.es.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as x } from "../button/index.es.js";
|
|
8
8
|
import { _ as le } from "../calendar/index.es.js";
|
|
9
9
|
import { _ as ie } from "../dropdown/index.es.js";
|
|
10
10
|
import { _ as ce } from "../inputrangenumber/index.es.js";
|
|
@@ -20,12 +20,12 @@ const J = (n) => {
|
|
|
20
20
|
}, me = (n, u, o) => {
|
|
21
21
|
const l = Object.keys(n), s = {};
|
|
22
22
|
p.emit("multi-select:hide-overlay"), l.forEach((r) => {
|
|
23
|
-
var
|
|
24
|
-
const i = Array.isArray(n[r]), F = typeof n[r] == "string", c = i ? (
|
|
23
|
+
var d;
|
|
24
|
+
const i = Array.isArray(n[r]), F = typeof n[r] == "string", c = i ? (d = n[r]) == null ? void 0 : d.filter((v) => v != null) : n[r];
|
|
25
25
|
if ((c != null && !i || i && c.length) && !F) {
|
|
26
26
|
if (Array.isArray(c) && c.every(
|
|
27
|
-
(
|
|
28
|
-
!isNaN(new Date(
|
|
27
|
+
(f) => typeof f == "number" && f > 9466848e5 && // Greater than 2000-01-01 00:00:00 UTC (milliseconds)
|
|
28
|
+
!isNaN(new Date(f).getTime())
|
|
29
29
|
// Converts to a valid date
|
|
30
30
|
)) {
|
|
31
31
|
s[r] = JSON.stringify(
|
|
@@ -58,10 +58,10 @@ const J = (n) => {
|
|
|
58
58
|
}), p.emit("data-table:clear-selected-data", {
|
|
59
59
|
tableName: u
|
|
60
60
|
}), l == null || l("apply", s);
|
|
61
|
-
},
|
|
61
|
+
}, de = {
|
|
62
62
|
class: "flex items-end justify-end gap-2",
|
|
63
63
|
"data-wv-section": "filteractionbuttons"
|
|
64
|
-
},
|
|
64
|
+
}, fe = /* @__PURE__ */ R({
|
|
65
65
|
inheritAttrs: !1,
|
|
66
66
|
__name: "FilterContainer",
|
|
67
67
|
props: {
|
|
@@ -72,7 +72,7 @@ const J = (n) => {
|
|
|
72
72
|
},
|
|
73
73
|
emits: ["apply"],
|
|
74
74
|
setup(n, { emit: u }) {
|
|
75
|
-
const o = n, l = u, { locale: s } = se("FilterContainer"), { resetForm: r, handleSubmit: i, setValues: F } = re(), c = N({}),
|
|
75
|
+
const o = n, l = u, { locale: s } = se("FilterContainer"), { resetForm: r, handleSubmit: i, setValues: F } = re(), c = N({}), d = N({}), v = k(), f = N(null), T = k(!1), O = k(0);
|
|
76
76
|
G(() => {
|
|
77
77
|
V(), p.on("show-filter", C), p.on("data-table:updated", D), U();
|
|
78
78
|
}), I(() => {
|
|
@@ -86,15 +86,15 @@ const J = (n) => {
|
|
|
86
86
|
t.tableName === o.tableName && (v.value = t.data);
|
|
87
87
|
}, P = async (t, a, e = {}) => {
|
|
88
88
|
if (o.static && !t)
|
|
89
|
-
|
|
89
|
+
d.value[a] = W(a);
|
|
90
90
|
else
|
|
91
91
|
try {
|
|
92
92
|
c.value[a] = !0;
|
|
93
93
|
const m = { [a]: !0, ...e }, y = await (t == null ? void 0 : t(m));
|
|
94
94
|
if ("data" in y) {
|
|
95
95
|
const { data: $ } = y;
|
|
96
|
-
|
|
97
|
-
} else Array.isArray(y) && (
|
|
96
|
+
d.value[a] = $.data[a];
|
|
97
|
+
} else Array.isArray(y) && (d.value[a] = y);
|
|
98
98
|
} catch (m) {
|
|
99
99
|
console.error(m);
|
|
100
100
|
} finally {
|
|
@@ -109,8 +109,8 @@ const J = (n) => {
|
|
|
109
109
|
}
|
|
110
110
|
return Array.from(a).map((e) => ({ label: e, value: e }));
|
|
111
111
|
}, V = () => {
|
|
112
|
-
if (
|
|
113
|
-
const { children: t } =
|
|
112
|
+
if (f.value) {
|
|
113
|
+
const { children: t } = f.value, a = f.value.childElementCount, e = a % o.fieldsPerRow;
|
|
114
114
|
let [m, y] = [1, 1];
|
|
115
115
|
for (const $ in Array.from({ length: a })) {
|
|
116
116
|
const q = Number($) === a - 1;
|
|
@@ -172,9 +172,9 @@ const J = (n) => {
|
|
|
172
172
|
return o.static ? `${t.field}.value` : `${t.field}`;
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
-
return Q(() => o.fields, V), (t, a) => z((h(),
|
|
175
|
+
return Q(() => o.fields, V), (t, a) => z((h(), S("form", b({
|
|
176
176
|
ref_key: "container",
|
|
177
|
-
ref:
|
|
177
|
+
ref: f
|
|
178
178
|
}, t.$preset.filtercontainer.root, {
|
|
179
179
|
style: `grid-template-columns: repeat(${t.fieldsPerRow}, 1fr)`,
|
|
180
180
|
onSubmit: a[0] || (a[0] = X(
|
|
@@ -184,7 +184,7 @@ const J = (n) => {
|
|
|
184
184
|
)),
|
|
185
185
|
"data-wv-name": "filtercontainer"
|
|
186
186
|
}), [
|
|
187
|
-
(h(!0),
|
|
187
|
+
(h(!0), S(B, null, Z(w(A), (e) => (h(), S(B, {
|
|
188
188
|
key: JSON.stringify(e) + O.value
|
|
189
189
|
}, [
|
|
190
190
|
e.type == "rangenumber" ? (h(), _(ce, b({
|
|
@@ -203,13 +203,14 @@ const J = (n) => {
|
|
|
203
203
|
"field-name": g(e),
|
|
204
204
|
loading: c.value[e.optionField ?? e.field],
|
|
205
205
|
mandatory: !1,
|
|
206
|
-
options:
|
|
206
|
+
options: d.value[e.optionField ?? e.field],
|
|
207
207
|
"show-optional-text": !1,
|
|
208
208
|
onShow: (m) => P(
|
|
209
209
|
e.fetchOptionFn,
|
|
210
210
|
e.optionField ?? e.field,
|
|
211
211
|
e.params
|
|
212
212
|
),
|
|
213
|
+
"hide-header-checkbox": "",
|
|
213
214
|
"option-label": "label",
|
|
214
215
|
"option-value": "value",
|
|
215
216
|
"use-validator": ""
|
|
@@ -220,7 +221,7 @@ const J = (n) => {
|
|
|
220
221
|
"field-name": g(e),
|
|
221
222
|
loading: c.value[e.field],
|
|
222
223
|
mandatory: !1,
|
|
223
|
-
options:
|
|
224
|
+
options: d.value[e.optionField ?? e.field],
|
|
224
225
|
"show-optional-text": !1,
|
|
225
226
|
onShow: (m) => P(
|
|
226
227
|
e.fetchOptionFn,
|
|
@@ -245,14 +246,14 @@ const J = (n) => {
|
|
|
245
246
|
fieldName: g(e)
|
|
246
247
|
})
|
|
247
248
|
], 64))), 128)),
|
|
248
|
-
Y("div",
|
|
249
|
-
M(
|
|
249
|
+
Y("div", de, [
|
|
250
|
+
M(x, {
|
|
250
251
|
label: w(s).clearFieldText,
|
|
251
252
|
onClick: j,
|
|
252
253
|
"data-wv-section": "clearbutton",
|
|
253
254
|
text: ""
|
|
254
255
|
}, null, 8, ["label"]),
|
|
255
|
-
M(
|
|
256
|
+
M(x, {
|
|
256
257
|
label: w(s).applyText,
|
|
257
258
|
onClick: w(E),
|
|
258
259
|
"data-wv-section": "applybutton",
|
|
@@ -263,10 +264,10 @@ const J = (n) => {
|
|
|
263
264
|
[te, T.value]
|
|
264
265
|
]);
|
|
265
266
|
}
|
|
266
|
-
}), Ne = /* @__PURE__ */
|
|
267
|
+
}), Ne = /* @__PURE__ */ R({
|
|
267
268
|
__name: "FilterContainer",
|
|
268
269
|
setup(n) {
|
|
269
|
-
return (u, o) => (h(), _(
|
|
270
|
+
return (u, o) => (h(), _(fe, b({
|
|
270
271
|
fields: u.$attrs.fields
|
|
271
272
|
}, u.$attrs), {
|
|
272
273
|
field: ae(({ field: l, fieldName: s }) => [
|
|
@@ -286,6 +287,6 @@ const J = (n) => {
|
|
|
286
287
|
}
|
|
287
288
|
});
|
|
288
289
|
export {
|
|
289
|
-
|
|
290
|
+
fe as _,
|
|
290
291
|
Ne as a
|
|
291
292
|
};
|
package/icon/index.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ export type WangsIcons =
|
|
|
144
144
|
| 'node-tree'
|
|
145
145
|
| 'note'
|
|
146
146
|
| 'notification'
|
|
147
|
+
| 'organization-chart'
|
|
147
148
|
| 'pdf'
|
|
148
149
|
| 'pair-tag'
|
|
149
150
|
| 'pencil'
|
|
@@ -181,6 +182,7 @@ export type WangsIcons =
|
|
|
181
182
|
| 'star'
|
|
182
183
|
| 'store'
|
|
183
184
|
| 'subtract'
|
|
185
|
+
| 'table'
|
|
184
186
|
| 'time'
|
|
185
187
|
| 'ticket'
|
|
186
188
|
| 'tools'
|
package/multiselect/index.d.ts
CHANGED
|
@@ -133,6 +133,11 @@ export interface MultiSelectProps {
|
|
|
133
133
|
* Decides how many selected item labels to show at most.
|
|
134
134
|
*/
|
|
135
135
|
maxSelectedLabels?: number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* To disable select all functionality
|
|
139
|
+
*/
|
|
140
|
+
hideHeaderCheckbox?: boolean;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
/**
|
package/multiselect/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as z, onMounted as E, onUnmounted as
|
|
1
|
+
import { defineComponent as z, onMounted as E, onUnmounted as H, inject as T, shallowRef as U, ref as A, reactive as R, computed as b, watch as v, createBlock as V, openBlock as w, withCtx as i, createVNode as r, normalizeClass as D, renderSlot as F, unref as t, mergeProps as k, createSlots as W, normalizeProps as p, guardReactiveProps as f, withModifiers as q, createElementVNode as G, toDisplayString as J, createCommentVNode as K } from "vue";
|
|
2
2
|
import { u as Q } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
|
-
import { e as
|
|
3
|
+
import { e as C } from "../event-bus/index.es.js";
|
|
4
4
|
import { u as X } from "../plugins/WangsVue.es.js";
|
|
5
5
|
import { f as Y } from "../utils/filterOptions.util.es.js";
|
|
6
6
|
import { a as Z } from "../utils/textFormatter.util.es.js";
|
|
7
7
|
import { s as ee } from "../vendor/primevue/multiselect/multiselect.esm.es.js";
|
|
8
|
-
import { _ as
|
|
8
|
+
import { _ as S } from "../button/index.es.js";
|
|
9
9
|
import { _ as le } from "../fieldwrapper/index.es.js";
|
|
10
10
|
import { _ as c } from "../icon/index.es.js";
|
|
11
11
|
import { _ as oe } from "../inputgroup/index.es.js";
|
|
12
12
|
import { _ as ae } from "../validatormessage/index.es.js";
|
|
13
|
-
const
|
|
13
|
+
const be = /* @__PURE__ */ z({
|
|
14
14
|
__name: "MultiSelect",
|
|
15
15
|
props: {
|
|
16
16
|
modelValue: {},
|
|
@@ -33,40 +33,41 @@ const he = /* @__PURE__ */ z({
|
|
|
33
33
|
filterPlaceholder: {},
|
|
34
34
|
display: { default: "chip" },
|
|
35
35
|
selectedItemsLabel: {},
|
|
36
|
-
maxSelectedLabels: {}
|
|
36
|
+
maxSelectedLabels: {},
|
|
37
|
+
hideHeaderCheckbox: { type: Boolean, default: !1 }
|
|
37
38
|
},
|
|
38
39
|
emits: ["update:modelValue", "show", "hide"],
|
|
39
|
-
setup(
|
|
40
|
-
const e =
|
|
40
|
+
setup(M, { expose: x, emit: B }) {
|
|
41
|
+
const e = M, L = B;
|
|
41
42
|
E(() => {
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
|
|
43
|
+
_(), C.on("multi-select:hide-overlay", g);
|
|
44
|
+
}), H(() => {
|
|
45
|
+
C.off("multi-select:hide-overlay");
|
|
45
46
|
});
|
|
46
|
-
const { locale: m } = X("MultiSelect"),
|
|
47
|
+
const { locale: m } = X("MultiSelect"), s = T("preset", {}).multiselect, u = U(!1), d = A(), a = R({
|
|
47
48
|
value: e.initialValue ? e.initialValue : e.modelValue
|
|
48
|
-
}),
|
|
49
|
+
}), P = b(() => Y(e.options)), $ = b(() => {
|
|
49
50
|
var l;
|
|
50
51
|
return m.emptySelectionErrorMessage.replace("{label}", e.label).replace(
|
|
51
52
|
"{formattedLabel}",
|
|
52
53
|
(l = Z(e.label)) == null ? void 0 : l.toLowerCase()
|
|
53
54
|
);
|
|
54
|
-
}), O =
|
|
55
|
+
}), O = b(() => {
|
|
55
56
|
var l;
|
|
56
57
|
return e.loading ? m.loadingPlaceholder : e.placeholder ?? ((l = m.inputPlaceholder) == null ? void 0 : l.replace("{label}", e.label ?? "").replace("{lowercaseLabel}", (e.label ?? "").toLowerCase()));
|
|
57
|
-
}),
|
|
58
|
+
}), _ = () => {
|
|
58
59
|
var l;
|
|
59
60
|
e.useValidator && (Object.assign(
|
|
60
61
|
a,
|
|
61
62
|
Q(e.fieldName ?? "multiSelect", (o) => !(Array.isArray(o) && o.length) && e.mandatory ? typeof e.validatorMessage == "object" && "empty" in e.validatorMessage ? e.validatorMessage.empty : e.validatorMessage ?? $.value : !0)
|
|
62
63
|
), (l = e.initialValue) != null && l.length && (a.value = e.initialValue));
|
|
63
|
-
}, g = () => {
|
|
64
|
-
d.value && d.value.show();
|
|
65
64
|
}, y = () => {
|
|
65
|
+
d.value && d.value.show();
|
|
66
|
+
}, g = () => {
|
|
66
67
|
d.value && d.value.hide();
|
|
67
68
|
}, I = (l) => {
|
|
68
69
|
const o = l != null && l.length ? l : void 0;
|
|
69
|
-
|
|
70
|
+
L("update:modelValue", o);
|
|
70
71
|
};
|
|
71
72
|
return v(
|
|
72
73
|
() => a.value,
|
|
@@ -84,30 +85,30 @@ const he = /* @__PURE__ */ z({
|
|
|
84
85
|
a.value = l;
|
|
85
86
|
},
|
|
86
87
|
{ once: !0 }
|
|
87
|
-
),
|
|
88
|
+
), x({
|
|
88
89
|
isShowOverlay: u,
|
|
89
|
-
showOverlay:
|
|
90
|
-
hideOverlay:
|
|
90
|
+
showOverlay: y,
|
|
91
|
+
hideOverlay: g
|
|
91
92
|
}), (l, o) => (w(), V(le, {
|
|
92
93
|
info: l.fieldInfo,
|
|
93
94
|
label: e.label,
|
|
94
95
|
mandatory: e.mandatory,
|
|
95
96
|
"show-optional-text": l.showOptionalText
|
|
96
97
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
99
|
-
class:
|
|
98
|
+
default: i(() => [
|
|
99
|
+
r(oe, {
|
|
100
|
+
class: D({ "rounded-none !ring-0 !w-max": l.controls }),
|
|
100
101
|
disabled: e.disabled,
|
|
101
102
|
invalid: !!a.errorMessage
|
|
102
103
|
}, {
|
|
103
|
-
default:
|
|
104
|
-
var
|
|
104
|
+
default: i(() => {
|
|
105
|
+
var h;
|
|
105
106
|
return [
|
|
106
|
-
|
|
107
|
+
r(t(ee), k(e, {
|
|
107
108
|
ref_key: "multiselect",
|
|
108
109
|
ref: d,
|
|
109
110
|
modelValue: a.value,
|
|
110
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
111
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => a.value = n),
|
|
111
112
|
"aria-describedby": e.label + "error",
|
|
112
113
|
class: [
|
|
113
114
|
{
|
|
@@ -115,58 +116,70 @@ const he = /* @__PURE__ */ z({
|
|
|
115
116
|
}
|
|
116
117
|
],
|
|
117
118
|
display: e.display,
|
|
118
|
-
"filter-placeholder": e.filterPlaceholder ||
|
|
119
|
+
"filter-placeholder": e.filterPlaceholder || t(m).filterPlaceholder,
|
|
119
120
|
"max-selected-labels": e.maxSelectedLabels,
|
|
120
|
-
options:
|
|
121
|
+
options: P.value,
|
|
121
122
|
placeholder: O.value,
|
|
123
|
+
pt: {
|
|
124
|
+
headerCheckbox: {
|
|
125
|
+
...t(s).headerCheckbox,
|
|
126
|
+
root: {
|
|
127
|
+
...t(s).headerCheckbox.root,
|
|
128
|
+
class: [
|
|
129
|
+
...t(s).headerCheckbox.root.class,
|
|
130
|
+
{ hidden: l.hideHeaderCheckbox }
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
122
135
|
"selected-items-label": e.selectedItemsLabel,
|
|
123
136
|
"show-toggle-all": e.filter,
|
|
124
|
-
"virtual-scroller-options": (((
|
|
125
|
-
onHide: o[1] || (o[1] = (
|
|
126
|
-
onShow: o[2] || (o[2] = (
|
|
137
|
+
"virtual-scroller-options": (((h = l.options) == null ? void 0 : h.length) ?? 0) > 10 ? { itemSize: 32 } : void 0,
|
|
138
|
+
onHide: o[1] || (o[1] = (n) => (u.value = !1, l.$emit("hide"))),
|
|
139
|
+
onShow: o[2] || (o[2] = (n) => (l.$emit("show"), u.value = !0))
|
|
127
140
|
}), W({
|
|
128
|
-
dropdownicon:
|
|
129
|
-
|
|
141
|
+
dropdownicon: i(() => [
|
|
142
|
+
r(c, p(f(t(s).dropdownicon({ state: { isShowOverlay: u.value } }))), null, 16)
|
|
130
143
|
]),
|
|
131
|
-
headercheckboxicon:
|
|
132
|
-
|
|
144
|
+
headercheckboxicon: i(() => [
|
|
145
|
+
r(c, { icon: "check" })
|
|
133
146
|
]),
|
|
134
|
-
itemcheckboxicon:
|
|
135
|
-
|
|
147
|
+
itemcheckboxicon: i(() => [
|
|
148
|
+
r(c, { icon: "check" })
|
|
136
149
|
]),
|
|
137
|
-
filtericon:
|
|
138
|
-
|
|
150
|
+
filtericon: i(() => [
|
|
151
|
+
r(c, p(f(t(s).filtericon)), null, 16)
|
|
139
152
|
]),
|
|
140
|
-
removetokenicon:
|
|
141
|
-
|
|
142
|
-
onClick: q((j) =>
|
|
143
|
-
},
|
|
153
|
+
removetokenicon: i(({ removeCallback: n, item: N }) => [
|
|
154
|
+
r(S, k({
|
|
155
|
+
onClick: q((j) => n(j, N), ["stop"])
|
|
156
|
+
}, t(s).removeTokenIcon, {
|
|
144
157
|
icon: "close",
|
|
145
158
|
rounded: "",
|
|
146
159
|
severity: "dark",
|
|
147
160
|
text: ""
|
|
148
161
|
}), null, 16, ["onClick"])
|
|
149
162
|
]),
|
|
150
|
-
loadingicon:
|
|
151
|
-
|
|
163
|
+
loadingicon: i(() => [
|
|
164
|
+
r(c, p(f(t(s).loadingicon)), null, 16)
|
|
152
165
|
]),
|
|
153
166
|
_: 2
|
|
154
167
|
}, [
|
|
155
168
|
l.loading ? {
|
|
156
169
|
name: "value",
|
|
157
|
-
fn:
|
|
158
|
-
G("span", p(f(
|
|
170
|
+
fn: i(({ placeholder: n }) => [
|
|
171
|
+
G("span", p(f(t(s).loadingplaceholder)), J(n), 17)
|
|
159
172
|
]),
|
|
160
173
|
key: "0"
|
|
161
174
|
} : void 0
|
|
162
|
-
]), 1040, ["modelValue", "aria-describedby", "class", "display", "filter-placeholder", "max-selected-labels", "options", "placeholder", "selected-items-label", "show-toggle-all", "virtual-scroller-options"]),
|
|
163
|
-
|
|
175
|
+
]), 1040, ["modelValue", "aria-describedby", "class", "display", "filter-placeholder", "max-selected-labels", "options", "placeholder", "pt", "selected-items-label", "show-toggle-all", "virtual-scroller-options"]),
|
|
176
|
+
F(l.$slots, "trigger", {
|
|
164
177
|
disabled: e.disabled
|
|
165
178
|
}, () => [
|
|
166
|
-
l.controls ? (w(), V(
|
|
179
|
+
l.controls ? (w(), V(S, {
|
|
167
180
|
key: 0,
|
|
168
181
|
disabled: e.disabled,
|
|
169
|
-
onClick:
|
|
182
|
+
onClick: y,
|
|
170
183
|
class: "!rounded !ring-0",
|
|
171
184
|
icon: "add"
|
|
172
185
|
}, null, 8, ["disabled"])) : K("", !0)
|
|
@@ -175,7 +188,7 @@ const he = /* @__PURE__ */ z({
|
|
|
175
188
|
}),
|
|
176
189
|
_: 3
|
|
177
190
|
}, 8, ["class", "disabled", "invalid"]),
|
|
178
|
-
|
|
191
|
+
r(ae, {
|
|
179
192
|
id: e.label + "error",
|
|
180
193
|
message: a.errorMessage
|
|
181
194
|
}, null, 8, ["id", "message"])
|
|
@@ -185,5 +198,5 @@ const he = /* @__PURE__ */ z({
|
|
|
185
198
|
}
|
|
186
199
|
});
|
|
187
200
|
export {
|
|
188
|
-
|
|
201
|
+
be as _
|
|
189
202
|
};
|