@opentiny/vue-renderless 3.19.5 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-select/index.js +11 -74
- package/base-select/vue.js +10 -10
- package/bulletin-board/index.js +5 -1
- package/bulletin-board/vue.js +5 -4
- package/button/index.js +11 -3
- package/button/vue.js +6 -2
- package/button-group/index.js +1 -1
- package/color-picker/index.js +4 -4
- package/color-picker/utils/color.js +358 -83
- package/color-picker/utils/hsv-to-rgb.js +59 -0
- package/color-picker/vue.js +27 -8
- package/color-select-panel/alpha-select/index.js +65 -14
- package/color-select-panel/alpha-select/vue.js +29 -44
- package/color-select-panel/hue-select/index.js +47 -61
- package/color-select-panel/hue-select/vue.js +29 -47
- package/color-select-panel/index.js +230 -80
- package/color-select-panel/sv-select/index.js +68 -0
- package/color-select-panel/sv-select/vue.js +32 -0
- package/color-select-panel/utils/color.js +345 -82
- package/color-select-panel/utils/getClientXY.js +54 -0
- package/color-select-panel/vue.js +48 -72
- package/common/deps/popper.js +1 -1
- package/common/deps/useUserAgent.js +16 -0
- package/common/event.js +21 -0
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/date-picker-mobile/index.js +4 -4
- package/dialog-box/index.js +1 -1
- package/dropdown/index.js +5 -1
- package/dropdown/vue.js +2 -2
- package/file-upload/vue.js +1 -0
- package/flowchart/index.js +3 -2
- package/form/index.js +2 -2
- package/form-item/index.js +4 -1
- package/grid-select/index.js +82 -0
- package/grid-select/vue.js +30 -0
- package/input/index.js +2 -2
- package/menu/vue.js +5 -1
- package/modal/index.js +2 -0
- package/numeric/index.js +29 -9
- package/option/index.js +6 -0
- package/option/vue.js +12 -2
- package/package.json +1 -1
- package/picker/index.js +1 -1
- package/recycle-scroller/index.js +43 -27
- package/recycle-scroller/vue.js +9 -4
- package/rich-text/index.js +13 -0
- package/rich-text/vue.js +4 -2
- package/select/index.js +71 -23
- package/select/vue.js +12 -4
- package/select-dropdown/vue.js +1 -1
- package/tabbar/index.js +4 -1
- package/tabbar/vue.js +1 -1
- package/tabs/index.js +8 -5
- package/tabs/vue.js +4 -1
- package/time-panel/vue.js +1 -1
- package/tooltip/vue.js +1 -0
- package/tree-menu/index.js +5 -1
- package/tree-node/index.js +5 -4
- package/tree-select/index.js +77 -1
- package/tree-select/vue.js +21 -7
- package/types/button.type.d.ts +7 -3
- package/types/color-select-panel.type.d.ts +23 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/numeric.type.d.ts +5 -5
- package/types/tree-menu.type.d.ts +1 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-26173587.d.ts → upload-list.type-1257e07a.d.ts} +4 -0
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +4 -0
- package/user-head/index.js +1 -1
- package/year-table/index.js +14 -29
- package/year-table/vue.js +17 -5
package/base-select/index.js
CHANGED
|
@@ -51,37 +51,6 @@ const showTip = ({ props, state, vm }) => (show) => {
|
|
|
51
51
|
state.showTip = show && overflow && !!state.tips && !state.visible;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
const gridOnQueryChange = ({ props, vm, constants, state }) => (value) => {
|
|
55
|
-
const { multiple, valueField, filterMethod, filterable, remote, remoteMethod } = props;
|
|
56
|
-
if (filterable && typeof filterMethod === "function") {
|
|
57
|
-
const table = vm.$refs.selectGrid.$refs.tinyTable;
|
|
58
|
-
const fullData = table.afterFullData;
|
|
59
|
-
vm.$refs.selectGrid.scrollTo(null, 0);
|
|
60
|
-
table.afterFullData = filterMethod(value, fullData) || [];
|
|
61
|
-
vm.$refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
62
|
-
state.previousQuery = value;
|
|
63
|
-
} else if (remote && typeof remoteMethod === "function") {
|
|
64
|
-
state.previousQuery = value;
|
|
65
|
-
remoteMethod(value, props.extraQueryParams).then((data) => {
|
|
66
|
-
if (multiple) {
|
|
67
|
-
const selectedIds = state.selected.map((sel) => sel[valueField]);
|
|
68
|
-
vm.$refs.selectGrid.clearSelection();
|
|
69
|
-
vm.$refs.selectGrid.setSelection(
|
|
70
|
-
data.filter((row) => ~selectedIds.indexOf(row[valueField])),
|
|
71
|
-
true
|
|
72
|
-
);
|
|
73
|
-
state.remoteData = data.filter((row) => !~selectedIds.indexOf(row[valueField])).concat(state.selected);
|
|
74
|
-
} else {
|
|
75
|
-
vm.$refs.selectGrid.clearRadioRow();
|
|
76
|
-
vm.$refs.selectGrid.setRadioRow(find(data, (item) => props.modelValue === item[props.valueField]));
|
|
77
|
-
state.remoteData = data;
|
|
78
|
-
}
|
|
79
|
-
vm.$refs.selectGrid.$refs.tinyTable.lastScrollTop = 0;
|
|
80
|
-
vm.$refs.selectGrid.loadData(data);
|
|
81
|
-
vm.$refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
54
|
const defaultOnQueryChange = ({ props, state, constants, api, nextTick }) => (value, isInput) => {
|
|
86
55
|
if (props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function")) {
|
|
87
56
|
state.hoverIndex = -1;
|
|
@@ -231,7 +200,7 @@ const getOptionOfSetSelected = ({ api, props }) => {
|
|
|
231
200
|
} else {
|
|
232
201
|
option.createdSelected = false;
|
|
233
202
|
}
|
|
234
|
-
if (!option.currentLabel) {
|
|
203
|
+
if (!option.state.currentLabel) {
|
|
235
204
|
api.clearNoMatchValue("");
|
|
236
205
|
}
|
|
237
206
|
return option;
|
|
@@ -252,6 +221,7 @@ const getResultOfSetSelected = ({ state, api, props }) => {
|
|
|
252
221
|
return result;
|
|
253
222
|
};
|
|
254
223
|
const setSelected = ({ api, nextTick, props, vm, state }) => () => {
|
|
224
|
+
var _a, _b, _c, _d;
|
|
255
225
|
if (!props.multiple) {
|
|
256
226
|
const option = getOptionOfSetSelected({ api, props });
|
|
257
227
|
state.selected = option;
|
|
@@ -260,10 +230,10 @@ const setSelected = ({ api, nextTick, props, vm, state }) => () => {
|
|
|
260
230
|
} else {
|
|
261
231
|
const result = getResultOfSetSelected({ state, props, api });
|
|
262
232
|
state.selectCls = result.length ? result.length === state.options.length ? "checked-sur" : "halfselect" : "check";
|
|
263
|
-
if (state.selected
|
|
233
|
+
if (!((_b = (_a = state.selected) == null ? void 0 : _a[0]) == null ? void 0 : _b.isTree) && !((_d = (_c = state.selected) == null ? void 0 : _c[0]) == null ? void 0 : _d.isGrid)) {
|
|
264
234
|
state.selected = result;
|
|
265
235
|
}
|
|
266
|
-
|
|
236
|
+
state.selected.length && (state.selectedLabel = "");
|
|
267
237
|
state.tips = state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join(",");
|
|
268
238
|
setFilteredSelectCls(nextTick, state, props);
|
|
269
239
|
nextTick(api.resetInputHeight);
|
|
@@ -879,9 +849,6 @@ const toVisible = ({ constants, state, props, vm, api, nextTick }) => () => {
|
|
|
879
849
|
if (vm.$refs.input && vm.$refs.input.value === "" && state.selected.length === 0) {
|
|
880
850
|
state.currentPlaceholder = state.cachedPlaceHolder;
|
|
881
851
|
}
|
|
882
|
-
if (vm.$refs.selectGrid) {
|
|
883
|
-
vm.$refs.selectGrid.clearScroll();
|
|
884
|
-
}
|
|
885
852
|
});
|
|
886
853
|
postOperOfToVisible({ props, state, constants });
|
|
887
854
|
};
|
|
@@ -906,25 +873,6 @@ const toHide = ({ constants, state, props, vm, api }) => () => {
|
|
|
906
873
|
}
|
|
907
874
|
}
|
|
908
875
|
}
|
|
909
|
-
if (vm.$refs.selectGrid) {
|
|
910
|
-
let { fullData } = vm.$refs.selectGrid.getTableData();
|
|
911
|
-
if (multiple) {
|
|
912
|
-
const selectedIds = state.selected.map((sel) => sel[valueField]);
|
|
913
|
-
vm.$refs.selectGrid.clearSelection();
|
|
914
|
-
vm.$refs.selectGrid.setSelection(
|
|
915
|
-
fullData.filter((row) => ~selectedIds.indexOf(row[valueField])),
|
|
916
|
-
true
|
|
917
|
-
);
|
|
918
|
-
} else {
|
|
919
|
-
vm.$refs.selectGrid.clearRadioRow();
|
|
920
|
-
vm.$refs.selectGrid.setRadioRow(find(fullData, (item) => props.modelValue === item[valueField]));
|
|
921
|
-
}
|
|
922
|
-
if (filterable && typeof props.filterMethod === "function") {
|
|
923
|
-
vm.$refs.selectGrid.handleTableData(true);
|
|
924
|
-
} else if (filterable && remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function")) {
|
|
925
|
-
vm.$refs.selectGrid.handleTableData();
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
876
|
};
|
|
929
877
|
const watchVisible = ({ api, constants, emit, state, vm, props }) => (value) => {
|
|
930
878
|
if ((props.filterable || props.remote) && !value) {
|
|
@@ -1007,17 +955,6 @@ const handleCopyClick = ({ parent, props, state }) => () => {
|
|
|
1007
955
|
document.execCommand("copy");
|
|
1008
956
|
parent.$el.removeChild(input);
|
|
1009
957
|
};
|
|
1010
|
-
const getcheckedData = ({ props, state }) => () => {
|
|
1011
|
-
const checkedKey = [];
|
|
1012
|
-
if (!Array.isArray(state.selected)) {
|
|
1013
|
-
return props.modelValue ? [props.modelValue] : [state.selected[props.valueField]];
|
|
1014
|
-
} else {
|
|
1015
|
-
state.selected.length > 0 && state.selected.forEach((item) => {
|
|
1016
|
-
checkedKey.push(item[props.valueField]);
|
|
1017
|
-
});
|
|
1018
|
-
return checkedKey;
|
|
1019
|
-
}
|
|
1020
|
-
};
|
|
1021
958
|
const debouncRquest = ({ api, state, props }) => debounce(props.delay, () => {
|
|
1022
959
|
if (props.filterable && state.query !== state.selectedLabel) {
|
|
1023
960
|
const isChange = false;
|
|
@@ -1177,20 +1114,17 @@ const initQuery = ({ props, state, constants, vm }) => ({ init } = {}) => {
|
|
|
1177
1114
|
return new Promise((resolve) => {
|
|
1178
1115
|
initData.then((selected2) => {
|
|
1179
1116
|
state.remoteData = selected2;
|
|
1180
|
-
vm.$refs.selectGrid.loadData(selected2);
|
|
1181
1117
|
resolve(selected2);
|
|
1182
1118
|
});
|
|
1183
1119
|
});
|
|
1184
1120
|
}
|
|
1185
1121
|
selected = initData;
|
|
1186
1122
|
state.remoteData = selected;
|
|
1187
|
-
vm.$refs.selectGrid.loadData(selected);
|
|
1188
1123
|
}
|
|
1189
1124
|
return Promise.resolve(selected);
|
|
1190
1125
|
};
|
|
1191
1126
|
const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
|
|
1192
1127
|
var _a;
|
|
1193
|
-
state.defaultCheckedKeys = state.gridCheckedData;
|
|
1194
1128
|
const parentEl = parent.$el;
|
|
1195
1129
|
const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]');
|
|
1196
1130
|
const inputClientRect = inputEl && inputEl.getBoundingClientRect() || {};
|
|
@@ -1198,7 +1132,7 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
|
|
|
1198
1132
|
document.activeElement.blur();
|
|
1199
1133
|
}
|
|
1200
1134
|
state.completed = true;
|
|
1201
|
-
const defaultSizeMap = {
|
|
1135
|
+
const defaultSizeMap = { medium: 40, default: 32, small: 28, mini: 24 };
|
|
1202
1136
|
const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
|
|
1203
1137
|
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
|
1204
1138
|
state.currentPlaceholder = "";
|
|
@@ -1362,10 +1296,13 @@ const watchShowClose = ({ nextTick, state, parent }) => () => {
|
|
|
1362
1296
|
const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]');
|
|
1363
1297
|
if (inputEl) {
|
|
1364
1298
|
const { paddingRight } = getComputedStyle(inputEl);
|
|
1365
|
-
|
|
1299
|
+
const COPY_ICON_WIDTH = 16;
|
|
1300
|
+
state.inputPaddingRight = parseFloat(paddingRight) + COPY_ICON_WIDTH;
|
|
1366
1301
|
}
|
|
1367
1302
|
});
|
|
1368
1303
|
};
|
|
1304
|
+
const computedShowTagText = ({ state }) => () => state.isDisplayOnly;
|
|
1305
|
+
const isTagClosable = () => (item) => !item.required;
|
|
1369
1306
|
const computedGetIcon = ({ designConfig, props }) => () => {
|
|
1370
1307
|
return props.dropdownIcon ? { icon: props.dropdownIcon } : {
|
|
1371
1308
|
icon: (designConfig == null ? void 0 : designConfig.icons.dropdownIcon) || "icon-delta-down",
|
|
@@ -1429,6 +1366,7 @@ export {
|
|
|
1429
1366
|
computedShowClose,
|
|
1430
1367
|
computedShowCopy,
|
|
1431
1368
|
computedShowNewOption,
|
|
1369
|
+
computedShowTagText,
|
|
1432
1370
|
computedTagsStyle,
|
|
1433
1371
|
debouncRquest,
|
|
1434
1372
|
defaultOnQueryChange,
|
|
@@ -1449,8 +1387,6 @@ export {
|
|
|
1449
1387
|
getSelectedOption,
|
|
1450
1388
|
getValueIndex,
|
|
1451
1389
|
getValueKey,
|
|
1452
|
-
getcheckedData,
|
|
1453
|
-
gridOnQueryChange,
|
|
1454
1390
|
handleBlur,
|
|
1455
1391
|
handleClearClick,
|
|
1456
1392
|
handleClose,
|
|
@@ -1467,6 +1403,7 @@ export {
|
|
|
1467
1403
|
hidePanel,
|
|
1468
1404
|
initQuery,
|
|
1469
1405
|
initValue,
|
|
1406
|
+
isTagClosable,
|
|
1470
1407
|
managePlaceholder,
|
|
1471
1408
|
mounted,
|
|
1472
1409
|
navigateOptions,
|
package/base-select/vue.js
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
debouncRquest,
|
|
7
7
|
getChildValue,
|
|
8
|
-
getcheckedData,
|
|
9
8
|
calcOverFlow,
|
|
10
9
|
toggleCheckAll,
|
|
11
10
|
handleCopyClick,
|
|
@@ -59,7 +58,6 @@ import {
|
|
|
59
58
|
onMouseenterNative,
|
|
60
59
|
onMouseleaveNative,
|
|
61
60
|
onCopying,
|
|
62
|
-
gridOnQueryChange,
|
|
63
61
|
defaultOnQueryChange,
|
|
64
62
|
queryChange,
|
|
65
63
|
toVisible,
|
|
@@ -100,7 +98,9 @@ import {
|
|
|
100
98
|
onClickCollapseTag,
|
|
101
99
|
computedIsExpand,
|
|
102
100
|
updateSelectedData,
|
|
103
|
-
hidePanel
|
|
101
|
+
hidePanel,
|
|
102
|
+
computedShowTagText,
|
|
103
|
+
isTagClosable
|
|
104
104
|
} from "./index";
|
|
105
105
|
import debounce from "../common/deps/debounce";
|
|
106
106
|
import { isNumber } from "../common/type";
|
|
@@ -156,7 +156,9 @@ const api = [
|
|
|
156
156
|
"clearSearchText",
|
|
157
157
|
"onClickCollapseTag",
|
|
158
158
|
"updateSelectedData",
|
|
159
|
-
"hidePanel"
|
|
159
|
+
"hidePanel",
|
|
160
|
+
"computedShowTagText",
|
|
161
|
+
"isTagClosable"
|
|
160
162
|
];
|
|
161
163
|
const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm, designConfig }) => {
|
|
162
164
|
const stateAdd = initStateAdd({ computed, props, api: api2, parent });
|
|
@@ -255,8 +257,6 @@ const initStateAdd = ({ computed, props, api: api2, parent }) => {
|
|
|
255
257
|
initialInputHeight: 0,
|
|
256
258
|
currentPlaceholder: props.placeholder,
|
|
257
259
|
filteredOptionsCount: 0,
|
|
258
|
-
gridData: [],
|
|
259
|
-
treeData: [],
|
|
260
260
|
remoteData: [],
|
|
261
261
|
currentKey: props.modelValue,
|
|
262
262
|
updateId: "",
|
|
@@ -267,12 +267,12 @@ const initStateAdd = ({ computed, props, api: api2, parent }) => {
|
|
|
267
267
|
formItemSize: computed(() => (parent.formItem || { state: {} }).state.formItemSize),
|
|
268
268
|
selectDisabled: computed(() => api2.computedSelectDisabled()),
|
|
269
269
|
isDisplayOnly: computed(() => props.displayOnly || (parent.form || {}).displayOnly),
|
|
270
|
-
|
|
270
|
+
isDisabled: computed(() => props.disabled || (parent.form || {}).disabled),
|
|
271
|
+
isShowTagText: computed(() => api2.computedShowTagText()),
|
|
271
272
|
searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
|
|
272
273
|
childrenName: computed(() => "children"),
|
|
273
274
|
tooltipContent: {},
|
|
274
275
|
isHidden: false,
|
|
275
|
-
defaultCheckedKeys: [],
|
|
276
276
|
optionIndexArr: [],
|
|
277
277
|
showCollapseTag: false,
|
|
278
278
|
exceedMaxVisibleRow: false,
|
|
@@ -314,7 +314,6 @@ const initApi = ({
|
|
|
314
314
|
showTip: showTip({ props, state, vm }),
|
|
315
315
|
onOptionDestroy: onOptionDestroy(state),
|
|
316
316
|
setSoftFocus: setSoftFocus({ vm, state }),
|
|
317
|
-
getcheckedData: getcheckedData({ props, state }),
|
|
318
317
|
resetInputWidth: resetInputWidth({ vm, state }),
|
|
319
318
|
resetHoverIndex: resetHoverIndex({ props, state }),
|
|
320
319
|
resetDatas: resetDatas({ props, state }),
|
|
@@ -334,7 +333,6 @@ const initApi = ({
|
|
|
334
333
|
onMouseenterNative: onMouseenterNative({ state }),
|
|
335
334
|
onMouseleaveNative: onMouseleaveNative({ state }),
|
|
336
335
|
onCopying: onCopying({ state, vm }),
|
|
337
|
-
gridOnQueryChange: gridOnQueryChange({ props, vm, constants, state }),
|
|
338
336
|
watchHoverIndex: watchHoverIndex({ state }),
|
|
339
337
|
computeOptimizeOpts: computeOptimizeOpts({ props, designConfig }),
|
|
340
338
|
computeCollapseTags: computeCollapseTags(props),
|
|
@@ -359,6 +357,8 @@ const initApi = ({
|
|
|
359
357
|
computedGetTagType: computedGetTagType({ designConfig, props }),
|
|
360
358
|
clearSearchText: clearSearchText({ state, api: api2 }),
|
|
361
359
|
clearNoMatchValue: clearNoMatchValue({ props, emit }),
|
|
360
|
+
computedShowTagText: computedShowTagText({ state }),
|
|
361
|
+
isTagClosable: isTagClosable(),
|
|
362
362
|
updateSelectedData: updateSelectedData({ state }),
|
|
363
363
|
hidePanel: hidePanel({ state })
|
|
364
364
|
});
|
package/bulletin-board/index.js
CHANGED
|
@@ -14,8 +14,12 @@ const computedMoreLink = ({ props }) => () => {
|
|
|
14
14
|
}
|
|
15
15
|
return props.moreLink;
|
|
16
16
|
};
|
|
17
|
+
const handleBulletinBoardClick = ({ emit }) => (item) => {
|
|
18
|
+
emit("contentClick", item);
|
|
19
|
+
};
|
|
17
20
|
export {
|
|
18
21
|
computedDataList,
|
|
19
22
|
computedMoreLink,
|
|
20
|
-
getRoute
|
|
23
|
+
getRoute,
|
|
24
|
+
handleBulletinBoardClick
|
|
21
25
|
};
|
package/bulletin-board/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { getRoute, computedDataList, computedMoreLink } from "./index";
|
|
3
|
-
const api = ["state", "getRoute"];
|
|
4
|
-
const renderless = (props, { reactive, computed, watch }) => {
|
|
2
|
+
import { getRoute, computedDataList, computedMoreLink, handleBulletinBoardClick } from "./index";
|
|
3
|
+
const api = ["state", "getRoute", "handleBulletinBoardClick"];
|
|
4
|
+
const renderless = (props, { reactive, computed, watch }, { emit }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const state = reactive({
|
|
7
7
|
actName: props.activeName,
|
|
@@ -19,7 +19,8 @@ const renderless = (props, { reactive, computed, watch }) => {
|
|
|
19
19
|
state,
|
|
20
20
|
getRoute,
|
|
21
21
|
computedDataList: computedDataList({ props, state }),
|
|
22
|
-
computedMoreLink: computedMoreLink({ props })
|
|
22
|
+
computedMoreLink: computedMoreLink({ props }),
|
|
23
|
+
handleBulletinBoardClick: handleBulletinBoardClick({ emit })
|
|
23
24
|
});
|
|
24
25
|
return api2;
|
|
25
26
|
};
|
package/button/index.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { xss } from "../common/xss";
|
|
3
|
-
const handleClick = ({ emit, props, state }) => (event) => {
|
|
3
|
+
const handleClick = ({ emit, props, state, designConfig }) => (event) => {
|
|
4
|
+
var _a, _b;
|
|
4
5
|
const urlHref = xss.filterUrl(props.href);
|
|
6
|
+
const DEFAULT_RESETTIME = 1e3;
|
|
7
|
+
let resetTime = DEFAULT_RESETTIME;
|
|
8
|
+
if (props.resetTime !== DEFAULT_RESETTIME) {
|
|
9
|
+
resetTime = props.resetTime;
|
|
10
|
+
} else {
|
|
11
|
+
resetTime = (_b = (_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.resetTime) != null ? _b : props.resetTime;
|
|
12
|
+
}
|
|
5
13
|
if (urlHref) {
|
|
6
14
|
location.href = urlHref;
|
|
7
|
-
} else if (props.nativeType === "button" &&
|
|
15
|
+
} else if (props.nativeType === "button" && resetTime > 0) {
|
|
8
16
|
state.disabled = true;
|
|
9
17
|
state.timer = window.setTimeout(() => {
|
|
10
18
|
state.disabled = false;
|
|
11
|
-
},
|
|
19
|
+
}, resetTime);
|
|
12
20
|
}
|
|
13
21
|
emit("click", event);
|
|
14
22
|
};
|
package/button/vue.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { handleClick, clearTimer } from "./index";
|
|
3
3
|
const api = ["state", "handleClick"];
|
|
4
|
-
const renderless = (props, { computed, onBeforeUnmount, reactive, watch, inject }, { emit, parent }) => {
|
|
4
|
+
const renderless = (props, { computed, onBeforeUnmount, reactive, watch, inject }, { emit, parent, designConfig }) => {
|
|
5
5
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
6
6
|
const state = reactive({
|
|
7
7
|
timer: 0,
|
|
8
8
|
disabled: props.disabled,
|
|
9
9
|
plain: computed(() => props.plain || (parent.buttonGroup || {}).plain),
|
|
10
|
+
round: computed(() => {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
return (_c = (_b = props.round) != null ? _b : (_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.round) != null ? _c : false;
|
|
13
|
+
}),
|
|
10
14
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
11
15
|
buttonDisabled: computed(
|
|
12
16
|
() => props.disabled || state.disabled || (parent.buttonGroup || {}).disabled || state.formDisabled
|
|
@@ -22,7 +26,7 @@ const renderless = (props, { computed, onBeforeUnmount, reactive, watch, inject
|
|
|
22
26
|
const api2 = {
|
|
23
27
|
state,
|
|
24
28
|
clearTimer: clearTimer(state),
|
|
25
|
-
handleClick: handleClick({ emit, props, state })
|
|
29
|
+
handleClick: handleClick({ emit, props, state, designConfig })
|
|
26
30
|
};
|
|
27
31
|
onBeforeUnmount(api2.clearTimer);
|
|
28
32
|
return api2;
|
package/button-group/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const handleChange = ({ emit, state }) => () => {
|
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
7
|
const handleClick = ({ emit, props, state }) => (node) => {
|
|
8
|
-
if (!state.disabled && !node.disabled) {
|
|
8
|
+
if (!state.disabled && !node.disabled && state.value !== node[props.valueField]) {
|
|
9
9
|
state.value = node[props.valueField];
|
|
10
10
|
emit("update:modelValue", state.value);
|
|
11
11
|
}
|
package/color-picker/index.js
CHANGED
|
@@ -7,15 +7,14 @@ const toggleVisible = (isShow) => {
|
|
|
7
7
|
isShow.value = val;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
const useEvent = (
|
|
10
|
+
const useEvent = (state, emit, changeVisible, color) => {
|
|
11
11
|
const onConfirm = (val) => {
|
|
12
|
-
|
|
12
|
+
color.fromString(val);
|
|
13
13
|
updateModelValue(val, emit);
|
|
14
14
|
emit("confirm", val);
|
|
15
15
|
changeVisible(false);
|
|
16
16
|
};
|
|
17
|
-
const onCancel = (
|
|
18
|
-
hex.value = color.value.hex;
|
|
17
|
+
const onCancel = () => {
|
|
19
18
|
changeVisible(false);
|
|
20
19
|
emit("cancel");
|
|
21
20
|
};
|
|
@@ -26,5 +25,6 @@ const useEvent = (hex, emit, changeVisible) => {
|
|
|
26
25
|
};
|
|
27
26
|
export {
|
|
28
27
|
toggleVisible,
|
|
28
|
+
updateModelValue,
|
|
29
29
|
useEvent
|
|
30
30
|
};
|