@opentiny/vue-renderless 3.14.0 → 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/common/bigInt.js +2 -2
- package/common/deps/date-util.js +4 -2
- package/date-range/vue.js +1 -0
- package/date-table/index.js +30 -53
- package/date-table/vue.js +1 -1
- package/numeric/index.js +4 -2
- package/package.json +1 -1
- package/picker/index.js +194 -190
- package/picker/vue.js +6 -3
- package/popeditor/index.js +2 -2
- package/select/index.js +14 -27
- package/select/vue.js +27 -7
- package/types/action-sheet.type.d.ts +2 -2
- package/types/alert.type.d.ts +1 -1
- package/types/checkbox.type.d.ts +3 -3
- package/types/collapse.type.d.ts +1 -1
- package/types/drawer.type.d.ts +1 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-222799ae.d.ts → form.type-a2dc0099.d.ts} +1 -1
- package/types/form.type.d.ts +1 -1
- package/types/input.type.d.ts +1 -1
- package/types/milestone.type.d.ts +1 -1
- package/types/pager.type.d.ts +1 -1
- package/types/popeditor.type.d.ts +1 -1
- package/types/popover.type.d.ts +2 -2
- package/types/progress.type.d.ts +1 -1
- package/types/steps.type.d.ts +1 -1
- package/types/switch.type.d.ts +3 -3
- package/types/transfer.type.d.ts +1 -1
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-a29aea50.d.ts → upload-list.type-6d6e3d0e.d.ts} +8 -4
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/user/index.js +1 -1
package/common/bigInt.js
CHANGED
|
@@ -119,7 +119,7 @@ class BigIntDecimal {
|
|
|
119
119
|
const f = Function;
|
|
120
120
|
const convertBigInt = (str) => {
|
|
121
121
|
const validStr = str.replace(/^0+/, "") || "0";
|
|
122
|
-
return f(`return BigInt(${validStr})`)();
|
|
122
|
+
return f(`return BigInt('${validStr}')`)();
|
|
123
123
|
};
|
|
124
124
|
if (validateNumber(mergedValue)) {
|
|
125
125
|
const trimRet = trimNumber(mergedValue);
|
|
@@ -127,7 +127,7 @@ class BigIntDecimal {
|
|
|
127
127
|
const numbers = trimRet.trimStr.split(".");
|
|
128
128
|
this.integer = !numbers[0].includes("e") ? BigInt(numbers[0]) : numbers[0];
|
|
129
129
|
const decimalStr = numbers[1] || "0";
|
|
130
|
-
this.decimal = convertBigInt(decimalStr);
|
|
130
|
+
this.decimal = decimalStr.includes("e") ? convertBigInt(decimalStr) : BigInt(decimalStr);
|
|
131
131
|
this.decimalLen = decimalStr.length;
|
|
132
132
|
} else {
|
|
133
133
|
this.nan = true;
|
package/common/deps/date-util.js
CHANGED
|
@@ -60,10 +60,12 @@ const getFirstDayOfMonth = (date) => {
|
|
|
60
60
|
};
|
|
61
61
|
const prevDate = (date, amount = 1) => new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
|
|
62
62
|
const nextDate = (date, amount = 1) => new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
|
|
63
|
-
const getStartDateOfMonth = (year, month) => {
|
|
63
|
+
const getStartDateOfMonth = (year, month, offsetDay = 0) => {
|
|
64
64
|
const res = new Date(year, month, 1);
|
|
65
65
|
const day = res.getDay();
|
|
66
|
-
|
|
66
|
+
const _day = day === 0 ? 7 : day;
|
|
67
|
+
const offset = _day + offsetDay <= 0 ? 7 + _day : _day;
|
|
68
|
+
return prevDate(res, offset);
|
|
67
69
|
};
|
|
68
70
|
const getWeekNumber = (src) => {
|
|
69
71
|
if (!isDate(src)) {
|
package/date-range/vue.js
CHANGED
|
@@ -117,6 +117,7 @@ const initState = ({ reactive, computed, api: api2, constants, designConfig }) =
|
|
|
117
117
|
dateFormat: computed(() => state.format ? extractDateFormat(state.format) : "yyyy-MM-dd"),
|
|
118
118
|
enableMonthArrow: computed(() => api2.getEnableMonthArrow()),
|
|
119
119
|
enableYearArrow: computed(() => api2.computerEnableYearArrow()),
|
|
120
|
+
// tiny 新增
|
|
120
121
|
confirmButtonProps: __spreadValues({
|
|
121
122
|
plain: true,
|
|
122
123
|
type: "default"
|
package/date-table/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../common/deps/date-util";
|
|
12
12
|
import { DATEPICKER } from "../common";
|
|
13
13
|
const formatJudg = ({ day, offset, j, i, cell, count, dateCountOfLastMonth }) => {
|
|
14
|
-
const nodfpm = day + offset
|
|
14
|
+
const nodfpm = day + offset <= 0 ? 7 + day + offset : day + offset;
|
|
15
15
|
if (j + i * 7 >= nodfpm) {
|
|
16
16
|
cell.text = count++;
|
|
17
17
|
} else {
|
|
@@ -36,19 +36,7 @@ const getDateTimestamp = (time) => {
|
|
|
36
36
|
}
|
|
37
37
|
return NaN;
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
for (let i = 0, len = arr.length; i !== len; ++i) {
|
|
41
|
-
if (pred(arr[i])) {
|
|
42
|
-
return i;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return -1;
|
|
46
|
-
};
|
|
47
|
-
const arrayFind = (arr, pred) => {
|
|
48
|
-
const idx = arrayFindIndex(arr, pred);
|
|
49
|
-
return ~idx ? arr[idx] : void 0;
|
|
50
|
-
};
|
|
51
|
-
const getSelected = ({ props, cell, format, t, cellDate, selectedDate }) => {
|
|
39
|
+
const getSelected = (props, cell, format, t, cellDate, selectedDate) => {
|
|
52
40
|
let selected = cell.selected;
|
|
53
41
|
if (props.selectionMode === "dates") {
|
|
54
42
|
selected = arrayFind(selectedDate, (date) => formatDate(date, format, t) === formatDate(cellDate, format, t));
|
|
@@ -61,14 +49,7 @@ const getCell = ({ state, props }) => (row, i, j) => {
|
|
|
61
49
|
const now = getDateTimestamp(/* @__PURE__ */ new Date());
|
|
62
50
|
let cell = row[props.showWeekNumber ? j + 1 : j];
|
|
63
51
|
if (!cell) {
|
|
64
|
-
cell = {
|
|
65
|
-
row: i,
|
|
66
|
-
column: j,
|
|
67
|
-
inRange: false,
|
|
68
|
-
start: false,
|
|
69
|
-
end: false,
|
|
70
|
-
type: DATEPICKER.Normal
|
|
71
|
-
};
|
|
52
|
+
cell = { row: i, column: j, inRange: false, start: false, end: false, type: DATEPICKER.Normal };
|
|
72
53
|
}
|
|
73
54
|
cell.type = DATEPICKER.Normal;
|
|
74
55
|
const index = i * 7 + j;
|
|
@@ -81,15 +62,7 @@ const getCell = ({ state, props }) => (row, i, j) => {
|
|
|
81
62
|
};
|
|
82
63
|
const doCount = ({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCountOfMonth }) => {
|
|
83
64
|
if (i >= 0 && i <= 1) {
|
|
84
|
-
const ret = formatJudg({
|
|
85
|
-
day,
|
|
86
|
-
offset,
|
|
87
|
-
j,
|
|
88
|
-
i,
|
|
89
|
-
cell,
|
|
90
|
-
count,
|
|
91
|
-
dateCountOfLastMonth
|
|
92
|
-
});
|
|
65
|
+
const ret = formatJudg({ day, offset, j, i, cell, count, dateCountOfLastMonth });
|
|
93
66
|
count = ret.count;
|
|
94
67
|
} else {
|
|
95
68
|
if (count <= dateCountOfMonth) {
|
|
@@ -101,7 +74,6 @@ const doCount = ({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCou
|
|
|
101
74
|
}
|
|
102
75
|
return count;
|
|
103
76
|
};
|
|
104
|
-
const coerceTruthyValueToArray = (val) => Array.isArray(val) ? val : val ? [val] : [];
|
|
105
77
|
const getRows = ({ api, props, state, t, vm }) => () => {
|
|
106
78
|
const date = new Date(state.year, state.month, 1);
|
|
107
79
|
let day = getFirstDayOfMonth(date);
|
|
@@ -133,15 +105,7 @@ const getRows = ({ api, props, state, t, vm }) => () => {
|
|
|
133
105
|
const { cell, cellDate } = api.getCell(row, i, j, DATEPICKER.Normal, props);
|
|
134
106
|
count = doCount({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCountOfMonth });
|
|
135
107
|
cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
|
|
136
|
-
cell.selected = getSelected(
|
|
137
|
-
props,
|
|
138
|
-
cell,
|
|
139
|
-
api,
|
|
140
|
-
format: DATEPICKER.DateFormats.date,
|
|
141
|
-
t,
|
|
142
|
-
cellDate,
|
|
143
|
-
selectedDate
|
|
144
|
-
});
|
|
108
|
+
cell.selected = getSelected(props, cell, DATEPICKER.DateFormats.date, t, cellDate, selectedDate);
|
|
145
109
|
cell.customClass = typeof cellClassName === "function" && cellClassName(cellDate);
|
|
146
110
|
vm.$set(row, props.showWeekNumber ? j + 1 : j, cell);
|
|
147
111
|
arr[i].push(cellDate);
|
|
@@ -165,6 +129,19 @@ const getRows = ({ api, props, state, t, vm }) => () => {
|
|
|
165
129
|
}
|
|
166
130
|
return rows;
|
|
167
131
|
};
|
|
132
|
+
const arrayFindIndex = (arr, pred) => {
|
|
133
|
+
for (let i = 0, len = arr.length; i !== len; ++i) {
|
|
134
|
+
if (pred(arr[i])) {
|
|
135
|
+
return i;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return -1;
|
|
139
|
+
};
|
|
140
|
+
const arrayFind = (arr, pred) => {
|
|
141
|
+
const idx = arrayFindIndex(arr, pred);
|
|
142
|
+
return ~idx ? arr[idx] : void 0;
|
|
143
|
+
};
|
|
144
|
+
const coerceTruthyValueToArray = (val) => Array.isArray(val) ? val : val ? [val] : [];
|
|
168
145
|
const watchMinDate = ({ api, props }) => (value, oldvalue) => {
|
|
169
146
|
if (getDateTimestamp(value) !== getDateTimestamp(oldvalue)) {
|
|
170
147
|
api.markRange(props.minDate, props.maxDate);
|
|
@@ -259,14 +236,14 @@ const markRange = ({ props, state }) => (minDate, maxDate) => {
|
|
|
259
236
|
for (let i = 0, k = rows.length; i < k; i++) {
|
|
260
237
|
const row = rows[i];
|
|
261
238
|
for (let j = 0, l = row.length; j < l; j++) {
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
239
|
+
if (props.showWeekNumber && j === 0)
|
|
240
|
+
continue;
|
|
241
|
+
const cell = row[j];
|
|
242
|
+
const index = i * 7 + j + (props.showWeekNumber ? -1 : 0);
|
|
243
|
+
const time = nextDate(startDate, index - state.offsetDay).getTime();
|
|
244
|
+
cell.inRange = minDate && time >= minDate && time <= maxDate;
|
|
245
|
+
cell.start = minDate && time === minDate;
|
|
246
|
+
cell.end = maxDate && time === maxDate;
|
|
270
247
|
}
|
|
271
248
|
}
|
|
272
249
|
};
|
|
@@ -312,10 +289,6 @@ const getTarget = (event) => {
|
|
|
312
289
|
}
|
|
313
290
|
return target;
|
|
314
291
|
};
|
|
315
|
-
const removeFromArray = (arr, pred) => {
|
|
316
|
-
const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
|
|
317
|
-
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
|
|
318
|
-
};
|
|
319
292
|
const handleClick = ({ api, emit, props, state }) => (event) => {
|
|
320
293
|
let target = getTarget(event);
|
|
321
294
|
if (target.tagName !== "TD") {
|
|
@@ -357,6 +330,10 @@ const handleClick = ({ api, emit, props, state }) => (event) => {
|
|
|
357
330
|
emit("pick", newValue);
|
|
358
331
|
}
|
|
359
332
|
};
|
|
333
|
+
const removeFromArray = (arr, pred) => {
|
|
334
|
+
const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
|
|
335
|
+
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
|
|
336
|
+
};
|
|
360
337
|
const getCssToken = ({ api }) => (cell, prexfix = "") => {
|
|
361
338
|
const cssStr = api.getCellClasses(cell) || "";
|
|
362
339
|
return cssStr.split(" ").map((className) => prexfix + className);
|
package/date-table/vue.js
CHANGED
|
@@ -29,7 +29,7 @@ const initState = ({ reactive, computed, api: api2, props }) => {
|
|
|
29
29
|
month: computed(() => !Array.isArray(props.date) && props.date.getMonth()),
|
|
30
30
|
offsetDay: computed(() => api2.getOffsetDay()),
|
|
31
31
|
year: computed(() => !Array.isArray(props.date) && props.date.getFullYear()),
|
|
32
|
-
startDate: computed(() => getStartDateOfMonth(state.year, state.month)),
|
|
32
|
+
startDate: computed(() => getStartDateOfMonth(state.year, state.month, state.offsetDay)),
|
|
33
33
|
date: props.value
|
|
34
34
|
});
|
|
35
35
|
return state;
|
package/numeric/index.js
CHANGED
|
@@ -61,7 +61,8 @@ const increase = ({ api, props, state }) => () => {
|
|
|
61
61
|
if (state.inputDisabled || state.maxDisabled) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const userInput = props.stringMode ? state.userInput : Number(state.userInput);
|
|
65
|
+
const value = (props.mouseWheel ? state.displayValue : userInput) || 0;
|
|
65
66
|
if (value.toString().includes("e")) {
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
@@ -79,7 +80,8 @@ const decrease = ({ api, props, state }) => () => {
|
|
|
79
80
|
if (state.inputDisabled || state.minDisabled) {
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
|
-
const
|
|
83
|
+
const userInput = props.stringMode ? state.userInput : Number(state.userInput);
|
|
84
|
+
const value = (props.mouseWheel ? state.displayValue : userInput) || 0;
|
|
83
85
|
if (value.toString().includes("e")) {
|
|
84
86
|
return;
|
|
85
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
|
5
5
|
"homepage": "https://opentiny.design/tiny-vue",
|
|
6
6
|
"keywords": [
|
package/picker/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import userPopper from "../common/deps/vue-popper";
|
|
|
8
8
|
import { DATEPICKER } from "../common";
|
|
9
9
|
import { formatDate, parseDate, isDateObject, getWeekNumber, prevDate, nextDate } from "../common/deps/date-util";
|
|
10
10
|
import { extend } from "../common/object";
|
|
11
|
-
import { isFunction } from "../common/type";
|
|
12
11
|
import globalTimezone from "./timezone";
|
|
13
12
|
const iso8601Reg = /^\d{4}-\d{2}-\d{2}(.)\d{2}:\d{2}:\d{2}(.+)$/;
|
|
14
13
|
const getPanel = ({ DatePanel, DateRangePanel, MonthRangePanel, YearRangePanel, TimePanel, TimeRangePanel, TimeSelect }) => (type) => {
|
|
@@ -27,7 +26,14 @@ const getPanel = ({ DatePanel, DateRangePanel, MonthRangePanel, YearRangePanel,
|
|
|
27
26
|
}
|
|
28
27
|
return DatePanel;
|
|
29
28
|
};
|
|
30
|
-
const
|
|
29
|
+
const watchMobileVisible = ({ api, props, state }) => ([dateMobileVisible, timeMobileVisible]) => {
|
|
30
|
+
if (dateMobileVisible || timeMobileVisible) {
|
|
31
|
+
state.valueOnOpen = Array.isArray(props.modelValue) ? [...props.modelValue] : props.modelValue;
|
|
32
|
+
} else {
|
|
33
|
+
api.emitChange(props.modelValue);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const watchPickerVisible = ({ api, vm, dispatch, emit, props, state, nextTick }) => (value) => {
|
|
31
37
|
if (props.readonly || state.pickerDisabled || state.isMobileScreen)
|
|
32
38
|
return;
|
|
33
39
|
if (value) {
|
|
@@ -35,7 +41,7 @@ const watchPickerVisible = ({ api, vm, dispatch, emit, props, state }) => (value
|
|
|
35
41
|
state.valueOnOpen = Array.isArray(props.modelValue) ? [...props.modelValue] : props.modelValue;
|
|
36
42
|
} else {
|
|
37
43
|
api.hidePicker();
|
|
38
|
-
api.emitChange(props.modelValue);
|
|
44
|
+
nextTick(() => api.emitChange(props.modelValue));
|
|
39
45
|
state.userInput = null;
|
|
40
46
|
if (props.validateEvent) {
|
|
41
47
|
dispatch("FormItem", "form.blur");
|
|
@@ -85,13 +91,7 @@ const displayValue = ({ api, props, state }) => () => {
|
|
|
85
91
|
const formatObj = {
|
|
86
92
|
rangeSeparator: props.rangeSeparator
|
|
87
93
|
};
|
|
88
|
-
const formattedValue = api.formatAsFormatAndType(
|
|
89
|
-
state.parsedValue,
|
|
90
|
-
state.format,
|
|
91
|
-
state.type,
|
|
92
|
-
props.rangeSeparator,
|
|
93
|
-
formatObj
|
|
94
|
-
);
|
|
94
|
+
const formattedValue = api.formatAsFormatAndType(state.parsedValue, state.format, state.type, formatObj);
|
|
95
95
|
if (Array.isArray(state.userInput)) {
|
|
96
96
|
return [
|
|
97
97
|
state.userInput[0] || formattedValue && formattedValue[0] || "",
|
|
@@ -128,7 +128,9 @@ const parsedValue = ({ api, props, state, t }) => () => {
|
|
|
128
128
|
let date = props.modelValue;
|
|
129
129
|
if (isServiceTimezone) {
|
|
130
130
|
if (Array.isArray(date)) {
|
|
131
|
-
date = [].concat(date).map((item) =>
|
|
131
|
+
date = [].concat(date).map((item) => {
|
|
132
|
+
return isDate(item) ? formatDate(item, state.valueFormat, t) : item;
|
|
133
|
+
});
|
|
132
134
|
} else {
|
|
133
135
|
date = formatDate(date, state.valueFormat, t);
|
|
134
136
|
}
|
|
@@ -371,6 +373,161 @@ const handleMouseEnter = ({ props, state }) => () => {
|
|
|
371
373
|
state.showClose = true;
|
|
372
374
|
}
|
|
373
375
|
};
|
|
376
|
+
const handleInput = ({ state, props, api }) => (val, event) => {
|
|
377
|
+
event = val.target ? val : event;
|
|
378
|
+
if (props.autoFormat) {
|
|
379
|
+
const value = api.formatInputValue({ event, prevValue: state.displayValue });
|
|
380
|
+
state.userInput = value;
|
|
381
|
+
} else {
|
|
382
|
+
const val2 = event.target.value;
|
|
383
|
+
state.userInput = val2;
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
const formatInputValue = ({ props, state }) => ({ event, prevValue = "" }) => {
|
|
387
|
+
const val = event.target.value;
|
|
388
|
+
const inputData = event.data;
|
|
389
|
+
const format = state.type === "time-select" ? "HH:mm" : props.format || DATEPICKER.DateFormats[state.type];
|
|
390
|
+
if (inputData && inputData.charCodeAt() >= 48 && inputData.charCodeAt() <= 57) {
|
|
391
|
+
return formatText({ event, format, text: prevValue, needSelectionStart: true });
|
|
392
|
+
} else {
|
|
393
|
+
return val;
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
const getSelectionStart = ({ value, format, regx, event }) => {
|
|
397
|
+
const formatMatchArr = format.match(regx);
|
|
398
|
+
let selectionStart = getSelectionStartIndex(event);
|
|
399
|
+
let I = 0;
|
|
400
|
+
if (value !== "") {
|
|
401
|
+
const match = value.match(/[0-9]/g);
|
|
402
|
+
I = match === null ? 0 : match.length;
|
|
403
|
+
for (let i = 0; i < formatMatchArr.length; i++) {
|
|
404
|
+
I -= Math.max(formatMatchArr[i].length, 2);
|
|
405
|
+
}
|
|
406
|
+
I = I >= 0 ? 1 : 0;
|
|
407
|
+
I === 1 && selectionStart >= value.length && (selectionStart = value.length - 1);
|
|
408
|
+
}
|
|
409
|
+
return { selectionStart, I };
|
|
410
|
+
};
|
|
411
|
+
const getNum = (value, format, regx) => {
|
|
412
|
+
let len = value.length;
|
|
413
|
+
if (format && regx) {
|
|
414
|
+
const formatMatchArr = format.match(regx);
|
|
415
|
+
len = Math.max(len, formatMatchArr.join("").length);
|
|
416
|
+
}
|
|
417
|
+
let num = { str: "", arr: [] };
|
|
418
|
+
for (let i = 0; i < len; i++) {
|
|
419
|
+
let char = value.charAt(i) ? value.charAt(i) : "00";
|
|
420
|
+
if (/[0-9]/.test(char)) {
|
|
421
|
+
num.str += char;
|
|
422
|
+
} else {
|
|
423
|
+
num.arr[i] = 1;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return num;
|
|
427
|
+
};
|
|
428
|
+
const getSelectionStartIndex = (event) => {
|
|
429
|
+
const inputElem = event.target;
|
|
430
|
+
return inputElem.selectionStart - (event.data ? event.data.length : 0);
|
|
431
|
+
};
|
|
432
|
+
const moveStart = (inputElem, moveStartIndex) => {
|
|
433
|
+
if (inputElem.setSelectionRange) {
|
|
434
|
+
inputElem.focus();
|
|
435
|
+
setTimeout(() => {
|
|
436
|
+
inputElem.setSelectionRange(moveStartIndex, moveStartIndex);
|
|
437
|
+
}, 0);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
const formatText = ({ event, text, format, needSelectionStart = false }) => {
|
|
441
|
+
if (!format)
|
|
442
|
+
return text;
|
|
443
|
+
let cursorOffset = 0;
|
|
444
|
+
let value = "";
|
|
445
|
+
let regx = /yyyy|yyy|yy|y|MM|M|dd|d|HH|hh|H|h|mm|m|ss|s|WW|W|w/g;
|
|
446
|
+
let startIndex = 0;
|
|
447
|
+
let { numStr, selectionStart } = getNumAndSelectionStart({
|
|
448
|
+
value: text,
|
|
449
|
+
format,
|
|
450
|
+
regx,
|
|
451
|
+
event,
|
|
452
|
+
needSelectionStart
|
|
453
|
+
});
|
|
454
|
+
let matchResult = regx.exec(format);
|
|
455
|
+
while (numStr.str !== "" && matchResult !== null) {
|
|
456
|
+
let subStr;
|
|
457
|
+
let newNum;
|
|
458
|
+
let subLen;
|
|
459
|
+
const endIndex = matchResult.index;
|
|
460
|
+
if (startIndex >= 0) {
|
|
461
|
+
value += format.substring(startIndex, endIndex);
|
|
462
|
+
}
|
|
463
|
+
selectionStart >= startIndex + cursorOffset && selectionStart <= endIndex + cursorOffset && (selectionStart = selectionStart + endIndex - startIndex);
|
|
464
|
+
startIndex = regx.lastIndex;
|
|
465
|
+
subLen = startIndex - endIndex;
|
|
466
|
+
subStr = numStr.str.substring(0, subLen);
|
|
467
|
+
const firstMatchChar = matchResult[0].charAt(0);
|
|
468
|
+
const firstChar = parseInt(subStr.charAt(0), 10);
|
|
469
|
+
if (numStr.str.length > 1) {
|
|
470
|
+
const secondChar = numStr.str.charAt(1);
|
|
471
|
+
newNum = 10 * firstChar + parseInt(secondChar, 10);
|
|
472
|
+
} else {
|
|
473
|
+
newNum = firstChar;
|
|
474
|
+
}
|
|
475
|
+
if (numStr.arr[endIndex + 1] || firstMatchChar === "M" && newNum > 12 || firstMatchChar === "d" && newNum > 31 || ["H", "h"].includes(firstMatchChar) && newNum > 23 || "ms".includes(firstMatchChar) && newNum > 59) {
|
|
476
|
+
subStr = matchResult[0].length === 2 ? "0" + firstChar : firstChar;
|
|
477
|
+
selectionStart++;
|
|
478
|
+
} else {
|
|
479
|
+
if (subLen === 1) {
|
|
480
|
+
subStr = String(newNum);
|
|
481
|
+
subLen++;
|
|
482
|
+
cursorOffset++;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
value += subStr;
|
|
486
|
+
numStr.str = numStr.str.substring(subLen);
|
|
487
|
+
matchResult = regx.exec(format);
|
|
488
|
+
}
|
|
489
|
+
const { value: val, selectionStart: cursorPos } = checkFormat({
|
|
490
|
+
value,
|
|
491
|
+
format,
|
|
492
|
+
startIndex,
|
|
493
|
+
selectionStart,
|
|
494
|
+
regx,
|
|
495
|
+
needSelectionStart
|
|
496
|
+
});
|
|
497
|
+
value = val;
|
|
498
|
+
selectionStart = cursorPos;
|
|
499
|
+
needSelectionStart && moveStart(event.target, selectionStart);
|
|
500
|
+
return value;
|
|
501
|
+
};
|
|
502
|
+
const getNumAndSelectionStart = ({ value, format, regx, event, needSelectionStart }) => {
|
|
503
|
+
if (needSelectionStart) {
|
|
504
|
+
let { selectionStart, I } = getSelectionStart({ value, format, regx, event });
|
|
505
|
+
let valueStr;
|
|
506
|
+
if (event.data) {
|
|
507
|
+
valueStr = value.substring(0, selectionStart) + event.data + value.substring(selectionStart + I);
|
|
508
|
+
selectionStart++;
|
|
509
|
+
} else {
|
|
510
|
+
valueStr = value;
|
|
511
|
+
}
|
|
512
|
+
const numStr = getNum(valueStr);
|
|
513
|
+
return { numStr, selectionStart };
|
|
514
|
+
} else {
|
|
515
|
+
const numStr = getNum(value, format, regx);
|
|
516
|
+
return { numStr };
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
const checkFormat = ({ value, format, startIndex, selectionStart, regx, needSelectionStart }) => {
|
|
520
|
+
if (!needSelectionStart && regx.lastIndex === 0 || needSelectionStart && regx.lastIndex === 0 && selectionStart >= startIndex) {
|
|
521
|
+
const subFormat = `(?<=${format.substring(0, startIndex)})(\\s*\\S*\\s*)+`;
|
|
522
|
+
const pattern = new RegExp(subFormat, "g");
|
|
523
|
+
const res = format.match(pattern);
|
|
524
|
+
if (res) {
|
|
525
|
+
value += res[0];
|
|
526
|
+
selectionStart = value.length;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return { value, selectionStart };
|
|
530
|
+
};
|
|
374
531
|
const handleChange = ({ api, state }) => () => {
|
|
375
532
|
if (state.userInput) {
|
|
376
533
|
const value = api.parseString(state.displayValue);
|
|
@@ -556,13 +713,11 @@ const handleKeydown = ({ api, state }) => (event) => {
|
|
|
556
713
|
state.picker.handleKeydown(event);
|
|
557
714
|
}
|
|
558
715
|
};
|
|
559
|
-
const hidePicker = ({
|
|
716
|
+
const hidePicker = ({ destroyPopper, state }) => () => {
|
|
560
717
|
if (state.picker) {
|
|
561
718
|
state.picker.resetView && state.picker.resetView();
|
|
562
719
|
state.pickerVisible = state.picker.visible = state.picker.state.visible = false;
|
|
563
|
-
|
|
564
|
-
doDestroy();
|
|
565
|
-
}
|
|
720
|
+
destroyPopper();
|
|
566
721
|
}
|
|
567
722
|
};
|
|
568
723
|
const showPicker = ({ api, nextTick, updatePopper, state }) => () => {
|
|
@@ -594,23 +749,22 @@ const handleSelectRange = (state) => (start, end, pos) => {
|
|
|
594
749
|
return;
|
|
595
750
|
}
|
|
596
751
|
const adjust = (value, start2, end2) => {
|
|
597
|
-
if (
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
end2 = hourLength + minuteLength + secondLength + 2;
|
|
752
|
+
if (value) {
|
|
753
|
+
const valueReg = /(\d+):(\d+):(\d+)(\s+.+)?/;
|
|
754
|
+
if (valueReg.test(value)) {
|
|
755
|
+
const matched = valueReg.exec(value);
|
|
756
|
+
const hourLength = matched[1].length;
|
|
757
|
+
const minuteLength = matched[2].length;
|
|
758
|
+
const secondLength = matched[3].length;
|
|
759
|
+
if (start2 === 0) {
|
|
760
|
+
end2 = hourLength;
|
|
761
|
+
} else if (start2 === 3) {
|
|
762
|
+
start2 = hourLength + 1;
|
|
763
|
+
end2 = hourLength + minuteLength + 1;
|
|
764
|
+
} else {
|
|
765
|
+
start2 = hourLength + minuteLength + 2;
|
|
766
|
+
end2 = hourLength + minuteLength + secondLength + 2;
|
|
767
|
+
}
|
|
614
768
|
}
|
|
615
769
|
}
|
|
616
770
|
return { start: start2, end: end2 };
|
|
@@ -771,8 +925,12 @@ const computedFormat = ({ props, utils }) => () => {
|
|
|
771
925
|
}
|
|
772
926
|
return format;
|
|
773
927
|
};
|
|
774
|
-
const computedTriggerClass = ({ props, state }) => () =>
|
|
775
|
-
|
|
928
|
+
const computedTriggerClass = ({ props, state }) => () => {
|
|
929
|
+
return props.suffixIcon || props.prefixIcon || (state.type.includes(DATEPICKER.Time) ? DATEPICKER.IconTime : DATEPICKER.IconDate);
|
|
930
|
+
};
|
|
931
|
+
const computedHaveTrigger = ({ props }) => () => {
|
|
932
|
+
return typeof props.showTrigger !== "undefined" ? props.showTrigger : DATEPICKER.TriggerTypes.includes(props.type);
|
|
933
|
+
};
|
|
776
934
|
const initPopper = ({ props, hooks, vnode }) => {
|
|
777
935
|
const { reactive, watch, toRefs, onBeforeUnmount, onDeactivated } = hooks;
|
|
778
936
|
const { emit, vm, slots, nextTick } = vnode;
|
|
@@ -782,7 +940,7 @@ const initPopper = ({ props, hooks, vnode }) => {
|
|
|
782
940
|
watch,
|
|
783
941
|
emit,
|
|
784
942
|
props: __spreadProps(__spreadValues({}, props), {
|
|
785
|
-
popperOptions: { boundariesPadding: 0, gpuAcceleration: false },
|
|
943
|
+
popperOptions: Object.assign({ boundariesPadding: 0, gpuAcceleration: false }, props.popperOptions),
|
|
786
944
|
visibleArrow: true,
|
|
787
945
|
offset: 0,
|
|
788
946
|
boundariesPadding: 5,
|
|
@@ -846,161 +1004,6 @@ const setInputPaddingLeft = ({ props, state, vm, nextTick }) => () => {
|
|
|
846
1004
|
});
|
|
847
1005
|
}
|
|
848
1006
|
};
|
|
849
|
-
const getSelectionStart = ({ value, format, regx, event }) => {
|
|
850
|
-
const formatMatchArr = format.match(regx);
|
|
851
|
-
let selectionStart = getSelectionStartIndex(event);
|
|
852
|
-
let I = 0;
|
|
853
|
-
if (value !== "") {
|
|
854
|
-
const match = value.match(/[0-9]/g);
|
|
855
|
-
I = match === null ? 0 : match.length;
|
|
856
|
-
for (let i = 0; i < formatMatchArr.length; i++) {
|
|
857
|
-
I -= Math.max(formatMatchArr[i].length, 2);
|
|
858
|
-
}
|
|
859
|
-
I = I >= 0 ? 1 : 0;
|
|
860
|
-
I === 1 && selectionStart >= value.length && (selectionStart = value.length - 1);
|
|
861
|
-
}
|
|
862
|
-
return { selectionStart, I };
|
|
863
|
-
};
|
|
864
|
-
const getNum = (value, format, regx) => {
|
|
865
|
-
let len = value.length;
|
|
866
|
-
if (format && regx) {
|
|
867
|
-
const formatMatchArr = format.match(regx);
|
|
868
|
-
len = Math.max(len, formatMatchArr.join("").length);
|
|
869
|
-
}
|
|
870
|
-
let num = { str: "", arr: [] };
|
|
871
|
-
for (let i = 0; i < len; i++) {
|
|
872
|
-
let char = value.charAt(i) ? value.charAt(i) : "00";
|
|
873
|
-
if (/[0-9]/.test(char)) {
|
|
874
|
-
num.str += char;
|
|
875
|
-
} else {
|
|
876
|
-
num.arr[i] = 1;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return num;
|
|
880
|
-
};
|
|
881
|
-
const getSelectionStartIndex = (event) => {
|
|
882
|
-
const inputElem = event.target;
|
|
883
|
-
return inputElem.selectionStart - (event.data ? event.data.length : 0);
|
|
884
|
-
};
|
|
885
|
-
const getNumAndSelectionStart = ({ value, format, regx, event, needSelectionStart }) => {
|
|
886
|
-
if (needSelectionStart) {
|
|
887
|
-
let { selectionStart, I } = getSelectionStart({ value, format, regx, event });
|
|
888
|
-
let valueStr;
|
|
889
|
-
if (event.data) {
|
|
890
|
-
valueStr = value.substring(0, selectionStart) + event.data + value.substring(selectionStart + I);
|
|
891
|
-
selectionStart++;
|
|
892
|
-
} else {
|
|
893
|
-
valueStr = value;
|
|
894
|
-
}
|
|
895
|
-
const numStr = getNum(valueStr);
|
|
896
|
-
return { numStr, selectionStart };
|
|
897
|
-
} else {
|
|
898
|
-
const numStr = getNum(value, format, regx);
|
|
899
|
-
return { numStr };
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
const checkFormat = ({ value, format, startIndex, selectionStart, regx, needSelectionStart }) => {
|
|
903
|
-
if (!needSelectionStart && regx.lastIndex === 0 || needSelectionStart && regx.lastIndex === 0 && selectionStart >= startIndex) {
|
|
904
|
-
const subFormat = `(?<=${format.substring(0, startIndex)})(\\s*\\S*\\s*)+`;
|
|
905
|
-
const pattern = new RegExp(subFormat, "g");
|
|
906
|
-
const res = format.match(pattern);
|
|
907
|
-
if (res) {
|
|
908
|
-
value += res[0];
|
|
909
|
-
selectionStart = value.length;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
return { value, selectionStart };
|
|
913
|
-
};
|
|
914
|
-
const moveStart = (inputElem, moveStartIndex) => {
|
|
915
|
-
if (inputElem.setSelectionRange) {
|
|
916
|
-
inputElem.focus();
|
|
917
|
-
setTimeout(() => {
|
|
918
|
-
inputElem.setSelectionRange(moveStartIndex, moveStartIndex);
|
|
919
|
-
}, 0);
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
const handleInput = ({ state, props, api }) => (val, event) => {
|
|
923
|
-
event = val.target ? val : event;
|
|
924
|
-
if (props.autoFormat) {
|
|
925
|
-
const value = api.formatInputValue({ event, prevValue: state.displayValue });
|
|
926
|
-
state.userInput = value;
|
|
927
|
-
} else {
|
|
928
|
-
const val2 = event.target.value;
|
|
929
|
-
state.userInput = val2;
|
|
930
|
-
}
|
|
931
|
-
};
|
|
932
|
-
const formatInputValue = ({ props, state }) => ({ event, prevValue = "" }) => {
|
|
933
|
-
const val = event.target.value;
|
|
934
|
-
const inputData = event.data;
|
|
935
|
-
const format = state.type === "time-select" ? "HH:mm" : props.format || DATEPICKER.DateFormats[state.type];
|
|
936
|
-
if (inputData && inputData.charCodeAt() >= 48 && inputData.charCodeAt() <= 57) {
|
|
937
|
-
return formatText({ event, format, text: prevValue, needSelectionStart: true });
|
|
938
|
-
} else {
|
|
939
|
-
return val;
|
|
940
|
-
}
|
|
941
|
-
};
|
|
942
|
-
const formatText = ({ event, text, format, needSelectionStart = false }) => {
|
|
943
|
-
if (!format)
|
|
944
|
-
return text;
|
|
945
|
-
let cursorOffset = 0;
|
|
946
|
-
let value = "";
|
|
947
|
-
let regx = /yyyy|yyy|yy|y|MM|M|dd|d|HH|hh|H|h|mm|m|ss|s|WW|W|w/g;
|
|
948
|
-
let startIndex = 0;
|
|
949
|
-
let { numStr, selectionStart } = getNumAndSelectionStart({
|
|
950
|
-
value: text,
|
|
951
|
-
format,
|
|
952
|
-
regx,
|
|
953
|
-
event,
|
|
954
|
-
needSelectionStart
|
|
955
|
-
});
|
|
956
|
-
let matchResult = regx.exec(format);
|
|
957
|
-
while (numStr.str !== "" && matchResult !== null) {
|
|
958
|
-
let subStr;
|
|
959
|
-
let newNum;
|
|
960
|
-
let subLen;
|
|
961
|
-
const endIndex = matchResult.index;
|
|
962
|
-
if (startIndex >= 0) {
|
|
963
|
-
value += format.substring(startIndex, endIndex);
|
|
964
|
-
}
|
|
965
|
-
selectionStart >= startIndex + cursorOffset && selectionStart <= endIndex + cursorOffset && (selectionStart = selectionStart + endIndex - startIndex);
|
|
966
|
-
startIndex = regx.lastIndex;
|
|
967
|
-
subLen = startIndex - endIndex;
|
|
968
|
-
subStr = numStr.str.substring(0, subLen);
|
|
969
|
-
const firstMatchChar = matchResult[0].charAt(0);
|
|
970
|
-
const firstChar = parseInt(subStr.charAt(0), 10);
|
|
971
|
-
if (numStr.str.length > 1) {
|
|
972
|
-
const secondChar = numStr.str.charAt(1);
|
|
973
|
-
newNum = 10 * firstChar + parseInt(secondChar, 10);
|
|
974
|
-
} else {
|
|
975
|
-
newNum = firstChar;
|
|
976
|
-
}
|
|
977
|
-
if (numStr.arr[endIndex + 1] || firstMatchChar === "M" && newNum > 12 || firstMatchChar === "d" && newNum > 31 || ["H", "h"].includes(firstMatchChar) && newNum > 23 || "ms".includes(firstMatchChar) && newNum > 59) {
|
|
978
|
-
subStr = matchResult[0].length === 2 ? "0" + firstChar : firstChar;
|
|
979
|
-
selectionStart++;
|
|
980
|
-
} else {
|
|
981
|
-
if (subLen === 1) {
|
|
982
|
-
subStr = String(newNum);
|
|
983
|
-
subLen++;
|
|
984
|
-
cursorOffset++;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
value += subStr;
|
|
988
|
-
numStr.str = numStr.str.substring(subLen);
|
|
989
|
-
matchResult = regx.exec(format);
|
|
990
|
-
}
|
|
991
|
-
const { value: val, selectionStart: cursorPos } = checkFormat({
|
|
992
|
-
value,
|
|
993
|
-
format,
|
|
994
|
-
startIndex,
|
|
995
|
-
selectionStart,
|
|
996
|
-
regx,
|
|
997
|
-
needSelectionStart
|
|
998
|
-
});
|
|
999
|
-
value = val;
|
|
1000
|
-
selectionStart = cursorPos;
|
|
1001
|
-
needSelectionStart && moveStart(event.target, selectionStart);
|
|
1002
|
-
return value;
|
|
1003
|
-
};
|
|
1004
1007
|
export {
|
|
1005
1008
|
blur,
|
|
1006
1009
|
computedFormat,
|
|
@@ -1059,6 +1062,7 @@ export {
|
|
|
1059
1062
|
updateOptions,
|
|
1060
1063
|
valueEquals,
|
|
1061
1064
|
watchIsRange,
|
|
1065
|
+
watchMobileVisible,
|
|
1062
1066
|
watchModelValue,
|
|
1063
1067
|
watchPickerVisible
|
|
1064
1068
|
};
|
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,
|
|
@@ -155,13 +156,13 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent, br
|
|
|
155
156
|
const initApi = ({ api: api2, props, hooks, state, vnode, others, utils, parent }) => {
|
|
156
157
|
const { t, emit, dispatch, nextTick, vm } = vnode;
|
|
157
158
|
const { TimePanel, TimeRangePanel } = others;
|
|
158
|
-
const { destroyPopper, popperElm, updatePopper
|
|
159
|
+
const { destroyPopper, popperElm, updatePopper } = initPopper({ props, hooks, vnode });
|
|
159
160
|
state.popperElm = popperElm;
|
|
160
161
|
state.picker = null;
|
|
161
162
|
Object.assign(api2, {
|
|
162
163
|
destroyPopper,
|
|
163
164
|
emitDbTime: emitDbTime({ emit, state, t }),
|
|
164
|
-
hidePicker: hidePicker({
|
|
165
|
+
hidePicker: hidePicker({ destroyPopper, state }),
|
|
165
166
|
handleSelectChange: ({ tz, date }) => !state.ranged && emit("select-change", { tz, date }),
|
|
166
167
|
getPanel: getPanel(others),
|
|
167
168
|
handleFocus: handleFocus({ emit, vm, state, api: api2 }),
|
|
@@ -187,7 +188,8 @@ const initApi = ({ api: api2, props, hooks, state, vnode, others, utils, parent
|
|
|
187
188
|
handleClose: handleClose({ api: api2, props, state }),
|
|
188
189
|
displayValue: displayValue({ api: api2, props, state }),
|
|
189
190
|
handlePick: handlePick({ api: api2, state }),
|
|
190
|
-
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 }),
|
|
191
193
|
formatToString: formatToString({ api: api2, state }),
|
|
192
194
|
watchIsRange: watchIsRange({ api: api2, state, TimePanel, TimeRangePanel }),
|
|
193
195
|
mountPicker: mountPicker({ api: api2, vm, props, state, updatePopper }),
|
|
@@ -240,6 +242,7 @@ const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
|
240
242
|
(type) => state.panel = markRaw(api2.getPanel(type)),
|
|
241
243
|
{ immediate: true }
|
|
242
244
|
);
|
|
245
|
+
watch(() => [state.dateMobileOption.visible, state.timeMobileOption.visible], api2.watchMobileVisible);
|
|
243
246
|
watch(() => state.pickerVisible, api2.watchPickerVisible);
|
|
244
247
|
watch(
|
|
245
248
|
() => props.defaultValue,
|
package/popeditor/index.js
CHANGED
|
@@ -570,7 +570,7 @@ const doSuggesst = ({ state, props, popper, api, nextTick }) => (event) => {
|
|
|
570
570
|
const row = find(state.selectedDatas, (node) => text === node[props.textField]);
|
|
571
571
|
api.sourceGridSelectChange({ checked: false, row, confirm: false });
|
|
572
572
|
});
|
|
573
|
-
if (addtions.length) {
|
|
573
|
+
if (!state.suggestList.length || addtions.length) {
|
|
574
574
|
doQuery(query2);
|
|
575
575
|
}
|
|
576
576
|
} else {
|
|
@@ -582,7 +582,7 @@ const closeSuggestPanel = ({ state, api, vm }) => (event = false) => {
|
|
|
582
582
|
const reference = vm.$refs.reference;
|
|
583
583
|
const popper = vm.$refs.popper;
|
|
584
584
|
let keep = !event;
|
|
585
|
-
if (event.target) {
|
|
585
|
+
if (event.target && reference) {
|
|
586
586
|
keep = reference.$el.contains(event.target) || popper.contains(event.target);
|
|
587
587
|
}
|
|
588
588
|
if (!keep) {
|
package/select/index.js
CHANGED
|
@@ -360,26 +360,8 @@ const getPluginOption = ({ api, props, state }) => (value, isTree) => {
|
|
|
360
360
|
return items;
|
|
361
361
|
};
|
|
362
362
|
const toggleCheckAll = ({ api, state, props }) => (filtered) => {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
for (let i = 0; i < options.length; i++) {
|
|
366
|
-
const isEnabled = !options[i].state.disabled && !options[i].state.groupDisabled;
|
|
367
|
-
const isRequired = options[i].required;
|
|
368
|
-
const isDisabledAndChecked = !isEnabled && options[i].state.selectCls === "checked-sur";
|
|
369
|
-
if (state.isSelectAll) {
|
|
370
|
-
if (isRequired || isDisabledAndChecked) {
|
|
371
|
-
values.push(options[i].value);
|
|
372
|
-
}
|
|
373
|
-
} else {
|
|
374
|
-
if (isEnabled || isRequired || isDisabledAndChecked) {
|
|
375
|
-
values.push(options[i].value);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
return values;
|
|
380
|
-
};
|
|
381
|
-
let value;
|
|
382
|
-
const enabledValues = getEnabledValues(state.options);
|
|
363
|
+
let value = [];
|
|
364
|
+
const enabledValues = state.options.filter((op) => !op.state.disabled && !op.state.groupDisabled && !op.required && op.state.visible).map((op) => op.value);
|
|
383
365
|
if (filtered) {
|
|
384
366
|
if (state.filteredSelectCls === "check" || state.filteredSelectCls === "halfselect") {
|
|
385
367
|
value = [.../* @__PURE__ */ new Set([...state.modelValue, ...enabledValues])];
|
|
@@ -393,9 +375,12 @@ const toggleCheckAll = ({ api, state, props }) => (filtered) => {
|
|
|
393
375
|
const unchecked = state.options.filter((item) => !item.state.disabled && item.state.selectCls === "check");
|
|
394
376
|
unchecked.length ? value = enabledValues : value = [];
|
|
395
377
|
} else if (state.selectCls === "checked-sur") {
|
|
396
|
-
value =
|
|
378
|
+
value = [];
|
|
397
379
|
}
|
|
398
380
|
}
|
|
381
|
+
const requiredValue = state.options.filter((op) => op.required).map((op) => op.value);
|
|
382
|
+
const disabledSelectedValues = state.options.filter((op) => (op.state.disabled || op.state.groupDisabled) && op.state.selectCls === "checked-sur").map((op) => op.value);
|
|
383
|
+
value = [...value, ...requiredValue, ...disabledSelectedValues];
|
|
399
384
|
api.setSoftFocus();
|
|
400
385
|
state.isSilentBlur = true;
|
|
401
386
|
api.updateModelValue(value);
|
|
@@ -909,10 +894,7 @@ const watchValue = ({ api, constants, dispatch, props, vm, state }) => (value, o
|
|
|
909
894
|
state.currentPlaceholder = state.cachedPlaceHolder;
|
|
910
895
|
}
|
|
911
896
|
if (props.filterable && !props.reserveKeyword) {
|
|
912
|
-
|
|
913
|
-
const isInput = true;
|
|
914
|
-
props.renderType !== constants.TYPE.Grid && (state.query = "");
|
|
915
|
-
api.handleQueryChange(state.query, isChange, isInput);
|
|
897
|
+
props.renderType !== constants.TYPE.Grid && !props.searchable && (state.query = "");
|
|
916
898
|
}
|
|
917
899
|
}
|
|
918
900
|
api.setSelected();
|
|
@@ -1110,10 +1092,11 @@ const getOptionIndexArr = ({ props, state, api }) => () => {
|
|
|
1110
1092
|
});
|
|
1111
1093
|
};
|
|
1112
1094
|
const queryVisibleOptions = ({ props, vm, isMobileFirstMode }) => () => {
|
|
1095
|
+
var _a;
|
|
1113
1096
|
if (props.optimization) {
|
|
1114
1097
|
return optmzApis.queryVisibleOptions(vm, isMobileFirstMode);
|
|
1115
1098
|
} else {
|
|
1116
|
-
return Array.from(vm.$refs.scrollbar.$el.querySelectorAll('[data-index]:not([style*="display: none"])'));
|
|
1099
|
+
return Array.from(((_a = vm.$refs.scrollbar) == null ? void 0 : _a.$el.querySelectorAll('[data-index]:not([style*="display: none"])')) || []);
|
|
1117
1100
|
}
|
|
1118
1101
|
};
|
|
1119
1102
|
const handleCopyClick = ({ parent, props, state }) => () => {
|
|
@@ -1310,7 +1293,11 @@ const watchHoverIndex = ({ state }) => (value) => {
|
|
|
1310
1293
|
state.hoverValue = state.optionIndexArr[value];
|
|
1311
1294
|
}
|
|
1312
1295
|
};
|
|
1313
|
-
const handleDropdownClick = ({ emit }) => ($event) => {
|
|
1296
|
+
const handleDropdownClick = ({ vm, state, props, emit }) => ($event) => {
|
|
1297
|
+
if (props.allowCopy && vm.$refs.reference) {
|
|
1298
|
+
vm.$refs.reference.$el.querySelector("input").selectionEnd = 0;
|
|
1299
|
+
}
|
|
1300
|
+
state.softFocus = false;
|
|
1314
1301
|
emit("dropdown-click", $event);
|
|
1315
1302
|
};
|
|
1316
1303
|
const handleEnterTag = ({ state }) => ($event, key) => {
|
package/select/vue.js
CHANGED
|
@@ -170,7 +170,7 @@ const api = [
|
|
|
170
170
|
"updateModelValue",
|
|
171
171
|
"clearSearchText"
|
|
172
172
|
];
|
|
173
|
-
const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm }) => {
|
|
173
|
+
const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm, designConfig }) => {
|
|
174
174
|
const stateAdd = initStateAdd({ computed, props, api: api2, parent });
|
|
175
175
|
const state = reactive(__spreadProps(__spreadValues({}, stateAdd), {
|
|
176
176
|
selectEmitter: emitter(),
|
|
@@ -224,7 +224,13 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
224
224
|
// tiny 新增
|
|
225
225
|
getIcon: computed(() => api2.computedGetIcon()),
|
|
226
226
|
getTagType: computed(() => api2.computedGetTagType()),
|
|
227
|
-
isSelectAll: computed(() => state.selectCls === "checked-sur")
|
|
227
|
+
isSelectAll: computed(() => state.selectCls === "checked-sur"),
|
|
228
|
+
autoHideDownIcon: (() => {
|
|
229
|
+
if ((designConfig == null ? void 0 : designConfig.state) && "autoHideDownIcon" in designConfig.state) {
|
|
230
|
+
return designConfig.state.autoHideDownIcon;
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
})()
|
|
228
234
|
}));
|
|
229
235
|
return state;
|
|
230
236
|
};
|
|
@@ -422,7 +428,7 @@ const addApi = ({
|
|
|
422
428
|
mounted: mounted({ api: api2, parent, state, props, vm, designConfig }),
|
|
423
429
|
unMount: unMount({ api: api2, parent, vm, state }),
|
|
424
430
|
watchOptimizeOpts: watchOptimizeOpts({ props, state }),
|
|
425
|
-
handleDropdownClick: handleDropdownClick({ emit }),
|
|
431
|
+
handleDropdownClick: handleDropdownClick({ props, vm, state, emit }),
|
|
426
432
|
handleEnterTag: handleEnterTag({ state }),
|
|
427
433
|
calcCollapseTags: calcCollapseTags({ state, vm }),
|
|
428
434
|
initValue: initValue({ state }),
|
|
@@ -519,7 +525,18 @@ const addWatch = ({ watch, props, api: api2, state, nextTick }) => {
|
|
|
519
525
|
};
|
|
520
526
|
const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide, inject }, { vm, parent, emit, constants, nextTick, dispatch, t, emitter, isMobileFirstMode, useBreakpoint, designConfig }) => {
|
|
521
527
|
const api2 = {};
|
|
522
|
-
const state = initState({
|
|
528
|
+
const state = initState({
|
|
529
|
+
reactive,
|
|
530
|
+
computed,
|
|
531
|
+
props,
|
|
532
|
+
api: api2,
|
|
533
|
+
emitter,
|
|
534
|
+
parent,
|
|
535
|
+
constants,
|
|
536
|
+
useBreakpoint,
|
|
537
|
+
vm,
|
|
538
|
+
designConfig
|
|
539
|
+
});
|
|
523
540
|
const dialog = inject("dialog", null);
|
|
524
541
|
provide("selectEmitter", state.selectEmitter);
|
|
525
542
|
provide("selectVm", vm);
|
|
@@ -539,9 +556,6 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
539
556
|
isMobileFirstMode,
|
|
540
557
|
designConfig
|
|
541
558
|
});
|
|
542
|
-
initWatch({ watch, props, api: api2, state, nextTick });
|
|
543
|
-
onMounted(api2.mounted);
|
|
544
|
-
onBeforeUnmount(api2.unMount);
|
|
545
559
|
parent.$on("handle-clear", (event) => {
|
|
546
560
|
api2.handleClearClick(event);
|
|
547
561
|
});
|
|
@@ -555,6 +569,12 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
555
569
|
state.selectEmitter.on(constants.EVENT_NAME.handleOptionClick, api2.handleOptionSelect);
|
|
556
570
|
state.selectEmitter.on(constants.EVENT_NAME.setSelected, api2.setSelected);
|
|
557
571
|
state.selectEmitter.on(constants.EVENT_NAME.initValue, api2.initValue);
|
|
572
|
+
initWatch({ watch, props, api: api2, state, nextTick });
|
|
573
|
+
onMounted(api2.mounted);
|
|
574
|
+
onBeforeUnmount(() => {
|
|
575
|
+
api2.unMount();
|
|
576
|
+
dialog && dialog.state.emitter.off("handleSelectClose", api2.handleClose);
|
|
577
|
+
});
|
|
558
578
|
return api2;
|
|
559
579
|
};
|
|
560
580
|
export {
|
|
@@ -6,7 +6,7 @@ declare const actionSheetProps: {
|
|
|
6
6
|
type: ArrayConstructor;
|
|
7
7
|
default: () => never[];
|
|
8
8
|
};
|
|
9
|
-
modelValue: (
|
|
9
|
+
modelValue: (StringConstructor | ArrayConstructor | NumberConstructor)[];
|
|
10
10
|
beforeClose: FunctionConstructor;
|
|
11
11
|
visible: {
|
|
12
12
|
type: BooleanConstructor;
|
|
@@ -45,7 +45,7 @@ declare const actionSheetProps: {
|
|
|
45
45
|
type: BooleanConstructor;
|
|
46
46
|
default: () => boolean;
|
|
47
47
|
};
|
|
48
|
-
customClass: (
|
|
48
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
49
49
|
contentClass: StringConstructor;
|
|
50
50
|
type: {
|
|
51
51
|
type: StringConstructor;
|
package/types/alert.type.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ declare const alertProps: {
|
|
|
76
76
|
type: BooleanConstructor;
|
|
77
77
|
default: boolean;
|
|
78
78
|
};
|
|
79
|
-
customClass: (
|
|
79
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
80
80
|
offset: {
|
|
81
81
|
type: (StringConstructor | NumberConstructor)[];
|
|
82
82
|
default: number;
|
package/types/checkbox.type.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ declare const checkboxProps: {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
modelValue: {
|
|
23
|
-
type: (
|
|
23
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
24
24
|
};
|
|
25
25
|
label: {
|
|
26
|
-
type: (
|
|
26
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
27
27
|
default: string;
|
|
28
28
|
};
|
|
29
29
|
indeterminate: BooleanConstructor;
|
|
@@ -40,7 +40,7 @@ declare const checkboxProps: {
|
|
|
40
40
|
border: BooleanConstructor;
|
|
41
41
|
size: StringConstructor;
|
|
42
42
|
text: StringConstructor;
|
|
43
|
-
customClass: (
|
|
43
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
44
44
|
validateEvent: {
|
|
45
45
|
type: BooleanConstructor;
|
|
46
46
|
default: boolean;
|
package/types/collapse.type.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const collapseProps: {
|
|
|
24
24
|
accordion: BooleanConstructor;
|
|
25
25
|
beforeClose: FunctionConstructor;
|
|
26
26
|
modelValue: {
|
|
27
|
-
type: (
|
|
27
|
+
type: (StringConstructor | ArrayConstructor | NumberConstructor)[];
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
30
|
tiny_mode: StringConstructor;
|
package/types/drawer.type.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const drawerProps: {
|
|
|
13
13
|
type: BooleanConstructor;
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
|
-
customClass: (
|
|
16
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
17
17
|
placement: {
|
|
18
18
|
type: StringConstructor;
|
|
19
19
|
default: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-
|
|
2
|
+
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-6d6e3d0e.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-
|
|
2
|
+
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-a2dc0099.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -138,7 +138,7 @@ declare const formItemProps: {
|
|
|
138
138
|
type: BooleanConstructor;
|
|
139
139
|
default: undefined;
|
|
140
140
|
};
|
|
141
|
-
rules: (
|
|
141
|
+
rules: (ObjectConstructor | ArrayConstructor)[];
|
|
142
142
|
showMessage: {
|
|
143
143
|
type: BooleanConstructor;
|
|
144
144
|
default: boolean;
|
package/types/form.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-
|
|
2
|
+
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-a2dc0099.js';
|
|
3
3
|
import './shared.type.js';
|
package/types/input.type.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ declare const calculateNodeStyling: () => (targetElement: HTMLElement) => {
|
|
|
231
231
|
borderSize: number;
|
|
232
232
|
boxSizing: string;
|
|
233
233
|
};
|
|
234
|
-
declare const calcTextareaHeight: ({ api, hiddenTextarea, props, state }: Pick<IInputRenderlessParams, "state" | "
|
|
234
|
+
declare const calcTextareaHeight: ({ api, hiddenTextarea, props, state }: Pick<IInputRenderlessParams, "state" | "props" | "api"> & {
|
|
235
235
|
hiddenTextarea: HTMLTextAreaElement | null;
|
|
236
236
|
}) => (targetElement: HTMLTextAreaElement, minRows?: number, maxRows?: null) => {
|
|
237
237
|
minHeight?: string | undefined;
|
package/types/pager.type.d.ts
CHANGED
package/types/popover.type.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ declare const popoverProps: {
|
|
|
67
67
|
maxHeight: {
|
|
68
68
|
type: (StringConstructor | NumberConstructor)[];
|
|
69
69
|
};
|
|
70
|
-
listData: (
|
|
70
|
+
listData: (ObjectConstructor | ArrayConstructor)[];
|
|
71
71
|
genArrowByHtml: {
|
|
72
72
|
type: BooleanConstructor;
|
|
73
73
|
default: () => boolean;
|
|
@@ -92,7 +92,7 @@ declare const popoverProps: {
|
|
|
92
92
|
*
|
|
93
93
|
*/
|
|
94
94
|
|
|
95
|
-
declare const mounted: ({ api, state, constants, props, nextTick, mode }: Pick<IPopoverRenderlessParams, "state" | "
|
|
95
|
+
declare const mounted: ({ api, state, constants, props, nextTick, mode }: Pick<IPopoverRenderlessParams, "state" | "props" | "nextTick" | "api" | "mode"> & {
|
|
96
96
|
constants: {
|
|
97
97
|
IDPREFIX: string;
|
|
98
98
|
};
|
package/types/progress.type.d.ts
CHANGED
package/types/steps.type.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const stepsProps: {
|
|
|
14
14
|
type: StringConstructor;
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
|
-
data: (
|
|
17
|
+
data: (ObjectConstructor | ArrayConstructor)[];
|
|
18
18
|
space: (StringConstructor | NumberConstructor)[];
|
|
19
19
|
active: {
|
|
20
20
|
type: NumberConstructor;
|
package/types/switch.type.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare const switchProps: {
|
|
|
30
30
|
};
|
|
31
31
|
falseColor: StringConstructor;
|
|
32
32
|
falseValue: {
|
|
33
|
-
type: (
|
|
33
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
34
34
|
default: boolean;
|
|
35
35
|
};
|
|
36
36
|
mini: {
|
|
@@ -38,7 +38,7 @@ declare const switchProps: {
|
|
|
38
38
|
default: boolean;
|
|
39
39
|
};
|
|
40
40
|
modelValue: {
|
|
41
|
-
type: (
|
|
41
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
42
42
|
default: boolean;
|
|
43
43
|
};
|
|
44
44
|
size: (StringConstructor | NumberConstructor)[];
|
|
@@ -48,7 +48,7 @@ declare const switchProps: {
|
|
|
48
48
|
};
|
|
49
49
|
trueColor: StringConstructor;
|
|
50
50
|
trueValue: {
|
|
51
|
-
type: (
|
|
51
|
+
type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
|
|
52
52
|
default: boolean;
|
|
53
53
|
};
|
|
54
54
|
beforeChange: FunctionConstructor;
|
package/types/transfer.type.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ declare const logicFun: ({ props, emit, state }: Pick<ITransferRenderlessParams,
|
|
|
126
126
|
pullMode?: "sort" | undefined;
|
|
127
127
|
}) => void;
|
|
128
128
|
/** 组件加载后,给左右面板初始化Sortable的功能 */
|
|
129
|
-
declare const sortableEvent: ({ api, droppanel, props, queryDom, refs }: Pick<ITransferRenderlessParams, "
|
|
129
|
+
declare const sortableEvent: ({ api, droppanel, props, queryDom, refs }: Pick<ITransferRenderlessParams, "props" | "refs" | "api"> & {
|
|
130
130
|
droppanel: string;
|
|
131
131
|
queryDom: string;
|
|
132
132
|
}) => () => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
|
|
3
|
-
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-
|
|
3
|
+
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-6d6e3d0e.js';
|
|
4
4
|
|
|
5
5
|
declare const UploadDraggerProps: {
|
|
6
6
|
disabled: BooleanConstructor;
|
|
7
|
-
customClass: (
|
|
7
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
8
8
|
tiny_mode: StringConstructor;
|
|
9
9
|
tiny_mode_root: BooleanConstructor;
|
|
10
10
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -336,7 +336,7 @@ declare const fileUploadProps: {
|
|
|
336
336
|
type: BooleanConstructor;
|
|
337
337
|
default: boolean;
|
|
338
338
|
};
|
|
339
|
-
customClass: (
|
|
339
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
340
340
|
hwh5: ObjectConstructor;
|
|
341
341
|
mode: {
|
|
342
342
|
type: StringConstructor;
|
|
@@ -403,7 +403,7 @@ declare const beforeUpload: ({ props, api, Modal, constants, t, state }: Pick<IF
|
|
|
403
403
|
declare const startUpload: ({ state, constants, vm, Modal, api, t }: Pick<IFileUploadRenderlessParams, 'state' | 'constants' | 'vm' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile, isList: boolean) => void;
|
|
404
404
|
declare const properFileSize: ({ props, state, api, constants, Modal, t }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile) => boolean;
|
|
405
405
|
declare const addFileToList: ({ api, constants, emit, props, state, mode }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'props' | 'state' | 'mode'>) => (rawFile: IFileUploadFile, updateId: string, reUpload: boolean) => void;
|
|
406
|
-
declare const getFileHash: ({ emit, Modal, constants, t, CryptoJS, state }: Pick<IFileUploadRenderlessParams, "state" | "
|
|
406
|
+
declare const getFileHash: ({ emit, Modal, constants, t, CryptoJS, state }: Pick<IFileUploadRenderlessParams, "state" | "emit" | "t" | "constants"> & IFileUploadModalVm & {
|
|
407
407
|
CryptoJS: object;
|
|
408
408
|
}) => ({ file, chunkSize, showTips }: {
|
|
409
409
|
file: IFileUploadFile;
|
|
@@ -488,7 +488,7 @@ declare const setWriterFile: ({ state, emit, Streamsaver }: Pick<IFileUploadRend
|
|
|
488
488
|
declare const getFormData$1: ({ constants, props, state }: Pick<IFileUploadRenderlessParams, 'constants' | 'props' | 'state'>) => ({ formData, file, type }: IFileUploadGetFormData) => IUploadFormData;
|
|
489
489
|
declare const largeDocumentUpload: ({ api, Modal, state, t, emit, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 't' | 'emit' | 'constants'> & IFileUploadModalVm) => (file: IFileUploadFile) => void;
|
|
490
490
|
declare const segmentUploadInit: ({ api, props, service, state, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'service' | 'state' | 'constants'>) => (file: IFileUploadFile) => Promise<unknown>;
|
|
491
|
-
declare const segmentUpload: ({ api, props, service, state, emit, constants, CryptoJS }: Pick<IFileUploadRenderlessParams, "state" | "
|
|
491
|
+
declare const segmentUpload: ({ api, props, service, state, emit, constants, CryptoJS }: Pick<IFileUploadRenderlessParams, "state" | "props" | "emit" | "api" | "constants" | "service"> & {
|
|
492
492
|
CryptoJS: object;
|
|
493
493
|
}) => (batchIndex: number, file: IFileUploadFile, progress: {
|
|
494
494
|
file: IFileUploadFile;
|
|
@@ -664,7 +664,7 @@ declare const uploadProps: {
|
|
|
664
664
|
type: BooleanConstructor;
|
|
665
665
|
default: boolean;
|
|
666
666
|
};
|
|
667
|
-
customClass: (
|
|
667
|
+
customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
668
668
|
handleTriggerClick: {
|
|
669
669
|
type: FunctionConstructor;
|
|
670
670
|
default: () => void;
|
|
@@ -1104,6 +1104,10 @@ declare const uploadListProps: {
|
|
|
1104
1104
|
type: BooleanConstructor;
|
|
1105
1105
|
default: boolean;
|
|
1106
1106
|
};
|
|
1107
|
+
compact: {
|
|
1108
|
+
type: BooleanConstructor;
|
|
1109
|
+
default: boolean;
|
|
1110
|
+
};
|
|
1107
1111
|
tiny_mode: StringConstructor;
|
|
1108
1112
|
tiny_mode_root: BooleanConstructor;
|
|
1109
1113
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-
|
|
2
|
+
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-6d6e3d0e.js';
|
|
3
3
|
import './shared.type.js';
|
package/types/upload.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-
|
|
2
|
+
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-6d6e3d0e.js';
|
|
3
3
|
import './shared.type.js';
|
package/user/index.js
CHANGED
|
@@ -191,7 +191,7 @@ const updateOptions = ({ props, state, nextTick }) => (usersList) => {
|
|
|
191
191
|
return nextTick();
|
|
192
192
|
};
|
|
193
193
|
const autoSelect = ({ props, state, nextTick }) => (usersList) => {
|
|
194
|
-
if (!usersList.length) {
|
|
194
|
+
if (!usersList.length || props.multiple && props.multipleLimit && state.user.length >= props.multipleLimit) {
|
|
195
195
|
return nextTick();
|
|
196
196
|
}
|
|
197
197
|
const values = props.multiple ? [].concat(state.user) : [];
|