@koobiq/components 20.4.2 → 21.0.1
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 +791 -609
- 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 +2871 -2595
- 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 +400 -149
- 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 +463 -143
- 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 +734 -488
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +1700 -617
- 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 +415 -18
- package/schematics/migrations/accordion-state-saving-default/README.md +60 -0
- package/schematics/migrations/accordion-state-saving-default/data.cjs +75 -0
- package/schematics/migrations/accordion-state-saving-default/index.cjs +61 -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.cjs +47 -0
- package/schematics/migrations/actions-panel-overlay-container/index.cjs +55 -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 → data.cjs} +3 -0
- package/schematics/migrations/alert-signals/index.cjs +221 -0
- package/schematics/migrations/angular-animations-removal/README.md +46 -0
- package/schematics/migrations/angular-animations-removal/data.cjs +150 -0
- package/schematics/migrations/angular-animations-removal/index.cjs +21 -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.cjs +136 -0
- package/schematics/migrations/app-switcher-signals/index.cjs +366 -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 → index.cjs} +6 -5
- package/schematics/migrations/autocomplete-signals/README.md +92 -0
- package/schematics/migrations/autocomplete-signals/data.cjs +149 -0
- package/schematics/migrations/autocomplete-signals/index.cjs +707 -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.cjs +109 -0
- package/schematics/migrations/badge-signals/index.cjs +694 -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.cjs +136 -0
- package/schematics/migrations/button-state-and-styles/index.cjs +221 -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.cjs +106 -0
- package/schematics/migrations/button-supported-colors/index.cjs +261 -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.cjs +200 -0
- package/schematics/migrations/button-toggle-signals-and-aria/index.cjs +497 -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.cjs +88 -0
- package/schematics/migrations/button-truncation/index.cjs +270 -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.cjs +114 -0
- package/schematics/migrations/checkbox-signals/index.cjs +635 -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.cjs +101 -0
- package/schematics/migrations/clamped-text-disclosure/index.cjs +60 -0
- package/schematics/migrations/clamped-text-disclosure/schema.json +15 -0
- package/schematics/migrations/code-block-highlight-js-core/README.md +53 -0
- package/schematics/migrations/code-block-highlight-js-core/data.cjs +64 -0
- package/schematics/migrations/code-block-highlight-js-core/index.cjs +319 -0
- package/schematics/migrations/code-block-highlight-js-core/schema.json +20 -0
- package/schematics/migrations/code-block-signals/README.md +84 -0
- package/schematics/migrations/code-block-signals/data.cjs +121 -0
- package/schematics/migrations/code-block-signals/index.cjs +701 -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.cjs +131 -0
- package/schematics/migrations/color-signals/index.cjs +20 -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.cjs +27 -0
- package/schematics/migrations/core-mixins-removal/index.cjs +18 -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 → index.cjs} +4 -3
- package/schematics/migrations/datepicker-signals/README.md +24 -0
- package/schematics/migrations/datepicker-signals/data.cjs +49 -0
- package/schematics/migrations/datepicker-signals/index.cjs +18 -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 → index.cjs} +8 -7
- package/schematics/migrations/design-tokens-v4/README.md +75 -0
- package/schematics/migrations/design-tokens-v4/index.cjs +60 -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.cjs +62 -0
- package/schematics/migrations/divider-signals-and-aria/index.cjs +212 -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.cjs +85 -0
- package/schematics/migrations/dl-attribute-coercion/index.cjs +162 -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.cjs +44 -0
- package/schematics/migrations/dl-standalone-names/index.cjs +322 -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.cjs +84 -0
- package/schematics/migrations/dropdown-demote-overlay/index.cjs +289 -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.cjs +152 -0
- package/schematics/migrations/dropdown-signals/index.cjs +20 -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.cjs +85 -0
- package/schematics/migrations/empty-state-error-color/index.cjs +72 -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 → index.cjs} +6 -5
- package/schematics/migrations/file-upload-cva-and-primitives/README.md +70 -0
- package/schematics/migrations/file-upload-cva-and-primitives/data.cjs +97 -0
- package/schematics/migrations/file-upload-cva-and-primitives/index.cjs +61 -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.cjs +20 -0
- package/schematics/migrations/file-upload-deprecated-outputs/index.cjs +71 -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.cjs +151 -0
- package/schematics/migrations/filter-bar-rename-action/index.cjs +178 -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 → data.cjs} +1 -2
- package/schematics/migrations/filter-bar-signals/index.cjs +225 -0
- package/schematics/migrations/filter-bar-state-saving-default/README.md +53 -0
- package/schematics/migrations/filter-bar-state-saving-default/data.cjs +87 -0
- package/schematics/migrations/filter-bar-state-saving-default/index.cjs +62 -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.cjs +58 -0
- package/schematics/migrations/flag-inner-html/index.cjs +62 -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.cjs +288 -0
- package/schematics/migrations/form-field-signals/index.cjs +383 -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.cjs +97 -0
- package/schematics/migrations/icon-semantics-and-api/index.cjs +65 -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 → index.cjs} +4 -3
- package/schematics/migrations/inline-edit-a11y-and-types/README.md +82 -0
- package/schematics/migrations/inline-edit-a11y-and-types/data.cjs +117 -0
- package/schematics/migrations/inline-edit-a11y-and-types/index.cjs +98 -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.cjs +135 -0
- package/schematics/migrations/input-number-surface/index.cjs +293 -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.cjs +30 -0
- package/schematics/migrations/input-signals/index.cjs +18 -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.cjs +20 -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.cjs +116 -0
- package/schematics/migrations/link-signals/index.cjs +416 -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.cjs +35 -0
- package/schematics/migrations/list-signals/index.cjs +18 -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.cjs +74 -0
- package/schematics/migrations/list-tree-multiple-input/index.cjs +222 -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.cjs +101 -0
- package/schematics/migrations/loader-overlay-signals/index.cjs +698 -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 → index.cjs} +6 -5
- package/schematics/migrations/locale-configuration-providers/README.md +163 -0
- package/schematics/migrations/locale-configuration-providers/data.cjs +257 -0
- package/schematics/migrations/locale-configuration-providers/index.cjs +295 -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.cjs +43 -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.cjs +79 -0
- package/schematics/migrations/markdown-signals/index.cjs +640 -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.cjs +110 -0
- package/schematics/migrations/modal-dialog-semantics/index.cjs +59 -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.cjs +132 -0
- package/schematics/migrations/modal-signals/index.cjs +20 -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.cjs +198 -0
- package/schematics/migrations/navbar-signals-and-aria/index.cjs +569 -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 → index.cjs} +8 -7
- package/schematics/migrations/notification-center-signals/README.md +67 -0
- package/schematics/migrations/notification-center-signals/data.cjs +66 -0
- package/schematics/migrations/notification-center-signals/index.cjs +62 -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.cjs +86 -0
- package/schematics/migrations/option-signals/index.cjs +20 -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.cjs +61 -0
- package/schematics/migrations/popover-leave-delay/index.cjs +55 -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.cjs +76 -0
- package/schematics/migrations/progress-bar-percentage-and-aria/index.cjs +59 -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.cjs +83 -0
- package/schematics/migrations/progress-spinner-signals/index.cjs +695 -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.cjs +70 -0
- package/schematics/migrations/query-list-signals/index.cjs +18 -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.cjs +163 -0
- package/schematics/migrations/radio-signals-and-aria/index.cjs +40 -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.cjs +45 -0
- package/schematics/migrations/read-state-dwell-handlers/index.cjs +216 -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.cjs +21 -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.cjs +99 -0
- package/schematics/migrations/select-signal-inputs/index.cjs +58 -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.cjs +111 -0
- package/schematics/migrations/sidepanel-non-modal-behavior/index.cjs +58 -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.cjs +69 -0
- package/schematics/migrations/signal-inputs-subclasses/index.cjs +18 -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.cjs +53 -0
- package/schematics/migrations/split-button-optional-disabled/index.cjs +58 -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.cjs +21 -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.cjs +88 -0
- package/schematics/migrations/state-saving-default/index.cjs +63 -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.cjs +66 -0
- package/schematics/migrations/table-cell-content/index.cjs +67 -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.cjs +139 -0
- package/schematics/migrations/tabs-signals-and-aria/index.cjs +66 -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.cjs +42 -0
- package/schematics/migrations/tag-list-cleaner/index.cjs +197 -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.cjs +191 -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.cjs +103 -0
- package/schematics/migrations/tags-signals/index.cjs +674 -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.cjs +121 -0
- package/schematics/migrations/textarea-signals/index.cjs +380 -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.cjs +139 -0
- package/schematics/migrations/time-range-title-for/index.cjs +164 -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.cjs +82 -0
- package/schematics/migrations/timepicker-signals/index.cjs +710 -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.cjs +101 -0
- package/schematics/migrations/timezone-grouping-utils/index.cjs +65 -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.cjs +69 -0
- package/schematics/migrations/title-encapsulation/index.cjs +58 -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.cjs +79 -0
- package/schematics/migrations/toast-stack-and-defaults/index.cjs +54 -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.cjs +89 -0
- package/schematics/migrations/tooltip-pointer-events-and-types/index.cjs +61 -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.cjs +56 -0
- package/schematics/migrations/top-bar-container-selectors/index.cjs +85 -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.cjs +106 -0
- package/schematics/migrations/tree-select-signals/index.cjs +59 -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.cjs +123 -0
- package/schematics/migrations/tree-signals/index.cjs +55 -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.cjs +78 -0
- package/schematics/migrations/tree-state-saving-default/index.cjs +61 -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.cjs +78 -0
- package/schematics/migrations/username-pipe-injection/index.cjs +59 -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 → data.cjs} +124 -77
- package/schematics/migrations/v20-upgrade/index.cjs +19 -0
- package/schematics/migrations/v21-upgrade/README.md +271 -0
- package/schematics/migrations/v21-upgrade/data.cjs +1371 -0
- package/schematics/migrations/v21-upgrade/index.cjs +95 -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.cjs +29 -0
- package/schematics/migrations/zoneless-change-detection/index.cjs +21 -0
- package/schematics/migrations/zoneless-change-detection/schema.json +15 -0
- package/schematics/migrations.json +401 -6
- package/schematics/ng-add/index.cjs +266 -0
- package/schematics/ng-add/schema.json +15 -0
- package/schematics/utils/{angular-parsing.js → angular-parsing.cjs} +2 -2
- package/schematics/utils/deprecated-path-migration.cjs +62 -0
- package/schematics/utils/html-config.cjs +148 -0
- package/schematics/utils/{icon-migration.js → icon-migration.cjs} +2 -2
- package/schematics/utils/list-item-pattern.cjs +16 -0
- package/schematics/utils/{package-config.js → package-config.cjs} +3 -32
- package/schematics/utils/project-files.cjs +25 -0
- package/schematics/utils/replacement-driver.cjs +337 -0
- package/schematics/utils/safe-rule.cjs +23 -0
- package/schematics/utils/signal-members-migration.cjs +779 -0
- package/schematics/utils/tag-patterns.cjs +21 -0
- package/schematics/utils/template-ref-access.cjs +155 -0
- package/schematics/utils/{typescript.js → typescript.cjs} +1 -1
- package/schematics/utils/warn-only-migration.cjs +52 -0
- package/schematics/utils/workspace-styles.cjs +123 -0
- 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} +150 -88
- 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 +670 -0
- package/types/koobiq-components-tree.d.ts +1339 -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/schematics/migrations/alert-signals/index.js +0 -353
- package/schematics/migrations/filter-bar-signals/index.js +0 -319
- package/schematics/migrations/v20-upgrade/index.js +0 -225
- package/schematics/ng-add/index.js +0 -39
- 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 -178
- 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/schematics/migrations/css-selectors/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/deprecated-icons/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/icons-replacement/{data.js → data.cjs} +0 -0
- /package/schematics/migrations/new-icons-pack/{data.js → data.cjs} +0 -0
- /package/schematics/utils/{ast.js → ast.cjs} +0 -0
- /package/schematics/utils/{messages.js → messages.cjs} +0 -0
- /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
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ts = require('typescript');
|
|
4
|
+
var utils_ast = require('./ast.cjs');
|
|
5
|
+
var utils_messages = require('./messages.cjs');
|
|
6
|
+
var utils_packageConfig = require('./package-config.cjs');
|
|
7
|
+
var utils_projectFiles = require('./project-files.cjs');
|
|
8
|
+
var utils_typescript = require('./typescript.cjs');
|
|
9
|
+
require('@angular-devkit/schematics');
|
|
10
|
+
require('@schematics/angular/utility');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Shared engine for the `<component>-signals` migrations: rewrites property reads of members that became
|
|
14
|
+
* signals into calls, in TypeScript code and in templates, and reports what it cannot rewrite.
|
|
15
|
+
*
|
|
16
|
+
* A migration supplies the policy — which types, which members, which of them stay writable — and this
|
|
17
|
+
* module supplies the mechanism: resolving which expressions actually denote one of those types, and
|
|
18
|
+
* editing only the reads that belong to them.
|
|
19
|
+
*/
|
|
20
|
+
const TS_EXT = '.ts';
|
|
21
|
+
const HTML_EXT = '.html';
|
|
22
|
+
/** Signal-API methods reachable on a signal; a read followed by one is already migrated. */
|
|
23
|
+
const SIGNAL_API_METHODS = new Set(['set', 'update', 'asReadonly', 'subscribe']);
|
|
24
|
+
/** Factories whose single argument gives the type of the declaration they set up. */
|
|
25
|
+
const TYPING_FACTORIES = new Set(['inject', 'viewChild', 'contentChild']);
|
|
26
|
+
function escapeRegExp(value) {
|
|
27
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
28
|
+
}
|
|
29
|
+
/** Applies text-span edits to `content`, right-to-left, so earlier edits don't shift later offsets. */
|
|
30
|
+
function applyEdits(content, edits) {
|
|
31
|
+
const sorted = [...edits].sort((a, b) => b.start - a.start || b.end - a.end);
|
|
32
|
+
let result = content;
|
|
33
|
+
for (const { start, end, text } of sorted) {
|
|
34
|
+
result = result.slice(0, start) + text + result.slice(end);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/** Walks up from `node` to the nearest ancestor matching `predicate`. */
|
|
39
|
+
function findAncestor(node, predicate) {
|
|
40
|
+
let current = node.parent;
|
|
41
|
+
while (current) {
|
|
42
|
+
if (predicate(current))
|
|
43
|
+
return current;
|
|
44
|
+
current = current.parent;
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Nodes that open a new binding scope. `ts.isFunctionLike` rather than a hand-rolled list of declarations,
|
|
50
|
+
* so a parameter of a `FunctionTypeNode` or a `MethodSignature` is bounded by its type instead of falling
|
|
51
|
+
* back to the whole file. Blocks and loops are included because `let`/`const` are block-scoped.
|
|
52
|
+
*/
|
|
53
|
+
const opensScope = (node) => ts.isFunctionLike(node) ||
|
|
54
|
+
ts.isBlock(node) ||
|
|
55
|
+
ts.isCaseBlock(node) ||
|
|
56
|
+
ts.isModuleBlock(node) ||
|
|
57
|
+
ts.isForStatement(node) ||
|
|
58
|
+
ts.isForInStatement(node) ||
|
|
59
|
+
ts.isForOfStatement(node) ||
|
|
60
|
+
ts.isCatchClause(node) ||
|
|
61
|
+
ts.isClassLike(node) ||
|
|
62
|
+
ts.isSourceFile(node);
|
|
63
|
+
/** Nodes that rebind `this`, so `this.panel` inside them is a different object. Arrows don't. */
|
|
64
|
+
const rebindsThis = (node) => ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) || ts.isClassLike(node);
|
|
65
|
+
/** Whether `node` sits inside `scope` without crossing a `barrier` node on the way up. */
|
|
66
|
+
function reachesScope(node, scope, barrier) {
|
|
67
|
+
let current = node.parent;
|
|
68
|
+
while (current && current !== scope) {
|
|
69
|
+
if (barrier(current))
|
|
70
|
+
return false;
|
|
71
|
+
current = current.parent;
|
|
72
|
+
}
|
|
73
|
+
return current === scope;
|
|
74
|
+
}
|
|
75
|
+
/** Whether a type annotation names `typeName` directly (not through a union, array or type argument). */
|
|
76
|
+
function isTypeReference(type, typeName) {
|
|
77
|
+
return !!type && ts.isTypeReferenceNode(type) && ts.isIdentifier(type.typeName) && type.typeName.text === typeName;
|
|
78
|
+
}
|
|
79
|
+
const FIELD_MODIFIERS = new Set([
|
|
80
|
+
ts.SyntaxKind.PrivateKeyword,
|
|
81
|
+
ts.SyntaxKind.PublicKeyword,
|
|
82
|
+
ts.SyntaxKind.ProtectedKeyword,
|
|
83
|
+
ts.SyntaxKind.ReadonlyKeyword
|
|
84
|
+
]);
|
|
85
|
+
/** Every value declaration that introduces a plain identifier, with the scope it is visible in. */
|
|
86
|
+
function collectBindings(sourceFile) {
|
|
87
|
+
const bindings = [];
|
|
88
|
+
const add = (name, declaration, scope) => bindings.push({ name, declaration, scope: scope ?? sourceFile });
|
|
89
|
+
const visit = (node) => {
|
|
90
|
+
if (ts.isParameter(node) && ts.isIdentifier(node.name)) {
|
|
91
|
+
add(node.name.text, node, findAncestor(node, ts.isFunctionLike));
|
|
92
|
+
}
|
|
93
|
+
else if ((ts.isVariableDeclaration(node) || ts.isBindingElement(node)) && ts.isIdentifier(node.name)) {
|
|
94
|
+
add(node.name.text, node, findAncestor(node, opensScope));
|
|
95
|
+
}
|
|
96
|
+
else if ((ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)) && node.name) {
|
|
97
|
+
add(node.name.text, node, findAncestor(node, opensScope));
|
|
98
|
+
}
|
|
99
|
+
else if ((ts.isImportSpecifier(node) || ts.isImportClause(node)) && node.name) {
|
|
100
|
+
add(node.name.text, node, sourceFile);
|
|
101
|
+
}
|
|
102
|
+
node.forEachChild(visit);
|
|
103
|
+
};
|
|
104
|
+
visit(sourceFile);
|
|
105
|
+
return bindings;
|
|
106
|
+
}
|
|
107
|
+
/** The declaration `name` binds to at `pos`: the innermost enclosing scope that declares it. */
|
|
108
|
+
function resolveBinding(bindings, name, pos) {
|
|
109
|
+
let best;
|
|
110
|
+
let bestWidth = Number.POSITIVE_INFINITY;
|
|
111
|
+
for (const binding of bindings) {
|
|
112
|
+
if (binding.name !== name)
|
|
113
|
+
continue;
|
|
114
|
+
const start = binding.scope.getStart();
|
|
115
|
+
const end = binding.scope.getEnd();
|
|
116
|
+
if (pos < start || pos > end)
|
|
117
|
+
continue;
|
|
118
|
+
const width = end - start;
|
|
119
|
+
if (width < bestWidth) {
|
|
120
|
+
best = binding;
|
|
121
|
+
bestWidth = width;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return best?.declaration;
|
|
125
|
+
}
|
|
126
|
+
/** Local names `exported` is bound to in this file, including aliased imports. */
|
|
127
|
+
function localTypeNames(sourceFile, exported) {
|
|
128
|
+
const names = new Set([exported]);
|
|
129
|
+
const visit = (node) => {
|
|
130
|
+
if (ts.isImportSpecifier(node) && (node.propertyName?.text ?? node.name.text) === exported) {
|
|
131
|
+
names.add(node.name.text);
|
|
132
|
+
}
|
|
133
|
+
node.forEachChild(visit);
|
|
134
|
+
};
|
|
135
|
+
visit(sourceFile);
|
|
136
|
+
return [...names];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Whether an initializer types its declaration as `typeName`, for the shapes a modern Angular consumer
|
|
140
|
+
* writes: `inject(KbqDropdown)`, `viewChild(KbqDropdown)`, `viewChild.required(…)`, `contentChild(…)`.
|
|
141
|
+
* Also reports whether the declaration is a signal query, whose instance sits behind a call of its own.
|
|
142
|
+
*/
|
|
143
|
+
function initializerTypeOf(initializer, typeName) {
|
|
144
|
+
const none = { matches: false, signalQuery: false };
|
|
145
|
+
if (!initializer || !ts.isCallExpression(initializer))
|
|
146
|
+
return none;
|
|
147
|
+
const callee = initializer.expression;
|
|
148
|
+
const name = ts.isIdentifier(callee)
|
|
149
|
+
? callee.text
|
|
150
|
+
: ts.isPropertyAccessExpression(callee) && ts.isIdentifier(callee.expression)
|
|
151
|
+
? callee.expression.text
|
|
152
|
+
: undefined;
|
|
153
|
+
if (!name || !TYPING_FACTORIES.has(name))
|
|
154
|
+
return none;
|
|
155
|
+
const [arg] = initializer.arguments;
|
|
156
|
+
if (!arg || !ts.isIdentifier(arg) || arg.text !== typeName)
|
|
157
|
+
return none;
|
|
158
|
+
return { matches: true, signalQuery: name !== 'inject' };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Collects the receivers of one type: method/function params, class fields (incl.
|
|
162
|
+
* `@ViewChild(KbqDropdown) x: KbqDropdown`, constructor parameter-properties and the `inject()` /
|
|
163
|
+
* `viewChild()` initializer forms) and typed locals. Annotations that resolve are recorded in `resolved`,
|
|
164
|
+
* so the caller can report the mentions this pass could not turn into a receiver.
|
|
165
|
+
*/
|
|
166
|
+
function collectReceivers(sourceFile, typeName, ownerType, resolved) {
|
|
167
|
+
const receivers = [];
|
|
168
|
+
const add = (text, declaration, scope, signalQuery = false) => receivers.push({ text, declaration, scope: scope ?? sourceFile, type: ownerType, signalQuery });
|
|
169
|
+
const visit = (node) => {
|
|
170
|
+
if (ts.isParameter(node) && ts.isIdentifier(node.name) && isTypeReference(node.type, typeName)) {
|
|
171
|
+
resolved?.add(node.type);
|
|
172
|
+
add(node.name.text, node, findAncestor(node, ts.isFunctionLike));
|
|
173
|
+
// A constructor parameter-property is also a class field, reachable as `this.<name>`.
|
|
174
|
+
if (node.modifiers?.some((modifier) => FIELD_MODIFIERS.has(modifier.kind))) {
|
|
175
|
+
const owner = findAncestor(node, ts.isClassDeclaration);
|
|
176
|
+
if (owner)
|
|
177
|
+
add(`this.${node.name.text}`, node, owner);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else if (ts.isPropertyDeclaration(node) && ts.isIdentifier(node.name)) {
|
|
181
|
+
const owner = findAncestor(node, ts.isClassDeclaration);
|
|
182
|
+
const annotated = isTypeReference(node.type, typeName);
|
|
183
|
+
const { matches, signalQuery } = initializerTypeOf(node.initializer, typeName);
|
|
184
|
+
if (owner && (annotated || matches)) {
|
|
185
|
+
if (annotated)
|
|
186
|
+
resolved?.add(node.type);
|
|
187
|
+
add(`this.${node.name.text}`, node, owner, signalQuery);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {
|
|
191
|
+
const annotated = isTypeReference(node.type, typeName);
|
|
192
|
+
const { matches, signalQuery } = initializerTypeOf(node.initializer, typeName);
|
|
193
|
+
if (annotated || matches) {
|
|
194
|
+
if (annotated)
|
|
195
|
+
resolved?.add(node.type);
|
|
196
|
+
add(node.name.text, node, findAncestor(node, opensScope), signalQuery);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
node.forEachChild(visit);
|
|
200
|
+
};
|
|
201
|
+
visit(sourceFile);
|
|
202
|
+
return receivers;
|
|
203
|
+
}
|
|
204
|
+
/** Every receiver in the file, across every migrated type and every local alias of it. */
|
|
205
|
+
function collectAllReceivers(sourceFile, types, resolved) {
|
|
206
|
+
return types.flatMap((type) => localTypeNames(sourceFile, type).flatMap((name) => collectReceivers(sourceFile, name, type, resolved)));
|
|
207
|
+
}
|
|
208
|
+
/** Strips the wrappers that do not change which object an access reads from. */
|
|
209
|
+
function unwrapReceiver(node) {
|
|
210
|
+
let current = node;
|
|
211
|
+
while (ts.isNonNullExpression(current) || ts.isParenthesizedExpression(current)) {
|
|
212
|
+
current = current.expression;
|
|
213
|
+
}
|
|
214
|
+
return current;
|
|
215
|
+
}
|
|
216
|
+
/** The receiver a property access resolves to at this exact position, if any. */
|
|
217
|
+
function resolveReceiver(expression, at, sourceFile, receivers, bindings) {
|
|
218
|
+
const inner = unwrapReceiver(expression);
|
|
219
|
+
// `this . panel` and `this /* x */ . panel` spell the same receiver as `this.panel`.
|
|
220
|
+
const text = ts.isPropertyAccessExpression(inner)
|
|
221
|
+
? `${inner.expression.getText(sourceFile).replace(/\s+/g, '')}.${inner.name.text}`
|
|
222
|
+
: inner.getText(sourceFile);
|
|
223
|
+
return receivers.find((receiver) => {
|
|
224
|
+
if (receiver.text !== text)
|
|
225
|
+
return false;
|
|
226
|
+
// For `this.panel`, a nested `function` or class changes what `this` is; an arrow does not.
|
|
227
|
+
// For a bare `panel`, a nested redeclaration of the same name shadows the receiver.
|
|
228
|
+
if (receiver.text.startsWith('this.'))
|
|
229
|
+
return reachesScope(at, receiver.scope, rebindsThis);
|
|
230
|
+
return (reachesScope(at, receiver.scope, () => false) &&
|
|
231
|
+
resolveBinding(bindings, receiver.text, at.getStart(sourceFile)) === receiver.declaration);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/** Binary operators that make their left operand a write target rather than a read. */
|
|
235
|
+
const ASSIGNMENT_OPERATORS = new Set([
|
|
236
|
+
ts.SyntaxKind.EqualsToken,
|
|
237
|
+
ts.SyntaxKind.PlusEqualsToken,
|
|
238
|
+
ts.SyntaxKind.MinusEqualsToken,
|
|
239
|
+
ts.SyntaxKind.AsteriskEqualsToken,
|
|
240
|
+
ts.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
241
|
+
ts.SyntaxKind.SlashEqualsToken,
|
|
242
|
+
ts.SyntaxKind.PercentEqualsToken,
|
|
243
|
+
ts.SyntaxKind.LessThanLessThanEqualsToken,
|
|
244
|
+
ts.SyntaxKind.GreaterThanGreaterThanEqualsToken,
|
|
245
|
+
ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,
|
|
246
|
+
ts.SyntaxKind.AmpersandEqualsToken,
|
|
247
|
+
ts.SyntaxKind.BarEqualsToken,
|
|
248
|
+
ts.SyntaxKind.CaretEqualsToken,
|
|
249
|
+
ts.SyntaxKind.BarBarEqualsToken,
|
|
250
|
+
ts.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
251
|
+
ts.SyntaxKind.QuestionQuestionEqualsToken
|
|
252
|
+
]);
|
|
253
|
+
/** The unary operators that write their operand: `!x.member` and `-x.member` are reads. */
|
|
254
|
+
const INCREMENT_OPERATORS = new Set([ts.SyntaxKind.PlusPlusToken, ts.SyntaxKind.MinusMinusToken]);
|
|
255
|
+
/** Whether `node` sits on the left of a destructuring assignment, where it is written rather than read. */
|
|
256
|
+
function isDestructuringTarget(node) {
|
|
257
|
+
let current = node;
|
|
258
|
+
while (ts.isPropertyAssignment(current.parent) ||
|
|
259
|
+
ts.isShorthandPropertyAssignment(current.parent) ||
|
|
260
|
+
ts.isSpreadAssignment(current.parent) ||
|
|
261
|
+
ts.isSpreadElement(current.parent) ||
|
|
262
|
+
ts.isObjectLiteralExpression(current.parent) ||
|
|
263
|
+
ts.isArrayLiteralExpression(current.parent)) {
|
|
264
|
+
current = current.parent;
|
|
265
|
+
}
|
|
266
|
+
return (ts.isBinaryExpression(current.parent) &&
|
|
267
|
+
current.parent.left === current &&
|
|
268
|
+
ASSIGNMENT_OPERATORS.has(current.parent.operatorToken.kind));
|
|
269
|
+
}
|
|
270
|
+
/** Whether `node` is written rather than read: by any assignment, `++` / `--`, `delete` or destructuring. */
|
|
271
|
+
function isWriteTarget(node) {
|
|
272
|
+
const parent = node.parent;
|
|
273
|
+
return ((ts.isBinaryExpression(parent) &&
|
|
274
|
+
parent.left === node &&
|
|
275
|
+
ASSIGNMENT_OPERATORS.has(parent.operatorToken.kind)) ||
|
|
276
|
+
((ts.isPostfixUnaryExpression(parent) || ts.isPrefixUnaryExpression(parent)) &&
|
|
277
|
+
INCREMENT_OPERATORS.has(parent.operator)) ||
|
|
278
|
+
ts.isDeleteExpression(parent) ||
|
|
279
|
+
isDestructuringTarget(node));
|
|
280
|
+
}
|
|
281
|
+
/** Whether `node` is the target of a plain `=`, the one write that translates to `.set()`. */
|
|
282
|
+
function isPlainAssignment(node) {
|
|
283
|
+
const parent = node.parent;
|
|
284
|
+
return (ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken);
|
|
285
|
+
}
|
|
286
|
+
/** Classifies a matched property access and appends the resulting edit(s). */
|
|
287
|
+
function classifyAccess(node, sourceFile, writableMembers, edits) {
|
|
288
|
+
const parent = node.parent;
|
|
289
|
+
// Already migrated: `x.member()` (call) or `x.member.set(...)` and the rest of the signal API.
|
|
290
|
+
if (ts.isCallExpression(parent) && parent.expression === node)
|
|
291
|
+
return;
|
|
292
|
+
if (ts.isPropertyAccessExpression(parent) && parent.expression === node && SIGNAL_API_METHODS.has(parent.name.text))
|
|
293
|
+
return;
|
|
294
|
+
// Write target: `x.member = RHS` and every compound form (`+=`, `||=`, …). A writable member has a
|
|
295
|
+
// mechanical translation to `.set(...)`; a read-only `input()` does not, so the write is left untouched
|
|
296
|
+
// and becomes a compile error the consumer fixes by hand. Appending `()` would produce unparseable
|
|
297
|
+
// TypeScript instead. Only a plain `=` translates: `x.member += 1` would need to read and write at once.
|
|
298
|
+
if (ts.isBinaryExpression(parent) && parent.left === node && ASSIGNMENT_OPERATORS.has(parent.operatorToken.kind)) {
|
|
299
|
+
if (isPlainAssignment(node) && writableMembers.has(node.name.text)) {
|
|
300
|
+
const rhs = parent.right;
|
|
301
|
+
edits.push({ start: node.getEnd(), end: rhs.getStart(sourceFile), text: '.set(' });
|
|
302
|
+
edits.push({ start: rhs.getEnd(), end: rhs.getEnd(), text: ')' });
|
|
303
|
+
}
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
// `x.member++` / `--x.member`, `delete x.member` and a destructuring target are writes too, for the same
|
|
307
|
+
// reason.
|
|
308
|
+
if (isWriteTarget(node))
|
|
309
|
+
return;
|
|
310
|
+
// Read (incl. optional chain `x?.member`): append `()`.
|
|
311
|
+
edits.push({ start: node.getEnd(), end: node.getEnd(), text: '()' });
|
|
312
|
+
}
|
|
313
|
+
/** Collects edits for every read of a signal member on a known receiver. */
|
|
314
|
+
function collectAccessEdits(sourceFile, config, receivers, bindings) {
|
|
315
|
+
const edits = [];
|
|
316
|
+
const visit = (node) => {
|
|
317
|
+
if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name)) {
|
|
318
|
+
const receiver = resolveReceiver(node.expression, node, sourceFile, receivers, bindings);
|
|
319
|
+
// Each type owns its own members, so a read only counts on the type that declares it. A signal
|
|
320
|
+
// query holds the instance behind a call of its own, making the read `query().member()`;
|
|
321
|
+
// appending one `()` would be wrong in both halves, so it is left to the warning.
|
|
322
|
+
if (receiver && !receiver.signalQuery && config.membersByType[receiver.type]?.includes(node.name.text)) {
|
|
323
|
+
classifyAccess(node, sourceFile, config.writableMembers, edits);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
node.forEachChild(visit);
|
|
327
|
+
};
|
|
328
|
+
visit(sourceFile);
|
|
329
|
+
return edits;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* 1-based lines where a migrated type is named in a position `collectReceivers` cannot resolve — a union,
|
|
333
|
+
* an array, a `QueryList<…>`, a cast, a return type — plus the reads the access pass structurally cannot
|
|
334
|
+
* reach: `panel['items']` and `const { items } = panel`.
|
|
335
|
+
*/
|
|
336
|
+
function collectUnresolvedMentions(sourceFile, config, resolved, typeNames, receivers, bindings) {
|
|
337
|
+
const lines = new Set();
|
|
338
|
+
const members = [...Object.values(config.membersByType).flat(), ...(config.protectedMembers ?? [])];
|
|
339
|
+
const report = (node) => lines.add(sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + 1);
|
|
340
|
+
const isReceiver = (expression, at) => !!resolveReceiver(expression, at, sourceFile, receivers, bindings);
|
|
341
|
+
const visit = (node) => {
|
|
342
|
+
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && typeNames.includes(node.typeName.text)) {
|
|
343
|
+
if (!resolved.has(node))
|
|
344
|
+
report(node);
|
|
345
|
+
}
|
|
346
|
+
else if (ts.isElementAccessExpression(node) &&
|
|
347
|
+
ts.isStringLiteralLike(node.argumentExpression) &&
|
|
348
|
+
members.includes(node.argumentExpression.text) &&
|
|
349
|
+
isReceiver(node.expression, node)) {
|
|
350
|
+
report(node);
|
|
351
|
+
}
|
|
352
|
+
else if (ts.isVariableDeclaration(node) &&
|
|
353
|
+
ts.isObjectBindingPattern(node.name) &&
|
|
354
|
+
node.initializer &&
|
|
355
|
+
isReceiver(node.initializer, node) &&
|
|
356
|
+
node.name.elements.some((element) => members.includes((element.propertyName ?? element.name).getText(sourceFile)))) {
|
|
357
|
+
report(node);
|
|
358
|
+
}
|
|
359
|
+
node.forEachChild(visit);
|
|
360
|
+
};
|
|
361
|
+
visit(sourceFile);
|
|
362
|
+
return [...lines].sort((a, b) => a - b);
|
|
363
|
+
}
|
|
364
|
+
/** Collects the members read on a receiver that no consumer can keep reading as-is. */
|
|
365
|
+
function collectReceiverWarnings(sourceFile, config) {
|
|
366
|
+
const protectedAccess = new Set();
|
|
367
|
+
const resolved = new Set();
|
|
368
|
+
const types = Object.keys(config.membersByType);
|
|
369
|
+
const bindings = collectBindings(sourceFile);
|
|
370
|
+
const receivers = collectAllReceivers(sourceFile, types, resolved);
|
|
371
|
+
const typeNames = types.flatMap((type) => localTypeNames(sourceFile, type));
|
|
372
|
+
const protectedMembers = config.protectedMembers ?? [];
|
|
373
|
+
const visit = (node) => {
|
|
374
|
+
if (ts.isPropertyAccessExpression(node) &&
|
|
375
|
+
ts.isIdentifier(node.name) &&
|
|
376
|
+
protectedMembers.includes(node.name.text) &&
|
|
377
|
+
resolveReceiver(node.expression, node, sourceFile, receivers, bindings)) {
|
|
378
|
+
protectedAccess.add(node.name.text);
|
|
379
|
+
}
|
|
380
|
+
node.forEachChild(visit);
|
|
381
|
+
};
|
|
382
|
+
visit(sourceFile);
|
|
383
|
+
return {
|
|
384
|
+
protectedAccess,
|
|
385
|
+
unresolved: collectUnresolvedMentions(sourceFile, config, resolved, typeNames, receivers, bindings)
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
/** Pass A — rewrite programmatic reads of signal members in TypeScript code. */
|
|
389
|
+
function migrateTsExpressions(content, fileName, config) {
|
|
390
|
+
const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
391
|
+
const receivers = collectAllReceivers(sourceFile, Object.keys(config.membersByType));
|
|
392
|
+
if (receivers.length === 0)
|
|
393
|
+
return content;
|
|
394
|
+
const edits = collectAccessEdits(sourceFile, config, receivers, collectBindings(sourceFile));
|
|
395
|
+
return edits.length > 0 ? applyEdits(content, edits) : content;
|
|
396
|
+
}
|
|
397
|
+
/** Attribute-name prefixes that mark the value as an Angular expression rather than a literal. */
|
|
398
|
+
const BINDING_PREFIX = /^(?:\[|\(|\*|bind-|bind(?:on)?-|on-)/;
|
|
399
|
+
/** `(click)` / `on-click`: the value is a statement list, where an assignment is legal. */
|
|
400
|
+
const EVENT_BINDING = /^(?:\(|on-)/;
|
|
401
|
+
/** `[(ngModel)]` / `bindon-ngModel`: the value is a write target, which a signal fills without a call. */
|
|
402
|
+
const TWO_WAY_BINDING = /^(?:\[\(|bindon-)/;
|
|
403
|
+
/** The names a structural directive declares: `let row`, `let i = index`, `index as i`. */
|
|
404
|
+
const MICROSYNTAX_NAME = /\b(?:let|as)\s+([A-Za-z_$][\w$]*)/g;
|
|
405
|
+
/**
|
|
406
|
+
* Walks a template's HTML AST, collecting what a rewrite through reference variables needs: the refs
|
|
407
|
+
* `resolveRef` binds, the source ranges that actually hold Angular expressions, and every other name the
|
|
408
|
+
* template introduces (so a `@for` variable sharing a ref's name is not rewritten).
|
|
409
|
+
*/
|
|
410
|
+
class TemplateScanner {
|
|
411
|
+
constructor(template, resolveRef) {
|
|
412
|
+
this.template = template;
|
|
413
|
+
this.resolveRef = resolveRef;
|
|
414
|
+
this.refs = [];
|
|
415
|
+
this.otherNames = new Set();
|
|
416
|
+
this.expressions = [];
|
|
417
|
+
this.view = { start: 0, end: template.length };
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The refs whose name nothing else in the template introduces. Where a `@for`, `let-` or `@let` variable or a
|
|
421
|
+
* foreign `#ref` shares the name, the reads could belong to either, so neither is rewritten.
|
|
422
|
+
*/
|
|
423
|
+
unambiguousRefs() {
|
|
424
|
+
return this.refs.filter((ref) => !this.otherNames.has(ref.name));
|
|
425
|
+
}
|
|
426
|
+
visitElement(element) {
|
|
427
|
+
const attrs = (element.attrs ?? []).filter((attr) => typeof attr.name === 'string');
|
|
428
|
+
// `*ngIf` / `*ngFor` wrap the element in a template of its own, which also holds the refs on the element.
|
|
429
|
+
const structural = attrs.some((attr) => attr.name.startsWith('*'));
|
|
430
|
+
this.inView(structural ? element.sourceSpan : undefined, () => this.scanElement(element, attrs));
|
|
431
|
+
}
|
|
432
|
+
visitBlock(block) {
|
|
433
|
+
for (const parameter of block.parameters ?? []) {
|
|
434
|
+
const span = parameter.sourceSpan;
|
|
435
|
+
if (!span)
|
|
436
|
+
continue;
|
|
437
|
+
this.expressions.push({ start: span.start.offset, end: span.end.offset, kind: 'expression' });
|
|
438
|
+
// `@for (item of rows; track item)` and `@if (x; as y)` introduce names of their own.
|
|
439
|
+
for (const match of String(parameter.expression ?? '').matchAll(/(?:^\s*|\b(?:as|let)\s+)([A-Za-z_$][\w$]*)\s*(?:\bof\b|\bin\b|=|$)/g)) {
|
|
440
|
+
this.otherNames.add(match[1]);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
this.inView(block.sourceSpan, () => this.visitChildren(block));
|
|
444
|
+
}
|
|
445
|
+
visitText(text) {
|
|
446
|
+
const span = text.sourceSpan;
|
|
447
|
+
if (span)
|
|
448
|
+
this.collectInterpolations(span.start.offset, span.end.offset);
|
|
449
|
+
}
|
|
450
|
+
visitLetDeclaration(decl) {
|
|
451
|
+
if (decl.name)
|
|
452
|
+
this.otherNames.add(decl.name);
|
|
453
|
+
const span = decl.valueSpan ?? decl.sourceSpan;
|
|
454
|
+
if (span)
|
|
455
|
+
this.expressions.push({ start: span.start.offset, end: span.end.offset, kind: 'expression' });
|
|
456
|
+
}
|
|
457
|
+
scanElement(element, attrs) {
|
|
458
|
+
const references = [];
|
|
459
|
+
for (const attr of attrs) {
|
|
460
|
+
const reference = this.referenceName(attr.name);
|
|
461
|
+
if (reference !== undefined) {
|
|
462
|
+
references.push({ name: reference, value: String(attr.value ?? '') });
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
// `let-item` on an <ng-template> introduces a name the refs must not collide with.
|
|
466
|
+
if (attr.name.startsWith('let-')) {
|
|
467
|
+
this.otherNames.add(attr.name.slice(4));
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (attr.name.startsWith('*')) {
|
|
471
|
+
for (const [, name] of String(attr.value ?? '').matchAll(MICROSYNTAX_NAME))
|
|
472
|
+
this.otherNames.add(name);
|
|
473
|
+
}
|
|
474
|
+
this.collectAttributeExpression(attr);
|
|
475
|
+
}
|
|
476
|
+
for (const { name, value } of references) {
|
|
477
|
+
const type = this.resolveRef(element, value);
|
|
478
|
+
if (type !== undefined)
|
|
479
|
+
this.refs.push({ name, type, ...this.view });
|
|
480
|
+
else
|
|
481
|
+
this.otherNames.add(name);
|
|
482
|
+
}
|
|
483
|
+
this.inView(element.name === 'ng-template' ? element.sourceSpan : undefined, () => this.visitChildren(element));
|
|
484
|
+
}
|
|
485
|
+
/** Runs `walk` with the embedded view narrowed to `span`, if the node opens one. */
|
|
486
|
+
inView(span, walk) {
|
|
487
|
+
if (!span) {
|
|
488
|
+
walk();
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const outer = this.view;
|
|
492
|
+
this.view = { start: span.start.offset, end: span.end.offset };
|
|
493
|
+
walk();
|
|
494
|
+
this.view = outer;
|
|
495
|
+
}
|
|
496
|
+
/** `#ref` / `ref-ref`, or `undefined` when the attribute is not a reference variable. */
|
|
497
|
+
referenceName(name) {
|
|
498
|
+
if (name.startsWith('#'))
|
|
499
|
+
return name.slice(1);
|
|
500
|
+
if (name.startsWith('ref-'))
|
|
501
|
+
return name.slice(4);
|
|
502
|
+
return undefined;
|
|
503
|
+
}
|
|
504
|
+
collectAttributeExpression(attr) {
|
|
505
|
+
const span = attr.valueSpan;
|
|
506
|
+
if (!span)
|
|
507
|
+
return;
|
|
508
|
+
const start = span.start.offset;
|
|
509
|
+
const end = span.end.offset;
|
|
510
|
+
// A binding's whole value is an expression; a plain attribute only holds interpolations.
|
|
511
|
+
if (TWO_WAY_BINDING.test(attr.name))
|
|
512
|
+
this.expressions.push({ start, end, kind: 'twoWay' });
|
|
513
|
+
else if (EVENT_BINDING.test(attr.name))
|
|
514
|
+
this.expressions.push({ start, end, kind: 'statement' });
|
|
515
|
+
else if (BINDING_PREFIX.test(attr.name))
|
|
516
|
+
this.expressions.push({ start, end, kind: 'expression' });
|
|
517
|
+
else
|
|
518
|
+
this.collectInterpolations(start, end);
|
|
519
|
+
}
|
|
520
|
+
collectInterpolations(start, end) {
|
|
521
|
+
for (const match of this.template.slice(start, end).matchAll(/\{\{([\s\S]*?)\}\}/g)) {
|
|
522
|
+
const from = start + match.index + 2;
|
|
523
|
+
this.expressions.push({ start: from, end: from + match[1].length, kind: 'expression' });
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
visitChildren(node) {
|
|
527
|
+
for (const child of node.children ?? []) {
|
|
528
|
+
child.visit(this);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
visitAttribute() { }
|
|
532
|
+
visitComment() { }
|
|
533
|
+
visitExpansion() { }
|
|
534
|
+
visitExpansionCase() { }
|
|
535
|
+
visitBlockParameter() { }
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Matches `<ref>.<member>` inside a template expression. The lookbehind rejects `state.panel.items`, where
|
|
539
|
+
* `\b` alone matches after the dot, and admits a `$`-prefixed ref that `\b` never could. Angular's grammar
|
|
540
|
+
* allows whitespace around the dot, so a binding wrapped over two lines is matched too. The three groups skip
|
|
541
|
+
* an already-migrated read, a signal-API call, and an assignment target that must not gain a `()`.
|
|
542
|
+
*/
|
|
543
|
+
function memberAccessPattern(ref, members) {
|
|
544
|
+
const methods = [...SIGNAL_API_METHODS].join('|');
|
|
545
|
+
const names = members.map(escapeRegExp).join('|');
|
|
546
|
+
return new RegExp(`(?<![\\w$.])(${escapeRegExp(ref)})\\s*\\??\\.\\s*(${names})\\b` +
|
|
547
|
+
`(?!\\s*\\()(?!\\s*\\.\\s*(?:${methods})\\b)(?!\\s*=(?!=))`, 'g');
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Rewrites `ref.member` reads to `ref.member()`, only inside the given expression ranges. Restricting the
|
|
551
|
+
* rewrite to expressions is what keeps prose, comments and attribute names out of it.
|
|
552
|
+
*/
|
|
553
|
+
function rewriteRefReads(template, config, refs, expressions) {
|
|
554
|
+
const edits = [];
|
|
555
|
+
for (const { start, end } of expressions) {
|
|
556
|
+
const source = template.slice(start, end);
|
|
557
|
+
for (const ref of refs) {
|
|
558
|
+
if (start < ref.start || end > ref.end)
|
|
559
|
+
continue;
|
|
560
|
+
const members = config.membersByType[ref.type] ?? [];
|
|
561
|
+
if (members.length === 0)
|
|
562
|
+
continue;
|
|
563
|
+
for (const match of source.matchAll(memberAccessPattern(ref.name, members))) {
|
|
564
|
+
const at = start + match.index + match[0].length;
|
|
565
|
+
edits.push({ start: at, end: at, text: '()' });
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return edits.length > 0
|
|
570
|
+
? { content: applyEdits(template, edits), changed: true }
|
|
571
|
+
: { content: template, changed: false };
|
|
572
|
+
}
|
|
573
|
+
/** Protected members read through a reference variable, which no template can keep reading. */
|
|
574
|
+
function collectRefManualMembers(template, config, refs, expressions) {
|
|
575
|
+
const found = new Set();
|
|
576
|
+
const manual = config.protectedMembers ?? [];
|
|
577
|
+
if (manual.length === 0)
|
|
578
|
+
return found;
|
|
579
|
+
for (const { start, end } of expressions) {
|
|
580
|
+
const source = template.slice(start, end);
|
|
581
|
+
for (const ref of refs) {
|
|
582
|
+
if (start < ref.start || end > ref.end)
|
|
583
|
+
continue;
|
|
584
|
+
const pattern = new RegExp(`(?<![\\w$.])${escapeRegExp(ref.name)}\\s*\\??\\.\\s*(${manual.map(escapeRegExp).join('|')})\\b`, 'g');
|
|
585
|
+
for (const match of source.matchAll(pattern)) {
|
|
586
|
+
found.add(match[1]);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return found;
|
|
591
|
+
}
|
|
592
|
+
const untouched = (template) => ({
|
|
593
|
+
content: template,
|
|
594
|
+
changed: false,
|
|
595
|
+
manual: new Set(),
|
|
596
|
+
unparseable: false
|
|
597
|
+
});
|
|
598
|
+
/** Whether a template renders any of the migrated elements, or names any of their `exportAs` values. */
|
|
599
|
+
function rendersComponent(template, config) {
|
|
600
|
+
return (Object.keys(config.elementToType).some((element) => template.includes(`<${element}`)) ||
|
|
601
|
+
Object.keys(config.exportAsToType).some((exportAs) => template.includes(exportAs)) ||
|
|
602
|
+
Object.keys(config.attributeToType ?? {}).some((attribute) => template.includes(attribute)));
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* The migrated type a `#ref` names: `#t="kbqDropdownTrigger"` names a directive on the element, a bare `#d` the
|
|
606
|
+
* component the element is. `#d="cdkOverlayOrigin"` names something else entirely.
|
|
607
|
+
*/
|
|
608
|
+
function refType(config, element, value) {
|
|
609
|
+
if (value)
|
|
610
|
+
return Object.hasOwn(config.exportAsToType, value) ? config.exportAsToType[value] : undefined;
|
|
611
|
+
if (Object.hasOwn(config.elementToType, element.name))
|
|
612
|
+
return config.elementToType[element.name];
|
|
613
|
+
const types = config.attributeToType ?? {};
|
|
614
|
+
// The component an attribute of the element selects, whether the attribute is bound or not.
|
|
615
|
+
for (const attr of element.attrs ?? []) {
|
|
616
|
+
const name = typeof attr.name === 'string' ? attr.name.replace(/^\[(.*)\]$/, '$1') : '';
|
|
617
|
+
if (Object.hasOwn(types, name))
|
|
618
|
+
return types[name];
|
|
619
|
+
}
|
|
620
|
+
return undefined;
|
|
621
|
+
}
|
|
622
|
+
/** Pass B (core) — parse a template, discover refs, rewrite their signal reads. */
|
|
623
|
+
async function migrateTemplate(template, config) {
|
|
624
|
+
if (!rendersComponent(template, config))
|
|
625
|
+
return untouched(template);
|
|
626
|
+
const parsed = await utils_typescript.parseTemplate(template);
|
|
627
|
+
if (!parsed.tree)
|
|
628
|
+
return { ...untouched(template), unparseable: true };
|
|
629
|
+
const scanner = new TemplateScanner(template, (element, value) => refType(config, element, value));
|
|
630
|
+
utils_ast.visitAll(scanner, parsed.tree.rootNodes);
|
|
631
|
+
const refs = scanner.unambiguousRefs();
|
|
632
|
+
if (refs.length === 0)
|
|
633
|
+
return untouched(template);
|
|
634
|
+
return {
|
|
635
|
+
...rewriteRefReads(template, config, refs, scanner.expressions),
|
|
636
|
+
manual: collectRefManualMembers(template, config, refs, scanner.expressions),
|
|
637
|
+
unparseable: false
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
/** Pass B (inline) — rewrite ref reads inside inline component templates. */
|
|
641
|
+
async function migrateInlineTemplates(content, fileName, config) {
|
|
642
|
+
const manual = new Set();
|
|
643
|
+
// Parsing the file to find inline templates is the expensive half, and most consumers have none.
|
|
644
|
+
if (!rendersComponent(content, config))
|
|
645
|
+
return { content, manual, unparseable: false };
|
|
646
|
+
const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
647
|
+
const ranges = utils_typescript.collectInlineTemplateRanges(sourceFile).sort((a, b) => b.start - a.start);
|
|
648
|
+
let result = content;
|
|
649
|
+
let unparseable = false;
|
|
650
|
+
for (const { start, end } of ranges) {
|
|
651
|
+
const outcome = await migrateTemplate(result.slice(start, end), config);
|
|
652
|
+
for (const member of outcome.manual)
|
|
653
|
+
manual.add(member);
|
|
654
|
+
unparseable ||= outcome.unparseable;
|
|
655
|
+
if (outcome.changed) {
|
|
656
|
+
result = result.slice(0, start) + outcome.content + result.slice(end);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return { content: result, manual, unparseable };
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Builds the rule for a `<component>-signals` migration from its policy.
|
|
663
|
+
*
|
|
664
|
+
* Compiled state — the warn patterns and the consumer test — is derived once here rather than per file:
|
|
665
|
+
* the consumer test runs against every file of the project, and the warn patterns against every file that
|
|
666
|
+
* passes it. None carries the `g` flag, so a shared instance holds no `lastIndex`.
|
|
667
|
+
*/
|
|
668
|
+
function signalMembersRule(config, options) {
|
|
669
|
+
const { label } = config;
|
|
670
|
+
const types = Object.keys(config.membersByType);
|
|
671
|
+
const typeAnchor = new RegExp(`\\b(?:${types.map(escapeRegExp).join('|')})\\w*\\b`);
|
|
672
|
+
const compiledWarnPatterns = config.warnPatterns.map(({ anchor, pattern, message }) => ({
|
|
673
|
+
anchor: new RegExp(anchor),
|
|
674
|
+
pattern: new RegExp(pattern),
|
|
675
|
+
message
|
|
676
|
+
}));
|
|
677
|
+
const protectedMessage = (members) => `These ${types[0]} members are \`protected\` now and can't be read from outside the component: ` +
|
|
678
|
+
`${[...members].join(', ')}.${config.messages.protectedHint ? ` ${config.messages.protectedHint}` : ''}`;
|
|
679
|
+
/**
|
|
680
|
+
* A `.ts` file is a consumer if it names one of the migrated types, imports the package, or renders the
|
|
681
|
+
* component in an inline template — a component that only imports the NgModule names no type.
|
|
682
|
+
*/
|
|
683
|
+
const referencesComponent = (content) => typeAnchor.test(content) || content.includes(config.package) || rendersComponent(content, config);
|
|
684
|
+
return async (tree, context) => {
|
|
685
|
+
const { project } = options;
|
|
686
|
+
// `ng update` invokes migrations with no options at all, and migrations.json declares no schema,
|
|
687
|
+
// so the schema default never reaches us — applying the fix is the intended behaviour there.
|
|
688
|
+
const fix = options.fix ?? true;
|
|
689
|
+
const projectDefinition = await utils_packageConfig.setupOptions(project, tree);
|
|
690
|
+
const root = projectDefinition?.root ?? '';
|
|
691
|
+
const rootDir = root ? tree.getDir(root) : tree.root;
|
|
692
|
+
const tsPaths = [];
|
|
693
|
+
const htmlPaths = [];
|
|
694
|
+
utils_projectFiles.visitProjectFiles(rootDir, (filePath) => {
|
|
695
|
+
if (filePath.endsWith(TS_EXT))
|
|
696
|
+
tsPaths.push(filePath);
|
|
697
|
+
else if (filePath.endsWith(HTML_EXT))
|
|
698
|
+
htmlPaths.push(filePath);
|
|
699
|
+
});
|
|
700
|
+
let touched = 0;
|
|
701
|
+
let consumers = 0;
|
|
702
|
+
const commit = (filePath, original, updated) => {
|
|
703
|
+
if (updated === original)
|
|
704
|
+
return;
|
|
705
|
+
touched++;
|
|
706
|
+
if (fix) {
|
|
707
|
+
tree.overwrite(filePath, updated);
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
utils_messages.logMessage(context.logger, [`${label} would update ${filePath} (run with --fix to apply)`]);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
const reportUnparseable = (filePath) => utils_messages.logMessage(context.logger, [`${label} ${filePath}`, ` ${config.messages.unparseableTemplate}`]);
|
|
714
|
+
const warnTemplateMembers = (filePath, manual) => {
|
|
715
|
+
if (manual.size === 0)
|
|
716
|
+
return;
|
|
717
|
+
utils_messages.logMessage(context.logger, [`${label} ${filePath}`, ` ${protectedMessage(manual)}`]);
|
|
718
|
+
};
|
|
719
|
+
for (const filePath of tsPaths) {
|
|
720
|
+
const original = tree.read(filePath)?.toString();
|
|
721
|
+
if (!original || !referencesComponent(original))
|
|
722
|
+
continue;
|
|
723
|
+
consumers++;
|
|
724
|
+
for (const { anchor, pattern, message } of compiledWarnPatterns) {
|
|
725
|
+
if (!anchor.test(original) || !pattern.test(original))
|
|
726
|
+
continue;
|
|
727
|
+
utils_messages.logMessage(context.logger, [`${label} ${filePath}`, ` ${message}`]);
|
|
728
|
+
}
|
|
729
|
+
const sourceFile = ts.createSourceFile(filePath, original, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
730
|
+
const { protectedAccess, unresolved } = collectReceiverWarnings(sourceFile, config);
|
|
731
|
+
if (protectedAccess.size > 0) {
|
|
732
|
+
utils_messages.logMessage(context.logger, [`${label} ${filePath}`, ` ${protectedMessage(protectedAccess)}`]);
|
|
733
|
+
}
|
|
734
|
+
if (unresolved.length > 0) {
|
|
735
|
+
utils_messages.logMessage(context.logger, [
|
|
736
|
+
`${label} ${filePath}`,
|
|
737
|
+
` ${config.messages.unresolvedReceiver} ${unresolved.join(', ')}.`
|
|
738
|
+
]);
|
|
739
|
+
}
|
|
740
|
+
const content = migrateTsExpressions(original, filePath, config);
|
|
741
|
+
const inline = await migrateInlineTemplates(content, filePath, config);
|
|
742
|
+
warnTemplateMembers(filePath, inline.manual);
|
|
743
|
+
if (inline.unparseable)
|
|
744
|
+
reportUnparseable(filePath);
|
|
745
|
+
commit(filePath, original, inline.content);
|
|
746
|
+
}
|
|
747
|
+
for (const filePath of htmlPaths) {
|
|
748
|
+
const original = tree.read(filePath)?.toString();
|
|
749
|
+
// Counted on "renders the component", matching the `.ts` loop: a project whose only usage is a
|
|
750
|
+
// plain binding in an external template still needs the summary.
|
|
751
|
+
if (!original || !rendersComponent(original, config))
|
|
752
|
+
continue;
|
|
753
|
+
consumers++;
|
|
754
|
+
const outcome = await migrateTemplate(original, config);
|
|
755
|
+
warnTemplateMembers(filePath, outcome.manual);
|
|
756
|
+
if (outcome.unparseable)
|
|
757
|
+
reportUnparseable(filePath);
|
|
758
|
+
commit(filePath, original, outcome.content);
|
|
759
|
+
}
|
|
760
|
+
// Nothing here uses the component, so the summary would only be noise.
|
|
761
|
+
if (consumers === 0)
|
|
762
|
+
return;
|
|
763
|
+
utils_messages.logMessage(context.logger, [
|
|
764
|
+
`${label} processed tree under "${root || '<workspace root>'}", ` +
|
|
765
|
+
`${fix ? 'updated' : 'would update'} ${touched} file(s).`,
|
|
766
|
+
...config.messages.summary
|
|
767
|
+
]);
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
exports.TemplateScanner = TemplateScanner;
|
|
772
|
+
exports.classifyAccess = classifyAccess;
|
|
773
|
+
exports.collectAllReceivers = collectAllReceivers;
|
|
774
|
+
exports.collectBindings = collectBindings;
|
|
775
|
+
exports.isPlainAssignment = isPlainAssignment;
|
|
776
|
+
exports.isWriteTarget = isWriteTarget;
|
|
777
|
+
exports.memberAccessPattern = memberAccessPattern;
|
|
778
|
+
exports.resolveReceiver = resolveReceiver;
|
|
779
|
+
exports.signalMembersRule = signalMembersRule;
|