@pingux/astro 2.70.0-alpha.2 → 2.70.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/lib/cjs/components/AccordionItem/AccordionItem.d.ts +1 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.js +1 -1
- package/lib/cjs/components/Calendar/Calendar.js +4 -0
- package/lib/cjs/components/Calendar/Calendar.mdx +1 -1
- package/lib/cjs/components/Calendar/Calendar.test.js +1 -4
- package/lib/cjs/components/Calendar/CalendarCell.js +1 -1
- package/lib/cjs/components/DatePicker/DatePicker.test.js +62 -6
- package/lib/cjs/components/RangeCalendar/RangeCalendar.d.ts +7 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.js +100 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.mdx +39 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.stories.d.ts +103 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.stories.js +131 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.styles.d.ts +104 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.styles.js +118 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.test.d.ts +1 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.test.js +217 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarCell.d.ts +4 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarCell.js +96 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarGrid.d.ts +4 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarGrid.js +70 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarHeader.d.ts +4 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarHeader.js +85 -0
- package/lib/cjs/components/RangeCalendar/index.d.ts +2 -0
- package/lib/cjs/components/RangeCalendar/index.js +33 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +45 -26
- package/lib/cjs/styles/variants/variants.js +2 -0
- package/lib/cjs/types/calendar.d.ts +51 -16
- package/lib/components/AccordionItem/AccordionItem.js +0 -3
- package/lib/components/Calendar/Calendar.js +4 -0
- package/lib/components/Calendar/Calendar.mdx +1 -1
- package/lib/components/Calendar/Calendar.test.js +1 -4
- package/lib/components/Calendar/CalendarCell.js +1 -1
- package/lib/components/DatePicker/DatePicker.test.js +62 -6
- package/lib/components/RangeCalendar/RangeCalendar.js +86 -0
- package/lib/components/RangeCalendar/RangeCalendar.mdx +39 -0
- package/lib/components/RangeCalendar/RangeCalendar.stories.js +112 -0
- package/lib/components/RangeCalendar/RangeCalendar.styles.js +110 -0
- package/lib/components/RangeCalendar/RangeCalendar.test.js +208 -0
- package/lib/components/RangeCalendar/RangeCalendarCell.js +82 -0
- package/lib/components/RangeCalendar/RangeCalendarGrid.js +61 -0
- package/lib/components/RangeCalendar/RangeCalendarHeader.js +76 -0
- package/lib/components/RangeCalendar/index.js +2 -0
- package/lib/index.js +2 -0
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60, _context61, _context62, _context63, _context64, _context65, _context66, _context67, _context68, _context69, _context70, _context71, _context72, _context73, _context74;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27, _context28, _context29, _context30, _context31, _context32, _context33, _context34, _context35, _context36, _context37, _context38, _context39, _context40, _context41, _context42, _context43, _context44, _context45, _context46, _context47, _context48, _context49, _context50, _context51, _context52, _context53, _context54, _context55, _context56, _context57, _context58, _context59, _context60, _context61, _context62, _context63, _context64, _context65, _context66, _context67, _context68, _context69, _context70, _context71, _context72, _context73, _context74, _context75;
|
4
4
|
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
5
5
|
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
6
6
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
@@ -95,6 +95,7 @@ var _exportNames = {
|
|
95
95
|
Radio: true,
|
96
96
|
RadioField: true,
|
97
97
|
RadioGroupField: true,
|
98
|
+
RangeCalendar: true,
|
98
99
|
RequirementsList: true,
|
99
100
|
RockerButton: true,
|
100
101
|
RockerButtonGroup: true,
|
@@ -656,6 +657,12 @@ _Object$defineProperty(exports, "RadioGroupField", {
|
|
656
657
|
return _RadioGroupField["default"];
|
657
658
|
}
|
658
659
|
});
|
660
|
+
_Object$defineProperty(exports, "RangeCalendar", {
|
661
|
+
enumerable: true,
|
662
|
+
get: function get() {
|
663
|
+
return _RangeCalendar["default"];
|
664
|
+
}
|
665
|
+
});
|
659
666
|
_Object$defineProperty(exports, "RemovableBadge", {
|
660
667
|
enumerable: true,
|
661
668
|
get: function get() {
|
@@ -1480,8 +1487,20 @@ _forEachInstanceProperty(_context49 = _Object$keys(_RadioGroupField)).call(_cont
|
|
1480
1487
|
}
|
1481
1488
|
});
|
1482
1489
|
});
|
1490
|
+
var _RangeCalendar = _interopRequireWildcard(require("./components/RangeCalendar"));
|
1491
|
+
_forEachInstanceProperty(_context50 = _Object$keys(_RangeCalendar)).call(_context50, function (key) {
|
1492
|
+
if (key === "default" || key === "__esModule") return;
|
1493
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1494
|
+
if (key in exports && exports[key] === _RangeCalendar[key]) return;
|
1495
|
+
_Object$defineProperty(exports, key, {
|
1496
|
+
enumerable: true,
|
1497
|
+
get: function get() {
|
1498
|
+
return _RangeCalendar[key];
|
1499
|
+
}
|
1500
|
+
});
|
1501
|
+
});
|
1483
1502
|
var _RequirementsList = _interopRequireWildcard(require("./components/RequirementsList"));
|
1484
|
-
_forEachInstanceProperty(
|
1503
|
+
_forEachInstanceProperty(_context51 = _Object$keys(_RequirementsList)).call(_context51, function (key) {
|
1485
1504
|
if (key === "default" || key === "__esModule") return;
|
1486
1505
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1487
1506
|
if (key in exports && exports[key] === _RequirementsList[key]) return;
|
@@ -1493,7 +1512,7 @@ _forEachInstanceProperty(_context50 = _Object$keys(_RequirementsList)).call(_con
|
|
1493
1512
|
});
|
1494
1513
|
});
|
1495
1514
|
var _RockerButton = _interopRequireWildcard(require("./components/RockerButton"));
|
1496
|
-
_forEachInstanceProperty(
|
1515
|
+
_forEachInstanceProperty(_context52 = _Object$keys(_RockerButton)).call(_context52, function (key) {
|
1497
1516
|
if (key === "default" || key === "__esModule") return;
|
1498
1517
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1499
1518
|
if (key in exports && exports[key] === _RockerButton[key]) return;
|
@@ -1505,7 +1524,7 @@ _forEachInstanceProperty(_context51 = _Object$keys(_RockerButton)).call(_context
|
|
1505
1524
|
});
|
1506
1525
|
});
|
1507
1526
|
var _RockerButtonGroup = _interopRequireWildcard(require("./components/RockerButtonGroup"));
|
1508
|
-
_forEachInstanceProperty(
|
1527
|
+
_forEachInstanceProperty(_context53 = _Object$keys(_RockerButtonGroup)).call(_context53, function (key) {
|
1509
1528
|
if (key === "default" || key === "__esModule") return;
|
1510
1529
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1511
1530
|
if (key in exports && exports[key] === _RockerButtonGroup[key]) return;
|
@@ -1517,7 +1536,7 @@ _forEachInstanceProperty(_context52 = _Object$keys(_RockerButtonGroup)).call(_co
|
|
1517
1536
|
});
|
1518
1537
|
});
|
1519
1538
|
var _ScrollBox = _interopRequireWildcard(require("./components/ScrollBox"));
|
1520
|
-
_forEachInstanceProperty(
|
1539
|
+
_forEachInstanceProperty(_context54 = _Object$keys(_ScrollBox)).call(_context54, function (key) {
|
1521
1540
|
if (key === "default" || key === "__esModule") return;
|
1522
1541
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1523
1542
|
if (key in exports && exports[key] === _ScrollBox[key]) return;
|
@@ -1529,7 +1548,7 @@ _forEachInstanceProperty(_context53 = _Object$keys(_ScrollBox)).call(_context53,
|
|
1529
1548
|
});
|
1530
1549
|
});
|
1531
1550
|
var _SearchField = _interopRequireWildcard(require("./components/SearchField"));
|
1532
|
-
_forEachInstanceProperty(
|
1551
|
+
_forEachInstanceProperty(_context55 = _Object$keys(_SearchField)).call(_context55, function (key) {
|
1533
1552
|
if (key === "default" || key === "__esModule") return;
|
1534
1553
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1535
1554
|
if (key in exports && exports[key] === _SearchField[key]) return;
|
@@ -1541,7 +1560,7 @@ _forEachInstanceProperty(_context54 = _Object$keys(_SearchField)).call(_context5
|
|
1541
1560
|
});
|
1542
1561
|
});
|
1543
1562
|
var _SelectField = _interopRequireWildcard(require("./components/SelectField"));
|
1544
|
-
_forEachInstanceProperty(
|
1563
|
+
_forEachInstanceProperty(_context56 = _Object$keys(_SelectField)).call(_context56, function (key) {
|
1545
1564
|
if (key === "default" || key === "__esModule") return;
|
1546
1565
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1547
1566
|
if (key in exports && exports[key] === _SelectField[key]) return;
|
@@ -1553,7 +1572,7 @@ _forEachInstanceProperty(_context55 = _Object$keys(_SelectField)).call(_context5
|
|
1553
1572
|
});
|
1554
1573
|
});
|
1555
1574
|
var _Separator = _interopRequireWildcard(require("./components/Separator"));
|
1556
|
-
_forEachInstanceProperty(
|
1575
|
+
_forEachInstanceProperty(_context57 = _Object$keys(_Separator)).call(_context57, function (key) {
|
1557
1576
|
if (key === "default" || key === "__esModule") return;
|
1558
1577
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1559
1578
|
if (key in exports && exports[key] === _Separator[key]) return;
|
@@ -1565,7 +1584,7 @@ _forEachInstanceProperty(_context56 = _Object$keys(_Separator)).call(_context56,
|
|
1565
1584
|
});
|
1566
1585
|
});
|
1567
1586
|
var _Stepper = _interopRequireWildcard(require("./components/Stepper"));
|
1568
|
-
_forEachInstanceProperty(
|
1587
|
+
_forEachInstanceProperty(_context58 = _Object$keys(_Stepper)).call(_context58, function (key) {
|
1569
1588
|
if (key === "default" || key === "__esModule") return;
|
1570
1589
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1571
1590
|
if (key in exports && exports[key] === _Stepper[key]) return;
|
@@ -1577,7 +1596,7 @@ _forEachInstanceProperty(_context57 = _Object$keys(_Stepper)).call(_context57, f
|
|
1577
1596
|
});
|
1578
1597
|
});
|
1579
1598
|
var _Switch = _interopRequireWildcard(require("./components/Switch"));
|
1580
|
-
_forEachInstanceProperty(
|
1599
|
+
_forEachInstanceProperty(_context59 = _Object$keys(_Switch)).call(_context59, function (key) {
|
1581
1600
|
if (key === "default" || key === "__esModule") return;
|
1582
1601
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1583
1602
|
if (key in exports && exports[key] === _Switch[key]) return;
|
@@ -1589,7 +1608,7 @@ _forEachInstanceProperty(_context58 = _Object$keys(_Switch)).call(_context58, fu
|
|
1589
1608
|
});
|
1590
1609
|
});
|
1591
1610
|
var _SwitchField = _interopRequireWildcard(require("./components/SwitchField"));
|
1592
|
-
_forEachInstanceProperty(
|
1611
|
+
_forEachInstanceProperty(_context60 = _Object$keys(_SwitchField)).call(_context60, function (key) {
|
1593
1612
|
if (key === "default" || key === "__esModule") return;
|
1594
1613
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1595
1614
|
if (key in exports && exports[key] === _SwitchField[key]) return;
|
@@ -1601,7 +1620,7 @@ _forEachInstanceProperty(_context59 = _Object$keys(_SwitchField)).call(_context5
|
|
1601
1620
|
});
|
1602
1621
|
});
|
1603
1622
|
var _Tab = _interopRequireWildcard(require("./components/Tab"));
|
1604
|
-
_forEachInstanceProperty(
|
1623
|
+
_forEachInstanceProperty(_context61 = _Object$keys(_Tab)).call(_context61, function (key) {
|
1605
1624
|
if (key === "default" || key === "__esModule") return;
|
1606
1625
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1607
1626
|
if (key in exports && exports[key] === _Tab[key]) return;
|
@@ -1613,7 +1632,7 @@ _forEachInstanceProperty(_context60 = _Object$keys(_Tab)).call(_context60, funct
|
|
1613
1632
|
});
|
1614
1633
|
});
|
1615
1634
|
var _Table = _interopRequireWildcard(require("./components/Table"));
|
1616
|
-
_forEachInstanceProperty(
|
1635
|
+
_forEachInstanceProperty(_context62 = _Object$keys(_Table)).call(_context62, function (key) {
|
1617
1636
|
if (key === "default" || key === "__esModule") return;
|
1618
1637
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1619
1638
|
if (key in exports && exports[key] === _Table[key]) return;
|
@@ -1625,7 +1644,7 @@ _forEachInstanceProperty(_context61 = _Object$keys(_Table)).call(_context61, fun
|
|
1625
1644
|
});
|
1626
1645
|
});
|
1627
1646
|
var _TableBody = _interopRequireWildcard(require("./components/TableBody"));
|
1628
|
-
_forEachInstanceProperty(
|
1647
|
+
_forEachInstanceProperty(_context63 = _Object$keys(_TableBody)).call(_context63, function (key) {
|
1629
1648
|
if (key === "default" || key === "__esModule") return;
|
1630
1649
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1631
1650
|
if (key in exports && exports[key] === _TableBody[key]) return;
|
@@ -1637,7 +1656,7 @@ _forEachInstanceProperty(_context62 = _Object$keys(_TableBody)).call(_context62,
|
|
1637
1656
|
});
|
1638
1657
|
});
|
1639
1658
|
var _TableCaption = _interopRequireWildcard(require("./components/TableCaption"));
|
1640
|
-
_forEachInstanceProperty(
|
1659
|
+
_forEachInstanceProperty(_context64 = _Object$keys(_TableCaption)).call(_context64, function (key) {
|
1641
1660
|
if (key === "default" || key === "__esModule") return;
|
1642
1661
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1643
1662
|
if (key in exports && exports[key] === _TableCaption[key]) return;
|
@@ -1649,7 +1668,7 @@ _forEachInstanceProperty(_context63 = _Object$keys(_TableCaption)).call(_context
|
|
1649
1668
|
});
|
1650
1669
|
});
|
1651
1670
|
var _TableCell = _interopRequireWildcard(require("./components/TableCell"));
|
1652
|
-
_forEachInstanceProperty(
|
1671
|
+
_forEachInstanceProperty(_context65 = _Object$keys(_TableCell)).call(_context65, function (key) {
|
1653
1672
|
if (key === "default" || key === "__esModule") return;
|
1654
1673
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1655
1674
|
if (key in exports && exports[key] === _TableCell[key]) return;
|
@@ -1661,7 +1680,7 @@ _forEachInstanceProperty(_context64 = _Object$keys(_TableCell)).call(_context64,
|
|
1661
1680
|
});
|
1662
1681
|
});
|
1663
1682
|
var _TableHead = _interopRequireWildcard(require("./components/TableHead"));
|
1664
|
-
_forEachInstanceProperty(
|
1683
|
+
_forEachInstanceProperty(_context66 = _Object$keys(_TableHead)).call(_context66, function (key) {
|
1665
1684
|
if (key === "default" || key === "__esModule") return;
|
1666
1685
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1667
1686
|
if (key in exports && exports[key] === _TableHead[key]) return;
|
@@ -1673,7 +1692,7 @@ _forEachInstanceProperty(_context65 = _Object$keys(_TableHead)).call(_context65,
|
|
1673
1692
|
});
|
1674
1693
|
});
|
1675
1694
|
var _TableRow = _interopRequireWildcard(require("./components/TableRow"));
|
1676
|
-
_forEachInstanceProperty(
|
1695
|
+
_forEachInstanceProperty(_context67 = _Object$keys(_TableRow)).call(_context67, function (key) {
|
1677
1696
|
if (key === "default" || key === "__esModule") return;
|
1678
1697
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1679
1698
|
if (key in exports && exports[key] === _TableRow[key]) return;
|
@@ -1685,7 +1704,7 @@ _forEachInstanceProperty(_context66 = _Object$keys(_TableRow)).call(_context66,
|
|
1685
1704
|
});
|
1686
1705
|
});
|
1687
1706
|
var _Tabs = _interopRequireWildcard(require("./components/Tabs"));
|
1688
|
-
_forEachInstanceProperty(
|
1707
|
+
_forEachInstanceProperty(_context68 = _Object$keys(_Tabs)).call(_context68, function (key) {
|
1689
1708
|
if (key === "default" || key === "__esModule") return;
|
1690
1709
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1691
1710
|
if (key in exports && exports[key] === _Tabs[key]) return;
|
@@ -1697,7 +1716,7 @@ _forEachInstanceProperty(_context67 = _Object$keys(_Tabs)).call(_context67, func
|
|
1697
1716
|
});
|
1698
1717
|
});
|
1699
1718
|
var _Text = _interopRequireWildcard(require("./components/Text"));
|
1700
|
-
_forEachInstanceProperty(
|
1719
|
+
_forEachInstanceProperty(_context69 = _Object$keys(_Text)).call(_context69, function (key) {
|
1701
1720
|
if (key === "default" || key === "__esModule") return;
|
1702
1721
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1703
1722
|
if (key in exports && exports[key] === _Text[key]) return;
|
@@ -1709,7 +1728,7 @@ _forEachInstanceProperty(_context68 = _Object$keys(_Text)).call(_context68, func
|
|
1709
1728
|
});
|
1710
1729
|
});
|
1711
1730
|
var _TextArea = _interopRequireWildcard(require("./components/TextArea"));
|
1712
|
-
_forEachInstanceProperty(
|
1731
|
+
_forEachInstanceProperty(_context70 = _Object$keys(_TextArea)).call(_context70, function (key) {
|
1713
1732
|
if (key === "default" || key === "__esModule") return;
|
1714
1733
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1715
1734
|
if (key in exports && exports[key] === _TextArea[key]) return;
|
@@ -1721,7 +1740,7 @@ _forEachInstanceProperty(_context69 = _Object$keys(_TextArea)).call(_context69,
|
|
1721
1740
|
});
|
1722
1741
|
});
|
1723
1742
|
var _TextAreaField = _interopRequireWildcard(require("./components/TextAreaField"));
|
1724
|
-
_forEachInstanceProperty(
|
1743
|
+
_forEachInstanceProperty(_context71 = _Object$keys(_TextAreaField)).call(_context71, function (key) {
|
1725
1744
|
if (key === "default" || key === "__esModule") return;
|
1726
1745
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1727
1746
|
if (key in exports && exports[key] === _TextAreaField[key]) return;
|
@@ -1733,7 +1752,7 @@ _forEachInstanceProperty(_context70 = _Object$keys(_TextAreaField)).call(_contex
|
|
1733
1752
|
});
|
1734
1753
|
});
|
1735
1754
|
var _TextField = _interopRequireWildcard(require("./components/TextField"));
|
1736
|
-
_forEachInstanceProperty(
|
1755
|
+
_forEachInstanceProperty(_context72 = _Object$keys(_TextField)).call(_context72, function (key) {
|
1737
1756
|
if (key === "default" || key === "__esModule") return;
|
1738
1757
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1739
1758
|
if (key in exports && exports[key] === _TextField[key]) return;
|
@@ -1746,7 +1765,7 @@ _forEachInstanceProperty(_context71 = _Object$keys(_TextField)).call(_context71,
|
|
1746
1765
|
});
|
1747
1766
|
var _TimeZonePicker = _interopRequireDefault(require("./components/TimeZonePicker"));
|
1748
1767
|
var _TooltipTrigger = _interopRequireWildcard(require("./components/TooltipTrigger"));
|
1749
|
-
_forEachInstanceProperty(
|
1768
|
+
_forEachInstanceProperty(_context73 = _Object$keys(_TooltipTrigger)).call(_context73, function (key) {
|
1750
1769
|
if (key === "default" || key === "__esModule") return;
|
1751
1770
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1752
1771
|
if (key in exports && exports[key] === _TooltipTrigger[key]) return;
|
@@ -1758,7 +1777,7 @@ _forEachInstanceProperty(_context72 = _Object$keys(_TooltipTrigger)).call(_conte
|
|
1758
1777
|
});
|
1759
1778
|
});
|
1760
1779
|
var _TreeView = _interopRequireWildcard(require("./components/TreeView"));
|
1761
|
-
_forEachInstanceProperty(
|
1780
|
+
_forEachInstanceProperty(_context74 = _Object$keys(_TreeView)).call(_context74, function (key) {
|
1762
1781
|
if (key === "default" || key === "__esModule") return;
|
1763
1782
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1764
1783
|
if (key in exports && exports[key] === _TreeView[key]) return;
|
@@ -1770,7 +1789,7 @@ _forEachInstanceProperty(_context73 = _Object$keys(_TreeView)).call(_context73,
|
|
1770
1789
|
});
|
1771
1790
|
});
|
1772
1791
|
var _types = require("./types");
|
1773
|
-
_forEachInstanceProperty(
|
1792
|
+
_forEachInstanceProperty(_context75 = _Object$keys(_types)).call(_context75, function (key) {
|
1774
1793
|
if (key === "default" || key === "__esModule") return;
|
1775
1794
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
1776
1795
|
if (key in exports && exports[key] === _types[key]) return;
|
@@ -46,6 +46,7 @@ var _OverlayPanel = _interopRequireDefault(require("../../components/OverlayPane
|
|
46
46
|
var _PanelHeader = _interopRequireDefault(require("../../components/PanelHeader/PanelHeader.styles"));
|
47
47
|
var _PopoverMenu = _interopRequireDefault(require("../../components/PopoverMenu/PopoverMenu.styles"));
|
48
48
|
var _ProgressBar = _interopRequireDefault(require("../../components/ProgressBar/ProgressBar.styles"));
|
49
|
+
var _RangeCalendar = _interopRequireDefault(require("../../components/RangeCalendar/RangeCalendar.styles"));
|
49
50
|
var _RockerButton = _interopRequireDefault(require("../../components/RockerButton/RockerButton.styles"));
|
50
51
|
var _ScrollBox = _interopRequireDefault(require("../../components/ScrollBox/ScrollBox.styles"));
|
51
52
|
var _Separator = _interopRequireDefault(require("../../components/Separator/Separator.styles"));
|
@@ -67,6 +68,7 @@ var _default = _objectSpread({
|
|
67
68
|
breadcrumb: _Breadcrumb["default"],
|
68
69
|
buttonBar: _ButtonBar["default"],
|
69
70
|
calendar: _Calendar["default"],
|
71
|
+
rangeCalendar: _RangeCalendar["default"],
|
70
72
|
callout: _Callout["default"],
|
71
73
|
codeView: _CodeView["default"],
|
72
74
|
collapsiblePanel: _CollapsiblePanel["default"],
|
@@ -1,24 +1,31 @@
|
|
1
1
|
import { Key } from 'react';
|
2
2
|
import type { CalendarDate, CalendarDateTime, ZonedDateTime } from '@internationalized/date';
|
3
|
-
import { type CalendarState } from '@react-stately/calendar';
|
3
|
+
import { type CalendarState, type RangeCalendarState } from '@react-stately/calendar';
|
4
|
+
import type { AriaButtonProps } from '@react-types/button';
|
5
|
+
import type { DOMAttributes as AriaDOMAttributes } from '@react-types/shared';
|
4
6
|
import { DOMAttributes } from './shared/dom';
|
5
7
|
import { TestingAttributes } from './shared/test';
|
6
8
|
import { BoxProps } from './box';
|
7
9
|
export type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;
|
8
|
-
type calendarGridStateProps = CalendarState;
|
10
|
+
type calendarGridStateProps = CalendarState | RangeCalendarState;
|
11
|
+
type MappedDateValue<T> = T extends ZonedDateTime ? ZonedDateTime : T extends CalendarDateTime ? CalendarDateTime : T extends CalendarDate ? CalendarDate : never;
|
9
12
|
export interface RangeValue<T> {
|
10
13
|
/** The start value of the range. */
|
11
14
|
start: T;
|
12
15
|
/** The end value of the range. */
|
13
16
|
end: T;
|
14
17
|
}
|
15
|
-
export
|
16
|
-
|
17
|
-
|
18
|
+
export type StringOrRangeValue = RangeValue<DateValue> | {
|
19
|
+
start: string;
|
20
|
+
end: string;
|
21
|
+
};
|
22
|
+
export interface CalendarBaseProps extends BoxProps, TestingAttributes {
|
18
23
|
/** Prop to provide a custom default focused date (uncontrolled) */
|
19
|
-
defaultFocusedValue?: DateValue;
|
20
|
-
/**
|
21
|
-
|
24
|
+
defaultFocusedValue?: DateValue | string;
|
25
|
+
/** The maximum allowed date that a user may select. */
|
26
|
+
maxValue?: DateValue | string;
|
27
|
+
/** The minimum allowed date that a user may select. */
|
28
|
+
minValue?: DateValue | string;
|
22
29
|
/** custom week days for other calendars */
|
23
30
|
customWeekDays?: string[];
|
24
31
|
/** Whether the element should receive focus on render. */
|
@@ -31,39 +38,67 @@ export interface CalendarProps extends BoxProps, TestingAttributes {
|
|
31
38
|
*
|
32
39
|
* (date?: DateValue) => boolean
|
33
40
|
*/
|
34
|
-
isDateUnavailable?: (date:
|
41
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
35
42
|
/** Whether the calendar is disabled. */
|
36
43
|
isDisabled?: boolean;
|
37
44
|
/** Whether the calendar dates are only focusable. */
|
38
45
|
isReadOnly?: boolean;
|
39
46
|
/** Whether user input is required on the input before form submission. */
|
40
47
|
isRequired?: boolean;
|
41
|
-
/** The maximum allowed date that a user may select. */
|
42
|
-
maxValue?: DateValue | string;
|
43
|
-
/** The minimum allowed date that a user may select. */
|
44
|
-
minValue?: DateValue | string;
|
45
48
|
/** Handler that is called when the element loses focus. */
|
46
49
|
onBlur?: () => void;
|
47
|
-
/** Handler that is called when the element's selection state changes. */
|
48
|
-
onChange?: () => void;
|
49
50
|
/** Handler that is called when the element receives focus. */
|
50
51
|
onFocus?: () => void;
|
51
52
|
/** Handler that is called when the element's focus status changes. */
|
52
|
-
onFocusChange?: () => void;
|
53
|
+
onFocusChange?: (date: CalendarDate) => void;
|
53
54
|
/** Handler that is called when a key is pressed. */
|
54
55
|
onKeyDown?: () => void;
|
55
56
|
/** Handler that is called when a key is released. */
|
56
57
|
onKeyUp?: () => void;
|
57
58
|
}
|
59
|
+
export interface CalendarProps extends Omit<CalendarBaseProps, 'onChange'> {
|
60
|
+
/** Prop to provide a custom default date (uncontrolled) */
|
61
|
+
defaultValue?: DateValue | string;
|
62
|
+
/** Prop to provide a custom default focused date (uncontrolled) */
|
63
|
+
value?: DateValue | string;
|
64
|
+
/** Handler that is called when the value changes. */
|
65
|
+
onChange?: (value: MappedDateValue<DateValue>) => void;
|
66
|
+
}
|
67
|
+
export interface RangeCalendarProps extends Omit<CalendarBaseProps, 'onChange'> {
|
68
|
+
/** Prop to provide a custom default date (uncontrolled) */
|
69
|
+
defaultValue?: StringOrRangeValue | null;
|
70
|
+
/** The currently selected date range. */
|
71
|
+
value?: StringOrRangeValue | null;
|
72
|
+
/** Handler that is called when the value changes. */
|
73
|
+
onChange?: (value: RangeValue<MappedDateValue<DateValue>>) => void;
|
74
|
+
}
|
75
|
+
export interface RangeCalendarHeaderProps {
|
76
|
+
state: RangeCalendarState;
|
77
|
+
calendarProps: AriaDOMAttributes;
|
78
|
+
prevButtonProps: AriaButtonProps;
|
79
|
+
nextButtonProps: AriaButtonProps;
|
80
|
+
}
|
58
81
|
export interface CalendarGridProps {
|
59
82
|
/** State object that is passed in from the useCalendar hook */
|
60
83
|
state: calendarGridStateProps;
|
61
84
|
/** Custom week days for other international calendars */
|
62
85
|
customWeekDays?: Array<string>;
|
63
86
|
}
|
87
|
+
export interface RangeCalendarGridProps {
|
88
|
+
/** State object that is passed in from the useRangeCalendar hook */
|
89
|
+
state: RangeCalendarState;
|
90
|
+
/** The offset to apply to the calendar */
|
91
|
+
offset?: object;
|
92
|
+
}
|
64
93
|
export interface CalendarCellProps extends DOMAttributes {
|
65
94
|
state: calendarGridStateProps;
|
66
95
|
date: object;
|
67
96
|
key?: Key;
|
68
97
|
}
|
98
|
+
export interface RangeCalendarCellProps extends DOMAttributes {
|
99
|
+
state: RangeCalendarState;
|
100
|
+
date: object;
|
101
|
+
key?: Key;
|
102
|
+
currentMonth: CalendarDate;
|
103
|
+
}
|
69
104
|
export {};
|
@@ -9,9 +9,6 @@ import MenuUp from '@pingux/mdi-react/MenuUpIcon';
|
|
9
9
|
import { useAccordionItem } from '@react-aria/accordion';
|
10
10
|
import { useFocusRing } from '@react-aria/focus';
|
11
11
|
import { useHover } from '@react-aria/interactions';
|
12
|
-
|
13
|
-
// eslint-disable-next-line import/no-unresolved
|
14
|
-
|
15
12
|
import { Button as ThemeUIButton } from 'theme-ui';
|
16
13
|
import { AccordionContext } from '../../context/AccordionContext';
|
17
14
|
import { useStatusClasses } from '../../hooks';
|
@@ -53,6 +53,10 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
53
53
|
prevButtonProps = _ref.prevButtonProps,
|
54
54
|
nextButtonProps = _ref.nextButtonProps,
|
55
55
|
title = _ref.title;
|
56
|
+
|
57
|
+
// to remove warning for unknown event handler property `onFocusChange`.
|
58
|
+
delete prevButtonProps.onFocusChange;
|
59
|
+
delete nextButtonProps.onFocusChange;
|
56
60
|
var _useState = useState(null),
|
57
61
|
_useState2 = _slicedToArray(_useState, 2),
|
58
62
|
yearChangeDirection = _useState2[0],
|
@@ -25,7 +25,7 @@ These keys provide additional functionality to the component.
|
|
25
25
|
| Tab | Components in the calendar are focusable and follow the page tab sequence. |
|
26
26
|
| Shift + Tab | Moves focus to the previous focusable component. |
|
27
27
|
| Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home | Shifts the focus to the first calendar date. |
|
28
|
-
| Pressing
|
28
|
+
| Pressing End:(Fn + left Arrow Key) Or Control or Command + End | Shifts the focus to the last calendar date. |
|
29
29
|
| Arrow key | Navigates up, down, right, and left across the calendar. |
|
30
30
|
| Page up | Changes the grid of dates to the previous month. |
|
31
31
|
| Page down | Changes the grid of dates to the next month. |
|
@@ -209,15 +209,12 @@ test('allows users to select and navigate through calendar items', function () {
|
|
209
209
|
});
|
210
210
|
test('readonly calendar', function () {
|
211
211
|
getComponent({
|
212
|
-
isReadOnly: true
|
213
|
-
defaultValue: '2022-08-10'
|
212
|
+
isReadOnly: true
|
214
213
|
});
|
215
214
|
expect(screen.queryByRole('grid')).toHaveAttribute('aria-readonly', 'true');
|
216
215
|
var dateButtons = screen.queryAllByRole('button');
|
217
216
|
userEvent.click(dateButtons[4]);
|
218
217
|
expect(dateButtons[4]).not.toHaveClass('is-selected');
|
219
|
-
expect(dateButtons[4]).toHaveFocus();
|
220
|
-
expect(dateButtons[4]).toHaveAttribute('tabindex', '0');
|
221
218
|
});
|
222
219
|
test('disabled calendar date', function () {
|
223
220
|
getComponent({
|
@@ -49,7 +49,7 @@ var CalendarCell = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
49
49
|
setFocused(false);
|
50
50
|
focusNextPage();
|
51
51
|
}
|
52
|
-
}, [
|
52
|
+
}, [focusNextPage, focusPreviousPage, formattedDate, state, setFocused, cellRef]);
|
53
53
|
var _useHover = useHover({}),
|
54
54
|
hoverProps = _useHover.hoverProps,
|
55
55
|
isHovered = _useHover.isHovered;
|
@@ -619,12 +619,6 @@ test('dateField should handle autofocus when deleting segments from middle', fun
|
|
619
619
|
key: 'Backspace'
|
620
620
|
});
|
621
621
|
}
|
622
|
-
fireEvent.keyDown(year, {
|
623
|
-
key: 'Backspace'
|
624
|
-
});
|
625
|
-
fireEvent.keyUp(year, {
|
626
|
-
key: 'Backspace'
|
627
|
-
});
|
628
622
|
expect(day).toHaveFocus();
|
629
623
|
expect(hiddenInput).toHaveValue('');
|
630
624
|
});
|
@@ -664,6 +658,68 @@ test('segment focus should move to the year if month is already empty', function
|
|
664
658
|
}
|
665
659
|
expect(year).toHaveFocus();
|
666
660
|
});
|
661
|
+
test('segment focus stay on year if all are empty for year segment', function () {
|
662
|
+
getComponent({
|
663
|
+
defaultValue: ''
|
664
|
+
});
|
665
|
+
var hiddenInput = screen.queryByTestId('date-field');
|
666
|
+
var inputButtons = screen.queryAllByRole('spinbutton');
|
667
|
+
var year = inputButtons[0];
|
668
|
+
expect(hiddenInput).toHaveValue('');
|
669
|
+
act(function () {
|
670
|
+
year.focus();
|
671
|
+
});
|
672
|
+
expect(year).toHaveFocus();
|
673
|
+
fireEvent.keyDown(year, {
|
674
|
+
key: 'Backspace'
|
675
|
+
});
|
676
|
+
fireEvent.keyUp(year, {
|
677
|
+
key: 'Backspace'
|
678
|
+
});
|
679
|
+
expect(year).toHaveFocus();
|
680
|
+
});
|
681
|
+
test('segment focus should move to previous if all are empty for month segment', function () {
|
682
|
+
getComponent({
|
683
|
+
defaultValue: ''
|
684
|
+
});
|
685
|
+
var hiddenInput = screen.queryByTestId('date-field');
|
686
|
+
var inputButtons = screen.queryAllByRole('spinbutton');
|
687
|
+
var month = inputButtons[1];
|
688
|
+
var year = inputButtons[0];
|
689
|
+
expect(hiddenInput).toHaveValue('');
|
690
|
+
act(function () {
|
691
|
+
month.focus();
|
692
|
+
});
|
693
|
+
expect(month).toHaveFocus();
|
694
|
+
fireEvent.keyDown(month, {
|
695
|
+
key: 'Backspace'
|
696
|
+
});
|
697
|
+
fireEvent.keyUp(month, {
|
698
|
+
key: 'Backspace'
|
699
|
+
});
|
700
|
+
expect(year).toHaveFocus();
|
701
|
+
});
|
702
|
+
test('segment focus should move to previous if all are empty for day segment', function () {
|
703
|
+
getComponent({
|
704
|
+
defaultValue: ''
|
705
|
+
});
|
706
|
+
var hiddenInput = screen.queryByTestId('date-field');
|
707
|
+
var inputButtons = screen.queryAllByRole('spinbutton');
|
708
|
+
var day = inputButtons[2];
|
709
|
+
var month = inputButtons[1];
|
710
|
+
expect(hiddenInput).toHaveValue('');
|
711
|
+
act(function () {
|
712
|
+
day.focus();
|
713
|
+
});
|
714
|
+
expect(day).toHaveFocus();
|
715
|
+
fireEvent.keyDown(day, {
|
716
|
+
key: 'Backspace'
|
717
|
+
});
|
718
|
+
fireEvent.keyUp(day, {
|
719
|
+
key: 'Backspace'
|
720
|
+
});
|
721
|
+
expect(month).toHaveFocus();
|
722
|
+
});
|
667
723
|
test('should add the correct number of padded 0 to year, month and day', function () {
|
668
724
|
getComponent({
|
669
725
|
defaultValue: '0009-08-02'
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
|
+
import React, { forwardRef } from 'react';
|
14
|
+
import { createCalendar, parseDate } from '@internationalized/date';
|
15
|
+
import { useRangeCalendar } from '@react-aria/calendar';
|
16
|
+
import { useLocale } from '@react-aria/i18n';
|
17
|
+
import { useRangeCalendarState } from '@react-stately/calendar';
|
18
|
+
import { useLocalOrForwardRef } from '../../hooks';
|
19
|
+
import { Box } from '../../index';
|
20
|
+
import RangeCalendarGrid from './RangeCalendarGrid';
|
21
|
+
import RangeCalendarHeader from './RangeCalendarHeader';
|
22
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
23
|
+
export var parseDateIfString = function parseDateIfString(value) {
|
24
|
+
return typeof value === 'string' ? parseDate(value) : value;
|
25
|
+
};
|
26
|
+
export var parseDateRangeIfString = function parseDateRangeIfString(value) {
|
27
|
+
var start = parseDateIfString(value.start);
|
28
|
+
var end = parseDateIfString(value.end);
|
29
|
+
return {
|
30
|
+
start: start,
|
31
|
+
end: end
|
32
|
+
};
|
33
|
+
};
|
34
|
+
var RangeCalendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
35
|
+
var defaultFocusedValue = props.defaultFocusedValue,
|
36
|
+
defaultValue = props.defaultValue,
|
37
|
+
hasAutoFocus = props.hasAutoFocus,
|
38
|
+
maxValue = props.maxValue,
|
39
|
+
minValue = props.minValue,
|
40
|
+
value = props.value;
|
41
|
+
var _useLocale = useLocale(),
|
42
|
+
locale = _useLocale.locale;
|
43
|
+
var calenderRangeRef = useLocalOrForwardRef(ref);
|
44
|
+
var parsedDates = {
|
45
|
+
value: value && parseDateRangeIfString(value),
|
46
|
+
defaultValue: defaultValue && parseDateRangeIfString(defaultValue),
|
47
|
+
defaultFocusedValue: defaultFocusedValue && parseDateIfString(defaultFocusedValue),
|
48
|
+
maxValue: maxValue && parseDateIfString(maxValue),
|
49
|
+
minValue: minValue && parseDateIfString(minValue)
|
50
|
+
};
|
51
|
+
var state = useRangeCalendarState(_objectSpread(_objectSpread(_objectSpread({
|
52
|
+
autoFocus: hasAutoFocus
|
53
|
+
}, props), parsedDates), {}, {
|
54
|
+
visibleDuration: {
|
55
|
+
months: 2
|
56
|
+
},
|
57
|
+
pageBehavior: 'single',
|
58
|
+
locale: locale,
|
59
|
+
createCalendar: createCalendar
|
60
|
+
}));
|
61
|
+
var _ref = useRangeCalendar(_objectSpread(_objectSpread({}, props), parsedDates), state, calenderRangeRef),
|
62
|
+
calendarProps = _ref.calendarProps,
|
63
|
+
prevButtonProps = _ref.prevButtonProps,
|
64
|
+
nextButtonProps = _ref.nextButtonProps;
|
65
|
+
return ___EmotionJSX(Box, _extends({}, calendarProps, {
|
66
|
+
ref: calenderRangeRef,
|
67
|
+
variant: "rangeCalendar.calendarContainer",
|
68
|
+
role: "group"
|
69
|
+
}), ___EmotionJSX(RangeCalendarHeader, {
|
70
|
+
state: state,
|
71
|
+
calendarProps: calendarProps,
|
72
|
+
prevButtonProps: prevButtonProps,
|
73
|
+
nextButtonProps: nextButtonProps
|
74
|
+
}), ___EmotionJSX(Box, {
|
75
|
+
isRow: true,
|
76
|
+
gap: "26px"
|
77
|
+
}, ___EmotionJSX(RangeCalendarGrid, {
|
78
|
+
state: state
|
79
|
+
}), ___EmotionJSX(RangeCalendarGrid, {
|
80
|
+
state: state,
|
81
|
+
offset: {
|
82
|
+
months: 1
|
83
|
+
}
|
84
|
+
})));
|
85
|
+
});
|
86
|
+
export default RangeCalendar;
|