@das-fed/ui 6.4.0-hot.5 → 6.4.0-hot.7

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 (149) hide show
  1. package/esm-map.json +5 -5
  2. package/package.json +8 -8
  3. package/packages/business-components/app-container/index.js +46 -255
  4. package/packages/business-components/app-container/index.js.gz +0 -0
  5. package/packages/business-components/change-enterprises/index.js +89 -298
  6. package/packages/business-components/change-enterprises/index.js.gz +0 -0
  7. package/packages/business-components/device-panel/index.js +45113 -56024
  8. package/packages/business-components/device-panel/index.js.gz +0 -0
  9. package/packages/business-components/device-panel/style.css +1 -1
  10. package/packages/business-components/device-panel/style.css.gz +0 -0
  11. package/packages/business-components/layout-breadcrumb/index.js +37 -37
  12. package/packages/business-components/layout-breadcrumb/index.js.gz +0 -0
  13. package/packages/business-components/process-form/index.js +801 -1010
  14. package/packages/business-components/process-form/index.js.gz +0 -0
  15. package/packages/business-components/process-log/index.js +331 -3669
  16. package/packages/business-components/process-log/index.js.gz +0 -0
  17. package/packages/business-components/process-search-form/index.js +416 -404
  18. package/packages/business-components/process-search-form/index.js.gz +0 -0
  19. package/packages/business-components/process-table/hooks/useProcessTable.d.ts +2 -74
  20. package/packages/business-components/process-table/hooks/useValueFormatter.d.ts +6 -0
  21. package/packages/business-components/process-table/index.js +616 -788
  22. package/packages/business-components/process-table/index.js.gz +0 -0
  23. package/packages/business-components/process-table/src/type.d.ts +42 -0
  24. package/packages/business-components/process-table/style.css +1 -1
  25. package/packages/business-components/process-table/util/encryption/index.d.ts +7 -0
  26. package/packages/business-components/urgent-panel/index.js +1590 -2470
  27. package/packages/business-components/urgent-panel/index.js.gz +0 -0
  28. package/packages/business-components/user-org-dialog/index.js +289 -273
  29. package/packages/business-components/user-org-dialog/index.js.gz +0 -0
  30. package/packages/business-components/user-org-dialog/style.css +1 -1
  31. package/packages/business-components/user-org-dialog/style.css.gz +0 -0
  32. package/packages/business-components/video-dialog/index.js +88 -88
  33. package/packages/business-components/video-dialog/index.js.gz +0 -0
  34. package/packages/components/alert/index.js +51 -3418
  35. package/packages/components/alert/index.js.gz +0 -0
  36. package/packages/components/autocomplete/index.js +456 -2875
  37. package/packages/components/autocomplete/index.js.gz +0 -0
  38. package/packages/components/breadcrumb/index.js +47 -271
  39. package/packages/components/breadcrumb/index.js.gz +0 -0
  40. package/packages/components/button/index.js +212 -9801
  41. package/packages/components/button/index.js.gz +0 -0
  42. package/packages/components/cascader/index.js +139 -6406
  43. package/packages/components/cascader/index.js.gz +0 -0
  44. package/packages/components/checkbox/index.js +179 -3837
  45. package/packages/components/checkbox/index.js.gz +0 -0
  46. package/packages/components/collapse-panel/index.js +30 -3624
  47. package/packages/components/collapse-panel/index.js.gz +0 -0
  48. package/packages/components/collaspe/index.js +30 -3624
  49. package/packages/components/collaspe/index.js.gz +0 -0
  50. package/packages/components/color-picker/index.js +106 -5346
  51. package/packages/components/color-picker/index.js.gz +0 -0
  52. package/packages/components/date-picker/index.js +529 -13993
  53. package/packages/components/date-picker/index.js.gz +0 -0
  54. package/packages/components/dialog/index.js +186 -1835
  55. package/packages/components/dialog/index.js.gz +0 -0
  56. package/packages/components/drawer/index.js +38 -1614
  57. package/packages/components/drawer/index.js.gz +0 -0
  58. package/packages/components/dropdown/index.js +54 -4615
  59. package/packages/components/dropdown/index.js.gz +0 -0
  60. package/packages/components/edit-table/index.js +411 -408
  61. package/packages/components/edit-table/index.js.gz +0 -0
  62. package/packages/components/edit-table/src/type.d.ts +2 -6
  63. package/packages/components/empty/index.js +39 -800
  64. package/packages/components/empty/index.js.gz +0 -0
  65. package/packages/components/image-preview/index.js +34 -1283
  66. package/packages/components/image-preview/index.js.gz +0 -0
  67. package/packages/components/image-upload/index.js +111 -11722
  68. package/packages/components/image-upload/index.js.gz +0 -0
  69. package/packages/components/image-viewer/index.js +386 -13168
  70. package/packages/components/image-viewer/index.js.gz +0 -0
  71. package/packages/components/input/index.js +157 -1086
  72. package/packages/components/input/index.js.gz +0 -0
  73. package/packages/components/input-number/index.js +145 -1831
  74. package/packages/components/input-number/index.js.gz +0 -0
  75. package/packages/components/live-player/index.js +2883 -3669
  76. package/packages/components/live-player/index.js.gz +0 -0
  77. package/packages/components/map/index.js +1189 -5213
  78. package/packages/components/map/index.js.gz +0 -0
  79. package/packages/components/menu-aside/index.js +603 -8297
  80. package/packages/components/menu-aside/index.js.gz +0 -0
  81. package/packages/components/menu-header/index.js +38 -10077
  82. package/packages/components/menu-header/index.js.gz +0 -0
  83. package/packages/components/message/index.js +53 -1289
  84. package/packages/components/message/index.js.gz +0 -0
  85. package/packages/components/notification/index.js +47 -3269
  86. package/packages/components/notification/index.js.gz +0 -0
  87. package/packages/components/notification/style.css +1 -1
  88. package/packages/components/notification/style.css.gz +0 -0
  89. package/packages/components/pagination/index.js +153 -8030
  90. package/packages/components/pagination/index.js.gz +0 -0
  91. package/packages/components/popover/index.js +44 -2495
  92. package/packages/components/popover/index.js.gz +0 -0
  93. package/packages/components/progress/index.js +107 -517
  94. package/packages/components/progress/index.js.gz +0 -0
  95. package/packages/components/radio/index.js +159 -3724
  96. package/packages/components/radio/index.js.gz +0 -0
  97. package/packages/components/scrollbar/index.js +915 -1442
  98. package/packages/components/scrollbar/index.js.gz +0 -0
  99. package/packages/components/search/index.js +89 -5261
  100. package/packages/components/search/index.js.gz +0 -0
  101. package/packages/components/search-form/index.js +930 -1008
  102. package/packages/components/search-form/index.js.gz +0 -0
  103. package/packages/components/search-form/style.css +1 -1
  104. package/packages/components/search-form/style.css.gz +0 -0
  105. package/packages/components/select/index.js +379 -10505
  106. package/packages/components/select/index.js.gz +0 -0
  107. package/packages/components/select-list/index.js +1173 -1433
  108. package/packages/components/select-list/index.js.gz +0 -0
  109. package/packages/components/special-range-picker-month/index.js +196 -2645
  110. package/packages/components/special-range-picker-month/index.js.gz +0 -0
  111. package/packages/components/special-range-picker-year/index.js +259 -2710
  112. package/packages/components/special-range-picker-year/index.js.gz +0 -0
  113. package/packages/components/spin/index.js +48 -3534
  114. package/packages/components/spin/index.js.gz +0 -0
  115. package/packages/components/step/index.js +28 -4085
  116. package/packages/components/step/index.js.gz +0 -0
  117. package/packages/components/steps/index.js +14 -4070
  118. package/packages/components/switch/index.js +31 -547
  119. package/packages/components/switch/index.js.gz +0 -0
  120. package/packages/components/table/index.d.ts +2 -14
  121. package/packages/components/table/index.js +6286 -18588
  122. package/packages/components/table/index.js.gz +0 -0
  123. package/packages/components/table/src/table-column/index.vue.d.ts +0 -3
  124. package/packages/components/table/src/type.d.ts +1 -1
  125. package/packages/components/table/style.css +1 -1
  126. package/packages/components/table/style.css.gz +0 -0
  127. package/packages/components/tabs/index.js +172 -12630
  128. package/packages/components/tabs/index.js.gz +0 -0
  129. package/packages/components/tag/index.js +55 -325
  130. package/packages/components/tag/index.js.gz +0 -0
  131. package/packages/components/time-line/index.js +60 -3397
  132. package/packages/components/time-line/index.js.gz +0 -0
  133. package/packages/components/tooltip/index.js +65 -2174
  134. package/packages/components/tooltip/index.js.gz +0 -0
  135. package/packages/components/tree/index.js +1881 -6751
  136. package/packages/components/tree/index.js.gz +0 -0
  137. package/packages/components/tree/src/App.vue.d.ts +24 -19
  138. package/packages/components/tree/src/hooks/use-tree.d.ts +0 -1
  139. package/packages/components/tree-select/index.js +358 -2778
  140. package/packages/components/tree-select/index.js.gz +0 -0
  141. package/packages/components/upload/index.js +115 -11726
  142. package/packages/components/upload/index.js.gz +0 -0
  143. package/packages/components/virtual-tree/index.js +86 -2928
  144. package/packages/components/virtual-tree/index.js.gz +0 -0
  145. package/packages/components/watermark/index.js +17 -368
  146. package/packages/global/theme/index.js +8 -1802
  147. package/packages/global/theme/index.js.gz +0 -0
  148. package/packages/components/steps/index.js.gz +0 -0
  149. package/packages/components/watermark/index.js.gz +0 -0
