@wfrog/vc-ui 1.9.1 → 1.9.2
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/dist/es/chunk/{Cb0n0U19.mjs → 78BvQgmt.mjs} +8 -8
- package/dist/es/chunk/{DCS0eqqM.mjs → B-xUksL-.mjs} +1 -1
- package/dist/es/chunk/{B7FqhrtI.mjs → BA_oVIng.mjs} +8 -8
- package/dist/es/chunk/{D1Ki7NcP.mjs → BH1e_-Fa.mjs} +6 -6
- package/dist/es/chunk/{CPW-P7zz.mjs → BPQ3KP1S.mjs} +17 -17
- package/dist/es/chunk/{3jDcB2xo.mjs → BQk-dhWy.mjs} +9 -9
- package/dist/es/chunk/{e5i7OJY-.mjs → BZoKD2RY.mjs} +1 -1
- package/dist/es/chunk/{CROtrCmM.mjs → Bc6yUGLs.mjs} +1 -1
- package/dist/es/chunk/{BBXZ8dk4.mjs → Bj4UMVBI.mjs} +4 -4
- package/dist/es/chunk/{DrC4SmEj.mjs → BjVI1XMz.mjs} +2 -2
- package/dist/es/chunk/{DYhJTpil.mjs → C-7W07Z_.mjs} +9 -9
- package/dist/es/chunk/{CsjEhAYY.mjs → C0XgBrDz.mjs} +3 -3
- package/dist/es/chunk/{Cmb_E8Ip.mjs → C5I6QvTa.mjs} +2 -2
- package/dist/es/chunk/{BvNFaD5d.mjs → CBMjhoFP.mjs} +2 -2
- package/dist/es/chunk/{CFYABm3t.mjs → CGC9zZcN.mjs} +9 -9
- package/dist/es/chunk/{tJuysXfp.mjs → CJK5_jsA.mjs} +3 -3
- package/dist/es/chunk/CNHQauEr.mjs +215 -0
- package/dist/es/chunk/{CK5Bluh4.mjs → COvAourt.mjs} +1 -1
- package/dist/es/chunk/{DutTJaGc.mjs → CVqW0jzp.mjs} +2 -2
- package/dist/es/chunk/{C2kaTl08.mjs → CccIsEqA.mjs} +3 -3
- package/dist/es/chunk/{Dh_zpmSz.mjs → CqhShW5K.mjs} +5 -5
- package/dist/es/chunk/{yuIXvUxc.mjs → CvYIOfT1.mjs} +1 -1
- package/dist/es/chunk/{DDR6UjaC.mjs → CxHJBf4l.mjs} +1 -1
- package/dist/es/chunk/{DNsAO9iB.mjs → CzdaOBtA.mjs} +2 -2
- package/dist/es/chunk/{CaA5lDme.mjs → D-1mFPUH.mjs} +3 -3
- package/dist/es/chunk/{C6xZotC7.mjs → D0QTifnI.mjs} +3 -3
- package/dist/es/chunk/{BqMf3xBl.mjs → DBf73TLo.mjs} +9 -9
- package/dist/es/chunk/{CdG7Eqv2.mjs → DFOYvCRL.mjs} +9 -9
- package/dist/es/chunk/{BZ1uhZQF.mjs → DRwwUUhy.mjs} +1 -1
- package/dist/es/chunk/{Cjp0Czyu.mjs → D_bou1py.mjs} +1 -1
- package/dist/es/chunk/{CSZw6Ko2.mjs → Db0Pk78M.mjs} +7 -7
- package/dist/es/chunk/{D5u7KBz_.mjs → DbhQlaOz.mjs} +5 -5
- package/dist/es/chunk/{BzqDqZOf.mjs → DdY32YAP.mjs} +5 -5
- package/dist/es/chunk/{RgWmId3R.mjs → Dgu95mOy.mjs} +5 -5
- package/dist/es/chunk/{BPqrpkTb.mjs → DkT4qqGt.mjs} +1 -1
- package/dist/es/chunk/{39c07jh1.mjs → Do7HIVy5.mjs} +9 -9
- package/dist/es/chunk/{UUVoNfr4.mjs → DodoD9a9.mjs} +2 -2
- package/dist/es/chunk/{By7FMB3I.mjs → Gk1J52Yw.mjs} +1 -1
- package/dist/es/chunk/{BAqSLB3Y.mjs → KyEEoljI.mjs} +4 -4
- package/dist/es/chunk/{B_RyUSJF.mjs → QtiOxqKv.mjs} +20 -20
- package/dist/es/chunk/{dN0VcQc2.mjs → V6KjsUQN.mjs} +1 -1
- package/dist/es/chunk/{BQVjODp4.mjs → eEsLFV3s.mjs} +2 -2
- package/dist/es/chunk/{BL-J8gO7.mjs → eqwEsspo.mjs} +8 -8
- package/dist/es/chunk/{B11niAKN.mjs → jjYAptTv.mjs} +5 -5
- package/dist/es/chunk/{Co77DVCw.mjs → nxVM7re4.mjs} +1 -1
- package/dist/es/chunk/{C-HMX6-e.mjs → o2Q7kb8Y.mjs} +13 -13
- package/dist/es/chunk/{CPCieLBG.mjs → vPhxogl3.mjs} +1 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.mjs +16 -224
- package/dist/es/components/button/index.css +1 -1
- package/dist/es/components/choice/choice.mjs +3 -3
- package/dist/es/components/color-switcher/color-switcher.mjs +8 -8
- package/dist/es/components/cropper/cropper.mjs +9 -9
- package/dist/es/components/currency/currency.mjs +4 -4
- package/dist/es/components/daterange-picker/daterange-picker.mjs +18 -18
- package/dist/es/components/dialog/dialog.mjs +8 -8
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +9 -9
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +3 -3
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +8 -8
- package/dist/es/components/drag-verify/drag-verify.mjs +2 -2
- package/dist/es/components/drawer/drawer.mjs +9 -9
- package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
- package/dist/es/components/explorer/docs/data.d.ts +2 -0
- package/dist/es/components/explorer/explorer.mjs +2 -2
- package/dist/es/components/explorer-column-table/explorer-column-table.mjs +5 -5
- package/dist/es/components/explorer-container/explorer-container.mjs +2 -2
- package/dist/es/components/explorer-filter/explorer-filter.mjs +3 -3
- package/dist/es/components/explorer-footer/explorer-footer.mjs +6 -6
- package/dist/es/components/explorer-form/explorer-form.mjs +2 -2
- package/dist/es/components/explorer-list/explorer-list.mjs +2 -2
- package/dist/es/components/explorer-modal-form/explorer-modal-form.mjs +3 -3
- package/dist/es/components/explorer-panel/explorer-panel.mjs +2 -2
- package/dist/es/components/explorer-query/explorer-query.mjs +2 -2
- package/dist/es/components/explorer-table/explorer-table.d.ts +4 -1
- package/dist/es/components/explorer-table/explorer-table.mjs +11 -9
- package/dist/es/components/explorer-table/explorer-table.vue.d.ts +7 -3
- package/dist/es/components/explorer-tools/explorer-tools.mjs +12 -12
- package/dist/es/components/explorer-tree/explorer-tree.mjs +5 -5
- package/dist/es/components/icon/icon2.mjs +1 -1
- package/dist/es/components/icon-picker/icon-picker.mjs +9 -9
- package/dist/es/components/image/image.mjs +3 -3
- package/dist/es/components/input/input.mjs +2 -2
- package/dist/es/components/input-number/input-number.mjs +3 -3
- package/dist/es/components/pca-picker/pca-picker.mjs +15 -15
- package/dist/es/components/screenfull/screenfull.mjs +2 -2
- package/dist/es/components/scrollbar/scrollbar.mjs +2 -2
- package/dist/es/components/select/select.mjs +4 -4
- package/dist/es/components/single-player/single-player.mjs +9 -9
- package/dist/es/components/splitter/splitter.mjs +2 -2
- package/dist/es/components/splitter-panel/splitter-panel.mjs +2 -2
- package/dist/es/components/switch/index.css +1 -1
- package/dist/es/components/switch/switch.mjs +406 -16
- package/dist/es/components/tags/tags.mjs +7 -7
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +2 -2
- package/dist/es/components/tinymce/tinymce.mjs +2 -2
- package/dist/es/components/transfer/transfer.mjs +3 -3
- package/dist/es/components/transfer-panel/transfer-panel.mjs +3 -3
- package/dist/es/components/tree-picker/tree-picker.mjs +8 -8
- package/dist/es/index.mjs +1 -1
- package/dist/index.css +3 -2
- package/package.json +1 -1
|
@@ -1,7 +1,398 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { i as isString, b as buildProps, d as definePropType, u as useNamespace, a as debugWarn, k as isPromise, t as throwError } from '../../chunk/Gk1J52Yw.mjs';
|
|
3
|
+
import { E as ElPopconfirm } from '../../chunk/CNHQauEr.mjs';
|
|
4
|
+
import '../../chunk/BH1e_-Fa.mjs';
|
|
5
|
+
/* empty css */
|
|
6
|
+
import '../../chunk/Db0Pk78M.mjs';
|
|
7
|
+
import { defineComponent, computed, ref, shallowRef, watch, onMounted, createElementBlock, openBlock, withModifiers, normalizeClass, createElementVNode, createCommentVNode, withKeys, unref, renderSlot, createBlock, withCtx, resolveDynamicComponent, toDisplayString, normalizeStyle, createVNode, nextTick, useTemplateRef, mergeProps, isRef } from 'vue';
|
|
8
|
+
import { useFormDisabled as useFormDisabled$1 } from 'element-plus';
|
|
9
|
+
import { useVModel } from '@vueuse/core';
|
|
10
|
+
import { E as ElIcon } from '../../chunk/D0QTifnI.mjs';
|
|
11
|
+
import { Loading } from '@element-plus/icons-vue';
|
|
12
|
+
import { c as componentSizes } from '../../chunk/vPhxogl3.mjs';
|
|
13
|
+
import { i as iconPropType } from '../icon/icon2.mjs';
|
|
14
|
+
import { u as useAriaProps } from '../../chunk/B-xUksL-.mjs';
|
|
15
|
+
import { I as INPUT_EVENT, C as CHANGE_EVENT, U as UPDATE_MODEL_EVENT } from '../../chunk/Ct6q2FXg.mjs';
|
|
16
|
+
import { d as isBoolean, b as isNumber } from '../../chunk/Bc6yUGLs.mjs';
|
|
17
|
+
import { _ as _export_sfc, w as withInstall } from '../../chunk/V6KjsUQN.mjs';
|
|
18
|
+
import { u as useFormItem, c as useFormSize, b as useFormItemInputId, a as useFormDisabled } from '../../chunk/CBMjhoFP.mjs';
|
|
19
|
+
import { a as addUnit } from '../../chunk/DodoD9a9.mjs';
|
|
20
|
+
import { _ as _export_sfc$1 } from '../../chunk/pcqpp-6-.mjs';
|
|
21
|
+
|
|
22
|
+
const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
|
|
23
|
+
|
|
24
|
+
const switchProps = buildProps({
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: [Boolean, String, Number],
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
loading: Boolean,
|
|
34
|
+
size: {
|
|
35
|
+
type: String,
|
|
36
|
+
validator: isValidComponentSize
|
|
37
|
+
},
|
|
38
|
+
width: {
|
|
39
|
+
type: [String, Number],
|
|
40
|
+
default: ""
|
|
41
|
+
},
|
|
42
|
+
inlinePrompt: Boolean,
|
|
43
|
+
inactiveActionIcon: {
|
|
44
|
+
type: iconPropType
|
|
45
|
+
},
|
|
46
|
+
activeActionIcon: {
|
|
47
|
+
type: iconPropType
|
|
48
|
+
},
|
|
49
|
+
activeIcon: {
|
|
50
|
+
type: iconPropType
|
|
51
|
+
},
|
|
52
|
+
inactiveIcon: {
|
|
53
|
+
type: iconPropType
|
|
54
|
+
},
|
|
55
|
+
activeText: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
inactiveText: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
activeValue: {
|
|
64
|
+
type: [Boolean, String, Number],
|
|
65
|
+
default: true
|
|
66
|
+
},
|
|
67
|
+
inactiveValue: {
|
|
68
|
+
type: [Boolean, String, Number],
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
name: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: ""
|
|
74
|
+
},
|
|
75
|
+
validateEvent: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
beforeChange: {
|
|
80
|
+
type: definePropType(Function)
|
|
81
|
+
},
|
|
82
|
+
id: String,
|
|
83
|
+
tabindex: {
|
|
84
|
+
type: [String, Number]
|
|
85
|
+
},
|
|
86
|
+
...useAriaProps(["ariaLabel"])
|
|
87
|
+
});
|
|
88
|
+
const switchEmits = {
|
|
89
|
+
[UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
90
|
+
[CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
91
|
+
[INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const _hoisted_1 = ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex"];
|
|
95
|
+
const _hoisted_2 = ["aria-hidden"];
|
|
96
|
+
const _hoisted_3 = { key: 1 };
|
|
97
|
+
const _hoisted_4 = { key: 1 };
|
|
98
|
+
const _hoisted_5 = ["aria-hidden"];
|
|
99
|
+
const COMPONENT_NAME = "ElSwitch";
|
|
100
|
+
const _sfc_main$1 = defineComponent({
|
|
101
|
+
...{
|
|
102
|
+
name: COMPONENT_NAME
|
|
103
|
+
},
|
|
104
|
+
__name: "switch",
|
|
105
|
+
props: switchProps,
|
|
106
|
+
emits: switchEmits,
|
|
107
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
108
|
+
const props = __props;
|
|
109
|
+
const emit = __emit;
|
|
110
|
+
const { formItem } = useFormItem();
|
|
111
|
+
const switchSize = useFormSize();
|
|
112
|
+
const ns = useNamespace("switch");
|
|
113
|
+
const { inputId } = useFormItemInputId(props, {
|
|
114
|
+
formItemContext: formItem
|
|
115
|
+
});
|
|
116
|
+
const switchDisabled = useFormDisabled(
|
|
117
|
+
computed(() => {
|
|
118
|
+
if (props.loading) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return void 0;
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
const isControlled = ref(props.modelValue !== false);
|
|
125
|
+
const input = shallowRef();
|
|
126
|
+
const switchKls = computed(() => [
|
|
127
|
+
ns.b(),
|
|
128
|
+
ns.m(switchSize.value),
|
|
129
|
+
ns.is("disabled", switchDisabled.value),
|
|
130
|
+
ns.is("checked", checked.value)
|
|
131
|
+
]);
|
|
132
|
+
const labelLeftKls = computed(() => [
|
|
133
|
+
ns.e("label"),
|
|
134
|
+
ns.em("label", "left"),
|
|
135
|
+
ns.is("active", !checked.value)
|
|
136
|
+
]);
|
|
137
|
+
const labelRightKls = computed(() => [
|
|
138
|
+
ns.e("label"),
|
|
139
|
+
ns.em("label", "right"),
|
|
140
|
+
ns.is("active", checked.value)
|
|
141
|
+
]);
|
|
142
|
+
const coreStyle = computed(() => ({
|
|
143
|
+
width: addUnit(props.width)
|
|
144
|
+
}));
|
|
145
|
+
watch(
|
|
146
|
+
() => props.modelValue,
|
|
147
|
+
() => {
|
|
148
|
+
isControlled.value = true;
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
const actualValue = computed(() => {
|
|
152
|
+
return isControlled.value ? props.modelValue : false;
|
|
153
|
+
});
|
|
154
|
+
const checked = computed(() => actualValue.value === props.activeValue);
|
|
155
|
+
if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
|
|
156
|
+
emit(UPDATE_MODEL_EVENT, props.inactiveValue);
|
|
157
|
+
emit(CHANGE_EVENT, props.inactiveValue);
|
|
158
|
+
emit(INPUT_EVENT, props.inactiveValue);
|
|
159
|
+
}
|
|
160
|
+
watch(checked, (val) => {
|
|
161
|
+
var _a;
|
|
162
|
+
input.value.checked = val;
|
|
163
|
+
if (props.validateEvent) {
|
|
164
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const handleChange = () => {
|
|
168
|
+
const val = checked.value ? props.inactiveValue : props.activeValue;
|
|
169
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
170
|
+
emit(CHANGE_EVENT, val);
|
|
171
|
+
emit(INPUT_EVENT, val);
|
|
172
|
+
nextTick(() => {
|
|
173
|
+
input.value.checked = checked.value;
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
const switchValue = () => {
|
|
177
|
+
if (switchDisabled.value)
|
|
178
|
+
return;
|
|
179
|
+
const { beforeChange } = props;
|
|
180
|
+
if (!beforeChange) {
|
|
181
|
+
handleChange();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const shouldChange = beforeChange();
|
|
185
|
+
const isPromiseOrBool = [
|
|
186
|
+
isPromise(shouldChange),
|
|
187
|
+
isBoolean(shouldChange)
|
|
188
|
+
].includes(true);
|
|
189
|
+
if (!isPromiseOrBool) {
|
|
190
|
+
throwError(
|
|
191
|
+
COMPONENT_NAME,
|
|
192
|
+
"beforeChange must return type `Promise<boolean>` or `boolean`"
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
if (isPromise(shouldChange)) {
|
|
196
|
+
shouldChange.then((result) => {
|
|
197
|
+
if (result) {
|
|
198
|
+
handleChange();
|
|
199
|
+
}
|
|
200
|
+
}).catch((e) => {
|
|
201
|
+
debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
|
|
202
|
+
});
|
|
203
|
+
} else if (shouldChange) {
|
|
204
|
+
handleChange();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const focus = () => {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
210
|
+
};
|
|
211
|
+
onMounted(() => {
|
|
212
|
+
input.value.checked = checked.value;
|
|
213
|
+
});
|
|
214
|
+
__expose({
|
|
215
|
+
focus,
|
|
216
|
+
checked
|
|
217
|
+
});
|
|
218
|
+
return (_ctx, _cache) => {
|
|
219
|
+
return openBlock(), createElementBlock(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
class: normalizeClass(switchKls.value),
|
|
223
|
+
onClick: withModifiers(switchValue, ["prevent"])
|
|
224
|
+
},
|
|
225
|
+
[
|
|
226
|
+
createElementVNode("input", {
|
|
227
|
+
id: unref(inputId),
|
|
228
|
+
ref_key: "input",
|
|
229
|
+
ref: input,
|
|
230
|
+
class: normalizeClass(unref(ns).e("input")),
|
|
231
|
+
type: "checkbox",
|
|
232
|
+
role: "switch",
|
|
233
|
+
"aria-checked": checked.value,
|
|
234
|
+
"aria-disabled": unref(switchDisabled),
|
|
235
|
+
"aria-label": _ctx.ariaLabel,
|
|
236
|
+
name: _ctx.name,
|
|
237
|
+
"true-value": _ctx.activeValue,
|
|
238
|
+
"false-value": _ctx.inactiveValue,
|
|
239
|
+
disabled: unref(switchDisabled),
|
|
240
|
+
tabindex: _ctx.tabindex,
|
|
241
|
+
onChange: handleChange,
|
|
242
|
+
onKeydown: withKeys(switchValue, ["enter"])
|
|
243
|
+
}, null, 42, _hoisted_1),
|
|
244
|
+
!_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText || _ctx.$slots.inactive) ? (openBlock(), createElementBlock(
|
|
245
|
+
"span",
|
|
246
|
+
{
|
|
247
|
+
key: 0,
|
|
248
|
+
class: normalizeClass(labelLeftKls.value)
|
|
249
|
+
},
|
|
250
|
+
[
|
|
251
|
+
renderSlot(_ctx.$slots, "inactive", {}, () => [
|
|
252
|
+
_ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
253
|
+
default: withCtx(() => [
|
|
254
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
})) : createCommentVNode("v-if", true),
|
|
258
|
+
!_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
|
259
|
+
key: 1,
|
|
260
|
+
"aria-hidden": checked.value
|
|
261
|
+
}, toDisplayString(_ctx.inactiveText), 9, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
262
|
+
])
|
|
263
|
+
],
|
|
264
|
+
2
|
|
265
|
+
)) : createCommentVNode("v-if", true),
|
|
266
|
+
createElementVNode(
|
|
267
|
+
"span",
|
|
268
|
+
{
|
|
269
|
+
class: normalizeClass(unref(ns).e("core")),
|
|
270
|
+
style: normalizeStyle(coreStyle.value)
|
|
271
|
+
},
|
|
272
|
+
[
|
|
273
|
+
_ctx.inlinePrompt ? (openBlock(), createElementBlock(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
key: 0,
|
|
277
|
+
class: normalizeClass(unref(ns).e("inner"))
|
|
278
|
+
},
|
|
279
|
+
[
|
|
280
|
+
!checked.value ? (openBlock(), createElementBlock(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
key: 0,
|
|
284
|
+
class: normalizeClass(unref(ns).e("inner-wrapper"))
|
|
285
|
+
},
|
|
286
|
+
[
|
|
287
|
+
renderSlot(_ctx.$slots, "inactive", {}, () => [
|
|
288
|
+
_ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
289
|
+
default: withCtx(() => [
|
|
290
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
|
|
291
|
+
]),
|
|
292
|
+
_: 1
|
|
293
|
+
})) : createCommentVNode("v-if", true),
|
|
294
|
+
!_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock(
|
|
295
|
+
"span",
|
|
296
|
+
_hoisted_3,
|
|
297
|
+
toDisplayString(_ctx.inactiveText),
|
|
298
|
+
1
|
|
299
|
+
)) : createCommentVNode("v-if", true)
|
|
300
|
+
])
|
|
301
|
+
],
|
|
302
|
+
2
|
|
303
|
+
)) : (openBlock(), createElementBlock(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
key: 1,
|
|
307
|
+
class: normalizeClass(unref(ns).e("inner-wrapper"))
|
|
308
|
+
},
|
|
309
|
+
[
|
|
310
|
+
renderSlot(_ctx.$slots, "active", {}, () => [
|
|
311
|
+
_ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
312
|
+
default: withCtx(() => [
|
|
313
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
|
|
314
|
+
]),
|
|
315
|
+
_: 1
|
|
316
|
+
})) : createCommentVNode("v-if", true),
|
|
317
|
+
!_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock(
|
|
318
|
+
"span",
|
|
319
|
+
_hoisted_4,
|
|
320
|
+
toDisplayString(_ctx.activeText),
|
|
321
|
+
1
|
|
322
|
+
)) : createCommentVNode("v-if", true)
|
|
323
|
+
])
|
|
324
|
+
],
|
|
325
|
+
2
|
|
326
|
+
))
|
|
327
|
+
],
|
|
328
|
+
2
|
|
329
|
+
)) : createCommentVNode("v-if", true),
|
|
330
|
+
createElementVNode(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
class: normalizeClass(unref(ns).e("action"))
|
|
334
|
+
},
|
|
335
|
+
[
|
|
336
|
+
_ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
|
|
337
|
+
key: 0,
|
|
338
|
+
class: normalizeClass(unref(ns).is("loading"))
|
|
339
|
+
}, {
|
|
340
|
+
default: withCtx(() => [
|
|
341
|
+
createVNode(unref(Loading))
|
|
342
|
+
]),
|
|
343
|
+
_: 1
|
|
344
|
+
}, 8, ["class"])) : checked.value ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [
|
|
345
|
+
_ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
346
|
+
default: withCtx(() => [
|
|
347
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
|
|
348
|
+
]),
|
|
349
|
+
_: 1
|
|
350
|
+
})) : createCommentVNode("v-if", true)
|
|
351
|
+
]) : !checked.value ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [
|
|
352
|
+
_ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
353
|
+
default: withCtx(() => [
|
|
354
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
})) : createCommentVNode("v-if", true)
|
|
358
|
+
]) : createCommentVNode("v-if", true)
|
|
359
|
+
],
|
|
360
|
+
2
|
|
361
|
+
)
|
|
362
|
+
],
|
|
363
|
+
6
|
|
364
|
+
),
|
|
365
|
+
!_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText || _ctx.$slots.active) ? (openBlock(), createElementBlock(
|
|
366
|
+
"span",
|
|
367
|
+
{
|
|
368
|
+
key: 1,
|
|
369
|
+
class: normalizeClass(labelRightKls.value)
|
|
370
|
+
},
|
|
371
|
+
[
|
|
372
|
+
renderSlot(_ctx.$slots, "active", {}, () => [
|
|
373
|
+
_ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
374
|
+
default: withCtx(() => [
|
|
375
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
|
|
376
|
+
]),
|
|
377
|
+
_: 1
|
|
378
|
+
})) : createCommentVNode("v-if", true),
|
|
379
|
+
!_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
|
|
380
|
+
key: 1,
|
|
381
|
+
"aria-hidden": !checked.value
|
|
382
|
+
}, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
383
|
+
])
|
|
384
|
+
],
|
|
385
|
+
2
|
|
386
|
+
)) : createCommentVNode("v-if", true)
|
|
387
|
+
],
|
|
388
|
+
2
|
|
389
|
+
);
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
var Switch = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);
|
|
394
|
+
|
|
395
|
+
const ElSwitch = withInstall(Switch);
|
|
5
396
|
|
|
6
397
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
398
|
__name: "switch",
|
|
@@ -17,8 +408,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
408
|
setup(__props, { emit: __emit }) {
|
|
18
409
|
const props = __props;
|
|
19
410
|
const emits = __emit;
|
|
411
|
+
const myValue = useVModel(props, "modelValue", emits);
|
|
20
412
|
const mainRef = useTemplateRef("mainRef");
|
|
21
|
-
const formDisabled = useFormDisabled();
|
|
413
|
+
const formDisabled = useFormDisabled$1();
|
|
22
414
|
function getSwitchEle() {
|
|
23
415
|
if (!mainRef.value) {
|
|
24
416
|
return;
|
|
@@ -27,22 +419,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
419
|
return ele;
|
|
28
420
|
}
|
|
29
421
|
const handleConfirm = () => getSwitchEle()?.click();
|
|
30
|
-
const myValue = computed({
|
|
31
|
-
get: () => props.modelValue,
|
|
32
|
-
set: (val) => emits("update:modelValue", val)
|
|
33
|
-
});
|
|
34
422
|
onMounted(() => {
|
|
35
423
|
getSwitchEle()?.addEventListener("click", (event) => {
|
|
36
424
|
event.stopPropagation();
|
|
37
425
|
});
|
|
38
426
|
});
|
|
39
427
|
return (_ctx, _cache) => {
|
|
40
|
-
|
|
428
|
+
const _component_ElSwitch = ElSwitch;
|
|
429
|
+
const _component_ElPopconfirm = ElPopconfirm;
|
|
430
|
+
return unref(formDisabled) || !__props.confirm ? (openBlock(), createBlock(_component_ElSwitch, mergeProps({
|
|
41
431
|
key: 0,
|
|
42
|
-
modelValue: myValue
|
|
43
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => myValue.value = $event),
|
|
432
|
+
modelValue: unref(myValue),
|
|
433
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(myValue) ? myValue.value = $event : null),
|
|
44
434
|
class: __props.className
|
|
45
|
-
}, _ctx.$attrs, {
|
|
435
|
+
}, _ctx.$attrs, { disabled: unref(formDisabled) }), null, 16, ["modelValue", "class", "disabled"])) : (openBlock(), createBlock(_component_ElPopconfirm, mergeProps({
|
|
46
436
|
key: 1,
|
|
47
437
|
title: __props.confirmTitle
|
|
48
438
|
}, props.confirmProps, { onConfirm: handleConfirm }), {
|
|
@@ -52,9 +442,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
442
|
ref: mainRef,
|
|
53
443
|
class: normalizeClass(_ctx.$style.main)
|
|
54
444
|
}, [
|
|
55
|
-
createVNode(
|
|
56
|
-
modelValue: myValue
|
|
57
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => myValue.value = $event),
|
|
445
|
+
createVNode(_component_ElSwitch, mergeProps({
|
|
446
|
+
modelValue: unref(myValue),
|
|
447
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(myValue) ? myValue.value = $event : null),
|
|
58
448
|
class: ["h-switch", __props.className]
|
|
59
449
|
}, _ctx.$attrs), null, 16, ["modelValue", "class"])
|
|
60
450
|
], 2)
|
|
@@ -73,7 +463,7 @@ const style0 = {
|
|
|
73
463
|
const cssModules = {
|
|
74
464
|
"$style": style0
|
|
75
465
|
};
|
|
76
|
-
const Component = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
466
|
+
const Component = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__cssModules", cssModules]]);
|
|
77
467
|
|
|
78
468
|
const __vite_glob_0_49 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
79
469
|
__proto__: null,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import '../../chunk/
|
|
3
|
-
import '../../chunk/
|
|
2
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
3
|
+
import '../../chunk/BH1e_-Fa.mjs';
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { E as ElAlert } from '../../chunk/
|
|
6
|
-
import { E as ElInput } from '../../chunk/
|
|
7
|
-
import { E as ElSpace } from '../../chunk/
|
|
5
|
+
import { E as ElAlert } from '../../chunk/Bj4UMVBI.mjs';
|
|
6
|
+
import { E as ElInput } from '../../chunk/DFOYvCRL.mjs';
|
|
7
|
+
import { E as ElSpace } from '../../chunk/Dgu95mOy.mjs';
|
|
8
8
|
/* empty css */
|
|
9
9
|
import { defineComponent, ref, computed, watch, createBlock, unref, openBlock, withCtx, createElementBlock, Fragment, renderList, mergeProps, createTextVNode, toDisplayString, createVNode, createCommentVNode, normalizeClass, isRef, withDirectives, withKeys } from 'vue';
|
|
10
10
|
import { useFormDisabled } from 'element-plus';
|
|
11
11
|
import Draggable from 'vuedraggable-es-fix';
|
|
12
12
|
import { v as vFocus } from '../../chunk/CL65DvCP.mjs';
|
|
13
13
|
import { C as Component$1 } from '../button/button.mjs';
|
|
14
|
-
import { E as ElTag } from '../../chunk/
|
|
15
|
-
import { E as ElPopover } from '../../chunk/
|
|
14
|
+
import { E as ElTag } from '../../chunk/jjYAptTv.mjs';
|
|
15
|
+
import { E as ElPopover } from '../../chunk/DdY32YAP.mjs';
|
|
16
16
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
17
17
|
|
|
18
18
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import '../../chunk/
|
|
2
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { a as ElTooltip } from '../../chunk/
|
|
4
|
+
import { a as ElTooltip } from '../../chunk/BH1e_-Fa.mjs';
|
|
5
5
|
import { defineComponent, ref, useTemplateRef, computed, watch, onMounted, nextTick, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createBlock, createCommentVNode, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString } from 'vue';
|
|
6
6
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import '../../chunk/
|
|
3
|
-
import { v as vLoading } from '../../chunk/
|
|
2
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
3
|
+
import { v as vLoading } from '../../chunk/D-1mFPUH.mjs';
|
|
4
4
|
import { defineComponent, useCssVars, shallowRef, ref, computed, watch, onMounted, onBeforeUnmount, withDirectives, createElementBlock, openBlock, normalizeClass, createElementVNode, unref } from 'vue';
|
|
5
5
|
import { useDark } from '@vueuse/core';
|
|
6
6
|
import { i as index } from '../../chunk/BaJ7k5Lg.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import './index.css'
|
|
2
|
-
import '../../chunk/
|
|
3
|
-
import '../../chunk/
|
|
2
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
3
|
+
import '../../chunk/BH1e_-Fa.mjs';
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { defineComponent, useCssVars, unref, computed, useCssModule, useTemplateRef, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, createVNode, isRef, mergeProps } from 'vue';
|
|
6
6
|
import { useFormDisabled } from 'element-plus';
|
|
7
7
|
import { C as Component$2 } from '../select/select.mjs';
|
|
8
8
|
import { C as Component$1 } from '../transfer-panel/transfer-panel.mjs';
|
|
9
9
|
import { useVModel, useToggle, useThrottleFn, onClickOutside } from '@vueuse/core';
|
|
10
|
-
import { E as ElPopover } from '../../chunk/
|
|
10
|
+
import { E as ElPopover } from '../../chunk/DdY32YAP.mjs';
|
|
11
11
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
12
12
|
|
|
13
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
import { defineComponent, useCssVars, ref, computed, createElementBlock, openBlock, normalizeClass, createVNode, createElementVNode, unref, withKeys, isRef, withCtx, createBlock, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode, renderSlot } from 'vue';
|
|
3
3
|
import { useFormDisabled } from 'element-plus';
|
|
4
|
-
import '../../chunk/
|
|
5
|
-
import { E as ElInput } from '../../chunk/
|
|
6
|
-
import { E as ElText } from '../../chunk/
|
|
4
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
5
|
+
import { E as ElInput } from '../../chunk/DFOYvCRL.mjs';
|
|
6
|
+
import { E as ElText } from '../../chunk/DbhQlaOz.mjs';
|
|
7
7
|
import { Search } from '@element-plus/icons-vue';
|
|
8
8
|
import { C as Component$3 } from '../button/button.mjs';
|
|
9
9
|
import { C as Component$2 } from '../iconify-icon/iconify-icon.mjs';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './index.css'
|
|
2
2
|
import './popover-cascader.css'
|
|
3
|
-
import '../../chunk/
|
|
4
|
-
import '../../chunk/
|
|
3
|
+
import '../../chunk/Gk1J52Yw.mjs';
|
|
4
|
+
import '../../chunk/BH1e_-Fa.mjs';
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { P as PopoverCascader, E as ElCascader } from '../../chunk/
|
|
7
|
-
import '../../chunk/
|
|
6
|
+
import { P as PopoverCascader, E as ElCascader } from '../../chunk/QtiOxqKv.mjs';
|
|
7
|
+
import '../../chunk/DFOYvCRL.mjs';
|
|
8
8
|
/* empty css */
|
|
9
|
-
import '../../chunk/
|
|
10
|
-
import '../../chunk/
|
|
11
|
-
import '../../chunk/
|
|
9
|
+
import '../../chunk/DBf73TLo.mjs';
|
|
10
|
+
import '../../chunk/Do7HIVy5.mjs';
|
|
11
|
+
import '../../chunk/CqhShW5K.mjs';
|
|
12
12
|
import { defineComponent, useCssVars, unref, computed, useCssModule, useTemplateRef, ref, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, createVNode, mergeProps, isRef, createTextVNode, toDisplayString, nextTick } from 'vue';
|
|
13
13
|
import { useFormDisabled } from 'element-plus';
|
|
14
14
|
import { useVModel, useToggle, useThrottleFn, onClickOutside } from '@vueuse/core';
|
|
15
|
-
import { E as ElPopover } from '../../chunk/
|
|
15
|
+
import { E as ElPopover } from '../../chunk/DdY32YAP.mjs';
|
|
16
16
|
import { _ as _export_sfc } from '../../chunk/pcqpp-6-.mjs';
|
|
17
17
|
|
|
18
18
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
package/dist/es/index.mjs
CHANGED
|
@@ -156,7 +156,7 @@ const __vite_glob_0_47 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePr
|
|
|
156
156
|
default: _sfc_main$8
|
|
157
157
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
158
158
|
|
|
159
|
-
const version = "1.9.
|
|
159
|
+
const version = "1.9.2";
|
|
160
160
|
|
|
161
161
|
const modules = /* #__PURE__ */ Object.assign({"./components/awesome-icon/awesome-icon.vue": __vite_glob_0_0,"./components/backbottom/backbottom.vue": __vite_glob_0_1,"./components/button/button.vue": __vite_glob_0_2,"./components/chat-container/chat-container.vue": __vite_glob_0_3,"./components/choice-boolean/choice-boolean.vue": __vite_glob_0_4,"./components/choice/choice.vue": __vite_glob_0_5,"./components/color-switcher/color-switcher.vue": __vite_glob_0_6,"./components/config-provider/config-provider.vue": __vite_glob_0_7,"./components/cropper/cropper.vue": __vite_glob_0_8,"./components/currency/currency.vue": __vite_glob_0_9,"./components/dark-switcher/dark-switcher.vue": __vite_glob_0_10,"./components/daterange-picker/daterange-picker.vue": __vite_glob_0_11,"./components/dialog-camera-upload/dialog-camera-upload.vue": __vite_glob_0_12,"./components/dialog-map-point/dialog-map-point.vue": __vite_glob_0_13,"./components/dialog-upload-images/dialog-upload-images.vue": __vite_glob_0_14,"./components/dialog/dialog.vue": __vite_glob_0_15,"./components/drag-verify/drag-verify.vue": __vite_glob_0_16,"./components/drawer/drawer.vue": __vite_glob_0_17,"./components/easy-pagination/easy-pagination.vue": __vite_glob_0_18,"./components/el-icon/el-icon.vue": __vite_glob_0_19,"./components/explorer-column-table/explorer-column-table.vue": __vite_glob_0_20,"./components/explorer-container/explorer-container.vue": __vite_glob_0_21,"./components/explorer-filter/explorer-filter.vue": __vite_glob_0_22,"./components/explorer-footer/explorer-footer.vue": __vite_glob_0_23,"./components/explorer-form/explorer-form.vue": __vite_glob_0_24,"./components/explorer-list/explorer-list.vue": __vite_glob_0_25,"./components/explorer-modal-form/explorer-modal-form.vue": __vite_glob_0_26,"./components/explorer-panel/explorer-panel.vue": __vite_glob_0_27,"./components/explorer-query/explorer-query.vue": __vite_glob_0_28,"./components/explorer-table/explorer-table.vue": __vite_glob_0_29,"./components/explorer-tools/explorer-tools.vue": __vite_glob_0_30,"./components/explorer-tree/explorer-tree.vue": __vite_glob_0_31,"./components/explorer/explorer.vue": __vite_glob_0_32,"./components/flag/flag.vue": __vite_glob_0_33,"./components/icon-picker/icon-picker.vue": __vite_glob_0_34,"./components/icon/icon.vue": __vite_glob_0_35,"./components/iconify-icon/iconify-icon.vue": __vite_glob_0_36,"./components/image/image.vue": __vite_glob_0_37,"./components/input-number/input-number.vue": __vite_glob_0_38,"./components/input/input.vue": __vite_glob_0_39,"./components/pca-picker/pca-picker.vue": __vite_glob_0_40,"./components/qr-code/qr-code.vue": __vite_glob_0_41,"./components/screenfull/screenfull.vue": __vite_glob_0_42,"./components/scrollbar/scrollbar.vue": __vite_glob_0_43,"./components/select/select.vue": __vite_glob_0_44,"./components/single-player/single-player.vue": __vite_glob_0_45,"./components/splitter-panel/splitter-panel.vue": __vite_glob_0_46,"./components/splitter/splitter.vue": __vite_glob_0_47,"./components/svg-icon/svg-icon.vue": __vite_glob_0_48,"./components/switch/switch.vue": __vite_glob_0_49,"./components/sync-scroll-container/sync-scroll-container.vue": __vite_glob_0_50,"./components/tags/tags.vue": __vite_glob_0_51,"./components/text-ellipsis/text-ellipsis.vue": __vite_glob_0_52,"./components/thousand-input/thousand-input.vue": __vite_glob_0_53,"./components/tinymce/tinymce.vue": __vite_glob_0_54,"./components/transfer-panel/transfer-panel.vue": __vite_glob_0_55,"./components/transfer/transfer.vue": __vite_glob_0_56,"./components/tree-picker/tree-picker.vue": __vite_glob_0_57,"./components/upload-file/upload-file.vue": __vite_glob_0_58});
|
|
162
162
|
const upper = (_, letter) => letter.toUpperCase();
|