@opentiny/vue-renderless 3.13.2 → 3.14.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/action-sheet/index.js +20 -13
- package/action-sheet/vue.js +8 -7
- package/amount/index.js +100 -25
- package/amount/vue.js +102 -26
- package/anchor/index.js +1 -0
- package/area/index.js +8 -8
- package/area/vue.js +5 -5
- package/async-flowchart/index.js +16 -3
- package/autocomplete/index.js +58 -14
- package/autocomplete/vue.js +40 -12
- package/badge/index.js +12 -0
- package/badge/vue.js +6 -4
- package/breadcrumb/vue.js +3 -1
- package/breadcrumb-item/vue.js +6 -2
- package/button/index.js +5 -1
- package/calendar/index.js +2 -86
- package/calendar-bar/index.js +18 -4
- package/calendar-view/index.js +5 -1
- package/calendar-view/vue.js +16 -3
- package/card-group/vue.js +4 -2
- package/cascader/index.js +86 -34
- package/cascader/vue.js +61 -20
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +36 -23
- package/cascader-mobile/vue.js +6 -0
- package/cascader-node/index.js +13 -1
- package/cascader-node/vue.js +15 -4
- package/cascader-panel/index.js +1 -1
- package/cascader-select/column-index.js +150 -0
- package/cascader-select/column.js +120 -0
- package/cascader-select/index.js +29 -165
- package/cascader-select/usePicker.js +251 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +35 -47
- package/cell/vue.js +2 -1
- package/chart-bar/index.js +2 -3
- package/chart-core/deps/constants.js +43 -43
- package/chart-core/index.js +1 -1
- package/chart-gauge/index.js +2 -2
- package/chart-heatmap/index.js +17 -10
- package/chart-line/index.js +8 -9
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +4 -6
- package/checkbox/index.js +18 -1
- package/checkbox/vue.js +15 -7
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +1 -1
- package/collapse/index.js +3 -3
- package/color-select-panel/vue.js +0 -7
- package/column-list-item/index.js +17 -1
- package/column-list-item/vue.js +8 -3
- package/common/bigInt.js +2 -2
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/date-util.js +4 -2
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +44 -11
- package/common/deps/resize-event.js +1 -0
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +2 -2
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +38 -20
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +2 -2
- package/common/type.js +2 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/pattern.js +2 -2
- package/common/validate/rules/range.js +8 -5
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +5 -5
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/util.js +15 -16
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/currency/index.js +74 -7
- package/currency/vue.js +21 -5
- package/date-panel/index.js +16 -0
- package/date-panel/vue.js +8 -2
- package/date-picker-mobile/index.js +12 -0
- package/date-picker-mobile/vue.js +7 -1
- package/date-range/vue.js +15 -6
- package/date-table/index.js +35 -53
- package/date-table/vue.js +4 -2
- package/dialog-box/index.js +46 -14
- package/dialog-box/vue.js +30 -7
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +27 -5
- package/drawer/vue.js +14 -7
- package/dropdown/index.js +7 -7
- package/dropdown/vue.js +6 -2
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +6 -10
- package/dropdown-item/vue.js +20 -7
- package/dropdown-menu/index.js +20 -7
- package/dropdown-menu/vue.js +4 -3
- package/exception/index.js +2 -7
- package/exception/vue.js +7 -10
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +13 -2
- package/file-upload/index.js +68 -18
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floating-button/index.js +62 -16
- package/floating-button/vue.js +27 -9
- package/flowchart/index.js +134 -25
- package/flowchart/node.js +13 -4
- package/flowchart/vue.js +16 -4
- package/form/vue.js +8 -0
- package/form-item/index.js +5 -5
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/plugins/export.js +5 -2
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -1
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +81 -20
- package/input/vue.js +44 -18
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/link/vue.js +3 -1
- package/loading/index.js +2 -2
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/menu/index.js +15 -2
- package/menu/vue.js +22 -17
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/modal/index.js +44 -4
- package/modal/vue.js +18 -4
- package/multi-select/index.js +186 -11
- package/multi-select/vue.js +60 -15
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +48 -12
- package/numeric/vue.js +44 -19
- package/option/index.js +27 -9
- package/option/vue.js +37 -21
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +18 -4
- package/pager/vue.js +16 -5
- package/picker/index.js +290 -77
- package/picker/mb.js +42 -0
- package/picker/vue.js +76 -20
- package/picker-column/index.js +1 -1
- package/pop-upload/vue.js +3 -0
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +73 -34
- package/popeditor/vue.js +15 -11
- package/popover/index.js +4 -4
- package/popover/vue.js +6 -6
- package/popup/index.js +3 -3
- package/popup/vue.js +5 -5
- package/pull-refresh/index.js +13 -13
- package/pull-refresh/vue.js +5 -4
- package/radio/index.js +0 -17
- package/radio/vue.js +4 -10
- package/rate/index.js +1 -1
- package/rate/vue.js +0 -2
- package/record/index.js +4 -1
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +192 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +382 -0
- package/rich-text/vue.js +102 -0
- package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
- package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
- package/scrollbar/index.js +11 -11
- package/scrollbar/vue-bar.js +3 -3
- package/scrollbar/vue.js +5 -5
- package/search/index.js +9 -9
- package/search/vue.js +8 -6
- package/select/index.js +442 -393
- package/select/vue.js +278 -164
- package/select-dropdown/index.js +61 -3
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- package/selected-box/index.js +2 -0
- package/selected-box/vue.js +6 -3
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +70 -17
- package/slider/vue.js +16 -7
- package/split/index.js +5 -3
- package/split/vue.js +4 -6
- package/standard-list-item/index.js +15 -1
- package/standard-list-item/vue.js +6 -5
- package/steps/index.js +25 -2
- package/steps/slide-bar.js +8 -1
- package/steps/vue.js +15 -3
- package/tab-item-mf/vue.js +14 -8
- package/tab-nav/index.js +30 -5
- package/tab-nav/vue.js +16 -4
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +16 -4
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tabs-mf/wheel.js +1 -0
- package/tag/index.js +1 -1
- package/tag-group/index.js +2 -1
- package/time/index.js +5 -2
- package/time/vue.js +1 -1
- package/time-line/index.js +3 -3
- package/time-line/vue.js +2 -2
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +6 -3
- package/tooltip/vue.js +4 -4
- package/transfer/index.js +20 -22
- package/transfer/vue.js +1 -6
- package/transfer-panel/vue.js +3 -5
- package/tree/index.js +21 -4
- package/tree/vue.js +10 -8
- package/tree-menu/index.js +29 -3
- package/tree-menu/vue.js +28 -15
- package/tree-node/index.js +18 -18
- package/tree-node/vue.js +6 -5
- package/types/action-sheet.type.d.ts +118 -1
- package/types/amount.type.d.ts +168 -1
- package/types/area.type.d.ts +134 -1
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +199 -1
- package/types/badge.type.d.ts +3 -1
- package/types/breadcrumb-item.type.d.ts +2 -0
- package/types/breadcrumb.type.d.ts +2 -0
- package/types/button-group.type.d.ts +3 -3
- package/types/button.type.d.ts +4 -0
- package/types/cascader-menu.type.d.ts +3 -4
- package/types/cascader-node.type.d.ts +5 -2
- package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -241
- package/types/cascader.type.d.ts +329 -1
- package/types/checkbox.type.d.ts +6 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +38 -1
- package/types/dialog-box.type.d.ts +13 -3
- package/types/drawer.type.d.ts +133 -1
- package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +123 -0
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
- package/types/form.type.d.ts +1 -1
- package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
- package/types/input.type.d.ts +2 -6
- package/types/ip-address.type.d.ts +160 -1
- package/types/link.type.d.ts +6 -3
- package/types/loading.type.d.ts +7 -0
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +29 -2
- package/types/numeric.type.d.ts +41 -10
- package/types/pager.type.d.ts +12 -0
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +2 -0
- package/types/radio.type.d.ts +0 -4
- package/types/rate.type.d.ts +236 -1
- package/types/search.type.d.ts +88 -1
- package/types/shared.type.d.ts +1 -1
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slider.type.d.ts +49 -10
- package/types/steps.type.d.ts +14 -3
- package/types/tab-bar.type.d.ts +1 -1
- package/types/tab-nav.type.d.ts +7 -2
- package/types/tabs.type.d.ts +9 -1
- package/types/tag-group.type.d.ts +64 -1
- package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
- package/types/time-line.type.d.ts +1 -1
- package/types/timeline-item.type.d.ts +1 -1
- package/types/tooltip.type.d.ts +2 -2
- package/types/transfer.type.d.ts +185 -1
- package/types/tree-menu.type.d.ts +210 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +146 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +64 -34
- package/upload/vue.js +9 -5
- package/upload-dragger/index.js +22 -20
- package/upload-list/index.js +24 -18
- package/upload-list/vue.js +9 -4
- package/user/index.js +35 -26
- package/user/vue.js +1 -1
- package/user-head/index.js +3 -3
- package/watermark/index.js +11 -0
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
- package/common/deps/modal-queue.js +0 -6
- package/common/deps/requestAnimationFrame.js +0 -25
package/ip-address/index.js
CHANGED
|
@@ -16,12 +16,13 @@ const ipValidator = ({ props, api }) => (value) => {
|
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
18
|
const getCursorPosition = (el) => {
|
|
19
|
+
var _a, _b;
|
|
19
20
|
let cursorPos = 0;
|
|
20
21
|
let selectRange = null;
|
|
21
|
-
if (document.selection) {
|
|
22
|
-
selectRange = document.selection.createRange();
|
|
23
|
-
selectRange.moveStart("character", -el.value.length);
|
|
24
|
-
cursorPos = selectRange.text.length;
|
|
22
|
+
if (document == null ? void 0 : document.selection) {
|
|
23
|
+
selectRange = (_a = document == null ? void 0 : document.selection) == null ? void 0 : _a.createRange();
|
|
24
|
+
selectRange == null ? void 0 : selectRange.moveStart("character", -el.value.length);
|
|
25
|
+
cursorPos = (_b = selectRange == null ? void 0 : selectRange.text) == null ? void 0 : _b.length;
|
|
25
26
|
}
|
|
26
27
|
if (el.selectionStart || el.selectionStart === "0") {
|
|
27
28
|
cursorPos = el.selectionStart;
|
|
@@ -51,8 +52,9 @@ const getValue = ({ api, props, state }) => () => {
|
|
|
51
52
|
return result;
|
|
52
53
|
};
|
|
53
54
|
const setValue = ({ api, props, state }) => (value) => {
|
|
55
|
+
var _a;
|
|
54
56
|
if (value) {
|
|
55
|
-
if (api.ipValidator(value)) {
|
|
57
|
+
if ((_a = api == null ? void 0 : api.ipValidator) == null ? void 0 : _a.call(api, value)) {
|
|
56
58
|
if (api.isIP6(props.type)) {
|
|
57
59
|
state.address = value.split(":").map((item) => ({ value: item }));
|
|
58
60
|
if (state.address.length < 8) {
|
|
@@ -76,7 +78,14 @@ const setValue = ({ api, props, state }) => (value) => {
|
|
|
76
78
|
state.address = api.isIP6(props.type) ? new Array(8).fill("").map(createValue) : new Array(4).fill("").map(createValue);
|
|
77
79
|
}
|
|
78
80
|
};
|
|
79
|
-
const activeEvent = ({
|
|
81
|
+
const activeEvent = ({
|
|
82
|
+
emit,
|
|
83
|
+
parent,
|
|
84
|
+
state,
|
|
85
|
+
index,
|
|
86
|
+
event,
|
|
87
|
+
type
|
|
88
|
+
}) => {
|
|
80
89
|
const target = event && event.target ? event.target : parent.$el.querySelectorAll("input")[index || 0];
|
|
81
90
|
type === "focus" && (state.active = true);
|
|
82
91
|
if (!event) {
|
|
@@ -92,37 +101,55 @@ const activeEvent = ({ emit, parent, state, index, event, type }) => {
|
|
|
92
101
|
!state.isSelected && emit(type, target.value, index);
|
|
93
102
|
}
|
|
94
103
|
};
|
|
95
|
-
const focus = ({
|
|
104
|
+
const focus = ({
|
|
105
|
+
emit,
|
|
106
|
+
parent,
|
|
107
|
+
state
|
|
108
|
+
}) => ({ index, event }) => {
|
|
96
109
|
activeEvent({ emit, parent, state, index, event, type: "focus" });
|
|
97
110
|
};
|
|
98
|
-
const select = ({
|
|
111
|
+
const select = ({
|
|
112
|
+
emit,
|
|
113
|
+
parent,
|
|
114
|
+
state
|
|
115
|
+
}) => ({ index, event }) => {
|
|
99
116
|
activeEvent({ emit, parent, state, index, event, type: "select" });
|
|
100
117
|
};
|
|
101
118
|
const inputEvent = ({ api, componentName, emit, eventName, props }) => ({ item, index }) => {
|
|
119
|
+
var _a, _b, _c, _d, _e;
|
|
102
120
|
const val = item.value.trim();
|
|
103
121
|
let value = "";
|
|
104
122
|
if (api.isIP4(props.type)) {
|
|
105
|
-
if (!index && api.ipValidator(val)) {
|
|
106
|
-
api.setValue(val);
|
|
123
|
+
if (!index && ((_a = api == null ? void 0 : api.ipValidator) == null ? void 0 : _a.call(api, val))) {
|
|
124
|
+
(_b = api == null ? void 0 : api.setValue) == null ? void 0 : _b.call(api, val);
|
|
107
125
|
} else if (isNaN(val) || val < IPTHRESHOLD.Min || val > IPTHRESHOLD.Max) {
|
|
108
126
|
item.value = "";
|
|
109
127
|
}
|
|
110
128
|
} else {
|
|
111
|
-
if (!index && api.ipValidator(val)) {
|
|
112
|
-
api.setValue(val);
|
|
129
|
+
if (!index && ((_c = api == null ? void 0 : api.ipValidator) == null ? void 0 : _c.call(api, val))) {
|
|
130
|
+
(_d = api == null ? void 0 : api.setValue) == null ? void 0 : _d.call(api, val);
|
|
113
131
|
} else if (val.length > 4) {
|
|
114
132
|
item.value = item.value.slice(0, 4);
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
|
-
value = api.getValue();
|
|
135
|
+
value = (_e = api == null ? void 0 : api.getValue) == null ? void 0 : _e.call(api);
|
|
118
136
|
emit("update:modelValue", value, index);
|
|
137
|
+
emit("input", value, index);
|
|
119
138
|
api.dispatch(componentName, eventName, [value]);
|
|
120
139
|
};
|
|
121
140
|
const change = ({ api, emit }) => () => {
|
|
122
|
-
|
|
141
|
+
var _a;
|
|
142
|
+
const value = (_a = api == null ? void 0 : api.getValue) == null ? void 0 : _a.call(api);
|
|
123
143
|
emit("change", value);
|
|
124
144
|
};
|
|
125
|
-
const blur = ({
|
|
145
|
+
const blur = ({
|
|
146
|
+
api,
|
|
147
|
+
componentName,
|
|
148
|
+
emit,
|
|
149
|
+
eventName,
|
|
150
|
+
props,
|
|
151
|
+
state
|
|
152
|
+
}) => ({ item, index }) => {
|
|
126
153
|
state.active = false;
|
|
127
154
|
state.isDel = false;
|
|
128
155
|
if (api.isIP4(props.type)) {
|
|
@@ -162,20 +189,35 @@ const keyup = ({ api, props }) => ({ item, index, event }) => {
|
|
|
162
189
|
}
|
|
163
190
|
}
|
|
164
191
|
};
|
|
165
|
-
const checkError1 = ({
|
|
192
|
+
const checkError1 = ({
|
|
193
|
+
Tab,
|
|
194
|
+
Space,
|
|
195
|
+
NumpadDecimal,
|
|
196
|
+
NumpadComma,
|
|
197
|
+
keyCode,
|
|
198
|
+
value
|
|
199
|
+
}) => [Tab, Space, NumpadDecimal, NumpadComma].includes(keyCode) && value;
|
|
166
200
|
const checkError2 = (newValue) => newValue && (isNaN(newValue) || newValue > IPTHRESHOLD.Max);
|
|
167
201
|
const checkError3 = ({ isfilterKeyCodes, isSelected, value }) => !isfilterKeyCodes && !isSelected && value === "0";
|
|
168
202
|
const checkError4 = ({ isfilterKeyCodes, isSelected, value, key }) => !isfilterKeyCodes && !isSelected && value + key > IPTHRESHOLD.Max;
|
|
169
203
|
const checkError5 = ({ key, isfilterKeyCodes, value, ctrlKey, keyCode, KeyV }) => isNaN(key) && !isfilterKeyCodes && !(!value && ctrlKey && keyCode === KeyV);
|
|
170
|
-
const isError = ({
|
|
204
|
+
const isError = ({
|
|
205
|
+
key,
|
|
206
|
+
value,
|
|
207
|
+
isSelected,
|
|
208
|
+
isfilterKeyCodes,
|
|
209
|
+
ctrlKey,
|
|
210
|
+
keyCode,
|
|
211
|
+
newValue
|
|
212
|
+
}) => {
|
|
171
213
|
const { Tab, Space, NumpadDecimal, NumpadComma, KeyV } = KEY_CODE;
|
|
172
214
|
return checkError1({ Tab, Space, NumpadDecimal, NumpadComma, keyCode, value }) || checkError2(newValue) || checkError3({ isfilterKeyCodes, isSelected, value }) || checkError4({ isfilterKeyCodes, isSelected, value, key }) || checkError5({ key, isfilterKeyCodes, value, ctrlKey, keyCode, KeyV });
|
|
173
215
|
};
|
|
174
216
|
const keydown = ({ api, props, state }) => ({ item, index, event }) => {
|
|
175
217
|
const { target, key, keyCode, ctrlKey } = event;
|
|
176
218
|
const value = item.value;
|
|
177
|
-
const selectionStart = target.selectionStart;
|
|
178
|
-
const selectionEnd = target.selectionEnd;
|
|
219
|
+
const selectionStart = target == null ? void 0 : target.selectionStart;
|
|
220
|
+
const selectionEnd = target == null ? void 0 : target.selectionEnd;
|
|
179
221
|
const isSelected = selectionStart !== selectionEnd;
|
|
180
222
|
const cursorPosition = api.getCursorPosition(target);
|
|
181
223
|
const isfilterKeyCodes = state.filterKeyCodes.includes(keyCode);
|
package/ip-address/vue.js
CHANGED
|
@@ -20,7 +20,13 @@ import {
|
|
|
20
20
|
} from "./index";
|
|
21
21
|
import { KEY_CODE } from "../common";
|
|
22
22
|
const api = ["state", "focus", "inputEvent", "blur", "keyup", "keydown", "change", "select"];
|
|
23
|
-
const initState = ({
|
|
23
|
+
const initState = ({
|
|
24
|
+
reactive,
|
|
25
|
+
computed,
|
|
26
|
+
handleValue,
|
|
27
|
+
parent,
|
|
28
|
+
props
|
|
29
|
+
}) => {
|
|
24
30
|
const state = reactive(__spreadProps(__spreadValues({}, handleValue.state), {
|
|
25
31
|
active: false,
|
|
26
32
|
isSelected: false,
|
|
@@ -40,7 +46,18 @@ const initState = ({ reactive, computed, handleValue, parent, props }) => {
|
|
|
40
46
|
}));
|
|
41
47
|
return state;
|
|
42
48
|
};
|
|
43
|
-
const initApi = ({
|
|
49
|
+
const initApi = ({
|
|
50
|
+
state,
|
|
51
|
+
api: api2,
|
|
52
|
+
dispatch,
|
|
53
|
+
handleValue,
|
|
54
|
+
emit,
|
|
55
|
+
broadcast,
|
|
56
|
+
parent,
|
|
57
|
+
componentName,
|
|
58
|
+
props,
|
|
59
|
+
eventName
|
|
60
|
+
}) => {
|
|
44
61
|
Object.assign(api2, __spreadProps(__spreadValues({}, handleValue.api), {
|
|
45
62
|
state,
|
|
46
63
|
dispatch,
|
|
@@ -77,8 +94,9 @@ const useHandleValue = ({ componentName, dispatch, eventName, props, reactive, t
|
|
|
77
94
|
watch(
|
|
78
95
|
() => props.modelValue,
|
|
79
96
|
(value) => {
|
|
97
|
+
var _a;
|
|
80
98
|
if (!state.isDel) {
|
|
81
|
-
api2.setValue(value);
|
|
99
|
+
(_a = api2 == null ? void 0 : api2.setValue) == null ? void 0 : _a.call(api2, value);
|
|
82
100
|
dispatch(componentName, eventName, [value]);
|
|
83
101
|
}
|
|
84
102
|
},
|
|
@@ -89,7 +107,7 @@ const useHandleValue = ({ componentName, dispatch, eventName, props, reactive, t
|
|
|
89
107
|
api: api2
|
|
90
108
|
};
|
|
91
109
|
};
|
|
92
|
-
const renderless = (props, { reactive, toRefs, watch, inject, computed }, {
|
|
110
|
+
const renderless = (props, { reactive, toRefs, watch, inject, computed }, { emit, parent, broadcast, dispatch }) => {
|
|
93
111
|
const api2 = {};
|
|
94
112
|
const componentName = "FormItem";
|
|
95
113
|
const eventName = {
|
package/link/vue.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
2
3
|
import { handleClick } from "./index";
|
|
3
4
|
const api = ["state", "handleClick"];
|
|
4
5
|
const renderless = (props, { inject, reactive, computed }, { emit, parent }) => {
|
|
5
6
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
6
7
|
const state = reactive({
|
|
7
8
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
8
|
-
disabled: computed(() => props.disabled || state.formDisabled)
|
|
9
|
+
disabled: computed(() => props.disabled || state.formDisabled),
|
|
10
|
+
href: computed(() => xss.filterUrl(props.href))
|
|
9
11
|
});
|
|
10
12
|
return {
|
|
11
13
|
state,
|
package/loading/index.js
CHANGED
|
@@ -12,9 +12,9 @@ const close = ({ state, constants, vm }) => () => {
|
|
|
12
12
|
vm,
|
|
13
13
|
() => {
|
|
14
14
|
const target = state.fullscreen || state.body ? document.body : state.target;
|
|
15
|
-
removeClass(target, constants.PARENT_RELATIVE_CLS);
|
|
16
|
-
removeClass(target, constants.PARENT_HIDDEN_CLS);
|
|
17
15
|
if (vm.$el && vm.$el.parentNode) {
|
|
16
|
+
removeClass(target, constants.PARENT_RELATIVE_CLS);
|
|
17
|
+
removeClass(target, constants.PARENT_HIDDEN_CLS);
|
|
18
18
|
vm.$el.parentNode.removeChild(vm.$el);
|
|
19
19
|
}
|
|
20
20
|
state.closed = true;
|
package/loading/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { handleAfterLeave, setText, close } from "./index";
|
|
3
3
|
const api = ["state", "handleAfterLeave", "setText", "close"];
|
|
4
|
-
const renderless = (props, { reactive }, { constants, vm, emit }) => {
|
|
4
|
+
const renderless = (props, { reactive, computed }, { constants, vm, emit, designConfig }) => {
|
|
5
5
|
const state = reactive({
|
|
6
6
|
text: null,
|
|
7
7
|
spinner: null,
|
|
@@ -10,7 +10,13 @@ const renderless = (props, { reactive }, { constants, vm, emit }) => {
|
|
|
10
10
|
background: null,
|
|
11
11
|
fullscreen: true,
|
|
12
12
|
closed: false,
|
|
13
|
-
size: "
|
|
13
|
+
size: "",
|
|
14
|
+
iconSize: "",
|
|
15
|
+
loadingImg: computed(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
return props.loadingImg || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.loadingImg);
|
|
18
|
+
}),
|
|
19
|
+
iconStyle: computed(() => state.iconSize ? { width: state.iconSize + "px", height: state.iconSize + "px" } : {})
|
|
14
20
|
});
|
|
15
21
|
const api2 = {
|
|
16
22
|
state,
|
package/logout/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { xss } from "../common";
|
|
3
3
|
const logout = ({ service, state, props }) => () => {
|
|
4
4
|
let { isMock, isLocal, redirectUrl = "", getLogoutUrl, showLogin } = service;
|
|
5
|
-
if (typeof props.beforeLogout === "function") {
|
|
5
|
+
if (typeof props.beforeLogout === "function" && !state.logout) {
|
|
6
6
|
if (props.beforeLogout(redirectUrl) === false) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
package/menu/index.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import {
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
|
+
import { deepClone } from "../picker-column";
|
|
3
4
|
const filterInput = ({ state }) => (val) => {
|
|
4
5
|
state.filterValue = val;
|
|
5
6
|
};
|
|
7
|
+
const computeData = ({ props, vm }) => () => filterNodeUrl(props.data || [], vm);
|
|
8
|
+
const filterNodeUrl = (data, vm) => {
|
|
9
|
+
data.forEach((node) => {
|
|
10
|
+
node.url = xss.filterUrl(node.url);
|
|
11
|
+
vm.$set(node, "isCurrent", false);
|
|
12
|
+
if (node.children) {
|
|
13
|
+
filterNodeUrl(node.children, vm);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
6
18
|
const setIsCurrent = ({ props, vm, state }) => (data, node) => {
|
|
7
19
|
if (props.onlyCheckChildren && node.children)
|
|
8
20
|
return;
|
|
@@ -30,7 +42,7 @@ const getIsCurrent = (vm, node, nodeId) => {
|
|
|
30
42
|
};
|
|
31
43
|
const filterNodes = ({ state, api, nextTick }) => (label) => {
|
|
32
44
|
if (label !== "") {
|
|
33
|
-
state.filterData = filterTree(
|
|
45
|
+
state.filterData = filterTree(deepClone(state.data), label);
|
|
34
46
|
} else {
|
|
35
47
|
state.filterData = [];
|
|
36
48
|
if (state.activedKeys) {
|
|
@@ -117,6 +129,7 @@ const findPaths = (nodes, nodeId) => {
|
|
|
117
129
|
}
|
|
118
130
|
};
|
|
119
131
|
export {
|
|
132
|
+
computeData,
|
|
120
133
|
filterInput,
|
|
121
134
|
filterNodes,
|
|
122
135
|
getActivedKeysPath,
|
package/menu/vue.js
CHANGED
|
@@ -6,25 +6,25 @@ import {
|
|
|
6
6
|
getActivedKeysPath,
|
|
7
7
|
setNodeHidden,
|
|
8
8
|
setAllNodeVisible,
|
|
9
|
-
filterInput
|
|
9
|
+
filterInput,
|
|
10
|
+
computeData
|
|
10
11
|
} from "./index";
|
|
11
12
|
import debounce from "../common/deps/debounce";
|
|
12
13
|
const api = ["state", "setIsCurrent", "filterNodes", "filterInput"];
|
|
13
|
-
const
|
|
14
|
-
const api2 = {};
|
|
14
|
+
const initState = ({ reactive, computed, props, api: api2 }) => {
|
|
15
15
|
const state = reactive({
|
|
16
16
|
isEmpty: computed(() => props.data.length !== 0 && state.filterValue && state.filterData.length === 0),
|
|
17
17
|
activedNodeId: null,
|
|
18
|
-
filterCheckedId: null,
|
|
19
|
-
activedKeys: props.activedKeys,
|
|
20
|
-
expandedKeysPath: [],
|
|
21
|
-
activedKeysPath: [],
|
|
22
|
-
filterText: "",
|
|
23
18
|
filterValue: "",
|
|
24
19
|
currentPaths: [],
|
|
25
20
|
filterData: [],
|
|
26
|
-
data:
|
|
21
|
+
data: computed(() => api2.computeData())
|
|
27
22
|
});
|
|
23
|
+
return state;
|
|
24
|
+
};
|
|
25
|
+
const renderless = (props, { reactive, watch, onMounted, computed }, { vm, emit, nextTick }) => {
|
|
26
|
+
const api2 = {};
|
|
27
|
+
const state = initState({ reactive, computed, props, api: api2 });
|
|
28
28
|
Object.assign(api2, {
|
|
29
29
|
state,
|
|
30
30
|
setIsCurrent: setIsCurrent({ props, vm, state, emit, nextTick }),
|
|
@@ -33,7 +33,8 @@ const renderless = (props, { reactive, watch, onMounted, computed }, { vm, emit,
|
|
|
33
33
|
getActivedKeysPath: getActivedKeysPath({ state }),
|
|
34
34
|
getExpandedKeysPath: getExpandedKeysPath({ state }),
|
|
35
35
|
setAllNodeVisible: setAllNodeVisible({ vm, state }),
|
|
36
|
-
filterInput: filterInput({ state })
|
|
36
|
+
filterInput: filterInput({ state }),
|
|
37
|
+
computeData: computeData({ props, vm })
|
|
37
38
|
});
|
|
38
39
|
watch(
|
|
39
40
|
() => props.expandAll,
|
|
@@ -59,18 +60,22 @@ const renderless = (props, { reactive, watch, onMounted, computed }, { vm, emit,
|
|
|
59
60
|
);
|
|
60
61
|
watch(
|
|
61
62
|
() => props.activedKeys,
|
|
62
|
-
() => {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
(val) => {
|
|
64
|
+
if (val || val === 0) {
|
|
65
|
+
state.activedKeys = props.activedKeys;
|
|
66
|
+
api2.getActivedKeysPath(props.activedKeys);
|
|
67
|
+
api2.setIsCurrent(props.data, { id: props.activedKeys });
|
|
68
|
+
}
|
|
65
69
|
},
|
|
66
70
|
{ immediate: true }
|
|
67
71
|
);
|
|
68
72
|
watch(
|
|
69
73
|
() => props.data,
|
|
70
|
-
() => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
(val) => {
|
|
75
|
+
nextTick(() => {
|
|
76
|
+
api2.setIsCurrent(val, { id: props.activedKeys });
|
|
77
|
+
});
|
|
78
|
+
}
|
|
74
79
|
);
|
|
75
80
|
onMounted(() => {
|
|
76
81
|
vm.$on("node-clicked", (param) => {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const importData = (instance, data) => {
|
|
3
|
+
instance.init(data);
|
|
4
|
+
};
|
|
5
|
+
const initEvent = (render, emit) => {
|
|
6
|
+
const onOperation = (info) => {
|
|
7
|
+
emit("operation", { render, info });
|
|
8
|
+
};
|
|
9
|
+
const onSelectNode = (nodeObj, e) => {
|
|
10
|
+
emit("selectNode", { render, nodeObj, e });
|
|
11
|
+
};
|
|
12
|
+
const selectNewNode = (nodeObj) => {
|
|
13
|
+
emit("selectNewNode", { render, nodeObj });
|
|
14
|
+
};
|
|
15
|
+
const onSelectNodes = (nodeObj) => {
|
|
16
|
+
emit("selectNodes", { render, nodeObj });
|
|
17
|
+
};
|
|
18
|
+
const unselectNode = () => {
|
|
19
|
+
emit("unselectNode", { render });
|
|
20
|
+
};
|
|
21
|
+
const unselectNodes = () => {
|
|
22
|
+
emit("unselectNodes", { render });
|
|
23
|
+
};
|
|
24
|
+
const expandNode = (nodeObj) => {
|
|
25
|
+
emit("expandNode", { render, nodeObj });
|
|
26
|
+
};
|
|
27
|
+
render.bus.addListener("operation", onOperation);
|
|
28
|
+
render.bus.addListener("selectNode", onSelectNode);
|
|
29
|
+
render.bus.addListener("selectNewNode", selectNewNode);
|
|
30
|
+
render.bus.addListener("selectNodes", onSelectNodes);
|
|
31
|
+
render.bus.addListener("unselectNode", unselectNode);
|
|
32
|
+
render.bus.addListener("unselectNodes", unselectNodes);
|
|
33
|
+
render.bus.addListener("expandNode", expandNode);
|
|
34
|
+
return () => {
|
|
35
|
+
render.bus.removeListener("operation", onOperation);
|
|
36
|
+
render.bus.removeListener("selectNode", onSelectNode);
|
|
37
|
+
render.bus.removeListener("selectNewNode", selectNewNode);
|
|
38
|
+
render.bus.removeListener("selectNodes", onSelectNodes);
|
|
39
|
+
render.bus.removeListener("unselectNode", unselectNode);
|
|
40
|
+
render.bus.removeListener("unselectNodes", unselectNodes);
|
|
41
|
+
render.bus.removeListener("expandNode", expandNode);
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
importData,
|
|
46
|
+
initEvent
|
|
47
|
+
};
|
package/mind-map/vue.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
5
|
+
import { importData, initEvent } from ".";
|
|
6
|
+
const api = [];
|
|
7
|
+
const renderless = (props, { getCurrentInstance, onMounted, onUnmounted, watch }, { emit }, {
|
|
8
|
+
MindElixir
|
|
9
|
+
}) => {
|
|
10
|
+
const api2 = {};
|
|
11
|
+
let destoryListener = null;
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
var _a;
|
|
14
|
+
const instance = getCurrentInstance();
|
|
15
|
+
if (!instance) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Can not find instance. Please open Issue: https://github.com/opentiny/tiny-vue/issues/new/choose"
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const mindmap = instance.refs.mindmap;
|
|
21
|
+
const render = new MindElixir(__spreadProps(__spreadValues({
|
|
22
|
+
contextMenu: false,
|
|
23
|
+
toolBar: false,
|
|
24
|
+
nodeMenu: false
|
|
25
|
+
}, (_a = props.options) != null ? _a : {}), {
|
|
26
|
+
el: mindmap
|
|
27
|
+
}));
|
|
28
|
+
destoryListener = initEvent(render, emit);
|
|
29
|
+
emit("create", render);
|
|
30
|
+
watch(
|
|
31
|
+
() => props.modelValue,
|
|
32
|
+
() => {
|
|
33
|
+
if (props.modelValue) {
|
|
34
|
+
emit("beforeImport", { render, data: props.modelValue });
|
|
35
|
+
importData(render, props.modelValue);
|
|
36
|
+
emit("afterImport", { render, data: props.modelValue });
|
|
37
|
+
} else {
|
|
38
|
+
const root = MindElixir.new("root");
|
|
39
|
+
render.init(root);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{ deep: true, immediate: true }
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
onUnmounted(() => {
|
|
46
|
+
destoryListener == null ? void 0 : destoryListener();
|
|
47
|
+
});
|
|
48
|
+
return api2;
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
api,
|
|
52
|
+
renderless
|
|
53
|
+
};
|
package/modal/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import PopupManager from "../common/deps/popup-manager";
|
|
|
5
5
|
import { getDomNode } from "../common/deps/dom";
|
|
6
6
|
import { getViewportWindow } from "../common/global";
|
|
7
7
|
const DragClass = "is__drag";
|
|
8
|
+
let timer;
|
|
8
9
|
const emitZoom = ({ params, parent, emit, event }) => {
|
|
9
10
|
let { $listeners, events = {} } = parent;
|
|
10
11
|
if ($listeners.zoom) {
|
|
@@ -30,6 +31,11 @@ const computedBoxStyle = ({ props, isMobileFirstMode }) => () => {
|
|
|
30
31
|
return { width, height };
|
|
31
32
|
};
|
|
32
33
|
const watchValue = (api) => (visible) => visible ? api.open() : api.close("hide");
|
|
34
|
+
const watchVisible = ({ api, props }) => (visible) => {
|
|
35
|
+
if (props.lockScroll) {
|
|
36
|
+
visible ? api.showScrollbar() : api.hideScrollbar();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
33
39
|
const created = ({ api, props, state }) => () => {
|
|
34
40
|
if (props.modelValue) {
|
|
35
41
|
api.open();
|
|
@@ -40,9 +46,19 @@ const mounted = ({
|
|
|
40
46
|
api,
|
|
41
47
|
parent,
|
|
42
48
|
props,
|
|
43
|
-
isMobileFirstMode
|
|
49
|
+
isMobileFirstMode,
|
|
50
|
+
state
|
|
44
51
|
}) => () => {
|
|
45
|
-
if (isMobileFirstMode) {
|
|
52
|
+
if (!isMobileFirstMode) {
|
|
53
|
+
let modalBoxElem = api.getBox();
|
|
54
|
+
Object.assign(modalBoxElem.style, {
|
|
55
|
+
width: props.width ? isNaN(props.width) ? props.width : `${props.width}px` : null,
|
|
56
|
+
height: props.height ? isNaN(props.height) ? props.height : `${props.height}px` : null
|
|
57
|
+
});
|
|
58
|
+
if (props.lockScroll && state.visible) {
|
|
59
|
+
api.showScrollbar();
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
46
62
|
on(window, "resize", api.resetDragStyle);
|
|
47
63
|
}
|
|
48
64
|
if (props.escClosable) {
|
|
@@ -56,6 +72,7 @@ const beforeUnmouted = ({ api, parent, isMobileFirstMode }) => () => {
|
|
|
56
72
|
off(document, "keydown", api.handleGlobalKeydownEvent);
|
|
57
73
|
off(window, "hashchange", api.handleHashChange);
|
|
58
74
|
api.removeMsgQueue();
|
|
75
|
+
api.hideScrollbar();
|
|
59
76
|
if (parent.$el.parentNode) {
|
|
60
77
|
parent.$el.parentNode.removeChild(parent.$el);
|
|
61
78
|
}
|
|
@@ -65,6 +82,18 @@ const selfClickEvent = ({ api, parent, props }) => (event) => {
|
|
|
65
82
|
api.close("mask");
|
|
66
83
|
}
|
|
67
84
|
};
|
|
85
|
+
const mouseEnterEvent = () => () => {
|
|
86
|
+
clearTimeout(timer);
|
|
87
|
+
};
|
|
88
|
+
const mouseLeaveEvent = ({ api, props }) => () => {
|
|
89
|
+
api.addMsgQueue();
|
|
90
|
+
timer = window.setTimeout(
|
|
91
|
+
() => {
|
|
92
|
+
api.close("close");
|
|
93
|
+
},
|
|
94
|
+
parseFloat(props.duration)
|
|
95
|
+
);
|
|
96
|
+
};
|
|
68
97
|
const updateZindex = ({ state, props }) => () => {
|
|
69
98
|
state.modalZindex = props.zIndex || PopupManager.nextZIndex();
|
|
70
99
|
};
|
|
@@ -128,7 +157,7 @@ const open = ({
|
|
|
128
157
|
}, 10);
|
|
129
158
|
if (state.isMsg) {
|
|
130
159
|
api.addMsgQueue();
|
|
131
|
-
setTimeout(
|
|
160
|
+
timer = window.setTimeout(
|
|
132
161
|
() => {
|
|
133
162
|
api.close(params.type);
|
|
134
163
|
},
|
|
@@ -628,6 +657,12 @@ const resetDragStyle = (api) => () => {
|
|
|
628
657
|
modalBoxElement.style.left = "";
|
|
629
658
|
modalBoxElement.style.top = "";
|
|
630
659
|
};
|
|
660
|
+
const showScrollbar = (lockScrollClass) => () => {
|
|
661
|
+
addClass(document.body, lockScrollClass);
|
|
662
|
+
};
|
|
663
|
+
const hideScrollbar = (lockScrollClass) => () => {
|
|
664
|
+
removeClass(document.body, lockScrollClass);
|
|
665
|
+
};
|
|
631
666
|
export {
|
|
632
667
|
MsgQueue,
|
|
633
668
|
addMsgQueue,
|
|
@@ -644,8 +679,11 @@ export {
|
|
|
644
679
|
handleEvent,
|
|
645
680
|
handleGlobalKeydownEvent,
|
|
646
681
|
handleHashChange,
|
|
682
|
+
hideScrollbar,
|
|
647
683
|
maximize,
|
|
648
684
|
mounted,
|
|
685
|
+
mouseEnterEvent,
|
|
686
|
+
mouseLeaveEvent,
|
|
649
687
|
mousedownEvent,
|
|
650
688
|
open,
|
|
651
689
|
removeMsgQueue,
|
|
@@ -653,9 +691,11 @@ export {
|
|
|
653
691
|
resetFormTip,
|
|
654
692
|
revert,
|
|
655
693
|
selfClickEvent,
|
|
694
|
+
showScrollbar,
|
|
656
695
|
toggleZoomEvent,
|
|
657
696
|
updateFormTip,
|
|
658
697
|
updateStyle,
|
|
659
698
|
updateZindex,
|
|
660
|
-
watchValue
|
|
699
|
+
watchValue,
|
|
700
|
+
watchVisible
|
|
661
701
|
};
|
package/modal/vue.js
CHANGED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
mounted,
|
|
19
19
|
beforeUnmouted,
|
|
20
20
|
selfClickEvent,
|
|
21
|
+
mouseEnterEvent,
|
|
22
|
+
mouseLeaveEvent,
|
|
21
23
|
updateZindex,
|
|
22
24
|
closeEvent,
|
|
23
25
|
confirmEvent,
|
|
@@ -25,7 +27,10 @@ import {
|
|
|
25
27
|
open,
|
|
26
28
|
resetDragStyle,
|
|
27
29
|
computedBoxStyle,
|
|
28
|
-
handleHashChange
|
|
30
|
+
handleHashChange,
|
|
31
|
+
showScrollbar,
|
|
32
|
+
hideScrollbar,
|
|
33
|
+
watchVisible
|
|
29
34
|
} from "./index";
|
|
30
35
|
const api = [
|
|
31
36
|
"state",
|
|
@@ -38,6 +43,8 @@ const api = [
|
|
|
38
43
|
"close",
|
|
39
44
|
"updateStyle",
|
|
40
45
|
"selfClickEvent",
|
|
46
|
+
"mouseEnterEvent",
|
|
47
|
+
"mouseLeaveEvent",
|
|
41
48
|
"updateZindex",
|
|
42
49
|
"closeEvent",
|
|
43
50
|
"confirmEvent",
|
|
@@ -46,8 +53,9 @@ const api = [
|
|
|
46
53
|
"beforeUnmouted",
|
|
47
54
|
"resetDragStyle"
|
|
48
55
|
];
|
|
49
|
-
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch }, { vm, emit, emitter, nextTick, broadcast, vm: parent }, { isMobileFirstMode }) => {
|
|
56
|
+
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch }, { vm, emit, emitter, nextTick, broadcast, vm: parent, constants, mode }, { isMobileFirstMode }) => {
|
|
50
57
|
const api2 = {};
|
|
58
|
+
const lockScrollClass = constants.SCROLL_LOCK_CLASS(mode);
|
|
51
59
|
const state = reactive({
|
|
52
60
|
emitter: emitter(),
|
|
53
61
|
visible: false,
|
|
@@ -70,9 +78,11 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
70
78
|
getBox: getBox({ vm }),
|
|
71
79
|
watchValue: watchValue(api2),
|
|
72
80
|
created: created({ api: api2, props, state }),
|
|
73
|
-
mounted: mounted({ api: api2, parent, props, isMobileFirstMode }),
|
|
81
|
+
mounted: mounted({ api: api2, parent, props, isMobileFirstMode, state }),
|
|
74
82
|
beforeUnmouted: beforeUnmouted({ api: api2, parent, isMobileFirstMode }),
|
|
75
83
|
selfClickEvent: selfClickEvent({ api: api2, parent, props }),
|
|
84
|
+
mouseEnterEvent: mouseEnterEvent(),
|
|
85
|
+
mouseLeaveEvent: mouseLeaveEvent({ api: api2, props }),
|
|
76
86
|
updateZindex: updateZindex({ state, props }),
|
|
77
87
|
handleEvent: handleEvent({ api: api2, emit, parent, props, isMobileFirstMode }),
|
|
78
88
|
closeEvent: closeEvent(api2),
|
|
@@ -90,9 +100,13 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
90
100
|
mousedownEvent: mousedownEvent({ api: api2, nextTick, props, state, emit, isMobileFirstMode }),
|
|
91
101
|
dragEvent: dragEvent({ api: api2, emit, parent, props, state }),
|
|
92
102
|
resetDragStyle: resetDragStyle(api2),
|
|
93
|
-
computedBoxStyle: computedBoxStyle({ props, isMobileFirstMode })
|
|
103
|
+
computedBoxStyle: computedBoxStyle({ props, isMobileFirstMode }),
|
|
104
|
+
watchVisible: watchVisible({ api: api2, props }),
|
|
105
|
+
hideScrollbar: hideScrollbar(lockScrollClass),
|
|
106
|
+
showScrollbar: showScrollbar(lockScrollClass)
|
|
94
107
|
});
|
|
95
108
|
watch(() => props.modelValue, api2.watchValue);
|
|
109
|
+
watch(() => state.visible, api2.watchVisible);
|
|
96
110
|
api2.created();
|
|
97
111
|
onMounted(api2.mounted);
|
|
98
112
|
onBeforeUnmount(api2.beforeUnmouted);
|