@webx-ui/core 0.0.1 → 0.1.0
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/LICENSE +21 -21
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/types.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +41 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types.d.ts +18 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +37 -0
- package/dist/components/CheckboxGroup/index.d.ts +2 -0
- package/dist/components/CheckboxGroup/types.d.ts +23 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +25 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/ColorPicker/types.d.ts +21 -0
- package/dist/components/DatePicker/DatePicker.d.ts +54 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/types.d.ts +47 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +51 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/types.d.ts +37 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +52 -0
- package/dist/components/DateTimePicker/index.d.ts +1 -0
- package/dist/components/Form/Form.d.ts +32 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types.d.ts +22 -0
- package/dist/components/FormItem/FormItem.d.ts +33 -0
- package/dist/components/FormItem/index.d.ts +2 -0
- package/dist/components/FormItem/types.d.ts +24 -0
- package/dist/components/Input/Input.d.ts +11 -10
- package/dist/components/Input/types.d.ts +2 -0
- package/dist/components/InputNumber/InputNumber.d.ts +41 -0
- package/dist/components/InputNumber/index.d.ts +2 -0
- package/dist/components/InputNumber/types.d.ts +34 -0
- package/dist/components/Radio/Radio.d.ts +36 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/types.d.ts +16 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RadioGroup/types.d.ts +19 -0
- package/dist/components/Rate/Rate.d.ts +24 -0
- package/dist/components/Rate/index.d.ts +2 -0
- package/dist/components/Rate/types.d.ts +22 -0
- package/dist/components/RichText/RichText.d.ts +38 -0
- package/dist/components/RichText/ToolbarButton.d.ts +20 -0
- package/dist/components/RichText/icons.d.ts +6 -0
- package/dist/components/RichText/index.d.ts +2 -0
- package/dist/components/RichText/tools.d.ts +48 -0
- package/dist/components/RichText/types.d.ts +42 -0
- package/dist/components/Select/Select.d.ts +50 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/types.d.ts +41 -0
- package/dist/components/Slider/Slider.d.ts +26 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/types.d.ts +24 -0
- package/dist/components/Switch/Switch.d.ts +38 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/types.d.ts +18 -0
- package/dist/components/TagsInput/TagsInput.d.ts +32 -0
- package/dist/components/TagsInput/index.d.ts +2 -0
- package/dist/components/TagsInput/types.d.ts +26 -0
- package/dist/components/Textarea/Textarea.d.ts +39 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/types.d.ts +31 -0
- package/dist/components/TimePicker/TimePicker.d.ts +52 -0
- package/dist/components/TimePicker/index.d.ts +1 -0
- package/dist/components/index.d.ts +20 -1
- package/dist/composables/useFormField.d.ts +64 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2418 -164
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +12 -2
package/dist/index.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as E, computed as u, openBlock as n, createBlock as Q, resolveDynamicComponent as xe, mergeProps as K, withCtx as H, createElementBlock as d, renderSlot as P, createCommentVNode as W, useSlots as Ce, normalizeClass as U, createElementVNode as I, createTextVNode as ee, toDisplayString as N, inject as te, provide as ne, useModel as G, ref as D, onMounted as ke, watch as Z, unref as s, mergeModels as S, Fragment as X, renderList as q, createVNode as F, normalizeStyle as ae, withModifiers as le, createSlots as ue, normalizeProps as se, guardReactiveProps as de, toRef as oe, withDirectives as Ve, withKeys as Ie, vModelText as Te, nextTick as be } from "vue";
|
|
2
|
+
import { VueDatePicker as ge } from "@vuepic/vue-datepicker";
|
|
3
|
+
import { colorToHex as pe, getAreaBackgroundStyle as ze, getSliderBackgroundStyle as We, PopoverRoot as Se, PopoverAnchor as Ae, PopoverPortal as Le, PopoverContent as Re, ColorAreaRoot as He, ColorAreaArea as De, ColorAreaThumb as Fe, ColorSliderRoot as Pe, ColorSliderTrack as Ne, ColorSliderThumb as Ue, convertToHsb as he, parseColor as Ee, ComboboxRoot as Oe, ComboboxAnchor as je, ComboboxInput as Ge, ComboboxTrigger as qe, ComboboxPortal as Ke, ComboboxContent as Ye, ComboboxViewport as Xe, ComboboxEmpty as Qe, ComboboxItem as Je, ComboboxItemIndicator as Ze, SliderRoot as ea, SliderTrack as aa, SliderRange as la, SliderThumb as ta } from "reka-ui";
|
|
4
|
+
import { useEditor as oa, EditorContent as ia } from "@tiptap/vue-3";
|
|
5
|
+
import na from "@tiptap/starter-kit";
|
|
6
|
+
import { TableKit as ua } from "@tiptap/extension-table";
|
|
7
|
+
import sa from "@tiptap/extension-image";
|
|
8
|
+
import da from "@tiptap/extension-youtube";
|
|
9
|
+
import ra from "@tiptap/extension-file-handler";
|
|
10
|
+
const ca = {
|
|
3
11
|
key: 0,
|
|
4
12
|
class: "wx-button__spinner",
|
|
5
13
|
"aria-hidden": "true"
|
|
6
|
-
},
|
|
14
|
+
}, va = {
|
|
7
15
|
key: 1,
|
|
8
16
|
class: "wx-button__icon"
|
|
9
|
-
},
|
|
17
|
+
}, fa = {
|
|
10
18
|
key: 2,
|
|
11
19
|
class: "wx-button__label"
|
|
12
|
-
},
|
|
20
|
+
}, ma = /* @__PURE__ */ E({
|
|
13
21
|
name: "WxButton",
|
|
14
22
|
inheritAttrs: !1,
|
|
15
23
|
__name: "Button",
|
|
@@ -26,77 +34,844 @@ const A = {
|
|
|
26
34
|
nativeType: { default: "button" }
|
|
27
35
|
},
|
|
28
36
|
emits: ["click"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
37
|
+
setup(e, { emit: y }) {
|
|
38
|
+
const a = e, t = y, i = u(() => a.disabled || a.loading), l = u(() => a.href ? "a" : "button"), o = u(() => [
|
|
31
39
|
"wx-button",
|
|
32
|
-
`wx-button--${
|
|
33
|
-
`wx-button--${
|
|
34
|
-
`wx-button--${
|
|
40
|
+
`wx-button--${a.type}`,
|
|
41
|
+
`wx-button--${a.variant}`,
|
|
42
|
+
`wx-button--${a.size}`,
|
|
35
43
|
{
|
|
36
|
-
"wx-button--block":
|
|
37
|
-
"wx-button--round":
|
|
38
|
-
"wx-button--loading":
|
|
39
|
-
"is-disabled":
|
|
40
|
-
}
|
|
41
|
-
]), v =
|
|
42
|
-
() =>
|
|
43
|
-
href:
|
|
44
|
-
target:
|
|
44
|
+
"wx-button--block": a.block,
|
|
45
|
+
"wx-button--round": a.round,
|
|
46
|
+
"wx-button--loading": a.loading,
|
|
47
|
+
"is-disabled": i.value
|
|
48
|
+
}
|
|
49
|
+
]), v = u(
|
|
50
|
+
() => a.href ? {
|
|
51
|
+
href: i.value ? void 0 : a.href,
|
|
52
|
+
target: a.target,
|
|
45
53
|
role: "button",
|
|
46
|
-
"aria-disabled":
|
|
47
|
-
tabindex:
|
|
54
|
+
"aria-disabled": i.value ? "true" : void 0,
|
|
55
|
+
tabindex: i.value ? -1 : void 0
|
|
48
56
|
} : {
|
|
49
|
-
type:
|
|
50
|
-
disabled:
|
|
57
|
+
type: a.nativeType,
|
|
58
|
+
disabled: i.value
|
|
51
59
|
}
|
|
52
60
|
);
|
|
53
|
-
function
|
|
54
|
-
if (
|
|
55
|
-
|
|
61
|
+
function m(b) {
|
|
62
|
+
if (i.value) {
|
|
63
|
+
b.preventDefault(), b.stopPropagation();
|
|
56
64
|
return;
|
|
57
65
|
}
|
|
58
|
-
|
|
66
|
+
t("click", b);
|
|
59
67
|
}
|
|
60
|
-
return (
|
|
61
|
-
class:
|
|
62
|
-
"aria-busy":
|
|
63
|
-
onClick:
|
|
68
|
+
return (b, c) => (n(), Q(xe(l.value), K({ ...v.value, ...b.$attrs }, {
|
|
69
|
+
class: o.value,
|
|
70
|
+
"aria-busy": e.loading || void 0,
|
|
71
|
+
onClick: m
|
|
64
72
|
}), {
|
|
65
|
-
default:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
])) :
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
])) :
|
|
73
|
+
default: H(() => [
|
|
74
|
+
e.loading ? (n(), d("span", ca)) : b.$slots.icon ? (n(), d("span", va, [
|
|
75
|
+
P(b.$slots, "icon", {}, void 0, !0)
|
|
76
|
+
])) : W("", !0),
|
|
77
|
+
b.$slots.default ? (n(), d("span", fa, [
|
|
78
|
+
P(b.$slots, "default", {}, void 0, !0)
|
|
79
|
+
])) : W("", !0)
|
|
72
80
|
]),
|
|
73
81
|
_: 3
|
|
74
82
|
}, 16, ["class", "aria-busy"]));
|
|
75
83
|
}
|
|
76
|
-
}),
|
|
77
|
-
const
|
|
78
|
-
for (const [
|
|
79
|
-
|
|
80
|
-
return
|
|
81
|
-
},
|
|
84
|
+
}), j = (e, y) => {
|
|
85
|
+
const a = e.__vccOpts || e;
|
|
86
|
+
for (const [t, i] of y)
|
|
87
|
+
a[t] = i;
|
|
88
|
+
return a;
|
|
89
|
+
}, ba = /* @__PURE__ */ j(ma, [["__scopeId", "data-v-11c2b24d"]]), pa = {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "wx-card__header"
|
|
92
|
+
}, ha = { class: "wx-card__title" }, ya = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "wx-card__extra"
|
|
95
|
+
}, xa = { class: "wx-card__body" }, ka = {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "wx-card__layout"
|
|
98
|
+
}, ga = { class: "wx-card__sidebar" }, wa = { class: "wx-card__content" }, $a = {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: "wx-card__footer"
|
|
101
|
+
}, _a = /* @__PURE__ */ E({
|
|
102
|
+
name: "WxCard",
|
|
103
|
+
__name: "Card",
|
|
104
|
+
props: {
|
|
105
|
+
title: { default: void 0 },
|
|
106
|
+
shadow: { default: "always" },
|
|
107
|
+
padding: { default: "md" },
|
|
108
|
+
bordered: { type: Boolean, default: !1 }
|
|
109
|
+
},
|
|
110
|
+
setup(e) {
|
|
111
|
+
const y = e, a = Ce(), t = u(() => !!(y.title || a.header || a.extra)), i = u(() => !!a.sidebar), l = u(() => [
|
|
112
|
+
"wx-card",
|
|
113
|
+
`wx-card--shadow-${y.shadow}`,
|
|
114
|
+
`wx-card--padding-${y.padding}`,
|
|
115
|
+
{
|
|
116
|
+
"wx-card--bordered": y.bordered,
|
|
117
|
+
"wx-card--with-sidebar": i.value
|
|
118
|
+
}
|
|
119
|
+
]);
|
|
120
|
+
return (o, v) => (n(), d("section", {
|
|
121
|
+
class: U(l.value)
|
|
122
|
+
}, [
|
|
123
|
+
t.value ? (n(), d("header", pa, [
|
|
124
|
+
I("div", ha, [
|
|
125
|
+
P(o.$slots, "header", {}, () => [
|
|
126
|
+
ee(N(e.title), 1)
|
|
127
|
+
], !0)
|
|
128
|
+
]),
|
|
129
|
+
o.$slots.extra ? (n(), d("div", ya, [
|
|
130
|
+
P(o.$slots, "extra", {}, void 0, !0)
|
|
131
|
+
])) : W("", !0)
|
|
132
|
+
])) : W("", !0),
|
|
133
|
+
I("div", xa, [
|
|
134
|
+
i.value ? (n(), d("div", ka, [
|
|
135
|
+
I("aside", ga, [
|
|
136
|
+
P(o.$slots, "sidebar", {}, void 0, !0)
|
|
137
|
+
]),
|
|
138
|
+
I("div", wa, [
|
|
139
|
+
P(o.$slots, "default", {}, void 0, !0)
|
|
140
|
+
])
|
|
141
|
+
])) : P(o.$slots, "default", {}, void 0, !0, 1)
|
|
142
|
+
]),
|
|
143
|
+
o.$slots.footer ? (n(), d("footer", $a, [
|
|
144
|
+
P(o.$slots, "footer", {}, void 0, !0)
|
|
145
|
+
])) : W("", !0)
|
|
146
|
+
], 2));
|
|
147
|
+
}
|
|
148
|
+
}), Ba = /* @__PURE__ */ j(_a, [["__scopeId", "data-v-604cd918"]]), ce = /* @__PURE__ */ Symbol("wx-form"), we = /* @__PURE__ */ Symbol("wx-form-item");
|
|
149
|
+
let ye = 0;
|
|
150
|
+
function ve(e = "wx") {
|
|
151
|
+
return ye += 1, `${e}-${ye}`;
|
|
152
|
+
}
|
|
153
|
+
function Y(e) {
|
|
154
|
+
const y = te(ce, null), a = te(we, null), t = ve("wx-control"), i = u(() => e.id ?? a?.id.value ?? t), l = u(
|
|
155
|
+
() => e.disabled || a?.disabled.value || y?.disabled.value || !1
|
|
156
|
+
), o = u(
|
|
157
|
+
() => e.size ?? a?.size.value ?? y?.size.value ?? "md"
|
|
158
|
+
), v = u(() => e.status && e.status !== "default" ? e.status : a?.status.value ?? "default"), m = u(() => a?.describedBy.value);
|
|
159
|
+
return { id: i, disabled: l, size: o, status: v, describedBy: m, form: y, item: a };
|
|
160
|
+
}
|
|
161
|
+
const $e = /* @__PURE__ */ Symbol("wx-checkbox-group"), _e = /* @__PURE__ */ Symbol("wx-radio-group");
|
|
162
|
+
function Ma(e) {
|
|
163
|
+
ne(we, e);
|
|
164
|
+
}
|
|
165
|
+
const Ca = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], Va = {
|
|
166
|
+
class: "wx-checkbox__box",
|
|
167
|
+
"aria-hidden": "true"
|
|
168
|
+
}, Ia = {
|
|
169
|
+
class: "wx-checkbox__mark",
|
|
170
|
+
viewBox: "0 0 16 16",
|
|
171
|
+
fill: "none"
|
|
172
|
+
}, Ta = {
|
|
173
|
+
key: 0,
|
|
174
|
+
d: "M4 8h8",
|
|
175
|
+
stroke: "currentColor",
|
|
176
|
+
"stroke-width": "2",
|
|
177
|
+
"stroke-linecap": "round"
|
|
178
|
+
}, za = {
|
|
179
|
+
key: 1,
|
|
180
|
+
d: "M3.5 8.5l3 3 6-6",
|
|
181
|
+
stroke: "currentColor",
|
|
182
|
+
"stroke-width": "2",
|
|
183
|
+
"stroke-linecap": "round",
|
|
184
|
+
"stroke-linejoin": "round"
|
|
185
|
+
}, Wa = {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "wx-checkbox__label"
|
|
188
|
+
}, Sa = /* @__PURE__ */ E({
|
|
189
|
+
name: "WxCheckbox",
|
|
190
|
+
inheritAttrs: !1,
|
|
191
|
+
__name: "Checkbox",
|
|
192
|
+
props: /* @__PURE__ */ S({
|
|
193
|
+
value: { type: [String, Number, Boolean, null], default: void 0 },
|
|
194
|
+
label: { default: void 0 },
|
|
195
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
196
|
+
disabled: { type: Boolean, default: void 0 },
|
|
197
|
+
size: { default: void 0 },
|
|
198
|
+
id: { default: void 0 },
|
|
199
|
+
name: { default: void 0 },
|
|
200
|
+
ariaLabel: { default: void 0 }
|
|
201
|
+
}, {
|
|
202
|
+
modelValue: { type: Boolean, default: !1 },
|
|
203
|
+
modelModifiers: {}
|
|
204
|
+
}),
|
|
205
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
206
|
+
setup(e, { emit: y }) {
|
|
207
|
+
const a = e, t = y, i = G(e, "modelValue"), l = te($e, null), o = Y(a), v = D(null), m = u(
|
|
208
|
+
() => l ? l.modelValue.value.includes(a.value ?? null) : i.value === !0
|
|
209
|
+
), b = u(() => a.disabled || l?.disabled.value || o.disabled.value), c = u(() => a.size ?? l?.size.value ?? o.size.value), r = u(() => [
|
|
210
|
+
"wx-checkbox",
|
|
211
|
+
`wx-checkbox--${c.value}`,
|
|
212
|
+
{
|
|
213
|
+
"is-checked": m.value,
|
|
214
|
+
"is-indeterminate": a.indeterminate && !m.value,
|
|
215
|
+
"is-disabled": b.value
|
|
216
|
+
}
|
|
217
|
+
]);
|
|
218
|
+
function h() {
|
|
219
|
+
v.value && (v.value.indeterminate = a.indeterminate && !m.value);
|
|
220
|
+
}
|
|
221
|
+
ke(h), Z([() => a.indeterminate, m], h);
|
|
222
|
+
function p(T) {
|
|
223
|
+
const M = T.target.checked;
|
|
224
|
+
l ? l.toggle(a.value ?? null, M) : i.value = M, t("change", M);
|
|
225
|
+
}
|
|
226
|
+
return (T, M) => (n(), d("label", {
|
|
227
|
+
class: U(r.value)
|
|
228
|
+
}, [
|
|
229
|
+
I("input", K({
|
|
230
|
+
id: s(o).id.value,
|
|
231
|
+
ref_key: "inputRef",
|
|
232
|
+
ref: v
|
|
233
|
+
}, T.$attrs, {
|
|
234
|
+
class: "wx-checkbox__native",
|
|
235
|
+
type: "checkbox",
|
|
236
|
+
name: e.name ?? s(l)?.name.value,
|
|
237
|
+
checked: m.value,
|
|
238
|
+
disabled: b.value,
|
|
239
|
+
"aria-label": e.ariaLabel,
|
|
240
|
+
"aria-describedby": s(o).describedBy.value,
|
|
241
|
+
onChange: p
|
|
242
|
+
}), null, 16, Ca),
|
|
243
|
+
I("span", Va, [
|
|
244
|
+
(n(), d("svg", Ia, [
|
|
245
|
+
e.indeterminate && !m.value ? (n(), d("path", Ta)) : (n(), d("path", za))
|
|
246
|
+
]))
|
|
247
|
+
]),
|
|
248
|
+
e.label || T.$slots.default ? (n(), d("span", Wa, [
|
|
249
|
+
P(T.$slots, "default", {}, () => [
|
|
250
|
+
ee(N(e.label), 1)
|
|
251
|
+
], !0)
|
|
252
|
+
])) : W("", !0)
|
|
253
|
+
], 2));
|
|
254
|
+
}
|
|
255
|
+
}), Be = /* @__PURE__ */ j(Sa, [["__scopeId", "data-v-c35cc837"]]), Aa = ["aria-labelledby", "aria-describedby"], La = /* @__PURE__ */ E({
|
|
256
|
+
name: "WxCheckboxGroup",
|
|
257
|
+
__name: "CheckboxGroup",
|
|
258
|
+
props: /* @__PURE__ */ S({
|
|
259
|
+
options: { default: void 0 },
|
|
260
|
+
disabled: { type: Boolean, default: void 0 },
|
|
261
|
+
size: { default: void 0 },
|
|
262
|
+
name: { default: void 0 },
|
|
263
|
+
inline: { type: Boolean, default: !1 },
|
|
264
|
+
min: { default: void 0 },
|
|
265
|
+
max: { default: void 0 }
|
|
266
|
+
}, {
|
|
267
|
+
modelValue: { default: () => [] },
|
|
268
|
+
modelModifiers: {}
|
|
269
|
+
}),
|
|
270
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
271
|
+
setup(e, { emit: y }) {
|
|
272
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a);
|
|
273
|
+
l.item?.registerLabelTarget(void 0);
|
|
274
|
+
const o = u(() => a.disabled ?? l.disabled.value), v = u(() => a.size ?? l.size.value);
|
|
275
|
+
function m(b, c) {
|
|
276
|
+
const r = i.value ?? [];
|
|
277
|
+
if (c) {
|
|
278
|
+
if (r.includes(b) || a.max !== void 0 && r.length >= a.max) return;
|
|
279
|
+
i.value = [...r, b];
|
|
280
|
+
} else {
|
|
281
|
+
if (a.min !== void 0 && r.length <= a.min) return;
|
|
282
|
+
i.value = r.filter((h) => h !== b);
|
|
283
|
+
}
|
|
284
|
+
t("change", i.value);
|
|
285
|
+
}
|
|
286
|
+
return ne($e, {
|
|
287
|
+
name: u(() => a.name),
|
|
288
|
+
modelValue: u(() => i.value ?? []),
|
|
289
|
+
disabled: o,
|
|
290
|
+
size: v,
|
|
291
|
+
toggle: m
|
|
292
|
+
}), (b, c) => (n(), d("div", {
|
|
293
|
+
class: U(["wx-checkbox-group", { "wx-checkbox-group--inline": e.inline }]),
|
|
294
|
+
role: "group",
|
|
295
|
+
"aria-labelledby": s(l).item ? `${s(l).item.id.value}-label` : void 0,
|
|
296
|
+
"aria-describedby": s(l).describedBy.value
|
|
297
|
+
}, [
|
|
298
|
+
P(b.$slots, "default", {}, () => [
|
|
299
|
+
(n(!0), d(X, null, q(e.options, (r) => (n(), Q(Be, {
|
|
300
|
+
key: String(r.value),
|
|
301
|
+
value: r.value,
|
|
302
|
+
label: r.label,
|
|
303
|
+
disabled: r.disabled
|
|
304
|
+
}, null, 8, ["value", "label", "disabled"]))), 128))
|
|
305
|
+
], !0)
|
|
306
|
+
], 10, Aa));
|
|
307
|
+
}
|
|
308
|
+
}), Ra = /* @__PURE__ */ j(La, [["__scopeId", "data-v-8a0c916b"]]), Ha = ["disabled", "aria-label"], Da = ["id", "value", "name", "placeholder", "disabled", "readonly", "aria-label", "aria-describedby", "aria-invalid"], Fa = {
|
|
309
|
+
key: 0,
|
|
310
|
+
class: "wx-color-picker__presets"
|
|
311
|
+
}, Pa = ["aria-label", "aria-pressed", "onClick"], Na = /* @__PURE__ */ E({
|
|
312
|
+
name: "WxColorPicker",
|
|
313
|
+
inheritAttrs: !1,
|
|
314
|
+
__name: "ColorPicker",
|
|
315
|
+
props: /* @__PURE__ */ S({
|
|
316
|
+
presets: { default: () => [] },
|
|
317
|
+
clearable: { type: Boolean, default: !1 },
|
|
318
|
+
placeholder: { default: "#000000" },
|
|
319
|
+
teleport: { type: Boolean, default: !0 },
|
|
320
|
+
disabled: { type: Boolean, default: void 0 },
|
|
321
|
+
readonly: { type: Boolean, default: !1 },
|
|
322
|
+
size: { default: void 0 },
|
|
323
|
+
status: { default: void 0 },
|
|
324
|
+
id: { default: void 0 },
|
|
325
|
+
name: { default: void 0 },
|
|
326
|
+
ariaLabel: { default: void 0 }
|
|
327
|
+
}, {
|
|
328
|
+
modelValue: { default: null },
|
|
329
|
+
modelModifiers: {}
|
|
330
|
+
}),
|
|
331
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
332
|
+
setup(e, { emit: y }) {
|
|
333
|
+
const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i, t = e, i = y, l = G(e, "modelValue"), o = Y(t), v = D(!1), m = D(l.value ?? "");
|
|
334
|
+
Z(l, (x) => {
|
|
335
|
+
m.value = x ?? "";
|
|
336
|
+
});
|
|
337
|
+
function b(x) {
|
|
338
|
+
return he(Ee(x));
|
|
339
|
+
}
|
|
340
|
+
const c = D(
|
|
341
|
+
b(l.value && a.test(l.value) ? l.value : "#427edd")
|
|
342
|
+
);
|
|
343
|
+
Z(l, (x) => {
|
|
344
|
+
const k = x && a.test(x) ? x : null;
|
|
345
|
+
!k || k === pe(c.value).toLowerCase() || (c.value = b(k));
|
|
346
|
+
});
|
|
347
|
+
const r = u(
|
|
348
|
+
() => ze(c.value, "saturation", "brightness", "hsb")
|
|
349
|
+
), h = u(() => We(c.value, "hue", "hsb")), p = u(() => l.value && a.test(l.value) ? l.value : null), T = u(() => [
|
|
350
|
+
"wx-color-picker",
|
|
351
|
+
`wx-color-picker--${o.size.value}`,
|
|
352
|
+
{
|
|
353
|
+
[`wx-color-picker--${o.status.value}`]: o.status.value !== "default",
|
|
354
|
+
"is-open": v.value,
|
|
355
|
+
"is-disabled": o.disabled.value
|
|
356
|
+
}
|
|
357
|
+
]);
|
|
358
|
+
function M(x) {
|
|
359
|
+
l.value !== x && (l.value = x, i("change", x));
|
|
360
|
+
}
|
|
361
|
+
function g(x) {
|
|
362
|
+
const k = x.target.value;
|
|
363
|
+
m.value = k, a.test(k) ? M(k.toLowerCase()) : k === "" && M(null);
|
|
364
|
+
}
|
|
365
|
+
function C() {
|
|
366
|
+
if (m.value === "") {
|
|
367
|
+
M(null);
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const x = m.value.startsWith("#") ? m.value : `#${m.value}`;
|
|
371
|
+
a.test(x) ? (M(x.toLowerCase()), m.value = x.toLowerCase()) : m.value = l.value ?? "";
|
|
372
|
+
}
|
|
373
|
+
function f(x) {
|
|
374
|
+
c.value = he(x), M(pe(x).toLowerCase());
|
|
375
|
+
}
|
|
376
|
+
function $(x) {
|
|
377
|
+
const k = x.toLowerCase();
|
|
378
|
+
c.value = b(k), M(k);
|
|
379
|
+
}
|
|
380
|
+
function V() {
|
|
381
|
+
M(null), m.value = "";
|
|
382
|
+
}
|
|
383
|
+
function L() {
|
|
384
|
+
!o.disabled.value && !t.readonly && (v.value = !0);
|
|
385
|
+
}
|
|
386
|
+
return (x, k) => (n(), Q(s(Se), {
|
|
387
|
+
open: v.value,
|
|
388
|
+
"onUpdate:open": k[0] || (k[0] = (R) => v.value = R)
|
|
389
|
+
}, {
|
|
390
|
+
default: H(() => [
|
|
391
|
+
I("div", {
|
|
392
|
+
class: U(T.value)
|
|
393
|
+
}, [
|
|
394
|
+
F(s(Ae), { "as-child": "" }, {
|
|
395
|
+
default: H(() => [
|
|
396
|
+
I("div", {
|
|
397
|
+
class: "wx-color-picker__field",
|
|
398
|
+
onClick: L
|
|
399
|
+
}, [
|
|
400
|
+
I("button", {
|
|
401
|
+
class: U(["wx-color-picker__swatch", { "is-empty": !p.value }]),
|
|
402
|
+
type: "button",
|
|
403
|
+
disabled: s(o).disabled.value,
|
|
404
|
+
"aria-label": e.ariaLabel ?? "Pick a colour",
|
|
405
|
+
style: ae(p.value ? { background: p.value } : void 0)
|
|
406
|
+
}, null, 14, Ha),
|
|
407
|
+
I("input", K({
|
|
408
|
+
id: s(o).id.value
|
|
409
|
+
}, x.$attrs, {
|
|
410
|
+
class: "wx-color-picker__input",
|
|
411
|
+
type: "text",
|
|
412
|
+
autocomplete: "off",
|
|
413
|
+
spellcheck: "false",
|
|
414
|
+
value: m.value,
|
|
415
|
+
name: e.name,
|
|
416
|
+
placeholder: e.placeholder,
|
|
417
|
+
disabled: s(o).disabled.value,
|
|
418
|
+
readonly: e.readonly,
|
|
419
|
+
"aria-label": e.ariaLabel,
|
|
420
|
+
"aria-describedby": s(o).describedBy.value,
|
|
421
|
+
"aria-invalid": s(o).status.value === "error" || void 0,
|
|
422
|
+
onInput: g,
|
|
423
|
+
onBlur: C
|
|
424
|
+
}), null, 16, Da),
|
|
425
|
+
e.clearable && p.value && !s(o).disabled.value ? (n(), d("button", {
|
|
426
|
+
key: 0,
|
|
427
|
+
class: "wx-color-picker__clear",
|
|
428
|
+
type: "button",
|
|
429
|
+
tabindex: "-1",
|
|
430
|
+
"aria-label": "Clear",
|
|
431
|
+
onClick: le(V, ["stop"])
|
|
432
|
+
}, " ✕ ")) : W("", !0)
|
|
433
|
+
])
|
|
434
|
+
]),
|
|
435
|
+
_: 1
|
|
436
|
+
}),
|
|
437
|
+
F(s(Le), {
|
|
438
|
+
disabled: !e.teleport
|
|
439
|
+
}, {
|
|
440
|
+
default: H(() => [
|
|
441
|
+
F(s(Re), {
|
|
442
|
+
class: "wx-color-picker__panel",
|
|
443
|
+
"side-offset": 4,
|
|
444
|
+
align: "start"
|
|
445
|
+
}, {
|
|
446
|
+
default: H(() => [
|
|
447
|
+
F(s(He), {
|
|
448
|
+
class: "wx-color-picker__area",
|
|
449
|
+
"color-space": "hsb",
|
|
450
|
+
"x-channel": "saturation",
|
|
451
|
+
"y-channel": "brightness",
|
|
452
|
+
"model-value": c.value,
|
|
453
|
+
"onUpdate:color": f
|
|
454
|
+
}, {
|
|
455
|
+
default: H(() => [
|
|
456
|
+
F(s(De), {
|
|
457
|
+
class: "wx-color-picker__area-surface",
|
|
458
|
+
style: ae(r.value)
|
|
459
|
+
}, {
|
|
460
|
+
default: H(() => [
|
|
461
|
+
F(s(Fe), { class: "wx-color-picker__thumb" })
|
|
462
|
+
]),
|
|
463
|
+
_: 1
|
|
464
|
+
}, 8, ["style"])
|
|
465
|
+
]),
|
|
466
|
+
_: 1
|
|
467
|
+
}, 8, ["model-value"]),
|
|
468
|
+
F(s(Pe), {
|
|
469
|
+
class: "wx-color-picker__hue",
|
|
470
|
+
"color-space": "hsb",
|
|
471
|
+
channel: "hue",
|
|
472
|
+
"model-value": c.value,
|
|
473
|
+
"onUpdate:color": f
|
|
474
|
+
}, {
|
|
475
|
+
default: H(() => [
|
|
476
|
+
F(s(Ne), {
|
|
477
|
+
class: "wx-color-picker__hue-track",
|
|
478
|
+
style: ae(h.value)
|
|
479
|
+
}, {
|
|
480
|
+
default: H(() => [
|
|
481
|
+
F(s(Ue), { class: "wx-color-picker__thumb" })
|
|
482
|
+
]),
|
|
483
|
+
_: 1
|
|
484
|
+
}, 8, ["style"])
|
|
485
|
+
]),
|
|
486
|
+
_: 1
|
|
487
|
+
}, 8, ["model-value"]),
|
|
488
|
+
e.presets.length ? (n(), d("div", Fa, [
|
|
489
|
+
(n(!0), d(X, null, q(e.presets, (R) => (n(), d("button", {
|
|
490
|
+
key: R,
|
|
491
|
+
class: "wx-color-picker__preset",
|
|
492
|
+
type: "button",
|
|
493
|
+
style: ae({ background: R }),
|
|
494
|
+
"aria-label": R,
|
|
495
|
+
"aria-pressed": l.value === R,
|
|
496
|
+
onClick: (O) => $(R)
|
|
497
|
+
}, null, 12, Pa))), 128))
|
|
498
|
+
])) : W("", !0)
|
|
499
|
+
]),
|
|
500
|
+
_: 1
|
|
501
|
+
})
|
|
502
|
+
]),
|
|
503
|
+
_: 1
|
|
504
|
+
}, 8, ["disabled"])
|
|
505
|
+
], 2)
|
|
506
|
+
]),
|
|
507
|
+
_: 1
|
|
508
|
+
}, 8, ["open"]));
|
|
509
|
+
}
|
|
510
|
+
}), Ua = /* @__PURE__ */ j(Na, [["__scopeId", "data-v-aab2d65f"]]), fe = /* @__PURE__ */ E({
|
|
511
|
+
name: "WxDatePicker",
|
|
512
|
+
inheritAttrs: !1,
|
|
513
|
+
__name: "DatePicker",
|
|
514
|
+
props: /* @__PURE__ */ S({
|
|
515
|
+
type: { default: "date" },
|
|
516
|
+
valueFormat: { default: void 0 },
|
|
517
|
+
format: { default: void 0 },
|
|
518
|
+
placeholder: { default: void 0 },
|
|
519
|
+
clearable: { type: Boolean, default: !0 },
|
|
520
|
+
minDate: { default: void 0 },
|
|
521
|
+
maxDate: { default: void 0 },
|
|
522
|
+
seconds: { type: Boolean, default: !1 },
|
|
523
|
+
minutesIncrement: { default: 1 },
|
|
524
|
+
is24: { type: Boolean, default: !0 },
|
|
525
|
+
weekStart: { default: 1 },
|
|
526
|
+
autoApply: { type: Boolean, default: !0 },
|
|
527
|
+
textInput: { type: Boolean, default: !1 },
|
|
528
|
+
teleport: { type: [Boolean, String], default: !0 },
|
|
529
|
+
disabled: { type: Boolean, default: void 0 },
|
|
530
|
+
readonly: { type: Boolean, default: !1 },
|
|
531
|
+
size: { default: void 0 },
|
|
532
|
+
status: { default: void 0 },
|
|
533
|
+
id: { default: void 0 },
|
|
534
|
+
name: { default: void 0 },
|
|
535
|
+
ariaLabel: { default: void 0 }
|
|
536
|
+
}, {
|
|
537
|
+
modelValue: { default: null },
|
|
538
|
+
modelModifiers: {}
|
|
539
|
+
}),
|
|
540
|
+
emits: /* @__PURE__ */ S(["change", "clear", "open", "close"], ["update:modelValue"]),
|
|
541
|
+
setup(e, { emit: y }) {
|
|
542
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = u(() => a.type !== "date"), v = u(() => {
|
|
543
|
+
if (a.valueFormat !== "date")
|
|
544
|
+
return a.valueFormat ? a.valueFormat : a.type === "time" ? a.seconds ? "HH:mm:ss" : "HH:mm" : a.type === "datetime" ? a.seconds ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm" : "yyyy-MM-dd";
|
|
545
|
+
}), m = u(() => {
|
|
546
|
+
if (a.format) return a.format;
|
|
547
|
+
const M = a.seconds ? "HH:mm:ss" : "HH:mm";
|
|
548
|
+
return a.type === "time" ? M : a.type === "datetime" ? `dd.MM.yyyy ${M}` : "dd.MM.yyyy";
|
|
549
|
+
}), b = u(() => a.type === "time" ? { modeHeight: 125 } : void 0), c = u(() => ({
|
|
550
|
+
enableTimePicker: o.value,
|
|
551
|
+
enableSeconds: a.seconds,
|
|
552
|
+
is24: a.is24,
|
|
553
|
+
minutesIncrement: a.minutesIncrement
|
|
554
|
+
})), r = u(() => ({
|
|
555
|
+
id: l.id.value,
|
|
556
|
+
name: a.name,
|
|
557
|
+
clearable: a.clearable,
|
|
558
|
+
// The library reads `state: false` as invalid; leaving it undefined means neutral.
|
|
559
|
+
state: l.status.value === "error" ? !1 : void 0,
|
|
560
|
+
"aria-label": a.ariaLabel,
|
|
561
|
+
"aria-describedby": l.describedBy.value
|
|
562
|
+
})), h = u(() => [
|
|
563
|
+
"wx-datepicker",
|
|
564
|
+
`wx-datepicker--${l.size.value}`,
|
|
565
|
+
{
|
|
566
|
+
[`wx-datepicker--${l.status.value}`]: l.status.value !== "default",
|
|
567
|
+
"is-disabled": l.disabled.value
|
|
568
|
+
}
|
|
569
|
+
]);
|
|
570
|
+
function p(M) {
|
|
571
|
+
i.value = M, t("change", M);
|
|
572
|
+
}
|
|
573
|
+
function T() {
|
|
574
|
+
i.value = null, t("change", null), t("clear");
|
|
575
|
+
}
|
|
576
|
+
return (M, g) => (n(), d("div", {
|
|
577
|
+
class: U(h.value)
|
|
578
|
+
}, [
|
|
579
|
+
F(s(ge), K({
|
|
580
|
+
"model-value": i.value,
|
|
581
|
+
"model-type": v.value,
|
|
582
|
+
formats: { input: m.value },
|
|
583
|
+
"time-picker": e.type === "time",
|
|
584
|
+
"time-config": c.value,
|
|
585
|
+
config: b.value,
|
|
586
|
+
"input-attrs": r.value,
|
|
587
|
+
ui: { input: "wx-datepicker__input", menu: "wx-datepicker__menu" },
|
|
588
|
+
placeholder: e.placeholder,
|
|
589
|
+
"min-date": e.minDate,
|
|
590
|
+
"max-date": e.maxDate,
|
|
591
|
+
"week-start": e.weekStart,
|
|
592
|
+
"auto-apply": e.autoApply,
|
|
593
|
+
"text-input": e.textInput,
|
|
594
|
+
teleport: e.teleport,
|
|
595
|
+
disabled: s(l).disabled.value,
|
|
596
|
+
readonly: e.readonly
|
|
597
|
+
}, M.$attrs, {
|
|
598
|
+
"onUpdate:modelValue": p,
|
|
599
|
+
onCleared: T,
|
|
600
|
+
onOpen: g[0] || (g[0] = (C) => t("open")),
|
|
601
|
+
onClosed: g[1] || (g[1] = (C) => t("close"))
|
|
602
|
+
}), ue({ _: 2 }, [
|
|
603
|
+
q(M.$slots, (C, f) => ({
|
|
604
|
+
name: f,
|
|
605
|
+
fn: H(($) => [
|
|
606
|
+
P(M.$slots, f, se(de($ ?? {})))
|
|
607
|
+
])
|
|
608
|
+
}))
|
|
609
|
+
]), 1040, ["model-value", "model-type", "formats", "time-picker", "time-config", "config", "input-attrs", "placeholder", "min-date", "max-date", "week-start", "auto-apply", "text-input", "teleport", "disabled", "readonly"])
|
|
610
|
+
], 2));
|
|
611
|
+
}
|
|
612
|
+
}), Ea = /* @__PURE__ */ E({
|
|
613
|
+
name: "WxDateRangePicker",
|
|
614
|
+
inheritAttrs: !1,
|
|
615
|
+
__name: "DateRangePicker",
|
|
616
|
+
props: /* @__PURE__ */ S({
|
|
617
|
+
valueFormat: { default: void 0 },
|
|
618
|
+
format: { default: void 0 },
|
|
619
|
+
placeholder: { default: void 0 },
|
|
620
|
+
clearable: { type: Boolean, default: !0 },
|
|
621
|
+
minDate: { default: void 0 },
|
|
622
|
+
maxDate: { default: void 0 },
|
|
623
|
+
months: { default: 2 },
|
|
624
|
+
weekStart: { default: 1 },
|
|
625
|
+
autoApply: { type: Boolean, default: !0 },
|
|
626
|
+
textInput: { type: Boolean, default: !1 },
|
|
627
|
+
teleport: { type: Boolean, default: !0 },
|
|
628
|
+
disabled: { type: Boolean, default: void 0 },
|
|
629
|
+
readonly: { type: Boolean, default: !1 },
|
|
630
|
+
size: { default: void 0 },
|
|
631
|
+
status: { default: void 0 },
|
|
632
|
+
id: { default: void 0 },
|
|
633
|
+
name: { default: void 0 },
|
|
634
|
+
ariaLabel: { default: void 0 }
|
|
635
|
+
}, {
|
|
636
|
+
modelValue: { default: null },
|
|
637
|
+
modelModifiers: {}
|
|
638
|
+
}),
|
|
639
|
+
emits: /* @__PURE__ */ S(["change", "clear", "open", "close"], ["update:modelValue"]),
|
|
640
|
+
setup(e, { emit: y }) {
|
|
641
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = u(
|
|
642
|
+
() => a.valueFormat === "date" ? void 0 : a.valueFormat ?? "yyyy-MM-dd"
|
|
643
|
+
), v = u(() => a.format ?? "dd.MM.yyyy"), m = u(() => ({
|
|
644
|
+
id: l.id.value,
|
|
645
|
+
name: a.name,
|
|
646
|
+
clearable: a.clearable,
|
|
647
|
+
state: l.status.value === "error" ? !1 : void 0,
|
|
648
|
+
"aria-label": a.ariaLabel,
|
|
649
|
+
"aria-describedby": l.describedBy.value
|
|
650
|
+
})), b = u(() => [
|
|
651
|
+
"wx-datepicker",
|
|
652
|
+
"wx-datepicker--range",
|
|
653
|
+
`wx-datepicker--${l.size.value}`,
|
|
654
|
+
{
|
|
655
|
+
[`wx-datepicker--${l.status.value}`]: l.status.value !== "default",
|
|
656
|
+
"is-disabled": l.disabled.value
|
|
657
|
+
}
|
|
658
|
+
]);
|
|
659
|
+
function c(h) {
|
|
660
|
+
i.value = h, t("change", h);
|
|
661
|
+
}
|
|
662
|
+
function r() {
|
|
663
|
+
i.value = null, t("change", null), t("clear");
|
|
664
|
+
}
|
|
665
|
+
return (h, p) => (n(), d("div", {
|
|
666
|
+
class: U(b.value)
|
|
667
|
+
}, [
|
|
668
|
+
F(s(ge), K({
|
|
669
|
+
range: "",
|
|
670
|
+
"model-value": i.value,
|
|
671
|
+
"model-type": o.value,
|
|
672
|
+
formats: { input: v.value },
|
|
673
|
+
"multi-calendars": e.months,
|
|
674
|
+
"input-attrs": m.value,
|
|
675
|
+
ui: { input: "wx-datepicker__input", menu: "wx-datepicker__menu" },
|
|
676
|
+
placeholder: e.placeholder,
|
|
677
|
+
"min-date": e.minDate,
|
|
678
|
+
"max-date": e.maxDate,
|
|
679
|
+
"week-start": e.weekStart,
|
|
680
|
+
"auto-apply": e.autoApply,
|
|
681
|
+
"text-input": e.textInput,
|
|
682
|
+
teleport: e.teleport,
|
|
683
|
+
disabled: s(l).disabled.value,
|
|
684
|
+
readonly: e.readonly
|
|
685
|
+
}, h.$attrs, {
|
|
686
|
+
"onUpdate:modelValue": c,
|
|
687
|
+
onCleared: r,
|
|
688
|
+
onOpen: p[0] || (p[0] = (T) => t("open")),
|
|
689
|
+
onClosed: p[1] || (p[1] = (T) => t("close"))
|
|
690
|
+
}), ue({ _: 2 }, [
|
|
691
|
+
q(h.$slots, (T, M) => ({
|
|
692
|
+
name: M,
|
|
693
|
+
fn: H((g) => [
|
|
694
|
+
P(h.$slots, M, se(de(g ?? {})))
|
|
695
|
+
])
|
|
696
|
+
}))
|
|
697
|
+
]), 1040, ["model-value", "model-type", "formats", "multi-calendars", "input-attrs", "placeholder", "min-date", "max-date", "week-start", "auto-apply", "text-input", "teleport", "disabled", "readonly"])
|
|
698
|
+
], 2));
|
|
699
|
+
}
|
|
700
|
+
}), Oa = /* @__PURE__ */ E({
|
|
701
|
+
name: "WxDateTimePicker",
|
|
702
|
+
__name: "DateTimePicker",
|
|
703
|
+
props: /* @__PURE__ */ S({
|
|
704
|
+
valueFormat: { default: void 0 },
|
|
705
|
+
format: { default: void 0 },
|
|
706
|
+
placeholder: { default: void 0 },
|
|
707
|
+
clearable: { type: Boolean, default: void 0 },
|
|
708
|
+
minDate: { default: void 0 },
|
|
709
|
+
maxDate: { default: void 0 },
|
|
710
|
+
seconds: { type: Boolean, default: void 0 },
|
|
711
|
+
minutesIncrement: { default: void 0 },
|
|
712
|
+
is24: { type: Boolean, default: void 0 },
|
|
713
|
+
weekStart: { default: void 0 },
|
|
714
|
+
autoApply: { type: Boolean, default: void 0 },
|
|
715
|
+
textInput: { type: Boolean, default: void 0 },
|
|
716
|
+
teleport: { type: [Boolean, String], default: void 0 },
|
|
717
|
+
disabled: { type: Boolean, default: void 0 },
|
|
718
|
+
readonly: { type: Boolean, default: void 0 },
|
|
719
|
+
size: { default: void 0 },
|
|
720
|
+
status: { default: void 0 },
|
|
721
|
+
id: { default: void 0 },
|
|
722
|
+
name: { default: void 0 },
|
|
723
|
+
ariaLabel: { default: void 0 }
|
|
724
|
+
}, {
|
|
725
|
+
modelValue: { default: null },
|
|
726
|
+
modelModifiers: {}
|
|
727
|
+
}),
|
|
728
|
+
emits: ["update:modelValue"],
|
|
729
|
+
setup(e) {
|
|
730
|
+
const y = G(e, "modelValue");
|
|
731
|
+
return (a, t) => (n(), Q(fe, K({
|
|
732
|
+
modelValue: y.value,
|
|
733
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => y.value = i),
|
|
734
|
+
type: "datetime"
|
|
735
|
+
}, a.$props), ue({ _: 2 }, [
|
|
736
|
+
q(a.$slots, (i, l) => ({
|
|
737
|
+
name: l,
|
|
738
|
+
fn: H((o) => [
|
|
739
|
+
P(a.$slots, l, se(de(o ?? {})))
|
|
740
|
+
])
|
|
741
|
+
}))
|
|
742
|
+
]), 1040, ["modelValue"]));
|
|
743
|
+
}
|
|
744
|
+
}), ja = /* @__PURE__ */ E({
|
|
745
|
+
name: "WxForm",
|
|
746
|
+
__name: "Form",
|
|
747
|
+
props: {
|
|
748
|
+
errors: { default: void 0 },
|
|
749
|
+
disabled: { type: Boolean, default: !1 },
|
|
750
|
+
size: { default: "md" },
|
|
751
|
+
labelPosition: { default: "top" },
|
|
752
|
+
labelWidth: { default: void 0 },
|
|
753
|
+
gap: { default: "md" }
|
|
754
|
+
},
|
|
755
|
+
emits: ["submit", "reset"],
|
|
756
|
+
setup(e, { emit: y }) {
|
|
757
|
+
const a = e, t = y, i = u(() => a.errors ?? {});
|
|
758
|
+
ne(ce, {
|
|
759
|
+
errors: i,
|
|
760
|
+
disabled: oe(a, "disabled"),
|
|
761
|
+
size: oe(a, "size"),
|
|
762
|
+
labelPosition: oe(a, "labelPosition"),
|
|
763
|
+
labelWidth: oe(a, "labelWidth")
|
|
764
|
+
});
|
|
765
|
+
function l(v) {
|
|
766
|
+
v.preventDefault(), t("submit", v);
|
|
767
|
+
}
|
|
768
|
+
function o(v) {
|
|
769
|
+
t("reset", v);
|
|
770
|
+
}
|
|
771
|
+
return (v, m) => (n(), d("form", {
|
|
772
|
+
class: U(["wx-form", `wx-form--gap-${e.gap}`, `wx-form--label-${e.labelPosition}`]),
|
|
773
|
+
novalidate: "",
|
|
774
|
+
onSubmit: l,
|
|
775
|
+
onReset: o
|
|
776
|
+
}, [
|
|
777
|
+
P(v.$slots, "default", {}, void 0, !0)
|
|
778
|
+
], 34));
|
|
779
|
+
}
|
|
780
|
+
}), Ga = /* @__PURE__ */ j(ja, [["__scopeId", "data-v-bfab857f"]]), qa = {
|
|
781
|
+
key: 0,
|
|
782
|
+
class: "wx-form-item__required",
|
|
783
|
+
"aria-hidden": "true"
|
|
784
|
+
}, Ka = { class: "wx-form-item__control" }, Ya = {
|
|
785
|
+
key: 2,
|
|
786
|
+
class: "wx-form-item__error",
|
|
787
|
+
"aria-hidden": "true"
|
|
788
|
+
}, Xa = /* @__PURE__ */ E({
|
|
789
|
+
name: "WxFormItem",
|
|
790
|
+
__name: "FormItem",
|
|
791
|
+
props: {
|
|
792
|
+
label: { default: void 0 },
|
|
793
|
+
name: { default: void 0 },
|
|
794
|
+
required: { type: Boolean, default: !1 },
|
|
795
|
+
error: { default: void 0 },
|
|
796
|
+
help: { default: void 0 },
|
|
797
|
+
disabled: { type: Boolean, default: !1 },
|
|
798
|
+
size: { default: void 0 },
|
|
799
|
+
labelWidth: { default: void 0 },
|
|
800
|
+
reserveErrorSpace: { type: Boolean, default: !1 }
|
|
801
|
+
},
|
|
802
|
+
setup(e, { expose: y }) {
|
|
803
|
+
const a = e, t = te(ce, null), i = ve("wx-field"), l = `${i}-error`, o = `${i}-help`, v = D("control"), m = D(i);
|
|
804
|
+
function b(f) {
|
|
805
|
+
if (f === void 0) {
|
|
806
|
+
v.value = "group";
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
v.value = "control", m.value = f;
|
|
810
|
+
}
|
|
811
|
+
const c = u(() => a.error !== void 0 ? Array.isArray(a.error) ? a.error : [a.error] : a.name && t ? t.errors.value[a.name] ?? [] : []), r = u(() => c.value.length > 0), h = u(() => r.value ? "error" : "default"), p = u(() => r.value ? l : a.help ? o : void 0), T = u(() => a.size), M = u(() => a.disabled), g = u(() => a.labelWidth ?? t?.labelWidth.value), C = u(() => t?.labelPosition.value === "left");
|
|
812
|
+
return Ma({
|
|
813
|
+
id: u(() => i),
|
|
814
|
+
describedBy: p,
|
|
815
|
+
status: h,
|
|
816
|
+
disabled: M,
|
|
817
|
+
size: T,
|
|
818
|
+
registerLabelTarget: b
|
|
819
|
+
}), y({ messages: c, hasError: r }), (f, $) => (n(), d("div", {
|
|
820
|
+
class: U([
|
|
821
|
+
"wx-form-item",
|
|
822
|
+
{ "wx-form-item--inline": C.value, "is-error": r.value, "is-required": e.required }
|
|
823
|
+
]),
|
|
824
|
+
style: ae(C.value && g.value ? { "--wx-form-item-label-width": g.value } : void 0)
|
|
825
|
+
}, [
|
|
826
|
+
e.label || f.$slots.label ? (n(), Q(xe(v.value === "group" ? "span" : "label"), {
|
|
827
|
+
key: 0,
|
|
828
|
+
id: `${s(i)}-label`,
|
|
829
|
+
class: "wx-form-item__label",
|
|
830
|
+
for: v.value === "group" ? void 0 : m.value
|
|
831
|
+
}, {
|
|
832
|
+
default: H(() => [
|
|
833
|
+
P(f.$slots, "label", {}, () => [
|
|
834
|
+
ee(N(e.label), 1)
|
|
835
|
+
], !0),
|
|
836
|
+
e.required ? (n(), d("span", qa, "*")) : W("", !0)
|
|
837
|
+
]),
|
|
838
|
+
_: 3
|
|
839
|
+
}, 8, ["id", "for"])) : W("", !0),
|
|
840
|
+
I("div", Ka, [
|
|
841
|
+
P(f.$slots, "default", {}, void 0, !0),
|
|
842
|
+
r.value ? (n(), d("p", {
|
|
843
|
+
key: 0,
|
|
844
|
+
id: l,
|
|
845
|
+
class: "wx-form-item__error",
|
|
846
|
+
role: "alert"
|
|
847
|
+
}, N(c.value[0]), 1)) : e.help ? (n(), d("p", {
|
|
848
|
+
key: 1,
|
|
849
|
+
id: o,
|
|
850
|
+
class: "wx-form-item__help"
|
|
851
|
+
}, N(e.help), 1)) : e.reserveErrorSpace ? (n(), d("p", Ya, " ")) : W("", !0)
|
|
852
|
+
])
|
|
853
|
+
], 6));
|
|
854
|
+
}
|
|
855
|
+
}), Qa = /* @__PURE__ */ j(Xa, [["__scopeId", "data-v-0b8142de"]]), Ja = {
|
|
82
856
|
key: 0,
|
|
83
857
|
class: "wx-input__affix wx-input__affix--prefix"
|
|
84
|
-
},
|
|
858
|
+
}, Za = ["id", "type", "value", "placeholder", "disabled", "readonly", "maxlength", "autocomplete", "aria-label", "aria-describedby", "aria-invalid"], el = {
|
|
85
859
|
key: 2,
|
|
86
860
|
class: "wx-input__count"
|
|
87
|
-
},
|
|
861
|
+
}, al = {
|
|
88
862
|
key: 3,
|
|
89
863
|
class: "wx-input__affix wx-input__affix--suffix"
|
|
90
|
-
},
|
|
864
|
+
}, ll = /* @__PURE__ */ E({
|
|
91
865
|
name: "WxInput",
|
|
92
866
|
inheritAttrs: !1,
|
|
93
867
|
__name: "Input",
|
|
94
|
-
props: /* @__PURE__ */
|
|
868
|
+
props: /* @__PURE__ */ S({
|
|
869
|
+
id: { default: void 0 },
|
|
95
870
|
type: { default: "text" },
|
|
96
|
-
size: { default:
|
|
97
|
-
status: { default:
|
|
871
|
+
size: { default: void 0 },
|
|
872
|
+
status: { default: void 0 },
|
|
98
873
|
placeholder: { default: void 0 },
|
|
99
|
-
disabled: { type: Boolean, default:
|
|
874
|
+
disabled: { type: Boolean, default: void 0 },
|
|
100
875
|
readonly: { type: Boolean, default: !1 },
|
|
101
876
|
clearable: { type: Boolean, default: !1 },
|
|
102
877
|
maxlength: { default: void 0 },
|
|
@@ -107,147 +882,1626 @@ const A = {
|
|
|
107
882
|
modelValue: { default: "" },
|
|
108
883
|
modelModifiers: {}
|
|
109
884
|
}),
|
|
110
|
-
emits: /* @__PURE__ */
|
|
111
|
-
setup(
|
|
112
|
-
const
|
|
113
|
-
() =>
|
|
114
|
-
),
|
|
115
|
-
() =>
|
|
116
|
-
),
|
|
885
|
+
emits: /* @__PURE__ */ S(["input", "change", "focus", "blur", "clear"], ["update:modelValue"]),
|
|
886
|
+
setup(e, { expose: y, emit: a }) {
|
|
887
|
+
const t = e, i = a, l = G(e, "modelValue"), o = Y(t), v = D(null), m = D(!1), b = u(() => l.value == null ? "" : String(l.value)), c = u(
|
|
888
|
+
() => t.clearable && !o.disabled.value && !t.readonly && b.value.length > 0
|
|
889
|
+
), r = u(
|
|
890
|
+
() => t.showCount && t.maxlength ? `${b.value.length}/${t.maxlength}` : null
|
|
891
|
+
), h = u(() => [
|
|
117
892
|
"wx-input",
|
|
118
|
-
`wx-input--${
|
|
893
|
+
`wx-input--${o.size.value}`,
|
|
119
894
|
{
|
|
120
|
-
[`wx-input--${
|
|
121
|
-
"is-focused":
|
|
122
|
-
"is-disabled":
|
|
123
|
-
"is-readonly":
|
|
895
|
+
[`wx-input--${o.status.value}`]: o.status.value !== "default",
|
|
896
|
+
"is-focused": m.value,
|
|
897
|
+
"is-disabled": o.disabled.value,
|
|
898
|
+
"is-readonly": t.readonly
|
|
124
899
|
}
|
|
125
900
|
]);
|
|
126
|
-
function
|
|
127
|
-
const
|
|
128
|
-
l.value =
|
|
129
|
-
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
function
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
function
|
|
140
|
-
l.value = "",
|
|
141
|
-
}
|
|
142
|
-
return
|
|
143
|
-
focus: () =>
|
|
144
|
-
blur: () =>
|
|
145
|
-
select: () =>
|
|
146
|
-
input:
|
|
147
|
-
}), (
|
|
148
|
-
class:
|
|
149
|
-
}, [
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
])) :
|
|
153
|
-
|
|
901
|
+
function p(f) {
|
|
902
|
+
const $ = f.target.value;
|
|
903
|
+
l.value = $, i("input", $);
|
|
904
|
+
}
|
|
905
|
+
function T(f) {
|
|
906
|
+
i("change", f.target.value);
|
|
907
|
+
}
|
|
908
|
+
function M(f) {
|
|
909
|
+
m.value = !0, i("focus", f);
|
|
910
|
+
}
|
|
911
|
+
function g(f) {
|
|
912
|
+
m.value = !1, i("blur", f);
|
|
913
|
+
}
|
|
914
|
+
function C() {
|
|
915
|
+
l.value = "", i("input", ""), i("change", ""), i("clear"), v.value?.focus();
|
|
916
|
+
}
|
|
917
|
+
return y({
|
|
918
|
+
focus: () => v.value?.focus(),
|
|
919
|
+
blur: () => v.value?.blur(),
|
|
920
|
+
select: () => v.value?.select(),
|
|
921
|
+
input: v
|
|
922
|
+
}), (f, $) => (n(), d("div", {
|
|
923
|
+
class: U(h.value)
|
|
924
|
+
}, [
|
|
925
|
+
f.$slots.prefix ? (n(), d("span", Ja, [
|
|
926
|
+
P(f.$slots, "prefix", {}, void 0, !0)
|
|
927
|
+
])) : W("", !0),
|
|
928
|
+
I("input", K({
|
|
929
|
+
id: s(o).id.value,
|
|
154
930
|
ref_key: "inputRef",
|
|
155
|
-
ref:
|
|
156
|
-
},
|
|
931
|
+
ref: v
|
|
932
|
+
}, f.$attrs, {
|
|
157
933
|
class: "wx-input__inner",
|
|
158
|
-
type:
|
|
159
|
-
value:
|
|
160
|
-
placeholder:
|
|
161
|
-
disabled:
|
|
162
|
-
readonly:
|
|
163
|
-
maxlength:
|
|
164
|
-
autocomplete:
|
|
165
|
-
"aria-label":
|
|
166
|
-
"aria-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
934
|
+
type: e.type,
|
|
935
|
+
value: b.value,
|
|
936
|
+
placeholder: e.placeholder,
|
|
937
|
+
disabled: s(o).disabled.value,
|
|
938
|
+
readonly: e.readonly,
|
|
939
|
+
maxlength: e.maxlength,
|
|
940
|
+
autocomplete: e.autocomplete,
|
|
941
|
+
"aria-label": e.ariaLabel,
|
|
942
|
+
"aria-describedby": s(o).describedBy.value,
|
|
943
|
+
"aria-invalid": s(o).status.value === "error" || void 0,
|
|
944
|
+
onInput: p,
|
|
945
|
+
onChange: T,
|
|
946
|
+
onFocus: M,
|
|
947
|
+
onBlur: g
|
|
948
|
+
}), null, 16, Za),
|
|
949
|
+
c.value ? (n(), d("button", {
|
|
173
950
|
key: 1,
|
|
174
951
|
class: "wx-input__clear",
|
|
175
952
|
type: "button",
|
|
176
953
|
tabindex: "-1",
|
|
177
954
|
"aria-label": "Clear",
|
|
178
|
-
onClick:
|
|
179
|
-
}, " ✕ ")) :
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
])) :
|
|
955
|
+
onClick: C
|
|
956
|
+
}, " ✕ ")) : W("", !0),
|
|
957
|
+
r.value ? (n(), d("span", el, N(r.value), 1)) : W("", !0),
|
|
958
|
+
f.$slots.suffix ? (n(), d("span", al, [
|
|
959
|
+
P(f.$slots, "suffix", {}, void 0, !0)
|
|
960
|
+
])) : W("", !0)
|
|
961
|
+
], 2));
|
|
962
|
+
}
|
|
963
|
+
}), tl = /* @__PURE__ */ j(ll, [["__scopeId", "data-v-82a546ac"]]), ol = ["disabled"], il = ["id", "name", "value", "placeholder", "disabled", "readonly", "aria-label", "aria-describedby", "aria-invalid", "aria-valuenow", "aria-valuemin", "aria-valuemax"], nl = ["disabled"], ul = /* @__PURE__ */ E({
|
|
964
|
+
name: "WxInputNumber",
|
|
965
|
+
inheritAttrs: !1,
|
|
966
|
+
__name: "InputNumber",
|
|
967
|
+
props: /* @__PURE__ */ S({
|
|
968
|
+
min: { default: void 0 },
|
|
969
|
+
max: { default: void 0 },
|
|
970
|
+
step: { default: 1 },
|
|
971
|
+
precision: { default: void 0 },
|
|
972
|
+
controls: { type: Boolean, default: !0 },
|
|
973
|
+
controlsPosition: { default: "sides" },
|
|
974
|
+
wheel: { type: Boolean, default: !1 },
|
|
975
|
+
size: { default: void 0 },
|
|
976
|
+
status: { default: void 0 },
|
|
977
|
+
id: { default: void 0 },
|
|
978
|
+
name: { default: void 0 },
|
|
979
|
+
placeholder: { default: void 0 },
|
|
980
|
+
disabled: { type: Boolean, default: void 0 },
|
|
981
|
+
readonly: { type: Boolean, default: !1 },
|
|
982
|
+
ariaLabel: { default: void 0 }
|
|
983
|
+
}, {
|
|
984
|
+
modelValue: { default: null },
|
|
985
|
+
modelModifiers: {}
|
|
986
|
+
}),
|
|
987
|
+
emits: /* @__PURE__ */ S(["change", "focus", "blur"], ["update:modelValue"]),
|
|
988
|
+
setup(e, { expose: y, emit: a }) {
|
|
989
|
+
const t = e, i = a, l = G(e, "modelValue"), o = Y(t), v = D(null), m = D(!1), b = u(() => {
|
|
990
|
+
if (t.precision !== void 0) return t.precision;
|
|
991
|
+
const [, B = ""] = String(t.step).split(".");
|
|
992
|
+
return B.length;
|
|
993
|
+
});
|
|
994
|
+
function c(B) {
|
|
995
|
+
const A = 10 ** b.value;
|
|
996
|
+
return Math.round((B + Number.EPSILON) * A) / A;
|
|
997
|
+
}
|
|
998
|
+
function r(B) {
|
|
999
|
+
let A = B;
|
|
1000
|
+
return t.min !== void 0 && (A = Math.max(A, t.min)), t.max !== void 0 && (A = Math.min(A, t.max)), c(A);
|
|
1001
|
+
}
|
|
1002
|
+
const h = u(
|
|
1003
|
+
() => typeof l.value == "number" && Number.isFinite(l.value) ? l.value : null
|
|
1004
|
+
), p = D(h.value === null ? "" : h.value.toFixed(b.value));
|
|
1005
|
+
Z(h, (B) => {
|
|
1006
|
+
m.value || (p.value = B === null ? "" : B.toFixed(b.value));
|
|
1007
|
+
});
|
|
1008
|
+
const T = u(() => o.disabled.value), M = u(
|
|
1009
|
+
() => !T.value && !t.readonly && (t.min === void 0 || (h.value ?? 0) > t.min)
|
|
1010
|
+
), g = u(
|
|
1011
|
+
() => !T.value && !t.readonly && (t.max === void 0 || (h.value ?? 0) < t.max)
|
|
1012
|
+
), C = u(() => [
|
|
1013
|
+
"wx-input-number",
|
|
1014
|
+
`wx-input-number--${o.size.value}`,
|
|
1015
|
+
`wx-input-number--controls-${t.controls ? t.controlsPosition : "none"}`,
|
|
1016
|
+
{
|
|
1017
|
+
[`wx-input-number--${o.status.value}`]: o.status.value !== "default",
|
|
1018
|
+
"is-focused": m.value,
|
|
1019
|
+
"is-disabled": T.value
|
|
1020
|
+
}
|
|
1021
|
+
]);
|
|
1022
|
+
function f(B) {
|
|
1023
|
+
l.value !== B && (l.value = B, i("change", B));
|
|
1024
|
+
}
|
|
1025
|
+
function $(B) {
|
|
1026
|
+
if (T.value || t.readonly) return;
|
|
1027
|
+
const A = h.value ?? r(0), _ = r(A + B * t.step);
|
|
1028
|
+
f(_), p.value = _.toFixed(b.value);
|
|
1029
|
+
}
|
|
1030
|
+
function V(B) {
|
|
1031
|
+
p.value = B.target.value;
|
|
1032
|
+
const A = Number.parseFloat(p.value);
|
|
1033
|
+
p.value === "" ? f(null) : Number.isFinite(A) && f(c(A));
|
|
1034
|
+
}
|
|
1035
|
+
function L() {
|
|
1036
|
+
if (p.value.trim() === "") {
|
|
1037
|
+
f(null), p.value = "";
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
const B = Number.parseFloat(p.value);
|
|
1041
|
+
if (!Number.isFinite(B)) {
|
|
1042
|
+
p.value = h.value === null ? "" : h.value.toFixed(b.value);
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
const A = r(B);
|
|
1046
|
+
f(A), p.value = A.toFixed(b.value);
|
|
1047
|
+
}
|
|
1048
|
+
function x(B) {
|
|
1049
|
+
m.value = !0, i("focus", B);
|
|
1050
|
+
}
|
|
1051
|
+
function k(B) {
|
|
1052
|
+
m.value = !1, L(), i("blur", B);
|
|
1053
|
+
}
|
|
1054
|
+
function R(B) {
|
|
1055
|
+
!t.wheel || !m.value || T.value || t.readonly || (B.preventDefault(), $(B.deltaY < 0 ? 1 : -1));
|
|
1056
|
+
}
|
|
1057
|
+
function O(B) {
|
|
1058
|
+
B.key === "ArrowUp" ? (B.preventDefault(), $(1)) : B.key === "ArrowDown" ? (B.preventDefault(), $(-1)) : B.key === "Enter" && L();
|
|
1059
|
+
}
|
|
1060
|
+
return y({
|
|
1061
|
+
focus: () => v.value?.focus(),
|
|
1062
|
+
blur: () => v.value?.blur(),
|
|
1063
|
+
increase: () => $(1),
|
|
1064
|
+
decrease: () => $(-1),
|
|
1065
|
+
input: v
|
|
1066
|
+
}), (B, A) => (n(), d("div", {
|
|
1067
|
+
class: U(C.value)
|
|
1068
|
+
}, [
|
|
1069
|
+
e.controls ? (n(), d("button", {
|
|
1070
|
+
key: 0,
|
|
1071
|
+
class: "wx-input-number__button wx-input-number__button--decrease",
|
|
1072
|
+
type: "button",
|
|
1073
|
+
tabindex: "-1",
|
|
1074
|
+
"aria-label": "Decrease",
|
|
1075
|
+
disabled: !M.value,
|
|
1076
|
+
onClick: A[0] || (A[0] = (_) => $(-1))
|
|
1077
|
+
}, [...A[2] || (A[2] = [
|
|
1078
|
+
I("svg", {
|
|
1079
|
+
viewBox: "0 0 16 16",
|
|
1080
|
+
fill: "none",
|
|
1081
|
+
"aria-hidden": "true"
|
|
1082
|
+
}, [
|
|
1083
|
+
I("path", {
|
|
1084
|
+
d: "M3.5 8h9",
|
|
1085
|
+
stroke: "currentColor",
|
|
1086
|
+
"stroke-width": "1.5",
|
|
1087
|
+
"stroke-linecap": "round"
|
|
1088
|
+
})
|
|
1089
|
+
], -1)
|
|
1090
|
+
])], 8, ol)) : W("", !0),
|
|
1091
|
+
I("input", K({
|
|
1092
|
+
id: s(o).id.value,
|
|
1093
|
+
ref_key: "inputRef",
|
|
1094
|
+
ref: v
|
|
1095
|
+
}, B.$attrs, {
|
|
1096
|
+
class: "wx-input-number__inner",
|
|
1097
|
+
type: "text",
|
|
1098
|
+
inputmode: "decimal",
|
|
1099
|
+
autocomplete: "off",
|
|
1100
|
+
name: e.name,
|
|
1101
|
+
value: p.value,
|
|
1102
|
+
placeholder: e.placeholder,
|
|
1103
|
+
disabled: T.value,
|
|
1104
|
+
readonly: e.readonly,
|
|
1105
|
+
"aria-label": e.ariaLabel,
|
|
1106
|
+
"aria-describedby": s(o).describedBy.value,
|
|
1107
|
+
"aria-invalid": s(o).status.value === "error" || void 0,
|
|
1108
|
+
role: "spinbutton",
|
|
1109
|
+
"aria-valuenow": h.value ?? void 0,
|
|
1110
|
+
"aria-valuemin": e.min,
|
|
1111
|
+
"aria-valuemax": e.max,
|
|
1112
|
+
onInput: V,
|
|
1113
|
+
onFocus: x,
|
|
1114
|
+
onBlur: k,
|
|
1115
|
+
onKeydown: O,
|
|
1116
|
+
onWheel: R
|
|
1117
|
+
}), null, 16, il),
|
|
1118
|
+
e.controls ? (n(), d("button", {
|
|
1119
|
+
key: 1,
|
|
1120
|
+
class: "wx-input-number__button wx-input-number__button--increase",
|
|
1121
|
+
type: "button",
|
|
1122
|
+
tabindex: "-1",
|
|
1123
|
+
"aria-label": "Increase",
|
|
1124
|
+
disabled: !g.value,
|
|
1125
|
+
onClick: A[1] || (A[1] = (_) => $(1))
|
|
1126
|
+
}, [...A[3] || (A[3] = [
|
|
1127
|
+
I("svg", {
|
|
1128
|
+
viewBox: "0 0 16 16",
|
|
1129
|
+
fill: "none",
|
|
1130
|
+
"aria-hidden": "true"
|
|
1131
|
+
}, [
|
|
1132
|
+
I("path", {
|
|
1133
|
+
d: "M8 3.5v9M3.5 8h9",
|
|
1134
|
+
stroke: "currentColor",
|
|
1135
|
+
"stroke-width": "1.5",
|
|
1136
|
+
"stroke-linecap": "round"
|
|
1137
|
+
})
|
|
1138
|
+
], -1)
|
|
1139
|
+
])], 8, nl)) : W("", !0)
|
|
184
1140
|
], 2));
|
|
185
1141
|
}
|
|
186
|
-
}),
|
|
1142
|
+
}), sl = /* @__PURE__ */ j(ul, [["__scopeId", "data-v-1dcbf297"]]), dl = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], rl = {
|
|
187
1143
|
key: 0,
|
|
188
|
-
class: "wx-
|
|
189
|
-
},
|
|
1144
|
+
class: "wx-radio__label"
|
|
1145
|
+
}, cl = /* @__PURE__ */ E({
|
|
1146
|
+
name: "WxRadio",
|
|
1147
|
+
inheritAttrs: !1,
|
|
1148
|
+
__name: "Radio",
|
|
1149
|
+
props: /* @__PURE__ */ S({
|
|
1150
|
+
value: { type: [String, Number, Boolean, null] },
|
|
1151
|
+
label: { default: void 0 },
|
|
1152
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1153
|
+
size: { default: void 0 },
|
|
1154
|
+
id: { default: void 0 },
|
|
1155
|
+
name: { default: void 0 },
|
|
1156
|
+
ariaLabel: { default: void 0 }
|
|
1157
|
+
}, {
|
|
1158
|
+
modelValue: { type: [String, Number, Boolean, null], default: null },
|
|
1159
|
+
modelModifiers: {}
|
|
1160
|
+
}),
|
|
1161
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
1162
|
+
setup(e, { emit: y }) {
|
|
1163
|
+
const a = e, t = y, i = G(e, "modelValue"), l = te(_e, null), o = Y(a), v = u(
|
|
1164
|
+
() => l ? l.modelValue.value === a.value : i.value === a.value
|
|
1165
|
+
), m = u(() => a.disabled || l?.disabled.value || o.disabled.value), b = u(() => a.size ?? l?.size.value ?? o.size.value), c = u(() => [
|
|
1166
|
+
"wx-radio",
|
|
1167
|
+
`wx-radio--${b.value}`,
|
|
1168
|
+
{ "is-checked": v.value, "is-disabled": m.value }
|
|
1169
|
+
]);
|
|
1170
|
+
function r() {
|
|
1171
|
+
l ? l.toggle(a.value, !0) : i.value = a.value, t("change", a.value);
|
|
1172
|
+
}
|
|
1173
|
+
return (h, p) => (n(), d("label", {
|
|
1174
|
+
class: U(c.value)
|
|
1175
|
+
}, [
|
|
1176
|
+
I("input", K({
|
|
1177
|
+
id: s(o).id.value
|
|
1178
|
+
}, h.$attrs, {
|
|
1179
|
+
class: "wx-radio__native",
|
|
1180
|
+
type: "radio",
|
|
1181
|
+
name: e.name ?? s(l)?.name.value,
|
|
1182
|
+
checked: v.value,
|
|
1183
|
+
disabled: m.value,
|
|
1184
|
+
"aria-label": e.ariaLabel,
|
|
1185
|
+
"aria-describedby": s(o).describedBy.value,
|
|
1186
|
+
onChange: r
|
|
1187
|
+
}), null, 16, dl),
|
|
1188
|
+
p[0] || (p[0] = I("span", {
|
|
1189
|
+
class: "wx-radio__box",
|
|
1190
|
+
"aria-hidden": "true"
|
|
1191
|
+
}, [
|
|
1192
|
+
I("span", { class: "wx-radio__dot" })
|
|
1193
|
+
], -1)),
|
|
1194
|
+
e.label || h.$slots.default ? (n(), d("span", rl, [
|
|
1195
|
+
P(h.$slots, "default", {}, () => [
|
|
1196
|
+
ee(N(e.label), 1)
|
|
1197
|
+
], !0)
|
|
1198
|
+
])) : W("", !0)
|
|
1199
|
+
], 2));
|
|
1200
|
+
}
|
|
1201
|
+
}), Me = /* @__PURE__ */ j(cl, [["__scopeId", "data-v-a22bec4a"]]), vl = ["aria-labelledby", "aria-describedby"], fl = /* @__PURE__ */ E({
|
|
1202
|
+
name: "WxRadioGroup",
|
|
1203
|
+
__name: "RadioGroup",
|
|
1204
|
+
props: /* @__PURE__ */ S({
|
|
1205
|
+
options: { default: void 0 },
|
|
1206
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1207
|
+
size: { default: void 0 },
|
|
1208
|
+
name: { default: void 0 },
|
|
1209
|
+
inline: { type: Boolean, default: !1 }
|
|
1210
|
+
}, {
|
|
1211
|
+
modelValue: { type: [String, Number, Boolean, null], default: null },
|
|
1212
|
+
modelModifiers: {}
|
|
1213
|
+
}),
|
|
1214
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
1215
|
+
setup(e, { emit: y }) {
|
|
1216
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = ve("wx-radio-group");
|
|
1217
|
+
l.item?.registerLabelTarget(void 0);
|
|
1218
|
+
const v = u(() => a.disabled ?? l.disabled.value), m = u(() => a.size ?? l.size.value), b = u(() => a.name ?? o);
|
|
1219
|
+
function c(r) {
|
|
1220
|
+
i.value !== r && (i.value = r, t("change", r));
|
|
1221
|
+
}
|
|
1222
|
+
return ne(_e, {
|
|
1223
|
+
name: b,
|
|
1224
|
+
modelValue: u(() => i.value),
|
|
1225
|
+
disabled: v,
|
|
1226
|
+
size: m,
|
|
1227
|
+
toggle: c
|
|
1228
|
+
}), (r, h) => (n(), d("div", {
|
|
1229
|
+
class: U(["wx-radio-group", { "wx-radio-group--inline": e.inline }]),
|
|
1230
|
+
role: "radiogroup",
|
|
1231
|
+
"aria-labelledby": s(l).item ? `${s(l).item.id.value}-label` : void 0,
|
|
1232
|
+
"aria-describedby": s(l).describedBy.value
|
|
1233
|
+
}, [
|
|
1234
|
+
P(r.$slots, "default", {}, () => [
|
|
1235
|
+
(n(!0), d(X, null, q(e.options, (p) => (n(), Q(Me, {
|
|
1236
|
+
key: String(p.value),
|
|
1237
|
+
value: p.value,
|
|
1238
|
+
label: p.label,
|
|
1239
|
+
disabled: p.disabled
|
|
1240
|
+
}, null, 8, ["value", "label", "disabled"]))), 128))
|
|
1241
|
+
], !0)
|
|
1242
|
+
], 10, vl));
|
|
1243
|
+
}
|
|
1244
|
+
}), ml = /* @__PURE__ */ j(fl, [["__scopeId", "data-v-dcd2686e"]]), bl = ["id", "tabindex", "aria-label", "aria-describedby", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-disabled"], pl = ["onClick", "onMousemove"], hl = {
|
|
190
1245
|
key: 0,
|
|
191
|
-
class: "wx-
|
|
192
|
-
},
|
|
1246
|
+
class: "wx-rate__value"
|
|
1247
|
+
}, yl = ["name", "value"], xl = /* @__PURE__ */ E({
|
|
1248
|
+
name: "WxRate",
|
|
1249
|
+
inheritAttrs: !1,
|
|
1250
|
+
__name: "Rate",
|
|
1251
|
+
props: /* @__PURE__ */ S({
|
|
1252
|
+
max: { default: 5 },
|
|
1253
|
+
allowHalf: { type: Boolean, default: !1 },
|
|
1254
|
+
clearable: { type: Boolean, default: !0 },
|
|
1255
|
+
showValue: { type: Boolean, default: !1 },
|
|
1256
|
+
readonly: { type: Boolean, default: !1 },
|
|
1257
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1258
|
+
size: { default: void 0 },
|
|
1259
|
+
id: { default: void 0 },
|
|
1260
|
+
name: { default: void 0 },
|
|
1261
|
+
ariaLabel: { default: void 0 }
|
|
1262
|
+
}, {
|
|
1263
|
+
modelValue: { default: 0 },
|
|
1264
|
+
modelModifiers: {}
|
|
1265
|
+
}),
|
|
1266
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
1267
|
+
setup(e, { emit: y }) {
|
|
1268
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = D(null), v = u(() => !l.disabled.value && !a.readonly), m = u(() => o.value ?? i.value ?? 0), b = u(
|
|
1269
|
+
() => Array.from({ length: a.max }, (g, C) => {
|
|
1270
|
+
const f = C + 1, $ = Math.min(Math.max(m.value - C, 0), 1);
|
|
1271
|
+
return { position: f, full: $ >= 1, half: $ > 0 && $ < 1 };
|
|
1272
|
+
})
|
|
1273
|
+
), c = u(() => [
|
|
1274
|
+
"wx-rate",
|
|
1275
|
+
`wx-rate--${l.size.value}`,
|
|
1276
|
+
{ "is-disabled": l.disabled.value, "is-readonly": a.readonly }
|
|
1277
|
+
]);
|
|
1278
|
+
function r(g, C) {
|
|
1279
|
+
if (!a.allowHalf) return g;
|
|
1280
|
+
const f = C.currentTarget, { left: $, width: V } = f.getBoundingClientRect();
|
|
1281
|
+
return C.clientX - $ < V / 2 ? g - 0.5 : g;
|
|
1282
|
+
}
|
|
1283
|
+
function h(g, C = !1) {
|
|
1284
|
+
const f = C && a.clearable && i.value === g ? 0 : g;
|
|
1285
|
+
f !== i.value && (i.value = f, t("change", f));
|
|
1286
|
+
}
|
|
1287
|
+
function p(g, C) {
|
|
1288
|
+
v.value && h(r(g, C), !0);
|
|
1289
|
+
}
|
|
1290
|
+
function T(g, C) {
|
|
1291
|
+
v.value && (o.value = r(g, C));
|
|
1292
|
+
}
|
|
1293
|
+
function M(g) {
|
|
1294
|
+
if (!v.value) return;
|
|
1295
|
+
const C = a.allowHalf ? 0.5 : 1, f = i.value ?? 0;
|
|
1296
|
+
g.key === "ArrowRight" || g.key === "ArrowUp" ? (g.preventDefault(), h(Math.min(f + C, a.max))) : g.key === "ArrowLeft" || g.key === "ArrowDown" ? (g.preventDefault(), h(Math.max(f - C, 0))) : g.key === "Home" ? (g.preventDefault(), h(0)) : g.key === "End" && (g.preventDefault(), h(a.max));
|
|
1297
|
+
}
|
|
1298
|
+
return (g, C) => (n(), d("div", K({
|
|
1299
|
+
id: s(l).id.value
|
|
1300
|
+
}, g.$attrs, {
|
|
1301
|
+
class: c.value,
|
|
1302
|
+
role: "slider",
|
|
1303
|
+
tabindex: v.value ? 0 : -1,
|
|
1304
|
+
"aria-label": e.ariaLabel,
|
|
1305
|
+
"aria-describedby": s(l).describedBy.value,
|
|
1306
|
+
"aria-valuemin": 0,
|
|
1307
|
+
"aria-valuemax": e.max,
|
|
1308
|
+
"aria-valuenow": i.value ?? 0,
|
|
1309
|
+
"aria-readonly": e.readonly || void 0,
|
|
1310
|
+
"aria-disabled": s(l).disabled.value || void 0,
|
|
1311
|
+
onKeydown: M,
|
|
1312
|
+
onMouseleave: C[0] || (C[0] = (f) => o.value = null)
|
|
1313
|
+
}), [
|
|
1314
|
+
(n(!0), d(X, null, q(b.value, (f) => (n(), d("span", {
|
|
1315
|
+
key: f.position,
|
|
1316
|
+
class: U(["wx-rate__star", { "is-full": f.full, "is-half": f.half }]),
|
|
1317
|
+
onClick: ($) => p(f.position, $),
|
|
1318
|
+
onMousemove: ($) => T(f.position, $)
|
|
1319
|
+
}, [...C[1] || (C[1] = [
|
|
1320
|
+
I("svg", {
|
|
1321
|
+
viewBox: "0 0 24 24",
|
|
1322
|
+
"aria-hidden": "true"
|
|
1323
|
+
}, [
|
|
1324
|
+
I("path", {
|
|
1325
|
+
class: "wx-rate__outline",
|
|
1326
|
+
d: "M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z",
|
|
1327
|
+
fill: "none",
|
|
1328
|
+
stroke: "currentColor",
|
|
1329
|
+
"stroke-width": "1.5",
|
|
1330
|
+
"stroke-linejoin": "round"
|
|
1331
|
+
}),
|
|
1332
|
+
I("path", {
|
|
1333
|
+
class: "wx-rate__fill",
|
|
1334
|
+
d: "M12 3.5l2.6 5.3 5.9.9-4.2 4.1 1 5.8-5.3-2.8-5.3 2.8 1-5.8-4.2-4.1 5.9-.9z",
|
|
1335
|
+
fill: "currentColor"
|
|
1336
|
+
})
|
|
1337
|
+
], -1)
|
|
1338
|
+
])], 42, pl))), 128)),
|
|
1339
|
+
e.showValue ? (n(), d("span", hl, N(i.value ?? 0), 1)) : W("", !0),
|
|
1340
|
+
e.name ? (n(), d("input", {
|
|
1341
|
+
key: 1,
|
|
1342
|
+
type: "hidden",
|
|
1343
|
+
name: e.name,
|
|
1344
|
+
value: i.value ?? 0
|
|
1345
|
+
}, null, 8, yl)) : W("", !0)
|
|
1346
|
+
], 16, bl));
|
|
1347
|
+
}
|
|
1348
|
+
}), kl = /* @__PURE__ */ j(xl, [["__scopeId", "data-v-7cbc0034"]]), gl = {
|
|
1349
|
+
bold: "M7 5h6a3.5 3.5 0 0 1 0 7H7zm0 7h7a3.5 3.5 0 0 1 0 7H7z",
|
|
1350
|
+
italic: "M15 5h-5M14 19H9M13.5 5 10.5 19",
|
|
1351
|
+
strike: "M5 12h14M8 8.5A3 3 0 0 1 11 6h2a3 3 0 0 1 3 2.5M16 15.5A3 3 0 0 1 13 18h-2a3 3 0 0 1-3-2.5",
|
|
1352
|
+
code: "m9 8-5 4 5 4M15 8l5 4-5 4",
|
|
1353
|
+
bulletList: "M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01",
|
|
1354
|
+
orderedList: "M10 6h10M10 12h10M10 18h10M4 6h1v4M4 10h2M4 14h2v2H4v2h2",
|
|
1355
|
+
blockquote: "M7 15V9h4v6H7l-2 3M15 15V9h4v6h-4l-2 3",
|
|
1356
|
+
hr: "M4 12h16",
|
|
1357
|
+
link: "M10 13a4 4 0 0 0 5.7.4l2.6-2.6a4 4 0 0 0-5.7-5.7l-1.5 1.5M14 11a4 4 0 0 0-5.7-.4l-2.6 2.6a4 4 0 0 0 5.7 5.7l1.5-1.5",
|
|
1358
|
+
table: "M4 6h16v12H4zM4 10h16M10 10v8M4 14h16",
|
|
1359
|
+
image: "M4 6h16v12H4zM4 15l4-4 4 4 3-3 5 5M9 9.5h.01",
|
|
1360
|
+
youtube: "M3 8.5A2.5 2.5 0 0 1 5.5 6h13A2.5 2.5 0 0 1 21 8.5v7a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 15.5zM10.5 9.5l4 2.5-4 2.5z",
|
|
1361
|
+
undo: "M4 9h11a4.5 4.5 0 0 1 0 9h-4M4 9l4-4M4 9l4 4",
|
|
1362
|
+
redo: "M20 9H9a4.5 4.5 0 0 0 0 9h4M20 9l-4-4M20 9l-4 4",
|
|
1363
|
+
rowAfter: "M4 5h16M4 11h16M8 15v6M5 18h6",
|
|
1364
|
+
rowBefore: "M4 19h16M4 13h16M8 3v6M5 6h6",
|
|
1365
|
+
columnAfter: "M5 4v16M11 4v16M15 8h6M18 5v6",
|
|
1366
|
+
columnBefore: "M19 4v16M13 4v16M3 8h6M6 5v6",
|
|
1367
|
+
deleteRow: "M4 8h16M4 16h16M9 12h6",
|
|
1368
|
+
deleteColumn: "M8 4v16M16 4v16M12 9v6",
|
|
1369
|
+
deleteTable: "M5 7h14M9 7V5h6v2M7 7l1 12h8l1-12M10 11v4M14 11v4",
|
|
1370
|
+
mergeCells: "M4 6h16v12H4zM12 6v3M12 15v3M9 12h6M9 12l2-2M9 12l2 2",
|
|
1371
|
+
check: "m5 13 4 4L19 7",
|
|
1372
|
+
close: "M6 6l12 12M18 6 6 18"
|
|
1373
|
+
}, wl = ["title", "aria-label", "aria-pressed", "disabled"], $l = {
|
|
1374
|
+
key: 0,
|
|
1375
|
+
viewBox: "0 0 24 24",
|
|
1376
|
+
fill: "none",
|
|
1377
|
+
"aria-hidden": "true"
|
|
1378
|
+
}, _l = ["d"], Bl = {
|
|
193
1379
|
key: 1,
|
|
194
|
-
class: "wx-
|
|
195
|
-
},
|
|
196
|
-
name: "
|
|
197
|
-
__name: "
|
|
1380
|
+
class: "wx-rich-text__tool-text"
|
|
1381
|
+
}, Ml = /* @__PURE__ */ E({
|
|
1382
|
+
name: "WxRichTextToolbarButton",
|
|
1383
|
+
__name: "ToolbarButton",
|
|
198
1384
|
props: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
1385
|
+
icon: { default: void 0 },
|
|
1386
|
+
text: { default: void 0 },
|
|
1387
|
+
label: {},
|
|
1388
|
+
active: { type: Boolean, default: !1 },
|
|
1389
|
+
disabled: { type: Boolean, default: !1 }
|
|
203
1390
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1391
|
+
emits: ["click"],
|
|
1392
|
+
setup(e) {
|
|
1393
|
+
return (y, a) => (n(), d("button", {
|
|
1394
|
+
type: "button",
|
|
1395
|
+
class: U(["wx-rich-text__tool", { "is-active": e.active }]),
|
|
1396
|
+
title: e.label,
|
|
1397
|
+
"aria-label": e.label,
|
|
1398
|
+
"aria-pressed": e.active,
|
|
1399
|
+
disabled: e.disabled,
|
|
1400
|
+
onClick: a[0] || (a[0] = (t) => y.$emit("click"))
|
|
1401
|
+
}, [
|
|
1402
|
+
e.icon ? (n(), d("svg", $l, [
|
|
1403
|
+
I("path", {
|
|
1404
|
+
d: s(gl)[e.icon],
|
|
1405
|
+
stroke: "currentColor",
|
|
1406
|
+
"stroke-width": "1.7",
|
|
1407
|
+
"stroke-linecap": "round",
|
|
1408
|
+
"stroke-linejoin": "round"
|
|
1409
|
+
}, null, 8, _l)
|
|
1410
|
+
])) : (n(), d("span", Bl, N(e.text), 1))
|
|
1411
|
+
], 10, wl));
|
|
1412
|
+
}
|
|
1413
|
+
}), ie = /* @__PURE__ */ j(Ml, [["__scopeId", "data-v-c8c7e143"]]), Cl = [
|
|
1414
|
+
"bold",
|
|
1415
|
+
"italic",
|
|
1416
|
+
"strike",
|
|
1417
|
+
"code",
|
|
1418
|
+
"divider",
|
|
1419
|
+
"h2",
|
|
1420
|
+
"h3",
|
|
1421
|
+
"h4",
|
|
1422
|
+
"divider",
|
|
1423
|
+
"bulletList",
|
|
1424
|
+
"orderedList",
|
|
1425
|
+
"blockquote",
|
|
1426
|
+
"hr",
|
|
1427
|
+
"divider",
|
|
1428
|
+
"link",
|
|
1429
|
+
"table",
|
|
1430
|
+
"image",
|
|
1431
|
+
"youtube",
|
|
1432
|
+
"divider",
|
|
1433
|
+
"undo",
|
|
1434
|
+
"redo"
|
|
1435
|
+
], Vl = [
|
|
1436
|
+
"image/png",
|
|
1437
|
+
"image/jpeg",
|
|
1438
|
+
"image/gif",
|
|
1439
|
+
"image/webp",
|
|
1440
|
+
"image/svg+xml"
|
|
1441
|
+
], re = {
|
|
1442
|
+
bold: { label: "Bold", icon: "bold" },
|
|
1443
|
+
italic: { label: "Italic", icon: "italic" },
|
|
1444
|
+
strike: { label: "Strikethrough", icon: "strike" },
|
|
1445
|
+
code: { label: "Inline code", icon: "code" },
|
|
1446
|
+
h2: { label: "Heading 2", text: "H2" },
|
|
1447
|
+
h3: { label: "Heading 3", text: "H3" },
|
|
1448
|
+
h4: { label: "Heading 4", text: "H4" },
|
|
1449
|
+
bulletList: { label: "Bulleted list", icon: "bulletList" },
|
|
1450
|
+
orderedList: { label: "Numbered list", icon: "orderedList" },
|
|
1451
|
+
blockquote: { label: "Quote", icon: "blockquote" },
|
|
1452
|
+
hr: { label: "Divider", icon: "hr" },
|
|
1453
|
+
link: { label: "Link", icon: "link" },
|
|
1454
|
+
table: { label: "Table", icon: "table" },
|
|
1455
|
+
image: { label: "Image", icon: "image" },
|
|
1456
|
+
youtube: { label: "YouTube video", icon: "youtube" },
|
|
1457
|
+
undo: { label: "Undo", icon: "undo" },
|
|
1458
|
+
redo: { label: "Redo", icon: "redo" }
|
|
1459
|
+
}, Il = [
|
|
1460
|
+
{ key: "addRowAfter", label: "Row below", icon: "rowAfter" },
|
|
1461
|
+
{ key: "addRowBefore", label: "Row above", icon: "rowBefore" },
|
|
1462
|
+
{ key: "addColumnAfter", label: "Column after", icon: "columnAfter" },
|
|
1463
|
+
{ key: "addColumnBefore", label: "Column before", icon: "columnBefore" },
|
|
1464
|
+
{ key: "deleteRow", label: "Delete row", icon: "deleteRow" },
|
|
1465
|
+
{ key: "deleteColumn", label: "Delete column", icon: "deleteColumn" },
|
|
1466
|
+
{ key: "mergeOrSplit", label: "Merge or split cells", icon: "mergeCells" },
|
|
1467
|
+
{ key: "deleteTable", label: "Delete table", icon: "deleteTable" }
|
|
1468
|
+
], Tl = ["aria-label"], zl = {
|
|
1469
|
+
key: 0,
|
|
1470
|
+
class: "wx-rich-text__divider",
|
|
1471
|
+
"aria-hidden": "true"
|
|
1472
|
+
}, Wl = {
|
|
1473
|
+
key: 0,
|
|
1474
|
+
class: "wx-rich-text__uploading"
|
|
1475
|
+
}, Sl = {
|
|
1476
|
+
key: 0,
|
|
1477
|
+
class: "wx-rich-text__toolbar wx-rich-text__toolbar--table"
|
|
1478
|
+
}, Al = ["for"], Ll = ["id", "placeholder"], Rl = {
|
|
1479
|
+
key: 0,
|
|
1480
|
+
class: "wx-rich-text__placeholder"
|
|
1481
|
+
}, Hl = ["accept"], Dl = /* @__PURE__ */ E({
|
|
1482
|
+
name: "WxRichText",
|
|
1483
|
+
inheritAttrs: !1,
|
|
1484
|
+
__name: "RichText",
|
|
1485
|
+
props: /* @__PURE__ */ S({
|
|
1486
|
+
placeholder: { default: void 0 },
|
|
1487
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1488
|
+
readonly: { type: Boolean, default: !1 },
|
|
1489
|
+
size: { default: void 0 },
|
|
1490
|
+
status: { default: void 0 },
|
|
1491
|
+
id: { default: void 0 },
|
|
1492
|
+
ariaLabel: { default: void 0 },
|
|
1493
|
+
minHeight: { default: "220px" },
|
|
1494
|
+
tools: { default: () => Cl },
|
|
1495
|
+
upload: { type: Function, default: void 0 },
|
|
1496
|
+
pickImage: { type: Function, default: void 0 },
|
|
1497
|
+
accept: { default: () => Vl }
|
|
1498
|
+
}, {
|
|
1499
|
+
modelValue: { default: "" },
|
|
1500
|
+
modelModifiers: {}
|
|
1501
|
+
}),
|
|
1502
|
+
emits: /* @__PURE__ */ S(["change", "focus", "blur", "uploadError"], ["update:modelValue"]),
|
|
1503
|
+
setup(e, { expose: y, emit: a }) {
|
|
1504
|
+
const t = e, i = a, l = G(e, "modelValue"), o = Y(t), v = D(!1), m = D(0), b = D(null), c = D(null), r = u(() => !o.disabled.value && !t.readonly);
|
|
1505
|
+
function h() {
|
|
1506
|
+
const _ = p.value;
|
|
1507
|
+
return !_ || _.isEmpty ? "" : _.getHTML();
|
|
1508
|
+
}
|
|
1509
|
+
const p = oa({
|
|
1510
|
+
content: l.value ?? "",
|
|
1511
|
+
editable: r.value,
|
|
1512
|
+
extensions: [
|
|
1513
|
+
na.configure({
|
|
1514
|
+
link: {
|
|
1515
|
+
openOnClick: !1,
|
|
1516
|
+
autolink: !0,
|
|
1517
|
+
HTMLAttributes: { rel: "noopener noreferrer nofollow", target: "_blank" }
|
|
1518
|
+
}
|
|
1519
|
+
}),
|
|
1520
|
+
ua.configure({ table: { resizable: !0 } }),
|
|
1521
|
+
sa.configure({ HTMLAttributes: { class: "wx-rich-text__image" } }),
|
|
1522
|
+
da.configure({ nocookie: !0, width: 640, height: 360 }),
|
|
1523
|
+
ra.configure({
|
|
1524
|
+
allowedMimeTypes: t.accept,
|
|
1525
|
+
onDrop: (_, z, w) => {
|
|
1526
|
+
f(z, w);
|
|
1527
|
+
},
|
|
1528
|
+
onPaste: (_, z) => {
|
|
1529
|
+
f(z);
|
|
1530
|
+
}
|
|
1531
|
+
})
|
|
1532
|
+
],
|
|
1533
|
+
onUpdate: () => {
|
|
1534
|
+
const _ = h();
|
|
1535
|
+
l.value = _, i("change", _);
|
|
1536
|
+
},
|
|
1537
|
+
onFocus: () => {
|
|
1538
|
+
v.value = !0, i("focus");
|
|
1539
|
+
},
|
|
1540
|
+
onBlur: () => {
|
|
1541
|
+
v.value = !1, i("blur");
|
|
1542
|
+
}
|
|
1543
|
+
});
|
|
1544
|
+
Z(l, (_) => {
|
|
1545
|
+
const z = p.value;
|
|
1546
|
+
z && (_ ?? "") !== h() && z.commands.setContent(_ ?? "", { emitUpdate: !1 });
|
|
1547
|
+
}), Z(r, (_) => p.value?.setEditable(_));
|
|
1548
|
+
const T = u(() => p.value?.isEmpty ?? !0), M = u(() => p.value?.isActive("table") ?? !1), g = u(() => [
|
|
1549
|
+
"wx-rich-text",
|
|
1550
|
+
`wx-rich-text--${o.size.value}`,
|
|
1551
|
+
{
|
|
1552
|
+
[`wx-rich-text--${o.status.value}`]: o.status.value !== "default",
|
|
1553
|
+
"is-focused": v.value,
|
|
1554
|
+
"is-disabled": o.disabled.value,
|
|
1555
|
+
"is-readonly": t.readonly
|
|
1556
|
+
}
|
|
210
1557
|
]);
|
|
211
|
-
|
|
212
|
-
|
|
1558
|
+
function C(_, z, w) {
|
|
1559
|
+
const J = p.value;
|
|
1560
|
+
if (!J) return;
|
|
1561
|
+
const me = w ?? J.state.selection.anchor;
|
|
1562
|
+
J.chain().focus().insertContentAt(me, { type: "image", attrs: { src: _, alt: z } }).run();
|
|
1563
|
+
}
|
|
1564
|
+
async function f(_, z) {
|
|
1565
|
+
if (t.upload)
|
|
1566
|
+
for (const w of _) {
|
|
1567
|
+
m.value += 1;
|
|
1568
|
+
try {
|
|
1569
|
+
const J = await t.upload(w);
|
|
1570
|
+
C(J.url, J.alt, z);
|
|
1571
|
+
} catch (J) {
|
|
1572
|
+
i("uploadError", J, w);
|
|
1573
|
+
} finally {
|
|
1574
|
+
m.value -= 1;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
async function $() {
|
|
1579
|
+
if (t.pickImage) {
|
|
1580
|
+
const _ = await t.pickImage();
|
|
1581
|
+
_ && C(_);
|
|
1582
|
+
return;
|
|
1583
|
+
}
|
|
1584
|
+
b.value?.click();
|
|
1585
|
+
}
|
|
1586
|
+
function V(_) {
|
|
1587
|
+
const z = _.target, w = Array.from(z.files ?? []);
|
|
1588
|
+
z.value = "", f(w);
|
|
1589
|
+
}
|
|
1590
|
+
function L(_) {
|
|
1591
|
+
const z = _ === "link" ? p.value?.getAttributes("link").href ?? "" : "";
|
|
1592
|
+
c.value = { kind: _, value: String(z) };
|
|
1593
|
+
}
|
|
1594
|
+
function x() {
|
|
1595
|
+
const _ = p.value, z = c.value;
|
|
1596
|
+
if (!_ || !z) return;
|
|
1597
|
+
const w = z.value.trim();
|
|
1598
|
+
z.kind === "link" ? w ? _.chain().focus().extendMarkRange("link").setLink({ href: w }).run() : _.chain().focus().extendMarkRange("link").unsetLink().run() : w && _.commands.setYoutubeVideo({ src: w }), c.value = null;
|
|
1599
|
+
}
|
|
1600
|
+
function k(_) {
|
|
1601
|
+
return _ === "image" ? !!(t.upload || t.pickImage) : !0;
|
|
1602
|
+
}
|
|
1603
|
+
const R = u(() => t.tools.filter(k));
|
|
1604
|
+
function O(_) {
|
|
1605
|
+
const z = p.value;
|
|
1606
|
+
if (!z) return !1;
|
|
1607
|
+
switch (_) {
|
|
1608
|
+
case "h2":
|
|
1609
|
+
return z.isActive("heading", { level: 2 });
|
|
1610
|
+
case "h3":
|
|
1611
|
+
return z.isActive("heading", { level: 3 });
|
|
1612
|
+
case "h4":
|
|
1613
|
+
return z.isActive("heading", { level: 4 });
|
|
1614
|
+
default:
|
|
1615
|
+
return z.isActive(_);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
function B(_) {
|
|
1619
|
+
const z = p.value;
|
|
1620
|
+
if (!z) return;
|
|
1621
|
+
const w = z.chain().focus();
|
|
1622
|
+
switch (_) {
|
|
1623
|
+
case "bold":
|
|
1624
|
+
w.toggleBold().run();
|
|
1625
|
+
break;
|
|
1626
|
+
case "italic":
|
|
1627
|
+
w.toggleItalic().run();
|
|
1628
|
+
break;
|
|
1629
|
+
case "strike":
|
|
1630
|
+
w.toggleStrike().run();
|
|
1631
|
+
break;
|
|
1632
|
+
case "code":
|
|
1633
|
+
w.toggleCode().run();
|
|
1634
|
+
break;
|
|
1635
|
+
case "h2":
|
|
1636
|
+
w.toggleHeading({ level: 2 }).run();
|
|
1637
|
+
break;
|
|
1638
|
+
case "h3":
|
|
1639
|
+
w.toggleHeading({ level: 3 }).run();
|
|
1640
|
+
break;
|
|
1641
|
+
case "h4":
|
|
1642
|
+
w.toggleHeading({ level: 4 }).run();
|
|
1643
|
+
break;
|
|
1644
|
+
case "bulletList":
|
|
1645
|
+
w.toggleBulletList().run();
|
|
1646
|
+
break;
|
|
1647
|
+
case "orderedList":
|
|
1648
|
+
w.toggleOrderedList().run();
|
|
1649
|
+
break;
|
|
1650
|
+
case "blockquote":
|
|
1651
|
+
w.toggleBlockquote().run();
|
|
1652
|
+
break;
|
|
1653
|
+
case "hr":
|
|
1654
|
+
w.setHorizontalRule().run();
|
|
1655
|
+
break;
|
|
1656
|
+
case "undo":
|
|
1657
|
+
w.undo().run();
|
|
1658
|
+
break;
|
|
1659
|
+
case "redo":
|
|
1660
|
+
w.redo().run();
|
|
1661
|
+
break;
|
|
1662
|
+
case "table":
|
|
1663
|
+
w.insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run();
|
|
1664
|
+
break;
|
|
1665
|
+
case "link":
|
|
1666
|
+
L("link");
|
|
1667
|
+
break;
|
|
1668
|
+
case "youtube":
|
|
1669
|
+
L("youtube");
|
|
1670
|
+
break;
|
|
1671
|
+
case "image":
|
|
1672
|
+
$();
|
|
1673
|
+
break;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
function A(_) {
|
|
1677
|
+
const z = p.value;
|
|
1678
|
+
if (!z) return;
|
|
1679
|
+
z.chain().focus()[_]().run();
|
|
1680
|
+
}
|
|
1681
|
+
return y({
|
|
1682
|
+
editor: p,
|
|
1683
|
+
focus: () => p.value?.commands.focus(),
|
|
1684
|
+
clear: () => p.value?.commands.clearContent(!0)
|
|
1685
|
+
}), (_, z) => (n(), d("div", {
|
|
1686
|
+
class: U(g.value)
|
|
213
1687
|
}, [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
1688
|
+
I("div", {
|
|
1689
|
+
class: "wx-rich-text__toolbar",
|
|
1690
|
+
role: "toolbar",
|
|
1691
|
+
"aria-label": e.ariaLabel ?? "Text formatting"
|
|
1692
|
+
}, [
|
|
1693
|
+
(n(!0), d(X, null, q(R.value, (w, J) => (n(), d(X, {
|
|
1694
|
+
key: `${w}-${J}`
|
|
1695
|
+
}, [
|
|
1696
|
+
w === "divider" ? (n(), d("span", zl)) : (n(), Q(ie, {
|
|
1697
|
+
key: 1,
|
|
1698
|
+
icon: s(re)[w].icon,
|
|
1699
|
+
text: s(re)[w].text,
|
|
1700
|
+
label: s(re)[w].label,
|
|
1701
|
+
active: O(w),
|
|
1702
|
+
disabled: !r.value,
|
|
1703
|
+
onClick: (me) => B(w)
|
|
1704
|
+
}, null, 8, ["icon", "text", "label", "active", "disabled", "onClick"]))
|
|
1705
|
+
], 64))), 128)),
|
|
1706
|
+
m.value > 0 ? (n(), d("span", Wl, "Uploading…")) : W("", !0)
|
|
1707
|
+
], 8, Tl),
|
|
1708
|
+
M.value && r.value ? (n(), d("div", Sl, [
|
|
1709
|
+
(n(!0), d(X, null, q(s(Il), (w) => (n(), Q(ie, {
|
|
1710
|
+
key: w.key,
|
|
1711
|
+
icon: w.icon,
|
|
1712
|
+
label: w.label,
|
|
1713
|
+
onClick: (J) => A(w.key)
|
|
1714
|
+
}, null, 8, ["icon", "label", "onClick"]))), 128))
|
|
1715
|
+
])) : W("", !0),
|
|
1716
|
+
c.value ? (n(), d("form", {
|
|
1717
|
+
key: 1,
|
|
1718
|
+
class: "wx-rich-text__prompt",
|
|
1719
|
+
onSubmit: le(x, ["prevent"])
|
|
1720
|
+
}, [
|
|
1721
|
+
I("label", {
|
|
1722
|
+
class: "wx-rich-text__prompt-label",
|
|
1723
|
+
for: `${s(o).id.value}-prompt`
|
|
1724
|
+
}, N(c.value.kind === "link" ? "Link address" : "YouTube URL"), 9, Al),
|
|
1725
|
+
Ve(I("input", {
|
|
1726
|
+
id: `${s(o).id.value}-prompt`,
|
|
1727
|
+
"onUpdate:modelValue": z[0] || (z[0] = (w) => c.value.value = w),
|
|
1728
|
+
class: "wx-rich-text__prompt-input",
|
|
1729
|
+
type: "url",
|
|
1730
|
+
placeholder: c.value.kind === "link" ? "https://example.com" : "https://youtu.be/…",
|
|
1731
|
+
onKeydown: z[1] || (z[1] = Ie((w) => c.value = null, ["esc"]))
|
|
1732
|
+
}, null, 40, Ll), [
|
|
1733
|
+
[Te, c.value.value]
|
|
219
1734
|
]),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1735
|
+
F(ie, {
|
|
1736
|
+
icon: "check",
|
|
1737
|
+
label: "Apply",
|
|
1738
|
+
onClick: x
|
|
1739
|
+
}),
|
|
1740
|
+
F(ie, {
|
|
1741
|
+
icon: "close",
|
|
1742
|
+
label: "Cancel",
|
|
1743
|
+
onClick: z[2] || (z[2] = (w) => c.value = null)
|
|
1744
|
+
})
|
|
1745
|
+
], 32)) : W("", !0),
|
|
1746
|
+
I("div", {
|
|
1747
|
+
class: "wx-rich-text__body",
|
|
1748
|
+
style: ae({ minHeight: e.minHeight })
|
|
1749
|
+
}, [
|
|
1750
|
+
e.placeholder && T.value ? (n(), d("span", Rl, N(e.placeholder), 1)) : W("", !0),
|
|
1751
|
+
F(s(ia), {
|
|
1752
|
+
editor: s(p),
|
|
1753
|
+
class: "wx-rich-text__content",
|
|
1754
|
+
"aria-describedby": s(o).describedBy.value
|
|
1755
|
+
}, null, 8, ["editor", "aria-describedby"])
|
|
1756
|
+
], 4),
|
|
1757
|
+
e.upload && !e.pickImage ? (n(), d("input", {
|
|
1758
|
+
key: 2,
|
|
1759
|
+
ref_key: "fileInput",
|
|
1760
|
+
ref: b,
|
|
1761
|
+
class: "wx-rich-text__file",
|
|
1762
|
+
type: "file",
|
|
1763
|
+
accept: e.accept.join(","),
|
|
1764
|
+
multiple: "",
|
|
1765
|
+
onChange: V
|
|
1766
|
+
}, null, 40, Hl)) : W("", !0)
|
|
1767
|
+
], 2));
|
|
1768
|
+
}
|
|
1769
|
+
}), Fl = /* @__PURE__ */ j(Dl, [["__scopeId", "data-v-80be39db"]]), Pl = { class: "wx-select__value" }, Nl = ["aria-label", "onClick"], Ul = {
|
|
1770
|
+
key: 0,
|
|
1771
|
+
class: "wx-select__single"
|
|
1772
|
+
}, El = {
|
|
1773
|
+
key: 1,
|
|
1774
|
+
class: "wx-select__placeholder"
|
|
1775
|
+
}, Ol = { class: "wx-select__option-label" }, jl = /* @__PURE__ */ E({
|
|
1776
|
+
name: "WxSelect",
|
|
1777
|
+
inheritAttrs: !1,
|
|
1778
|
+
__name: "Select",
|
|
1779
|
+
props: /* @__PURE__ */ S({
|
|
1780
|
+
options: { default: () => [] },
|
|
1781
|
+
multiple: { type: Boolean, default: !1 },
|
|
1782
|
+
filterable: { type: Boolean, default: !1 },
|
|
1783
|
+
clearable: { type: Boolean, default: !1 },
|
|
1784
|
+
placeholder: { default: void 0 },
|
|
1785
|
+
emptyText: { default: "Nothing found" },
|
|
1786
|
+
teleport: { type: Boolean, default: !0 },
|
|
1787
|
+
disabled: { type: Boolean, default: void 0 },
|
|
1788
|
+
size: { default: void 0 },
|
|
1789
|
+
status: { default: void 0 },
|
|
1790
|
+
id: { default: void 0 },
|
|
1791
|
+
name: { default: void 0 },
|
|
1792
|
+
ariaLabel: { default: void 0 }
|
|
1793
|
+
}, {
|
|
1794
|
+
modelValue: { default: null },
|
|
1795
|
+
modelModifiers: {}
|
|
1796
|
+
}),
|
|
1797
|
+
emits: /* @__PURE__ */ S(["change", "clear", "open", "close", "search"], ["update:modelValue"]),
|
|
1798
|
+
setup(e, { emit: y }) {
|
|
1799
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = D(!1), v = D(""), m = u({
|
|
1800
|
+
get: () => a.multiple ? i.value ?? [] : i.value ?? null,
|
|
1801
|
+
set: (V) => {
|
|
1802
|
+
i.value = V, t("change", V);
|
|
1803
|
+
}
|
|
1804
|
+
}), b = (V) => a.options.find((L) => L.value === V)?.label ?? String(V), c = u(() => a.multiple ? (i.value ?? []).map((V) => ({ value: V, label: b(V) })) : []), r = u(() => {
|
|
1805
|
+
if (a.multiple) return "";
|
|
1806
|
+
const V = i.value;
|
|
1807
|
+
return V == null ? "" : b(V);
|
|
1808
|
+
}), h = u(
|
|
1809
|
+
() => a.multiple ? c.value.length > 0 : i.value !== null && i.value !== void 0 && i.value !== ""
|
|
1810
|
+
), p = u(() => a.clearable && !l.disabled.value && h.value), T = u(() => [
|
|
1811
|
+
"wx-select",
|
|
1812
|
+
`wx-select--${l.size.value}`,
|
|
1813
|
+
{
|
|
1814
|
+
[`wx-select--${l.status.value}`]: l.status.value !== "default",
|
|
1815
|
+
"is-open": o.value,
|
|
1816
|
+
"is-disabled": l.disabled.value,
|
|
1817
|
+
"is-multiple": a.multiple
|
|
1818
|
+
}
|
|
1819
|
+
]);
|
|
1820
|
+
Z(
|
|
1821
|
+
() => i.value,
|
|
1822
|
+
() => {
|
|
1823
|
+
v.value = a.multiple ? "" : r.value;
|
|
1824
|
+
},
|
|
1825
|
+
{ immediate: !0 }
|
|
1826
|
+
), Z(o, (V) => {
|
|
1827
|
+
if (V) {
|
|
1828
|
+
t("open");
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
v.value = a.multiple ? "" : r.value, t("close");
|
|
1832
|
+
});
|
|
1833
|
+
function M() {
|
|
1834
|
+
l.disabled.value || (o.value = !0);
|
|
1835
|
+
}
|
|
1836
|
+
function g(V) {
|
|
1837
|
+
return V == null ? "" : b(V);
|
|
1838
|
+
}
|
|
1839
|
+
function C(V) {
|
|
1840
|
+
t("search", V.target.value);
|
|
1841
|
+
}
|
|
1842
|
+
function f() {
|
|
1843
|
+
i.value = a.multiple ? [] : null, t("change", i.value), t("clear");
|
|
1844
|
+
}
|
|
1845
|
+
function $(V) {
|
|
1846
|
+
const L = (i.value ?? []).filter((x) => x !== V);
|
|
1847
|
+
i.value = L, t("change", L);
|
|
1848
|
+
}
|
|
1849
|
+
return (V, L) => (n(), Q(s(Oe), {
|
|
1850
|
+
modelValue: m.value,
|
|
1851
|
+
"onUpdate:modelValue": L[1] || (L[1] = (x) => m.value = x),
|
|
1852
|
+
open: o.value,
|
|
1853
|
+
"onUpdate:open": L[2] || (L[2] = (x) => o.value = x),
|
|
1854
|
+
multiple: e.multiple,
|
|
1855
|
+
disabled: s(l).disabled.value,
|
|
1856
|
+
name: e.name,
|
|
1857
|
+
"ignore-filter": !e.filterable,
|
|
1858
|
+
"open-on-click": !0,
|
|
1859
|
+
class: U(T.value),
|
|
1860
|
+
as: "div"
|
|
1861
|
+
}, {
|
|
1862
|
+
default: H(() => [
|
|
1863
|
+
F(s(je), {
|
|
1864
|
+
class: "wx-select__anchor",
|
|
1865
|
+
as: "div",
|
|
1866
|
+
onClick: M
|
|
1867
|
+
}, {
|
|
1868
|
+
default: H(() => [
|
|
1869
|
+
I("div", Pl, [
|
|
1870
|
+
e.multiple ? (n(!0), d(X, { key: 0 }, q(c.value, (x) => (n(), d("span", {
|
|
1871
|
+
key: String(x.value),
|
|
1872
|
+
class: "wx-select__tag"
|
|
1873
|
+
}, [
|
|
1874
|
+
ee(N(x.label) + " ", 1),
|
|
1875
|
+
s(l).disabled.value ? W("", !0) : (n(), d("button", {
|
|
1876
|
+
key: 0,
|
|
1877
|
+
class: "wx-select__tag-remove",
|
|
1878
|
+
type: "button",
|
|
1879
|
+
tabindex: "-1",
|
|
1880
|
+
"aria-label": `Remove ${x.label}`,
|
|
1881
|
+
onClick: le((k) => $(x.value), ["stop"])
|
|
1882
|
+
}, " ✕ ", 8, Nl))
|
|
1883
|
+
]))), 128)) : W("", !0),
|
|
1884
|
+
e.filterable ? (n(), Q(s(Ge), K({
|
|
1885
|
+
key: 1,
|
|
1886
|
+
id: s(l).id.value
|
|
1887
|
+
}, V.$attrs, {
|
|
1888
|
+
modelValue: v.value,
|
|
1889
|
+
"onUpdate:modelValue": L[0] || (L[0] = (x) => v.value = x),
|
|
1890
|
+
class: "wx-select__input",
|
|
1891
|
+
placeholder: e.placeholder,
|
|
1892
|
+
"aria-label": e.ariaLabel,
|
|
1893
|
+
"aria-describedby": s(l).describedBy.value,
|
|
1894
|
+
"aria-invalid": s(l).status.value === "error" || void 0,
|
|
1895
|
+
"display-value": e.multiple ? void 0 : g,
|
|
1896
|
+
"auto-focus": "",
|
|
1897
|
+
onInput: C
|
|
1898
|
+
}), null, 16, ["id", "modelValue", "placeholder", "aria-label", "aria-describedby", "aria-invalid", "display-value"])) : (n(), d(X, { key: 2 }, [
|
|
1899
|
+
!e.multiple && h.value ? (n(), d("span", Ul, N(r.value), 1)) : h.value ? W("", !0) : (n(), d("span", El, N(e.placeholder), 1))
|
|
1900
|
+
], 64))
|
|
1901
|
+
]),
|
|
1902
|
+
p.value ? (n(), d("button", {
|
|
1903
|
+
key: 0,
|
|
1904
|
+
class: "wx-select__clear",
|
|
1905
|
+
type: "button",
|
|
1906
|
+
tabindex: "-1",
|
|
1907
|
+
"aria-label": "Clear",
|
|
1908
|
+
onClick: le(f, ["stop"])
|
|
1909
|
+
}, " ✕ ")) : W("", !0),
|
|
1910
|
+
F(s(qe), {
|
|
1911
|
+
id: e.filterable ? void 0 : s(l).id.value,
|
|
1912
|
+
class: "wx-select__toggle",
|
|
1913
|
+
"aria-label": e.ariaLabel,
|
|
1914
|
+
"aria-describedby": s(l).describedBy.value
|
|
1915
|
+
}, {
|
|
1916
|
+
default: H(() => [...L[3] || (L[3] = [
|
|
1917
|
+
I("svg", {
|
|
1918
|
+
viewBox: "0 0 16 16",
|
|
1919
|
+
fill: "none",
|
|
1920
|
+
"aria-hidden": "true"
|
|
1921
|
+
}, [
|
|
1922
|
+
I("path", {
|
|
1923
|
+
d: "m4 6 4 4 4-4",
|
|
1924
|
+
stroke: "currentColor",
|
|
1925
|
+
"stroke-width": "1.6",
|
|
1926
|
+
"stroke-linecap": "round",
|
|
1927
|
+
"stroke-linejoin": "round"
|
|
1928
|
+
})
|
|
1929
|
+
], -1)
|
|
1930
|
+
])]),
|
|
1931
|
+
_: 1
|
|
1932
|
+
}, 8, ["id", "aria-label", "aria-describedby"])
|
|
1933
|
+
]),
|
|
1934
|
+
_: 1
|
|
1935
|
+
}),
|
|
1936
|
+
F(s(Ke), {
|
|
1937
|
+
disabled: !e.teleport
|
|
1938
|
+
}, {
|
|
1939
|
+
default: H(() => [
|
|
1940
|
+
F(s(Ye), {
|
|
1941
|
+
class: "wx-select__content",
|
|
1942
|
+
position: "popper",
|
|
1943
|
+
"side-offset": 4
|
|
1944
|
+
}, {
|
|
1945
|
+
default: H(() => [
|
|
1946
|
+
F(s(Xe), { class: "wx-select__viewport" }, {
|
|
1947
|
+
default: H(() => [
|
|
1948
|
+
F(s(Qe), { class: "wx-select__empty" }, {
|
|
1949
|
+
default: H(() => [
|
|
1950
|
+
ee(N(e.emptyText), 1)
|
|
1951
|
+
]),
|
|
1952
|
+
_: 1
|
|
1953
|
+
}),
|
|
1954
|
+
P(V.$slots, "default", {}, () => [
|
|
1955
|
+
(n(!0), d(X, null, q(e.options, (x) => (n(), Q(s(Je), {
|
|
1956
|
+
key: String(x.value),
|
|
1957
|
+
class: "wx-select__option",
|
|
1958
|
+
value: x.value,
|
|
1959
|
+
disabled: x.disabled
|
|
1960
|
+
}, {
|
|
1961
|
+
default: H(() => [
|
|
1962
|
+
I("span", Ol, N(x.label), 1),
|
|
1963
|
+
F(s(Ze), { class: "wx-select__check" }, {
|
|
1964
|
+
default: H(() => [...L[4] || (L[4] = [
|
|
1965
|
+
I("svg", {
|
|
1966
|
+
viewBox: "0 0 16 16",
|
|
1967
|
+
fill: "none",
|
|
1968
|
+
"aria-hidden": "true"
|
|
1969
|
+
}, [
|
|
1970
|
+
I("path", {
|
|
1971
|
+
d: "m3.5 8.5 3 3 6-6",
|
|
1972
|
+
stroke: "currentColor",
|
|
1973
|
+
"stroke-width": "2",
|
|
1974
|
+
"stroke-linecap": "round",
|
|
1975
|
+
"stroke-linejoin": "round"
|
|
1976
|
+
})
|
|
1977
|
+
], -1)
|
|
1978
|
+
])]),
|
|
1979
|
+
_: 1
|
|
1980
|
+
})
|
|
1981
|
+
]),
|
|
1982
|
+
_: 2
|
|
1983
|
+
}, 1032, ["value", "disabled"]))), 128))
|
|
1984
|
+
], !0)
|
|
1985
|
+
]),
|
|
1986
|
+
_: 3
|
|
1987
|
+
})
|
|
1988
|
+
]),
|
|
1989
|
+
_: 3
|
|
1990
|
+
})
|
|
1991
|
+
]),
|
|
1992
|
+
_: 3
|
|
1993
|
+
}, 8, ["disabled"])
|
|
226
1994
|
]),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
1995
|
+
_: 3
|
|
1996
|
+
}, 8, ["modelValue", "open", "multiple", "disabled", "name", "ignore-filter", "class"]));
|
|
1997
|
+
}
|
|
1998
|
+
}), Gl = /* @__PURE__ */ j(jl, [["__scopeId", "data-v-c4893d5b"]]), ql = { class: "wx-slider__row" }, Kl = {
|
|
1999
|
+
key: 0,
|
|
2000
|
+
class: "wx-slider__value"
|
|
2001
|
+
}, Yl = {
|
|
2002
|
+
key: 0,
|
|
2003
|
+
class: "wx-slider__marks",
|
|
2004
|
+
"aria-hidden": "true"
|
|
2005
|
+
}, Xl = /* @__PURE__ */ E({
|
|
2006
|
+
name: "WxSlider",
|
|
2007
|
+
inheritAttrs: !1,
|
|
2008
|
+
__name: "Slider",
|
|
2009
|
+
props: /* @__PURE__ */ S({
|
|
2010
|
+
min: { default: 0 },
|
|
2011
|
+
max: { default: 100 },
|
|
2012
|
+
step: { default: 1 },
|
|
2013
|
+
range: { type: Boolean, default: !1 },
|
|
2014
|
+
minStepsBetweenThumbs: { default: 0 },
|
|
2015
|
+
showValue: { type: Boolean, default: !1 },
|
|
2016
|
+
marks: { default: void 0 },
|
|
2017
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2018
|
+
size: { default: void 0 },
|
|
2019
|
+
id: { default: void 0 },
|
|
2020
|
+
name: { default: void 0 },
|
|
2021
|
+
ariaLabel: { default: void 0 }
|
|
2022
|
+
}, {
|
|
2023
|
+
modelValue: { default: null },
|
|
2024
|
+
modelModifiers: {}
|
|
2025
|
+
}),
|
|
2026
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
2027
|
+
setup(e, { emit: y }) {
|
|
2028
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = u(() => {
|
|
2029
|
+
if (a.range) {
|
|
2030
|
+
const r = Array.isArray(i.value) ? i.value : [];
|
|
2031
|
+
return [r[0] ?? a.min, r[1] ?? a.max];
|
|
2032
|
+
}
|
|
2033
|
+
return [(Array.isArray(i.value) ? i.value[0] : i.value) ?? a.min];
|
|
2034
|
+
});
|
|
2035
|
+
function v(c) {
|
|
2036
|
+
if (!c) return;
|
|
2037
|
+
const r = a.range ? [...c] : c[0];
|
|
2038
|
+
i.value = r, t("change", r);
|
|
2039
|
+
}
|
|
2040
|
+
const m = u(
|
|
2041
|
+
() => Object.entries(a.marks ?? {}).map(([c, r]) => ({
|
|
2042
|
+
value: Number(c),
|
|
2043
|
+
label: r,
|
|
2044
|
+
offset: (Number(c) - a.min) / (a.max - a.min) * 100
|
|
2045
|
+
}))
|
|
2046
|
+
), b = u(() => [
|
|
2047
|
+
"wx-slider",
|
|
2048
|
+
`wx-slider--${l.size.value}`,
|
|
2049
|
+
{ "is-disabled": l.disabled.value, "is-range": a.range }
|
|
2050
|
+
]);
|
|
2051
|
+
return (c, r) => (n(), d("div", {
|
|
2052
|
+
class: U(b.value)
|
|
2053
|
+
}, [
|
|
2054
|
+
I("div", ql, [
|
|
2055
|
+
F(s(ea), K({
|
|
2056
|
+
id: s(l).id.value
|
|
2057
|
+
}, c.$attrs, {
|
|
2058
|
+
class: "wx-slider__root",
|
|
2059
|
+
"model-value": o.value,
|
|
2060
|
+
min: e.min,
|
|
2061
|
+
max: e.max,
|
|
2062
|
+
step: e.step,
|
|
2063
|
+
disabled: s(l).disabled.value,
|
|
2064
|
+
"min-steps-between-thumbs": e.minStepsBetweenThumbs,
|
|
2065
|
+
name: e.name,
|
|
2066
|
+
"onUpdate:modelValue": v
|
|
2067
|
+
}), {
|
|
2068
|
+
default: H(() => [
|
|
2069
|
+
F(s(aa), { class: "wx-slider__track" }, {
|
|
2070
|
+
default: H(() => [
|
|
2071
|
+
F(s(la), { class: "wx-slider__range" })
|
|
2072
|
+
]),
|
|
2073
|
+
_: 1
|
|
2074
|
+
}),
|
|
2075
|
+
(n(!0), d(X, null, q(o.value.length, (h) => (n(), Q(s(ta), {
|
|
2076
|
+
key: h,
|
|
2077
|
+
class: "wx-slider__thumb",
|
|
2078
|
+
"aria-label": e.ariaLabel,
|
|
2079
|
+
"aria-describedby": s(l).describedBy.value
|
|
2080
|
+
}, null, 8, ["aria-label", "aria-describedby"]))), 128))
|
|
2081
|
+
]),
|
|
2082
|
+
_: 1
|
|
2083
|
+
}, 16, ["id", "model-value", "min", "max", "step", "disabled", "min-steps-between-thumbs", "name"]),
|
|
2084
|
+
e.showValue ? (n(), d("span", Kl, N(e.range ? `${o.value[0]} — ${o.value[1]}` : o.value[0]), 1)) : W("", !0)
|
|
2085
|
+
]),
|
|
2086
|
+
m.value.length ? (n(), d("div", Yl, [
|
|
2087
|
+
(n(!0), d(X, null, q(m.value, (h) => (n(), d("span", {
|
|
2088
|
+
key: h.value,
|
|
2089
|
+
class: "wx-slider__mark",
|
|
2090
|
+
style: ae({ left: `${h.offset}%` })
|
|
2091
|
+
}, N(h.label), 5))), 128))
|
|
2092
|
+
])) : W("", !0)
|
|
230
2093
|
], 2));
|
|
231
2094
|
}
|
|
232
|
-
}),
|
|
2095
|
+
}), Ql = /* @__PURE__ */ j(Xl, [["__scopeId", "data-v-49653b8d"]]), Jl = ["id", "name", "checked", "disabled", "aria-label", "aria-describedby"], Zl = {
|
|
2096
|
+
key: 0,
|
|
2097
|
+
class: "wx-switch__label"
|
|
2098
|
+
}, et = /* @__PURE__ */ E({
|
|
2099
|
+
name: "WxSwitch",
|
|
2100
|
+
inheritAttrs: !1,
|
|
2101
|
+
__name: "Switch",
|
|
2102
|
+
props: /* @__PURE__ */ S({
|
|
2103
|
+
activeValue: { type: [String, Number, Boolean, null], default: !0 },
|
|
2104
|
+
inactiveValue: { type: [String, Number, Boolean, null], default: !1 },
|
|
2105
|
+
label: { default: void 0 },
|
|
2106
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2107
|
+
size: { default: void 0 },
|
|
2108
|
+
id: { default: void 0 },
|
|
2109
|
+
name: { default: void 0 },
|
|
2110
|
+
ariaLabel: { default: void 0 }
|
|
2111
|
+
}, {
|
|
2112
|
+
modelValue: { type: [String, Number, Boolean, null], default: !1 },
|
|
2113
|
+
modelModifiers: {}
|
|
2114
|
+
}),
|
|
2115
|
+
emits: /* @__PURE__ */ S(["change"], ["update:modelValue"]),
|
|
2116
|
+
setup(e, { emit: y }) {
|
|
2117
|
+
const a = e, t = y, i = G(e, "modelValue"), l = Y(a), o = u(() => i.value === a.activeValue), v = u(() => a.size ?? l.size.value), m = u(() => [
|
|
2118
|
+
"wx-switch",
|
|
2119
|
+
`wx-switch--${v.value}`,
|
|
2120
|
+
{ "is-checked": o.value, "is-disabled": l.disabled.value }
|
|
2121
|
+
]);
|
|
2122
|
+
function b(c) {
|
|
2123
|
+
const r = c.target.checked ? a.activeValue : a.inactiveValue;
|
|
2124
|
+
i.value = r, t("change", r);
|
|
2125
|
+
}
|
|
2126
|
+
return (c, r) => (n(), d("label", {
|
|
2127
|
+
class: U(m.value)
|
|
2128
|
+
}, [
|
|
2129
|
+
I("input", K({
|
|
2130
|
+
id: s(l).id.value
|
|
2131
|
+
}, c.$attrs, {
|
|
2132
|
+
class: "wx-switch__native",
|
|
2133
|
+
type: "checkbox",
|
|
2134
|
+
role: "switch",
|
|
2135
|
+
name: e.name,
|
|
2136
|
+
checked: o.value,
|
|
2137
|
+
disabled: s(l).disabled.value,
|
|
2138
|
+
"aria-label": e.ariaLabel,
|
|
2139
|
+
"aria-describedby": s(l).describedBy.value,
|
|
2140
|
+
onChange: b
|
|
2141
|
+
}), null, 16, Jl),
|
|
2142
|
+
r[0] || (r[0] = I("span", {
|
|
2143
|
+
class: "wx-switch__track",
|
|
2144
|
+
"aria-hidden": "true"
|
|
2145
|
+
}, [
|
|
2146
|
+
I("span", { class: "wx-switch__thumb" })
|
|
2147
|
+
], -1)),
|
|
2148
|
+
e.label || c.$slots.default ? (n(), d("span", Zl, [
|
|
2149
|
+
P(c.$slots, "default", {}, () => [
|
|
2150
|
+
ee(N(e.label), 1)
|
|
2151
|
+
], !0)
|
|
2152
|
+
])) : W("", !0)
|
|
2153
|
+
], 2));
|
|
2154
|
+
}
|
|
2155
|
+
}), at = /* @__PURE__ */ j(et, [["__scopeId", "data-v-b9a90e4d"]]), lt = ["aria-label", "onClick"], tt = ["id", "value", "placeholder", "disabled", "aria-label", "aria-describedby", "aria-invalid", "aria-expanded"], ot = {
|
|
2156
|
+
key: 0,
|
|
2157
|
+
class: "wx-tags-input__list",
|
|
2158
|
+
role: "listbox"
|
|
2159
|
+
}, it = ["aria-selected", "onMousedown", "onMousemove"], nt = ["name"], ut = ["value"], st = /* @__PURE__ */ E({
|
|
2160
|
+
name: "WxTagsInput",
|
|
2161
|
+
inheritAttrs: !1,
|
|
2162
|
+
__name: "TagsInput",
|
|
2163
|
+
props: /* @__PURE__ */ S({
|
|
2164
|
+
suggestions: { default: () => [] },
|
|
2165
|
+
placeholder: { default: void 0 },
|
|
2166
|
+
emptyText: { default: "Nothing found" },
|
|
2167
|
+
max: { default: void 0 },
|
|
2168
|
+
duplicates: { type: Boolean, default: !1 },
|
|
2169
|
+
allowCreate: { type: Boolean, default: !0 },
|
|
2170
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2171
|
+
size: { default: void 0 },
|
|
2172
|
+
status: { default: void 0 },
|
|
2173
|
+
id: { default: void 0 },
|
|
2174
|
+
name: { default: void 0 },
|
|
2175
|
+
ariaLabel: { default: void 0 }
|
|
2176
|
+
}, {
|
|
2177
|
+
modelValue: { default: () => [] },
|
|
2178
|
+
modelModifiers: {}
|
|
2179
|
+
}),
|
|
2180
|
+
emits: /* @__PURE__ */ S(["change", "search"], ["update:modelValue"]),
|
|
2181
|
+
setup(e, { expose: y, emit: a }) {
|
|
2182
|
+
const t = e, i = a, l = G(e, "modelValue"), o = Y(t), v = D(null), m = D(""), b = D(!1), c = D(-1), r = D(-1), h = u(() => l.value ?? []), p = u(
|
|
2183
|
+
() => t.suggestions.filter((k) => !h.value.includes(k))
|
|
2184
|
+
), T = u(() => b.value && p.value.length > 0), M = u(() => t.max !== void 0 && h.value.length >= t.max), g = u(() => [
|
|
2185
|
+
"wx-tags-input",
|
|
2186
|
+
`wx-tags-input--${o.size.value}`,
|
|
2187
|
+
{
|
|
2188
|
+
[`wx-tags-input--${o.status.value}`]: o.status.value !== "default",
|
|
2189
|
+
"is-open": T.value,
|
|
2190
|
+
"is-disabled": o.disabled.value
|
|
2191
|
+
}
|
|
2192
|
+
]);
|
|
2193
|
+
Z(p, () => {
|
|
2194
|
+
c.value = -1;
|
|
2195
|
+
});
|
|
2196
|
+
function C(k) {
|
|
2197
|
+
l.value = k, i("change", k);
|
|
2198
|
+
}
|
|
2199
|
+
function f(k) {
|
|
2200
|
+
const R = k.trim();
|
|
2201
|
+
if (!(!R || M.value)) {
|
|
2202
|
+
if (!t.duplicates && h.value.includes(R)) {
|
|
2203
|
+
m.value = "";
|
|
2204
|
+
return;
|
|
2205
|
+
}
|
|
2206
|
+
C([...h.value, R]), m.value = "", b.value = !1, r.value = -1;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
function $(k) {
|
|
2210
|
+
C(h.value.filter((R, O) => O !== k)), r.value = -1;
|
|
2211
|
+
}
|
|
2212
|
+
function V(k) {
|
|
2213
|
+
const R = k.target.value;
|
|
2214
|
+
m.value = R, r.value = -1, c.value = -1, R && (b.value = !0), i("search", R);
|
|
2215
|
+
}
|
|
2216
|
+
function L(k) {
|
|
2217
|
+
if (k.key === "Escape") {
|
|
2218
|
+
b.value = !1, r.value = -1;
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
if (k.key === "Backspace" && m.value === "" && h.value.length > 0) {
|
|
2222
|
+
k.preventDefault(), r.value === h.value.length - 1 ? $(r.value) : r.value = h.value.length - 1;
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
if (k.key === "ArrowDown" && T.value) {
|
|
2226
|
+
k.preventDefault(), c.value = (c.value + 1) % p.value.length;
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
if (k.key === "ArrowUp" && T.value) {
|
|
2230
|
+
k.preventDefault(), c.value = c.value <= 0 ? p.value.length - 1 : c.value - 1;
|
|
2231
|
+
return;
|
|
2232
|
+
}
|
|
2233
|
+
k.key === "Enter" && (k.preventDefault(), T.value && c.value >= 0 ? f(p.value[c.value]) : t.allowCreate && f(m.value));
|
|
2234
|
+
}
|
|
2235
|
+
function x() {
|
|
2236
|
+
r.value = -1, window.setTimeout(() => {
|
|
2237
|
+
b.value = !1;
|
|
2238
|
+
}, 120);
|
|
2239
|
+
}
|
|
2240
|
+
return y({ focus: () => v.value?.focus() }), (k, R) => (n(), d("div", {
|
|
2241
|
+
class: U(g.value)
|
|
2242
|
+
}, [
|
|
2243
|
+
I("div", {
|
|
2244
|
+
class: "wx-tags-input__anchor",
|
|
2245
|
+
onClick: R[1] || (R[1] = (O) => v.value?.focus())
|
|
2246
|
+
}, [
|
|
2247
|
+
(n(!0), d(X, null, q(h.value, (O, B) => (n(), d("span", {
|
|
2248
|
+
key: O,
|
|
2249
|
+
class: U(["wx-tags-input__tag", { "is-armed": B === r.value }])
|
|
2250
|
+
}, [
|
|
2251
|
+
ee(N(O) + " ", 1),
|
|
2252
|
+
s(o).disabled.value ? W("", !0) : (n(), d("button", {
|
|
2253
|
+
key: 0,
|
|
2254
|
+
class: "wx-tags-input__remove",
|
|
2255
|
+
type: "button",
|
|
2256
|
+
tabindex: "-1",
|
|
2257
|
+
"aria-label": `Remove ${O}`,
|
|
2258
|
+
onClick: le((A) => $(B), ["stop"])
|
|
2259
|
+
}, " ✕ ", 8, lt))
|
|
2260
|
+
], 2))), 128)),
|
|
2261
|
+
I("input", K({
|
|
2262
|
+
id: s(o).id.value,
|
|
2263
|
+
ref_key: "inputRef",
|
|
2264
|
+
ref: v
|
|
2265
|
+
}, k.$attrs, {
|
|
2266
|
+
class: "wx-tags-input__field",
|
|
2267
|
+
type: "text",
|
|
2268
|
+
role: "combobox",
|
|
2269
|
+
autocomplete: "off",
|
|
2270
|
+
value: m.value,
|
|
2271
|
+
placeholder: e.placeholder,
|
|
2272
|
+
disabled: s(o).disabled.value,
|
|
2273
|
+
"aria-label": e.ariaLabel,
|
|
2274
|
+
"aria-describedby": s(o).describedBy.value,
|
|
2275
|
+
"aria-invalid": s(o).status.value === "error" || void 0,
|
|
2276
|
+
"aria-expanded": T.value,
|
|
2277
|
+
onInput: V,
|
|
2278
|
+
onKeydown: L,
|
|
2279
|
+
onFocus: R[0] || (R[0] = (O) => b.value = !0),
|
|
2280
|
+
onBlur: x
|
|
2281
|
+
}), null, 16, tt),
|
|
2282
|
+
T.value ? (n(), d("ul", ot, [
|
|
2283
|
+
(n(!0), d(X, null, q(p.value, (O, B) => (n(), d("li", {
|
|
2284
|
+
key: O,
|
|
2285
|
+
class: U(["wx-tags-input__option", { "is-highlighted": B === c.value }]),
|
|
2286
|
+
role: "option",
|
|
2287
|
+
"aria-selected": B === c.value,
|
|
2288
|
+
onMousedown: le((A) => f(O), ["prevent"]),
|
|
2289
|
+
onMousemove: (A) => c.value = B
|
|
2290
|
+
}, N(O), 43, it))), 128))
|
|
2291
|
+
])) : W("", !0)
|
|
2292
|
+
]),
|
|
2293
|
+
e.name ? (n(), d("select", {
|
|
2294
|
+
key: 0,
|
|
2295
|
+
class: "wx-sr-only",
|
|
2296
|
+
name: e.name,
|
|
2297
|
+
multiple: "",
|
|
2298
|
+
tabindex: "-1",
|
|
2299
|
+
"aria-hidden": "true"
|
|
2300
|
+
}, [
|
|
2301
|
+
(n(!0), d(X, null, q(h.value, (O) => (n(), d("option", {
|
|
2302
|
+
key: O,
|
|
2303
|
+
value: O,
|
|
2304
|
+
selected: ""
|
|
2305
|
+
}, N(O), 9, ut))), 128))
|
|
2306
|
+
], 8, nt)) : W("", !0)
|
|
2307
|
+
], 2));
|
|
2308
|
+
}
|
|
2309
|
+
}), dt = /* @__PURE__ */ j(st, [["__scopeId", "data-v-fcf7fe37"]]), rt = ["id", "value", "rows", "placeholder", "disabled", "readonly", "maxlength", "aria-label", "aria-describedby", "aria-invalid"], ct = {
|
|
2310
|
+
key: 0,
|
|
2311
|
+
class: "wx-textarea__count"
|
|
2312
|
+
}, vt = /* @__PURE__ */ E({
|
|
2313
|
+
name: "WxTextarea",
|
|
2314
|
+
inheritAttrs: !1,
|
|
2315
|
+
__name: "Textarea",
|
|
2316
|
+
props: /* @__PURE__ */ S({
|
|
2317
|
+
size: { default: void 0 },
|
|
2318
|
+
status: { default: void 0 },
|
|
2319
|
+
id: { default: void 0 },
|
|
2320
|
+
placeholder: { default: void 0 },
|
|
2321
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2322
|
+
readonly: { type: Boolean, default: !1 },
|
|
2323
|
+
rows: { default: 3 },
|
|
2324
|
+
autosize: { type: [Boolean, Object], default: !1 },
|
|
2325
|
+
maxlength: { default: void 0 },
|
|
2326
|
+
showCount: { type: Boolean, default: !1 },
|
|
2327
|
+
resize: { default: "vertical" },
|
|
2328
|
+
ariaLabel: { default: void 0 }
|
|
2329
|
+
}, {
|
|
2330
|
+
modelValue: { default: "" },
|
|
2331
|
+
modelModifiers: {}
|
|
2332
|
+
}),
|
|
2333
|
+
emits: /* @__PURE__ */ S(["input", "change", "focus", "blur"], ["update:modelValue"]),
|
|
2334
|
+
setup(e, { expose: y, emit: a }) {
|
|
2335
|
+
const t = e, i = a, l = G(e, "modelValue"), o = Y(t), v = D(null), m = D(!1), b = u(() => l.value ?? ""), c = u(
|
|
2336
|
+
() => t.showCount && t.maxlength ? `${b.value.length}/${t.maxlength}` : null
|
|
2337
|
+
), r = u(
|
|
2338
|
+
() => t.autosize === !0 ? {} : t.autosize === !1 ? null : t.autosize
|
|
2339
|
+
), h = u(() => [
|
|
2340
|
+
"wx-textarea",
|
|
2341
|
+
`wx-textarea--${o.size.value}`,
|
|
2342
|
+
{
|
|
2343
|
+
[`wx-textarea--${o.status.value}`]: o.status.value !== "default",
|
|
2344
|
+
"is-focused": m.value,
|
|
2345
|
+
"is-disabled": o.disabled.value,
|
|
2346
|
+
"is-readonly": t.readonly,
|
|
2347
|
+
"is-autosize": !!r.value
|
|
2348
|
+
}
|
|
2349
|
+
]);
|
|
2350
|
+
function p() {
|
|
2351
|
+
const f = r.value, $ = v.value;
|
|
2352
|
+
if (!f || !$) return;
|
|
2353
|
+
$.style.height = "auto";
|
|
2354
|
+
const V = getComputedStyle($), L = Number.parseFloat(V.lineHeight) || 20, x = Number.parseFloat(V.paddingTop) + Number.parseFloat(V.paddingBottom) + Number.parseFloat(V.borderTopWidth) + Number.parseFloat(V.borderBottomWidth);
|
|
2355
|
+
let k = $.scrollHeight;
|
|
2356
|
+
f.minRows && (k = Math.max(k, f.minRows * L + x)), f.maxRows && (k = Math.min(k, f.maxRows * L + x)), $.style.height = `${k}px`, $.style.overflowY = f.maxRows && $.scrollHeight > k ? "auto" : "hidden";
|
|
2357
|
+
}
|
|
2358
|
+
ke(() => be(p)), Z([b, r], () => be(p));
|
|
2359
|
+
function T(f) {
|
|
2360
|
+
const $ = f.target.value;
|
|
2361
|
+
l.value = $, i("input", $);
|
|
2362
|
+
}
|
|
2363
|
+
function M(f) {
|
|
2364
|
+
i("change", f.target.value);
|
|
2365
|
+
}
|
|
2366
|
+
function g(f) {
|
|
2367
|
+
m.value = !0, i("focus", f);
|
|
2368
|
+
}
|
|
2369
|
+
function C(f) {
|
|
2370
|
+
m.value = !1, i("blur", f);
|
|
2371
|
+
}
|
|
2372
|
+
return y({
|
|
2373
|
+
focus: () => v.value?.focus(),
|
|
2374
|
+
blur: () => v.value?.blur(),
|
|
2375
|
+
select: () => v.value?.select(),
|
|
2376
|
+
textarea: v
|
|
2377
|
+
}), (f, $) => (n(), d("div", {
|
|
2378
|
+
class: U(h.value)
|
|
2379
|
+
}, [
|
|
2380
|
+
I("textarea", K({
|
|
2381
|
+
id: s(o).id.value,
|
|
2382
|
+
ref_key: "textareaRef",
|
|
2383
|
+
ref: v
|
|
2384
|
+
}, f.$attrs, {
|
|
2385
|
+
class: "wx-textarea__inner",
|
|
2386
|
+
value: b.value,
|
|
2387
|
+
rows: e.rows,
|
|
2388
|
+
placeholder: e.placeholder,
|
|
2389
|
+
disabled: s(o).disabled.value,
|
|
2390
|
+
readonly: e.readonly,
|
|
2391
|
+
maxlength: e.maxlength,
|
|
2392
|
+
"aria-label": e.ariaLabel,
|
|
2393
|
+
"aria-describedby": s(o).describedBy.value,
|
|
2394
|
+
"aria-invalid": s(o).status.value === "error" || void 0,
|
|
2395
|
+
style: { resize: e.resize },
|
|
2396
|
+
onInput: T,
|
|
2397
|
+
onChange: M,
|
|
2398
|
+
onFocus: g,
|
|
2399
|
+
onBlur: C
|
|
2400
|
+
}), null, 16, rt),
|
|
2401
|
+
c.value ? (n(), d("span", ct, N(c.value), 1)) : W("", !0)
|
|
2402
|
+
], 2));
|
|
2403
|
+
}
|
|
2404
|
+
}), ft = /* @__PURE__ */ j(vt, [["__scopeId", "data-v-bbca9693"]]), mt = /* @__PURE__ */ E({
|
|
2405
|
+
name: "WxTimePicker",
|
|
2406
|
+
__name: "TimePicker",
|
|
2407
|
+
props: /* @__PURE__ */ S({
|
|
2408
|
+
valueFormat: { default: void 0 },
|
|
2409
|
+
format: { default: void 0 },
|
|
2410
|
+
placeholder: { default: void 0 },
|
|
2411
|
+
clearable: { type: Boolean, default: void 0 },
|
|
2412
|
+
minDate: { default: void 0 },
|
|
2413
|
+
maxDate: { default: void 0 },
|
|
2414
|
+
seconds: { type: Boolean, default: void 0 },
|
|
2415
|
+
minutesIncrement: { default: void 0 },
|
|
2416
|
+
is24: { type: Boolean, default: void 0 },
|
|
2417
|
+
weekStart: { default: void 0 },
|
|
2418
|
+
autoApply: { type: Boolean, default: void 0 },
|
|
2419
|
+
textInput: { type: Boolean, default: void 0 },
|
|
2420
|
+
teleport: { type: [Boolean, String], default: void 0 },
|
|
2421
|
+
disabled: { type: Boolean, default: void 0 },
|
|
2422
|
+
readonly: { type: Boolean, default: void 0 },
|
|
2423
|
+
size: { default: void 0 },
|
|
2424
|
+
status: { default: void 0 },
|
|
2425
|
+
id: { default: void 0 },
|
|
2426
|
+
name: { default: void 0 },
|
|
2427
|
+
ariaLabel: { default: void 0 }
|
|
2428
|
+
}, {
|
|
2429
|
+
modelValue: { default: null },
|
|
2430
|
+
modelModifiers: {}
|
|
2431
|
+
}),
|
|
2432
|
+
emits: ["update:modelValue"],
|
|
2433
|
+
setup(e) {
|
|
2434
|
+
const y = G(e, "modelValue");
|
|
2435
|
+
return (a, t) => (n(), Q(fe, K({
|
|
2436
|
+
modelValue: y.value,
|
|
2437
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => y.value = i),
|
|
2438
|
+
type: "time"
|
|
2439
|
+
}, a.$props), ue({ _: 2 }, [
|
|
2440
|
+
q(a.$slots, (i, l) => ({
|
|
2441
|
+
name: l,
|
|
2442
|
+
fn: H((o) => [
|
|
2443
|
+
P(a.$slots, l, se(de(o ?? {})))
|
|
2444
|
+
])
|
|
2445
|
+
}))
|
|
2446
|
+
]), 1040, ["modelValue"]));
|
|
2447
|
+
}
|
|
2448
|
+
}), bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
233
2449
|
__proto__: null,
|
|
234
|
-
WxButton:
|
|
235
|
-
WxCard:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
2450
|
+
WxButton: ba,
|
|
2451
|
+
WxCard: Ba,
|
|
2452
|
+
WxCheckbox: Be,
|
|
2453
|
+
WxCheckboxGroup: Ra,
|
|
2454
|
+
WxColorPicker: Ua,
|
|
2455
|
+
WxDatePicker: fe,
|
|
2456
|
+
WxDateRangePicker: Ea,
|
|
2457
|
+
WxDateTimePicker: Oa,
|
|
2458
|
+
WxForm: Ga,
|
|
2459
|
+
WxFormItem: Qa,
|
|
2460
|
+
WxInput: tl,
|
|
2461
|
+
WxInputNumber: sl,
|
|
2462
|
+
WxRadio: Me,
|
|
2463
|
+
WxRadioGroup: ml,
|
|
2464
|
+
WxRate: kl,
|
|
2465
|
+
WxRichText: Fl,
|
|
2466
|
+
WxSelect: Gl,
|
|
2467
|
+
WxSlider: Ql,
|
|
2468
|
+
WxSwitch: at,
|
|
2469
|
+
WxTagsInput: dt,
|
|
2470
|
+
WxTextarea: ft,
|
|
2471
|
+
WxTimePicker: mt
|
|
2472
|
+
}, Symbol.toStringTag, { value: "Module" })), Bt = {
|
|
2473
|
+
install(e, y = {}) {
|
|
2474
|
+
const { prefix: a = "Wx" } = y;
|
|
2475
|
+
for (const [t, i] of Object.entries(bt)) {
|
|
2476
|
+
if (!t.startsWith("Wx")) continue;
|
|
2477
|
+
const l = a === "Wx" ? t : `${a}${t.slice(2)}`;
|
|
2478
|
+
e.component(l, i);
|
|
244
2479
|
}
|
|
245
2480
|
}
|
|
246
2481
|
};
|
|
247
2482
|
export {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
2483
|
+
Bt as WebxUI,
|
|
2484
|
+
ba as WxButton,
|
|
2485
|
+
Ba as WxCard,
|
|
2486
|
+
Be as WxCheckbox,
|
|
2487
|
+
Ra as WxCheckboxGroup,
|
|
2488
|
+
Ua as WxColorPicker,
|
|
2489
|
+
fe as WxDatePicker,
|
|
2490
|
+
Ea as WxDateRangePicker,
|
|
2491
|
+
Oa as WxDateTimePicker,
|
|
2492
|
+
Ga as WxForm,
|
|
2493
|
+
Qa as WxFormItem,
|
|
2494
|
+
tl as WxInput,
|
|
2495
|
+
sl as WxInputNumber,
|
|
2496
|
+
Me as WxRadio,
|
|
2497
|
+
ml as WxRadioGroup,
|
|
2498
|
+
kl as WxRate,
|
|
2499
|
+
Fl as WxRichText,
|
|
2500
|
+
Gl as WxSelect,
|
|
2501
|
+
Ql as WxSlider,
|
|
2502
|
+
at as WxSwitch,
|
|
2503
|
+
dt as WxTagsInput,
|
|
2504
|
+
ft as WxTextarea,
|
|
2505
|
+
mt as WxTimePicker
|
|
252
2506
|
};
|
|
253
2507
|
//# sourceMappingURL=index.js.map
|