zartui 3.0.7 → 3.0.9
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/calendar/Calendar.d.ts +23 -33
- package/es/calendar/Calendar.mjs +124 -31
- package/es/calendar/CalendarDay.mjs +1 -1
- package/es/calendar/CalendarHeader.d.ts +15 -1
- package/es/calendar/CalendarHeader.mjs +106 -4
- package/es/calendar/CalendarMonth.d.ts +23 -24
- package/es/calendar/CalendarMonth.mjs +49 -8
- package/es/calendar/index.css +1 -1
- package/es/calendar/index.d.ts +15 -22
- package/es/calendar/types.d.ts +3 -1
- package/es/calendar/utils.d.ts +4 -1
- package/es/calendar/utils.mjs +23 -3
- package/es/cascader/Cascader.mjs +1 -1
- package/es/dialog/Dialog.d.ts +4 -0
- package/es/dialog/Dialog.mjs +24 -9
- package/es/dialog/index.css +1 -1
- package/es/dialog/index.d.ts +3 -0
- package/es/dialog/types.d.ts +1 -0
- package/es/field/Field.d.ts +3 -0
- package/es/field/Field.mjs +2 -1
- package/es/field/index.d.ts +2 -0
- package/es/icon/config.mjs +2 -1
- package/es/icon/index.css +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/overlay/index.d.ts +1 -1
- package/es/popover/Popover.mjs +14 -6
- package/es/swipe-cell/index.d.ts +1 -1
- package/es/table/Table.d.ts +8 -3
- package/es/table/Table.mjs +122 -31
- package/es/table/index.css +1 -1
- package/es/table/index.d.ts +5 -3
- package/es/table/style/index.mjs +2 -0
- package/es/table/types.d.ts +5 -0
- package/es/table/types.mjs +8 -0
- package/es/tag/Tag.d.ts +3 -0
- package/es/tag/Tag.mjs +24 -16
- package/es/tag/index.css +1 -1
- package/es/tag/index.d.ts +2 -0
- package/es/tag/style/index.mjs +1 -0
- package/es/uploader/UploaderPreviewItem.d.ts +1 -1
- package/lib/calendar/Calendar.d.ts +23 -33
- package/lib/calendar/Calendar.js +123 -30
- package/lib/calendar/CalendarDay.js +1 -1
- package/lib/calendar/CalendarHeader.d.ts +15 -1
- package/lib/calendar/CalendarHeader.js +106 -4
- package/lib/calendar/CalendarMonth.d.ts +23 -24
- package/lib/calendar/CalendarMonth.js +48 -7
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.d.ts +15 -22
- package/lib/calendar/types.d.ts +3 -1
- package/lib/calendar/utils.d.ts +4 -1
- package/lib/calendar/utils.js +23 -3
- package/lib/cascader/Cascader.js +1 -1
- package/lib/dialog/Dialog.d.ts +4 -0
- package/lib/dialog/Dialog.js +24 -9
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.d.ts +3 -0
- package/lib/dialog/types.d.ts +1 -0
- package/lib/field/Field.d.ts +3 -0
- package/lib/field/Field.js +2 -1
- package/lib/field/index.d.ts +2 -0
- package/lib/icon/config.js +2 -1
- package/lib/icon/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/overlay/index.d.ts +1 -1
- package/lib/popover/Popover.js +14 -6
- package/lib/swipe-cell/index.d.ts +1 -1
- package/lib/table/Table.d.ts +8 -3
- package/lib/table/Table.js +122 -31
- package/lib/table/index.css +1 -1
- package/lib/table/index.d.ts +5 -3
- package/lib/table/style/index.js +2 -0
- package/lib/table/types.d.ts +5 -0
- package/lib/table/types.js +27 -0
- package/lib/tag/Tag.d.ts +3 -0
- package/lib/tag/Tag.js +34 -16
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.d.ts +2 -0
- package/lib/tag/style/index.js +1 -0
- package/lib/uploader/UploaderPreviewItem.d.ts +1 -1
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +488 -110
- package/lib/zartui.es.js +488 -110
- package/lib/zartui.js +488 -110
- package/lib/zartui.min.js +1 -1
- package/package.json +7 -7
package/lib/zartui.es.js
CHANGED
|
@@ -1724,8 +1724,9 @@ var stdin_default$1x = defineComponent({
|
|
|
1724
1724
|
});
|
|
1725
1725
|
const Button = withInstall(stdin_default$1x);
|
|
1726
1726
|
var stdin_default$1w = Button;
|
|
1727
|
+
const monthsOfYear = 12;
|
|
1727
1728
|
const [name$18, bem$15, t$6] = createNamespace("calendar");
|
|
1728
|
-
const formatMonthTitle = (date) => t$6("
|
|
1729
|
+
const formatMonthTitle = (date) => t$6("ztCalendar.monthTitle", date.getFullYear(), date.getMonth() + 1);
|
|
1729
1730
|
function compareMonth(date1, date2) {
|
|
1730
1731
|
const year1 = date1.getFullYear();
|
|
1731
1732
|
const year2 = date2.getFullYear();
|
|
@@ -1747,9 +1748,20 @@ function compareDay(day1, day2) {
|
|
|
1747
1748
|
}
|
|
1748
1749
|
const cloneDate = (date) => new Date(date);
|
|
1749
1750
|
const cloneDates = (dates) => Array.isArray(dates) ? dates.map(cloneDate) : cloneDate(dates);
|
|
1750
|
-
function getDayByOffset(date, offset2) {
|
|
1751
|
+
function getDayByOffset(date, offset2, isMonth, isYear) {
|
|
1751
1752
|
const cloned = cloneDate(date);
|
|
1752
|
-
|
|
1753
|
+
if (isYear) {
|
|
1754
|
+
cloned.setFullYear(cloned.getFullYear() + offset2);
|
|
1755
|
+
} else if (isMonth) {
|
|
1756
|
+
cloned.setMonth(cloned.getMonth() + offset2);
|
|
1757
|
+
const multiplier = cloned.getFullYear() - date.getFullYear();
|
|
1758
|
+
const setLastDate = date.getMonth() + offset2 !== cloned.getMonth() + multiplier * monthsOfYear;
|
|
1759
|
+
if (setLastDate) {
|
|
1760
|
+
cloned.setDate(0);
|
|
1761
|
+
}
|
|
1762
|
+
} else {
|
|
1763
|
+
cloned.setDate(cloned.getDate() + offset2);
|
|
1764
|
+
}
|
|
1753
1765
|
return cloned;
|
|
1754
1766
|
}
|
|
1755
1767
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
|
@@ -1759,11 +1771,16 @@ const getToday = () => {
|
|
|
1759
1771
|
today.setHours(0, 0, 0, 0);
|
|
1760
1772
|
return today;
|
|
1761
1773
|
};
|
|
1774
|
+
const getPrevDate = (date, isMonth, isYear) => getDayByOffset(date, -1, isMonth, isYear);
|
|
1775
|
+
const getNextDate = (date, isMonth, isYear) => getDayByOffset(date, 1, isMonth, isYear);
|
|
1762
1776
|
function calcDateNum(date) {
|
|
1763
1777
|
const day1 = date[0].getTime();
|
|
1764
1778
|
const day2 = date[1].getTime();
|
|
1765
1779
|
return (day2 - day1) / (1e3 * 60 * 60 * 24) + 1;
|
|
1766
1780
|
}
|
|
1781
|
+
function getFirstDate(date) {
|
|
1782
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1783
|
+
}
|
|
1767
1784
|
function useRefs() {
|
|
1768
1785
|
const refs = ref([]);
|
|
1769
1786
|
const cache = [];
|
|
@@ -2108,7 +2125,7 @@ var stdin_default$1u = defineComponent({
|
|
|
2108
2125
|
style2.width = "100%";
|
|
2109
2126
|
return style2;
|
|
2110
2127
|
}
|
|
2111
|
-
if (index === 0) {
|
|
2128
|
+
if (index === 0 && item.text && +item.text === 1) {
|
|
2112
2129
|
style2.marginLeft = `${100 * offset2 / 7}%`;
|
|
2113
2130
|
}
|
|
2114
2131
|
if (color) {
|
|
@@ -2182,10 +2199,11 @@ var stdin_default$1u = defineComponent({
|
|
|
2182
2199
|
const [name$15] = createNamespace("calendar-month");
|
|
2183
2200
|
const calendarMonthProps = {
|
|
2184
2201
|
date: makeRequiredProp(Date),
|
|
2202
|
+
showType: makeStringProp("inline"),
|
|
2185
2203
|
type: String,
|
|
2186
2204
|
color: String,
|
|
2187
|
-
minDate:
|
|
2188
|
-
maxDate:
|
|
2205
|
+
minDate: Date,
|
|
2206
|
+
maxDate: Date,
|
|
2189
2207
|
showMark: Boolean,
|
|
2190
2208
|
rowHeight: numericProp,
|
|
2191
2209
|
formatter: Function,
|
|
@@ -2194,7 +2212,8 @@ const calendarMonthProps = {
|
|
|
2194
2212
|
allowSameDay: Boolean,
|
|
2195
2213
|
showSubtitle: Boolean,
|
|
2196
2214
|
showMonthTitle: Boolean,
|
|
2197
|
-
firstDayOfWeek: Number
|
|
2215
|
+
firstDayOfWeek: Number,
|
|
2216
|
+
disabledDate: Function
|
|
2198
2217
|
};
|
|
2199
2218
|
var stdin_default$1t = defineComponent({
|
|
2200
2219
|
name: name$15,
|
|
@@ -2221,6 +2240,7 @@ var stdin_default$1t = defineComponent({
|
|
|
2221
2240
|
const totalDay = computed(() => getMonthEndDay2(props.date.getFullYear(), props.date.getMonth() + 1));
|
|
2222
2241
|
const shouldRender = computed(() => visible.value || !props.lazyRender);
|
|
2223
2242
|
const getTitle = () => title.value;
|
|
2243
|
+
const getDate = () => props.date;
|
|
2224
2244
|
const getMultipleDayType = (day) => {
|
|
2225
2245
|
const isSelected = (date) => props.currentDate.some((item) => compareDay(item, date) === 0);
|
|
2226
2246
|
if (isSelected(day)) {
|
|
@@ -2265,18 +2285,22 @@ var stdin_default$1t = defineComponent({
|
|
|
2265
2285
|
}
|
|
2266
2286
|
return "";
|
|
2267
2287
|
};
|
|
2268
|
-
const getDayType = (day) => {
|
|
2288
|
+
const getDayType = (day, defaultType) => {
|
|
2269
2289
|
const {
|
|
2270
2290
|
type,
|
|
2271
2291
|
minDate,
|
|
2272
2292
|
maxDate,
|
|
2273
|
-
currentDate
|
|
2293
|
+
currentDate,
|
|
2294
|
+
disabledDate
|
|
2274
2295
|
} = props;
|
|
2275
|
-
if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
|
|
2296
|
+
if (minDate && compareDay(day, minDate) < 0 || maxDate && compareDay(day, maxDate) > 0 || disabledDate && disabledDate(day)) {
|
|
2276
2297
|
return "disabled";
|
|
2277
2298
|
}
|
|
2278
2299
|
if (currentDate === null) {
|
|
2279
|
-
return "";
|
|
2300
|
+
return defaultType || "";
|
|
2301
|
+
}
|
|
2302
|
+
if (defaultType) {
|
|
2303
|
+
return defaultType;
|
|
2280
2304
|
}
|
|
2281
2305
|
if (Array.isArray(currentDate)) {
|
|
2282
2306
|
if (type === "multiple") {
|
|
@@ -2317,6 +2341,22 @@ var stdin_default$1t = defineComponent({
|
|
|
2317
2341
|
const days2 = [];
|
|
2318
2342
|
const year = props.date.getFullYear();
|
|
2319
2343
|
const month = props.date.getMonth();
|
|
2344
|
+
if (props.showType && props.showType === "inline") {
|
|
2345
|
+
for (let day = offset2.value - 1; day >= 0; day--) {
|
|
2346
|
+
const date = new Date(year, month, -day);
|
|
2347
|
+
const type = getDayType(date, "preview");
|
|
2348
|
+
let config = {
|
|
2349
|
+
date,
|
|
2350
|
+
type,
|
|
2351
|
+
text: date.getDate(),
|
|
2352
|
+
bottomInfo: getBottomInfo(type)
|
|
2353
|
+
};
|
|
2354
|
+
if (props.formatter) {
|
|
2355
|
+
config = props.formatter(config);
|
|
2356
|
+
}
|
|
2357
|
+
days2.push(config);
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2320
2360
|
for (let day = 1; day <= totalDay.value; day++) {
|
|
2321
2361
|
const date = new Date(year, month, day);
|
|
2322
2362
|
const type = getDayType(date);
|
|
@@ -2331,6 +2371,23 @@ var stdin_default$1t = defineComponent({
|
|
|
2331
2371
|
}
|
|
2332
2372
|
days2.push(config);
|
|
2333
2373
|
}
|
|
2374
|
+
if (props.showType && props.showType === "inline" && days2 && days2.length < 42) {
|
|
2375
|
+
const nextMonthsLength = days2.length;
|
|
2376
|
+
for (let day = 1; day <= 42 - nextMonthsLength; day++) {
|
|
2377
|
+
const date = new Date(year, month + 1, day);
|
|
2378
|
+
const type = getDayType(date, "preview");
|
|
2379
|
+
let config = {
|
|
2380
|
+
date,
|
|
2381
|
+
type,
|
|
2382
|
+
text: date.getDate(),
|
|
2383
|
+
bottomInfo: getBottomInfo(type)
|
|
2384
|
+
};
|
|
2385
|
+
if (props.formatter) {
|
|
2386
|
+
config = props.formatter(config);
|
|
2387
|
+
}
|
|
2388
|
+
days2.push(config);
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2334
2391
|
return days2;
|
|
2335
2392
|
});
|
|
2336
2393
|
const disabledDays = computed(() => days.value.filter((day) => day.type === "disabled"));
|
|
@@ -2358,6 +2415,7 @@ var stdin_default$1t = defineComponent({
|
|
|
2358
2415
|
}, [(shouldRender.value ? days : placeholders).value.map(renderDay)]);
|
|
2359
2416
|
useExpose({
|
|
2360
2417
|
getTitle,
|
|
2418
|
+
getDate,
|
|
2361
2419
|
getHeight: () => height.value,
|
|
2362
2420
|
setVisible,
|
|
2363
2421
|
scrollToDate,
|
|
@@ -2377,9 +2435,13 @@ var stdin_default$1s = defineComponent({
|
|
|
2377
2435
|
subtitle: String,
|
|
2378
2436
|
showTitle: Boolean,
|
|
2379
2437
|
showSubtitle: Boolean,
|
|
2380
|
-
firstDayOfWeek: makeNumberProp(1)
|
|
2438
|
+
firstDayOfWeek: makeNumberProp(1),
|
|
2439
|
+
yearPreEnable: Boolean,
|
|
2440
|
+
monthPreEnable: Boolean,
|
|
2441
|
+
yearNextEnable: Boolean,
|
|
2442
|
+
monthNextEnable: Boolean
|
|
2381
2443
|
},
|
|
2382
|
-
emits: ["clickSubtitle"],
|
|
2444
|
+
emits: ["clickSubtitle", "clickPreIcon", "clickNextIcon"],
|
|
2383
2445
|
setup(props, {
|
|
2384
2446
|
slots,
|
|
2385
2447
|
emit
|
|
@@ -2394,13 +2456,111 @@ var stdin_default$1s = defineComponent({
|
|
|
2394
2456
|
}
|
|
2395
2457
|
};
|
|
2396
2458
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
|
2459
|
+
const onClickPreIcon = (isMonth, isYear) => () => {
|
|
2460
|
+
if (isMonth && !props.monthPreEnable || isYear && !props.yearPreEnable) {
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2463
|
+
emit("clickPreIcon", isMonth, isYear);
|
|
2464
|
+
};
|
|
2465
|
+
const onClickNextIcon = (isMonth, isYear) => () => {
|
|
2466
|
+
if (isMonth && !props.monthNextEnable || isYear && !props.yearNextEnable) {
|
|
2467
|
+
return;
|
|
2468
|
+
}
|
|
2469
|
+
emit("clickNextIcon", isMonth, isYear);
|
|
2470
|
+
};
|
|
2471
|
+
const fastForwardImg = () => createVNode("svg", {
|
|
2472
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2473
|
+
"width": "16px",
|
|
2474
|
+
"height": "16px",
|
|
2475
|
+
"viewBox": "0 0 16 16",
|
|
2476
|
+
"version": "1.1"
|
|
2477
|
+
}, [createVNode("g", {
|
|
2478
|
+
"stroke": "none",
|
|
2479
|
+
"stroke-width": "1",
|
|
2480
|
+
"fill": "none",
|
|
2481
|
+
"fill-rule": "evenodd"
|
|
2482
|
+
}, [createVNode("g", {
|
|
2483
|
+
"transform": "translate(-32.000000, -320.000000)",
|
|
2484
|
+
"fill": "#0091FA",
|
|
2485
|
+
"fill-rule": "nonzero"
|
|
2486
|
+
}, [createVNode("g", {
|
|
2487
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2488
|
+
}, [createVNode("g", {
|
|
2489
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2490
|
+
}, [createVNode("g", {
|
|
2491
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2492
|
+
}, [createVNode("g", {
|
|
2493
|
+
"transform": "translate(8.000000, 10.000000) scale(-1, 1) translate(-8.000000, -10.000000) translate(0.000000, 2.000000)"
|
|
2494
|
+
}, [createVNode("g", {
|
|
2495
|
+
"transform": "translate(0.500000, 2.000000)"
|
|
2496
|
+
}, [createVNode("path", {
|
|
2497
|
+
"d": "M6.79659726,4.25543258 L3.35183004,7.88886609 C3.14952477,8.10225141 2.77635057,8.13960837 2.51832213,7.9723052 C2.48075622,7.94794782 2.4468797,7.91993249 2.41742642,7.88886609 L-1.02734079,4.25543258 C-1.22964607,4.04204726 -1.18447352,3.73343826 -0.926445085,3.56613509 C-0.821927664,3.49836699 -0.69295109,3.46153846 -0.560138985,3.46153846 L6.32939545,3.46153846 C6.65727667,3.46153846 6.92307692,3.68135095 6.92307692,3.95250339 C6.92307692,4.06233684 6.87854337,4.16899837 6.79659726,4.25543258 Z",
|
|
2498
|
+
"opacity": "0.3",
|
|
2499
|
+
"transform": "translate(2.884615, 5.769231) rotate(-90.000000) translate(-2.884615, -5.769231) "
|
|
2500
|
+
}, null), createVNode("path", {
|
|
2501
|
+
"d": "M12.5116225,3.49853348 L7.59052644,8.94868375 C7.3015189,9.26876173 6.7684129,9.32479717 6.39980085,9.07384242 C6.34613526,9.03730635 6.29774023,8.99528335 6.25566412,8.94868375 L1.3345681,3.49853348 C1.04556056,3.1784555 1.11009277,2.715542 1.47870482,2.46458724 C1.62801542,2.3629351 1.81226767,2.30769231 2.00199925,2.30769231 L11.8441913,2.30769231 C12.3125931,2.30769231 12.6923077,2.63741103 12.6923077,3.0441397 C12.6923077,3.20888987 12.6286883,3.36888217 12.5116225,3.49853348 Z",
|
|
2502
|
+
"opacity": "0.8",
|
|
2503
|
+
"transform": "translate(6.923077, 5.769231) rotate(-90.000000) translate(-6.923077, -5.769231) "
|
|
2504
|
+
}, null), createVNode("path", {
|
|
2505
|
+
"d": "M17.1270071,3.49853348 L12.2059111,8.94868375 C11.9169035,9.26876173 11.3837975,9.32479717 11.0151855,9.07384242 C10.9615199,9.03730635 10.9131248,8.99528335 10.8710487,8.94868375 L5.94995271,3.49853348 C5.66094518,3.1784555 5.72547739,2.715542 6.09408944,2.46458724 C6.24340004,2.3629351 6.42765229,2.30769231 6.61738387,2.30769231 L16.4595759,2.30769231 C16.9279777,2.30769231 17.3076923,2.63741103 17.3076923,3.0441397 C17.3076923,3.20888987 17.2440729,3.36888217 17.1270071,3.49853348 Z",
|
|
2506
|
+
"opacity": "0.8",
|
|
2507
|
+
"transform": "translate(11.538462, 5.769231) rotate(-90.000000) translate(-11.538462, -5.769231) "
|
|
2508
|
+
}, null)])])])])])])])]);
|
|
2509
|
+
const slowForward = () => createVNode("svg", {
|
|
2510
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2511
|
+
"width": "16px",
|
|
2512
|
+
"height": "16px",
|
|
2513
|
+
"viewBox": "0 0 16 16",
|
|
2514
|
+
"version": "1.1"
|
|
2515
|
+
}, [createVNode("g", {
|
|
2516
|
+
"stroke": "none",
|
|
2517
|
+
"stroke-width": "1",
|
|
2518
|
+
"fill": "none",
|
|
2519
|
+
"fill-rule": "evenodd"
|
|
2520
|
+
}, [createVNode("g", {
|
|
2521
|
+
"transform": "translate(-80.000000, -320.000000)",
|
|
2522
|
+
"fill": "#0091FA",
|
|
2523
|
+
"fill-rule": "nonzero"
|
|
2524
|
+
}, [createVNode("g", {
|
|
2525
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2526
|
+
}, [createVNode("g", {
|
|
2527
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2528
|
+
}, [createVNode("g", {
|
|
2529
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2530
|
+
}, [createVNode("g", {
|
|
2531
|
+
"transform": "translate(56.000000, 10.000000) scale(-1, 1) translate(-56.000000, -10.000000) translate(48.000000, 2.000000)"
|
|
2532
|
+
}, [createVNode("g", {
|
|
2533
|
+
"transform": "translate(3.000000, 2.000000)"
|
|
2534
|
+
}, [createVNode("path", {
|
|
2535
|
+
"d": "M7.06846115,4.42564988 L3.48590324,8.20442073 C3.27550576,8.42634147 2.88740459,8.46519271 2.61905502,8.29119741 C2.57998647,8.26586573 2.54475489,8.23672979 2.51412348,8.20442073 L-1.06843443,4.42564988 C-1.27883191,4.20372915 -1.23185246,3.88277579 -0.963502888,3.70878049 C-0.854804771,3.63830167 -0.720669133,3.6 -0.582544544,3.6 L6.58257127,3.6 C6.92356774,3.6 7.2,3.82860498 7.2,4.11060352 C7.2,4.22483031 7.1536851,4.3357583 7.06846115,4.42564988 Z",
|
|
2536
|
+
"opacity": "0.3",
|
|
2537
|
+
"transform": "translate(3.000000, 6.000000) rotate(-90.000000) translate(-3.000000, -6.000000) "
|
|
2538
|
+
}, null), createVNode("path", {
|
|
2539
|
+
"d": "M13.0120874,3.63847482 L7.89414749,9.3066311 C7.59357966,9.6395122 7.03914942,9.69778906 6.65579288,9.43679611 C6.59998067,9.3987986 6.54964984,9.35509469 6.50589069,9.3066311 L1.38795082,3.63847482 C1.08738299,3.30559372 1.15449649,2.82416368 1.53785302,2.56317073 C1.69313604,2.4574525 1.88475838,2.4 2.08207922,2.4 L12.317959,2.4 C12.8050968,2.4 13.2,2.74290748 13.2,3.16590528 C13.2,3.33724547 13.1338359,3.50363746 13.0120874,3.63847482 Z",
|
|
2540
|
+
"opacity": "0.8",
|
|
2541
|
+
"transform": "translate(7.200000, 6.000000) rotate(-90.000000) translate(-7.200000, -6.000000) "
|
|
2542
|
+
}, null)])])])])])])])]);
|
|
2397
2543
|
const renderSubtitle = () => {
|
|
2398
2544
|
if (props.showSubtitle) {
|
|
2399
2545
|
const title = slots.subtitle ? slots.subtitle() : props.subtitle;
|
|
2400
2546
|
return createVNode("div", {
|
|
2401
|
-
"class": bem$15("header-subtitle")
|
|
2547
|
+
"class": bem$15("header-subtitle")
|
|
2548
|
+
}, [createVNode("div", {
|
|
2549
|
+
"class": bem$15("header-subtitle", ["opt", props.yearPreEnable ? "enable" : "unenable"]),
|
|
2550
|
+
"onClick": onClickPreIcon(false, true)
|
|
2551
|
+
}, [fastForwardImg()]), createVNode("div", {
|
|
2552
|
+
"class": bem$15("header-subtitle", ["opt", props.monthPreEnable ? "enable" : "unenable"]),
|
|
2553
|
+
"onClick": onClickPreIcon(true, false)
|
|
2554
|
+
}, [slowForward()]), createVNode("label", {
|
|
2555
|
+
"class": bem$15("header-subtitle-text"),
|
|
2402
2556
|
"onClick": onClickSubtitle
|
|
2403
|
-
}, [title])
|
|
2557
|
+
}, [title]), createVNode("div", {
|
|
2558
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.monthNextEnable ? "enable" : "unenable"]]),
|
|
2559
|
+
"onClick": onClickNextIcon(true, false)
|
|
2560
|
+
}, [slowForward()]), createVNode("div", {
|
|
2561
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.yearNextEnable ? "enable" : "unenable"]]),
|
|
2562
|
+
"onClick": onClickNextIcon(false, true)
|
|
2563
|
+
}, [fastForwardImg()])]);
|
|
2404
2564
|
}
|
|
2405
2565
|
};
|
|
2406
2566
|
const renderWeekDays = () => {
|
|
@@ -2422,6 +2582,7 @@ var stdin_default$1s = defineComponent({
|
|
|
2422
2582
|
});
|
|
2423
2583
|
const calendarProps = {
|
|
2424
2584
|
show: Boolean,
|
|
2585
|
+
showType: makeStringProp("inline"),
|
|
2425
2586
|
type: makeStringProp("single"),
|
|
2426
2587
|
title: String,
|
|
2427
2588
|
color: String,
|
|
@@ -2448,24 +2609,14 @@ const calendarProps = {
|
|
|
2448
2609
|
closeOnClickOverlay: truthProp,
|
|
2449
2610
|
safeAreaInsetTop: Boolean,
|
|
2450
2611
|
safeAreaInsetBottom: truthProp,
|
|
2451
|
-
minDate:
|
|
2452
|
-
|
|
2453
|
-
validator: isDate,
|
|
2454
|
-
default: getToday
|
|
2455
|
-
},
|
|
2456
|
-
maxDate: {
|
|
2457
|
-
type: Date,
|
|
2458
|
-
validator: isDate,
|
|
2459
|
-
default: () => {
|
|
2460
|
-
const now = getToday();
|
|
2461
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
|
2462
|
-
}
|
|
2463
|
-
},
|
|
2612
|
+
minDate: Date,
|
|
2613
|
+
maxDate: Date,
|
|
2464
2614
|
firstDayOfWeek: {
|
|
2465
2615
|
type: numericProp,
|
|
2466
|
-
default:
|
|
2616
|
+
default: 1,
|
|
2467
2617
|
validator: (val) => val >= 0 && val <= 6
|
|
2468
|
-
}
|
|
2618
|
+
},
|
|
2619
|
+
disabledDate: Function
|
|
2469
2620
|
};
|
|
2470
2621
|
var stdin_default$1r = defineComponent({
|
|
2471
2622
|
name: name$18,
|
|
@@ -2475,11 +2626,19 @@ var stdin_default$1r = defineComponent({
|
|
|
2475
2626
|
emit,
|
|
2476
2627
|
slots
|
|
2477
2628
|
}) {
|
|
2478
|
-
const
|
|
2479
|
-
|
|
2629
|
+
const lastMinDate = computed(() => {
|
|
2630
|
+
const now = new Date();
|
|
2631
|
+
return props.showType !== "inline" && !props.minDate ? new Date(now.getFullYear(), now.getMonth() - 3, now.getDate()) : props.minDate;
|
|
2632
|
+
});
|
|
2633
|
+
const lastMaxDate = computed(() => {
|
|
2634
|
+
const now = new Date();
|
|
2635
|
+
return props.showType !== "inline" && !props.maxDate ? new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()) : props.maxDate;
|
|
2636
|
+
});
|
|
2637
|
+
const limitDateRange = (date, minDate = lastMinDate.value, maxDate = lastMaxDate.value) => {
|
|
2638
|
+
if (minDate && compareDay(date, minDate) === -1) {
|
|
2480
2639
|
return minDate;
|
|
2481
2640
|
}
|
|
2482
|
-
if (compareDay(date, maxDate) === 1) {
|
|
2641
|
+
if (maxDate && compareDay(date, maxDate) === 1) {
|
|
2483
2642
|
return maxDate;
|
|
2484
2643
|
}
|
|
2485
2644
|
return date;
|
|
@@ -2487,10 +2646,10 @@ var stdin_default$1r = defineComponent({
|
|
|
2487
2646
|
const getInitialDate = (defaultDate = props.defaultDate) => {
|
|
2488
2647
|
const {
|
|
2489
2648
|
type,
|
|
2490
|
-
minDate,
|
|
2491
|
-
maxDate,
|
|
2492
2649
|
allowSameDay
|
|
2493
2650
|
} = props;
|
|
2651
|
+
const minDate = lastMinDate.value;
|
|
2652
|
+
const maxDate = lastMaxDate.value;
|
|
2494
2653
|
if (defaultDate === null) {
|
|
2495
2654
|
return defaultDate;
|
|
2496
2655
|
}
|
|
@@ -2499,8 +2658,8 @@ var stdin_default$1r = defineComponent({
|
|
|
2499
2658
|
if (!Array.isArray(defaultDate)) {
|
|
2500
2659
|
defaultDate = [];
|
|
2501
2660
|
}
|
|
2502
|
-
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
|
|
2503
|
-
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
|
|
2661
|
+
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : maxDate && getPrevDay(maxDate));
|
|
2662
|
+
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : minDate && getNextDay(minDate));
|
|
2504
2663
|
return [start, end];
|
|
2505
2664
|
}
|
|
2506
2665
|
if (type === "multiple") {
|
|
@@ -2514,20 +2673,40 @@ var stdin_default$1r = defineComponent({
|
|
|
2514
2673
|
}
|
|
2515
2674
|
return limitDateRange(defaultDate);
|
|
2516
2675
|
};
|
|
2676
|
+
const getInitialTitleDate = (defaultDate = props.defaultDate) => {
|
|
2677
|
+
const initTitleDate = getInitialDate(defaultDate);
|
|
2678
|
+
const now = getToday();
|
|
2679
|
+
if (Array.isArray(initTitleDate)) {
|
|
2680
|
+
return initTitleDate[0] || now;
|
|
2681
|
+
} else {
|
|
2682
|
+
return initTitleDate || now;
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2517
2685
|
let bodyHeight;
|
|
2518
2686
|
const bodyRef = ref();
|
|
2519
2687
|
const subtitle = ref("");
|
|
2520
2688
|
const currentDate = ref(getInitialDate());
|
|
2689
|
+
const titleDate = ref(getInitialTitleDate());
|
|
2521
2690
|
const [monthRefs, setMonthRefs] = useRefs();
|
|
2522
2691
|
const dayOffset = computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
|
2523
2692
|
const months = computed(() => {
|
|
2693
|
+
var _a;
|
|
2524
2694
|
const months2 = [];
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2695
|
+
if (props.showType !== "inline" && lastMinDate.value && lastMaxDate.value) {
|
|
2696
|
+
const cursor = new Date(lastMinDate.value);
|
|
2697
|
+
cursor.setDate(1);
|
|
2698
|
+
do {
|
|
2699
|
+
months2.push(new Date(cursor));
|
|
2700
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
2701
|
+
} while (compareMonth(cursor, lastMaxDate.value) !== 1);
|
|
2702
|
+
} else if (props.showType === "inline") {
|
|
2703
|
+
const temp = (_a = titleDate.value) != null ? _a : cloneDates(titleDate.value);
|
|
2704
|
+
if (!Array.isArray(temp)) {
|
|
2705
|
+
months2.push(getFirstDate(temp));
|
|
2706
|
+
} else {
|
|
2707
|
+
months2.push(getFirstDate(temp[0]));
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2531
2710
|
return months2;
|
|
2532
2711
|
});
|
|
2533
2712
|
const buttonDisabled = computed(() => {
|
|
@@ -2578,6 +2757,7 @@ var stdin_default$1r = defineComponent({
|
|
|
2578
2757
|
});
|
|
2579
2758
|
if (currentMonth) {
|
|
2580
2759
|
subtitle.value = currentMonth.getTitle();
|
|
2760
|
+
titleDate.value = currentMonth.getDate();
|
|
2581
2761
|
}
|
|
2582
2762
|
};
|
|
2583
2763
|
const scrollToDate = (targetDate) => {
|
|
@@ -2618,6 +2798,7 @@ var stdin_default$1r = defineComponent({
|
|
|
2618
2798
|
};
|
|
2619
2799
|
const reset = (date = getInitialDate()) => {
|
|
2620
2800
|
currentDate.value = date;
|
|
2801
|
+
titleDate.value = getInitialTitleDate(date);
|
|
2621
2802
|
scrollToCurrentDate();
|
|
2622
2803
|
};
|
|
2623
2804
|
const checkRange = (date) => {
|
|
@@ -2679,6 +2860,9 @@ var stdin_default$1r = defineComponent({
|
|
|
2679
2860
|
const {
|
|
2680
2861
|
type
|
|
2681
2862
|
} = props;
|
|
2863
|
+
if (item.type === "preview") {
|
|
2864
|
+
titleDate.value = date;
|
|
2865
|
+
}
|
|
2682
2866
|
if (type === "range") {
|
|
2683
2867
|
if (!currentDate.value) {
|
|
2684
2868
|
select([date]);
|
|
@@ -2726,6 +2910,64 @@ var stdin_default$1r = defineComponent({
|
|
|
2726
2910
|
select(date, true);
|
|
2727
2911
|
}
|
|
2728
2912
|
};
|
|
2913
|
+
const yearPreEnable = computed(() => {
|
|
2914
|
+
if (!lastMinDate.value) {
|
|
2915
|
+
return true;
|
|
2916
|
+
}
|
|
2917
|
+
return titleDate.value.getFullYear() > lastMinDate.value.getFullYear();
|
|
2918
|
+
});
|
|
2919
|
+
const monthPreEnable = computed(() => {
|
|
2920
|
+
if (!lastMinDate.value) {
|
|
2921
|
+
return true;
|
|
2922
|
+
}
|
|
2923
|
+
const targetDate = titleDate.value;
|
|
2924
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
2925
|
+
const minDateYearMonth = getFirstDate(lastMinDate.value);
|
|
2926
|
+
return compareDay(targetYearMonth, minDateYearMonth) === 1;
|
|
2927
|
+
});
|
|
2928
|
+
const yearNextEnable = computed(() => {
|
|
2929
|
+
if (!lastMaxDate.value) {
|
|
2930
|
+
return true;
|
|
2931
|
+
}
|
|
2932
|
+
return titleDate.value.getFullYear() < lastMaxDate.value.getFullYear();
|
|
2933
|
+
});
|
|
2934
|
+
const monthNextEnable = computed(() => {
|
|
2935
|
+
if (!lastMaxDate.value) {
|
|
2936
|
+
return true;
|
|
2937
|
+
}
|
|
2938
|
+
const targetDate = titleDate.value;
|
|
2939
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
2940
|
+
const maxDateYearMonth = getFirstDate(lastMaxDate.value);
|
|
2941
|
+
return compareDay(maxDateYearMonth, targetYearMonth) === 1;
|
|
2942
|
+
});
|
|
2943
|
+
const onClickTitleIcon = (isPreFlag, isMonth, isYear) => {
|
|
2944
|
+
const curTitleDate = titleDate.value;
|
|
2945
|
+
if (curTitleDate) {
|
|
2946
|
+
let targetDate = isPreFlag ? getPrevDate(curTitleDate, isMonth, isYear) : getNextDate(curTitleDate, isMonth, isYear);
|
|
2947
|
+
if (!isDate(targetDate)) {
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
let hasCompared = false;
|
|
2951
|
+
const compareDate = isPreFlag ? lastMinDate.value : lastMaxDate.value;
|
|
2952
|
+
const compareValue = isPreFlag ? 1 : -1;
|
|
2953
|
+
if (compareDate && compareDay(compareDate, targetDate) === compareValue && compareMonth(compareDate, targetDate) === 0) {
|
|
2954
|
+
targetDate = compareDate;
|
|
2955
|
+
hasCompared = true;
|
|
2956
|
+
}
|
|
2957
|
+
if (hasCompared || !compareDate || compareDate && compareDay(compareDate, targetDate) !== compareValue) {
|
|
2958
|
+
scrollToDate(targetDate);
|
|
2959
|
+
titleDate.value = targetDate;
|
|
2960
|
+
}
|
|
2961
|
+
} else {
|
|
2962
|
+
raf(onScroll);
|
|
2963
|
+
}
|
|
2964
|
+
};
|
|
2965
|
+
const onClickPreIcon = (isMonth, isYear) => {
|
|
2966
|
+
onClickTitleIcon(true, isMonth, isYear);
|
|
2967
|
+
};
|
|
2968
|
+
const onClickNextIcon = (isMonth, isYear) => {
|
|
2969
|
+
onClickTitleIcon(false, isMonth, isYear);
|
|
2970
|
+
};
|
|
2729
2971
|
const updateShow = (value) => emit("update:show", value);
|
|
2730
2972
|
const renderMonth = (date, index) => {
|
|
2731
2973
|
const showMonthTitle = index !== 0 || !props.showSubtitle;
|
|
@@ -2735,7 +2977,7 @@ var stdin_default$1r = defineComponent({
|
|
|
2735
2977
|
"currentDate": currentDate.value,
|
|
2736
2978
|
"showMonthTitle": showMonthTitle,
|
|
2737
2979
|
"firstDayOfWeek": dayOffset.value
|
|
2738
|
-
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
|
2980
|
+
}, pick(props, ["showType", "type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay", "disabledDate"]), {
|
|
2739
2981
|
"onClick": onClickDay
|
|
2740
2982
|
}), pick(slots, ["top-info", "bottom-info"]));
|
|
2741
2983
|
};
|
|
@@ -2785,7 +3027,13 @@ var stdin_default$1r = defineComponent({
|
|
|
2785
3027
|
"showTitle": props.showTitle,
|
|
2786
3028
|
"showSubtitle": props.showSubtitle,
|
|
2787
3029
|
"firstDayOfWeek": dayOffset.value,
|
|
2788
|
-
"onClickSubtitle": (event) => emit("clickSubtitle", event)
|
|
3030
|
+
"onClickSubtitle": (event) => emit("clickSubtitle", event),
|
|
3031
|
+
"onClickPreIcon": onClickPreIcon,
|
|
3032
|
+
"onClickNextIcon": onClickNextIcon,
|
|
3033
|
+
"yearPreEnable": yearPreEnable.value,
|
|
3034
|
+
"monthPreEnable": monthPreEnable.value,
|
|
3035
|
+
"yearNextEnable": yearNextEnable.value,
|
|
3036
|
+
"monthNextEnable": monthNextEnable.value
|
|
2789
3037
|
}, pick(slots, ["title", "subtitle"])), createVNode("div", {
|
|
2790
3038
|
"ref": bodyRef,
|
|
2791
3039
|
"class": bem$15("body"),
|
|
@@ -2797,6 +3045,11 @@ var stdin_default$1r = defineComponent({
|
|
|
2797
3045
|
currentDate.value = value;
|
|
2798
3046
|
scrollToCurrentDate();
|
|
2799
3047
|
});
|
|
3048
|
+
watch(titleDate, (newValue) => {
|
|
3049
|
+
if (props.showType === "inline" && newValue) {
|
|
3050
|
+
subtitle.value = formatMonthTitle(newValue);
|
|
3051
|
+
}
|
|
3052
|
+
});
|
|
2800
3053
|
useExpose({
|
|
2801
3054
|
reset,
|
|
2802
3055
|
scrollToDate,
|
|
@@ -4278,7 +4531,7 @@ var stdin_default$1i = defineComponent({
|
|
|
4278
4531
|
options,
|
|
4279
4532
|
selected
|
|
4280
4533
|
} = tab;
|
|
4281
|
-
const placeholder = props.placeholder || t$5("
|
|
4534
|
+
const placeholder = props.placeholder || t$5("ztCascader.select");
|
|
4282
4535
|
const title = selected ? selected[textKey] : placeholder;
|
|
4283
4536
|
return createVNode(Tab, {
|
|
4284
4537
|
"title": title,
|
|
@@ -6645,6 +6898,7 @@ const DateTimePicker = withInstall(stdin_default$$);
|
|
|
6645
6898
|
const [name$H, bem$I, t$3] = createNamespace("dialog");
|
|
6646
6899
|
const dialogProps = extend({}, popupSharedProps, {
|
|
6647
6900
|
title: String,
|
|
6901
|
+
primaryHeader: Boolean,
|
|
6648
6902
|
theme: String,
|
|
6649
6903
|
width: numericProp,
|
|
6650
6904
|
message: [String, Function],
|
|
@@ -6722,12 +6976,21 @@ var stdin_default$_ = defineComponent({
|
|
|
6722
6976
|
const renderTitle = () => {
|
|
6723
6977
|
const title = slots.title ? slots.title() : props.title;
|
|
6724
6978
|
if (title) {
|
|
6725
|
-
return
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6979
|
+
return (
|
|
6980
|
+
// <div
|
|
6981
|
+
// class={bem(['header', props.titleType, {
|
|
6982
|
+
// isolated: !props.message && !slots.default,
|
|
6983
|
+
// 'custom-title': !!slots.title,
|
|
6984
|
+
// }])}
|
|
6985
|
+
// >
|
|
6986
|
+
createVNode("div", {
|
|
6987
|
+
"class": bem$I("header", {
|
|
6988
|
+
isolated: !props.message && !slots.default,
|
|
6989
|
+
"custom-title": !!slots.title,
|
|
6990
|
+
primary: props.primaryHeader
|
|
6991
|
+
})
|
|
6992
|
+
}, [title])
|
|
6993
|
+
);
|
|
6731
6994
|
}
|
|
6732
6995
|
};
|
|
6733
6996
|
const renderMessage = (hasTitle) => {
|
|
@@ -6736,10 +6999,15 @@ var stdin_default$_ = defineComponent({
|
|
|
6736
6999
|
allowHtml,
|
|
6737
7000
|
messageAlign
|
|
6738
7001
|
} = props;
|
|
6739
|
-
const
|
|
6740
|
-
"has-title": hasTitle,
|
|
7002
|
+
const mods = {
|
|
6741
7003
|
[messageAlign]: messageAlign
|
|
6742
|
-
}
|
|
7004
|
+
};
|
|
7005
|
+
if (props.primaryHeader) {
|
|
7006
|
+
mods["primary-header"] = props.primaryHeader;
|
|
7007
|
+
} else if (hasTitle) {
|
|
7008
|
+
mods["has-title"] = hasTitle;
|
|
7009
|
+
}
|
|
7010
|
+
const classNames = bem$I("message", mods);
|
|
6743
7011
|
const content = isFunction(message) ? message() : message;
|
|
6744
7012
|
if (allowHtml && typeof content === "string") {
|
|
6745
7013
|
return createVNode("div", {
|
|
@@ -8458,6 +8726,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
|
|
8458
8726
|
labelAlign: String,
|
|
8459
8727
|
showWordLimit: Boolean,
|
|
8460
8728
|
errorMessageAlign: String,
|
|
8729
|
+
descriptionClass: unknownProp,
|
|
8461
8730
|
description: makeStringProp(""),
|
|
8462
8731
|
colon: {
|
|
8463
8732
|
type: Boolean,
|
|
@@ -8795,7 +9064,7 @@ var stdin_default$W = defineComponent({
|
|
|
8795
9064
|
return;
|
|
8796
9065
|
}
|
|
8797
9066
|
return createVNode("div", {
|
|
8798
|
-
"class": bem$E("description")
|
|
9067
|
+
"class": [bem$E("description"), props.descriptionClass]
|
|
8799
9068
|
}, [props.description]);
|
|
8800
9069
|
};
|
|
8801
9070
|
const showMessage = computed(() => !(form && form.props.showErrorMessage === false) && (props.errorMessage || state.validateMessage));
|
|
@@ -13859,12 +14128,14 @@ var stdin_default$p = defineComponent({
|
|
|
13859
14128
|
return __async(this, null, function* () {
|
|
13860
14129
|
var _a;
|
|
13861
14130
|
if (wrapperRef.value && popupRef.value && arrowRef.value) {
|
|
14131
|
+
const popoverEl = popupRef.value;
|
|
14132
|
+
const wrapperEl = wrapperRef.value;
|
|
13862
14133
|
const {
|
|
13863
14134
|
x,
|
|
13864
14135
|
y,
|
|
13865
14136
|
placement: realPlacement,
|
|
13866
14137
|
middlewareData
|
|
13867
|
-
} = yield computePosition(
|
|
14138
|
+
} = yield computePosition(wrapperEl, popoverEl, {
|
|
13868
14139
|
placement: props.placement,
|
|
13869
14140
|
middleware: [offset(8), shift({
|
|
13870
14141
|
padding: 4,
|
|
@@ -13875,11 +14146,7 @@ var stdin_default$p = defineComponent({
|
|
|
13875
14146
|
padding: 6
|
|
13876
14147
|
})]
|
|
13877
14148
|
});
|
|
13878
|
-
|
|
13879
|
-
left: `${x}px`,
|
|
13880
|
-
top: `${y}px`
|
|
13881
|
-
});
|
|
13882
|
-
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
14149
|
+
let popupTop = y;
|
|
13883
14150
|
const side = realPlacement.split("-")[0];
|
|
13884
14151
|
const arrowSide = {
|
|
13885
14152
|
top: "bottom",
|
|
@@ -13887,6 +14154,16 @@ var stdin_default$p = defineComponent({
|
|
|
13887
14154
|
bottom: "top",
|
|
13888
14155
|
left: "right"
|
|
13889
14156
|
}[side];
|
|
14157
|
+
if (y < 0) {
|
|
14158
|
+
popupTop = 0;
|
|
14159
|
+
} else if (y > 0 && y + popoverEl.offsetHeight > document.body.clientHeight) {
|
|
14160
|
+
popupTop = document.body.clientHeight - popoverEl.offsetHeight;
|
|
14161
|
+
}
|
|
14162
|
+
Object.assign(popupRef.value.style, {
|
|
14163
|
+
left: `${x}px`,
|
|
14164
|
+
top: `${popupTop}px`
|
|
14165
|
+
});
|
|
14166
|
+
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
13890
14167
|
const {
|
|
13891
14168
|
x: arrowX,
|
|
13892
14169
|
y: arrowY
|
|
@@ -15795,6 +16072,11 @@ var stdin_default$a = defineComponent({
|
|
|
15795
16072
|
}
|
|
15796
16073
|
});
|
|
15797
16074
|
const TabbarItem = withInstall(stdin_default$a);
|
|
16075
|
+
var SortOrderEnum = /* @__PURE__ */ ((SortOrderEnum2) => {
|
|
16076
|
+
SortOrderEnum2["ASCEND"] = "ascend";
|
|
16077
|
+
SortOrderEnum2["DESCEND"] = "descend";
|
|
16078
|
+
return SortOrderEnum2;
|
|
16079
|
+
})(SortOrderEnum || {});
|
|
15798
16080
|
const [name$4, bem$4] = createNamespace("table");
|
|
15799
16081
|
const tableProps = {
|
|
15800
16082
|
headList: makeArrayProp(),
|
|
@@ -15817,12 +16099,42 @@ const tableProps = {
|
|
|
15817
16099
|
var stdin_default$9 = defineComponent({
|
|
15818
16100
|
name: name$4,
|
|
15819
16101
|
props: tableProps,
|
|
15820
|
-
|
|
15821
|
-
|
|
16102
|
+
emits: ["sort"],
|
|
16103
|
+
setup(props, {
|
|
16104
|
+
emit
|
|
16105
|
+
}) {
|
|
16106
|
+
const sortOrder = ref("");
|
|
16107
|
+
const sortKey = ref("");
|
|
15822
16108
|
const fixedColumn = computed(() => props.headList.filter((v) => v.fixed));
|
|
16109
|
+
const formatColumns = computed(() => {
|
|
16110
|
+
const columns = [];
|
|
16111
|
+
let left = 0;
|
|
16112
|
+
props.headList.forEach((element, index) => {
|
|
16113
|
+
var _a;
|
|
16114
|
+
const column = Object.assign({}, element);
|
|
16115
|
+
const preColumn = props.headList[index - 1];
|
|
16116
|
+
const nextColumn = props.headList[index + 1];
|
|
16117
|
+
if (preColumn) {
|
|
16118
|
+
left += Number((_a = preColumn.width) == null ? void 0 : _a.split("px")[0]);
|
|
16119
|
+
column.left = `${left}px`;
|
|
16120
|
+
} else {
|
|
16121
|
+
column.left = 0;
|
|
16122
|
+
}
|
|
16123
|
+
if (element.fixed && !nextColumn.fixed) {
|
|
16124
|
+
column.lastFixLeft = true;
|
|
16125
|
+
}
|
|
16126
|
+
columns.push(column);
|
|
16127
|
+
});
|
|
16128
|
+
return columns;
|
|
16129
|
+
});
|
|
16130
|
+
const pingedLeft = ref(false);
|
|
15823
16131
|
const resortHeadList = computed(() => fixedColumn.value.concat(props.headList.filter((v) => !v.fixed)));
|
|
15824
16132
|
onMounted(() => {
|
|
15825
16133
|
const fixedIndexList = props.headList.map((v, i) => {
|
|
16134
|
+
if (v.sorter && v.defaultSortOrder) {
|
|
16135
|
+
sortOrder.value = v.defaultSortOrder || "";
|
|
16136
|
+
sortKey.value = v.key;
|
|
16137
|
+
}
|
|
15826
16138
|
if (v.fixed) {
|
|
15827
16139
|
return `tableHead${i}`;
|
|
15828
16140
|
} else {
|
|
@@ -15839,31 +16151,86 @@ var stdin_default$9 = defineComponent({
|
|
|
15839
16151
|
}, 0);
|
|
15840
16152
|
}
|
|
15841
16153
|
});
|
|
15842
|
-
const
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
16154
|
+
const getNextSortOrder = (type) => {
|
|
16155
|
+
if (!type) {
|
|
16156
|
+
return SortOrderEnum.ASCEND;
|
|
16157
|
+
} else if (type === SortOrderEnum.ASCEND) {
|
|
16158
|
+
return SortOrderEnum.DESCEND;
|
|
15846
16159
|
} else {
|
|
15847
|
-
|
|
16160
|
+
return "";
|
|
15848
16161
|
}
|
|
15849
16162
|
};
|
|
15850
|
-
const
|
|
15851
|
-
if (
|
|
15852
|
-
|
|
16163
|
+
const onHeaderClick = (data) => {
|
|
16164
|
+
if (!data.sorter)
|
|
16165
|
+
return;
|
|
16166
|
+
sortOrder.value = getNextSortOrder(data.key === sortKey.value ? sortOrder.value : "");
|
|
16167
|
+
sortKey.value = data.key;
|
|
16168
|
+
emit("sort", {
|
|
16169
|
+
order: sortOrder.value,
|
|
16170
|
+
key: data.key
|
|
16171
|
+
});
|
|
16172
|
+
};
|
|
16173
|
+
const onScroll = (event) => {
|
|
16174
|
+
const {
|
|
16175
|
+
scrollLeft,
|
|
16176
|
+
currentTarget
|
|
16177
|
+
} = event;
|
|
16178
|
+
const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget == null ? void 0 : currentTarget.scrollLeft;
|
|
16179
|
+
pingedLeft.value = mergedScrollLeft > 0;
|
|
16180
|
+
};
|
|
16181
|
+
const getHead = (colData) => {
|
|
16182
|
+
if ((colData == null ? void 0 : colData.colSpan) !== 0) {
|
|
16183
|
+
return createVNode("th", {
|
|
16184
|
+
"class": bem$4("left", {
|
|
16185
|
+
fixed: colData.fixed,
|
|
16186
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
16187
|
+
}),
|
|
16188
|
+
"style": {
|
|
16189
|
+
left: colData.fixed ? colData.left : ""
|
|
16190
|
+
},
|
|
16191
|
+
"colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
|
|
16192
|
+
}, [createVNode("div", {
|
|
16193
|
+
"class": bem$4("head"),
|
|
16194
|
+
"onClick": () => onHeaderClick(colData)
|
|
16195
|
+
}, [createVNode("span", {
|
|
16196
|
+
"class": bem$4("head-label")
|
|
16197
|
+
}, [colData.label]), colData.sorter ? createVNode("span", {
|
|
16198
|
+
"class": bem$4("head-sort")
|
|
16199
|
+
}, [createVNode(Icon, {
|
|
16200
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.ASCEND ? bem$4("sort-active") : ""],
|
|
16201
|
+
"name": "spinner-shrink",
|
|
16202
|
+
"size": "12",
|
|
16203
|
+
"style": {
|
|
16204
|
+
marginBottom: "-3px"
|
|
16205
|
+
}
|
|
16206
|
+
}, null), createVNode(Icon, {
|
|
16207
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.DESCEND ? bem$4("sort-active") : ""],
|
|
16208
|
+
"name": "spinner-expand",
|
|
16209
|
+
"size": "12",
|
|
16210
|
+
"style": {
|
|
16211
|
+
marginTop: "-3px"
|
|
16212
|
+
}
|
|
16213
|
+
}, null)]) : ""])]);
|
|
15853
16214
|
}
|
|
15854
16215
|
};
|
|
15855
|
-
const
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
16216
|
+
const getBody = (rowData, rowIndex) => createVNode("tr", null, [formatColumns.value.map((colData) => {
|
|
16217
|
+
let additionalCellProps;
|
|
16218
|
+
if (colData.customCell) {
|
|
16219
|
+
additionalCellProps = colData.customCell(rowData, rowIndex);
|
|
16220
|
+
}
|
|
16221
|
+
const style = Object.assign({}, colData.style);
|
|
16222
|
+
style.left = colData.fixed ? colData.left : "";
|
|
16223
|
+
return (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 0 && (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 0 && createVNode("td", {
|
|
16224
|
+
"onClick": () => colData.click && colData.click(rowData, rowIndex),
|
|
16225
|
+
"class": bem$4("left", {
|
|
16226
|
+
fixed: colData.fixed,
|
|
16227
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
16228
|
+
}),
|
|
16229
|
+
"colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
|
|
16230
|
+
"rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
|
|
16231
|
+
"style": style
|
|
16232
|
+
}, [rowData[colData.key]]);
|
|
16233
|
+
})]);
|
|
15867
16234
|
const getCol = () => {
|
|
15868
16235
|
const cols = [];
|
|
15869
16236
|
const col = resortHeadList.value.length;
|
|
@@ -15894,16 +16261,20 @@ var stdin_default$9 = defineComponent({
|
|
|
15894
16261
|
})
|
|
15895
16262
|
}, [getLoadingColumn()]) : createVNode("div", {
|
|
15896
16263
|
"class": bem$4({
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
"class": bem$4("normal-box"),
|
|
16264
|
+
fixed: fixedColumn.value.length > 0,
|
|
16265
|
+
bordered: props.border,
|
|
16266
|
+
striped: props.striped
|
|
16267
|
+
}),
|
|
15902
16268
|
"onScroll": onScroll
|
|
15903
|
-
}, [
|
|
15904
|
-
"
|
|
15905
|
-
|
|
15906
|
-
|
|
16269
|
+
}, [createVNode("table", null, [createVNode("colgroup", null, [props.headList.map((item) => createVNode("col", {
|
|
16270
|
+
"style": {
|
|
16271
|
+
width: item.width
|
|
16272
|
+
}
|
|
16273
|
+
}, null))]), createVNode("thead", {
|
|
16274
|
+
"class": bem$4("thead")
|
|
16275
|
+
}, [createVNode("tr", null, [formatColumns.value.map((colData) => getHead(colData))])]), createVNode("tbody", {
|
|
16276
|
+
"class": bem$4("tbody")
|
|
16277
|
+
}, [props.dataList.map((rowData, rowIndex) => getBody(rowData, rowIndex))])])]);
|
|
15907
16278
|
}
|
|
15908
16279
|
});
|
|
15909
16280
|
const Table = withInstall(stdin_default$9);
|
|
@@ -15919,6 +16290,7 @@ const tagProps = {
|
|
|
15919
16290
|
borderColor: String,
|
|
15920
16291
|
closeable: Boolean,
|
|
15921
16292
|
icon: String,
|
|
16293
|
+
image: String,
|
|
15922
16294
|
iconPrefix: String,
|
|
15923
16295
|
iconColor: String,
|
|
15924
16296
|
badge: Boolean,
|
|
@@ -15981,27 +16353,33 @@ var stdin_default$8 = defineComponent({
|
|
|
15981
16353
|
"class": [bem$3("close"), HAPTICS_FEEDBACK],
|
|
15982
16354
|
"onClick": onClose
|
|
15983
16355
|
}, null);
|
|
15984
|
-
const LeftIcon =
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
16356
|
+
const LeftIcon = () => {
|
|
16357
|
+
if (props.image) {
|
|
16358
|
+
return createVNode(stdin_default$1z, {
|
|
16359
|
+
"class": bem$3("image"),
|
|
16360
|
+
"src": props.image
|
|
16361
|
+
}, null);
|
|
16362
|
+
} else if (props.icon) {
|
|
16363
|
+
return createVNode(Icon, {
|
|
16364
|
+
"name": props.icon,
|
|
16365
|
+
"class": bem$3("icon"),
|
|
16366
|
+
"classPrefix": props.iconPrefix,
|
|
16367
|
+
"style": {
|
|
16368
|
+
color: props.iconColor
|
|
16369
|
+
}
|
|
16370
|
+
}, null);
|
|
15990
16371
|
}
|
|
15991
|
-
}
|
|
16372
|
+
};
|
|
15992
16373
|
return createVNode("span", {
|
|
15993
16374
|
"style": getStyle(),
|
|
15994
16375
|
"class": bem$3([classes, type])
|
|
15995
|
-
}, [LeftIcon, (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
15996
|
-
};
|
|
15997
|
-
const getStampStyle = () => {
|
|
15998
|
-
const style = {
|
|
15999
|
-
color: props.color || props.textColor,
|
|
16000
|
-
width: props.stampDiameter + "px",
|
|
16001
|
-
height: props.stampDiameter + "px"
|
|
16002
|
-
};
|
|
16003
|
-
return style;
|
|
16376
|
+
}, [LeftIcon(), (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
16004
16377
|
};
|
|
16378
|
+
const getStampStyle = () => ({
|
|
16379
|
+
color: props.color || props.textColor,
|
|
16380
|
+
width: props.stampDiameter + "px",
|
|
16381
|
+
height: props.stampDiameter + "px"
|
|
16382
|
+
});
|
|
16005
16383
|
const renderStampTag = () => {
|
|
16006
16384
|
var _a;
|
|
16007
16385
|
const {
|
|
@@ -17752,7 +18130,7 @@ const Lazyload = {
|
|
|
17752
18130
|
});
|
|
17753
18131
|
}
|
|
17754
18132
|
};
|
|
17755
|
-
const version = "3.0.
|
|
18133
|
+
const version = "3.0.9";
|
|
17756
18134
|
function install(app) {
|
|
17757
18135
|
const components = [
|
|
17758
18136
|
ActionSheet,
|