@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/rich-text/vue.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import {
|
|
3
|
+
initContent,
|
|
4
|
+
initQuill,
|
|
5
|
+
setToolbarTips,
|
|
6
|
+
setPlaceholder,
|
|
7
|
+
getFileUploadUrl,
|
|
8
|
+
selectionChange,
|
|
9
|
+
textChange,
|
|
10
|
+
mounted,
|
|
11
|
+
beforeUnmount,
|
|
12
|
+
maxLength,
|
|
13
|
+
handlePaste,
|
|
14
|
+
isDisplayOnly
|
|
15
|
+
} from "./index";
|
|
16
|
+
const api = [
|
|
17
|
+
"state",
|
|
18
|
+
"initContent",
|
|
19
|
+
"initQuill",
|
|
20
|
+
"setToolbarTips",
|
|
21
|
+
"setPlaceholder",
|
|
22
|
+
"selectionChange",
|
|
23
|
+
"textChange",
|
|
24
|
+
"handlePaste"
|
|
25
|
+
];
|
|
26
|
+
const initState = ({ reactive, props, computed, api: api2 }) => {
|
|
27
|
+
const state = reactive({
|
|
28
|
+
innerOptions: {},
|
|
29
|
+
innerContent: "",
|
|
30
|
+
fileUploadUrl: props.fileUpload && props.fileUpload.url || "",
|
|
31
|
+
content: props.modelValue || props.content,
|
|
32
|
+
maxLength: computed(() => api2.maxLength()),
|
|
33
|
+
pasteCanceled: false,
|
|
34
|
+
isDisplayOnly: computed(() => api2.isDisplayOnly())
|
|
35
|
+
});
|
|
36
|
+
return state;
|
|
37
|
+
};
|
|
38
|
+
const initApi = (args) => {
|
|
39
|
+
let { api: api2, props, state, emit, service, nextTick, t, vm, i18n, watch, constants, parent } = args;
|
|
40
|
+
let { Quill, ImageDrop, ImageUpload, FileUpload, Modal } = args;
|
|
41
|
+
Object.assign(api2, {
|
|
42
|
+
state,
|
|
43
|
+
initContent: initContent({ state, props, nextTick }),
|
|
44
|
+
initQuill: initQuill({ service, emit, props, api: api2, state, vm, ImageDrop, FileUpload, ImageUpload, Quill }),
|
|
45
|
+
setToolbarTips: setToolbarTips({ t, vm }),
|
|
46
|
+
setPlaceholder: setPlaceholder({ state, props }),
|
|
47
|
+
getFileUploadUrl: getFileUploadUrl({ service }),
|
|
48
|
+
selectionChange: selectionChange({ emit, state }),
|
|
49
|
+
textChange: textChange({ emit, vm, state, Modal, t }),
|
|
50
|
+
mounted: mounted({ api: api2, props, state, i18n, watch }),
|
|
51
|
+
beforeUnmount: beforeUnmount({ api: api2, state }),
|
|
52
|
+
maxLength: maxLength({ props, constants }),
|
|
53
|
+
handlePaste: handlePaste({ state }),
|
|
54
|
+
isDisplayOnly: isDisplayOnly({ state, props, parent, nextTick })
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const initWatch = ({ watch, props, api: api2, state }) => {
|
|
58
|
+
watch(
|
|
59
|
+
() => props.modelValue,
|
|
60
|
+
(val) => {
|
|
61
|
+
state.content = val;
|
|
62
|
+
api2.initContent();
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
watch(
|
|
66
|
+
() => props.content,
|
|
67
|
+
(val) => {
|
|
68
|
+
state.content = val;
|
|
69
|
+
api2.initContent();
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
watch(
|
|
73
|
+
() => props.disabled,
|
|
74
|
+
(param) => {
|
|
75
|
+
if (state.quill) {
|
|
76
|
+
state.quill.enable(!param);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
watch(
|
|
81
|
+
() => props.options.placeholder,
|
|
82
|
+
() => {
|
|
83
|
+
api2.setPlaceholder();
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed, inject }, { service, emit, t, nextTick, vm, i18n, constants, parent }, { Quill, ImageDrop, ImageUpload, FileUpload, Modal }) => {
|
|
88
|
+
parent.auiForm = parent.auiForm || inject("form", null);
|
|
89
|
+
const api2 = {};
|
|
90
|
+
const state = initState({ reactive, props, computed, api: api2, parent });
|
|
91
|
+
const args = { api: api2, props, state, emit, service, nextTick, t, vm, i18n, watch, constants, parent };
|
|
92
|
+
Object.assign(args, { Quill, ImageDrop, ImageUpload, FileUpload, Modal });
|
|
93
|
+
initApi(args);
|
|
94
|
+
initWatch({ watch, props, api: api2, state });
|
|
95
|
+
onMounted(api2.mounted);
|
|
96
|
+
onBeforeUnmount(api2.beforeUnmount);
|
|
97
|
+
return api2;
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
api,
|
|
101
|
+
renderless
|
|
102
|
+
};
|
|
@@ -58,7 +58,7 @@ const tableMouseMove = (state, vm) => (e) => {
|
|
|
58
58
|
state.flagX = Math.ceil((e.x - x) / 30);
|
|
59
59
|
state.flagY = Math.ceil((e.y - y) / 30);
|
|
60
60
|
};
|
|
61
|
-
const tableChoose = (state
|
|
61
|
+
const tableChoose = (state) => () => {
|
|
62
62
|
if (state.flagX && state.flagY) {
|
|
63
63
|
state.editor.chain().focus().insertTable({ rows: state.flagY, cols: state.flagX, withHeaderRow: true }).run();
|
|
64
64
|
}
|
|
@@ -70,7 +70,7 @@ const toggleTablePanel = (state) => () => {
|
|
|
70
70
|
const closeTablePanel = (state) => () => {
|
|
71
71
|
state.isShowTable && (state.isShowTable = false);
|
|
72
72
|
};
|
|
73
|
-
const shouldShow = ({ editor
|
|
73
|
+
const shouldShow = ({ editor }) => {
|
|
74
74
|
return editor.isActive("table");
|
|
75
75
|
};
|
|
76
76
|
const eventMap = /* @__PURE__ */ new Map();
|
|
@@ -27,7 +27,7 @@ const api = [
|
|
|
27
27
|
"eventClick",
|
|
28
28
|
"Active"
|
|
29
29
|
];
|
|
30
|
-
const renderless = (props, { computed,
|
|
30
|
+
const renderless = (props, { computed, onBeforeUnmount, reactive }, { vm, emit }, {
|
|
31
31
|
Editor,
|
|
32
32
|
StarterKit,
|
|
33
33
|
Table,
|
|
@@ -235,10 +235,7 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, ref
|
|
|
235
235
|
emit("create", { editor });
|
|
236
236
|
},
|
|
237
237
|
onUpdate({ editor }) {
|
|
238
|
-
const json = editor.getJSON();
|
|
239
238
|
const html = editor.getHTML();
|
|
240
|
-
const text = editor.getText();
|
|
241
|
-
const lineText = editor.getText({ blockSeparator: "--" });
|
|
242
239
|
emit("update", { editor });
|
|
243
240
|
emit("update:modelValue", html);
|
|
244
241
|
},
|
|
@@ -260,7 +257,7 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, ref
|
|
|
260
257
|
}, props.options);
|
|
261
258
|
let options = Object.assign(defaultOptions, props.options);
|
|
262
259
|
const state = reactive({
|
|
263
|
-
editor:
|
|
260
|
+
editor: new Editor(options),
|
|
264
261
|
toolbar: computed(() => props.customToolBar.length ? props.customToolBar : defaultToolBar),
|
|
265
262
|
// table 变量
|
|
266
263
|
isShowTable: false,
|
package/scrollbar/index.js
CHANGED
|
@@ -37,10 +37,10 @@ const clickThumbHandler = ({ api, state }) => (event) => {
|
|
|
37
37
|
api.startDrag(event);
|
|
38
38
|
state[state.bar.axis] = event.currentTarget[state.bar.offset] - (event[state.bar.client] - event.currentTarget.getBoundingClientRect()[state.bar.direction]);
|
|
39
39
|
};
|
|
40
|
-
const clickTrackHandler = ({
|
|
40
|
+
const clickTrackHandler = ({ vm, state }) => (event) => {
|
|
41
41
|
const offset = Math.abs(event.target.getBoundingClientRect()[state.bar.direction] - event[state.bar.client]);
|
|
42
|
-
const thumbHalf = refs.thumb[state.bar.offset] / 2;
|
|
43
|
-
const thumbPositionPercentage = (offset - thumbHalf) * 100 / refs.bar[state.bar.offset];
|
|
42
|
+
const thumbHalf = vm.$refs.thumb[state.bar.offset] / 2;
|
|
43
|
+
const thumbPositionPercentage = (offset - thumbHalf) * 100 / vm.$refs.bar[state.bar.offset];
|
|
44
44
|
state.wrap[state.bar.scroll] = thumbPositionPercentage * state.wrap[state.bar.scrollSize] / 100;
|
|
45
45
|
};
|
|
46
46
|
const startDrag = ({ api, on, state }) => (event) => {
|
|
@@ -50,7 +50,7 @@ const startDrag = ({ api, on, state }) => (event) => {
|
|
|
50
50
|
on(document, "mouseup", api.mouseUpDocumentHandler);
|
|
51
51
|
document.onselectstart = () => false;
|
|
52
52
|
};
|
|
53
|
-
const mouseMoveDocumentHandler = ({
|
|
53
|
+
const mouseMoveDocumentHandler = ({ vm, state }) => (event) => {
|
|
54
54
|
if (state.cursorDown === false) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -58,9 +58,9 @@ const mouseMoveDocumentHandler = ({ refs, state }) => (event) => {
|
|
|
58
58
|
if (!prevPage) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
const offset = (refs.bar.getBoundingClientRect()[state.bar.direction] - event[state.bar.client]) * -1;
|
|
62
|
-
const thumbClickPosition = refs.thumb[state.bar.offset] - prevPage;
|
|
63
|
-
const thumbPositionPercentage = (offset - thumbClickPosition) * 100 / refs.bar[state.bar.offset];
|
|
61
|
+
const offset = (vm.$refs.bar.getBoundingClientRect()[state.bar.direction] - event[state.bar.client]) * -1;
|
|
62
|
+
const thumbClickPosition = vm.$refs.thumb[state.bar.offset] - prevPage;
|
|
63
|
+
const thumbPositionPercentage = (offset - thumbClickPosition) * 100 / vm.$refs.bar[state.bar.offset];
|
|
64
64
|
state.wrap[state.bar.scroll] = thumbPositionPercentage * state.wrap[state.bar.scrollSize] / 100;
|
|
65
65
|
};
|
|
66
66
|
const mouseUpDocumentHandler = ({ api, off, state }) => () => {
|
|
@@ -69,15 +69,15 @@ const mouseUpDocumentHandler = ({ api, off, state }) => () => {
|
|
|
69
69
|
off(document, "mousemove", api.mouseMoveDocumentHandler);
|
|
70
70
|
document.onselectstart = null;
|
|
71
71
|
};
|
|
72
|
-
const handleScroll = ({
|
|
73
|
-
const wrap = refs.wrap;
|
|
72
|
+
const handleScroll = ({ vm, state, emit }) => (event) => {
|
|
73
|
+
const wrap = vm.$refs.wrap;
|
|
74
74
|
state.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
|
|
75
75
|
state.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
|
|
76
76
|
emit("scroll", event);
|
|
77
77
|
};
|
|
78
|
-
const update = ({
|
|
78
|
+
const update = ({ vm, state }) => () => {
|
|
79
79
|
let heightPercentage, widthPercentage;
|
|
80
|
-
const wrap = refs.wrap;
|
|
80
|
+
const wrap = vm.$refs.wrap;
|
|
81
81
|
if (!wrap) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
package/scrollbar/vue-bar.js
CHANGED
|
@@ -18,7 +18,7 @@ const api = [
|
|
|
18
18
|
"mouseUpDocumentHandler",
|
|
19
19
|
"mouseMoveDocumentHandler"
|
|
20
20
|
];
|
|
21
|
-
const renderless = (props, { computed, onUnmounted, reactive }, {
|
|
21
|
+
const renderless = (props, { computed, onUnmounted, reactive }, { vm, parent }) => {
|
|
22
22
|
const state = reactive({
|
|
23
23
|
bar: computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]),
|
|
24
24
|
wrap: computed(() => parent.$refs.wrap)
|
|
@@ -26,8 +26,8 @@ const renderless = (props, { computed, onUnmounted, reactive }, { refs, parent }
|
|
|
26
26
|
const api2 = {
|
|
27
27
|
state,
|
|
28
28
|
renderThumbStyle,
|
|
29
|
-
clickTrackHandler: clickTrackHandler({
|
|
30
|
-
mouseMoveDocumentHandler: mouseMoveDocumentHandler({
|
|
29
|
+
clickTrackHandler: clickTrackHandler({ vm, state }),
|
|
30
|
+
mouseMoveDocumentHandler: mouseMoveDocumentHandler({ vm, state })
|
|
31
31
|
};
|
|
32
32
|
onUnmounted(() => off(document, "mouseup", api2.mouseUpDocumentHandler));
|
|
33
33
|
return Object.assign(api2, {
|
package/scrollbar/vue.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { handleScroll, update } from "./index";
|
|
3
3
|
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
4
4
|
const api = ["state", "update", "handleScroll"];
|
|
5
|
-
const renderless = (props, { onBeforeUnmount, onMounted, reactive }, {
|
|
5
|
+
const renderless = (props, { onBeforeUnmount, onMounted, reactive }, { vm, nextTick, emit }) => {
|
|
6
6
|
const state = reactive({
|
|
7
7
|
sizeWidth: "0",
|
|
8
8
|
sizeHeight: "0",
|
|
@@ -11,21 +11,21 @@ const renderless = (props, { onBeforeUnmount, onMounted, reactive }, { refs, nex
|
|
|
11
11
|
});
|
|
12
12
|
const api2 = {
|
|
13
13
|
state,
|
|
14
|
-
update: update({
|
|
15
|
-
handleScroll: handleScroll({
|
|
14
|
+
update: update({ vm, state }),
|
|
15
|
+
handleScroll: handleScroll({ vm, state, emit })
|
|
16
16
|
};
|
|
17
17
|
onMounted(() => {
|
|
18
18
|
if (props.native) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
nextTick(api2.update);
|
|
22
|
-
!props.noresize && addResizeListener(refs.resize, api2.update);
|
|
22
|
+
!props.noresize && addResizeListener(vm.$refs.resize, api2.update);
|
|
23
23
|
});
|
|
24
24
|
onBeforeUnmount(() => {
|
|
25
25
|
if (props.native) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
!props.noresize && removeResizeListener(refs.resize, api2.update);
|
|
28
|
+
!props.noresize && removeResizeListener(vm.$refs.resize, api2.update);
|
|
29
29
|
});
|
|
30
30
|
return api2;
|
|
31
31
|
};
|
package/search/index.js
CHANGED
|
@@ -10,12 +10,12 @@ const handleChange = ({ emit, state }) => (event) => {
|
|
|
10
10
|
const value = event.target.value;
|
|
11
11
|
emit("change", state.searchValue, value);
|
|
12
12
|
};
|
|
13
|
-
const handleInput = ({ api, state }) => (event) => {
|
|
14
|
-
const value = event.target.value;
|
|
13
|
+
const handleInput = ({ api, props, state }) => (event) => {
|
|
14
|
+
const value = event.target ? event.target.value : event;
|
|
15
15
|
api.emitInput(value, state.searchValue);
|
|
16
16
|
};
|
|
17
|
-
const showSelector = ({
|
|
18
|
-
refs.selector.style.zIndex = PopupManager.nextZIndex();
|
|
17
|
+
const showSelector = ({ vm, state }) => () => {
|
|
18
|
+
vm.$refs.selector.style.zIndex = PopupManager.nextZIndex();
|
|
19
19
|
state.show = true;
|
|
20
20
|
};
|
|
21
21
|
const changeKey = ({ emit, state }) => (key) => {
|
|
@@ -31,10 +31,10 @@ const searchClick = ({ emit, props, state }) => (event) => {
|
|
|
31
31
|
emit("search", state.searchValue, state.currentValue);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const searchEnterKey = ({ api, props,
|
|
34
|
+
const searchEnterKey = ({ api, props, vm, nextTick }) => (event) => {
|
|
35
35
|
if (props.isEnterSearch) {
|
|
36
36
|
api.searchClick(event);
|
|
37
|
-
nextTick(() => refs.input.blur());
|
|
37
|
+
nextTick(() => vm.$refs.input.blur());
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
const clickOutside = ({ parent, props, state }) => (event) => {
|
|
@@ -71,13 +71,13 @@ const mounted = ({ api }) => () => {
|
|
|
71
71
|
const beforeDestroy = ({ api }) => () => {
|
|
72
72
|
off(document.body, "click", api.clickOutside);
|
|
73
73
|
};
|
|
74
|
-
const clear = ({ api, emit,
|
|
74
|
+
const clear = ({ api, emit, vm, state }) => (event) => {
|
|
75
75
|
event.preventDefault();
|
|
76
76
|
state.currentValue = "";
|
|
77
|
-
refs.input.focus();
|
|
77
|
+
vm.$refs.input.focus();
|
|
78
78
|
state.focus = true;
|
|
79
|
-
emit("change", [], "");
|
|
80
79
|
api.emitInput("", state.searchValue);
|
|
80
|
+
emit("change", [], "");
|
|
81
81
|
emit("clear");
|
|
82
82
|
};
|
|
83
83
|
export {
|
package/search/vue.js
CHANGED
|
@@ -51,7 +51,7 @@ const useFormatSearchTypes = ({ computed, props, reactive, toRefs, watch }) => {
|
|
|
51
51
|
state: toRefs(state)
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, toRefs, watch }, {
|
|
54
|
+
const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, toRefs, watch }, { vm, parent, emit, nextTick }) => {
|
|
55
55
|
const formatSearchTypes2 = useFormatSearchTypes({
|
|
56
56
|
computed,
|
|
57
57
|
props,
|
|
@@ -66,21 +66,23 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, toR
|
|
|
66
66
|
collapse: props.mini,
|
|
67
67
|
currentValue: props.modelValue
|
|
68
68
|
}, formatSearchTypes2.state), {
|
|
69
|
-
showClear: computed(() => props.clearable && (state.focus || state.hovering) && state.currentValue)
|
|
69
|
+
showClear: computed(() => props.clearable && (state.focus || state.hovering) && state.currentValue),
|
|
70
|
+
formItemSize: computed(() => (parent.formItem || {}).formItemSize),
|
|
71
|
+
searchSize: computed(() => props.size || state.formItemSize)
|
|
70
72
|
}));
|
|
71
73
|
const api2 = __spreadValues({
|
|
72
74
|
state,
|
|
73
75
|
changeKey: changeKey({ state, emit }),
|
|
74
76
|
handleChange: handleChange({ emit, state }),
|
|
75
|
-
showSelector: showSelector({
|
|
77
|
+
showSelector: showSelector({ vm, state }),
|
|
76
78
|
searchClick: searchClick({ emit, props, state }),
|
|
77
79
|
clickOutside: clickOutside({ parent, props, state }),
|
|
78
80
|
emitInput: emitInput({ emit })
|
|
79
81
|
}, formatSearchTypes2.api);
|
|
80
82
|
Object.assign(api2, {
|
|
81
|
-
clear: clear({ api: api2, emit,
|
|
82
|
-
handleInput: handleInput({ api: api2, state }),
|
|
83
|
-
searchEnterKey: searchEnterKey({ api: api2, props,
|
|
83
|
+
clear: clear({ api: api2, emit, vm, state }),
|
|
84
|
+
handleInput: handleInput({ api: api2, props, state }),
|
|
85
|
+
searchEnterKey: searchEnterKey({ api: api2, props, vm, nextTick })
|
|
84
86
|
});
|
|
85
87
|
onMounted(mounted({ api: api2 }));
|
|
86
88
|
onBeforeUnmount(beforeDestroy({ api: api2 }));
|