@lucca-front/ng 22.0.0-rc.2 → 22.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/lucca-front-ng-a11y.mjs +125 -8
- package/fesm2022/lucca-front-ng-a11y.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-activity-feed.mjs +74 -27
- package/fesm2022/lucca-front-ng-activity-feed.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-api.mjs +116 -78
- package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-app-layout.mjs +4 -4
- package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-box.mjs +44 -6
- package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs +15 -9
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-icon.mjs +28 -13
- package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs +20 -10
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +105 -63
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-chip.mjs +33 -13
- package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-clear.mjs +17 -8
- package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-code.mjs +4 -4
- package/fesm2022/lucca-front-ng-code.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +16 -8
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-comment.mjs +48 -27
- package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-container.mjs +13 -6
- package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-api.mjs +70 -24
- package/fesm2022/lucca-front-ng-core-select-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-department.mjs +31 -18
- package/fesm2022/lucca-front-ng-core-select-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs +21 -15
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +12 -9
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-legal-units.mjs +168 -0
- package/fesm2022/lucca-front-ng-core-select-legal-units.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs +9 -6
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +65 -41
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +355 -236
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +86 -29
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +143 -81
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date.mjs +91 -62
- package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +375 -161
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-department.mjs +31 -27
- package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +71 -51
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-divider.mjs +16 -8
- package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dropdown.mjs +42 -41
- package/fesm2022/lucca-front-ng-dropdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-empty-state.mjs +56 -30
- package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-error-page.mjs +15 -7
- package/fesm2022/lucca-front-ng-error-page.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-establishment.mjs +57 -45
- package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +23 -11
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +135 -69
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +83 -52
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-footer.mjs +17 -8
- package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +124 -71
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +12 -6
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-label.mjs +65 -42
- package/fesm2022/lucca-front-ng-form-label.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +9 -6
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-formly.mjs +58 -58
- package/fesm2022/lucca-front-ng-formly.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +58 -40
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs +3 -3
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs +8 -9
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs +3 -3
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +263 -105
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +370 -154
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-gauge.mjs +23 -13
- package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-grid.mjs +39 -18
- package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +50 -15
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-text.mjs +28 -0
- package/fesm2022/lucca-front-ng-highlight-text.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +174 -17
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs +124 -0
- package/fesm2022/lucca-front-ng-impersonation.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-index-table.mjs +82 -54
- package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-inline-message.mjs +17 -7
- package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-input.mjs +27 -24
- package/fesm2022/lucca-front-ng-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +54 -23
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listbox.mjs +31 -18
- package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listing.mjs +16 -12
- package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-loading.mjs +13 -6
- package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-main-layout.mjs +6 -6
- package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-mobile-push.mjs +15 -5
- package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs +32 -26
- package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +247 -123
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-new-badge.mjs +5 -4
- package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-number-format.mjs +14 -10
- package/fesm2022/lucca-front-ng-number-format.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-number.mjs +7 -7
- package/fesm2022/lucca-front-ng-number.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-numeric-badge.mjs +24 -12
- package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +160 -140
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-page-header.mjs +12 -8
- package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-pagination.mjs +26 -10
- package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-plg-push.mjs +14 -8
- package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover.mjs +23 -20
- package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +107 -35
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popup.mjs +10 -10
- package/fesm2022/lucca-front-ng-popup.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-bar.mjs +13 -6
- package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-stepper.mjs +22 -12
- package/fesm2022/lucca-front-ng-progress-stepper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-read-more.mjs +38 -17
- package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-resource-card.mjs +26 -17
- package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-safe-content.mjs +10 -10
- package/fesm2022/lucca-front-ng-safe-content.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll-box.mjs +8 -6
- package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll.mjs +14 -10
- package/fesm2022/lucca-front-ng-scroll.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +26 -14
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs +12 -10
- package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-select.mjs +30 -23
- package/fesm2022/lucca-front-ng-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sidepanel.mjs +7 -7
- package/fesm2022/lucca-front-ng-sidepanel.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +66 -50
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +131 -62
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs +16 -11
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon.mjs +34 -25
- package/fesm2022/lucca-front-ng-software-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs +14 -11
- package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-status-badge.mjs +15 -7
- package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-table-of-content.mjs +8 -7
- package/fesm2022/lucca-front-ng-table-of-content.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tag.mjs +22 -11
- package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-text-flow.mjs +4 -4
- package/fesm2022/lucca-front-ng-text-flow.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +416 -80
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-title.mjs +34 -15
- package/fesm2022/lucca-front-ng-title.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-toast.mjs +20 -14
- package/fesm2022/lucca-front-ng-toast.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tooltip.mjs +60 -30
- package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tree-select.mjs +20 -13
- package/fesm2022/lucca-front-ng-tree-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +28 -23
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user.mjs +172 -113
- package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs +34 -24
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
- package/package.json +20 -8
- package/schematics/action-icon/index.js +34 -1
- package/schematics/action-icon/migration.spec.js +36 -3
- package/schematics/alignment-utilities/migration.spec.js +36 -3
- package/schematics/cdn-urls/migration.spec.js +36 -3
- package/schematics/class-prefix/migration.spec.js +36 -3
- package/schematics/collection.json +10 -0
- package/schematics/color-text/migration.spec.js +36 -3
- package/schematics/component-path/migration.spec.js +36 -3
- package/schematics/deprecated-resolver/index.js +73 -0
- package/schematics/deprecated-resolver/migration.spec.js +58 -0
- package/schematics/deprecated-resolver/schema.json +23 -0
- package/schematics/empty-state-title/migration.spec.js +35 -2
- package/schematics/lib/css-mapper.js +44 -6
- package/schematics/lib/deprecated-mapper.js +109 -0
- package/schematics/lib/index.js +1 -0
- package/schematics/lib/lf-schematic-context.js +34 -1
- package/schematics/lib/local-deps/package-lock.json +17 -79
- package/schematics/lib/local-deps/package.json +1 -1
- package/schematics/lib/local-deps/postcss.js +34 -1
- package/schematics/lib/migration-test.js +5 -2
- package/schematics/lib/scss-ast.js +53 -0
- package/schematics/lu-button/migration.spec.js +34 -1
- package/schematics/lu-container/migration.spec.js +34 -1
- package/schematics/lu-grid/index.js +23 -0
- package/schematics/lu-grid/migration.js +237 -0
- package/schematics/lu-grid/migration.spec.js +56 -0
- package/schematics/lu-grid/migration.utils.js +60 -0
- package/schematics/lu-grid/schema.json +23 -0
- package/schematics/lu-icon/migration.spec.js +34 -1
- package/schematics/lu-loading/migration.spec.js +34 -1
- package/schematics/lu-select/migration.spec.js +34 -1
- package/schematics/lu-text-input/migration.spec.js +34 -1
- package/schematics/new-icons/index.js +35 -2
- package/schematics/new-icons/migration.spec.js +36 -3
- package/schematics/package.json +3 -0
- package/schematics/palettes/index.js +17 -2
- package/schematics/palettes/migration.spec.js +36 -3
- package/schematics/tokens-radius/migration.spec.js +36 -3
- package/schematics/tokens-spacing/migration.spec.js +36 -3
- package/schematics/tokens-typo/migration.spec.js +36 -3
- package/src/components/_picker.scss +6 -1
- package/src/components/_popover.scss +1 -2
- package/src/definitions/option/_option-item.scss +6 -25
- package/types/lucca-front-ng-a11y.d.ts +30 -2
- package/types/lucca-front-ng-activity-feed.d.ts +18 -3
- package/types/lucca-front-ng-api.d.ts +14 -8
- package/types/lucca-front-ng-box.d.ts +6 -1
- package/types/lucca-front-ng-bubble-icon.d.ts +12 -3
- package/types/lucca-front-ng-bubble-illustration.d.ts +11 -5
- package/types/lucca-front-ng-callout.d.ts +24 -16
- package/types/lucca-front-ng-chip.d.ts +10 -1
- package/types/lucca-front-ng-clear.d.ts +9 -3
- package/types/lucca-front-ng-color.d.ts +8 -1
- package/types/lucca-front-ng-comment.d.ts +8 -1
- package/types/lucca-front-ng-container.d.ts +8 -1
- package/types/lucca-front-ng-core-select-api.d.ts +13 -1
- package/types/lucca-front-ng-core-select-department.d.ts +3 -2
- package/types/lucca-front-ng-core-select-legal-units.d.ts +56 -0
- package/types/lucca-front-ng-core-select-user.d.ts +2 -1
- package/types/lucca-front-ng-core-select.d.ts +34 -15
- package/types/lucca-front-ng-core.d.ts +31 -8
- package/types/lucca-front-ng-data-table.d.ts +18 -3
- package/types/lucca-front-ng-date2.d.ts +28 -9
- package/types/lucca-front-ng-dialog.d.ts +13 -2
- package/types/lucca-front-ng-divider.d.ts +8 -1
- package/types/lucca-front-ng-empty-state.d.ts +16 -8
- package/types/lucca-front-ng-error-page.d.ts +9 -4
- package/types/lucca-front-ng-fancy-box.d.ts +8 -1
- package/types/lucca-front-ng-file-upload.d.ts +23 -11
- package/types/lucca-front-ng-filter-pills.d.ts +0 -1
- package/types/lucca-front-ng-footer.d.ts +11 -2
- package/types/lucca-front-ng-form-field.d.ts +34 -17
- package/types/lucca-front-ng-form-header.d.ts +9 -2
- package/types/lucca-front-ng-form-label.d.ts +13 -5
- package/types/lucca-front-ng-form.d.ts +2 -0
- package/types/lucca-front-ng-forms-phone-number-input.d.ts +19 -12
- package/types/lucca-front-ng-forms-rich-text-input.d.ts +17 -2
- package/types/lucca-front-ng-forms.d.ts +90 -22
- package/types/lucca-front-ng-gauge.d.ts +1 -1
- package/types/lucca-front-ng-grid.d.ts +23 -8
- package/types/lucca-front-ng-highlight-data.d.ts +16 -1
- package/types/lucca-front-ng-highlight-text.d.ts +12 -0
- package/types/lucca-front-ng-horizontal-navigation.d.ts +40 -3
- package/types/lucca-front-ng-impersonation.d.ts +33 -0
- package/types/lucca-front-ng-index-table.d.ts +19 -4
- package/types/lucca-front-ng-inline-message.d.ts +11 -4
- package/types/lucca-front-ng-input.d.ts +2 -1
- package/types/lucca-front-ng-link.d.ts +13 -3
- package/types/lucca-front-ng-listbox.d.ts +8 -1
- package/types/lucca-front-ng-listing.d.ts +1 -1
- package/types/lucca-front-ng-loading.d.ts +8 -1
- package/types/lucca-front-ng-modal.d.ts +1 -1
- package/types/lucca-front-ng-multi-select.d.ts +3 -0
- package/types/lucca-front-ng-numeric-badge.d.ts +9 -2
- package/types/lucca-front-ng-pagination.d.ts +8 -1
- package/types/lucca-front-ng-popover2.d.ts +23 -2
- package/types/lucca-front-ng-progress-bar.d.ts +8 -1
- package/types/lucca-front-ng-progress-stepper.d.ts +8 -1
- package/types/lucca-front-ng-read-more.d.ts +8 -1
- package/types/lucca-front-ng-resource-card.d.ts +10 -1
- package/types/lucca-front-ng-segmented-control-tabs.d.ts +2 -0
- package/types/lucca-front-ng-segmented-control.d.ts +4 -2
- package/types/lucca-front-ng-simple-select.d.ts +16 -17
- package/types/lucca-front-ng-skeleton.d.ts +51 -19
- package/types/lucca-front-ng-software-icon.d.ts +11 -6
- package/types/lucca-front-ng-sortable-list.d.ts +2 -1
- package/types/lucca-front-ng-status-badge.d.ts +9 -2
- package/types/lucca-front-ng-tag.d.ts +9 -2
- package/types/lucca-front-ng-time.d.ts +89 -8
- package/types/lucca-front-ng-title.d.ts +6 -1
- package/types/lucca-front-ng-tooltip.d.ts +7 -2
- package/types/lucca-front-ng-user.d.ts +19 -5
- package/types/lucca-front-ng-vertical-navigation.d.ts +1 -1
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.postCss = void 0;
|
|
4
|
-
exports.postCss = require("postcss");
|
|
37
|
+
exports.postCss = __importStar(require("postcss"));
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createTreeFromFiles = createTreeFromFiles;
|
|
4
7
|
exports.createTreeFromFolder = createTreeFromFolder;
|
|
@@ -7,8 +10,8 @@ exports.runSchematic = runSchematic;
|
|
|
7
10
|
exports.expectTree = expectTree;
|
|
8
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
9
12
|
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
10
|
-
const fs_1 = require("fs");
|
|
11
|
-
const path_1 = require("path");
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
12
15
|
const node_fs_1 = require("node:fs");
|
|
13
16
|
function createTreeFromFiles(testsRoot, files, filePartFilter) {
|
|
14
17
|
const tree = new testing_1.UnitTestTree(schematics_1.Tree.empty());
|
|
@@ -10,6 +10,7 @@ exports.updateCSSVariableNames = updateCSSVariableNames;
|
|
|
10
10
|
exports.removeImportNode = removeImportNode;
|
|
11
11
|
exports.commentNode = commentNode;
|
|
12
12
|
exports.wrapWithCalcFunctionNode = wrapWithCalcFunctionNode;
|
|
13
|
+
exports.updateRgbaToTransparentize = updateRgbaToTransparentize;
|
|
13
14
|
const scss_value_ast_js_1 = require("./scss-value-ast.js");
|
|
14
15
|
function removeContainerIfEmpty(node) {
|
|
15
16
|
if (!node) {
|
|
@@ -193,6 +194,58 @@ function wrapWithCalcFunctionNode(rootValueNode, node, postcssValueParser) {
|
|
|
193
194
|
rootValueNode.nodes = newNodes;
|
|
194
195
|
}
|
|
195
196
|
}
|
|
197
|
+
const COLOR_UTILS_IMPORT = '@lucca-front/scss/src/commons/utils/color';
|
|
198
|
+
/**
|
|
199
|
+
* Transforms rgba(var(--x-rgb), alpha) → color.transparentize(var(--palette-x), alpha)
|
|
200
|
+
* and rgb(var(--x-rgb)) → var(--palette-x).
|
|
201
|
+
* Adds @use for the color utils if any rgba replacement happened.
|
|
202
|
+
*/
|
|
203
|
+
function updateRgbaToTransparentize(root, rgbVarMappings, postcssValueParser, postCss) {
|
|
204
|
+
let hasRgba = false;
|
|
205
|
+
root.walkDecls((decl) => {
|
|
206
|
+
const valueAst = new scss_value_ast_js_1.ScssValueAst(decl.value, postcssValueParser);
|
|
207
|
+
let changed = false;
|
|
208
|
+
valueAst.walkFunction(/^rgba?$/, (funcNode) => {
|
|
209
|
+
const isRgba = funcNode.value === 'rgba';
|
|
210
|
+
const varNode = funcNode.nodes.find((n) => n.type === 'function' && n.value === 'var');
|
|
211
|
+
if (!varNode) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const varName = varNode.nodes[0]?.value ?? '';
|
|
215
|
+
const newVarName = rgbVarMappings[varName];
|
|
216
|
+
if (!newVarName) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const hasAlpha = funcNode.nodes.some((n) => n.type === 'word');
|
|
220
|
+
if (isRgba || hasAlpha) {
|
|
221
|
+
varNode.nodes = [{ type: 'word', value: newVarName, sourceIndex: 0, sourceEndIndex: newVarName.length }];
|
|
222
|
+
funcNode.value = 'color.transparentize';
|
|
223
|
+
hasRgba = true;
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
// rgb(var(--x-rgb)) → var(--palette-x)
|
|
227
|
+
funcNode.value = 'var';
|
|
228
|
+
funcNode.nodes = [{ type: 'word', value: newVarName, sourceIndex: 0, sourceEndIndex: newVarName.length }];
|
|
229
|
+
}
|
|
230
|
+
changed = true;
|
|
231
|
+
});
|
|
232
|
+
if (changed) {
|
|
233
|
+
decl.value = valueAst.toString();
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
if (!hasRgba) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
let colorImportExists = false;
|
|
240
|
+
root.walkAtRules(/(import|use)/, (rule) => {
|
|
241
|
+
if (rule.params.includes(COLOR_UTILS_IMPORT)) {
|
|
242
|
+
colorImportExists = true;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
if (!colorImportExists) {
|
|
246
|
+
addMixinImport(root, COLOR_UTILS_IMPORT, postCss);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
196
249
|
function split(array, predicate) {
|
|
197
250
|
const chunks = [];
|
|
198
251
|
const separators = [];
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path = require("path");
|
|
36
|
+
const path = __importStar(require("path"));
|
|
4
37
|
const lib_1 = require("../lib");
|
|
5
38
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
6
39
|
const testsRoot = path.join(__dirname, 'tests');
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path = require("path");
|
|
36
|
+
const path = __importStar(require("path"));
|
|
4
37
|
const lib_1 = require("../lib");
|
|
5
38
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
6
39
|
const testsRoot = path.join(__dirname, 'tests');
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typescript_1 = require("typescript");
|
|
4
|
+
const lib_1 = require("../lib");
|
|
5
|
+
const migration_1 = require("./migration");
|
|
6
|
+
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
7
|
+
require('@angular-devkit/schematics');
|
|
8
|
+
exports.default = (options) => {
|
|
9
|
+
return async (tree, context) => {
|
|
10
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
11
|
+
tree.visit((path, entry) => {
|
|
12
|
+
if (path.includes('node_modules') || !entry) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
|
|
16
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => {
|
|
17
|
+
const sourceFile = (0, typescript_1.createSourceFile)(path, content, typescript_1.ScriptTarget.ESNext);
|
|
18
|
+
return (0, migration_1.migrateComponent)(sourceFile, path, tree);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateComponent = migrateComponent;
|
|
4
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
5
|
+
const lib_1 = require("../lib");
|
|
6
|
+
const migration_utils_1 = require("./migration.utils");
|
|
7
|
+
// --- Main migration ---
|
|
8
|
+
function migrateComponent(sourceFile, path, tree) {
|
|
9
|
+
const htmlGrids = findHTMLGrids(sourceFile, path, tree);
|
|
10
|
+
const htmlGridColumns = findHTMLGridColumns(sourceFile, path, tree);
|
|
11
|
+
if (htmlGrids.length === 0 && htmlGridColumns.length === 0) {
|
|
12
|
+
return tree.readText(path);
|
|
13
|
+
}
|
|
14
|
+
const tsUpdate = tree.beginUpdate(path);
|
|
15
|
+
const firstItem = htmlGrids[0] || htmlGridColumns[0];
|
|
16
|
+
const isInlineTemplate = firstItem.filePath === path;
|
|
17
|
+
const templateUpdate = isInlineTemplate ? tsUpdate : tree.beginUpdate(firstItem.filePath);
|
|
18
|
+
htmlGrids.forEach((grid) => migrateGridNode(grid, templateUpdate));
|
|
19
|
+
htmlGridColumns.forEach((col) => migrateGridColumnNode(col, templateUpdate));
|
|
20
|
+
const changesToApply = [];
|
|
21
|
+
if (htmlGrids.length > 0) {
|
|
22
|
+
changesToApply.push((0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'GridComponent', '@lucca-front/ng/grid'), (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'GridComponent'));
|
|
23
|
+
}
|
|
24
|
+
if (htmlGridColumns.length > 0) {
|
|
25
|
+
changesToApply.push((0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'GridColumnComponent', '@lucca-front/ng/grid'), (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'GridColumnComponent'));
|
|
26
|
+
}
|
|
27
|
+
(0, change_1.applyToUpdateRecorder)(tsUpdate, changesToApply);
|
|
28
|
+
tree.commitUpdate(tsUpdate);
|
|
29
|
+
if (!isInlineTemplate) {
|
|
30
|
+
tree.commitUpdate(templateUpdate);
|
|
31
|
+
}
|
|
32
|
+
return tree.readText(path);
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
function migrateGridNode(grid, templateUpdate) {
|
|
36
|
+
const { node, nodeOffset, inputs } = grid;
|
|
37
|
+
const divLength = node.name.length;
|
|
38
|
+
const classesNode = node.attributes.find((attr) => attr.name === 'class');
|
|
39
|
+
const styleNode = node.attributes.find((attr) => attr.name === 'style');
|
|
40
|
+
// Build inputs string (everything that comes after the element name)
|
|
41
|
+
let thingsToAdd = 'lu-grid';
|
|
42
|
+
if (inputs.mode) {
|
|
43
|
+
thingsToAdd += ` mode="${inputs.mode}"`;
|
|
44
|
+
}
|
|
45
|
+
if (inputs.columns) {
|
|
46
|
+
thingsToAdd += ` columns="${inputs.columns}"`;
|
|
47
|
+
}
|
|
48
|
+
// Remove element name 'div'
|
|
49
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.start.offset + 1, divLength);
|
|
50
|
+
if (node.children.length > 0 && node.endSourceSpan) {
|
|
51
|
+
// Has children — replace end tag
|
|
52
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset + 1, divLength + 1);
|
|
53
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
54
|
+
templateUpdate.insertLeft(nodeOffset + node.endSourceSpan.start.offset + 1, '/lu-grid');
|
|
55
|
+
}
|
|
56
|
+
else if (!node.isSelfClosing) {
|
|
57
|
+
// Empty, not self-closing
|
|
58
|
+
const endSpanOffset = node.endSourceSpan?.start.offset || -1;
|
|
59
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.end.offset, endSpanOffset - node.startSourceSpan.end.offset);
|
|
60
|
+
if (node.endSourceSpan?.start?.offset) {
|
|
61
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset, node.endSourceSpan.toString().length);
|
|
62
|
+
}
|
|
63
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
64
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.end.offset - 1, ` /`);
|
|
65
|
+
}
|
|
66
|
+
// Modify class attribute — remove 'grid' and mode-related classes
|
|
67
|
+
if (classesNode && classesNode.keySpan) {
|
|
68
|
+
const classes = classesNode.value;
|
|
69
|
+
const cleanedClasses = classes.split(' ').filter((c) => c !== 'grid' && c !== 'mod-auto' && c !== 'mod-form').join(' ');
|
|
70
|
+
templateUpdate.remove(nodeOffset + classesNode.keySpan.start.offset - 1, classesNode.sourceSpan.toString().length + 1);
|
|
71
|
+
if (cleanedClasses) {
|
|
72
|
+
templateUpdate.insertRight(nodeOffset + classesNode.keySpan.start.offset, ` class="${cleanedClasses}"`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Modify style attribute — remove --grid-columns, keep the rest
|
|
76
|
+
if (styleNode && styleNode.keySpan) {
|
|
77
|
+
const cssProps = (0, migration_utils_1.parseCssCustomProperties)(styleNode.value);
|
|
78
|
+
const remaining = Object.entries(cssProps)
|
|
79
|
+
.filter(([key]) => key !== '--grid-columns')
|
|
80
|
+
.map(([key, val]) => `${key}: ${val}`)
|
|
81
|
+
.join('; ');
|
|
82
|
+
templateUpdate.remove(nodeOffset + styleNode.keySpan.start.offset - 1, styleNode.sourceSpan.toString().length + 1);
|
|
83
|
+
if (remaining) {
|
|
84
|
+
templateUpdate.insertRight(nodeOffset + styleNode.keySpan.start.offset, ` style="${remaining}"`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
+
function migrateGridColumnNode(col, templateUpdate) {
|
|
90
|
+
const { node, nodeOffset, inputs, remainingStyle, extraClasses } = col;
|
|
91
|
+
const divLength = node.name.length;
|
|
92
|
+
const classesNode = node.attributes.find((attr) => attr.name === 'class');
|
|
93
|
+
const styleNode = node.attributes.find((attr) => attr.name === 'style');
|
|
94
|
+
// Build inputs string
|
|
95
|
+
let thingsToAdd = 'lu-grid-column';
|
|
96
|
+
if (inputs.colspan) {
|
|
97
|
+
thingsToAdd += ` colspan="${inputs.colspan}"`;
|
|
98
|
+
}
|
|
99
|
+
if (inputs.rowspan) {
|
|
100
|
+
thingsToAdd += ` rowspan="${inputs.rowspan}"`;
|
|
101
|
+
}
|
|
102
|
+
if (inputs.column) {
|
|
103
|
+
thingsToAdd += ` column="${inputs.column}"`;
|
|
104
|
+
}
|
|
105
|
+
if (inputs.row) {
|
|
106
|
+
thingsToAdd += ` row="${inputs.row}"`;
|
|
107
|
+
}
|
|
108
|
+
if (inputs.justify) {
|
|
109
|
+
thingsToAdd += ` justify="${inputs.justify}"`;
|
|
110
|
+
}
|
|
111
|
+
if (inputs.align) {
|
|
112
|
+
thingsToAdd += ` align="${inputs.align}"`;
|
|
113
|
+
}
|
|
114
|
+
if (inputs.responsive) {
|
|
115
|
+
const responsiveEntries = Object.entries(inputs.responsive)
|
|
116
|
+
.map(([key, val]) => `${key}: ${val}`)
|
|
117
|
+
.join(', ');
|
|
118
|
+
thingsToAdd += ` [responsive]="{ ${responsiveEntries} }"`;
|
|
119
|
+
}
|
|
120
|
+
// Remove element name 'div'
|
|
121
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.start.offset + 1, divLength);
|
|
122
|
+
if (node.children.length > 0 && node.endSourceSpan) {
|
|
123
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset + 1, divLength + 1);
|
|
124
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
125
|
+
templateUpdate.insertLeft(nodeOffset + node.endSourceSpan.start.offset + 1, '/lu-grid-column');
|
|
126
|
+
}
|
|
127
|
+
else if (!node.isSelfClosing) {
|
|
128
|
+
const endSpanOffset = node.endSourceSpan?.start.offset || -1;
|
|
129
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.end.offset, endSpanOffset - node.startSourceSpan.end.offset);
|
|
130
|
+
if (node.endSourceSpan?.start?.offset) {
|
|
131
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset, node.endSourceSpan.toString().length);
|
|
132
|
+
}
|
|
133
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
134
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.end.offset - 1, ` /`);
|
|
135
|
+
}
|
|
136
|
+
// Class attribute: remove 'grid-column', keep extra classes
|
|
137
|
+
if (classesNode && classesNode.keySpan) {
|
|
138
|
+
templateUpdate.remove(nodeOffset + classesNode.keySpan.start.offset - 1, classesNode.sourceSpan.toString().length + 1);
|
|
139
|
+
if (extraClasses) {
|
|
140
|
+
templateUpdate.insertRight(nodeOffset + classesNode.keySpan.start.offset, ` class="${extraClasses}"`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Style attribute: remove grid-specific properties, keep the rest
|
|
144
|
+
if (styleNode && styleNode.keySpan) {
|
|
145
|
+
templateUpdate.remove(nodeOffset + styleNode.keySpan.start.offset - 1, styleNode.sourceSpan.toString().length + 1);
|
|
146
|
+
if (remainingStyle) {
|
|
147
|
+
templateUpdate.insertRight(nodeOffset + styleNode.keySpan.start.offset, ` style="${remainingStyle}"`);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// --- Finders ---
|
|
152
|
+
function gridHasNonNeutralColumnChildren(node) {
|
|
153
|
+
return node.children.some((child) => {
|
|
154
|
+
if (!(0, lib_1.isInterestingNode)(child) || (0, migration_utils_1.isNeutralElement)(child.name)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
const childClasses = child.attributes.find((attr) => attr.name === 'class')?.value;
|
|
158
|
+
return !!childClasses?.match(/(^|\s)grid-column(\s|$)/);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function findHTMLGrids(sourceFile, basePath, tree) {
|
|
162
|
+
const results = [];
|
|
163
|
+
const ngTemplates = (0, lib_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
|
|
164
|
+
ngTemplates.forEach((template) => {
|
|
165
|
+
const htmlAst = new lib_1.HtmlAst(template.content);
|
|
166
|
+
htmlAst.visitNodes((node) => {
|
|
167
|
+
if (!(0, lib_1.isInterestingNode)(node) || !(0, migration_utils_1.isNeutralElement)(node.name)) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const classes = node.attributes.find((attr) => attr.name === 'class')?.value;
|
|
171
|
+
if (!classes?.match(/(^|\s)grid(\s|$)/)) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (gridHasNonNeutralColumnChildren(node)) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const styleAttr = node.attributes.find((attr) => attr.name === 'style')?.value || '';
|
|
178
|
+
const cssProps = (0, migration_utils_1.parseCssCustomProperties)(styleAttr);
|
|
179
|
+
const classParts = classes.split(' ');
|
|
180
|
+
const extraClasses = classParts.filter((c) => c !== 'grid' && c !== 'mod-auto' && c !== 'mod-form').join(' ');
|
|
181
|
+
const inputs = {
|
|
182
|
+
mode: classParts.includes('mod-auto') ? 'auto' : classParts.includes('mod-form') ? 'form' : undefined,
|
|
183
|
+
columns: cssProps['--grid-columns'],
|
|
184
|
+
extraClasses: extraClasses || undefined,
|
|
185
|
+
};
|
|
186
|
+
results.push({
|
|
187
|
+
node,
|
|
188
|
+
inputs,
|
|
189
|
+
nodeOffset: template.offsetStart,
|
|
190
|
+
filePath: template.filePath,
|
|
191
|
+
componentTS: sourceFile,
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
return results;
|
|
196
|
+
}
|
|
197
|
+
function findHTMLGridColumns(sourceFile, basePath, tree) {
|
|
198
|
+
const results = [];
|
|
199
|
+
const ngTemplates = (0, lib_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
|
|
200
|
+
ngTemplates.forEach((template) => {
|
|
201
|
+
const htmlAst = new lib_1.HtmlAst(template.content);
|
|
202
|
+
htmlAst.visitNodes((node, parent) => {
|
|
203
|
+
if (!(0, lib_1.isInterestingNode)(node)) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const classes = node.attributes.find((attr) => attr.name === 'class')?.value;
|
|
207
|
+
if (!classes?.match(/(^|\s)grid-column(\s|$)/)) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
// Only migrate grid-column if its parent grid container is also being migrated
|
|
211
|
+
if (!(0, lib_1.isInterestingNode)(parent) || !(0, migration_utils_1.isNeutralElement)(parent.name)) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const parentClasses = parent.attributes.find((attr) => attr.name === 'class')?.value;
|
|
215
|
+
if (!parentClasses?.match(/(^|\s)grid(\s|$)/)) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (gridHasNonNeutralColumnChildren(parent)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const styleAttr = node.attributes.find((attr) => attr.name === 'style')?.value || '';
|
|
222
|
+
const { inputs, remainingStyle } = (0, migration_utils_1.extractGridColumnInputs)(styleAttr);
|
|
223
|
+
const classParts = classes.split(' ');
|
|
224
|
+
const extraClasses = classParts.filter((c) => c !== 'grid-column').join(' ');
|
|
225
|
+
results.push({
|
|
226
|
+
node,
|
|
227
|
+
inputs,
|
|
228
|
+
remainingStyle: remainingStyle || undefined,
|
|
229
|
+
extraClasses: extraClasses || undefined,
|
|
230
|
+
nodeOffset: template.offsetStart,
|
|
231
|
+
filePath: template.filePath,
|
|
232
|
+
componentTS: sourceFile,
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
return results;
|
|
237
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const path = __importStar(require("path"));
|
|
37
|
+
const lib_1 = require("../lib");
|
|
38
|
+
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
39
|
+
const testsRoot = path.join(__dirname, 'tests');
|
|
40
|
+
describe('lu-grid Migration', () => {
|
|
41
|
+
it('should handle basic case files', async () => {
|
|
42
|
+
// Arrange
|
|
43
|
+
const tree = (0, lib_1.createTreeFromFolder)(path.join(testsRoot, 'input'));
|
|
44
|
+
const expectedTree = (0, lib_1.createTreeFromFolder)(path.join(testsRoot, 'output'));
|
|
45
|
+
// Act
|
|
46
|
+
try {
|
|
47
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'lu-grid', { skipInstallation: true }, tree);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
// eslint-disable-next-line no-console
|
|
51
|
+
console.log(error);
|
|
52
|
+
}
|
|
53
|
+
// Assert
|
|
54
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCssCustomProperties = parseCssCustomProperties;
|
|
4
|
+
exports.extractGridColumnInputs = extractGridColumnInputs;
|
|
5
|
+
exports.isNeutralElement = isNeutralElement;
|
|
6
|
+
// --- CSS custom properties helpers ---
|
|
7
|
+
function parseCssCustomProperties(style) {
|
|
8
|
+
const result = {};
|
|
9
|
+
style.split(';').map((p) => p.trim()).filter(Boolean).forEach((part) => {
|
|
10
|
+
const colonIdx = part.indexOf(':');
|
|
11
|
+
if (colonIdx === -1) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const prop = part.substring(0, colonIdx).trim();
|
|
15
|
+
const value = part.substring(colonIdx + 1).trim();
|
|
16
|
+
result[prop] = value;
|
|
17
|
+
});
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
// CSS custom properties that map directly to GridColumnComponent inputs
|
|
21
|
+
const GRID_COLUMN_DIRECT_PROPS = {
|
|
22
|
+
'--grid-colspan': 'colspan',
|
|
23
|
+
'--grid-rowspan': 'rowspan',
|
|
24
|
+
'--grid-column': 'column',
|
|
25
|
+
'--grid-row': 'row',
|
|
26
|
+
'--grid-justify': 'justify',
|
|
27
|
+
'--grid-align': 'align',
|
|
28
|
+
};
|
|
29
|
+
// Prefix for responsive CSS custom properties
|
|
30
|
+
const RESPONSIVE_PREFIX = '--grid-';
|
|
31
|
+
function extractGridColumnInputs(style) {
|
|
32
|
+
const cssProps = parseCssCustomProperties(style);
|
|
33
|
+
const inputs = {};
|
|
34
|
+
const responsive = {};
|
|
35
|
+
const remaining = [];
|
|
36
|
+
for (const [prop, value] of Object.entries(cssProps)) {
|
|
37
|
+
if (GRID_COLUMN_DIRECT_PROPS[prop]) {
|
|
38
|
+
inputs[GRID_COLUMN_DIRECT_PROPS[prop]] = value;
|
|
39
|
+
}
|
|
40
|
+
else if (prop.startsWith(RESPONSIVE_PREFIX) && prop.includes('AtMedia')) {
|
|
41
|
+
// e.g. --grid-colspanAtMediaMinXS → colspanAtMediaMinXS
|
|
42
|
+
const key = prop.substring(RESPONSIVE_PREFIX.length);
|
|
43
|
+
responsive[key] = value;
|
|
44
|
+
}
|
|
45
|
+
else if (prop.startsWith('--grid-')) {
|
|
46
|
+
// Unknown grid property — drop it (it was grid-specific)
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
remaining.push(`${prop}: ${value}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (Object.keys(responsive).length > 0) {
|
|
53
|
+
inputs.responsive = responsive;
|
|
54
|
+
}
|
|
55
|
+
return { inputs, remainingStyle: remaining.join('; ') };
|
|
56
|
+
}
|
|
57
|
+
const NEUTRAL_HTML_ELEMENTS = ['div', 'span', 'section'];
|
|
58
|
+
function isNeutralElement(name) {
|
|
59
|
+
return NEUTRAL_HTML_ELEMENTS.includes(name);
|
|
60
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "LuccaFrontLuGrid",
|
|
4
|
+
"title": "Migrate HTML Grid to the new lu-grid component",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"dryRun": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Run through the migration without making any changes.",
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
"skipInstall": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Skip installing dependencies.",
|
|
15
|
+
"default": false
|
|
16
|
+
},
|
|
17
|
+
"verbose": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Enable verbose logging.",
|
|
20
|
+
"default": false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path = require("path");
|
|
36
|
+
const path = __importStar(require("path"));
|
|
4
37
|
const lib_1 = require("../lib");
|
|
5
38
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
6
39
|
const testsRoot = path.join(__dirname, 'tests');
|