@koobiq/components 20.4.1 → 21.0.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/accordion/accordion-trigger.scss +3 -10
- package/accordion/accordion.scss +4 -6
- package/actions-panel/actions-panel-container.scss +45 -1
- package/alert/alert.component.scss +3 -2
- package/app-switcher/_app-switcher-theme.scss +0 -4
- package/app-switcher/app-switcher-dropdown-app.scss +3 -2
- package/app-switcher/app-switcher-dropdown-site.scss +2 -1
- package/app-switcher/{kbq-app-switcher-list-item.scss → app-switcher-list-item.scss} +18 -4
- package/app-switcher/app-switcher-tokens.scss +15 -0
- package/app-switcher/app-switcher.scss +14 -4
- package/autocomplete/autocomplete.scss +7 -6
- package/badge/badge.component.scss +5 -8
- package/breadcrumbs/breadcrumbs.scss +25 -10
- package/button/_button-base.scss +30 -7
- package/button/_button-theme.scss +16 -0
- package/button/button-group.scss +7 -0
- package/button/button-tokens.scss +0 -2
- package/button/button.scss +34 -2
- package/button-toggle/_button-toggle-theme.scss +7 -2
- package/button-toggle/button-toggle.scss +65 -15
- package/checkbox/_checkbox-theme.scss +4 -3
- package/checkbox/checkbox.scss +3 -6
- package/clamped-text/clamped-text.scss +6 -2
- package/code-block/code-block-tokens.scss +0 -224
- package/code-block/code-block.scss +20 -9
- package/content-panel/content-panel-aside.scss +3 -2
- package/content-panel/content-panel-container.scss +37 -0
- package/content-panel/content-panel.scss +4 -3
- package/core/highlight/_highlight-theme.scss +3 -1
- package/core/option/action-container.scss +2 -2
- package/core/option/action.scss +2 -1
- package/core/option/option.scss +2 -1
- package/core/pop-up/_pop-up.scss +0 -37
- package/core/selection/pseudo-checkbox/pseudo-checkbox.scss +5 -10
- package/core/styles/_core.scss +3 -0
- package/core/styles/_koobiq-theme.scss +5 -6
- package/core/styles/common/_animation.scss +44 -16
- package/core/styles/common/_groups-mixins.scss +21 -19
- package/core/styles/common/_groups.scss +4 -32
- package/core/styles/common/_index.scss +0 -2
- package/core/styles/common/_link.scss +117 -0
- package/core/styles/common/_list.scss +0 -26
- package/core/styles/common/_overlay.scss +8 -10
- package/core/styles/common/_rtl.scss +0 -14
- package/core/styles/common/_select.scss +33 -15
- package/core/styles/common/_squircle.scss +63 -0
- package/core/styles/common/_tokens.scss +0 -11
- package/core/styles/common/_vendor-prefixes.scss +0 -20
- package/core/styles/functions/_timing.scss +0 -22
- package/core/styles/theming/_scrollbar-theme.scss +6 -1
- package/core/styles/theming/_theming.scss +13 -65
- package/core/styles/typography/_index.scss +0 -1
- package/core/styles/typography/_typography.scss +0 -143
- package/core/styles/visual/_body.scss +1 -6
- package/core/styles/visual/_layout.scss +0 -12
- package/datepicker/calendar-body.scss +3 -1
- package/datepicker/calendar-header.scss +0 -1
- package/datepicker/datepicker-content.scss +33 -1
- package/datepicker/datepicker-toggle.scss +0 -38
- package/dl/dl-tokens.scss +10 -0
- package/dl/dl.scss +113 -13
- package/dropdown/_dropdown-theme.scss +4 -16
- package/dropdown/dropdown-item.scss +4 -10
- package/dropdown/dropdown.scss +2 -1
- package/empty-state/_empty-state-theme.scss +10 -4
- package/empty-state/empty-state-tokens.scss +4 -4
- package/empty-state/empty-state.scss +4 -0
- package/fesm2022/koobiq-components-accordion.mjs +347 -229
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +302 -187
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +39 -39
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +677 -367
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +620 -253
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +46 -48
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +221 -169
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +565 -196
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +332 -116
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +172 -132
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +165 -158
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +755 -601
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-content-panel.mjs +260 -143
- package/fesm2022/koobiq-components-content-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +4342 -1595
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +1713 -1606
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs +73 -36
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dl.mjs +447 -89
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +703 -599
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-dynamic-translation.mjs +20 -20
- package/fesm2022/koobiq-components-dynamic-translation.mjs.map +1 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs +46 -31
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-empty-state.mjs +116 -60
- package/fesm2022/koobiq-components-empty-state.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +550 -290
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +2810 -2538
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-flag.mjs +79 -24
- package/fesm2022/koobiq-components-flag.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +389 -525
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +366 -136
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +429 -212
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +601 -459
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link-deprecated.mjs +196 -0
- package/fesm2022/koobiq-components-link-deprecated.mjs.map +1 -0
- package/fesm2022/koobiq-components-link.mjs +328 -125
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +583 -433
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +167 -68
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +55 -78
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +853 -475
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +895 -556
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +680 -310
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-overflow-items.mjs +46 -64
- package/fesm2022/koobiq-components-overflow-items.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +684 -285
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +87 -33
- package/fesm2022/koobiq-components-progress-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs +52 -43
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +450 -231
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-resizer.mjs +127 -21
- package/fesm2022/koobiq-components-resizer.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar-deprecated.mjs +299 -0
- package/fesm2022/koobiq-components-scrollbar-deprecated.mjs.map +1 -0
- package/fesm2022/koobiq-components-scrollbar.mjs +745 -222
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +288 -126
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +883 -693
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +207 -88
- package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +689 -296
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-skeleton.mjs +815 -41
- package/fesm2022/koobiq-components-skeleton.mjs.map +1 -1
- package/fesm2022/koobiq-components-split-button.mjs +109 -88
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter-deprecated.mjs +591 -0
- package/fesm2022/koobiq-components-splitter-deprecated.mjs.map +1 -0
- package/fesm2022/koobiq-components-splitter.mjs +890 -501
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-table.mjs +63 -49
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +1062 -603
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +886 -733
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +213 -185
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +299 -147
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +233 -245
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +344 -142
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +229 -145
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +486 -165
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +177 -130
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +657 -214
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-top-bar.mjs +61 -32
- package/fesm2022/koobiq-components-top-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +719 -488
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +1506 -558
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/fesm2022/koobiq-components-username.mjs +290 -135
- package/fesm2022/koobiq-components-username.mjs.map +1 -1
- package/file-upload/dropzone.scss +31 -3
- package/file-upload/file-upload-tokens.scss +2 -22
- package/file-upload/file-upload.scss +6 -0
- package/file-upload/multiple-file-upload.component.scss +14 -12
- package/file-upload/single-file-upload.component.scss +3 -2
- package/filter-bar/filters.scss +7 -0
- package/filter-bar/pipes/base-pipe.scss +3 -3
- package/filter-bar/pipes/pipe-date.scss +8 -1
- package/flag/flag-tokens.scss +22 -0
- package/flag/flag.scss +34 -21
- package/form-field/{_fiedset-theme.scss → _fieldset-theme.scss} +1 -5
- package/form-field/_form-field-theme.scss +4 -9
- package/form-field/cleaner.scss +3 -1
- package/form-field/fieldset.scss +3 -4
- package/form-field/form-field.scss +26 -21
- package/form-field/password-toggle.scss +3 -1
- package/icon/_icon-button-theme.scss +7 -0
- package/icon/_icon-theme.scss +10 -7
- package/icon/icon-button.scss +0 -2
- package/icon/icon-tokens.scss +12 -9
- package/inline-edit/inline-edit.scss +40 -54
- package/input/input.scss +4 -0
- package/link/{_link-theme.scss → deprecated/_link-theme.scss} +11 -6
- package/link/deprecated/link-tokens.scss +27 -0
- package/link/link-tokens.scss +6 -25
- package/link/link.scss +137 -0
- package/list/list.scss +3 -2
- package/loader-overlay/_loader-overlay-theme.scss +19 -10
- package/loader-overlay/loader-overlay-tokens.scss +0 -2
- package/loader-overlay/loader-overlay.scss +7 -1
- package/markdown/_markdown-theme.scss +16 -0
- package/markdown/markdown-tokens.scss +5 -0
- package/markdown/markdown.scss +2 -1
- package/modal/_modal-animation.scss +23 -14
- package/modal/modal-tokens.scss +2 -1
- package/modal/modal.scss +35 -31
- package/navbar/_navbar-item_horizontal.scss +8 -6
- package/navbar/_navbar-item_vertical.scss +18 -6
- package/navbar/_navbar-theme.scss +9 -1
- package/navbar/navbar-brand.scss +8 -6
- package/navbar/navbar-divider.scss +1 -1
- package/navbar/navbar-item.scss +8 -9
- package/navbar/navbar-toggle.scss +3 -3
- package/navbar/navbar-tokens.scss +14 -0
- package/navbar/navbar.scss +1 -2
- package/navbar/vertical-navbar.scss +2 -2
- package/notification-center/_notification-center-theme.scss +11 -6
- package/notification-center/notification-center-tokens.scss +33 -0
- package/notification-center/notification-center.scss +58 -20
- package/notification-center/notification-item.scss +15 -6
- package/package.json +112 -81
- package/popover/popover-tokens.scss +0 -2
- package/popover/popover.scss +41 -19
- package/prebuilt-themes/theme.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +20 -3
- package/progress-bar/progress-bar-tokens.scss +3 -0
- package/progress-bar/progress-bar.scss +36 -8
- package/progress-spinner/progress-spinner.scss +4 -3
- package/radio/_radio-theme.scss +21 -4
- package/radio/radio-tokens.scss +7 -3
- package/radio/radio.scss +55 -8
- package/schematics/collection.json +399 -7
- package/schematics/migrations/accordion-state-saving-default/README.md +60 -0
- package/schematics/migrations/accordion-state-saving-default/data.js +75 -0
- package/schematics/migrations/accordion-state-saving-default/index.js +60 -0
- package/schematics/migrations/accordion-state-saving-default/schema.json +15 -0
- package/schematics/migrations/actions-panel-overlay-container/README.md +35 -0
- package/schematics/migrations/actions-panel-overlay-container/data.js +47 -0
- package/schematics/migrations/actions-panel-overlay-container/index.js +54 -0
- package/schematics/migrations/actions-panel-overlay-container/schema.json +15 -0
- package/schematics/migrations/alert-signals/README.md +13 -7
- package/schematics/migrations/alert-signals/data.js +3 -0
- package/schematics/migrations/alert-signals/index.js +70 -203
- package/schematics/migrations/angular-animations-removal/README.md +46 -0
- package/schematics/migrations/angular-animations-removal/data.js +150 -0
- package/schematics/migrations/angular-animations-removal/index.js +20 -0
- package/schematics/migrations/angular-animations-removal/schema.json +15 -0
- package/schematics/migrations/app-switcher-signals/README.md +88 -0
- package/schematics/migrations/app-switcher-signals/data.js +136 -0
- package/schematics/migrations/app-switcher-signals/index.js +365 -0
- package/schematics/migrations/app-switcher-signals/schema.json +20 -0
- package/schematics/migrations/autocomplete-panel-width-auto/README.md +2 -2
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +1 -1
- package/schematics/migrations/autocomplete-signals/README.md +92 -0
- package/schematics/migrations/autocomplete-signals/data.js +149 -0
- package/schematics/migrations/autocomplete-signals/index.js +706 -0
- package/schematics/migrations/autocomplete-signals/schema.json +20 -0
- package/schematics/migrations/badge-signals/README.md +77 -0
- package/schematics/migrations/badge-signals/data.js +109 -0
- package/schematics/migrations/badge-signals/index.js +693 -0
- package/schematics/migrations/badge-signals/schema.json +20 -0
- package/schematics/migrations/button-state-and-styles/README.md +129 -0
- package/schematics/migrations/button-state-and-styles/data.js +136 -0
- package/schematics/migrations/button-state-and-styles/index.js +220 -0
- package/schematics/migrations/button-state-and-styles/schema.json +20 -0
- package/schematics/migrations/button-supported-colors/README.md +73 -0
- package/schematics/migrations/button-supported-colors/data.js +106 -0
- package/schematics/migrations/button-supported-colors/index.js +260 -0
- package/schematics/migrations/button-supported-colors/schema.json +20 -0
- package/schematics/migrations/button-toggle-signals-and-aria/README.md +137 -0
- package/schematics/migrations/button-toggle-signals-and-aria/data.js +200 -0
- package/schematics/migrations/button-toggle-signals-and-aria/index.js +496 -0
- package/schematics/migrations/button-toggle-signals-and-aria/schema.json +20 -0
- package/schematics/migrations/button-truncation/README.md +110 -0
- package/schematics/migrations/button-truncation/data.js +88 -0
- package/schematics/migrations/button-truncation/index.js +269 -0
- package/schematics/migrations/button-truncation/schema.json +20 -0
- package/schematics/migrations/checkbox-signals/README.md +76 -0
- package/schematics/migrations/checkbox-signals/data.js +114 -0
- package/schematics/migrations/checkbox-signals/index.js +634 -0
- package/schematics/migrations/checkbox-signals/schema.json +20 -0
- package/schematics/migrations/clamped-text-disclosure/README.md +62 -0
- package/schematics/migrations/clamped-text-disclosure/data.js +101 -0
- package/schematics/migrations/clamped-text-disclosure/index.js +59 -0
- package/schematics/migrations/clamped-text-disclosure/schema.json +15 -0
- package/schematics/migrations/code-block-signals/README.md +84 -0
- package/schematics/migrations/code-block-signals/data.js +121 -0
- package/schematics/migrations/code-block-signals/index.js +700 -0
- package/schematics/migrations/code-block-signals/schema.json +20 -0
- package/schematics/migrations/color-signals/README.md +46 -0
- package/schematics/migrations/color-signals/data.js +131 -0
- package/schematics/migrations/color-signals/index.js +19 -0
- package/schematics/migrations/color-signals/schema.json +20 -0
- package/schematics/migrations/core-mixins-removal/README.md +20 -0
- package/schematics/migrations/core-mixins-removal/data.js +27 -0
- package/schematics/migrations/core-mixins-removal/index.js +17 -0
- package/schematics/migrations/core-mixins-removal/schema.json +15 -0
- package/schematics/migrations/css-selectors/README.md +2 -2
- package/schematics/migrations/css-selectors/index.js +1 -1
- package/schematics/migrations/datepicker-signals/README.md +24 -0
- package/schematics/migrations/datepicker-signals/data.js +49 -0
- package/schematics/migrations/datepicker-signals/index.js +17 -0
- package/schematics/migrations/datepicker-signals/schema.json +15 -0
- package/schematics/migrations/deprecated-icons/README.md +2 -2
- package/schematics/migrations/deprecated-icons/index.js +1 -1
- package/schematics/migrations/design-tokens-v4/README.md +75 -0
- package/schematics/migrations/design-tokens-v4/index.js +59 -0
- package/schematics/migrations/design-tokens-v4/schema.json +15 -0
- package/schematics/migrations/divider-signals-and-aria/README.md +47 -0
- package/schematics/migrations/divider-signals-and-aria/data.js +62 -0
- package/schematics/migrations/divider-signals-and-aria/index.js +211 -0
- package/schematics/migrations/divider-signals-and-aria/schema.json +15 -0
- package/schematics/migrations/dl-attribute-coercion/README.md +59 -0
- package/schematics/migrations/dl-attribute-coercion/data.js +85 -0
- package/schematics/migrations/dl-attribute-coercion/index.js +161 -0
- package/schematics/migrations/dl-attribute-coercion/schema.json +15 -0
- package/schematics/migrations/dl-standalone-names/README.md +49 -0
- package/schematics/migrations/dl-standalone-names/data.js +44 -0
- package/schematics/migrations/dl-standalone-names/index.js +321 -0
- package/schematics/migrations/dl-standalone-names/schema.json +20 -0
- package/schematics/migrations/dropdown-demote-overlay/README.md +137 -0
- package/schematics/migrations/dropdown-demote-overlay/data.js +84 -0
- package/schematics/migrations/dropdown-demote-overlay/index.js +288 -0
- package/schematics/migrations/dropdown-demote-overlay/schema.json +20 -0
- package/schematics/migrations/dropdown-signals/README.md +83 -0
- package/schematics/migrations/dropdown-signals/data.js +152 -0
- package/schematics/migrations/dropdown-signals/index.js +19 -0
- package/schematics/migrations/dropdown-signals/schema.json +20 -0
- package/schematics/migrations/empty-state-error-color/README.md +84 -0
- package/schematics/migrations/empty-state-error-color/data.js +85 -0
- package/schematics/migrations/empty-state-error-color/index.js +71 -0
- package/schematics/migrations/empty-state-error-color/schema.json +15 -0
- package/schematics/migrations/empty-state-size-attr/README.md +2 -2
- package/schematics/migrations/empty-state-size-attr/index.js +1 -1
- package/schematics/migrations/file-upload-cva-and-primitives/README.md +70 -0
- package/schematics/migrations/file-upload-cva-and-primitives/data.js +97 -0
- package/schematics/migrations/file-upload-cva-and-primitives/index.js +60 -0
- package/schematics/migrations/file-upload-cva-and-primitives/schema.json +15 -0
- package/schematics/migrations/file-upload-deprecated-outputs/README.md +90 -0
- package/schematics/migrations/file-upload-deprecated-outputs/data.js +20 -0
- package/schematics/migrations/file-upload-deprecated-outputs/index.js +70 -0
- package/schematics/migrations/file-upload-deprecated-outputs/schema.json +20 -0
- package/schematics/migrations/filter-bar-rename-action/README.md +183 -0
- package/schematics/migrations/filter-bar-rename-action/data.js +151 -0
- package/schematics/migrations/filter-bar-rename-action/index.js +177 -0
- package/schematics/migrations/filter-bar-rename-action/schema.json +20 -0
- package/schematics/migrations/filter-bar-signals/README.md +27 -16
- package/schematics/migrations/filter-bar-signals/data.js +1 -2
- package/schematics/migrations/filter-bar-signals/index.js +100 -195
- package/schematics/migrations/filter-bar-state-saving-default/README.md +53 -0
- package/schematics/migrations/filter-bar-state-saving-default/data.js +87 -0
- package/schematics/migrations/filter-bar-state-saving-default/index.js +61 -0
- package/schematics/migrations/filter-bar-state-saving-default/schema.json +15 -0
- package/schematics/migrations/flag-inner-html/README.md +67 -0
- package/schematics/migrations/flag-inner-html/data.js +58 -0
- package/schematics/migrations/flag-inner-html/index.js +61 -0
- package/schematics/migrations/flag-inner-html/schema.json +15 -0
- package/schematics/migrations/form-field-signals/README.md +125 -0
- package/schematics/migrations/form-field-signals/data.js +288 -0
- package/schematics/migrations/form-field-signals/index.js +382 -0
- package/schematics/migrations/form-field-signals/schema.json +20 -0
- package/schematics/migrations/icon-semantics-and-api/README.md +65 -0
- package/schematics/migrations/icon-semantics-and-api/data.js +97 -0
- package/schematics/migrations/icon-semantics-and-api/index.js +64 -0
- package/schematics/migrations/icon-semantics-and-api/schema.json +15 -0
- package/schematics/migrations/icons-replacement/README.md +5 -5
- package/schematics/migrations/icons-replacement/index.js +1 -1
- package/schematics/migrations/inline-edit-a11y-and-types/README.md +82 -0
- package/schematics/migrations/inline-edit-a11y-and-types/data.js +117 -0
- package/schematics/migrations/inline-edit-a11y-and-types/index.js +97 -0
- package/schematics/migrations/inline-edit-a11y-and-types/schema.json +20 -0
- package/schematics/migrations/input-number-surface/README.md +140 -0
- package/schematics/migrations/input-number-surface/data.js +135 -0
- package/schematics/migrations/input-number-surface/index.js +292 -0
- package/schematics/migrations/input-number-surface/schema.json +20 -0
- package/schematics/migrations/input-signals/README.md +20 -0
- package/schematics/migrations/input-signals/data.js +30 -0
- package/schematics/migrations/input-signals/index.js +17 -0
- package/schematics/migrations/input-signals/schema.json +15 -0
- package/schematics/migrations/link-deprecated-path/README.md +144 -0
- package/schematics/migrations/link-deprecated-path/index.js +19 -0
- package/schematics/migrations/link-deprecated-path/schema.json +20 -0
- package/schematics/migrations/link-signals/README.md +71 -0
- package/schematics/migrations/link-signals/data.js +116 -0
- package/schematics/migrations/link-signals/index.js +415 -0
- package/schematics/migrations/link-signals/schema.json +20 -0
- package/schematics/migrations/list-signals/README.md +22 -0
- package/schematics/migrations/list-signals/data.js +35 -0
- package/schematics/migrations/list-signals/index.js +17 -0
- package/schematics/migrations/list-signals/schema.json +15 -0
- package/schematics/migrations/list-tree-multiple-input/README.md +105 -0
- package/schematics/migrations/list-tree-multiple-input/data.js +74 -0
- package/schematics/migrations/list-tree-multiple-input/index.js +221 -0
- package/schematics/migrations/list-tree-multiple-input/schema.json +20 -0
- package/schematics/migrations/loader-overlay-signals/README.md +62 -0
- package/schematics/migrations/loader-overlay-signals/data.js +101 -0
- package/schematics/migrations/loader-overlay-signals/index.js +697 -0
- package/schematics/migrations/loader-overlay-signals/schema.json +20 -0
- package/schematics/migrations/loader-overlay-size-attr/README.md +2 -2
- package/schematics/migrations/loader-overlay-size-attr/index.js +1 -1
- package/schematics/migrations/locale-configuration-providers/README.md +163 -0
- package/schematics/migrations/locale-configuration-providers/data.js +257 -0
- package/schematics/migrations/locale-configuration-providers/index.js +294 -0
- package/schematics/migrations/locale-configuration-providers/schema.json +20 -0
- package/schematics/migrations/mandatory-peer-dependencies/README.md +70 -0
- package/schematics/migrations/mandatory-peer-dependencies/index.js +42 -0
- package/schematics/migrations/mandatory-peer-dependencies/schema.json +15 -0
- package/schematics/migrations/markdown-signals/README.md +58 -0
- package/schematics/migrations/markdown-signals/data.js +79 -0
- package/schematics/migrations/markdown-signals/index.js +639 -0
- package/schematics/migrations/markdown-signals/schema.json +20 -0
- package/schematics/migrations/modal-dialog-semantics/README.md +106 -0
- package/schematics/migrations/modal-dialog-semantics/data.js +110 -0
- package/schematics/migrations/modal-dialog-semantics/index.js +58 -0
- package/schematics/migrations/modal-dialog-semantics/schema.json +15 -0
- package/schematics/migrations/modal-signals/README.md +88 -0
- package/schematics/migrations/modal-signals/data.js +132 -0
- package/schematics/migrations/modal-signals/index.js +19 -0
- package/schematics/migrations/modal-signals/schema.json +20 -0
- package/schematics/migrations/navbar-signals-and-aria/README.md +111 -0
- package/schematics/migrations/navbar-signals-and-aria/data.js +198 -0
- package/schematics/migrations/navbar-signals-and-aria/index.js +568 -0
- package/schematics/migrations/navbar-signals-and-aria/schema.json +20 -0
- package/schematics/migrations/new-icons-pack/README.md +10 -10
- package/schematics/migrations/new-icons-pack/index.js +1 -1
- package/schematics/migrations/notification-center-signals/README.md +67 -0
- package/schematics/migrations/notification-center-signals/data.js +66 -0
- package/schematics/migrations/notification-center-signals/index.js +61 -0
- package/schematics/migrations/notification-center-signals/schema.json +15 -0
- package/schematics/migrations/option-signals/README.md +37 -0
- package/schematics/migrations/option-signals/data.js +86 -0
- package/schematics/migrations/option-signals/index.js +19 -0
- package/schematics/migrations/option-signals/schema.json +20 -0
- package/schematics/migrations/popover-leave-delay/README.md +51 -0
- package/schematics/migrations/popover-leave-delay/data.js +61 -0
- package/schematics/migrations/popover-leave-delay/index.js +54 -0
- package/schematics/migrations/popover-leave-delay/schema.json +15 -0
- package/schematics/migrations/progress-bar-percentage-and-aria/README.md +54 -0
- package/schematics/migrations/progress-bar-percentage-and-aria/data.js +76 -0
- package/schematics/migrations/progress-bar-percentage-and-aria/index.js +58 -0
- package/schematics/migrations/progress-bar-percentage-and-aria/schema.json +15 -0
- package/schematics/migrations/progress-spinner-signals/README.md +72 -0
- package/schematics/migrations/progress-spinner-signals/data.js +83 -0
- package/schematics/migrations/progress-spinner-signals/index.js +694 -0
- package/schematics/migrations/progress-spinner-signals/schema.json +20 -0
- package/schematics/migrations/query-list-signals/README.md +32 -0
- package/schematics/migrations/query-list-signals/data.js +70 -0
- package/schematics/migrations/query-list-signals/index.js +17 -0
- package/schematics/migrations/query-list-signals/schema.json +15 -0
- package/schematics/migrations/radio-signals-and-aria/README.md +82 -0
- package/schematics/migrations/radio-signals-and-aria/data.js +163 -0
- package/schematics/migrations/radio-signals-and-aria/index.js +39 -0
- package/schematics/migrations/radio-signals-and-aria/schema.json +20 -0
- package/schematics/migrations/read-state-dwell-handlers/README.md +125 -0
- package/schematics/migrations/read-state-dwell-handlers/data.js +45 -0
- package/schematics/migrations/read-state-dwell-handlers/index.js +215 -0
- package/schematics/migrations/read-state-dwell-handlers/schema.json +20 -0
- package/schematics/migrations/scrollbar-deprecated-path/README.md +128 -0
- package/schematics/migrations/scrollbar-deprecated-path/index.js +20 -0
- package/schematics/migrations/scrollbar-deprecated-path/schema.json +20 -0
- package/schematics/migrations/select-signal-inputs/README.md +61 -0
- package/schematics/migrations/select-signal-inputs/data.js +99 -0
- package/schematics/migrations/select-signal-inputs/index.js +57 -0
- package/schematics/migrations/select-signal-inputs/schema.json +15 -0
- package/schematics/migrations/sidepanel-non-modal-behavior/README.md +57 -0
- package/schematics/migrations/sidepanel-non-modal-behavior/data.js +111 -0
- package/schematics/migrations/sidepanel-non-modal-behavior/index.js +57 -0
- package/schematics/migrations/sidepanel-non-modal-behavior/schema.json +15 -0
- package/schematics/migrations/signal-inputs-subclasses/README.md +28 -0
- package/schematics/migrations/signal-inputs-subclasses/data.js +69 -0
- package/schematics/migrations/signal-inputs-subclasses/index.js +17 -0
- package/schematics/migrations/signal-inputs-subclasses/schema.json +15 -0
- package/schematics/migrations/split-button-optional-disabled/README.md +47 -0
- package/schematics/migrations/split-button-optional-disabled/data.js +53 -0
- package/schematics/migrations/split-button-optional-disabled/index.js +57 -0
- package/schematics/migrations/split-button-optional-disabled/schema.json +15 -0
- package/schematics/migrations/splitter-deprecated-path/README.md +136 -0
- package/schematics/migrations/splitter-deprecated-path/index.js +20 -0
- package/schematics/migrations/splitter-deprecated-path/schema.json +20 -0
- package/schematics/migrations/state-saving-default/README.md +67 -0
- package/schematics/migrations/state-saving-default/data.js +88 -0
- package/schematics/migrations/state-saving-default/index.js +62 -0
- package/schematics/migrations/state-saving-default/schema.json +15 -0
- package/schematics/migrations/table-cell-content/README.md +55 -0
- package/schematics/migrations/table-cell-content/data.js +66 -0
- package/schematics/migrations/table-cell-content/index.js +66 -0
- package/schematics/migrations/table-cell-content/schema.json +15 -0
- package/schematics/migrations/tabs-signals-and-aria/README.md +93 -0
- package/schematics/migrations/tabs-signals-and-aria/data.js +139 -0
- package/schematics/migrations/tabs-signals-and-aria/index.js +65 -0
- package/schematics/migrations/tabs-signals-and-aria/schema.json +15 -0
- package/schematics/migrations/tag-list-cleaner/README.md +58 -0
- package/schematics/migrations/tag-list-cleaner/data.js +42 -0
- package/schematics/migrations/tag-list-cleaner/index.js +196 -0
- package/schematics/migrations/tag-list-cleaner/schema.json +20 -0
- package/schematics/migrations/tag-slots/README.md +41 -0
- package/schematics/migrations/tag-slots/index.js +190 -0
- package/schematics/migrations/tag-slots/schema.json +20 -0
- package/schematics/migrations/tags-signals/README.md +85 -0
- package/schematics/migrations/tags-signals/data.js +103 -0
- package/schematics/migrations/tags-signals/index.js +673 -0
- package/schematics/migrations/tags-signals/schema.json +20 -0
- package/schematics/migrations/textarea-signals/README.md +72 -0
- package/schematics/migrations/textarea-signals/data.js +121 -0
- package/schematics/migrations/textarea-signals/index.js +379 -0
- package/schematics/migrations/textarea-signals/schema.json +20 -0
- package/schematics/migrations/time-range-title-for/README.md +164 -0
- package/schematics/migrations/time-range-title-for/data.js +139 -0
- package/schematics/migrations/time-range-title-for/index.js +163 -0
- package/schematics/migrations/time-range-title-for/schema.json +20 -0
- package/schematics/migrations/timepicker-signals/README.md +78 -0
- package/schematics/migrations/timepicker-signals/data.js +82 -0
- package/schematics/migrations/timepicker-signals/index.js +709 -0
- package/schematics/migrations/timepicker-signals/schema.json +20 -0
- package/schematics/migrations/timezone-grouping-utils/README.md +73 -0
- package/schematics/migrations/timezone-grouping-utils/data.js +101 -0
- package/schematics/migrations/timezone-grouping-utils/index.js +64 -0
- package/schematics/migrations/timezone-grouping-utils/schema.json +15 -0
- package/schematics/migrations/title-encapsulation/README.md +49 -0
- package/schematics/migrations/title-encapsulation/data.js +69 -0
- package/schematics/migrations/title-encapsulation/index.js +57 -0
- package/schematics/migrations/title-encapsulation/schema.json +15 -0
- package/schematics/migrations/toast-stack-and-defaults/README.md +102 -0
- package/schematics/migrations/toast-stack-and-defaults/data.js +79 -0
- package/schematics/migrations/toast-stack-and-defaults/index.js +53 -0
- package/schematics/migrations/toast-stack-and-defaults/schema.json +15 -0
- package/schematics/migrations/tooltip-pointer-events-and-types/README.md +53 -0
- package/schematics/migrations/tooltip-pointer-events-and-types/data.js +89 -0
- package/schematics/migrations/tooltip-pointer-events-and-types/index.js +60 -0
- package/schematics/migrations/tooltip-pointer-events-and-types/schema.json +15 -0
- package/schematics/migrations/top-bar-container-selectors/README.md +111 -0
- package/schematics/migrations/top-bar-container-selectors/data.js +56 -0
- package/schematics/migrations/top-bar-container-selectors/index.js +84 -0
- package/schematics/migrations/top-bar-container-selectors/schema.json +20 -0
- package/schematics/migrations/tree-select-signals/README.md +61 -0
- package/schematics/migrations/tree-select-signals/data.js +106 -0
- package/schematics/migrations/tree-select-signals/index.js +58 -0
- package/schematics/migrations/tree-select-signals/schema.json +15 -0
- package/schematics/migrations/tree-signals/README.md +82 -0
- package/schematics/migrations/tree-signals/data.js +123 -0
- package/schematics/migrations/tree-signals/index.js +54 -0
- package/schematics/migrations/tree-signals/schema.json +15 -0
- package/schematics/migrations/tree-state-saving-default/README.md +66 -0
- package/schematics/migrations/tree-state-saving-default/data.js +78 -0
- package/schematics/migrations/tree-state-saving-default/index.js +60 -0
- package/schematics/migrations/tree-state-saving-default/schema.json +15 -0
- package/schematics/migrations/username-pipe-injection/README.md +59 -0
- package/schematics/migrations/username-pipe-injection/data.js +78 -0
- package/schematics/migrations/username-pipe-injection/index.js +58 -0
- package/schematics/migrations/username-pipe-injection/schema.json +15 -0
- package/schematics/migrations/v20-upgrade/README.md +36 -16
- package/schematics/migrations/v20-upgrade/data.js +124 -77
- package/schematics/migrations/v20-upgrade/index.js +6 -213
- package/schematics/migrations/v21-upgrade/README.md +271 -0
- package/schematics/migrations/v21-upgrade/data.js +1371 -0
- package/schematics/migrations/v21-upgrade/index.js +94 -0
- package/schematics/migrations/v21-upgrade/schema.json +20 -0
- package/schematics/migrations/zoneless-change-detection/README.md +30 -0
- package/schematics/migrations/zoneless-change-detection/data.js +29 -0
- package/schematics/migrations/zoneless-change-detection/index.js +20 -0
- package/schematics/migrations/zoneless-change-detection/schema.json +15 -0
- package/schematics/migrations.json +392 -2
- package/schematics/ng-add/index.js +515 -14
- package/schematics/ng-add/schema.json +15 -0
- package/schematics/utils/deprecated-path-migration.js +61 -0
- package/schematics/utils/package-config.js +9 -105
- package/scrollbar/{_scrollbar-component-theme.scss → deprecated/_scrollbar-component-theme.scss} +1 -1
- package/scrollbar/{scrollbar.component.scss → deprecated/scrollbar.component.scss} +1 -1
- package/scrollbar/native-scrollbar.scss +68 -0
- package/scrollbar/scrollbar-tokens.scss +13 -22
- package/scrollbar/scrollbar-track.scss +94 -0
- package/scrollbar/scrollbar-viewport.scss +33 -0
- package/scrollbar/scrollbar.scss +24 -0
- package/search-expandable/search-expandable-tokens.scss +4 -0
- package/search-expandable/search-expandable.scss +4 -2
- package/select/_select-theme.scss +3 -16
- package/select/select.scss +0 -6
- package/sidebar/sidebar.scss +20 -0
- package/sidepanel/_sidepanel-theme.scss +1 -1
- package/sidepanel/sidepanel-tokens.scss +7 -1
- package/sidepanel/sidepanel.scss +41 -5
- package/skeleton/skeleton-presets.scss +350 -0
- package/skeleton/skeleton-tokens.scss +127 -0
- package/skeleton/skeleton.scss +53 -45
- package/split-button/_split-button-theme.scss +4 -4
- package/split-button/split-button.scss +2 -6
- package/splitter/{_splitter-theme.scss → deprecated/_splitter-theme.scss} +1 -1
- package/splitter/deprecated/splitter.scss +51 -0
- package/splitter/splitter-tokens.scss +19 -0
- package/splitter/splitter.scss +148 -28
- package/table/_table-theme.scss +13 -12
- package/table/table-tokens.scss +8 -0
- package/table/table.scss +47 -22
- package/tabs/_tabs-common.scss +14 -14
- package/tabs/_tabs-theme.scss +4 -5
- package/tabs/tab-body.scss +49 -1
- package/tabs/tab-header.scss +2 -1
- package/tags/tag-list.scss +4 -0
- package/tags/tag.scss +19 -1
- package/time-range/time-range.scss +9 -0
- package/timezone/timezone-option.component.scss +4 -7
- package/timezone/timezone-select.component.scss +3 -0
- package/toast/_toast-theme.scss +1 -4
- package/toast/toast-container.component.scss +19 -13
- package/toast/toast-tokens.scss +12 -6
- package/toast/toast.component.scss +42 -19
- package/toggle/_toggle-theme.scss +4 -10
- package/toggle/toggle.scss +67 -26
- package/tooltip/_tooltip-theme.scss +7 -1
- package/tooltip/tooltip-tokens.scss +1 -2
- package/tooltip/tooltip.scss +55 -9
- package/top-bar/top-bar-tokens.scss +13 -2
- package/top-bar/top-bar.scss +24 -19
- package/tree/_tree-theme.scss +0 -1
- package/tree/toggle.scss +5 -9
- package/tree/tree-option.scss +2 -4
- package/tree/tree-tokens.scss +2 -1
- package/tree/tree.scss +3 -5
- package/tree-select/_tree-select-theme.scss +4 -15
- package/tree-select/tree-select-tokens.scss +16 -0
- package/tree-select/tree-select.scss +0 -6
- package/{accordion/index.d.ts → types/koobiq-components-accordion.d.ts} +102 -84
- package/{actions-panel/index.d.ts → types/koobiq-components-actions-panel.d.ts} +44 -59
- package/{alert/index.d.ts → types/koobiq-components-alert.d.ts} +8 -3
- package/types/koobiq-components-app-switcher.d.ts +406 -0
- package/types/koobiq-components-autocomplete.d.ts +443 -0
- package/{badge/index.d.ts → types/koobiq-components-badge.d.ts} +25 -20
- package/{breadcrumbs/index.d.ts → types/koobiq-components-breadcrumbs.d.ts} +97 -46
- package/types/koobiq-components-button-toggle.d.ts +340 -0
- package/types/koobiq-components-button.d.ts +296 -0
- package/types/koobiq-components-checkbox.d.ts +172 -0
- package/types/koobiq-components-clamped-text.d.ts +184 -0
- package/{code-block/index.d.ts → types/koobiq-components-code-block.d.ts} +114 -79
- package/{content-panel/index.d.ts → types/koobiq-components-content-panel.d.ts} +81 -25
- package/{core/index.d.ts → types/koobiq-components-core.d.ts} +2827 -865
- package/{datepicker/index.d.ts → types/koobiq-components-datepicker.d.ts} +161 -116
- package/types/koobiq-components-divider.d.ts +43 -0
- package/types/koobiq-components-dl.d.ts +235 -0
- package/{dropdown/index.d.ts → types/koobiq-components-dropdown.d.ts} +245 -239
- package/types/koobiq-components-ellipsis-center.d.ts +85 -0
- package/types/koobiq-components-empty-state.d.ts +106 -0
- package/{file-upload/index.d.ts → types/koobiq-components-file-upload.d.ts} +214 -107
- package/{filter-bar/index.d.ts → types/koobiq-components-filter-bar.d.ts} +410 -495
- package/types/koobiq-components-flag.d.ts +68 -0
- package/{form-field/index.d.ts → types/koobiq-components-form-field.d.ts} +167 -191
- package/types/koobiq-components-icon.d.ts +333 -0
- package/{inline-edit/index.d.ts → types/koobiq-components-inline-edit.d.ts} +109 -46
- package/types/koobiq-components-input.d.ts +477 -0
- package/types/koobiq-components-link-deprecated.d.ts +101 -0
- package/types/koobiq-components-link.d.ts +176 -0
- package/{list/index.d.ts → types/koobiq-components-list.d.ts} +162 -99
- package/types/koobiq-components-loader-overlay.d.ts +101 -0
- package/{markdown/index.d.ts → types/koobiq-components-markdown.d.ts} +16 -24
- package/types/koobiq-components-modal.d.ts +666 -0
- package/types/koobiq-components-navbar.d.ts +569 -0
- package/types/koobiq-components-notification-center.d.ts +500 -0
- package/{overflow-items/index.d.ts → types/koobiq-components-overflow-items.d.ts} +8 -22
- package/types/koobiq-components-popover.d.ts +468 -0
- package/types/koobiq-components-progress-bar.d.ts +67 -0
- package/{progress-spinner/index.d.ts → types/koobiq-components-progress-spinner.d.ts} +33 -10
- package/types/koobiq-components-radio.d.ts +294 -0
- package/{resizer/index.d.ts → types/koobiq-components-resizer.d.ts} +37 -2
- package/{scrollbar/index.d.ts → types/koobiq-components-scrollbar-deprecated.d.ts} +18 -1
- package/types/koobiq-components-scrollbar.d.ts +154 -0
- package/types/koobiq-components-search-expandable.d.ts +164 -0
- package/{select/index.d.ts → types/koobiq-components-select.d.ts} +360 -167
- package/types/koobiq-components-sidebar.d.ts +152 -0
- package/types/koobiq-components-sidepanel.d.ts +436 -0
- package/types/koobiq-components-skeleton.d.ts +234 -0
- package/types/koobiq-components-split-button.d.ts +65 -0
- package/{splitter/index.d.ts → types/koobiq-components-splitter-deprecated.d.ts} +44 -1
- package/types/koobiq-components-splitter.d.ts +406 -0
- package/types/koobiq-components-table.d.ts +44 -0
- package/types/koobiq-components-tabs.d.ts +888 -0
- package/{tags/index.d.ts → types/koobiq-components-tags.d.ts} +249 -133
- package/types/koobiq-components-textarea.d.ts +178 -0
- package/{time-range/index.d.ts → types/koobiq-components-time-range.d.ts} +135 -62
- package/types/koobiq-components-timepicker.d.ts +223 -0
- package/types/koobiq-components-timezone.d.ts +266 -0
- package/types/koobiq-components-title.d.ts +184 -0
- package/types/koobiq-components-toast.d.ts +289 -0
- package/types/koobiq-components-toggle.d.ts +121 -0
- package/types/koobiq-components-tooltip.d.ts +610 -0
- package/types/koobiq-components-top-bar.d.ts +61 -0
- package/types/koobiq-components-tree-select.d.ts +667 -0
- package/types/koobiq-components-tree.d.ts +1290 -0
- package/types/koobiq-components-username.d.ts +340 -0
- package/username/_username-theme.scss +35 -0
- package/username/username.scss +10 -34
- package/app-switcher/index.d.ts +0 -276
- package/autocomplete/index.d.ts +0 -286
- package/button/index.d.ts +0 -153
- package/button-toggle/index.d.ts +0 -162
- package/checkbox/index.d.ts +0 -163
- package/clamped-text/index.d.ts +0 -146
- package/core/styles/_tokens.scss +0 -7
- package/core/styles/common/_clearfix.scss +0 -13
- package/core/styles/common/_popup.scss +0 -6
- package/core/styles/functions/_index.scss +0 -3
- package/core/styles/functions/_number.scss +0 -60
- package/core/styles/functions/_string.scss +0 -18
- package/core/styles/theming/scrollbar-tokens.scss +0 -25
- package/core/styles/typography/_typography-utils.scss +0 -84
- package/divider/index.d.ts +0 -20
- package/dl/index.d.ts +0 -45
- package/ellipsis-center/index.d.ts +0 -71
- package/empty-state/index.d.ts +0 -45
- package/flag/index.d.ts +0 -44
- package/icon/index.d.ts +0 -200
- package/input/index.d.ts +0 -354
- package/link/index.d.ts +0 -56
- package/loader-overlay/index.d.ts +0 -57
- package/modal/index.d.ts +0 -339
- package/navbar/index.d.ts +0 -372
- package/notification-center/index.d.ts +0 -323
- package/popover/index.d.ts +0 -182
- package/prebuilt-themes/dark-theme.css +0 -1
- package/prebuilt-themes/light-theme.css +0 -1
- package/progress-bar/index.d.ts +0 -31
- package/radio/index.d.ts +0 -203
- package/search-expandable/index.d.ts +0 -101
- package/sidebar/index.d.ts +0 -94
- package/sidepanel/index.d.ts +0 -272
- package/skeleton/index.d.ts +0 -26
- package/split-button/index.d.ts +0 -46
- package/table/index.d.ts +0 -25
- package/tabs/index.d.ts +0 -677
- package/textarea/index.d.ts +0 -138
- package/timepicker/index.d.ts +0 -197
- package/timezone/index.d.ts +0 -125
- package/title/index.d.ts +0 -139
- package/toast/index.d.ts +0 -187
- package/toggle/index.d.ts +0 -104
- package/tooltip/index.d.ts +0 -335
- package/top-bar/index.d.ts +0 -33
- package/tree/index.d.ts +0 -802
- package/tree-select/index.d.ts +0 -475
- package/username/index.d.ts +0 -194
- /package/{dynamic-translation/index.d.ts → types/koobiq-components-dynamic-translation.d.ts} +0 -0
- /package/{index.d.ts → types/koobiq-components.d.ts} +0 -0
|
@@ -1,41 +1,100 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _IdGenerator, A11yModule } from '@angular/cdk/a11y';
|
|
2
2
|
import { getSupportedInputTypes } from '@angular/cdk/platform';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { forwardRef, inject, ElementRef, Renderer2,
|
|
4
|
+
import { InjectionToken, forwardRef, inject, ElementRef, Renderer2, NgZone, DestroyRef, input, booleanAttribute, signal, computed, effect, untracked, Directive, linkedSignal, NgModule } from '@angular/core';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, NgControl, NgForm, FormGroupDirective, NG_VALIDATORS, Validators, FormsModule } from '@angular/forms';
|
|
6
|
-
import
|
|
6
|
+
import * as i1 from '@koobiq/components/core';
|
|
7
|
+
import { ruRUFormattersData, kbqLocaleConfigurationOverrideProvider, KBQ_DEFAULT_LOCALE_ID, KBQ_DEFAULT_PRECISION_SEPARATOR, normalizeNumber, KBQ_LOCALE_SERVICE, KbqLocaleOverridesDirective, V, X, Z, NUMPAD_MINUS, DASH, FF_MINUS, DELETE, BACKSPACE, TAB, ESCAPE, ENTER, LEFT_ARROW, RIGHT_ARROW, HOME, END, isSelectAll, isCopy, isFunctionKey, isNumberKey, isNumpadKey, UP_ARROW, DOWN_ARROW, checkAndNormalizeLocalizedNumber, formatNumberWithLocale, ErrorStateMatcher, KbqErrorStateTracker, kbqInjectAutofilled } from '@koobiq/components/core';
|
|
7
8
|
import { KbqFormFieldControl, KbqFormFieldModule } from '@koobiq/components/form-field';
|
|
9
|
+
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
8
10
|
import { Subject } from 'rxjs';
|
|
9
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
10
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
|
11
11
|
import { KbqIconModule } from '@koobiq/components/icon';
|
|
12
12
|
|
|
13
13
|
function getKbqInputUnsupportedTypeError(inputType) {
|
|
14
14
|
return Error(`Input type "${inputType}" isn't supported by kbqInput.`);
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Logged when `kbqNumberInput` sits on a native number field, which the directive resets to `text`.
|
|
18
|
+
*/
|
|
19
|
+
const KBQ_NUMBER_INPUT_UNSUPPORTED_TYPE_MESSAGE = 'Input type "number" isn\'t supported by kbqNumberInput: the native value sanitizer rejects the ' +
|
|
20
|
+
'formatted value, blanking the field. The type has been reset to "text".';
|
|
16
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use {@link KBQ_INPUT_DEFAULT_LOCALE_CONFIGURATION}, which carries the whole `input`
|
|
24
|
+
* locale section rather than just its `number` slice. Will be removed in 22.0.0.
|
|
25
|
+
*/
|
|
17
26
|
const KBQ_INPUT_NUMBER_DEFAULT_CONFIGURATION = ruRUFormattersData.input.number;
|
|
27
|
+
/**
|
|
28
|
+
* Default configuration of `KbqNumberInput`: the whole `input` locale section, of which the number input
|
|
29
|
+
* reads `number`.
|
|
30
|
+
*/
|
|
31
|
+
const KBQ_INPUT_DEFAULT_LOCALE_CONFIGURATION = ruRUFormattersData.input;
|
|
32
|
+
/** Injection token for providing the default configuration of `KbqNumberInput`. */
|
|
33
|
+
const KBQ_INPUT_LOCALE_CONFIGURATION = new InjectionToken('KbqInputLocaleConfiguration', { factory: () => KBQ_INPUT_DEFAULT_LOCALE_CONFIGURATION });
|
|
34
|
+
/**
|
|
35
|
+
* Utility provider for `KBQ_INPUT_LOCALE_CONFIGURATION`. Only the values you pass are overridden; the rest
|
|
36
|
+
* keep following the active locale.
|
|
37
|
+
*/
|
|
38
|
+
const kbqInputLocaleConfigurationProvider = (configuration) => kbqLocaleConfigurationOverrideProvider('input', configuration);
|
|
39
|
+
/**
|
|
40
|
+
* Default of `bigStep`.
|
|
41
|
+
*
|
|
42
|
+
* @docs-private
|
|
43
|
+
*/
|
|
18
44
|
const BIG_STEP = 10;
|
|
45
|
+
/**
|
|
46
|
+
* Default of `step`.
|
|
47
|
+
*
|
|
48
|
+
* @docs-private
|
|
49
|
+
*/
|
|
19
50
|
const SMALL_STEP = 1;
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The locale id handed to `Intl.NumberFormat`, which is not always the active one.
|
|
53
|
+
*
|
|
54
|
+
* `es-LA` is not a real BCP-47 tag — `LA` is the region code for Laos — so what `Intl` makes of it is
|
|
55
|
+
* up to the ICU data of whatever engine is running: today's Node resolves it to plain `es`, another
|
|
56
|
+
* build may fall back somewhere else entirely. Pinning it to a tag every ICU build carries is a
|
|
57
|
+
* deliberate workaround, not a leftover: it takes that variance out of the rendered number. Remove it
|
|
58
|
+
* only when the locale is renamed to a real tag such as `es-419`.
|
|
59
|
+
*/
|
|
60
|
+
function resolveIntlLocale(localeId) {
|
|
61
|
+
return !localeId || localeId === 'es-LA' ? KBQ_DEFAULT_LOCALE_ID : localeId;
|
|
22
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Transform for the numeric inputs: coerces the static attribute form (`min="3"`) and anything a
|
|
65
|
+
* binding produces, falling back to `fallback` for a value that is not a number.
|
|
66
|
+
*/
|
|
67
|
+
const numberAttribute = (fallback) => (value) => coerceNumberProperty(value, fallback);
|
|
68
|
+
/** @docs-private */
|
|
23
69
|
function isFloat(value) {
|
|
24
70
|
return /^-?\d+\.\d+$/.test(value);
|
|
25
71
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Number of digits after the decimal point. Exponent-aware, so `1e-7` reports `7` rather than the
|
|
74
|
+
* `0` that reading `'1e-7'.split('.')` would give.
|
|
75
|
+
*/
|
|
76
|
+
function getFractionDigits(value) {
|
|
77
|
+
const [mantissa, negativeExponent] = value.toString().split(/e-/i);
|
|
78
|
+
const digits = mantissa.split(KBQ_DEFAULT_PRECISION_SEPARATOR)[1]?.length ?? 0;
|
|
79
|
+
return negativeExponent ? digits + Number(negativeExponent) : digits;
|
|
31
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Decimal scale of `value`: `10 ** <number of fraction digits>`.
|
|
83
|
+
*
|
|
84
|
+
* @docs-private
|
|
85
|
+
*/
|
|
32
86
|
function getPrecision(value) {
|
|
33
|
-
|
|
34
|
-
return arr.length === 1 ? 1 : Math.pow(10, arr[1].length);
|
|
87
|
+
return Math.pow(10, getFractionDigits(value));
|
|
35
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Adds two decimal numbers without IEEE-754 drift: both operands are rounded into integer space at
|
|
91
|
+
* the larger of the two scales, added there, and scaled back.
|
|
92
|
+
*
|
|
93
|
+
* @docs-private
|
|
94
|
+
*/
|
|
36
95
|
function add(value1, value2) {
|
|
37
96
|
const precision = Math.max(getPrecision(value1), getPrecision(value2));
|
|
38
|
-
return (value1 * precision + value2 * precision) / precision;
|
|
97
|
+
return (Math.round(value1 * precision) + Math.round(value2 * precision)) / precision;
|
|
39
98
|
}
|
|
40
99
|
const KBQ_NUMBER_INPUT_VALUE_ACCESSOR = {
|
|
41
100
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -43,38 +102,13 @@ const KBQ_NUMBER_INPUT_VALUE_ACCESSOR = {
|
|
|
43
102
|
multi: true
|
|
44
103
|
};
|
|
45
104
|
class KbqNumberInput {
|
|
46
|
-
|
|
47
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
105
|
+
/** The numeric value of the field, bound with `[value]` or written by a form control. */
|
|
48
106
|
get value() {
|
|
49
|
-
return this.
|
|
50
|
-
}
|
|
51
|
-
set value(value) {
|
|
52
|
-
const oldValue = this.value;
|
|
53
|
-
this._value = value;
|
|
54
|
-
if (oldValue !== value) {
|
|
55
|
-
this.setViewValue(this.formatNumber(value));
|
|
56
|
-
this.valueChange.emit(value);
|
|
57
|
-
}
|
|
107
|
+
return this.valueState() ?? null;
|
|
58
108
|
}
|
|
59
|
-
|
|
60
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
109
|
+
/** Whether the field is disabled, bound with `[disabled]` or set by a form control. */
|
|
61
110
|
get disabled() {
|
|
62
|
-
return this.
|
|
63
|
-
}
|
|
64
|
-
set disabled(value) {
|
|
65
|
-
const newValue = coerceBooleanProperty(value);
|
|
66
|
-
const element = this.nativeElement;
|
|
67
|
-
if (this._disabled !== newValue) {
|
|
68
|
-
this._disabled = newValue;
|
|
69
|
-
this.disabledChange.emit(newValue);
|
|
70
|
-
}
|
|
71
|
-
// We need to null check the `blur` method, because it's undefined during SSR.
|
|
72
|
-
if (newValue && element.blur) {
|
|
73
|
-
// Normally, native input elements automatically blur if they turn disabled. This behavior
|
|
74
|
-
// is problematic, because it would mean that it triggers another change detection cycle,
|
|
75
|
-
// which then causes a changed after checked error if the input element was focused before.
|
|
76
|
-
element.blur();
|
|
77
|
-
}
|
|
111
|
+
return this.disabledState();
|
|
78
112
|
}
|
|
79
113
|
get nativeElement() {
|
|
80
114
|
return this.elementRef.nativeElement;
|
|
@@ -82,8 +116,19 @@ class KbqNumberInput {
|
|
|
82
116
|
get viewValue() {
|
|
83
117
|
return this.nativeElement.value;
|
|
84
118
|
}
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Locale-aware numeric read of the field: parsed straight from `nativeElement.value`, so `"1 234,5"`
|
|
121
|
+
* reads back as `1234.5` where the native `valueAsNumber` of a `type="text"` input reports `NaN`.
|
|
122
|
+
* Computed on every read rather than cached off the committed model, so it never lags behind a
|
|
123
|
+
* keystroke the way `value` can while `onInput`'s reformat is still pending in its `setTimeout(0)` —
|
|
124
|
+
* safe to read from a consumer's own `(input)` handler. An in-progress `"-"` reads as `null`, same as
|
|
125
|
+
* an empty field, rather than the last committed number.
|
|
126
|
+
*/
|
|
127
|
+
get valueAsNumber() {
|
|
128
|
+
if (this.viewValue === '' || this.viewValue === '-')
|
|
129
|
+
return null;
|
|
130
|
+
const parsed = Number(normalizeNumber(this.viewValue, this.config));
|
|
131
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
87
132
|
}
|
|
88
133
|
get fractionSeparator() {
|
|
89
134
|
return this.config.fractionSeparator;
|
|
@@ -91,31 +136,69 @@ class KbqNumberInput {
|
|
|
91
136
|
get groupSeparator() {
|
|
92
137
|
return this.config.groupSeparator;
|
|
93
138
|
}
|
|
139
|
+
get config() {
|
|
140
|
+
return this.localeConfiguration().number;
|
|
141
|
+
}
|
|
94
142
|
constructor() {
|
|
95
143
|
this.elementRef = inject(ElementRef);
|
|
96
144
|
this.renderer = inject(Renderer2);
|
|
145
|
+
this.ngZone = inject(NgZone);
|
|
146
|
+
this.destroyRef = inject(DestroyRef);
|
|
97
147
|
this.localeService = inject(KBQ_LOCALE_SERVICE, { optional: true });
|
|
98
148
|
/** Emits when the value changes (either due to user input or programmatic change). */
|
|
99
|
-
this.valueChange = new
|
|
149
|
+
this.valueChange = new Subject();
|
|
100
150
|
/** Emits when the disabled state has changed */
|
|
101
|
-
this.disabledChange = new
|
|
151
|
+
this.disabledChange = new Subject();
|
|
152
|
+
/** Emits whenever the focused or disabled state of the directive changes. */
|
|
102
153
|
this.stateChanges = new Subject();
|
|
103
154
|
/**
|
|
104
|
-
*
|
|
155
|
+
* Discriminator read by `kbq-stepper` to find the control it drives.
|
|
156
|
+
*
|
|
105
157
|
* @docs-private
|
|
106
158
|
*/
|
|
107
159
|
this.controlType = 'input-number';
|
|
108
160
|
/**
|
|
109
161
|
* Allows input and pasting of integers only.
|
|
110
162
|
*/
|
|
111
|
-
this.integer = input(false, ...(ngDevMode ?
|
|
112
|
-
|
|
163
|
+
this.integer = input(false, { ...(ngDevMode ? { debugName: "integer" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
164
|
+
/** Step applied when `Shift` is held. */
|
|
165
|
+
this.bigStep = input(BIG_STEP, { ...(ngDevMode ? { debugName: "bigStep" } : /* istanbul ignore next */ {}), transform: numberAttribute(BIG_STEP) });
|
|
166
|
+
/** Step applied by the arrow keys and by `kbq-stepper`. */
|
|
167
|
+
this.step = input(SMALL_STEP, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute(SMALL_STEP) });
|
|
168
|
+
/** Lower bound the value is clamped to when stepping. */
|
|
169
|
+
this.min = input(-Infinity, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute(-Infinity) });
|
|
170
|
+
/** Upper bound the value is clamped to when stepping. */
|
|
171
|
+
this.max = input(Infinity, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute(Infinity) });
|
|
172
|
+
this.withThousandSeparator = input(true, { ...(ngDevMode ? { debugName: "withThousandSeparator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
113
173
|
/**
|
|
114
|
-
*
|
|
174
|
+
* Adds the thousand separator only from this power of ten. For example, `4` keeps `1234`
|
|
175
|
+
* un-grouped and groups `12345`. Defaults to the active locale's own value.
|
|
115
176
|
*/
|
|
116
|
-
this.startFormattingFrom = input(...(ngDevMode ? [undefined, { debugName: "startFormattingFrom" }] : []));
|
|
117
|
-
|
|
177
|
+
this.startFormattingFrom = input(...(ngDevMode ? [undefined, { debugName: "startFormattingFrom" }] : /* istanbul ignore next */ []));
|
|
178
|
+
/** @docs-private */
|
|
179
|
+
this.valueInput = input(undefined, { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
180
|
+
this.valueState = signal(undefined, ...(ngDevMode ? [{ debugName: "valueState" }] : /* istanbul ignore next */ []));
|
|
181
|
+
/** @docs-private */
|
|
182
|
+
this.disabledInput = input(undefined, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled',
|
|
183
|
+
transform: booleanAttribute });
|
|
184
|
+
this.disabledState = signal(false, ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
118
185
|
this.focused = false;
|
|
186
|
+
/**
|
|
187
|
+
* An unbounded end reports no `aria-value*`: `Infinity` is not a valid ARIA attribute value.
|
|
188
|
+
* A `computed()` rather than a getter so the value is cached between checks — the host binding
|
|
189
|
+
* itself lives in the declaring view and repaints either way.
|
|
190
|
+
*/
|
|
191
|
+
this.ariaValueMin = computed(() => (Number.isFinite(this.min()) ? this.min() : null), ...(ngDevMode ? [{ debugName: "ariaValueMin" }] : /* istanbul ignore next */ []));
|
|
192
|
+
/** The upper bound, reported the way `ariaValueMin` reports the lower one. */
|
|
193
|
+
this.ariaValueMax = computed(() => (Number.isFinite(this.max()) ? this.max() : null), ...(ngDevMode ? [{ debugName: "ariaValueMax" }] : /* istanbul ignore next */ []));
|
|
194
|
+
this.localeConfiguration = inject(KbqLocaleOverridesDirective, { self: true }).read('input', KBQ_INPUT_LOCALE_CONFIGURATION);
|
|
195
|
+
/** Pending `onInput` reformats by timer handle: cancelled on destroy, run at once before a step. */
|
|
196
|
+
this.pendingReformats = new Map();
|
|
197
|
+
/**
|
|
198
|
+
* Called when the control is blurred. Needed to properly implement `ControlValueAccessor`.
|
|
199
|
+
*
|
|
200
|
+
* @docs-private
|
|
201
|
+
*/
|
|
119
202
|
this.onTouched = () => { };
|
|
120
203
|
this.isCtrlV = (event) => {
|
|
121
204
|
return event.keyCode === V && (event.ctrlKey || event.metaKey);
|
|
@@ -131,35 +214,37 @@ class KbqNumberInput {
|
|
|
131
214
|
[this.fractionSeparator, KBQ_DEFAULT_PRECISION_SEPARATOR].includes(event.key));
|
|
132
215
|
};
|
|
133
216
|
this.cvaOnChange = () => { };
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.
|
|
158
|
-
|
|
217
|
+
// The inputs stay `undefined` until a template binds them, so an unbound one does not override what a
|
|
218
|
+
// form control wrote through `writeValue` / `setDisabledState`. Once bound, `undefined` clears the value.
|
|
219
|
+
let bound = false;
|
|
220
|
+
effect(() => {
|
|
221
|
+
const value = this.valueInput();
|
|
222
|
+
if (!bound && value === undefined)
|
|
223
|
+
return;
|
|
224
|
+
bound = true;
|
|
225
|
+
untracked(() => this.setValue(value ?? null));
|
|
226
|
+
});
|
|
227
|
+
effect(() => {
|
|
228
|
+
const disabled = this.disabledInput();
|
|
229
|
+
if (disabled !== undefined)
|
|
230
|
+
untracked(() => this.setDisabled(disabled));
|
|
231
|
+
});
|
|
232
|
+
// Re-render the value in the separators of the new locale. `untracked` keeps the configuration the
|
|
233
|
+
// only dependency: formatting also reads the `withThousandSeparator` input, which must not rewrite
|
|
234
|
+
// what the user is typing on its own.
|
|
235
|
+
effect(() => {
|
|
236
|
+
this.localeConfiguration();
|
|
237
|
+
untracked(() => this.setViewValue(this.formatNumber(this.value)));
|
|
238
|
+
});
|
|
239
|
+
this.destroyRef.onDestroy(() => {
|
|
240
|
+
this.pendingReformats.forEach((_, handle) => clearTimeout(handle));
|
|
241
|
+
this.pendingReformats.clear();
|
|
242
|
+
});
|
|
159
243
|
}
|
|
160
244
|
ngOnDestroy() {
|
|
161
245
|
this.valueChange.complete();
|
|
162
246
|
this.disabledChange.complete();
|
|
247
|
+
this.stateChanges.complete();
|
|
163
248
|
}
|
|
164
249
|
onContainerClick() {
|
|
165
250
|
this.focus();
|
|
@@ -169,7 +254,7 @@ class KbqNumberInput {
|
|
|
169
254
|
}
|
|
170
255
|
// Implemented as part of ControlValueAccessor.
|
|
171
256
|
writeValue(value) {
|
|
172
|
-
this.value
|
|
257
|
+
this.setValue(value);
|
|
173
258
|
}
|
|
174
259
|
// Implemented as part of ControlValueAccessor.
|
|
175
260
|
registerOnChange(fn) {
|
|
@@ -181,7 +266,7 @@ class KbqNumberInput {
|
|
|
181
266
|
}
|
|
182
267
|
// Implemented as part of ControlValueAccessor.
|
|
183
268
|
setDisabledState(isDisabled) {
|
|
184
|
-
this.
|
|
269
|
+
this.setDisabled(isDisabled);
|
|
185
270
|
}
|
|
186
271
|
focusChanged(isFocused) {
|
|
187
272
|
if (isFocused !== this.focused) {
|
|
@@ -200,11 +285,11 @@ class KbqNumberInput {
|
|
|
200
285
|
// should parse normalized fractionSeparator
|
|
201
286
|
const viewValueToBeChecked = normalizeNumber(this.viewValue, this.config);
|
|
202
287
|
const shouldSkipForIntegerMode = this.integer() && this.isPeriod(event);
|
|
203
|
-
const
|
|
288
|
+
const shouldBlockMinus = minuses.includes(keyCode) && (this.viewValue.includes(event.key) || this.min() >= 0);
|
|
204
289
|
const isSignAndFractionSepAlreadyExists = this.isPeriod(event) &&
|
|
205
290
|
[this.fractionSeparator, KBQ_DEFAULT_PRECISION_SEPARATOR].includes(event.key) &&
|
|
206
291
|
viewValueToBeChecked.indexOf(KBQ_DEFAULT_PRECISION_SEPARATOR) !== -1;
|
|
207
|
-
if (shouldSkipForIntegerMode ||
|
|
292
|
+
if (shouldSkipForIntegerMode || shouldBlockMinus || isSignAndFractionSepAlreadyExists) {
|
|
208
293
|
event.preventDefault();
|
|
209
294
|
return;
|
|
210
295
|
}
|
|
@@ -225,7 +310,7 @@ class KbqNumberInput {
|
|
|
225
310
|
if (event.shiftKey || isLetter) {
|
|
226
311
|
event.preventDefault();
|
|
227
312
|
// process steps
|
|
228
|
-
const step = event.shiftKey ? this.bigStep : this.step;
|
|
313
|
+
const step = event.shiftKey ? this.bigStep() : this.step();
|
|
229
314
|
if (keyCode === UP_ARROW) {
|
|
230
315
|
this.stepUp(step);
|
|
231
316
|
}
|
|
@@ -237,7 +322,11 @@ class KbqNumberInput {
|
|
|
237
322
|
onInput(event) {
|
|
238
323
|
const currentValueLength = this.formatNumber(this.value)?.length || 0;
|
|
239
324
|
const previousSelectionStart = this.nativeElement.selectionStart || 0;
|
|
240
|
-
|
|
325
|
+
// Deferred so the browser has applied the keystroke to the native value before it is reformatted.
|
|
326
|
+
// The handle is tracked and cleared on destroy: a directive torn down between the keystroke and the
|
|
327
|
+
// timeout must not write to a detached node nor push a change into a control the view no longer owns.
|
|
328
|
+
const reformat = (correctCaret) => {
|
|
329
|
+
this.pendingReformats.delete(handle);
|
|
241
330
|
const fromPaste = event.inputType === 'insertFromPaste';
|
|
242
331
|
let formattedValue;
|
|
243
332
|
if (fromPaste) {
|
|
@@ -246,28 +335,20 @@ class KbqNumberInput {
|
|
|
246
335
|
else {
|
|
247
336
|
/*this.viewValue is raw and should be reformatted to localized number */
|
|
248
337
|
formattedValue = this.formatViewValue();
|
|
249
|
-
if (this.withThousandSeparator()) {
|
|
250
|
-
|
|
251
|
-
Promise.resolve().then(() => {
|
|
252
|
-
if (this.value &&
|
|
253
|
-
Math.abs(this.value) >= 1000 &&
|
|
254
|
-
Math.abs(this.viewValue.length - currentValueLength) === offsetWhenSeparatorAdded) {
|
|
255
|
-
// move selection to the left/right if separator was added/removed
|
|
256
|
-
const cursorPosition = Math.max(0, previousSelectionStart + Math.sign(this.viewValue.length - currentValueLength));
|
|
257
|
-
this.renderer.setProperty(this.nativeElement, 'selectionStart', cursorPosition);
|
|
258
|
-
this.renderer.setProperty(this.nativeElement, 'selectionEnd', cursorPosition);
|
|
259
|
-
}
|
|
260
|
-
});
|
|
338
|
+
if (correctCaret && this.withThousandSeparator()) {
|
|
339
|
+
this.correctCaretForSeparator(currentValueLength, previousSelectionStart);
|
|
261
340
|
}
|
|
262
341
|
}
|
|
263
342
|
this.setViewValue(formattedValue, !fromPaste);
|
|
264
343
|
if (this.viewValue !== '-') {
|
|
265
344
|
this.viewToModelUpdate(formattedValue);
|
|
266
345
|
}
|
|
267
|
-
}
|
|
346
|
+
};
|
|
347
|
+
const handle = setTimeout(() => reformat(true));
|
|
348
|
+
this.pendingReformats.set(handle, reformat);
|
|
268
349
|
}
|
|
269
350
|
onPaste(event) {
|
|
270
|
-
this.valueFromPaste = checkAndNormalizeLocalizedNumber(event.clipboardData?.getData('text'), this.localeService?.
|
|
351
|
+
this.valueFromPaste = checkAndNormalizeLocalizedNumber(event.clipboardData?.getData('text'), this.localeService?.localeId());
|
|
271
352
|
if (this.valueFromPaste === null || isNaN(this.valueFromPaste)) {
|
|
272
353
|
event.preventDefault();
|
|
273
354
|
}
|
|
@@ -280,22 +361,48 @@ class KbqNumberInput {
|
|
|
280
361
|
}
|
|
281
362
|
stepUp(step) {
|
|
282
363
|
this.nativeElement.focus();
|
|
283
|
-
|
|
364
|
+
this.commitPendingReformats();
|
|
365
|
+
const res = Math.max(Math.min(add(this.value || 0, step), this.max()), this.min());
|
|
284
366
|
this.setViewValue(this.formatNumber(res));
|
|
285
|
-
this.
|
|
367
|
+
this.valueState.set(res);
|
|
286
368
|
this.cvaOnChange(res);
|
|
287
|
-
this.valueChange.
|
|
369
|
+
this.valueChange.next(res);
|
|
288
370
|
}
|
|
289
371
|
stepDown(step) {
|
|
290
372
|
this.nativeElement.focus();
|
|
291
|
-
|
|
373
|
+
this.commitPendingReformats();
|
|
374
|
+
const res = Math.min(Math.max(add(this.value || 0, -step), this.min()), this.max());
|
|
292
375
|
this.setViewValue(this.formatNumber(res));
|
|
293
|
-
this.
|
|
376
|
+
this.valueState.set(res);
|
|
294
377
|
this.cvaOnChange(res);
|
|
295
|
-
this.valueChange.
|
|
378
|
+
this.valueChange.next(res);
|
|
296
379
|
}
|
|
297
|
-
|
|
298
|
-
|
|
380
|
+
/**
|
|
381
|
+
* Commits a keystroke whose reformat is still pending, so a step pressed right after typing starts from
|
|
382
|
+
* the typed value rather than the last committed one. The caret correction is skipped: the step rewrites
|
|
383
|
+
* the value it would apply to.
|
|
384
|
+
*/
|
|
385
|
+
commitPendingReformats() {
|
|
386
|
+
this.pendingReformats.forEach((reformat, handle) => {
|
|
387
|
+
clearTimeout(handle);
|
|
388
|
+
reformat(false);
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Moves the caret one position when a group separator was inserted or removed by the reformat, so it
|
|
393
|
+
* stays next to the same digit. Runs outside the zone: it only writes the selection, which no view or
|
|
394
|
+
* model reads back, and each keystroke would otherwise cost an extra application-wide check.
|
|
395
|
+
*/
|
|
396
|
+
correctCaretForSeparator(previousValueLength, previousSelectionStart) {
|
|
397
|
+
const offsetWhenSeparatorAdded = 2;
|
|
398
|
+
this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
|
|
399
|
+
const lengthDelta = this.viewValue.length - previousValueLength;
|
|
400
|
+
if (this.value && Math.abs(this.value) >= 1000 && Math.abs(lengthDelta) === offsetWhenSeparatorAdded) {
|
|
401
|
+
const cursorPosition = Math.max(0, previousSelectionStart + Math.sign(lengthDelta));
|
|
402
|
+
this.renderer.setProperty(this.nativeElement, 'selectionStart', cursorPosition);
|
|
403
|
+
this.renderer.setProperty(this.nativeElement, 'selectionEnd', cursorPosition);
|
|
404
|
+
}
|
|
405
|
+
}));
|
|
299
406
|
}
|
|
300
407
|
setViewValue(value, savePosition = false) {
|
|
301
408
|
const cursorPosition = this.nativeElement.selectionStart;
|
|
@@ -305,14 +412,37 @@ class KbqNumberInput {
|
|
|
305
412
|
this.renderer.setProperty(this.nativeElement, 'selectionEnd', cursorPosition);
|
|
306
413
|
}
|
|
307
414
|
}
|
|
415
|
+
/** Writes a value from outside the field: reformats it and reports the change. */
|
|
416
|
+
setValue(value) {
|
|
417
|
+
const oldValue = this.valueState();
|
|
418
|
+
this.valueState.set(value);
|
|
419
|
+
if (oldValue !== value) {
|
|
420
|
+
this.setViewValue(this.formatNumber(value));
|
|
421
|
+
this.valueChange.next(value);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
setDisabled(disabled) {
|
|
425
|
+
if (this.disabledState() !== disabled) {
|
|
426
|
+
this.disabledState.set(disabled);
|
|
427
|
+
this.disabledChange.next(disabled);
|
|
428
|
+
this.stateChanges.next();
|
|
429
|
+
}
|
|
430
|
+
// We need to null check the `blur` method, because it's undefined during SSR.
|
|
431
|
+
if (disabled && this.nativeElement.blur) {
|
|
432
|
+
// Normally, native input elements automatically blur if they turn disabled. This behavior
|
|
433
|
+
// is problematic, because it would mean that it triggers another change detection cycle,
|
|
434
|
+
// which then causes a changed after checked error if the input element was focused before.
|
|
435
|
+
this.nativeElement.blur();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
308
438
|
viewToModelUpdate(newValue) {
|
|
309
439
|
const normalizedValue = newValue === null ? null : +normalizeNumber(newValue, this.config);
|
|
310
440
|
if (normalizedValue !== this.value) {
|
|
311
|
-
this.
|
|
441
|
+
this.valueState.set(normalizedValue);
|
|
442
|
+
// `cvaOnChange` routes through `FormControl.setValue`, which re-runs the validators itself.
|
|
312
443
|
this.cvaOnChange(normalizedValue);
|
|
313
|
-
this.valueChange.
|
|
444
|
+
this.valueChange.next(normalizedValue);
|
|
314
445
|
}
|
|
315
|
-
this.ngControl?.updateValueAndValidity({ emitEvent: false });
|
|
316
446
|
}
|
|
317
447
|
formatViewValue() {
|
|
318
448
|
// we just need to skip the minus sign and not do any formatting
|
|
@@ -340,11 +470,11 @@ class KbqNumberInput {
|
|
|
340
470
|
useGrouping: this.withThousandSeparator(),
|
|
341
471
|
maximumFractionDigits: 20
|
|
342
472
|
};
|
|
343
|
-
|
|
344
|
-
|
|
473
|
+
const startFormattingFrom = this.startFormattingFrom() ?? this.config.startFormattingFrom;
|
|
474
|
+
if (this.withThousandSeparator() && startFormattingFrom != null) {
|
|
475
|
+
formatOptions.useGrouping = intPart >= Math.pow(10, startFormattingFrom);
|
|
345
476
|
}
|
|
346
|
-
const
|
|
347
|
-
const formatter = new Intl.NumberFormat(localeId, formatOptions);
|
|
477
|
+
const formatter = new Intl.NumberFormat(resolveIntlLocale(this.localeService?.localeId()), formatOptions);
|
|
348
478
|
const formattedIntPart = formatNumberWithLocale(intPart, formatter, this.config);
|
|
349
479
|
if (fractionPart === undefined) {
|
|
350
480
|
return formattedIntPart;
|
|
@@ -355,39 +485,38 @@ class KbqNumberInput {
|
|
|
355
485
|
}
|
|
356
486
|
return `${formattedIntPart}${this.fractionSeparator}${formattedFractionPart}`;
|
|
357
487
|
}
|
|
358
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
359
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
488
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqNumberInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
489
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqNumberInput, isStandalone: true, selector: "input[kbqNumberInput]", inputs: { integer: { classPropertyName: "integer", publicName: "integer", isSignal: true, isRequired: false, transformFunction: null }, bigStep: { classPropertyName: "bigStep", publicName: "bigStep", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", 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 }, withThousandSeparator: { classPropertyName: "withThousandSeparator", publicName: "withThousandSeparator", isSignal: true, isRequired: false, transformFunction: null }, startFormattingFrom: { classPropertyName: "startFormattingFrom", publicName: "startFormattingFrom", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "spinbutton" }, listeners: { "blur": "focusChanged(false)", "focus": "focusChanged(true)", "paste": "onPaste($event)", "keydown": "onKeyDown($event)", "input": "onInput($any($event))" }, properties: { "attr.inputmode": "integer() ? 'numeric' : 'decimal'", "attr.aria-valuenow": "value", "attr.aria-valuetext": "viewValue || null", "attr.aria-valuemin": "ariaValueMin()", "attr.aria-valuemax": "ariaValueMax()" } }, providers: [KBQ_NUMBER_INPUT_VALUE_ACCESSOR], exportAs: ["kbqNumberInput", "kbqNumericalInput"], hostDirectives: [{ directive: i1.KbqLocaleOverridesDirective, inputs: ["kbqLocaleOverrides", "localeOverrides"] }], ngImport: i0 }); }
|
|
360
490
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqNumberInput, decorators: [{
|
|
362
492
|
type: Directive,
|
|
363
493
|
args: [{
|
|
364
494
|
selector: `input[kbqNumberInput]`,
|
|
365
495
|
providers: [KBQ_NUMBER_INPUT_VALUE_ACCESSOR],
|
|
366
496
|
host: {
|
|
497
|
+
role: 'spinbutton',
|
|
498
|
+
'[attr.inputmode]': "integer() ? 'numeric' : 'decimal'",
|
|
499
|
+
'[attr.aria-valuenow]': 'value',
|
|
500
|
+
// The formatted, locale-correct string, so the grouped value is announced rather than the raw number.
|
|
501
|
+
'[attr.aria-valuetext]': 'viewValue || null',
|
|
502
|
+
'[attr.aria-valuemin]': 'ariaValueMin()',
|
|
503
|
+
'[attr.aria-valuemax]': 'ariaValueMax()',
|
|
367
504
|
'(blur)': 'focusChanged(false)',
|
|
368
505
|
'(focus)': 'focusChanged(true)',
|
|
369
506
|
'(paste)': 'onPaste($event)',
|
|
370
507
|
'(keydown)': 'onKeyDown($event)',
|
|
371
|
-
'(input)': 'onInput($event)'
|
|
508
|
+
'(input)': 'onInput($any($event))'
|
|
372
509
|
},
|
|
373
|
-
|
|
510
|
+
hostDirectives: [
|
|
511
|
+
{ directive: KbqLocaleOverridesDirective, inputs: ['kbqLocaleOverrides: localeOverrides'] }
|
|
512
|
+
],
|
|
513
|
+
exportAs: 'kbqNumberInput, kbqNumericalInput'
|
|
374
514
|
}]
|
|
375
|
-
}], ctorParameters: () => [], propDecorators: { integer: [{ type: i0.Input, args: [{ isSignal: true, alias: "integer", required: false }] }], bigStep: [{
|
|
376
|
-
type: Input
|
|
377
|
-
}], step: [{
|
|
378
|
-
type: Input
|
|
379
|
-
}], min: [{
|
|
380
|
-
type: Input
|
|
381
|
-
}], max: [{
|
|
382
|
-
type: Input
|
|
383
|
-
}], withThousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "withThousandSeparator", required: false }] }], startFormattingFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "startFormattingFrom", required: false }] }], value: [{
|
|
384
|
-
type: Input
|
|
385
|
-
}], disabled: [{
|
|
386
|
-
type: Input
|
|
387
|
-
}] } });
|
|
515
|
+
}], ctorParameters: () => [], propDecorators: { integer: [{ type: i0.Input, args: [{ isSignal: true, alias: "integer", required: false }] }], bigStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "bigStep", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], withThousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "withThousandSeparator", required: false }] }], startFormattingFrom: [{ type: i0.Input, args: [{ isSignal: true, alias: "startFormattingFrom", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
388
516
|
|
|
389
517
|
const KBQ_INPUT_VALUE_ACCESSOR = new InjectionToken('KBQ_INPUT_VALUE_ACCESSOR');
|
|
390
518
|
|
|
519
|
+
const isObject$1 = (value) => typeof value === 'object' && value !== null;
|
|
391
520
|
const KBQ_INPUT_INVALID_TYPES = [
|
|
392
521
|
'button',
|
|
393
522
|
'checkbox',
|
|
@@ -399,83 +528,10 @@ const KBQ_INPUT_INVALID_TYPES = [
|
|
|
399
528
|
'reset',
|
|
400
529
|
'submit'
|
|
401
530
|
];
|
|
402
|
-
let nextUniqueId$1 = 0;
|
|
403
531
|
class KbqInput {
|
|
404
|
-
/**
|
|
405
|
-
* Implemented as part of KbqFormFieldControl.
|
|
406
|
-
* @docs-private
|
|
407
|
-
*/
|
|
408
|
-
// TODO: Skipped for migration because:
|
|
409
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
410
|
-
get disabled() {
|
|
411
|
-
if (this.ngControl && this.ngControl.disabled !== null) {
|
|
412
|
-
return this.ngControl.disabled;
|
|
413
|
-
}
|
|
414
|
-
return this._disabled;
|
|
415
|
-
}
|
|
416
|
-
set disabled(value) {
|
|
417
|
-
this._disabled = coerceBooleanProperty(value);
|
|
418
|
-
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
419
|
-
// Reset from here to ensure that the element doesn't become stuck.
|
|
420
|
-
if (this.focused) {
|
|
421
|
-
this.focused = false;
|
|
422
|
-
this.stateChanges.next();
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Implemented as part of KbqFormFieldControl.
|
|
427
|
-
* @docs-private
|
|
428
|
-
*/
|
|
429
|
-
// TODO: Skipped for migration because:
|
|
430
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
431
|
-
get id() {
|
|
432
|
-
return this._id;
|
|
433
|
-
}
|
|
434
|
-
set id(value) {
|
|
435
|
-
this._id = value || this.uid;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Implemented as part of KbqFormFieldControl.
|
|
439
|
-
* @docs-private
|
|
440
|
-
*/
|
|
441
|
-
// TODO: Skipped for migration because:
|
|
442
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
443
|
-
get required() {
|
|
444
|
-
return this._required;
|
|
445
|
-
}
|
|
446
|
-
set required(value) {
|
|
447
|
-
this._required = coerceBooleanProperty(value);
|
|
448
|
-
}
|
|
449
532
|
/** Input type of the element. */
|
|
450
|
-
// TODO: Skipped for migration because:
|
|
451
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
452
533
|
get type() {
|
|
453
|
-
return this.
|
|
454
|
-
}
|
|
455
|
-
set type(value) {
|
|
456
|
-
this._type = value || 'text';
|
|
457
|
-
this.validateType();
|
|
458
|
-
// When using Angular inputs, developers are no longer able to set the properties on the native
|
|
459
|
-
// input element. To ensure that bindings for `type` work, we need to sync the setter
|
|
460
|
-
// with the native property. Textarea elements don't support the type property or attribute.
|
|
461
|
-
if (getSupportedInputTypes().has(this._type)) {
|
|
462
|
-
this.elementRef.nativeElement.type = this._type;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Implemented as part of KbqFormFieldControl.
|
|
467
|
-
* @docs-private
|
|
468
|
-
*/
|
|
469
|
-
// TODO: Skipped for migration because:
|
|
470
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
471
|
-
get value() {
|
|
472
|
-
return this.inputValueAccessor.value;
|
|
473
|
-
}
|
|
474
|
-
set value(value) {
|
|
475
|
-
if (value !== this.value) {
|
|
476
|
-
this.inputValueAccessor.value = value;
|
|
477
|
-
this.stateChanges.next();
|
|
478
|
-
}
|
|
534
|
+
return this.resolvedType();
|
|
479
535
|
}
|
|
480
536
|
constructor() {
|
|
481
537
|
this.elementRef = inject(ElementRef);
|
|
@@ -484,29 +540,39 @@ class KbqInput {
|
|
|
484
540
|
this.parentForm = inject(NgForm, { optional: true });
|
|
485
541
|
this.parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
486
542
|
this.defaultErrorStateMatcher = inject(ErrorStateMatcher);
|
|
543
|
+
this.errorStateTracker = new KbqErrorStateTracker(this.defaultErrorStateMatcher, this.ngControl, this.parentFormGroup, this.parentForm);
|
|
487
544
|
/** Whether the component is in an error state. */
|
|
488
|
-
this.errorState =
|
|
545
|
+
this.errorState = this.errorStateTracker.errorState;
|
|
546
|
+
/** An object used to control when error messages are shown. */
|
|
547
|
+
this.errorStateMatcher = input(...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []));
|
|
548
|
+
this.focusedValue = signal(false, ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
|
|
489
549
|
/**
|
|
490
550
|
* Implemented as part of KbqFormFieldControl.
|
|
551
|
+
*
|
|
491
552
|
* @docs-private
|
|
492
553
|
*/
|
|
493
|
-
this.focused =
|
|
554
|
+
this.focused = this.focusedValue.asReadonly();
|
|
494
555
|
/**
|
|
495
556
|
* Implemented as part of KbqFormFieldControl.
|
|
557
|
+
*
|
|
496
558
|
* @docs-private
|
|
497
559
|
*/
|
|
498
560
|
this.autofilled = kbqInjectAutofilled();
|
|
499
561
|
/**
|
|
500
562
|
* Implemented as part of KbqFormFieldControl.
|
|
563
|
+
*
|
|
501
564
|
* @docs-private
|
|
502
565
|
*/
|
|
503
|
-
this.
|
|
566
|
+
this.controlType = this.numberInput ? 'input-number' : 'input';
|
|
567
|
+
/** @docs-private */
|
|
568
|
+
this.placeholderInput = input(undefined, { ...(ngDevMode ? { debugName: "placeholderInput" } : /* istanbul ignore next */ {}), alias: 'placeholder' });
|
|
504
569
|
/**
|
|
505
|
-
* Implemented as part of KbqFormFieldControl.
|
|
570
|
+
* Implemented as part of KbqFormFieldControl. Writable, so that a select search can supply one.
|
|
571
|
+
*
|
|
506
572
|
* @docs-private
|
|
507
573
|
*/
|
|
508
|
-
this.
|
|
509
|
-
this.uid =
|
|
574
|
+
this.placeholder = linkedSignal(() => this.placeholderInput(), ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
575
|
+
this.uid = inject(_IdGenerator).getId('kbq-input-');
|
|
510
576
|
this.neverEmptyInputTypes = [
|
|
511
577
|
'date',
|
|
512
578
|
'datetime',
|
|
@@ -515,21 +581,104 @@ class KbqInput {
|
|
|
515
581
|
'time',
|
|
516
582
|
'week'
|
|
517
583
|
].filter((t) => getSupportedInputTypes().has(t));
|
|
518
|
-
|
|
519
|
-
this.
|
|
520
|
-
|
|
584
|
+
/** @docs-private */
|
|
585
|
+
this.disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled',
|
|
586
|
+
transform: booleanAttribute });
|
|
587
|
+
/** `disabled` of the bound form control, which takes precedence over the input. */
|
|
588
|
+
this.formDisabled = signal(null, ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
589
|
+
/**
|
|
590
|
+
* Implemented as part of KbqFormFieldControl.
|
|
591
|
+
*
|
|
592
|
+
* @docs-private
|
|
593
|
+
*/
|
|
594
|
+
this.disabled = computed(() => this.formDisabled() ?? this.disabledInput(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
595
|
+
/** @docs-private */
|
|
596
|
+
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
597
|
+
/**
|
|
598
|
+
* Implemented as part of KbqFormFieldControl.
|
|
599
|
+
*
|
|
600
|
+
* @docs-private
|
|
601
|
+
*/
|
|
602
|
+
this.id = computed(() => this.idInput() || this.uid, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
603
|
+
/**
|
|
604
|
+
* Implemented as part of KbqFormFieldControl.
|
|
605
|
+
*
|
|
606
|
+
* @docs-private
|
|
607
|
+
*/
|
|
608
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
609
|
+
/** @docs-private */
|
|
610
|
+
this.typeInput = input(undefined, { ...(ngDevMode ? { debugName: "typeInput" } : /* istanbul ignore next */ {}), alias: 'type' });
|
|
611
|
+
// A native number field runs the value sanitization algorithm on assignment and drops anything that
|
|
612
|
+
// is not a valid floating-point number — which is every value `kbqNumberInput` renders once a group
|
|
613
|
+
// separator or a comma fraction separator is in it. It also reports `selectionStart` as `null`,
|
|
614
|
+
// disabling caret preservation. Reset rather than throw, so an existing consumer keeps working.
|
|
615
|
+
this.resolvedType = computed(() => {
|
|
616
|
+
const type = this.typeInput() || 'text';
|
|
617
|
+
return this.numberInput && type === 'number' ? 'text' : type;
|
|
618
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedType" }] : /* istanbul ignore next */ []));
|
|
619
|
+
/** @docs-private */
|
|
620
|
+
this.valueInput = input(undefined, { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
621
|
+
this.emptyValue = signal(true, ...(ngDevMode ? [{ debugName: "emptyValue" }] : /* istanbul ignore next */ []));
|
|
622
|
+
/**
|
|
623
|
+
* Implemented as part of KbqFormFieldControl.
|
|
624
|
+
*
|
|
625
|
+
* @docs-private
|
|
626
|
+
*/
|
|
627
|
+
this.empty = this.emptyValue.asReadonly();
|
|
521
628
|
const inputValueAccessor = inject(KBQ_INPUT_VALUE_ACCESSOR, { optional: true, self: true });
|
|
522
629
|
// If no input value accessor was explicitly specified, use the element as the input value accessor.
|
|
523
630
|
this.inputValueAccessor = inputValueAccessor || this.elementRef.nativeElement;
|
|
524
|
-
|
|
525
|
-
//
|
|
526
|
-
this.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
this.
|
|
631
|
+
// A static `type` is on the element before any directive runs, while the effect below runs after a reactive
|
|
632
|
+
// form has written its value from `ngOnChanges`: a number field would sanitize that value away by then.
|
|
633
|
+
if (this.numberInput && this.elementRef.nativeElement.type === 'number') {
|
|
634
|
+
this.elementRef.nativeElement.type = 'text';
|
|
635
|
+
}
|
|
636
|
+
// Read once: a custom accessor may build a new value on every read.
|
|
637
|
+
const initialValue = this.inputValueAccessor.value;
|
|
638
|
+
this.value = signal(initialValue, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
639
|
+
this.syncedValue = initialValue;
|
|
640
|
+
this.syncedText = this.elementRef.nativeElement.value;
|
|
641
|
+
// A binding of `type` no longer reaches the element on its own: the directive takes the input. Textarea
|
|
642
|
+
// elements don't support the type property or attribute.
|
|
643
|
+
effect(() => {
|
|
644
|
+
const type = this.resolvedType();
|
|
645
|
+
untracked(() => {
|
|
646
|
+
this.validateType();
|
|
647
|
+
if (getSupportedInputTypes().has(type)) {
|
|
648
|
+
this.elementRef.nativeElement.type = type;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
// A bound value replaces the current one whenever the binding changes. The number input takes the same
|
|
653
|
+
// binding and renders it in the locale format, so it owns the element's value.
|
|
654
|
+
effect(() => {
|
|
655
|
+
const value = this.valueInput();
|
|
656
|
+
if (value !== undefined && !this.numberInput) {
|
|
657
|
+
untracked(() => this.value.set(value));
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
// A value set in code is written to the element on the next change detection. The one the element last agreed
|
|
661
|
+
// on is not written back: the element may have changed since, as when the number input renders a bound value.
|
|
662
|
+
effect(() => {
|
|
663
|
+
const value = this.value();
|
|
664
|
+
untracked(() => {
|
|
665
|
+
if (value !== this.syncedValue) {
|
|
666
|
+
if (this.inputValueAccessor.value !== value) {
|
|
667
|
+
this.inputValueAccessor.value = value;
|
|
668
|
+
}
|
|
669
|
+
this.syncedValue = value;
|
|
670
|
+
this.syncedText = this.elementRef.nativeElement.value;
|
|
671
|
+
}
|
|
672
|
+
this.dirtyCheckNativeValue();
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
676
|
+
// Reset from here to ensure that the element doesn't become stuck.
|
|
677
|
+
effect(() => {
|
|
678
|
+
if (this.disabled()) {
|
|
679
|
+
untracked(() => this.focusedValue.set(false));
|
|
680
|
+
}
|
|
681
|
+
});
|
|
533
682
|
}
|
|
534
683
|
ngDoCheck() {
|
|
535
684
|
if (this.ngControl) {
|
|
@@ -537,6 +686,7 @@ class KbqInput {
|
|
|
537
686
|
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
|
538
687
|
// that whatever logic is in here has to be super lean or we risk destroying the performance.
|
|
539
688
|
this.updateErrorState();
|
|
689
|
+
this.formDisabled.set(this.ngControl.disabled);
|
|
540
690
|
}
|
|
541
691
|
// We need to dirty-check the native element's value, because there are some cases where
|
|
542
692
|
// we won't be notified when it changes (e.g. the consumer isn't using forms or they're
|
|
@@ -544,15 +694,8 @@ class KbqInput {
|
|
|
544
694
|
this.dirtyCheckNativeValue();
|
|
545
695
|
}
|
|
546
696
|
updateErrorState() {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
const matcher = this.errorStateMatcher || this.defaultErrorStateMatcher;
|
|
550
|
-
const control = this.ngControl ? this.ngControl.control : null;
|
|
551
|
-
const newState = matcher.isErrorState(control, parent);
|
|
552
|
-
if (newState !== oldState) {
|
|
553
|
-
this.errorState = newState;
|
|
554
|
-
this.stateChanges.next();
|
|
555
|
-
}
|
|
697
|
+
this.errorStateTracker.errorStateMatcher = this.errorStateMatcher();
|
|
698
|
+
this.errorStateTracker.updateErrorState();
|
|
556
699
|
}
|
|
557
700
|
/** Focuses the input. */
|
|
558
701
|
focus() {
|
|
@@ -563,42 +706,48 @@ class KbqInput {
|
|
|
563
706
|
}
|
|
564
707
|
/** Callback for the cases where the focused state of the input changes. */
|
|
565
708
|
focusChanged(isFocused) {
|
|
566
|
-
|
|
567
|
-
this.focused = isFocused;
|
|
568
|
-
this.stateChanges.next();
|
|
569
|
-
}
|
|
709
|
+
this.focusedValue.set(isFocused);
|
|
570
710
|
}
|
|
571
711
|
/**
|
|
572
712
|
* Implemented as part of KbqFormFieldControl.
|
|
713
|
+
*
|
|
573
714
|
* @docs-private
|
|
574
715
|
*/
|
|
575
|
-
|
|
576
|
-
|
|
716
|
+
onContainerClick() {
|
|
717
|
+
this.focus();
|
|
577
718
|
}
|
|
578
719
|
/**
|
|
579
|
-
*
|
|
720
|
+
* Reads the native value back, since it changes without notice: through the forms API, which writes the
|
|
721
|
+
* element directly, or by the user typing into an input that no form listens to.
|
|
722
|
+
*
|
|
580
723
|
* @docs-private
|
|
581
724
|
*/
|
|
582
|
-
onContainerClick() {
|
|
583
|
-
this.focus();
|
|
584
|
-
}
|
|
585
|
-
/** Does some manual dirty checking on the native input `value` property. */
|
|
586
725
|
dirtyCheckNativeValue() {
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
726
|
+
const nativeValue = this.inputValueAccessor.value;
|
|
727
|
+
const text = this.elementRef.nativeElement.value;
|
|
728
|
+
// Only a change of the element itself: a value set in code and not yet written must not be overwritten. An
|
|
729
|
+
// object counts as changed only with the text, as a custom accessor may build a new one on every read.
|
|
730
|
+
if (nativeValue !== this.syncedValue && (!isObject$1(nativeValue) || text !== this.syncedText)) {
|
|
731
|
+
this.syncedValue = nativeValue;
|
|
732
|
+
this.syncedText = text;
|
|
733
|
+
this.value.set(nativeValue);
|
|
591
734
|
}
|
|
735
|
+
this.emptyValue.set(this.isEmpty());
|
|
592
736
|
}
|
|
593
737
|
/** Make sure the input is a supported type. */
|
|
594
738
|
validateType() {
|
|
595
|
-
|
|
596
|
-
|
|
739
|
+
const type = this.typeInput() || 'text';
|
|
740
|
+
if (KBQ_INPUT_INVALID_TYPES.indexOf(type) > -1) {
|
|
741
|
+
throw getKbqInputUnsupportedTypeError(type);
|
|
742
|
+
}
|
|
743
|
+
if (this.numberInput && type === 'number' && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
744
|
+
// eslint-disable-next-line no-console
|
|
745
|
+
console.warn(KBQ_NUMBER_INPUT_UNSUPPORTED_TYPE_MESSAGE);
|
|
597
746
|
}
|
|
598
747
|
}
|
|
599
748
|
/** Checks whether the input type is one of the types that are never empty. */
|
|
600
749
|
isNeverEmpty() {
|
|
601
|
-
return this.neverEmptyInputTypes.indexOf(this.
|
|
750
|
+
return this.neverEmptyInputTypes.indexOf(this.type) > -1;
|
|
602
751
|
}
|
|
603
752
|
/** Checks whether the input is invalid based on the native validation. */
|
|
604
753
|
isBadInput() {
|
|
@@ -606,15 +755,18 @@ class KbqInput {
|
|
|
606
755
|
const validity = this.elementRef.nativeElement.validity;
|
|
607
756
|
return validity?.badInput;
|
|
608
757
|
}
|
|
609
|
-
|
|
610
|
-
|
|
758
|
+
isEmpty() {
|
|
759
|
+
return !this.isNeverEmpty() && !this.elementRef.nativeElement.value && !this.isBadInput();
|
|
760
|
+
}
|
|
761
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
762
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqInput, isStandalone: true, selector: "input[kbqInput],input[kbqNumberInput]", inputs: { errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, placeholderInput: { classPropertyName: "placeholderInput", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, typeInput: { classPropertyName: "typeInput", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "focus": "focusChanged(true)", "input": "dirtyCheckNativeValue()" }, properties: { "attr.id": "id()", "attr.placeholder": "placeholder()", "attr.disabled": "disabled() || null", "attr.aria-invalid": "errorState()", "required": "required()" }, classAttribute: "kbq-input" }, providers: [
|
|
611
763
|
{
|
|
612
764
|
provide: KbqFormFieldControl,
|
|
613
765
|
useExisting: KbqInput
|
|
614
766
|
}
|
|
615
|
-
], exportAs: ["kbqInput"],
|
|
767
|
+
], exportAs: ["kbqInput"], ngImport: i0 }); }
|
|
616
768
|
}
|
|
617
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
769
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInput, decorators: [{
|
|
618
770
|
type: Directive,
|
|
619
771
|
args: [{
|
|
620
772
|
selector: `input[kbqInput],input[kbqNumberInput]`,
|
|
@@ -628,55 +780,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
628
780
|
class: 'kbq-input',
|
|
629
781
|
// Native input properties that are overwritten by Angular inputs need to be synced with
|
|
630
782
|
// the native input element. Otherwise property bindings for those don't work.
|
|
631
|
-
'[attr.id]': 'id',
|
|
632
|
-
'[attr.placeholder]': 'placeholder',
|
|
633
|
-
'[attr.disabled]': 'disabled || null',
|
|
634
|
-
'[
|
|
783
|
+
'[attr.id]': 'id()',
|
|
784
|
+
'[attr.placeholder]': 'placeholder()',
|
|
785
|
+
'[attr.disabled]': 'disabled() || null',
|
|
786
|
+
'[attr.aria-invalid]': 'errorState()',
|
|
787
|
+
'[required]': 'required()',
|
|
635
788
|
'(blur)': 'onBlur()',
|
|
636
|
-
'(focus)': 'focusChanged(true)'
|
|
789
|
+
'(focus)': 'focusChanged(true)',
|
|
790
|
+
'(input)': 'dirtyCheckNativeValue()'
|
|
637
791
|
},
|
|
638
792
|
exportAs: 'kbqInput'
|
|
639
793
|
}]
|
|
640
|
-
}], ctorParameters: () => [], propDecorators: { errorStateMatcher: [{
|
|
641
|
-
type: Input
|
|
642
|
-
}], placeholder: [{
|
|
643
|
-
type: Input
|
|
644
|
-
}], disabled: [{
|
|
645
|
-
type: Input
|
|
646
|
-
}], id: [{
|
|
647
|
-
type: Input
|
|
648
|
-
}], required: [{
|
|
649
|
-
type: Input
|
|
650
|
-
}], type: [{
|
|
651
|
-
type: Input
|
|
652
|
-
}], value: [{
|
|
653
|
-
type: Input
|
|
654
|
-
}] } });
|
|
794
|
+
}], ctorParameters: () => [], propDecorators: { errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], placeholderInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], typeInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
655
795
|
class KbqInputMono {
|
|
656
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
657
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
796
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputMono, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
797
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: KbqInputMono, isStandalone: true, selector: "input[kbqInputMonospace]", host: { classAttribute: "kbq-input_monospace" }, exportAs: ["kbqInputMonospace", "KbqInputMonospace"], ngImport: i0 }); }
|
|
658
798
|
}
|
|
659
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputMono, decorators: [{
|
|
660
800
|
type: Directive,
|
|
661
801
|
args: [{
|
|
662
802
|
selector: 'input[kbqInputMonospace]',
|
|
663
803
|
host: { class: 'kbq-input_monospace' },
|
|
664
|
-
exportAs: 'KbqInputMonospace'
|
|
804
|
+
exportAs: 'kbqInputMonospace, KbqInputMonospace'
|
|
665
805
|
}]
|
|
666
806
|
}] });
|
|
667
807
|
|
|
668
|
-
|
|
808
|
+
/**
|
|
809
|
+
* Transform for the validator bounds. `coerceNumberProperty`, not `parseInt`: the bound value may be a
|
|
810
|
+
* fractional number or the string form of a static `min="0.5"` attribute, and `parseInt` would truncate
|
|
811
|
+
* both to `0`. A non-numeric bound becomes `NaN`, which installs no validator and writes no attribute.
|
|
812
|
+
*/
|
|
813
|
+
const bound = (value) => coerceNumberProperty(value, NaN);
|
|
814
|
+
const KBQ_MIN_VALIDATOR = {
|
|
669
815
|
provide: NG_VALIDATORS,
|
|
670
|
-
useExisting: forwardRef(() =>
|
|
816
|
+
useExisting: forwardRef(() => KbqMinValidator),
|
|
671
817
|
multi: true
|
|
672
818
|
};
|
|
673
819
|
/**
|
|
674
|
-
* A directive which installs the
|
|
820
|
+
* A directive which installs the `KbqMinValidator` for any `formControlName`,
|
|
675
821
|
* `formControl`, or control with `ngModel` that also has a `min` attribute.
|
|
676
822
|
*/
|
|
677
|
-
class
|
|
823
|
+
class KbqMinValidator {
|
|
678
824
|
constructor() {
|
|
679
|
-
|
|
825
|
+
/** Lower bound installed as `Validators.min`. A non-numeric bound reads back as `NaN`. */
|
|
826
|
+
this.min = input(undefined, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: bound });
|
|
827
|
+
/** `min()` unless it is `NaN`, which has no DOM representation. */
|
|
828
|
+
this.coercedMin = computed(() => (Number.isNaN(this.min()) ? null : this.min()), ...(ngDevMode ? [{ debugName: "coercedMin" }] : /* istanbul ignore next */ []));
|
|
680
829
|
}
|
|
681
830
|
ngOnChanges(changes) {
|
|
682
831
|
if ('min' in changes) {
|
|
@@ -693,33 +842,41 @@ class MinValidator {
|
|
|
693
842
|
this.onChange = fn;
|
|
694
843
|
}
|
|
695
844
|
createValidator() {
|
|
696
|
-
|
|
845
|
+
const min = this.min();
|
|
846
|
+
this.validator = Number.isNaN(min) ? Validators.nullValidator : Validators.min(min);
|
|
697
847
|
}
|
|
698
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
699
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
848
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMinValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
849
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqMinValidator, isStandalone: true, selector: "[min][formControlName],[min][formControl],[min][ngModel]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.min": "coercedMin() ?? null" } }, providers: [KBQ_MIN_VALIDATOR], usesOnChanges: true, ngImport: i0 }); }
|
|
700
850
|
}
|
|
701
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMinValidator, decorators: [{
|
|
702
852
|
type: Directive,
|
|
703
853
|
args: [{
|
|
704
854
|
selector: '[min][formControlName],[min][formControl],[min][ngModel]',
|
|
705
|
-
providers: [
|
|
855
|
+
providers: [KBQ_MIN_VALIDATOR],
|
|
706
856
|
host: {
|
|
707
|
-
|
|
857
|
+
// Coerced rather than the raw `min()`, so a non-numeric bound (e.g. `"5px"`) is dropped from the
|
|
858
|
+
// DOM exactly like it is from the installed validator, instead of writing a bogus `min` attribute.
|
|
859
|
+
// `?? null` rather than a falsy check: a bound `[min]="0"` is the most common lower bound and must
|
|
860
|
+
// still reach the DOM.
|
|
861
|
+
'[attr.min]': 'coercedMin() ?? null'
|
|
708
862
|
}
|
|
709
863
|
}]
|
|
710
864
|
}], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }] } });
|
|
711
|
-
const
|
|
865
|
+
const KBQ_MAX_VALIDATOR = {
|
|
712
866
|
provide: NG_VALIDATORS,
|
|
713
|
-
useExisting: forwardRef(() =>
|
|
867
|
+
useExisting: forwardRef(() => KbqMaxValidator),
|
|
714
868
|
multi: true
|
|
715
869
|
};
|
|
716
870
|
/**
|
|
717
|
-
* A directive which installs the
|
|
718
|
-
* `formControl`, or control with `ngModel` that also has a `
|
|
871
|
+
* A directive which installs the `KbqMaxValidator` for any `formControlName`,
|
|
872
|
+
* `formControl`, or control with `ngModel` that also has a `max` attribute.
|
|
719
873
|
*/
|
|
720
|
-
class
|
|
874
|
+
class KbqMaxValidator {
|
|
721
875
|
constructor() {
|
|
722
|
-
|
|
876
|
+
/** Upper bound installed as `Validators.max`. A non-numeric bound reads back as `NaN`. */
|
|
877
|
+
this.max = input(undefined, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: bound });
|
|
878
|
+
/** `max()` unless it is `NaN`, which has no DOM representation. */
|
|
879
|
+
this.coercedMax = computed(() => (Number.isNaN(this.max()) ? null : this.max()), ...(ngDevMode ? [{ debugName: "coercedMax" }] : /* istanbul ignore next */ []));
|
|
723
880
|
}
|
|
724
881
|
ngOnChanges(changes) {
|
|
725
882
|
if ('max' in changes) {
|
|
@@ -736,139 +893,143 @@ class MaxValidator {
|
|
|
736
893
|
this.onChange = fn;
|
|
737
894
|
}
|
|
738
895
|
createValidator() {
|
|
739
|
-
|
|
896
|
+
const max = this.max();
|
|
897
|
+
this.validator = Number.isNaN(max) ? Validators.nullValidator : Validators.max(max);
|
|
740
898
|
}
|
|
741
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
742
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
899
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMaxValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
900
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqMaxValidator, isStandalone: true, selector: "[max][formControlName],[max][formControl],[max][ngModel]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.max": "coercedMax() ?? null" } }, providers: [KBQ_MAX_VALIDATOR], usesOnChanges: true, ngImport: i0 }); }
|
|
743
901
|
}
|
|
744
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMaxValidator, decorators: [{
|
|
745
903
|
type: Directive,
|
|
746
904
|
args: [{
|
|
747
905
|
selector: '[max][formControlName],[max][formControl],[max][ngModel]',
|
|
748
|
-
providers: [
|
|
906
|
+
providers: [KBQ_MAX_VALIDATOR],
|
|
749
907
|
host: {
|
|
750
|
-
'[attr.
|
|
908
|
+
// See `KbqMinValidator`'s `[attr.min]` for why this is coerced rather than the raw `max()`.
|
|
909
|
+
'[attr.max]': 'coercedMax() ?? null'
|
|
751
910
|
}
|
|
752
911
|
}]
|
|
753
912
|
}], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }] } });
|
|
754
913
|
|
|
755
|
-
|
|
914
|
+
const isObject = (value) => typeof value === 'object' && value !== null;
|
|
756
915
|
class KbqInputPassword {
|
|
757
|
-
/**
|
|
758
|
-
* Implemented as part of KbqFormFieldControl.
|
|
759
|
-
* @docs-private
|
|
760
|
-
*/
|
|
761
|
-
// TODO: Skipped for migration because:
|
|
762
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
763
|
-
get disabled() {
|
|
764
|
-
if (this.ngControl && this.ngControl.disabled !== null) {
|
|
765
|
-
return this.ngControl.disabled;
|
|
766
|
-
}
|
|
767
|
-
return this._disabled;
|
|
768
|
-
}
|
|
769
|
-
set disabled(value) {
|
|
770
|
-
this._disabled = coerceBooleanProperty(value);
|
|
771
|
-
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
772
|
-
// Reset from here to ensure that the element doesn't become stuck.
|
|
773
|
-
if (this.focused) {
|
|
774
|
-
this.focused = false;
|
|
775
|
-
this.stateChanges.next(null);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* Implemented as part of KbqFormFieldControl.
|
|
780
|
-
* @docs-private
|
|
781
|
-
*/
|
|
782
|
-
// TODO: Skipped for migration because:
|
|
783
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
784
|
-
get id() {
|
|
785
|
-
return this._id;
|
|
786
|
-
}
|
|
787
|
-
set id(value) {
|
|
788
|
-
this._id = value || this.uid;
|
|
789
|
-
}
|
|
790
|
-
/**
|
|
791
|
-
* Implemented as part of KbqFormFieldControl.
|
|
792
|
-
* @docs-private
|
|
793
|
-
*/
|
|
794
|
-
// TODO: Skipped for migration because:
|
|
795
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
796
|
-
get required() {
|
|
797
|
-
return this._required;
|
|
798
|
-
}
|
|
799
|
-
set required(value) {
|
|
800
|
-
this._required = coerceBooleanProperty(value);
|
|
801
|
-
}
|
|
802
|
-
// this.elementRef.nativeElement.type = this._type;
|
|
803
|
-
/**
|
|
804
|
-
* Implemented as part of KbqFormFieldControl.
|
|
805
|
-
* @docs-private
|
|
806
|
-
*/
|
|
807
|
-
// TODO: Skipped for migration because:
|
|
808
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
809
|
-
get value() {
|
|
810
|
-
return this._inputValueAccessor.value;
|
|
811
|
-
}
|
|
812
|
-
set value(value) {
|
|
813
|
-
if (value === this.value) {
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
this._inputValueAccessor.value = value;
|
|
817
|
-
this.stateChanges.next(null);
|
|
818
|
-
}
|
|
819
|
-
/**
|
|
820
|
-
* Implemented as part of KbqFormFieldControl.
|
|
821
|
-
* @docs-private
|
|
822
|
-
*/
|
|
823
|
-
get empty() {
|
|
824
|
-
return !this.elementRef.nativeElement.value && !this.isBadInput();
|
|
825
|
-
}
|
|
826
916
|
constructor() {
|
|
827
917
|
this.elementRef = inject(ElementRef);
|
|
828
918
|
this.ngControl = inject(NgControl, { optional: true, self: true });
|
|
829
919
|
this.parentForm = inject(NgForm, { optional: true });
|
|
830
920
|
this.parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
831
921
|
this.defaultErrorStateMatcher = inject(ErrorStateMatcher);
|
|
922
|
+
this.errorStateTracker = new KbqErrorStateTracker(this.defaultErrorStateMatcher, this.ngControl, this.parentFormGroup, this.parentForm);
|
|
832
923
|
/** Whether the component is in an error state. */
|
|
833
|
-
this.errorState =
|
|
924
|
+
this.errorState = this.errorStateTracker.errorState;
|
|
925
|
+
/** An object used to control when error messages are shown. */
|
|
926
|
+
this.errorStateMatcher = input(...(ngDevMode ? [undefined, { debugName: "errorStateMatcher" }] : /* istanbul ignore next */ []));
|
|
927
|
+
this.focusedValue = signal(false, ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
|
|
834
928
|
/**
|
|
835
929
|
* Implemented as part of KbqFormFieldControl.
|
|
930
|
+
*
|
|
836
931
|
* @docs-private
|
|
837
932
|
*/
|
|
838
|
-
this.focused =
|
|
933
|
+
this.focused = this.focusedValue.asReadonly();
|
|
839
934
|
/**
|
|
840
935
|
* Implemented as part of KbqFormFieldControl.
|
|
936
|
+
*
|
|
841
937
|
* @docs-private
|
|
842
938
|
*/
|
|
843
939
|
this.autofilled = kbqInjectAutofilled();
|
|
844
940
|
/**
|
|
845
941
|
* Implemented as part of KbqFormFieldControl.
|
|
942
|
+
*
|
|
846
943
|
* @docs-private
|
|
847
944
|
*/
|
|
848
|
-
this.
|
|
849
|
-
this.
|
|
945
|
+
this.controlType = 'input-password';
|
|
946
|
+
this.elementTypeValue = signal('password', ...(ngDevMode ? [{ debugName: "elementTypeValue" }] : /* istanbul ignore next */ []));
|
|
947
|
+
/** Type of the native input: `password` while the password is hidden, `text` while it is shown. */
|
|
948
|
+
this.elementType = this.elementTypeValue.asReadonly();
|
|
949
|
+
/** @docs-private */
|
|
950
|
+
this.placeholderInput = input(undefined, { ...(ngDevMode ? { debugName: "placeholderInput" } : /* istanbul ignore next */ {}), alias: 'placeholder' });
|
|
850
951
|
/**
|
|
851
952
|
* Implemented as part of KbqFormFieldControl.
|
|
953
|
+
*
|
|
852
954
|
* @docs-private
|
|
853
955
|
*/
|
|
854
|
-
this.
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
this.
|
|
858
|
-
|
|
956
|
+
this.placeholder = linkedSignal(() => this.placeholderInput(), ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
957
|
+
// Own namespace: sharing `kbq-input-` with `KbqInput` produced duplicate ids on any page holding both
|
|
958
|
+
// controls, and the form field's `<label for>` then resolved to the wrong control.
|
|
959
|
+
this.uid = inject(_IdGenerator).getId('kbq-input-password-');
|
|
960
|
+
/** @docs-private */
|
|
961
|
+
this.disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled',
|
|
962
|
+
transform: booleanAttribute });
|
|
963
|
+
/** `disabled` of the bound form control, which takes precedence over the input. */
|
|
964
|
+
this.formDisabled = signal(null, ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
965
|
+
/**
|
|
966
|
+
* Implemented as part of KbqFormFieldControl.
|
|
967
|
+
*
|
|
968
|
+
* @docs-private
|
|
969
|
+
*/
|
|
970
|
+
this.disabled = computed(() => this.formDisabled() ?? this.disabledInput(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
971
|
+
/** @docs-private */
|
|
972
|
+
this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
|
|
973
|
+
/**
|
|
974
|
+
* Implemented as part of KbqFormFieldControl.
|
|
975
|
+
*
|
|
976
|
+
* @docs-private
|
|
977
|
+
*/
|
|
978
|
+
this.id = computed(() => this.idInput() || this.uid, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
979
|
+
/**
|
|
980
|
+
* Implemented as part of KbqFormFieldControl.
|
|
981
|
+
*
|
|
982
|
+
* @docs-private
|
|
983
|
+
*/
|
|
984
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
985
|
+
/** @docs-private */
|
|
986
|
+
this.valueInput = input(undefined, { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
987
|
+
this.emptyValue = signal(true, ...(ngDevMode ? [{ debugName: "emptyValue" }] : /* istanbul ignore next */ []));
|
|
988
|
+
/**
|
|
989
|
+
* Implemented as part of KbqFormFieldControl.
|
|
990
|
+
*
|
|
991
|
+
* @docs-private
|
|
992
|
+
*/
|
|
993
|
+
this.empty = this.emptyValue.asReadonly();
|
|
859
994
|
const inputValueAccessor = inject(KBQ_INPUT_VALUE_ACCESSOR, { optional: true, self: true });
|
|
860
995
|
// If no input value accessor was explicitly specified, use the element as the input value
|
|
861
996
|
// accessor.
|
|
862
|
-
this.
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
this.
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
997
|
+
this.inputValueAccessor = inputValueAccessor || this.elementRef.nativeElement;
|
|
998
|
+
// Read once: a custom accessor may build a new value on every read.
|
|
999
|
+
const initialValue = this.inputValueAccessor.value;
|
|
1000
|
+
this.value = signal(initialValue, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1001
|
+
this.syncedValue = initialValue;
|
|
1002
|
+
this.syncedText = this.elementRef.nativeElement.value;
|
|
1003
|
+
// A bound value replaces the current one whenever the binding changes.
|
|
1004
|
+
effect(() => {
|
|
1005
|
+
const value = this.valueInput();
|
|
1006
|
+
if (value !== undefined) {
|
|
1007
|
+
untracked(() => this.value.set(value));
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
// A value set in code is written to the element on the next change detection. The one the element last agreed
|
|
1011
|
+
// on is not written back: a custom accessor that builds a new value on every read would be written on every
|
|
1012
|
+
// keystroke.
|
|
1013
|
+
effect(() => {
|
|
1014
|
+
const value = this.value();
|
|
1015
|
+
untracked(() => {
|
|
1016
|
+
if (value !== this.syncedValue) {
|
|
1017
|
+
if (this.inputValueAccessor.value !== value) {
|
|
1018
|
+
this.inputValueAccessor.value = value;
|
|
1019
|
+
}
|
|
1020
|
+
this.syncedValue = value;
|
|
1021
|
+
this.syncedText = this.elementRef.nativeElement.value;
|
|
1022
|
+
}
|
|
1023
|
+
this.emptyValue.set(this.isEmpty());
|
|
1024
|
+
});
|
|
1025
|
+
});
|
|
1026
|
+
// Browsers may not fire the blur event if the input is disabled too quickly.
|
|
1027
|
+
// Reset from here to ensure that the element doesn't become stuck.
|
|
1028
|
+
effect(() => {
|
|
1029
|
+
if (this.disabled()) {
|
|
1030
|
+
untracked(() => this.focusedValue.set(false));
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
872
1033
|
}
|
|
873
1034
|
ngDoCheck() {
|
|
874
1035
|
if (this.ngControl) {
|
|
@@ -876,6 +1037,7 @@ class KbqInputPassword {
|
|
|
876
1037
|
// error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
|
877
1038
|
// that whatever logic is in here has to be super lean or we risk destroying the performance.
|
|
878
1039
|
this.updateErrorState();
|
|
1040
|
+
this.formDisabled.set(this.ngControl.disabled);
|
|
879
1041
|
}
|
|
880
1042
|
// We need to dirty-check the native element's value, because there are some cases where
|
|
881
1043
|
// we won't be notified when it changes (e.g. the consumer isn't using forms or they're
|
|
@@ -883,23 +1045,12 @@ class KbqInputPassword {
|
|
|
883
1045
|
this.dirtyCheckNativeValue();
|
|
884
1046
|
}
|
|
885
1047
|
updateErrorState() {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
const matcher = this.errorStateMatcher || this.defaultErrorStateMatcher;
|
|
889
|
-
const control = this.ngControl ? this.ngControl.control : null;
|
|
890
|
-
const newState = matcher.isErrorState(control, parent);
|
|
891
|
-
if (newState !== oldState) {
|
|
892
|
-
this.errorState = newState;
|
|
893
|
-
this.stateChanges.next(null);
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
checkRules() {
|
|
897
|
-
this.checkRule.next();
|
|
1048
|
+
this.errorStateTracker.errorStateMatcher = this.errorStateMatcher();
|
|
1049
|
+
this.errorStateTracker.updateErrorState();
|
|
898
1050
|
}
|
|
899
1051
|
/** Toggles the native input type between password and text. */
|
|
900
1052
|
toggleType() {
|
|
901
|
-
this.
|
|
902
|
-
this.stateChanges.next(null);
|
|
1053
|
+
this.elementTypeValue.update((type) => (type === 'password' ? 'text' : 'password'));
|
|
903
1054
|
}
|
|
904
1055
|
/** Focuses the input. */
|
|
905
1056
|
focus() {
|
|
@@ -910,49 +1061,51 @@ class KbqInputPassword {
|
|
|
910
1061
|
}
|
|
911
1062
|
/** Callback for the cases where the focused state of the input changes. */
|
|
912
1063
|
focusChanged(isFocused) {
|
|
913
|
-
|
|
914
|
-
return;
|
|
915
|
-
}
|
|
916
|
-
this.focused = isFocused;
|
|
917
|
-
this.stateChanges.next({ focused: this.focused });
|
|
918
|
-
}
|
|
919
|
-
onInput() {
|
|
920
|
-
// This is a noop function and is used to let Angular know whenever the value changes.
|
|
921
|
-
// Angular will run a new change detection each time the `input` event has been dispatched.
|
|
922
|
-
// It's necessary that Angular recognizes the value change, because when floatingLabel
|
|
923
|
-
// is set to false and Angular forms aren't used, the placeholder won't recognize the
|
|
924
|
-
// value changes and will not disappear.
|
|
925
|
-
// Listening to the input event wouldn't be necessary when the input is using the
|
|
926
|
-
// FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
|
|
1064
|
+
this.focusedValue.set(isFocused);
|
|
927
1065
|
}
|
|
928
1066
|
/**
|
|
929
1067
|
* Implemented as part of KbqFormFieldControl.
|
|
1068
|
+
*
|
|
930
1069
|
* @docs-private
|
|
931
1070
|
*/
|
|
932
1071
|
onContainerClick() {
|
|
933
1072
|
this.focus();
|
|
934
1073
|
}
|
|
935
|
-
/**
|
|
1074
|
+
/**
|
|
1075
|
+
* Reads the native value back, since it changes without notice: through the forms API, which writes the
|
|
1076
|
+
* element directly, or by the user typing into an input that no form listens to.
|
|
1077
|
+
*
|
|
1078
|
+
* @docs-private
|
|
1079
|
+
*/
|
|
936
1080
|
dirtyCheckNativeValue() {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1081
|
+
const nativeValue = this.inputValueAccessor.value;
|
|
1082
|
+
const text = this.elementRef.nativeElement.value;
|
|
1083
|
+
// Only a change of the element itself: a value set in code and not yet written must not be overwritten. An
|
|
1084
|
+
// object counts as changed only with the text, as a custom accessor may build a new one on every read.
|
|
1085
|
+
if (nativeValue !== this.syncedValue && (!isObject(nativeValue) || text !== this.syncedText)) {
|
|
1086
|
+
this.syncedValue = nativeValue;
|
|
1087
|
+
this.syncedText = text;
|
|
1088
|
+
this.value.set(nativeValue);
|
|
940
1089
|
}
|
|
1090
|
+
this.emptyValue.set(this.isEmpty());
|
|
941
1091
|
}
|
|
942
1092
|
/** Checks whether the input is invalid based on the native validation. */
|
|
943
1093
|
isBadInput() {
|
|
944
1094
|
// The `validity` property won't be present on platform-server.
|
|
945
1095
|
return this.elementRef.nativeElement.validity?.badInput;
|
|
946
1096
|
}
|
|
947
|
-
|
|
948
|
-
|
|
1097
|
+
isEmpty() {
|
|
1098
|
+
return !this.elementRef.nativeElement.value && !this.isBadInput();
|
|
1099
|
+
}
|
|
1100
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputPassword, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1101
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: KbqInputPassword, isStandalone: true, selector: "input[kbqInputPassword]", inputs: { errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, placeholderInput: { classPropertyName: "placeholderInput", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "onBlur()", "focus": "focusChanged(true)", "input": "dirtyCheckNativeValue()" }, properties: { "attr.id": "id()", "attr.type": "elementType()", "attr.placeholder": "placeholder()", "attr.disabled": "disabled() || null", "attr.aria-invalid": "errorState()", "required": "required()" }, classAttribute: "kbq-input kbq-input-password" }, providers: [
|
|
949
1102
|
{
|
|
950
1103
|
provide: KbqFormFieldControl,
|
|
951
1104
|
useExisting: KbqInputPassword
|
|
952
1105
|
}
|
|
953
|
-
], exportAs: ["kbqInputPassword"],
|
|
1106
|
+
], exportAs: ["kbqInputPassword"], ngImport: i0 }); }
|
|
954
1107
|
}
|
|
955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputPassword, decorators: [{
|
|
956
1109
|
type: Directive,
|
|
957
1110
|
args: [{
|
|
958
1111
|
selector: `input[kbqInputPassword]`,
|
|
@@ -966,53 +1119,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
966
1119
|
class: 'kbq-input kbq-input-password',
|
|
967
1120
|
// Native input properties that are overwritten by Angular inputs need to be synced with
|
|
968
1121
|
// the native input element. Otherwise property bindings for those don't work.
|
|
969
|
-
'[attr.id]': 'id',
|
|
970
|
-
'[attr.type]': 'elementType',
|
|
971
|
-
'[attr.placeholder]': 'placeholder',
|
|
972
|
-
'[attr.disabled]': 'disabled || null',
|
|
973
|
-
'[
|
|
1122
|
+
'[attr.id]': 'id()',
|
|
1123
|
+
'[attr.type]': 'elementType()',
|
|
1124
|
+
'[attr.placeholder]': 'placeholder()',
|
|
1125
|
+
'[attr.disabled]': 'disabled() || null',
|
|
1126
|
+
'[attr.aria-invalid]': 'errorState()',
|
|
1127
|
+
'[required]': 'required()',
|
|
974
1128
|
'(blur)': 'onBlur()',
|
|
975
1129
|
'(focus)': 'focusChanged(true)',
|
|
976
|
-
'(input)': '
|
|
1130
|
+
'(input)': 'dirtyCheckNativeValue()'
|
|
977
1131
|
},
|
|
978
1132
|
exportAs: 'kbqInputPassword'
|
|
979
1133
|
}]
|
|
980
|
-
}], ctorParameters: () => [], propDecorators: { errorStateMatcher: [{
|
|
981
|
-
type: Input
|
|
982
|
-
}], placeholder: [{
|
|
983
|
-
type: Input
|
|
984
|
-
}], disabled: [{
|
|
985
|
-
type: Input
|
|
986
|
-
}], id: [{
|
|
987
|
-
type: Input
|
|
988
|
-
}], required: [{
|
|
989
|
-
type: Input
|
|
990
|
-
}], value: [{
|
|
991
|
-
type: Input
|
|
992
|
-
}] } });
|
|
1134
|
+
}], ctorParameters: () => [], propDecorators: { errorStateMatcher: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorStateMatcher", required: false }] }], placeholderInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
993
1135
|
|
|
994
1136
|
class KbqInputModule {
|
|
995
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
996
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1137
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1138
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: KbqInputModule, imports: [A11yModule,
|
|
997
1139
|
FormsModule,
|
|
998
1140
|
KbqIconModule,
|
|
999
1141
|
KbqInput,
|
|
1000
1142
|
KbqNumberInput,
|
|
1001
1143
|
KbqInputPassword,
|
|
1002
1144
|
KbqInputMono,
|
|
1003
|
-
|
|
1004
|
-
|
|
1145
|
+
KbqMinValidator,
|
|
1146
|
+
KbqMaxValidator], exports: [KbqInput,
|
|
1005
1147
|
KbqNumberInput,
|
|
1006
1148
|
KbqInputPassword,
|
|
1007
1149
|
KbqInputMono,
|
|
1008
|
-
|
|
1009
|
-
|
|
1150
|
+
KbqMinValidator,
|
|
1151
|
+
KbqMaxValidator,
|
|
1010
1152
|
KbqFormFieldModule] }); }
|
|
1011
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1153
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputModule, imports: [A11yModule,
|
|
1012
1154
|
FormsModule,
|
|
1013
1155
|
KbqIconModule, KbqFormFieldModule] }); }
|
|
1014
1156
|
}
|
|
1015
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqInputModule, decorators: [{
|
|
1016
1158
|
type: NgModule,
|
|
1017
1159
|
args: [{
|
|
1018
1160
|
imports: [
|
|
@@ -1023,16 +1165,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
1023
1165
|
KbqNumberInput,
|
|
1024
1166
|
KbqInputPassword,
|
|
1025
1167
|
KbqInputMono,
|
|
1026
|
-
|
|
1027
|
-
|
|
1168
|
+
KbqMinValidator,
|
|
1169
|
+
KbqMaxValidator
|
|
1028
1170
|
],
|
|
1029
1171
|
exports: [
|
|
1030
1172
|
KbqInput,
|
|
1031
1173
|
KbqNumberInput,
|
|
1032
1174
|
KbqInputPassword,
|
|
1033
1175
|
KbqInputMono,
|
|
1034
|
-
|
|
1035
|
-
|
|
1176
|
+
KbqMinValidator,
|
|
1177
|
+
KbqMaxValidator,
|
|
1036
1178
|
KbqFormFieldModule
|
|
1037
1179
|
]
|
|
1038
1180
|
}]
|
|
@@ -1042,5 +1184,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
1042
1184
|
* Generated bundle index. Do not edit.
|
|
1043
1185
|
*/
|
|
1044
1186
|
|
|
1045
|
-
export { BIG_STEP, KBQ_INPUT_NUMBER_DEFAULT_CONFIGURATION, KBQ_INPUT_VALUE_ACCESSOR, KBQ_NUMBER_INPUT_VALUE_ACCESSOR, KbqInput, KbqInputModule, KbqInputMono, KbqInputPassword,
|
|
1187
|
+
export { BIG_STEP, KBQ_INPUT_DEFAULT_LOCALE_CONFIGURATION, KBQ_INPUT_LOCALE_CONFIGURATION, KBQ_INPUT_NUMBER_DEFAULT_CONFIGURATION, KBQ_INPUT_VALUE_ACCESSOR, KBQ_MAX_VALIDATOR, KBQ_MIN_VALIDATOR, KBQ_NUMBER_INPUT_VALUE_ACCESSOR, KbqInput, KbqInputModule, KbqInputMono, KbqInputPassword, KbqMaxValidator, KbqMinValidator, KbqNumberInput, SMALL_STEP, add, getPrecision, isFloat, kbqInputLocaleConfigurationProvider };
|
|
1046
1188
|
//# sourceMappingURL=koobiq-components-input.mjs.map
|