@nectary/components 0.39.0 → 0.40.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.
Files changed (115) hide show
  1. package/accordion/index.js +47 -84
  2. package/accordion-item/index.js +26 -53
  3. package/action-menu/index.d.ts +0 -1
  4. package/action-menu/index.js +179 -223
  5. package/action-menu/types.d.ts +8 -18
  6. package/action-menu-option/index.d.ts +1 -0
  7. package/action-menu-option/index.js +51 -62
  8. package/action-menu-option/types.d.ts +9 -0
  9. package/action-menu-option/utils.d.ts +2 -0
  10. package/action-menu-option/utils.js +3 -0
  11. package/alert/index.js +6 -20
  12. package/avatar/index.js +12 -31
  13. package/avatar-badge/index.js +8 -22
  14. package/avatar-status/index.js +1 -1
  15. package/button/index.js +42 -92
  16. package/card/index.js +21 -59
  17. package/chat-avatar/index.js +8 -22
  18. package/chat-block/index.js +29 -69
  19. package/chat-bubble/index.js +6 -20
  20. package/checkbox/index.js +55 -107
  21. package/chip/index.d.ts +13 -0
  22. package/chip/index.js +137 -0
  23. package/chip/types.d.ts +38 -0
  24. package/color-menu/index.d.ts +13 -0
  25. package/color-menu/index.js +464 -0
  26. package/color-menu/types.d.ts +37 -0
  27. package/color-swatch/index.d.ts +13 -0
  28. package/color-swatch/index.js +59 -0
  29. package/color-swatch/types.d.ts +12 -0
  30. package/colors.json +57 -49
  31. package/date-picker/index.js +161 -292
  32. package/dialog/index.js +70 -142
  33. package/dropdown-checkbox-option/index.js +6 -20
  34. package/dropdown-radio-option/index.js +6 -20
  35. package/field/index.js +25 -63
  36. package/file-drop/index.js +123 -200
  37. package/file-picker/index.d.ts +0 -1
  38. package/file-picker/index.js +55 -108
  39. package/file-status/index.js +15 -39
  40. package/help-tooltip/index.js +1 -1
  41. package/horizontal-stepper/index.js +33 -59
  42. package/horizontal-stepper-item/index.js +13 -37
  43. package/icon-button/index.js +39 -84
  44. package/icons-channel/notify/index.d.ts +11 -0
  45. package/icons-channel/notify/index.js +4 -0
  46. package/illustrations/create-illustration-class.js +1 -1
  47. package/inline-alert/index.js +29 -81
  48. package/input/index.js +113 -222
  49. package/link/index.js +46 -96
  50. package/list-item/index.js +1 -1
  51. package/package.json +12 -14
  52. package/pagination/index.js +109 -163
  53. package/popover/index.js +224 -294
  54. package/progress/index.js +9 -28
  55. package/radio/index.js +103 -169
  56. package/radio-option/index.js +24 -48
  57. package/segment/index.js +49 -130
  58. package/segment-collapse/index.js +24 -49
  59. package/segmented-control/index.js +36 -73
  60. package/segmented-control-option/index.js +41 -87
  61. package/segmented-icon-control/index.js +47 -84
  62. package/segmented-icon-control-option/index.js +38 -79
  63. package/select-button/index.d.ts +13 -0
  64. package/select-button/index.js +153 -0
  65. package/select-button/types.d.ts +43 -0
  66. package/select-menu/index.d.ts +11 -0
  67. package/select-menu/index.js +346 -0
  68. package/select-menu/types.d.ts +29 -0
  69. package/select-menu/types.js +1 -0
  70. package/{dropdown-text-option → select-menu-option}/index.d.ts +5 -7
  71. package/select-menu-option/index.js +76 -0
  72. package/{select-option → select-menu-option}/types.d.ts +8 -9
  73. package/stop-events/index.js +7 -20
  74. package/table-head-cell/index.js +7 -21
  75. package/tabs/index.js +103 -165
  76. package/tabs-option/index.js +20 -44
  77. package/tag/index.d.ts +0 -1
  78. package/tag/index.js +37 -38
  79. package/tag/types.d.ts +13 -7
  80. package/textarea/index.js +92 -167
  81. package/theme.css +80 -49
  82. package/tile-control/index.js +55 -96
  83. package/tile-control-option/index.js +40 -86
  84. package/time-picker/index.js +216 -368
  85. package/title/index.js +6 -20
  86. package/toast/index.js +32 -70
  87. package/toast-manager/index.js +141 -217
  88. package/toggle/index.js +54 -106
  89. package/types.d.ts +7 -0
  90. package/utils/colors.d.ts +10 -0
  91. package/utils/colors.js +121 -0
  92. package/{utils.d.ts → utils/index.d.ts} +17 -9
  93. package/{utils.js → utils/index.js} +96 -39
  94. package/vertical-stepper/index.js +29 -50
  95. package/vertical-stepper-item/index.js +13 -37
  96. package/dropdown/index.d.ts +0 -12
  97. package/dropdown/index.js +0 -415
  98. package/dropdown/types.d.ts +0 -32
  99. package/dropdown-text-option/index.js +0 -104
  100. package/dropdown-text-option/types.d.ts +0 -16
  101. package/select/index.d.ts +0 -13
  102. package/select/index.js +0 -316
  103. package/select/types.d.ts +0 -53
  104. package/select-option/index.d.ts +0 -11
  105. package/select-option/index.js +0 -8
  106. package/tag/utils.d.ts +0 -5
  107. package/tag/utils.js +0 -6
  108. package/tag-close/index.d.ts +0 -12
  109. package/tag-close/index.js +0 -42
  110. package/tag-close/types.d.ts +0 -5
  111. /package/{dropdown-text-option → chip}/types.js +0 -0
  112. /package/{dropdown → color-menu}/types.js +0 -0
  113. /package/{select-option → color-swatch}/types.js +0 -0
  114. /package/{select → select-button}/types.js +0 -0
  115. /package/{tag-close → select-menu-option}/types.js +0 -0
