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.cjs.js
CHANGED
|
@@ -1726,8 +1726,9 @@ var stdin_default$1x = vue.defineComponent({
|
|
|
1726
1726
|
});
|
|
1727
1727
|
const Button = withInstall(stdin_default$1x);
|
|
1728
1728
|
var stdin_default$1w = Button;
|
|
1729
|
+
const monthsOfYear = 12;
|
|
1729
1730
|
const [name$18, bem$15, t$6] = createNamespace("calendar");
|
|
1730
|
-
const formatMonthTitle = (date) => t$6("
|
|
1731
|
+
const formatMonthTitle = (date) => t$6("ztCalendar.monthTitle", date.getFullYear(), date.getMonth() + 1);
|
|
1731
1732
|
function compareMonth(date1, date2) {
|
|
1732
1733
|
const year1 = date1.getFullYear();
|
|
1733
1734
|
const year2 = date2.getFullYear();
|
|
@@ -1749,9 +1750,20 @@ function compareDay(day1, day2) {
|
|
|
1749
1750
|
}
|
|
1750
1751
|
const cloneDate = (date) => new Date(date);
|
|
1751
1752
|
const cloneDates = (dates) => Array.isArray(dates) ? dates.map(cloneDate) : cloneDate(dates);
|
|
1752
|
-
function getDayByOffset(date, offset) {
|
|
1753
|
+
function getDayByOffset(date, offset, isMonth, isYear) {
|
|
1753
1754
|
const cloned = cloneDate(date);
|
|
1754
|
-
|
|
1755
|
+
if (isYear) {
|
|
1756
|
+
cloned.setFullYear(cloned.getFullYear() + offset);
|
|
1757
|
+
} else if (isMonth) {
|
|
1758
|
+
cloned.setMonth(cloned.getMonth() + offset);
|
|
1759
|
+
const multiplier = cloned.getFullYear() - date.getFullYear();
|
|
1760
|
+
const setLastDate = date.getMonth() + offset !== cloned.getMonth() + multiplier * monthsOfYear;
|
|
1761
|
+
if (setLastDate) {
|
|
1762
|
+
cloned.setDate(0);
|
|
1763
|
+
}
|
|
1764
|
+
} else {
|
|
1765
|
+
cloned.setDate(cloned.getDate() + offset);
|
|
1766
|
+
}
|
|
1755
1767
|
return cloned;
|
|
1756
1768
|
}
|
|
1757
1769
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
|
@@ -1761,11 +1773,16 @@ const getToday = () => {
|
|
|
1761
1773
|
today.setHours(0, 0, 0, 0);
|
|
1762
1774
|
return today;
|
|
1763
1775
|
};
|
|
1776
|
+
const getPrevDate = (date, isMonth, isYear) => getDayByOffset(date, -1, isMonth, isYear);
|
|
1777
|
+
const getNextDate = (date, isMonth, isYear) => getDayByOffset(date, 1, isMonth, isYear);
|
|
1764
1778
|
function calcDateNum(date) {
|
|
1765
1779
|
const day1 = date[0].getTime();
|
|
1766
1780
|
const day2 = date[1].getTime();
|
|
1767
1781
|
return (day2 - day1) / (1e3 * 60 * 60 * 24) + 1;
|
|
1768
1782
|
}
|
|
1783
|
+
function getFirstDate(date) {
|
|
1784
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1785
|
+
}
|
|
1769
1786
|
function useRefs() {
|
|
1770
1787
|
const refs = vue.ref([]);
|
|
1771
1788
|
const cache = [];
|
|
@@ -2110,7 +2127,7 @@ var stdin_default$1u = vue.defineComponent({
|
|
|
2110
2127
|
style2.width = "100%";
|
|
2111
2128
|
return style2;
|
|
2112
2129
|
}
|
|
2113
|
-
if (index === 0) {
|
|
2130
|
+
if (index === 0 && item.text && +item.text === 1) {
|
|
2114
2131
|
style2.marginLeft = `${100 * offset / 7}%`;
|
|
2115
2132
|
}
|
|
2116
2133
|
if (color) {
|
|
@@ -2184,10 +2201,11 @@ var stdin_default$1u = vue.defineComponent({
|
|
|
2184
2201
|
const [name$15] = createNamespace("calendar-month");
|
|
2185
2202
|
const calendarMonthProps = {
|
|
2186
2203
|
date: makeRequiredProp(Date),
|
|
2204
|
+
showType: makeStringProp("inline"),
|
|
2187
2205
|
type: String,
|
|
2188
2206
|
color: String,
|
|
2189
|
-
minDate:
|
|
2190
|
-
maxDate:
|
|
2207
|
+
minDate: Date,
|
|
2208
|
+
maxDate: Date,
|
|
2191
2209
|
showMark: Boolean,
|
|
2192
2210
|
rowHeight: numericProp,
|
|
2193
2211
|
formatter: Function,
|
|
@@ -2196,7 +2214,8 @@ const calendarMonthProps = {
|
|
|
2196
2214
|
allowSameDay: Boolean,
|
|
2197
2215
|
showSubtitle: Boolean,
|
|
2198
2216
|
showMonthTitle: Boolean,
|
|
2199
|
-
firstDayOfWeek: Number
|
|
2217
|
+
firstDayOfWeek: Number,
|
|
2218
|
+
disabledDate: Function
|
|
2200
2219
|
};
|
|
2201
2220
|
var stdin_default$1t = vue.defineComponent({
|
|
2202
2221
|
name: name$15,
|
|
@@ -2223,6 +2242,7 @@ var stdin_default$1t = vue.defineComponent({
|
|
|
2223
2242
|
const totalDay = vue.computed(() => getMonthEndDay2(props.date.getFullYear(), props.date.getMonth() + 1));
|
|
2224
2243
|
const shouldRender = vue.computed(() => visible.value || !props.lazyRender);
|
|
2225
2244
|
const getTitle = () => title.value;
|
|
2245
|
+
const getDate = () => props.date;
|
|
2226
2246
|
const getMultipleDayType = (day) => {
|
|
2227
2247
|
const isSelected = (date) => props.currentDate.some((item) => compareDay(item, date) === 0);
|
|
2228
2248
|
if (isSelected(day)) {
|
|
@@ -2267,18 +2287,22 @@ var stdin_default$1t = vue.defineComponent({
|
|
|
2267
2287
|
}
|
|
2268
2288
|
return "";
|
|
2269
2289
|
};
|
|
2270
|
-
const getDayType = (day) => {
|
|
2290
|
+
const getDayType = (day, defaultType) => {
|
|
2271
2291
|
const {
|
|
2272
2292
|
type,
|
|
2273
2293
|
minDate,
|
|
2274
2294
|
maxDate,
|
|
2275
|
-
currentDate
|
|
2295
|
+
currentDate,
|
|
2296
|
+
disabledDate
|
|
2276
2297
|
} = props;
|
|
2277
|
-
if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
|
|
2298
|
+
if (minDate && compareDay(day, minDate) < 0 || maxDate && compareDay(day, maxDate) > 0 || disabledDate && disabledDate(day)) {
|
|
2278
2299
|
return "disabled";
|
|
2279
2300
|
}
|
|
2280
2301
|
if (currentDate === null) {
|
|
2281
|
-
return "";
|
|
2302
|
+
return defaultType || "";
|
|
2303
|
+
}
|
|
2304
|
+
if (defaultType) {
|
|
2305
|
+
return defaultType;
|
|
2282
2306
|
}
|
|
2283
2307
|
if (Array.isArray(currentDate)) {
|
|
2284
2308
|
if (type === "multiple") {
|
|
@@ -2319,6 +2343,22 @@ var stdin_default$1t = vue.defineComponent({
|
|
|
2319
2343
|
const days2 = [];
|
|
2320
2344
|
const year = props.date.getFullYear();
|
|
2321
2345
|
const month = props.date.getMonth();
|
|
2346
|
+
if (props.showType && props.showType === "inline") {
|
|
2347
|
+
for (let day = offset.value - 1; day >= 0; day--) {
|
|
2348
|
+
const date = new Date(year, month, -day);
|
|
2349
|
+
const type = getDayType(date, "preview");
|
|
2350
|
+
let config = {
|
|
2351
|
+
date,
|
|
2352
|
+
type,
|
|
2353
|
+
text: date.getDate(),
|
|
2354
|
+
bottomInfo: getBottomInfo(type)
|
|
2355
|
+
};
|
|
2356
|
+
if (props.formatter) {
|
|
2357
|
+
config = props.formatter(config);
|
|
2358
|
+
}
|
|
2359
|
+
days2.push(config);
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2322
2362
|
for (let day = 1; day <= totalDay.value; day++) {
|
|
2323
2363
|
const date = new Date(year, month, day);
|
|
2324
2364
|
const type = getDayType(date);
|
|
@@ -2333,6 +2373,23 @@ var stdin_default$1t = vue.defineComponent({
|
|
|
2333
2373
|
}
|
|
2334
2374
|
days2.push(config);
|
|
2335
2375
|
}
|
|
2376
|
+
if (props.showType && props.showType === "inline" && days2 && days2.length < 42) {
|
|
2377
|
+
const nextMonthsLength = days2.length;
|
|
2378
|
+
for (let day = 1; day <= 42 - nextMonthsLength; day++) {
|
|
2379
|
+
const date = new Date(year, month + 1, day);
|
|
2380
|
+
const type = getDayType(date, "preview");
|
|
2381
|
+
let config = {
|
|
2382
|
+
date,
|
|
2383
|
+
type,
|
|
2384
|
+
text: date.getDate(),
|
|
2385
|
+
bottomInfo: getBottomInfo(type)
|
|
2386
|
+
};
|
|
2387
|
+
if (props.formatter) {
|
|
2388
|
+
config = props.formatter(config);
|
|
2389
|
+
}
|
|
2390
|
+
days2.push(config);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2336
2393
|
return days2;
|
|
2337
2394
|
});
|
|
2338
2395
|
const disabledDays = vue.computed(() => days.value.filter((day) => day.type === "disabled"));
|
|
@@ -2360,6 +2417,7 @@ var stdin_default$1t = vue.defineComponent({
|
|
|
2360
2417
|
}, [(shouldRender.value ? days : placeholders).value.map(renderDay)]);
|
|
2361
2418
|
useExpose({
|
|
2362
2419
|
getTitle,
|
|
2420
|
+
getDate,
|
|
2363
2421
|
getHeight: () => height.value,
|
|
2364
2422
|
setVisible,
|
|
2365
2423
|
scrollToDate,
|
|
@@ -2379,9 +2437,13 @@ var stdin_default$1s = vue.defineComponent({
|
|
|
2379
2437
|
subtitle: String,
|
|
2380
2438
|
showTitle: Boolean,
|
|
2381
2439
|
showSubtitle: Boolean,
|
|
2382
|
-
firstDayOfWeek: makeNumberProp(1)
|
|
2440
|
+
firstDayOfWeek: makeNumberProp(1),
|
|
2441
|
+
yearPreEnable: Boolean,
|
|
2442
|
+
monthPreEnable: Boolean,
|
|
2443
|
+
yearNextEnable: Boolean,
|
|
2444
|
+
monthNextEnable: Boolean
|
|
2383
2445
|
},
|
|
2384
|
-
emits: ["clickSubtitle"],
|
|
2446
|
+
emits: ["clickSubtitle", "clickPreIcon", "clickNextIcon"],
|
|
2385
2447
|
setup(props, {
|
|
2386
2448
|
slots,
|
|
2387
2449
|
emit
|
|
@@ -2396,13 +2458,111 @@ var stdin_default$1s = vue.defineComponent({
|
|
|
2396
2458
|
}
|
|
2397
2459
|
};
|
|
2398
2460
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
|
2461
|
+
const onClickPreIcon = (isMonth, isYear) => () => {
|
|
2462
|
+
if (isMonth && !props.monthPreEnable || isYear && !props.yearPreEnable) {
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
emit("clickPreIcon", isMonth, isYear);
|
|
2466
|
+
};
|
|
2467
|
+
const onClickNextIcon = (isMonth, isYear) => () => {
|
|
2468
|
+
if (isMonth && !props.monthNextEnable || isYear && !props.yearNextEnable) {
|
|
2469
|
+
return;
|
|
2470
|
+
}
|
|
2471
|
+
emit("clickNextIcon", isMonth, isYear);
|
|
2472
|
+
};
|
|
2473
|
+
const fastForwardImg = () => vue.createVNode("svg", {
|
|
2474
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2475
|
+
"width": "16px",
|
|
2476
|
+
"height": "16px",
|
|
2477
|
+
"viewBox": "0 0 16 16",
|
|
2478
|
+
"version": "1.1"
|
|
2479
|
+
}, [vue.createVNode("g", {
|
|
2480
|
+
"stroke": "none",
|
|
2481
|
+
"stroke-width": "1",
|
|
2482
|
+
"fill": "none",
|
|
2483
|
+
"fill-rule": "evenodd"
|
|
2484
|
+
}, [vue.createVNode("g", {
|
|
2485
|
+
"transform": "translate(-32.000000, -320.000000)",
|
|
2486
|
+
"fill": "#0091FA",
|
|
2487
|
+
"fill-rule": "nonzero"
|
|
2488
|
+
}, [vue.createVNode("g", {
|
|
2489
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2490
|
+
}, [vue.createVNode("g", {
|
|
2491
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2492
|
+
}, [vue.createVNode("g", {
|
|
2493
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2494
|
+
}, [vue.createVNode("g", {
|
|
2495
|
+
"transform": "translate(8.000000, 10.000000) scale(-1, 1) translate(-8.000000, -10.000000) translate(0.000000, 2.000000)"
|
|
2496
|
+
}, [vue.createVNode("g", {
|
|
2497
|
+
"transform": "translate(0.500000, 2.000000)"
|
|
2498
|
+
}, [vue.createVNode("path", {
|
|
2499
|
+
"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",
|
|
2500
|
+
"opacity": "0.3",
|
|
2501
|
+
"transform": "translate(2.884615, 5.769231) rotate(-90.000000) translate(-2.884615, -5.769231) "
|
|
2502
|
+
}, null), vue.createVNode("path", {
|
|
2503
|
+
"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",
|
|
2504
|
+
"opacity": "0.8",
|
|
2505
|
+
"transform": "translate(6.923077, 5.769231) rotate(-90.000000) translate(-6.923077, -5.769231) "
|
|
2506
|
+
}, null), vue.createVNode("path", {
|
|
2507
|
+
"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",
|
|
2508
|
+
"opacity": "0.8",
|
|
2509
|
+
"transform": "translate(11.538462, 5.769231) rotate(-90.000000) translate(-11.538462, -5.769231) "
|
|
2510
|
+
}, null)])])])])])])])]);
|
|
2511
|
+
const slowForward = () => vue.createVNode("svg", {
|
|
2512
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
2513
|
+
"width": "16px",
|
|
2514
|
+
"height": "16px",
|
|
2515
|
+
"viewBox": "0 0 16 16",
|
|
2516
|
+
"version": "1.1"
|
|
2517
|
+
}, [vue.createVNode("g", {
|
|
2518
|
+
"stroke": "none",
|
|
2519
|
+
"stroke-width": "1",
|
|
2520
|
+
"fill": "none",
|
|
2521
|
+
"fill-rule": "evenodd"
|
|
2522
|
+
}, [vue.createVNode("g", {
|
|
2523
|
+
"transform": "translate(-80.000000, -320.000000)",
|
|
2524
|
+
"fill": "#0091FA",
|
|
2525
|
+
"fill-rule": "nonzero"
|
|
2526
|
+
}, [vue.createVNode("g", {
|
|
2527
|
+
"transform": "translate(0.000000, 70.000000)"
|
|
2528
|
+
}, [vue.createVNode("g", {
|
|
2529
|
+
"transform": "translate(0.000000, 236.000000)"
|
|
2530
|
+
}, [vue.createVNode("g", {
|
|
2531
|
+
"transform": "translate(32.000000, 12.000000)"
|
|
2532
|
+
}, [vue.createVNode("g", {
|
|
2533
|
+
"transform": "translate(56.000000, 10.000000) scale(-1, 1) translate(-56.000000, -10.000000) translate(48.000000, 2.000000)"
|
|
2534
|
+
}, [vue.createVNode("g", {
|
|
2535
|
+
"transform": "translate(3.000000, 2.000000)"
|
|
2536
|
+
}, [vue.createVNode("path", {
|
|
2537
|
+
"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",
|
|
2538
|
+
"opacity": "0.3",
|
|
2539
|
+
"transform": "translate(3.000000, 6.000000) rotate(-90.000000) translate(-3.000000, -6.000000) "
|
|
2540
|
+
}, null), vue.createVNode("path", {
|
|
2541
|
+
"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",
|
|
2542
|
+
"opacity": "0.8",
|
|
2543
|
+
"transform": "translate(7.200000, 6.000000) rotate(-90.000000) translate(-7.200000, -6.000000) "
|
|
2544
|
+
}, null)])])])])])])])]);
|
|
2399
2545
|
const renderSubtitle = () => {
|
|
2400
2546
|
if (props.showSubtitle) {
|
|
2401
2547
|
const title = slots.subtitle ? slots.subtitle() : props.subtitle;
|
|
2402
2548
|
return vue.createVNode("div", {
|
|
2403
|
-
"class": bem$15("header-subtitle")
|
|
2549
|
+
"class": bem$15("header-subtitle")
|
|
2550
|
+
}, [vue.createVNode("div", {
|
|
2551
|
+
"class": bem$15("header-subtitle", ["opt", props.yearPreEnable ? "enable" : "unenable"]),
|
|
2552
|
+
"onClick": onClickPreIcon(false, true)
|
|
2553
|
+
}, [fastForwardImg()]), vue.createVNode("div", {
|
|
2554
|
+
"class": bem$15("header-subtitle", ["opt", props.monthPreEnable ? "enable" : "unenable"]),
|
|
2555
|
+
"onClick": onClickPreIcon(true, false)
|
|
2556
|
+
}, [slowForward()]), vue.createVNode("label", {
|
|
2557
|
+
"class": bem$15("header-subtitle-text"),
|
|
2404
2558
|
"onClick": onClickSubtitle
|
|
2405
|
-
}, [title])
|
|
2559
|
+
}, [title]), vue.createVNode("div", {
|
|
2560
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.monthNextEnable ? "enable" : "unenable"]]),
|
|
2561
|
+
"onClick": onClickNextIcon(true, false)
|
|
2562
|
+
}, [slowForward()]), vue.createVNode("div", {
|
|
2563
|
+
"class": bem$15("header-subtitle", ["opt", "right", [props.yearNextEnable ? "enable" : "unenable"]]),
|
|
2564
|
+
"onClick": onClickNextIcon(false, true)
|
|
2565
|
+
}, [fastForwardImg()])]);
|
|
2406
2566
|
}
|
|
2407
2567
|
};
|
|
2408
2568
|
const renderWeekDays = () => {
|
|
@@ -2424,6 +2584,7 @@ var stdin_default$1s = vue.defineComponent({
|
|
|
2424
2584
|
});
|
|
2425
2585
|
const calendarProps = {
|
|
2426
2586
|
show: Boolean,
|
|
2587
|
+
showType: makeStringProp("inline"),
|
|
2427
2588
|
type: makeStringProp("single"),
|
|
2428
2589
|
title: String,
|
|
2429
2590
|
color: String,
|
|
@@ -2450,24 +2611,14 @@ const calendarProps = {
|
|
|
2450
2611
|
closeOnClickOverlay: truthProp,
|
|
2451
2612
|
safeAreaInsetTop: Boolean,
|
|
2452
2613
|
safeAreaInsetBottom: truthProp,
|
|
2453
|
-
minDate:
|
|
2454
|
-
|
|
2455
|
-
validator: isDate,
|
|
2456
|
-
default: getToday
|
|
2457
|
-
},
|
|
2458
|
-
maxDate: {
|
|
2459
|
-
type: Date,
|
|
2460
|
-
validator: isDate,
|
|
2461
|
-
default: () => {
|
|
2462
|
-
const now = getToday();
|
|
2463
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
|
2464
|
-
}
|
|
2465
|
-
},
|
|
2614
|
+
minDate: Date,
|
|
2615
|
+
maxDate: Date,
|
|
2466
2616
|
firstDayOfWeek: {
|
|
2467
2617
|
type: numericProp,
|
|
2468
|
-
default:
|
|
2618
|
+
default: 1,
|
|
2469
2619
|
validator: (val) => val >= 0 && val <= 6
|
|
2470
|
-
}
|
|
2620
|
+
},
|
|
2621
|
+
disabledDate: Function
|
|
2471
2622
|
};
|
|
2472
2623
|
var stdin_default$1r = vue.defineComponent({
|
|
2473
2624
|
name: name$18,
|
|
@@ -2477,11 +2628,19 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2477
2628
|
emit,
|
|
2478
2629
|
slots
|
|
2479
2630
|
}) {
|
|
2480
|
-
const
|
|
2481
|
-
|
|
2631
|
+
const lastMinDate = vue.computed(() => {
|
|
2632
|
+
const now = new Date();
|
|
2633
|
+
return props.showType !== "inline" && !props.minDate ? new Date(now.getFullYear(), now.getMonth() - 3, now.getDate()) : props.minDate;
|
|
2634
|
+
});
|
|
2635
|
+
const lastMaxDate = vue.computed(() => {
|
|
2636
|
+
const now = new Date();
|
|
2637
|
+
return props.showType !== "inline" && !props.maxDate ? new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()) : props.maxDate;
|
|
2638
|
+
});
|
|
2639
|
+
const limitDateRange = (date, minDate = lastMinDate.value, maxDate = lastMaxDate.value) => {
|
|
2640
|
+
if (minDate && compareDay(date, minDate) === -1) {
|
|
2482
2641
|
return minDate;
|
|
2483
2642
|
}
|
|
2484
|
-
if (compareDay(date, maxDate) === 1) {
|
|
2643
|
+
if (maxDate && compareDay(date, maxDate) === 1) {
|
|
2485
2644
|
return maxDate;
|
|
2486
2645
|
}
|
|
2487
2646
|
return date;
|
|
@@ -2489,10 +2648,10 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2489
2648
|
const getInitialDate = (defaultDate = props.defaultDate) => {
|
|
2490
2649
|
const {
|
|
2491
2650
|
type,
|
|
2492
|
-
minDate,
|
|
2493
|
-
maxDate,
|
|
2494
2651
|
allowSameDay
|
|
2495
2652
|
} = props;
|
|
2653
|
+
const minDate = lastMinDate.value;
|
|
2654
|
+
const maxDate = lastMaxDate.value;
|
|
2496
2655
|
if (defaultDate === null) {
|
|
2497
2656
|
return defaultDate;
|
|
2498
2657
|
}
|
|
@@ -2501,8 +2660,8 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2501
2660
|
if (!Array.isArray(defaultDate)) {
|
|
2502
2661
|
defaultDate = [];
|
|
2503
2662
|
}
|
|
2504
|
-
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
|
|
2505
|
-
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
|
|
2663
|
+
const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : maxDate && getPrevDay(maxDate));
|
|
2664
|
+
const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : minDate && getNextDay(minDate));
|
|
2506
2665
|
return [start, end];
|
|
2507
2666
|
}
|
|
2508
2667
|
if (type === "multiple") {
|
|
@@ -2516,20 +2675,40 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2516
2675
|
}
|
|
2517
2676
|
return limitDateRange(defaultDate);
|
|
2518
2677
|
};
|
|
2678
|
+
const getInitialTitleDate = (defaultDate = props.defaultDate) => {
|
|
2679
|
+
const initTitleDate = getInitialDate(defaultDate);
|
|
2680
|
+
const now = getToday();
|
|
2681
|
+
if (Array.isArray(initTitleDate)) {
|
|
2682
|
+
return initTitleDate[0] || now;
|
|
2683
|
+
} else {
|
|
2684
|
+
return initTitleDate || now;
|
|
2685
|
+
}
|
|
2686
|
+
};
|
|
2519
2687
|
let bodyHeight;
|
|
2520
2688
|
const bodyRef = vue.ref();
|
|
2521
2689
|
const subtitle = vue.ref("");
|
|
2522
2690
|
const currentDate = vue.ref(getInitialDate());
|
|
2691
|
+
const titleDate = vue.ref(getInitialTitleDate());
|
|
2523
2692
|
const [monthRefs, setMonthRefs] = useRefs();
|
|
2524
2693
|
const dayOffset = vue.computed(() => props.firstDayOfWeek ? +props.firstDayOfWeek % 7 : 0);
|
|
2525
2694
|
const months = vue.computed(() => {
|
|
2695
|
+
var _a;
|
|
2526
2696
|
const months2 = [];
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2697
|
+
if (props.showType !== "inline" && lastMinDate.value && lastMaxDate.value) {
|
|
2698
|
+
const cursor = new Date(lastMinDate.value);
|
|
2699
|
+
cursor.setDate(1);
|
|
2700
|
+
do {
|
|
2701
|
+
months2.push(new Date(cursor));
|
|
2702
|
+
cursor.setMonth(cursor.getMonth() + 1);
|
|
2703
|
+
} while (compareMonth(cursor, lastMaxDate.value) !== 1);
|
|
2704
|
+
} else if (props.showType === "inline") {
|
|
2705
|
+
const temp = (_a = titleDate.value) != null ? _a : cloneDates(titleDate.value);
|
|
2706
|
+
if (!Array.isArray(temp)) {
|
|
2707
|
+
months2.push(getFirstDate(temp));
|
|
2708
|
+
} else {
|
|
2709
|
+
months2.push(getFirstDate(temp[0]));
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2533
2712
|
return months2;
|
|
2534
2713
|
});
|
|
2535
2714
|
const buttonDisabled = vue.computed(() => {
|
|
@@ -2580,6 +2759,7 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2580
2759
|
});
|
|
2581
2760
|
if (currentMonth) {
|
|
2582
2761
|
subtitle.value = currentMonth.getTitle();
|
|
2762
|
+
titleDate.value = currentMonth.getDate();
|
|
2583
2763
|
}
|
|
2584
2764
|
};
|
|
2585
2765
|
const scrollToDate = (targetDate) => {
|
|
@@ -2620,6 +2800,7 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2620
2800
|
};
|
|
2621
2801
|
const reset = (date = getInitialDate()) => {
|
|
2622
2802
|
currentDate.value = date;
|
|
2803
|
+
titleDate.value = getInitialTitleDate(date);
|
|
2623
2804
|
scrollToCurrentDate();
|
|
2624
2805
|
};
|
|
2625
2806
|
const checkRange = (date) => {
|
|
@@ -2681,6 +2862,9 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2681
2862
|
const {
|
|
2682
2863
|
type
|
|
2683
2864
|
} = props;
|
|
2865
|
+
if (item.type === "preview") {
|
|
2866
|
+
titleDate.value = date;
|
|
2867
|
+
}
|
|
2684
2868
|
if (type === "range") {
|
|
2685
2869
|
if (!currentDate.value) {
|
|
2686
2870
|
select([date]);
|
|
@@ -2728,6 +2912,64 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2728
2912
|
select(date, true);
|
|
2729
2913
|
}
|
|
2730
2914
|
};
|
|
2915
|
+
const yearPreEnable = vue.computed(() => {
|
|
2916
|
+
if (!lastMinDate.value) {
|
|
2917
|
+
return true;
|
|
2918
|
+
}
|
|
2919
|
+
return titleDate.value.getFullYear() > lastMinDate.value.getFullYear();
|
|
2920
|
+
});
|
|
2921
|
+
const monthPreEnable = vue.computed(() => {
|
|
2922
|
+
if (!lastMinDate.value) {
|
|
2923
|
+
return true;
|
|
2924
|
+
}
|
|
2925
|
+
const targetDate = titleDate.value;
|
|
2926
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
2927
|
+
const minDateYearMonth = getFirstDate(lastMinDate.value);
|
|
2928
|
+
return compareDay(targetYearMonth, minDateYearMonth) === 1;
|
|
2929
|
+
});
|
|
2930
|
+
const yearNextEnable = vue.computed(() => {
|
|
2931
|
+
if (!lastMaxDate.value) {
|
|
2932
|
+
return true;
|
|
2933
|
+
}
|
|
2934
|
+
return titleDate.value.getFullYear() < lastMaxDate.value.getFullYear();
|
|
2935
|
+
});
|
|
2936
|
+
const monthNextEnable = vue.computed(() => {
|
|
2937
|
+
if (!lastMaxDate.value) {
|
|
2938
|
+
return true;
|
|
2939
|
+
}
|
|
2940
|
+
const targetDate = titleDate.value;
|
|
2941
|
+
const targetYearMonth = getFirstDate(targetDate);
|
|
2942
|
+
const maxDateYearMonth = getFirstDate(lastMaxDate.value);
|
|
2943
|
+
return compareDay(maxDateYearMonth, targetYearMonth) === 1;
|
|
2944
|
+
});
|
|
2945
|
+
const onClickTitleIcon = (isPreFlag, isMonth, isYear) => {
|
|
2946
|
+
const curTitleDate = titleDate.value;
|
|
2947
|
+
if (curTitleDate) {
|
|
2948
|
+
let targetDate = isPreFlag ? getPrevDate(curTitleDate, isMonth, isYear) : getNextDate(curTitleDate, isMonth, isYear);
|
|
2949
|
+
if (!isDate(targetDate)) {
|
|
2950
|
+
return;
|
|
2951
|
+
}
|
|
2952
|
+
let hasCompared = false;
|
|
2953
|
+
const compareDate = isPreFlag ? lastMinDate.value : lastMaxDate.value;
|
|
2954
|
+
const compareValue = isPreFlag ? 1 : -1;
|
|
2955
|
+
if (compareDate && compareDay(compareDate, targetDate) === compareValue && compareMonth(compareDate, targetDate) === 0) {
|
|
2956
|
+
targetDate = compareDate;
|
|
2957
|
+
hasCompared = true;
|
|
2958
|
+
}
|
|
2959
|
+
if (hasCompared || !compareDate || compareDate && compareDay(compareDate, targetDate) !== compareValue) {
|
|
2960
|
+
scrollToDate(targetDate);
|
|
2961
|
+
titleDate.value = targetDate;
|
|
2962
|
+
}
|
|
2963
|
+
} else {
|
|
2964
|
+
use.raf(onScroll);
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2967
|
+
const onClickPreIcon = (isMonth, isYear) => {
|
|
2968
|
+
onClickTitleIcon(true, isMonth, isYear);
|
|
2969
|
+
};
|
|
2970
|
+
const onClickNextIcon = (isMonth, isYear) => {
|
|
2971
|
+
onClickTitleIcon(false, isMonth, isYear);
|
|
2972
|
+
};
|
|
2731
2973
|
const updateShow = (value) => emit("update:show", value);
|
|
2732
2974
|
const renderMonth = (date, index) => {
|
|
2733
2975
|
const showMonthTitle = index !== 0 || !props.showSubtitle;
|
|
@@ -2737,7 +2979,7 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2737
2979
|
"currentDate": currentDate.value,
|
|
2738
2980
|
"showMonthTitle": showMonthTitle,
|
|
2739
2981
|
"firstDayOfWeek": dayOffset.value
|
|
2740
|
-
}, pick(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
|
2982
|
+
}, pick(props, ["showType", "type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay", "disabledDate"]), {
|
|
2741
2983
|
"onClick": onClickDay
|
|
2742
2984
|
}), pick(slots, ["top-info", "bottom-info"]));
|
|
2743
2985
|
};
|
|
@@ -2787,7 +3029,13 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2787
3029
|
"showTitle": props.showTitle,
|
|
2788
3030
|
"showSubtitle": props.showSubtitle,
|
|
2789
3031
|
"firstDayOfWeek": dayOffset.value,
|
|
2790
|
-
"onClickSubtitle": (event) => emit("clickSubtitle", event)
|
|
3032
|
+
"onClickSubtitle": (event) => emit("clickSubtitle", event),
|
|
3033
|
+
"onClickPreIcon": onClickPreIcon,
|
|
3034
|
+
"onClickNextIcon": onClickNextIcon,
|
|
3035
|
+
"yearPreEnable": yearPreEnable.value,
|
|
3036
|
+
"monthPreEnable": monthPreEnable.value,
|
|
3037
|
+
"yearNextEnable": yearNextEnable.value,
|
|
3038
|
+
"monthNextEnable": monthNextEnable.value
|
|
2791
3039
|
}, pick(slots, ["title", "subtitle"])), vue.createVNode("div", {
|
|
2792
3040
|
"ref": bodyRef,
|
|
2793
3041
|
"class": bem$15("body"),
|
|
@@ -2799,6 +3047,11 @@ var stdin_default$1r = vue.defineComponent({
|
|
|
2799
3047
|
currentDate.value = value;
|
|
2800
3048
|
scrollToCurrentDate();
|
|
2801
3049
|
});
|
|
3050
|
+
vue.watch(titleDate, (newValue) => {
|
|
3051
|
+
if (props.showType === "inline" && newValue) {
|
|
3052
|
+
subtitle.value = formatMonthTitle(newValue);
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
2802
3055
|
useExpose({
|
|
2803
3056
|
reset,
|
|
2804
3057
|
scrollToDate,
|
|
@@ -4280,7 +4533,7 @@ var stdin_default$1i = vue.defineComponent({
|
|
|
4280
4533
|
options,
|
|
4281
4534
|
selected
|
|
4282
4535
|
} = tab;
|
|
4283
|
-
const placeholder = props.placeholder || t$5("
|
|
4536
|
+
const placeholder = props.placeholder || t$5("ztCascader.select");
|
|
4284
4537
|
const title = selected ? selected[textKey] : placeholder;
|
|
4285
4538
|
return vue.createVNode(Tab, {
|
|
4286
4539
|
"title": title,
|
|
@@ -6647,6 +6900,7 @@ const DateTimePicker = withInstall(stdin_default$$);
|
|
|
6647
6900
|
const [name$H, bem$I, t$3] = createNamespace("dialog");
|
|
6648
6901
|
const dialogProps = extend({}, popupSharedProps, {
|
|
6649
6902
|
title: String,
|
|
6903
|
+
primaryHeader: Boolean,
|
|
6650
6904
|
theme: String,
|
|
6651
6905
|
width: numericProp,
|
|
6652
6906
|
message: [String, Function],
|
|
@@ -6724,12 +6978,21 @@ var stdin_default$_ = vue.defineComponent({
|
|
|
6724
6978
|
const renderTitle = () => {
|
|
6725
6979
|
const title = slots.title ? slots.title() : props.title;
|
|
6726
6980
|
if (title) {
|
|
6727
|
-
return
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6981
|
+
return (
|
|
6982
|
+
// <div
|
|
6983
|
+
// class={bem(['header', props.titleType, {
|
|
6984
|
+
// isolated: !props.message && !slots.default,
|
|
6985
|
+
// 'custom-title': !!slots.title,
|
|
6986
|
+
// }])}
|
|
6987
|
+
// >
|
|
6988
|
+
vue.createVNode("div", {
|
|
6989
|
+
"class": bem$I("header", {
|
|
6990
|
+
isolated: !props.message && !slots.default,
|
|
6991
|
+
"custom-title": !!slots.title,
|
|
6992
|
+
primary: props.primaryHeader
|
|
6993
|
+
})
|
|
6994
|
+
}, [title])
|
|
6995
|
+
);
|
|
6733
6996
|
}
|
|
6734
6997
|
};
|
|
6735
6998
|
const renderMessage = (hasTitle) => {
|
|
@@ -6738,10 +7001,15 @@ var stdin_default$_ = vue.defineComponent({
|
|
|
6738
7001
|
allowHtml,
|
|
6739
7002
|
messageAlign
|
|
6740
7003
|
} = props;
|
|
6741
|
-
const
|
|
6742
|
-
"has-title": hasTitle,
|
|
7004
|
+
const mods = {
|
|
6743
7005
|
[messageAlign]: messageAlign
|
|
6744
|
-
}
|
|
7006
|
+
};
|
|
7007
|
+
if (props.primaryHeader) {
|
|
7008
|
+
mods["primary-header"] = props.primaryHeader;
|
|
7009
|
+
} else if (hasTitle) {
|
|
7010
|
+
mods["has-title"] = hasTitle;
|
|
7011
|
+
}
|
|
7012
|
+
const classNames = bem$I("message", mods);
|
|
6745
7013
|
const content = isFunction(message) ? message() : message;
|
|
6746
7014
|
if (allowHtml && typeof content === "string") {
|
|
6747
7015
|
return vue.createVNode("div", {
|
|
@@ -8460,6 +8728,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
|
|
|
8460
8728
|
labelAlign: String,
|
|
8461
8729
|
showWordLimit: Boolean,
|
|
8462
8730
|
errorMessageAlign: String,
|
|
8731
|
+
descriptionClass: unknownProp,
|
|
8463
8732
|
description: makeStringProp(""),
|
|
8464
8733
|
colon: {
|
|
8465
8734
|
type: Boolean,
|
|
@@ -8797,7 +9066,7 @@ var stdin_default$W = vue.defineComponent({
|
|
|
8797
9066
|
return;
|
|
8798
9067
|
}
|
|
8799
9068
|
return vue.createVNode("div", {
|
|
8800
|
-
"class": bem$E("description")
|
|
9069
|
+
"class": [bem$E("description"), props.descriptionClass]
|
|
8801
9070
|
}, [props.description]);
|
|
8802
9071
|
};
|
|
8803
9072
|
const showMessage = vue.computed(() => !(form && form.props.showErrorMessage === false) && (props.errorMessage || state.validateMessage));
|
|
@@ -13861,12 +14130,14 @@ var stdin_default$p = vue.defineComponent({
|
|
|
13861
14130
|
return __async(this, null, function* () {
|
|
13862
14131
|
var _a;
|
|
13863
14132
|
if (wrapperRef.value && popupRef.value && arrowRef.value) {
|
|
14133
|
+
const popoverEl = popupRef.value;
|
|
14134
|
+
const wrapperEl = wrapperRef.value;
|
|
13864
14135
|
const {
|
|
13865
14136
|
x,
|
|
13866
14137
|
y,
|
|
13867
14138
|
placement: realPlacement,
|
|
13868
14139
|
middlewareData
|
|
13869
|
-
} = yield vue$1.computePosition(
|
|
14140
|
+
} = yield vue$1.computePosition(wrapperEl, popoverEl, {
|
|
13870
14141
|
placement: props.placement,
|
|
13871
14142
|
middleware: [vue$1.offset(8), vue$1.shift({
|
|
13872
14143
|
padding: 4,
|
|
@@ -13877,11 +14148,7 @@ var stdin_default$p = vue.defineComponent({
|
|
|
13877
14148
|
padding: 6
|
|
13878
14149
|
})]
|
|
13879
14150
|
});
|
|
13880
|
-
|
|
13881
|
-
left: `${x}px`,
|
|
13882
|
-
top: `${y}px`
|
|
13883
|
-
});
|
|
13884
|
-
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
14151
|
+
let popupTop = y;
|
|
13885
14152
|
const side = realPlacement.split("-")[0];
|
|
13886
14153
|
const arrowSide = {
|
|
13887
14154
|
top: "bottom",
|
|
@@ -13889,6 +14156,16 @@ var stdin_default$p = vue.defineComponent({
|
|
|
13889
14156
|
bottom: "top",
|
|
13890
14157
|
left: "right"
|
|
13891
14158
|
}[side];
|
|
14159
|
+
if (y < 0) {
|
|
14160
|
+
popupTop = 0;
|
|
14161
|
+
} else if (y > 0 && y + popoverEl.offsetHeight > document.body.clientHeight) {
|
|
14162
|
+
popupTop = document.body.clientHeight - popoverEl.offsetHeight;
|
|
14163
|
+
}
|
|
14164
|
+
Object.assign(popupRef.value.style, {
|
|
14165
|
+
left: `${x}px`,
|
|
14166
|
+
top: `${popupTop}px`
|
|
14167
|
+
});
|
|
14168
|
+
popupRef.value.setAttribute("data-popper-placement", realPlacement);
|
|
13892
14169
|
const {
|
|
13893
14170
|
x: arrowX,
|
|
13894
14171
|
y: arrowY
|
|
@@ -15797,6 +16074,11 @@ var stdin_default$a = vue.defineComponent({
|
|
|
15797
16074
|
}
|
|
15798
16075
|
});
|
|
15799
16076
|
const TabbarItem = withInstall(stdin_default$a);
|
|
16077
|
+
var SortOrderEnum = /* @__PURE__ */ ((SortOrderEnum2) => {
|
|
16078
|
+
SortOrderEnum2["ASCEND"] = "ascend";
|
|
16079
|
+
SortOrderEnum2["DESCEND"] = "descend";
|
|
16080
|
+
return SortOrderEnum2;
|
|
16081
|
+
})(SortOrderEnum || {});
|
|
15800
16082
|
const [name$4, bem$4] = createNamespace("table");
|
|
15801
16083
|
const tableProps = {
|
|
15802
16084
|
headList: makeArrayProp(),
|
|
@@ -15819,12 +16101,42 @@ const tableProps = {
|
|
|
15819
16101
|
var stdin_default$9 = vue.defineComponent({
|
|
15820
16102
|
name: name$4,
|
|
15821
16103
|
props: tableProps,
|
|
15822
|
-
|
|
15823
|
-
|
|
16104
|
+
emits: ["sort"],
|
|
16105
|
+
setup(props, {
|
|
16106
|
+
emit
|
|
16107
|
+
}) {
|
|
16108
|
+
const sortOrder = vue.ref("");
|
|
16109
|
+
const sortKey = vue.ref("");
|
|
15824
16110
|
const fixedColumn = vue.computed(() => props.headList.filter((v) => v.fixed));
|
|
16111
|
+
const formatColumns = vue.computed(() => {
|
|
16112
|
+
const columns = [];
|
|
16113
|
+
let left = 0;
|
|
16114
|
+
props.headList.forEach((element, index) => {
|
|
16115
|
+
var _a;
|
|
16116
|
+
const column = Object.assign({}, element);
|
|
16117
|
+
const preColumn = props.headList[index - 1];
|
|
16118
|
+
const nextColumn = props.headList[index + 1];
|
|
16119
|
+
if (preColumn) {
|
|
16120
|
+
left += Number((_a = preColumn.width) == null ? void 0 : _a.split("px")[0]);
|
|
16121
|
+
column.left = `${left}px`;
|
|
16122
|
+
} else {
|
|
16123
|
+
column.left = 0;
|
|
16124
|
+
}
|
|
16125
|
+
if (element.fixed && !nextColumn.fixed) {
|
|
16126
|
+
column.lastFixLeft = true;
|
|
16127
|
+
}
|
|
16128
|
+
columns.push(column);
|
|
16129
|
+
});
|
|
16130
|
+
return columns;
|
|
16131
|
+
});
|
|
16132
|
+
const pingedLeft = vue.ref(false);
|
|
15825
16133
|
const resortHeadList = vue.computed(() => fixedColumn.value.concat(props.headList.filter((v) => !v.fixed)));
|
|
15826
16134
|
vue.onMounted(() => {
|
|
15827
16135
|
const fixedIndexList = props.headList.map((v, i) => {
|
|
16136
|
+
if (v.sorter && v.defaultSortOrder) {
|
|
16137
|
+
sortOrder.value = v.defaultSortOrder || "";
|
|
16138
|
+
sortKey.value = v.key;
|
|
16139
|
+
}
|
|
15828
16140
|
if (v.fixed) {
|
|
15829
16141
|
return `tableHead${i}`;
|
|
15830
16142
|
} else {
|
|
@@ -15841,31 +16153,86 @@ var stdin_default$9 = vue.defineComponent({
|
|
|
15841
16153
|
}, 0);
|
|
15842
16154
|
}
|
|
15843
16155
|
});
|
|
15844
|
-
const
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
16156
|
+
const getNextSortOrder = (type) => {
|
|
16157
|
+
if (!type) {
|
|
16158
|
+
return SortOrderEnum.ASCEND;
|
|
16159
|
+
} else if (type === SortOrderEnum.ASCEND) {
|
|
16160
|
+
return SortOrderEnum.DESCEND;
|
|
15848
16161
|
} else {
|
|
15849
|
-
|
|
16162
|
+
return "";
|
|
15850
16163
|
}
|
|
15851
16164
|
};
|
|
15852
|
-
const
|
|
15853
|
-
if (
|
|
15854
|
-
|
|
16165
|
+
const onHeaderClick = (data) => {
|
|
16166
|
+
if (!data.sorter)
|
|
16167
|
+
return;
|
|
16168
|
+
sortOrder.value = getNextSortOrder(data.key === sortKey.value ? sortOrder.value : "");
|
|
16169
|
+
sortKey.value = data.key;
|
|
16170
|
+
emit("sort", {
|
|
16171
|
+
order: sortOrder.value,
|
|
16172
|
+
key: data.key
|
|
16173
|
+
});
|
|
16174
|
+
};
|
|
16175
|
+
const onScroll = (event) => {
|
|
16176
|
+
const {
|
|
16177
|
+
scrollLeft,
|
|
16178
|
+
currentTarget
|
|
16179
|
+
} = event;
|
|
16180
|
+
const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget == null ? void 0 : currentTarget.scrollLeft;
|
|
16181
|
+
pingedLeft.value = mergedScrollLeft > 0;
|
|
16182
|
+
};
|
|
16183
|
+
const getHead = (colData) => {
|
|
16184
|
+
if ((colData == null ? void 0 : colData.colSpan) !== 0) {
|
|
16185
|
+
return vue.createVNode("th", {
|
|
16186
|
+
"class": bem$4("left", {
|
|
16187
|
+
fixed: colData.fixed,
|
|
16188
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
16189
|
+
}),
|
|
16190
|
+
"style": {
|
|
16191
|
+
left: colData.fixed ? colData.left : ""
|
|
16192
|
+
},
|
|
16193
|
+
"colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
|
|
16194
|
+
}, [vue.createVNode("div", {
|
|
16195
|
+
"class": bem$4("head"),
|
|
16196
|
+
"onClick": () => onHeaderClick(colData)
|
|
16197
|
+
}, [vue.createVNode("span", {
|
|
16198
|
+
"class": bem$4("head-label")
|
|
16199
|
+
}, [colData.label]), colData.sorter ? vue.createVNode("span", {
|
|
16200
|
+
"class": bem$4("head-sort")
|
|
16201
|
+
}, [vue.createVNode(Icon, {
|
|
16202
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.ASCEND ? bem$4("sort-active") : ""],
|
|
16203
|
+
"name": "spinner-shrink",
|
|
16204
|
+
"size": "12",
|
|
16205
|
+
"style": {
|
|
16206
|
+
marginBottom: "-3px"
|
|
16207
|
+
}
|
|
16208
|
+
}, null), vue.createVNode(Icon, {
|
|
16209
|
+
"class": [colData.key === sortKey.value && sortOrder.value === SortOrderEnum.DESCEND ? bem$4("sort-active") : ""],
|
|
16210
|
+
"name": "spinner-expand",
|
|
16211
|
+
"size": "12",
|
|
16212
|
+
"style": {
|
|
16213
|
+
marginTop: "-3px"
|
|
16214
|
+
}
|
|
16215
|
+
}, null)]) : ""])]);
|
|
15855
16216
|
}
|
|
15856
16217
|
};
|
|
15857
|
-
const
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
|
|
16218
|
+
const getBody = (rowData, rowIndex) => vue.createVNode("tr", null, [formatColumns.value.map((colData) => {
|
|
16219
|
+
let additionalCellProps;
|
|
16220
|
+
if (colData.customCell) {
|
|
16221
|
+
additionalCellProps = colData.customCell(rowData, rowIndex);
|
|
16222
|
+
}
|
|
16223
|
+
const style = Object.assign({}, colData.style);
|
|
16224
|
+
style.left = colData.fixed ? colData.left : "";
|
|
16225
|
+
return (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 0 && (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 0 && vue.createVNode("td", {
|
|
16226
|
+
"onClick": () => colData.click && colData.click(rowData, rowIndex),
|
|
16227
|
+
"class": bem$4("left", {
|
|
16228
|
+
fixed: colData.fixed,
|
|
16229
|
+
last: colData.lastFixLeft && pingedLeft.value
|
|
16230
|
+
}),
|
|
16231
|
+
"colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
|
|
16232
|
+
"rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
|
|
16233
|
+
"style": style
|
|
16234
|
+
}, [rowData[colData.key]]);
|
|
16235
|
+
})]);
|
|
15869
16236
|
const getCol = () => {
|
|
15870
16237
|
const cols = [];
|
|
15871
16238
|
const col = resortHeadList.value.length;
|
|
@@ -15896,16 +16263,20 @@ var stdin_default$9 = vue.defineComponent({
|
|
|
15896
16263
|
})
|
|
15897
16264
|
}, [getLoadingColumn()]) : vue.createVNode("div", {
|
|
15898
16265
|
"class": bem$4({
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
"class": bem$4("normal-box"),
|
|
16266
|
+
fixed: fixedColumn.value.length > 0,
|
|
16267
|
+
bordered: props.border,
|
|
16268
|
+
striped: props.striped
|
|
16269
|
+
}),
|
|
15904
16270
|
"onScroll": onScroll
|
|
15905
|
-
}, [
|
|
15906
|
-
"
|
|
15907
|
-
|
|
15908
|
-
|
|
16271
|
+
}, [vue.createVNode("table", null, [vue.createVNode("colgroup", null, [props.headList.map((item) => vue.createVNode("col", {
|
|
16272
|
+
"style": {
|
|
16273
|
+
width: item.width
|
|
16274
|
+
}
|
|
16275
|
+
}, null))]), vue.createVNode("thead", {
|
|
16276
|
+
"class": bem$4("thead")
|
|
16277
|
+
}, [vue.createVNode("tr", null, [formatColumns.value.map((colData) => getHead(colData))])]), vue.createVNode("tbody", {
|
|
16278
|
+
"class": bem$4("tbody")
|
|
16279
|
+
}, [props.dataList.map((rowData, rowIndex) => getBody(rowData, rowIndex))])])]);
|
|
15909
16280
|
}
|
|
15910
16281
|
});
|
|
15911
16282
|
const Table = withInstall(stdin_default$9);
|
|
@@ -15921,6 +16292,7 @@ const tagProps = {
|
|
|
15921
16292
|
borderColor: String,
|
|
15922
16293
|
closeable: Boolean,
|
|
15923
16294
|
icon: String,
|
|
16295
|
+
image: String,
|
|
15924
16296
|
iconPrefix: String,
|
|
15925
16297
|
iconColor: String,
|
|
15926
16298
|
badge: Boolean,
|
|
@@ -15983,27 +16355,33 @@ var stdin_default$8 = vue.defineComponent({
|
|
|
15983
16355
|
"class": [bem$3("close"), HAPTICS_FEEDBACK],
|
|
15984
16356
|
"onClick": onClose
|
|
15985
16357
|
}, null);
|
|
15986
|
-
const LeftIcon =
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
16358
|
+
const LeftIcon = () => {
|
|
16359
|
+
if (props.image) {
|
|
16360
|
+
return vue.createVNode(stdin_default$1z, {
|
|
16361
|
+
"class": bem$3("image"),
|
|
16362
|
+
"src": props.image
|
|
16363
|
+
}, null);
|
|
16364
|
+
} else if (props.icon) {
|
|
16365
|
+
return vue.createVNode(Icon, {
|
|
16366
|
+
"name": props.icon,
|
|
16367
|
+
"class": bem$3("icon"),
|
|
16368
|
+
"classPrefix": props.iconPrefix,
|
|
16369
|
+
"style": {
|
|
16370
|
+
color: props.iconColor
|
|
16371
|
+
}
|
|
16372
|
+
}, null);
|
|
15992
16373
|
}
|
|
15993
|
-
}
|
|
16374
|
+
};
|
|
15994
16375
|
return vue.createVNode("span", {
|
|
15995
16376
|
"style": getStyle(),
|
|
15996
16377
|
"class": bem$3([classes, type])
|
|
15997
|
-
}, [LeftIcon, (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
15998
|
-
};
|
|
15999
|
-
const getStampStyle = () => {
|
|
16000
|
-
const style = {
|
|
16001
|
-
color: props.color || props.textColor,
|
|
16002
|
-
width: props.stampDiameter + "px",
|
|
16003
|
-
height: props.stampDiameter + "px"
|
|
16004
|
-
};
|
|
16005
|
-
return style;
|
|
16378
|
+
}, [LeftIcon(), (_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
|
16006
16379
|
};
|
|
16380
|
+
const getStampStyle = () => ({
|
|
16381
|
+
color: props.color || props.textColor,
|
|
16382
|
+
width: props.stampDiameter + "px",
|
|
16383
|
+
height: props.stampDiameter + "px"
|
|
16384
|
+
});
|
|
16007
16385
|
const renderStampTag = () => {
|
|
16008
16386
|
var _a;
|
|
16009
16387
|
const {
|