@wfrog/vc-ui 1.11.10 → 1.11.12
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/Bw0Rhd-r.mjs +110 -0
- package/dist/es/chunk/CqTdDZkE.mjs +31 -0
- package/dist/es/chunk/{DAnWZLYj.mjs → CzWfBa_8.mjs} +96 -2
- package/dist/es/chunk/D229kQ56.mjs +28 -0
- package/dist/es/chunk/{Cxx_YWUC.mjs → DcouM6gM.mjs} +6 -548
- package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
- package/dist/es/chunk/KanuIcmc.mjs +412 -0
- package/dist/es/chunk/{B71xEPfK.mjs → uuUHUjSk.mjs} +4 -35
- package/dist/es/components/backbottom/backbottom.mjs +3 -2
- package/dist/es/components/button/button.mjs +14 -13
- package/dist/es/components/choice/choice.mjs +11 -9
- package/dist/es/components/choice/index.css +1 -1
- package/dist/es/components/choice-boolean/choice-boolean.mjs +3 -3
- package/dist/es/components/color-switch/color-switch.mjs +73 -1046
- package/dist/es/components/color-switch/index.css +1 -1
- package/dist/es/components/cropper/cropper.mjs +11 -117
- package/dist/es/components/cropper/index.css +1 -1
- package/dist/es/components/currency/currency.mjs +10 -12
- package/dist/es/components/daterange-picker/daterange-picker.mjs +10 -6255
- package/dist/es/components/dialog/dialog.mjs +14 -408
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -14
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +4 -4
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +14 -1380
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -2
- package/dist/es/components/drawer/drawer.mjs +16 -359
- package/dist/es/components/drawer/index.css +3 -3
- package/dist/es/components/easy-pagination/easy-pagination.mjs +3 -2
- package/dist/es/components/explorer/explorer.mjs +8 -8
- package/dist/es/components/explorer-column-table/explorer-column-table.mjs +5 -7
- package/dist/es/components/explorer-column-table/index.css +1 -1
- package/dist/es/components/explorer-container/explorer-container.d.ts +1 -1
- package/dist/es/components/explorer-container/explorer-container.mjs +4 -3
- package/dist/es/components/explorer-filter/explorer-filter.mjs +5 -4
- package/dist/es/components/explorer-footer/explorer-footer.mjs +4 -8
- package/dist/es/components/explorer-form/explorer-form.mjs +4 -3
- package/dist/es/components/explorer-list/explorer-list.mjs +18 -13
- package/dist/es/components/explorer-list/explorer-list.vue.d.ts +1 -1
- package/dist/es/components/explorer-list/index.css +16 -16
- package/dist/es/components/explorer-modal-form/explorer-modal-form.mjs +8 -7
- package/dist/es/components/explorer-panel/explorer-panel.mjs +3 -3
- package/dist/es/components/explorer-query/explorer-query.mjs +9 -2201
- package/dist/es/components/explorer-query/index.css +1 -1
- package/dist/es/components/explorer-table/explorer-table.mjs +5 -8
- package/dist/es/components/explorer-tools/explorer-tools.mjs +23 -271
- package/dist/es/components/explorer-tools/index.css +9 -9
- package/dist/es/components/explorer-tree/explorer-tree.mjs +4 -5
- package/dist/es/components/explorer-tree/explorer-tree.vue.d.ts +1 -1
- package/dist/es/components/form-item/form-item.mjs +3 -3
- package/dist/es/components/icon-picker/icon-picker.mjs +8 -12
- package/dist/es/components/image/image.mjs +4 -4
- package/dist/es/components/info-tooltip/info-tooltip.mjs +336 -4
- package/dist/es/components/input/input.mjs +3 -2
- package/dist/es/components/input-number/input-number.mjs +3 -3
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +443 -601
- package/dist/es/components/screenfull/screenfull.mjs +4 -3
- package/dist/es/components/scrollbar/index.css +1 -1
- package/dist/es/components/scrollbar/scrollbar.mjs +10 -10
- package/dist/es/components/select/index.css +1 -1
- package/dist/es/components/select/select.mjs +9 -10
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +10 -1087
- package/dist/es/components/splitter/splitter.mjs +3 -3
- package/dist/es/components/splitter-panel/splitter-panel.mjs +3 -3
- package/dist/es/components/switch/index.css +1 -1
- package/dist/es/components/switch/switch.mjs +9 -395
- package/dist/es/components/tags/tags.mjs +7 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +3 -3
- package/dist/es/components/thousand-input/thousand-input.mjs +39 -8
- package/dist/es/components/tinymce/tinymce.mjs +4 -3
- package/dist/es/components/transfer/transfer.mjs +3 -4
- package/dist/es/components/transfer-panel/transfer-panel.mjs +5 -4
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +5 -10
- package/dist/es/index.mjs +1 -1
- package/dist/index.css +41 -68
- package/package.json +1 -1
- package/dist/es/chunk/B-rxnVJv.mjs +0 -3
- package/dist/es/chunk/B5HpgPRt.mjs +0 -69
- package/dist/es/chunk/BBhZKpIc.mjs +0 -2179
- package/dist/es/chunk/BDcsaNYa.mjs +0 -59
- package/dist/es/chunk/BTSSEFfD.mjs +0 -319
- package/dist/es/chunk/BTpNRPQW.mjs +0 -55
- package/dist/es/chunk/BVBK1U57.mjs +0 -96
- package/dist/es/chunk/Bc6yUGLs.mjs +0 -45
- package/dist/es/chunk/BjVI1XMz.mjs +0 -40
- package/dist/es/chunk/BlzQCBDu.mjs +0 -5741
- package/dist/es/chunk/BpJKnxlF.mjs +0 -476
- package/dist/es/chunk/Brp-qSBw.mjs +0 -2003
- package/dist/es/chunk/BunQI8Jb.mjs +0 -390
- package/dist/es/chunk/C0XgBrDz.mjs +0 -775
- package/dist/es/chunk/C0pTANRX.mjs +0 -109
- package/dist/es/chunk/CBMjhoFP.mjs +0 -101
- package/dist/es/chunk/CBiNtNvQ.mjs +0 -242
- package/dist/es/chunk/CBlJeNBO.mjs +0 -890
- package/dist/es/chunk/CCVL_Zj-.mjs +0 -427
- package/dist/es/chunk/CEl4MyfJ.mjs +0 -252
- package/dist/es/chunk/CJK5_jsA.mjs +0 -53
- package/dist/es/chunk/CKOcwq5V.mjs +0 -44
- package/dist/es/chunk/COs9dJZa.mjs +0 -66
- package/dist/es/chunk/CPt6MxJW.mjs +0 -375
- package/dist/es/chunk/CVqW0jzp.mjs +0 -107
- package/dist/es/chunk/CccIsEqA.mjs +0 -128
- package/dist/es/chunk/CjLR27-a.mjs +0 -582
- package/dist/es/chunk/CoGexPPD.mjs +0 -2192
- package/dist/es/chunk/CsLIbnzG.mjs +0 -64
- package/dist/es/chunk/Ct6q2FXg.mjs +0 -5
- package/dist/es/chunk/Cuq5meQh.mjs +0 -184
- package/dist/es/chunk/CvYIOfT1.mjs +0 -23
- package/dist/es/chunk/CxHJBf4l.mjs +0 -31
- package/dist/es/chunk/CzdaOBtA.mjs +0 -66
- package/dist/es/chunk/D0QTifnI.mjs +0 -54
- package/dist/es/chunk/D1QnA2iT.mjs +0 -229
- package/dist/es/chunk/D3AvJlVX.mjs +0 -188
- package/dist/es/chunk/D9Lr0Bzb.mjs +0 -1136
- package/dist/es/chunk/DCkPv0hy.mjs +0 -29
- package/dist/es/chunk/DRwwUUhy.mjs +0 -49
- package/dist/es/chunk/DX-2VRY2.mjs +0 -836
- package/dist/es/chunk/DZ2oTFad.mjs +0 -687
- package/dist/es/chunk/D_bou1py.mjs +0 -55
- package/dist/es/chunk/Da199A5L.mjs +0 -314
- package/dist/es/chunk/DbhQlaOz.mjs +0 -94
- package/dist/es/chunk/Dgu95mOy.mjs +0 -237
- package/dist/es/chunk/DhGOsWxx.mjs +0 -6
- package/dist/es/chunk/Dm_Sj5aH.mjs +0 -487
- package/dist/es/chunk/Dmi-1GRO.mjs +0 -163
- package/dist/es/chunk/DodoD9a9.mjs +0 -52
- package/dist/es/chunk/DrrVDcwm.mjs +0 -955
- package/dist/es/chunk/Du_zJ1Fz.mjs +0 -49
- package/dist/es/chunk/DxxbB5jY.mjs +0 -34
- package/dist/es/chunk/Gk1J52Yw.mjs +0 -207
- package/dist/es/chunk/NsldgdCh.mjs +0 -704
- package/dist/es/chunk/V6KjsUQN.mjs +0 -35
- package/dist/es/chunk/eEsLFV3s.mjs +0 -76
- package/dist/es/chunk/fqiLhk0V.mjs +0 -2065
- package/dist/es/chunk/nxVM7re4.mjs +0 -35
- package/dist/es/chunk/s7HLrANj.mjs +0 -215
- package/dist/es/chunk/vPhxogl3.mjs +0 -19
- package/dist/es/components/icon/icon2.mjs +0 -27
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { isRef, computed, watch, onScopeDispose } from 'vue';
|
|
2
|
-
import { t as throwError, u as useNamespace } from './Gk1J52Yw.mjs';
|
|
3
|
-
import { h as hasClass, b as addClass, g as getStyle, r as removeClass } from './DodoD9a9.mjs';
|
|
4
|
-
import { d as getScrollBarWidth } from './CccIsEqA.mjs';
|
|
5
|
-
|
|
6
|
-
const useLockscreen = (trigger, options = {}) => {
|
|
7
|
-
if (!isRef(trigger)) {
|
|
8
|
-
throwError(
|
|
9
|
-
"[useLockscreen]",
|
|
10
|
-
"You need to pass a ref param to this function"
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
const ns = options.ns || useNamespace("popup");
|
|
14
|
-
const hiddenCls = computed(() => ns.bm("parent", "hidden"));
|
|
15
|
-
let scrollBarWidth = 0;
|
|
16
|
-
let withoutHiddenClass = false;
|
|
17
|
-
let bodyWidth = "0";
|
|
18
|
-
let cleaned = false;
|
|
19
|
-
const cleanup = () => {
|
|
20
|
-
if (cleaned)
|
|
21
|
-
return;
|
|
22
|
-
cleaned = true;
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
if (typeof document === "undefined")
|
|
25
|
-
return;
|
|
26
|
-
if (withoutHiddenClass && document) {
|
|
27
|
-
document.body.style.width = bodyWidth;
|
|
28
|
-
removeClass(document.body, hiddenCls.value);
|
|
29
|
-
}
|
|
30
|
-
}, 200);
|
|
31
|
-
};
|
|
32
|
-
watch(trigger, (val) => {
|
|
33
|
-
if (!val) {
|
|
34
|
-
cleanup();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
cleaned = false;
|
|
38
|
-
withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
|
|
39
|
-
if (withoutHiddenClass) {
|
|
40
|
-
bodyWidth = document.body.style.width;
|
|
41
|
-
addClass(document.body, hiddenCls.value);
|
|
42
|
-
}
|
|
43
|
-
scrollBarWidth = getScrollBarWidth(ns.namespace.value);
|
|
44
|
-
const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
|
|
45
|
-
const bodyOverflowY = getStyle(document.body, "overflowY");
|
|
46
|
-
if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
|
|
47
|
-
document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
onScopeDispose(() => cleanup());
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { useLockscreen as u };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { f as isArray } from './Cxx_YWUC.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Casts `value` as an array if it's not one.
|
|
5
|
-
*
|
|
6
|
-
* @static
|
|
7
|
-
* @memberOf _
|
|
8
|
-
* @since 4.4.0
|
|
9
|
-
* @category Lang
|
|
10
|
-
* @param {*} value The value to inspect.
|
|
11
|
-
* @returns {Array} Returns the cast array.
|
|
12
|
-
* @example
|
|
13
|
-
*
|
|
14
|
-
* _.castArray(1);
|
|
15
|
-
* // => [1]
|
|
16
|
-
*
|
|
17
|
-
* _.castArray({ 'a': 1 });
|
|
18
|
-
* // => [{ 'a': 1 }]
|
|
19
|
-
*
|
|
20
|
-
* _.castArray('abc');
|
|
21
|
-
* // => ['abc']
|
|
22
|
-
*
|
|
23
|
-
* _.castArray(null);
|
|
24
|
-
* // => [null]
|
|
25
|
-
*
|
|
26
|
-
* _.castArray(undefined);
|
|
27
|
-
* // => [undefined]
|
|
28
|
-
*
|
|
29
|
-
* _.castArray();
|
|
30
|
-
* // => []
|
|
31
|
-
*
|
|
32
|
-
* var array = [1, 2, 3];
|
|
33
|
-
* console.log(_.castArray(array) === array);
|
|
34
|
-
* // => true
|
|
35
|
-
*/
|
|
36
|
-
function castArray() {
|
|
37
|
-
if (!arguments.length) {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
var value = arguments[0];
|
|
41
|
-
return isArray(value) ? value : [value];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { castArray as c };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance, inject, ref, computed } from 'vue';
|
|
2
|
-
import { b as buildProps, d as definePropType, f as isFunction, c as isArray, a as debugWarn } from './Gk1J52Yw.mjs';
|
|
3
|
-
import { i as isEqual } from './B71xEPfK.mjs';
|
|
4
|
-
|
|
5
|
-
const emptyValuesContextKey = Symbol("emptyValuesContextKey");
|
|
6
|
-
const SCOPE = "use-empty-values";
|
|
7
|
-
const DEFAULT_EMPTY_VALUES = ["", void 0, null];
|
|
8
|
-
const DEFAULT_VALUE_ON_CLEAR = void 0;
|
|
9
|
-
const useEmptyValuesProps = buildProps({
|
|
10
|
-
emptyValues: Array,
|
|
11
|
-
valueOnClear: {
|
|
12
|
-
type: definePropType([
|
|
13
|
-
String,
|
|
14
|
-
Number,
|
|
15
|
-
Boolean,
|
|
16
|
-
Function
|
|
17
|
-
]),
|
|
18
|
-
default: void 0,
|
|
19
|
-
validator: (val) => {
|
|
20
|
-
val = isFunction(val) ? val() : val;
|
|
21
|
-
if (isArray(val)) {
|
|
22
|
-
return val.every((item) => !item);
|
|
23
|
-
}
|
|
24
|
-
return !val;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const useEmptyValues = (props, defaultValue) => {
|
|
29
|
-
const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
|
|
30
|
-
const emptyValues = computed(
|
|
31
|
-
() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES
|
|
32
|
-
);
|
|
33
|
-
const valueOnClear = computed(() => {
|
|
34
|
-
if (isFunction(props.valueOnClear)) {
|
|
35
|
-
return props.valueOnClear();
|
|
36
|
-
} else if (props.valueOnClear !== void 0) {
|
|
37
|
-
return props.valueOnClear;
|
|
38
|
-
} else if (isFunction(config.value.valueOnClear)) {
|
|
39
|
-
return config.value.valueOnClear();
|
|
40
|
-
} else if (config.value.valueOnClear !== void 0) {
|
|
41
|
-
return config.value.valueOnClear;
|
|
42
|
-
}
|
|
43
|
-
return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR;
|
|
44
|
-
});
|
|
45
|
-
const isEmptyValue = (value) => {
|
|
46
|
-
let result = true;
|
|
47
|
-
if (isArray(value)) {
|
|
48
|
-
result = emptyValues.value.some((emptyValue) => {
|
|
49
|
-
return isEqual(value, emptyValue);
|
|
50
|
-
});
|
|
51
|
-
} else {
|
|
52
|
-
result = emptyValues.value.includes(value);
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
};
|
|
56
|
-
if (!isEmptyValue(valueOnClear.value)) {
|
|
57
|
-
debugWarn(SCOPE, "value-on-clear should be a value of empty-values");
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
emptyValues,
|
|
61
|
-
valueOnClear,
|
|
62
|
-
isEmptyValue
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export { useEmptyValues as a, emptyValuesContextKey as e, useEmptyValuesProps as u };
|
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import { computed, inject, ref, useSlots, Text, defineComponent, createBlock, openBlock, resolveDynamicComponent, mergeProps, unref, withCtx, createElementBlock, createCommentVNode, Fragment, renderSlot, normalizeClass, provide, reactive, toRef } from 'vue';
|
|
2
|
-
import { E as ElIcon } from './D0QTifnI.mjs';
|
|
3
|
-
import { u as useDeprecated } from './CvYIOfT1.mjs';
|
|
4
|
-
import { u as useGlobalConfig } from './C0pTANRX.mjs';
|
|
5
|
-
import { u as useFormItem, c as useFormSize, a as useFormDisabled } from './CBMjhoFP.mjs';
|
|
6
|
-
import { Loading } from '@element-plus/icons-vue';
|
|
7
|
-
import { b as buildProps, d as definePropType, u as useNamespace } from './Gk1J52Yw.mjs';
|
|
8
|
-
import { u as useSizeProp } from './vPhxogl3.mjs';
|
|
9
|
-
import { i as iconPropType } from '../components/icon/icon2.mjs';
|
|
10
|
-
import { T as TinyColor } from './D9Lr0Bzb.mjs';
|
|
11
|
-
import { _ as _export_sfc, w as withInstall, a as withNoopInstall } from './V6KjsUQN.mjs';
|
|
12
|
-
|
|
13
|
-
const buttonGroupContextKey = Symbol(
|
|
14
|
-
"buttonGroupContextKey"
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const useButton = (props, emit) => {
|
|
18
|
-
useDeprecated(
|
|
19
|
-
{
|
|
20
|
-
from: "type.text",
|
|
21
|
-
replacement: "link",
|
|
22
|
-
version: "3.0.0",
|
|
23
|
-
scope: "props",
|
|
24
|
-
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
|
|
25
|
-
},
|
|
26
|
-
computed(() => props.type === "text")
|
|
27
|
-
);
|
|
28
|
-
const buttonGroupContext = inject(buttonGroupContextKey, void 0);
|
|
29
|
-
const globalConfig = useGlobalConfig("button");
|
|
30
|
-
const { form } = useFormItem();
|
|
31
|
-
const _size = useFormSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
|
|
32
|
-
const _disabled = useFormDisabled();
|
|
33
|
-
const _ref = ref();
|
|
34
|
-
const slots = useSlots();
|
|
35
|
-
const _type = computed(
|
|
36
|
-
() => {
|
|
37
|
-
var _a;
|
|
38
|
-
return props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || ((_a = globalConfig.value) == null ? void 0 : _a.type) || "";
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
const autoInsertSpace = computed(
|
|
42
|
-
() => {
|
|
43
|
-
var _a, _b, _c;
|
|
44
|
-
return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
const _plain = computed(
|
|
48
|
-
() => {
|
|
49
|
-
var _a, _b, _c;
|
|
50
|
-
return (_c = (_b = props.plain) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.plain) != null ? _c : false;
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
const _round = computed(
|
|
54
|
-
() => {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
return (_c = (_b = props.round) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.round) != null ? _c : false;
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
const _text = computed(() => {
|
|
60
|
-
var _a, _b, _c;
|
|
61
|
-
return (_c = (_b = props.text) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.text) != null ? _c : false;
|
|
62
|
-
});
|
|
63
|
-
const _props = computed(() => {
|
|
64
|
-
if (props.tag === "button") {
|
|
65
|
-
return {
|
|
66
|
-
ariaDisabled: _disabled.value || props.loading,
|
|
67
|
-
disabled: _disabled.value || props.loading,
|
|
68
|
-
autofocus: props.autofocus,
|
|
69
|
-
type: props.nativeType
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return {};
|
|
73
|
-
});
|
|
74
|
-
const shouldAddSpace = computed(() => {
|
|
75
|
-
var _a;
|
|
76
|
-
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
77
|
-
if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
|
|
78
|
-
const slot = defaultSlot[0];
|
|
79
|
-
if ((slot == null ? void 0 : slot.type) === Text) {
|
|
80
|
-
const text = slot.children;
|
|
81
|
-
return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
});
|
|
86
|
-
const handleClick = (evt) => {
|
|
87
|
-
if (_disabled.value || props.loading) {
|
|
88
|
-
evt.stopPropagation();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (props.nativeType === "reset") {
|
|
92
|
-
form == null ? void 0 : form.resetFields();
|
|
93
|
-
}
|
|
94
|
-
emit("click", evt);
|
|
95
|
-
};
|
|
96
|
-
return {
|
|
97
|
-
_disabled,
|
|
98
|
-
_size,
|
|
99
|
-
_type,
|
|
100
|
-
_ref,
|
|
101
|
-
_props,
|
|
102
|
-
_plain,
|
|
103
|
-
_round,
|
|
104
|
-
_text,
|
|
105
|
-
shouldAddSpace,
|
|
106
|
-
handleClick
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const buttonTypes = [
|
|
111
|
-
"default",
|
|
112
|
-
"primary",
|
|
113
|
-
"success",
|
|
114
|
-
"warning",
|
|
115
|
-
"info",
|
|
116
|
-
"danger",
|
|
117
|
-
"text",
|
|
118
|
-
""
|
|
119
|
-
];
|
|
120
|
-
const buttonNativeTypes = ["button", "submit", "reset"];
|
|
121
|
-
const buttonProps = buildProps({
|
|
122
|
-
size: useSizeProp,
|
|
123
|
-
disabled: {
|
|
124
|
-
type: Boolean,
|
|
125
|
-
default: void 0
|
|
126
|
-
},
|
|
127
|
-
type: {
|
|
128
|
-
type: String,
|
|
129
|
-
values: buttonTypes,
|
|
130
|
-
default: ""
|
|
131
|
-
},
|
|
132
|
-
icon: {
|
|
133
|
-
type: iconPropType
|
|
134
|
-
},
|
|
135
|
-
nativeType: {
|
|
136
|
-
type: String,
|
|
137
|
-
values: buttonNativeTypes,
|
|
138
|
-
default: "button"
|
|
139
|
-
},
|
|
140
|
-
loading: Boolean,
|
|
141
|
-
loadingIcon: {
|
|
142
|
-
type: iconPropType,
|
|
143
|
-
default: () => Loading
|
|
144
|
-
},
|
|
145
|
-
plain: {
|
|
146
|
-
type: Boolean,
|
|
147
|
-
default: void 0
|
|
148
|
-
},
|
|
149
|
-
text: {
|
|
150
|
-
type: Boolean,
|
|
151
|
-
default: void 0
|
|
152
|
-
},
|
|
153
|
-
link: Boolean,
|
|
154
|
-
bg: Boolean,
|
|
155
|
-
autofocus: Boolean,
|
|
156
|
-
round: {
|
|
157
|
-
type: Boolean,
|
|
158
|
-
default: void 0
|
|
159
|
-
},
|
|
160
|
-
circle: Boolean,
|
|
161
|
-
color: String,
|
|
162
|
-
dark: Boolean,
|
|
163
|
-
autoInsertSpace: {
|
|
164
|
-
type: Boolean,
|
|
165
|
-
default: void 0
|
|
166
|
-
},
|
|
167
|
-
tag: {
|
|
168
|
-
type: definePropType([String, Object]),
|
|
169
|
-
default: "button"
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
const buttonEmits = {
|
|
173
|
-
click: (evt) => evt instanceof MouseEvent
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
function darken(color, amount = 20) {
|
|
177
|
-
return color.mix("#141414", amount).toString();
|
|
178
|
-
}
|
|
179
|
-
function useButtonCustomStyle(props) {
|
|
180
|
-
const _disabled = useFormDisabled();
|
|
181
|
-
const ns = useNamespace("button");
|
|
182
|
-
return computed(() => {
|
|
183
|
-
let styles = {};
|
|
184
|
-
let buttonColor = props.color;
|
|
185
|
-
if (buttonColor) {
|
|
186
|
-
const match = buttonColor.match(/var\((.*?)\)/);
|
|
187
|
-
if (match) {
|
|
188
|
-
buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
|
|
189
|
-
}
|
|
190
|
-
const color = new TinyColor(buttonColor);
|
|
191
|
-
const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
|
|
192
|
-
if (props.plain) {
|
|
193
|
-
styles = ns.cssVarBlock({
|
|
194
|
-
"bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
|
|
195
|
-
"text-color": buttonColor,
|
|
196
|
-
"border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
|
|
197
|
-
"hover-text-color": `var(${ns.cssVarName("color-white")})`,
|
|
198
|
-
"hover-bg-color": buttonColor,
|
|
199
|
-
"hover-border-color": buttonColor,
|
|
200
|
-
"active-bg-color": activeBgColor,
|
|
201
|
-
"active-text-color": `var(${ns.cssVarName("color-white")})`,
|
|
202
|
-
"active-border-color": activeBgColor
|
|
203
|
-
});
|
|
204
|
-
if (_disabled.value) {
|
|
205
|
-
styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
|
|
206
|
-
styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
|
|
207
|
-
styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
|
|
208
|
-
}
|
|
209
|
-
} else {
|
|
210
|
-
const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
|
|
211
|
-
const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
|
|
212
|
-
styles = ns.cssVarBlock({
|
|
213
|
-
"bg-color": buttonColor,
|
|
214
|
-
"text-color": textColor,
|
|
215
|
-
"border-color": buttonColor,
|
|
216
|
-
"hover-bg-color": hoverBgColor,
|
|
217
|
-
"hover-text-color": textColor,
|
|
218
|
-
"hover-border-color": hoverBgColor,
|
|
219
|
-
"active-bg-color": activeBgColor,
|
|
220
|
-
"active-border-color": activeBgColor
|
|
221
|
-
});
|
|
222
|
-
if (_disabled.value) {
|
|
223
|
-
const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
|
|
224
|
-
styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
|
|
225
|
-
styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
|
|
226
|
-
styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return styles;
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const _sfc_main$1 = defineComponent({
|
|
235
|
-
...{
|
|
236
|
-
name: "ElButton"
|
|
237
|
-
},
|
|
238
|
-
__name: "button",
|
|
239
|
-
props: buttonProps,
|
|
240
|
-
emits: buttonEmits,
|
|
241
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
242
|
-
const props = __props;
|
|
243
|
-
const emit = __emit;
|
|
244
|
-
const buttonStyle = useButtonCustomStyle(props);
|
|
245
|
-
const ns = useNamespace("button");
|
|
246
|
-
const {
|
|
247
|
-
_ref,
|
|
248
|
-
_size,
|
|
249
|
-
_type,
|
|
250
|
-
_disabled,
|
|
251
|
-
_props,
|
|
252
|
-
_plain,
|
|
253
|
-
_round,
|
|
254
|
-
_text,
|
|
255
|
-
shouldAddSpace,
|
|
256
|
-
handleClick
|
|
257
|
-
} = useButton(props, emit);
|
|
258
|
-
const buttonKls = computed(() => [
|
|
259
|
-
ns.b(),
|
|
260
|
-
ns.m(_type.value),
|
|
261
|
-
ns.m(_size.value),
|
|
262
|
-
ns.is("disabled", _disabled.value),
|
|
263
|
-
ns.is("loading", props.loading),
|
|
264
|
-
ns.is("plain", _plain.value),
|
|
265
|
-
ns.is("round", _round.value),
|
|
266
|
-
ns.is("circle", props.circle),
|
|
267
|
-
ns.is("text", _text.value),
|
|
268
|
-
ns.is("link", props.link),
|
|
269
|
-
ns.is("has-bg", props.bg)
|
|
270
|
-
]);
|
|
271
|
-
__expose({
|
|
272
|
-
ref: _ref,
|
|
273
|
-
size: _size,
|
|
274
|
-
type: _type,
|
|
275
|
-
disabled: _disabled,
|
|
276
|
-
shouldAddSpace
|
|
277
|
-
});
|
|
278
|
-
return (_ctx, _cache) => {
|
|
279
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
|
|
280
|
-
ref_key: "_ref",
|
|
281
|
-
ref: _ref
|
|
282
|
-
}, unref(_props), {
|
|
283
|
-
class: buttonKls.value,
|
|
284
|
-
style: unref(buttonStyle),
|
|
285
|
-
onClick: unref(handleClick)
|
|
286
|
-
}), {
|
|
287
|
-
default: withCtx(() => [
|
|
288
|
-
_ctx.loading ? (openBlock(), createElementBlock(
|
|
289
|
-
Fragment,
|
|
290
|
-
{ key: 0 },
|
|
291
|
-
[
|
|
292
|
-
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
|
|
293
|
-
key: 1,
|
|
294
|
-
class: normalizeClass(unref(ns).is("loading"))
|
|
295
|
-
}, {
|
|
296
|
-
default: withCtx(() => [
|
|
297
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
|
|
298
|
-
]),
|
|
299
|
-
_: 1
|
|
300
|
-
}, 8, ["class"]))
|
|
301
|
-
],
|
|
302
|
-
64
|
|
303
|
-
)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
304
|
-
default: withCtx(() => [
|
|
305
|
-
_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
306
|
-
]),
|
|
307
|
-
_: 3
|
|
308
|
-
})) : createCommentVNode("v-if", true),
|
|
309
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock(
|
|
310
|
-
"span",
|
|
311
|
-
{
|
|
312
|
-
key: 2,
|
|
313
|
-
class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
|
|
314
|
-
},
|
|
315
|
-
[
|
|
316
|
-
renderSlot(_ctx.$slots, "default")
|
|
317
|
-
],
|
|
318
|
-
2
|
|
319
|
-
)) : createCommentVNode("v-if", true)
|
|
320
|
-
]),
|
|
321
|
-
_: 3
|
|
322
|
-
}, 16, ["class", "style", "onClick"]);
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
|
|
327
|
-
|
|
328
|
-
const buttonGroupProps = {
|
|
329
|
-
size: buttonProps.size,
|
|
330
|
-
type: buttonProps.type,
|
|
331
|
-
direction: {
|
|
332
|
-
type: definePropType(String),
|
|
333
|
-
values: ["horizontal", "vertical"],
|
|
334
|
-
default: "horizontal"
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
const _sfc_main = defineComponent({
|
|
339
|
-
...{
|
|
340
|
-
name: "ElButtonGroup"
|
|
341
|
-
},
|
|
342
|
-
__name: "button-group",
|
|
343
|
-
props: buttonGroupProps,
|
|
344
|
-
setup(__props) {
|
|
345
|
-
const props = __props;
|
|
346
|
-
provide(
|
|
347
|
-
buttonGroupContextKey,
|
|
348
|
-
reactive({
|
|
349
|
-
size: toRef(props, "size"),
|
|
350
|
-
type: toRef(props, "type")
|
|
351
|
-
})
|
|
352
|
-
);
|
|
353
|
-
const ns = useNamespace("button");
|
|
354
|
-
return (_ctx, _cache) => {
|
|
355
|
-
return openBlock(), createElementBlock(
|
|
356
|
-
"div",
|
|
357
|
-
{
|
|
358
|
-
class: normalizeClass([unref(ns).b("group"), unref(ns).bm("group", props.direction)])
|
|
359
|
-
},
|
|
360
|
-
[
|
|
361
|
-
renderSlot(_ctx.$slots, "default")
|
|
362
|
-
],
|
|
363
|
-
2
|
|
364
|
-
);
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
|
|
369
|
-
|
|
370
|
-
const ElButton = withInstall(Button, {
|
|
371
|
-
ButtonGroup
|
|
372
|
-
});
|
|
373
|
-
withNoopInstall(ButtonGroup);
|
|
374
|
-
|
|
375
|
-
export { ElButton as E, buttonTypes as b };
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance, shallowRef, ref, watch, unref, onMounted, nextTick } from 'vue';
|
|
2
|
-
import { useEventListener } from '@vueuse/core';
|
|
3
|
-
import { f as isElement } from './Bc6yUGLs.mjs';
|
|
4
|
-
import { a as isFocusable } from './CsLIbnzG.mjs';
|
|
5
|
-
import { f as isFunction } from './Gk1J52Yw.mjs';
|
|
6
|
-
|
|
7
|
-
function useFocusController(target, {
|
|
8
|
-
disabled,
|
|
9
|
-
beforeFocus,
|
|
10
|
-
afterFocus,
|
|
11
|
-
beforeBlur,
|
|
12
|
-
afterBlur
|
|
13
|
-
} = {}) {
|
|
14
|
-
const instance = getCurrentInstance();
|
|
15
|
-
const { emit } = instance;
|
|
16
|
-
const wrapperRef = shallowRef();
|
|
17
|
-
const isFocused = ref(false);
|
|
18
|
-
const handleFocus = (event) => {
|
|
19
|
-
const cancelFocus = isFunction(beforeFocus) ? beforeFocus(event) : false;
|
|
20
|
-
if (unref(disabled) || isFocused.value || cancelFocus)
|
|
21
|
-
return;
|
|
22
|
-
isFocused.value = true;
|
|
23
|
-
emit("focus", event);
|
|
24
|
-
afterFocus == null ? void 0 : afterFocus();
|
|
25
|
-
};
|
|
26
|
-
const handleBlur = (event) => {
|
|
27
|
-
var _a;
|
|
28
|
-
const cancelBlur = isFunction(beforeBlur) ? beforeBlur(event) : false;
|
|
29
|
-
if (unref(disabled) || event.relatedTarget && ((_a = wrapperRef.value) == null ? void 0 : _a.contains(event.relatedTarget)) || cancelBlur)
|
|
30
|
-
return;
|
|
31
|
-
isFocused.value = false;
|
|
32
|
-
emit("blur", event);
|
|
33
|
-
afterBlur == null ? void 0 : afterBlur();
|
|
34
|
-
};
|
|
35
|
-
const handleClick = (event) => {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
if (unref(disabled) || isFocusable(event.target) || ((_a = wrapperRef.value) == null ? void 0 : _a.contains(document.activeElement)) && wrapperRef.value !== document.activeElement)
|
|
38
|
-
return;
|
|
39
|
-
(_b = target.value) == null ? void 0 : _b.focus();
|
|
40
|
-
};
|
|
41
|
-
watch([wrapperRef, () => unref(disabled)], ([el, disabled2]) => {
|
|
42
|
-
if (!el)
|
|
43
|
-
return;
|
|
44
|
-
if (disabled2) {
|
|
45
|
-
el.removeAttribute("tabindex");
|
|
46
|
-
} else {
|
|
47
|
-
el.setAttribute("tabindex", "-1");
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
useEventListener(wrapperRef, "focus", handleFocus, true);
|
|
51
|
-
useEventListener(wrapperRef, "blur", handleBlur, true);
|
|
52
|
-
useEventListener(wrapperRef, "click", handleClick, true);
|
|
53
|
-
if (process.env.NODE_ENV === "test") {
|
|
54
|
-
onMounted(() => {
|
|
55
|
-
const targetEl = isElement(target.value) ? target.value : document.querySelector("input,textarea");
|
|
56
|
-
if (targetEl) {
|
|
57
|
-
useEventListener(targetEl, "focus", handleFocus, true);
|
|
58
|
-
useEventListener(targetEl, "blur", handleBlur, true);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
isFocused,
|
|
64
|
-
wrapperRef,
|
|
65
|
-
handleFocus,
|
|
66
|
-
handleBlur
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
|
|
71
|
-
|
|
72
|
-
function useComposition({
|
|
73
|
-
afterComposition,
|
|
74
|
-
emit
|
|
75
|
-
}) {
|
|
76
|
-
const isComposing = ref(false);
|
|
77
|
-
const handleCompositionStart = (event) => {
|
|
78
|
-
emit == null ? void 0 : emit("compositionstart", event);
|
|
79
|
-
isComposing.value = true;
|
|
80
|
-
};
|
|
81
|
-
const handleCompositionUpdate = (event) => {
|
|
82
|
-
var _a;
|
|
83
|
-
emit == null ? void 0 : emit("compositionupdate", event);
|
|
84
|
-
const text = (_a = event.target) == null ? void 0 : _a.value;
|
|
85
|
-
const lastCharacter = text[text.length - 1] || "";
|
|
86
|
-
isComposing.value = !isKorean(lastCharacter);
|
|
87
|
-
};
|
|
88
|
-
const handleCompositionEnd = (event) => {
|
|
89
|
-
emit == null ? void 0 : emit("compositionend", event);
|
|
90
|
-
if (isComposing.value) {
|
|
91
|
-
isComposing.value = false;
|
|
92
|
-
nextTick(() => afterComposition(event));
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const handleComposition = (event) => {
|
|
96
|
-
event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
|
|
97
|
-
};
|
|
98
|
-
return {
|
|
99
|
-
isComposing,
|
|
100
|
-
handleComposition,
|
|
101
|
-
handleCompositionStart,
|
|
102
|
-
handleCompositionUpdate,
|
|
103
|
-
handleCompositionEnd
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { useComposition as a, useFocusController as u };
|