@@ -1,16 +1,3 @@
1
- import _classPrivateFieldGet from '@babel/runtime/helpers/classPrivateFieldGet';
2
- import _classPrivateFieldSet from '@babel/runtime/helpers/classPrivateFieldSet';
3
-
4
- var _$pickerHours, _$pickerMinutes, _$pickerTouch, _$needleHour, _$needleMinute, _$headerHours, _$headerHoursText, _$headerMinutes, _$headerMinutesText, _$ampm, _$submitButton, _hour, _minute, _getClickDegree, _onPickerClick, _render, _selectHour, _selectMinute, _onAmPmChange, _onSubmitButtonClick, _onHoursKeydown, _onMinutesKeydown, _onChangeReactHandler;
5
-
6
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
7
-
8
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
9
-
10
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
-
12
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
13
-
14
1
  import '../icon-button';
15
2
  import '../icons/done';
16
3
  import '../icons/arrow-drop-up';
@@ -18,7 +5,7 @@ import '../icons/arrow-drop-down';
18
5
  import '../segmented-control';
19
6
  import '../segmented-control-option';
20
7
  import { defineCustomElement, getAttribute, getBooleanAttribute, getReactEventHandler, getRect, isAttrTrue, NectaryElement, setClass, updateAttribute, updateBooleanAttribute } from '../utils';
