naive-ui 2.21.1 → 2.21.2
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/es/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +9 -4
- package/es/_internal/select-menu/src/SelectMenu.d.ts +1 -0
- package/es/_internal/selection/src/Selection.d.ts +1 -0
- package/es/_styles/common/dark.js +2 -1
- package/es/_styles/common/light.d.ts +1 -0
- package/es/_styles/common/light.js +1 -1
- package/es/alert/src/Alert.d.ts +1 -0
- package/es/auto-complete/src/AutoComplete.d.ts +1 -0
- package/es/auto-complete/src/AutoComplete.js +4 -1
- package/es/calendar/src/Calendar.d.ts +1 -0
- package/es/card/src/Card.d.ts +1 -0
- package/es/cascader/src/Cascader.d.ts +1 -0
- package/es/cascader/src/CascaderOption.d.ts +1 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +1 -0
- package/es/checkbox/src/Checkbox.d.ts +1 -0
- package/es/collapse/src/Collapse.d.ts +1 -0
- package/es/color-picker/src/ColorInputUnit.d.ts +1 -0
- package/es/data-table/src/DataTable.d.ts +1 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +2 -1
- package/es/data-table/src/TableParts/Body.d.ts +1 -0
- package/es/data-table/src/TableParts/Cell.d.ts +2 -0
- package/es/data-table/src/TableParts/Header.d.ts +1 -0
- package/es/data-table/src/styles/index.cssr.js +2 -2
- package/es/data-table/src/use-table-data.js +3 -3
- package/es/data-table/styles/light.js +4 -4
- package/es/date-picker/src/DatePicker.d.ts +1 -0
- package/es/date-picker/src/panel/date.d.ts +2 -1
- package/es/date-picker/src/panel/daterange.d.ts +3 -2
- package/es/date-picker/src/panel/datetime.d.ts +2 -1
- package/es/date-picker/src/panel/datetimerange.d.ts +3 -2
- package/es/date-picker/src/panel/month.d.ts +2 -1
- package/es/date-picker/src/panel/use-calendar.d.ts +2 -1
- package/es/date-picker/src/panel/use-calendar.js +2 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +3 -2
- package/es/date-picker/src/panel/use-dual-calendar.js +4 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +1 -0
- package/es/dialog/src/Dialog.d.ts +1 -0
- package/es/drawer/src/Drawer.d.ts +1 -0
- package/es/drawer/src/DrawerBodyWrapper.d.ts +1 -0
- package/es/drawer/src/DrawerContent.d.ts +1 -0
- package/es/dropdown/src/Dropdown.d.ts +6 -5
- package/es/dynamic-input/src/DynamicInput.d.ts +1 -0
- package/es/dynamic-input/src/InputPreset.d.ts +1 -0
- package/es/dynamic-input/src/PairPreset.d.ts +1 -0
- package/es/dynamic-tags/src/DynamicTags.d.ts +1 -0
- package/es/ellipsis/src/Ellipsis.d.ts +1 -0
- package/es/input/src/Input.d.ts +1 -0
- package/es/input-number/src/InputNumber.d.ts +35 -0
- package/es/input-number/src/InputNumber.js +22 -6
- package/es/layout/src/Layout.d.ts +2 -0
- package/es/layout/src/LayoutContent.d.ts +1 -0
- package/es/layout/src/LayoutSider.d.ts +1 -0
- package/es/log/src/Log.d.ts +7 -25
- package/es/log/src/Log.js +2 -11
- package/es/log/src/LogLine.d.ts +1 -0
- package/es/log/src/LogLine.js +12 -10
- package/es/mention/src/Mention.d.ts +1 -0
- package/es/menu/src/Menu.d.ts +1 -0
- package/es/menu/src/MenuOption.d.ts +1 -0
- package/es/modal/src/BodyWrapper.d.ts +1 -0
- package/es/notification/src/NotificationContainer.d.ts +8 -0
- package/es/notification/src/NotificationContainer.js +7 -2
- package/es/notification/src/NotificationProvider.d.ts +17 -0
- package/es/notification/src/NotificationProvider.js +38 -3
- package/es/notification/src/styles/index.cssr.d.ts +2 -1
- package/es/notification/src/styles/index.cssr.js +41 -12
- package/es/pagination/src/Pagination.d.ts +1 -0
- package/es/popconfirm/src/Popconfirm.d.ts +6 -5
- package/es/popover/src/Popover.d.ts +6 -6
- package/es/popover/src/Popover.js +2 -5
- package/es/popover/src/PopoverBody.d.ts +5 -5
- package/es/popover/src/PopoverBody.js +2 -1
- package/es/popover/src/styles/index.cssr.js +0 -1
- package/es/popselect/src/Popselect.d.ts +6 -5
- package/es/popselect/src/PopselectPanel.d.ts +1 -0
- package/es/select/src/Select.d.ts +1 -0
- package/es/slider/src/Slider.d.ts +1 -0
- package/es/slider/src/Slider.js +70 -54
- package/es/table/styles/light.js +2 -2
- package/es/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/es/time-picker/src/Panel.d.ts +1 -0
- package/es/time-picker/src/TimePicker.d.ts +1 -0
- package/es/tooltip/src/Tooltip.d.ts +6 -5
- package/es/transfer/src/Transfer.d.ts +1 -0
- package/es/transfer/src/TransferFilter.d.ts +1 -0
- package/es/transfer/src/TransferList.d.ts +1 -0
- package/es/transfer/src/TransferListItem.d.ts +1 -0
- package/es/tree/src/Tree.d.ts +1 -0
- package/es/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/es/tree-select/src/TreeSelect.d.ts +1 -0
- package/es/upload/index.d.ts +1 -2
- package/es/upload/src/Upload.d.ts +8 -9
- package/es/upload/src/Upload.js +69 -16
- package/es/upload/src/UploadFile.d.ts +1 -0
- package/es/upload/src/UploadProgress.d.ts +1 -0
- package/es/upload/src/interface.d.ts +14 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +1 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +9 -4
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +1 -0
- package/lib/_internal/selection/src/Selection.d.ts +1 -0
- package/lib/_styles/common/dark.js +2 -1
- package/lib/_styles/common/light.d.ts +1 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/alert/src/Alert.d.ts +1 -0
- package/lib/auto-complete/src/AutoComplete.d.ts +1 -0
- package/lib/auto-complete/src/AutoComplete.js +4 -1
- package/lib/calendar/src/Calendar.d.ts +1 -0
- package/lib/card/src/Card.d.ts +1 -0
- package/lib/cascader/src/Cascader.d.ts +1 -0
- package/lib/cascader/src/CascaderOption.d.ts +1 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +1 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +1 -0
- package/lib/checkbox/src/Checkbox.d.ts +1 -0
- package/lib/collapse/src/Collapse.d.ts +1 -0
- package/lib/color-picker/src/ColorInputUnit.d.ts +1 -0
- package/lib/data-table/src/DataTable.d.ts +1 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +2 -1
- package/lib/data-table/src/TableParts/Body.d.ts +1 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +2 -0
- package/lib/data-table/src/TableParts/Header.d.ts +1 -0
- package/lib/data-table/src/styles/index.cssr.js +2 -2
- package/lib/data-table/src/use-table-data.js +3 -3
- package/lib/data-table/styles/light.js +4 -4
- package/lib/date-picker/src/DatePicker.d.ts +1 -0
- package/lib/date-picker/src/panel/date.d.ts +2 -1
- package/lib/date-picker/src/panel/daterange.d.ts +3 -2
- package/lib/date-picker/src/panel/datetime.d.ts +2 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +3 -2
- package/lib/date-picker/src/panel/month.d.ts +2 -1
- package/lib/date-picker/src/panel/use-calendar.d.ts +2 -1
- package/lib/date-picker/src/panel/use-calendar.js +2 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +3 -2
- package/lib/date-picker/src/panel/use-dual-calendar.js +4 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +1 -0
- package/lib/dialog/src/Dialog.d.ts +1 -0
- package/lib/drawer/src/Drawer.d.ts +1 -0
- package/lib/drawer/src/DrawerBodyWrapper.d.ts +1 -0
- package/lib/drawer/src/DrawerContent.d.ts +1 -0
- package/lib/dropdown/src/Dropdown.d.ts +6 -5
- package/lib/dynamic-input/src/DynamicInput.d.ts +1 -0
- package/lib/dynamic-input/src/InputPreset.d.ts +1 -0
- package/lib/dynamic-input/src/PairPreset.d.ts +1 -0
- package/lib/dynamic-tags/src/DynamicTags.d.ts +1 -0
- package/lib/ellipsis/src/Ellipsis.d.ts +1 -0
- package/lib/input/src/Input.d.ts +1 -0
- package/lib/input-number/src/InputNumber.d.ts +35 -0
- package/lib/input-number/src/InputNumber.js +22 -6
- package/lib/layout/src/Layout.d.ts +2 -0
- package/lib/layout/src/LayoutContent.d.ts +1 -0
- package/lib/layout/src/LayoutSider.d.ts +1 -0
- package/lib/log/src/Log.d.ts +7 -25
- package/lib/log/src/Log.js +2 -11
- package/lib/log/src/LogLine.d.ts +1 -0
- package/lib/log/src/LogLine.js +11 -9
- package/lib/mention/src/Mention.d.ts +1 -0
- package/lib/menu/src/Menu.d.ts +1 -0
- package/lib/menu/src/MenuOption.d.ts +1 -0
- package/lib/modal/src/BodyWrapper.d.ts +1 -0
- package/lib/notification/src/NotificationContainer.d.ts +8 -0
- package/lib/notification/src/NotificationContainer.js +7 -2
- package/lib/notification/src/NotificationProvider.d.ts +17 -0
- package/lib/notification/src/NotificationProvider.js +38 -3
- package/lib/notification/src/styles/index.cssr.d.ts +2 -1
- package/lib/notification/src/styles/index.cssr.js +41 -12
- package/lib/pagination/src/Pagination.d.ts +1 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +6 -5
- package/lib/popover/src/Popover.d.ts +6 -6
- package/lib/popover/src/Popover.js +2 -5
- package/lib/popover/src/PopoverBody.d.ts +5 -5
- package/lib/popover/src/PopoverBody.js +2 -1
- package/lib/popover/src/styles/index.cssr.js +0 -1
- package/lib/popselect/src/Popselect.d.ts +6 -5
- package/lib/popselect/src/PopselectPanel.d.ts +1 -0
- package/lib/select/src/Select.d.ts +1 -0
- package/lib/slider/src/Slider.d.ts +1 -0
- package/lib/slider/src/Slider.js +70 -54
- package/lib/table/styles/light.js +2 -2
- package/lib/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/lib/time-picker/src/Panel.d.ts +1 -0
- package/lib/time-picker/src/TimePicker.d.ts +1 -0
- package/lib/tooltip/src/Tooltip.d.ts +6 -5
- package/lib/transfer/src/Transfer.d.ts +1 -0
- package/lib/transfer/src/TransferFilter.d.ts +1 -0
- package/lib/transfer/src/TransferList.d.ts +1 -0
- package/lib/transfer/src/TransferListItem.d.ts +1 -0
- package/lib/tree/src/Tree.d.ts +1 -0
- package/lib/tree/src/TreeNodeCheckbox.d.ts +1 -0
- package/lib/tree-select/src/TreeSelect.d.ts +1 -0
- package/lib/upload/index.d.ts +1 -2
- package/lib/upload/src/Upload.d.ts +8 -9
- package/lib/upload/src/Upload.js +69 -16
- package/lib/upload/src/UploadFile.d.ts +1 -0
- package/lib/upload/src/UploadProgress.d.ts +1 -0
- package/lib/upload/src/interface.d.ts +14 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -3
- package/web-types.json +51 -6
package/es/slider/src/Slider.js
CHANGED
|
@@ -37,9 +37,14 @@ export default defineComponent({
|
|
|
37
37
|
setup(props) {
|
|
38
38
|
const { mergedClsPrefixRef, namespaceRef } = useConfig(props);
|
|
39
39
|
const themeRef = useTheme('Slider', 'Slider', style, sliderLight, props, mergedClsPrefixRef);
|
|
40
|
+
// dom ref
|
|
41
|
+
const handleRailRef = ref(null);
|
|
42
|
+
const [handleRefs, setHandleRefs] = useRefs();
|
|
43
|
+
const [followerRefs, setFollowerRefs] = useRefs();
|
|
44
|
+
const followerEnabledIndexSetRef = ref(new Set());
|
|
45
|
+
// data ref
|
|
40
46
|
const formItem = useFormItem(props);
|
|
41
47
|
const { mergedDisabledRef } = formItem;
|
|
42
|
-
const handleRailRef = ref(null);
|
|
43
48
|
const precisionRef = computed(() => {
|
|
44
49
|
const { step } = props;
|
|
45
50
|
if (step <= 0 || step === 'mark')
|
|
@@ -51,8 +56,6 @@ export default defineComponent({
|
|
|
51
56
|
}
|
|
52
57
|
return precision;
|
|
53
58
|
});
|
|
54
|
-
const [handleRefs, setHandleRefs] = useRefs();
|
|
55
|
-
const [followerRefs, setFollowerRefs] = useRefs();
|
|
56
59
|
const uncontrolledValueRef = ref(props.defaultValue);
|
|
57
60
|
const controlledValueRef = toRef(props, 'value');
|
|
58
61
|
const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
|
|
@@ -72,10 +75,13 @@ export default defineComponent({
|
|
|
72
75
|
const { marks } = props;
|
|
73
76
|
return marks ? Object.keys(marks).map(parseFloat) : null;
|
|
74
77
|
});
|
|
78
|
+
// status ref
|
|
75
79
|
const activeIndexRef = ref(-1);
|
|
76
80
|
const previousIndexRef = ref(-1);
|
|
77
81
|
const hoverIndexRef = ref(-1);
|
|
78
82
|
const draggingRef = ref(false);
|
|
83
|
+
// style ref
|
|
84
|
+
const dotTransitionDisabledRef = ref(false);
|
|
79
85
|
const styleDirectionRef = computed(() => {
|
|
80
86
|
const { vertical, reverse } = props;
|
|
81
87
|
const left = reverse ? 'right' : 'left';
|
|
@@ -86,20 +92,19 @@ export default defineComponent({
|
|
|
86
92
|
if (handleCountExceeds2Ref.value)
|
|
87
93
|
return;
|
|
88
94
|
const values = arrifiedValueRef.value;
|
|
89
|
-
const start = props.range ? Math.min
|
|
90
|
-
const end = props.range ? Math.max
|
|
95
|
+
const start = valueToPercentage(props.range ? Math.min(...values) : props.min);
|
|
96
|
+
const end = valueToPercentage(props.range ? Math.max(...values) : values[0]);
|
|
91
97
|
const { value: styleDirection } = styleDirectionRef;
|
|
92
98
|
return props.vertical
|
|
93
99
|
? {
|
|
94
|
-
[styleDirection]: `${
|
|
95
|
-
height: `${
|
|
100
|
+
[styleDirection]: `${start}%`,
|
|
101
|
+
height: `${end - start}%`
|
|
96
102
|
}
|
|
97
103
|
: {
|
|
98
|
-
[styleDirection]: `${
|
|
99
|
-
width: `${
|
|
104
|
+
[styleDirection]: `${start}%`,
|
|
105
|
+
width: `${end - start}%`
|
|
100
106
|
};
|
|
101
107
|
});
|
|
102
|
-
const dotTransitionDisabledRef = ref(false);
|
|
103
108
|
const markInfosRef = computed(() => {
|
|
104
109
|
const mergedMarks = [];
|
|
105
110
|
const { marks } = props;
|
|
@@ -128,6 +133,14 @@ export default defineComponent({
|
|
|
128
133
|
}
|
|
129
134
|
return mergedMarks;
|
|
130
135
|
});
|
|
136
|
+
function getHandleStyle(value, index) {
|
|
137
|
+
const percentage = valueToPercentage(value);
|
|
138
|
+
const { value: styleDirection } = styleDirectionRef;
|
|
139
|
+
return {
|
|
140
|
+
[styleDirection]: `${percentage}%`,
|
|
141
|
+
zIndex: index === activeIndexRef.value ? 1 : 0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
131
144
|
function isShowTooltip(index) {
|
|
132
145
|
return (props.showTooltip ||
|
|
133
146
|
hoverIndexRef.value === index ||
|
|
@@ -149,14 +162,6 @@ export default defineComponent({
|
|
|
149
162
|
inst.syncPosition();
|
|
150
163
|
});
|
|
151
164
|
}
|
|
152
|
-
function getHandleStyle(value, index) {
|
|
153
|
-
const percentage = valueToPercentage(value);
|
|
154
|
-
const { value: styleDirection } = styleDirectionRef;
|
|
155
|
-
return {
|
|
156
|
-
[styleDirection]: `${percentage}%`,
|
|
157
|
-
zIndex: index === activeIndexRef.value ? 1 : 0
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
165
|
function doUpdateValue(value) {
|
|
161
166
|
const { 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
|
|
162
167
|
const { nTriggerFormInput, nTriggerFormChange } = formItem;
|
|
@@ -195,51 +200,39 @@ export default defineComponent({
|
|
|
195
200
|
dispatchValueUpdate(value);
|
|
196
201
|
}
|
|
197
202
|
}
|
|
198
|
-
|
|
199
|
-
if (markValues) {
|
|
200
|
-
let closestMark = null;
|
|
201
|
-
let index = -1;
|
|
202
|
-
while (++index < markValues.length) {
|
|
203
|
-
const diff = markValues[index] - currentValue;
|
|
204
|
-
const distance = Math.abs(diff);
|
|
205
|
-
if (
|
|
206
|
-
// find marks in the same direction
|
|
207
|
-
(buffer === undefined || diff * buffer > 0) &&
|
|
208
|
-
(closestMark === null || distance < closestMark.distance)) {
|
|
209
|
-
closestMark = {
|
|
210
|
-
value: markValues[index],
|
|
211
|
-
distance,
|
|
212
|
-
index
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return closestMark;
|
|
217
|
-
}
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
203
|
+
// value conversion
|
|
220
204
|
function sanitizeValue(value, currentValue, stepBuffer) {
|
|
221
205
|
const stepping = stepBuffer !== undefined;
|
|
222
206
|
if (!stepBuffer) {
|
|
223
207
|
stepBuffer = value - currentValue > 0 ? 1 : -1;
|
|
224
208
|
}
|
|
225
209
|
const markValues = markValuesRef.value || [];
|
|
226
|
-
const {
|
|
210
|
+
const { step } = props;
|
|
227
211
|
if (step === 'mark') {
|
|
228
212
|
const closestMark = getClosestMark(value, markValues.concat(currentValue), stepping ? stepBuffer : undefined);
|
|
229
213
|
return closestMark ? closestMark.value : currentValue;
|
|
230
214
|
}
|
|
231
215
|
if (step <= 0)
|
|
232
216
|
return currentValue;
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
?
|
|
242
|
-
|
|
217
|
+
const { value: precision } = precisionRef;
|
|
218
|
+
let closestMark;
|
|
219
|
+
// if it is a stepping, priority will be given to the marks
|
|
220
|
+
// on the rail, otherwise take the nearest one
|
|
221
|
+
if (stepping) {
|
|
222
|
+
const currentStep = Number((currentValue / step).toFixed(precision));
|
|
223
|
+
const actualStep = Math.floor(currentStep);
|
|
224
|
+
const leftStep = currentStep > actualStep ? actualStep : actualStep - 1;
|
|
225
|
+
const rightStep = currentStep < actualStep ? actualStep : actualStep + 1;
|
|
226
|
+
closestMark = getClosestMark(currentValue, [
|
|
227
|
+
Number((leftStep * step).toFixed(precision)),
|
|
228
|
+
Number((rightStep * step).toFixed(precision)),
|
|
229
|
+
...markValues
|
|
230
|
+
], stepBuffer);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
const roundValue = getRoundValue(value);
|
|
234
|
+
closestMark = getClosestMark(value, [...markValues, roundValue]);
|
|
235
|
+
}
|
|
243
236
|
return closestMark ? clampValue(closestMark.value) : currentValue;
|
|
244
237
|
}
|
|
245
238
|
function clampValue(value) {
|
|
@@ -260,6 +253,27 @@ export default defineComponent({
|
|
|
260
253
|
const newValue = Math.round((value - min) / step) * step + min;
|
|
261
254
|
return Number(newValue.toFixed(precisionRef.value));
|
|
262
255
|
}
|
|
256
|
+
function getClosestMark(currentValue, markValues = markValuesRef.value, buffer) {
|
|
257
|
+
if (!markValues || !markValues.length)
|
|
258
|
+
return null;
|
|
259
|
+
let closestMark = null;
|
|
260
|
+
let index = -1;
|
|
261
|
+
while (++index < markValues.length) {
|
|
262
|
+
const diff = markValues[index] - currentValue;
|
|
263
|
+
const distance = Math.abs(diff);
|
|
264
|
+
if (
|
|
265
|
+
// find marks in the same direction
|
|
266
|
+
(buffer === undefined || diff * buffer > 0) &&
|
|
267
|
+
(closestMark === null || distance < closestMark.distance)) {
|
|
268
|
+
closestMark = {
|
|
269
|
+
index,
|
|
270
|
+
distance,
|
|
271
|
+
value: markValues[index]
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return closestMark;
|
|
276
|
+
}
|
|
263
277
|
function getPointValue(event) {
|
|
264
278
|
const railEl = handleRailRef.value;
|
|
265
279
|
if (!railEl)
|
|
@@ -278,6 +292,7 @@ export default defineComponent({
|
|
|
278
292
|
}
|
|
279
293
|
return percentageToValue(percentage);
|
|
280
294
|
}
|
|
295
|
+
// dom event handle
|
|
281
296
|
function handleRailKeyDown(e) {
|
|
282
297
|
if (mergedDisabledRef.value)
|
|
283
298
|
return;
|
|
@@ -390,7 +405,7 @@ export default defineComponent({
|
|
|
390
405
|
hoverIndexRef.value = -1;
|
|
391
406
|
}
|
|
392
407
|
}
|
|
393
|
-
watch(activeIndexRef, (_, previous) => (previousIndexRef.value = previous));
|
|
408
|
+
watch(activeIndexRef, (_, previous) => void nextTick(() => (previousIndexRef.value = previous)));
|
|
394
409
|
watch(mergedValueRef, () => {
|
|
395
410
|
if (props.marks) {
|
|
396
411
|
if (dotTransitionDisabledRef.value)
|
|
@@ -422,6 +437,7 @@ export default defineComponent({
|
|
|
422
437
|
getHandleStyle,
|
|
423
438
|
activeIndex: activeIndexRef,
|
|
424
439
|
arrifiedValues: arrifiedValueRef,
|
|
440
|
+
followerEnabledIndexSet: followerEnabledIndexSetRef,
|
|
425
441
|
handleRailMouseDown,
|
|
426
442
|
handleHandleFocus,
|
|
427
443
|
handleHandleBlur,
|
|
@@ -501,8 +517,8 @@ export default defineComponent({
|
|
|
501
517
|
h(VTarget, null, {
|
|
502
518
|
default: () => (h("div", { ref: this.setHandleRefs(index), class: `${mergedClsPrefix}-slider-handle`, tabindex: this.mergedDisabled ? -1 : 0, style: this.getHandleStyle(value, index), onFocus: () => this.handleHandleFocus(index), onBlur: () => this.handleHandleBlur(index), onMouseenter: () => this.handleHandleMouseEnter(index), onMouseleave: () => this.handleHandleMouseLeave(index) }))
|
|
503
519
|
}),
|
|
504
|
-
this.tooltip && (h(VFollower, { ref: this.setFollowerRefs(index), show: showTooltip, to: this.adjustedTo, teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.mergedPlacement, containerClass: this.namespace }, {
|
|
505
|
-
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: this.isSkipCSSDetection(index) }, {
|
|
520
|
+
this.tooltip && (h(VFollower, { ref: this.setFollowerRefs(index), show: showTooltip, to: this.adjustedTo, enabled: this.followerEnabledIndexSet.has(index), teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey, placement: this.mergedPlacement, containerClass: this.namespace }, {
|
|
521
|
+
default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: this.isMounted, css: this.isSkipCSSDetection(index), onEnter: () => this.followerEnabledIndexSet.add(index), onAfterLeave: () => this.followerEnabledIndexSet.delete(index) }, {
|
|
506
522
|
default: () => showTooltip ? (h("div", { class: [
|
|
507
523
|
`${mergedClsPrefix}-slider-handle-indicator`,
|
|
508
524
|
`${mergedClsPrefix}-slider-handle-indicator--${this.mergedPlacement}`
|
package/es/table/styles/light.js
CHANGED
|
@@ -2,12 +2,12 @@ import { composite } from 'seemly';
|
|
|
2
2
|
import sizeVariables from './_common';
|
|
3
3
|
import { commonLight } from '../../_styles/common';
|
|
4
4
|
export const self = (vars) => {
|
|
5
|
-
const { dividerColor, cardColor, modalColor, popoverColor, tableHeaderColor,
|
|
5
|
+
const { dividerColor, cardColor, modalColor, popoverColor, tableHeaderColor, tableColorStriped, textColor1, textColor2, borderRadius, fontWeightStrong, lineHeight, fontSizeSmall, fontSizeMedium, fontSizeLarge } = vars;
|
|
6
6
|
return Object.assign(Object.assign({}, sizeVariables), { fontSizeSmall,
|
|
7
7
|
fontSizeMedium,
|
|
8
8
|
fontSizeLarge,
|
|
9
9
|
lineHeight,
|
|
10
|
-
borderRadius, borderColor: composite(cardColor, dividerColor), borderColorModal: composite(modalColor, dividerColor), borderColorPopover: composite(popoverColor, dividerColor), tdColor: cardColor, tdColorModal: modalColor, tdColorPopover: popoverColor, tdColorStriped: composite(cardColor,
|
|
10
|
+
borderRadius, borderColor: composite(cardColor, dividerColor), borderColorModal: composite(modalColor, dividerColor), borderColorPopover: composite(popoverColor, dividerColor), tdColor: cardColor, tdColorModal: modalColor, tdColorPopover: popoverColor, tdColorStriped: composite(cardColor, tableColorStriped), tdColorStripedModal: composite(modalColor, tableColorStriped), tdColorStripedPopover: composite(popoverColor, tableColorStriped), thColor: composite(cardColor, tableHeaderColor), thColorModal: composite(modalColor, tableHeaderColor), thColorPopover: composite(popoverColor, tableHeaderColor), thTextColor: textColor1, tdTextColor: textColor2, thFontWeight: fontWeightStrong });
|
|
11
11
|
};
|
|
12
12
|
const tableLight = {
|
|
13
13
|
name: 'Table',
|
|
@@ -146,6 +146,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
146
|
tableHeaderColor: string;
|
|
147
147
|
hoverColor: string;
|
|
148
148
|
tableColorHover: string;
|
|
149
|
+
tableColorStriped: string;
|
|
149
150
|
pressedColor: string;
|
|
150
151
|
opacityDisabled: string;
|
|
151
152
|
inputColorDisabled: string;
|
|
@@ -2006,6 +2006,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2006
2006
|
tableHeaderColor: string;
|
|
2007
2007
|
hoverColor: string;
|
|
2008
2008
|
tableColorHover: string;
|
|
2009
|
+
tableColorStriped: string;
|
|
2009
2010
|
pressedColor: string;
|
|
2010
2011
|
opacityDisabled: string;
|
|
2011
2012
|
inputColorDisabled: string;
|
|
@@ -103,7 +103,7 @@ declare const tooltipProps: {
|
|
|
103
103
|
default: string;
|
|
104
104
|
};
|
|
105
105
|
arrowStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
106
|
-
|
|
106
|
+
flip: {
|
|
107
107
|
type: BooleanConstructor;
|
|
108
108
|
default: boolean;
|
|
109
109
|
};
|
|
@@ -245,7 +245,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
245
245
|
default: string;
|
|
246
246
|
};
|
|
247
247
|
arrowStyle: import("vue").PropType<string | import("vue").CSSProperties>;
|
|
248
|
-
|
|
248
|
+
flip: {
|
|
249
249
|
type: BooleanConstructor;
|
|
250
250
|
default: boolean;
|
|
251
251
|
};
|
|
@@ -358,6 +358,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
358
358
|
tableHeaderColor: string;
|
|
359
359
|
hoverColor: string;
|
|
360
360
|
tableColorHover: string;
|
|
361
|
+
tableColorStriped: string;
|
|
361
362
|
pressedColor: string;
|
|
362
363
|
opacityDisabled: string;
|
|
363
364
|
inputColorDisabled: string;
|
|
@@ -449,7 +450,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
449
450
|
getDisabled?: unknown;
|
|
450
451
|
displayDirective?: unknown;
|
|
451
452
|
arrowStyle?: unknown;
|
|
452
|
-
|
|
453
|
+
flip?: unknown;
|
|
453
454
|
animated?: unknown;
|
|
454
455
|
width?: unknown;
|
|
455
456
|
overlap?: unknown;
|
|
@@ -467,6 +468,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
467
468
|
minWidth?: unknown;
|
|
468
469
|
maxWidth?: unknown;
|
|
469
470
|
} & {
|
|
471
|
+
flip: boolean;
|
|
470
472
|
disabled: boolean;
|
|
471
473
|
duration: number;
|
|
472
474
|
raw: boolean;
|
|
@@ -476,7 +478,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
476
478
|
showArrow: boolean;
|
|
477
479
|
delay: number;
|
|
478
480
|
displayDirective: "show" | "if";
|
|
479
|
-
filp: boolean;
|
|
480
481
|
animated: boolean;
|
|
481
482
|
defaultShow: boolean;
|
|
482
483
|
internalExtraClass: string[];
|
|
@@ -567,6 +568,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
567
568
|
arrow?: boolean | undefined;
|
|
568
569
|
}>, {
|
|
569
570
|
show: boolean | undefined;
|
|
571
|
+
flip: boolean;
|
|
570
572
|
width: number | "trigger";
|
|
571
573
|
disabled: boolean;
|
|
572
574
|
duration: number;
|
|
@@ -578,7 +580,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
578
580
|
showArrow: boolean;
|
|
579
581
|
delay: number;
|
|
580
582
|
displayDirective: "show" | "if";
|
|
581
|
-
filp: boolean;
|
|
582
583
|
animated: boolean;
|
|
583
584
|
defaultShow: boolean;
|
|
584
585
|
internalExtraClass: string[];
|
|
@@ -2152,6 +2152,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2152
2152
|
tableHeaderColor: string;
|
|
2153
2153
|
hoverColor: string;
|
|
2154
2154
|
tableColorHover: string;
|
|
2155
|
+
tableColorStriped: string;
|
|
2155
2156
|
pressedColor: string;
|
|
2156
2157
|
opacityDisabled: string;
|
|
2157
2158
|
inputColorDisabled: string;
|
|
@@ -100,6 +100,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
100
|
tableHeaderColor: string;
|
|
101
101
|
hoverColor: string;
|
|
102
102
|
tableColorHover: string;
|
|
103
|
+
tableColorStriped: string;
|
|
103
104
|
pressedColor: string;
|
|
104
105
|
opacityDisabled: string;
|
|
105
106
|
inputColorDisabled: string;
|
package/es/tree/src/Tree.d.ts
CHANGED
|
@@ -598,6 +598,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
598
598
|
tableHeaderColor: string;
|
|
599
599
|
hoverColor: string;
|
|
600
600
|
tableColorHover: string;
|
|
601
|
+
tableColorStriped: string;
|
|
601
602
|
pressedColor: string;
|
|
602
603
|
opacityDisabled: string;
|
|
603
604
|
inputColorDisabled: string;
|
|
@@ -1131,6 +1131,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1131
1131
|
tableHeaderColor: string;
|
|
1132
1132
|
hoverColor: string;
|
|
1133
1133
|
tableColorHover: string;
|
|
1134
|
+
tableColorStriped: string;
|
|
1134
1135
|
pressedColor: string;
|
|
1135
1136
|
opacityDisabled: string;
|
|
1136
1137
|
inputColorDisabled: string;
|
package/es/upload/index.d.ts
CHANGED
|
@@ -3,5 +3,4 @@ export { default as NUploadDragger } from './src/UploadDragger';
|
|
|
3
3
|
export { default as NUploadTrigger } from './src/UploadTrigger';
|
|
4
4
|
export { default as NUploadFileList } from './src/UploadFileList';
|
|
5
5
|
export type { UploadProps } from './src/Upload';
|
|
6
|
-
export type {
|
|
7
|
-
export type { UploadInst, FileInfo as UploadFileInfo } from './src/interface';
|
|
6
|
+
export type { UploadInst, FileInfo as UploadFileInfo, CustomRequestOptions as UploadCustomRequestOptions } from './src/interface';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType, CSSProperties } from 'vue';
|
|
2
2
|
import { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
|
|
3
|
-
import { FileInfo, FuncOrRecordOrUndef, OnFinish, OnRemove, OnDownload, OnChange, OnUpdateFileList, OnBeforeUpload, listType, OnPreview, CreateThumbnailUrl } from './interface';
|
|
3
|
+
import { FileInfo, FuncOrRecordOrUndef, OnFinish, OnRemove, OnDownload, OnChange, OnUpdateFileList, OnBeforeUpload, listType, OnPreview, CreateThumbnailUrl, CustomRequest } from './interface';
|
|
4
4
|
declare const uploadProps: {
|
|
5
5
|
readonly name: {
|
|
6
6
|
readonly type: StringConstructor;
|
|
@@ -8,6 +8,7 @@ declare const uploadProps: {
|
|
|
8
8
|
};
|
|
9
9
|
readonly accept: StringConstructor;
|
|
10
10
|
readonly action: StringConstructor;
|
|
11
|
+
readonly customRequest: PropType<CustomRequest>;
|
|
11
12
|
readonly method: {
|
|
12
13
|
readonly type: StringConstructor;
|
|
13
14
|
readonly default: "POST";
|
|
@@ -50,10 +51,7 @@ declare const uploadProps: {
|
|
|
50
51
|
readonly type: BooleanConstructor;
|
|
51
52
|
readonly default: true;
|
|
52
53
|
};
|
|
53
|
-
readonly showDownloadButton:
|
|
54
|
-
readonly type: BooleanConstructor;
|
|
55
|
-
readonly default: false;
|
|
56
|
-
};
|
|
54
|
+
readonly showDownloadButton: BooleanConstructor;
|
|
57
55
|
readonly showRetryButton: {
|
|
58
56
|
readonly type: BooleanConstructor;
|
|
59
57
|
readonly default: true;
|
|
@@ -814,6 +812,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
814
812
|
};
|
|
815
813
|
readonly accept: StringConstructor;
|
|
816
814
|
readonly action: StringConstructor;
|
|
815
|
+
readonly customRequest: PropType<CustomRequest>;
|
|
817
816
|
readonly method: {
|
|
818
817
|
readonly type: StringConstructor;
|
|
819
818
|
readonly default: "POST";
|
|
@@ -856,10 +855,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
856
855
|
readonly type: BooleanConstructor;
|
|
857
856
|
readonly default: true;
|
|
858
857
|
};
|
|
859
|
-
readonly showDownloadButton:
|
|
860
|
-
readonly type: BooleanConstructor;
|
|
861
|
-
readonly default: false;
|
|
862
|
-
};
|
|
858
|
+
readonly showDownloadButton: BooleanConstructor;
|
|
863
859
|
readonly showRetryButton: {
|
|
864
860
|
readonly type: BooleanConstructor;
|
|
865
861
|
readonly default: true;
|
|
@@ -1689,6 +1685,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1689
1685
|
tableHeaderColor: string;
|
|
1690
1686
|
hoverColor: string;
|
|
1691
1687
|
tableColorHover: string;
|
|
1688
|
+
tableColorStriped: string;
|
|
1692
1689
|
pressedColor: string;
|
|
1693
1690
|
opacityDisabled: string;
|
|
1694
1691
|
inputColorDisabled: string;
|
|
@@ -1988,6 +1985,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1988
1985
|
readonly name?: unknown;
|
|
1989
1986
|
readonly accept?: unknown;
|
|
1990
1987
|
readonly action?: unknown;
|
|
1988
|
+
readonly customRequest?: unknown;
|
|
1991
1989
|
readonly method?: unknown;
|
|
1992
1990
|
readonly multiple?: unknown;
|
|
1993
1991
|
readonly showFileList?: unknown;
|
|
@@ -2778,6 +2776,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2778
2776
|
}, any>;
|
|
2779
2777
|
}>> | undefined;
|
|
2780
2778
|
onRemove?: OnRemove | undefined;
|
|
2779
|
+
customRequest?: CustomRequest | undefined;
|
|
2781
2780
|
onFinish?: OnFinish | undefined;
|
|
2782
2781
|
onBeforeUpload?: OnBeforeUpload | undefined;
|
|
2783
2782
|
onDownload?: OnDownload | undefined;
|
package/es/upload/src/Upload.js
CHANGED
|
@@ -68,6 +68,45 @@ function createXhrHandlers(inst, file, XHR) {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
function customSubmitImpl(options) {
|
|
72
|
+
const { inst, file, data, headers, withCredentials, action, customRequest } = options;
|
|
73
|
+
const { doChange } = options.inst;
|
|
74
|
+
let percentage = 0;
|
|
75
|
+
customRequest({
|
|
76
|
+
file,
|
|
77
|
+
data,
|
|
78
|
+
headers,
|
|
79
|
+
withCredentials,
|
|
80
|
+
action,
|
|
81
|
+
onProgress(event) {
|
|
82
|
+
const fileAfterChange = Object.assign({}, file, {
|
|
83
|
+
status: 'uploading'
|
|
84
|
+
});
|
|
85
|
+
const progress = event.percent;
|
|
86
|
+
fileAfterChange.percentage = progress;
|
|
87
|
+
percentage = progress;
|
|
88
|
+
doChange(fileAfterChange);
|
|
89
|
+
},
|
|
90
|
+
onFinish() {
|
|
91
|
+
var _a;
|
|
92
|
+
let fileAfterChange = Object.assign({}, file, {
|
|
93
|
+
status: 'finished',
|
|
94
|
+
percentage,
|
|
95
|
+
file: null
|
|
96
|
+
});
|
|
97
|
+
fileAfterChange =
|
|
98
|
+
((_a = inst.onFinish) === null || _a === void 0 ? void 0 : _a.call(inst, { file: fileAfterChange })) || fileAfterChange;
|
|
99
|
+
doChange(fileAfterChange);
|
|
100
|
+
},
|
|
101
|
+
onError() {
|
|
102
|
+
const fileAfterChange = Object.assign({}, file, {
|
|
103
|
+
status: 'error',
|
|
104
|
+
percentage
|
|
105
|
+
});
|
|
106
|
+
doChange(fileAfterChange);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
71
110
|
function registerHandler(inst, file, request) {
|
|
72
111
|
const handlers = createXhrHandlers(inst, file, request);
|
|
73
112
|
request.onabort = handlers.handleXHRAbort;
|
|
@@ -120,7 +159,7 @@ function submitImpl(inst, file, formData, { method, action, withCredentials, hea
|
|
|
120
159
|
const uploadProps = Object.assign(Object.assign({}, useTheme.props), { name: {
|
|
121
160
|
type: String,
|
|
122
161
|
default: 'file'
|
|
123
|
-
}, accept: String, action: String,
|
|
162
|
+
}, accept: String, action: String, customRequest: Function,
|
|
124
163
|
// to be impl
|
|
125
164
|
// directory: {
|
|
126
165
|
// type: Boolean,
|
|
@@ -149,10 +188,7 @@ const uploadProps = Object.assign(Object.assign({}, useTheme.props), { name: {
|
|
|
149
188
|
}, showRemoveButton: {
|
|
150
189
|
type: Boolean,
|
|
151
190
|
default: true
|
|
152
|
-
}, showDownloadButton: {
|
|
153
|
-
type: Boolean,
|
|
154
|
-
default: false
|
|
155
|
-
}, showRetryButton: {
|
|
191
|
+
}, showDownloadButton: Boolean, showRetryButton: {
|
|
156
192
|
type: Boolean,
|
|
157
193
|
default: true
|
|
158
194
|
}, showPreviewButton: {
|
|
@@ -264,17 +300,34 @@ export default defineComponent({
|
|
|
264
300
|
if (status === 'pending' || (status === 'error' && shouldReupload)) {
|
|
265
301
|
const formData = new FormData();
|
|
266
302
|
formData.append(fieldName, file.file);
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
303
|
+
if (props.customRequest) {
|
|
304
|
+
customSubmitImpl({
|
|
305
|
+
inst: {
|
|
306
|
+
doChange,
|
|
307
|
+
XhrMap,
|
|
308
|
+
onFinish: props.onFinish
|
|
309
|
+
},
|
|
310
|
+
file,
|
|
311
|
+
action,
|
|
312
|
+
withCredentials,
|
|
313
|
+
headers,
|
|
314
|
+
data,
|
|
315
|
+
customRequest: props.customRequest
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
submitImpl({
|
|
320
|
+
doChange,
|
|
321
|
+
XhrMap,
|
|
322
|
+
onFinish: props.onFinish
|
|
323
|
+
}, file, formData, {
|
|
324
|
+
method,
|
|
325
|
+
action,
|
|
326
|
+
withCredentials,
|
|
327
|
+
headers,
|
|
328
|
+
data
|
|
329
|
+
});
|
|
330
|
+
}
|
|
278
331
|
}
|
|
279
332
|
});
|
|
280
333
|
}
|
|
@@ -21,7 +21,7 @@ export declare type OnChange = (data: {
|
|
|
21
21
|
}) => void;
|
|
22
22
|
export declare type OnFinish = ({ file, event }: {
|
|
23
23
|
file: FileInfo;
|
|
24
|
-
event
|
|
24
|
+
event?: Event;
|
|
25
25
|
}) => FileInfo | undefined;
|
|
26
26
|
export declare type OnRemove = (data: {
|
|
27
27
|
file: FileInfo;
|
|
@@ -85,3 +85,16 @@ export declare type OnBeforeUpload = (data: {
|
|
|
85
85
|
export declare type listType = 'text' | 'image' | 'image-card';
|
|
86
86
|
export declare type OnPreview = (file: FileInfo) => void;
|
|
87
87
|
export declare type CreateThumbnailUrl = (file: File) => Promise<string>;
|
|
88
|
+
export interface CustomRequestOptions {
|
|
89
|
+
file: FileInfo;
|
|
90
|
+
action?: string;
|
|
91
|
+
withCredentials?: boolean;
|
|
92
|
+
data?: FuncOrRecordOrUndef;
|
|
93
|
+
headers?: FuncOrRecordOrUndef;
|
|
94
|
+
onProgress: (e: {
|
|
95
|
+
percent: number;
|
|
96
|
+
}) => void;
|
|
97
|
+
onFinish: () => void;
|
|
98
|
+
onError: () => void;
|
|
99
|
+
}
|
|
100
|
+
export declare type CustomRequest = (options: CustomRequestOptions) => void;
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.21.
|
|
1
|
+
declare const _default: "2.21.2";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.21.
|
|
1
|
+
export default '2.21.2';
|
|
@@ -120,6 +120,7 @@ declare const Scrollbar: import("vue").DefineComponent<{
|
|
|
120
120
|
scrollTo: ScrollTo;
|
|
121
121
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
122
122
|
containerScrollTop: import("vue").Ref<number>;
|
|
123
|
+
wrapperRef: import("vue").Ref<HTMLElement | null>;
|
|
123
124
|
containerRef: import("vue").Ref<HTMLElement | null>;
|
|
124
125
|
contentRef: import("vue").Ref<HTMLElement | null>;
|
|
125
126
|
yRailRef: import("vue").Ref<HTMLElement | null>;
|