@das-fed/ui 6.4.0-hot.1 → 6.4.0-hot.3

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.
Files changed (113) hide show
  1. package/package.json +5 -5
  2. package/packages/business-components/app-container/index.js +255 -46
  3. package/packages/business-components/app-container/index.js.gz +0 -0
  4. package/packages/business-components/change-enterprises/index.js +298 -89
  5. package/packages/business-components/change-enterprises/index.js.gz +0 -0
  6. package/packages/business-components/device-panel/index.js +28123 -23289
  7. package/packages/business-components/device-panel/index.js.gz +0 -0
  8. package/packages/business-components/process-form/index.js +1010 -801
  9. package/packages/business-components/process-form/index.js.gz +0 -0
  10. package/packages/business-components/process-log/index.js +3669 -331
  11. package/packages/business-components/process-log/index.js.gz +0 -0
  12. package/packages/business-components/urgent-panel/index.js +2338 -1553
  13. package/packages/business-components/urgent-panel/index.js.gz +0 -0
  14. package/packages/components/alert/index.js +3418 -51
  15. package/packages/components/alert/index.js.gz +0 -0
  16. package/packages/components/autocomplete/index.js +2875 -456
  17. package/packages/components/autocomplete/index.js.gz +0 -0
  18. package/packages/components/breadcrumb/index.js +271 -47
  19. package/packages/components/breadcrumb/index.js.gz +0 -0
  20. package/packages/components/button/index.js +9800 -211
  21. package/packages/components/button/index.js.gz +0 -0
  22. package/packages/components/cascader/index.js +6406 -139
  23. package/packages/components/cascader/index.js.gz +0 -0
  24. package/packages/components/checkbox/index.js +3837 -179
  25. package/packages/components/checkbox/index.js.gz +0 -0
  26. package/packages/components/collapse-panel/index.js +3624 -30
  27. package/packages/components/collapse-panel/index.js.gz +0 -0
  28. package/packages/components/collaspe/index.js +3624 -30
  29. package/packages/components/collaspe/index.js.gz +0 -0
  30. package/packages/components/color-picker/index.js +5346 -106
  31. package/packages/components/color-picker/index.js.gz +0 -0
  32. package/packages/components/date-picker/index.js +13993 -529
  33. package/packages/components/date-picker/index.js.gz +0 -0
  34. package/packages/components/dialog/index.js +1835 -186
  35. package/packages/components/dialog/index.js.gz +0 -0
  36. package/packages/components/drawer/index.js +1614 -38
  37. package/packages/components/drawer/index.js.gz +0 -0
  38. package/packages/components/dropdown/index.js +4615 -54
  39. package/packages/components/dropdown/index.js.gz +0 -0
  40. package/packages/components/empty/index.js +800 -39
  41. package/packages/components/empty/index.js.gz +0 -0
  42. package/packages/components/image-preview/index.js +1283 -34
  43. package/packages/components/image-preview/index.js.gz +0 -0
  44. package/packages/components/image-upload/index.js +11722 -111
  45. package/packages/components/image-upload/index.js.gz +0 -0
  46. package/packages/components/image-viewer/index.js +13168 -386
  47. package/packages/components/image-viewer/index.js.gz +0 -0
  48. package/packages/components/input/index.js +1086 -157
  49. package/packages/components/input/index.js.gz +0 -0
  50. package/packages/components/input-number/index.js +1831 -145
  51. package/packages/components/input-number/index.js.gz +0 -0
  52. package/packages/components/live-player/index.js +3669 -2883
  53. package/packages/components/live-player/index.js.gz +0 -0
  54. package/packages/components/map/index.js +5214 -1190
  55. package/packages/components/map/index.js.gz +0 -0
  56. package/packages/components/menu-aside/index.js +8297 -603
  57. package/packages/components/menu-aside/index.js.gz +0 -0
  58. package/packages/components/menu-header/index.js +10077 -38
  59. package/packages/components/menu-header/index.js.gz +0 -0
  60. package/packages/components/message/index.js +1289 -53
  61. package/packages/components/message/index.js.gz +0 -0
  62. package/packages/components/notification/index.js +3269 -47
  63. package/packages/components/notification/index.js.gz +0 -0
  64. package/packages/components/pagination/index.js +8025 -148
  65. package/packages/components/pagination/index.js.gz +0 -0
  66. package/packages/components/popover/index.js +2495 -44
  67. package/packages/components/popover/index.js.gz +0 -0
  68. package/packages/components/progress/index.js +517 -107
  69. package/packages/components/progress/index.js.gz +0 -0
  70. package/packages/components/radio/index.js +3724 -159
  71. package/packages/components/radio/index.js.gz +0 -0
  72. package/packages/components/scrollbar/index.js +1442 -915
  73. package/packages/components/scrollbar/index.js.gz +0 -0
  74. package/packages/components/search/index.js +5261 -89
  75. package/packages/components/search/index.js.gz +0 -0
  76. package/packages/components/search-form/index.js +1010 -920
  77. package/packages/components/search-form/index.js.gz +0 -0
  78. package/packages/components/select/index.js +10505 -379
  79. package/packages/components/select/index.js.gz +0 -0
  80. package/packages/components/select-list/index.js +1433 -1173
  81. package/packages/components/select-list/index.js.gz +0 -0
  82. package/packages/components/special-range-picker-month/index.js +2645 -196
  83. package/packages/components/special-range-picker-month/index.js.gz +0 -0
  84. package/packages/components/special-range-picker-year/index.js +2710 -259
  85. package/packages/components/special-range-picker-year/index.js.gz +0 -0
  86. package/packages/components/spin/index.js +3534 -48
  87. package/packages/components/spin/index.js.gz +0 -0
  88. package/packages/components/step/index.js +4085 -28
  89. package/packages/components/step/index.js.gz +0 -0
  90. package/packages/components/steps/index.js +4070 -14
  91. package/packages/components/steps/index.js.gz +0 -0
  92. package/packages/components/switch/index.js +547 -31
  93. package/packages/components/switch/index.js.gz +0 -0
  94. package/packages/components/table/index.js +17503 -5201
  95. package/packages/components/table/index.js.gz +0 -0
  96. package/packages/components/tabs/index.js +12630 -172
  97. package/packages/components/tabs/index.js.gz +0 -0
  98. package/packages/components/tag/index.js +325 -55
  99. package/packages/components/tag/index.js.gz +0 -0
  100. package/packages/components/time-line/index.js +3397 -60
  101. package/packages/components/time-line/index.js.gz +0 -0
  102. package/packages/components/tooltip/index.js +2174 -65
  103. package/packages/components/tooltip/index.js.gz +0 -0
  104. package/packages/components/tree/index.js +6747 -1881
  105. package/packages/components/tree/index.js.gz +0 -0
  106. package/packages/components/tree-select/index.js +2778 -358
  107. package/packages/components/tree-select/index.js.gz +0 -0
  108. package/packages/components/upload/index.js +11726 -115
  109. package/packages/components/upload/index.js.gz +0 -0
  110. package/packages/components/virtual-tree/index.js +2928 -86
  111. package/packages/components/virtual-tree/index.js.gz +0 -0
  112. package/packages/components/watermark/index.js +368 -17
  113. package/packages/components/watermark/index.js.gz +0 -0