21
- const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;width:248px;padding:16px;box-sizing:border-box;gap:16px}#header{position:relative;width:100%;height:48px;font:var(--sinch-font-title-xl);line-height:48px}#footer{display:flex;justify-content:center;width:100%;height:32px}#picker{position:relative;width:216px;height:216px;border-radius:50%;box-sizing:border-box;border:1px solid var(--sinch-color-stormy-500)}#picker-hours,#picker-minutes{position:absolute;left:0;top:0;width:100%;height:100%;border-radius:50%;pointer-events:none;user-select:none}.digit-hour-12,.digit-hour-24,.digit-minute{position:absolute;width:28px;height:28px;font:var(--sinch-font-text-s);line-height:28px;text-align:center;color:var(--sinch-color-text-default);top:calc(50% - 14px);left:calc(50% - 14px);z-index:1;cursor:pointer}.digit-hour-24{font:var(--sinch-font-text-xs);line-height:28px;color:var(--sinch-color-text-muted)}.digit-minute{font:var(--sinch-font-text-xs);line-height:28px;color:var(--sinch-color-text-muted)}.digit-hour-12:hover,.digit-hour-24:hover,.digit-minute:hover{color:var(--sinch-color-tropical-500)}.digit-hour-12.selected,.digit-hour-24.selected,.digit-minute.selected{color:var(--sinch-color-tropical-500)}.digit-hour-12.selected{font-size:16px}.digit-hour-24.selected{font-size:16px}.digit-minute.selected{font-size:16px}#picker-touch{position:absolute;left:0;top:0;width:100%;height:100%;cursor:pointer;border-radius:50%}#needle-hour,#needle-minute,#picker-touch::after{background-color:var(--sinch-color-stormy-500)}#needle-hour,#needle-minute{position:absolute;transform-origin:bottom center;transform:rotate(0);bottom:50%;height:50px;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:transform height;z-index:2}@media (prefers-reduced-motion){#needle-hour,#needle-minute{transition:none}}#needle-hour{width:4px;left:calc(50% - 2px);border-radius:2px}#needle-minute{width:2px;left:calc(50% - 1px);border-radius:1px}#needle-minute:not(.selected)::after{content:"";position:absolute;transform:translateX(-50%);left:0;top:-16px;width:4px;height:4px;border-radius:50%;background-color:var(--sinch-color-tropical-500)}#picker-touch::after{content:"";position:absolute;top:50%;left:50%;width:12px;height:12px;border-radius:50%;transform:translate(-50%,-50%)}#header-hours,#header-minutes{position:absolute;padding:0 4px;width:50px;outline:0;--sinch-icon-size:24px}#header-hours{right:calc(50% + 8px);text-align:right}#header-minutes{left:calc(50% + 8px)}#header-hours::before,#header-minutes::before{content:"";display:none;position:absolute;border-radius:12px;left:50%;top:50%;width:100%;height:100%;transform:translate(-50%,-50%);padding:1px;border:1px solid var(--sinch-color-aqua-400)}#header-hours-down,#header-hours-up,#header-minutes-down,#header-minutes-up{display:none;position:absolute;left:50%;transform:translateX(-50%)}#header-hours-up,#header-minutes-up{top:-18px}#header-hours-down,#header-minutes-down{bottom:-18px}#header-hours:focus #header-hours-down,#header-hours:focus #header-hours-up,#header-hours:focus::before{display:block}#header-minutes:focus #header-minutes-down,#header-minutes:focus #header-minutes-up,#header-minutes:focus::before{display:block}#header-colon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}#submit{position:absolute;right:0;top:50%;transform:translateY(-50%)}:host([ampm]) .digit-hour-24{display:none}:host(:not([ampm])) #footer{display:none}</style><div id="wrapper"><div id="header"><div id="header-hours" tabindex="0" role="meter" aria-valuemin="0" aria-valuemax="23" aria-valuenow="0" aria-valuetext="0"><span>00</span><sinch-icon-arrow-drop-up id="header-hours-up"></sinch-icon-arrow-drop-up><sinch-icon-arrow-drop-down id="header-hours-down"></sinch-icon-arrow-drop-down></div><div id="header-colon">&colon;</div><div id="header-minutes" tabindex="0" role="meter" aria-valuemin="0" aria-valuemax="59" aria-valuenow="0" aria-valuetext="0"><span>00</span><sinch-icon-arrow-drop-up id="header-minutes-up"></sinch-icon-arrow-drop-up><sinch-icon-arrow-drop-down id="header-minutes-down"></sinch-icon-arrow-drop-down></div><sinch-icon-button id="submit" small aria-label="Submit"><sinch-icon-done slot="icon"></sinch-icon-done></sinch-icon-button></div><div id="picker" aria-hidden="true"><div id="picker-hours"></div><div id="picker-minutes"></div><div id="picker-touch"><div id="needle-hour"></div><div id="needle-minute"></div></div></div><div id="footer"><sinch-segmented-control id="ampm"><sinch-segmented-control-option value="am" text="AM" aria-label="AM"></sinch-segmented-control-option><sinch-segmented-control-option value="pm" text="PM" aria-label="PM"></sinch-segmented-control-option></sinch-segmented-control></div></div>';
8
+ const templateHTML = '<style>:host{display:block;outline:0}#wrapper{display:flex;flex-direction:column;width:248px;padding:16px;box-sizing:border-box;gap:16px}#header{position:relative;width:100%;height:48px;font:var(--sinch-font-title-xl);line-height:48px}#footer{display:flex;justify-content:center;width:100%;height:32px}#picker{position:relative;width:216px;height:216px;border-radius:50%;box-sizing:border-box;border:1px solid var(--sinch-color-stormy-500)}#picker-hours,#picker-minutes{position:absolute;left:0;top:0;width:100%;height:100%;border-radius:50%;pointer-events:none;user-select:none}.digit-hour-12,.digit-hour-24,.digit-minute{position:absolute;width:28px;height:28px;font:var(--sinch-font-text-s);line-height:28px;text-align:center;color:var(--sinch-color-text-default);top:calc(50% - 14px);left:calc(50% - 14px);z-index:1;cursor:pointer}.digit-hour-24{font:var(--sinch-font-text-xs);line-height:28px;color:var(--sinch-color-text-muted)}.digit-minute{font:var(--sinch-font-text-xs);line-height:28px;color:var(--sinch-color-text-muted)}.digit-hour-12:hover,.digit-hour-24:hover,.digit-minute:hover{color:var(--sinch-color-tropical-500)}.digit-hour-12.selected,.digit-hour-24.selected,.digit-minute.selected{color:var(--sinch-color-tropical-500)}.digit-hour-12.selected{font-size:16px}.digit-hour-24.selected{font-size:16px}.digit-minute.selected{font-size:16px}#picker-touch{position:absolute;left:0;top:0;width:100%;height:100%;cursor:pointer;border-radius:50%}#needle-hour,#needle-minute,#picker-touch::after{background-color:var(--sinch-color-stormy-500)}#needle-hour,#needle-minute{position:absolute;transform-origin:bottom center;transform:rotate(0);bottom:50%;height:50px;transition-duration:.25s;transition-timing-function:ease-in-out;transition-property:transform height;z-index:2}@media (prefers-reduced-motion){#needle-hour,#needle-minute{transition:none}}#needle-hour{width:4px;left:calc(50% - 2px);border-radius:2px}#needle-minute{width:2px;left:calc(50% - 1px);border-radius:1px}#needle-minute:not(.selected)::after{content:"";position:absolute;transform:translateX(-50%);left:0;top:-16px;width:4px;height:4px;border-radius:50%;background-color:var(--sinch-color-tropical-500)}#picker-touch::after{content:"";position:absolute;top:50%;left:50%;width:12px;height:12px;border-radius:50%;transform:translate(-50%,-50%)}#header-hours,#header-minutes{position:absolute;padding:0 4px;width:50px;outline:0;--sinch-size-icon:24px}#header-hours{right:calc(50% + 8px);text-align:right}#header-minutes{left:calc(50% + 8px)}#header-hours::before,#header-minutes::before{content:"";display:none;position:absolute;border-radius:12px;left:50%;top:50%;width:100%;height:100%;transform:translate(-50%,-50%);padding:1px;border:1px solid var(--sinch-color-aqua-400)}#header-hours-down,#header-hours-up,#header-minutes-down,#header-minutes-up{display:none;position:absolute;left:50%;transform:translateX(-50%)}#header-hours-up,#header-minutes-up{top:-18px}#header-hours-down,#header-minutes-down{bottom:-18px}#header-hours:focus #header-hours-down,#header-hours:focus #header-hours-up,#header-hours:focus::before{display:block}#header-minutes:focus #header-minutes-down,#header-minutes:focus #header-minutes-up,#header-minutes:focus::before{display:block}#header-colon{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}#submit{position:absolute;right:0;top:50%;transform:translateY(-50%)}:host([ampm]) .digit-hour-24{display:none}:host(:not([ampm])) #footer{display:none}</style><div id="wrapper"><div id="header"><div id="header-hours" tabindex="0" role="meter" aria-valuemin="0" aria-valuemax="23" aria-valuenow="0" aria-valuetext="0"><span>00</span><sinch-icon-arrow-drop-up id="header-hours-up"></sinch-icon-arrow-drop-up><sinch-icon-arrow-drop-down id="header-hours-down"></sinch-icon-arrow-drop-down></div><div id="header-colon">&colon;</div><div id="header-minutes" tabindex="0" role="meter" aria-valuemin="0" aria-valuemax="59" aria-valuenow="0" aria-valuetext="0"><span>00</span><sinch-icon-arrow-drop-up id="header-minutes-up"></sinch-icon-arrow-drop-up><sinch-icon-arrow-drop-down id="header-minutes-down"></sinch-icon-arrow-drop-down></div><sinch-icon-button id="submit" small aria-label="Submit"><sinch-icon-done slot="icon"></sinch-icon-done></sinch-icon-button></div><div id="picker" aria-hidden="true"><div id="picker-hours"></div><div id="picker-minutes"></div><div id="picker-touch"><div id="needle-hour"></div><div id="needle-minute"></div></div></div><div id="footer"><sinch-segmented-control id="ampm"><sinch-segmented-control-option value="am" text="AM" aria-label="AM"></sinch-segmented-control-option><sinch-segmented-control-option value="pm" text="PM" aria-label="PM"></sinch-segmented-control-option></sinch-segmented-control></div></div>';
22
9
  import { getNeedleRotationDeg, getShortestCssDeg, hourToIndex, parseTime, stringifyHour, stringifyHourFace, stringifyMinute, stringifyTime } from './utils';
23
10
  const template = document.createElement('template');
24
11
  template.innerHTML = templateHTML;
@@ -32,254 +19,38 @@ const HOUR_24_RADIUS = HOUR_12_RADIUS - HOUR_24_DIGIT_SIZE;
32
19
  const NEEDLE_HOUR_12_LENGTH = HOUR_12_RADIUS;
33
20
  const NEEDLE_HOUR_24_LENGTH = HOUR_24_RADIUS;
