@opentiny/vue-renderless 3.17.6 → 3.18.0-beta.1
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/README.md +12 -3
- package/action-menu/index.js +2 -2
- package/action-menu/vue.js +2 -2
- package/anchor/index.js +11 -4
- package/autocomplete/index.js +20 -14
- package/autocomplete/vue.js +36 -9
- package/badge/index.js +4 -3
- package/base-select/index.js +3 -3
- package/breadcrumb-item/vue.js +1 -1
- package/button-group/index.js +6 -1
- package/carousel-item/index.js +1 -1
- package/checkbox/index.js +1 -1
- package/collapse-item/index.js +7 -1
- package/collapse-item/vue.js +12 -2
- package/color-picker/index.js +20 -32
- package/color-picker/vue.js +31 -54
- package/color-select-panel/index.js +8 -5
- package/color-select-panel/vue.js +1 -2
- package/common/deps/clickoutside.js +10 -3
- package/common/deps/dom.js +9 -1
- package/common/deps/tree-model/tree-store.js +13 -2
- package/common/deps/useRelation.js +24 -7
- package/common/deps/useWindowSize.js +23 -0
- package/common/form/const.js +10 -0
- package/common/index.js +1 -1
- package/common/prop-util.js +43 -0
- package/common/runtime.js +1 -1
- package/common/xss.js +2 -2
- package/crop/index.js +14 -22
- package/crop/vue.js +33 -29
- package/date-panel/index.js +13 -2
- package/date-panel/vue.js +16 -10
- package/dialog-box/index.js +1 -1
- package/dialog-select/index.js +40 -13
- package/dialog-select/vue.js +3 -3
- package/drawer/index.js +13 -0
- package/drawer/vue.js +4 -3
- package/dropdown-item/index.js +2 -2
- package/dropdown-item/mf.js +1 -1
- package/dropdown-item/vue.js +9 -6
- package/dropdown-menu/index.js +3 -0
- package/dropdown-menu/vue.js +5 -3
- package/fall-menu/index.js +4 -0
- package/fall-menu/vue.js +15 -2
- package/file-upload/index.js +4 -4
- package/filter-box/vue.js +5 -2
- package/fluent-editor/index.js +10 -3
- package/fluent-editor/options.js +93 -27
- package/fluent-editor/vue.js +8 -8
- package/form/index.js +7 -4
- package/form/vue.js +1 -1
- package/form-item/index.js +6 -1
- package/form-item/vue.js +3 -1
- package/grid/utils/dom.js +3 -1
- package/guide/index.js +21 -6
- package/input/index.js +17 -1
- package/input/vue.js +19 -8
- package/ip-address/index.js +0 -10
- package/ip-address/vue.js +2 -5
- package/load-list/index.js +43 -0
- package/load-list/vue.js +69 -0
- package/milestone/index.js +55 -8
- package/milestone/vue.js +16 -3
- package/modal/index.js +6 -6
- package/modal/vue.js +4 -3
- package/nav-menu/index.js +7 -3
- package/option/index.js +0 -15
- package/option/vue.js +2 -13
- package/package.json +7 -7
- package/pager/index.js +25 -0
- package/pager/vue.js +18 -4
- package/pager-item/index.js +4 -7
- package/picker/index.js +27 -7
- package/picker/vue.js +2 -1
- package/pop-upload/index.js +13 -4
- package/pop-upload/vue.js +4 -0
- package/popeditor/index.js +14 -2
- package/popeditor/vue.js +9 -5
- package/rich-text-editor/vue.js +9 -3
- package/select/index.js +12 -11
- package/select/vue.js +14 -5
- package/slider/index.js +2 -2
- package/slider-button/index.js +8 -3
- package/slider-button/vue.js +6 -2
- package/slider-button-group/index.js +46 -9
- package/slider-button-group/vue.js +40 -18
- package/split/vue.js +4 -2
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/tab-item-mf/vue.js +6 -1
- package/tabs-mf/index.js +58 -3
- package/tabs-mf/vue-bar.js +0 -6
- package/tabs-mf/vue-swipe.js +20 -0
- package/tabs-mf/vue.js +22 -4
- package/time/index.js +6 -1
- package/time/vue.js +8 -2
- package/time-line/index.js +1 -1
- package/time-line-new/index.js +53 -0
- package/time-line-new/vue.js +41 -0
- package/time-range/vue.js +4 -1
- package/time-spinner/index.js +4 -1
- package/time-spinner/vue.js +2 -2
- package/tooltip/vue.js +16 -3
- package/transfer-panel/vue.js +7 -6
- package/tree/index.js +18 -7
- package/tree/vue.js +14 -7
- package/tree-node/index.js +2 -2
- package/tree-node/vue.js +6 -2
- package/tree-select/index.js +6 -6
- package/tree-select/vue.js +1 -1
- package/types/action-menu.type.d.ts +1 -1
- package/types/alert.type.d.ts +2 -0
- package/types/autocomplete.type.d.ts +17 -13
- package/types/badge.type.d.ts +1 -1
- package/types/button-group.type.d.ts +3 -0
- package/types/button.type.d.ts +21 -0
- package/types/checkbox.type.d.ts +1 -0
- package/types/date-picker.type.d.ts +3 -0
- package/types/drawer.type.d.ts +5 -1
- package/types/{dropdown-item.type-678794c9.d.ts → dropdown-item.type-c9badbc1.d.ts} +6 -2
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +4 -0
- package/types/fall-menu.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-33aa784a.d.ts → form.type-f6fb4c38.d.ts} +5 -0
- package/types/form.type.d.ts +1 -1
- package/types/input.type.d.ts +12 -2
- package/types/link.type.d.ts +6 -1
- package/types/load-list.type.d.ts +58 -0
- package/types/milestone.type.d.ts +27 -1
- package/types/modal.type.d.ts +3 -2
- package/types/pager.type.d.ts +5 -1
- package/types/picker.type.d.ts +3 -0
- package/types/popover.type.d.ts +1 -1
- package/types/search.type.d.ts +4 -0
- package/types/steps.type.d.ts +1 -0
- package/types/tag.type.d.ts +1 -0
- package/types/tooltip.type.d.ts +3 -0
- package/types/transfer.type.d.ts +3 -3
- package/types/tree-menu.type.d.ts +4 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-02a1effb.d.ts → upload-list.type-26173587.d.ts} +17 -3
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/upload-list/vue.js +7 -7
- package/virtual-scroll-box/index.js +294 -0
- package/virtual-scroll-box/vue.js +43 -0
- package/virtual-tree/index.js +168 -0
- package/virtual-tree/vue.js +53 -0
- package/LICENSE +0 -22
package/README.md
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
# @opentiny/vue-renderless
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Provides a rendering-free logic layer for the `TinyVue` component.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## You can customize the global configuration of some components
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Modify the popup window starting level (z-index)
|
|
8
|
+
|
|
9
|
+
Add the following code to the entry file `main.js`:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import PopupManager from '@opentiny/vue-renderless/common/deps/popup-manager'
|
|
13
|
+
|
|
14
|
+
// Set the starting level to 3000
|
|
15
|
+
PopupManager.zIndex = 3000
|
|
16
|
+
```
|
package/action-menu/index.js
CHANGED
|
@@ -9,14 +9,14 @@ const computedMaxShowNum = ({ props, state }) => () => {
|
|
|
9
9
|
return 2;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
const computedSpacing = ({ props, state }) => () => {
|
|
12
|
+
const computedSpacing = ({ props, state, designConfig }) => () => {
|
|
13
13
|
if (props.spacing !== void 0) {
|
|
14
14
|
return String(props.spacing).includes("px") ? props.spacing : props.spacing + "px";
|
|
15
15
|
}
|
|
16
16
|
if (state.isCardMode) {
|
|
17
17
|
return "10px";
|
|
18
18
|
} else {
|
|
19
|
-
return "
|
|
19
|
+
return (designConfig == null ? void 0 : designConfig.props.spacing) || "8px";
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const computedMoreText = ({ props, state, t }) => () => {
|
package/action-menu/vue.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
computedSuffixIcon
|
|
10
10
|
} from "./index";
|
|
11
11
|
const api = ["state", "handleMoreClick", "handleItemClick", "visibleChange"];
|
|
12
|
-
const renderless = (props, { computed, reactive }, { emit, t }) => {
|
|
12
|
+
const renderless = (props, { computed, reactive }, { emit, t, designConfig }) => {
|
|
13
13
|
const api2 = {};
|
|
14
14
|
const state = reactive({
|
|
15
15
|
visibleOptions: computed(() => props.options.slice(0, state.maxShowNum)),
|
|
@@ -26,7 +26,7 @@ const renderless = (props, { computed, reactive }, { emit, t }) => {
|
|
|
26
26
|
handleItemClick: handleItemClick(emit),
|
|
27
27
|
visibleChange: visibleChange(emit),
|
|
28
28
|
computedMaxShowNum: computedMaxShowNum({ props, state }),
|
|
29
|
-
computedSpacing: computedSpacing({ props, state }),
|
|
29
|
+
computedSpacing: computedSpacing({ props, state, designConfig }),
|
|
30
30
|
computedMoreText: computedMoreText({ props, state, t }),
|
|
31
31
|
computedSuffixIcon: computedSuffixIcon({ props, state })
|
|
32
32
|
});
|
package/anchor/index.js
CHANGED
|
@@ -87,11 +87,14 @@ const handleScroll = (state) => () => {
|
|
|
87
87
|
state.scrollTimer = window.setTimeout(() => {
|
|
88
88
|
state.isScroll = false;
|
|
89
89
|
clearTimeout(state.scrollTimer);
|
|
90
|
-
},
|
|
90
|
+
}, 200);
|
|
91
91
|
};
|
|
92
92
|
const setChildOffsetTop = ({ state, props }) => {
|
|
93
|
-
var _a;
|
|
94
|
-
|
|
93
|
+
var _a, _b;
|
|
94
|
+
if (!((_a = props.links) == null ? void 0 : _a.length)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
state.offsetTop = ((_b = document.querySelector(props.links[0].link)) == null ? void 0 : _b.offsetTop) || 0;
|
|
95
98
|
};
|
|
96
99
|
const getContainer = ({ props }) => () => props.containerId && document.querySelector(props.containerId) || document.body;
|
|
97
100
|
const mounted = ({ state, api, props, nextTick }) => () => {
|
|
@@ -131,6 +134,10 @@ const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
|
131
134
|
updateSkidPosition({ vm, state, emit });
|
|
132
135
|
return;
|
|
133
136
|
}
|
|
137
|
+
if (state.isScroll) {
|
|
138
|
+
api.handleScroll();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
134
141
|
for (let key in state.observerLinks) {
|
|
135
142
|
if (Object.prototype.hasOwnProperty.call(state.observerLinks, key)) {
|
|
136
143
|
const item = state.observerLinks[key];
|
|
@@ -146,7 +153,7 @@ const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
|
146
153
|
}
|
|
147
154
|
}
|
|
148
155
|
},
|
|
149
|
-
{ root: scrollContainer, threshold: [0] }
|
|
156
|
+
{ root: scrollContainer, threshold: [0, 0.25, 0.5, 1] }
|
|
150
157
|
);
|
|
151
158
|
addObserver({ props, state });
|
|
152
159
|
};
|
package/autocomplete/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { FORM_ITEM, FORM_EVENT } from "../common/form/const";
|
|
2
3
|
const getData = ({
|
|
3
4
|
props,
|
|
4
5
|
state,
|
|
@@ -28,11 +29,15 @@ const handleChange = ({
|
|
|
28
29
|
api,
|
|
29
30
|
emit,
|
|
30
31
|
state,
|
|
31
|
-
props
|
|
32
|
+
props,
|
|
33
|
+
dispatch
|
|
32
34
|
}) => (value) => {
|
|
33
35
|
state.activated = true;
|
|
34
36
|
emit("update:modelValue", value);
|
|
35
37
|
state.suggestionDisabled = false;
|
|
38
|
+
if (state.validateEvent) {
|
|
39
|
+
dispatch(FORM_ITEM, FORM_EVENT.change, [value]);
|
|
40
|
+
}
|
|
36
41
|
if (!props.triggerOnFocus && !value) {
|
|
37
42
|
state.suggestionDisabled = true;
|
|
38
43
|
state.suggestions = [];
|
|
@@ -55,9 +60,12 @@ const handleFocus = ({
|
|
|
55
60
|
api.debouncedGetData(props.modelValue);
|
|
56
61
|
}
|
|
57
62
|
};
|
|
58
|
-
const handleBlur = ({ emit, state }) => (
|
|
63
|
+
const handleBlur = ({ emit, state, dispatch, props }) => () => {
|
|
59
64
|
state.suggestionDisabled = true;
|
|
60
|
-
emit("blur"
|
|
65
|
+
emit("blur");
|
|
66
|
+
if (state.validateEvent) {
|
|
67
|
+
dispatch(FORM_ITEM, FORM_EVENT.blur, [props.modelValue]);
|
|
68
|
+
}
|
|
61
69
|
};
|
|
62
70
|
const handleClear = ({ emit, state }) => () => {
|
|
63
71
|
state.activated = false;
|
|
@@ -91,21 +99,22 @@ const select = ({
|
|
|
91
99
|
emit,
|
|
92
100
|
nextTick,
|
|
93
101
|
props,
|
|
94
|
-
state
|
|
102
|
+
state,
|
|
103
|
+
dispatch
|
|
95
104
|
}) => (item) => {
|
|
96
|
-
|
|
105
|
+
const value = item[props.valueKey];
|
|
106
|
+
emit("update:modelValue", value);
|
|
97
107
|
emit("select", item);
|
|
108
|
+
if (state.validateEvent) {
|
|
109
|
+
dispatch(FORM_ITEM, FORM_EVENT.change, [value]);
|
|
110
|
+
}
|
|
98
111
|
nextTick(() => {
|
|
99
112
|
state.activated = false;
|
|
100
113
|
state.suggestions = [];
|
|
101
114
|
state.highlightedIndex = -1;
|
|
102
115
|
});
|
|
103
116
|
};
|
|
104
|
-
const highlight = ({
|
|
105
|
-
constants,
|
|
106
|
-
vm,
|
|
107
|
-
state
|
|
108
|
-
}) => (index) => {
|
|
117
|
+
const highlight = ({ constants, vm, state }) => (index) => {
|
|
109
118
|
if (!state.suggestionVisible || state.loading) {
|
|
110
119
|
return;
|
|
111
120
|
}
|
|
@@ -136,10 +145,7 @@ const computedVisible = (state) => {
|
|
|
136
145
|
let isValidData = Array.isArray(suggestions) && suggestions.length > 0;
|
|
137
146
|
return (isValidData || state.loading) && state.activated;
|
|
138
147
|
};
|
|
139
|
-
const watchVisible = ({
|
|
140
|
-
suggestionState,
|
|
141
|
-
vm
|
|
142
|
-
}) => (val) => {
|
|
148
|
+
const watchVisible = ({ suggestionState, vm }) => (val) => {
|
|
143
149
|
let $input = vm.$refs.input.getInput();
|
|
144
150
|
if ($input) {
|
|
145
151
|
suggestionState.dropdownWidth = $input.offsetWidth + "px";
|
package/autocomplete/vue.js
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
} from "./index";
|
|
20
20
|
const api = [
|
|
21
21
|
"state",
|
|
22
|
-
"select",
|
|
23
22
|
"suggestionState",
|
|
24
23
|
"getInput",
|
|
25
24
|
"handleChange",
|
|
@@ -37,8 +36,10 @@ const initState = ({
|
|
|
37
36
|
reactive,
|
|
38
37
|
$prefix,
|
|
39
38
|
computed,
|
|
39
|
+
props,
|
|
40
40
|
inject
|
|
41
41
|
}) => {
|
|
42
|
+
var _a;
|
|
42
43
|
const state = reactive({
|
|
43
44
|
showAutoWidth: inject("showAutoWidth", null),
|
|
44
45
|
popperElm: null,
|
|
@@ -48,7 +49,9 @@ const initState = ({
|
|
|
48
49
|
highlightedIndex: -1,
|
|
49
50
|
suggestionDisabled: false,
|
|
50
51
|
id: $prefix + "-" + guid(),
|
|
51
|
-
suggestionVisible: computed(() => computedVisible(state))
|
|
52
|
+
suggestionVisible: computed(() => computedVisible(state)),
|
|
53
|
+
// props.validateEvent优先级大于inject,都没有配置默认为true
|
|
54
|
+
validateEvent: (_a = props.validateEvent) != null ? _a : inject("validateEvent", true)
|
|
52
55
|
});
|
|
53
56
|
return state;
|
|
54
57
|
};
|
|
@@ -67,7 +70,19 @@ const initSuggestionState = ({
|
|
|
67
70
|
referenceElm
|
|
68
71
|
});
|
|
69
72
|
};
|
|
70
|
-
const initApi = ({
|
|
73
|
+
const initApi = ({
|
|
74
|
+
api: api2,
|
|
75
|
+
state,
|
|
76
|
+
doDestroy,
|
|
77
|
+
suggestionState,
|
|
78
|
+
emit,
|
|
79
|
+
vm,
|
|
80
|
+
props,
|
|
81
|
+
updatePopper,
|
|
82
|
+
nextTick,
|
|
83
|
+
constants,
|
|
84
|
+
dispatch
|
|
85
|
+
}) => {
|
|
71
86
|
api2.getData = getData({ props, state, updatePopper, nextTick });
|
|
72
87
|
Object.assign(api2, {
|
|
73
88
|
state,
|
|
@@ -75,13 +90,13 @@ const initApi = ({ api: api2, state, doDestroy, suggestionState, emit, vm, props
|
|
|
75
90
|
suggestionState,
|
|
76
91
|
close: close(state),
|
|
77
92
|
open: open(api2),
|
|
78
|
-
handleBlur: handleBlur({ emit, state }),
|
|
93
|
+
handleBlur: handleBlur({ emit, state, dispatch, props }),
|
|
79
94
|
mounted: mounted({ vm, state, suggestionState }),
|
|
80
95
|
highlight: highlight({ constants, vm, state }),
|
|
81
96
|
handleClear: handleClear({ emit, state }),
|
|
82
|
-
select: select({ emit, nextTick, props, state }),
|
|
97
|
+
select: select({ emit, nextTick, props, state, dispatch }),
|
|
83
98
|
watchVisible: watchVisible({ suggestionState, vm }),
|
|
84
|
-
handleChange: handleChange({ api: api2, emit, state, props }),
|
|
99
|
+
handleChange: handleChange({ api: api2, emit, state, props, dispatch }),
|
|
85
100
|
handleFocus: handleFocus({ api: api2, emit, props, state }),
|
|
86
101
|
handleKeyEnter: handleKeyEnter({ api: api2, emit, nextTick, props, state }),
|
|
87
102
|
debouncedGetData: debounce(props.debounce, api2.getData)
|
|
@@ -96,9 +111,9 @@ const renderless = (props, {
|
|
|
96
111
|
toRefs,
|
|
97
112
|
onDeactivated,
|
|
98
113
|
inject
|
|
99
|
-
}, { $prefix, vm, parent, emit, constants, nextTick, slots }) => {
|
|
114
|
+
}, { $prefix, vm, parent, emit, constants, nextTick, slots, dispatch }) => {
|
|
100
115
|
const api2 = {};
|
|
101
|
-
const state = initState({ reactive, $prefix, computed, inject });
|
|
116
|
+
const state = initState({ reactive, $prefix, computed, props, inject });
|
|
102
117
|
const { showPopper, popperElm, referenceElm, doDestroy, updatePopper } = userPopper({
|
|
103
118
|
reactive,
|
|
104
119
|
watch,
|
|
@@ -112,7 +127,19 @@ const renderless = (props, {
|
|
|
112
127
|
onDeactivated
|
|
113
128
|
});
|
|
114
129
|
const suggestionState = initSuggestionState({ reactive, parent, showPopper, popperElm, referenceElm });
|
|
115
|
-
initApi({
|
|
130
|
+
initApi({
|
|
131
|
+
api: api2,
|
|
132
|
+
state,
|
|
133
|
+
doDestroy,
|
|
134
|
+
suggestionState,
|
|
135
|
+
emit,
|
|
136
|
+
vm,
|
|
137
|
+
props,
|
|
138
|
+
updatePopper,
|
|
139
|
+
nextTick,
|
|
140
|
+
constants,
|
|
141
|
+
dispatch
|
|
142
|
+
});
|
|
116
143
|
watch(() => state.suggestionVisible, api2.watchVisible);
|
|
117
144
|
onMounted(api2.mounted);
|
|
118
145
|
return api2;
|
package/badge/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const computedContent = ({ props, state }) => () => typeof
|
|
2
|
+
const computedContent = ({ props, state }) => () => (typeof props.value === "number" || typeof props.value === "string") && typeof props.max === "number" ? props.max < Number(state.valueRef) ? `${props.max}+` : state.valueRef : state.valueRef;
|
|
3
3
|
const computedValueRef = ({ props }) => () => {
|
|
4
|
-
if (typeof props.value === "number") {
|
|
4
|
+
if (typeof props.value === "number" || typeof props.value === "string") {
|
|
5
5
|
return props.value;
|
|
6
|
+
} else {
|
|
7
|
+
return void 0;
|
|
6
8
|
}
|
|
7
|
-
return typeof props.modelValue === "number" ? props.modelValue : void 0;
|
|
8
9
|
};
|
|
9
10
|
const computedTransform = ({ designConfig, props }) => () => {
|
|
10
11
|
if ((designConfig == null ? void 0 : designConfig.transform) === "unset") {
|
package/base-select/index.js
CHANGED
|
@@ -420,7 +420,7 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
|
|
|
420
420
|
if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
|
|
421
421
|
api.calcCollapseTags();
|
|
422
422
|
}
|
|
423
|
-
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || state.initialInputHeight ||
|
|
423
|
+
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || state.initialInputHeight || 32;
|
|
424
424
|
const noSelected = state.selected.length === 0;
|
|
425
425
|
const spacingHeight = designConfig ? (_a = designConfig.state) == null ? void 0 : _a.spacingHeight : constants.SPACING_HEIGHT;
|
|
426
426
|
if (!state.isDisplayOnly) {
|
|
@@ -1198,7 +1198,7 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
|
|
|
1198
1198
|
document.activeElement.blur();
|
|
1199
1199
|
}
|
|
1200
1200
|
state.completed = true;
|
|
1201
|
-
const defaultSizeMap = { default:
|
|
1201
|
+
const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 };
|
|
1202
1202
|
const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
|
|
1203
1203
|
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
|
1204
1204
|
state.currentPlaceholder = "";
|
|
@@ -1249,7 +1249,7 @@ const optmzApis = {
|
|
|
1249
1249
|
vm.$refs.scrollbar.$el.querySelectorAll(
|
|
1250
1250
|
'.tiny-recycle-scroller__slot, .tiny-recycle-scroller__item-view:not([style*="transform: translateY(-9999px) translateX(0px)"])'
|
|
1251
1251
|
)
|
|
1252
|
-
).map((item) => item.querySelector(`[data-tag="tiny-
|
|
1252
|
+
).map((item) => item.querySelector(`[data-tag="tiny-option"]:not(${querySelectKey})`)).filter((v) => v);
|
|
1253
1253
|
},
|
|
1254
1254
|
setScrollTop: ({ refs, state }) => {
|
|
1255
1255
|
const { optimizeStore } = state;
|
package/breadcrumb-item/vue.js
CHANGED
|
@@ -7,7 +7,7 @@ const renderless = (props, { reactive, inject, computed }, { refs, router, emit,
|
|
|
7
7
|
const constants = breadcrumb._constants;
|
|
8
8
|
const state = reactive({
|
|
9
9
|
size: inject("size", null),
|
|
10
|
-
separator: computed(() => breadcrumb.separator || (designConfig == null ? void 0 : designConfig.separator) || "
|
|
10
|
+
separator: computed(() => breadcrumb.separator || (designConfig == null ? void 0 : designConfig.separator) || "/")
|
|
11
11
|
});
|
|
12
12
|
const api2 = {
|
|
13
13
|
state,
|
package/button-group/index.js
CHANGED
|
@@ -23,7 +23,12 @@ const getItemClass = ({ props, state }) => (node) => {
|
|
|
23
23
|
if (state.disabled || node.disabled) {
|
|
24
24
|
return { disabled: true };
|
|
25
25
|
}
|
|
26
|
-
return props.plain ? {
|
|
26
|
+
return props.plain ? {
|
|
27
|
+
plain: props.plain,
|
|
28
|
+
medium: props.size === "medium",
|
|
29
|
+
small: props.size === "small",
|
|
30
|
+
mini: props.size === "mini"
|
|
31
|
+
} : {};
|
|
27
32
|
};
|
|
28
33
|
export {
|
|
29
34
|
getItemClass,
|
package/carousel-item/index.js
CHANGED
|
@@ -46,7 +46,7 @@ const translateItem = ({ api, CARD_SCALE, parent, state, carouselParent }) => ({
|
|
|
46
46
|
} else {
|
|
47
47
|
state.active = index === activeIndex;
|
|
48
48
|
if (length === 2 && !state.active) {
|
|
49
|
-
state.translate = vnode.type === TYPE_VERTICAL ?
|
|
49
|
+
state.translate = vnode.type === TYPE_VERTICAL ? parentHeight : parentWidth;
|
|
50
50
|
} else {
|
|
51
51
|
state.translate = vnode.type === TYPE_VERTICAL ? parentHeight * (index - activeIndex) : parentWidth * (index - activeIndex);
|
|
52
52
|
}
|
package/checkbox/index.js
CHANGED
|
@@ -111,7 +111,7 @@ const computedIsGroupDisplayOnly = ({ state }) => () => state.isGroup && (state.
|
|
|
111
111
|
const computedDisplayLabel = ({ state, props, t }) => () => {
|
|
112
112
|
state.showLabel = true;
|
|
113
113
|
if (props.trueLabel !== void 0 && props.falseLabel !== void 0) {
|
|
114
|
-
return props.modelValue
|
|
114
|
+
return props.modelValue;
|
|
115
115
|
} else {
|
|
116
116
|
return props.modelValue ? t("yes") : t("no");
|
|
117
117
|
}
|
package/collapse-item/index.js
CHANGED
|
@@ -23,6 +23,11 @@ const handleHeaderClick = ({
|
|
|
23
23
|
state.focusing = false;
|
|
24
24
|
state.isClick = true;
|
|
25
25
|
};
|
|
26
|
+
const handleHeaderContainerClick = ({ api }) => (e) => {
|
|
27
|
+
if (e.target === e.currentTarget) {
|
|
28
|
+
api.handleHeaderClick();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
26
31
|
const handleEnterClick = ({
|
|
27
32
|
componentName,
|
|
28
33
|
dispatch,
|
|
@@ -32,5 +37,6 @@ const handleEnterClick = ({
|
|
|
32
37
|
export {
|
|
33
38
|
handleEnterClick,
|
|
34
39
|
handleFocus,
|
|
35
|
-
handleHeaderClick
|
|
40
|
+
handleHeaderClick,
|
|
41
|
+
handleHeaderContainerClick
|
|
36
42
|
};
|
package/collapse-item/vue.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { handleFocus, handleEnterClick, handleHeaderClick } from "./index";
|
|
2
|
+
import { handleFocus, handleEnterClick, handleHeaderClick, handleHeaderContainerClick } from "./index";
|
|
3
3
|
import { guid } from "../common/string";
|
|
4
|
-
const api = [
|
|
4
|
+
const api = [
|
|
5
|
+
"state",
|
|
6
|
+
"isActive",
|
|
7
|
+
"handleFocus",
|
|
8
|
+
"handleEnterClick",
|
|
9
|
+
"handleHeaderClick",
|
|
10
|
+
"handleHeaderContainerClick"
|
|
11
|
+
];
|
|
5
12
|
const renderless = (props, { computed, reactive }, { parent, constants, dispatch, designConfig }) => {
|
|
6
13
|
var _a;
|
|
7
14
|
const _constants = parent.collapse._constants;
|
|
@@ -22,6 +29,9 @@ const renderless = (props, { computed, reactive }, { parent, constants, dispatch
|
|
|
22
29
|
handleEnterClick: handleEnterClick({ componentName, dispatch, eventName, parent }),
|
|
23
30
|
handleHeaderClick: handleHeaderClick({ componentName, dispatch, eventName, props, parent, state })
|
|
24
31
|
};
|
|
32
|
+
Object.assign(api2, {
|
|
33
|
+
handleHeaderContainerClick: handleHeaderContainerClick({ api: api2 })
|
|
34
|
+
});
|
|
25
35
|
return api2;
|
|
26
36
|
};
|
|
27
37
|
export {
|
package/color-picker/index.js
CHANGED
|
@@ -1,42 +1,30 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
tmpColor.reset(color.value.getHex());
|
|
5
|
-
triggerBg.value = pre.value;
|
|
6
|
-
isShow.value = false;
|
|
7
|
-
emit("cancel");
|
|
8
|
-
};
|
|
2
|
+
const updateModelValue = (val, emit) => {
|
|
3
|
+
emit("update:modelValue", val);
|
|
9
4
|
};
|
|
10
|
-
const
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
triggerBg.value = color;
|
|
14
|
-
hex.value = color;
|
|
15
|
-
isShow.value = false;
|
|
16
|
-
emit("confirm", color);
|
|
5
|
+
const toggleVisible = (isShow) => {
|
|
6
|
+
return (val) => {
|
|
7
|
+
isShow.value = val;
|
|
17
8
|
};
|
|
18
9
|
};
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
const useEvent = (hex, emit, changeVisible) => {
|
|
11
|
+
const onConfirm = (val) => {
|
|
12
|
+
hex.value = val;
|
|
13
|
+
updateModelValue(val, emit);
|
|
14
|
+
emit("confirm", val);
|
|
15
|
+
changeVisible(false);
|
|
23
16
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tmpColor.set({ s, v });
|
|
17
|
+
const onCancel = (color) => {
|
|
18
|
+
hex.value = color.value.hex;
|
|
19
|
+
changeVisible(false);
|
|
20
|
+
emit("cancel");
|
|
29
21
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
triggerBg.value = color.value.getHex();
|
|
22
|
+
return {
|
|
23
|
+
onConfirm,
|
|
24
|
+
onCancel
|
|
34
25
|
};
|
|
35
26
|
};
|
|
36
27
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onConfirm,
|
|
40
|
-
onHueUpdate,
|
|
41
|
-
onSVUpdate
|
|
28
|
+
toggleVisible,
|
|
29
|
+
useEvent
|
|
42
30
|
};
|
package/color-picker/vue.js
CHANGED
|
@@ -1,72 +1,49 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"onCancel",
|
|
13
|
-
"onAlphaUpdate",
|
|
14
|
-
"alpha"
|
|
15
|
-
];
|
|
16
|
-
const renderless = (props, context, { emit }) => {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
18
|
-
const { modelValue, visible, predefine, size, history } = context.toRefs(props);
|
|
19
|
-
const pre = context.ref((_a = modelValue.value) != null ? _a : "transparent");
|
|
20
|
-
const triggerBg = context.ref((_b = pre.value) != null ? _b : "transparent");
|
|
21
|
-
const tmpColor = new Color((_c = triggerBg.value) != null ? _c : "transparent");
|
|
22
|
-
const hex = context.ref((_d = modelValue.value) != null ? _d : "transparent");
|
|
23
|
-
const isShow = context.ref((_e = visible == null ? void 0 : visible.value) != null ? _e : false);
|
|
24
|
-
const changeVisible = (state2) => {
|
|
25
|
-
isShow.value = state2;
|
|
26
|
-
};
|
|
27
|
-
const stack = context.ref([...(_f = history == null ? void 0 : history.value) != null ? _f : []]);
|
|
28
|
-
const predefineStack = context.ref([...(_g = predefine == null ? void 0 : predefine.value) != null ? _g : []]);
|
|
29
|
-
const state = context.reactive({
|
|
30
|
-
isShow,
|
|
31
|
-
hex,
|
|
32
|
-
triggerBg,
|
|
33
|
-
defaultValue: modelValue,
|
|
34
|
-
stack,
|
|
35
|
-
predefineStack,
|
|
36
|
-
size: size != null ? size : ""
|
|
37
|
-
});
|
|
38
|
-
const api2 = {
|
|
39
|
-
state,
|
|
40
|
-
changeVisible,
|
|
41
|
-
onCancel: onCancel(tmpColor, triggerBg, isShow, pre, emit),
|
|
42
|
-
onConfirm: onConfirm(triggerBg, pre, hex, isShow, emit),
|
|
43
|
-
onHueUpdate: onHueUpdate(tmpColor, triggerBg),
|
|
44
|
-
onSVUpdate: onSVUpdate(tmpColor, triggerBg),
|
|
45
|
-
onColorUpdate: onColorUpdate(triggerBg)
|
|
46
|
-
};
|
|
47
|
-
context.watch(
|
|
2
|
+
import { toggleVisible, useEvent } from "./index";
|
|
3
|
+
const api = ["state", "changeVisible", "onConfirm", "onCancel", "onHueUpdate", "onSVUpdate", "onColorUpdate"];
|
|
4
|
+
const renderless = (props, ctx, { emit }) => {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
const { modelValue, visible, predefine, size, history } = ctx.toRefs(props);
|
|
7
|
+
const isShow = ctx.ref(visible.value);
|
|
8
|
+
const hex = ctx.ref((_a = modelValue.value) != null ? _a : "transparent");
|
|
9
|
+
const stack = ctx.ref([...(_b = history == null ? void 0 : history.value) != null ? _b : []]);
|
|
10
|
+
const predefineStack = ctx.ref([...(_c = predefine == null ? void 0 : predefine.value) != null ? _c : []]);
|
|
11
|
+
ctx.watch(
|
|
48
12
|
predefine,
|
|
49
13
|
(newPredefine) => {
|
|
50
14
|
predefineStack.value = [...newPredefine];
|
|
51
15
|
},
|
|
52
16
|
{ deep: true }
|
|
53
17
|
);
|
|
54
|
-
|
|
18
|
+
ctx.watch(
|
|
55
19
|
history,
|
|
56
20
|
(newHistory) => {
|
|
57
21
|
stack.value = [...newHistory];
|
|
58
22
|
},
|
|
59
23
|
{ deep: true }
|
|
60
24
|
);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
hex
|
|
64
|
-
|
|
65
|
-
|
|
25
|
+
const state = ctx.reactive({
|
|
26
|
+
isShow,
|
|
27
|
+
hex,
|
|
28
|
+
triggerBg: ctx.ref(modelValue.value),
|
|
29
|
+
size,
|
|
30
|
+
stack,
|
|
31
|
+
predefineStack
|
|
32
|
+
});
|
|
33
|
+
ctx.watch(props, () => {
|
|
34
|
+
hex.value = props.modelValue;
|
|
66
35
|
});
|
|
67
|
-
|
|
68
|
-
|
|
36
|
+
ctx.watch(hex, () => {
|
|
37
|
+
emit("update:modelValue", hex.value);
|
|
69
38
|
});
|
|
39
|
+
const changeVisible = toggleVisible(isShow);
|
|
40
|
+
const { onConfirm, onCancel } = useEvent(hex, emit, changeVisible);
|
|
41
|
+
const api2 = {
|
|
42
|
+
state,
|
|
43
|
+
changeVisible,
|
|
44
|
+
onConfirm,
|
|
45
|
+
onCancel
|
|
46
|
+
};
|
|
70
47
|
return api2;
|
|
71
48
|
};
|
|
72
49
|
export {
|
|
@@ -20,6 +20,7 @@ const onConfirm = (hex, pre, res, emit, stack, enableHistory, color) => {
|
|
|
20
20
|
}
|
|
21
21
|
color.value.setPrevH(color.value.get("h"));
|
|
22
22
|
emit("confirm", res.value);
|
|
23
|
+
emit("update:modelValue", res.value);
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
const onCancel = (res, pre, emit, isShow, hex, color) => {
|
|
@@ -33,31 +34,33 @@ const onCancel = (res, pre, emit, isShow, hex, color) => {
|
|
|
33
34
|
}));
|
|
34
35
|
emit("cancel", color);
|
|
35
36
|
}
|
|
37
|
+
emit("update:modelValue", hex.value);
|
|
36
38
|
};
|
|
37
39
|
};
|
|
38
|
-
const onColorUpdate = (color, res) => {
|
|
40
|
+
const onColorUpdate = (color, res, emit) => {
|
|
39
41
|
res.value = color.value.getHex();
|
|
42
|
+
emit("update:modelValue", res.value);
|
|
40
43
|
};
|
|
41
44
|
const onHSVUpdate = (color, res, hex, emit) => {
|
|
42
45
|
return {
|
|
43
46
|
onHueUpdate: (hue) => {
|
|
44
47
|
color.value.set({ h: hue });
|
|
45
|
-
onColorUpdate(color, res);
|
|
48
|
+
onColorUpdate(color, res, emit);
|
|
46
49
|
hex.value = color.value.getHex();
|
|
47
50
|
emit("hue-update", hue);
|
|
48
51
|
},
|
|
49
52
|
onSVUpdate: ({ s, v }) => {
|
|
50
53
|
hex.value = color.value.getHex();
|
|
51
|
-
onColorUpdate(color, res);
|
|
54
|
+
onColorUpdate(color, res, emit);
|
|
52
55
|
emit("sv-update", { s, v });
|
|
53
56
|
}
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
|
-
const onAlphaUpdate = (color, res) => {
|
|
59
|
+
const onAlphaUpdate = (color, res, emit) => {
|
|
57
60
|
return {
|
|
58
61
|
update: (alpha) => {
|
|
59
62
|
color.value.set({ a: alpha });
|
|
60
|
-
onColorUpdate(color, res);
|
|
63
|
+
onColorUpdate(color, res, emit);
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
66
|
};
|
|
@@ -58,7 +58,6 @@ const renderless = (props, context, { emit }) => {
|
|
|
58
58
|
{ deep: true }
|
|
59
59
|
);
|
|
60
60
|
context.watch(modelValue, (newValue) => {
|
|
61
|
-
pre.value = res.value;
|
|
62
61
|
hex.value = newValue;
|
|
63
62
|
res.value = newValue;
|
|
64
63
|
color.value.reset(newValue);
|
|
@@ -68,7 +67,7 @@ const renderless = (props, context, { emit }) => {
|
|
|
68
67
|
isShow.value = visible2;
|
|
69
68
|
});
|
|
70
69
|
const { onHueUpdate, onSVUpdate } = onHSVUpdate(color, res, hex, emit);
|
|
71
|
-
const { update } = onAlphaUpdate(color, res);
|
|
70
|
+
const { update } = onAlphaUpdate(color, res, emit);
|
|
72
71
|
const api2 = {
|
|
73
72
|
state,
|
|
74
73
|
changeVisible,
|