@cdek-it/angular-ui-kit 0.0.2 → 0.2.6-test

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 (173) hide show
  1. package/components/accordion/index.d.ts +21 -0
  2. package/components/autocomplete/index.d.ts +65 -0
  3. package/components/avatar/index.d.ts +22 -0
  4. package/components/badge/index.d.ts +19 -0
  5. package/components/breadcrumb/index.d.ts +11 -0
  6. package/components/button/index.d.ts +40 -0
  7. package/components/card/index.d.ts +20 -0
  8. package/components/carousel/index.d.ts +41 -0
  9. package/components/checkbox/index.d.ts +44 -0
  10. package/components/chip/index.d.ts +14 -0
  11. package/components/confirm-dialog/index.d.ts +37 -0
  12. package/components/date-picker/index.d.ts +89 -0
  13. package/components/dialog/index.d.ts +47 -0
  14. package/components/divider/index.d.ts +15 -0
  15. package/components/drawer/index.d.ts +33 -0
  16. package/components/galleria/index.d.ts +65 -0
  17. package/components/inputgroup/index.d.ts +17 -0
  18. package/components/inputmask/index.d.ts +43 -0
  19. package/components/inputnumber/index.d.ts +50 -0
  20. package/components/inputotp/index.d.ts +40 -0
  21. package/components/inputtext/index.d.ts +35 -0
  22. package/components/listbox/index.d.ts +43 -0
  23. package/components/megamenu/index.d.ts +26 -0
  24. package/components/menu/index.d.ts +24 -0
  25. package/components/menubar/index.d.ts +16 -0
  26. package/components/message/index.d.ts +19 -0
  27. package/components/metergroup/index.d.ts +21 -0
  28. package/components/paginator/index.d.ts +25 -0
  29. package/components/panelmenu/index.d.ts +19 -0
  30. package/components/password/index.d.ts +54 -0
  31. package/components/popover/index.d.ts +12 -0
  32. package/components/progressbar/index.d.ts +13 -0
  33. package/components/progressspinner/index.d.ts +17 -0
  34. package/components/radiobutton/index.d.ts +39 -0
  35. package/components/rating/index.d.ts +27 -0
  36. package/components/scroll-panel/index.d.ts +11 -0
  37. package/components/select/index.d.ts +78 -0
  38. package/components/skeleton/index.d.ts +17 -0
  39. package/components/slider/index.d.ts +33 -0
  40. package/components/stepper/index.d.ts +25 -0
  41. package/components/tabs/index.d.ts +22 -0
  42. package/components/tag/index.d.ts +15 -0
  43. package/components/textarea/index.d.ts +40 -0
  44. package/components/tieredmenu/index.d.ts +19 -0
  45. package/components/timeline/index.d.ts +35 -0
  46. package/components/toast/index.d.ts +52 -0
  47. package/components/toggleswitch/index.d.ts +26 -0
  48. package/components/tooltip/index.d.ts +18 -0
  49. package/fesm2022/cdek-it-angular-ui-kit-components-accordion.mjs +69 -0
  50. package/fesm2022/cdek-it-angular-ui-kit-components-accordion.mjs.map +1 -0
  51. package/fesm2022/cdek-it-angular-ui-kit-components-autocomplete.mjs +269 -0
  52. package/fesm2022/cdek-it-angular-ui-kit-components-autocomplete.mjs.map +1 -0
  53. package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs +93 -0
  54. package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs.map +1 -0
  55. package/fesm2022/cdek-it-angular-ui-kit-components-badge.mjs +46 -0
  56. package/fesm2022/cdek-it-angular-ui-kit-components-badge.mjs.map +1 -0
  57. package/fesm2022/cdek-it-angular-ui-kit-components-breadcrumb.mjs +31 -0
  58. package/fesm2022/cdek-it-angular-ui-kit-components-breadcrumb.mjs.map +1 -0
  59. package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs +143 -0
  60. package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs.map +1 -0
  61. package/fesm2022/cdek-it-angular-ui-kit-components-card.mjs +124 -0
  62. package/fesm2022/cdek-it-angular-ui-kit-components-card.mjs.map +1 -0
  63. package/fesm2022/cdek-it-angular-ui-kit-components-carousel.mjs +166 -0
  64. package/fesm2022/cdek-it-angular-ui-kit-components-carousel.mjs.map +1 -0
  65. package/fesm2022/cdek-it-angular-ui-kit-components-checkbox.mjs +179 -0
  66. package/fesm2022/cdek-it-angular-ui-kit-components-checkbox.mjs.map +1 -0
  67. package/fesm2022/cdek-it-angular-ui-kit-components-chip.mjs +56 -0
  68. package/fesm2022/cdek-it-angular-ui-kit-components-chip.mjs.map +1 -0
  69. package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs +192 -0
  70. package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs.map +1 -0
  71. package/fesm2022/cdek-it-angular-ui-kit-components-date-picker.mjs +640 -0
  72. package/fesm2022/cdek-it-angular-ui-kit-components-date-picker.mjs.map +1 -0
  73. package/fesm2022/cdek-it-angular-ui-kit-components-dialog.mjs +179 -0
  74. package/fesm2022/cdek-it-angular-ui-kit-components-dialog.mjs.map +1 -0
  75. package/fesm2022/cdek-it-angular-ui-kit-components-divider.mjs +42 -0
  76. package/fesm2022/cdek-it-angular-ui-kit-components-divider.mjs.map +1 -0
  77. package/fesm2022/cdek-it-angular-ui-kit-components-drawer.mjs +153 -0
  78. package/fesm2022/cdek-it-angular-ui-kit-components-drawer.mjs.map +1 -0
  79. package/fesm2022/cdek-it-angular-ui-kit-components-galleria.mjs +284 -0
  80. package/fesm2022/cdek-it-angular-ui-kit-components-galleria.mjs.map +1 -0
  81. package/fesm2022/cdek-it-angular-ui-kit-components-inputgroup.mjs +64 -0
  82. package/fesm2022/cdek-it-angular-ui-kit-components-inputgroup.mjs.map +1 -0
  83. package/fesm2022/cdek-it-angular-ui-kit-components-inputmask.mjs +164 -0
  84. package/fesm2022/cdek-it-angular-ui-kit-components-inputmask.mjs.map +1 -0
  85. package/fesm2022/cdek-it-angular-ui-kit-components-inputnumber.mjs +267 -0
  86. package/fesm2022/cdek-it-angular-ui-kit-components-inputnumber.mjs.map +1 -0
  87. package/fesm2022/cdek-it-angular-ui-kit-components-inputotp.mjs +148 -0
  88. package/fesm2022/cdek-it-angular-ui-kit-components-inputotp.mjs.map +1 -0
  89. package/fesm2022/cdek-it-angular-ui-kit-components-inputtext.mjs +187 -0
  90. package/fesm2022/cdek-it-angular-ui-kit-components-inputtext.mjs.map +1 -0
  91. package/fesm2022/cdek-it-angular-ui-kit-components-listbox.mjs +172 -0
  92. package/fesm2022/cdek-it-angular-ui-kit-components-listbox.mjs.map +1 -0
  93. package/fesm2022/cdek-it-angular-ui-kit-components-megamenu.mjs +160 -0
  94. package/fesm2022/cdek-it-angular-ui-kit-components-megamenu.mjs.map +1 -0
  95. package/fesm2022/cdek-it-angular-ui-kit-components-menu.mjs +114 -0
  96. package/fesm2022/cdek-it-angular-ui-kit-components-menu.mjs.map +1 -0
  97. package/fesm2022/cdek-it-angular-ui-kit-components-menubar.mjs +88 -0
  98. package/fesm2022/cdek-it-angular-ui-kit-components-menubar.mjs.map +1 -0
  99. package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs +105 -0
  100. package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs.map +1 -0
  101. package/fesm2022/cdek-it-angular-ui-kit-components-metergroup.mjs +69 -0
  102. package/fesm2022/cdek-it-angular-ui-kit-components-metergroup.mjs.map +1 -0
  103. package/fesm2022/cdek-it-angular-ui-kit-components-paginator.mjs +95 -0
  104. package/fesm2022/cdek-it-angular-ui-kit-components-paginator.mjs.map +1 -0
  105. package/fesm2022/cdek-it-angular-ui-kit-components-panelmenu.mjs +69 -0
  106. package/fesm2022/cdek-it-angular-ui-kit-components-panelmenu.mjs.map +1 -0
  107. package/fesm2022/cdek-it-angular-ui-kit-components-password.mjs +258 -0
  108. package/fesm2022/cdek-it-angular-ui-kit-components-password.mjs.map +1 -0
  109. package/fesm2022/cdek-it-angular-ui-kit-components-popover.mjs +48 -0
  110. package/fesm2022/cdek-it-angular-ui-kit-components-popover.mjs.map +1 -0
  111. package/fesm2022/cdek-it-angular-ui-kit-components-progressbar.mjs +34 -0
  112. package/fesm2022/cdek-it-angular-ui-kit-components-progressbar.mjs.map +1 -0
  113. package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs +64 -0
  114. package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs.map +1 -0
  115. package/fesm2022/cdek-it-angular-ui-kit-components-radiobutton.mjs +148 -0
  116. package/fesm2022/cdek-it-angular-ui-kit-components-radiobutton.mjs.map +1 -0
  117. package/fesm2022/cdek-it-angular-ui-kit-components-rating.mjs +105 -0
  118. package/fesm2022/cdek-it-angular-ui-kit-components-rating.mjs.map +1 -0
  119. package/fesm2022/cdek-it-angular-ui-kit-components-scroll-panel.mjs +42 -0
  120. package/fesm2022/cdek-it-angular-ui-kit-components-scroll-panel.mjs.map +1 -0
  121. package/fesm2022/cdek-it-angular-ui-kit-components-select.mjs +350 -0
  122. package/fesm2022/cdek-it-angular-ui-kit-components-select.mjs.map +1 -0
  123. package/fesm2022/cdek-it-angular-ui-kit-components-skeleton.mjs +62 -0
  124. package/fesm2022/cdek-it-angular-ui-kit-components-skeleton.mjs.map +1 -0
  125. package/fesm2022/cdek-it-angular-ui-kit-components-slider.mjs +124 -0
  126. package/fesm2022/cdek-it-angular-ui-kit-components-slider.mjs.map +1 -0
  127. package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs +227 -0
  128. package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs.map +1 -0
  129. package/fesm2022/cdek-it-angular-ui-kit-components-tabs.mjs +83 -0
  130. package/fesm2022/cdek-it-angular-ui-kit-components-tabs.mjs.map +1 -0
  131. package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs +46 -0
  132. package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs.map +1 -0
  133. package/fesm2022/cdek-it-angular-ui-kit-components-textarea.mjs +214 -0
  134. package/fesm2022/cdek-it-angular-ui-kit-components-textarea.mjs.map +1 -0
  135. package/fesm2022/cdek-it-angular-ui-kit-components-tieredmenu.mjs +70 -0
  136. package/fesm2022/cdek-it-angular-ui-kit-components-tieredmenu.mjs.map +1 -0
  137. package/fesm2022/cdek-it-angular-ui-kit-components-timeline.mjs +164 -0
  138. package/fesm2022/cdek-it-angular-ui-kit-components-timeline.mjs.map +1 -0
  139. package/fesm2022/cdek-it-angular-ui-kit-components-toast.mjs +106 -0
  140. package/fesm2022/cdek-it-angular-ui-kit-components-toast.mjs.map +1 -0
  141. package/fesm2022/cdek-it-angular-ui-kit-components-toggleswitch.mjs +93 -0
  142. package/fesm2022/cdek-it-angular-ui-kit-components-toggleswitch.mjs.map +1 -0
  143. package/fesm2022/cdek-it-angular-ui-kit-components-tooltip.mjs +60 -0
  144. package/fesm2022/cdek-it-angular-ui-kit-components-tooltip.mjs.map +1 -0
  145. package/fesm2022/cdek-it-angular-ui-kit-providers.mjs +8028 -0
  146. package/fesm2022/cdek-it-angular-ui-kit-providers.mjs.map +1 -0
  147. package/fesm2022/cdek-it-angular-ui-kit-shared.mjs +4 -0
  148. package/fesm2022/cdek-it-angular-ui-kit-shared.mjs.map +1 -0
  149. package/fesm2022/cdek-it-angular-ui-kit.mjs +6 -0
  150. package/fesm2022/cdek-it-angular-ui-kit.mjs.map +1 -0
  151. package/index.d.ts +2 -0
  152. package/package.json +227 -112
  153. package/providers/index.d.ts +5 -0
  154. package/shared/index.d.ts +49 -0
  155. package/LICENSE.md +0 -75
  156. package/README.md +0 -70
  157. package/dist-css/css/brand-dark-primary-theme.css/theme.css +0 -9924
  158. package/dist-css/css/brand-dark-primary-theme.min.css/theme.min.css +0 -2852
  159. package/dist-css/css/brand-dark-secondary-theme.css/theme.css +0 -9924
  160. package/dist-css/css/brand-dark-secondary-theme.min.css/theme.min.css +0 -2852
  161. package/dist-css/css/brand-light-primary-theme.css/theme.css +0 -10007
  162. package/dist-css/css/brand-light-primary-theme.min.css/theme.min.css +0 -2868
  163. package/dist-css/css/brand-light-secondary-theme.css/theme.css +0 -9924
  164. package/dist-css/css/brand-light-secondary-theme.min.css/theme.min.css +0 -2852
  165. package/dist-css/css/dark-primary-theme.css/theme.css +0 -9924
  166. package/dist-css/css/dark-primary-theme.min.css/theme.min.css +0 -2852
  167. package/dist-css/css/dark-secondary-theme.css/theme.css +0 -9924
  168. package/dist-css/css/dark-secondary-theme.min.css/theme.min.css +0 -2852
  169. package/dist-css/css/light-primary-theme.css/theme.css +0 -10007
  170. package/dist-css/css/light-primary-theme.min.css/theme.min.css +0 -2868
  171. package/dist-css/css/light-secondary-theme.css/theme.css +0 -9924
  172. package/dist-css/css/light-secondary-theme.min.css/theme.min.css +0 -2852
  173. package/dist-css/package.json +0 -15
