@opentiny/vue-renderless 3.12.1 → 3.13.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/index.js +20 -13
- package/action-sheet/vue.js +8 -7
- package/alert/index.js +50 -1
- package/alert/vue.js +36 -9
- 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 +20 -6
- package/calendar-view/index.js +10 -12
- package/calendar-view/vue.js +17 -4
- package/cascader/index.js +80 -34
- package/cascader/vue.js +49 -19
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +37 -24
- package/cascader-mobile/vue.js +7 -1
- 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/cascader-view/index.js +1 -1
- 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 +17 -0
- package/checkbox/vue.js +16 -7
- package/checkbox-group/vue.js +2 -0
- package/col/vue.js +3 -2
- 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/date.js +2 -0
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +48 -5
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +1 -1
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +22 -10
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- 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/container/index.js +17 -1
- package/container/vue.js +12 -3
- 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 +12 -5
- package/date-table/index.js +5 -0
- package/date-table/vue.js +3 -1
- package/dialog-box/index.js +17 -6
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +26 -5
- package/drawer/vue.js +13 -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 +21 -8
- 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 +47 -12
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -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 +3 -1
- package/form-item/index.js +4 -4
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/utils/common.js +10 -5
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -0
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +89 -22
- package/input/vue.js +52 -21
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/label/index.js +56 -0
- package/label/vue.js +26 -0
- package/link/vue.js +3 -1
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/mask/index.js +13 -0
- package/mask/vue.js +18 -0
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/multi-select/index.js +150 -10
- package/multi-select/vue.js +46 -11
- package/multi-select-item/index.js +17 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +51 -9
- package/numeric/vue.js +44 -14
- package/option/index.js +12 -5
- package/option/vue.js +15 -7
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +372 -0
- package/pager/vue.js +125 -2
- package/picker/index.js +253 -48
- package/picker/mb.js +42 -0
- package/picker/vue.js +70 -17
- package/picker-column/index.js +1 -1
- package/pop-upload/index.js +0 -2
- package/pop-upload/vue.js +3 -4
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +55 -24
- 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 +57 -65
- package/pull-refresh/vue.js +23 -7
- 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-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 +1 -1
- package/search/vue.js +3 -1
- package/select/index.js +176 -110
- package/select/vue.js +105 -20
- package/select-dropdown/index.js +62 -4
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- 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 +27 -7
- package/slider/vue.js +26 -7
- package/split/index.js +1 -1
- 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 +9 -4
- package/tab-nav/vue.js +6 -2
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +1 -1
- package/tabs/vue.js +1 -0
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tag/index.js +1 -1
- package/tag/vue.js +5 -1
- package/tag-group/index.js +2 -1
- package/tall-storage/index.js +4 -5
- package/time/index.js +4 -1
- package/time/vue.js +1 -1
- package/time-line/vue.js +1 -1
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/time-spinner/index.js +0 -3
- package/time-spinner/vue.js +2 -3
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +1 -2
- package/tooltip/vue.js +3 -3
- 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 +27 -3
- package/tree-menu/vue.js +27 -14
- package/tree-node/index.js +12 -10
- package/tree-node/vue.js +6 -5
- package/types/action-menu.type.d.ts +5 -0
- package/types/action-sheet.type.d.ts +118 -1
- package/types/alert.type.d.ts +16 -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.type.d.ts +5 -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 +327 -1
- package/types/checkbox.type.d.ts +9 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +34 -1
- package/types/dialog-box.type.d.ts +5 -1
- package/types/drawer.type.d.ts +132 -1
- package/types/{dropdown-item.type-bf83e929.d.ts → dropdown-item.type-8475a549.d.ts} +8 -14
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +2 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-d88482e4.d.ts} +3 -0
- package/types/form.type.d.ts +1 -1
- package/types/input.type.d.ts +23 -9
- package/types/ip-address.type.d.ts +160 -1
- package/types/label.type.d.ts +81 -0
- package/types/link.type.d.ts +6 -3
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +4 -2
- package/types/numeric.type.d.ts +36 -9
- package/types/pager.type.d.ts +171 -1
- package/types/picker.type.d.ts +14 -0
- package/types/popconfirm.type.d.ts +85 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- 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 +8 -1
- package/types/steps.type.d.ts +14 -3
- package/types/tab-item.type.d.ts +0 -1
- package/types/tab-nav.type.d.ts +6 -1
- package/types/tabs.type.d.ts +5 -0
- package/types/tag-group.type.d.ts +64 -1
- package/types/tag.type.d.ts +12 -0
- package/types/tooltip.type.d.ts +1 -1
- package/types/transfer.type.d.ts +183 -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-1078fba2.d.ts} +27 -6
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +59 -29
- package/upload/vue.js +6 -4
- package/upload-list/index.js +14 -14
- package/upload-list/vue.js +5 -2
- package/user/index.js +5 -4
- package/user-head/index.js +1 -1
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
package/picker/vue.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
parseString,
|
|
25
25
|
formatToString,
|
|
26
26
|
handleMouseEnter,
|
|
27
|
+
handleInput,
|
|
27
28
|
handleChange,
|
|
28
29
|
handleStartInput,
|
|
29
30
|
handleEndInput,
|
|
@@ -53,8 +54,10 @@ import {
|
|
|
53
54
|
emitDbTime,
|
|
54
55
|
handleEnterDisplayOnlyContent,
|
|
55
56
|
handleEnterPickerlabel,
|
|
56
|
-
setInputPaddingLeft
|
|
57
|
+
setInputPaddingLeft,
|
|
58
|
+
formatInputValue
|
|
57
59
|
} from "./index";
|
|
60
|
+
import { dateMobileToggle, timeMobileToggle, dateToTimeArray, timeArrayToDate, timeMobileConfirm } from "./mb";
|
|
58
61
|
import { DATEPICKER } from "../common";
|
|
59
62
|
const api = [
|
|
60
63
|
"state",
|
|
@@ -66,9 +69,9 @@ const api = [
|
|
|
66
69
|
"handleStartChange",
|
|
67
70
|
"handleStartInput",
|
|
68
71
|
"handleKeydown",
|
|
69
|
-
"handleMouseEnter",
|
|
70
72
|
"handleClickIcon",
|
|
71
73
|
"handleMouseEnter",
|
|
74
|
+
"handleInput",
|
|
72
75
|
"handleChange",
|
|
73
76
|
"handleClose",
|
|
74
77
|
"handlePick",
|
|
@@ -76,9 +79,13 @@ const api = [
|
|
|
76
79
|
"handleSelectChange",
|
|
77
80
|
"popperElm",
|
|
78
81
|
"handleEnterDisplayOnlyContent",
|
|
79
|
-
"handleEnterPickerlabel"
|
|
82
|
+
"handleEnterPickerlabel",
|
|
83
|
+
"timeMobileToggle",
|
|
84
|
+
"timeMobileConfirm",
|
|
85
|
+
"emitInput",
|
|
86
|
+
"dateMobileToggle"
|
|
80
87
|
];
|
|
81
|
-
const initState = ({ api: api2, reactive, vm, computed, props, utils, parent }) => {
|
|
88
|
+
const initState = ({ api: api2, reactive, vm, computed, props, utils, parent, breakpoint }) => {
|
|
82
89
|
const state = reactive({
|
|
83
90
|
historyValue: [],
|
|
84
91
|
historyInput: [],
|
|
@@ -103,6 +110,7 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent })
|
|
|
103
110
|
haveTrigger: computed(() => api2.computedHaveTrigger()),
|
|
104
111
|
displayValue: computed(() => api2.displayValue()),
|
|
105
112
|
parsedValue: computed(() => api2.parsedValue()),
|
|
113
|
+
oldValue: props.modelValue,
|
|
106
114
|
pickerSize: computed(() => props.size),
|
|
107
115
|
pickerDisabled: computed(() => props.disabled || state.formDisabled || state.isDisplayOnly),
|
|
108
116
|
firstInputId: computed(() => api2.firstInputId()),
|
|
@@ -113,11 +121,38 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent })
|
|
|
113
121
|
format: computed(() => api2.computedFormat()),
|
|
114
122
|
labelTooltip: "",
|
|
115
123
|
displayOnlyTooltip: "",
|
|
116
|
-
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly)
|
|
124
|
+
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
|
|
125
|
+
isMobileScreen: computed(() => breakpoint.current.value === "default"),
|
|
126
|
+
dateMobileOption: {
|
|
127
|
+
visible: false,
|
|
128
|
+
type: props.type,
|
|
129
|
+
value: props.modelValue
|
|
130
|
+
},
|
|
131
|
+
timeMobileOption: {
|
|
132
|
+
visible: false,
|
|
133
|
+
type: props.type,
|
|
134
|
+
value: [0, 0, 0]
|
|
135
|
+
},
|
|
136
|
+
isDateMobileComponent: computed(
|
|
137
|
+
() => [
|
|
138
|
+
DATEPICKER.DateRange,
|
|
139
|
+
DATEPICKER.DateTimeRange,
|
|
140
|
+
DATEPICKER.DateTime,
|
|
141
|
+
DATEPICKER.DatePicker,
|
|
142
|
+
DATEPICKER.Date,
|
|
143
|
+
DATEPICKER.Dates
|
|
144
|
+
].includes(props.type)
|
|
145
|
+
),
|
|
146
|
+
isTimeMobileComponent: computed(
|
|
147
|
+
() => [DATEPICKER.Time, DATEPICKER.TimeRange, DATEPICKER.TimeSelect, DATEPICKER.TimePicker].includes(props.type)
|
|
148
|
+
),
|
|
149
|
+
showSeconds: computed(
|
|
150
|
+
() => (state.format || props.pickerOptions && props.pickerOptions.format || "ss").includes("ss")
|
|
151
|
+
)
|
|
117
152
|
});
|
|
118
153
|
return state;
|
|
119
154
|
};
|
|
120
|
-
const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
155
|
+
const initApi = ({ api: api2, props, hooks, state, vnode, others, utils, parent }) => {
|
|
121
156
|
const { t, emit, dispatch, nextTick, vm } = vnode;
|
|
122
157
|
const { TimePanel, TimeRangePanel } = others;
|
|
123
158
|
const { destroyPopper, popperElm, updatePopper, doDestroy } = initPopper({ props, hooks, vnode });
|
|
@@ -127,16 +162,17 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
127
162
|
destroyPopper,
|
|
128
163
|
emitDbTime: emitDbTime({ emit, state, t }),
|
|
129
164
|
hidePicker: hidePicker({ state, doDestroy }),
|
|
130
|
-
handleSelectChange: ({ tz, date }) => emit("select-change", { tz, date }),
|
|
165
|
+
handleSelectChange: ({ tz, date }) => !state.ranged && emit("select-change", { tz, date }),
|
|
131
166
|
getPanel: getPanel(others),
|
|
132
|
-
handleFocus: handleFocus({ emit, vm, state }),
|
|
167
|
+
handleFocus: handleFocus({ emit, vm, state, api: api2 }),
|
|
133
168
|
getTimezone: getTimezone({ props, utils }),
|
|
134
169
|
emitChange: emitChange({ api: api2, dispatch, emit, props, state }),
|
|
135
170
|
parsedValue: parsedValue({ api: api2, props, state, t }),
|
|
136
171
|
parseAsFormatAndType: parseAsFormatAndType({ api: api2 }),
|
|
137
|
-
typeValueResolveMap: typeValueResolveMap({ api: api2, t }),
|
|
172
|
+
typeValueResolveMap: typeValueResolveMap({ api: api2, props, t }),
|
|
138
173
|
updateOptions: updateOptions({ api: api2, props, state }),
|
|
139
174
|
focus: focus({ api: api2, props, vm }),
|
|
175
|
+
handleInput: handleInput({ api: api2, state, props }),
|
|
140
176
|
handleChange: handleChange({ api: api2, state }),
|
|
141
177
|
isValidValue: isValidValue({ api: api2, state }),
|
|
142
178
|
emitInput: emitInput({ api: api2, emit, props, state }),
|
|
@@ -160,18 +196,25 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
160
196
|
computedTriggerClass: computedTriggerClass({ props, state }),
|
|
161
197
|
computedHaveTrigger: computedHaveTrigger({ props }),
|
|
162
198
|
setInputPaddingLeft: setInputPaddingLeft({ props, state, vm, nextTick }),
|
|
199
|
+
formatInputValue: formatInputValue({ props, state, api: api2 })
|
|
200
|
+
});
|
|
201
|
+
initApi2({ api: api2, props, state, t, parent });
|
|
202
|
+
initMobileApi({ api: api2, props, state, t, parent });
|
|
203
|
+
};
|
|
204
|
+
const initApi2 = ({ api: api2, props, state, t, parent }) => {
|
|
205
|
+
Object.assign(api2, {
|
|
163
206
|
t,
|
|
164
207
|
state,
|
|
165
208
|
blur: blur(state),
|
|
166
209
|
getMode: getMode({ state }),
|
|
167
|
-
getType: getType({ props }),
|
|
168
|
-
dateParser: dateParser({ t }),
|
|
210
|
+
getType: getType({ props, parent }),
|
|
211
|
+
dateParser: dateParser({ t, props }),
|
|
169
212
|
rangeParser: rangeParser(api2),
|
|
170
213
|
rangeFormatter: rangeFormatter(api2),
|
|
171
214
|
dateFormatter: dateFormatter({ t }),
|
|
172
215
|
getValueEmpty: getValueEmpty(props),
|
|
173
|
-
handleEndInput: handleEndInput(state),
|
|
174
|
-
handleStartInput: handleStartInput(state),
|
|
216
|
+
handleEndInput: handleEndInput({ state, props, api: api2 }),
|
|
217
|
+
handleStartInput: handleStartInput({ state, props, api: api2 }),
|
|
175
218
|
firstInputId: firstInputId({ props, state }),
|
|
176
219
|
secondInputId: secondInputId({ props, state }),
|
|
177
220
|
handleMouseEnter: handleMouseEnter({ props, state }),
|
|
@@ -182,6 +225,15 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils }) => {
|
|
|
182
225
|
handleEnterDisplayOnlyContent: handleEnterDisplayOnlyContent({ state, t })
|
|
183
226
|
});
|
|
184
227
|
};
|
|
228
|
+
const initMobileApi = ({ api: api2, props, state }) => {
|
|
229
|
+
Object.assign(api2, {
|
|
230
|
+
dateMobileToggle: dateMobileToggle({ state, props, api: api2 }),
|
|
231
|
+
timeMobileToggle: timeMobileToggle({ state, props, api: api2 }),
|
|
232
|
+
timeMobileConfirm: timeMobileConfirm({ state, props, api: api2 }),
|
|
233
|
+
dateToTimeArray,
|
|
234
|
+
timeArrayToDate: timeArrayToDate({ state, props, api: api2 })
|
|
235
|
+
});
|
|
236
|
+
};
|
|
185
237
|
const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
186
238
|
watch(
|
|
187
239
|
() => state.type,
|
|
@@ -206,17 +258,18 @@ const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
|
206
258
|
const renderless = (props, hooks, vnode, others) => {
|
|
207
259
|
const api2 = {};
|
|
208
260
|
const { reactive, computed, watch, onBeforeUnmount, inject, markRaw, onMounted } = hooks;
|
|
209
|
-
const { vm, service, parent } = vnode;
|
|
261
|
+
const { vm, service, parent, useBreakpoint } = vnode;
|
|
210
262
|
const { utils = {} } = service || {};
|
|
211
|
-
const
|
|
263
|
+
const breakpoint = useBreakpoint();
|
|
264
|
+
const state = initState({ api: api2, reactive, vm, computed, props, utils, parent, inject, breakpoint });
|
|
212
265
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
213
|
-
initApi({ api: api2, props, hooks, state, vnode, others, utils });
|
|
266
|
+
initApi({ api: api2, props, hooks, state, vnode, others, utils, parent });
|
|
214
267
|
initWatch({ api: api2, state, props, watch, markRaw });
|
|
215
268
|
api2.initGlobalTimezone();
|
|
216
269
|
onMounted(() => {
|
|
217
270
|
api2.setInputPaddingLeft();
|
|
218
271
|
});
|
|
219
|
-
|
|
272
|
+
parent.$on("handle-clear", (event) => {
|
|
220
273
|
state.showClose = true;
|
|
221
274
|
api2.handleClickIcon(event);
|
|
222
275
|
});
|
package/picker-column/index.js
CHANGED
package/pop-upload/index.js
CHANGED
|
@@ -43,7 +43,6 @@ const watchDisabled = (state) => (value) => state.disabled = value;
|
|
|
43
43
|
const watchAccept = (state) => (value) => state.accept = value;
|
|
44
44
|
const closeErrorTips = (state) => () => state.errorTips = [];
|
|
45
45
|
const closeSuccessTips = (state) => () => state.successTips = [];
|
|
46
|
-
const watchFilters = (state) => (value) => state.filters = value;
|
|
47
46
|
const watchLimit = (state) => (value) => {
|
|
48
47
|
state.limit = value;
|
|
49
48
|
if (value != void 0 && value > 0) {
|
|
@@ -157,7 +156,6 @@ export {
|
|
|
157
156
|
watchAccept,
|
|
158
157
|
watchAction,
|
|
159
158
|
watchDisabled,
|
|
160
|
-
watchFilters,
|
|
161
159
|
watchHeaders,
|
|
162
160
|
watchLimit,
|
|
163
161
|
watchMaxUploadFileSize,
|
package/pop-upload/vue.js
CHANGED
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
closeErrorTips,
|
|
25
25
|
watchUploaFileType,
|
|
26
26
|
watchMaxUploadFileSize,
|
|
27
|
-
watchFilters,
|
|
28
27
|
watchAccept,
|
|
29
28
|
computedUploadButtonText,
|
|
30
29
|
computedUploadsButtonText,
|
|
@@ -41,6 +40,7 @@ import {
|
|
|
41
40
|
fileUploadChange,
|
|
42
41
|
deleteFile
|
|
43
42
|
} from "./index";
|
|
43
|
+
import { formatFileSize } from "../common/string";
|
|
44
44
|
const api = [
|
|
45
45
|
"state",
|
|
46
46
|
"closeSuccessTips",
|
|
@@ -56,6 +56,7 @@ const api = [
|
|
|
56
56
|
"showDialog",
|
|
57
57
|
"closeDialog",
|
|
58
58
|
"fileUploadChange",
|
|
59
|
+
"formatFileSize",
|
|
59
60
|
"deleteFile"
|
|
60
61
|
];
|
|
61
62
|
const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
@@ -66,7 +67,6 @@ const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
|
66
67
|
isShowDialog: false,
|
|
67
68
|
accept: props.accept,
|
|
68
69
|
action: props.action,
|
|
69
|
-
filters: props.filters,
|
|
70
70
|
headers: props.headers,
|
|
71
71
|
disabled: props.disabled,
|
|
72
72
|
multiple: props.multiple,
|
|
@@ -95,6 +95,7 @@ const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
|
95
95
|
const initApi = ({ api: api2, state, refs, emit, props, constants, t }) => {
|
|
96
96
|
Object.assign(api2, {
|
|
97
97
|
state,
|
|
98
|
+
formatFileSize,
|
|
98
99
|
abort: abort(refs),
|
|
99
100
|
showDialog: showDialog(state),
|
|
100
101
|
watchLimit: watchLimit(state),
|
|
@@ -103,7 +104,6 @@ const initApi = ({ api: api2, state, refs, emit, props, constants, t }) => {
|
|
|
103
104
|
watchAccept: watchAccept(state),
|
|
104
105
|
progressEvent: progressEvent(emit),
|
|
105
106
|
watchHeaders: watchHeaders(state),
|
|
106
|
-
watchFilters: watchFilters(state),
|
|
107
107
|
watchMultiple: watchMultiple(state),
|
|
108
108
|
watchDisabled: watchDisabled(state),
|
|
109
109
|
closeErrorTips: closeErrorTips(state),
|
|
@@ -146,7 +146,6 @@ const initWatch = ({ watch, props, api: api2 }) => {
|
|
|
146
146
|
watch(() => props.multiple, api2.watchMultiple, { immediate: true });
|
|
147
147
|
watch(() => props.action, api2.watchAction, { immediate: true });
|
|
148
148
|
watch(() => props.headers, api2.watchHeaders, { immediate: true });
|
|
149
|
-
watch(() => props.filters, api2.watchFilters, { immediate: true });
|
|
150
149
|
watch(() => props.limit, api2.watchLimit, { immediate: true });
|
|
151
150
|
};
|
|
152
151
|
const renderless = (props, { computed, reactive, watch }, { t, constants, emit, refs }) => {
|
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
|
@@ -52,7 +52,7 @@ const getDisplay = ({ constants, props, state }) => () => {
|
|
|
52
52
|
} else if (props.multi) {
|
|
53
53
|
const displayTxt = [];
|
|
54
54
|
state.selectedValues.forEach((val) => {
|
|
55
|
-
const item = find(state.selectedDatas, (data) => val
|
|
55
|
+
const item = find(state.selectedDatas, (data) => String(val) === String(data[props.valueField]));
|
|
56
56
|
if (item) {
|
|
57
57
|
displayTxt.push(item[props.textField]);
|
|
58
58
|
} else {
|
|
@@ -93,6 +93,7 @@ const handleClear = ({ constants, emit, props, state }) => () => {
|
|
|
93
93
|
state.treeSelectList = [];
|
|
94
94
|
state.selectedDatas = [];
|
|
95
95
|
state.selectedValues = [];
|
|
96
|
+
state.cacheStore.treeSelectList = [];
|
|
96
97
|
if (!isEqual(state.commitValue, props.modelValue)) {
|
|
97
98
|
emit("update:modelValue", state.commitValue);
|
|
98
99
|
emit(
|
|
@@ -122,6 +123,9 @@ const handleConfirm = ({ api, constants, emit, props, state }) => (skipBeforeClo
|
|
|
122
123
|
}
|
|
123
124
|
if (props.popseletor === constants.TYPE_TREE) {
|
|
124
125
|
const commitValue = state.treeSelectList.map((item) => item.id).join(props.valueSplit);
|
|
126
|
+
state.cacheStore = {
|
|
127
|
+
treeSelectList: state.treeSelectList.slice(0)
|
|
128
|
+
};
|
|
125
129
|
if (!isEqual(commitValue, props.modelValue)) {
|
|
126
130
|
emit("update:modelValue", commitValue);
|
|
127
131
|
emit("change", commitValue, state.treeSelectList);
|
|
@@ -143,8 +147,8 @@ const handleOpen = ({ api, constants, props, state }) => (event) => {
|
|
|
143
147
|
api.openDialog({ api, props, state });
|
|
144
148
|
}
|
|
145
149
|
};
|
|
146
|
-
const handleSearch = ({ api,
|
|
147
|
-
const sourcetable = refs[constants.GRID_REF.source];
|
|
150
|
+
const handleSearch = ({ api, vm, constants }) => () => {
|
|
151
|
+
const sourcetable = vm.$refs[constants.GRID_REF.source];
|
|
148
152
|
sourcetable && sourcetable.clearRadioRow();
|
|
149
153
|
api.query();
|
|
150
154
|
};
|
|
@@ -187,7 +191,7 @@ const renderTextHandler = ({ state, props, datas, dataset, value }) => {
|
|
|
187
191
|
arrValues = value && ~["string", "number"].indexOf(typeof value) ? value.toString().split(props.valueSplit) : [];
|
|
188
192
|
}
|
|
189
193
|
arrValues.forEach((val) => {
|
|
190
|
-
const item = find(dataset, (data) => val
|
|
194
|
+
const item = find(dataset, (data) => String(val) === String(data[props.valueField])) || find(datas, (data) => String(val) === String(data[props.valueField]));
|
|
191
195
|
item && rows.push(item);
|
|
192
196
|
});
|
|
193
197
|
if (props.multi) {
|
|
@@ -212,7 +216,7 @@ const getTreeSelectList = ({ value, state, props }) => {
|
|
|
212
216
|
eachTree(
|
|
213
217
|
state.treeOp.data,
|
|
214
218
|
(node) => {
|
|
215
|
-
if (values.
|
|
219
|
+
if (values.includes(String(node[id]))) {
|
|
216
220
|
selectdTreeNodeList.push({ id: node[id], value: node[label] });
|
|
217
221
|
}
|
|
218
222
|
},
|
|
@@ -235,7 +239,7 @@ const initDisplay = ({ api, constants, props, state, nextTick }) => (value) => {
|
|
|
235
239
|
});
|
|
236
240
|
});
|
|
237
241
|
} else {
|
|
238
|
-
const item = find(dataset, (data) => value
|
|
242
|
+
const item = find(dataset, (data) => String(value) === String(data[props.valueField]));
|
|
239
243
|
state.selectedDatas = item || value;
|
|
240
244
|
if (props.popseletor === constants.TYPE_GRID) {
|
|
241
245
|
state.commitValue = state.selectedDatas ? state.selectedDatas[props.valueField] : "";
|
|
@@ -337,17 +341,17 @@ const selectedGridSelectChange = ({ constants, props, vm, state }) => ({ checked
|
|
|
337
341
|
const len = state.selectedValues.length;
|
|
338
342
|
event && (event.target.checked = !checked);
|
|
339
343
|
for (let i = 0; i < len; i++) {
|
|
340
|
-
if (state.selectedValues[i]
|
|
344
|
+
if (String(state.selectedValues[i]) === String(row[props.valueField])) {
|
|
341
345
|
state.selectedValues.splice(i, 1);
|
|
342
346
|
state.selectedDatas.splice(i, 1);
|
|
343
347
|
const sourcetable = refs[constants.GRID_REF.source];
|
|
344
348
|
const historytable = refs[constants.GRID_REF.history];
|
|
345
349
|
sourcetable && sourcetable.setSelection(
|
|
346
|
-
sourcetable.data.filter((lrow) => lrow[props.valueField]
|
|
350
|
+
sourcetable.data.filter((lrow) => String(lrow[props.valueField]) === String(row[props.valueField])),
|
|
347
351
|
false
|
|
348
352
|
);
|
|
349
353
|
historytable && historytable.setSelection(
|
|
350
|
-
historytable.data.filter((lrow) => lrow[props.valueField]
|
|
354
|
+
historytable.data.filter((lrow) => String(lrow[props.valueField]) === String(row[props.valueField])),
|
|
351
355
|
false
|
|
352
356
|
);
|
|
353
357
|
break;
|
|
@@ -359,7 +363,7 @@ const selectedGridSelectChange = ({ constants, props, vm, state }) => ({ checked
|
|
|
359
363
|
const sourceGridSelectAll = ({ props, state, api }) => ({ selection, checked }) => {
|
|
360
364
|
if (checked) {
|
|
361
365
|
selection.forEach((item) => {
|
|
362
|
-
if (!find(state.selectedValues, (val) => val
|
|
366
|
+
if (!find(state.selectedValues, (val) => String(val) === String(item[props.valueField]))) {
|
|
363
367
|
state.selectedValues.push(item[props.valueField]);
|
|
364
368
|
state.selectedDatas.push(item);
|
|
365
369
|
}
|
|
@@ -368,7 +372,7 @@ const sourceGridSelectAll = ({ props, state, api }) => ({ selection, checked })
|
|
|
368
372
|
const len = state.sourceGridDataset.length;
|
|
369
373
|
for (let i = 0; i < len; i++) {
|
|
370
374
|
const sourceGridItem = state.sourceGridDataset[i][props.valueField];
|
|
371
|
-
const selectedItem = find(state.selectedValues, (val) => val
|
|
375
|
+
const selectedItem = find(state.selectedValues, (val) => String(val) === String(sourceGridItem));
|
|
372
376
|
const index = state.selectedValues.indexOf(selectedItem);
|
|
373
377
|
if (index !== -1) {
|
|
374
378
|
state.selectedValues.splice(index, 1);
|
|
@@ -392,7 +396,7 @@ const sourceGridSelectChange = ({ props, state, api }) => ({ checked, row, confi
|
|
|
392
396
|
state.selectedDatas.push(row);
|
|
393
397
|
} else {
|
|
394
398
|
state.selectedValues.forEach((item, index) => {
|
|
395
|
-
if (row[props.valueField]
|
|
399
|
+
if (String(row[props.valueField]) === String(item)) {
|
|
396
400
|
state.selectedValues.splice(index, 1);
|
|
397
401
|
state.selectedDatas.splice(index, 1);
|
|
398
402
|
}
|
|
@@ -431,7 +435,7 @@ const computedTreeOp = ({ api, constants }) => (props, state) => {
|
|
|
431
435
|
treeOp.checkStrictly = treeOp.checkStrictly !== false;
|
|
432
436
|
treeOp.expandOnClickNode = false;
|
|
433
437
|
treeOp.nodeKey = treeOp.nodeKey || constants.ID;
|
|
434
|
-
treeOp.defaultCheckedKeys = state.treeSelectList.map((item) => item.id);
|
|
438
|
+
treeOp.defaultCheckedKeys = state.cacheStore.treeSelectList && state.cacheStore.treeSelectList.map((item) => item.id);
|
|
435
439
|
treeOp.props = __spreadValues({
|
|
436
440
|
label: props.textField || constants.LABEL,
|
|
437
441
|
id: props.valueField || constants.ID,
|
|
@@ -447,15 +451,35 @@ const treeCheckChange = ({ constants, state, props }) => (data, checked) => {
|
|
|
447
451
|
state.treeSelectList = treeSelectList;
|
|
448
452
|
} else {
|
|
449
453
|
if (checked) {
|
|
450
|
-
state
|
|
451
|
-
id: data[state.treeOp.props.id],
|
|
452
|
-
value: data[state.treeOp.props.label]
|
|
453
|
-
});
|
|
454
|
+
addTreeSelectNode(data, state);
|
|
454
455
|
} else {
|
|
455
|
-
state.
|
|
456
|
+
state.removedNodeId = [];
|
|
457
|
+
getRemovedNodeId(data, state);
|
|
458
|
+
state.treeSelectList = state.treeSelectList.filter((item) => !state.removedNodeId.includes(item.id));
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
461
|
};
|
|
462
|
+
const addTreeSelectNode = (node, state) => {
|
|
463
|
+
if (!state.treeSelectList.some((item) => item.id === node[state.treeOp.props.id])) {
|
|
464
|
+
state.treeSelectList.push({
|
|
465
|
+
id: node[state.treeOp.props.id],
|
|
466
|
+
value: node[state.treeOp.props.label]
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
if (!node.expanded && Array.isArray(node.children)) {
|
|
470
|
+
node.children.forEach((child) => {
|
|
471
|
+
addTreeSelectNode(child, state);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
const getRemovedNodeId = (node, state) => {
|
|
476
|
+
state.removedNodeId.push(node[state.treeOp.props.id]);
|
|
477
|
+
if (!node.expanded && Array.isArray(node.children)) {
|
|
478
|
+
node.children.forEach((child) => {
|
|
479
|
+
getRemovedNodeId(child, state);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
};
|
|
459
483
|
const handleNumberPageChange = ({ api, emit, state }) => (size) => {
|
|
460
484
|
state.pagerConfig.currentPage = 1;
|
|
461
485
|
state.pagerConfig.pageSize = size;
|
|
@@ -500,9 +524,9 @@ const getSuggestParam = ({ state, props, api }) => (input) => {
|
|
|
500
524
|
}
|
|
501
525
|
return input;
|
|
502
526
|
};
|
|
503
|
-
const updateSuggestWidth = ({
|
|
504
|
-
|
|
505
|
-
refs.popper.style.width = $input.clientWidth + "px";
|
|
527
|
+
const updateSuggestWidth = ({ vm }) => () => {
|
|
528
|
+
const $input = vm.$refs.reference.getInput();
|
|
529
|
+
vm.$refs.popper.style.width = $input.clientWidth + "px";
|
|
506
530
|
};
|
|
507
531
|
const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
508
532
|
if (!props.suggest) {
|
|
@@ -546,8 +570,9 @@ const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
|
546
570
|
}
|
|
547
571
|
}
|
|
548
572
|
};
|
|
549
|
-
const closeSuggestPanel = ({ state, api,
|
|
550
|
-
const
|
|
573
|
+
const closeSuggestPanel = ({ state, api, vm }) => (event = false) => {
|
|
574
|
+
const reference = vm.$refs.reference;
|
|
575
|
+
const popper = vm.$refs.popper;
|
|
551
576
|
let keep = !event;
|
|
552
577
|
if (event.target) {
|
|
553
578
|
keep = reference.$el.contains(event.target) || popper.contains(event.target);
|
|
@@ -565,6 +590,11 @@ const suggestRadioChange = ({ state, api }) => ({ row }) => {
|
|
|
565
590
|
state.showSuggestPanel = false;
|
|
566
591
|
api.handleConfirm();
|
|
567
592
|
};
|
|
593
|
+
const radioChangeFn = ({ props, api }) => () => {
|
|
594
|
+
if (props.radioChangeClose) {
|
|
595
|
+
api.handleConfirm();
|
|
596
|
+
}
|
|
597
|
+
};
|
|
568
598
|
const handlePager = ({ api, props, state }) => () => {
|
|
569
599
|
if (!props.showPager) {
|
|
570
600
|
state.sourceGridDataset = state.fullGridData;
|
|
@@ -599,7 +629,7 @@ const mounted = ({ api, props }) => () => {
|
|
|
599
629
|
const doDestroy = ({ popper }) => () => {
|
|
600
630
|
popper.doDestroy();
|
|
601
631
|
};
|
|
602
|
-
const selectedBoxInit = (
|
|
632
|
+
const selectedBoxInit = (vm) => () => vm.$refs.selectedBox && vm.$refs.selectedBox.init();
|
|
603
633
|
const selectedBoxClear = (api) => () => api.selectedGridSelectAll({ checked: false });
|
|
604
634
|
const selectedBoxDelete = (api) => ({ option: row }) => api.selectedGridSelectChange({ checked: false, row });
|
|
605
635
|
const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
|
|
@@ -643,6 +673,7 @@ export {
|
|
|
643
673
|
mounted,
|
|
644
674
|
openDialog,
|
|
645
675
|
query,
|
|
676
|
+
radioChangeFn,
|
|
646
677
|
selectedBoxClear,
|
|
647
678
|
selectedBoxDelete,
|
|
648
679
|
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) {
|
package/popover/vue.js
CHANGED
|
@@ -52,7 +52,7 @@ const initState = ({
|
|
|
52
52
|
});
|
|
53
53
|
return state;
|
|
54
54
|
};
|
|
55
|
-
const initApi = ({ api: api2, props, state,
|
|
55
|
+
const initApi = ({ api: api2, props, state, emit, doDestroy, constants, nextTick, vm, mode }) => {
|
|
56
56
|
Object.assign(api2, {
|
|
57
57
|
state,
|
|
58
58
|
mounted: mounted({ api: api2, state, constants, props, nextTick, mode }),
|
|
@@ -71,8 +71,8 @@ const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, ne
|
|
|
71
71
|
handleMouseLeave: handleMouseLeave({ props, state }),
|
|
72
72
|
handleAfterLeave: handleAfterLeave(emit),
|
|
73
73
|
handleMouseEnter: handleMouseEnter({ props, state }),
|
|
74
|
-
handleDocumentClick: handleDocumentClick({
|
|
75
|
-
wrapMounted: wrapMounted({ api: api2, props,
|
|
74
|
+
handleDocumentClick: handleDocumentClick({ vm, state }),
|
|
75
|
+
wrapMounted: wrapMounted({ api: api2, props, vm, state }),
|
|
76
76
|
handleItemClick: handleItemClick({ emit, state }),
|
|
77
77
|
observeCallback: observeCallback({ vm, state })
|
|
78
78
|
});
|
|
@@ -130,13 +130,13 @@ const renderless = (props, {
|
|
|
130
130
|
onUnmounted,
|
|
131
131
|
onActivated,
|
|
132
132
|
onDeactivated
|
|
133
|
-
}, { $prefix, emit, vm,
|
|
133
|
+
}, { $prefix, emit, vm, slots, nextTick, mode }) => {
|
|
134
134
|
const api2 = {};
|
|
135
135
|
const constants = { IDPREFIX: `${$prefix.toLowerCase()}-popover` };
|
|
136
|
-
const options = { emit, onBeforeUnmount, nextTick, reactive, props, watch, onDeactivated,
|
|
136
|
+
const options = { emit, onBeforeUnmount, nextTick, reactive, props, watch, onDeactivated, vm, slots, toRefs };
|
|
137
137
|
const { showPopper, popperElm, referenceElm, doDestroy, updatePopper } = userPopper(options);
|
|
138
138
|
const state = initState({ reactive, computed, api: api2, popperElm, showPopper, referenceElm });
|
|
139
|
-
initApi({ api: api2, constants, props, state,
|
|
139
|
+
initApi({ api: api2, constants, props, state, emit, doDestroy, nextTick, vm, mode });
|
|
140
140
|
onDeactivated(() => {
|
|
141
141
|
api2.destroyed();
|
|
142
142
|
api2.cleanup();
|