34
21
  const NEEDLE_MINUTE_LENGTH = MINUTE_RADIUS;
35
- defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$pickerMinutes = new WeakMap(), _$pickerTouch = new WeakMap(), _$needleHour = new WeakMap(), _$needleMinute = new WeakMap(), _$headerHours = new WeakMap(), _$headerHoursText = new WeakMap(), _$headerMinutes = new WeakMap(), _$headerMinutesText = new WeakMap(), _$ampm = new WeakMap(), _$submitButton = new WeakMap(), _hour = new WeakMap(), _minute = new WeakMap(), _getClickDegree = new WeakSet(), _onPickerClick = new WeakMap(), _render = new WeakSet(), _selectHour = new WeakSet(), _selectMinute = new WeakSet(), _onAmPmChange = new WeakMap(), _onSubmitButtonClick = new WeakMap(), _onHoursKeydown = new WeakMap(), _onMinutesKeydown = new WeakMap(), _onChangeReactHandler = new WeakMap(), class extends NectaryElement {
22
+ defineCustomElement('sinch-time-picker', class extends NectaryElement {
23
+ #$pickerHours;
24
+ #$pickerMinutes;
25
+ #$pickerTouch;
26
+ #$needleHour;
27
+ #$needleMinute;
28
+ #$headerHours;
29
+ #$headerHoursText;
30
+ #$headerMinutes;
31
+ #$headerMinutesText;
32
+ #$ampm;
33
+ #$submitButton;
34
+ #hour = 0;
35
+ #minute = 0;
36
+
36
37
  constructor() {
37
38
  super();
38
-
39
- _classPrivateMethodInitSpec(this, _selectMinute);
40
-
41
- _classPrivateMethodInitSpec(this, _selectHour);
42
-
43
- _classPrivateMethodInitSpec(this, _render);
44
-
45
- _classPrivateMethodInitSpec(this, _getClickDegree);
46
-
47
- _classPrivateFieldInitSpec(this, _$pickerHours, {
48
- writable: true,
49
- value: void 0
50
- });
51
-
52
- _classPrivateFieldInitSpec(this, _$pickerMinutes, {
53
- writable: true,
54
- value: void 0
55
- });
56
-
57
- _classPrivateFieldInitSpec(this, _$pickerTouch, {
58
- writable: true,
59
- value: void 0
60
- });
61
-
62
- _classPrivateFieldInitSpec(this, _$needleHour, {
63
- writable: true,
64
- value: void 0
65
- });
66
-
67
- _classPrivateFieldInitSpec(this, _$needleMinute, {
68
- writable: true,
69
- value: void 0
70
- });
71
-
72
- _classPrivateFieldInitSpec(this, _$headerHours, {
73
- writable: true,
74
- value: void 0
75
- });
76
-
77
- _classPrivateFieldInitSpec(this, _$headerHoursText, {
78
- writable: true,
79
- value: void 0
80
- });
81
-
82
- _classPrivateFieldInitSpec(this, _$headerMinutes, {
83
- writable: true,
84
- value: void 0
85
- });
86
-
87
- _classPrivateFieldInitSpec(this, _$headerMinutesText, {
88
- writable: true,
89
- value: void 0
90
- });
91
-
92
- _classPrivateFieldInitSpec(this, _$ampm, {
93
- writable: true,
94
- value: void 0
95
- });
96
-
97
- _classPrivateFieldInitSpec(this, _$submitButton, {
98
- writable: true,
99
- value: void 0
100
- });
101
-
102
- _classPrivateFieldInitSpec(this, _hour, {
103
- writable: true,
104
- value: 0
105
- });
106
-
107
- _classPrivateFieldInitSpec(this, _minute, {
108
- writable: true,
109
- value: 0
110
- });
111
-
112
- _classPrivateFieldInitSpec(this, _onPickerClick, {
113
- writable: true,
114
- value: e => {
115
- const [cssDeg, rowIndex] = _classPrivateMethodGet(this, _getClickDegree, _getClickDegree2).call(this, e.x, e.y);
116
-
117
- const isHourRowClick = rowIndex > 0;
118
- const isHour24RowClick = rowIndex > 1;
119
-
120
- if (isHourRowClick) {
121
- const digitIndex = Math.round(cssDeg / 30) % 12;
122
- const is24 = getBooleanAttribute(this, 'ampm') === false;
123
-
124
- if (is24) {
125
- if (isHour24RowClick) {
126
- _classPrivateFieldSet(this, _hour, digitIndex === 0 ? 0 : digitIndex + 12);
127
- } else {
128
- _classPrivateFieldSet(this, _hour, digitIndex === 0 ? 12 : digitIndex);
129
- }
130
- } else {
131
- _classPrivateFieldSet(this, _hour, digitIndex + (_classPrivateFieldGet(this, _$ampm).value === 'pm' ? 12 : 0));
132
- }
133
-
134
- _classPrivateFieldGet(this, _$headerHours).focus();
135
- } else {
136
- _classPrivateFieldSet(this, _minute, Math.round(cssDeg / 6) % 60);
137
-
138
- _classPrivateFieldGet(this, _$headerMinutes).focus();
139
- }
140
-
141
- _classPrivateMethodGet(this, _render, _render2).call(this);
142
- }
143
- });
144
-
145
- _classPrivateFieldInitSpec(this, _onAmPmChange, {
146
- writable: true,
147
- value: e => {
148
- e.stopPropagation();
149
- const value = e.detail;
150
-
151
- switch (value) {
152
- case 'am':
153
- {
154
- if (_classPrivateFieldGet(this, _hour) >= 12) {
155
- _classPrivateFieldSet(this, _hour, _classPrivateFieldGet(this, _hour) - 12);
156
-
157
- _classPrivateMethodGet(this, _render, _render2).call(this);
158
- }
159
-
160
- break;
161
- }
162
-
163
- case 'pm':
164
- {
165
- if (_classPrivateFieldGet(this, _hour) < 12) {
166
- _classPrivateFieldSet(this, _hour, _classPrivateFieldGet(this, _hour) + 12);
167
-
168
- _classPrivateMethodGet(this, _render, _render2).call(this);
169
- }
170
-
171
- break;
172
- }
173
- }
174
- }
175
- });
176
-
177
- _classPrivateFieldInitSpec(this, _onSubmitButtonClick, {
178
- writable: true,
179
- value: () => {
180
- const value = stringifyTime(_classPrivateFieldGet(this, _hour), _classPrivateFieldGet(this, _minute));
181
- this.dispatchEvent(new CustomEvent('change', {
182
- bubbles: true,
183
- detail: value
184
- }));
185
- this.dispatchEvent(new CustomEvent('-change', {
186
- detail: value
187
- }));
188
- }
189
- });
190
-
191
- _classPrivateFieldInitSpec(this, _onHoursKeydown, {
192
- writable: true,
193
- value: e => {
194
- switch (e.key) {
195
- case 'ArrowUp':
196
- {
197
- e.preventDefault();
198
-
199
- _classPrivateFieldSet(this, _hour, (_classPrivateFieldGet(this, _hour) + 1) % 24);
200
-
201
- _classPrivateMethodGet(this, _render, _render2).call(this);
202
-
203
- break;
204
- }
205
-
206
- case 'ArrowDown':
207
- {
208
- e.preventDefault();
209
-
210
- _classPrivateFieldSet(this, _hour, (_classPrivateFieldGet(this, _hour) + 23) % 24);
211
-
212
- _classPrivateMethodGet(this, _render, _render2).call(this);
213
-
214
- break;
215
- }
216
- }
217
- }
218
- });
219
-
220
- _classPrivateFieldInitSpec(this, _onMinutesKeydown, {
221
- writable: true,
222
- value: e => {
223
- switch (e.key) {
224
- case 'ArrowUp':
225
- {
226
- e.preventDefault();
227
-
228
- _classPrivateFieldSet(this, _minute, (_classPrivateFieldGet(this, _minute) + 1) % 60);
229
-
230
- _classPrivateMethodGet(this, _render, _render2).call(this);
231
-
232
- break;
233
- }
234
-
235
- case 'ArrowDown':
236
- {
237
- e.preventDefault();
238
-
239
- _classPrivateFieldSet(this, _minute, (_classPrivateFieldGet(this, _minute) + 59) % 60);
240
-
241
- _classPrivateMethodGet(this, _render, _render2).call(this);
242
-
243
- break;
244
- }
245
- }
246
- }
247
- });
248
-
249
- _classPrivateFieldInitSpec(this, _onChangeReactHandler, {
250
- writable: true,
251
- value: e => {
252
- getReactEventHandler(this, 'on-change')?.(e);
253
- }
254
- });
255
-
256
39
  const shadowRoot = this.attachShadow();
257
40
  shadowRoot.appendChild(template.content.cloneNode(true));
258
-
259
- _classPrivateFieldSet(this, _$pickerHours, shadowRoot.querySelector('#picker-hours'));
260
-
261
- _classPrivateFieldSet(this, _$pickerMinutes, shadowRoot.querySelector('#picker-minutes'));
262
-
263
- _classPrivateFieldSet(this, _$pickerTouch, shadowRoot.querySelector('#picker'));
264
-
265
- _classPrivateFieldSet(this, _$needleHour, shadowRoot.querySelector('#needle-hour'));
266
-
267
- _classPrivateFieldSet(this, _$needleMinute, shadowRoot.querySelector('#needle-minute'));
268
-
269
- _classPrivateFieldSet(this, _$headerHours, shadowRoot.querySelector('#header-hours'));
270
-
271
- _classPrivateFieldSet(this, _$headerMinutes, shadowRoot.querySelector('#header-minutes'));
272
-
273
- _classPrivateFieldSet(this, _$headerHoursText, shadowRoot.querySelector('#header-hours > span'));
274
-
275
- _classPrivateFieldSet(this, _$headerMinutesText, shadowRoot.querySelector('#header-minutes > span'));
276
-
277
- _classPrivateFieldSet(this, _$ampm, shadowRoot.querySelector('#ampm'));
278
-
279
- _classPrivateFieldSet(this, _$submitButton, shadowRoot.querySelector('#submit'));
280
-
281
- _classPrivateFieldGet(this, _$needleMinute).style.height = `${NEEDLE_MINUTE_LENGTH}px`;
282
- _classPrivateFieldGet(this, _$needleHour).style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
41
+ this.#$pickerHours = shadowRoot.querySelector('#picker-hours');
42
+ this.#$pickerMinutes = shadowRoot.querySelector('#picker-minutes');
43
+ this.#$pickerTouch = shadowRoot.querySelector('#picker');
44
+ this.#$needleHour = shadowRoot.querySelector('#needle-hour');
45
+ this.#$needleMinute = shadowRoot.querySelector('#needle-minute');
46
+ this.#$headerHours = shadowRoot.querySelector('#header-hours');
47
+ this.#$headerMinutes = shadowRoot.querySelector('#header-minutes');
48
+ this.#$headerHoursText = shadowRoot.querySelector('#header-hours > span');
49
+ this.#$headerMinutesText = shadowRoot.querySelector('#header-minutes > span');
50
+ this.#$ampm = shadowRoot.querySelector('#ampm');
51
+ this.#$submitButton = shadowRoot.querySelector('#submit');
52
+ this.#$needleMinute.style.height = `${NEEDLE_MINUTE_LENGTH}px`;
53
+ this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
283
54
  const MINUTE_DIGIT_RADIUS = MINUTE_RADIUS + MINUTE_DIGIT_SIZE / 2;
284
55
  const HOUR_12_DIGIT_RADIUS = HOUR_12_RADIUS + HOUR_12_DIGIT_SIZE / 2;
285
56
  const HOUR_24_DIGIT_RADIUS = HOUR_24_RADIUS + HOUR_24_DIGIT_SIZE / 2;
@@ -297,8 +68,7 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
297
68
  hours12Frag.appendChild(el);
298
69
  }
299
70
 
300
- _classPrivateFieldGet(this, _$pickerHours).appendChild(hours12Frag);
301
-
71
+ this.#$pickerHours.appendChild(hours12Frag);
302
72
  const hours24Frag = document.createDocumentFragment();
303
73
 
304
74
  for (let i = 12; i < 24; i++) {
@@ -313,8 +83,7 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
313
83
  hours24Frag.appendChild(el);
314
84
  }
315
85
 
316
- _classPrivateFieldGet(this, _$pickerHours).appendChild(hours24Frag);
317
-
86
+ this.#$pickerHours.appendChild(hours24Frag);
318
87
  const minutesFrag = document.createDocumentFragment();
319
88
 
320
89
  for (let i = 0; i < 60; i += 5) {
@@ -328,35 +97,25 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
328
97
  minutesFrag.appendChild(el);
329
98
  }
330
99
 
331
- _classPrivateFieldGet(this, _$pickerMinutes).appendChild(minutesFrag);
100
+ this.#$pickerMinutes.appendChild(minutesFrag);
332
101
  }
333
102
 
334
103
  connectedCallback() {
335
- _classPrivateFieldGet(this, _$pickerTouch).addEventListener('click', _classPrivateFieldGet(this, _onPickerClick));
336
-
337
- _classPrivateFieldGet(this, _$ampm).addEventListener('change', _classPrivateFieldGet(this, _onAmPmChange));
338
-
339
- _classPrivateFieldGet(this, _$submitButton).addEventListener('click', _classPrivateFieldGet(this, _onSubmitButtonClick));
340
-
341
- _classPrivateFieldGet(this, _$headerHours).addEventListener('keydown', _classPrivateFieldGet(this, _onHoursKeydown));
342
-
343
- _classPrivateFieldGet(this, _$headerMinutes).addEventListener('keydown', _classPrivateFieldGet(this, _onMinutesKeydown));
344
-
345
- this.addEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
104
+ this.#$pickerTouch.addEventListener('click', this.#onPickerClick);
105
+ this.#$ampm.addEventListener('change', this.#onAmPmChange);
106
+ this.#$submitButton.addEventListener('click', this.#onSubmitButtonClick);
107
+ this.#$headerHours.addEventListener('keydown', this.#onHoursKeydown);
108
+ this.#$headerMinutes.addEventListener('keydown', this.#onMinutesKeydown);
109
+ this.addEventListener('-change', this.#onChangeReactHandler);
346
110
  }
347
111
 
348
112
  disconnectedCallback() {
349
- _classPrivateFieldGet(this, _$pickerTouch).removeEventListener('click', _classPrivateFieldGet(this, _onPickerClick));
350
-
351
- _classPrivateFieldGet(this, _$ampm).removeEventListener('change', _classPrivateFieldGet(this, _onAmPmChange));
352
-
353
- _classPrivateFieldGet(this, _$submitButton).removeEventListener('click', _classPrivateFieldGet(this, _onSubmitButtonClick));
354
-
355
- _classPrivateFieldGet(this, _$headerHours).removeEventListener('keydown', _classPrivateFieldGet(this, _onHoursKeydown));
356
-
357
- _classPrivateFieldGet(this, _$headerMinutes).removeEventListener('keydown', _classPrivateFieldGet(this, _onMinutesKeydown));
358
-
359
- this.removeEventListener('-change', _classPrivateFieldGet(this, _onChangeReactHandler));
113
+ this.#$pickerTouch.removeEventListener('click', this.#onPickerClick);
114
+ this.#$ampm.removeEventListener('change', this.#onAmPmChange);
115
+ this.#$submitButton.removeEventListener('click', this.#onSubmitButtonClick);
116
+ this.#$headerHours.removeEventListener('keydown', this.#onHoursKeydown);
117
+ this.#$headerMinutes.removeEventListener('keydown', this.#onMinutesKeydown);
118
+ this.removeEventListener('-change', this.#onChangeReactHandler);
360
119
  }
361
120
 
362
121
  static get observedAttributes() {
@@ -379,13 +138,9 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
379
138
  hours,
380
139
  minutes
381
140
  } = parseTime(newVal);
382
-
383
- _classPrivateFieldSet(this, _hour, hours);
384
-
385
- _classPrivateFieldSet(this, _minute, minutes);
386
-
387
- _classPrivateMethodGet(this, _render, _render2).call(this);
388
-
141
+ this.#hour = hours;
142
+ this.#minute = minutes;
143
+ this.#render();
389
144
  break;
390
145
  }
391
146
 
@@ -393,15 +148,13 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
393
148
  {
394
149
  const isAmpm = isAttrTrue(newVal);
395
150
  updateBooleanAttribute(this, 'ampm', isAmpm);
396
-
397
- _classPrivateMethodGet(this, _render, _render2).call(this);
398
-
151
+ this.#render();
399
152
  break;
400
153
  }
401
154
 
402
155
  case 'submit-aria-label':
403
156
  {
404
- updateAttribute(_classPrivateFieldGet(this, _$submitButton), 'aria-label', newVal);
157
+ updateAttribute(this.#$submitButton, 'aria-label', newVal);
405
158
  break;
406
159
  }
407
160
  }
@@ -436,7 +189,7 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
436
189
  }
437
190
 
438
191
  get submitButtonRect() {
439
- return getRect(_classPrivateFieldGet(this, _$submitButton));
192
+ return getRect(this.#$submitButton);
440
193
  }
441
194
 
442
195
  get amButtonRect() {
@@ -444,8 +197,7 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
444
197
  return null;
445
198
  }
446
199
 
447
- const $am = _classPrivateFieldGet(this, _$ampm).querySelector('[value="am"]');
448
-
200
+ const $am = this.#$ampm.querySelector('[value="am"]');
449
201
  return $am != null ? getRect($am) : null;
450
202
  }
451
203
 
@@ -454,102 +206,198 @@ defineCustomElement('sinch-time-picker', (_$pickerHours = new WeakMap(), _$picke
454
206
  return null;
455
207
  }
456
208
 
457
- const $pm = _classPrivateFieldGet(this, _$ampm).querySelector('[value="pm"]');
458
-
209
+ const $pm = this.#$ampm.querySelector('[value="pm"]');
459
210
  return $pm != null ? getRect($pm) : null;
460
211
  }
461
212
 
462
213
  hourDigitRect(hour) {
463
- const $digit = _classPrivateFieldGet(this, _$pickerHours).children[hourToIndex(hour, !this.ampm)];
464
-
214
+ const $digit = this.#$pickerHours.children[hourToIndex(hour, !this.ampm)];
465
215
  return $digit != null ? getRect($digit) : null;
466
216
  }
467
217
 
468
218
  minuteDigitRect(minute) {
469
- const $digit = _classPrivateFieldGet(this, _$pickerMinutes).children[Math.round(minute / 5)];
470
-
219
+ const $digit = this.#$pickerMinutes.children[Math.round(minute / 5)];
471
220
  return $digit != null ? getRect($digit) : null;
472
221
  }
473
222
 
474
- }));
475
-
476
- function _getClickDegree2(x, y) {
477
- const touchRect = _classPrivateFieldGet(this, _$pickerTouch).getBoundingClientRect();
478
-
479
- const cx = touchRect.width / 2;
480
- const cy = touchRect.height / 2;
481
- const px = x - touchRect.x;
482
- const py = touchRect.height - y + touchRect.y;
483
- const dx = px - cx;
484
- const dy = py - cy;
485
- const len = Math.sqrt(dx * dx + dy * dy);
486
- const cosRad = dx / len;
487
- const rad = Math.acos(cosRad * (dy < 0 ? -1 : 1));
488
- const deg = rad * (180 / Math.PI);
489
- let cssDeg = (deg - 90 - 360) % 360 * -1;
490
-
491
- if (dy < 0) {
492
- cssDeg += 180;
223
+ #getClickDegree(x, y) {
224
+ const touchRect = this.#$pickerTouch.getBoundingClientRect();
225
+ const cx = touchRect.width / 2;
226
+ const cy = touchRect.height / 2;
227
+ const px = x - touchRect.x;
228
+ const py = touchRect.height - y + touchRect.y;
229
+ const dx = px - cx;
230
+ const dy = py - cy;
231
+ const len = Math.sqrt(dx * dx + dy * dy);
232
+ const cosRad = dx / len;
233
+ const rad = Math.acos(cosRad * (dy < 0 ? -1 : 1));
234
+ const deg = rad * (180 / Math.PI);
235
+ let cssDeg = (deg - 90 - 360) % 360 * -1;
236
+
237
+ if (dy < 0) {
238
+ cssDeg += 180;
239
+ }
240
+
241
+ const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
242
+ return [cssDeg, rowIndex];
493
243
  }
494
244
 
495
- const rowIndex = len > MINUTE_RADIUS ? 0 : len > HOUR_12_RADIUS ? 1 : 2;
496
- return [cssDeg, rowIndex];
497
- }
245
+ #onPickerClick = e => {
246
+ const [cssDeg, rowIndex] = this.#getClickDegree(e.x, e.y);
247
+ const isHourRowClick = rowIndex > 0;
248
+ const isHour24RowClick = rowIndex > 1;
498
249
 