@@ -0,0 +1,640 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ChangeDetectorRef, EventEmitter, forwardRef, Output, Input, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
+ import { DatePicker } from 'primeng/datepicker';
6
+ import { InputText } from 'primeng/inputtext';
7
+ import { PrimeTemplate } from 'primeng/api';
8
+ import { Select } from 'primeng/select';
9
+ import { Button } from 'primeng/button';
10
+
11
+ const MONTHS = [
12
+ { name: 'Январь', value: 0 },
13
+ { name: 'Февраль', value: 1 },
14
+ { name: 'Март', value: 2 },
15
+ { name: 'Апрель', value: 3 },
16
+ { name: 'Май', value: 4 },
17
+ { name: 'Июнь', value: 5 },
18
+ { name: 'Июль', value: 6 },
19
+ { name: 'Август', value: 7 },
20
+ { name: 'Сентябрь', value: 8 },
21
+ { name: 'Октябрь', value: 9 },
22
+ { name: 'Ноябрь', value: 10 },
23
+ { name: 'Декабрь', value: 11 },
24
+ ];
25
+ const YEARS = (() => {
26
+ const result = [];
27
+ for (let y = 1990; y <= 2035; y++) {
28
+ result.push({ name: String(y), value: y });
29
+ }
30
+ return result;
31
+ })();
32
+ class ExtraDatePickerComponent {
33
+ cdr = inject(ChangeDetectorRef);
34
+ dpRef;
35
+ months = MONTHS;
36
+ years = YEARS;
37
+ dpCurrentMonth = new Date().getMonth();
38
+ dpCurrentYear = new Date().getFullYear();
39
+ hourInput = '00';
40
+ minuteInput = '00';
41
+ modelValue = null;
42
+ disabled = false;
43
+ dateFormat = 'dd.mm.yy';
44
+ selectionMode = 'single';
45
+ size = 'medium';
46
+ showIcon = true;
47
+ iconDisplay = 'input';
48
+ inline = false;
49
+ showButtonBar = false;
50
+ showTime = false;
51
+ hourFormat = '24';
52
+ showClear = false;
53
+ placeholder = undefined;
54
+ readonly = false;
55
+ invalid = false;
56
+ minDate = undefined;
57
+ maxDate = undefined;
58
+ view = 'date';
59
+ showOtherMonths = true;
60
+ selectOtherMonths = false;
61
+ onSelect = new EventEmitter();
62
+ onMonthChange = new EventEmitter();
63
+ onYearChange = new EventEmitter();
64
+ onClear = new EventEmitter();
65
+ get primeSize() {
66
+ if (this.size === 'small')
67
+ return 'small';
68
+ if (this.size === 'large' || this.size === 'xlarge')
69
+ return 'large';
70
+ return undefined;
71
+ }
72
+ ngAfterViewInit() {
73
+ // Sync initial month/year for inline mode (panel renders immediately)
74
+ if (this.inline) {
75
+ this.syncCurrentDate();
76
+ }
77
+ }
78
+ syncCurrentDate() {
79
+ if (this.dpRef) {
80
+ this.dpCurrentMonth = this.dpRef.currentMonth;
81
+ this.dpCurrentYear = this.dpRef.currentYear;
82
+ }
83
+ }
84
+ onMonthChangeHandler(event) {
85
+ this.dpCurrentMonth = event.month ? event.month - 1 : new Date().getMonth();
86
+ this.dpCurrentYear = event.year || new Date().getFullYear();
87
+ this.onMonthChange.emit(event);
88
+ }
89
+ onYearChangeHandler(event) {
90
+ this.dpCurrentMonth = event.month ? event.month - 1 : new Date().getMonth();
91
+ this.dpCurrentYear = event.year || new Date().getFullYear();
92
+ this.onYearChange.emit(event);
93
+ }
94
+ onMonthSelect(month) {
95
+ this.dpCurrentMonth = month;
96
+ this.dpRef?.createMonths(month, this.dpCurrentYear);
97
+ }
98
+ onYearSelect(year) {
99
+ this.dpCurrentYear = year;
100
+ this.dpRef?.createMonths(this.dpCurrentMonth, year);
101
+ }
102
+ navPrev(event) {
103
+ this.dpRef?.navBackward(event);
104
+ }
105
+ navNext(event) {
106
+ this.dpRef?.navForward(event);
107
+ }
108
+ onValueChange(val) {
109
+ this.modelValue = val;
110
+ this._onChange(val);
111
+ if (this.inline) {
112
+ this._onTouched();
113
+ }
114
+ if (this.selectionMode === 'range' && Array.isArray(val)) {
115
+ if (val[1]) {
116
+ this.rangeStart = null;
117
+ if (!this.inline) {
118
+ this.dpRef.hideOverlay();
119
+ }
120
+ }
121
+ else {
122
+ this.rangeStart = val[0] ?? null;
123
+ }
124
+ }
125
+ }
126
+ onHourFieldInput(event) {
127
+ const input = event.target;
128
+ const cleaned = input.value.replace(/\D/g, '').slice(0, 2);
129
+ if (input.value !== cleaned) {
130
+ input.value = cleaned;
131
+ }
132
+ this.hourInput = cleaned;
133
+ if (cleaned.length === 2) {
134
+ const parsed = parseInt(cleaned, 10);
135
+ if (!isNaN(parsed)) {
136
+ this.dpRef.currentHour = Math.min(23, Math.max(0, parsed));
137
+ }
138
+ }
139
+ }
140
+ onHourFieldBlur() {
141
+ const parsed = parseInt(this.hourInput, 10);
142
+ const clamped = isNaN(parsed) ? 0 : Math.min(23, Math.max(0, parsed));
143
+ this.dpRef.currentHour = clamped;
144
+ this.hourInput = String(clamped).padStart(2, '0');
145
+ this.dpRef.updateTime();
146
+ this.cdr.markForCheck();
147
+ }
148
+ onMinuteFieldInput(event) {
149
+ const input = event.target;
150
+ const cleaned = input.value.replace(/\D/g, '').slice(0, 2);
151
+ if (input.value !== cleaned) {
152
+ input.value = cleaned;
153
+ }
154
+ this.minuteInput = cleaned;
155
+ if (cleaned.length === 2) {
156
+ const parsed = parseInt(cleaned, 10);
157
+ if (!isNaN(parsed)) {
158
+ this.dpRef.currentMinute = Math.min(59, Math.max(0, parsed));
159
+ }
160
+ }
161
+ }
162
+ onMinuteFieldBlur() {
163
+ const parsed = parseInt(this.minuteInput, 10);
164
+ const clamped = isNaN(parsed) ? 0 : Math.min(59, Math.max(0, parsed));
165
+ this.dpRef.currentMinute = clamped;
166
+ this.minuteInput = String(clamped).padStart(2, '0');
167
+ this.dpRef.updateTime();
168
+ this.cdr.markForCheck();
169
+ }
170
+ syncTimeInputs() {
171
+ if (!this.dpRef)
172
+ return;
173
+ const h = this.dpRef.currentHour ?? 0;
174
+ const m = this.dpRef.currentMinute ?? 0;
175
+ this.hourInput = String(h).padStart(2, '0');
176
+ this.minuteInput = String(m).padStart(2, '0');
177
+ this.cdr.markForCheck();
178
+ }
179
+ selectOverlayGuard = null;
180
+ attachSelectOverlayGuard() {
181
+ if (this.selectOverlayGuard)
182
+ return;
183
+ this.selectOverlayGuard = (e) => {
184
+ const target = e.target;
185
+ if (target && target.closest('.p-select-overlay')) {
186
+ e.stopPropagation();
187
+ }
188
+ };
189
+ document.addEventListener('mousedown', this.selectOverlayGuard, true);
190
+ }
191
+ detachSelectOverlayGuard() {
192
+ if (!this.selectOverlayGuard)
193
+ return;
194
+ document.removeEventListener('mousedown', this.selectOverlayGuard, true);
195
+ this.selectOverlayGuard = null;
196
+ }
197
+ // ── Range hover preview ──────────────────────────────────────────────────
198
+ panelMouseoverHandler = null;
199
+ panelMouseleaveHandler = null;
200
+ rangeStart = null;
201
+ onPanelShow() {
202
+ this.syncCurrentDate();
203
+ this.syncTimeInputs();
204
+ this.attachSelectOverlayGuard();
205
+ if (this.selectionMode === 'range') {
206
+ this.attachRangePreview();
207
+ }
208
+ }
209
+ onPanelClose() {
210
+ this.detachSelectOverlayGuard();
211
+ this.detachRangePreview();
212
+ this._onTouched();
213
+ }
214
+ onDateSelected(event) {
215
+ this.onSelect.emit(event);
216
+ }
217
+ // ── ControlValueAccessor ──────────────────────────────────────────────────
218
+ _onChange = () => { };
219
+ _onTouched = () => { };
220
+ writeValue(value) {
221
+ this.modelValue = value ?? null;
222
+ this.cdr.markForCheck();
223
+ }
224
+ registerOnChange(fn) {
225
+ this._onChange = fn;
226
+ }
227
+ registerOnTouched(fn) {
228
+ this._onTouched = fn;
229
+ }
230
+ setDisabledState(isDisabled) {
231
+ this.disabled = isDisabled;
232
+ this.cdr.markForCheck();
233
+ }
234
+ ngOnDestroy() {
235
+ this.detachRangePreview();
236
+ this.detachSelectOverlayGuard();
237
+ }
238
+ attachRangePreview() {
239
+ this.removeRangeListeners();
240
+ setTimeout(() => {
241
+ const panel = this.getPanelElement();
242
+ if (!panel)
243
+ return;
244
+ this.panelMouseoverHandler = (e) => {
245
+ if (!this.rangeStart)
246
+ return;
247
+ const dayEl = e.target.closest('.p-datepicker-day');
248
+ if (!dayEl)
249
+ return;
250
+ const dateKey = dayEl.getAttribute('data-date');
251
+ if (!dateKey)
252
+ return;
253
+ const hovered = this.parseDateKey(dateKey);
254
+ if (!hovered)
255
+ return;
256
+ this.clearHoverPreview(panel);
257
+ this.applyRangePreview(panel, this.rangeStart, hovered);
258
+ };
259
+ this.panelMouseleaveHandler = () => {
260
+ this.clearHoverPreview(panel);
261
+ };
262
+ panel.addEventListener('mouseover', this.panelMouseoverHandler);
263
+ panel.addEventListener('mouseleave', this.panelMouseleaveHandler);
264
+ });
265
+ }
266
+ removeRangeListeners() {
267
+ const panel = this.getPanelElement();
268
+ if (panel) {
269
+ if (this.panelMouseoverHandler) {
270
+ panel.removeEventListener('mouseover', this.panelMouseoverHandler);
271
+ }
272
+ if (this.panelMouseleaveHandler) {
273
+ panel.removeEventListener('mouseleave', this.panelMouseleaveHandler);
274
+ }
275
+ }
276
+ this.panelMouseoverHandler = null;
277
+ this.panelMouseleaveHandler = null;
278
+ }
279
+ detachRangePreview() {
280
+ const panel = this.getPanelElement();
281
+ if (panel)
282
+ this.clearHoverPreview(panel);
283
+ this.removeRangeListeners();
284
+ }
285
+ getPanelElement() {
286
+ return this.dpRef?.content?.nativeElement ?? document.querySelector('.p-datepicker-panel');
287
+ }
288
+ parseDateKey(key) {
289
+ const parts = key.split('-').map(Number);
290
+ if (parts.length !== 3 || parts.some(isNaN))
291
+ return null;
292
+ return new Date(parts[0], parts[1], parts[2]);
293
+ }
294
+ applyRangePreview(panel, start, end) {
295
+ const [from, to] = start <= end ? [start, end] : [end, start];
296
+ const days = panel.querySelectorAll('.p-datepicker-day[data-date]');
297
+ days.forEach((el) => {
298
+ const key = el.getAttribute('data-date');
299
+ if (!key)
300
+ return;
301
+ const d = this.parseDateKey(key);
302
+ if (!d)
303
+ return;
304
+ const inRange = d > from && d < to;
305
+ const isEdge = d.getTime() === from.getTime() || d.getTime() === to.getTime();
306
+ if (inRange) {
307
+ el.classList.add('p-datepicker-day-selected-range');
308
+ el.setAttribute('data-hover-preview', '');
309
+ }
310
+ if (isEdge && !el.classList.contains('p-datepicker-day-selected')) {
311
+ el.classList.add('p-datepicker-day-selected');
312
+ el.setAttribute('data-hover-preview', '');
313
+ }
314
+ });
315
+ }
316
+ clearHoverPreview(panel) {
317
+ panel.querySelectorAll('[data-hover-preview]').forEach((el) => {
318
+ el.classList.remove('p-datepicker-day-selected-range', 'p-datepicker-day-selected');
319
+ el.removeAttribute('data-hover-preview');
320
+ });
321
+ }
322
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraDatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
323
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ExtraDatePickerComponent, isStandalone: true, selector: "extra-date-picker", inputs: { dateFormat: "dateFormat", selectionMode: "selectionMode", size: "size", showIcon: "showIcon", iconDisplay: "iconDisplay", inline: "inline", showButtonBar: "showButtonBar", showTime: "showTime", hourFormat: "hourFormat", showClear: "showClear", placeholder: "placeholder", readonly: "readonly", invalid: "invalid", minDate: "minDate", maxDate: "maxDate", view: "view", showOtherMonths: "showOtherMonths", selectOtherMonths: "selectOtherMonths" }, outputs: { onSelect: "onSelect", onMonthChange: "onMonthChange", onYearChange: "onYearChange", onClear: "onClear" }, host: { styleAttribute: "display: inline-flex" }, providers: [
324
+ {
325
+ provide: NG_VALUE_ACCESSOR,
326
+ useExisting: forwardRef(() => ExtraDatePickerComponent),
327
+ multi: true
328
+ }
329
+ ], viewQueries: [{ propertyName: "dpRef", first: true, predicate: ["dpRef"], descendants: true }], ngImport: i0, template: `
330
+ <p-datepicker
331
+ #dpRef
332
+ [ngModel]="modelValue"
333
+ (ngModelChange)="onValueChange($event)"
334
+ [dateFormat]="dateFormat"
335
+ [selectionMode]="selectionMode"
336
+ [showIcon]="showIcon"
337
+ [iconDisplay]="iconDisplay"
338
+ [inline]="inline"
339
+ [showButtonBar]="showButtonBar"
340
+ [showTime]="showTime"
341
+ [hourFormat]="hourFormat"
342
+ [showClear]="showClear"
343
+ [placeholder]="placeholder"
344
+ [disabled]="disabled"
345
+ [readonlyInput]="readonly"
346
+ [invalid]="invalid"
347
+ [size]="primeSize"
348
+ [inputStyleClass]="size === 'xlarge' ? 'p-inputtext-xlg' : ''"
349
+ [panelStyle]="{ minWidth: 'fit-content' }"
350
+ [appendTo]="inline ? undefined : 'body'"
351
+ [minDate]="minDate"
352
+ [maxDate]="maxDate"
353
+ [view]="view"
354
+ [hideOnDateTimeSelect]="false"
355
+ [showOtherMonths]="showOtherMonths"
356
+ [selectOtherMonths]="selectOtherMonths"
357
+ (onShow)="onPanelShow()"
358
+ (onClose)="onPanelClose()"
359
+ (onMonthChange)="onMonthChangeHandler($event)"
360
+ (onYearChange)="onYearChangeHandler($event)"
361
+ (onSelect)="onDateSelected($event)"
362
+ (onClear)="onClear.emit($event)"
363
+ >
364
+ <ng-template pTemplate="header">
365
+ <div class="p-datepicker-header p-datepicker-custom-header">
366
+ <p-button severity="secondary" [rounded]="true" [text]="true" (onClick)="navPrev($event)">
367
+ <ng-template pTemplate="icon">
368
+ <i class="ti ti-chevron-left" aria-hidden="true"></i>
369
+ </ng-template>
370
+ </p-button>
371
+ <div class="p-datepicker-title">
372
+ <p-select
373
+ appendTo="body"
374
+ [options]="months"
375
+ optionLabel="name"
376
+ optionValue="value"
377
+ [ngModel]="dpCurrentMonth"
378
+ (ngModelChange)="onMonthSelect($event)"
379
+ class="p-datepicker-month-select"
380
+ ></p-select>
381
+ <p-select
382
+ appendTo="body"
383
+ [options]="years"
384
+ optionLabel="name"
385
+ optionValue="value"
386
+ [ngModel]="dpCurrentYear"
387
+ (ngModelChange)="onYearSelect($event)"
388
+ class="p-datepicker-year-select"
389
+ ></p-select>
390
+ </div>
391
+ <p-button severity="secondary" [rounded]="true" [text]="true" (onClick)="navNext($event)">
392
+ <ng-template pTemplate="icon">
393
+ <i class="ti ti-chevron-right" aria-hidden="true"></i>
394
+ </ng-template>
395
+ </p-button>
396
+ </div>
397
+ </ng-template>
398
+
399
+ <ng-template pTemplate="inputicon" let-clickCallBack="clickCallBack">
400
+ <i class="ti ti-calendar-month p-datepicker-input-icon cursor-pointer" (click)="clickCallBack($event)"></i>
401
+ </ng-template>
402
+ <ng-template pTemplate="triggericon">
403
+ <i class="ti ti-calendar-month"></i>
404
+ </ng-template>
405
+ @if (showClear) {
406
+ <ng-template pTemplate="clearicon">
407
+ <i class="ti ti-x"></i>
408
+ </ng-template>
409
+ }
410
+ @if (showTime) {
411
+ <ng-template pTemplate="footer">
412
+ <div class="p-datepicker-time-picker p-datepicker-time-picker-custom" (keydown)="$event.stopPropagation()">
413
+ <div class="p-datepicker-time-field">
414
+ <label class="p-datepicker-time-label">Часы</label>
415
+ <input
416
+ type="text"
417
+ inputmode="numeric"
418
+ maxlength="2"
419
+ pattern="[0-9]{2}"
420
+ pInputText
421
+ class="p-datepicker-time-input"
422
+ [value]="hourInput"
423
+ (input)="onHourFieldInput($event)"
424
+ (blur)="onHourFieldBlur()"
425
+ />
426
+ </div>
427
+ <div class="p-datepicker-separator">
428
+ <span>:</span>
429
+ </div>
430
+ <div class="p-datepicker-time-field">
431
+ <label class="p-datepicker-time-label">Минуты</label>
432
+ <input
433
+ type="text"
434
+ inputmode="numeric"
435
+ maxlength="2"
436
+ pattern="[0-9]{2}"
437
+ pInputText
438
+ class="p-datepicker-time-input"
439
+ [value]="minuteInput"
440
+ (input)="onMinuteFieldInput($event)"
441
+ (blur)="onMinuteFieldBlur()"
442
+ />
443
+ </div>
444
+ </div>
445
+ </ng-template>
446
+ }
447
+ </p-datepicker>
448
+ `, isInline: true, dependencies: [{ kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
449
+ }
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraDatePickerComponent, decorators: [{
451
+ type: Component,
452
+ args: [{
453
+ selector: 'extra-date-picker',
454
+ host: { style: 'display: inline-flex' },
455
+ standalone: true,
456
+ changeDetection: ChangeDetectionStrategy.OnPush,
457
+ providers: [
458
+ {
459
+ provide: NG_VALUE_ACCESSOR,
460
+ useExisting: forwardRef(() => ExtraDatePickerComponent),
461
+ multi: true
462
+ }
463
+ ],
464
+ imports: [DatePicker, InputText, PrimeTemplate, FormsModule, Select, Button],
465
+ template: `
466
+ <p-datepicker
467
+ #dpRef
468
+ [ngModel]="modelValue"
469
+ (ngModelChange)="onValueChange($event)"
470
+ [dateFormat]="dateFormat"
471
+ [selectionMode]="selectionMode"
472
+ [showIcon]="showIcon"
473
+ [iconDisplay]="iconDisplay"
474
+ [inline]="inline"
475
+ [showButtonBar]="showButtonBar"
476
+ [showTime]="showTime"
477
+ [hourFormat]="hourFormat"
478
+ [showClear]="showClear"
479
+ [placeholder]="placeholder"
480
+ [disabled]="disabled"
481
+ [readonlyInput]="readonly"
482
+ [invalid]="invalid"
483
+ [size]="primeSize"
484
+ [inputStyleClass]="size === 'xlarge' ? 'p-inputtext-xlg' : ''"
485
+ [panelStyle]="{ minWidth: 'fit-content' }"
486
+ [appendTo]="inline ? undefined : 'body'"
487
+ [minDate]="minDate"
488
+ [maxDate]="maxDate"
489
+ [view]="view"
490
+ [hideOnDateTimeSelect]="false"
491
+ [showOtherMonths]="showOtherMonths"
492
+ [selectOtherMonths]="selectOtherMonths"
493
+ (onShow)="onPanelShow()"
494
+ (onClose)="onPanelClose()"
495
+ (onMonthChange)="onMonthChangeHandler($event)"
496
+ (onYearChange)="onYearChangeHandler($event)"
497
+ (onSelect)="onDateSelected($event)"
498
+ (onClear)="onClear.emit($event)"
499
+ >
500
+ <ng-template pTemplate="header">
501
+ <div class="p-datepicker-header p-datepicker-custom-header">
502
+ <p-button severity="secondary" [rounded]="true" [text]="true" (onClick)="navPrev($event)">
503
+ <ng-template pTemplate="icon">
504
+ <i class="ti ti-chevron-left" aria-hidden="true"></i>
505
+ </ng-template>
506
+ </p-button>
507
+ <div class="p-datepicker-title">
508
+ <p-select
509
+ appendTo="body"
510
+ [options]="months"
511
+ optionLabel="name"
512
+ optionValue="value"
513
+ [ngModel]="dpCurrentMonth"
514
+ (ngModelChange)="onMonthSelect($event)"
515
+ class="p-datepicker-month-select"
516
+ ></p-select>
517
+ <p-select
518
+ appendTo="body"
519
+ [options]="years"
520
+ optionLabel="name"
521
+ optionValue="value"
522
+ [ngModel]="dpCurrentYear"
523
+ (ngModelChange)="onYearSelect($event)"
524
+ class="p-datepicker-year-select"
525
+ ></p-select>
526
+ </div>
527
+ <p-button severity="secondary" [rounded]="true" [text]="true" (onClick)="navNext($event)">
528
+ <ng-template pTemplate="icon">
529
+ <i class="ti ti-chevron-right" aria-hidden="true"></i>
530
+ </ng-template>
531
+ </p-button>
532
+ </div>
533
+ </ng-template>
534
+
535
+ <ng-template pTemplate="inputicon" let-clickCallBack="clickCallBack">
536
+ <i class="ti ti-calendar-month p-datepicker-input-icon cursor-pointer" (click)="clickCallBack($event)"></i>
537
+ </ng-template>
538
+ <ng-template pTemplate="triggericon">
539
+ <i class="ti ti-calendar-month"></i>
540
+ </ng-template>
541
+ @if (showClear) {
542
+ <ng-template pTemplate="clearicon">
543
+ <i class="ti ti-x"></i>
544
+ </ng-template>
545
+ }
546
+ @if (showTime) {
547
+ <ng-template pTemplate="footer">
548
+ <div class="p-datepicker-time-picker p-datepicker-time-picker-custom" (keydown)="$event.stopPropagation()">
549
+ <div class="p-datepicker-time-field">
550
+ <label class="p-datepicker-time-label">Часы</label>
551
+ <input
552
+ type="text"
553
+ inputmode="numeric"
554
+ maxlength="2"
555
+ pattern="[0-9]{2}"
556
+ pInputText
557
+ class="p-datepicker-time-input"
558
+ [value]="hourInput"
559
+ (input)="onHourFieldInput($event)"
560
+ (blur)="onHourFieldBlur()"
561
+ />
562
+ </div>
563
+ <div class="p-datepicker-separator">
564
+ <span>:</span>
565
+ </div>
566
+ <div class="p-datepicker-time-field">
567
+ <label class="p-datepicker-time-label">Минуты</label>
568
+ <input
569
+ type="text"
570
+ inputmode="numeric"
571
+ maxlength="2"
572
+ pattern="[0-9]{2}"
573
+ pInputText
574
+ class="p-datepicker-time-input"
575
+ [value]="minuteInput"
576
+ (input)="onMinuteFieldInput($event)"
577
+ (blur)="onMinuteFieldBlur()"
578
+ />
579
+ </div>
580
+ </div>
581
+ </ng-template>
582
+ }
583
+ </p-datepicker>
584
+ `
585
+ }]
586
+ }], propDecorators: { dpRef: [{
587
+ type: ViewChild,
588
+ args: ['dpRef']
589
+ }], dateFormat: [{
590
+ type: Input
591
+ }], selectionMode: [{
592
+ type: Input
593
+ }], size: [{
594
+ type: Input
595
+ }], showIcon: [{
596
+ type: Input
597
+ }], iconDisplay: [{
598
+ type: Input
599
+ }], inline: [{
600
+ type: Input
601
+ }], showButtonBar: [{
602
+ type: Input
603
+ }], showTime: [{
604
+ type: Input
605
+ }], hourFormat: [{
606
+ type: Input
607
+ }], showClear: [{
608
+ type: Input
609
+ }], placeholder: [{
610
+ type: Input
611
+ }], readonly: [{
612
+ type: Input
613
+ }], invalid: [{
614
+ type: Input
615
+ }], minDate: [{
616
+ type: Input
617
+ }], maxDate: [{
618
+ type: Input
619
+ }], view: [{
620
+ type: Input
621
+ }], showOtherMonths: [{
622
+ type: Input
623
+ }], selectOtherMonths: [{
624
+ type: Input
625
+ }], onSelect: [{
626
+ type: Output
627
+ }], onMonthChange: [{
628
+ type: Output
629
+ }], onYearChange: [{
630
+ type: Output
631
+ }], onClear: [{
632
+ type: Output
633
+ }] } });
634
+
635
+ /**
636
+ * Generated bundle index. Do not edit.
637
+ */
638
+
639
+ export { ExtraDatePickerComponent };
640
+ //# sourceMappingURL=cdek-it-angular-ui-kit-components-date-picker.mjs.map