design-angular-kit 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +461 -0
- package/assets/i18n/en.json +89 -0
- package/assets/i18n/it.json +89 -0
- package/esm2022/design-angular-kit.mjs +5 -0
- package/esm2022/lib/abstracts/abstract-form.component.mjs +199 -0
- package/esm2022/lib/abstracts/abstract.component.mjs +46 -0
- package/esm2022/lib/components/core/accordion/accordion.component.mjs +39 -0
- package/esm2022/lib/components/core/alert/alert.component.mjs +71 -0
- package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +43 -0
- package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +40 -0
- package/esm2022/lib/components/core/avatar/avatar.directive.mjs +78 -0
- package/esm2022/lib/components/core/avatar/avatar.module.mjs +33 -0
- package/esm2022/lib/components/core/badge/badge.directive.mjs +39 -0
- package/esm2022/lib/components/core/button/button.directive.mjs +80 -0
- package/esm2022/lib/components/core/callout/callout.component.mjs +64 -0
- package/esm2022/lib/components/core/card/card.component.mjs +59 -0
- package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +86 -0
- package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +19 -0
- package/esm2022/lib/components/core/carousel/carousel.module.mjs +18 -0
- package/esm2022/lib/components/core/chip/chip.component.mjs +136 -0
- package/esm2022/lib/components/core/collapse/collapse.component.mjs +116 -0
- package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +27 -0
- package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +11 -0
- package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +55 -0
- package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +19 -0
- package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +147 -0
- package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +70 -0
- package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +18 -0
- package/esm2022/lib/components/core/forward/forward.directive.mjs +57 -0
- package/esm2022/lib/components/core/link/link.component.mjs +42 -0
- package/esm2022/lib/components/core/list/list/list.component.mjs +22 -0
- package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +56 -0
- package/esm2022/lib/components/core/list/list.module.mjs +18 -0
- package/esm2022/lib/components/core/modal/modal.component.mjs +194 -0
- package/esm2022/lib/components/core/notifications/notifications.component.mjs +111 -0
- package/esm2022/lib/components/core/pagination/pagination.component.mjs +130 -0
- package/esm2022/lib/components/core/popover/popover.directive.mjs +176 -0
- package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +34 -0
- package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +25 -0
- package/esm2022/lib/components/core/spinner/spinner.component.mjs +30 -0
- package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +116 -0
- package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +22 -0
- package/esm2022/lib/components/core/steppers/steppers.module.mjs +18 -0
- package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +97 -0
- package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +39 -0
- package/esm2022/lib/components/core/tab/tab.module.mjs +18 -0
- package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +134 -0
- package/esm2022/lib/components/core/table/sort/sort.directive.mjs +123 -0
- package/esm2022/lib/components/core/table/table.component.mjs +45 -0
- package/esm2022/lib/components/core/table/table.module.mjs +19 -0
- package/esm2022/lib/components/core/timeline/timeline-item/timeline-item.component.mjs +90 -0
- package/esm2022/lib/components/core/timeline/timeline.component.mjs +36 -0
- package/esm2022/lib/components/core/timeline/timeline.module.mjs +18 -0
- package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +143 -0
- package/esm2022/lib/components/core/video-player/video-player-i18n.model.mjs +2 -0
- package/esm2022/lib/components/core/video-player/video-player-i18n.service.mjs +130 -0
- package/esm2022/lib/components/core/video-player/video-player.component.mjs +303 -0
- package/esm2022/lib/components/core/video-player/video-player.config.mjs +43 -0
- package/esm2022/lib/components/core/video-player/video-player.cookie.mjs +25 -0
- package/esm2022/lib/components/core/video-player/video-player.model.mjs +3 -0
- package/esm2022/lib/components/core/video-player/video-player.module.mjs +16 -0
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +178 -0
- package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +48 -0
- package/esm2022/lib/components/form/form.module.mjs +67 -0
- package/esm2022/lib/components/form/input/input.component.mjs +190 -0
- package/esm2022/lib/components/form/password-input/password-input.component.mjs +149 -0
- package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +60 -0
- package/esm2022/lib/components/form/range/range.component.mjs +64 -0
- package/esm2022/lib/components/form/rating/rating.component.mjs +50 -0
- package/esm2022/lib/components/form/search/search.component.mjs +112 -0
- package/esm2022/lib/components/form/select/select.component.mjs +70 -0
- package/esm2022/lib/components/form/textarea/textarea.component.mjs +55 -0
- package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +191 -0
- package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +2 -0
- package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +70 -0
- package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +72 -0
- package/esm2022/lib/components/form/transfer/transfer.component.mjs +149 -0
- package/esm2022/lib/components/form/transfer/transfer.model.mjs +6 -0
- package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +142 -0
- package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +107 -0
- package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +67 -0
- package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +68 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +51 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +21 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +18 -0
- package/esm2022/lib/components/navigation/header/header.component.mjs +103 -0
- package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +27 -0
- package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +49 -0
- package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +11 -0
- package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +18 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +97 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +44 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +116 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +2 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +68 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +23 -0
- package/esm2022/lib/components/navigation/sidebar/sidebar.component.mjs +50 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink/skiplink.component.mjs +27 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.mjs +26 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink.module.mjs +18 -0
- package/esm2022/lib/components/utils/error-page/error-page.component.mjs +74 -0
- package/esm2022/lib/components/utils/icon/icon.component.mjs +63 -0
- package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +50 -0
- package/esm2022/lib/design-angular-kit.module.mjs +237 -0
- package/esm2022/lib/enums/colors.enums.mjs +12 -0
- package/esm2022/lib/enums/sizes.enum.mjs +9 -0
- package/esm2022/lib/interfaces/core.mjs +16 -0
- package/esm2022/lib/interfaces/design-angular-kit-config.mjs +7 -0
- package/esm2022/lib/interfaces/form.mjs +2 -0
- package/esm2022/lib/interfaces/icon.mjs +168 -0
- package/esm2022/lib/interfaces/sortable-table.mjs +6 -0
- package/esm2022/lib/interfaces/utils.mjs +2 -0
- package/esm2022/lib/pipes/date-ago.pipe.mjs +56 -0
- package/esm2022/lib/pipes/duration.pipe.mjs +115 -0
- package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +48 -0
- package/esm2022/lib/provide-design-angular-kit.mjs +64 -0
- package/esm2022/lib/services/notification/notification.service.mjs +120 -0
- package/esm2022/lib/utils/coercion.mjs +18 -0
- package/esm2022/lib/utils/date-utils.mjs +162 -0
- package/esm2022/lib/utils/file-utils.mjs +73 -0
- package/esm2022/lib/utils/regex.mjs +35 -0
- package/esm2022/lib/validators/it-validators.mjs +161 -0
- package/esm2022/public_api.mjs +114 -0
- package/fesm2022/design-angular-kit.mjs +7423 -0
- package/fesm2022/design-angular-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/abstracts/abstract-form.component.d.ts +89 -0
- package/lib/abstracts/abstract.component.d.ts +30 -0
- package/lib/components/core/accordion/accordion.component.d.ts +18 -0
- package/lib/components/core/alert/alert.component.d.ts +44 -0
- package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +29 -0
- package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +15 -0
- package/lib/components/core/avatar/avatar.directive.d.ts +33 -0
- package/lib/components/core/avatar/avatar.module.d.ts +9 -0
- package/lib/components/core/badge/badge.directive.d.ts +23 -0
- package/lib/components/core/button/button.directive.d.ts +48 -0
- package/lib/components/core/callout/callout.component.d.ts +50 -0
- package/lib/components/core/card/card.component.d.ts +69 -0
- package/lib/components/core/carousel/carousel/carousel.component.d.ts +65 -0
- package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +15 -0
- package/lib/components/core/carousel/carousel.module.d.ts +8 -0
- package/lib/components/core/chip/chip.component.d.ts +76 -0
- package/lib/components/core/collapse/collapse.component.d.ts +67 -0
- package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +12 -0
- package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +5 -0
- package/lib/components/core/dimmer/dimmer.component.d.ts +24 -0
- package/lib/components/core/dimmer/dimmer.module.d.ts +9 -0
- package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +94 -0
- package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +46 -0
- package/lib/components/core/dropdown/dropdown.module.d.ts +8 -0
- package/lib/components/core/forward/forward.directive.d.ts +14 -0
- package/lib/components/core/link/link.component.d.ts +35 -0
- package/lib/components/core/list/list/list.component.d.ts +24 -0
- package/lib/components/core/list/list-item/list-item.component.d.ts +41 -0
- package/lib/components/core/list/list.module.d.ts +8 -0
- package/lib/components/core/modal/modal.component.d.ts +135 -0
- package/lib/components/core/notifications/notifications.component.d.ts +45 -0
- package/lib/components/core/pagination/pagination.component.d.ts +92 -0
- package/lib/components/core/popover/popover.directive.d.ts +99 -0
- package/lib/components/core/progress-bar/progress-bar.component.d.ts +31 -0
- package/lib/components/core/progress-button/progress-button.component.d.ts +21 -0
- package/lib/components/core/spinner/spinner.component.d.ts +24 -0
- package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +130 -0
- package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +24 -0
- package/lib/components/core/steppers/steppers.module.d.ts +8 -0
- package/lib/components/core/tab/tab-container/tab-container.component.d.ts +60 -0
- package/lib/components/core/tab/tab-item/tab-item.component.d.ts +38 -0
- package/lib/components/core/tab/tab.module.d.ts +8 -0
- package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +72 -0
- package/lib/components/core/table/sort/sort.directive.d.ts +53 -0
- package/lib/components/core/table/table.component.d.ts +60 -0
- package/lib/components/core/table/table.module.d.ts +9 -0
- package/lib/components/core/timeline/timeline-item/timeline-item.component.d.ts +79 -0
- package/lib/components/core/timeline/timeline.component.d.ts +21 -0
- package/lib/components/core/timeline/timeline.module.d.ts +8 -0
- package/lib/components/core/tooltip/tooltip.directive.d.ts +82 -0
- package/lib/components/core/video-player/video-player-i18n.model.d.ts +179 -0
- package/lib/components/core/video-player/video-player-i18n.service.d.ts +17 -0
- package/lib/components/core/video-player/video-player.component.d.ts +48 -0
- package/lib/components/core/video-player/video-player.config.d.ts +68 -0
- package/lib/components/core/video-player/video-player.cookie.d.ts +6 -0
- package/lib/components/core/video-player/video-player.model.d.ts +44 -0
- package/lib/components/core/video-player/video-player.module.d.ts +7 -0
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +75 -0
- package/lib/components/form/checkbox/checkbox.component.d.ts +41 -0
- package/lib/components/form/form.module.d.ts +19 -0
- package/lib/components/form/input/input.component.d.ts +95 -0
- package/lib/components/form/password-input/password-input.component.d.ts +80 -0
- package/lib/components/form/radio-button/radio-button.component.d.ts +38 -0
- package/lib/components/form/range/range.component.d.ts +42 -0
- package/lib/components/form/rating/rating.component.d.ts +24 -0
- package/lib/components/form/search/search.component.d.ts +59 -0
- package/lib/components/form/select/select.component.d.ts +36 -0
- package/lib/components/form/textarea/textarea.component.d.ts +34 -0
- package/lib/components/form/transfer/store/transfer.reducers.d.ts +103 -0
- package/lib/components/form/transfer/store/transfer.state.d.ts +18 -0
- package/lib/components/form/transfer/store/transfer.store.d.ts +23 -0
- package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +48 -0
- package/lib/components/form/transfer/transfer.component.d.ts +75 -0
- package/{src/lib/components/form/transfer/transfer.model.ts → lib/components/form/transfer/transfer.model.d.ts} +2 -9
- package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +60 -0
- package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +62 -0
- package/lib/components/navigation/back-button/back-button.component.d.ts +47 -0
- package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +50 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +28 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +23 -0
- package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +8 -0
- package/lib/components/navigation/header/header.component.d.ts +38 -0
- package/lib/components/navigation/megamenu/megamenu.component.d.ts +22 -0
- package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +19 -0
- package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +5 -0
- package/lib/components/navigation/navbar/navbar.module.d.ts +8 -0
- package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +16 -0
- package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +7 -0
- package/lib/components/navigation/navscroll/navscroll.component.d.ts +47 -0
- package/{src/lib/components/navigation/navscroll/navscroll.model.ts → lib/components/navigation/navscroll/navscroll.model.d.ts} +5 -7
- package/lib/components/navigation/navscroll/navscroll.store.d.ts +16 -0
- package/lib/components/navigation/navscroll/navscroll.utils.d.ts +6 -0
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +26 -0
- package/lib/components/navigation/skiplink/skiplink/skiplink.component.d.ts +17 -0
- package/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.d.ts +24 -0
- package/lib/components/navigation/skiplink/skiplink.module.d.ts +8 -0
- package/lib/components/utils/error-page/error-page.component.d.ts +44 -0
- package/lib/components/utils/icon/icon.component.d.ts +53 -0
- package/lib/components/utils/language-switcher/language-switcher.component.d.ts +27 -0
- package/lib/design-angular-kit.module.d.ts +54 -0
- package/lib/enums/colors.enums.d.ts +10 -0
- package/lib/enums/sizes.enum.d.ts +7 -0
- package/{src/lib/interfaces/core.ts → lib/interfaces/core.d.ts} +53 -95
- package/lib/interfaces/design-angular-kit-config.d.ts +30 -0
- package/lib/interfaces/form.d.ts +67 -0
- package/lib/interfaces/icon.d.ts +4 -0
- package/lib/interfaces/sortable-table.d.ts +33 -0
- package/lib/interfaces/utils.d.ts +10 -0
- package/lib/pipes/date-ago.pipe.d.ts +17 -0
- package/lib/pipes/duration.pipe.d.ts +35 -0
- package/lib/pipes/mark-matching-text.pipe.d.ts +18 -0
- package/lib/provide-design-angular-kit.d.ts +7 -0
- package/lib/services/notification/notification.service.d.ts +63 -0
- package/{src/lib/utils/coercion.ts → lib/utils/coercion.d.ts} +1 -7
- package/lib/utils/date-utils.d.ts +79 -0
- package/lib/utils/file-utils.d.ts +32 -0
- package/lib/utils/regex.d.ts +34 -0
- package/lib/validators/it-validators.d.ts +70 -0
- package/package.json +33 -15
- package/{src/public_api.ts → public_api.d.ts} +6 -45
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +29 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/index.spec.d.ts +1 -0
- package/schematics/ng-add/index.spec.js +43 -0
- package/schematics/ng-add/index.spec.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-animations.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/add-animations.js +11 -0
- package/schematics/ng-add/rules/setup-project/add-animations.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-assets.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-assets.js +50 -0
- package/schematics/ng-add/rules/setup-project/add-assets.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +43 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.js +11 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +11 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +112 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.js +50 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js +13 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/exceptions.d.ts +7 -0
- package/schematics/ng-add/rules/setup-project/exceptions.js +17 -0
- package/schematics/ng-add/rules/setup-project/exceptions.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/index.js +23 -0
- package/schematics/ng-add/rules/setup-project/index.js.map +1 -0
- package/schematics/ng-add/{schema.ts → schema.d.ts} +1 -1
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/setup-project.d.ts +3 -0
- package/schematics/ng-add/setup-project.js +37 -0
- package/schematics/ng-add/setup-project.js.map +1 -0
- package/schematics/ng-add/setup-project.spec.d.ts +1 -0
- package/schematics/ng-add/setup-project.spec.js +139 -0
- package/schematics/ng-add/setup-project.spec.js.map +1 -0
- package/schematics/ng-add/utils.d.ts +14 -0
- package/schematics/ng-add/utils.js +49 -0
- package/schematics/ng-add/utils.js.map +1 -0
- package/schematics/ng-add/versions-helper.d.ts +3 -0
- package/schematics/ng-add/versions-helper.js +40 -0
- package/schematics/ng-add/versions-helper.js.map +1 -0
- package/.eslintrc.json +0 -31
- package/karma.conf.js +0 -38
- package/ng-package.json +0 -9
- package/ng-package.prod.json +0 -8
- package/schematics/ng-add/index.spec.ts +0 -45
- package/schematics/ng-add/index.ts +0 -36
- package/schematics/ng-add/rules/setup-project/add-animations.ts +0 -7
- package/schematics/ng-add/rules/setup-project/add-assets.ts +0 -45
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.ts +0 -40
- package/schematics/ng-add/rules/setup-project/add-http-client.ts +0 -7
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.ts +0 -120
- package/schematics/ng-add/rules/setup-project/add-localisation.ts +0 -45
- package/schematics/ng-add/rules/setup-project/angular-json-helper.ts +0 -11
- package/schematics/ng-add/rules/setup-project/exceptions.ts +0 -13
- package/schematics/ng-add/setup-project.spec.ts +0 -166
- package/schematics/ng-add/setup-project.ts +0 -31
- package/schematics/ng-add/utils.ts +0 -71
- package/schematics/ng-add/versions-helper.ts +0 -41
- package/src/lib/abstracts/abstract-form.component.ts +0 -200
- package/src/lib/abstracts/abstract.component.ts +0 -63
- package/src/lib/components/core/accordion/accordion.component.html +0 -27
- package/src/lib/components/core/accordion/accordion.component.spec.ts +0 -21
- package/src/lib/components/core/accordion/accordion.component.ts +0 -40
- package/src/lib/components/core/alert/alert.component.html +0 -19
- package/src/lib/components/core/alert/alert.component.scss +0 -3
- package/src/lib/components/core/alert/alert.component.spec.ts +0 -62
- package/src/lib/components/core/alert/alert.component.ts +0 -75
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.html +0 -23
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.scss +0 -17
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.spec.ts +0 -21
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.ts +0 -50
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.html +0 -7
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.spec.ts +0 -38
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.ts +0 -25
- package/src/lib/components/core/avatar/avatar.directive.ts +0 -73
- package/src/lib/components/core/avatar/avatar.module.ts +0 -18
- package/src/lib/components/core/badge/badge.directive.spec.ts +0 -59
- package/src/lib/components/core/badge/badge.directive.ts +0 -39
- package/src/lib/components/core/button/button.directive.spec.ts +0 -96
- package/src/lib/components/core/button/button.directive.ts +0 -89
- package/src/lib/components/core/callout/callout.component.html +0 -25
- package/src/lib/components/core/callout/callout.component.spec.ts +0 -138
- package/src/lib/components/core/callout/callout.component.ts +0 -92
- package/src/lib/components/core/card/card.component.html +0 -35
- package/src/lib/components/core/card/card.component.scss +0 -30
- package/src/lib/components/core/card/card.component.spec.ts +0 -21
- package/src/lib/components/core/card/card.component.ts +0 -78
- package/src/lib/components/core/carousel/carousel/carousel.component.html +0 -29
- package/src/lib/components/core/carousel/carousel/carousel.component.scss +0 -1
- package/src/lib/components/core/carousel/carousel/carousel.component.spec.ts +0 -21
- package/src/lib/components/core/carousel/carousel/carousel.component.ts +0 -119
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.html +0 -3
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.spec.ts +0 -22
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.ts +0 -20
- package/src/lib/components/core/carousel/carousel.module.ts +0 -11
- package/src/lib/components/core/chip/chip.component.html +0 -26
- package/src/lib/components/core/chip/chip.component.spec.ts +0 -87
- package/src/lib/components/core/chip/chip.component.ts +0 -154
- package/src/lib/components/core/collapse/collapse.component.html +0 -3
- package/src/lib/components/core/collapse/collapse.component.spec.ts +0 -21
- package/src/lib/components/core/collapse/collapse.component.ts +0 -124
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.html +0 -3
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.spec.ts +0 -35
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.ts +0 -23
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.html +0 -3
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.spec.ts +0 -22
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.ts +0 -10
- package/src/lib/components/core/dimmer/dimmer.component.html +0 -7
- package/src/lib/components/core/dimmer/dimmer.component.spec.ts +0 -49
- package/src/lib/components/core/dimmer/dimmer.component.ts +0 -50
- package/src/lib/components/core/dimmer/dimmer.module.ts +0 -12
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.html +0 -45
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.scss +0 -3
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.spec.ts +0 -21
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.ts +0 -186
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.html +0 -18
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.scss +0 -4
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.spec.ts +0 -21
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.ts +0 -82
- package/src/lib/components/core/dropdown/dropdown.module.ts +0 -11
- package/src/lib/components/core/forward/forward.directive.spec.ts +0 -60
- package/src/lib/components/core/forward/forward.directive.ts +0 -43
- package/src/lib/components/core/link/link.component.html +0 -13
- package/src/lib/components/core/link/link.component.spec.ts +0 -21
- package/src/lib/components/core/link/link.component.ts +0 -54
- package/src/lib/components/core/list/list/list.component.html +0 -13
- package/src/lib/components/core/list/list/list.component.spec.ts +0 -21
- package/src/lib/components/core/list/list/list.component.ts +0 -30
- package/src/lib/components/core/list/list-item/list-item.component.html +0 -42
- package/src/lib/components/core/list/list-item/list-item.component.scss +0 -16
- package/src/lib/components/core/list/list-item/list-item.component.spec.ts +0 -21
- package/src/lib/components/core/list/list-item/list-item.component.ts +0 -75
- package/src/lib/components/core/list/list.module.ts +0 -11
- package/src/lib/components/core/modal/modal.component.html +0 -36
- package/src/lib/components/core/modal/modal.component.scss +0 -3
- package/src/lib/components/core/modal/modal.component.spec.ts +0 -21
- package/src/lib/components/core/modal/modal.component.ts +0 -218
- package/src/lib/components/core/notifications/notifications.component.html +0 -25
- package/src/lib/components/core/notifications/notifications.component.scss +0 -3
- package/src/lib/components/core/notifications/notifications.component.spec.ts +0 -21
- package/src/lib/components/core/notifications/notifications.component.ts +0 -123
- package/src/lib/components/core/pagination/pagination.component.html +0 -107
- package/src/lib/components/core/pagination/pagination.component.spec.ts +0 -21
- package/src/lib/components/core/pagination/pagination.component.ts +0 -157
- package/src/lib/components/core/popover/popover.directive.spec.ts +0 -21
- package/src/lib/components/core/popover/popover.directive.ts +0 -171
- package/src/lib/components/core/progress-bar/progress-bar.component.html +0 -20
- package/src/lib/components/core/progress-bar/progress-bar.component.spec.ts +0 -21
- package/src/lib/components/core/progress-bar/progress-bar.component.ts +0 -46
- package/src/lib/components/core/progress-button/progress-button.component.html +0 -5
- package/src/lib/components/core/progress-button/progress-button.component.spec.ts +0 -21
- package/src/lib/components/core/progress-button/progress-button.component.ts +0 -39
- package/src/lib/components/core/spinner/spinner.component.html +0 -7
- package/src/lib/components/core/spinner/spinner.component.spec.ts +0 -80
- package/src/lib/components/core/spinner/spinner.component.ts +0 -31
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.html +0 -126
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.spec.ts +0 -21
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.ts +0 -185
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.html +0 -3
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.spec.ts +0 -22
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.ts +0 -33
- package/src/lib/components/core/steppers/steppers.module.ts +0 -11
- package/src/lib/components/core/tab/tab-container/tab-container.component.html +0 -78
- package/src/lib/components/core/tab/tab-container/tab-container.component.spec.ts +0 -21
- package/src/lib/components/core/tab/tab-container/tab-container.component.ts +0 -137
- package/src/lib/components/core/tab/tab-item/tab-item.component.html +0 -3
- package/src/lib/components/core/tab/tab-item/tab-item.component.spec.ts +0 -22
- package/src/lib/components/core/tab/tab-item/tab-item.component.ts +0 -50
- package/src/lib/components/core/tab/tab.module.ts +0 -11
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.html +0 -27
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.scss +0 -65
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.spec.ts +0 -25
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.ts +0 -164
- package/src/lib/components/core/table/sort/sort.directive.spec.ts +0 -73
- package/src/lib/components/core/table/sort/sort.directive.ts +0 -142
- package/src/lib/components/core/table/table.component.html +0 -23
- package/src/lib/components/core/table/table.component.scss +0 -7
- package/src/lib/components/core/table/table.component.spec.ts +0 -21
- package/src/lib/components/core/table/table.component.ts +0 -70
- package/src/lib/components/core/table/table.module.ts +0 -12
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.html +0 -47
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.spec.ts +0 -24
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.ts +0 -102
- package/src/lib/components/core/timeline/timeline.component.html +0 -21
- package/src/lib/components/core/timeline/timeline.component.spec.ts +0 -21
- package/src/lib/components/core/timeline/timeline.component.ts +0 -31
- package/src/lib/components/core/timeline/timeline.module.ts +0 -11
- package/src/lib/components/core/tooltip/tooltip.directive.spec.ts +0 -20
- package/src/lib/components/core/tooltip/tooltip.directive.ts +0 -141
- package/src/lib/components/form/autocomplete/autocomplete.component.html +0 -58
- package/src/lib/components/form/autocomplete/autocomplete.component.spec.ts +0 -21
- package/src/lib/components/form/autocomplete/autocomplete.component.ts +0 -130
- package/src/lib/components/form/checkbox/checkbox.component.html +0 -67
- package/src/lib/components/form/checkbox/checkbox.component.spec.ts +0 -21
- package/src/lib/components/form/checkbox/checkbox.component.ts +0 -65
- package/src/lib/components/form/form.module.ts +0 -34
- package/src/lib/components/form/input/input.component.html +0 -92
- package/src/lib/components/form/input/input.component.scss +0 -29
- package/src/lib/components/form/input/input.component.spec.ts +0 -21
- package/src/lib/components/form/input/input.component.ts +0 -234
- package/src/lib/components/form/password-input/password-input.component.html +0 -65
- package/src/lib/components/form/password-input/password-input.component.scss +0 -9
- package/src/lib/components/form/password-input/password-input.component.spec.ts +0 -21
- package/src/lib/components/form/password-input/password-input.component.ts +0 -171
- package/src/lib/components/form/radio-button/radio-button.component.html +0 -50
- package/src/lib/components/form/radio-button/radio-button.component.scss +0 -14
- package/src/lib/components/form/radio-button/radio-button.component.spec.ts +0 -21
- package/src/lib/components/form/radio-button/radio-button.component.ts +0 -82
- package/src/lib/components/form/range/range.component.html +0 -17
- package/src/lib/components/form/range/range.component.scss +0 -17
- package/src/lib/components/form/range/range.component.spec.ts +0 -21
- package/src/lib/components/form/range/range.component.ts +0 -100
- package/src/lib/components/form/rating/rating.component.html +0 -24
- package/src/lib/components/form/rating/rating.component.spec.ts +0 -21
- package/src/lib/components/form/rating/rating.component.ts +0 -52
- package/src/lib/components/form/select/select.component.html +0 -54
- package/src/lib/components/form/select/select.component.scss +0 -3
- package/src/lib/components/form/select/select.component.spec.ts +0 -22
- package/src/lib/components/form/select/select.component.ts +0 -91
- package/src/lib/components/form/textarea/textarea.component.html +0 -28
- package/src/lib/components/form/textarea/textarea.component.scss +0 -12
- package/src/lib/components/form/textarea/textarea.component.spec.ts +0 -21
- package/src/lib/components/form/textarea/textarea.component.ts +0 -61
- package/src/lib/components/form/transfer/store/transfer.reducers.ts +0 -242
- package/src/lib/components/form/transfer/store/transfer.state.ts +0 -20
- package/src/lib/components/form/transfer/store/transfer.store.ts +0 -88
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.html +0 -42
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.spec.ts +0 -33
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.ts +0 -93
- package/src/lib/components/form/transfer/transfer.component.html +0 -52
- package/src/lib/components/form/transfer/transfer.component.spec.ts +0 -27
- package/src/lib/components/form/transfer/transfer.component.ts +0 -159
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.html +0 -36
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.spec.ts +0 -21
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.ts +0 -170
- package/src/lib/components/form/upload-file-list/upload-file-list.component.html +0 -46
- package/src/lib/components/form/upload-file-list/upload-file-list.component.spec.ts +0 -22
- package/src/lib/components/form/upload-file-list/upload-file-list.component.ts +0 -120
- package/src/lib/components/navigation/back-button/back-button.component.html +0 -25
- package/src/lib/components/navigation/back-button/back-button.component.spec.ts +0 -91
- package/src/lib/components/navigation/back-button/back-button.component.ts +0 -67
- package/src/lib/components/navigation/back-to-top/back-to-top.component.html +0 -11
- package/src/lib/components/navigation/back-to-top/back-to-top.component.spec.ts +0 -21
- package/src/lib/components/navigation/back-to-top/back-to-top.component.ts +0 -80
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.html +0 -23
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.spec.ts +0 -21
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.ts +0 -68
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.html +0 -3
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.spec.ts +0 -22
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.ts +0 -29
- package/src/lib/components/navigation/breadcrumbs/breadcrumbs.module.ts +0 -11
- package/src/lib/components/navigation/header/header.component.html +0 -102
- package/src/lib/components/navigation/header/header.component.scss +0 -3
- package/src/lib/components/navigation/header/header.component.spec.ts +0 -21
- package/src/lib/components/navigation/header/header.component.ts +0 -107
- package/src/lib/components/navigation/megamenu/megamenu.component.html +0 -34
- package/src/lib/components/navigation/megamenu/megamenu.component.scss +0 -5
- package/src/lib/components/navigation/megamenu/megamenu.component.ts +0 -30
- package/src/lib/components/navigation/navbar/navbar/navbar.component.html +0 -28
- package/src/lib/components/navigation/navbar/navbar/navbar.component.ts +0 -45
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.html +0 -3
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.ts +0 -10
- package/src/lib/components/navigation/navbar/navbar.module.ts +0 -11
- package/src/lib/components/navigation/navscroll/navscroll-list-item.component.ts +0 -95
- package/src/lib/components/navigation/navscroll/navscroll-list-items.component.ts +0 -27
- package/src/lib/components/navigation/navscroll/navscroll.component.html +0 -101
- package/src/lib/components/navigation/navscroll/navscroll.component.scss +0 -9
- package/src/lib/components/navigation/navscroll/navscroll.component.ts +0 -143
- package/src/lib/components/navigation/navscroll/navscroll.store.ts +0 -96
- package/src/lib/components/navigation/navscroll/navscroll.utils.ts +0 -28
- package/src/lib/components/navigation/sidebar/sidebar.component.html +0 -11
- package/src/lib/components/navigation/sidebar/sidebar.component.spec.ts +0 -21
- package/src/lib/components/navigation/sidebar/sidebar.component.ts +0 -39
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.html +0 -15
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.ts +0 -27
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.html +0 -15
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.ts +0 -38
- package/src/lib/components/navigation/skiplink/skiplink.module.ts +0 -11
- package/src/lib/components/utils/error-page/error-page.component.html +0 -33
- package/src/lib/components/utils/error-page/error-page.component.spec.ts +0 -21
- package/src/lib/components/utils/error-page/error-page.component.ts +0 -79
- package/src/lib/components/utils/icon/icon.component.html +0 -6
- package/src/lib/components/utils/icon/icon.component.spec.ts +0 -21
- package/src/lib/components/utils/icon/icon.component.ts +0 -95
- package/src/lib/components/utils/language-switcher/language-switcher.component.html +0 -21
- package/src/lib/components/utils/language-switcher/language-switcher.component.spec.ts +0 -21
- package/src/lib/components/utils/language-switcher/language-switcher.component.ts +0 -56
- package/src/lib/design-angular-kit.module.ts +0 -131
- package/src/lib/enums/colors.enums.ts +0 -10
- package/src/lib/enums/sizes.enum.ts +0 -7
- package/src/lib/interfaces/design-angular-kit-config.ts +0 -34
- package/src/lib/interfaces/form.ts +0 -78
- package/src/lib/interfaces/icon.ts +0 -176
- package/src/lib/interfaces/sortable-table.ts +0 -42
- package/src/lib/interfaces/utils.ts +0 -11
- package/src/lib/pipes/date-ago.pipe.ts +0 -57
- package/src/lib/pipes/duration.pipe.ts +0 -112
- package/src/lib/pipes/mark-matching-text.pipe.ts +0 -43
- package/src/lib/provide-design-angular-kit.ts +0 -73
- package/src/lib/services/notification/notification.service.spec.ts +0 -16
- package/src/lib/services/notification/notification.service.ts +0 -119
- package/src/lib/utils/date-utils.ts +0 -184
- package/src/lib/utils/file-utils.ts +0 -80
- package/src/lib/utils/regex.ts +0 -44
- package/src/lib/validators/it-validators.ts +0 -193
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -24
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.schematics.json +0 -25
- package/tsconfig.spec.json +0 -9
- /package/schematics/ng-add/rules/setup-project/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoMainFileException = exports.NoProjectException = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
class NoProjectException extends schematics_1.SchematicsException {
|
|
6
|
+
constructor(project) {
|
|
7
|
+
super(`Unable to find project '${project}' in the workspace`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.NoProjectException = NoProjectException;
|
|
11
|
+
class NoMainFileException extends schematics_1.SchematicsException {
|
|
12
|
+
constructor(project) {
|
|
13
|
+
super(`Unable to find 'build.options.main' file path for project "${project}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.NoMainFileException = NoMainFileException;
|
|
17
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../../../../../projects/design-angular-kit/schematics/ng-add/rules/setup-project/exceptions.ts"],"names":[],"mappings":";;;AAAA,2DAAiE;AAEjE,MAAa,kBAAmB,SAAQ,gCAAmB;IACzD,YAAY,OAAe;QACzB,KAAK,CAAC,2BAA2B,OAAO,oBAAoB,CAAC,CAAC;IAChE,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,mBAAoB,SAAQ,gCAAmB;IAC1D,YAAY,OAAe;QACzB,KAAK,CAAC,8DAA8D,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;CACF;AAJD,kDAIC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./add-animations"), exports);
|
|
18
|
+
__exportStar(require("./add-assets"), exports);
|
|
19
|
+
__exportStar(require("./add-design-angular-kit"), exports);
|
|
20
|
+
__exportStar(require("./add-http-client"), exports);
|
|
21
|
+
__exportStar(require("./add-import-to-style-file"), exports);
|
|
22
|
+
__exportStar(require("./add-localisation"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../projects/design-angular-kit/schematics/ng-add/rules/setup-project/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,6DAA2C;AAC3C,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../projects/design-angular-kit/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
+
const schematics_2 = require("@angular/cdk/schematics");
|
|
14
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
15
|
+
const setup_project_1 = require("./rules/setup-project");
|
|
16
|
+
const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
|
|
17
|
+
function default_1(options) {
|
|
18
|
+
return (host, context) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const workspace = yield (0, workspace_1.getWorkspace)(host);
|
|
20
|
+
const project = (0, schematics_2.getProjectFromWorkspace)(workspace, options.project);
|
|
21
|
+
const isAProject = project.extensions['projectType'] === workspace_models_1.ProjectType.Application;
|
|
22
|
+
if (isAProject) {
|
|
23
|
+
return (0, schematics_1.chain)([
|
|
24
|
+
(0, setup_project_1.addAnimations)(),
|
|
25
|
+
(0, setup_project_1.addHttpClient)(),
|
|
26
|
+
(0, setup_project_1.addDesignAngularKit)(options),
|
|
27
|
+
(0, setup_project_1.addImportToStyleFile)(options),
|
|
28
|
+
(0, setup_project_1.addAssets)(options),
|
|
29
|
+
(0, setup_project_1.addLocalisation)(options),
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
context.logger.warn(`Design Angular Kit has been set in your workspace. No additional setup required.\nIf you intend to run the schematics on a specific project, please use -- project option `);
|
|
33
|
+
return;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.default = default_1;
|
|
37
|
+
//# sourceMappingURL=setup-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-project.js","sourceRoot":"","sources":["../../../../projects/design-angular-kit/schematics/ng-add/setup-project.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAiF;AAEjF,wDAAkE;AAClE,qEAAqE;AACrE,yDAA4I;AAG5I,mFAA2E;AAE3E,mBAAyB,OAAe;IACtC,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACpE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,8BAAW,CAAC,WAAW,CAAC;QAEjF,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAA,kBAAK,EAAC;gBACX,IAAA,6BAAa,GAAE;gBACf,IAAA,6BAAa,GAAE;gBACf,IAAA,mCAAmB,EAAC,OAAO,CAAC;gBAC5B,IAAA,oCAAoB,EAAC,OAAO,CAAC;gBAC7B,IAAA,yBAAS,EAAC,OAAO,CAAC;gBAClB,IAAA,+BAAe,EAAC,OAAO,CAAC;aACzB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,4KAA4K,CAC7K,CAAC;QACF,OAAO;IACT,CAAC,CAAA,CAAC;AACJ,CAAC;AArBD,4BAqBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const createApp = (runner_1, options_1, _a) => __awaiter(void 0, [runner_1, options_1, _a], void 0, function* (runner, options, { standalone, style }) {
|
|
15
|
+
let tree = yield runner.runExternalSchematic('@schematics/angular', 'workspace', {
|
|
16
|
+
name: 'workspace',
|
|
17
|
+
version: '18.0.0',
|
|
18
|
+
newProjectRoot: 'projects',
|
|
19
|
+
});
|
|
20
|
+
tree = yield runner.runExternalSchematic('@schematics/angular', 'application', {
|
|
21
|
+
name: options.project,
|
|
22
|
+
standalone,
|
|
23
|
+
style,
|
|
24
|
+
}, tree);
|
|
25
|
+
return { tree };
|
|
26
|
+
});
|
|
27
|
+
describe(`ng add design-angular-kit | setup-project - library providing`, () => {
|
|
28
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
29
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
30
|
+
const defaultOptions = {
|
|
31
|
+
project: 'test-project', // Set your default project name
|
|
32
|
+
};
|
|
33
|
+
it('should add DesignAngularKitModule to the root module - NgModule app', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone: false, style: 'scss' });
|
|
35
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
36
|
+
// Check if the app.module.ts file exists
|
|
37
|
+
const modulePath = '/projects/test-project/src/app/app.module.ts';
|
|
38
|
+
expect(tree.files).toContain(modulePath);
|
|
39
|
+
// Check if the correct import statement was added
|
|
40
|
+
const content = tree.readContent(modulePath);
|
|
41
|
+
expect(content).toContain(`import { DesignAngularKitModule } from 'design-angular-kit';`);
|
|
42
|
+
expect(content).toContain(`DesignAngularKitModule.forRoot()`);
|
|
43
|
+
}));
|
|
44
|
+
it('should add provideDesignAngularKit() to the app config - Standalone app', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone: true, style: 'scss' });
|
|
46
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
47
|
+
// Check if the app.module.ts file exists
|
|
48
|
+
const appConfigPath = '/projects/test-project/src/app/app.config.ts';
|
|
49
|
+
expect(tree.files).toContain(appConfigPath);
|
|
50
|
+
// Check if the correct import statement was added
|
|
51
|
+
const content = tree.readContent(appConfigPath);
|
|
52
|
+
expect(content).toContain(`import { provideDesignAngularKit } from 'design-angular-kit';`);
|
|
53
|
+
expect(content).toContain(`provideDesignAngularKit()`);
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
for (const standalone of [true, false]) {
|
|
57
|
+
describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - styles`, () => {
|
|
58
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
59
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
60
|
+
const defaultOptions = {
|
|
61
|
+
project: 'test-project', // Set your default project name
|
|
62
|
+
};
|
|
63
|
+
it('should add .scss import to project style file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone, style: 'scss' });
|
|
65
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
66
|
+
// Check if the styles.scss file exists
|
|
67
|
+
const styleFilePath = '/projects/test-project/src/styles.scss';
|
|
68
|
+
expect(tree.files).toContain(styleFilePath);
|
|
69
|
+
// Check if the correct import statement was added
|
|
70
|
+
const content = tree.readContent(styleFilePath);
|
|
71
|
+
expect(content).toContain(`@import '../node_modules/bootstrap-italia/src/scss/bootstrap-italia.scss';`);
|
|
72
|
+
}));
|
|
73
|
+
it('should add .sass import to project style file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone, style: 'sass' });
|
|
75
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
76
|
+
// Check if the styles.sass file exists
|
|
77
|
+
const styleFilePath = '/projects/test-project/src/styles.sass';
|
|
78
|
+
expect(tree.files).toContain(styleFilePath);
|
|
79
|
+
// Check if the correct import statement was added
|
|
80
|
+
const content = tree.readContent(styleFilePath);
|
|
81
|
+
expect(content).toContain(`@import 'bootstrap-italia/scss/bootstrap-italia'`);
|
|
82
|
+
}));
|
|
83
|
+
it('should add .css import to angular.json', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone, style: 'css' });
|
|
85
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
86
|
+
// Check if the angular.json file exists
|
|
87
|
+
const angularJsonPath = '/angular.json';
|
|
88
|
+
expect(tree.files).toContain(angularJsonPath);
|
|
89
|
+
// Check if the correct import statement was added
|
|
90
|
+
const content = tree.readContent(angularJsonPath);
|
|
91
|
+
expect(content).toContain(`node_modules/bootstrap-italia/dist/css/bootstrap-italia.min.css`);
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - assets`, () => {
|
|
95
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
96
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
97
|
+
const defaultOptions = {
|
|
98
|
+
project: 'test-project', // Set your default project name
|
|
99
|
+
};
|
|
100
|
+
it('should add bootstrap italia assets to angular.json', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
+
var _a, _b, _c, _d, _e;
|
|
102
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone, style: 'css' });
|
|
103
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
104
|
+
// Check if the angular.json file exists
|
|
105
|
+
const angularJsonPath = '/angular.json';
|
|
106
|
+
expect(tree.files).toContain(angularJsonPath);
|
|
107
|
+
// Check if the correct import statement was added
|
|
108
|
+
const content = tree.readContent(angularJsonPath);
|
|
109
|
+
//"./node_modules/bootstrap-italia/"
|
|
110
|
+
expect(content).toContain(`./node_modules/bootstrap-italia/`);
|
|
111
|
+
const angularJson = JSON.parse(content);
|
|
112
|
+
const assetsConfig = (_e = (_d = (_c = (_b = (_a = angularJson.projects[defaultOptions.project]) === null || _a === void 0 ? void 0 : _a.architect) === null || _b === void 0 ? void 0 : _b.build) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.assets) === null || _e === void 0 ? void 0 : _e.find((item) => item.input === `./node_modules/bootstrap-italia/`);
|
|
113
|
+
expect(assetsConfig).toBeDefined(assetsConfig);
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
describe(`ng add design-angular-kit | setup-project for ${standalone ? 'standalone' : 'NgModule'} app - localisation`, () => {
|
|
117
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
118
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
119
|
+
const defaultOptions = {
|
|
120
|
+
project: 'test-project', // Set your default project name
|
|
121
|
+
};
|
|
122
|
+
it('should add bootstrap italia localisation to angular.json', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
+
var _a, _b, _c, _d, _e;
|
|
124
|
+
const { tree: appTree } = yield createApp(runner, defaultOptions, { standalone, style: 'css' });
|
|
125
|
+
const tree = yield runner.runSchematic('ng-add-setup-project', defaultOptions, appTree);
|
|
126
|
+
// Check if the angular.json file exists
|
|
127
|
+
const angularJsonPath = '/angular.json';
|
|
128
|
+
expect(tree.files).toContain(angularJsonPath);
|
|
129
|
+
// Check if the correct import statement was added
|
|
130
|
+
const content = tree.readContent(angularJsonPath);
|
|
131
|
+
//"./node_modules/bootstrap-italia/"
|
|
132
|
+
expect(content).toContain(`/node_modules/design-angular-kit/assets/i18n`);
|
|
133
|
+
const angularJson = JSON.parse(content);
|
|
134
|
+
const assetsConfig = (_e = (_d = (_c = (_b = (_a = angularJson.projects[defaultOptions.project]) === null || _a === void 0 ? void 0 : _a.architect) === null || _b === void 0 ? void 0 : _b.build) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.assets) === null || _e === void 0 ? void 0 : _e.find((item) => item.input === `./node_modules/design-angular-kit/assets/i18n`);
|
|
135
|
+
expect(assetsConfig).toBeDefined(assetsConfig);
|
|
136
|
+
}));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=setup-project.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-project.spec.js","sourceRoot":"","sources":["../../../../projects/design-angular-kit/schematics/ng-add/setup-project.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,gEAAyE;AACzE,6BAA6B;AAG7B,MAAM,SAAS,GAAG,0BAIhB,EAAE,iEAHF,MAA2B,EAC3B,OAAe,EACf,EAAE,UAAU,EAAE,KAAK,EAA2D;IAE9E,IAAI,IAAI,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,qBAAqB,EAAE,WAAW,EAAE;QAC/E,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,UAAU;KAC3B,CAAC,CAAC;IAEH,IAAI,GAAG,MAAM,MAAM,CAAC,oBAAoB,CACtC,qBAAqB,EACrB,aAAa,EACb;QACE,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,UAA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AI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YAClD,oCAAoC;YACpC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,8CAA8C,CAAC,CAAC;YAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,YAAY,GAAG,MAAA,MAAA,MAAA,MAAA,MAAA,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,0CAAE,SAAS,0CAAE,KAAK,0CAAE,OAAO,0CAAE,MAAM,0CAAE,IAAI,CACxG,CAAC,IAAuB,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,+CAA+C,CAC5F,CAAC;YACF,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/** Get a SemVerObject given a semver string */
|
|
3
|
+
export declare function toSemVerObject(versionString: string): {
|
|
4
|
+
semVer: string | undefined;
|
|
5
|
+
major: string;
|
|
6
|
+
minor: string;
|
|
7
|
+
patch: string;
|
|
8
|
+
prerelease: string;
|
|
9
|
+
buildmetadata: string;
|
|
10
|
+
};
|
|
11
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
12
|
+
export declare function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree;
|
|
13
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
14
|
+
export declare function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPackageVersionFromPackageJson = exports.addPackageToPackageJson = exports.toSemVerObject = void 0;
|
|
4
|
+
const SEMVER_WITH_PREFIX_REGEX = /^[\^~]?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/;
|
|
5
|
+
function sortObjectByKeys(obj) {
|
|
6
|
+
return Object.keys(obj)
|
|
7
|
+
.sort()
|
|
8
|
+
.reduce((result, key) => {
|
|
9
|
+
result[key] = obj[key];
|
|
10
|
+
return result;
|
|
11
|
+
}, {});
|
|
12
|
+
}
|
|
13
|
+
/** Get a SemVerObject given a semver string */
|
|
14
|
+
function toSemVerObject(versionString) {
|
|
15
|
+
var _a;
|
|
16
|
+
const [semVer, major, minor, patch, prerelease, buildmetadata] = (_a = versionString.match(SEMVER_WITH_PREFIX_REGEX)) !== null && _a !== void 0 ? _a : [];
|
|
17
|
+
return { semVer, major, minor, patch, prerelease, buildmetadata };
|
|
18
|
+
}
|
|
19
|
+
exports.toSemVerObject = toSemVerObject;
|
|
20
|
+
/** Adds a package to the package.json in the given host tree. */
|
|
21
|
+
function addPackageToPackageJson(host, pkg, version) {
|
|
22
|
+
if (host.exists('package.json')) {
|
|
23
|
+
const sourceText = host.read('package.json').toString('utf-8');
|
|
24
|
+
const json = JSON.parse(sourceText);
|
|
25
|
+
if (!json.dependencies) {
|
|
26
|
+
json.dependencies = {};
|
|
27
|
+
}
|
|
28
|
+
if (!json.dependencies[pkg]) {
|
|
29
|
+
json.dependencies[pkg] = version;
|
|
30
|
+
json.dependencies = sortObjectByKeys(json.dependencies);
|
|
31
|
+
}
|
|
32
|
+
host.overwrite('package.json', JSON.stringify(json, null, 2));
|
|
33
|
+
}
|
|
34
|
+
return host;
|
|
35
|
+
}
|
|
36
|
+
exports.addPackageToPackageJson = addPackageToPackageJson;
|
|
37
|
+
/** Gets the version of the specified package by looking at the package.json in the given tree. */
|
|
38
|
+
function getPackageVersionFromPackageJson(tree, name) {
|
|
39
|
+
if (!tree.exists('package.json')) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
|
|
43
|
+
if (packageJson.dependencies && packageJson.dependencies[name]) {
|
|
44
|
+
return packageJson.dependencies[name];
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
|
|
49
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../projects/design-angular-kit/schematics/ng-add/utils.ts"],"names":[],"mappings":";;;AAeA,MAAM,wBAAwB,GAC5B,yKAAyK,CAAC;AAE5K,SAAS,gBAAgB,CAAC,GAA2B;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,MAAM,CACL,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC,EACD,EAA4B,CAC7B,CAAC;AACN,CAAC;AAED,+CAA+C;AAC/C,SAAgB,cAAc,CAAC,aAAqB;;IAClD,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,CAAC,GAAG,MAAA,aAAa,CAAC,KAAK,CAAC,wBAAwB,CAAC,mCAAI,EAAE,CAAC;IACrH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAyB,CAAC;AAC3F,CAAC;AAHD,wCAGC;AAED,iEAAiE;AACjE,SAAgB,uBAAuB,CAAC,IAAU,EAAE,GAAW,EAAE,OAAe;IAC9E,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC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"__esModule", { value: true });
|
|
3
|
+
exports.getPackageVersion = void 0;
|
|
4
|
+
const ANGULAR_VERSIONS = {
|
|
5
|
+
v17: '17',
|
|
6
|
+
v18: '18',
|
|
7
|
+
};
|
|
8
|
+
const KIT_VERSION_1_0_0 = '1.0.0';
|
|
9
|
+
const KIT_VERSION_1_1_0 = '1.1.0';
|
|
10
|
+
const DEFAULT = 'DEFAULT';
|
|
11
|
+
const LATEST = 'LATEST';
|
|
12
|
+
const versionsMap = {
|
|
13
|
+
[DEFAULT]: KIT_VERSION_1_0_0,
|
|
14
|
+
[ANGULAR_VERSIONS.v17]: KIT_VERSION_1_0_0,
|
|
15
|
+
[ANGULAR_VERSIONS.v18]: KIT_VERSION_1_1_0,
|
|
16
|
+
[LATEST]: KIT_VERSION_1_1_0,
|
|
17
|
+
};
|
|
18
|
+
// Get Design Angular Kit package version given Angular major version
|
|
19
|
+
function getPackageVersion({ angularMajorVersion }) {
|
|
20
|
+
if (isNaN(+angularMajorVersion)) {
|
|
21
|
+
throw new Error('Major version is not a number');
|
|
22
|
+
}
|
|
23
|
+
let version = versionsMap[DEFAULT];
|
|
24
|
+
switch (angularMajorVersion) {
|
|
25
|
+
case ANGULAR_VERSIONS.v17:
|
|
26
|
+
version = versionsMap[ANGULAR_VERSIONS.v17];
|
|
27
|
+
break;
|
|
28
|
+
case ANGULAR_VERSIONS.v18:
|
|
29
|
+
version = versionsMap[ANGULAR_VERSIONS.v18];
|
|
30
|
+
break;
|
|
31
|
+
default: {
|
|
32
|
+
if (Number(angularMajorVersion) > Number(ANGULAR_VERSIONS.v18)) {
|
|
33
|
+
version = versionsMap[LATEST];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return version;
|
|
38
|
+
}
|
|
39
|
+
exports.getPackageVersion = getPackageVersion;
|
|
40
|
+
//# sourceMappingURL=versions-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions-helper.js","sourceRoot":"","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CAAC;AACjB,CAAC;AAtBD,8CAsBC"}
|
package/.eslintrc.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc.json",
|
|
3
|
-
"ignorePatterns": ["!**/*"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts"],
|
|
7
|
-
"rules": {
|
|
8
|
-
"@angular-eslint/directive-selector": [
|
|
9
|
-
"error",
|
|
10
|
-
{
|
|
11
|
-
"type": "attribute",
|
|
12
|
-
"prefix": "it",
|
|
13
|
-
"style": "camelCase"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"@angular-eslint/component-selector": [
|
|
17
|
-
"error",
|
|
18
|
-
{
|
|
19
|
-
"type": "element",
|
|
20
|
-
"prefix": "it",
|
|
21
|
-
"style": "kebab-case"
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"files": ["*.html"],
|
|
28
|
-
"rules": {}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
package/karma.conf.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-coverage'),
|
|
11
|
-
require('karma-chrome-launcher'),
|
|
12
|
-
require('karma-jasmine-html-reporter'),
|
|
13
|
-
require('karma-coverage-istanbul-reporter'),
|
|
14
|
-
require('@angular-devkit/build-angular/plugins/karma'),
|
|
15
|
-
],
|
|
16
|
-
client: {
|
|
17
|
-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
18
|
-
},
|
|
19
|
-
coverageIstanbulReporter: {
|
|
20
|
-
dir: require('path').join(__dirname, '../../coverage'),
|
|
21
|
-
reports: ['html', 'lcovonly', 'text-summary'],
|
|
22
|
-
fixWebpackSourcePaths: true,
|
|
23
|
-
},
|
|
24
|
-
reporters: ['progress', 'kjhtml', 'coverage-istanbul'],
|
|
25
|
-
port: 9876,
|
|
26
|
-
colors: true,
|
|
27
|
-
logLevel: config.LOG_INFO,
|
|
28
|
-
autoWatch: true,
|
|
29
|
-
browsers: ['Chrome'],
|
|
30
|
-
customLaunchers: {
|
|
31
|
-
ChromeNoSandbox: {
|
|
32
|
-
base: 'Chrome',
|
|
33
|
-
flags: ['--no-sandbox'],
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
singleRun: false,
|
|
37
|
-
});
|
|
38
|
-
};
|
package/ng-package.json
DELETED
package/ng-package.prod.json
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { Schema as SchematicOptions } from './schema';
|
|
4
|
-
|
|
5
|
-
describe(`ng add design-angular-kit`, () => {
|
|
6
|
-
const collectionPath = path.join(__dirname, '../collection.json');
|
|
7
|
-
const runner = new SchematicTestRunner('schematics', collectionPath);
|
|
8
|
-
|
|
9
|
-
const defaultOptions: SchematicOptions = {
|
|
10
|
-
project: 'test-project', // Set your default project name
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let appTree: UnitTestTree;
|
|
14
|
-
|
|
15
|
-
beforeEach(async () => {
|
|
16
|
-
// Simulate an Angular workspace project before running the schematic
|
|
17
|
-
appTree = await runner.runExternalSchematic('@schematics/angular', 'workspace', {
|
|
18
|
-
name: 'workspace',
|
|
19
|
-
version: '6.0.0',
|
|
20
|
-
newProjectRoot: 'projects',
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
appTree = await runner.runExternalSchematic(
|
|
24
|
-
'@schematics/angular',
|
|
25
|
-
'application',
|
|
26
|
-
{
|
|
27
|
-
name: defaultOptions.project,
|
|
28
|
-
standalone: false,
|
|
29
|
-
},
|
|
30
|
-
appTree
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should add DesignAngularKitModule to package.json', async () => {
|
|
35
|
-
const tree = await runner.runSchematic('ng-add', defaultOptions, appTree);
|
|
36
|
-
|
|
37
|
-
// Check if the package.json file exists
|
|
38
|
-
const packageJsonPath = '/package.json';
|
|
39
|
-
expect(tree.files).toContain(packageJsonPath);
|
|
40
|
-
|
|
41
|
-
// Check if the correct dependency was added
|
|
42
|
-
const content = tree.readContent(packageJsonPath);
|
|
43
|
-
expect(content).toContain(`"design-angular-kit"`);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks';
|
|
3
|
-
|
|
4
|
-
import { Schema } from './schema';
|
|
5
|
-
import { addPackageToPackageJson, getPackageVersionFromPackageJson, toSemVerObject } from './utils';
|
|
6
|
-
import { getPackageVersion } from './versions-helper';
|
|
7
|
-
|
|
8
|
-
const DESIGN_ANGULAR_KIT_PACKAGE_NAME = 'design-angular-kit';
|
|
9
|
-
const NG_LATEST_VERSION = '19.0.0';
|
|
10
|
-
|
|
11
|
-
export default function (options: Schema): Rule {
|
|
12
|
-
return (host: Tree, context: SchematicContext) => {
|
|
13
|
-
// Get the version of `@angular/core`
|
|
14
|
-
// This tag should be preferred because all Angular dependencies should have the same version tag if possible.
|
|
15
|
-
const ngCoreVersionTag = getPackageVersionFromPackageJson(host, '@angular/core');
|
|
16
|
-
const designAngularKitVersionRange = getPackageVersionFromPackageJson(host, DESIGN_ANGULAR_KIT_PACKAGE_NAME);
|
|
17
|
-
const angularDependencyVersion = ngCoreVersionTag || NG_LATEST_VERSION;
|
|
18
|
-
|
|
19
|
-
const { major: angularMajorVersion } = toSemVerObject(angularDependencyVersion);
|
|
20
|
-
|
|
21
|
-
const designAngularKitPackageVersion = getPackageVersion({ angularMajorVersion });
|
|
22
|
-
|
|
23
|
-
// The CLI inserts `design-angular-kit` into the `package.json` before this schematic runs.
|
|
24
|
-
// This means that we do not need to insert Design Angular Kit into `package.json` files again.
|
|
25
|
-
if (designAngularKitVersionRange === null) {
|
|
26
|
-
addPackageToPackageJson(host, DESIGN_ANGULAR_KIT_PACKAGE_NAME, designAngularKitPackageVersion);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
addPackageToPackageJson(host, '@angular/cdk', angularDependencyVersion);
|
|
30
|
-
addPackageToPackageJson(host, '@angular/animations', angularDependencyVersion);
|
|
31
|
-
|
|
32
|
-
const installTaskId = context.addTask(new NodePackageInstallTask());
|
|
33
|
-
|
|
34
|
-
context.addTask(new RunSchematicTask('ng-add-setup-project', options), [installTaskId]);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { callRule, noop, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
|
|
3
|
-
export function addAnimations(): Rule {
|
|
4
|
-
//this dependency should be provided at application level instead of lib level. ref: provideDesignAngularKit
|
|
5
|
-
//provideAnimationsAsync(),
|
|
6
|
-
return (host: Tree, context: SchematicContext) => callRule(noop(), host, context);
|
|
7
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { JsonArray, JsonObject, workspaces } from '@angular-devkit/core';
|
|
2
|
-
import { Rule, Tree } from '@angular-devkit/schematics';
|
|
3
|
-
import { readWorkspace, writeWorkspace } from '@schematics/angular/utility';
|
|
4
|
-
|
|
5
|
-
import { Schema } from '../../schema';
|
|
6
|
-
import { getProjectTargetOptions } from './angular-json-helper';
|
|
7
|
-
import { NoProjectException } from './exceptions';
|
|
8
|
-
|
|
9
|
-
const ASSETS_CONFIG = {
|
|
10
|
-
glob: '**/*',
|
|
11
|
-
input: './node_modules/bootstrap-italia/',
|
|
12
|
-
output: '/bootstrap-italia/',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function addAssets(options: Schema): Rule {
|
|
16
|
-
return async (host: Tree) => {
|
|
17
|
-
const workspace = await readWorkspace(host);
|
|
18
|
-
|
|
19
|
-
const projectName = options.project || workspace.extensions.defaultProject!.toString();
|
|
20
|
-
const project = workspace.projects.get(projectName);
|
|
21
|
-
if (!project) {
|
|
22
|
-
throw new NoProjectException(projectName);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
addAssetsToAngularJson(project);
|
|
26
|
-
await writeWorkspace(host, workspace);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function addAssetsToAngularJson(project: workspaces.ProjectDefinition) {
|
|
31
|
-
const targetOptions = getProjectTargetOptions(project, 'build');
|
|
32
|
-
const assets = targetOptions.assets as JsonArray | undefined;
|
|
33
|
-
if (!assets) {
|
|
34
|
-
targetOptions.assets = [ASSETS_CONFIG];
|
|
35
|
-
} else {
|
|
36
|
-
const existingAssets = assets.map(s => (typeof s === 'string' ? s : (s as JsonObject)!['input'])) as Array<string>;
|
|
37
|
-
|
|
38
|
-
for (const [, input] of existingAssets.entries()) {
|
|
39
|
-
if (input === ASSETS_CONFIG.input) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
assets.push(ASSETS_CONFIG);
|
|
44
|
-
}
|
|
45
|
-
}
|