499
- function _render2() {
500
- const is24 = getBooleanAttribute(this, 'ampm') === false;
250
+ if (isHourRowClick) {
251
+ const digitIndex = Math.round(cssDeg / 30) % 12;
252
+ const is24 = getBooleanAttribute(this, 'ampm') === false;
501
253
 
502
- _classPrivateMethodGet(this, _selectHour, _selectHour2).call(this, is24);
254
+ if (is24) {
255
+ if (isHour24RowClick) {
256
+ this.#hour = digitIndex === 0 ? 0 : digitIndex + 12;
257
+ } else {
258
+ this.#hour = digitIndex === 0 ? 12 : digitIndex;
259
+ }
260
+ } else {
261
+ this.#hour = digitIndex + (this.#$ampm.value === 'pm' ? 12 : 0);
262
+ }
503
263
 
504
- _classPrivateMethodGet(this, _selectMinute, _selectMinute2).call(this);
264
+ this.#$headerHours.focus();
265
+ } else {
266
+ this.#minute = Math.round(cssDeg / 6) % 60;
267
+ this.#$headerMinutes.focus();
268
+ }
505
269
 
506
- _classPrivateFieldGet(this, _$headerHoursText).textContent = stringifyHour(_classPrivateFieldGet(this, _hour), is24);
507
- _classPrivateFieldGet(this, _$headerMinutesText).textContent = stringifyMinute(_classPrivateFieldGet(this, _minute));
508
- updateAttribute(_classPrivateFieldGet(this, _$headerHours), 'aria-valuenow', _classPrivateFieldGet(this, _hour));
509
- updateAttribute(_classPrivateFieldGet(this, _$headerHours), 'aria-valuetext', _classPrivateFieldGet(this, _hour));
510
- updateAttribute(_classPrivateFieldGet(this, _$headerMinutes), 'aria-valuenow', _classPrivateFieldGet(this, _minute));
511
- updateAttribute(_classPrivateFieldGet(this, _$headerMinutes), 'aria-valuetext', _classPrivateFieldGet(this, _minute));
512
- }
270
+ this.#render();
271
+ };
272
+
273
+ #render() {
274
+ const is24 = getBooleanAttribute(this, 'ampm') === false;
275
+ this.#selectHour(is24);
276
+ this.#selectMinute();
277
+ this.#$headerHoursText.textContent = stringifyHour(this.#hour, is24);
278
+ this.#$headerMinutesText.textContent = stringifyMinute(this.#minute);
279
+ updateAttribute(this.#$headerHours, 'aria-valuenow', this.#hour);
280
+ updateAttribute(this.#$headerHours, 'aria-valuetext', this.#hour);
281
+ updateAttribute(this.#$headerMinutes, 'aria-valuenow', this.#minute);
282
+ updateAttribute(this.#$headerMinutes, 'aria-valuetext', this.#minute);
283
+ }
284
+
285
+ #selectHour(is24) {
286
+ const $hours = this.#$pickerHours.children;
287
+ const hourDigitIndex = this.#hour % 12;
288
+ const selectedIndex = hourToIndex(this.#hour, is24);
289
+ const currentCssDeg = getNeedleRotationDeg(this.#$needleHour);
290
+ const hourCssDeg = getShortestCssDeg(currentCssDeg, hourDigitIndex * 30);
291
+
292
+ for (let i = 0; i < $hours.length; i++) {
293
+ setClass($hours[i], 'selected', i === selectedIndex);
294
+ }
513
295
 
514
- function _selectHour2(is24) {
515
- const $hours = _classPrivateFieldGet(this, _$pickerHours).children;
296
+ this.#$needleHour.style.transform = `rotate(${hourCssDeg}deg)`;
516
297
 
517
- const hourDigitIndex = _classPrivateFieldGet(this, _hour) % 12;
518
- const selectedIndex = hourToIndex(_classPrivateFieldGet(this, _hour), is24);
519
- const currentCssDeg = getNeedleRotationDeg(_classPrivateFieldGet(this, _$needleHour));
520
- const hourCssDeg = getShortestCssDeg(currentCssDeg, hourDigitIndex * 30);
298
+ if (is24) {
299
+ if (this.#hour > 0 && this.#hour <= 12) {
300
+ this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
301
+ } else {
302
+ this.#$needleHour.style.height = `${NEEDLE_HOUR_24_LENGTH}px`;
303
+ }
304
+ } else {
305
+ this.#$needleHour.style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
306
+ }
521
307
 
522
- for (let i = 0; i < $hours.length; i++) {
523
- setClass($hours[i], 'selected', i === selectedIndex);
308
+ this.#$ampm.setAttribute('value', this.#hour >= 0 && this.#hour < 12 ? 'am' : 'pm');
524
309
  }
525
310
 
526
- _classPrivateFieldGet(this, _$needleHour).style.transform = `rotate(${hourCssDeg}deg)`;
311
+ #selectMinute() {
312
+ const $minutes = this.#$pickerMinutes.children;
313
+ const isNeedleSelected = this.#minute % 5 === 0;
314
+ const selectedIndex = this.#minute / 5;
315
+ const currentCssDeg = getNeedleRotationDeg(this.#$needleMinute);
316
+ const minuteCssDeg = getShortestCssDeg(currentCssDeg, this.#minute * 6);
527
317
 
528
- if (is24) {
529
- if (_classPrivateFieldGet(this, _hour) > 0 && _classPrivateFieldGet(this, _hour) <= 12) {
530
- _classPrivateFieldGet(this, _$needleHour).style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
531
- } else {
532
- _classPrivateFieldGet(this, _$needleHour).style.height = `${NEEDLE_HOUR_24_LENGTH}px`;
318
+ for (let i = 0; i < $minutes.length; i++) {
319
+ setClass($minutes[i], 'selected', selectedIndex === i);
533
320
  }
534
- } else {
535
- _classPrivateFieldGet(this, _$needleHour).style.height = `${NEEDLE_HOUR_12_LENGTH}px`;
321
+
322
+ setClass(this.#$needleMinute, 'selected', isNeedleSelected);
323
+ this.#$needleMinute.style.transform = `rotate(${minuteCssDeg}deg)`;
536
324
  }
537
325
 
538
- _classPrivateFieldGet(this, _$ampm).setAttribute('value', _classPrivateFieldGet(this, _hour) >= 0 && _classPrivateFieldGet(this, _hour) < 12 ? 'am' : 'pm');
539
- }
326
+ #onAmPmChange = e => {
327
+ e.stopPropagation();
328
+ const value = e.detail;
540
329
 
541
- function _selectMinute2() {
542
- const $minutes = _classPrivateFieldGet(this, _$pickerMinutes).children;
330
+ switch (value) {
331
+ case 'am':
332
+ {
333
+ if (this.#hour >= 12) {
334
+ this.#hour -= 12;
335
+ this.#render();
336
+ }
543
337
 
544
- const isNeedleSelected = _classPrivateFieldGet(this, _minute) % 5 === 0;
545
- const selectedIndex = _classPrivateFieldGet(this, _minute) / 5;
546
- const currentCssDeg = getNeedleRotationDeg(_classPrivateFieldGet(this, _$needleMinute));
547
- const minuteCssDeg = getShortestCssDeg(currentCssDeg, _classPrivateFieldGet(this, _minute) * 6);
338
+ break;
339
+ }
548
340
 
549
- for (let i = 0; i < $minutes.length; i++) {
550
- setClass($minutes[i], 'selected', selectedIndex === i);
551
- }
341
+ case 'pm':
342
+ {
343
+ if (this.#hour < 12) {
344
+ this.#hour += 12;
345
+ this.#render();
346
+ }
552
347
 
553
- setClass(_classPrivateFieldGet(this, _$needleMinute), 'selected', isNeedleSelected);
554
- _classPrivateFieldGet(this, _$needleMinute).style.transform = `rotate(${minuteCssDeg}deg)`;
555
- }
348
+ break;
349
+ }
350
+ }
351
+ };
352
+ #onSubmitButtonClick = () => {
353
+ const value = stringifyTime(this.#hour, this.#minute);
354
+ this.dispatchEvent(new CustomEvent('change', {
355
+ bubbles: true,
356
+ detail: value
357
+ }));
358
+ this.dispatchEvent(new CustomEvent('-change', {
359
+ detail: value
360
+ }));
361
+ };
362
+ #onHoursKeydown = e => {
363
+ switch (e.key) {
364
+ case 'ArrowUp':
365
+ {
366
+ e.preventDefault();
367
+ this.#hour = (this.#hour + 1) % 24;
368
+ this.#render();
369
+ break;
370
+ }
371
+
372
+ case 'ArrowDown':
373
+ {
374
+ e.preventDefault();
375
+ this.#hour = (this.#hour + 23) % 24;
376
+ this.#render();
377
+ break;
378
+ }
379
+ }
380
+ };
381
+ #onMinutesKeydown = e => {
382
+ switch (e.key) {
383
+ case 'ArrowUp':
384
+ {
385
+ e.preventDefault();
386
+ this.#minute = (this.#minute + 1) % 60;
387
+ this.#render();
388
+ break;
389
+ }
390
+
391
+ case 'ArrowDown':
392
+ {
393
+ e.preventDefault();
394
+ this.#minute = (this.#minute + 59) % 60;
395
+ this.#render();
396
+ break;
397
+ }
398
+ }
399
+ };
400
+ #onChangeReactHandler = e => {
401
+ getReactEventHandler(this, 'on-change')?.(e);
402
+ };
403
+ });