@@ -1,49 +1,565 @@
1
1
  import '@das-fed/ui/packages/components/switch/style.css';
2
- import { withInstall as u } from "@das-fed/utils/with-install/index";
3
- import { setThemeRule as d } from "@das-fed/web/packages/theme/index";
4
- import { defineComponent as m, computed as c, ref as f, onMounted as p, openBlock as _, createElementBlock as h, createVNode as w, unref as b, mergeProps as v } from "vue";
5
- import { ElSwitch as S } from "element-plus";
6
- import "element-plus/es/components/switch/style/css";
7
- const x = { class: "das-ui-switch" }, B = {
2
+ import { withInstall as Ee } from "@das-fed/utils/with-install/index";
3
+ import { setThemeRule as Ce } from "@das-fed/web/packages/theme/index";
4
+ import { defineComponent as B, openBlock as d, createElementBlock as S, createElementVNode as L, warn as Pe, watch as D, unref as s, getCurrentInstance as J, inject as E, ref as $, computed as v, mergeProps as ue, renderSlot as ze, onMounted as X, toRef as ke, onUnmounted as Be, normalizeClass as I, normalizeStyle as ie, withModifiers as Oe, withKeys as Te, createBlock as g, withCtx as P, resolveDynamicComponent as T, createCommentVNode as V, toDisplayString as H, createVNode as de, nextTick as De } from "vue";
5
+ import "element-plus/theme-chalk/base.css";
6
+ import "element-plus/theme-chalk/el-switch.css";
7
+ var re;
8
+ const ve = typeof window < "u";
9
+ ve && ((re = window == null ? void 0 : window.navigator) != null && re.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
10
+ /**
11
+ * @vue/shared v3.4.35
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/
15
+ process.env.NODE_ENV !== "production" && Object.freeze({});
16
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
17
+ const Ae = Object.prototype.hasOwnProperty, le = (e, t) => Ae.call(e, t), Y = (e) => typeof e == "function", k = (e) => typeof e == "string", ee = (e) => e !== null && typeof e == "object", ce = (e) => (ee(e) || Y(e)) && Y(e.then) && Y(e.catch);
18
+ function Ke(e) {
19
+ for (var t = -1, n = e == null ? 0 : e.length, o = {}; ++t < n; ) {
20
+ var i = e[t];
21
+ o[i[0]] = i[1];
22
+ }
23
+ return o;
24
+ }
25
+ const je = (e) => e === void 0, U = (e) => typeof e == "boolean", M = (e) => typeof e == "number", Fe = (e) => k(e) ? !Number.isNaN(Number(e)) : !1;
26
+ class pe extends Error {
27
+ constructor(t) {
28
+ super(t), this.name = "ElementPlusError";
29
+ }
30
+ }
31
+ function Le(e, t) {
32
+ throw new pe(`[${e}] ${t}`);
33
+ }
34
+ function A(e, t) {
35
+ if (process.env.NODE_ENV !== "production") {
36
+ const n = k(e) ? new pe(`[${e}] ${t}`) : e;
37
+ }
38
+ }
39
+ const Ue = "utils/dom/style";
40
+ function fe(e, t = "px") {
41
+ if (!e)
42
+ return "";
43
+ if (M(e) || Fe(e))
44
+ return `${e}${t}`;
45
+ if (k(e))
46
+ return e;
47
+ A(Ue, "binding value must be a string or number");
48
+ }
49
+ /*! Element Plus Icons Vue v2.3.1 */
50
+ var Me = /* @__PURE__ */ B({
51
+ name: "Loading",
52
+ __name: "loading",
53
+ setup(e) {
54
+ return (t, n) => (d(), S("svg", {
55
+ xmlns: "http://www.w3.org/2000/svg",
56
+ viewBox: "0 0 1024 1024"
57
+ }, [
58
+ L("path", {
59
+ fill: "currentColor",
60
+ d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
61
+ })
62
+ ]));
63
+ }
64
+ }), Re = Me;
65
+ const me = "__epPropKey", te = (e) => e, Je = (e) => ee(e) && !!e[me], he = (e, t) => {
66
+ if (!ee(e) || Je(e))
67
+ return e;
68
+ const { values: n, required: o, default: i, type: c, validator: h } = e, b = {
69
+ type: c,
70
+ required: !!o,
71
+ validator: n || h ? (p) => {
72
+ let w = !1, _ = [];
73
+ if (n && (_ = Array.from(n), le(e, "default") && _.push(i), w || (w = _.includes(p))), h && (w || (w = h(p))), !w && _.length > 0) {
74
+ const N = [...new Set(_)].map((K) => JSON.stringify(K)).join(", ");
75
+ Pe(`Invalid prop: validation failed${t ? ` for prop "${t}"` : ""}. Expected one of [${N}], got value ${JSON.stringify(p)}.`);
76
+ }
77
+ return w;
78
+ } : void 0,
79
+ [me]: !0
80
+ };
81
+ return le(e, "default") && (b.default = i), b;
82
+ }, ye = (e) => Ke(Object.entries(e).map(([t, n]) => [
83
+ t,
84
+ he(n, t)
85
+ ])), F = te([
86
+ String,
87
+ Object,
88
+ Function
89
+ ]), be = (e, t) => (e.install = (n) => {
90
+ for (const o of [e, ...Object.values({})])
91
+ n.component(o.name, o);
92
+ }, e), W = "update:modelValue", Z = "change", G = "input", we = ["", "default", "small", "large"], qe = (e) => ["", ...we].includes(e), He = ({ from: e, replacement: t, scope: n, version: o, ref: i, type: c = "API" }, h) => {
93
+ D(() => s(h), (l) => {
94
+ l && A(n, `[${c}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.
95
+ For more detail, please visit: ${i}
96
+ `);
97
+ }, {
98
+ immediate: !0
99
+ });
100
+ }, x = "el", Ye = "is-", C = (e, t, n, o, i) => {
101
+ let c = `${e}-${t}`;
102
+ return n && (c += `-${n}`), o && (c += `__${o}`), i && (c += `--${i}`), c;
103
+ }, xe = Symbol("namespaceContextKey"), ge = (e) => {
104
+ const t = J() ? E(xe, $(x)) : $(x);
105
+ return v(() => s(t) || x);
106
+ }, _e = (e, t) => {
107
+ const n = ge();
108
+ return {
109
+ namespace: n,
110
+ b: (r = "") => C(n.value, e, r, "", ""),
111
+ e: (r) => r ? C(n.value, e, "", r, "") : "",
112
+ m: (r) => r ? C(n.value, e, "", "", r) : "",
113
+ be: (r, u) => r && u ? C(n.value, e, r, u, "") : "",
114
+ em: (r, u) => r && u ? C(n.value, e, "", r, u) : "",
115
+ bm: (r, u) => r && u ? C(n.value, e, r, "", u) : "",
116
+ bem: (r, u, y) => r && u && y ? C(n.value, e, r, u, y) : "",
117
+ is: (r, ...u) => {
118
+ const y = u.length >= 1 ? u[0] : !0;
119
+ return r && y ? `${Ye}${r}` : "";
120
+ },
121
+ cssVar: (r) => {
122
+ const u = {};
123
+ for (const y in r)
124
+ r[y] && (u[`--${n.value}-${y}`] = r[y]);
125
+ return u;
126
+ },
127
+ cssVarName: (r) => `--${n.value}-${r}`,
128
+ cssVarBlock: (r) => {
129
+ const u = {};
130
+ for (const y in r)
131
+ r[y] && (u[`--${n.value}-${e}-${y}`] = r[y]);
132
+ return u;
133
+ },
134
+ cssVarBlockName: (r) => `--${n.value}-${e}-${r}`
135
+ };
136
+ }, Ie = (e) => {
137
+ const t = J();
138
+ return v(() => {
139
+ var n, o;
140
+ return (o = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$props) == null ? void 0 : o[e];
141
+ });
142
+ }, Q = {
143
+ prefix: Math.floor(Math.random() * 1e4),
144
+ current: 0
145
+ }, We = Symbol("elIdInjection"), Ze = () => J() ? E(We, Q) : Q, Ge = (e) => {
146
+ const t = Ze();
147
+ !ve && t === Q && A("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
148
+ usage: app.provide(ID_INJECTION_KEY, {
149
+ prefix: number,
150
+ current: number,
151
+ })`);
152
+ const n = ge();
153
+ return v(() => s(e) || `${n.value}-id-${t.prefix}-${t.current++}`);
154
+ };
155
+ he({
156
+ type: String,
157
+ values: we,
158
+ required: !1
159
+ });
160
+ const Qe = Symbol("size"), Xe = () => {
161
+ const e = E(Qe, {});
162
+ return v(() => s(e.size) || "");
163
+ };
164
+ var Se = (e, t) => {
165
+ const n = e.__vccOpts || e;
166
+ for (const [o, i] of t)
167
+ n[o] = i;
168
+ return n;
169
+ };
170
+ const et = ye({
171
+ size: {
172
+ type: te([Number, String])
173
+ },
174
+ color: {
175
+ type: String
176
+ }
177
+ }), tt = B({
178
+ name: "ElIcon",
179
+ inheritAttrs: !1
180
+ }), nt = /* @__PURE__ */ B({
181
+ ...tt,
182
+ props: et,
183
+ setup(e) {
184
+ const t = e, n = _e("icon"), o = v(() => {
185
+ const { size: i, color: c } = t;
186
+ return !i && !c ? {} : {
187
+ fontSize: je(i) ? void 0 : fe(i),
188
+ "--color": c
189
+ };
190
+ });
191
+ return (i, c) => (d(), S("i", ue({
192
+ class: s(n).b(),
193
+ style: s(o)
194
+ }, i.$attrs), [
195
+ ze(i.$slots, "default")
196
+ ], 16));
197
+ }
198
+ });
199
+ var ot = /* @__PURE__ */ Se(nt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
200
+ const z = be(ot), ne = Symbol("formContextKey"), $e = Symbol("formItemContextKey"), at = (e, t = {}) => {
201
+ const n = $(void 0), o = t.prop ? n : Ie("size"), i = t.global ? n : Xe(), c = t.form ? { size: void 0 } : E(ne, void 0), h = t.formItem ? { size: void 0 } : E($e, void 0);
202
+ return v(() => o.value || s(e) || (h == null ? void 0 : h.size) || (c == null ? void 0 : c.size) || i.value || "");
203
+ }, st = (e) => {
204
+ const t = Ie("disabled"), n = E(ne, void 0);
205
+ return v(() => t.value || s(e) || (n == null ? void 0 : n.disabled) || !1);
206
+ }, it = () => {
207
+ const e = E(ne, void 0), t = E($e, void 0);
208
+ return {
209
+ form: e,
210
+ formItem: t
211
+ };
212
+ }, rt = (e, {
213
+ formItemContext: t,
214
+ disableIdGeneration: n,
215
+ disableIdManagement: o
216
+ }) => {
217
+ n || (n = $(!1)), o || (o = $(!1));
218
+ const i = $();
219
+ let c;
220
+ const h = v(() => {
221
+ var l;
222
+ return !!(!e.label && t && t.inputIds && ((l = t.inputIds) == null ? void 0 : l.length) <= 1);
223
+ });
224
+ return X(() => {
225
+ c = D([ke(e, "id"), n], ([l, b]) => {
226
+ const p = l ?? (b ? void 0 : Ge().value);
227
+ p !== i.value && (t != null && t.removeInputId && (i.value && t.removeInputId(i.value), !(o != null && o.value) && !b && p && t.addInputId(p)), i.value = p);
228
+ }, { immediate: !0 });
229
+ }), Be(() => {
230
+ c && c(), t != null && t.removeInputId && i.value && t.removeInputId(i.value);
231
+ }), {
232
+ isLabeledByFormItem: h,
233
+ inputId: i
234
+ };
235
+ }, lt = ye({
236
+ modelValue: {
237
+ type: [Boolean, String, Number],
238
+ default: !1
239
+ },
240
+ disabled: {
241
+ type: Boolean,
242
+ default: !1
243
+ },
244
+ loading: {
245
+ type: Boolean,
246
+ default: !1
247
+ },
248
+ size: {
249
+ type: String,
250
+ validator: qe
251
+ },
252
+ width: {
253
+ type: [String, Number],
254
+ default: ""
255
+ },
256
+ inlinePrompt: {
257
+ type: Boolean,
258
+ default: !1
259
+ },
260
+ inactiveActionIcon: {
261
+ type: F
262
+ },
263
+ activeActionIcon: {
264
+ type: F
265
+ },
266
+ activeIcon: {
267
+ type: F
268
+ },
269
+ inactiveIcon: {
270
+ type: F
271
+ },
272
+ activeText: {
273
+ type: String,
274
+ default: ""
275
+ },
276
+ inactiveText: {
277
+ type: String,
278
+ default: ""
279
+ },
280
+ activeValue: {
281
+ type: [Boolean, String, Number],
282
+ default: !0
283
+ },
284
+ inactiveValue: {
285
+ type: [Boolean, String, Number],
286
+ default: !1
287
+ },
288
+ activeColor: {
289
+ type: String,
290
+ default: ""
291
+ },
292
+ inactiveColor: {
293
+ type: String,
294
+ default: ""
295
+ },
296
+ borderColor: {
297
+ type: String,
298
+ default: ""
299
+ },
300
+ name: {
301
+ type: String,
302
+ default: ""
303
+ },
304
+ validateEvent: {
305
+ type: Boolean,
306
+ default: !0
307
+ },
308
+ beforeChange: {
309
+ type: te(Function)
310
+ },
311
+ id: String,
312
+ tabindex: {
313
+ type: [String, Number]
314
+ },
315
+ value: {
316
+ type: [Boolean, String, Number],
317
+ default: !1
318
+ },
319
+ label: {
320
+ type: String,
321
+ default: void 0
322
+ }
323
+ }), ct = {
324
+ [W]: (e) => U(e) || k(e) || M(e),
325
+ [Z]: (e) => U(e) || k(e) || M(e),
326
+ [G]: (e) => U(e) || k(e) || M(e)
327
+ }, ut = ["onClick"], dt = ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"], vt = ["aria-hidden"], pt = ["aria-hidden"], ft = ["aria-hidden"], R = "ElSwitch", mt = B({
328
+ name: R
329
+ }), ht = /* @__PURE__ */ B({
330
+ ...mt,
331
+ props: lt,
332
+ emits: ct,
333
+ setup(e, { expose: t, emit: n }) {
334
+ const o = e, i = J(), { formItem: c } = it(), h = at(), l = _e("switch");
335
+ ((a) => {
336
+ a.forEach((m) => {
337
+ He({
338
+ from: m[0],
339
+ replacement: m[1],
340
+ scope: R,
341
+ version: "2.3.0",
342
+ ref: "https://element-plus.org/en-US/component/switch.html#attributes",
343
+ type: "Attribute"
344
+ }, v(() => {
345
+ var O;
346
+ return !!((O = i.vnode.props) != null && O[m[2]]);
347
+ }));
348
+ });
349
+ })([
350
+ ['"value"', '"model-value" or "v-model"', "value"],
351
+ ['"active-color"', "CSS var `--el-switch-on-color`", "activeColor"],
352
+ ['"inactive-color"', "CSS var `--el-switch-off-color`", "inactiveColor"],
353
+ ['"border-color"', "CSS var `--el-switch-border-color`", "borderColor"]
354
+ ]);
355
+ const { inputId: p } = rt(o, {
356
+ formItemContext: c
357
+ }), w = st(v(() => o.loading)), _ = $(o.modelValue !== !1), N = $(), K = $(), oe = v(() => [
358
+ l.b(),
359
+ l.m(h.value),
360
+ l.is("disabled", w.value),
361
+ l.is("checked", f.value)
362
+ ]), r = v(() => [
363
+ l.e("label"),
364
+ l.em("label", "left"),
365
+ l.is("active", !f.value)
366
+ ]), u = v(() => [
367
+ l.e("label"),
368
+ l.em("label", "right"),
369
+ l.is("active", f.value)
370
+ ]), y = v(() => ({
371
+ width: fe(o.width)
372
+ }));
373
+ D(() => o.modelValue, () => {
374
+ _.value = !0;
375
+ }), D(() => o.value, () => {
376
+ _.value = !1;
377
+ });
378
+ const ae = v(() => _.value ? o.modelValue : o.value), f = v(() => ae.value === o.activeValue);
379
+ [o.activeValue, o.inactiveValue].includes(ae.value) || (n(W, o.inactiveValue), n(Z, o.inactiveValue), n(G, o.inactiveValue)), D(f, (a) => {
380
+ var m;
381
+ N.value.checked = a, o.validateEvent && ((m = c == null ? void 0 : c.validate) == null || m.call(c, "change").catch((O) => A(O)));
382
+ });
383
+ const j = () => {
384
+ const a = f.value ? o.inactiveValue : o.activeValue;
385
+ n(W, a), n(Z, a), n(G, a), De(() => {
386
+ N.value.checked = f.value;
387
+ });
388
+ }, se = () => {
389
+ if (w.value)
390
+ return;
391
+ const { beforeChange: a } = o;
392
+ if (!a) {
393
+ j();
394
+ return;
395
+ }
396
+ const m = a();
397
+ [
398
+ ce(m),
399
+ U(m)
400
+ ].includes(!0) || Le(R, "beforeChange must return type `Promise<boolean>` or `boolean`"), ce(m) ? m.then((q) => {
401
+ q && j();
402
+ }).catch((q) => {
403
+ A(R, `some error occurred: ${q}`);
404
+ }) : m && j();
405
+ }, Ve = v(() => l.cssVarBlock({
406
+ ...o.activeColor ? { "on-color": o.activeColor } : null,
407
+ ...o.inactiveColor ? { "off-color": o.inactiveColor } : null,
408
+ ...o.borderColor ? { "border-color": o.borderColor } : null
409
+ })), Ne = () => {
410
+ var a, m;
411
+ (m = (a = N.value) == null ? void 0 : a.focus) == null || m.call(a);
412
+ };
413
+ return X(() => {
414
+ N.value.checked = f.value;
415
+ }), t({
416
+ focus: Ne,
417
+ checked: f
418
+ }), (a, m) => (d(), S("div", {
419
+ class: I(s(oe)),
420
+ style: ie(s(Ve)),
421
+ onClick: Oe(se, ["prevent"])
422
+ }, [
423
+ L("input", {
424
+ id: s(p),
425
+ ref_key: "input",
426
+ ref: N,
427
+ class: I(s(l).e("input")),
428
+ type: "checkbox",
429
+ role: "switch",
430
+ "aria-checked": s(f),
431
+ "aria-disabled": s(w),
432
+ "aria-label": a.label,
433
+ name: a.name,
434
+ "true-value": a.activeValue,
435
+ "false-value": a.inactiveValue,
436
+ disabled: s(w),
437
+ tabindex: a.tabindex,
438
+ onChange: j,
439
+ onKeydown: Te(se, ["enter"])
440
+ }, null, 42, dt),
441
+ !a.inlinePrompt && (a.inactiveIcon || a.inactiveText) ? (d(), S("span", {
442
+ key: 0,
443
+ class: I(s(r))
444
+ }, [
445
+ a.inactiveIcon ? (d(), g(s(z), { key: 0 }, {
446
+ default: P(() => [
447
+ (d(), g(T(a.inactiveIcon)))
448
+ ]),
449
+ _: 1
450
+ })) : V("v-if", !0),
451
+ !a.inactiveIcon && a.inactiveText ? (d(), S("span", {
452
+ key: 1,
453
+ "aria-hidden": s(f)
454
+ }, H(a.inactiveText), 9, vt)) : V("v-if", !0)
455
+ ], 2)) : V("v-if", !0),
456
+ L("span", {
457
+ ref_key: "core",
458
+ ref: K,
459
+ class: I(s(l).e("core")),
460
+ style: ie(s(y))
461
+ }, [
462
+ a.inlinePrompt ? (d(), S("div", {
463
+ key: 0,
464
+ class: I(s(l).e("inner"))
465
+ }, [
466
+ a.activeIcon || a.inactiveIcon ? (d(), g(s(z), {
467
+ key: 0,
468
+ class: I(s(l).is("icon"))
469
+ }, {
470
+ default: P(() => [
471
+ (d(), g(T(s(f) ? a.activeIcon : a.inactiveIcon)))
472
+ ]),
473
+ _: 1
474
+ }, 8, ["class"])) : a.activeText || a.inactiveText ? (d(), S("span", {
475
+ key: 1,
476
+ class: I(s(l).is("text")),
477
+ "aria-hidden": !s(f)
478
+ }, H(s(f) ? a.activeText : a.inactiveText), 11, pt)) : V("v-if", !0)
479
+ ], 2)) : V("v-if", !0),
480
+ L("div", {
481
+ class: I(s(l).e("action"))
482
+ }, [
483
+ a.loading ? (d(), g(s(z), {
484
+ key: 0,
485
+ class: I(s(l).is("loading"))
486
+ }, {
487
+ default: P(() => [
488
+ de(s(Re))
489
+ ]),
490
+ _: 1
491
+ }, 8, ["class"])) : a.activeActionIcon && s(f) ? (d(), g(s(z), { key: 1 }, {
492
+ default: P(() => [
493
+ (d(), g(T(a.activeActionIcon)))
494
+ ]),
495
+ _: 1
496
+ })) : a.inactiveActionIcon && !s(f) ? (d(), g(s(z), { key: 2 }, {
497
+ default: P(() => [
498
+ (d(), g(T(a.inactiveActionIcon)))
499
+ ]),
500
+ _: 1
501
+ })) : V("v-if", !0)
502
+ ], 2)
503
+ ], 6),
504
+ !a.inlinePrompt && (a.activeIcon || a.activeText) ? (d(), S("span", {
505
+ key: 1,
506
+ class: I(s(u))
507
+ }, [
508
+ a.activeIcon ? (d(), g(s(z), { key: 0 }, {
509
+ default: P(() => [
510
+ (d(), g(T(a.activeIcon)))
511
+ ]),
512
+ _: 1
513
+ })) : V("v-if", !0),
514
+ !a.activeIcon && a.activeText ? (d(), S("span", {
515
+ key: 1,
516
+ "aria-hidden": !s(f)
517
+ }, H(a.activeText), 9, ft)) : V("v-if", !0)
518
+ ], 2)) : V("v-if", !0)
519
+ ], 14, ut));
520
+ }
521
+ });
522
+ var yt = /* @__PURE__ */ Se(ht, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);
523
+ const bt = be(yt), wt = { class: "das-ui-switch" }, gt = {
8
524
  inheritAttrs: !1
9
- }, V = /* @__PURE__ */ m({
10
- ...B,
525
+ }, _t = /* @__PURE__ */ B({
526
+ ...gt,
11
527
  __name: "Index",
12
528
  props: {
13
529
  modelValue: { type: [Boolean, String, Number], default: !0 },
14
530
  size: { default: "small" }
15
531
  },
16
- setup(o, { expose: i }) {
17
- const e = o, s = c(() => e.modelValue), n = c(() => e.size ? e.size : "small"), a = f(null);
18
- return p(() => {
19
- var t, r;
20
- const l = (r = (t = a.value) == null ? void 0 : t.$el) == null ? void 0 : r.querySelector(".el-switch__input");
532
+ setup(e, { expose: t }) {
533
+ const n = e, o = v(() => n.modelValue), i = v(() => n.size ? n.size : "small"), c = $(null);
534
+ return X(() => {
535
+ var b, p;
536
+ const l = (p = (b = c.value) == null ? void 0 : b.$el) == null ? void 0 : p.querySelector(".el-switch__input");
21
537
  l && l.setAttribute("tabindex", "-1");
22
- }), i({
23
- $refSwitch: a
24
- }), (l, t) => (_(), h("div", x, [
25
- w(b(S), v({
538
+ }), t({
539
+ $refSwitch: c
540
+ }), (l, b) => (d(), S("div", wt, [
541
+ de(s(bt), ue({
26
542
  ref_key: "$refSwitch",
27
- ref: a,
28
- modelValue: s.value,
29
- "onUpdate:modelValue": t[0] || (t[0] = (r) => s.value = r)
30
- }, l.$attrs, { size: n.value }), null, 16, ["modelValue", "size"])
543
+ ref: c,
544
+ modelValue: o.value,
545
+ "onUpdate:modelValue": b[0] || (b[0] = (p) => o.value = p)
546
+ }, l.$attrs, { size: i.value }), null, 16, ["modelValue", "size"])
31
547
  ]));
32
548
  }
33
- }), z = (o, i) => {
34
- const e = o.__vccOpts || o;
35
- for (const [s, n] of i)
36
- e[s] = n;
37
- return e;
38
- }, D = /* @__PURE__ */ z(V, [["__scopeId", "data-v-247b1241"]]), I = {
549
+ }), It = (e, t) => {
550
+ const n = e.__vccOpts || e;
551
+ for (const [o, i] of t)
552
+ n[o] = i;
553
+ return n;
554
+ }, St = /* @__PURE__ */ It(_t, [["__scopeId", "data-v-247b1241"]]), $t = {
39
555
  "--das-ui-switch-on-color": "#5582F3",
40
556
  "--das-ui-switch-off-color": "#B2B2B2",
41
557
  "--das-ui-switch-on-color-disabled": "#B5CAFF",
42
558
  "--das-ui-switch-off-color-disabled": "#D9D9D9"
43
559
  };
44
- d(I);
45
- const T = u(D);
560
+ Ce($t);
561
+ const zt = Ee(St);
46
562
  export {
47
- T as DasSwitch,
48
- T as default
563
+ zt as DasSwitch,
564
+ zt as default
49
565
  };