@rt-tools/ui-kit-v2 0.23.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/rt-tools-ui-kit-v2-accordion.mjs +142 -71
- package/fesm2022/rt-tools-ui-kit-v2-accordion.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-action-bar.mjs +467 -231
- package/fesm2022/rt-tools-ui-kit-v2-action-bar.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-ai-run-status.mjs +260 -91
- package/fesm2022/rt-tools-ui-kit-v2-ai-run-status.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-aside-section.mjs +80 -46
- package/fesm2022/rt-tools-ui-kit-v2-aside-section.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-aside.mjs +984 -697
- package/fesm2022/rt-tools-ui-kit-v2-aside.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-autocomplete.mjs +452 -210
- package/fesm2022/rt-tools-ui-kit-v2-autocomplete.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-bar-list.mjs +143 -52
- package/fesm2022/rt-tools-ui-kit-v2-bar-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-bottom-sheet.mjs +158 -83
- package/fesm2022/rt-tools-ui-kit-v2-bottom-sheet.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-breadcrumbs.mjs +335 -0
- package/fesm2022/rt-tools-ui-kit-v2-breadcrumbs.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-button.mjs +437 -363
- package/fesm2022/rt-tools-ui-kit-v2-button.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-calendar.mjs +430 -149
- package/fesm2022/rt-tools-ui-kit-v2-calendar.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-card.mjs +155 -71
- package/fesm2022/rt-tools-ui-kit-v2-card.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-carousel.mjs +155 -0
- package/fesm2022/rt-tools-ui-kit-v2-carousel.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-checkbox.mjs +215 -110
- package/fesm2022/rt-tools-ui-kit-v2-checkbox.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-collapsible-text.mjs +158 -75
- package/fesm2022/rt-tools-ui-kit-v2-collapsible-text.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-color-palette.mjs +769 -0
- package/fesm2022/rt-tools-ui-kit-v2-color-palette.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-confirm-popover.mjs +462 -253
- package/fesm2022/rt-tools-ui-kit-v2-confirm-popover.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-container.mjs +1276 -1316
- package/fesm2022/rt-tools-ui-kit-v2-container.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-copy-value.mjs +185 -80
- package/fesm2022/rt-tools-ui-kit-v2-copy-value.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-core.mjs +2321 -2619
- package/fesm2022/rt-tools-ui-kit-v2-core.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-counter-row.mjs +100 -44
- package/fesm2022/rt-tools-ui-kit-v2-counter-row.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-counter.mjs +290 -155
- package/fesm2022/rt-tools-ui-kit-v2-counter.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-data-list.mjs +2097 -858
- package/fesm2022/rt-tools-ui-kit-v2-data-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-data-table.mjs +2247 -1176
- package/fesm2022/rt-tools-ui-kit-v2-data-table.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-date-picker.mjs +1043 -705
- package/fesm2022/rt-tools-ui-kit-v2-date-picker.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-date-range.mjs +810 -525
- package/fesm2022/rt-tools-ui-kit-v2-date-range.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-delta-view.mjs +158 -138
- package/fesm2022/rt-tools-ui-kit-v2-delta-view.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-detail-list.mjs +177 -67
- package/fesm2022/rt-tools-ui-kit-v2-detail-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-dialog.mjs +550 -477
- package/fesm2022/rt-tools-ui-kit-v2-dialog.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-dot-field.mjs +185 -168
- package/fesm2022/rt-tools-ui-kit-v2-dot-field.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-download-link.mjs +116 -43
- package/fesm2022/rt-tools-ui-kit-v2-download-link.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-draggable-tree.mjs +585 -0
- package/fesm2022/rt-tools-ui-kit-v2-draggable-tree.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-dynamic-list.mjs +755 -259
- package/fesm2022/rt-tools-ui-kit-v2-dynamic-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-dynamic-selector.mjs +3266 -1115
- package/fesm2022/rt-tools-ui-kit-v2-dynamic-selector.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-empty-state.mjs +190 -55
- package/fesm2022/rt-tools-ui-kit-v2-empty-state.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-expansion-panel.mjs +283 -103
- package/fesm2022/rt-tools-ui-kit-v2-expansion-panel.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-field.mjs +393 -177
- package/fesm2022/rt-tools-ui-kit-v2-field.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-file-card.mjs +399 -207
- package/fesm2022/rt-tools-ui-kit-v2-file-card.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-file-drop.mjs +288 -212
- package/fesm2022/rt-tools-ui-kit-v2-file-drop.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-file-input.mjs +262 -116
- package/fesm2022/rt-tools-ui-kit-v2-file-input.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-file-list.mjs +57 -31
- package/fesm2022/rt-tools-ui-kit-v2-file-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-filter-control.mjs +258 -90
- package/fesm2022/rt-tools-ui-kit-v2-filter-control.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-form-control.mjs +249 -215
- package/fesm2022/rt-tools-ui-kit-v2-form-control.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-header.mjs +199 -71
- package/fesm2022/rt-tools-ui-kit-v2-header.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree-selector.mjs +231 -0
- package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree-selector.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree.mjs +336 -0
- package/fesm2022/rt-tools-ui-kit-v2-hybrid-tree.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-icon-button.mjs +451 -162
- package/fesm2022/rt-tools-ui-kit-v2-icon-button.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-icon.mjs +931 -686
- package/fesm2022/rt-tools-ui-kit-v2-icon.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-image-cropper.mjs +664 -491
- package/fesm2022/rt-tools-ui-kit-v2-image-cropper.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-image-upload.mjs +574 -222
- package/fesm2022/rt-tools-ui-kit-v2-image-upload.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-info-item.mjs +150 -36
- package/fesm2022/rt-tools-ui-kit-v2-info-item.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-inline-edit.mjs +606 -0
- package/fesm2022/rt-tools-ui-kit-v2-inline-edit.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-input-number.mjs +461 -355
- package/fesm2022/rt-tools-ui-kit-v2-input-number.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-input.mjs +338 -143
- package/fesm2022/rt-tools-ui-kit-v2-input.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-live-badge.mjs +135 -48
- package/fesm2022/rt-tools-ui-kit-v2-live-badge.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-logo.mjs +166 -92
- package/fesm2022/rt-tools-ui-kit-v2-logo.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-markdown-text.mjs +118 -56
- package/fesm2022/rt-tools-ui-kit-v2-markdown-text.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-menu.mjs +1054 -527
- package/fesm2022/rt-tools-ui-kit-v2-menu.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-message.mjs +230 -104
- package/fesm2022/rt-tools-ui-kit-v2-message.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-money-list.mjs +210 -70
- package/fesm2022/rt-tools-ui-kit-v2-money-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-multiselect.mjs +532 -311
- package/fesm2022/rt-tools-ui-kit-v2-multiselect.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-night-grid.mjs +125 -50
- package/fesm2022/rt-tools-ui-kit-v2-night-grid.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-note.mjs +73 -43
- package/fesm2022/rt-tools-ui-kit-v2-note.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-notifications-bell.mjs +161 -53
- package/fesm2022/rt-tools-ui-kit-v2-notifications-bell.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-page-header.mjs +491 -310
- package/fesm2022/rt-tools-ui-kit-v2-page-header.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-pagination.mjs +374 -174
- package/fesm2022/rt-tools-ui-kit-v2-pagination.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-photo-viewer.mjs +202 -159
- package/fesm2022/rt-tools-ui-kit-v2-photo-viewer.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-popover.mjs +438 -309
- package/fesm2022/rt-tools-ui-kit-v2-popover.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-profile-menu.mjs +295 -0
- package/fesm2022/rt-tools-ui-kit-v2-profile-menu.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-prompt-suggestion.mjs +135 -45
- package/fesm2022/rt-tools-ui-kit-v2-prompt-suggestion.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-radio-button.mjs +293 -171
- package/fesm2022/rt-tools-ui-kit-v2-radio-button.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-radius.mjs +62 -55
- package/fesm2022/rt-tools-ui-kit-v2-radius.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs +3379 -1466
- package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-ripple.mjs +114 -116
- package/fesm2022/rt-tools-ui-kit-v2-ripple.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-scroll-area.mjs +406 -299
- package/fesm2022/rt-tools-ui-kit-v2-scroll-area.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-section-nav.mjs +137 -36
- package/fesm2022/rt-tools-ui-kit-v2-section-nav.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-select.mjs +687 -468
- package/fesm2022/rt-tools-ui-kit-v2-select.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-side-menu.mjs +2195 -1569
- package/fesm2022/rt-tools-ui-kit-v2-side-menu.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-skeleton-wrapper.mjs +187 -48
- package/fesm2022/rt-tools-ui-kit-v2-skeleton-wrapper.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-skeleton.mjs +242 -122
- package/fesm2022/rt-tools-ui-kit-v2-skeleton.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-speed-menu.mjs +439 -0
- package/fesm2022/rt-tools-ui-kit-v2-speed-menu.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-spinner.mjs +218 -69
- package/fesm2022/rt-tools-ui-kit-v2-spinner.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-split-button.mjs +292 -91
- package/fesm2022/rt-tools-ui-kit-v2-split-button.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-stat-tile.mjs +225 -138
- package/fesm2022/rt-tools-ui-kit-v2-stat-tile.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-stepper.mjs +150 -116
- package/fesm2022/rt-tools-ui-kit-v2-stepper.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-table.mjs +2462 -1583
- package/fesm2022/rt-tools-ui-kit-v2-table.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-tabs.mjs +647 -346
- package/fesm2022/rt-tools-ui-kit-v2-tabs.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-tag.mjs +335 -121
- package/fesm2022/rt-tools-ui-kit-v2-tag.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-textarea.mjs +217 -84
- package/fesm2022/rt-tools-ui-kit-v2-textarea.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-theme-toggle.mjs +151 -72
- package/fesm2022/rt-tools-ui-kit-v2-theme-toggle.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-thread-list.mjs +697 -226
- package/fesm2022/rt-tools-ui-kit-v2-thread-list.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-timeline.mjs +92 -38
- package/fesm2022/rt-tools-ui-kit-v2-timeline.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-toast.mjs +752 -338
- package/fesm2022/rt-tools-ui-kit-v2-toast.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-toggle-button-group.mjs +310 -129
- package/fesm2022/rt-tools-ui-kit-v2-toggle-button-group.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-toggle-switch.mjs +286 -158
- package/fesm2022/rt-tools-ui-kit-v2-toggle-switch.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-toolbar.mjs +270 -134
- package/fesm2022/rt-tools-ui-kit-v2-toolbar.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-tooltip.mjs +322 -202
- package/fesm2022/rt-tools-ui-kit-v2-tooltip.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-tree-selector.mjs +908 -0
- package/fesm2022/rt-tools-ui-kit-v2-tree-selector.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-tree.mjs +785 -0
- package/fesm2022/rt-tools-ui-kit-v2-tree.mjs.map +1 -0
- package/fesm2022/rt-tools-ui-kit-v2-welcome-dialog.mjs +118 -63
- package/fesm2022/rt-tools-ui-kit-v2-welcome-dialog.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-workspace-details.mjs +783 -262
- package/fesm2022/rt-tools-ui-kit-v2-workspace-details.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2-workspace.mjs +633 -294
- package/fesm2022/rt-tools-ui-kit-v2-workspace.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2.mjs +100 -103
- package/package.json +45 -1
- package/src/assets/icons/collapse-all.svg +9 -0
- package/src/assets/icons/expand-all.svg +9 -0
- package/src/assets/icons-material/collapse-all.fill.svg +5 -0
- package/src/assets/icons-material/collapse-all.svg +5 -0
- package/src/assets/icons-material/expand-all.fill.svg +5 -0
- package/src/assets/icons-material/expand-all.svg +5 -0
- package/src/assets/icons-material/undo.fill.svg +5 -0
- package/src/assets/icons-material/undo.svg +5 -0
- package/src/lib/components/bottom-sheet/CONTEXT.md +20 -2
- package/src/lib/components/bottom-sheet/rt-bottom-sheet.component.scss +36 -1
- package/src/lib/components/breadcrumbs/CONTEXT.md +37 -0
- package/src/lib/components/breadcrumbs/rt-breadcrumbs.component.scss +205 -0
- package/src/lib/components/carousel/CONTEXT.md +42 -0
- package/src/lib/components/carousel/rt-carousel.component.scss +117 -0
- package/src/lib/components/checkbox/CONTEXT.md +3 -0
- package/src/lib/components/checkbox/rt-checkbox.component.scss +9 -3
- package/src/lib/components/color-palette/CONTEXT.md +49 -0
- package/src/lib/components/color-palette/picker/rt-color-picker.component.scss +161 -0
- package/src/lib/components/color-palette/rt-color-palette.component.scss +132 -0
- package/src/lib/components/draggable-tree/CONTEXT.md +54 -0
- package/src/lib/components/draggable-tree/rt-draggable-tree.component.scss +219 -0
- package/src/lib/components/hybrid-tree/CONTEXT.md +31 -0
- package/src/lib/components/hybrid-tree-selector/CONTEXT.md +25 -0
- package/src/lib/components/icon-button/CONTEXT.md +3 -0
- package/src/lib/components/inline-edit/CONTEXT.md +41 -0
- package/src/lib/components/inline-edit/rt-inline-edit.component.scss +274 -0
- package/src/lib/components/popover/CONTEXT.md +3 -0
- package/src/lib/components/profile-menu/CONTEXT.md +32 -0
- package/src/lib/components/profile-menu/rt-profile-menu.component.scss +104 -0
- package/src/lib/components/speed-menu/CONTEXT.md +34 -0
- package/src/lib/components/speed-menu/rt-speed-menu.component.scss +118 -0
- package/src/lib/components/tag/rt-tag.component.scss +12 -0
- package/src/lib/components/thread-list/CONTEXT.md +1 -0
- package/src/lib/components/thread-list/rt-thread-list.component.scss +2 -1
- package/src/lib/components/toolbar/CONTEXT.md +9 -4
- package/src/lib/components/toolbar/rt-toolbar.component.scss +10 -2
- package/src/lib/components/tooltip/CONTEXT.md +8 -1
- package/src/lib/components/tree/CONTEXT.md +66 -0
- package/src/lib/components/tree/rt-tree.component.scss +313 -0
- package/src/lib/components/tree-selector/CONTEXT.md +47 -0
- package/src/lib/components/tree-selector/rt-tree-selector.component.scss +121 -0
- package/src/styles/_primitives.scss +4 -0
- package/src/styles/_semantic.scss +5 -0
- package/styles/tokens.css +43 -0
- package/types/rt-tools-ui-kit-v2-accordion.d.ts +31 -24
- package/types/rt-tools-ui-kit-v2-action-bar.d.ts +112 -91
- package/types/rt-tools-ui-kit-v2-ai-run-status.d.ts +64 -40
- package/types/rt-tools-ui-kit-v2-aside-section.d.ts +13 -10
- package/types/rt-tools-ui-kit-v2-aside.d.ts +268 -206
- package/types/rt-tools-ui-kit-v2-autocomplete.d.ts +102 -61
- package/types/rt-tools-ui-kit-v2-bar-list.d.ts +39 -27
- package/types/rt-tools-ui-kit-v2-bottom-sheet.d.ts +31 -20
- package/types/rt-tools-ui-kit-v2-breadcrumbs.d.ts +89 -0
- package/types/rt-tools-ui-kit-v2-button.d.ts +119 -59
- package/types/rt-tools-ui-kit-v2-calendar.d.ts +151 -86
- package/types/rt-tools-ui-kit-v2-card.d.ts +42 -21
- package/types/rt-tools-ui-kit-v2-carousel.d.ts +76 -0
- package/types/rt-tools-ui-kit-v2-checkbox.d.ts +48 -24
- package/types/rt-tools-ui-kit-v2-collapsible-text.d.ts +28 -20
- package/types/rt-tools-ui-kit-v2-color-palette.d.ts +208 -0
- package/types/rt-tools-ui-kit-v2-confirm-popover.d.ts +104 -47
- package/types/rt-tools-ui-kit-v2-container.d.ts +278 -221
- package/types/rt-tools-ui-kit-v2-copy-value.d.ts +39 -24
- package/types/rt-tools-ui-kit-v2-core.d.ts +862 -865
- package/types/rt-tools-ui-kit-v2-counter-row.d.ts +20 -12
- package/types/rt-tools-ui-kit-v2-counter.d.ts +70 -38
- package/types/rt-tools-ui-kit-v2-data-list.d.ts +429 -264
- package/types/rt-tools-ui-kit-v2-data-table.d.ts +500 -351
- package/types/rt-tools-ui-kit-v2-date-picker.d.ts +164 -138
- package/types/rt-tools-ui-kit-v2-date-range.d.ts +102 -84
- package/types/rt-tools-ui-kit-v2-delta-view.d.ts +16 -13
- package/types/rt-tools-ui-kit-v2-detail-list.d.ts +23 -16
- package/types/rt-tools-ui-kit-v2-dialog.d.ts +130 -101
- package/types/rt-tools-ui-kit-v2-dot-field.d.ts +10 -13
- package/types/rt-tools-ui-kit-v2-download-link.d.ts +22 -17
- package/types/rt-tools-ui-kit-v2-draggable-tree.d.ts +132 -0
- package/types/rt-tools-ui-kit-v2-dynamic-list.d.ts +185 -96
- package/types/rt-tools-ui-kit-v2-dynamic-selector.d.ts +904 -404
- package/types/rt-tools-ui-kit-v2-empty-state.d.ts +48 -19
- package/types/rt-tools-ui-kit-v2-expansion-panel.d.ts +67 -39
- package/types/rt-tools-ui-kit-v2-field.d.ts +90 -49
- package/types/rt-tools-ui-kit-v2-file-card.d.ts +115 -75
- package/types/rt-tools-ui-kit-v2-file-drop.d.ts +75 -48
- package/types/rt-tools-ui-kit-v2-file-input.d.ts +53 -36
- package/types/rt-tools-ui-kit-v2-file-list.d.ts +5 -8
- package/types/rt-tools-ui-kit-v2-filter-control.d.ts +83 -49
- package/types/rt-tools-ui-kit-v2-form-control.d.ts +102 -74
- package/types/rt-tools-ui-kit-v2-header.d.ts +40 -22
- package/types/rt-tools-ui-kit-v2-hybrid-tree-selector.d.ts +14 -0
- package/types/rt-tools-ui-kit-v2-hybrid-tree.d.ts +72 -0
- package/types/rt-tools-ui-kit-v2-icon-button.d.ts +190 -90
- package/types/rt-tools-ui-kit-v2-icon.d.ts +160 -129
- package/types/rt-tools-ui-kit-v2-image-cropper.d.ts +151 -111
- package/types/rt-tools-ui-kit-v2-image-upload.d.ts +159 -85
- package/types/rt-tools-ui-kit-v2-info-item.d.ts +26 -13
- package/types/rt-tools-ui-kit-v2-inline-edit.d.ts +194 -0
- package/types/rt-tools-ui-kit-v2-input-number.d.ts +102 -53
- package/types/rt-tools-ui-kit-v2-input.d.ts +82 -43
- package/types/rt-tools-ui-kit-v2-live-badge.d.ts +30 -17
- package/types/rt-tools-ui-kit-v2-logo.d.ts +49 -32
- package/types/rt-tools-ui-kit-v2-markdown-text.d.ts +26 -17
- package/types/rt-tools-ui-kit-v2-menu.d.ts +272 -155
- package/types/rt-tools-ui-kit-v2-message.d.ts +59 -33
- package/types/rt-tools-ui-kit-v2-money-list.d.ts +36 -18
- package/types/rt-tools-ui-kit-v2-multiselect.d.ts +114 -80
- package/types/rt-tools-ui-kit-v2-night-grid.d.ts +34 -25
- package/types/rt-tools-ui-kit-v2-note.d.ts +12 -9
- package/types/rt-tools-ui-kit-v2-notifications-bell.d.ts +37 -16
- package/types/rt-tools-ui-kit-v2-page-header.d.ts +218 -150
- package/types/rt-tools-ui-kit-v2-pagination.d.ts +99 -63
- package/types/rt-tools-ui-kit-v2-photo-viewer.d.ts +61 -66
- package/types/rt-tools-ui-kit-v2-popover.d.ts +116 -55
- package/types/rt-tools-ui-kit-v2-profile-menu.d.ts +103 -0
- package/types/rt-tools-ui-kit-v2-prompt-suggestion.d.ts +26 -16
- package/types/rt-tools-ui-kit-v2-radio-button.d.ts +85 -43
- package/types/rt-tools-ui-kit-v2-radius.d.ts +18 -15
- package/types/rt-tools-ui-kit-v2-rich-editor.d.ts +931 -590
- package/types/rt-tools-ui-kit-v2-ripple.d.ts +28 -25
- package/types/rt-tools-ui-kit-v2-scroll-area.d.ts +60 -58
- package/types/rt-tools-ui-kit-v2-section-nav.d.ts +32 -22
- package/types/rt-tools-ui-kit-v2-select.d.ts +182 -139
- package/types/rt-tools-ui-kit-v2-side-menu.d.ts +452 -349
- package/types/rt-tools-ui-kit-v2-skeleton-wrapper.d.ts +53 -20
- package/types/rt-tools-ui-kit-v2-skeleton.d.ts +55 -26
- package/types/rt-tools-ui-kit-v2-speed-menu.d.ts +131 -0
- package/types/rt-tools-ui-kit-v2-spinner.d.ts +56 -28
- package/types/rt-tools-ui-kit-v2-split-button.d.ts +96 -55
- package/types/rt-tools-ui-kit-v2-stat-tile.d.ts +88 -60
- package/types/rt-tools-ui-kit-v2-stepper.d.ts +50 -37
- package/types/rt-tools-ui-kit-v2-table.d.ts +631 -480
- package/types/rt-tools-ui-kit-v2-tabs.d.ts +198 -113
- package/types/rt-tools-ui-kit-v2-tag.d.ts +106 -53
- package/types/rt-tools-ui-kit-v2-textarea.d.ts +48 -25
- package/types/rt-tools-ui-kit-v2-theme-toggle.d.ts +28 -26
- package/types/rt-tools-ui-kit-v2-thread-list.d.ts +154 -94
- package/types/rt-tools-ui-kit-v2-timeline.d.ts +30 -28
- package/types/rt-tools-ui-kit-v2-toast.d.ts +174 -98
- package/types/rt-tools-ui-kit-v2-toggle-button-group.d.ts +132 -86
- package/types/rt-tools-ui-kit-v2-toggle-switch.d.ts +88 -50
- package/types/rt-tools-ui-kit-v2-toolbar.d.ts +30 -27
- package/types/rt-tools-ui-kit-v2-tooltip.d.ts +65 -41
- package/types/rt-tools-ui-kit-v2-tree-selector.d.ts +257 -0
- package/types/rt-tools-ui-kit-v2-tree.d.ts +282 -0
- package/types/rt-tools-ui-kit-v2-welcome-dialog.d.ts +21 -24
- package/types/rt-tools-ui-kit-v2-workspace-details.d.ts +195 -124
- package/types/rt-tools-ui-kit-v2-workspace.d.ts +122 -79
- package/types/rt-tools-ui-kit-v2.d.ts +100 -90
- package/fesm2022/rt-tools-ui-kit-v2.mjs.map +0 -1
|
@@ -1,779 +1,1117 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { BlockDirective, ElemDirective, ModDirective } from
|
|
4
|
-
import {
|
|
5
|
-
import { RtBottomSheetComponent } from
|
|
6
|
-
import { RtFormControlBase } from
|
|
7
|
-
import { RtIconButtonComponent } from
|
|
8
|
-
import { RtPopoverDirective } from
|
|
9
|
-
import * as i1 from
|
|
10
|
-
import { RtRadiusDirective } from
|
|
11
|
-
import { RtButtonDirective } from
|
|
12
|
-
import { ERtCalendarDayState, RtCalendarComponent } from
|
|
13
|
-
import { RtToggleButtonGroupComponent } from
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Чистая логика панели rt-date-picker: чтение и запись значения, месяц, границы, колонки времени
|
|
17
|
-
* и клавиши сетки. Текущий момент приходит параметром — компонент читает часы на своей границе.
|
|
18
|
-
*
|
|
19
|
-
* Значения — строки формы нативного input'а: `YYYY-MM-DD`, `HH:mm`, `YYYY-MM-DDTHH:mm`. Строки
|
|
20
|
-
* одной формы сравниваются как текст, поэтому границы сравниваются обрезанными до длины значения.
|
|
21
|
-
*/
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, afterRenderEffect, booleanAttribute, computed, forwardRef, inject, input, linkedSignal, numberAttribute, output, signal, viewChild, viewChildren } from "@angular/core";
|
|
3
|
+
import { BlockDirective, ElemDirective, ModDirective } from "@rt-tools/core";
|
|
4
|
+
import { BreakpointsService, RT_KIT_LABELS, RT_KIT_LOCALE } from "@rt-tools/ui-kit-v2/core";
|
|
5
|
+
import { RtBottomSheetComponent } from "@rt-tools/ui-kit-v2/bottom-sheet";
|
|
6
|
+
import { RtFormControlBase } from "@rt-tools/ui-kit-v2/form-control";
|
|
7
|
+
import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
|
|
8
|
+
import { RtPopoverDirective } from "@rt-tools/ui-kit-v2/popover";
|
|
9
|
+
import * as i1 from "@rt-tools/ui-kit-v2/radius";
|
|
10
|
+
import { RtRadiusDirective } from "@rt-tools/ui-kit-v2/radius";
|
|
11
|
+
import { RtButtonDirective } from "@rt-tools/ui-kit-v2/button";
|
|
12
|
+
import { ERtCalendarDayState, RtCalendarComponent } from "@rt-tools/ui-kit-v2/calendar";
|
|
13
|
+
import { RtToggleButtonGroupComponent } from "@rt-tools/ui-kit-v2/toggle-button-group";
|
|
22
14
|
const DAY_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
23
15
|
const TIME_RE = /^(\d{2}):(\d{2})$/;
|
|
24
|
-
const DAY_LENGTH_MS =
|
|
16
|
+
const DAY_LENGTH_MS = 864e5;
|
|
25
17
|
const WEEK = 7;
|
|
26
18
|
const DAY_LEN = 10;
|
|
27
19
|
const MONTH_LEN$1 = 7;
|
|
28
20
|
const TIME_LEN = 5;
|
|
29
|
-
/** Числа строки даты или времени: `2026-09-29` → `[2026, 9, 29]`. */
|
|
30
21
|
function nums(text) {
|
|
31
|
-
|
|
22
|
+
return text.split(/\D/).map(Number);
|
|
32
23
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Строка формы значения как число: `2026-09-29T10:05` → `202609291005`. Строки одной формы
|
|
35
|
-
* сравниваются по этому числу так же, как по порядку дат.
|
|
36
|
-
*/
|
|
37
24
|
function rank(text) {
|
|
38
|
-
|
|
25
|
+
return Number(text.replace(/\D/g, ""));
|
|
39
26
|
}
|
|
40
27
|
function pad(value) {
|
|
41
|
-
|
|
28
|
+
return String(value).padStart(2, "0");
|
|
42
29
|
}
|
|
43
30
|
function dayToMs(day) {
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
const [y, m, d] = nums(day);
|
|
32
|
+
return Date.UTC(y, m - 1, d);
|
|
46
33
|
}
|
|
47
34
|
function msToDay(ms) {
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
const date = new Date(ms);
|
|
36
|
+
return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
|
|
50
37
|
}
|
|
51
38
|
function daysInMonth(year, month) {
|
|
52
|
-
|
|
39
|
+
return new Date(Date.UTC(year, month, 0)).getUTCDate();
|
|
53
40
|
}
|
|
54
41
|
function isDay(text) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const day = Number(match[3]);
|
|
61
|
-
return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth(Number(match[1]), month);
|
|
42
|
+
const match = DAY_RE.exec(text);
|
|
43
|
+
if (match === null) return false;
|
|
44
|
+
const month = Number(match[2]);
|
|
45
|
+
const day = Number(match[3]);
|
|
46
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= daysInMonth(Number(match[1]), month);
|
|
62
47
|
}
|
|
63
48
|
function isTime(text) {
|
|
64
|
-
|
|
65
|
-
|
|
49
|
+
const match = TIME_RE.exec(text);
|
|
50
|
+
return match !== null && Number(match[1]) < 24 && Number(match[2]) < 60;
|
|
66
51
|
}
|
|
67
|
-
/** Время `HH:mm` из часа и минуты. */
|
|
68
52
|
function rtDateTime(hour, minute) {
|
|
69
|
-
|
|
53
|
+
return `${pad(hour)}:${pad(minute)}`;
|
|
70
54
|
}
|
|
71
|
-
/** Первый день недели локали: 1 — понедельник … 7 — воскресенье. */
|
|
72
55
|
function rtDateFirstDay(locale) {
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
const info = new Intl.Locale(locale);
|
|
57
|
+
return (info.getWeekInfo?.() ?? info.weekInfo)?.firstDay ?? 1;
|
|
75
58
|
}
|
|
76
|
-
/** Читает текст формы значения; `null` — текст не значение этого типа. */
|
|
77
59
|
function rtDateRead(text, type) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
const parts = value.split('T');
|
|
86
|
-
return parts.length === 2 && isDay(parts[0]) && isTime(parts[1]) ? value : null;
|
|
87
|
-
}
|
|
88
|
-
/** Собирает значение типа из дня и времени; без нужной части — пустая строка. */
|
|
60
|
+
const value = text.trim();
|
|
61
|
+
if (type === "date") return isDay(value) ? value : null;
|
|
62
|
+
if (type === "time") return isTime(value) ? value : null;
|
|
63
|
+
const parts = value.split("T");
|
|
64
|
+
return parts.length === 2 && isDay(parts[0]) && isTime(parts[1]) ? value : null;
|
|
65
|
+
}
|
|
89
66
|
function rtDateWrite(type, day, time) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return time ?? '';
|
|
95
|
-
}
|
|
96
|
-
return day !== null && time !== null ? `${day}T${time}` : '';
|
|
97
|
-
}
|
|
98
|
-
/** Разбирает значение на день и время; недостающая часть — `null`. */
|
|
67
|
+
if (type === "date") return day ?? "";
|
|
68
|
+
if (type === "time") return time ?? "";
|
|
69
|
+
return day !== null && time !== null ? `${day}T${time}` : "";
|
|
70
|
+
}
|
|
99
71
|
function rtDateSplit(value, type) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
72
|
+
if (value === "") return {
|
|
73
|
+
day: null,
|
|
74
|
+
time: null
|
|
75
|
+
};
|
|
76
|
+
if (type === "time") return {
|
|
77
|
+
day: null,
|
|
78
|
+
time: value
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
day: value.slice(0, DAY_LEN),
|
|
82
|
+
time: type === "date" ? null : value.slice(11)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
109
85
|
function rtDateInBounds(value, min, max) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
86
|
+
const low = min === null ? null : min.slice(0, value.length);
|
|
87
|
+
const high = max === null ? null : max.slice(0, value.length);
|
|
88
|
+
return (low === null || rank(value) >= rank(low)) && (high === null || rank(value) <= rank(high));
|
|
113
89
|
}
|
|
114
|
-
/** Текущий момент: день и время, округлённое вниз до шага минут. */
|
|
115
90
|
function rtDateNow(now, step) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
91
|
+
const minute = Math.floor(now.getMinutes() / step) * step;
|
|
92
|
+
return {
|
|
93
|
+
day: `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`,
|
|
94
|
+
time: `${pad(now.getHours())}:${pad(minute)}`
|
|
95
|
+
};
|
|
121
96
|
}
|
|
122
|
-
/** Сдвигает месяц `YYYY-MM` на `delta` месяцев. */
|
|
123
97
|
function rtDateAddMonths(month, delta) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
const [y, m] = nums(month);
|
|
99
|
+
const date = new Date(Date.UTC(y, m - 1 + delta, 1));
|
|
100
|
+
return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}`;
|
|
127
101
|
}
|
|
128
|
-
/** Можно ли листать от месяца на `delta`: соседний месяц не лежит за границей. */
|
|
129
102
|
function rtDateCanPage(month, delta, min, max) {
|
|
130
|
-
|
|
103
|
+
return rtDateInBounds(rtDateAddMonths(month, delta), min, max);
|
|
131
104
|
}
|
|
132
105
|
function monthTitle(month, locale) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
106
|
+
const [y, m] = nums(month);
|
|
107
|
+
const name = new Intl.DateTimeFormat(locale, {
|
|
108
|
+
month: "long",
|
|
109
|
+
timeZone: "UTC"
|
|
110
|
+
}).format(Date.UTC(y, m - 1, 1));
|
|
111
|
+
return `${name.charAt(0).toLocaleUpperCase(locale)}${name.slice(1)} ${y}`;
|
|
136
112
|
}
|
|
137
113
|
function dayCell(day, ctx) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
/** Месяц `YYYY-MM` для календаря: подпись по локали, пустые ячейки до первого дня, дни. */
|
|
114
|
+
return {
|
|
115
|
+
key: day,
|
|
116
|
+
dayOfMonth: Number(day.slice(8)),
|
|
117
|
+
sublabel: "",
|
|
118
|
+
state: day === ctx.chosen ? ERtCalendarDayState.Chosen : ERtCalendarDayState.Free,
|
|
119
|
+
disabled: !rtDateInBounds(day, ctx.min, ctx.max),
|
|
120
|
+
today: day === ctx.today
|
|
121
|
+
};
|
|
122
|
+
}
|
|
148
123
|
function rtDateMonth(month, ctx) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
124
|
+
const [y, m] = nums(month);
|
|
125
|
+
const first = Date.UTC(y, m - 1, 1);
|
|
126
|
+
const blanks = ((new Date(first).getUTCDay() || WEEK) - rtDateFirstDay(ctx.locale) + WEEK) % WEEK;
|
|
127
|
+
const days = Array.from({ length: daysInMonth(y, m) }, (_, i) => dayCell(msToDay(first + i * DAY_LENGTH_MS), ctx));
|
|
128
|
+
const leadingBlanks = Array.from({ length: blanks }, (_, i) => i);
|
|
129
|
+
return {
|
|
130
|
+
key: month,
|
|
131
|
+
label: monthTitle(month, ctx.locale),
|
|
132
|
+
leadingBlanks,
|
|
133
|
+
days
|
|
134
|
+
};
|
|
135
|
+
}
|
|
158
136
|
function rtDateWeekdays(locale) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
137
|
+
const format = new Intl.DateTimeFormat(locale, {
|
|
138
|
+
weekday: "short",
|
|
139
|
+
timeZone: "UTC"
|
|
140
|
+
});
|
|
141
|
+
const monday = Date.UTC(2024, 0, 1);
|
|
142
|
+
const shift = rtDateFirstDay(locale) - 1;
|
|
143
|
+
return Array.from({ length: WEEK }, (_, i) => format.format(monday + (i + shift) % WEEK * DAY_LENGTH_MS));
|
|
164
144
|
}
|
|
165
|
-
/** Двенадцать месяцев года для выбора месяца; месяц за границей выключен. */
|
|
166
145
|
function rtDateMonths(year, locale, min, max) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
146
|
+
const format = new Intl.DateTimeFormat(locale, {
|
|
147
|
+
month: "short",
|
|
148
|
+
timeZone: "UTC"
|
|
149
|
+
});
|
|
150
|
+
return Array.from({ length: 12 }, (_, i) => {
|
|
151
|
+
const key = `${year}-${pad(i + 1)}`;
|
|
152
|
+
return {
|
|
153
|
+
key,
|
|
154
|
+
label: format.format(Date.UTC(year, i, 1)),
|
|
155
|
+
disabled: !rtDateInBounds(key, min, max)
|
|
156
|
+
};
|
|
157
|
+
});
|
|
172
158
|
}
|
|
173
|
-
/** Граница времени для дня: у даты со временем действует только в день самой границы. */
|
|
174
159
|
function timeBound(bound, day) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
return day === bound.slice(0, DAY_LEN) ? bound.slice(DAY_LEN + 1) : null;
|
|
160
|
+
if (bound === null || bound.length <= TIME_LEN) return bound;
|
|
161
|
+
return day === bound.slice(0, DAY_LEN) ? bound.slice(11) : null;
|
|
179
162
|
}
|
|
180
|
-
/** Колонки часов и минут: минуты идут с шагом, время за границей выключено. */
|
|
181
163
|
function rtDateTimeColumns(ctx) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
164
|
+
const low = timeBound(ctx.min, ctx.day);
|
|
165
|
+
const high = timeBound(ctx.max, ctx.day);
|
|
166
|
+
const hours = Array.from({ length: 24 }, (_, h) => ({
|
|
167
|
+
value: h,
|
|
168
|
+
label: pad(h),
|
|
169
|
+
disabled: low !== null && rank(`${pad(h)}:59`) < rank(low) || high !== null && rank(`${pad(h)}:00`) > rank(high)
|
|
170
|
+
}));
|
|
171
|
+
const step = Math.max(1, Math.floor(ctx.step));
|
|
172
|
+
return {
|
|
173
|
+
hours,
|
|
174
|
+
minutes: Array.from({ length: Math.ceil(60 / step) }, (_, i) => {
|
|
175
|
+
const minute = i * step;
|
|
176
|
+
const time = `${pad(ctx.hour ?? 0)}:${pad(minute)}`;
|
|
177
|
+
return {
|
|
178
|
+
value: minute,
|
|
179
|
+
label: pad(minute),
|
|
180
|
+
disabled: ctx.hour !== null && !rtDateInBounds(time, low, high)
|
|
181
|
+
};
|
|
182
|
+
})
|
|
183
|
+
};
|
|
196
184
|
}
|
|
197
185
|
function shiftMonth(day, delta) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
186
|
+
const target = rtDateAddMonths(day.slice(0, MONTH_LEN$1), delta);
|
|
187
|
+
const [y, m] = nums(target);
|
|
188
|
+
return `${target}-${pad(Math.min(Number(day.slice(8)), daysInMonth(y, m)))}`;
|
|
189
|
+
}
|
|
190
|
+
const DAY_KEYS = {
|
|
191
|
+
ArrowLeft: -1,
|
|
192
|
+
ArrowRight: 1,
|
|
193
|
+
ArrowUp: -7,
|
|
194
|
+
ArrowDown: WEEK
|
|
195
|
+
};
|
|
196
|
+
const MONTH_KEYS = {
|
|
197
|
+
PageUp: -1,
|
|
198
|
+
PageDown: 1
|
|
199
|
+
};
|
|
206
200
|
function keyTarget(key, day, firstDay) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const offset = ((new Date(ms).getUTCDay() || WEEK) - firstDay + WEEK) % WEEK;
|
|
215
|
-
if (key === 'Home') {
|
|
216
|
-
return msToDay(ms - offset * DAY_LENGTH_MS);
|
|
217
|
-
}
|
|
218
|
-
return key === 'End' ? msToDay(ms + (WEEK - 1 - offset) * DAY_LENGTH_MS) : null;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Куда клавиша переводит фокус с дня; `null` — клавиша не сеточная. День за границей не
|
|
222
|
-
* достаётся: фокус встаёт на ближний день в границах.
|
|
223
|
-
*/
|
|
201
|
+
const ms = dayToMs(day);
|
|
202
|
+
if (key in DAY_KEYS) return msToDay(ms + DAY_KEYS[key] * DAY_LENGTH_MS);
|
|
203
|
+
if (key in MONTH_KEYS) return shiftMonth(day, MONTH_KEYS[key]);
|
|
204
|
+
const offset = ((new Date(ms).getUTCDay() || WEEK) - firstDay + WEEK) % WEEK;
|
|
205
|
+
if (key === "Home") return msToDay(ms - offset * DAY_LENGTH_MS);
|
|
206
|
+
return key === "End" ? msToDay(ms + (6 - offset) * DAY_LENGTH_MS) : null;
|
|
207
|
+
}
|
|
224
208
|
function rtDateGridKey(key, day, firstDay, min, max) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (low !== null && rank(target) < rank(low)) {
|
|
232
|
-
return low;
|
|
233
|
-
}
|
|
234
|
-
return high !== null && rank(target) > rank(high) ? high : target;
|
|
209
|
+
const target = keyTarget(key, day, firstDay);
|
|
210
|
+
if (target === null) return null;
|
|
211
|
+
const low = min === null ? null : min.slice(0, DAY_LEN);
|
|
212
|
+
const high = max === null ? null : max.slice(0, DAY_LEN);
|
|
213
|
+
if (low !== null && rank(target) < rank(low)) return low;
|
|
214
|
+
return high !== null && rank(target) > rank(high) ? high : target;
|
|
235
215
|
}
|
|
236
|
-
|
|
237
|
-
const BEM_BLOCK$1 = 'rt-date-panel';
|
|
216
|
+
const BEM_BLOCK$1 = "rt-date-panel";
|
|
238
217
|
const MONTH_LEN = 7;
|
|
239
218
|
const YEAR_LEN$1 = 4;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtDatePanelComponent, isStandalone: true, selector: "rt-date-panel", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, sheet: { classPropertyName: "sheet", publicName: "sheet", isSignal: true, isRequired: false, transformFunction: null }, now: { classPropertyName: "now", publicName: "now", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { picked: "picked", closed: "closed" }, host: { listeners: { "keydown.escape": "closed.emit()" }, properties: { "class.rt-date-panel--sheet": "sheet()", "class.rt-date-panel--with-time": "type() !== 'date'" }, classAttribute: "rt-date-panel" }, viewQueries: [{ propertyName: "timeCells", predicate: ["timeCell"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"], dependencies: [{ kind: "directive", type:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
219
|
+
var RtDatePanelComponent = class RtDatePanelComponent {
|
|
220
|
+
#locale;
|
|
221
|
+
#openedAt;
|
|
222
|
+
#firstDay;
|
|
223
|
+
constructor() {
|
|
224
|
+
this.#locale = inject(RT_KIT_LOCALE);
|
|
225
|
+
this.#openedAt = /* @__PURE__ */ new Date();
|
|
226
|
+
this.#firstDay = computed(() => rtDateFirstDay(this.#locale()), ...ngDevMode ? [{ debugName: "#firstDay" }] : /* istanbul ignore next */ []);
|
|
227
|
+
this.t = inject(RT_KIT_LABELS);
|
|
228
|
+
this.weekdays = computed(() => rtDateWeekdays(this.#locale()), ...ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []);
|
|
229
|
+
this.timeCells = viewChildren("timeCell", ...ngDevMode ? [{ debugName: "timeCells" }] : /* istanbul ignore next */ []);
|
|
230
|
+
this.view = signal("days", ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
231
|
+
this.tab = signal("date", ...ngDevMode ? [{ debugName: "tab" }] : /* istanbul ignore next */ []);
|
|
232
|
+
this.activeKey = signal(null, ...ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []);
|
|
233
|
+
this.today = computed(() => rtDateNow(this.now() ?? this.#openedAt, 1).day, ...ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []);
|
|
234
|
+
this.draftDay = linkedSignal(() => rtDateSplit(this.value(), this.type()).day, ...ngDevMode ? [{ debugName: "draftDay" }] : /* istanbul ignore next */ []);
|
|
235
|
+
this.draftTime = linkedSignal(() => rtDateSplit(this.value(), this.type()).time, ...ngDevMode ? [{ debugName: "draftTime" }] : /* istanbul ignore next */ []);
|
|
236
|
+
this.shownMonth = linkedSignal(() => (this.draftDay() ?? this.today()).slice(0, MONTH_LEN), ...ngDevMode ? [{ debugName: "shownMonth" }] : /* istanbul ignore next */ []);
|
|
237
|
+
this.year = linkedSignal(() => Number(this.shownMonth().slice(0, YEAR_LEN$1)), ...ngDevMode ? [{ debugName: "year" }] : /* istanbul ignore next */ []);
|
|
238
|
+
this.split = computed(() => this.sheet() && this.type() === "datetime-local", ...ngDevMode ? [{ debugName: "split" }] : /* istanbul ignore next */ []);
|
|
239
|
+
this.showDate = computed(() => this.type() !== "time" && !(this.split() && this.tab() === "time"), ...ngDevMode ? [{ debugName: "showDate" }] : /* istanbul ignore next */ []);
|
|
240
|
+
this.showTime = computed(() => this.type() !== "date" && !(this.split() && this.tab() === "date"), ...ngDevMode ? [{ debugName: "showTime" }] : /* istanbul ignore next */ []);
|
|
241
|
+
this.months = computed(() => [rtDateMonth(this.shownMonth(), {
|
|
242
|
+
locale: this.#locale(),
|
|
243
|
+
today: this.today(),
|
|
244
|
+
chosen: this.draftDay(),
|
|
245
|
+
min: this.min(),
|
|
246
|
+
max: this.max()
|
|
247
|
+
})], ...ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []);
|
|
248
|
+
this.canPrev = computed(() => rtDateCanPage(this.shownMonth(), -1, this.min(), this.max()), ...ngDevMode ? [{ debugName: "canPrev" }] : /* istanbul ignore next */ []);
|
|
249
|
+
this.canNext = computed(() => rtDateCanPage(this.shownMonth(), 1, this.min(), this.max()), ...ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []);
|
|
250
|
+
this.monthCells = computed(() => rtDateMonths(this.year(), this.#locale(), this.min(), this.max()), ...ngDevMode ? [{ debugName: "monthCells" }] : /* istanbul ignore next */ []);
|
|
251
|
+
this.canPrevYear = computed(() => rtDateInBounds(String(this.year() - 1), this.min(), this.max()), ...ngDevMode ? [{ debugName: "canPrevYear" }] : /* istanbul ignore next */ []);
|
|
252
|
+
this.canNextYear = computed(() => rtDateInBounds(String(this.year() + 1), this.min(), this.max()), ...ngDevMode ? [{ debugName: "canNextYear" }] : /* istanbul ignore next */ []);
|
|
253
|
+
this.draftHour = computed(() => this.#part(0), ...ngDevMode ? [{ debugName: "draftHour" }] : /* istanbul ignore next */ []);
|
|
254
|
+
this.draftMinute = computed(() => this.#part(1), ...ngDevMode ? [{ debugName: "draftMinute" }] : /* istanbul ignore next */ []);
|
|
255
|
+
this.columns = computed(() => rtDateTimeColumns({
|
|
256
|
+
step: this.minuteStep(),
|
|
257
|
+
hour: this.draftHour(),
|
|
258
|
+
day: this.draftDay(),
|
|
259
|
+
min: this.min(),
|
|
260
|
+
max: this.max()
|
|
261
|
+
}), ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
262
|
+
this.todayOff = computed(() => !rtDateInBounds(this.today(), this.min(), this.max()), ...ngDevMode ? [{ debugName: "todayOff" }] : /* istanbul ignore next */ []);
|
|
263
|
+
this.canApply = computed(() => this.#draftValue() !== "", ...ngDevMode ? [{ debugName: "canApply" }] : /* istanbul ignore next */ []);
|
|
264
|
+
this.tabs = computed(() => [{
|
|
265
|
+
value: "date",
|
|
266
|
+
label: this.t().uiDate
|
|
267
|
+
}, {
|
|
268
|
+
value: "time",
|
|
269
|
+
label: this.t().uiTime
|
|
270
|
+
}], ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
271
|
+
this.type = input.required(...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
272
|
+
this.value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
273
|
+
this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
274
|
+
this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
275
|
+
this.minuteStep = input(5, {
|
|
276
|
+
...ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {},
|
|
277
|
+
transform: numberAttribute
|
|
278
|
+
});
|
|
279
|
+
this.sheet = input(false, {
|
|
280
|
+
...ngDevMode ? { debugName: "sheet" } : /* istanbul ignore next */ {},
|
|
281
|
+
transform: booleanAttribute
|
|
282
|
+
});
|
|
283
|
+
this.now = input(null, ...ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []);
|
|
284
|
+
this.picked = output();
|
|
285
|
+
this.closed = output();
|
|
286
|
+
afterRenderEffect(() => {
|
|
287
|
+
for (const cell of this.timeCells()) {
|
|
288
|
+
const node = cell.nativeElement;
|
|
289
|
+
const column = node.parentElement;
|
|
290
|
+
if (column !== null && node.getAttribute("aria-pressed") === "true") column.scrollTop = node.offsetTop - (column.clientHeight - node.offsetHeight) / 2;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
pickDay(day) {
|
|
295
|
+
this.activeKey.set(day.key);
|
|
296
|
+
if (this.type() === "date") {
|
|
297
|
+
this.#emit(day.key);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
this.draftDay.set(day.key);
|
|
301
|
+
}
|
|
302
|
+
pickToday() {
|
|
303
|
+
if (!this.todayOff()) this.#emit(this.today());
|
|
304
|
+
}
|
|
305
|
+
pickNow() {
|
|
306
|
+
const now = rtDateNow(this.now() ?? /* @__PURE__ */ new Date(), this.minuteStep());
|
|
307
|
+
this.draftTime.set(now.time);
|
|
308
|
+
if (this.type() === "datetime-local") this.draftDay.set(now.day);
|
|
309
|
+
}
|
|
310
|
+
pickHour(hour) {
|
|
311
|
+
this.draftTime.set(rtDateTime(hour, this.draftMinute() ?? 0));
|
|
312
|
+
}
|
|
313
|
+
pickMinute(minute) {
|
|
314
|
+
this.draftTime.set(rtDateTime(this.draftHour() ?? 0, minute));
|
|
315
|
+
}
|
|
316
|
+
onGridKey(event) {
|
|
317
|
+
const next = rtDateGridKey(event.key, event.day.key, this.#firstDay(), this.min(), this.max());
|
|
318
|
+
if (next !== null) {
|
|
319
|
+
this.shownMonth.set(next.slice(0, MONTH_LEN));
|
|
320
|
+
this.activeKey.set(next);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
page(delta) {
|
|
324
|
+
this.shownMonth.set(rtDateAddMonths(this.shownMonth(), delta));
|
|
325
|
+
}
|
|
326
|
+
openMonths() {
|
|
327
|
+
this.year.set(Number(this.shownMonth().slice(0, YEAR_LEN$1)));
|
|
328
|
+
this.view.set("months");
|
|
329
|
+
}
|
|
330
|
+
pageYear(delta) {
|
|
331
|
+
this.year.update((year) => year + delta);
|
|
332
|
+
}
|
|
333
|
+
pickMonth(cell) {
|
|
334
|
+
this.shownMonth.set(cell.key);
|
|
335
|
+
this.view.set("days");
|
|
336
|
+
}
|
|
337
|
+
apply() {
|
|
338
|
+
const value = this.#draftValue();
|
|
339
|
+
if (value !== "") this.#emit(value);
|
|
340
|
+
}
|
|
341
|
+
#emit(value) {
|
|
342
|
+
this.picked.emit(value);
|
|
343
|
+
this.closed.emit();
|
|
344
|
+
}
|
|
345
|
+
#draftValue() {
|
|
346
|
+
const value = rtDateWrite(this.type(), this.draftDay(), this.draftTime());
|
|
347
|
+
return value !== "" && rtDateInBounds(value, this.min(), this.max()) ? value : "";
|
|
348
|
+
}
|
|
349
|
+
#part(index) {
|
|
350
|
+
const time = this.draftTime();
|
|
351
|
+
return time === null ? null : Number(time.split(":")[index]);
|
|
352
|
+
}
|
|
353
|
+
static {
|
|
354
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
355
|
+
minVersion: "12.0.0",
|
|
356
|
+
version: "22.2.2",
|
|
357
|
+
ngImport: i0,
|
|
358
|
+
type: RtDatePanelComponent,
|
|
359
|
+
deps: [],
|
|
360
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
static {
|
|
364
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
365
|
+
minVersion: "17.0.0",
|
|
366
|
+
version: "22.2.2",
|
|
367
|
+
type: RtDatePanelComponent,
|
|
368
|
+
isStandalone: true,
|
|
369
|
+
selector: "rt-date-panel",
|
|
370
|
+
inputs: {
|
|
371
|
+
type: {
|
|
372
|
+
classPropertyName: "type",
|
|
373
|
+
publicName: "type",
|
|
374
|
+
isSignal: true,
|
|
375
|
+
isRequired: true,
|
|
376
|
+
transformFunction: null
|
|
377
|
+
},
|
|
378
|
+
value: {
|
|
379
|
+
classPropertyName: "value",
|
|
380
|
+
publicName: "value",
|
|
381
|
+
isSignal: true,
|
|
382
|
+
isRequired: false,
|
|
383
|
+
transformFunction: null
|
|
384
|
+
},
|
|
385
|
+
min: {
|
|
386
|
+
classPropertyName: "min",
|
|
387
|
+
publicName: "min",
|
|
388
|
+
isSignal: true,
|
|
389
|
+
isRequired: false,
|
|
390
|
+
transformFunction: null
|
|
391
|
+
},
|
|
392
|
+
max: {
|
|
393
|
+
classPropertyName: "max",
|
|
394
|
+
publicName: "max",
|
|
395
|
+
isSignal: true,
|
|
396
|
+
isRequired: false,
|
|
397
|
+
transformFunction: null
|
|
398
|
+
},
|
|
399
|
+
minuteStep: {
|
|
400
|
+
classPropertyName: "minuteStep",
|
|
401
|
+
publicName: "minuteStep",
|
|
402
|
+
isSignal: true,
|
|
403
|
+
isRequired: false,
|
|
404
|
+
transformFunction: null
|
|
405
|
+
},
|
|
406
|
+
sheet: {
|
|
407
|
+
classPropertyName: "sheet",
|
|
408
|
+
publicName: "sheet",
|
|
409
|
+
isSignal: true,
|
|
410
|
+
isRequired: false,
|
|
411
|
+
transformFunction: null
|
|
412
|
+
},
|
|
413
|
+
now: {
|
|
414
|
+
classPropertyName: "now",
|
|
415
|
+
publicName: "now",
|
|
416
|
+
isSignal: true,
|
|
417
|
+
isRequired: false,
|
|
418
|
+
transformFunction: null
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
outputs: {
|
|
422
|
+
picked: "picked",
|
|
423
|
+
closed: "closed"
|
|
424
|
+
},
|
|
425
|
+
host: {
|
|
426
|
+
listeners: { "keydown.escape": "closed.emit()" },
|
|
427
|
+
properties: {
|
|
428
|
+
"class.rt-date-panel--sheet": "sheet()",
|
|
429
|
+
"class.rt-date-panel--with-time": "type() !== 'date'"
|
|
430
|
+
},
|
|
431
|
+
classAttribute: "rt-date-panel"
|
|
432
|
+
},
|
|
433
|
+
viewQueries: [{
|
|
434
|
+
propertyName: "timeCells",
|
|
435
|
+
predicate: ["timeCell"],
|
|
436
|
+
descendants: true,
|
|
437
|
+
isSignal: true
|
|
438
|
+
}],
|
|
439
|
+
ngImport: i0,
|
|
440
|
+
template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n",
|
|
441
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"],
|
|
442
|
+
dependencies: [
|
|
443
|
+
{
|
|
444
|
+
kind: "directive",
|
|
445
|
+
type: BlockDirective,
|
|
446
|
+
selector: "[rtBlock]",
|
|
447
|
+
inputs: ["rtMod"]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
kind: "directive",
|
|
451
|
+
type: ElemDirective,
|
|
452
|
+
selector: "[rtElem]",
|
|
453
|
+
inputs: ["rtMod"]
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
kind: "directive",
|
|
457
|
+
type: RtButtonDirective,
|
|
458
|
+
selector: "button[rtButton], a[rtButton]",
|
|
459
|
+
inputs: [
|
|
460
|
+
"label",
|
|
461
|
+
"icon",
|
|
462
|
+
"iconPos",
|
|
463
|
+
"theme",
|
|
464
|
+
"appearance",
|
|
465
|
+
"size",
|
|
466
|
+
"loading",
|
|
467
|
+
"loadingIcon",
|
|
468
|
+
"loadingLabel",
|
|
469
|
+
"pressed"
|
|
470
|
+
]
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
kind: "component",
|
|
474
|
+
type: RtCalendarComponent,
|
|
475
|
+
selector: "rt-calendar",
|
|
476
|
+
inputs: [
|
|
477
|
+
"months",
|
|
478
|
+
"weekdayLabels",
|
|
479
|
+
"canPrev",
|
|
480
|
+
"canNext",
|
|
481
|
+
"prevAriaLabel",
|
|
482
|
+
"nextAriaLabel",
|
|
483
|
+
"sublabelsLoading",
|
|
484
|
+
"grid",
|
|
485
|
+
"activeKey",
|
|
486
|
+
"titleAction",
|
|
487
|
+
"headerTitle"
|
|
488
|
+
],
|
|
489
|
+
outputs: [
|
|
490
|
+
"prevMonth",
|
|
491
|
+
"nextMonth",
|
|
492
|
+
"dayClick",
|
|
493
|
+
"gridKey",
|
|
494
|
+
"titleClick",
|
|
495
|
+
"dayHover"
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
kind: "component",
|
|
500
|
+
type: RtIconButtonComponent,
|
|
501
|
+
selector: "rt-icon-button",
|
|
502
|
+
inputs: [
|
|
503
|
+
"icon",
|
|
504
|
+
"glyph",
|
|
505
|
+
"ariaLabel",
|
|
506
|
+
"variant",
|
|
507
|
+
"iconColor",
|
|
508
|
+
"iconFill",
|
|
509
|
+
"size",
|
|
510
|
+
"iconSize",
|
|
511
|
+
"type",
|
|
512
|
+
"tooltip",
|
|
513
|
+
"tooltipHideOnClick",
|
|
514
|
+
"tabIndex",
|
|
515
|
+
"loading",
|
|
516
|
+
"disabled",
|
|
517
|
+
"active",
|
|
518
|
+
"expanded",
|
|
519
|
+
"indicator"
|
|
520
|
+
],
|
|
521
|
+
outputs: ["clicked"]
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
kind: "component",
|
|
525
|
+
type: RtToggleButtonGroupComponent,
|
|
526
|
+
selector: "rt-toggle-button-group",
|
|
527
|
+
inputs: [
|
|
528
|
+
"options",
|
|
529
|
+
"value",
|
|
530
|
+
"multiple",
|
|
531
|
+
"values",
|
|
532
|
+
"ariaLabel",
|
|
533
|
+
"size",
|
|
534
|
+
"disabled",
|
|
535
|
+
"fullWidth"
|
|
536
|
+
],
|
|
537
|
+
outputs: ["valueChange", "valuesChange"]
|
|
538
|
+
}
|
|
539
|
+
],
|
|
540
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
541
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
546
|
+
minVersion: "12.0.0",
|
|
547
|
+
version: "22.2.2",
|
|
548
|
+
ngImport: i0,
|
|
549
|
+
type: RtDatePanelComponent,
|
|
550
|
+
decorators: [{
|
|
551
|
+
type: Component,
|
|
552
|
+
args: [{
|
|
553
|
+
selector: "rt-date-panel",
|
|
554
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
555
|
+
encapsulation: ViewEncapsulation.None,
|
|
556
|
+
imports: [
|
|
557
|
+
BlockDirective,
|
|
558
|
+
ElemDirective,
|
|
559
|
+
RtButtonDirective,
|
|
560
|
+
RtCalendarComponent,
|
|
561
|
+
RtIconButtonComponent,
|
|
562
|
+
RtToggleButtonGroupComponent
|
|
563
|
+
],
|
|
564
|
+
host: {
|
|
565
|
+
class: BEM_BLOCK$1,
|
|
566
|
+
"[class.rt-date-panel--sheet]": "sheet()",
|
|
567
|
+
"[class.rt-date-panel--with-time]": "type() !== 'date'",
|
|
568
|
+
"(keydown.escape)": "closed.emit()"
|
|
569
|
+
},
|
|
570
|
+
template: "<ng-container rtBlock=\"rt-date-panel\">\n @if (split()) {\n <rt-toggle-button-group\n rtElem=\"tabs\"\n qa-dataid=\"date-panel-tabs\"\n fullWidth\n [ariaLabel]=\"t().uiDate + ' | ' + t().uiTime\"\n [options]=\"tabs()\"\n [value]=\"tab()\"\n (valueChange)=\"tab.set($event)\" />\n }\n\n <div rtElem=\"body\">\n @if (showDate()) {\n @if (view() === 'days') {\n <rt-calendar\n rtElem=\"calendar\"\n qa-dataid=\"date-panel-calendar\"\n grid\n titleAction\n headerTitle\n [months]=\"months()\"\n [weekdayLabels]=\"weekdays()\"\n [canPrev]=\"canPrev()\"\n [canNext]=\"canNext()\"\n [activeKey]=\"activeKey()\"\n [prevAriaLabel]=\"t().uiPrevMonth\"\n [nextAriaLabel]=\"t().uiNextMonth\"\n (prevMonth)=\"page(-1)\"\n (nextMonth)=\"page(1)\"\n (dayClick)=\"pickDay($event)\"\n (gridKey)=\"onGridKey($event)\"\n (titleClick)=\"openMonths()\" />\n } @else {\n <div rtElem=\"months\" qa-dataid=\"date-panel-months\" role=\"group\" [attr.aria-label]=\"t().uiChooseMonth\">\n <div rtElem=\"months-header\">\n <rt-icon-button\n qa-dataid=\"date-panel-prev-year\"\n icon=\"chevron-left\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiPrevYear\"\n [disabled]=\"!canPrevYear()\"\n (clicked)=\"pageYear(-1)\" />\n <span rtElem=\"year\" qa-dataid=\"date-panel-year\">{{ year() }}</span>\n <rt-icon-button\n qa-dataid=\"date-panel-next-year\"\n icon=\"chevron-right\"\n variant=\"secondary\"\n radius=\"full\"\n [ariaLabel]=\"t().uiNextYear\"\n [disabled]=\"!canNextYear()\"\n (clicked)=\"pageYear(1)\" />\n </div>\n <div rtElem=\"month-grid\">\n @for (cell of monthCells(); track cell.key) {\n <button\n rtElem=\"cell\"\n qa-dataid=\"date-panel-month\"\n type=\"button\"\n [attr.data-key]=\"cell.key\"\n [attr.aria-pressed]=\"cell.key === shownMonth()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMonth(cell)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n }\n\n @if (showTime()) {\n <div rtElem=\"time\" qa-dataid=\"date-panel-time\">\n <div rtElem=\"column\" qa-dataid=\"date-panel-hours\" role=\"group\" [attr.aria-label]=\"t().uiHours\">\n @for (cell of columns().hours; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-hour\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftHour()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickHour(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n <div rtElem=\"column\" qa-dataid=\"date-panel-minutes\" role=\"group\" [attr.aria-label]=\"t().uiMinutes\">\n @for (cell of columns().minutes; track cell.value) {\n <button\n #timeCell\n rtElem=\"cell\"\n qa-dataid=\"date-panel-minute\"\n type=\"button\"\n [attr.aria-pressed]=\"cell.value === draftMinute()\"\n [disabled]=\"cell.disabled\"\n (click)=\"pickMinute(cell.value)\">\n {{ cell.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <div rtElem=\"footer\">\n @switch (type()) {\n @case ('date') {\n <button\n rtButton\n qa-dataid=\"date-panel-today\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiToday\"\n [attr.aria-label]=\"t().uiToday\"\n [disabled]=\"todayOff()\"\n (click)=\"pickToday()\"></button>\n }\n @case ('time') {\n <button\n rtButton\n qa-dataid=\"date-panel-now\"\n theme=\"secondary\"\n appearance=\"text\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiNow\"\n [attr.aria-label]=\"t().uiNow\"\n (click)=\"pickNow()\"></button>\n <button\n rtButton\n qa-dataid=\"date-panel-done\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiDone\"\n [attr.aria-label]=\"t().uiDone\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n @default {\n <button\n rtButton\n qa-dataid=\"date-panel-apply\"\n size=\"sm\"\n type=\"button\"\n [label]=\"t().uiApply\"\n [attr.aria-label]=\"t().uiApply\"\n [disabled]=\"!canApply()\"\n (click)=\"apply()\"></button>\n }\n }\n </div>\n</ng-container>\n",
|
|
571
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-panel{--rt-date-panel-cell-size: var(--rt-control-height-sm);--rt-date-panel-cell-radius: var(--rt-radius-md);--rt-date-panel-divider-width: var(--rt-border-width-thin);--rt-date-panel-column-height: calc(var(--rt-date-panel-cell-size) * 7 + var(--rt-space-0-5) * 6);display:flex;flex-direction:column;padding:var(--rt-space-4);gap:var(--rt-space-4)}.rt-date-panel__body{display:flex;align-items:flex-start;gap:var(--rt-space-4)}.rt-date-panel .rt-date-panel__calendar{--rt-calendar-month-count: 1;--rt-calendar-day-justify: center}.rt-date-panel__calendar,.rt-date-panel__months{flex:1 1 auto;min-inline-size:calc(var(--rt-size-10) * 7)}.rt-date-panel__months-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--rt-space-4)}.rt-date-panel__year{color:var(--rt-color-text-primary);font-weight:var(--rt-font-weight-semibold)}.rt-date-panel__month-grid{display:grid;gap:var(--rt-space-1);grid-template-columns:repeat(3,1fr)}.rt-date-panel__time{display:flex;gap:var(--rt-space-1)}.rt-date-panel__column{position:relative;display:flex;flex-direction:column;gap:var(--rt-space-0-5);max-block-size:var(--rt-date-panel-column-height);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.rt-date-panel__cell{flex:0 0 auto;padding:0 var(--rt-space-2);border:none;border-radius:var(--rt-date-panel-cell-radius);background:none;color:var(--rt-color-text-primary);cursor:pointer;font:inherit;font-size:var(--rt-text-sm);font-variant-numeric:tabular-nums;min-block-size:var(--rt-date-panel-cell-size);min-inline-size:var(--rt-control-height-md)}.rt-date-panel__cell:hover:not(:disabled,[aria-pressed=true]){background:var(--rt-color-bg-subtle)}.rt-date-panel__cell:focus-visible{outline:var(--rt-focus-ring-width) solid var(--rt-focus-ring-color);outline-offset:var(--rt-focus-ring-offset)}.rt-date-panel__cell[aria-pressed=true]{background:var(--rt-color-action-primary);color:var(--rt-color-action-on-primary)}.rt-date-panel__cell:disabled{color:var(--rt-color-text-muted);cursor:not-allowed;opacity:.45}.rt-date-panel__footer{display:flex;justify-content:flex-end;padding-top:var(--rt-space-2);border-top:var(--rt-date-panel-divider-width) solid var(--rt-color-border-subtle);gap:var(--rt-space-2)}.rt-date-panel:not(.rt-date-panel--with-time) .rt-date-panel__footer{justify-content:center}.rt-date-panel--sheet{--rt-date-panel-cell-size: calc(var(--rt-size-10) + var(--rt-size-1));padding-inline:0}.rt-date-panel--sheet .rt-date-panel__calendar{--rt-calendar-day-size: var(--rt-date-panel-cell-size)}.rt-date-panel--sheet .rt-date-panel__body{flex-direction:column;align-items:stretch}.rt-date-panel--sheet .rt-date-panel__calendar,.rt-date-panel--sheet .rt-date-panel__months{min-inline-size:0}.rt-date-panel--sheet .rt-date-panel__time{justify-content:center}.rt-date-panel--sheet .rt-date-panel__column{flex:1 1 0}}\n"]
|
|
572
|
+
}]
|
|
573
|
+
}],
|
|
574
|
+
ctorParameters: () => [],
|
|
575
|
+
propDecorators: {
|
|
576
|
+
timeCells: [{
|
|
577
|
+
type: i0.ViewChildren,
|
|
578
|
+
args: ["timeCell", { isSignal: true }]
|
|
579
|
+
}],
|
|
580
|
+
type: [{
|
|
581
|
+
type: i0.Input,
|
|
582
|
+
args: [{
|
|
583
|
+
isSignal: true,
|
|
584
|
+
alias: "type",
|
|
585
|
+
required: true
|
|
586
|
+
}]
|
|
587
|
+
}],
|
|
588
|
+
value: [{
|
|
589
|
+
type: i0.Input,
|
|
590
|
+
args: [{
|
|
591
|
+
isSignal: true,
|
|
592
|
+
alias: "value",
|
|
593
|
+
required: false
|
|
594
|
+
}]
|
|
595
|
+
}],
|
|
596
|
+
min: [{
|
|
597
|
+
type: i0.Input,
|
|
598
|
+
args: [{
|
|
599
|
+
isSignal: true,
|
|
600
|
+
alias: "min",
|
|
601
|
+
required: false
|
|
602
|
+
}]
|
|
603
|
+
}],
|
|
604
|
+
max: [{
|
|
605
|
+
type: i0.Input,
|
|
606
|
+
args: [{
|
|
607
|
+
isSignal: true,
|
|
608
|
+
alias: "max",
|
|
609
|
+
required: false
|
|
610
|
+
}]
|
|
611
|
+
}],
|
|
612
|
+
minuteStep: [{
|
|
613
|
+
type: i0.Input,
|
|
614
|
+
args: [{
|
|
615
|
+
isSignal: true,
|
|
616
|
+
alias: "minuteStep",
|
|
617
|
+
required: false
|
|
618
|
+
}]
|
|
619
|
+
}],
|
|
620
|
+
sheet: [{
|
|
621
|
+
type: i0.Input,
|
|
622
|
+
args: [{
|
|
623
|
+
isSignal: true,
|
|
624
|
+
alias: "sheet",
|
|
625
|
+
required: false
|
|
626
|
+
}]
|
|
627
|
+
}],
|
|
628
|
+
now: [{
|
|
629
|
+
type: i0.Input,
|
|
630
|
+
args: [{
|
|
631
|
+
isSignal: true,
|
|
632
|
+
alias: "now",
|
|
633
|
+
required: false
|
|
634
|
+
}]
|
|
635
|
+
}],
|
|
636
|
+
picked: [{
|
|
637
|
+
type: i0.Output,
|
|
638
|
+
args: ["picked"]
|
|
639
|
+
}],
|
|
640
|
+
closed: [{
|
|
641
|
+
type: i0.Output,
|
|
642
|
+
args: ["closed"]
|
|
643
|
+
}]
|
|
644
|
+
}
|
|
645
|
+
});
|
|
458
646
|
const SAMPLE_DAY = new Date(2026, 0, 31);
|
|
459
|
-
const DEFAULT_LAYOUT = {
|
|
647
|
+
const DEFAULT_LAYOUT = {
|
|
648
|
+
order: [
|
|
649
|
+
"day",
|
|
650
|
+
"month",
|
|
651
|
+
"year"
|
|
652
|
+
],
|
|
653
|
+
separator: "."
|
|
654
|
+
};
|
|
460
655
|
const YEAR_LEN = 4;
|
|
461
656
|
const PART_MAX_LEN = 2;
|
|
462
657
|
const DAY_GROUPS = 3;
|
|
463
658
|
const TIME_GROUPS = 2;
|
|
464
|
-
/** Знаки, которые встречаются в тексте даты любой локали, кроме цифр. */
|
|
465
659
|
const TEXT_RE = /^[\d\s.,/:\-T]+$/;
|
|
466
660
|
function isDatePart(type) {
|
|
467
|
-
|
|
661
|
+
return type === "day" || type === "month" || type === "year";
|
|
468
662
|
}
|
|
469
663
|
function dayText(day, layout) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
664
|
+
const [year, month, date] = day.split("-");
|
|
665
|
+
const parts = {
|
|
666
|
+
day: date,
|
|
667
|
+
month,
|
|
668
|
+
year
|
|
669
|
+
};
|
|
670
|
+
return layout.order.map((part) => parts[part]).join(layout.separator);
|
|
473
671
|
}
|
|
474
|
-
/** День ISO из трёх групп цифр в порядке локали; `null` — группы не складываются в день. */
|
|
475
672
|
function readDay(groups, layout) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return null;
|
|
486
|
-
}
|
|
487
|
-
return `${year}-${month.padStart(PART_MAX_LEN, '0')}-${day.padStart(PART_MAX_LEN, '0')}`;
|
|
488
|
-
}
|
|
489
|
-
/** Время ISO из двух групп цифр: часы в один или два знака, минуты — ровно два. */
|
|
673
|
+
const parts = {};
|
|
674
|
+
layout.order.forEach((part, index) => {
|
|
675
|
+
parts[part] = groups[index];
|
|
676
|
+
});
|
|
677
|
+
const { day, month, year } = parts;
|
|
678
|
+
if (day === void 0 || month === void 0 || year?.length !== YEAR_LEN) return null;
|
|
679
|
+
if (day.length > PART_MAX_LEN || month.length > PART_MAX_LEN) return null;
|
|
680
|
+
return `${year}-${month.padStart(PART_MAX_LEN, "0")}-${day.padStart(PART_MAX_LEN, "0")}`;
|
|
681
|
+
}
|
|
490
682
|
function readTime(groups) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
return null;
|
|
497
|
-
}
|
|
498
|
-
return `${hour.padStart(PART_MAX_LEN, '0')}:${minute}`;
|
|
499
|
-
}
|
|
500
|
-
/** Значение типа из групп цифр текста; `null` — группы не складываются в значение. */
|
|
683
|
+
if (groups.length !== TIME_GROUPS) return null;
|
|
684
|
+
const [hour, minute] = groups;
|
|
685
|
+
if (minute.length !== PART_MAX_LEN || hour.length > PART_MAX_LEN) return null;
|
|
686
|
+
return `${hour.padStart(PART_MAX_LEN, "0")}:${minute}`;
|
|
687
|
+
}
|
|
501
688
|
function readGroups(groups, type, layout) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return null;
|
|
510
|
-
}
|
|
511
|
-
const day = readDay(groups.slice(0, DAY_GROUPS), layout);
|
|
512
|
-
const time = readTime(groups.slice(DAY_GROUPS));
|
|
513
|
-
return day === null || time === null ? null : `${day}T${time}`;
|
|
514
|
-
}
|
|
515
|
-
/** Порядок дня, месяца и года и знак между ними — по локали. */
|
|
689
|
+
if (type === "time") return readTime(groups);
|
|
690
|
+
if (type === "date") return groups.length === DAY_GROUPS ? readDay(groups, layout) : null;
|
|
691
|
+
if (groups.length !== 5) return null;
|
|
692
|
+
const day = readDay(groups.slice(0, DAY_GROUPS), layout);
|
|
693
|
+
const time = readTime(groups.slice(DAY_GROUPS));
|
|
694
|
+
return day === null || time === null ? null : `${day}T${time}`;
|
|
695
|
+
}
|
|
516
696
|
function rtDateLayout(locale) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* Текст поля для значения ISO; пустое значение — пустой текст. Строка, которая не читается как
|
|
533
|
-
* значение этого типа, показывается как есть: она пришла из формы мимо поля и не должна пропасть.
|
|
534
|
-
*/
|
|
697
|
+
const parts = new Intl.DateTimeFormat(locale, {
|
|
698
|
+
day: "2-digit",
|
|
699
|
+
month: "2-digit",
|
|
700
|
+
year: "numeric"
|
|
701
|
+
}).formatToParts(SAMPLE_DAY);
|
|
702
|
+
const order = parts.map((part) => part.type).filter((type) => isDatePart(type));
|
|
703
|
+
const separator = parts.find((part) => part.type === "literal")?.value.trim() ?? "";
|
|
704
|
+
if (order.length !== DAY_GROUPS || separator === "") return DEFAULT_LAYOUT;
|
|
705
|
+
return {
|
|
706
|
+
order,
|
|
707
|
+
separator
|
|
708
|
+
};
|
|
709
|
+
}
|
|
535
710
|
function rtDateText(value, type, layout) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
const [day, time] = value.split('T');
|
|
543
|
-
return `${dayText(day, layout)} ${time}`;
|
|
544
|
-
}
|
|
545
|
-
/** Подсказка формы текста в буквах кита: `дд.мм.гггг`, `чч:мм`, `дд.мм.гггг чч:мм`. */
|
|
711
|
+
if (type === "time" || rtDateRead(value, type) === null) return value;
|
|
712
|
+
if (type === "date") return dayText(value, layout);
|
|
713
|
+
const [day, time] = value.split("T");
|
|
714
|
+
return `${dayText(day, layout)} ${time}`;
|
|
715
|
+
}
|
|
546
716
|
function rtDateShape(type, layout, letters) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
return type === 'date' ? day : `${day} ${time}`;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Читает набранный текст в значение ISO; `null` — текст не значение этого типа. Читается и
|
|
556
|
-
* порядок локали, и сама форма значения: вставленная `2026-08-01` тоже становится значением.
|
|
557
|
-
*/
|
|
717
|
+
const time = `${letters.hour}:${letters.minute}`;
|
|
718
|
+
if (type === "time") return time;
|
|
719
|
+
const day = layout.order.map((part) => letters[part]).join(layout.separator);
|
|
720
|
+
return type === "date" ? day : `${day} ${time}`;
|
|
721
|
+
}
|
|
558
722
|
function rtDateParse(text, type, layout) {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return null;
|
|
566
|
-
}
|
|
567
|
-
const candidate = readGroups(value.match(/\d+/g) ?? [], type, layout);
|
|
568
|
-
// Кандидат проверяется той же формой значения: 31.02.2026 складывается в строку, но не в день.
|
|
569
|
-
return candidate === null ? null : rtDateRead(candidate, type);
|
|
723
|
+
const iso = rtDateRead(text, type);
|
|
724
|
+
if (iso !== null) return iso;
|
|
725
|
+
const value = text.trim();
|
|
726
|
+
if (!TEXT_RE.test(value)) return null;
|
|
727
|
+
const candidate = readGroups(value.match(/\d+/g) ?? [], type, layout);
|
|
728
|
+
return candidate === null ? null : rtDateRead(candidate, type);
|
|
570
729
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
730
|
+
const BEM_BLOCK = "rt-date-picker";
|
|
731
|
+
var RtDatePickerComponent = class RtDatePickerComponent extends RtFormControlBase {
|
|
732
|
+
constructor() {
|
|
733
|
+
super(...arguments);
|
|
734
|
+
this.#locale = inject(RT_KIT_LOCALE);
|
|
735
|
+
this.#layout = computed(() => rtDateLayout(this.#locale()), ...ngDevMode ? [{ debugName: "#layout" }] : /* istanbul ignore next */ []);
|
|
736
|
+
this.t = inject(RT_KIT_LABELS);
|
|
737
|
+
this.narrow = inject(BreakpointsService).narrow;
|
|
738
|
+
this.fieldEl = viewChild("fieldEl", ...ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []);
|
|
739
|
+
this.popover = viewChild(RtPopoverDirective, ...ngDevMode ? [{ debugName: "popover" }] : /* istanbul ignore next */ []);
|
|
740
|
+
this.textInvalid = signal(false, ...ngDevMode ? [{ debugName: "textInvalid" }] : /* istanbul ignore next */ []);
|
|
741
|
+
this.sheetOpen = signal(false, ...ngDevMode ? [{ debugName: "sheetOpen" }] : /* istanbul ignore next */ []);
|
|
742
|
+
this.shape = computed(() => {
|
|
743
|
+
const labels = this.t();
|
|
744
|
+
return rtDateShape(this.type(), this.#layout(), {
|
|
745
|
+
day: labels.uiShapeDay,
|
|
746
|
+
month: labels.uiShapeMonth,
|
|
747
|
+
year: labels.uiShapeYear,
|
|
748
|
+
hour: labels.uiShapeHour,
|
|
749
|
+
minute: labels.uiShapeMinute
|
|
750
|
+
});
|
|
751
|
+
}, ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
752
|
+
this.text = computed(() => this.#text(this.value()), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
753
|
+
this.openIcon = computed(() => this.type() === "time" ? "ico-time" : "ico-calendar", ...ngDevMode ? [{ debugName: "openIcon" }] : /* istanbul ignore next */ []);
|
|
754
|
+
this.hasValue = computed(() => this.value() !== "", ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
|
|
755
|
+
this.fieldSize = computed(() => this.shape().length, ...ngDevMode ? [{ debugName: "fieldSize" }] : /* istanbul ignore next */ []);
|
|
756
|
+
this.shapeTitle = computed(() => this.hasValue() ? null : this.shape(), ...ngDevMode ? [{ debugName: "shapeTitle" }] : /* istanbul ignore next */ []);
|
|
757
|
+
this.appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
|
|
758
|
+
this.displayText = computed(() => this.#format(this.value(), this.type()), ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
|
|
759
|
+
this.type = input("date", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
760
|
+
this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
761
|
+
this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
762
|
+
this.minuteStep = input(5, {
|
|
763
|
+
...ngDevMode ? { debugName: "minuteStep" } : /* istanbul ignore next */ {},
|
|
764
|
+
transform: numberAttribute
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
#locale;
|
|
768
|
+
#layout;
|
|
769
|
+
writeValue(value) {
|
|
770
|
+
super.writeValue(value);
|
|
771
|
+
this.textInvalid.set(false);
|
|
772
|
+
}
|
|
773
|
+
getEmptyValue() {
|
|
774
|
+
return "";
|
|
775
|
+
}
|
|
776
|
+
focusAfterClear() {
|
|
777
|
+
this.fieldEl()?.nativeElement.focus();
|
|
778
|
+
}
|
|
779
|
+
clearValue() {
|
|
780
|
+
super.clearValue();
|
|
781
|
+
this.#accept("");
|
|
782
|
+
}
|
|
783
|
+
onTyped(event) {
|
|
784
|
+
const text = event.target.value;
|
|
785
|
+
if (text.trim() === "") {
|
|
786
|
+
this.#commit("");
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
const read = rtDateParse(text, this.type(), this.#layout());
|
|
790
|
+
if (read === null || !rtDateInBounds(read, this.min(), this.max())) {
|
|
791
|
+
this.textInvalid.set(true);
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
this.#commit(read);
|
|
795
|
+
}
|
|
796
|
+
openPanel() {
|
|
797
|
+
if (this.narrow() && !this.isDisabled()) this.sheetOpen.set(true);
|
|
798
|
+
}
|
|
799
|
+
closePanel() {
|
|
800
|
+
this.sheetOpen.set(false);
|
|
801
|
+
this.popover()?.close();
|
|
802
|
+
}
|
|
803
|
+
onPicked(value) {
|
|
804
|
+
this.#commit(value);
|
|
805
|
+
this.markTouched();
|
|
806
|
+
}
|
|
807
|
+
onBlur() {
|
|
808
|
+
this.markTouched();
|
|
809
|
+
}
|
|
810
|
+
#commit(value) {
|
|
811
|
+
this.value.set(value);
|
|
812
|
+
this.emitChange(value);
|
|
813
|
+
this.#accept(value);
|
|
814
|
+
}
|
|
815
|
+
#accept(value) {
|
|
816
|
+
this.textInvalid.set(false);
|
|
817
|
+
const node = this.fieldEl()?.nativeElement;
|
|
818
|
+
if (node !== void 0) node.value = this.#text(value);
|
|
819
|
+
}
|
|
820
|
+
#text(value) {
|
|
821
|
+
return typeof value === "string" ? rtDateText(value, this.type(), this.#layout()) : "";
|
|
822
|
+
}
|
|
823
|
+
#format(value, type) {
|
|
824
|
+
if (value === "") return "";
|
|
825
|
+
const parsed = Date.parse(type === "time" ? `1970-01-01T${value}` : value);
|
|
826
|
+
if (Number.isNaN(parsed)) return value;
|
|
827
|
+
return new Intl.DateTimeFormat(this.#locale(), this.#formatOptions(type)).format(new Date(parsed));
|
|
828
|
+
}
|
|
829
|
+
#formatOptions(type) {
|
|
830
|
+
if (type === "time") return {
|
|
831
|
+
hour: "2-digit",
|
|
832
|
+
minute: "2-digit"
|
|
833
|
+
};
|
|
834
|
+
if (type === "datetime-local") return {
|
|
835
|
+
dateStyle: "medium",
|
|
836
|
+
timeStyle: "short"
|
|
837
|
+
};
|
|
838
|
+
return { dateStyle: "medium" };
|
|
839
|
+
}
|
|
840
|
+
static {
|
|
841
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
842
|
+
minVersion: "12.0.0",
|
|
843
|
+
version: "22.2.2",
|
|
844
|
+
ngImport: i0,
|
|
845
|
+
type: RtDatePickerComponent,
|
|
846
|
+
deps: null,
|
|
847
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
static {
|
|
851
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
852
|
+
minVersion: "17.0.0",
|
|
853
|
+
version: "22.2.2",
|
|
854
|
+
type: RtDatePickerComponent,
|
|
855
|
+
isStandalone: true,
|
|
856
|
+
selector: "rt-date-picker",
|
|
857
|
+
inputs: {
|
|
858
|
+
appearance: {
|
|
859
|
+
classPropertyName: "appearance",
|
|
860
|
+
publicName: "appearance",
|
|
861
|
+
isSignal: true,
|
|
862
|
+
isRequired: false,
|
|
863
|
+
transformFunction: null
|
|
864
|
+
},
|
|
865
|
+
type: {
|
|
866
|
+
classPropertyName: "type",
|
|
867
|
+
publicName: "type",
|
|
868
|
+
isSignal: true,
|
|
869
|
+
isRequired: false,
|
|
870
|
+
transformFunction: null
|
|
871
|
+
},
|
|
872
|
+
min: {
|
|
873
|
+
classPropertyName: "min",
|
|
874
|
+
publicName: "min",
|
|
875
|
+
isSignal: true,
|
|
876
|
+
isRequired: false,
|
|
877
|
+
transformFunction: null
|
|
878
|
+
},
|
|
879
|
+
max: {
|
|
880
|
+
classPropertyName: "max",
|
|
881
|
+
publicName: "max",
|
|
882
|
+
isSignal: true,
|
|
883
|
+
isRequired: false,
|
|
884
|
+
transformFunction: null
|
|
885
|
+
},
|
|
886
|
+
minuteStep: {
|
|
887
|
+
classPropertyName: "minuteStep",
|
|
888
|
+
publicName: "minuteStep",
|
|
889
|
+
isSignal: true,
|
|
890
|
+
isRequired: false,
|
|
891
|
+
transformFunction: null
|
|
892
|
+
}
|
|
893
|
+
},
|
|
894
|
+
host: {
|
|
895
|
+
properties: {
|
|
896
|
+
"class.rt-date-picker--disabled": "isDisabled()",
|
|
897
|
+
"class.rt-date-picker--invalid": "isInvalid() || textInvalid()",
|
|
898
|
+
"class.rt-date-picker--readonly": "isReadonly()",
|
|
899
|
+
"class.rt-date-picker--borderless": "!bordered()",
|
|
900
|
+
"class.rt-date-picker--appearance--fill": "appearance() === 'fill'",
|
|
901
|
+
"class.rt-date-picker--size--sm": "size() === 'sm'",
|
|
902
|
+
"class.rt-date-picker--size--lg": "size() === 'lg'"
|
|
903
|
+
},
|
|
904
|
+
classAttribute: "rt-date-picker"
|
|
905
|
+
},
|
|
906
|
+
providers: [{
|
|
907
|
+
provide: RtFormControlBase,
|
|
908
|
+
useExisting: forwardRef(() => RtDatePickerComponent)
|
|
909
|
+
}],
|
|
910
|
+
viewQueries: [{
|
|
911
|
+
propertyName: "fieldEl",
|
|
912
|
+
first: true,
|
|
913
|
+
predicate: ["fieldEl"],
|
|
914
|
+
descendants: true,
|
|
915
|
+
isSignal: true
|
|
916
|
+
}, {
|
|
917
|
+
propertyName: "popover",
|
|
918
|
+
first: true,
|
|
919
|
+
predicate: RtPopoverDirective,
|
|
920
|
+
descendants: true,
|
|
921
|
+
isSignal: true
|
|
922
|
+
}],
|
|
923
|
+
usesInheritance: true,
|
|
924
|
+
hostDirectives: [{
|
|
925
|
+
directive: i1.RtRadiusDirective,
|
|
926
|
+
inputs: ["radius", "radius"]
|
|
927
|
+
}],
|
|
928
|
+
ngImport: i0,
|
|
929
|
+
template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n",
|
|
930
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"],
|
|
931
|
+
dependencies: [
|
|
932
|
+
{
|
|
933
|
+
kind: "component",
|
|
934
|
+
type: RtBottomSheetComponent,
|
|
935
|
+
selector: "rt-bottom-sheet",
|
|
936
|
+
inputs: ["open"],
|
|
937
|
+
outputs: ["openChange"]
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
kind: "component",
|
|
941
|
+
type: RtDatePanelComponent,
|
|
942
|
+
selector: "rt-date-panel",
|
|
943
|
+
inputs: [
|
|
944
|
+
"type",
|
|
945
|
+
"value",
|
|
946
|
+
"min",
|
|
947
|
+
"max",
|
|
948
|
+
"minuteStep",
|
|
949
|
+
"sheet",
|
|
950
|
+
"now"
|
|
951
|
+
],
|
|
952
|
+
outputs: ["picked", "closed"]
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
kind: "component",
|
|
956
|
+
type: RtIconButtonComponent,
|
|
957
|
+
selector: "rt-icon-button",
|
|
958
|
+
inputs: [
|
|
959
|
+
"icon",
|
|
960
|
+
"glyph",
|
|
961
|
+
"ariaLabel",
|
|
962
|
+
"variant",
|
|
963
|
+
"iconColor",
|
|
964
|
+
"iconFill",
|
|
965
|
+
"size",
|
|
966
|
+
"iconSize",
|
|
967
|
+
"type",
|
|
968
|
+
"tooltip",
|
|
969
|
+
"tooltipHideOnClick",
|
|
970
|
+
"tabIndex",
|
|
971
|
+
"loading",
|
|
972
|
+
"disabled",
|
|
973
|
+
"active",
|
|
974
|
+
"expanded",
|
|
975
|
+
"indicator"
|
|
976
|
+
],
|
|
977
|
+
outputs: ["clicked"]
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
kind: "directive",
|
|
981
|
+
type: RtPopoverDirective,
|
|
982
|
+
selector: "[rtPopover]",
|
|
983
|
+
inputs: [
|
|
984
|
+
"rtPopover",
|
|
985
|
+
"rtPopoverTrigger",
|
|
986
|
+
"rtPopoverWidth",
|
|
987
|
+
"rtPopoverAlign",
|
|
988
|
+
"rtPopoverFitViewport",
|
|
989
|
+
"rtPopoverContext",
|
|
990
|
+
"rtPopoverPanelClass",
|
|
991
|
+
"rtPopoverDisabled",
|
|
992
|
+
"rtPopoverOffsetY",
|
|
993
|
+
"rtPopoverOffsetX",
|
|
994
|
+
"rtPopoverPositions"
|
|
995
|
+
],
|
|
996
|
+
outputs: ["rtPopoverOpened", "rtPopoverClosed"],
|
|
997
|
+
exportAs: ["rtPopover"]
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
kind: "directive",
|
|
1001
|
+
type: BlockDirective,
|
|
1002
|
+
selector: "[rtBlock]",
|
|
1003
|
+
inputs: ["rtMod"]
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
kind: "directive",
|
|
1007
|
+
type: ElemDirective,
|
|
1008
|
+
selector: "[rtElem]",
|
|
1009
|
+
inputs: ["rtMod"]
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
kind: "directive",
|
|
1013
|
+
type: ModDirective,
|
|
1014
|
+
selector: "[rtMod]"
|
|
1015
|
+
}
|
|
1016
|
+
],
|
|
1017
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1018
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1023
|
+
minVersion: "12.0.0",
|
|
1024
|
+
version: "22.2.2",
|
|
1025
|
+
ngImport: i0,
|
|
1026
|
+
type: RtDatePickerComponent,
|
|
1027
|
+
decorators: [{
|
|
1028
|
+
type: Component,
|
|
1029
|
+
args: [{
|
|
1030
|
+
selector: "rt-date-picker",
|
|
1031
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1032
|
+
encapsulation: ViewEncapsulation.None,
|
|
1033
|
+
imports: [
|
|
1034
|
+
RtBottomSheetComponent,
|
|
1035
|
+
RtDatePanelComponent,
|
|
1036
|
+
RtIconButtonComponent,
|
|
1037
|
+
RtPopoverDirective,
|
|
1038
|
+
BlockDirective,
|
|
1039
|
+
ElemDirective,
|
|
1040
|
+
ModDirective
|
|
1041
|
+
],
|
|
1042
|
+
providers: [{
|
|
1043
|
+
provide: RtFormControlBase,
|
|
1044
|
+
useExisting: forwardRef(() => RtDatePickerComponent)
|
|
1045
|
+
}],
|
|
1046
|
+
hostDirectives: [{
|
|
1047
|
+
directive: RtRadiusDirective,
|
|
1048
|
+
inputs: ["radius"]
|
|
1049
|
+
}],
|
|
1050
|
+
host: {
|
|
1051
|
+
class: BEM_BLOCK,
|
|
1052
|
+
"[class.rt-date-picker--disabled]": "isDisabled()",
|
|
1053
|
+
"[class.rt-date-picker--invalid]": "isInvalid() || textInvalid()",
|
|
1054
|
+
"[class.rt-date-picker--readonly]": "isReadonly()",
|
|
1055
|
+
"[class.rt-date-picker--borderless]": "!bordered()",
|
|
1056
|
+
"[class.rt-date-picker--appearance--fill]": "appearance() === 'fill'",
|
|
1057
|
+
"[class.rt-date-picker--size--sm]": "size() === 'sm'",
|
|
1058
|
+
"[class.rt-date-picker--size--lg]": "size() === 'lg'"
|
|
1059
|
+
},
|
|
1060
|
+
template: "<ng-container rtBlock=\"rt-date-picker\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"date-picker-readonly\" [rtMod]=\"{ empty: !displayText() }\">{{ displayText() || '—' }}</span>\n } @else {\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"date-picker-control\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [disabled]=\"isDisabled()\"\n [attr.placeholder]=\"shape()\"\n [attr.title]=\"shapeTitle()\"\n [attr.size]=\"fieldSize()\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || textInvalid() || null\"\n (input)=\"onTyped($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"date-picker-clear\"\n icon=\"ico-close\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n [ariaLabel]=\"t().uiClear\"\n [tabIndex]=\"-1\"\n (clicked)=\"clear($event)\" />\n }\n <rt-icon-button\n rtElem=\"open\"\n qa-dataid=\"date-picker-open\"\n size=\"sm\"\n variant=\"ghost\"\n iconColor=\"muted\"\n rtPopoverAlign=\"end\"\n [icon]=\"openIcon()\"\n [ariaLabel]=\"t().uiOpenCalendar\"\n [disabled]=\"isDisabled()\"\n [rtPopover]=\"panelTpl\"\n [rtPopoverDisabled]=\"narrow() || isDisabled()\"\n (clicked)=\"openPanel()\" />\n\n <ng-template #panelTpl>\n <div rtElem=\"popup\" qa-dataid=\"date-picker-popup\">\n <rt-date-panel\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n </div>\n </ng-template>\n\n @if (narrow()) {\n <rt-bottom-sheet qa-dataid=\"date-picker-sheet\" [open]=\"sheetOpen()\" (openChange)=\"sheetOpen.set($event)\">\n @if (sheetOpen()) {\n <rt-date-panel\n sheet\n [type]=\"type()\"\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [minuteStep]=\"minuteStep()\"\n (picked)=\"onPicked($event)\"\n (closed)=\"closePanel()\" />\n }\n </rt-bottom-sheet>\n }\n }\n</ng-container>\n",
|
|
1061
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-date-picker{--rt-date-picker-radius: var(--rt-input-radius);--rt-date-picker-fill-radius: var(--rt-radius-sm);position:relative;display:inline-flex;width:100%;min-height:var(--rt-input-height);box-sizing:border-box;align-items:center;padding:var(--rt-input-padding-y) var(--rt-input-padding-x);border:var(--rt-input-border-width) solid var(--rt-input-color-border);border-radius:var(--rt-date-picker-radius);background-color:var(--rt-input-color-bg);color:var(--rt-input-color-text);cursor:text;font-size:var(--rt-input-font-size);gap:var(--rt-space-sm);line-height:var(--rt-input-line-height);transition:var(--rt-input-transition)}.rt-date-picker:focus-within{border-color:var(--rt-input-color-border-focus);box-shadow:var(--rt-input-focus-shadow);outline:2px solid transparent;outline-offset:var(--rt-input-focus-outline-offset)}.rt-date-picker--borderless{border-color:transparent}.rt-date-picker--appearance--fill{border-color:transparent;border-radius:var(--rt-date-picker-fill-radius) var(--rt-date-picker-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-date-picker--invalid{border-color:var(--rt-input-color-border-error)}.rt-date-picker--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-date-picker--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-date-picker--size--sm{min-height:var(--rt-input-height-sm)}.rt-date-picker--size--lg{min-height:var(--rt-input-height-lg)}.rt-date-picker--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-date-picker__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-date-picker__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-date-picker__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none;text-overflow:ellipsis}.rt-date-picker__field:disabled{cursor:not-allowed}.rt-date-picker__clear,.rt-date-picker__open{flex-shrink:0}.rt-date-picker__popup{border:var(--rt-overlay-select-panel-border-width) solid var(--rt-color-border-subtle);border-radius:var(--rt-overlay-select-radius);background-color:var(--rt-color-bg-surface);box-shadow:var(--rt-overlay-select-shadow)}.rt-date-picker[data-rt-radius=none]{--rt-date-picker-radius: var(--rt-radius-none)}.rt-date-picker[data-rt-radius=xs]{--rt-date-picker-radius: var(--rt-radius-xs)}.rt-date-picker[data-rt-radius=sm]{--rt-date-picker-radius: var(--rt-radius-sm)}.rt-date-picker[data-rt-radius=ms]{--rt-date-picker-radius: var(--rt-radius-ms)}.rt-date-picker[data-rt-radius=md]{--rt-date-picker-radius: var(--rt-radius-md)}.rt-date-picker[data-rt-radius=lg]{--rt-date-picker-radius: var(--rt-radius-lg)}.rt-date-picker[data-rt-radius=xl]{--rt-date-picker-radius: var(--rt-radius-xl)}.rt-date-picker[data-rt-radius=\"2xl\"]{--rt-date-picker-radius: var(--rt-radius-2xl)}.rt-date-picker[data-rt-radius=full]{--rt-date-picker-radius: var(--rt-radius-full)}}\n"]
|
|
1062
|
+
}]
|
|
1063
|
+
}],
|
|
1064
|
+
propDecorators: {
|
|
1065
|
+
fieldEl: [{
|
|
1066
|
+
type: i0.ViewChild,
|
|
1067
|
+
args: ["fieldEl", { isSignal: true }]
|
|
1068
|
+
}],
|
|
1069
|
+
popover: [{
|
|
1070
|
+
type: i0.ViewChild,
|
|
1071
|
+
args: [i0.forwardRef(() => RtPopoverDirective), { isSignal: true }]
|
|
1072
|
+
}],
|
|
1073
|
+
appearance: [{
|
|
1074
|
+
type: i0.Input,
|
|
1075
|
+
args: [{
|
|
1076
|
+
isSignal: true,
|
|
1077
|
+
alias: "appearance",
|
|
1078
|
+
required: false
|
|
1079
|
+
}]
|
|
1080
|
+
}],
|
|
1081
|
+
type: [{
|
|
1082
|
+
type: i0.Input,
|
|
1083
|
+
args: [{
|
|
1084
|
+
isSignal: true,
|
|
1085
|
+
alias: "type",
|
|
1086
|
+
required: false
|
|
1087
|
+
}]
|
|
1088
|
+
}],
|
|
1089
|
+
min: [{
|
|
1090
|
+
type: i0.Input,
|
|
1091
|
+
args: [{
|
|
1092
|
+
isSignal: true,
|
|
1093
|
+
alias: "min",
|
|
1094
|
+
required: false
|
|
1095
|
+
}]
|
|
1096
|
+
}],
|
|
1097
|
+
max: [{
|
|
1098
|
+
type: i0.Input,
|
|
1099
|
+
args: [{
|
|
1100
|
+
isSignal: true,
|
|
1101
|
+
alias: "max",
|
|
1102
|
+
required: false
|
|
1103
|
+
}]
|
|
1104
|
+
}],
|
|
1105
|
+
minuteStep: [{
|
|
1106
|
+
type: i0.Input,
|
|
1107
|
+
args: [{
|
|
1108
|
+
isSignal: true,
|
|
1109
|
+
alias: "minuteStep",
|
|
1110
|
+
required: false
|
|
1111
|
+
}]
|
|
1112
|
+
}]
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
778
1115
|
export { RtDatePickerComponent, rtDateAddMonths, rtDateCanPage, rtDateFirstDay, rtDateGridKey, rtDateInBounds, rtDateLayout, rtDateMonth, rtDateMonths, rtDateNow, rtDateParse, rtDateRead, rtDateShape, rtDateSplit, rtDateText, rtDateTime, rtDateTimeColumns, rtDateWeekdays, rtDateWrite };
|
|
779
|
-
|
|
1116
|
+
|
|
1117
|
+
//# sourceMappingURL=rt-tools-ui-kit-v2-date-picker.mjs.map
|