@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,362 +1,468 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { BlockDirective, ElemDirective, ModDirective } from
|
|
4
|
-
import { RT_KIT_LABELS } from
|
|
5
|
-
import { RtFormControlBase } from
|
|
6
|
-
import { RtIconComponent } from
|
|
7
|
-
import { RtIconButtonComponent } from
|
|
8
|
-
import * as i1 from
|
|
9
|
-
import { RtRadiusDirective } from
|
|
10
|
-
|
|
11
|
-
const BEM_BLOCK = 'rt-input-number';
|
|
12
|
-
/**
|
|
13
|
-
* Парсит строку в `number | null` по разделителям локали: `groupSep` и любые
|
|
14
|
-
* пробелы удаляются, оставшийся разделитель дробной части приводится к точке.
|
|
15
|
-
*
|
|
16
|
-
* Разбор обязан знать локаль, иначе он расходится с показом: в `en-US` разряды
|
|
17
|
-
* группируются запятой, и набранное `1000` показывалось как `1,000`, а в форму
|
|
18
|
-
* уходила `1` — безусловная замена первой запятой на точку читала разделитель
|
|
19
|
-
* разрядов как десятичный.
|
|
20
|
-
*
|
|
21
|
-
* Пустая строка / NaN → null.
|
|
22
|
-
*/
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, LOCALE_ID, ViewEncapsulation, booleanAttribute, computed, forwardRef, inject, input, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { BlockDirective, ElemDirective, ModDirective } from "@rt-tools/core";
|
|
4
|
+
import { RT_KIT_LABELS } from "@rt-tools/ui-kit-v2/core";
|
|
5
|
+
import { RtFormControlBase } from "@rt-tools/ui-kit-v2/form-control";
|
|
6
|
+
import { RtIconComponent } from "@rt-tools/ui-kit-v2/icon";
|
|
7
|
+
import { RtIconButtonComponent } from "@rt-tools/ui-kit-v2/icon-button";
|
|
8
|
+
import * as i1 from "@rt-tools/ui-kit-v2/radius";
|
|
9
|
+
import { RtRadiusDirective } from "@rt-tools/ui-kit-v2/radius";
|
|
10
|
+
const BEM_BLOCK = "rt-input-number";
|
|
23
11
|
function parseNumber(text, groupSep) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const parsed = parseFloat(cleaned);
|
|
32
|
-
return Number.isNaN(parsed) ? null : parsed;
|
|
12
|
+
const withoutSpaces = text.replace(/\s/g, "");
|
|
13
|
+
const cleaned = (groupSep.trim() === "" ? withoutSpaces : withoutSpaces.split(groupSep).join("")).replace(/,/g, ".");
|
|
14
|
+
if (cleaned === "") return null;
|
|
15
|
+
const parsed = parseFloat(cleaned);
|
|
16
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
33
17
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Клампит `value` в диапазон `[min, max]`. `null` границы игнорируются —
|
|
36
|
-
* соответствующая сторона остаётся неограниченной.
|
|
37
|
-
*/
|
|
38
18
|
function clamp(value, min, max) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (max !== null && result > max) {
|
|
44
|
-
result = max;
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
19
|
+
let result = value;
|
|
20
|
+
if (min !== null && result < min) result = min;
|
|
21
|
+
if (max !== null && result > max) result = max;
|
|
22
|
+
return result;
|
|
47
23
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Форматирует `number | null` в строку с группировкой разрядов (неразрывный
|
|
50
|
-
* пробел) и заданным fractionDigits diapason. `value === null` → "".
|
|
51
|
-
* `maxFractionDigits` ограничивается сверху 20 (лимит Intl). Итоговый
|
|
52
|
-
* precision = `max(min, min(max, 20))` и фиксирует одинаковую нижнюю/верхнюю
|
|
53
|
-
* границу дробной части (как прежний `toFixed`), меняется только группировка
|
|
54
|
-
* и десятичный разделитель — их даёт `locale`.
|
|
55
|
-
*
|
|
56
|
-
* `grouped === false` снимает разделители разрядов: у года, номера дома и кода
|
|
57
|
-
* разряды значения не несут, и `2026` показывалось как `2 026`.
|
|
58
|
-
*/
|
|
59
24
|
function formatNumber(value, minFractionDigits, maxFractionDigits, locale, grouped) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
maximumFractionDigits: precision,
|
|
68
|
-
useGrouping: grouped,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Numeric input с parse/format/clamp logic. Использует native
|
|
73
|
-
* `<input type="text" inputmode="decimal">` (НЕ `type="number"` — избегаем
|
|
74
|
-
* browser spinner quirks: scroll-wheel value changes, locale-specific decimal
|
|
75
|
-
* separators, inconsistent step rounding).
|
|
76
|
-
*
|
|
77
|
-
* CVA через общий `RtFormControlBase` — авто-подсветка invalid, `clearable`
|
|
78
|
-
* (крестик при непустом display). Parser принимает `,`/`.`, невалидный ввод
|
|
79
|
-
* (NaN) не эмитится во время набора; на blur невалидное → null, валидное —
|
|
80
|
-
* clamp + format.
|
|
81
|
-
*
|
|
82
|
-
* Визуально и по токенам идентичен rt-input (`--rt-input-*`): host — box,
|
|
83
|
-
* `<input>` — прозрачный `__field`.
|
|
84
|
-
*/
|
|
85
|
-
class RtInputNumberComponent extends RtFormControlBase {
|
|
86
|
-
constructor() {
|
|
87
|
-
super(...arguments);
|
|
88
|
-
this.#locale = inject(LOCALE_ID);
|
|
89
|
-
// Символ группировки разрядов из локали (для ru — неразрывный пробел). Берём
|
|
90
|
-
// тот же, что отдаёт toLocaleString на blur — тогда live и blur выглядят
|
|
91
|
-
// одинаково, а parseNumber (стрипает \s) парсит обратно обе формы.
|
|
92
|
-
this.#groupSep = (1000).toLocaleString(this.#locale).replace(/\d/g, '') || ' ';
|
|
93
|
-
/**
|
|
94
|
-
* Что в этой локали можно набрать как разделитель дробной части: всё из
|
|
95
|
-
* «.,», кроме того, чем локаль разделяет разряды. В `ru` разряды разделяет
|
|
96
|
-
* неразрывный пробел, поэтому годятся оба знака; в `en-US` запятая — это
|
|
97
|
-
* разряды, и десятичной остаётся только точка. Иначе набранное `1,5`
|
|
98
|
-
* значило бы в показе одно, а в разборе другое.
|
|
99
|
-
*/
|
|
100
|
-
this.#decimalSepPattern = new RegExp(`[${['.', ','].filter((char) => char !== this.#groupSep).join('')}]`);
|
|
101
|
-
this.t = inject(RT_KIT_LABELS);
|
|
102
|
-
this.fieldEl = viewChild('fieldEl', /* @ts-ignore */
|
|
103
|
-
...(ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []));
|
|
104
|
-
this.displayValue = signal('', /* @ts-ignore */
|
|
105
|
-
...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
106
|
-
// Крестик показываем только при непустом и ненулевом значении: 0 — это и
|
|
107
|
-
// есть результат очистки, поэтому при нём кнопка сброса не нужна.
|
|
108
|
-
this.hasValue = computed(() => this.displayValue() !== '' && this.value() !== null && this.value() !== 0, /* @ts-ignore */
|
|
109
|
-
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
110
|
-
/** Вид рамки: `outline` — рамка со всех сторон, `fill` — залитое поле с чертой снизу. */
|
|
111
|
-
this.appearance = input('outline', /* @ts-ignore */
|
|
112
|
-
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
113
|
-
this.displayText = computed(() => this.displayValue(), /* @ts-ignore */
|
|
114
|
-
...(ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []));
|
|
115
|
-
this.iconLeft = input(null, /* @ts-ignore */
|
|
116
|
-
...(ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []));
|
|
117
|
-
/** Текстовый префикс слева от значения (напр. «₽» для рублёвых сумм). */
|
|
118
|
-
this.prefix = input(null, /* @ts-ignore */
|
|
119
|
-
...(ngDevMode ? [{ debugName: "prefix" }] : /* istanbul ignore next */ []));
|
|
120
|
-
this.placeholder = input('', /* @ts-ignore */
|
|
121
|
-
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
122
|
-
this.min = input(null, /* @ts-ignore */
|
|
123
|
-
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
124
|
-
this.max = input(null, /* @ts-ignore */
|
|
125
|
-
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
126
|
-
this.minFractionDigits = input(0, /* @ts-ignore */
|
|
127
|
-
...(ngDevMode ? [{ debugName: "minFractionDigits" }] : /* istanbul ignore next */ []));
|
|
128
|
-
this.maxFractionDigits = input(2, /* @ts-ignore */
|
|
129
|
-
...(ngDevMode ? [{ debugName: "maxFractionDigits" }] : /* istanbul ignore next */ []));
|
|
130
|
-
/**
|
|
131
|
-
* Группировать ли разряды. Снимается у чисел, которые разрядами не читаются:
|
|
132
|
-
* год, номер дома, код. У года разделитель превращает `2026` в `2 026`.
|
|
133
|
-
*/
|
|
134
|
-
this.grouped = input(true, { ...(ngDevMode ? { debugName: "grouped" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
135
|
-
}
|
|
136
|
-
#locale;
|
|
137
|
-
// Символ группировки разрядов из локали (для ru — неразрывный пробел). Берём
|
|
138
|
-
// тот же, что отдаёт toLocaleString на blur — тогда live и blur выглядят
|
|
139
|
-
// одинаково, а parseNumber (стрипает \s) парсит обратно обе формы.
|
|
140
|
-
#groupSep;
|
|
141
|
-
/**
|
|
142
|
-
* Что в этой локали можно набрать как разделитель дробной части: всё из
|
|
143
|
-
* «.,», кроме того, чем локаль разделяет разряды. В `ru` разряды разделяет
|
|
144
|
-
* неразрывный пробел, поэтому годятся оба знака; в `en-US` запятая — это
|
|
145
|
-
* разряды, и десятичной остаётся только точка. Иначе набранное `1,5`
|
|
146
|
-
* значило бы в показе одно, а в разборе другое.
|
|
147
|
-
*/
|
|
148
|
-
#decimalSepPattern;
|
|
149
|
-
writeValue(value) {
|
|
150
|
-
super.writeValue(value);
|
|
151
|
-
this.displayValue.set(formatNumber(this.value(), this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped()));
|
|
152
|
-
}
|
|
153
|
-
getEmptyValue() {
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
focusAfterClear() {
|
|
157
|
-
this.fieldEl()?.nativeElement.focus();
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Падинг/гэп рамки принадлежат host-контейнеру, а не `<input>`, поэтому клик
|
|
161
|
-
* по этой зоне сам по себе не фокусирует поле. Перехватываем mousedown и
|
|
162
|
-
* переводим фокус в input — но только если клик не пришёлся на само поле
|
|
163
|
-
* (там нужно нативное позиционирование курсора) и не на интерактивный
|
|
164
|
-
* постфикс (крестик-очистка со своим обработчиком).
|
|
165
|
-
*/
|
|
166
|
-
onHostMousedown(event) {
|
|
167
|
-
if (this.isDisabled()) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const field = this.fieldEl()?.nativeElement;
|
|
171
|
-
const target = event.target;
|
|
172
|
-
if (!field || target === field || target.closest('button, rt-icon-button')) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
event.preventDefault();
|
|
176
|
-
field.focus();
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Крестик сбрасывает поле не в пустое/null, а в 0 — отформатированный по
|
|
180
|
-
* текущему fractionDigits (например `0,00`). Числовые поля всегда имеют
|
|
181
|
-
* осмысленный ноль, поэтому «очистка» = обнуление, а не пустое значение.
|
|
182
|
-
*/
|
|
183
|
-
clearValue() {
|
|
184
|
-
this.value.set(0);
|
|
185
|
-
this.displayValue.set(formatNumber(0, this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped()));
|
|
186
|
-
}
|
|
187
|
-
onInput(event) {
|
|
188
|
-
const target = event.target;
|
|
189
|
-
const raw = target.value;
|
|
190
|
-
const caret = target.selectionStart ?? raw.length;
|
|
191
|
-
// Live-группировка разрядов прямо во время набора (1000000 → 1 000 000).
|
|
192
|
-
const formatted = this.#groupDisplay(raw);
|
|
193
|
-
const nextCaret = this.#restoreCaret(raw, caret, formatted);
|
|
194
|
-
// Пишем value императивно ДО Angular CD: тогда повторная запись биндинга
|
|
195
|
-
// `[value]` будет той же строкой и не сбросит каретку в конец. Затем
|
|
196
|
-
// восстанавливаем позицию по числу значимых символов слева от курсора.
|
|
197
|
-
target.value = formatted;
|
|
198
|
-
target.setSelectionRange(nextCaret, nextCaret);
|
|
199
|
-
this.displayValue.set(formatted);
|
|
200
|
-
const parsed = parseNumber(formatted, this.#groupSep);
|
|
201
|
-
if (parsed === null) {
|
|
202
|
-
// Только реально пустой ввод → emit null (пользователь очистил поле).
|
|
203
|
-
// Нечисловой ввод стрипается из отображения, но prev value держится до
|
|
204
|
-
// blur — поэтому проверяем исходный `raw`, а не очищенный `formatted`.
|
|
205
|
-
if (raw.trim() === '') {
|
|
206
|
-
this.value.set(null);
|
|
207
|
-
this.emitChange(null);
|
|
208
|
-
}
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
this.value.set(parsed);
|
|
212
|
-
this.emitChange(parsed);
|
|
213
|
-
}
|
|
214
|
-
onBlur() {
|
|
215
|
-
const parsed = parseNumber(this.displayValue(), this.#groupSep);
|
|
216
|
-
if (parsed === null) {
|
|
217
|
-
this.value.set(null);
|
|
218
|
-
this.displayValue.set('');
|
|
219
|
-
this.emitChange(null);
|
|
220
|
-
this.markTouched();
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const clamped = clamp(parsed, this.min(), this.max());
|
|
224
|
-
const formatted = formatNumber(clamped, this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped());
|
|
225
|
-
// `formatted` содержит разделители локали — обратный парс через
|
|
226
|
-
// parseNumber (а не parseFloat) даёт округлённое числовое значение.
|
|
227
|
-
const rounded = parseNumber(formatted, this.#groupSep) ?? clamped;
|
|
228
|
-
this.value.set(rounded);
|
|
229
|
-
this.displayValue.set(formatted);
|
|
230
|
-
this.emitChange(rounded);
|
|
231
|
-
this.markTouched();
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Live-форматирование строки во время набора: целая часть группируется по
|
|
235
|
-
* разрядам (`#groupSep`), дробная остаётся как набрана (хвостовая запятая и
|
|
236
|
-
* нули сохраняются, чтобы их можно было дописать). Разделителем дробной
|
|
237
|
-
* части считается только то, что им может быть в этой локали
|
|
238
|
-
* (`#decimalSepPattern`), — иначе запятая-разряды в `en-US` читалась бы как
|
|
239
|
-
* десятичная. Разделитель допускается всегда — округление по
|
|
240
|
-
* `maxFractionDigits` происходит на blur
|
|
241
|
-
* (поэтому в целочисленном поле «1000,5» парсится и округлится, а не склеится
|
|
242
|
-
* в «10005»). Группировка — линейным проходом, а не `Number()`, чтобы не
|
|
243
|
-
* терять точность на суммах длиннее 2^53.
|
|
244
|
-
*/
|
|
245
|
-
#groupDisplay(raw) {
|
|
246
|
-
const negative = raw.trimStart().startsWith('-');
|
|
247
|
-
let sep = '';
|
|
248
|
-
let fracDigits = '';
|
|
249
|
-
let intDigits;
|
|
250
|
-
const sepIndex = raw.search(this.#decimalSepPattern);
|
|
251
|
-
if (sepIndex >= 0) {
|
|
252
|
-
sep = raw.charAt(sepIndex);
|
|
253
|
-
intDigits = raw.slice(0, sepIndex).replace(/\D/g, '');
|
|
254
|
-
fracDigits = raw.slice(sepIndex + 1).replace(/\D/g, '');
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
intDigits = raw.replace(/\D/g, '');
|
|
258
|
-
}
|
|
259
|
-
// Ведущие нули убираем, но сохраняем один «0» перед десятичным разделителем.
|
|
260
|
-
intDigits = intDigits.replace(/^0+(?=\d)/, '');
|
|
261
|
-
let intPart;
|
|
262
|
-
if (intDigits === '') {
|
|
263
|
-
intPart = sep === '' ? '' : '0';
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
// Набор идёт тем же видом, что и показ на blur: иначе разделители
|
|
267
|
-
// появлялись бы при наборе и пропадали после ухода из поля.
|
|
268
|
-
intPart = this.grouped() ? this.#groupInteger(intDigits) : intDigits;
|
|
269
|
-
}
|
|
270
|
-
let out = negative ? `-${intPart}` : intPart;
|
|
271
|
-
if (sep !== '') {
|
|
272
|
-
out += sep + fracDigits;
|
|
273
|
-
}
|
|
274
|
-
return out;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Группирует строку цифр по три справа налево, вставляя `#groupSep`. Без
|
|
278
|
-
* регэкспа намеренно — `(\d{3})+`-lookahead флагуется как ReDoS-уязвимый, а
|
|
279
|
-
* линейный проход и быстрее, и безопасен.
|
|
280
|
-
*/
|
|
281
|
-
#groupInteger(digits) {
|
|
282
|
-
const length = digits.length;
|
|
283
|
-
let out = '';
|
|
284
|
-
for (let i = 0; i < length; i++) {
|
|
285
|
-
if (i > 0 && (length - i) % 3 === 0) {
|
|
286
|
-
out += this.#groupSep;
|
|
287
|
-
}
|
|
288
|
-
out += digits.charAt(i);
|
|
289
|
-
}
|
|
290
|
-
return out;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Пересчитывает позицию каретки после вставки разделителей разрядов: считает
|
|
294
|
-
* значимые символы (цифры и десятичный разделитель — не group-separator)
|
|
295
|
-
* слева от старой каретки и находит ту же точку в новой строке. Иначе курсор
|
|
296
|
-
* прыгал бы в конец при каждом вставленном пробеле.
|
|
297
|
-
*/
|
|
298
|
-
#restoreCaret(raw, caret, formatted) {
|
|
299
|
-
const isAnchor = (ch) => /[\d.,]/.test(ch);
|
|
300
|
-
let need = 0;
|
|
301
|
-
for (let i = 0; i < caret && i < raw.length; i++) {
|
|
302
|
-
if (isAnchor(raw.charAt(i))) {
|
|
303
|
-
need++;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
if (need === 0) {
|
|
307
|
-
return formatted.startsWith('-') ? 1 : 0;
|
|
308
|
-
}
|
|
309
|
-
let seen = 0;
|
|
310
|
-
let pos = 0;
|
|
311
|
-
while (pos < formatted.length) {
|
|
312
|
-
if (isAnchor(formatted.charAt(pos))) {
|
|
313
|
-
seen++;
|
|
314
|
-
if (seen === need) {
|
|
315
|
-
pos++;
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
pos++;
|
|
320
|
-
}
|
|
321
|
-
return pos;
|
|
322
|
-
}
|
|
323
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: RtInputNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
324
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: RtInputNumberComponent, isStandalone: true, selector: "rt-input-number", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, minFractionDigits: { classPropertyName: "minFractionDigits", publicName: "minFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, grouped: { classPropertyName: "grouped", publicName: "grouped", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onHostMousedown($event)" }, properties: { "class.rt-input-number--disabled": "isDisabled()", "class.rt-input-number--invalid": "isInvalid()", "class.rt-input-number--readonly": "isReadonly()", "class.rt-input-number--borderless": "!bordered()", "class.rt-input-number--appearance--fill": "appearance() === 'fill'", "class.rt-input-number--appearance--pill": "appearance() === 'pill'", "class.rt-input-number--size--sm": "size() === 'sm'", "class.rt-input-number--size--lg": "size() === 'lg'" }, classAttribute: "rt-input-number" }, providers: [
|
|
325
|
-
// Алиас базового токена — для contentChild(RtFormControlBase) в rt-field.
|
|
326
|
-
{ provide: RtFormControlBase, useExisting: forwardRef(() => RtInputNumberComponent) },
|
|
327
|
-
], viewQueries: [{ propertyName: "fieldEl", first: true, predicate: ["fieldEl"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1.RtRadiusDirective, inputs: ["radius", "radius"] }], ngImport: i0, template: "<ng-container rtBlock=\"rt-input-number\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"input-number-readonly\" [rtMod]=\"{ empty: !displayText() }\">\n @if (prefix() && displayText()) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\">{{ prefix() }}</span>\n }\n {{ displayText() || '\u2014' }}\n </span>\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n @if (prefix(); as pfx) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\" aria-hidden=\"true\">{{ pfx }}</span>\n }\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"input-number-control\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [value]=\"displayValue()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"input-number-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 }\n</ng-container>\n", styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-input-number{--rt-input-number-radius: var(--rt-input-radius);--rt-input-number-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-input-number-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-input-number: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-input-number--borderless{border-color:transparent}.rt-input-number--appearance--fill{border-color:transparent;border-radius:var(--rt-input-number-fill-radius) var(--rt-input-number-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--appearance--fill:where([data-rt-radius]){border-radius:var(--rt-input-number-radius);border-bottom-color:transparent}.rt-input-number--appearance--pill{--rt-input-number-radius: var(--rt-radius-full);border-color:transparent;background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--invalid{border-color:var(--rt-input-color-border-error)}.rt-input-number--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-input-number--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-input-number--size--sm{min-height:var(--rt-input-height-sm)}.rt-input-number--size--lg{min-height:var(--rt-input-height-lg)}.rt-input-number--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-input-number__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-input-number__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-input-number__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none}.rt-input-number__field::placeholder{color:var(--rt-input-color-text-placeholder);opacity:1}.rt-input-number__field:disabled{cursor:not-allowed}.rt-input-number__icon-left,.rt-input-number__prefix,.rt-input-number__clear{flex-shrink:0}.rt-input-number__prefix{color:var(--rt-color-text-muted);-webkit-user-select:none;user-select:none}.rt-input-number[data-rt-radius=none]{--rt-input-number-radius: var(--rt-radius-none)}.rt-input-number[data-rt-radius=xs]{--rt-input-number-radius: var(--rt-radius-xs)}.rt-input-number[data-rt-radius=sm]{--rt-input-number-radius: var(--rt-radius-sm)}.rt-input-number[data-rt-radius=ms]{--rt-input-number-radius: var(--rt-radius-ms)}.rt-input-number[data-rt-radius=md]{--rt-input-number-radius: var(--rt-radius-md)}.rt-input-number[data-rt-radius=lg]{--rt-input-number-radius: var(--rt-radius-lg)}.rt-input-number[data-rt-radius=xl]{--rt-input-number-radius: var(--rt-radius-xl)}.rt-input-number[data-rt-radius=\"2xl\"]{--rt-input-number-radius: var(--rt-radius-2xl)}.rt-input-number[data-rt-radius=full]{--rt-input-number-radius: var(--rt-radius-full)}}\n"], dependencies: [{ kind: "component", type:
|
|
328
|
-
// standalone components / directives
|
|
329
|
-
RtIconButtonComponent, selector: "rt-icon-button", inputs: ["icon", "glyph", "ariaLabel", "variant", "iconColor", "iconFill", "size", "iconSize", "type", "tooltip", "tabIndex", "loading", "disabled", "active", "indicator"], outputs: ["clicked"] }, { kind: "component", type: RtIconComponent, selector: "rt-icon", inputs: ["name", "glyph", "glyphStrategy", "size", "color", "fill", "spin", "rotate"] }, { kind: "directive", type: BlockDirective, selector: "[rtBlock]", inputs: ["rtMod"] }, { kind: "directive", type: ElemDirective, selector: "[rtElem]", inputs: ["rtMod"] }, { kind: "directive", type: ModDirective, selector: "[rtMod]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
25
|
+
if (value === null) return "";
|
|
26
|
+
const precision = Math.min(20, Math.max(minFractionDigits, Math.min(maxFractionDigits, 20)));
|
|
27
|
+
return value.toLocaleString(locale, {
|
|
28
|
+
minimumFractionDigits: precision,
|
|
29
|
+
maximumFractionDigits: precision,
|
|
30
|
+
useGrouping: grouped
|
|
31
|
+
});
|
|
330
32
|
}
|
|
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
|
-
|
|
33
|
+
var RtInputNumberComponent = class RtInputNumberComponent extends RtFormControlBase {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.#locale = inject(LOCALE_ID);
|
|
37
|
+
this.#groupSep = 1e3.toLocaleString(this.#locale).replace(/\d/g, "") || "\xA0";
|
|
38
|
+
this.#decimalSepPattern = new RegExp(`[${[".", ","].filter((char) => char !== this.#groupSep).join("")}]`);
|
|
39
|
+
this.t = inject(RT_KIT_LABELS);
|
|
40
|
+
this.fieldEl = viewChild("fieldEl", ...ngDevMode ? [{ debugName: "fieldEl" }] : /* istanbul ignore next */ []);
|
|
41
|
+
this.displayValue = signal("", ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
|
|
42
|
+
this.hasValue = computed(() => this.displayValue() !== "" && this.value() !== null && this.value() !== 0, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
|
|
43
|
+
this.appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
|
|
44
|
+
this.displayText = computed(() => this.displayValue(), ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
|
|
45
|
+
this.iconLeft = input(null, ...ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []);
|
|
46
|
+
this.prefix = input(null, ...ngDevMode ? [{ debugName: "prefix" }] : /* istanbul ignore next */ []);
|
|
47
|
+
this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
48
|
+
this.min = input(null, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
49
|
+
this.max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
50
|
+
this.minFractionDigits = input(0, ...ngDevMode ? [{ debugName: "minFractionDigits" }] : /* istanbul ignore next */ []);
|
|
51
|
+
this.maxFractionDigits = input(2, ...ngDevMode ? [{ debugName: "maxFractionDigits" }] : /* istanbul ignore next */ []);
|
|
52
|
+
this.grouped = input(true, {
|
|
53
|
+
...ngDevMode ? { debugName: "grouped" } : /* istanbul ignore next */ {},
|
|
54
|
+
transform: booleanAttribute
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
#locale;
|
|
58
|
+
#groupSep;
|
|
59
|
+
#decimalSepPattern;
|
|
60
|
+
writeValue(value) {
|
|
61
|
+
super.writeValue(value);
|
|
62
|
+
this.displayValue.set(formatNumber(this.value(), this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped()));
|
|
63
|
+
}
|
|
64
|
+
getEmptyValue() {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
focusAfterClear() {
|
|
68
|
+
this.fieldEl()?.nativeElement.focus();
|
|
69
|
+
}
|
|
70
|
+
onHostMousedown(event) {
|
|
71
|
+
if (this.isDisabled()) return;
|
|
72
|
+
const field = this.fieldEl()?.nativeElement;
|
|
73
|
+
const target = event.target;
|
|
74
|
+
if (!field || target === field || target.closest("button, rt-icon-button")) return;
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
field.focus();
|
|
77
|
+
}
|
|
78
|
+
clearValue() {
|
|
79
|
+
this.value.set(0);
|
|
80
|
+
this.displayValue.set(formatNumber(0, this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped()));
|
|
81
|
+
}
|
|
82
|
+
onInput(event) {
|
|
83
|
+
const target = event.target;
|
|
84
|
+
const raw = target.value;
|
|
85
|
+
const caret = target.selectionStart ?? raw.length;
|
|
86
|
+
const formatted = this.#groupDisplay(raw);
|
|
87
|
+
const nextCaret = this.#restoreCaret(raw, caret, formatted);
|
|
88
|
+
target.value = formatted;
|
|
89
|
+
target.setSelectionRange(nextCaret, nextCaret);
|
|
90
|
+
this.displayValue.set(formatted);
|
|
91
|
+
const parsed = parseNumber(formatted, this.#groupSep);
|
|
92
|
+
if (parsed === null) {
|
|
93
|
+
if (raw.trim() === "") {
|
|
94
|
+
this.value.set(null);
|
|
95
|
+
this.emitChange(null);
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.value.set(parsed);
|
|
100
|
+
this.emitChange(parsed);
|
|
101
|
+
}
|
|
102
|
+
onBlur() {
|
|
103
|
+
const parsed = parseNumber(this.displayValue(), this.#groupSep);
|
|
104
|
+
if (parsed === null) {
|
|
105
|
+
this.value.set(null);
|
|
106
|
+
this.displayValue.set("");
|
|
107
|
+
this.emitChange(null);
|
|
108
|
+
this.markTouched();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const clamped = clamp(parsed, this.min(), this.max());
|
|
112
|
+
const formatted = formatNumber(clamped, this.minFractionDigits(), this.maxFractionDigits(), this.#locale, this.grouped());
|
|
113
|
+
const rounded = parseNumber(formatted, this.#groupSep) ?? clamped;
|
|
114
|
+
this.value.set(rounded);
|
|
115
|
+
this.displayValue.set(formatted);
|
|
116
|
+
this.emitChange(rounded);
|
|
117
|
+
this.markTouched();
|
|
118
|
+
}
|
|
119
|
+
#groupDisplay(raw) {
|
|
120
|
+
const negative = raw.trimStart().startsWith("-");
|
|
121
|
+
let sep = "";
|
|
122
|
+
let fracDigits = "";
|
|
123
|
+
let intDigits;
|
|
124
|
+
const sepIndex = raw.search(this.#decimalSepPattern);
|
|
125
|
+
if (sepIndex >= 0) {
|
|
126
|
+
sep = raw.charAt(sepIndex);
|
|
127
|
+
intDigits = raw.slice(0, sepIndex).replace(/\D/g, "");
|
|
128
|
+
fracDigits = raw.slice(sepIndex + 1).replace(/\D/g, "");
|
|
129
|
+
} else intDigits = raw.replace(/\D/g, "");
|
|
130
|
+
intDigits = intDigits.replace(/^0+(?=\d)/, "");
|
|
131
|
+
let intPart;
|
|
132
|
+
if (intDigits === "") intPart = sep === "" ? "" : "0";
|
|
133
|
+
else intPart = this.grouped() ? this.#groupInteger(intDigits) : intDigits;
|
|
134
|
+
let out = negative ? `-${intPart}` : intPart;
|
|
135
|
+
if (sep !== "") out += sep + fracDigits;
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
#groupInteger(digits) {
|
|
139
|
+
const length = digits.length;
|
|
140
|
+
let out = "";
|
|
141
|
+
for (let i = 0; i < length; i++) {
|
|
142
|
+
if (i > 0 && (length - i) % 3 === 0) out += this.#groupSep;
|
|
143
|
+
out += digits.charAt(i);
|
|
144
|
+
}
|
|
145
|
+
return out;
|
|
146
|
+
}
|
|
147
|
+
#restoreCaret(raw, caret, formatted) {
|
|
148
|
+
const isAnchor = (ch) => /[\d.,]/.test(ch);
|
|
149
|
+
let need = 0;
|
|
150
|
+
for (let i = 0; i < caret && i < raw.length; i++) if (isAnchor(raw.charAt(i))) need++;
|
|
151
|
+
if (need === 0) return formatted.startsWith("-") ? 1 : 0;
|
|
152
|
+
let seen = 0;
|
|
153
|
+
let pos = 0;
|
|
154
|
+
while (pos < formatted.length) {
|
|
155
|
+
if (isAnchor(formatted.charAt(pos))) {
|
|
156
|
+
seen++;
|
|
157
|
+
if (seen === need) {
|
|
158
|
+
pos++;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
pos++;
|
|
163
|
+
}
|
|
164
|
+
return pos;
|
|
165
|
+
}
|
|
166
|
+
static {
|
|
167
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
168
|
+
minVersion: "12.0.0",
|
|
169
|
+
version: "22.2.2",
|
|
170
|
+
ngImport: i0,
|
|
171
|
+
type: RtInputNumberComponent,
|
|
172
|
+
deps: null,
|
|
173
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
static {
|
|
177
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
178
|
+
minVersion: "17.0.0",
|
|
179
|
+
version: "22.2.2",
|
|
180
|
+
type: RtInputNumberComponent,
|
|
181
|
+
isStandalone: true,
|
|
182
|
+
selector: "rt-input-number",
|
|
183
|
+
inputs: {
|
|
184
|
+
appearance: {
|
|
185
|
+
classPropertyName: "appearance",
|
|
186
|
+
publicName: "appearance",
|
|
187
|
+
isSignal: true,
|
|
188
|
+
isRequired: false,
|
|
189
|
+
transformFunction: null
|
|
190
|
+
},
|
|
191
|
+
iconLeft: {
|
|
192
|
+
classPropertyName: "iconLeft",
|
|
193
|
+
publicName: "iconLeft",
|
|
194
|
+
isSignal: true,
|
|
195
|
+
isRequired: false,
|
|
196
|
+
transformFunction: null
|
|
197
|
+
},
|
|
198
|
+
prefix: {
|
|
199
|
+
classPropertyName: "prefix",
|
|
200
|
+
publicName: "prefix",
|
|
201
|
+
isSignal: true,
|
|
202
|
+
isRequired: false,
|
|
203
|
+
transformFunction: null
|
|
204
|
+
},
|
|
205
|
+
placeholder: {
|
|
206
|
+
classPropertyName: "placeholder",
|
|
207
|
+
publicName: "placeholder",
|
|
208
|
+
isSignal: true,
|
|
209
|
+
isRequired: false,
|
|
210
|
+
transformFunction: null
|
|
211
|
+
},
|
|
212
|
+
min: {
|
|
213
|
+
classPropertyName: "min",
|
|
214
|
+
publicName: "min",
|
|
215
|
+
isSignal: true,
|
|
216
|
+
isRequired: false,
|
|
217
|
+
transformFunction: null
|
|
218
|
+
},
|
|
219
|
+
max: {
|
|
220
|
+
classPropertyName: "max",
|
|
221
|
+
publicName: "max",
|
|
222
|
+
isSignal: true,
|
|
223
|
+
isRequired: false,
|
|
224
|
+
transformFunction: null
|
|
225
|
+
},
|
|
226
|
+
minFractionDigits: {
|
|
227
|
+
classPropertyName: "minFractionDigits",
|
|
228
|
+
publicName: "minFractionDigits",
|
|
229
|
+
isSignal: true,
|
|
230
|
+
isRequired: false,
|
|
231
|
+
transformFunction: null
|
|
232
|
+
},
|
|
233
|
+
maxFractionDigits: {
|
|
234
|
+
classPropertyName: "maxFractionDigits",
|
|
235
|
+
publicName: "maxFractionDigits",
|
|
236
|
+
isSignal: true,
|
|
237
|
+
isRequired: false,
|
|
238
|
+
transformFunction: null
|
|
239
|
+
},
|
|
240
|
+
grouped: {
|
|
241
|
+
classPropertyName: "grouped",
|
|
242
|
+
publicName: "grouped",
|
|
243
|
+
isSignal: true,
|
|
244
|
+
isRequired: false,
|
|
245
|
+
transformFunction: null
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
host: {
|
|
249
|
+
listeners: { "mousedown": "onHostMousedown($event)" },
|
|
250
|
+
properties: {
|
|
251
|
+
"class.rt-input-number--disabled": "isDisabled()",
|
|
252
|
+
"class.rt-input-number--invalid": "isInvalid()",
|
|
253
|
+
"class.rt-input-number--readonly": "isReadonly()",
|
|
254
|
+
"class.rt-input-number--borderless": "!bordered()",
|
|
255
|
+
"class.rt-input-number--appearance--fill": "appearance() === 'fill'",
|
|
256
|
+
"class.rt-input-number--appearance--pill": "appearance() === 'pill'",
|
|
257
|
+
"class.rt-input-number--size--sm": "size() === 'sm'",
|
|
258
|
+
"class.rt-input-number--size--lg": "size() === 'lg'"
|
|
259
|
+
},
|
|
260
|
+
classAttribute: "rt-input-number"
|
|
261
|
+
},
|
|
262
|
+
providers: [{
|
|
263
|
+
provide: RtFormControlBase,
|
|
264
|
+
useExisting: forwardRef(() => RtInputNumberComponent)
|
|
265
|
+
}],
|
|
266
|
+
viewQueries: [{
|
|
267
|
+
propertyName: "fieldEl",
|
|
268
|
+
first: true,
|
|
269
|
+
predicate: ["fieldEl"],
|
|
270
|
+
descendants: true,
|
|
271
|
+
isSignal: true
|
|
272
|
+
}],
|
|
273
|
+
usesInheritance: true,
|
|
274
|
+
hostDirectives: [{
|
|
275
|
+
directive: i1.RtRadiusDirective,
|
|
276
|
+
inputs: ["radius", "radius"]
|
|
277
|
+
}],
|
|
278
|
+
ngImport: i0,
|
|
279
|
+
template: "<ng-container rtBlock=\"rt-input-number\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"input-number-readonly\" [rtMod]=\"{ empty: !displayText() }\">\n @if (prefix() && displayText()) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\">{{ prefix() }}</span>\n }\n {{ displayText() || '—' }}\n </span>\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n @if (prefix(); as pfx) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\" aria-hidden=\"true\">{{ pfx }}</span>\n }\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"input-number-control\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [value]=\"displayValue()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"input-number-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 }\n</ng-container>\n",
|
|
280
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-input-number{--rt-input-number-radius: var(--rt-input-radius);--rt-input-number-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-input-number-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-input-number: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-input-number--borderless{border-color:transparent}.rt-input-number--appearance--fill{border-color:transparent;border-radius:var(--rt-input-number-fill-radius) var(--rt-input-number-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--appearance--fill:where([data-rt-radius]){border-radius:var(--rt-input-number-radius);border-bottom-color:transparent}.rt-input-number--appearance--pill{--rt-input-number-radius: var(--rt-radius-full);border-color:transparent;background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--invalid{border-color:var(--rt-input-color-border-error)}.rt-input-number--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-input-number--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-input-number--size--sm{min-height:var(--rt-input-height-sm)}.rt-input-number--size--lg{min-height:var(--rt-input-height-lg)}.rt-input-number--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-input-number__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-input-number__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-input-number__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none}.rt-input-number__field::placeholder{color:var(--rt-input-color-text-placeholder);opacity:1}.rt-input-number__field:disabled{cursor:not-allowed}.rt-input-number__icon-left,.rt-input-number__prefix,.rt-input-number__clear{flex-shrink:0}.rt-input-number__prefix{color:var(--rt-color-text-muted);-webkit-user-select:none;user-select:none}.rt-input-number[data-rt-radius=none]{--rt-input-number-radius: var(--rt-radius-none)}.rt-input-number[data-rt-radius=xs]{--rt-input-number-radius: var(--rt-radius-xs)}.rt-input-number[data-rt-radius=sm]{--rt-input-number-radius: var(--rt-radius-sm)}.rt-input-number[data-rt-radius=ms]{--rt-input-number-radius: var(--rt-radius-ms)}.rt-input-number[data-rt-radius=md]{--rt-input-number-radius: var(--rt-radius-md)}.rt-input-number[data-rt-radius=lg]{--rt-input-number-radius: var(--rt-radius-lg)}.rt-input-number[data-rt-radius=xl]{--rt-input-number-radius: var(--rt-radius-xl)}.rt-input-number[data-rt-radius=\"2xl\"]{--rt-input-number-radius: var(--rt-radius-2xl)}.rt-input-number[data-rt-radius=full]{--rt-input-number-radius: var(--rt-radius-full)}}\n"],
|
|
281
|
+
dependencies: [
|
|
282
|
+
{
|
|
283
|
+
kind: "component",
|
|
284
|
+
type: RtIconButtonComponent,
|
|
285
|
+
selector: "rt-icon-button",
|
|
286
|
+
inputs: [
|
|
287
|
+
"icon",
|
|
288
|
+
"glyph",
|
|
289
|
+
"ariaLabel",
|
|
290
|
+
"variant",
|
|
291
|
+
"iconColor",
|
|
292
|
+
"iconFill",
|
|
293
|
+
"size",
|
|
294
|
+
"iconSize",
|
|
295
|
+
"type",
|
|
296
|
+
"tooltip",
|
|
297
|
+
"tooltipHideOnClick",
|
|
298
|
+
"tabIndex",
|
|
299
|
+
"loading",
|
|
300
|
+
"disabled",
|
|
301
|
+
"active",
|
|
302
|
+
"expanded",
|
|
303
|
+
"indicator"
|
|
304
|
+
],
|
|
305
|
+
outputs: ["clicked"]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
kind: "component",
|
|
309
|
+
type: RtIconComponent,
|
|
310
|
+
selector: "rt-icon",
|
|
311
|
+
inputs: [
|
|
312
|
+
"name",
|
|
313
|
+
"glyph",
|
|
314
|
+
"glyphStrategy",
|
|
315
|
+
"size",
|
|
316
|
+
"color",
|
|
317
|
+
"fill",
|
|
318
|
+
"spin",
|
|
319
|
+
"rotate"
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
kind: "directive",
|
|
324
|
+
type: BlockDirective,
|
|
325
|
+
selector: "[rtBlock]",
|
|
326
|
+
inputs: ["rtMod"]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "directive",
|
|
330
|
+
type: ElemDirective,
|
|
331
|
+
selector: "[rtElem]",
|
|
332
|
+
inputs: ["rtMod"]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
kind: "directive",
|
|
336
|
+
type: ModDirective,
|
|
337
|
+
selector: "[rtMod]"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
341
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
346
|
+
minVersion: "12.0.0",
|
|
347
|
+
version: "22.2.2",
|
|
348
|
+
ngImport: i0,
|
|
349
|
+
type: RtInputNumberComponent,
|
|
350
|
+
decorators: [{
|
|
351
|
+
type: Component,
|
|
352
|
+
args: [{
|
|
353
|
+
selector: "rt-input-number",
|
|
354
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
355
|
+
encapsulation: ViewEncapsulation.None,
|
|
356
|
+
imports: [
|
|
357
|
+
RtIconButtonComponent,
|
|
358
|
+
RtIconComponent,
|
|
359
|
+
BlockDirective,
|
|
360
|
+
ElemDirective,
|
|
361
|
+
ModDirective
|
|
362
|
+
],
|
|
363
|
+
providers: [{
|
|
364
|
+
provide: RtFormControlBase,
|
|
365
|
+
useExisting: forwardRef(() => RtInputNumberComponent)
|
|
366
|
+
}],
|
|
367
|
+
hostDirectives: [{
|
|
368
|
+
directive: RtRadiusDirective,
|
|
369
|
+
inputs: ["radius"]
|
|
370
|
+
}],
|
|
371
|
+
host: {
|
|
372
|
+
class: BEM_BLOCK,
|
|
373
|
+
"[class.rt-input-number--disabled]": "isDisabled()",
|
|
374
|
+
"[class.rt-input-number--invalid]": "isInvalid()",
|
|
375
|
+
"[class.rt-input-number--readonly]": "isReadonly()",
|
|
376
|
+
"[class.rt-input-number--borderless]": "!bordered()",
|
|
377
|
+
"[class.rt-input-number--appearance--fill]": "appearance() === 'fill'",
|
|
378
|
+
"[class.rt-input-number--appearance--pill]": "appearance() === 'pill'",
|
|
379
|
+
"[class.rt-input-number--size--sm]": "size() === 'sm'",
|
|
380
|
+
"[class.rt-input-number--size--lg]": "size() === 'lg'",
|
|
381
|
+
"(mousedown)": "onHostMousedown($event)"
|
|
382
|
+
},
|
|
383
|
+
template: "<ng-container rtBlock=\"rt-input-number\">\n @if (isReadonly()) {\n <span rtElem=\"readonly\" qa-dataid=\"input-number-readonly\" [rtMod]=\"{ empty: !displayText() }\">\n @if (prefix() && displayText()) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\">{{ prefix() }}</span>\n }\n {{ displayText() || '—' }}\n </span>\n } @else {\n @if (iconLeft(); as left) {\n <rt-icon rtElem=\"icon-left\" size=\"sm\" color=\"muted\" [name]=\"left\" />\n }\n @if (prefix(); as pfx) {\n <span rtElem=\"prefix\" qa-dataid=\"input-number-prefix\" aria-hidden=\"true\">{{ pfx }}</span>\n }\n <input\n #fieldEl\n rtElem=\"field\"\n qa-dataid=\"input-number-control\"\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveControlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [value]=\"displayValue()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\" />\n @if (showClearButton()) {\n <rt-icon-button\n rtElem=\"clear\"\n qa-dataid=\"input-number-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 }\n</ng-container>\n",
|
|
384
|
+
styles: ["@charset \"UTF-8\";@layer rt-kit.components{.rt-input-number{--rt-input-number-radius: var(--rt-input-radius);--rt-input-number-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-input-number-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-input-number: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-input-number--borderless{border-color:transparent}.rt-input-number--appearance--fill{border-color:transparent;border-radius:var(--rt-input-number-fill-radius) var(--rt-input-number-fill-radius) 0 0;border-bottom-color:var(--rt-color-field-fill-underline);background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--appearance--fill:where([data-rt-radius]){border-radius:var(--rt-input-number-radius);border-bottom-color:transparent}.rt-input-number--appearance--pill{--rt-input-number-radius: var(--rt-radius-full);border-color:transparent;background-color:var(--rt-color-bg-surface-subtle-2)}.rt-input-number--invalid{border-color:var(--rt-input-color-border-error)}.rt-input-number--invalid:focus-within{box-shadow:var(--rt-input-focus-shadow-error)}.rt-input-number--disabled{cursor:not-allowed;opacity:var(--rt-input-disabled-opacity)}.rt-input-number--size--sm{min-height:var(--rt-input-height-sm)}.rt-input-number--size--lg{min-height:var(--rt-input-height-lg)}.rt-input-number--readonly{padding-right:0;padding-left:0;border-color:transparent;background-color:transparent;cursor:default}.rt-input-number__readonly{color:var(--rt-field-value-color);font-size:var(--rt-field-value-font-size)}.rt-input-number__readonly--empty{color:var(--rt-field-value-empty-color)}.rt-input-number__field{min-width:0;flex:1 1 auto;padding:0;border:none;background:transparent;color:inherit;font:inherit;outline:none}.rt-input-number__field::placeholder{color:var(--rt-input-color-text-placeholder);opacity:1}.rt-input-number__field:disabled{cursor:not-allowed}.rt-input-number__icon-left,.rt-input-number__prefix,.rt-input-number__clear{flex-shrink:0}.rt-input-number__prefix{color:var(--rt-color-text-muted);-webkit-user-select:none;user-select:none}.rt-input-number[data-rt-radius=none]{--rt-input-number-radius: var(--rt-radius-none)}.rt-input-number[data-rt-radius=xs]{--rt-input-number-radius: var(--rt-radius-xs)}.rt-input-number[data-rt-radius=sm]{--rt-input-number-radius: var(--rt-radius-sm)}.rt-input-number[data-rt-radius=ms]{--rt-input-number-radius: var(--rt-radius-ms)}.rt-input-number[data-rt-radius=md]{--rt-input-number-radius: var(--rt-radius-md)}.rt-input-number[data-rt-radius=lg]{--rt-input-number-radius: var(--rt-radius-lg)}.rt-input-number[data-rt-radius=xl]{--rt-input-number-radius: var(--rt-radius-xl)}.rt-input-number[data-rt-radius=\"2xl\"]{--rt-input-number-radius: var(--rt-radius-2xl)}.rt-input-number[data-rt-radius=full]{--rt-input-number-radius: var(--rt-radius-full)}}\n"]
|
|
385
|
+
}]
|
|
386
|
+
}],
|
|
387
|
+
propDecorators: {
|
|
388
|
+
fieldEl: [{
|
|
389
|
+
type: i0.ViewChild,
|
|
390
|
+
args: ["fieldEl", { isSignal: true }]
|
|
391
|
+
}],
|
|
392
|
+
appearance: [{
|
|
393
|
+
type: i0.Input,
|
|
394
|
+
args: [{
|
|
395
|
+
isSignal: true,
|
|
396
|
+
alias: "appearance",
|
|
397
|
+
required: false
|
|
398
|
+
}]
|
|
399
|
+
}],
|
|
400
|
+
iconLeft: [{
|
|
401
|
+
type: i0.Input,
|
|
402
|
+
args: [{
|
|
403
|
+
isSignal: true,
|
|
404
|
+
alias: "iconLeft",
|
|
405
|
+
required: false
|
|
406
|
+
}]
|
|
407
|
+
}],
|
|
408
|
+
prefix: [{
|
|
409
|
+
type: i0.Input,
|
|
410
|
+
args: [{
|
|
411
|
+
isSignal: true,
|
|
412
|
+
alias: "prefix",
|
|
413
|
+
required: false
|
|
414
|
+
}]
|
|
415
|
+
}],
|
|
416
|
+
placeholder: [{
|
|
417
|
+
type: i0.Input,
|
|
418
|
+
args: [{
|
|
419
|
+
isSignal: true,
|
|
420
|
+
alias: "placeholder",
|
|
421
|
+
required: false
|
|
422
|
+
}]
|
|
423
|
+
}],
|
|
424
|
+
min: [{
|
|
425
|
+
type: i0.Input,
|
|
426
|
+
args: [{
|
|
427
|
+
isSignal: true,
|
|
428
|
+
alias: "min",
|
|
429
|
+
required: false
|
|
430
|
+
}]
|
|
431
|
+
}],
|
|
432
|
+
max: [{
|
|
433
|
+
type: i0.Input,
|
|
434
|
+
args: [{
|
|
435
|
+
isSignal: true,
|
|
436
|
+
alias: "max",
|
|
437
|
+
required: false
|
|
438
|
+
}]
|
|
439
|
+
}],
|
|
440
|
+
minFractionDigits: [{
|
|
441
|
+
type: i0.Input,
|
|
442
|
+
args: [{
|
|
443
|
+
isSignal: true,
|
|
444
|
+
alias: "minFractionDigits",
|
|
445
|
+
required: false
|
|
446
|
+
}]
|
|
447
|
+
}],
|
|
448
|
+
maxFractionDigits: [{
|
|
449
|
+
type: i0.Input,
|
|
450
|
+
args: [{
|
|
451
|
+
isSignal: true,
|
|
452
|
+
alias: "maxFractionDigits",
|
|
453
|
+
required: false
|
|
454
|
+
}]
|
|
455
|
+
}],
|
|
456
|
+
grouped: [{
|
|
457
|
+
type: i0.Input,
|
|
458
|
+
args: [{
|
|
459
|
+
isSignal: true,
|
|
460
|
+
alias: "grouped",
|
|
461
|
+
required: false
|
|
462
|
+
}]
|
|
463
|
+
}]
|
|
464
|
+
}
|
|
465
|
+
});
|
|
361
466
|
export { RtInputNumberComponent };
|
|
362
|
-
|
|
467
|
+
|
|
468
|
+
//# sourceMappingURL=rt-tools-ui-kit-v2-input-number.mjs.map
|