@3mo/date-time-fields 0.15.1 → 0.16.1
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/FieldDateTimeBase.d.ts +1 -0
- package/dist/FieldDateTimeBase.d.ts.map +1 -1
- package/dist/FieldDateTimeBase.js +1 -1
- package/dist/FieldTime.d.ts +43 -4
- package/dist/FieldTime.d.ts.map +1 -1
- package/dist/FieldTime.js +157 -9
- package/dist/FieldTimeController.d.ts +72 -0
- package/dist/FieldTimeController.d.ts.map +1 -0
- package/dist/FieldTimeController.js +110 -0
- package/dist/custom-elements.json +140 -103
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/segments/DateTimeSegment.d.ts +20 -0
- package/dist/segments/DateTimeSegment.d.ts.map +1 -0
- package/dist/segments/DateTimeSegment.js +4 -0
- package/dist/segments/DateTimeSegmenter.d.ts +68 -0
- package/dist/segments/DateTimeSegmenter.d.ts.map +1 -0
- package/dist/segments/DateTimeSegmenter.js +247 -0
- package/dist/segments/DateTimeSegmentsController.d.ts +90 -0
- package/dist/segments/DateTimeSegmentsController.d.ts.map +1 -0
- package/dist/segments/DateTimeSegmentsController.js +235 -0
- package/dist/segments/index.d.ts +5 -0
- package/dist/segments/index.d.ts.map +1 -0
- package/dist/segments/index.js +4 -0
- package/dist/segments/segmentsStyles.d.ts +3 -0
- package/dist/segments/segmentsStyles.d.ts.map +1 -0
- package/dist/segments/segmentsStyles.js +46 -0
- package/dist/selection/Calendar.d.ts.map +1 -1
- package/dist/selection/Calendar.js +3 -0
- package/dist/selection/HourList.d.ts +4 -0
- package/dist/selection/HourList.d.ts.map +1 -1
- package/dist/selection/HourList.js +24 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
|
@@ -1526,26 +1526,17 @@
|
|
|
1526
1526
|
{
|
|
1527
1527
|
"name": "mo-field-time",
|
|
1528
1528
|
"path": ".\\packages\\DateTimeFields\\FieldTime.ts",
|
|
1529
|
+
"description": "[object Object],[object Object],[object Object]",
|
|
1529
1530
|
"attributes": [
|
|
1530
1531
|
{
|
|
1531
|
-
"name": "
|
|
1532
|
-
"
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
"name": "maxLength",
|
|
1536
|
-
"type": "number | undefined"
|
|
1537
|
-
},
|
|
1538
|
-
{
|
|
1539
|
-
"name": "pattern",
|
|
1540
|
-
"type": "string | undefined"
|
|
1541
|
-
},
|
|
1542
|
-
{
|
|
1543
|
-
"name": "autoComplete",
|
|
1544
|
-
"type": "FieldTextAutoComplete | undefined"
|
|
1532
|
+
"name": "open",
|
|
1533
|
+
"description": "Whether the time picker is open",
|
|
1534
|
+
"type": "boolean",
|
|
1535
|
+
"default": "false"
|
|
1545
1536
|
},
|
|
1546
1537
|
{
|
|
1547
|
-
"name": "
|
|
1548
|
-
"description": "
|
|
1538
|
+
"name": "pickerHidden",
|
|
1539
|
+
"description": "Hide the time picker",
|
|
1549
1540
|
"type": "boolean",
|
|
1550
1541
|
"default": "false"
|
|
1551
1542
|
},
|
|
@@ -1555,9 +1546,26 @@
|
|
|
1555
1546
|
"type": "boolean",
|
|
1556
1547
|
"default": "false"
|
|
1557
1548
|
},
|
|
1549
|
+
{
|
|
1550
|
+
"name": "precision",
|
|
1551
|
+
"description": "'minute' (default) or 'second'",
|
|
1552
|
+
"type": "FieldDateTimePrecision",
|
|
1553
|
+
"default": "\"Minute\""
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"name": "hourCycle",
|
|
1557
|
+
"description": "The hour cycle of the segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention.",
|
|
1558
|
+
"type": "HourCycle | undefined"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"name": "shortcutReferenceDate",
|
|
1562
|
+
"description": "The date the units the user leaves out are taken from. Defaults to now.",
|
|
1563
|
+
"type": "DateTime",
|
|
1564
|
+
"default": "\"new DateTime()\""
|
|
1565
|
+
},
|
|
1558
1566
|
{
|
|
1559
1567
|
"name": "value",
|
|
1560
|
-
"description": "The
|
|
1568
|
+
"description": "The time as `HH:mm` or `HH:mm:ss`",
|
|
1561
1569
|
"type": "string | undefined"
|
|
1562
1570
|
},
|
|
1563
1571
|
{
|
|
@@ -1587,37 +1595,21 @@
|
|
|
1587
1595
|
],
|
|
1588
1596
|
"properties": [
|
|
1589
1597
|
{
|
|
1590
|
-
"name": "
|
|
1591
|
-
"type": "
|
|
1592
|
-
|
|
1593
|
-
{
|
|
1594
|
-
"name": "minLength",
|
|
1595
|
-
"attribute": "minLength",
|
|
1596
|
-
"type": "number | undefined"
|
|
1597
|
-
},
|
|
1598
|
-
{
|
|
1599
|
-
"name": "maxLength",
|
|
1600
|
-
"attribute": "maxLength",
|
|
1601
|
-
"type": "number | undefined"
|
|
1602
|
-
},
|
|
1603
|
-
{
|
|
1604
|
-
"name": "pattern",
|
|
1605
|
-
"attribute": "pattern",
|
|
1606
|
-
"type": "string | undefined"
|
|
1607
|
-
},
|
|
1608
|
-
{
|
|
1609
|
-
"name": "autoComplete",
|
|
1610
|
-
"attribute": "autoComplete",
|
|
1611
|
-
"type": "FieldTextAutoComplete | undefined"
|
|
1598
|
+
"name": "controller",
|
|
1599
|
+
"type": "FieldTimeController<this>",
|
|
1600
|
+
"default": "\"new FieldTimeController(this, host => ({\\n\\t\\tget value() { return host.value },\\n\\t\\tget precision() { return host.precision },\\n\\t\\tget hourCycle() { return host.hourCycle },\\n\\t\\tget referenceDate() { return host.shortcutReferenceDate },\\n\\t\\tget label() { return host._label },\\n\\t\\tget disabled() { return host.disabled },\\n\\t\\tget readonly() { return host.readonly },\\n\\t\\tget required() { return host.required },\\n\\t\\tget invalid() { return host.invalid },\\n\\t\\tget handlePickerOpen() { return host.pickerHidden ? undefined : () => host.open = true },\\n\\t\\thandleInput: value => host.handleInput(value),\\n\\t\\thandleChange: value => host.handleChange(value),\\n\\t}))\""
|
|
1612
1601
|
},
|
|
1613
1602
|
{
|
|
1614
|
-
"name": "
|
|
1615
|
-
"
|
|
1603
|
+
"name": "open",
|
|
1604
|
+
"attribute": "open",
|
|
1605
|
+
"description": "Whether the time picker is open",
|
|
1606
|
+
"type": "boolean",
|
|
1607
|
+
"default": "false"
|
|
1616
1608
|
},
|
|
1617
1609
|
{
|
|
1618
|
-
"name": "
|
|
1619
|
-
"attribute": "
|
|
1620
|
-
"description": "
|
|
1610
|
+
"name": "pickerHidden",
|
|
1611
|
+
"attribute": "pickerHidden",
|
|
1612
|
+
"description": "Hide the time picker",
|
|
1621
1613
|
"type": "boolean",
|
|
1622
1614
|
"default": "false"
|
|
1623
1615
|
},
|
|
@@ -1628,6 +1620,26 @@
|
|
|
1628
1620
|
"type": "boolean",
|
|
1629
1621
|
"default": "false"
|
|
1630
1622
|
},
|
|
1623
|
+
{
|
|
1624
|
+
"name": "precision",
|
|
1625
|
+
"attribute": "precision",
|
|
1626
|
+
"description": "'minute' (default) or 'second'",
|
|
1627
|
+
"type": "FieldDateTimePrecision",
|
|
1628
|
+
"default": "\"Minute\""
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"name": "hourCycle",
|
|
1632
|
+
"attribute": "hourCycle",
|
|
1633
|
+
"description": "The hour cycle of the segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention.",
|
|
1634
|
+
"type": "HourCycle | undefined"
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"name": "shortcutReferenceDate",
|
|
1638
|
+
"attribute": "shortcutReferenceDate",
|
|
1639
|
+
"description": "The date the units the user leaves out are taken from. Defaults to now.",
|
|
1640
|
+
"type": "DateTime",
|
|
1641
|
+
"default": "\"new DateTime()\""
|
|
1642
|
+
},
|
|
1631
1643
|
{
|
|
1632
1644
|
"name": "change",
|
|
1633
1645
|
"type": "EventDispatcher<T | undefined>"
|
|
@@ -1640,14 +1652,10 @@
|
|
|
1640
1652
|
"name": "validityChange",
|
|
1641
1653
|
"type": "EventDispatcher<boolean>"
|
|
1642
1654
|
},
|
|
1643
|
-
{
|
|
1644
|
-
"name": "isPopulated",
|
|
1645
|
-
"type": "boolean"
|
|
1646
|
-
},
|
|
1647
1655
|
{
|
|
1648
1656
|
"name": "value",
|
|
1649
1657
|
"attribute": "value",
|
|
1650
|
-
"description": "The
|
|
1658
|
+
"description": "The time as `HH:mm` or `HH:mm:ss`",
|
|
1651
1659
|
"type": "string | undefined"
|
|
1652
1660
|
},
|
|
1653
1661
|
{
|
|
@@ -1709,8 +1717,16 @@
|
|
|
1709
1717
|
],
|
|
1710
1718
|
"cssParts": [
|
|
1711
1719
|
{
|
|
1712
|
-
"name": "
|
|
1713
|
-
"description": "The
|
|
1720
|
+
"name": "segments",
|
|
1721
|
+
"description": "The group of segments making up the time"
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
"name": "segment",
|
|
1725
|
+
"description": "An editable unit of the time"
|
|
1726
|
+
},
|
|
1727
|
+
{
|
|
1728
|
+
"name": "literal",
|
|
1729
|
+
"description": "A separator between the units"
|
|
1714
1730
|
},
|
|
1715
1731
|
{
|
|
1716
1732
|
"name": "container",
|
|
@@ -3443,38 +3459,41 @@
|
|
|
3443
3459
|
{
|
|
3444
3460
|
"name": "mo-field-time",
|
|
3445
3461
|
"path": ".\\packages\\DateTimeFields\\dist\\FieldTime.d.ts",
|
|
3462
|
+
"description": "[object Object],[object Object],[object Object]",
|
|
3446
3463
|
"attributes": [
|
|
3447
3464
|
{
|
|
3448
|
-
"name": "
|
|
3449
|
-
"
|
|
3465
|
+
"name": "open",
|
|
3466
|
+
"description": "Whether the time picker is open",
|
|
3467
|
+
"type": "boolean"
|
|
3450
3468
|
},
|
|
3451
3469
|
{
|
|
3452
|
-
"name": "
|
|
3453
|
-
"
|
|
3470
|
+
"name": "pickerHidden",
|
|
3471
|
+
"description": "Hide the time picker",
|
|
3472
|
+
"type": "boolean"
|
|
3454
3473
|
},
|
|
3455
3474
|
{
|
|
3456
|
-
"name": "
|
|
3457
|
-
"
|
|
3475
|
+
"name": "dense",
|
|
3476
|
+
"description": "Whether the field is dense",
|
|
3477
|
+
"type": "boolean"
|
|
3458
3478
|
},
|
|
3459
3479
|
{
|
|
3460
|
-
"name": "
|
|
3461
|
-
"
|
|
3480
|
+
"name": "precision",
|
|
3481
|
+
"description": "'minute' (default) or 'second'",
|
|
3482
|
+
"type": "FieldDateTimePrecision"
|
|
3462
3483
|
},
|
|
3463
3484
|
{
|
|
3464
|
-
"name": "
|
|
3465
|
-
"description": "
|
|
3466
|
-
"type": "
|
|
3467
|
-
"default": "false"
|
|
3485
|
+
"name": "hourCycle",
|
|
3486
|
+
"description": "The hour cycle of the segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention.",
|
|
3487
|
+
"type": "HourCycle | undefined"
|
|
3468
3488
|
},
|
|
3469
3489
|
{
|
|
3470
|
-
"name": "
|
|
3471
|
-
"description": "
|
|
3472
|
-
"type": "
|
|
3473
|
-
"default": "false"
|
|
3490
|
+
"name": "shortcutReferenceDate",
|
|
3491
|
+
"description": "The date the units the user leaves out are taken from. Defaults to now.",
|
|
3492
|
+
"type": "DateTime"
|
|
3474
3493
|
},
|
|
3475
3494
|
{
|
|
3476
3495
|
"name": "value",
|
|
3477
|
-
"description": "The
|
|
3496
|
+
"description": "The time as `HH:mm` or `HH:mm:ss`",
|
|
3478
3497
|
"type": "string | undefined"
|
|
3479
3498
|
},
|
|
3480
3499
|
{
|
|
@@ -3504,46 +3523,44 @@
|
|
|
3504
3523
|
],
|
|
3505
3524
|
"properties": [
|
|
3506
3525
|
{
|
|
3507
|
-
"name": "
|
|
3508
|
-
"type": "
|
|
3526
|
+
"name": "controller",
|
|
3527
|
+
"type": "FieldTimeController<this>"
|
|
3509
3528
|
},
|
|
3510
3529
|
{
|
|
3511
|
-
"name": "
|
|
3512
|
-
"attribute": "
|
|
3513
|
-
"
|
|
3514
|
-
|
|
3515
|
-
{
|
|
3516
|
-
"name": "maxLength",
|
|
3517
|
-
"attribute": "maxLength",
|
|
3518
|
-
"type": "number | undefined"
|
|
3530
|
+
"name": "open",
|
|
3531
|
+
"attribute": "open",
|
|
3532
|
+
"description": "Whether the time picker is open",
|
|
3533
|
+
"type": "boolean"
|
|
3519
3534
|
},
|
|
3520
3535
|
{
|
|
3521
|
-
"name": "
|
|
3522
|
-
"attribute": "
|
|
3523
|
-
"
|
|
3536
|
+
"name": "pickerHidden",
|
|
3537
|
+
"attribute": "pickerHidden",
|
|
3538
|
+
"description": "Hide the time picker",
|
|
3539
|
+
"type": "boolean"
|
|
3524
3540
|
},
|
|
3525
3541
|
{
|
|
3526
|
-
"name": "
|
|
3527
|
-
"attribute": "
|
|
3528
|
-
"
|
|
3542
|
+
"name": "dense",
|
|
3543
|
+
"attribute": "dense",
|
|
3544
|
+
"description": "Whether the field is dense",
|
|
3545
|
+
"type": "boolean"
|
|
3529
3546
|
},
|
|
3530
3547
|
{
|
|
3531
|
-
"name": "
|
|
3532
|
-
"
|
|
3548
|
+
"name": "precision",
|
|
3549
|
+
"attribute": "precision",
|
|
3550
|
+
"description": "'minute' (default) or 'second'",
|
|
3551
|
+
"type": "FieldDateTimePrecision"
|
|
3533
3552
|
},
|
|
3534
3553
|
{
|
|
3535
|
-
"name": "
|
|
3536
|
-
"attribute": "
|
|
3537
|
-
"description": "
|
|
3538
|
-
"type": "
|
|
3539
|
-
"default": "false"
|
|
3554
|
+
"name": "hourCycle",
|
|
3555
|
+
"attribute": "hourCycle",
|
|
3556
|
+
"description": "The hour cycle of the segments ('h11', 'h12', 'h23' or 'h24'). Defaults to the language's convention.",
|
|
3557
|
+
"type": "HourCycle | undefined"
|
|
3540
3558
|
},
|
|
3541
3559
|
{
|
|
3542
|
-
"name": "
|
|
3543
|
-
"attribute": "
|
|
3544
|
-
"description": "
|
|
3545
|
-
"type": "
|
|
3546
|
-
"default": "false"
|
|
3560
|
+
"name": "shortcutReferenceDate",
|
|
3561
|
+
"attribute": "shortcutReferenceDate",
|
|
3562
|
+
"description": "The date the units the user leaves out are taken from. Defaults to now.",
|
|
3563
|
+
"type": "DateTime"
|
|
3547
3564
|
},
|
|
3548
3565
|
{
|
|
3549
3566
|
"name": "change",
|
|
@@ -3557,14 +3574,10 @@
|
|
|
3557
3574
|
"name": "validityChange",
|
|
3558
3575
|
"type": "EventDispatcher<boolean>"
|
|
3559
3576
|
},
|
|
3560
|
-
{
|
|
3561
|
-
"name": "isPopulated",
|
|
3562
|
-
"type": "boolean"
|
|
3563
|
-
},
|
|
3564
3577
|
{
|
|
3565
3578
|
"name": "value",
|
|
3566
3579
|
"attribute": "value",
|
|
3567
|
-
"description": "The
|
|
3580
|
+
"description": "The time as `HH:mm` or `HH:mm:ss`",
|
|
3568
3581
|
"type": "string | undefined"
|
|
3569
3582
|
},
|
|
3570
3583
|
{
|
|
@@ -3626,8 +3639,16 @@
|
|
|
3626
3639
|
],
|
|
3627
3640
|
"cssParts": [
|
|
3628
3641
|
{
|
|
3629
|
-
"name": "
|
|
3630
|
-
"description": "The
|
|
3642
|
+
"name": "segments",
|
|
3643
|
+
"description": "The group of segments making up the time"
|
|
3644
|
+
},
|
|
3645
|
+
{
|
|
3646
|
+
"name": "segment",
|
|
3647
|
+
"description": "An editable unit of the time"
|
|
3648
|
+
},
|
|
3649
|
+
{
|
|
3650
|
+
"name": "literal",
|
|
3651
|
+
"description": "A separator between the units"
|
|
3631
3652
|
},
|
|
3632
3653
|
{
|
|
3633
3654
|
"name": "container",
|
|
@@ -3939,6 +3960,11 @@
|
|
|
3939
3960
|
"name": "mo-hour-list",
|
|
3940
3961
|
"path": ".\\packages\\DateTimeFields\\dist\\selection\\HourList.d.ts",
|
|
3941
3962
|
"properties": [
|
|
3963
|
+
{
|
|
3964
|
+
"name": "hourCycle",
|
|
3965
|
+
"description": "Defaults to the language's convention, so English lists \"02 PM\" where German lists \"14\".",
|
|
3966
|
+
"type": "\"h23\" | \"h11\" | \"h12\" | \"h24\" | undefined"
|
|
3967
|
+
},
|
|
3942
3968
|
{
|
|
3943
3969
|
"name": "change",
|
|
3944
3970
|
"type": "EventDispatcher<DateTime>"
|
|
@@ -4113,6 +4139,11 @@
|
|
|
4113
4139
|
"name": "mo-hour-list",
|
|
4114
4140
|
"path": ".\\packages\\DateTimeFields\\selection\\HourList.ts",
|
|
4115
4141
|
"attributes": [
|
|
4142
|
+
{
|
|
4143
|
+
"name": "hourCycle",
|
|
4144
|
+
"description": "Defaults to the language's convention, so English lists \"02 PM\" where German lists \"14\".",
|
|
4145
|
+
"type": "\"h23\" | \"h11\" | \"h12\" | \"h24\" | undefined"
|
|
4146
|
+
},
|
|
4116
4147
|
{
|
|
4117
4148
|
"name": "navigationDate",
|
|
4118
4149
|
"type": "DateTime"
|
|
@@ -4123,6 +4154,12 @@
|
|
|
4123
4154
|
}
|
|
4124
4155
|
],
|
|
4125
4156
|
"properties": [
|
|
4157
|
+
{
|
|
4158
|
+
"name": "hourCycle",
|
|
4159
|
+
"attribute": "hourCycle",
|
|
4160
|
+
"description": "Defaults to the language's convention, so English lists \"02 PM\" where German lists \"14\".",
|
|
4161
|
+
"type": "\"h23\" | \"h11\" | \"h12\" | \"h24\" | undefined"
|
|
4162
|
+
},
|
|
4126
4163
|
{
|
|
4127
4164
|
"name": "change",
|
|
4128
4165
|
"type": "EventDispatcher<DateTime>"
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,10 @@ import '@3mo/tab';
|
|
|
9
9
|
import '@3mo/scroller';
|
|
10
10
|
import '@3mo/list';
|
|
11
11
|
import '@3mo/line';
|
|
12
|
+
import '@3mo/switch';
|
|
13
|
+
export * from './segments/index.js';
|
|
12
14
|
export * from './selection/index.js';
|
|
15
|
+
export * from './FieldTimeController.js';
|
|
13
16
|
export * from './FieldTime.js';
|
|
14
17
|
export * from './FieldDateTimePrecision.js';
|
|
15
18
|
export * from './FieldDateTime.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AACvB,OAAO,WAAW,CAAA;AAClB,OAAO,kBAAkB,CAAA;AACzB,OAAO,cAAc,CAAA;AACrB,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA;AAClB,OAAO,YAAY,CAAA;AACnB,OAAO,UAAU,CAAA;AACjB,OAAO,eAAe,CAAA;AACtB,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA;AAClB,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAA;AACvB,OAAO,WAAW,CAAA;AAClB,OAAO,kBAAkB,CAAA;AACzB,OAAO,cAAc,CAAA;AACrB,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA;AAClB,OAAO,YAAY,CAAA;AACnB,OAAO,UAAU,CAAA;AACjB,OAAO,eAAe,CAAA;AACtB,OAAO,WAAW,CAAA;AAClB,OAAO,WAAW,CAAA;AAClB,OAAO,aAAa,CAAA;AACpB,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,10 @@ import '@3mo/tab';
|
|
|
9
9
|
import '@3mo/scroller';
|
|
10
10
|
import '@3mo/list';
|
|
11
11
|
import '@3mo/line';
|
|
12
|
+
import '@3mo/switch';
|
|
13
|
+
export * from './segments/index.js';
|
|
12
14
|
export * from './selection/index.js';
|
|
15
|
+
export * from './FieldTimeController.js';
|
|
13
16
|
export * from './FieldTime.js';
|
|
14
17
|
export * from './FieldDateTimePrecision.js';
|
|
15
18
|
export * from './FieldDateTime.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type EditableSegment, type LiteralSegment } from '@3mo/segmented-input';
|
|
2
|
+
export type DateTimeSegmentType = 'era' | 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal';
|
|
3
|
+
export declare const editableDateTimeSegmentTypes: readonly ["year", "month", "week", "day", "hour", "minute", "second", "dayPeriod"];
|
|
4
|
+
export type EditableDateTimeSegmentType = typeof editableDateTimeSegmentTypes[number];
|
|
5
|
+
export declare function isEditableDateTimeSegmentType(type: DateTimeSegmentType): type is EditableDateTimeSegmentType;
|
|
6
|
+
/** One unit of a date or time as the field renders it, or a literal separator between two of them. */
|
|
7
|
+
export type DateTimeSegment = DateTimeLiteralSegment | EditableDateTimeSegment;
|
|
8
|
+
export interface DateTimeLiteralSegment extends LiteralSegment {
|
|
9
|
+
readonly type: DateTimeSegmentType;
|
|
10
|
+
}
|
|
11
|
+
export interface EditableDateTimeSegment extends EditableSegment {
|
|
12
|
+
readonly type: EditableDateTimeSegmentType;
|
|
13
|
+
/** The unit's numeric value, in the numbers the user sees (a 12-hour clock reports 1–12). */
|
|
14
|
+
readonly value?: number;
|
|
15
|
+
readonly min?: number;
|
|
16
|
+
readonly max?: number;
|
|
17
|
+
/** What assistive technology reads for the value where the number alone is not enough (month names, "2 PM"). */
|
|
18
|
+
readonly valueText?: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=DateTimeSegment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeSegment.d.ts","sourceRoot":"","sources":["../../segments/DateTimeSegment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEhF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAA;AAEpI,eAAO,MAAM,4BAA4B,oFAAqF,CAAA;AAE9H,MAAM,MAAM,2BAA2B,GAAG,OAAO,4BAA4B,CAAC,MAAM,CAAC,CAAA;AAErF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,IAAI,2BAA2B,CAE5G;AAED,sGAAsG;AACtG,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,uBAAuB,CAAA;AAE9E,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;CAClC;AAED,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC/D,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAA;IAC1C,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,gHAAgH;IAChH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type LanguageCode } from '@3mo/localization';
|
|
2
|
+
import { FieldDateTimePrecision } from '../FieldDateTimePrecision.js';
|
|
3
|
+
import { type DateTimeSegment, type EditableDateTimeSegmentType } from './DateTimeSegment.js';
|
|
4
|
+
export type HourCycle = 'h11' | 'h12' | 'h23' | 'h24';
|
|
5
|
+
/** Reads an `hourCycle` attribute, ignoring anything which is not one of the four cycles. */
|
|
6
|
+
export declare const hourCycleConverter: (value: unknown) => HourCycle | undefined;
|
|
7
|
+
export type DateTimeSegmenterOptions = {
|
|
8
|
+
readonly precision: FieldDateTimePrecision;
|
|
9
|
+
readonly language?: LanguageCode;
|
|
10
|
+
readonly calendar?: string;
|
|
11
|
+
readonly timeZone?: string;
|
|
12
|
+
readonly hourCycle?: HourCycle;
|
|
13
|
+
/** Renders only the time units, for time-only fields. */
|
|
14
|
+
readonly timeOnly?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Derives the segments of a date-time value for a language, calendar and precision from
|
|
18
|
+
* `Intl.DateTimeFormat.formatToParts`, and edits them with Temporal's calendar arithmetic.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DateTimeSegmenter {
|
|
21
|
+
static readonly pageSteps: Partial<Record<EditableDateTimeSegmentType, number>>;
|
|
22
|
+
static defaultHourCycle(language: LanguageCode): HourCycle;
|
|
23
|
+
readonly precision: FieldDateTimePrecision;
|
|
24
|
+
readonly language: LanguageCode;
|
|
25
|
+
readonly calendar: string;
|
|
26
|
+
readonly timeZone: string;
|
|
27
|
+
readonly hourCycle: HourCycle;
|
|
28
|
+
readonly timeOnly: boolean;
|
|
29
|
+
readonly direction: 'ltr' | 'rtl';
|
|
30
|
+
readonly formatOptions: Intl.DateTimeFormatOptions;
|
|
31
|
+
readonly formatter: Intl.DateTimeFormat;
|
|
32
|
+
private readonly displayNames?;
|
|
33
|
+
private readonly digits;
|
|
34
|
+
private readonly dayPeriods;
|
|
35
|
+
private readonly monthFormatter;
|
|
36
|
+
private readonly hourFormatter;
|
|
37
|
+
constructor(options: DateTimeSegmenterOptions);
|
|
38
|
+
/** Identifies the configuration, so a consumer can tell when its segmenter is stale. */
|
|
39
|
+
get key(): string;
|
|
40
|
+
get twelveHours(): boolean;
|
|
41
|
+
private buildFormatOptions;
|
|
42
|
+
/** Brings a date into this segmenter's calendar and time zone. */
|
|
43
|
+
adopt(date: DateTime): import("@3mo/date-time/DateTime.js").DateTime;
|
|
44
|
+
/** The editable unit types present, in rendering order. */
|
|
45
|
+
get types(): ReadonlyArray<EditableDateTimeSegmentType>;
|
|
46
|
+
segments(date: DateTime, filled: ReadonlySet<EditableDateTimeSegmentType>): Array<DateTimeSegment>;
|
|
47
|
+
private parts;
|
|
48
|
+
private typeOf;
|
|
49
|
+
labelOf(type: EditableDateTimeSegmentType): string;
|
|
50
|
+
private placeholderOf;
|
|
51
|
+
limits(date: DateTime, type: EditableDateTimeSegmentType): {
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
};
|
|
55
|
+
private static weeksInYear;
|
|
56
|
+
valueOf(date: DateTime, type: EditableDateTimeSegmentType): number;
|
|
57
|
+
private valueTextOf;
|
|
58
|
+
set(date: DateTime, type: EditableDateTimeSegmentType, value: number): DateTime;
|
|
59
|
+
/** Moves a unit by `delta`, wrapping at its limits — except the year, which is clamped. */
|
|
60
|
+
step(date: DateTime, type: EditableDateTimeSegmentType, delta: number): DateTime;
|
|
61
|
+
/** The numeric value of a typed character in the language's numbering system or ASCII, if it is a digit. */
|
|
62
|
+
digitOf(character: string): number | undefined;
|
|
63
|
+
/** Which day period a typed character selects, matching the first character of the localized "AM"/"PM". */
|
|
64
|
+
dayPeriodOf(character: string): 0 | 1 | undefined;
|
|
65
|
+
/** The whole value as one localized string, for the group's accessible description. */
|
|
66
|
+
describe(date: DateTime): string;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=DateTimeSegmenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimeSegmenter.d.ts","sourceRoot":"","sources":["../../segments/DateTimeSegmenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,KAAK,eAAe,EAA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