wcz-test 3.0.0 → 3.1.0
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/dist/index.js +40 -44
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1387,16 +1387,16 @@ function warnOnce(message, gravity = "warning") {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
|
|
1389
1389
|
// node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
|
|
1390
|
-
import
|
|
1390
|
+
import dayjs from "dayjs";
|
|
1391
1391
|
import weekOfYearPlugin from "dayjs/plugin/weekOfYear.js";
|
|
1392
1392
|
import customParseFormatPlugin from "dayjs/plugin/customParseFormat.js";
|
|
1393
1393
|
import localizedFormatPlugin from "dayjs/plugin/localizedFormat.js";
|
|
1394
1394
|
import isBetweenPlugin from "dayjs/plugin/isBetween.js";
|
|
1395
1395
|
import advancedFormatPlugin from "dayjs/plugin/advancedFormat.js";
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1396
|
+
dayjs.extend(localizedFormatPlugin);
|
|
1397
|
+
dayjs.extend(weekOfYearPlugin);
|
|
1398
|
+
dayjs.extend(isBetweenPlugin);
|
|
1399
|
+
dayjs.extend(advancedFormatPlugin);
|
|
1400
1400
|
var formatTokenMap = {
|
|
1401
1401
|
// Year
|
|
1402
1402
|
YY: "year",
|
|
@@ -1505,7 +1505,6 @@ var defaultFormats = {
|
|
|
1505
1505
|
};
|
|
1506
1506
|
var MISSING_UTC_PLUGIN = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join("\n");
|
|
1507
1507
|
var MISSING_TIMEZONE_PLUGIN = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join("\n");
|
|
1508
|
-
var withLocale = (dayjs3, locale) => !locale ? dayjs3 : (...args) => dayjs3(...args).locale(locale);
|
|
1509
1508
|
var AdapterDayjs = class {
|
|
1510
1509
|
constructor({
|
|
1511
1510
|
locale: _locale,
|
|
@@ -1514,7 +1513,6 @@ var AdapterDayjs = class {
|
|
|
1514
1513
|
this.isMUIAdapter = true;
|
|
1515
1514
|
this.isTimezoneCompatible = true;
|
|
1516
1515
|
this.lib = "dayjs";
|
|
1517
|
-
this.dayjs = void 0;
|
|
1518
1516
|
this.locale = void 0;
|
|
1519
1517
|
this.formats = void 0;
|
|
1520
1518
|
this.escapedCharacters = {
|
|
@@ -1529,8 +1527,8 @@ var AdapterDayjs = class {
|
|
|
1529
1527
|
}
|
|
1530
1528
|
return value.locale(expectedLocale);
|
|
1531
1529
|
};
|
|
1532
|
-
this.hasUTCPlugin = () => typeof
|
|
1533
|
-
this.hasTimezonePlugin = () => typeof
|
|
1530
|
+
this.hasUTCPlugin = () => typeof dayjs.utc !== "undefined";
|
|
1531
|
+
this.hasTimezonePlugin = () => typeof dayjs.tz !== "undefined";
|
|
1534
1532
|
this.isSame = (value, comparing, comparisonTemplate) => {
|
|
1535
1533
|
const comparingInValueTimezone = this.setTimezone(comparing, this.getTimezone(value));
|
|
1536
1534
|
return value.format(comparisonTemplate) === comparingInValueTimezone.format(comparisonTemplate);
|
|
@@ -1541,7 +1539,7 @@ var AdapterDayjs = class {
|
|
|
1541
1539
|
return void 0;
|
|
1542
1540
|
}
|
|
1543
1541
|
case "system": {
|
|
1544
|
-
return
|
|
1542
|
+
return dayjs.tz.guess();
|
|
1545
1543
|
}
|
|
1546
1544
|
default: {
|
|
1547
1545
|
return timezone;
|
|
@@ -1549,20 +1547,24 @@ var AdapterDayjs = class {
|
|
|
1549
1547
|
}
|
|
1550
1548
|
};
|
|
1551
1549
|
this.createSystemDate = (value) => {
|
|
1550
|
+
let date;
|
|
1552
1551
|
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
1553
|
-
const timezone =
|
|
1554
|
-
if (timezone
|
|
1555
|
-
|
|
1552
|
+
const timezone = dayjs.tz.guess();
|
|
1553
|
+
if (timezone === "UTC") {
|
|
1554
|
+
date = dayjs(value);
|
|
1555
|
+
} else {
|
|
1556
|
+
date = dayjs.tz(value, timezone);
|
|
1556
1557
|
}
|
|
1557
|
-
|
|
1558
|
+
} else {
|
|
1559
|
+
date = dayjs(value);
|
|
1558
1560
|
}
|
|
1559
|
-
return
|
|
1561
|
+
return this.setLocaleToValue(date);
|
|
1560
1562
|
};
|
|
1561
1563
|
this.createUTCDate = (value) => {
|
|
1562
1564
|
if (!this.hasUTCPlugin()) {
|
|
1563
1565
|
throw new Error(MISSING_UTC_PLUGIN);
|
|
1564
1566
|
}
|
|
1565
|
-
return
|
|
1567
|
+
return this.setLocaleToValue(dayjs.utc(value));
|
|
1566
1568
|
};
|
|
1567
1569
|
this.createTZDate = (value, timezone) => {
|
|
1568
1570
|
if (!this.hasUTCPlugin()) {
|
|
@@ -1572,10 +1574,10 @@ var AdapterDayjs = class {
|
|
|
1572
1574
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
1573
1575
|
}
|
|
1574
1576
|
const keepLocalTime = value !== void 0 && !value.endsWith("Z");
|
|
1575
|
-
return
|
|
1577
|
+
return this.setLocaleToValue(dayjs(value).tz(this.cleanTimezone(timezone), keepLocalTime));
|
|
1576
1578
|
};
|
|
1577
1579
|
this.getLocaleFormats = () => {
|
|
1578
|
-
const locales =
|
|
1580
|
+
const locales = dayjs.Ls;
|
|
1579
1581
|
const locale = this.locale || "en";
|
|
1580
1582
|
let localeObject = locales[locale];
|
|
1581
1583
|
if (localeObject === void 0) {
|
|
@@ -1604,20 +1606,15 @@ var AdapterDayjs = class {
|
|
|
1604
1606
|
if (value === null) {
|
|
1605
1607
|
return null;
|
|
1606
1608
|
}
|
|
1607
|
-
let parsedValue;
|
|
1608
1609
|
if (timezone === "UTC") {
|
|
1609
|
-
|
|
1610
|
-
} else if (timezone === "system" || timezone === "default" && !this.hasTimezonePlugin()) {
|
|
1611
|
-
parsedValue = this.createSystemDate(value);
|
|
1612
|
-
} else {
|
|
1613
|
-
parsedValue = this.createTZDate(value, timezone);
|
|
1610
|
+
return this.createUTCDate(value);
|
|
1614
1611
|
}
|
|
1615
|
-
if (
|
|
1616
|
-
return
|
|
1612
|
+
if (timezone === "system" || timezone === "default" && !this.hasTimezonePlugin()) {
|
|
1613
|
+
return this.createSystemDate(value);
|
|
1617
1614
|
}
|
|
1618
|
-
return
|
|
1615
|
+
return this.createTZDate(value, timezone);
|
|
1619
1616
|
};
|
|
1620
|
-
this.getInvalidDate = () =>
|
|
1617
|
+
this.getInvalidDate = () => dayjs(/* @__PURE__ */ new Date("Invalid date"));
|
|
1621
1618
|
this.getTimezone = (value) => {
|
|
1622
1619
|
if (this.hasTimezonePlugin()) {
|
|
1623
1620
|
const zone = value.$x?.$timezone;
|
|
@@ -1649,7 +1646,7 @@ var AdapterDayjs = class {
|
|
|
1649
1646
|
}
|
|
1650
1647
|
throw new Error(MISSING_TIMEZONE_PLUGIN);
|
|
1651
1648
|
}
|
|
1652
|
-
return
|
|
1649
|
+
return this.setLocaleToValue(dayjs.tz(value, this.cleanTimezone(timezone)));
|
|
1653
1650
|
};
|
|
1654
1651
|
this.toJsDate = (value) => {
|
|
1655
1652
|
return value.toDate();
|
|
@@ -1658,7 +1655,7 @@ var AdapterDayjs = class {
|
|
|
1658
1655
|
if (value === "") {
|
|
1659
1656
|
return null;
|
|
1660
1657
|
}
|
|
1661
|
-
return
|
|
1658
|
+
return dayjs(value, format, this.locale, true);
|
|
1662
1659
|
};
|
|
1663
1660
|
this.getCurrentLocaleCode = () => {
|
|
1664
1661
|
return this.locale || "en";
|
|
@@ -1684,7 +1681,7 @@ var AdapterDayjs = class {
|
|
|
1684
1681
|
return this.formatByString(value, this.formats[formatKey]);
|
|
1685
1682
|
};
|
|
1686
1683
|
this.formatByString = (value, formatString) => {
|
|
1687
|
-
return this.
|
|
1684
|
+
return this.setLocaleToValue(value).format(formatString);
|
|
1688
1685
|
};
|
|
1689
1686
|
this.formatNumber = (numberToFormat) => {
|
|
1690
1687
|
return numberToFormat;
|
|
@@ -1768,25 +1765,25 @@ var AdapterDayjs = class {
|
|
|
1768
1765
|
return this.adjustOffset(value.endOf("day"));
|
|
1769
1766
|
};
|
|
1770
1767
|
this.addYears = (value, amount) => {
|
|
1771
|
-
return this.adjustOffset(
|
|
1768
|
+
return this.adjustOffset(value.add(amount, "year"));
|
|
1772
1769
|
};
|
|
1773
1770
|
this.addMonths = (value, amount) => {
|
|
1774
|
-
return this.adjustOffset(
|
|
1771
|
+
return this.adjustOffset(value.add(amount, "month"));
|
|
1775
1772
|
};
|
|
1776
1773
|
this.addWeeks = (value, amount) => {
|
|
1777
|
-
return this.adjustOffset(
|
|
1774
|
+
return this.adjustOffset(value.add(amount, "week"));
|
|
1778
1775
|
};
|
|
1779
1776
|
this.addDays = (value, amount) => {
|
|
1780
|
-
return this.adjustOffset(
|
|
1777
|
+
return this.adjustOffset(value.add(amount, "day"));
|
|
1781
1778
|
};
|
|
1782
1779
|
this.addHours = (value, amount) => {
|
|
1783
|
-
return this.adjustOffset(
|
|
1780
|
+
return this.adjustOffset(value.add(amount, "hour"));
|
|
1784
1781
|
};
|
|
1785
1782
|
this.addMinutes = (value, amount) => {
|
|
1786
|
-
return this.adjustOffset(
|
|
1783
|
+
return this.adjustOffset(value.add(amount, "minute"));
|
|
1787
1784
|
};
|
|
1788
1785
|
this.addSeconds = (value, amount) => {
|
|
1789
|
-
return this.adjustOffset(
|
|
1786
|
+
return this.adjustOffset(value.add(amount, "second"));
|
|
1790
1787
|
};
|
|
1791
1788
|
this.getYear = (value) => {
|
|
1792
1789
|
return value.year();
|
|
@@ -1862,10 +1859,9 @@ var AdapterDayjs = class {
|
|
|
1862
1859
|
}
|
|
1863
1860
|
return years;
|
|
1864
1861
|
};
|
|
1865
|
-
this.dayjs = withLocale(defaultDayjs, _locale);
|
|
1866
1862
|
this.locale = _locale;
|
|
1867
1863
|
this.formats = _extends({}, defaultFormats, formats);
|
|
1868
|
-
|
|
1864
|
+
dayjs.extend(customParseFormatPlugin);
|
|
1869
1865
|
}
|
|
1870
1866
|
getDayOfWeek(value) {
|
|
1871
1867
|
return value.day() + 1;
|
|
@@ -2302,7 +2298,7 @@ var FormCheckbox = (props) => {
|
|
|
2302
2298
|
|
|
2303
2299
|
// src/components/form/FormDatePicker.tsx
|
|
2304
2300
|
import { DatePicker } from "@mui/x-date-pickers-pro";
|
|
2305
|
-
import
|
|
2301
|
+
import dayjs2 from "dayjs";
|
|
2306
2302
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2307
2303
|
var FormDatePicker = (props) => {
|
|
2308
2304
|
const field = useFieldContext();
|
|
@@ -2311,7 +2307,7 @@ var FormDatePicker = (props) => {
|
|
|
2311
2307
|
DatePicker,
|
|
2312
2308
|
{
|
|
2313
2309
|
name: field.name,
|
|
2314
|
-
value: field.state.value ?
|
|
2310
|
+
value: field.state.value ? dayjs2(field.state.value) : null,
|
|
2315
2311
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
2316
2312
|
slotProps: {
|
|
2317
2313
|
textField: {
|
|
@@ -2330,7 +2326,7 @@ var FormDatePicker = (props) => {
|
|
|
2330
2326
|
|
|
2331
2327
|
// src/components/form/FormDateTimePicker.tsx
|
|
2332
2328
|
import { DateTimePicker } from "@mui/x-date-pickers-pro";
|
|
2333
|
-
import
|
|
2329
|
+
import dayjs3 from "dayjs";
|
|
2334
2330
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2335
2331
|
var FormDateTimePicker = (props) => {
|
|
2336
2332
|
const field = useFieldContext();
|
|
@@ -2339,7 +2335,7 @@ var FormDateTimePicker = (props) => {
|
|
|
2339
2335
|
DateTimePicker,
|
|
2340
2336
|
{
|
|
2341
2337
|
name: field.name,
|
|
2342
|
-
value: field.state.value ?
|
|
2338
|
+
value: field.state.value ? dayjs3(field.state.value) : null,
|
|
2343
2339
|
onChange: (value) => field.handleChange(value ? value.format() : null),
|
|
2344
2340
|
slotProps: {
|
|
2345
2341
|
textField: {
|