zartui 3.0.7 → 3.0.8
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/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 +4 -2
- 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/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 +4 -2
- 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 +487 -109
- package/lib/zartui.es.js +487 -109
- package/lib/zartui.js +487 -109
- package/lib/zartui.min.js +1 -1
- package/package.json +7 -7
package/lib/zartui.js
CHANGED
|
@@ -1996,8 +1996,9 @@
|
|
|
1996
1996
|
});
|
|
1997
1997
|
const Button = withInstall(stdin_default$1x);
|
|
1998
1998
|
var stdin_default$1w = Button;
|
|
1999
|
+
const monthsOfYear = 12;
|
|
1999
2000
|
const [name$18, bem$15, t$7] = createNamespace("calendar");
|
|
2000
|
-
const formatMonthTitle = (date) => t$7("
|
|
2001
|
+
const formatMonthTitle = (date) => t$7("ztCalendar.monthTitle", date.getFullYear(), date.getMonth() + 1);
|
|
2001
2002
|
function compareMonth(date1, date2) {
|
|
2002
2003
|
const year1 = date1.getFullYear();
|
|
2003
2004
|
const year2 = date2.getFullYear();
|
|
@@ -2019,9 +2020,20 @@
|
|
|
2019
2020
|
}
|
|
2020
2021
|
const cloneDate = (date) => new Date(date);
|
|
2021
2022
|
const cloneDates = (dates) => Array.isArray(dates) ? dates.map(cloneDate) : cloneDate(dates);
|
|
2022
|
-
function getDayByOffset(date, offset2) {
|
|
2023
|
+
function getDayByOffset(date, offset2, isMonth, isYear) {
|
|
2023
2024
|
const cloned = cloneDate(date);
|
|
2024
|
-
|
|
2025
|
+
if (isYear) {
|
|
2026
|
+
cloned.setFullYear(cloned.getFullYear() + offset2);
|
|
2027
|
+
} else if (isMonth) {
|
|
2028
|
+
cloned.setMonth(cloned.getMonth() + offset2);
|
|
2029
|
+
const multiplier = cloned.getFullYear() - date.getFullYear();
|
|
2030
|
+
const setLastDate = date.getMonth() + offset2 !== cloned.getMonth() + multiplier * monthsOfYear;
|
|
2031
|
+
if (setLastDate) {
|
|
2032
|
+
cloned.setDate(0);
|
|
2033
|
+
}
|
|
2034
|
+
} else {
|
|
2035
|
+
cloned.setDate(cloned.getDate() + offset2);
|
|
2036
|
+
}
|
|
2025
2037
|
return cloned;
|
|
2026
2038
|
}
|
|
2027
2039
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
|
@@ -2031,11 +2043,16 @@
|
|
|
2031
2043
|
today.setHours(0, 0, 0, 0);
|
|
2032
2044
|
return today;
|
|
2033
2045
|
};
|
|
2046
|
+
const getPrevDate = (date, isMonth, isYear) => getDayByOffset(date, -1, isMonth, isYear);
|
|
2047
|
+
const getNextDate = (date, isMonth, isYear) => getDayByOffset(date, 1, isMonth, isYear);
|
|
2034
2048
|
function calcDateNum(date) {
|
|
2035
2049
|
const day1 = date[0].getTime();
|
|
2036
2050
|
const day2 = date[1].getTime();
|
|
2037
2051
|
return (day2 - day1) / (1e3 * 60 * 60 * 24) + 1;
|
|
2038
2052
|
}
|
|
2053
|
+
function getFirstDate(date) {
|
|
2054
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
2055
|
+
}
|
|
2039
2056
|
function useRefs() {
|
|
2040
2057
|
const refs = vue.ref([]);
|
|
2041
2058
|
const cache = [];
|
|
@@ -2380,7 +2397,7 @@
|
|
|
2380
2397
|
style2.width = "100%";
|
|
2381
2398
|
return style2;
|
|
2382
2399
|
}
|
|
2383
|
-
if (index === 0) {
|
|
2400
|
+
if (index === 0 && item.text && +item.text === 1) {
|
|
2384
2401
|
style2.marginLeft = `${100 * offset2 / 7}%`;
|
|
2385
2402
|
}
|
|
2386
2403
|
if (color) {
|
|
@@ -2454,10 +2471,11 @@
|
|
|
2454
2471
|
const [name$15] = createNamespace("calendar-month");
|
|
2455
2472
|
const calendarMonthProps = {
|
|
2456
2473
|
date: makeRequiredProp(Date),
|
|
2474
|
+
showType: makeStringProp("inline"),
|
|
2457
2475
|
type: String,
|
|
2458
2476
|
color: String,
|
|
2459
|
-
minDate:
|
|
2460
|
-
maxDate:
|
|
2477
|
+
minDate: Date,
|
|
2478
|
+
maxDate: Date,
|
|
2461
2479
|
showMark: Boolean,
|
|
2462
2480
|
rowHeight: numericProp,
|
|
2463
2481
|
formatter: Function,
|
|
@@ -2466,7 +2484,8 @@
|
|
|
2466
2484
|
allowSameDay: Boolean,
|
|
2467
2485
|
showSubtitle: Boolean,
|
|
2468
2486
|
showMonthTitle: Boolean,
|
|
2469
|
-
firstDayOfWeek: Number
|
|
2487
|
+
firstDayOfWeek: Number,
|
|
2488
|
+
disabledDate: Function
|
|
2470
2489
|
};
|
|
2471
2490
|
var stdin_default$1t = vue.defineComponent({
|
|
2472
2491
|
name: name$15,
|
|
@@ -2493,6 +2512,7 @@
|
|
|
2493
2512
|
const totalDay = vue.computed(() => getMonthEndDay2(props.date.getFullYear(), props.date.getMonth() + 1));
|
|
2494
2513
|
const shouldRender = vue.computed(() => visible.value || !props.lazyRender);
|
|
2495
2514
|
const getTitle = () => title.value;
|
|
2515
|
+
const getDate = () => props.date;
|
|
2496
2516
|
const getMultipleDayType = (day) => {
|
|
2497
2517
|
const isSelected = (date) => props.currentDate.some((item) => compareDay(item, date) === 0);
|
|
2498
2518
|
if (isSelected(day)) {
|
|
@@ -2537,18 +2557,22 @@
|
|
|
2537
2557
|
}
|
|
2538
2558
|
return "";
|
|
2539
2559
|
};
|
|
2540
|
-
const getDayType = (day) => {
|
|
2560
|
+
const getDayType = (day, defaultType) => {
|
|
2541
2561
|
const {
|
|
2542
2562
|
type,
|
|
2543
2563
|
minDate,
|
|
2544
2564
|
maxDate,
|
|
2545
|
-
currentDate
|
|
2565
|
+
currentDate,
|
|
2566
|
+
disabledDate
|
|
2546
2567
|
} = props;
|
|
2547
|
-
if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
|
|
2568
|
+
if (minDate && compareDay(day, minDate) < 0 || maxDate && compareDay(day, maxDate) > 0 || disabledDate && disabledDate(day)) {
|
|
2548
2569
|
return "disabled";
|
|
2549
2570
|
}
|
|
2550
2571
|
if (currentDate === null) {
|
|
2551
|
-
return "";
|
|
2572
|
+
return defaultType || "";
|
|
2573
|
+
}
|
|
2574
|
+
if (defaultType) {
|
|
2575
|
+
return defaultType;
|
|
2552
2576
|
}
|
|
2553
2577
|
if (Array.isArray(currentDate)) {
|
|
2554
2578
|
if (type === "multiple") {
|
|
@@ -2589,6 +2613,22 @@
|
|
|
2589
2613
|
const days2 = [];
|
|
2590
2614
|
const year = props.date.getFullYear();
|
|
2591
2615
|
const month = props.date.getMonth();
|
|
2616
|
+
if (props.showType && props.showType === "inline") {
|
|
2617
|
+
for (let day = offset2.value - 1; day >= 0; day--) {
|
|
2618
|
+
const date = new Date(year, month, -day);
|
|
2619
|
+
const type = getDayType(date, "preview");
|
|
2620
|
+
let config = {
|
|
2621
|
+
date,
|
|
2622
|
+
type,
|
|
2623
|
+
text: date.getDate(),
|
|
2624
|
+
bottomInfo: getBottomInfo(type)
|
|
2625
|
+
};
|
|
2626
|
+
if (props.formatter) {
|
|
2627
|
+
config = props.formatter(config);
|
|
2628
|
+
}
|
|
2629
|
+
days2.push(config);
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2592
2632
|
for (let day = 1; day <= totalDay.value; day++) {
|
|
2593
2633
|
const date = new Date(year, month, day);
|
|
2594
2634
|
const type = getDayType(date);
|
|
@@ -2603,6 +2643,23 @@
|
|
|
2603
2643
|
}
|
|
2604
2644
|
days2.push(config);
|
|
2605
2645
|
}
|
|
2646
|
+
if (props.showType && props.showType === "inline" && days2 && days2.length < 42) {
|
|
2647
|
+
const nextMonthsLength = days2.length;
|
|
2648
|
+
for (let day = 1; day <= 42 - nextMonthsLength; day++) {
|
|
2649
|
+
const date = new Date(year, month + 1, day);
|
|
2650
|
+
const type = getDayType(date, "preview");
|
|
2651
|
+
let config = {
|
|
2652
|
+
date,
|
|
2653
|
+
type,
|
|
2654
|
+
text: date.getDate(),
|
|
2655
|
+
bottomInfo: getBottomInfo(type)
|
|
2656
|
+
};
|
|
2657
|
+
if (props.formatter) {
|
|
2658
|
+
config = props.formatter(config);
|
|
2659
|
+
}
|
|
2660
|
+
days2.push(config);
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2606
2663
|
return days2;
|
|
2607
2664
|
});
|
|
2608
2665
|
const disabledDays = vue.computed(() => days.value.filter((day) => day.type === "disabled"));
|
|
@@ -2630,6 +2687,7 @@
|
|
|
2630
2687
|
}, [(shouldRender.value ? days : placeholders).value.map(renderDay)]);
|
|
2631
2688
|
useExpose({
|
|
2632
2689
|
getTitle,
|
|
2690
|
+
getDate,
|
|
2633
2691
|
getHeight: () => height2.value,
|
|
2634
2692
|
setVisible,
|
|
2635
2693
|
scrollToDate,
|
|
@@ -2649,9 +2707,13 @@
|
|
|
2649
2707
|
subtitle: String,
|
|
2650
2708
|
showTitle: Boolean,
|
|
2651
2709
|
showSubtitle: Boolean,
|
|
2652
|
-
firstDayOfWeek: makeNumberProp(1)
|
|
2710
|
+
firstDayOfWeek: makeNumberProp(1),
|
|
2711
|
+
yearPreEnable: Boolean,
|
|
2712
|
+
monthPreEnable: Boolean,
|
|
2713
|
+
yearNextEnable: Boolean,
|
|
2714
|
+
monthNextEnable: Boolean
|
|
2653
2715
|
},
|
|
2654
|
-
emits: ["clickSubtitle"],
|
|
2716
|
+
emits: ["clickSubtitle", "clickPreIcon", "clickNextIcon"],
|
|
2655
2717
|
setup(props, {
|
|
2656
2718
|
slots,
|
|
2657
2719
|
emit
|
|
@@ -2666,13 +2728,111 @@
|
|
|
2666
2728
|
}
|
|
2667
2729
|
};
|
|
2668
2730
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
|
2731
|
+
const onClickPreIcon = (isMonth, isYear) => () => {
|
|
2732
|
+
if (isMonth && !props.monthPreEnable || isYear && !props.yearPreEnable) {
|
|
2733
|
+
return;
|
|
2734
|
+
}
|
|
2735
|
+
emit("clickPreIcon", isMonth, isYear);
|
|
2736
|
+
};
|
|
2737
|
+
const onClickNextIcon = (isMonth, isYear) => () => {
|
|
2738
|
+
if (isMonth && !props.monthNextEnable || isYear && !props.yearNextEnable) {
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
emit("clickNextIcon", isMonth, isYear);
|
|
2742
|
+
};
|
|
2743
|
+
const fastForwardImg = () => vue.createVNode("svg", {
|
|
2744
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2745
|
+
"width": "16px",
|
|
2746
|
+
"height": "16px",
|
|
2747
|
+
"viewBox": "0 0 16 16",
|
|
2748
|
+
"version": "1.1"
|
|
2749
|
+
}, [vue.createVNode("g", {
|
|
2750
|
+
"stroke": "none",
|
|
2751
|
+
"stroke-width": "1",
|
|
2752
|
+
"fill": "none",
|
|
2753
|
+
"fill-rule": "evenodd"
|
|
2754
|
+
}, [vue.createVNode("g", {
|
|
2755
|
+
"transform": "translate(-32.000000, -320.000000)",
|
|
2756
|
+
"fill": "#0091FA",
|
|
2757
|
+
"fill-rule": "nonzero"
|
|
2758
|
+
}, [vue.createVNode("g", {
|
|
2759
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2760
|
+
}, [vue.createVNode("g", {
|
|
2761
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2762
|
+
}, [vue.createVNode("g", {
|
|
2763
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2764
|
+
}, [vue.createVNode("g", {
|
|
2765
|
+
"transform": "translate(8.000000, 10.000000) scale(-1, 1) translate(-8.000000, -10.000000) translate(0.000000, 2.000000)"
|
|
2766
|
+
}, [vue.createVNode("g", {
|
|
2767
|
+
"transform": "translate(0.500000, 2.000000)"
|
|
2768
|
+
}, [vue.createVNode("path", {
|
|
2769
|
+
"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",
|
|
2770
|
+
"opacity": "0.3",
|
|
2771
|
+
"transform": "translate(2.884615, 5.769231) rotate(-90.000000) translate(-2.884615, -5.769231) "
|
|
2772
|
+
}, null), vue.createVNode("path", {
|
|
2773
|
+
"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",
|
|
2774
|
+
"opacity": "0.8",
|
|
2775
|
+
"transform": "translate(6.923077, 5.769231) rotate(-90.000000) translate(-6.923077, -5.769231) "
|
|
2776
|
+
}, null), vue.createVNode("path", {
|
|
2777
|
+
"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",
|
|
2778
|
+
"opacity": "0.8",
|
|
2779
|
+
"transform": "translate(11.538462, 5.769231) rotate(-90.000000) translate(-11.538462, -5.769231) "
|
|
2780
|
+
}, null)])])])])])])])]);
|
|
2781
|
+
const slowForward = () => vue.createVNode("svg", {
|
|
2782
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2783
|
+
"width": "16px",
|
|
2784
|
+
"height": "16px",
|
|
2785
|
+
"viewBox": "0 0 16 16",
|
|
2786
|
+
"version": "1.1"
|
|
2787
|
+
}, [vue.createVNode("g", {
|
|
2788
|
+
"stroke": "none",
|
|
2789
|
+
"stroke-width": "1",
|
|
2790
|
+
"fill": "none",
|
|
2791
|
+
"fill-rule": "evenodd"
|
|
2792
|
+
}, [vue.createVNode("g", {
|
|
2793
|
+
"transform": "translate(-80.000000, -320.000000)",
|
|
2794
|
+
"fill": "#0091FA",
|
|
2795
|
+
"fill-rule": "nonzero"
|
|
2796
|
+
}, [vue.createVNode("g", {
|
|
2797
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2798
|
+
}, [vue.createVNode("g", {
|
|
2799
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2800
|
+
}, [vue.createVNode("g", {
|
|
2801
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2802
|
+
}, [vue.createVNode("g", {
|
|
2803
|
+
"transform": "translate(56.000000, 10.000000) scale(-1, 1) translate(-56.000000, -10.000000) translate(48.000000, 2.000000)"
|
|
2804
|
+
}, [vue.createVNode("g", {
|
|
2805
|
+
"transform": "translate(3.000000, 2.000000)"
|
|
2806
|
+
}, [vue.createVNode("path", {
|
|
2807
|
+
"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",
|
|
2808
|
+
"opacity": "0.3",
|
|
2809
|
+
"transform": "translate(3.000000, 6.000000) rotate(-90.000000) translate(-3.000000, -6.000000) "
|
|
2810
|
+
}, null), vue.createVNode("path", {
|
|
2811
|
+
"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",
|
|
2812
|
+
"opacity": "0.8",
|
|
2813
|
+
"transform": "translate(7.200000, 6.000000) rotate(-90.000000) translate(-7.200000, -6.000000) "
|
|
2814
|
+
}, null)])])])])])])])]);
|
|
2669
2815
|
const renderSubtitle = () => {
|
|
2670
2816
|
if (props.showSubtitle) {
|
|
2671
2817
|
const title = slots.subtitle ? slots.subtitle() : props.subtitle;
|
|
2672
2818
|
return vue.createVNode("div", {
|
|
2673
|
-
"class": bem$15("header-subtitle")
|
|
2819
|
+
"class": bem$15("header-subtitle")
|
|
2820
|
+
}, [vue.createVNode("div", {
|
|
2821
|
+
"class": bem$15("header-subtitle", ["opt", props.yearPreEnable ? "enable" : "unenable"]),
|
|
2822
|
+
"onClick": onClickPreIcon(false, true)
|
|
2823
|
+
}, [fastForwardImg()]), vue.createVNode("div", {
|
|
2824
|
+
"class": bem$15("header-subtitle", ["opt", props.monthPreEnable ? "enable" : "unenable"]),
|
|
2825
|
+
"onClick": onClickPreIcon(true, false)
|
|
2826
|
+
}, [slowForward()]), vue.createVNode("label", {
|
|
2827
|
+
"class": bem$15("header-subtitle-text"),
|
|
2674
2828
|
"onClick": onClickSubtitle
|
|
2675
|
-
}, [title])
|
|
2829
|
+
}, [title]), vue.createVNode("div", {
|
|
2830
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.monthNextEnable ? "enable" : "unenable"]]),
|
|
2831
|
+
"onClick": onClickNextIcon(true, false)
|
|
2832
|
+
}, [slowForward()]), vue.createVNode("div", {
|
|
2833
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.yearNextEnable ? "enable" : "unenable"]]),
|
|
2834
|
+
"onClick": onClickNextIcon(false, true)
|
|
2835
|
+
}, [fastForwardImg()])]);
|
|
2676
2836
|
}
|
|
2677
2837
|
};
|
|
2678
2838
|
const renderWeekDays = () => {
|
|
@@ -2694,6 +2854,7 @@
|
|
|
2694
2854
|
});
|
|
2695
2855
|
const calendarProps = {
|
|
2696
2856
|
show: Boolean,
|
|
2857
|
+
showType: makeStringProp("inline"),
|
|
2697
2858
|
type: makeStringProp("single"),
|
|
2698
2859
|
title: String,
|
|
2699
2860
|
color: String,
|
|
@@ -2720,24 +2881,14 @@
|
|
|
2720
2881
|
closeOnClickOverlay: truthProp,
|
|
2721
2882
|
safeAreaInsetTop: Boolean,
|
|
2722
2883
|
safeAreaInsetBottom: truthProp,
|
|
2723
|
-
minDate:
|
|
2724
|
-
|
|
2725
|
-
validator: isDate,
|
|
2726
|
-
default: getToday
|
|
2727
|
-
},
|
|
2728
|
-
maxDate: {
|
|
2729
|
-
type: Date,
|
|
2730
|
-
validator: isDate,
|
|
2731
|
-
default: () => {
|
|
2732
|
-
const now = getToday();
|
|
2733
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
|
2734
|
-
}
|
|
2735
|
-
},
|
|
2884
|
+
minDate: Date,
|
|
2885
|
+
maxDate: Date,
|
|
2736
2886
|
firstDayOfWeek: {
|
|
2737
2887
|
type: numericProp,
|
|
2738
|
-
default:
|
|
2888
|
+
default: 1,
|
|
2739
2889
|
validator: (val) => val >= 0 && val <= 6
|
|
2740
|
-
}
|
|
2890
|
+
},
|
|
2891
|
+
disabledDate: Function
|
|
2741
2892
|
};
|
|
2742
2893
|
var stdin_default$1r = vue.defineComponent({
|
|
2743
2894
|
name: name$18,
|
|
@@ -2747,11 +2898,19 @@
|
|
|
2747
2898
|
emit,
|
|
2748
2899
|
slots
|
|
2749
2900
|
}) {
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2901
|
+
const lastMinDate = vue.computed(() => {
|
|
2902
|
+
const now = new Date();
|
|
2903
|
+
return props.showType !== "inline" && !props.minDate ? new Date(now.getFullYear(), now.getMonth() - 3, now.getDate()) : props.minDate;
|
|
2904
|
+
});
|
|
2905
|
+
const lastMaxDate = vue.computed(() => {
|
|
2906
|
+
const now = new Date();
|
|
2907
|
+
return props.showType !== "inline" && !props.maxDate ? new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()) : props.maxDate;
|
|
2908
|
+
});
|
|
2909
|
+
const limitDateRange = (date, minDate = lastMinDate.value, maxDate = lastMaxDate.value) => {
|
|
2910
|
+
if (minDate && compareDay(date, minDate) === -1) {
|
|
2752
2911
|
return minDate;
|
|
2753
2912
|
}
|
|
2754
|
-
if (compareDay(date, maxDate) === 1) {
|
|
2913
|
+
if (maxDate && compareDay(date, maxDate) === 1) {
|
|
2755
2914
|
return maxDate;
|
|
2756
2915
|
}
|
|
2757
2916
|
return date;
|
|
@@ -2759,10 +2918,10 @@
|
|
|
2759
2918
|
const getInitialDate = (defaultDate = props.defaultDate) => {
|
|
2760
2919
|
const {
|
|
2761
2920
|
type,
|
|
2762
|
-
minDate,
|
|
2763
|
-
maxDate,
|
|
2764
2921
|
allowSameDay
|
|
2765
2922
|
} = props;
|
|
2923
|
+
const minDate = lastMinDate.value;
|
|
2924
|
+
const maxDate = lastMaxDate.value;
|
|
2766
2925
|
if (defaultDate === null) {
|
|
2767
2926
|
return defaultDate;
|
|
2768
2927
|
}
|
|
@@ -2771,8 +2930,8 @@
|
|
|
2771
2930
|
if (!Array.isArray(defaultDate)) {
|
|
2772
2931
|
defaultDate = [];
|
|
2773
2932
|
}
|
|
2774
|
-
const start2 = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
|
|
2775
|
-
const end2 = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
|
|
2933
|
+
const start2 = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : maxDate && getPrevDay(maxDate));
|
|
2934
|
+
const end2 = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : minDate && getNextDay(minDate));
|
|
2776
2935
|
return [start2, end2];
|
|
2777
2936
|
}
|
|
2778
2937
|
if (type === "multiple") {
|
|
@@ -2786,20 +2945,40 @@
|
|
|
2786
2945
|
}
|
|
2787
2946
|
return limitDateRange(defaultDate);
|
|
2788
2947
|
};
|
|
2948
|
+
const getInitialTitleDate = (defaultDate = props.defaultDate) => {
|
|
2949
|
+
const initTitleDate = getInitialDate(defaultDate);
|
|
2950
|
+
const now = getToday();
|
|
2951
|
+
if (Array.isArray(initTitleDate)) {
|
|
2952
|
+
return initTitleDate[0] || now;
|
|
2953
|
+
} else {
|
|
2954
|
+
return initTitleDate || now;
|
|
2955
|
+
}
|
|
2956
|
+
};
|
|
2789
2957
|
let bodyHeight;
|
|
2790
2958
|
const bodyRef = vue.ref();
|
|
2791
2959
|
const subtitle = vue.ref("");
|
|
2792
2960
|
const currentDate = vue.ref(getInitialDate());
|
|
2961
|
+
const titleDate = vue.ref(getInitialTitleDate());
|
|
2793
2962
|
const [monthRefs, setMonthRefs] = useRefs();
|
|
2794
2963
|
const dayOffset = vue.computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
|
2795
2964
|
const months = vue.computed(() => {
|
|
2965
|
+
var _a;
|
|
2796
2966
|
const months2 = [];
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2967
|
+
if (props.showType !== "inline" && lastMinDate.value && lastMaxDate.value) {
|
|
2968
|
+
const cursor = new Date(lastMinDate.value);
|
|
2969
|
+
cursor.setDate(1);
|
|
2970
|
+
do {
|
|
2971
|
+
months2.push(new Date(cursor));
|
|
2972
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
2973
|
+
} while (compareMonth(cursor, lastMaxDate.value) !== 1);
|
|
2974
|
+
} else if (props.showType === "inline") {
|
|
2975
|
+
const temp = (_a = titleDate.value) != null ? _a : cloneDates(titleDate.value);
|
|
2976
|
+
if (!Array.isArray(temp)) {
|
|
2977
|
+
months2.push(getFirstDate(temp));
|
|
2978
|
+
} else {
|
|
2979
|
+
months2.push(getFirstDate(temp[0]));
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2803
2982
|
return months2;
|
|
2804
2983
|
});
|
|
2805
2984
|
const buttonDisabled = vue.computed(() => {
|
|
@@ -2850,6 +3029,7 @@
|
|
|
2850
3029
|
});
|
|
2851
3030
|
if (currentMonth) {
|
|
2852
3031
|
subtitle.value = currentMonth.getTitle();
|
|
3032
|
+
titleDate.value = currentMonth.getDate();
|
|
2853
3033
|
}
|
|
2854
3034
|
};
|
|
2855
3035
|
const scrollToDate = (targetDate) => {
|
|
@@ -2890,6 +3070,7 @@
|
|
|
2890
3070
|
};
|
|
2891
3071
|
const reset = (date = getInitialDate()) => {
|
|
2892
3072
|
currentDate.value = date;
|
|
3073
|
+
titleDate.value = getInitialTitleDate(date);
|
|
2893
3074
|
scrollToCurrentDate();
|
|
2894
3075
|
};
|
|
2895
3076
|
const checkRange = (date) => {
|
|
@@ -2951,6 +3132,9 @@
|
|
|
2951
3132
|
const {
|
|
2952
3133
|
type
|
|
2953
3134
|
} = props;
|
|
3135
|
+
if (item.type === "preview") {
|
|
3136
|
+
titleDate.value = date;
|
|
3137
|
+
}
|
|
2954
3138
|
if (type === "range") {
|
|
2955
3139
|
if (!currentDate.value) {
|
|
2956
3140
|
select([date]);
|
|
@@ -2998,6 +3182,64 @@
|
|
|
2998
3182
|
select(date, true);
|
|
2999
3183
|
}
|
|
3000
3184
|
};
|
|
3185
|
+
const yearPreEnable = vue.computed(() => {
|
|
3186
|
+
if (!lastMinDate.value) {
|
|
3187
|
+
return true;
|
|
3188
|
+
}
|
|
3189
|
+
return titleDate.value.getFullYear() > lastMinDate.value.getFullYear();
|
|
3190
|
+
});
|
|
3191
|
+
const monthPreEnable = vue.computed(() => {
|
|
3192
|
+
if (!lastMinDate.value) {
|
|
3193
|
+
return true;
|
|
3194
|
+
}
|
|
3195
|
+
const targetDate = titleDate.value;
|
|
3196
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
3197
|
+
const minDateYearMonth = getFirstDate(lastMinDate.value);
|
|
3198
|
+
return compareDay(targetYearMonth, minDateYearMonth) === 1;
|
|
3199
|
+
});
|
|
3200
|
+
const yearNextEnable = vue.computed(() => {
|
|
3201
|
+
if (!lastMaxDate.value) {
|
|
3202
|
+
return true;
|
|
3203
|
+
}
|
|
3204
|
+
return titleDate.value.getFullYear() < lastMaxDate.value.getFullYear();
|
|
3205
|
+
});
|
|
3206
|
+
const monthNextEnable = vue.computed(() => {
|
|
3207
|
+
if (!lastMaxDate.value) {
|
|
3208
|
+
return true;
|
|
3209
|
+
}
|
|
3210
|
+
const targetDate = titleDate.value;
|
|
3211
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
3212
|
+
const maxDateYearMonth = getFirstDate(lastMaxDate.value);
|
|
3213
|
+
return compareDay(maxDateYearMonth, targetYearMonth) === 1;
|
|
3214
|
+
});
|
|
3215
|
+
const onClickTitleIcon = (isPreFlag, isMonth, isYear) => {
|
|
3216
|
+
const curTitleDate = titleDate.value;
|
|
3217
|
+
if (curTitleDate) {
|
|
3218
|
+
let targetDate = isPreFlag ? getPrevDate(curTitleDate, isMonth, isYear) : getNextDate(curTitleDate, isMonth, isYear);
|
|
3219
|
+
if (!isDate(targetDate)) {
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3222
|
+
let hasCompared = false;
|
|
3223
|
+
const compareDate = isPreFlag ? lastMinDate.value : lastMaxDate.value;
|
|
3224
|
+
const compareValue = isPreFlag ? 1 : -1;
|
|
3225
|
+
if (compareDate && compareDay(compareDate, targetDate) === compareValue && compareMonth(compareDate, targetDate) === 0) {
|
|
3226
|
+
targetDate = compareDate;
|
|
3227
|
+
hasCompared = true;
|
|
3228
|
+
}
|
|
3229
|
+
if (hasCompared || !compareDate || compareDate && compareDay(compareDate, targetDate) !== compareValue) {
|
|
3230
|
+
scrollToDate(targetDate);
|
|
3231
|
+
titleDate.value = targetDate;
|
|
3232
|
+
}
|
|
3233
|
+
} else {
|
|
3234
|
+
raf(onScroll);
|
|
3235
|
+
}
|
|
3236
|
+
};
|
|
3237
|
+
const onClickPreIcon = (isMonth, isYear) => {
|
|
3238
|
+
onClickTitleIcon(true, isMonth, isYear);
|
|
3239
|
+
};
|
|
3240
|
+
const onClickNextIcon = (isMonth, isYear) => {
|
|
3241
|
+
onClickTitleIcon(false, isMonth, isYear);
|
|
3242
|
+
};
|
|
3001
3243
|
const updateShow = (value) => emit("update:show", value);
|
|
3002
3244
|
const renderMonth = (date, index) => {
|
|
3003
3245
|
const showMonthTitle = index !== 0 || !props.showSubtitle;
|
|
@@ -3007,7 +3249,7 @@
|
|
|
3007
3249
|
"currentDate": currentDate.value,
|
|
3008
3250
|
"showMonthTitle": showMonthTitle,
|
|
3009
3251
|
"firstDayOfWeek": dayOffset.value
|
|
3010
|
-
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
|
3252
|
+
}, pick(props, ["showType", "type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay", "disabledDate"]), {
|
|
3011
3253
|
"onClick": onClickDay
|
|
3012
3254
|
}), pick(slots, ["top-info", "bottom-info"]));
|
|
3013
3255
|
};
|
|
@@ -3057,7 +3299,13 @@
|
|
|
3057
3299
|
"showTitle": props.showTitle,
|
|
3058
3300
|
"showSubtitle": props.showSubtitle,
|
|
3059
3301
|
"firstDayOfWeek": dayOffset.value,
|
|
3060
|
-
"onClickSubtitle": (event) => emit("clickSubtitle", event)
|
|
3302
|
+
"onClickSubtitle": (event) => emit("clickSubtitle", event),
|
|
3303
|
+
"onClickPreIcon": onClickPreIcon,
|
|
3304
|
+
"onClickNextIcon": onClickNextIcon,
|
|
3305
|
+
"yearPreEnable": yearPreEnable.value,
|
|
3306
|
+
"monthPreEnable": monthPreEnable.value,
|
|
3307
|
+
"yearNextEnable": yearNextEnable.value,
|
|
3308
|
+
"monthNextEnable": monthNextEnable.value
|
|
3061
3309
|
}, pick(slots, ["title", "subtitle"])), vue.createVNode("div", {
|
|
3062
3310
|
"ref": bodyRef,
|
|
3063
3311
|
"class": bem$15("body"),
|
|
@@ -3069,6 +3317,11 @@
|
|
|
3069
3317
|
currentDate.value = value;
|
|
3070
3318
|
scrollToCurrentDate();
|
|
3071
3319
|
});
|
|
3320
|
+
vue.watch(titleDate, (newValue) => {
|
|
3321
|
+
if (props.showType === "inline" && newValue) {
|
|
3322
|
+
subtitle.value = formatMonthTitle(newValue);
|
|
3323
|
+
}
|
|
3324
|
+
});
|
|
3072
3325
|
useExpose({
|
|
3073
3326
|
reset,
|
|
3074
3327
|
scrollToDate,
|
|
@@ -4541,7 +4794,7 @@
|
|
|
4541
4794
|
options,
|
|
4542
4795
|
selected
|
|
4543
4796
|
} = tab;
|
|
4544
|
-
const placeholder = props.placeholder || t$6("
|
|
4797
|
+
const placeholder = props.placeholder || t$6("ztCascader.select");
|
|
4545
4798
|
const title = selected ? selected[textKey] : placeholder;
|
|
4546
4799
|
return vue.createVNode(Tab, {
|
|
4547
4800
|
"title": title,
|
|
@@ -6891,6 +7144,7 @@
|
|
|
6891
7144
|
const [name$H, bem$I, t$4] = createNamespace("dialog");
|
|
6892
7145
|
const dialogProps = extend({}, popupSharedProps, {
|
|
6893
7146
|
title: String,
|
|
7147
|
+
primaryHeader: Boolean,
|
|
6894
7148
|
theme: String,
|
|
6895
7149
|
width: numericProp,
|
|
6896
7150
|
message: [String, Function],
|
|
@@ -6968,12 +7222,21 @@
|
|
|
6968
7222
|
const renderTitle = () => {
|
|
6969
7223
|
const title = slots.title ? slots.title() : props.title;
|
|
6970
7224
|
if (title) {
|
|
6971
|
-
return
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
7225
|
+
return (
|
|
7226
|
+
// <div
|
|
7227
|
+
// class={bem(['header', props.titleType, {
|
|
7228
|
+
// isolated: !props.message && !slots.default,
|
|
7229
|
+
// 'custom-title': !!slots.title,
|
|
7230
|
+
// }])}
|
|
7231
|
+
// >
|
|
7232
|
+
vue.createVNode("div", {
|
|
7233
|
+
"class": bem$I("header", {
|
|
7234
|
+
isolated: !props.message && !slots.default,
|
|
7235
|
+
"custom-title": !!slots.title,
|
|
7236
|
+
primary: props.primaryHeader
|
|
7237
|
+
})
|
|
7238
|
+
}, [title])
|
|
7239
|
+
);
|
|
6977
7240
|
}
|
|
6978
7241
|
};
|
|
6979
7242
|
const renderMessage = (hasTitle) => {
|
|
@@ -6982,10 +7245,15 @@
|
|
|
6982
7245
|
allowHtml,
|
|
6983
7246
|
messageAlign
|
|
6984
7247
|
} = props;
|
|
6985
|
-
const
|
|
6986
|
-
"has-title": hasTitle,
|
|
7248
|
+
const mods = {
|
|
6987
7249
|
[messageAlign]: messageAlign
|
|
6988
|
-
}
|
|
7250
|
+
};
|
|
7251
|
+
if (props.primaryHeader) {
|
|
7252
|
+
mods["primary-header"] = props.primaryHeader;
|
|
7253
|
+
} else if (hasTitle) {
|
|
7254
|
+
mods["has-title"] = hasTitle;
|
|
7255
|
+
}
|
|
7256
|
+
const classNames = bem$I("message", mods);
|
|
6989
7257
|
const content = isFunction(message) ? message() : message;
|
|
6990
7258
|
if (allowHtml && typeof content === "string") {
|
|
6991
7259
|
return vue.createVNode("div", {
|
|
@@ -8701,6 +8969,7 @@
|
|
|
8701
8969
|
labelAlign: String,
|
|
8702
8970
|
showWordLimit: Boolean,
|
|
8703
8971
|
errorMessageAlign: String,
|
|
8972
|
+
descriptionClass: unknownProp,
|
|
8704
8973
|
description: makeStringProp(""),
|
|
8705
8974
|
colon: {
|
|
8706
8975
|
type: Boolean,
|
|
@@ -9038,7 +9307,7 @@
|
|
|
9038
9307
|
return;
|
|
9039
9308
|
}
|
|
9040
9309
|
return vue.createVNode("div", {
|
|
9041
|
-
"class": bem$E("description")
|
|
9310
|
+
"class": [bem$E("description"), props.descriptionClass]
|
|
9042
9311
|
}, [props.description]);
|
|
9043
9312
|
};
|
|
9044
9313
|
const showMessage = vue.computed(() => !(form && form.props.showErrorMessage === false) && (props.errorMessage || state.validateMessage));
|
|
@@ -15599,12 +15868,14 @@
|
|
|
15599
15868
|
return __async(this, null, function* () {
|
|
15600
15869
|
var _a;
|
|
15601
15870
|
if (wrapperRef.value && popupRef.value && arrowRef.value) {
|
|
15871
|
+
const popoverEl = popupRef.value;
|
|
15872
|
+
const wrapperEl = wrapperRef.value;
|
|
15602
15873
|
const {
|
|
15603
15874
|
x: x2,
|
|
15604
15875
|
y: y2,
|
|
15605
15876
|
placement: realPlacement,
|
|
15606
15877
|
middlewareData
|
|
15607
|
-
} = yield z(
|
|
15878
|
+
} = yield z(wrapperEl, popoverEl, {
|
|
15608
15879
|
placement: props.placement,
|
|
15609
15880
|
middleware: [D$1(8), k({
|
|
15610
15881
|
padding: 4,
|
|
@@ -15615,11 +15886,7 @@
|
|
|
15615
15886
|
padding: 6
|
|
15616
15887
|
})]
|
|
15617
15888
|
});
|
|
15618
|
-
|
|
15619
|
-
left: `${x2}px`,
|
|
15620
|
-
top: `${y2}px`
|
|
15621
|
-
});
|
|
15622
|
-
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
15889
|
+
let popupTop = y2;
|
|
15623
15890
|
const side = realPlacement.split("-")[0];
|
|
15624
15891
|
const arrowSide = {
|
|
15625
15892
|
top: "bottom",
|
|
@@ -15627,6 +15894,16 @@
|
|
|
15627
15894
|
bottom: "top",
|
|
15628
15895
|
left: "right"
|
|
15629
15896
|
}[side];
|
|
15897
|
+
if (y2 < 0) {
|
|
15898
|
+
popupTop = 0;
|
|
15899
|
+
} else if (y2 > 0 && y2 + popoverEl.offsetHeight > document.body.clientHeight) {
|
|
15900
|
+
popupTop = document.body.clientHeight - popoverEl.offsetHeight;
|
|
15901
|
+
}
|
|
15902
|
+
Object.assign(popupRef.value.style, {
|
|
15903
|
+
left: `${x2}px`,
|
|
15904
|
+
top: `${popupTop}px`
|
|
15905
|
+
});
|
|
15906
|
+
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
15630
15907
|
const {
|
|
15631
15908
|
x: arrowX,
|
|
15632
15909
|
y: arrowY
|
|
@@ -17529,6 +17806,11 @@
|
|
|
17529
17806
|
}
|
|
17530
17807
|
});
|
|
17531
17808
|
const TabbarItem = withInstall(stdin_default$a);
|
|
17809
|
+
var SortOrderEnum = /* @__PURE__ */ ((SortOrderEnum2) => {
|
|
17810
|
+
SortOrderEnum2["ASCEND"] = "ascend";
|
|
17811
|
+
SortOrderEnum2["DESCEND"] = "descend";
|
|
17812
|
+
return SortOrderEnum2;
|
|
17813
|
+
})(SortOrderEnum || {});
|
|
17532
17814
|
const [name$4, bem$4] = createNamespace("table");
|
|
17533
17815
|
const tableProps = {
|
|
17534
17816
|
headList: makeArrayProp(),
|
|
@@ -17551,12 +17833,42 @@
|
|
|
17551
17833
|
var stdin_default$9 = vue.defineComponent({
|
|
17552
17834
|
name: name$4,
|
|
17553
17835
|
props: tableProps,
|
|
17554
|
-
|
|
17555
|
-
|
|
17836
|
+
emits: ["sort"],
|
|
17837
|
+
setup(props, {
|
|
17838
|
+
emit
|
|
17839
|
+
}) {
|
|
17840
|
+
const sortOrder = vue.ref("");
|
|
17841
|
+
const sortKey = vue.ref("");
|
|
17556
17842
|
const fixedColumn = vue.computed(() => props.headList.filter((v2) => v2.fixed));
|
|
17843
|
+
const formatColumns = vue.computed(() => {
|
|
17844
|
+
const columns = [];
|
|
17845
|
+
let left2 = 0;
|
|
17846
|
+
props.headList.forEach((element, index) => {
|
|
17847
|
+
var _a;
|
|
17848
|
+
const column = Object.assign({}, element);
|
|
17849
|
+
const preColumn = props.headList[index - 1];
|
|
17850
|
+
const nextColumn = props.headList[index + 1];
|
|
17851
|
+
if (preColumn) {
|
|
17852
|
+
left2 += Number((_a = preColumn.width) == null ? void 0 : _a.split("px")[0]);
|
|
17853
|
+
column.left = `${left2}px`;
|
|
17854
|
+
} else {
|
|
17855
|
+
column.left = 0;
|
|
17856
|
+
}
|
|
17857
|
+
if (element.fixed && !nextColumn.fixed) {
|
|
17858
|
+
column.lastFixLeft = true;
|
|
17859
|
+
}
|
|
17860
|
+
columns.push(column);
|
|
17861
|
+
});
|
|
17862
|
+
return columns;
|
|
17863
|
+
});
|
|
17864
|
+
const pingedLeft = vue.ref(false);
|
|
17557
17865
|
const resortHeadList = vue.computed(() => fixedColumn.value.concat(props.headList.filter((v2) => !v2.fixed)));
|
|
17558
17866
|
vue.onMounted(() => {
|
|
17559
17867
|
const fixedIndexList = props.headList.map((v2, i2) => {
|
|
17868
|
+
if (v2.sorter && v2.defaultSortOrder) {
|
|
17869
|
+
sortOrder.value = v2.defaultSortOrder || "";
|
|
17870
|
+
sortKey.value = v2.key;
|
|
17871
|
+
}
|
|
17560
17872
|
if (v2.fixed) {
|
|
17561
17873
|
return `tableHead${i2}`;
|
|
17562
17874
|
} else {
|
|
@@ -17573,31 +17885,86 @@
|
|
|
17573
17885
|
}, 0);
|
|
17574
17886
|
}
|
|
17575
17887
|
});
|
|
17576
|
-
const
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17888
|
+
const getNextSortOrder = (type) => {
|
|
17889
|
+
if (!type) {
|
|
17890
|
+
return SortOrderEnum.ASCEND;
|
|
17891
|
+
} else if (type === SortOrderEnum.ASCEND) {
|
|
17892
|
+
return SortOrderEnum.DESCEND;
|
|
17580
17893
|
} else {
|
|
17581
|
-
|
|
17894
|
+
return "";
|
|
17582
17895
|
}
|
|
17583
17896
|
};
|
|
17584
|
-
const
|
|
17585
|
-
if (
|
|
17586
|
-
|
|
17897
|
+
const onHeaderClick = (data) => {
|
|
17898
|
+
if (!data.sorter)
|
|
17899
|
+
return;
|
|
17900
|
+
sortOrder.value = getNextSortOrder(data.key === sortKey.value ? sortOrder.value : "");
|
|
17901
|
+
sortKey.value = data.key;
|
|
17902
|
+
emit("sort", {
|
|
17903
|
+
order: sortOrder.value,
|
|
17904
|
+
key: data.key
|
|
17905
|
+
});
|
|
17906
|
+
};
|
|
17907
|
+
const onScroll = (event) => {
|
|
17908
|
+
const {
|
|
17909
|
+
scrollLeft,
|
|
17910
|
+
currentTarget
|
|
17911
|
+
} = event;
|
|
17912
|
+
const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget == null ? void 0 : currentTarget.scrollLeft;
|
|
17913
|
+
pingedLeft.value = mergedScrollLeft > 0;
|
|
17914
|
+
};
|
|
17915
|
+
const getHead = (colData) => {
|
|
17916
|
+
if ((colData == null ? void 0 : colData.colSpan) !== 0) {
|
|
17917
|
+
return vue.createVNode("th", {
|
|
17918
|
+
"class": bem$4("left", {
|
|
17919
|
+
fixed: colData.fixed,
|
|
17920
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
17921
|
+
}),
|
|
17922
|
+
"style": {
|
|
17923
|
+
left: colData.fixed ? colData.left : ""
|
|
17924
|
+
},
|
|
17925
|
+
"colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
|
|
17926
|
+
}, [vue.createVNode("div", {
|
|
17927
|
+
"class": bem$4("head"),
|
|
17928
|
+
"onClick": () => onHeaderClick(colData)
|
|
17929
|
+
}, [vue.createVNode("span", {
|
|
17930
|
+
"class": bem$4("head-label")
|
|
17931
|
+
}, [colData.label]), colData.sorter ? vue.createVNode("span", {
|
|
17932
|
+
"class": bem$4("head-sort")
|
|
17933
|
+
}, [vue.createVNode(Icon, {
|
|
17934
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.ASCEND ? bem$4("sort-active") : ""],
|
|
17935
|
+
"name": "spinner-shrink",
|
|
17936
|
+
"size": "12",
|
|
17937
|
+
"style": {
|
|
17938
|
+
marginBottom: "-3px"
|
|
17939
|
+
}
|
|
17940
|
+
}, null), vue.createVNode(Icon, {
|
|
17941
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.DESCEND ? bem$4("sort-active") : ""],
|
|
17942
|
+
"name": "spinner-expand",
|
|
17943
|
+
"size": "12",
|
|
17944
|
+
"style": {
|
|
17945
|
+
marginTop: "-3px"
|
|
17946
|
+
}
|
|
17947
|
+
}, null)]) : ""])]);
|
|
17587
17948
|
}
|
|
17588
17949
|
};
|
|
17589
|
-
const
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17594
|
-
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17950
|
+
const getBody = (rowData, rowIndex) => vue.createVNode("tr", null, [formatColumns.value.map((colData) => {
|
|
17951
|
+
let additionalCellProps;
|
|
17952
|
+
if (colData.customCell) {
|
|
17953
|
+
additionalCellProps = colData.customCell(rowData, rowIndex);
|
|
17954
|
+
}
|
|
17955
|
+
const style = Object.assign({}, colData.style);
|
|
17956
|
+
style.left = colData.fixed ? colData.left : "";
|
|
17957
|
+
return (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 0 && (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 0 && vue.createVNode("td", {
|
|
17958
|
+
"onClick": () => colData.click && colData.click(rowData, rowIndex),
|
|
17959
|
+
"class": bem$4("left", {
|
|
17960
|
+
fixed: colData.fixed,
|
|
17961
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
17962
|
+
}),
|
|
17963
|
+
"colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
|
|
17964
|
+
"rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
|
|
17965
|
+
"style": style
|
|
17966
|
+
}, [rowData[colData.key]]);
|
|
17967
|
+
})]);
|
|
17601
17968
|
const getCol = () => {
|
|
17602
17969
|
const cols = [];
|
|
17603
17970
|
const col = resortHeadList.value.length;
|
|
@@ -17628,16 +17995,20 @@
|
|
|
17628
17995
|
})
|
|
17629
17996
|
}, [getLoadingColumn()]) : vue.createVNode("div", {
|
|
17630
17997
|
"class": bem$4({
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
"class": bem$4("normal-box"),
|
|
17998
|
+
fixed: fixedColumn.value.length > 0,
|
|
17999
|
+
bordered: props.border,
|
|
18000
|
+
striped: props.striped
|
|
18001
|
+
}),
|
|
17636
18002
|
"onScroll": onScroll
|
|
17637
|
-
}, [
|
|
17638
|
-
"
|
|
17639
|
-
|
|
17640
|
-
|
|
18003
|
+
}, [vue.createVNode("table", null, [vue.createVNode("colgroup", null, [props.headList.map((item) => vue.createVNode("col", {
|
|
18004
|
+
"style": {
|
|
18005
|
+
width: item.width
|
|
18006
|
+
}
|
|
18007
|
+
}, null))]), vue.createVNode("thead", {
|
|
18008
|
+
"class": bem$4("thead")
|
|
18009
|
+
}, [vue.createVNode("tr", null, [formatColumns.value.map((colData) => getHead(colData))])]), vue.createVNode("tbody", {
|
|
18010
|
+
"class": bem$4("tbody")
|
|
18011
|
+
}, [props.dataList.map((rowData, rowIndex) => getBody(rowData, rowIndex))])])]);
|
|
17641
18012
|
}
|
|
17642
18013
|
});
|
|
17643
18014
|
const Table = withInstall(stdin_default$9);
|
|
@@ -17653,6 +18024,7 @@
|
|
|
17653
18024
|
borderColor: String,
|
|
17654
18025
|
closeable: Boolean,
|
|
17655
18026
|
icon: String,
|
|
18027
|
+
image: String,
|
|
17656
18028
|
iconPrefix: String,
|
|
17657
18029
|
iconColor: String,
|
|
17658
18030
|
badge: Boolean,
|
|
@@ -17715,27 +18087,33 @@
|
|
|
17715
18087
|
"class": [bem$3("close"), HAPTICS_FEEDBACK],
|
|
17716
18088
|
"onClick": onClose
|
|
17717
18089
|
}, null);
|
|
17718
|
-
const LeftIcon =
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
18090
|
+
const LeftIcon = () => {
|
|
18091
|
+
if (props.image) {
|
|
18092
|
+
return vue.createVNode(stdin_default$1z, {
|
|
18093
|
+
"class": bem$3("image"),
|
|
18094
|
+
"src": props.image
|
|
18095
|
+
}, null);
|
|
18096
|
+
} else if (props.icon) {
|
|
18097
|
+
return vue.createVNode(Icon, {
|
|
18098
|
+
"name": props.icon,
|
|
18099
|
+
"class": bem$3("icon"),
|
|
18100
|
+
"classPrefix": props.iconPrefix,
|
|
18101
|
+
"style": {
|
|
18102
|
+
color: props.iconColor
|
|
18103
|
+
}
|
|
18104
|
+
}, null);
|
|
17724
18105
|
}
|
|
17725
|
-
}
|
|
18106
|
+
};
|
|
17726
18107
|
return vue.createVNode("span", {
|
|
17727
18108
|
"style": getStyle(),
|
|
17728
18109
|
"class": bem$3([classes, type])
|
|
17729
|
-
}, [LeftIcon, (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
17730
|
-
};
|
|
17731
|
-
const getStampStyle = () => {
|
|
17732
|
-
const style = {
|
|
17733
|
-
color: props.color || props.textColor,
|
|
17734
|
-
width: props.stampDiameter + "px",
|
|
17735
|
-
height: props.stampDiameter + "px"
|
|
17736
|
-
};
|
|
17737
|
-
return style;
|
|
18110
|
+
}, [LeftIcon(), (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
17738
18111
|
};
|
|
18112
|
+
const getStampStyle = () => ({
|
|
18113
|
+
color: props.color || props.textColor,
|
|
18114
|
+
width: props.stampDiameter + "px",
|
|
18115
|
+
height: props.stampDiameter + "px"
|
|
18116
|
+
});
|
|
17739
18117
|
const renderStampTag = () => {
|
|
17740
18118
|
var _a;
|
|
17741
18119
|
const {
|