@opentiny/vue-renderless 3.8.3 → 3.9.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/action-sheet/index.js +1 -1
- package/action-sheet/vue.js +12 -12
- package/alert/index.js +2 -2
- package/alert/vue.js +3 -3
- package/anchor/index.js +40 -23
- package/anchor/vue.js +5 -2
- package/button-group/index.js +6 -0
- package/button-group/vue.js +10 -5
- package/carousel/index.js +18 -20
- package/carousel/vue.js +29 -5
- package/carousel-item/index.js +2 -1
- package/carousel-item/vue.js +14 -2
- package/cascader/index.js +110 -11
- package/cascader/vue.js +35 -12
- package/chart-heatmap/index.js +12 -12
- package/checkbox/index.js +19 -6
- package/checkbox/vue.js +38 -20
- package/common/bigInt.js +2 -1
- package/common/browser.js +43 -37
- package/common/deps/ResizeObserver.js +2 -2
- package/common/deps/popper.js +26 -24
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/common/validate/util.js +3 -2
- package/drawer/index.js +16 -1
- package/drawer/vue.js +14 -3
- package/dropdown-item/mf.js +1 -1
- package/dropdown-menu/index.js +3 -0
- package/dropdown-menu/vue.js +20 -2
- package/file-upload/index.js +0 -1
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +2 -2
- package/image/vue.js +12 -1
- package/input/index.js +15 -3
- package/input/vue.js +34 -8
- package/ip-address/index.js +4 -4
- package/month-table/index.js +5 -2
- package/numeric/index.js +6 -3
- package/numeric/vue.js +1 -1
- package/package.json +8 -1
- package/pager/vue.js +2 -2
- package/popconfirm/index.js +1 -0
- package/popconfirm/vue.js +4 -2
- package/popover/index.js +19 -12
- package/popover/vue.js +15 -5
- package/progress/index.js +44 -6
- package/progress/vue.js +15 -4
- package/radio/index.js +2 -0
- package/radio/vue.js +3 -0
- package/record/index.js +166 -59
- package/record/vue.js +31 -14
- package/roles/index.js +5 -5
- package/roles/vue.js +1 -1
- package/slider/index.js +3 -1
- package/steps/index.js +8 -0
- package/steps/vue.js +3 -2
- package/switch/vue.js +9 -2
- package/tabs-mf/vue-bar.js +1 -1
- package/text-popup/vue.js +2 -1
- package/time-line/index.js +8 -0
- package/time-line/vue.js +2 -1
- package/tooltip/index.js +35 -25
- package/tooltip/vue.js +1 -1
- package/tree/index.js +1 -1
- package/user-head/vue.js +8 -1
package/cascader/vue.js
CHANGED
|
@@ -29,7 +29,12 @@ import {
|
|
|
29
29
|
watchValue,
|
|
30
30
|
setInputHeightToTag,
|
|
31
31
|
presentTextHandler,
|
|
32
|
-
handleBeforeUpdate
|
|
32
|
+
handleBeforeUpdate,
|
|
33
|
+
showPlaceholder,
|
|
34
|
+
calcCollapseTags,
|
|
35
|
+
watchInputHover,
|
|
36
|
+
handleMouseenter,
|
|
37
|
+
handleMouseleave
|
|
33
38
|
} from "./index";
|
|
34
39
|
import { removeResizeListener } from "../common/deps/resize-event";
|
|
35
40
|
import userPopper from "../common/deps/vue-popper";
|
|
@@ -49,10 +54,13 @@ const api = [
|
|
|
49
54
|
"handleBlur",
|
|
50
55
|
"handleFocus",
|
|
51
56
|
"toggleDropDownVisible",
|
|
52
|
-
"handleKeyDown"
|
|
57
|
+
"handleKeyDown",
|
|
58
|
+
"handleMouseenter",
|
|
59
|
+
"handleMouseleave"
|
|
53
60
|
];
|
|
54
|
-
const initState = ({ reactive, props, computed, parent, api: api2,
|
|
61
|
+
const initState = ({ reactive, props, computed, parent, api: api2, t, constants, refs, inject }) => {
|
|
55
62
|
const state = reactive({
|
|
63
|
+
showAutoWidth: inject("showAutoWidth", null),
|
|
56
64
|
dropDownVisible: false,
|
|
57
65
|
checkedValue: props.modelValue || null,
|
|
58
66
|
inputHover: false,
|
|
@@ -66,9 +74,11 @@ const initState = ({ reactive, props, computed, parent, api: api2, refs, t, cons
|
|
|
66
74
|
pressDeleteCount: 0,
|
|
67
75
|
realSize: computed(() => props.size),
|
|
68
76
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
69
|
-
|
|
77
|
+
displayOnly: computed(() => props.displayOnly),
|
|
78
|
+
disabled: computed(() => props.disabled || state.isDisplayOnly || state.formDisabled),
|
|
70
79
|
tagSize: computed(() => ~["small", "mini"].indexOf(state.realSize) ? "mini" : "small"),
|
|
71
80
|
isDisabled: computed(() => state.disabled),
|
|
81
|
+
isDisplayOnly: computed(() => state.displayOnly || (parent.auiForm || {}).displayOnly),
|
|
72
82
|
config: computed(() => api2.getConfig()),
|
|
73
83
|
multiple: computed(() => state.config.multiple),
|
|
74
84
|
leafOnly: computed(() => !state.config.checkStrictly),
|
|
@@ -76,14 +86,17 @@ const initState = ({ reactive, props, computed, parent, api: api2, refs, t, cons
|
|
|
76
86
|
clearBtnVisible: computed(() => api2.computClearVisible()),
|
|
77
87
|
panel: computed(() => refs.panel),
|
|
78
88
|
placeholder: computed(() => props.placeholder || t(constants.placeholder)),
|
|
79
|
-
inputValues: computed(() => state.multiple ? state.presentText : state.inputValue)
|
|
89
|
+
inputValues: computed(() => state.multiple ? state.presentText : state.inputValue),
|
|
90
|
+
collapseTagsLength: 0,
|
|
91
|
+
isHidden: false,
|
|
92
|
+
tooltipVisible: false,
|
|
93
|
+
tooltipContent: ""
|
|
80
94
|
});
|
|
81
95
|
return state;
|
|
82
96
|
};
|
|
83
|
-
const initApi = ({ api: api2, state, constants, dispatch, emit, refs, props, updatePopper, nextTick, parent }) => {
|
|
97
|
+
const initApi = ({ api: api2, state, constants, dispatch, emit, refs, props, updatePopper, nextTick, parent, t }) => {
|
|
84
98
|
Object.assign(api2, {
|
|
85
99
|
state,
|
|
86
|
-
handleBlur: handleBlur({ constants, dispatch, emit, state }),
|
|
87
100
|
handleFocus: handleFocus(emit),
|
|
88
101
|
handleClear: handleClear(state),
|
|
89
102
|
getCheckedNodes: getCheckedNodes(state),
|
|
@@ -91,11 +104,12 @@ const initApi = ({ api: api2, state, constants, dispatch, emit, refs, props, upd
|
|
|
91
104
|
handleDropdownLeave: handleDropdownLeave(state),
|
|
92
105
|
focusFirstNode: focusFirstNode({ refs, state }),
|
|
93
106
|
computClearVisible: computClearVisible({ props, state }),
|
|
94
|
-
|
|
107
|
+
showPlaceholder: showPlaceholder({ props, state, t, constants }),
|
|
108
|
+
updateStyle: updateStyle({ parent, refs, state, updatePopper, nextTick, props }),
|
|
95
109
|
getSuggestions: getSuggestions({ nextTick, props, state, updatePopper }),
|
|
96
110
|
handleExpandChange: handleExpandChange({ constants, emit, dispatch, nextTick, state, updatePopper }),
|
|
97
111
|
getConfig: getConfig({ parent, props }),
|
|
98
|
-
setInputHeightToTag: setInputHeightToTag({ nextTick, parent }),
|
|
112
|
+
setInputHeightToTag: setInputHeightToTag({ nextTick, parent, state }),
|
|
99
113
|
handleSuggestionClick: handleSuggestionClick({ api: api2, state }),
|
|
100
114
|
handleDelete: handleDelete({ api: api2, state }),
|
|
101
115
|
computePresentText: computePresentText({ props, state }),
|
|
@@ -108,7 +122,12 @@ const initApi = ({ api: api2, state, constants, dispatch, emit, refs, props, upd
|
|
|
108
122
|
watchCheckedValue: watchCheckedValue({ api: api2, emit, state }),
|
|
109
123
|
toggleDropDownVisible: toggleDropDownVisible({ emit, nextTick, refs, state, updatePopper }),
|
|
110
124
|
selfMounted: selfMounted({ api: api2, parent, props, refs, state }),
|
|
111
|
-
handleBeforeUpdate: handleBeforeUpdate({ props, api: api2 })
|
|
125
|
+
handleBeforeUpdate: handleBeforeUpdate({ props, api: api2, state }),
|
|
126
|
+
handleBlur: handleBlur({ constants, dispatch, emit, state, api: api2, props }),
|
|
127
|
+
calcCollapseTags: calcCollapseTags({ refs, state, nextTick }),
|
|
128
|
+
watchInputHover: watchInputHover({ refs }),
|
|
129
|
+
handleMouseenter: handleMouseenter({ refs, state }),
|
|
130
|
+
handleMouseleave: handleMouseleave({ state })
|
|
112
131
|
});
|
|
113
132
|
};
|
|
114
133
|
const initWatch = ({ watch, state, api: api2, props, nextTick, updatePopper }) => {
|
|
@@ -143,6 +162,7 @@ const initWatch = ({ watch, state, api: api2, props, nextTick, updatePopper }) =
|
|
|
143
162
|
() => Array.isArray(state.checkedValue) && state.checkedValue.length,
|
|
144
163
|
() => setTimeout(() => updatePopper())
|
|
145
164
|
);
|
|
165
|
+
watch([() => state.inputHover, () => state.dropDownVisible], api2.watchInputHover);
|
|
146
166
|
};
|
|
147
167
|
const renderless = (props, { computed, onMounted, onBeforeUnmount, onDeactivated, onUpdated, onBeforeUpdate, reactive, toRefs, watch, inject }, { t, refs, emit, nextTick, constants, parent, slots, dispatch }) => {
|
|
148
168
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
@@ -166,12 +186,15 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, onDeactivated
|
|
|
166
186
|
onDeactivated
|
|
167
187
|
});
|
|
168
188
|
const api2 = {};
|
|
169
|
-
const state = initState({ reactive, props, computed, parent, api: api2,
|
|
170
|
-
initApi({ api: api2, state, constants, dispatch, emit, refs, props, updatePopper, nextTick, parent });
|
|
189
|
+
const state = initState({ reactive, props, computed, parent, api: api2, t, constants, refs, inject });
|
|
190
|
+
initApi({ api: api2, state, constants, dispatch, emit, refs, props, updatePopper, nextTick, parent, t });
|
|
171
191
|
initWatch({ watch, state, api: api2, props, nextTick, updatePopper });
|
|
172
192
|
onBeforeUpdate(api2.handleBeforeUpdate);
|
|
173
193
|
onUpdated(api2.updateStyle);
|
|
174
194
|
onMounted(api2.selfMounted);
|
|
195
|
+
parent.$on("handle-clear", (event) => {
|
|
196
|
+
api2.handleClear(event);
|
|
197
|
+
});
|
|
175
198
|
onBeforeUnmount(() => removeResizeListener(parent.$el, api2.updateStyle));
|
|
176
199
|
return api2;
|
|
177
200
|
};
|
package/chart-heatmap/index.js
CHANGED
|
@@ -92,26 +92,26 @@ const fixParam = ({ type, rows, dimension, metrics, extraMetrics, chartData, inn
|
|
|
92
92
|
return { chartData, innerXAxisList, innerYAxisList };
|
|
93
93
|
};
|
|
94
94
|
const getResult = (args) => {
|
|
95
|
-
let { type, options, pointSize, blurSize, res, key, v, bmap, mapOrigin, geo, beforeRegisterMap } = args;
|
|
95
|
+
let { type, options, pointSize, blurSize, res, key, v, url, bmap, mapOrigin, geo, beforeRegisterMap } = args;
|
|
96
96
|
let { echarts, specialAreas, position, positionJsonLink, beforeRegisterMapOnce } = args;
|
|
97
97
|
let { mapURLProfix, amap, tooltip, xAxis, yAxis } = args;
|
|
98
98
|
if (type === "bmap") {
|
|
99
99
|
Object.assign(options.series[0], { coordinateSystem: "bmap", pointSize, blurSize });
|
|
100
|
-
res = getBmap(key, v).then(() => __spreadValues({ bmap }, options));
|
|
100
|
+
res = getBmap({ key, version: v, url }).then(() => __spreadValues({ bmap }, options));
|
|
101
101
|
} else if (type === "map") {
|
|
102
102
|
options.series[0].coordinateSystem = "geo";
|
|
103
|
-
let
|
|
104
|
-
if (
|
|
105
|
-
const geoAttr = __spreadValues({ map:
|
|
106
|
-
beforeRegisterMap && (
|
|
107
|
-
echarts.registerMap(
|
|
103
|
+
let jsonStr = JSON.stringify(mapOrigin);
|
|
104
|
+
if (jsonStr) {
|
|
105
|
+
const geoAttr = __spreadValues({ map: jsonStr }, geo);
|
|
106
|
+
beforeRegisterMap && (jsonStr = beforeRegisterMap(mapOrigin));
|
|
107
|
+
echarts.registerMap(jsonStr, { geoJSON: mapOrigin }, specialAreas);
|
|
108
108
|
res = new Promise((resolve) => resolve(__spreadValues({ geo: geoAttr }, options)));
|
|
109
109
|
} else {
|
|
110
110
|
let params = { position, positionJsonLink, beforeRegisterMapOnce, mapURLProfix };
|
|
111
|
-
res = getMapJSON(params).then((
|
|
111
|
+
res = getMapJSON(params).then((json) => {
|
|
112
112
|
const geoAttr = __spreadValues({ map: position }, geo);
|
|
113
|
-
beforeRegisterMap && (
|
|
114
|
-
echarts.registerMap(position,
|
|
113
|
+
beforeRegisterMap && (json = beforeRegisterMap(json));
|
|
114
|
+
echarts.registerMap(position, { geoJSON: json }, specialAreas);
|
|
115
115
|
return __spreadValues({ geo: geoAttr }, options);
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -126,7 +126,7 @@ const getResult = (args) => {
|
|
|
126
126
|
const heatmap = (columns, rows, settings, extra) => {
|
|
127
127
|
const { type = "cartesian" } = settings;
|
|
128
128
|
const { dimension = [columns[0], columns[1]] } = settings;
|
|
129
|
-
const { dataType = "normal", min, max, digit, bmap, amap, geo, key, v = "2.0" } = settings;
|
|
129
|
+
const { dataType = "normal", min, max, digit, bmap, amap, geo, key, v = "2.0", url } = settings;
|
|
130
130
|
const { position, mapOrigin, positionJsonLink, beforeRegisterMap, pointSize = 10, blurSize = 5 } = settings;
|
|
131
131
|
const { heatColor, yAxisName, xAxisName, beforeRegisterMapOnce, specialAreas = {} } = settings;
|
|
132
132
|
const { metrics = columns[2], mapURLProfix = "https://unpkg.com/echarts@3.6.2/map/json/" } = settings;
|
|
@@ -150,7 +150,7 @@ const heatmap = (columns, rows, settings, extra) => {
|
|
|
150
150
|
const tooltip = tooltipVisible && getTooltip(tooltipParams);
|
|
151
151
|
const options = { visualMap, series, grid: { left: 25, right: 80, width: "auto", height: "auto" } };
|
|
152
152
|
let res;
|
|
153
|
-
let args = { type, options, pointSize, blurSize, res, key, v, bmap, mapOrigin, geo, beforeRegisterMap };
|
|
153
|
+
let args = { type, options, pointSize, blurSize, res, key, v, url, bmap, mapOrigin, geo, beforeRegisterMap };
|
|
154
154
|
Object.assign(args, { echarts, specialAreas, position, positionJsonLink, beforeRegisterMapOnce });
|
|
155
155
|
Object.assign(args, { mapURLProfix, amap, tooltip, xAxis, yAxis });
|
|
156
156
|
res = getResult(args);
|
package/checkbox/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { isNull } from "../common/type";
|
|
2
3
|
const addToStore = ({ state, props }) => () => {
|
|
3
4
|
if (Array.isArray(state.model) && !state.model.includes(props.label)) {
|
|
4
5
|
state.model.push(props.label);
|
|
@@ -6,15 +7,24 @@ const addToStore = ({ state, props }) => () => {
|
|
|
6
7
|
state.model = props.trueLabel || true;
|
|
7
8
|
}
|
|
8
9
|
};
|
|
10
|
+
const removeFromStore = ({ state, props }) => () => {
|
|
11
|
+
if (Array.isArray(state.model)) {
|
|
12
|
+
const index = state.model.indexOf(props.label);
|
|
13
|
+
index !== -1 && state.model.splice(index, 1);
|
|
14
|
+
} else {
|
|
15
|
+
state.model = props.falseLabel !== void 0 && props.falseLabel;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
9
18
|
const handleChange = ({ state, props, emit, nextTick, dispatch, constants }) => (event) => {
|
|
10
19
|
if (state.isLimitExceeded) {
|
|
11
20
|
return;
|
|
12
21
|
}
|
|
13
22
|
let moduleValue;
|
|
23
|
+
const { trueLabel, falseLabel } = props;
|
|
14
24
|
if (event.target.checked) {
|
|
15
|
-
moduleValue =
|
|
25
|
+
moduleValue = trueLabel === void 0 ? true : trueLabel;
|
|
16
26
|
} else {
|
|
17
|
-
moduleValue =
|
|
27
|
+
moduleValue = falseLabel === void 0 ? false : falseLabel;
|
|
18
28
|
}
|
|
19
29
|
emit("change", moduleValue, event);
|
|
20
30
|
nextTick(() => {
|
|
@@ -23,7 +33,7 @@ const handleChange = ({ state, props, emit, nextTick, dispatch, constants }) =>
|
|
|
23
33
|
};
|
|
24
34
|
const computedGetModelGet = ({ state, props }) => () => {
|
|
25
35
|
const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
|
|
26
|
-
return
|
|
36
|
+
return isNull(model) ? [] : model;
|
|
27
37
|
};
|
|
28
38
|
const computedGetModelSet = ({ state, dispatch, emit, constants }) => (value) => {
|
|
29
39
|
if (state.isGroup) {
|
|
@@ -41,7 +51,7 @@ const computedIsChecked = ({ state, props }) => () => {
|
|
|
41
51
|
return state.model;
|
|
42
52
|
} else if (Array.isArray(state.model)) {
|
|
43
53
|
return state.model.includes(props.label);
|
|
44
|
-
} else if (state.model
|
|
54
|
+
} else if (!isNull(state.model)) {
|
|
45
55
|
return state.model === props.trueLabel;
|
|
46
56
|
}
|
|
47
57
|
};
|
|
@@ -62,7 +72,7 @@ const computedIsLimitDisabled = (state) => () => {
|
|
|
62
72
|
const { max, min } = state.checkboxGroup;
|
|
63
73
|
return !!(max || min) && state.model.length >= max && !state.isChecked || state.model.length <= min && state.isChecked;
|
|
64
74
|
};
|
|
65
|
-
const computedIsDisabled = ({ state, props }) => () => (state.isGroup ? state.checkboxGroup.disabled || props.disabled || state.isLimitDisabled : props.disabled) || state.formDisabled;
|
|
75
|
+
const computedIsDisabled = ({ state, props }) => () => (state.isGroup ? state.checkboxGroup.disabled || state.checkboxGroup.displayOnly || props.disabled || props.displayOnly || state.isLimitDisabled : props.disabled) || state.formDisabled;
|
|
66
76
|
const computedFormItemSize = (props) => () => (props.formItem || {}).formItemSize;
|
|
67
77
|
const computedCheckboxSize = ({ state, props, formItemSize }) => () => {
|
|
68
78
|
const tempCheckboxSize = props.size || formItemSize.value;
|
|
@@ -75,7 +85,9 @@ const mounted = ({ props, emit, api, parent }) => () => {
|
|
|
75
85
|
};
|
|
76
86
|
const toggleEvent = ({ parent, props, type }) => {
|
|
77
87
|
const inputEl = parent.$el;
|
|
78
|
-
|
|
88
|
+
for (let ev in props.events) {
|
|
89
|
+
inputEl[type + "EventListener"](ev, props.events[ev]);
|
|
90
|
+
}
|
|
79
91
|
};
|
|
80
92
|
const dispatchDisplayedValue = ({ state, api, dispatch }) => () => {
|
|
81
93
|
if (state.isDisplayOnly) {
|
|
@@ -111,5 +123,6 @@ export {
|
|
|
111
123
|
getDisplayedValue,
|
|
112
124
|
handleChange,
|
|
113
125
|
mounted,
|
|
126
|
+
removeFromStore,
|
|
114
127
|
toggleEvent
|
|
115
128
|
};
|
package/checkbox/vue.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
__spreadProps,
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../chunk-PKUHTIDK.js";
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
5
2
|
import {
|
|
6
3
|
addToStore,
|
|
4
|
+
removeFromStore,
|
|
7
5
|
handleChange,
|
|
8
6
|
computedGetModelGet,
|
|
9
7
|
computedGetModelSet,
|
|
@@ -12,20 +10,23 @@ import {
|
|
|
12
10
|
computedStore,
|
|
13
11
|
computedIsLimitDisabled,
|
|
14
12
|
computedIsDisabled,
|
|
13
|
+
computedIsDisplayOnly,
|
|
14
|
+
computedIsGroupDisplayOnly,
|
|
15
15
|
computedFormItemSize,
|
|
16
16
|
computedCheckboxSize,
|
|
17
17
|
mounted,
|
|
18
18
|
toggleEvent,
|
|
19
19
|
dispatchDisplayedValue,
|
|
20
|
-
getDisplayedValue
|
|
21
|
-
computedIsDisplayOnly,
|
|
22
|
-
computedIsGroupDisplayOnly
|
|
20
|
+
getDisplayedValue
|
|
23
21
|
} from "./index";
|
|
24
|
-
const api = ["state", "handleChange"];
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const api = ["state", "handleChange", "computedStore"];
|
|
23
|
+
const initState = ({ reactive, computed, parent, api: api2, inject, props }) => {
|
|
24
|
+
const state = reactive({
|
|
25
|
+
size: props.size || inject("size", null),
|
|
26
|
+
vertical: inject("vertical", null),
|
|
27
|
+
focus: false,
|
|
28
|
+
selfModel: false,
|
|
29
|
+
isLimitExceeded: false,
|
|
29
30
|
store: computed(() => api2.computedStore()),
|
|
30
31
|
isGroup: computed(() => api2.computedIsGroup()),
|
|
31
32
|
isChecked: computed(() => api2.computedIsChecked()),
|
|
@@ -36,11 +37,18 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
36
37
|
formDisplayOnly: computed(() => (parent.tinyForm || {}).displayOnly),
|
|
37
38
|
isDisplayOnly: computed(() => api2.computedIsDisplayOnly()),
|
|
38
39
|
isGroupDisplayOnly: computed(() => api2.computedIsGroupDisplayOnly()),
|
|
39
|
-
model: computed({
|
|
40
|
-
|
|
40
|
+
model: computed({
|
|
41
|
+
get: () => api2.computedGetModelGet(),
|
|
42
|
+
set: (value) => api2.computedGetModelSet(value)
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
return state;
|
|
46
|
+
};
|
|
47
|
+
const initApi = ({ vm, api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick }) => {
|
|
41
48
|
Object.assign(api2, {
|
|
42
49
|
state,
|
|
43
50
|
addToStore: addToStore({ state, props }),
|
|
51
|
+
removeFromStore: removeFromStore({ state, props }),
|
|
44
52
|
computedStore: computedStore({ state, props }),
|
|
45
53
|
computedFormItemSize: computedFormItemSize(props),
|
|
46
54
|
computedIsChecked: computedIsChecked({ state, props }),
|
|
@@ -50,21 +58,31 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
50
58
|
computedIsGroupDisplayOnly: computedIsGroupDisplayOnly({ state }),
|
|
51
59
|
computedGetModelGet: computedGetModelGet({ state, props }),
|
|
52
60
|
computedIsGroup: computedIsGroup({ state, parent, constants }),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const formItemSize = computed(() => api2.computedFormItemSize());
|
|
56
|
-
api2.computedCheckboxSize = computedCheckboxSize({ state, props, formItemSize });
|
|
57
|
-
Object.assign(api2, {
|
|
61
|
+
computedCheckboxSize: computedCheckboxSize({ state, props, formItemSize }),
|
|
62
|
+
computedGetModelSet: computedGetModelSet({ state, dispatch, emit, constants }),
|
|
58
63
|
mounted: mounted({ emit, props, api: api2, parent }),
|
|
59
|
-
handleChange: handleChange({ state, props, emit, nextTick, dispatch
|
|
64
|
+
handleChange: handleChange({ state, props, emit, nextTick, dispatch, constants }),
|
|
60
65
|
dispatchDisplayedValue: dispatchDisplayedValue({ state, api: api2, dispatch }),
|
|
61
66
|
getDisplayedValue: getDisplayedValue({ state, props, vm })
|
|
62
67
|
});
|
|
68
|
+
};
|
|
69
|
+
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch, inject }, { vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
70
|
+
const api2 = { dispatch };
|
|
71
|
+
const formItemSize = computed(() => api2.computedFormItemSize());
|
|
72
|
+
const state = initState({ reactive, computed, parent, api: api2, inject, props });
|
|
73
|
+
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
74
|
+
initApi({ vm, api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick });
|
|
63
75
|
watch(
|
|
64
76
|
() => props.modelValue,
|
|
65
77
|
(value) => props.validateEvent && api2.dispatch(constants.FORM_ITEM, constants.FORM_CHANGE, value)
|
|
66
78
|
);
|
|
67
79
|
watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
|
|
80
|
+
watch(
|
|
81
|
+
() => props.checked,
|
|
82
|
+
(value) => {
|
|
83
|
+
value ? api2.addToStore() : api2.removeFromStore();
|
|
84
|
+
}
|
|
85
|
+
);
|
|
68
86
|
onBeforeUnmount(() => {
|
|
69
87
|
toggleEvent({ parent, props, type: "remove" });
|
|
70
88
|
});
|
package/common/bigInt.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { fillChar } from "./string";
|
|
3
|
-
|
|
3
|
+
import { isBrowser } from "./browser";
|
|
4
|
+
const BigInt = isBrowser ? window.BigInt : global.BigInt;
|
|
4
5
|
function supportBigInt() {
|
|
5
6
|
return typeof BigInt === "function";
|
|
6
7
|
}
|
package/common/browser.js
CHANGED
|
@@ -22,52 +22,58 @@ const isEdge = (browser) => {
|
|
|
22
22
|
browser.edge = true;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
|
|
25
26
|
var browser_default = (() => {
|
|
26
|
-
const isMobile = /(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent);
|
|
27
27
|
const browser = {
|
|
28
28
|
name: void 0,
|
|
29
29
|
version: void 0,
|
|
30
30
|
isDoc: typeof document !== "undefined",
|
|
31
|
-
isMobile,
|
|
32
|
-
isPC:
|
|
31
|
+
isMobile: false,
|
|
32
|
+
isPC: true,
|
|
33
33
|
isNode: typeof window === "undefined"
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
browser.
|
|
38
|
-
browser.
|
|
39
|
-
matches
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
browser
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
if (isBrowser) {
|
|
36
|
+
const isMobile = /(Android|webOS|iPhone|iPad|iPod|SymbianOS|BlackBerry|Windows Phone)/.test(navigator.userAgent);
|
|
37
|
+
browser.isMobile = isMobile;
|
|
38
|
+
browser.isPC = !isMobile;
|
|
39
|
+
let matches;
|
|
40
|
+
if (!!window.chrome && (!!window.chrome.webstore || /^Google\b/.test(window.navigator.vendor))) {
|
|
41
|
+
browser.name = "chrome";
|
|
42
|
+
browser.chrome = true;
|
|
43
|
+
matches = navigator.userAgent.match(/chrome\/(\d+)/i);
|
|
44
|
+
browser.version = !!matches && !!matches[1] && parseInt(matches[1], 10);
|
|
45
|
+
matches = void 0;
|
|
46
|
+
} else if (!!document.all || !!document.documentMode) {
|
|
47
|
+
browser.name = "ie";
|
|
48
|
+
browser.version = getIEVersion();
|
|
49
|
+
browser.ie = true;
|
|
50
|
+
} else if (typeof window.InstallTrigger !== "undefined") {
|
|
51
|
+
browser.name = "firefox";
|
|
52
|
+
browser.firefox = true;
|
|
53
|
+
} else if (Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0) {
|
|
54
|
+
browser.name = "safari";
|
|
55
|
+
browser.safari = true;
|
|
56
|
+
} else if (!!window.opr && !!window.opr.addons || !!window.opera) {
|
|
57
|
+
browser.name = "opera";
|
|
58
|
+
browser.opera = true;
|
|
59
|
+
}
|
|
60
|
+
isEdge(browser);
|
|
61
|
+
if (!~["ie", "chrome"].indexOf(browser.name)) {
|
|
62
|
+
const reg = browser.name + "/(\\d+)";
|
|
63
|
+
matches = navigator.userAgent.match(new RegExp(reg, "i"));
|
|
64
|
+
browser.version = !!matches && !!matches[1] && parseInt(matches[1], 10);
|
|
65
|
+
matches = void 0;
|
|
66
|
+
}
|
|
67
|
+
if (browser.isDoc) {
|
|
68
|
+
const bodyEl = document.body || document.documentElement;
|
|
69
|
+
["webkit", "khtml", "moz", "ms", "o"].forEach((core) => {
|
|
70
|
+
browser["-" + core] = !!bodyEl[core + "MatchesSelector"];
|
|
71
|
+
});
|
|
72
|
+
}
|
|
68
73
|
}
|
|
69
74
|
return browser;
|
|
70
75
|
})();
|
|
71
76
|
export {
|
|
72
|
-
browser_default as default
|
|
77
|
+
browser_default as default,
|
|
78
|
+
isBrowser
|
|
73
79
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../chunk-PKUHTIDK.js";
|
|
2
2
|
import { on, off } from "./dom";
|
|
3
|
+
import { isBrowser } from "../browser";
|
|
3
4
|
const MapShim = function() {
|
|
4
5
|
if (typeof Map !== "undefined") {
|
|
5
6
|
return Map;
|
|
@@ -64,8 +65,7 @@ const MapShim = function() {
|
|
|
64
65
|
return obClass;
|
|
65
66
|
}();
|
|
66
67
|
}();
|
|
67
|
-
const func = window.Function;
|
|
68
|
-
const isBrowser = window !== "undefined" && document !== "undefined" && window.document === document;
|
|
68
|
+
const func = isBrowser ? window.Function : global.Function;
|
|
69
69
|
const global$1 = function() {
|
|
70
70
|
const isMath = (val) => val.Math === Math;
|
|
71
71
|
if (typeof global !== "undefined" && isMath(global)) {
|
package/common/deps/popper.js
CHANGED
|
@@ -5,7 +5,6 @@ import { on, off } from "./dom";
|
|
|
5
5
|
import PopupManager from "./popup-manager";
|
|
6
6
|
import { typeOf } from "../type";
|
|
7
7
|
import { xss } from "../xss";
|
|
8
|
-
const win = window;
|
|
9
8
|
const positions = ["left", "right", "top", "bottom"];
|
|
10
9
|
const modifiers = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"];
|
|
11
10
|
const DEFAULTS = {
|
|
@@ -35,7 +34,7 @@ const setStyle = (el, styles) => {
|
|
|
35
34
|
};
|
|
36
35
|
const getSupportedPropertyName = (property) => {
|
|
37
36
|
let prefixes = ["", "ms", "webkit", "moz", "o"];
|
|
38
|
-
let bodyEl =
|
|
37
|
+
let bodyEl = window.document.body;
|
|
39
38
|
for (let i = 0; i < prefixes.length; i++) {
|
|
40
39
|
let toCheck = prefixes[i] ? prefixes[i] + property.charAt(0).toUpperCase() + property.slice(1) : property;
|
|
41
40
|
if (typeof bodyEl.style[toCheck] !== "undefined") {
|
|
@@ -57,23 +56,26 @@ const addAttributes = (el, attributes) => {
|
|
|
57
56
|
};
|
|
58
57
|
const getOffsetParent = (el) => {
|
|
59
58
|
let offsetParent = el.offsetParent;
|
|
60
|
-
return offsetParent ===
|
|
59
|
+
return offsetParent === window.document.body || !offsetParent ? window.document.documentElement : offsetParent;
|
|
61
60
|
};
|
|
62
61
|
const getStyleComputedProperty = (el, property) => {
|
|
63
62
|
if (!el || el.nodeType !== 1) {
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
|
-
let css =
|
|
65
|
+
let css = window.getComputedStyle(el, null);
|
|
67
66
|
return css[property];
|
|
68
67
|
};
|
|
69
|
-
const isFixed = (el) => {
|
|
70
|
-
if (el ===
|
|
68
|
+
const isFixed = (el, offsetParent) => {
|
|
69
|
+
if (el === window.document.body) {
|
|
71
70
|
return false;
|
|
72
71
|
}
|
|
73
72
|
if (getStyleComputedProperty(el, "position") === "fixed") {
|
|
74
73
|
return true;
|
|
75
74
|
}
|
|
76
|
-
|
|
75
|
+
if (el === offsetParent) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
return el.parentNode ? isFixed(el.parentNode, offsetParent) : false;
|
|
77
79
|
};
|
|
78
80
|
const getBoundingClientRect = (el) => {
|
|
79
81
|
let rectObj = el.getBoundingClientRect();
|
|
@@ -97,11 +99,11 @@ const getScrollParent = (el) => {
|
|
|
97
99
|
if (!parent) {
|
|
98
100
|
return el;
|
|
99
101
|
}
|
|
100
|
-
if (parent ===
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
102
|
+
if (parent === window.document) {
|
|
103
|
+
if (window.document.body.scrollTop || window.document.body.scrollLeft) {
|
|
104
|
+
return window.document.body;
|
|
103
105
|
}
|
|
104
|
-
return
|
|
106
|
+
return window.document.documentElement;
|
|
105
107
|
}
|
|
106
108
|
if (isScrollElement(parent)) {
|
|
107
109
|
return parent;
|
|
@@ -140,7 +142,7 @@ const getOuterSizes = (el) => {
|
|
|
140
142
|
let _visibility = el.style.visibility;
|
|
141
143
|
el.style.display = "block";
|
|
142
144
|
el.style.visibility = "hidden";
|
|
143
|
-
let styles =
|
|
145
|
+
let styles = window.getComputedStyle(el);
|
|
144
146
|
let x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
145
147
|
let y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
|
|
146
148
|
let result = { width: el.offsetWidth + y, height: el.offsetHeight + x };
|
|
@@ -253,12 +255,12 @@ Popper.prototype.parse = function(config) {
|
|
|
253
255
|
classNames: ["popper"],
|
|
254
256
|
content: "",
|
|
255
257
|
contentType: "text",
|
|
256
|
-
parent:
|
|
258
|
+
parent: window.document.body,
|
|
257
259
|
tagName: "div"
|
|
258
260
|
};
|
|
259
261
|
config = __spreadValues(__spreadValues({}, defaultConfig), config);
|
|
260
262
|
const { tagName, classNames, attributes, contentType, content, arrowTagName } = config;
|
|
261
|
-
let docEl =
|
|
263
|
+
let docEl = window.document;
|
|
262
264
|
let popper = docEl.createElement(tagName);
|
|
263
265
|
addClassNames(popper, classNames);
|
|
264
266
|
addAttributes(popper, attributes);
|
|
@@ -291,11 +293,11 @@ Popper.prototype.parse = function(config) {
|
|
|
291
293
|
return popper;
|
|
292
294
|
};
|
|
293
295
|
Popper.prototype._getPosition = function(popper, reference) {
|
|
294
|
-
let
|
|
296
|
+
let offsetParent = getOffsetParent(reference);
|
|
295
297
|
if (this._options.forceAbsolute) {
|
|
296
298
|
return "absolute";
|
|
297
299
|
}
|
|
298
|
-
let isParentFixed = isFixed(reference,
|
|
300
|
+
let isParentFixed = isFixed(reference, offsetParent);
|
|
299
301
|
return isParentFixed ? "fixed" : "absolute";
|
|
300
302
|
};
|
|
301
303
|
Popper.prototype._getOffsets = function(popper, reference, placement) {
|
|
@@ -329,11 +331,11 @@ Popper.prototype._getOffsets = function(popper, reference, placement) {
|
|
|
329
331
|
};
|
|
330
332
|
Popper.prototype._setupEventListeners = function() {
|
|
331
333
|
this.state.updateBound = this.update.bind(this);
|
|
332
|
-
on(
|
|
334
|
+
on(window, "resize", this.state.updateBound);
|
|
333
335
|
if (this._options.boundariesElement !== "window") {
|
|
334
336
|
let target = getScrollParent(this._reference);
|
|
335
|
-
if (target ===
|
|
336
|
-
target =
|
|
337
|
+
if (target === window.document.body || target === window.document.documentElement) {
|
|
338
|
+
target = window;
|
|
337
339
|
}
|
|
338
340
|
this.state.scrollTarget = target;
|
|
339
341
|
if (this._options.bubbling || PopupManager.globalScroll) {
|
|
@@ -348,7 +350,7 @@ Popper.prototype._setupEventListeners = function() {
|
|
|
348
350
|
}
|
|
349
351
|
};
|
|
350
352
|
Popper.prototype._removeEventListeners = function() {
|
|
351
|
-
off(
|
|
353
|
+
off(window, "resize", this.state.updateBound);
|
|
352
354
|
if (this._options.boundariesElement !== "window" && this.state.scrollTarget) {
|
|
353
355
|
off(this.state.scrollTarget, "scroll", this.state.updateBound);
|
|
354
356
|
this.state.scrollTarget = null;
|
|
@@ -365,8 +367,8 @@ Popper.prototype._removeEventListeners = function() {
|
|
|
365
367
|
Popper.prototype._getBoundaries = function(data, padding, boundariesElement) {
|
|
366
368
|
let boundaries = {};
|
|
367
369
|
if (boundariesElement === "window") {
|
|
368
|
-
let body =
|
|
369
|
-
let html =
|
|
370
|
+
let body = window.document.body;
|
|
371
|
+
let html = window.document.documentElement;
|
|
370
372
|
let { width, height } = getMaxWH(body, html);
|
|
371
373
|
boundaries = { top: 0, right: width, bottom: height, left: 0 };
|
|
372
374
|
} else if (boundariesElement === "viewport") {
|
|
@@ -378,8 +380,8 @@ Popper.prototype._getBoundaries = function(data, padding, boundariesElement) {
|
|
|
378
380
|
let scrollLeft = isFixed2 ? 0 : getScrollLeftValue(scrollParent);
|
|
379
381
|
boundaries = {
|
|
380
382
|
top: 0 - (offsetParentRect.top - scrollTop),
|
|
381
|
-
right:
|
|
382
|
-
bottom:
|
|
383
|
+
right: window.document.documentElement.clientWidth - (offsetParentRect.left - scrollLeft),
|
|
384
|
+
bottom: window.document.documentElement.clientHeight - (offsetParentRect.top - scrollTop),
|
|
383
385
|
left: 0 - (offsetParentRect.left - scrollLeft)
|
|
384
386
|
};
|
|
385
387
|
} else {
|
package/common/index.js
CHANGED
package/common/runtime.js
CHANGED