@@ -1,565 +1,49 @@
1
1
  import '@das-fed/ui/packages/components/switch/style.css';
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 = {
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 = {
524
8
  inheritAttrs: !1
525
- }, _t = /* @__PURE__ */ B({
526
- ...gt,
9
+ }, V = /* @__PURE__ */ m({
10
+ ...B,
527
11
  __name: "Index",
528
12
  props: {
529
13
  modelValue: { type: [Boolean, String, Number], default: !0 },
530
14
  size: { default: "small" }
531
15
  },
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");
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");
537
21
  l && l.setAttribute("tabindex", "-1");
538
- }), t({
539
- $refSwitch: c
540
- }), (l, b) => (d(), S("div", wt, [
541
- de(s(bt), ue({
22
+ }), i({
23
+ $refSwitch: a
24
+ }), (l, t) => (_(), h("div", x, [
25
+ w(b(S), v({
542
26
  ref_key: "$refSwitch",
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"])
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"])
547
31
  ]));
548
32
  }
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 = {
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 = {
555
39
  "--das-ui-switch-on-color": "#5582F3",
556
40
  "--das-ui-switch-off-color": "#B2B2B2",
557
41
  "--das-ui-switch-on-color-disabled": "#B5CAFF",
558
42
  "--das-ui-switch-off-color-disabled": "#D9D9D9"
559
43
  };
560
- Ce($t);
561
- const zt = Ee(St);
44
+ d(I);
45
+ const T = u(D);
562
46
  export {
563
- zt as DasSwitch,
564
- zt as default
47
+ T as DasSwitch,
48
+ T as default
565
49
  };