@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/image-viewer/index.js
CHANGED
|
@@ -27,14 +27,11 @@ const hide = ({ props, api, state }) => () => {
|
|
|
27
27
|
};
|
|
28
28
|
const deviceSupportInstall = ({ state, api, mode }) => () => {
|
|
29
29
|
on(window, "resize", api.initPage);
|
|
30
|
-
state.urlList = state.urlList.map((subItem) => {
|
|
31
|
-
return xss.filterUrl(subItem);
|
|
32
|
-
});
|
|
33
30
|
state.urlList = state.urlList.map((subItem) => {
|
|
34
31
|
let subItemObj = {};
|
|
35
32
|
let lastSlashIndex = "";
|
|
36
33
|
if (typeof subItem === "string") {
|
|
37
|
-
subItem =
|
|
34
|
+
subItem = api.filterImageUrl(subItem);
|
|
38
35
|
if (state.isThumbnail || state.isMenuView) {
|
|
39
36
|
lastSlashIndex = subItem.lastIndexOf("/");
|
|
40
37
|
state.fileName = subItem.substring(lastSlashIndex + 1);
|
|
@@ -47,12 +44,15 @@ const deviceSupportInstall = ({ state, api, mode }) => () => {
|
|
|
47
44
|
return { url: subItem, name: state.fileName };
|
|
48
45
|
}
|
|
49
46
|
} else if (typeof subItem === "object" && subItem !== null) {
|
|
47
|
+
subItem.url = api.filterImageUrl(subItem.url);
|
|
50
48
|
if (!subItem.name) {
|
|
51
49
|
lastSlashIndex = subItem.url.lastIndexOf("/");
|
|
52
50
|
state.fileName = subItem.url.substring(lastSlashIndex + 1);
|
|
53
51
|
subItem.name = state.fileName;
|
|
54
52
|
}
|
|
55
53
|
return subItem;
|
|
54
|
+
} else {
|
|
55
|
+
return null;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
state._keyDownHandler = rafThrottle((event) => {
|
|
@@ -173,23 +173,17 @@ const prev = ({ state, api, vm }) => () => {
|
|
|
173
173
|
} else if (state.isMenuView) {
|
|
174
174
|
prevElement = vm.$refs[`isMenuView_${state.index}`][0] || vm.$refs[`isMenuView_${state.index}`];
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
case state.urlList.length - 3:
|
|
188
|
-
state.scrollTop = prevElement.offsetHeight;
|
|
189
|
-
break;
|
|
190
|
-
default:
|
|
191
|
-
api.getDefaultPrev(prevElement);
|
|
192
|
-
break;
|
|
176
|
+
if (state.index === 1) {
|
|
177
|
+
state.isThumbnail && vm.$refs.isThumbnailContent && (vm.$refs.isThumbnailContent.scrollTop = 0);
|
|
178
|
+
state.isMenuView && vm.$refs.isMenuViewContent && (vm.$refs.isMenuViewContent.scrollTop = 0);
|
|
179
|
+
state.scrollTop = 0;
|
|
180
|
+
} else if (state.index === state.urlList.length - 1) {
|
|
181
|
+
api.getLastPrev(prevElement);
|
|
182
|
+
} else if (state.index === state.urlList.length - 2) {
|
|
183
|
+
} else if (state.index === state.urlList.length - 3) {
|
|
184
|
+
state.scrollTop = prevElement.offsetHeight;
|
|
185
|
+
} else {
|
|
186
|
+
api.getDefaultPrev(prevElement);
|
|
193
187
|
}
|
|
194
188
|
};
|
|
195
189
|
const getLastPrev = ({ state, vm }) => (prevElement) => {
|
|
@@ -219,30 +213,37 @@ const next = ({ state, api, vm }) => () => {
|
|
|
219
213
|
} else if (state.isMenuView) {
|
|
220
214
|
element = vm.$refs[`isMenuView_${state.index}`][0] || vm.$refs[`isMenuView_${state.index}`];
|
|
221
215
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
state.scrollTop =
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
216
|
+
state.centerIndex = api.getCenterPosition(element) - 1;
|
|
217
|
+
let slientIndex = -1;
|
|
218
|
+
if (state.centerIndex > state.index) {
|
|
219
|
+
slientIndex = state.index;
|
|
220
|
+
}
|
|
221
|
+
if (state.index === 0) {
|
|
222
|
+
state.isThumbnail && vm.$refs.isThumbnailContent && (vm.$refs.isThumbnailContent.scrollTop = 0);
|
|
223
|
+
state.isMenuView && vm.$refs.isMenuViewContent && (vm.$refs.isMenuViewContent.scrollTop = 0);
|
|
224
|
+
state.scrollTop = 0;
|
|
225
|
+
} else if (state.index === slientIndex) {
|
|
226
|
+
} else {
|
|
227
|
+
if (state.isThumbnail) {
|
|
228
|
+
vm.$refs.isThumbnailContent && (vm.$refs.isThumbnailContent.scrollTop = state.scrollTop);
|
|
229
|
+
state.scrollTop = state.scrollTop + element.offsetHeight + state.thumbnailTop;
|
|
230
|
+
} else if (state.isMenuView) {
|
|
231
|
+
vm.$refs.isMenuViewContent && (vm.$refs.isMenuViewContent.scrollTop = state.scrollTop);
|
|
232
|
+
state.scrollTop = state.scrollTop + element.offsetHeight + state.menuTop;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const getCenterPosition = ({ state, vm }) => (element) => {
|
|
237
|
+
let contentHeight = 0;
|
|
238
|
+
let eleHeight = 0;
|
|
239
|
+
if (state.isThumbnail && vm.$refs.isThumbnailContent) {
|
|
240
|
+
contentHeight = vm.$refs.isThumbnailContent.getBoundingClientRect().height;
|
|
241
|
+
eleHeight = element.getBoundingClientRect().height + parseFloat(getComputedStyle(element).marginBottom) - 0;
|
|
242
|
+
return Math.ceil(contentHeight / eleHeight) / 2;
|
|
243
|
+
} else if (vm.$refs.isMenuViewContent && vm.$refs.isMenuViewContent) {
|
|
244
|
+
contentHeight = vm.$refs.isMenuViewContent.getBoundingClientRect().height;
|
|
245
|
+
eleHeight = element.getBoundingClientRect().height + parseFloat(getComputedStyle(element).marginTop) - 0;
|
|
246
|
+
return Math.ceil(contentHeight / eleHeight) / 2;
|
|
246
247
|
}
|
|
247
248
|
};
|
|
248
249
|
const handleActions = (state, props, emit) => (action, options = {}) => {
|
|
@@ -295,11 +296,11 @@ const handleActions = (state, props, emit) => (action, options = {}) => {
|
|
|
295
296
|
const computedIsSingle = (props) => () => props.urlList.length <= 1;
|
|
296
297
|
const computedIsFirst = (state) => () => state.index === 0;
|
|
297
298
|
const computedIsLast = ({ state, props }) => () => state.index === props.urlList.length - 1;
|
|
298
|
-
const computedCurrentImg = (state) => () => {
|
|
299
|
+
const computedCurrentImg = ({ state, api }) => () => {
|
|
299
300
|
if (typeof state.urlList[0] === "string") {
|
|
300
|
-
return state.urlList[state.index];
|
|
301
|
+
return api.filterImageUrl(state.urlList[state.index]);
|
|
301
302
|
} else if (typeof state.urlList[0] === "object" && state.urlList[0] !== null) {
|
|
302
|
-
return state.urlList[state.index].url;
|
|
303
|
+
return api.filterImageUrl(state.urlList[state.index].url);
|
|
303
304
|
}
|
|
304
305
|
};
|
|
305
306
|
const computedImgStyle = ({ state, constants }) => () => {
|
|
@@ -353,7 +354,7 @@ const getImageWidth = ({ state, parent, props, vm, mode }) => () => {
|
|
|
353
354
|
}
|
|
354
355
|
state.imageItemWidth = imageW;
|
|
355
356
|
state.imageAllWidth = state.urlList.length * imageW;
|
|
356
|
-
if (mode
|
|
357
|
+
if (mode === "mobile") {
|
|
357
358
|
if (props.startPosition > 0) {
|
|
358
359
|
state.index = props.startPosition;
|
|
359
360
|
state.imageTransition = 0;
|
|
@@ -412,7 +413,7 @@ const swipeRight = ({ state, emit }) => () => {
|
|
|
412
413
|
} else {
|
|
413
414
|
state.arrowStyle = null;
|
|
414
415
|
}
|
|
415
|
-
if (state.imageTransform
|
|
416
|
+
if (state.imageTransform === 0 && state.index === 0) {
|
|
416
417
|
return;
|
|
417
418
|
}
|
|
418
419
|
state.index = (state.index - 1 + len) % len;
|
|
@@ -447,9 +448,13 @@ const langClick = (state) => () => {
|
|
|
447
448
|
window.navigator.msSaveOrOpenBlob(blob, "img.png");
|
|
448
449
|
} else {
|
|
449
450
|
const a = document.createElement("a");
|
|
450
|
-
a.
|
|
451
|
+
a.style = "dispaly:none";
|
|
452
|
+
a.href = state.currentImg + "?response-content-type=application/octet-stream";
|
|
451
453
|
a.setAttribute("download", "img");
|
|
454
|
+
a.setAttribute("target", "downloadFile");
|
|
455
|
+
document.body.appendChild(a);
|
|
452
456
|
a.click();
|
|
457
|
+
document.body.removeChild(a);
|
|
453
458
|
}
|
|
454
459
|
};
|
|
455
460
|
const touchstart = ({ state, mode, api }) => (e) => {
|
|
@@ -629,6 +634,10 @@ const selectOption = ({ state, api }) => (item, index) => {
|
|
|
629
634
|
break;
|
|
630
635
|
}
|
|
631
636
|
};
|
|
637
|
+
const filterImageUrl = () => (imageUrl) => {
|
|
638
|
+
const isBase64 = /^data:image\/(png|jpg|jpeg|gif);base64,([a-zA-Z0-9+/]+={0,2})/;
|
|
639
|
+
return isBase64.test(imageUrl) ? imageUrl : xss.filterUrl(imageUrl);
|
|
640
|
+
};
|
|
632
641
|
export {
|
|
633
642
|
activeItems,
|
|
634
643
|
beforeDestroy,
|
|
@@ -640,6 +649,8 @@ export {
|
|
|
640
649
|
computedIsSingle,
|
|
641
650
|
deviceSupportInstall,
|
|
642
651
|
deviceSupportUninstall,
|
|
652
|
+
filterImageUrl,
|
|
653
|
+
getCenterPosition,
|
|
643
654
|
getDefaultPrev,
|
|
644
655
|
getImageWidth,
|
|
645
656
|
getLastPrev,
|
package/image-viewer/vue.js
CHANGED
|
@@ -34,7 +34,9 @@ import {
|
|
|
34
34
|
selectOption,
|
|
35
35
|
langClick,
|
|
36
36
|
getLastPrev,
|
|
37
|
-
getDefaultPrev
|
|
37
|
+
getDefaultPrev,
|
|
38
|
+
getCenterPosition,
|
|
39
|
+
filterImageUrl
|
|
38
40
|
} from "./index";
|
|
39
41
|
const api = [
|
|
40
42
|
"state",
|
|
@@ -72,7 +74,7 @@ const initState = ({ reactive, computed, api: api2, mode, props, constants, inje
|
|
|
72
74
|
mfPreviewVisible: inject("mfPreviewVisible", null),
|
|
73
75
|
scale: 1,
|
|
74
76
|
time: null,
|
|
75
|
-
index: mode
|
|
77
|
+
index: mode === "pc" || mode === "mobile-first" ? 0 : props.startPosition,
|
|
76
78
|
imageName: "",
|
|
77
79
|
isShow: false,
|
|
78
80
|
infinite: true,
|
|
@@ -111,7 +113,8 @@ const initState = ({ reactive, computed, api: api2, mode, props, constants, inje
|
|
|
111
113
|
fileName: "",
|
|
112
114
|
scrollTop: 0,
|
|
113
115
|
thumbnailTop: constants.THUMBNAILTOP,
|
|
114
|
-
menuTop: constants.MENUTOP
|
|
116
|
+
menuTop: constants.MENUTOP,
|
|
117
|
+
centerIndex: -1
|
|
115
118
|
});
|
|
116
119
|
return state;
|
|
117
120
|
};
|
|
@@ -135,7 +138,7 @@ const initApi = ({ api: api2, state, props, parent, nextTick, emit, t, constants
|
|
|
135
138
|
computedIsLast: computedIsLast({ state, props }),
|
|
136
139
|
watchVisible: watchVisible(state),
|
|
137
140
|
deviceSupportUninstall: deviceSupportUninstall({ state, mode }),
|
|
138
|
-
computedCurrentImg: computedCurrentImg(state),
|
|
141
|
+
computedCurrentImg: computedCurrentImg({ state, api: api2 }),
|
|
139
142
|
computedImgStyle: computedImgStyle({ state, constants }),
|
|
140
143
|
computeZIndex: computeZIndex({ constants, props }),
|
|
141
144
|
hide: hide({ props, api: api2, state }),
|
|
@@ -152,7 +155,9 @@ const initApi = ({ api: api2, state, props, parent, nextTick, emit, t, constants
|
|
|
152
155
|
selectOption: selectOption({ state, api: api2 }),
|
|
153
156
|
langClick: langClick(state),
|
|
154
157
|
getLastPrev: getLastPrev({ state, vm }),
|
|
155
|
-
getDefaultPrev: getDefaultPrev({ state, vm })
|
|
158
|
+
getDefaultPrev: getDefaultPrev({ state, vm }),
|
|
159
|
+
getCenterPosition: getCenterPosition({ state, vm }),
|
|
160
|
+
filterImageUrl: filterImageUrl()
|
|
156
161
|
});
|
|
157
162
|
};
|
|
158
163
|
const initWatch = ({ watch, state, api: api2, props, nextTick, vm }) => {
|
|
@@ -198,6 +203,13 @@ const initWatch = ({ watch, state, api: api2, props, nextTick, vm }) => {
|
|
|
198
203
|
api2.getImageWidth();
|
|
199
204
|
})
|
|
200
205
|
);
|
|
206
|
+
watch(
|
|
207
|
+
() => props.urlList,
|
|
208
|
+
() => {
|
|
209
|
+
state.urlList = props.urlList;
|
|
210
|
+
},
|
|
211
|
+
{ deep: true }
|
|
212
|
+
);
|
|
201
213
|
};
|
|
202
214
|
const renderless = (props, { computed, onMounted, onBeforeUnmount, onUpdated, reactive, watch, inject, provide }, { t, parent, nextTick, emit, constants, vm, mode }) => {
|
|
203
215
|
const api2 = {};
|
package/input/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { omitText } from "../common/string";
|
|
2
3
|
const HIDDEN_STYLE = `
|
|
3
4
|
height:0 !important;visibility:hidden !important;overflow:hidden !important;
|
|
4
5
|
position:absolute !important;z-index:-1000 !important;top:0 !important;right:0 !important
|
|
@@ -56,6 +57,12 @@ const calcTextareaHeight = ({
|
|
|
56
57
|
props,
|
|
57
58
|
state
|
|
58
59
|
}) => (targetElement, minRows = 1, maxRows = null) => {
|
|
60
|
+
if (!targetElement) {
|
|
61
|
+
return {
|
|
62
|
+
minHeight: "",
|
|
63
|
+
height: ""
|
|
64
|
+
};
|
|
65
|
+
}
|
|
59
66
|
if (!hiddenTextarea) {
|
|
60
67
|
hiddenTextarea = document.createElement("textarea");
|
|
61
68
|
document.body.appendChild(hiddenTextarea);
|
|
@@ -76,7 +83,7 @@ const calcTextareaHeight = ({
|
|
|
76
83
|
minHeight = minHeight + paddingSize + borderSize;
|
|
77
84
|
}
|
|
78
85
|
if (props.size) {
|
|
79
|
-
minHeight = props.size
|
|
86
|
+
minHeight = props.size === "mini" ? minHeight * 0.67 : props.size === "small" ? minHeight : minHeight * 1.17;
|
|
80
87
|
}
|
|
81
88
|
if (props.height) {
|
|
82
89
|
minHeight = props.height;
|
|
@@ -110,7 +117,8 @@ const handleBlur = ({
|
|
|
110
117
|
eventName,
|
|
111
118
|
emit,
|
|
112
119
|
props,
|
|
113
|
-
state
|
|
120
|
+
state,
|
|
121
|
+
vm
|
|
114
122
|
}) => (event) => {
|
|
115
123
|
state.focused = false;
|
|
116
124
|
emit("blur", event);
|
|
@@ -118,6 +126,9 @@ const handleBlur = ({
|
|
|
118
126
|
if (props.validateEvent) {
|
|
119
127
|
api.dispatch(componentName, eventName, [props.modelValue]);
|
|
120
128
|
}
|
|
129
|
+
if (props.hoverExpand) {
|
|
130
|
+
vm.$refs.textarea.scrollTop = 0;
|
|
131
|
+
}
|
|
121
132
|
};
|
|
122
133
|
const handleFocus = ({ api, emit, state }) => (event) => {
|
|
123
134
|
state.focused = true;
|
|
@@ -137,7 +148,7 @@ const handleInput = ({ api, emit, nextTick, state }) => (event) => {
|
|
|
137
148
|
nextTick(api.setNativeInputValue);
|
|
138
149
|
};
|
|
139
150
|
const handleChange = (emit) => (event) => emit("change", event.target.value);
|
|
140
|
-
const resizeTextarea = ({ api, parent,
|
|
151
|
+
const resizeTextarea = ({ api, parent, vm, state, props }) => () => {
|
|
141
152
|
if (isServer) {
|
|
142
153
|
return;
|
|
143
154
|
}
|
|
@@ -145,15 +156,22 @@ const resizeTextarea = ({ api, parent, refs, state }) => () => {
|
|
|
145
156
|
if (type !== "textarea") {
|
|
146
157
|
return;
|
|
147
158
|
}
|
|
159
|
+
if (props.hoverExpand && !state.enteredTextarea) {
|
|
160
|
+
state.textareaCalcStyle = {
|
|
161
|
+
minHeight: state.textareaHeight,
|
|
162
|
+
height: state.textareaHeight
|
|
163
|
+
};
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
148
166
|
if (!autosize) {
|
|
149
167
|
state.textareaCalcStyle = {
|
|
150
|
-
minHeight: api.calcTextareaHeight(refs.textarea).minHeight
|
|
168
|
+
minHeight: api.calcTextareaHeight(vm.$refs.textarea).minHeight
|
|
151
169
|
};
|
|
152
170
|
return;
|
|
153
171
|
}
|
|
154
172
|
const minRows = autosize.minRows;
|
|
155
173
|
const maxRows = autosize.maxRows;
|
|
156
|
-
state.textareaCalcStyle = api.calcTextareaHeight(refs.textarea, minRows, maxRows);
|
|
174
|
+
state.textareaCalcStyle = api.calcTextareaHeight(vm.$refs.textarea, minRows, maxRows);
|
|
157
175
|
};
|
|
158
176
|
const setNativeInputValue = ({ api, state }) => () => {
|
|
159
177
|
const input = api.getInput();
|
|
@@ -222,7 +240,7 @@ const handlePasswordVisible = ({ api, nextTick, state }) => () => {
|
|
|
222
240
|
state.passwordVisible = !state.passwordVisible;
|
|
223
241
|
nextTick(api.focus);
|
|
224
242
|
};
|
|
225
|
-
const getSuffixVisible = ({ parent, props, state }) => () => parent.$slots.suffix || props.suffixIcon || state.showClear || props.showPassword || state.isWordLimitVisible || state.validateState && state.needStatusIcon;
|
|
243
|
+
const getSuffixVisible = ({ parent, props, state }) => () => parent.$slots.suffix || props.suffixIcon || state.showClear || props.showPassword || state.isWordLimitVisible || state.validateState && state.needStatusIcon || props.mask && state.inputDisabled;
|
|
226
244
|
const textLength = (value) => {
|
|
227
245
|
if (typeof value === "number") {
|
|
228
246
|
return String(value).length;
|
|
@@ -243,8 +261,25 @@ const hasSelection = (api) => () => {
|
|
|
243
261
|
};
|
|
244
262
|
const handleEnterDisplayOnlyContent = ({ state, props }) => ($event, type) => {
|
|
245
263
|
const target = $event.target;
|
|
246
|
-
|
|
264
|
+
state.displayOnlyTooltip = "";
|
|
265
|
+
if (!target) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const isOverText = target.scrollWidth > target.offsetWidth || type === "textarea" && target.scrollHeight > target.offsetHeight;
|
|
269
|
+
if (isOverText) {
|
|
247
270
|
state.displayOnlyTooltip = props.displayOnlyContent || state.nativeInputValue;
|
|
271
|
+
} else {
|
|
272
|
+
let isOverTextWhenMask = false;
|
|
273
|
+
if (props.mask && state.maskValueVisible) {
|
|
274
|
+
const text = target.textContent;
|
|
275
|
+
const font = window.getComputedStyle(target).font;
|
|
276
|
+
const rect = target.getBoundingClientRect();
|
|
277
|
+
const iconWidth = 16 + 15;
|
|
278
|
+
isOverTextWhenMask = omitText(text, font, rect.width - iconWidth).o;
|
|
279
|
+
}
|
|
280
|
+
if (isOverTextWhenMask) {
|
|
281
|
+
state.displayOnlyTooltip = props.displayOnlyContent || state.nativeInputValue;
|
|
282
|
+
}
|
|
248
283
|
}
|
|
249
284
|
};
|
|
250
285
|
const hiddenPassword = ({ state, props }) => () => {
|
|
@@ -255,30 +290,53 @@ const hiddenPassword = ({ state, props }) => () => {
|
|
|
255
290
|
}
|
|
256
291
|
return str;
|
|
257
292
|
};
|
|
258
|
-
const
|
|
259
|
-
if (state.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
});
|
|
293
|
+
const getDisplayedMaskValue = ({ state }) => () => {
|
|
294
|
+
if (state.maskValueVisible) {
|
|
295
|
+
return state.nativeInputValue;
|
|
296
|
+
} else {
|
|
297
|
+
return state.nativeInputValue && state.maskSymbol;
|
|
264
298
|
}
|
|
265
299
|
};
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
300
|
+
const setInputDomValue = ({ state, props, nextTick, vm }) => (type) => {
|
|
301
|
+
nextTick(() => {
|
|
302
|
+
const input = vm.$refs.input;
|
|
303
|
+
if (props.mask && state.nativeInputValue && input) {
|
|
304
|
+
input.value = state.maskValueVisible || !state.inputDisabled ? state.nativeInputValue : state.maskSymbol;
|
|
305
|
+
}
|
|
306
|
+
if (type === "mask" && !props.mask && input) {
|
|
307
|
+
input.value = state.nativeInputValue;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
const handleEnterTextarea = ({ api, state, props, nextTick }) => () => {
|
|
312
|
+
if (props.hoverExpand && !state.isDisplayOnly) {
|
|
313
|
+
state.enteredTextarea = true;
|
|
314
|
+
nextTick(api.resizeTextarea);
|
|
271
315
|
}
|
|
272
316
|
};
|
|
317
|
+
const handleLeaveTextarea = ({ api, state, props, nextTick, vm }) => () => {
|
|
318
|
+
if (props.hoverExpand && !state.isDisplayOnly) {
|
|
319
|
+
state.enteredTextarea = false;
|
|
320
|
+
nextTick(() => {
|
|
321
|
+
api.resizeTextarea();
|
|
322
|
+
vm.$refs.textarea.scrollTop = 0;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const getDisplayOnlyText = ({ parent, state, props }) => () => {
|
|
327
|
+
const text = props.displayOnlyContent || state.nativeInputValue;
|
|
328
|
+
const showEmptyValue = typeof props.showEmptyValue === "boolean" ? props.showEmptyValue : (parent.tinyForm || {}).showEmptyValue;
|
|
329
|
+
return showEmptyValue ? text : text || "-";
|
|
330
|
+
};
|
|
273
331
|
export {
|
|
274
332
|
blur,
|
|
275
333
|
calcIconOffset,
|
|
276
334
|
calcTextareaHeight,
|
|
277
335
|
calculateNodeStyling,
|
|
278
336
|
clear,
|
|
279
|
-
dispatchDisplayedValue,
|
|
280
337
|
focus,
|
|
281
|
-
|
|
338
|
+
getDisplayOnlyText,
|
|
339
|
+
getDisplayedMaskValue,
|
|
282
340
|
getInput,
|
|
283
341
|
getSuffixVisible,
|
|
284
342
|
handleBlur,
|
|
@@ -287,14 +345,17 @@ export {
|
|
|
287
345
|
handleCompositionStart,
|
|
288
346
|
handleCompositionUpdate,
|
|
289
347
|
handleEnterDisplayOnlyContent,
|
|
348
|
+
handleEnterTextarea,
|
|
290
349
|
handleFocus,
|
|
291
350
|
handleInput,
|
|
351
|
+
handleLeaveTextarea,
|
|
292
352
|
handlePasswordVisible,
|
|
293
353
|
hasSelection,
|
|
294
354
|
hiddenPassword,
|
|
295
355
|
inputStyle,
|
|
296
356
|
resizeTextarea,
|
|
297
357
|
select,
|
|
358
|
+
setInputDomValue,
|
|
298
359
|
setNativeInputValue,
|
|
299
360
|
showBox,
|
|
300
361
|
textLength,
|
package/input/vue.js
CHANGED
|
@@ -29,9 +29,12 @@ import {
|
|
|
29
29
|
hasSelection,
|
|
30
30
|
handleEnterDisplayOnlyContent,
|
|
31
31
|
hiddenPassword,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
inputStyle
|
|
32
|
+
setInputDomValue,
|
|
33
|
+
getDisplayedMaskValue,
|
|
34
|
+
inputStyle,
|
|
35
|
+
handleEnterTextarea,
|
|
36
|
+
handleLeaveTextarea,
|
|
37
|
+
getDisplayOnlyText
|
|
35
38
|
} from "./index";
|
|
36
39
|
import useStorageBox from "../tall-storage/vue-storage-box";
|
|
37
40
|
const api = [
|
|
@@ -65,7 +68,9 @@ const api = [
|
|
|
65
68
|
"hasSelection",
|
|
66
69
|
"handleEnterDisplayOnlyContent",
|
|
67
70
|
"hiddenPassword",
|
|
68
|
-
"inputStyle"
|
|
71
|
+
"inputStyle",
|
|
72
|
+
"handleEnterTextarea",
|
|
73
|
+
"handleLeaveTextarea"
|
|
69
74
|
];
|
|
70
75
|
const initState = ({
|
|
71
76
|
reactive,
|
|
@@ -74,22 +79,28 @@ const initState = ({
|
|
|
74
79
|
props,
|
|
75
80
|
parent,
|
|
76
81
|
constants,
|
|
77
|
-
api: api2
|
|
82
|
+
api: api2,
|
|
83
|
+
vm
|
|
78
84
|
}) => {
|
|
79
85
|
const state = reactive({
|
|
80
86
|
mode,
|
|
87
|
+
maskSymbol: constants.MASKSYMBOL,
|
|
81
88
|
focused: false,
|
|
82
89
|
hovering: false,
|
|
83
90
|
isComposing: false,
|
|
84
91
|
passwordVisible: false,
|
|
92
|
+
maskValueVisible: false,
|
|
85
93
|
boxVisibility: false,
|
|
86
94
|
textareaCalcStyle: {},
|
|
87
95
|
checkedLabel: "",
|
|
96
|
+
enteredTextarea: false,
|
|
88
97
|
sheetvalue: props.modelValue,
|
|
89
98
|
inputSize: computed(() => props.size || state.formItemSize),
|
|
99
|
+
inputSizeMf: computed(() => props.size || (parent.tinyForm || {}).size),
|
|
90
100
|
showClear: computed(
|
|
91
101
|
() => props.clearable && !state.inputDisabled && !props.readonly && state.nativeInputValue && (state.focused || state.hovering)
|
|
92
102
|
),
|
|
103
|
+
textareaHeight: vm.theme === "saas" ? "28px" : "30px",
|
|
93
104
|
upperLimit: computed(() => parent.$attrs.maxlength),
|
|
94
105
|
textLength: computed(() => textLength(props.modelValue)),
|
|
95
106
|
inputExceed: computed(() => state.isWordLimitVisible && state.textLength > state.upperLimit),
|
|
@@ -119,7 +130,9 @@ const initState = ({
|
|
|
119
130
|
() => (props.displayOnly || (parent.tinyForm || {}).displayOnly) && ["text", "textarea", "password", "number"].includes(props.type)
|
|
120
131
|
),
|
|
121
132
|
displayOnlyTooltip: "",
|
|
122
|
-
hiddenPassword: computed(() => api2.hiddenPassword())
|
|
133
|
+
hiddenPassword: computed(() => api2.hiddenPassword()),
|
|
134
|
+
displayedMaskValue: computed(() => api2.getDisplayedMaskValue()),
|
|
135
|
+
displayOnlyText: computed(() => api2.getDisplayOnlyText())
|
|
123
136
|
});
|
|
124
137
|
return state;
|
|
125
138
|
};
|
|
@@ -132,7 +145,8 @@ const initApi = ({
|
|
|
132
145
|
vm,
|
|
133
146
|
props,
|
|
134
147
|
CLASS_PREFIX,
|
|
135
|
-
parent
|
|
148
|
+
parent,
|
|
149
|
+
nextTick
|
|
136
150
|
}) => {
|
|
137
151
|
Object.assign(api2, {
|
|
138
152
|
state,
|
|
@@ -148,8 +162,10 @@ const initApi = ({
|
|
|
148
162
|
calculateNodeStyling: calculateNodeStyling(),
|
|
149
163
|
handleCompositionStart: handleCompositionStart(state),
|
|
150
164
|
handleCompositionUpdate: handleCompositionUpdate(state),
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
setInputDomValue: setInputDomValue({ state, props, nextTick, vm }),
|
|
166
|
+
getDisplayOnlyText: getDisplayOnlyText({ parent, props, state }),
|
|
167
|
+
handleEnterTextarea: handleEnterTextarea({ api: api2, state, props, nextTick }),
|
|
168
|
+
handleLeaveTextarea: handleLeaveTextarea({ api: api2, state, props, nextTick, vm }),
|
|
153
169
|
inputStyle: inputStyle({ props })
|
|
154
170
|
});
|
|
155
171
|
};
|
|
@@ -163,7 +179,7 @@ const mergeApi = ({
|
|
|
163
179
|
nextTick,
|
|
164
180
|
parent,
|
|
165
181
|
state,
|
|
166
|
-
|
|
182
|
+
vm
|
|
167
183
|
}) => {
|
|
168
184
|
const { storageData, isMemoryStorage, addMemory, searchMemory, selectedMemory } = storages;
|
|
169
185
|
return Object.assign(api2, {
|
|
@@ -181,11 +197,12 @@ const mergeApi = ({
|
|
|
181
197
|
emit,
|
|
182
198
|
eventName: eventName.blur,
|
|
183
199
|
props,
|
|
184
|
-
state
|
|
200
|
+
state,
|
|
201
|
+
vm
|
|
185
202
|
}),
|
|
186
203
|
handleFocus: handleFocus({ api: api2, emit, state }),
|
|
187
204
|
handleInput: handleInput({ api: api2, emit, nextTick, state }),
|
|
188
|
-
resizeTextarea: resizeTextarea({ api: api2, parent,
|
|
205
|
+
resizeTextarea: resizeTextarea({ api: api2, parent, vm, state, props }),
|
|
189
206
|
updateIconOffset: updateIconOffset(api2),
|
|
190
207
|
calcTextareaHeight: calcTextareaHeight({
|
|
191
208
|
api: api2,
|
|
@@ -198,7 +215,8 @@ const mergeApi = ({
|
|
|
198
215
|
handlePasswordVisible: handlePasswordVisible({ api: api2, nextTick, state }),
|
|
199
216
|
hasSelection: hasSelection(api2),
|
|
200
217
|
handleEnterDisplayOnlyContent: handleEnterDisplayOnlyContent({ state, props }),
|
|
201
|
-
hiddenPassword: hiddenPassword({ state, props })
|
|
218
|
+
hiddenPassword: hiddenPassword({ state, props }),
|
|
219
|
+
getDisplayedMaskValue: getDisplayedMaskValue({ state })
|
|
202
220
|
});
|
|
203
221
|
};
|
|
204
222
|
const initWatch = ({
|
|
@@ -222,6 +240,15 @@ const initWatch = ({
|
|
|
222
240
|
if (props.validateEvent) {
|
|
223
241
|
api2.dispatch(componentName, eventName.change, [value]);
|
|
224
242
|
}
|
|
243
|
+
api2.setInputDomValue();
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
watch(() => state.maskValueVisible, api2.setInputDomValue);
|
|
247
|
+
watch(() => state.inputDisabled, api2.setInputDomValue);
|
|
248
|
+
watch(
|
|
249
|
+
() => props.mask,
|
|
250
|
+
() => {
|
|
251
|
+
api2.setInputDomValue("mask");
|
|
225
252
|
}
|
|
226
253
|
);
|
|
227
254
|
watch(
|
|
@@ -252,7 +279,6 @@ const initWatch = ({
|
|
|
252
279
|
api2.setNativeInputValue();
|
|
253
280
|
api2.resizeTextarea();
|
|
254
281
|
api2.updateIconOffset();
|
|
255
|
-
api2.dispatchDisplayedValue();
|
|
256
282
|
});
|
|
257
283
|
}
|
|
258
284
|
);
|
|
@@ -270,17 +296,17 @@ const renderless = (props, { computed, onMounted, onUpdated, reactive, toRefs, w
|
|
|
270
296
|
Input: constants.inputMode(mode),
|
|
271
297
|
InputGroup: constants.inputGroupMode(mode)
|
|
272
298
|
};
|
|
273
|
-
const state = initState({ reactive, computed, mode, props, parent, constants, api: api2 });
|
|
274
|
-
initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent, vm });
|
|
299
|
+
const state = initState({ reactive, computed, mode, props, parent, constants, api: api2, vm });
|
|
300
|
+
initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent, vm, nextTick });
|
|
275
301
|
const storages = useStorageBox({ api: api2, props, reactive, toRefs });
|
|
276
302
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
277
|
-
mergeApi({ api: api2, storages, componentName, emit, eventName, props, state, nextTick, parent,
|
|
303
|
+
mergeApi({ api: api2, storages, componentName, emit, eventName, props, state, nextTick, parent, vm });
|
|
278
304
|
initWatch({ watch, state, api: api2, props, nextTick, emit, componentName, eventName });
|
|
279
305
|
onMounted(() => {
|
|
280
306
|
api2.setNativeInputValue();
|
|
281
307
|
api2.resizeTextarea();
|
|
282
308
|
api2.updateIconOffset();
|
|
283
|
-
api2.
|
|
309
|
+
api2.setInputDomValue();
|
|
284
310
|
dispatch("Select", "input-mounted", vm.$el);
|
|
285
311
|
dispatch("Tooltip", "tooltip-update", vm.$el);
|
|
286
312
|
});
|