@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/picker/vue.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
watchIsRange,
|
|
6
6
|
parseAsFormatAndType,
|
|
7
7
|
watchPickerVisible,
|
|
8
|
+
watchMobileVisible,
|
|
8
9
|
getValueEmpty,
|
|
9
10
|
getMode,
|
|
10
11
|
displayValue,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
parseString,
|
|
25
26
|
formatToString,
|
|
26
27
|
handleMouseEnter,
|
|
28
|
+
handleInput,
|
|
27
29
|
handleChange,
|
|
28
30
|
handleStartInput,
|
|
29
31
|
handleEndInput,
|
|
@@ -53,8 +55,10 @@ import {
|
|
|
53
55
|
emitDbTime,
|
|
54
56
|
handleEnterDisplayOnlyContent,
|
|
55
57
|
handleEnterPickerlabel,
|
|
56
|
-
setInputPaddingLeft
|
|
58
|
+
setInputPaddingLeft,
|
|
59
|
+
formatInputValue
|
|
57
60
|
} from "./index";
|
|
61
|
+
import { dateMobileToggle, timeMobileToggle, dateToTimeArray, timeArrayToDate, timeMobileConfirm } from "./mb";
|
|
58
62
|
import { DATEPICKER } from "../common";
|
|
59
63
|
const api = [
|
|
60
64
|
"state",
|
|
@@ -66,9 +70,9 @@ const api = [
|
|
|
66
70
|
"handleStartChange",
|
|
67
71
|
"handleStartInput",
|
|
68
72
|
"handleKeydown",
|
|
69
|
-
"handleMouseEnter",
|
|
70
73
|
"handleClickIcon",
|
|
71
74
|
"handleMouseEnter",
|
|
75
|
+
"handleInput",
|
|
72
76
|
"handleChange",
|
|
73
77
|
"handleClose",
|
|
74
78
|
"handlePick",
|
|
@@ -76,9 +80,13 @@ const api = [
|
|
|
76
80
|
"handleSelectChange",
|
|
77
81
|
"popperElm",
|
|
78
82
|
"handleEnterDisplayOnlyContent",
|
|
79
|
-
"handleEnterPickerlabel"
|
|
83
|
+
"handleEnterPickerlabel",
|
|
84
|
+
"timeMobileToggle",
|
|
85
|
+
"timeMobileConfirm",
|
|
86
|
+
"emitInput",
|
|
87
|
+
"dateMobileToggle"
|
|
80
88
|
];
|
|
81
|
-
const initState = ({ api: api2, reactive, vm, computed, props, utils, parent }) => {
|
|
89
|
+
const initState = ({ api: api2, reactive, vm, computed, props, utils, parent, breakpoint }) => {
|
|
82
90
|
const state = reactive({
|
|
83
91
|
historyValue: [],
|
|
84
92
|
historyInput: [],
|
|
@@ -103,6 +111,7 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent })
|
|
|
103
111
|
haveTrigger: computed(() => api2.computedHaveTrigger()),
|
|
104
112
|
displayValue: computed(() => api2.displayValue()),
|
|
105
113
|
parsedValue: computed(() => api2.parsedValue()),
|
|
114
|
+
oldValue: props.modelValue,
|
|
106
115
|
pickerSize: computed(() => props.size),
|
|
107
116
|
pickerDisabled: computed(() => props.disabled || state.formDisabled || state.isDisplayOnly),
|
|
108
117
|
firstInputId: computed(() => api2.firstInputId()),
|
|
@@ -113,30 +122,58 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent })
|
|
|
113
122
|
format: computed(() => api2.computedFormat()),
|
|
114
123
|
labelTooltip: "",
|
|
115
124
|
displayOnlyTooltip: "",
|
|
116
|
-
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly)
|
|
125
|
+
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
|
|
126
|
+
isMobileScreen: computed(() => breakpoint.current.value === "default"),
|
|
127
|
+
dateMobileOption: {
|
|
128
|
+
visible: false,
|
|
129
|
+
type: props.type,
|
|
130
|
+
value: props.modelValue
|
|
131
|
+
},
|
|
132
|
+
timeMobileOption: {
|
|
133
|
+
visible: false,
|
|
134
|
+
type: props.type,
|
|
135
|
+
value: [0, 0, 0]
|
|
136
|
+
},
|
|
137
|
+
isDateMobileComponent: computed(
|
|
138
|
+
() => [
|
|
139
|
+
DATEPICKER.DateRange,
|
|
140
|
+
DATEPICKER.DateTimeRange,
|
|
141
|
+
DATEPICKER.DateTime,
|
|
142
|
+
DATEPICKER.DatePicker,
|
|
143
|
+
DATEPICKER.Date,
|
|
144
|
+
DATEPICKER.Dates
|
|
145
|
+
].includes(props.type)
|
|
146
|
+
),
|
|
147
|
+
isTimeMobileComponent: computed(
|
|
148
|
+
() => [DATEPICKER.Time, DATEPICKER.TimeRange, DATEPICKER.TimeSelect, DATEPICKER.TimePicker].includes(props.type)
|
|
149
|
+
),
|
|
150
|
+
showSeconds: computed(
|
|
151
|
+
() => (state.format || props.pickerOptions && props.pickerOptions.format || "ss").includes("ss")
|
|
152
|
+
)
|
|
117
153
|
});
|
|
118
154
|
return state;
|
|
119
155
|
};
|
|
120
|
-
const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
156
|
+
const initApi = ({ api: api2, props, hooks, state, vnode, others, utils, parent }) => {
|
|
121
157
|
const { t, emit, dispatch, nextTick, vm } = vnode;
|
|
122
158
|
const { TimePanel, TimeRangePanel } = others;
|
|
123
|
-
const { destroyPopper, popperElm, updatePopper
|
|
159
|
+
const { destroyPopper, popperElm, updatePopper } = initPopper({ props, hooks, vnode });
|
|
124
160
|
state.popperElm = popperElm;
|
|
125
161
|
state.picker = null;
|
|
126
162
|
Object.assign(api2, {
|
|
127
163
|
destroyPopper,
|
|
128
164
|
emitDbTime: emitDbTime({ emit, state, t }),
|
|
129
|
-
hidePicker: hidePicker({
|
|
130
|
-
handleSelectChange: ({ tz, date }) => emit("select-change", { tz, date }),
|
|
165
|
+
hidePicker: hidePicker({ destroyPopper, state }),
|
|
166
|
+
handleSelectChange: ({ tz, date }) => !state.ranged && emit("select-change", { tz, date }),
|
|
131
167
|
getPanel: getPanel(others),
|
|
132
|
-
handleFocus: handleFocus({ emit, vm, state }),
|
|
168
|
+
handleFocus: handleFocus({ emit, vm, state, api: api2 }),
|
|
133
169
|
getTimezone: getTimezone({ props, utils }),
|
|
134
170
|
emitChange: emitChange({ api: api2, dispatch, emit, props, state }),
|
|
135
171
|
parsedValue: parsedValue({ api: api2, props, state, t }),
|
|
136
172
|
parseAsFormatAndType: parseAsFormatAndType({ api: api2 }),
|
|
137
|
-
typeValueResolveMap: typeValueResolveMap({ api: api2, t }),
|
|
173
|
+
typeValueResolveMap: typeValueResolveMap({ api: api2, props, t }),
|
|
138
174
|
updateOptions: updateOptions({ api: api2, props, state }),
|
|
139
175
|
focus: focus({ api: api2, props, vm }),
|
|
176
|
+
handleInput: handleInput({ api: api2, state, props }),
|
|
140
177
|
handleChange: handleChange({ api: api2, state }),
|
|
141
178
|
isValidValue: isValidValue({ api: api2, state }),
|
|
142
179
|
emitInput: emitInput({ api: api2, emit, props, state }),
|
|
@@ -151,7 +188,8 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
151
188
|
handleClose: handleClose({ api: api2, props, state }),
|
|
152
189
|
displayValue: displayValue({ api: api2, props, state }),
|
|
153
190
|
handlePick: handlePick({ api: api2, state }),
|
|
154
|
-
watchPickerVisible: watchPickerVisible({ api: api2, vm, dispatch, emit, props, state }),
|
|
191
|
+
watchPickerVisible: watchPickerVisible({ api: api2, vm, dispatch, emit, props, state, nextTick }),
|
|
192
|
+
watchMobileVisible: watchMobileVisible({ api: api2, props, state }),
|
|
155
193
|
formatToString: formatToString({ api: api2, state }),
|
|
156
194
|
watchIsRange: watchIsRange({ api: api2, state, TimePanel, TimeRangePanel }),
|
|
157
195
|
mountPicker: mountPicker({ api: api2, vm, props, state, updatePopper }),
|
|
@@ -160,18 +198,25 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
160
198
|
computedTriggerClass: computedTriggerClass({ props, state }),
|
|
161
199
|
computedHaveTrigger: computedHaveTrigger({ props }),
|
|
162
200
|
setInputPaddingLeft: setInputPaddingLeft({ props, state, vm, nextTick }),
|
|
201
|
+
formatInputValue: formatInputValue({ props, state, api: api2 })
|
|
202
|
+
});
|
|
203
|
+
initApi2({ api: api2, props, state, t, parent });
|
|
204
|
+
initMobileApi({ api: api2, props, state, t, parent });
|
|
205
|
+
};
|
|
206
|
+
const initApi2 = ({ api: api2, props, state, t, parent }) => {
|
|
207
|
+
Object.assign(api2, {
|
|
163
208
|
t,
|
|
164
209
|
state,
|
|
165
210
|
blur: blur(state),
|
|
166
211
|
getMode: getMode({ state }),
|
|
167
|
-
getType: getType({ props }),
|
|
168
|
-
dateParser: dateParser({ t }),
|
|
212
|
+
getType: getType({ props, parent }),
|
|
213
|
+
dateParser: dateParser({ t, props }),
|
|
169
214
|
rangeParser: rangeParser(api2),
|
|
170
215
|
rangeFormatter: rangeFormatter(api2),
|
|
171
216
|
dateFormatter: dateFormatter({ t }),
|
|
172
217
|
getValueEmpty: getValueEmpty(props),
|
|
173
|
-
handleEndInput: handleEndInput(state),
|
|
174
|
-
handleStartInput: handleStartInput(state),
|
|
218
|
+
handleEndInput: handleEndInput({ state, props, api: api2 }),
|
|
219
|
+
handleStartInput: handleStartInput({ state, props, api: api2 }),
|
|
175
220
|
firstInputId: firstInputId({ props, state }),
|
|
176
221
|
secondInputId: secondInputId({ props, state }),
|
|
177
222
|
handleMouseEnter: handleMouseEnter({ props, state }),
|
|
@@ -182,12 +227,22 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
182
227
|
handleEnterDisplayOnlyContent: handleEnterDisplayOnlyContent({ state, t })
|
|
183
228
|
});
|
|
184
229
|
};
|
|
230
|
+
const initMobileApi = ({ api: api2, props, state }) => {
|
|
231
|
+
Object.assign(api2, {
|
|
232
|
+
dateMobileToggle: dateMobileToggle({ state, props, api: api2 }),
|
|
233
|
+
timeMobileToggle: timeMobileToggle({ state, props, api: api2 }),
|
|
234
|
+
timeMobileConfirm: timeMobileConfirm({ state, props, api: api2 }),
|
|
235
|
+
dateToTimeArray,
|
|
236
|
+
timeArrayToDate: timeArrayToDate({ state, props, api: api2 })
|
|
237
|
+
});
|
|
238
|
+
};
|
|
185
239
|
const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
186
240
|
watch(
|
|
187
241
|
() => state.type,
|
|
188
242
|
(type) => state.panel = markRaw(api2.getPanel(type)),
|
|
189
243
|
{ immediate: true }
|
|
190
244
|
);
|
|
245
|
+
watch(() => [state.dateMobileOption.visible, state.timeMobileOption.visible], api2.watchMobileVisible);
|
|
191
246
|
watch(() => state.pickerVisible, api2.watchPickerVisible);
|
|
192
247
|
watch(
|
|
193
248
|
() => props.defaultValue,
|
|
@@ -206,17 +261,18 @@ const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
|
206
261
|
const renderless = (props, hooks, vnode, others) => {
|
|
207
262
|
const api2 = {};
|
|
208
263
|
const { reactive, computed, watch, onBeforeUnmount, inject, markRaw, onMounted } = hooks;
|
|
209
|
-
const { vm, service, parent } = vnode;
|
|
264
|
+
const { vm, service, parent, useBreakpoint } = vnode;
|
|
210
265
|
const { utils = {} } = service || {};
|
|
211
|
-
const
|
|
266
|
+
const breakpoint = useBreakpoint();
|
|
267
|
+
const state = initState({ api: api2, reactive, vm, computed, props, utils, parent, inject, breakpoint });
|
|
212
268
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
213
|
-
initApi({ api: api2, props, hooks, state, vnode, others, utils });
|
|
269
|
+
initApi({ api: api2, props, hooks, state, vnode, others, utils, parent });
|
|
214
270
|
initWatch({ api: api2, state, props, watch, markRaw });
|
|
215
271
|
api2.initGlobalTimezone();
|
|
216
272
|
onMounted(() => {
|
|
217
273
|
api2.setInputPaddingLeft();
|
|
218
274
|
});
|
|
219
|
-
|
|
275
|
+
parent.$on("handle-clear", (event) => {
|
|
220
276
|
state.showClose = true;
|
|
221
277
|
api2.handleClickIcon(event);
|
|
222
278
|
});
|
package/picker-column/index.js
CHANGED
package/pop-upload/vue.js
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
fileUploadChange,
|
|
41
41
|
deleteFile
|
|
42
42
|
} from "./index";
|
|
43
|
+
import { formatFileSize } from "../common/string";
|
|
43
44
|
const api = [
|
|
44
45
|
"state",
|
|
45
46
|
"closeSuccessTips",
|
|
@@ -55,6 +56,7 @@ const api = [
|
|
|
55
56
|
"showDialog",
|
|
56
57
|
"closeDialog",
|
|
57
58
|
"fileUploadChange",
|
|
59
|
+
"formatFileSize",
|
|
58
60
|
"deleteFile"
|
|
59
61
|
];
|
|
60
62
|
const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
@@ -93,6 +95,7 @@ const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
|
93
95
|
const initApi = ({ api: api2, state, refs, emit, props, constants, t }) => {
|
|
94
96
|
Object.assign(api2, {
|
|
95
97
|
state,
|
|
98
|
+
formatFileSize,
|
|
96
99
|
abort: abort(refs),
|
|
97
100
|
showDialog: showDialog(state),
|
|
98
101
|
watchLimit: watchLimit(state),
|
package/popconfirm/index.js
CHANGED
|
@@ -5,26 +5,23 @@ const hide = ({ state, emit }) => () => {
|
|
|
5
5
|
state.isLock = false;
|
|
6
6
|
}, 300);
|
|
7
7
|
state.showPopover = false;
|
|
8
|
-
emit("hide", state.showPopover);
|
|
9
8
|
};
|
|
10
9
|
const show = ({ state, props, emit }) => (trigger) => {
|
|
11
10
|
if ((trigger ? props.trigger !== trigger : !props.reference) || state.isLock || state.showPopover) {
|
|
12
11
|
return;
|
|
13
12
|
}
|
|
14
13
|
state.showPopover = true;
|
|
15
|
-
emit("show", state.showPopover);
|
|
16
14
|
};
|
|
17
|
-
const confirm = ({ state,
|
|
15
|
+
const confirm = ({ state, api }) => () => {
|
|
18
16
|
state.showPopover = false;
|
|
19
|
-
|
|
20
|
-
emit("hide", state.showPopover);
|
|
17
|
+
api.handleEmit("confirm");
|
|
21
18
|
};
|
|
22
19
|
const handleEmit = ({ state, emit, vm }) => (type) => {
|
|
23
20
|
let { events = {} } = vm;
|
|
24
21
|
if (events[type]) {
|
|
25
22
|
events[type].call(vm, { $modal: vm, type });
|
|
26
23
|
} else {
|
|
27
|
-
emit(type, state
|
|
24
|
+
emit(type, state);
|
|
28
25
|
}
|
|
29
26
|
};
|
|
30
27
|
export {
|
package/popconfirm/vue.js
CHANGED
|
@@ -16,7 +16,7 @@ const renderless = (props, { computed, reactive }, { emit, constants, designConf
|
|
|
16
16
|
state,
|
|
17
17
|
show: show({ state, emit, props }),
|
|
18
18
|
hide: hide({ state, emit }),
|
|
19
|
-
confirm: confirm({ state,
|
|
19
|
+
confirm: confirm({ state, api: api2 }),
|
|
20
20
|
handleEmit: handleEmit({ state, emit, vm })
|
|
21
21
|
});
|
|
22
22
|
return api2;
|
package/popeditor/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
__spreadValues
|
|
3
|
-
} from "../chunk-G2ADBYYC.js";
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
4
2
|
import { find } from "../common/array";
|
|
5
3
|
import { typeOf, isNull } from "../common/type";
|
|
6
4
|
import { getDataset } from "../common/dataset";
|
|
@@ -52,7 +50,7 @@ const getDisplay = ({ constants, props, state }) => () => {
|
|
|
52
50
|
} else if (props.multi) {
|
|
53
51
|
const displayTxt = [];
|
|
54
52
|
state.selectedValues.forEach((val) => {
|
|
55
|
-
const item = find(state.selectedDatas, (data) => val
|
|
53
|
+
const item = find(state.selectedDatas, (data) => String(val) === String(data[props.valueField]));
|
|
56
54
|
if (item) {
|
|
57
55
|
displayTxt.push(item[props.textField]);
|
|
58
56
|
} else {
|
|
@@ -93,6 +91,7 @@ const handleClear = ({ constants, emit, props, state }) => () => {
|
|
|
93
91
|
state.treeSelectList = [];
|
|
94
92
|
state.selectedDatas = [];
|
|
95
93
|
state.selectedValues = [];
|
|
94
|
+
state.cacheStore.treeSelectList = [];
|
|
96
95
|
if (!isEqual(state.commitValue, props.modelValue)) {
|
|
97
96
|
emit("update:modelValue", state.commitValue);
|
|
98
97
|
emit(
|
|
@@ -122,6 +121,9 @@ const handleConfirm = ({ api, constants, emit, props, state }) => (skipBeforeClo
|
|
|
122
121
|
}
|
|
123
122
|
if (props.popseletor === constants.TYPE_TREE) {
|
|
124
123
|
const commitValue = state.treeSelectList.map((item) => item.id).join(props.valueSplit);
|
|
124
|
+
state.cacheStore = {
|
|
125
|
+
treeSelectList: state.treeSelectList.slice(0)
|
|
126
|
+
};
|
|
125
127
|
if (!isEqual(commitValue, props.modelValue)) {
|
|
126
128
|
emit("update:modelValue", commitValue);
|
|
127
129
|
emit("change", commitValue, state.treeSelectList);
|
|
@@ -143,8 +145,8 @@ const handleOpen = ({ api, constants, props, state }) => (event) => {
|
|
|
143
145
|
api.openDialog({ api, props, state });
|
|
144
146
|
}
|
|
145
147
|
};
|
|
146
|
-
const handleSearch = ({ api,
|
|
147
|
-
const sourcetable = refs[constants.GRID_REF.source];
|
|
148
|
+
const handleSearch = ({ api, vm, constants }) => () => {
|
|
149
|
+
const sourcetable = vm.$refs[constants.GRID_REF.source];
|
|
148
150
|
sourcetable && sourcetable.clearRadioRow();
|
|
149
151
|
api.query();
|
|
150
152
|
};
|
|
@@ -187,7 +189,7 @@ const renderTextHandler = ({ state, props, datas, dataset, value }) => {
|
|
|
187
189
|
arrValues = value && ~["string", "number"].indexOf(typeof value) ? value.toString().split(props.valueSplit) : [];
|
|
188
190
|
}
|
|
189
191
|
arrValues.forEach((val) => {
|
|
190
|
-
const item = find(dataset, (data) => val
|
|
192
|
+
const item = find(dataset, (data) => String(val) === String(data[props.valueField])) || find(datas, (data) => String(val) === String(data[props.valueField]));
|
|
191
193
|
item && rows.push(item);
|
|
192
194
|
});
|
|
193
195
|
if (props.multi) {
|
|
@@ -212,7 +214,7 @@ const getTreeSelectList = ({ value, state, props }) => {
|
|
|
212
214
|
eachTree(
|
|
213
215
|
state.treeOp.data,
|
|
214
216
|
(node) => {
|
|
215
|
-
if (values.
|
|
217
|
+
if (values.includes(String(node[id]))) {
|
|
216
218
|
selectdTreeNodeList.push({ id: node[id], value: node[label] });
|
|
217
219
|
}
|
|
218
220
|
},
|
|
@@ -235,7 +237,7 @@ const initDisplay = ({ api, constants, props, state, nextTick }) => (value) => {
|
|
|
235
237
|
});
|
|
236
238
|
});
|
|
237
239
|
} else {
|
|
238
|
-
const item = find(dataset, (data) => value
|
|
240
|
+
const item = find(dataset, (data) => String(value) === String(data[props.valueField]));
|
|
239
241
|
state.selectedDatas = item || value;
|
|
240
242
|
if (props.popseletor === constants.TYPE_GRID) {
|
|
241
243
|
state.commitValue = state.selectedDatas ? state.selectedDatas[props.valueField] : "";
|
|
@@ -337,17 +339,17 @@ const selectedGridSelectChange = ({ constants, props, vm, state }) => ({ checked
|
|
|
337
339
|
const len = state.selectedValues.length;
|
|
338
340
|
event && (event.target.checked = !checked);
|
|
339
341
|
for (let i = 0; i < len; i++) {
|
|
340
|
-
if (state.selectedValues[i]
|
|
342
|
+
if (String(state.selectedValues[i]) === String(row[props.valueField])) {
|
|
341
343
|
state.selectedValues.splice(i, 1);
|
|
342
344
|
state.selectedDatas.splice(i, 1);
|
|
343
345
|
const sourcetable = refs[constants.GRID_REF.source];
|
|
344
346
|
const historytable = refs[constants.GRID_REF.history];
|
|
345
347
|
sourcetable && sourcetable.setSelection(
|
|
346
|
-
sourcetable.data.filter((lrow) => lrow[props.valueField]
|
|
348
|
+
sourcetable.data.filter((lrow) => String(lrow[props.valueField]) === String(row[props.valueField])),
|
|
347
349
|
false
|
|
348
350
|
);
|
|
349
351
|
historytable && historytable.setSelection(
|
|
350
|
-
historytable.data.filter((lrow) => lrow[props.valueField]
|
|
352
|
+
historytable.data.filter((lrow) => String(lrow[props.valueField]) === String(row[props.valueField])),
|
|
351
353
|
false
|
|
352
354
|
);
|
|
353
355
|
break;
|
|
@@ -359,7 +361,7 @@ const selectedGridSelectChange = ({ constants, props, vm, state }) => ({ checked
|
|
|
359
361
|
const sourceGridSelectAll = ({ props, state, api }) => ({ selection, checked }) => {
|
|
360
362
|
if (checked) {
|
|
361
363
|
selection.forEach((item) => {
|
|
362
|
-
if (!find(state.selectedValues, (val) => val
|
|
364
|
+
if (!find(state.selectedValues, (val) => String(val) === String(item[props.valueField]))) {
|
|
363
365
|
state.selectedValues.push(item[props.valueField]);
|
|
364
366
|
state.selectedDatas.push(item);
|
|
365
367
|
}
|
|
@@ -368,7 +370,7 @@ const sourceGridSelectAll = ({ props, state, api }) => ({ selection, checked })
|
|
|
368
370
|
const len = state.sourceGridDataset.length;
|
|
369
371
|
for (let i = 0; i < len; i++) {
|
|
370
372
|
const sourceGridItem = state.sourceGridDataset[i][props.valueField];
|
|
371
|
-
const selectedItem = find(state.selectedValues, (val) => val
|
|
373
|
+
const selectedItem = find(state.selectedValues, (val) => String(val) === String(sourceGridItem));
|
|
372
374
|
const index = state.selectedValues.indexOf(selectedItem);
|
|
373
375
|
if (index !== -1) {
|
|
374
376
|
state.selectedValues.splice(index, 1);
|
|
@@ -392,7 +394,7 @@ const sourceGridSelectChange = ({ props, state, api }) => ({ checked, row, confi
|
|
|
392
394
|
state.selectedDatas.push(row);
|
|
393
395
|
} else {
|
|
394
396
|
state.selectedValues.forEach((item, index) => {
|
|
395
|
-
if (row[props.valueField]
|
|
397
|
+
if (String(row[props.valueField]) === String(item)) {
|
|
396
398
|
state.selectedValues.splice(index, 1);
|
|
397
399
|
state.selectedDatas.splice(index, 1);
|
|
398
400
|
}
|
|
@@ -431,12 +433,22 @@ const computedTreeOp = ({ api, constants }) => (props, state) => {
|
|
|
431
433
|
treeOp.checkStrictly = treeOp.checkStrictly !== false;
|
|
432
434
|
treeOp.expandOnClickNode = false;
|
|
433
435
|
treeOp.nodeKey = treeOp.nodeKey || constants.ID;
|
|
434
|
-
treeOp.defaultCheckedKeys = state.treeSelectList.map((item) => item.id);
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
436
|
+
treeOp.defaultCheckedKeys = state.cacheStore.treeSelectList && state.cacheStore.treeSelectList.map((item) => item.id);
|
|
437
|
+
const defaultLabel = props.textField || constants.LABEL;
|
|
438
|
+
const defaultId = props.valueField || constants.ID;
|
|
439
|
+
const defaultChildren = "children";
|
|
440
|
+
if (!treeOp.props) {
|
|
441
|
+
treeOp.props = {
|
|
442
|
+
label: defaultLabel,
|
|
443
|
+
id: defaultId,
|
|
444
|
+
children: defaultChildren
|
|
445
|
+
};
|
|
446
|
+
} else {
|
|
447
|
+
const { label, id, children } = treeOp.props;
|
|
448
|
+
treeOp.props.label = label || defaultLabel;
|
|
449
|
+
treeOp.props.id = id || defaultId;
|
|
450
|
+
treeOp.props.children = children || defaultChildren;
|
|
451
|
+
}
|
|
440
452
|
return treeOp;
|
|
441
453
|
};
|
|
442
454
|
const treeCheckChange = ({ constants, state, props }) => (data, checked) => {
|
|
@@ -447,15 +459,35 @@ const treeCheckChange = ({ constants, state, props }) => (data, checked) => {
|
|
|
447
459
|
state.treeSelectList = treeSelectList;
|
|
448
460
|
} else {
|
|
449
461
|
if (checked) {
|
|
450
|
-
state
|
|
451
|
-
id: data[state.treeOp.props.id],
|
|
452
|
-
value: data[state.treeOp.props.label]
|
|
453
|
-
});
|
|
462
|
+
addTreeSelectNode(data, state);
|
|
454
463
|
} else {
|
|
455
|
-
state.
|
|
464
|
+
state.removedNodeId = [];
|
|
465
|
+
getRemovedNodeId(data, state);
|
|
466
|
+
state.treeSelectList = state.treeSelectList.filter((item) => !state.removedNodeId.includes(item.id));
|
|
456
467
|
}
|
|
457
468
|
}
|
|
458
469
|
};
|
|
470
|
+
const addTreeSelectNode = (node, state) => {
|
|
471
|
+
if (!state.treeSelectList.some((item) => item.id === node[state.treeOp.props.id])) {
|
|
472
|
+
state.treeSelectList.push({
|
|
473
|
+
id: node[state.treeOp.props.id],
|
|
474
|
+
value: node[state.treeOp.props.label]
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
if (!node.expanded && Array.isArray(node.children)) {
|
|
478
|
+
node.children.forEach((child) => {
|
|
479
|
+
addTreeSelectNode(child, state);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
const getRemovedNodeId = (node, state) => {
|
|
484
|
+
state.removedNodeId.push(node[state.treeOp.props.id]);
|
|
485
|
+
if (!node.expanded && Array.isArray(node.children)) {
|
|
486
|
+
node.children.forEach((child) => {
|
|
487
|
+
getRemovedNodeId(child, state);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
};
|
|
459
491
|
const handleNumberPageChange = ({ api, emit, state }) => (size) => {
|
|
460
492
|
state.pagerConfig.currentPage = 1;
|
|
461
493
|
state.pagerConfig.pageSize = size;
|
|
@@ -500,9 +532,9 @@ const getSuggestParam = ({ state, props, api }) => (input) => {
|
|
|
500
532
|
}
|
|
501
533
|
return input;
|
|
502
534
|
};
|
|
503
|
-
const updateSuggestWidth = ({
|
|
504
|
-
|
|
505
|
-
refs.popper.style.width = $input.clientWidth + "px";
|
|
535
|
+
const updateSuggestWidth = ({ vm }) => () => {
|
|
536
|
+
const $input = vm.$refs.reference.getInput();
|
|
537
|
+
vm.$refs.popper.style.width = $input.clientWidth + "px";
|
|
506
538
|
};
|
|
507
539
|
const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
508
540
|
if (!props.suggest) {
|
|
@@ -538,7 +570,7 @@ const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
|
538
570
|
const row = find(state.selectedDatas, (node) => text === node[props.textField]);
|
|
539
571
|
api.sourceGridSelectChange({ checked: false, row, confirm: false });
|
|
540
572
|
});
|
|
541
|
-
if (addtions.length) {
|
|
573
|
+
if (!state.suggestList.length || addtions.length) {
|
|
542
574
|
doQuery(query2);
|
|
543
575
|
}
|
|
544
576
|
} else {
|
|
@@ -546,10 +578,11 @@ const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
|
546
578
|
}
|
|
547
579
|
}
|
|
548
580
|
};
|
|
549
|
-
const closeSuggestPanel = ({ state, api,
|
|
550
|
-
const
|
|
581
|
+
const closeSuggestPanel = ({ state, api, vm }) => (event = false) => {
|
|
582
|
+
const reference = vm.$refs.reference;
|
|
583
|
+
const popper = vm.$refs.popper;
|
|
551
584
|
let keep = !event;
|
|
552
|
-
if (event.target) {
|
|
585
|
+
if (event.target && reference) {
|
|
553
586
|
keep = reference.$el.contains(event.target) || popper.contains(event.target);
|
|
554
587
|
}
|
|
555
588
|
if (!keep) {
|
|
@@ -565,6 +598,11 @@ const suggestRadioChange = ({ state, api }) => ({ row }) => {
|
|
|
565
598
|
state.showSuggestPanel = false;
|
|
566
599
|
api.handleConfirm();
|
|
567
600
|
};
|
|
601
|
+
const radioChangeFn = ({ props, api }) => () => {
|
|
602
|
+
if (props.radioChangeClose) {
|
|
603
|
+
api.handleConfirm();
|
|
604
|
+
}
|
|
605
|
+
};
|
|
568
606
|
const handlePager = ({ api, props, state }) => () => {
|
|
569
607
|
if (!props.showPager) {
|
|
570
608
|
state.sourceGridDataset = state.fullGridData;
|
|
@@ -599,7 +637,7 @@ const mounted = ({ api, props }) => () => {
|
|
|
599
637
|
const doDestroy = ({ popper }) => () => {
|
|
600
638
|
popper.doDestroy();
|
|
601
639
|
};
|
|
602
|
-
const selectedBoxInit = (
|
|
640
|
+
const selectedBoxInit = (vm) => () => vm.$refs.selectedBox && vm.$refs.selectedBox.init();
|
|
603
641
|
const selectedBoxClear = (api) => () => api.selectedGridSelectAll({ checked: false });
|
|
604
642
|
const selectedBoxDelete = (api) => ({ option: row }) => api.selectedGridSelectChange({ checked: false, row });
|
|
605
643
|
const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
|
|
@@ -643,6 +681,7 @@ export {
|
|
|
643
681
|
mounted,
|
|
644
682
|
openDialog,
|
|
645
683
|
query,
|
|
684
|
+
radioChangeFn,
|
|
646
685
|
selectedBoxClear,
|
|
647
686
|
selectedBoxDelete,
|
|
648
687
|
selectedBoxDrag,
|
package/popeditor/vue.js
CHANGED
|
@@ -45,7 +45,8 @@ import {
|
|
|
45
45
|
selectedBoxInit,
|
|
46
46
|
selectedBoxClear,
|
|
47
47
|
selectedBoxDelete,
|
|
48
|
-
selectedBoxDrag
|
|
48
|
+
selectedBoxDrag,
|
|
49
|
+
radioChangeFn
|
|
49
50
|
} from "./index";
|
|
50
51
|
const api = [
|
|
51
52
|
"state",
|
|
@@ -74,7 +75,8 @@ const api = [
|
|
|
74
75
|
"doDestroy",
|
|
75
76
|
"selectedBoxClear",
|
|
76
77
|
"selectedBoxDelete",
|
|
77
|
-
"selectedBoxDrag"
|
|
78
|
+
"selectedBoxDrag",
|
|
79
|
+
"radioChangeFn"
|
|
78
80
|
];
|
|
79
81
|
const initState = ({ reactive, computed, props, api: api2, constants, t, parent, vm }) => {
|
|
80
82
|
const state = reactive({
|
|
@@ -89,6 +91,7 @@ const initState = ({ reactive, computed, props, api: api2, constants, t, parent,
|
|
|
89
91
|
commitValue: Array.isArray(props.modelValue) ? props.modelValue.slice(0) : props.modelValue,
|
|
90
92
|
currentPage: 1,
|
|
91
93
|
baseColumns: computed(() => getColumns({ constants, props })),
|
|
94
|
+
removedNodeId: [],
|
|
92
95
|
selectedDatas: [],
|
|
93
96
|
selectedValues: [],
|
|
94
97
|
sourceGridDataset: [],
|
|
@@ -118,7 +121,7 @@ const initState = ({ reactive, computed, props, api: api2, constants, t, parent,
|
|
|
118
121
|
});
|
|
119
122
|
return state;
|
|
120
123
|
};
|
|
121
|
-
const initApi = ({ api: api2, props, state, parent,
|
|
124
|
+
const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants, nextTick }) => {
|
|
122
125
|
Object.assign(api2, {
|
|
123
126
|
state,
|
|
124
127
|
popper,
|
|
@@ -139,7 +142,7 @@ const initApi = ({ api: api2, props, state, parent, refs, emit, popper, constant
|
|
|
139
142
|
handleReset: handleReset({ api: api2, state, props }),
|
|
140
143
|
openDialog: openDialog({ api: api2, emit, props, state }),
|
|
141
144
|
initDisplay: initDisplay({ api: api2, constants, props, state, nextTick }),
|
|
142
|
-
handleSearch: handleSearch({ api: api2, props, state,
|
|
145
|
+
handleSearch: handleSearch({ api: api2, props, state, vm, constants }),
|
|
143
146
|
computedTreeOp: computedTreeOp({ api: api2, constants }),
|
|
144
147
|
handleSizeChange: handleSizeChange({ api: api2, emit, state }),
|
|
145
148
|
handleOpen: handleOpen({ api: api2, constants, props, state }),
|
|
@@ -148,10 +151,10 @@ const initApi = ({ api: api2, props, state, parent, refs, emit, popper, constant
|
|
|
148
151
|
handleNumberPageChange: handleNumberPageChange({ api: api2, emit, state }),
|
|
149
152
|
doSearch: doSearch({ api: api2, state, props }),
|
|
150
153
|
doClear: doClear({ api: api2, state, props }),
|
|
151
|
-
updateSuggestWidth: updateSuggestWidth({
|
|
154
|
+
updateSuggestWidth: updateSuggestWidth({ vm }),
|
|
152
155
|
doSuggesstNow: doSuggesst({ api: api2, state, props, popper, nextTick }),
|
|
153
156
|
doSuggesst: debounce(1e3, doSuggesst({ api: api2, state, props, popper, nextTick })),
|
|
154
|
-
closeSuggestPanel: closeSuggestPanel({ api: api2, state,
|
|
157
|
+
closeSuggestPanel: closeSuggestPanel({ api: api2, state, vm }),
|
|
155
158
|
sourceGridSelectChange: sourceGridSelectChange({ props, state, api: api2 }),
|
|
156
159
|
sourceGridSelectAll: sourceGridSelectAll({ props, state, api: api2 }),
|
|
157
160
|
getSuggestParam: getSuggestParam({ props, state, api: api2 }),
|
|
@@ -160,10 +163,11 @@ const initApi = ({ api: api2, props, state, parent, refs, emit, popper, constant
|
|
|
160
163
|
initSearchOption: initSearchOption({ api: api2, state }),
|
|
161
164
|
mounted: mounted({ api: api2, props }),
|
|
162
165
|
doDestroy: doDestroy({ popper }),
|
|
163
|
-
selectedBoxInit: selectedBoxInit(
|
|
166
|
+
selectedBoxInit: selectedBoxInit(vm),
|
|
164
167
|
selectedBoxClear: selectedBoxClear(api2),
|
|
165
168
|
selectedBoxDelete: selectedBoxDelete(api2),
|
|
166
|
-
selectedBoxDrag: selectedBoxDrag({ props, state })
|
|
169
|
+
selectedBoxDrag: selectedBoxDrag({ props, state }),
|
|
170
|
+
radioChangeFn: radioChangeFn({ props, api: api2 })
|
|
167
171
|
});
|
|
168
172
|
state.search = api2.createSearchForm(false);
|
|
169
173
|
};
|
|
@@ -187,12 +191,12 @@ const initWatch = ({ watch, props, api: api2, state, popper }) => {
|
|
|
187
191
|
);
|
|
188
192
|
watch(() => props.conditions, api2.initSearchOption, { deep: true, immediate: true });
|
|
189
193
|
};
|
|
190
|
-
const renderless = (props, { computed, onMounted, reactive, watch, inject, toRefs, onBeforeUnmount, onDeactivated }, { t,
|
|
194
|
+
const renderless = (props, { computed, onMounted, reactive, watch, inject, toRefs, onBeforeUnmount, onDeactivated }, { t, parent, emit, constants, vm, nextTick, slots }) => {
|
|
191
195
|
const api2 = {};
|
|
192
196
|
const state = initState({ reactive, computed, props, api: api2, constants, t, parent, vm });
|
|
193
197
|
const popper = userPopper({
|
|
194
198
|
emit,
|
|
195
|
-
|
|
199
|
+
vm,
|
|
196
200
|
watch,
|
|
197
201
|
onBeforeUnmount,
|
|
198
202
|
props,
|
|
@@ -203,7 +207,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, inject, toRef
|
|
|
203
207
|
onDeactivated
|
|
204
208
|
});
|
|
205
209
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
206
|
-
initApi({ api: api2, props, state, parent,
|
|
210
|
+
initApi({ api: api2, props, state, parent, vm, emit, popper, constants, nextTick });
|
|
207
211
|
initWatch({ watch, props, api: api2, state, popper });
|
|
208
212
|
onMounted(api2.mounted);
|
|
209
213
|
onBeforeUnmount(api2.closeSuggestPanel);
|
package/popover/index.js
CHANGED
|
@@ -118,10 +118,10 @@ const handleMouseLeave = ({ props, state }) => () => {
|
|
|
118
118
|
state.showPopper = false;
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
const handleDocumentClick = ({
|
|
121
|
+
const handleDocumentClick = ({ vm, state }) => (event) => {
|
|
122
122
|
const reference = state.referenceElm;
|
|
123
123
|
const popperElm = state.popperElm;
|
|
124
|
-
const $el = refs.root;
|
|
124
|
+
const $el = vm.$refs.root;
|
|
125
125
|
let target = event.target;
|
|
126
126
|
if ((target == null ? void 0 : target.shadowRoot) && popperElm) {
|
|
127
127
|
target = state.webCompEventTarget;
|
|
@@ -165,8 +165,8 @@ const destroyed = ({ state, api }) => () => {
|
|
|
165
165
|
off(referenceElm, "keydown", api.handleKeydown);
|
|
166
166
|
};
|
|
167
167
|
const computedTooltipId = (constants) => () => `${constants.IDPREFIX}-${guid("", 4)}`;
|
|
168
|
-
const wrapMounted = ({ api, props,
|
|
169
|
-
const { reference, popper, wrapper } = refs;
|
|
168
|
+
const wrapMounted = ({ api, props, vm, state }) => () => {
|
|
169
|
+
const { reference, popper, wrapper } = vm.$refs;
|
|
170
170
|
const referenceElm = state.referenceElm = props.reference || reference;
|
|
171
171
|
state.popperElm = state.popperElm || popper;
|
|
172
172
|
if (!referenceElm && wrapper.children) {
|