design-angular-kit 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +31 -0
- package/karma.conf.js +38 -0
- package/ng-package.json +9 -0
- package/ng-package.prod.json +8 -0
- package/package.json +9 -14
- package/schematics/ng-add/index.spec.ts +45 -0
- package/schematics/ng-add/index.ts +36 -0
- package/schematics/ng-add/rules/setup-project/add-animations.ts +7 -0
- package/schematics/ng-add/rules/setup-project/add-assets.ts +45 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.ts +40 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.ts +7 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.ts +120 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.ts +45 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.ts +11 -0
- package/schematics/ng-add/rules/setup-project/exceptions.ts +13 -0
- package/schematics/ng-add/{schema.d.ts → schema.ts} +1 -1
- package/schematics/ng-add/setup-project.spec.ts +166 -0
- package/schematics/ng-add/setup-project.ts +31 -0
- package/schematics/ng-add/utils.ts +71 -0
- package/schematics/ng-add/versions-helper.ts +41 -0
- package/src/lib/abstracts/abstract-form.component.ts +200 -0
- package/src/lib/abstracts/abstract.component.ts +63 -0
- package/src/lib/components/core/accordion/accordion.component.html +27 -0
- package/src/lib/components/core/accordion/accordion.component.spec.ts +21 -0
- package/src/lib/components/core/accordion/accordion.component.ts +40 -0
- package/src/lib/components/core/alert/alert.component.html +19 -0
- package/src/lib/components/core/alert/alert.component.scss +3 -0
- package/src/lib/components/core/alert/alert.component.spec.ts +62 -0
- package/src/lib/components/core/alert/alert.component.ts +75 -0
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.html +23 -0
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.scss +17 -0
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.spec.ts +21 -0
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.ts +50 -0
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.html +7 -0
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.spec.ts +38 -0
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.ts +25 -0
- package/src/lib/components/core/avatar/avatar.directive.ts +73 -0
- package/src/lib/components/core/avatar/avatar.module.ts +18 -0
- package/src/lib/components/core/badge/badge.directive.spec.ts +59 -0
- package/src/lib/components/core/badge/badge.directive.ts +39 -0
- package/src/lib/components/core/button/button.directive.spec.ts +96 -0
- package/src/lib/components/core/button/button.directive.ts +89 -0
- package/src/lib/components/core/callout/callout.component.html +25 -0
- package/src/lib/components/core/callout/callout.component.spec.ts +138 -0
- package/src/lib/components/core/callout/callout.component.ts +92 -0
- package/src/lib/components/core/card/card.component.html +35 -0
- package/src/lib/components/core/card/card.component.scss +30 -0
- package/src/lib/components/core/card/card.component.spec.ts +21 -0
- package/src/lib/components/core/card/card.component.ts +78 -0
- package/src/lib/components/core/carousel/carousel/carousel.component.html +29 -0
- package/src/lib/components/core/carousel/carousel/carousel.component.scss +1 -0
- package/src/lib/components/core/carousel/carousel/carousel.component.spec.ts +21 -0
- package/src/lib/components/core/carousel/carousel/carousel.component.ts +119 -0
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.html +3 -0
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.spec.ts +22 -0
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.ts +20 -0
- package/src/lib/components/core/carousel/carousel.module.ts +11 -0
- package/src/lib/components/core/chip/chip.component.html +26 -0
- package/src/lib/components/core/chip/chip.component.spec.ts +87 -0
- package/src/lib/components/core/chip/chip.component.ts +154 -0
- package/src/lib/components/core/collapse/collapse.component.html +3 -0
- package/src/lib/components/core/collapse/collapse.component.spec.ts +21 -0
- package/src/lib/components/core/collapse/collapse.component.ts +124 -0
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.html +3 -0
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.spec.ts +35 -0
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.ts +23 -0
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.html +3 -0
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.spec.ts +22 -0
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.ts +10 -0
- package/src/lib/components/core/dimmer/dimmer.component.html +7 -0
- package/src/lib/components/core/dimmer/dimmer.component.spec.ts +49 -0
- package/src/lib/components/core/dimmer/dimmer.component.ts +50 -0
- package/src/lib/components/core/dimmer/dimmer.module.ts +12 -0
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.html +45 -0
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.scss +3 -0
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.spec.ts +21 -0
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.ts +186 -0
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.html +18 -0
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.scss +4 -0
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.spec.ts +21 -0
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.ts +82 -0
- package/src/lib/components/core/dropdown/dropdown.module.ts +11 -0
- package/src/lib/components/core/forward/forward.directive.spec.ts +60 -0
- package/src/lib/components/core/forward/forward.directive.ts +43 -0
- package/src/lib/components/core/link/link.component.html +13 -0
- package/src/lib/components/core/link/link.component.spec.ts +21 -0
- package/src/lib/components/core/link/link.component.ts +54 -0
- package/src/lib/components/core/list/list/list.component.html +13 -0
- package/src/lib/components/core/list/list/list.component.spec.ts +21 -0
- package/src/lib/components/core/list/list/list.component.ts +30 -0
- package/src/lib/components/core/list/list-item/list-item.component.html +42 -0
- package/src/lib/components/core/list/list-item/list-item.component.scss +16 -0
- package/src/lib/components/core/list/list-item/list-item.component.spec.ts +21 -0
- package/src/lib/components/core/list/list-item/list-item.component.ts +75 -0
- package/src/lib/components/core/list/list.module.ts +11 -0
- package/src/lib/components/core/modal/modal.component.html +36 -0
- package/src/lib/components/core/modal/modal.component.scss +3 -0
- package/src/lib/components/core/modal/modal.component.spec.ts +21 -0
- package/src/lib/components/core/modal/modal.component.ts +218 -0
- package/src/lib/components/core/notifications/notifications.component.html +25 -0
- package/src/lib/components/core/notifications/notifications.component.scss +3 -0
- package/src/lib/components/core/notifications/notifications.component.spec.ts +21 -0
- package/src/lib/components/core/notifications/notifications.component.ts +123 -0
- package/src/lib/components/core/pagination/pagination.component.html +107 -0
- package/src/lib/components/core/pagination/pagination.component.spec.ts +21 -0
- package/src/lib/components/core/pagination/pagination.component.ts +157 -0
- package/src/lib/components/core/popover/popover.directive.spec.ts +21 -0
- package/src/lib/components/core/popover/popover.directive.ts +171 -0
- package/src/lib/components/core/progress-bar/progress-bar.component.html +20 -0
- package/src/lib/components/core/progress-bar/progress-bar.component.spec.ts +21 -0
- package/src/lib/components/core/progress-bar/progress-bar.component.ts +46 -0
- package/src/lib/components/core/progress-button/progress-button.component.html +5 -0
- package/src/lib/components/core/progress-button/progress-button.component.spec.ts +21 -0
- package/src/lib/components/core/progress-button/progress-button.component.ts +39 -0
- package/src/lib/components/core/spinner/spinner.component.html +7 -0
- package/src/lib/components/core/spinner/spinner.component.spec.ts +80 -0
- package/src/lib/components/core/spinner/spinner.component.ts +31 -0
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.html +126 -0
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.spec.ts +21 -0
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.ts +185 -0
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.html +3 -0
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.spec.ts +22 -0
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.ts +33 -0
- package/src/lib/components/core/steppers/steppers.module.ts +11 -0
- package/src/lib/components/core/tab/tab-container/tab-container.component.html +78 -0
- package/src/lib/components/core/tab/tab-container/tab-container.component.spec.ts +21 -0
- package/src/lib/components/core/tab/tab-container/tab-container.component.ts +137 -0
- package/src/lib/components/core/tab/tab-item/tab-item.component.html +3 -0
- package/src/lib/components/core/tab/tab-item/tab-item.component.spec.ts +22 -0
- package/src/lib/components/core/tab/tab-item/tab-item.component.ts +50 -0
- package/src/lib/components/core/tab/tab.module.ts +11 -0
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.html +27 -0
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.scss +65 -0
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.spec.ts +25 -0
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.ts +164 -0
- package/src/lib/components/core/table/sort/sort.directive.spec.ts +73 -0
- package/src/lib/components/core/table/sort/sort.directive.ts +142 -0
- package/src/lib/components/core/table/table.component.html +23 -0
- package/src/lib/components/core/table/table.component.scss +7 -0
- package/src/lib/components/core/table/table.component.spec.ts +21 -0
- package/src/lib/components/core/table/table.component.ts +70 -0
- package/src/lib/components/core/table/table.module.ts +12 -0
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.html +47 -0
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.spec.ts +24 -0
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.ts +102 -0
- package/src/lib/components/core/timeline/timeline.component.html +21 -0
- package/src/lib/components/core/timeline/timeline.component.spec.ts +21 -0
- package/src/lib/components/core/timeline/timeline.component.ts +31 -0
- package/src/lib/components/core/timeline/timeline.module.ts +11 -0
- package/src/lib/components/core/tooltip/tooltip.directive.spec.ts +20 -0
- package/src/lib/components/core/tooltip/tooltip.directive.ts +141 -0
- package/src/lib/components/form/autocomplete/autocomplete.component.html +58 -0
- package/src/lib/components/form/autocomplete/autocomplete.component.spec.ts +21 -0
- package/src/lib/components/form/autocomplete/autocomplete.component.ts +130 -0
- package/src/lib/components/form/checkbox/checkbox.component.html +67 -0
- package/src/lib/components/form/checkbox/checkbox.component.spec.ts +21 -0
- package/src/lib/components/form/checkbox/checkbox.component.ts +65 -0
- package/src/lib/components/form/form.module.ts +34 -0
- package/src/lib/components/form/input/input.component.html +92 -0
- package/src/lib/components/form/input/input.component.scss +29 -0
- package/src/lib/components/form/input/input.component.spec.ts +21 -0
- package/src/lib/components/form/input/input.component.ts +234 -0
- package/src/lib/components/form/password-input/password-input.component.html +65 -0
- package/src/lib/components/form/password-input/password-input.component.scss +9 -0
- package/src/lib/components/form/password-input/password-input.component.spec.ts +21 -0
- package/src/lib/components/form/password-input/password-input.component.ts +171 -0
- package/src/lib/components/form/radio-button/radio-button.component.html +50 -0
- package/src/lib/components/form/radio-button/radio-button.component.scss +14 -0
- package/src/lib/components/form/radio-button/radio-button.component.spec.ts +21 -0
- package/src/lib/components/form/radio-button/radio-button.component.ts +82 -0
- package/src/lib/components/form/range/range.component.html +17 -0
- package/src/lib/components/form/range/range.component.scss +17 -0
- package/src/lib/components/form/range/range.component.spec.ts +21 -0
- package/src/lib/components/form/range/range.component.ts +100 -0
- package/src/lib/components/form/rating/rating.component.html +24 -0
- package/src/lib/components/form/rating/rating.component.spec.ts +21 -0
- package/src/lib/components/form/rating/rating.component.ts +52 -0
- package/src/lib/components/form/select/select.component.html +54 -0
- package/src/lib/components/form/select/select.component.scss +3 -0
- package/src/lib/components/form/select/select.component.spec.ts +22 -0
- package/src/lib/components/form/select/select.component.ts +91 -0
- package/src/lib/components/form/textarea/textarea.component.html +28 -0
- package/src/lib/components/form/textarea/textarea.component.scss +12 -0
- package/src/lib/components/form/textarea/textarea.component.spec.ts +21 -0
- package/src/lib/components/form/textarea/textarea.component.ts +61 -0
- package/src/lib/components/form/transfer/store/transfer.reducers.ts +242 -0
- package/src/lib/components/form/transfer/store/transfer.state.ts +20 -0
- package/src/lib/components/form/transfer/store/transfer.store.ts +88 -0
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.html +42 -0
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.spec.ts +33 -0
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.ts +93 -0
- package/src/lib/components/form/transfer/transfer.component.html +52 -0
- package/src/lib/components/form/transfer/transfer.component.spec.ts +27 -0
- package/src/lib/components/form/transfer/transfer.component.ts +159 -0
- package/{lib/components/form/transfer/transfer.model.d.ts → src/lib/components/form/transfer/transfer.model.ts} +9 -2
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.html +36 -0
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.spec.ts +21 -0
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.ts +170 -0
- package/src/lib/components/form/upload-file-list/upload-file-list.component.html +46 -0
- package/src/lib/components/form/upload-file-list/upload-file-list.component.spec.ts +22 -0
- package/src/lib/components/form/upload-file-list/upload-file-list.component.ts +120 -0
- package/src/lib/components/navigation/back-button/back-button.component.html +25 -0
- package/src/lib/components/navigation/back-button/back-button.component.spec.ts +91 -0
- package/src/lib/components/navigation/back-button/back-button.component.ts +67 -0
- package/src/lib/components/navigation/back-to-top/back-to-top.component.html +11 -0
- package/src/lib/components/navigation/back-to-top/back-to-top.component.spec.ts +21 -0
- package/src/lib/components/navigation/back-to-top/back-to-top.component.ts +80 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.html +23 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.spec.ts +21 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.ts +68 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.html +3 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.spec.ts +22 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.ts +29 -0
- package/src/lib/components/navigation/breadcrumbs/breadcrumbs.module.ts +11 -0
- package/src/lib/components/navigation/header/header.component.html +102 -0
- package/src/lib/components/navigation/header/header.component.scss +3 -0
- package/src/lib/components/navigation/header/header.component.spec.ts +21 -0
- package/src/lib/components/navigation/header/header.component.ts +107 -0
- package/src/lib/components/navigation/megamenu/megamenu.component.html +34 -0
- package/src/lib/components/navigation/megamenu/megamenu.component.scss +5 -0
- package/src/lib/components/navigation/megamenu/megamenu.component.ts +30 -0
- package/src/lib/components/navigation/navbar/navbar/navbar.component.html +28 -0
- package/src/lib/components/navigation/navbar/navbar/navbar.component.ts +45 -0
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.html +3 -0
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.ts +10 -0
- package/src/lib/components/navigation/navbar/navbar.module.ts +11 -0
- package/src/lib/components/navigation/navscroll/navscroll-list-item.component.ts +95 -0
- package/src/lib/components/navigation/navscroll/navscroll-list-items.component.ts +27 -0
- package/src/lib/components/navigation/navscroll/navscroll.component.html +101 -0
- package/src/lib/components/navigation/navscroll/navscroll.component.scss +9 -0
- package/src/lib/components/navigation/navscroll/navscroll.component.ts +143 -0
- package/{lib/components/navigation/navscroll/navscroll.model.d.ts → src/lib/components/navigation/navscroll/navscroll.model.ts} +7 -5
- package/src/lib/components/navigation/navscroll/navscroll.store.ts +96 -0
- package/src/lib/components/navigation/navscroll/navscroll.utils.ts +28 -0
- package/src/lib/components/navigation/sidebar/sidebar.component.html +11 -0
- package/src/lib/components/navigation/sidebar/sidebar.component.spec.ts +21 -0
- package/src/lib/components/navigation/sidebar/sidebar.component.ts +39 -0
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.html +15 -0
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.ts +27 -0
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.html +15 -0
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.ts +38 -0
- package/src/lib/components/navigation/skiplink/skiplink.module.ts +11 -0
- package/src/lib/components/utils/error-page/error-page.component.html +33 -0
- package/src/lib/components/utils/error-page/error-page.component.spec.ts +21 -0
- package/src/lib/components/utils/error-page/error-page.component.ts +79 -0
- package/src/lib/components/utils/icon/icon.component.html +6 -0
- package/src/lib/components/utils/icon/icon.component.spec.ts +21 -0
- package/src/lib/components/utils/icon/icon.component.ts +95 -0
- package/src/lib/components/utils/language-switcher/language-switcher.component.html +21 -0
- package/src/lib/components/utils/language-switcher/language-switcher.component.spec.ts +21 -0
- package/src/lib/components/utils/language-switcher/language-switcher.component.ts +56 -0
- package/src/lib/design-angular-kit.module.ts +131 -0
- package/src/lib/enums/colors.enums.ts +10 -0
- package/src/lib/enums/sizes.enum.ts +7 -0
- package/{lib/interfaces/core.d.ts → src/lib/interfaces/core.ts} +95 -53
- package/src/lib/interfaces/design-angular-kit-config.ts +34 -0
- package/src/lib/interfaces/form.ts +78 -0
- package/src/lib/interfaces/icon.ts +176 -0
- package/src/lib/interfaces/sortable-table.ts +42 -0
- package/src/lib/interfaces/utils.ts +11 -0
- package/src/lib/pipes/date-ago.pipe.ts +57 -0
- package/src/lib/pipes/duration.pipe.ts +112 -0
- package/src/lib/pipes/mark-matching-text.pipe.ts +43 -0
- package/src/lib/provide-design-angular-kit.ts +73 -0
- package/src/lib/services/notification/notification.service.spec.ts +16 -0
- package/src/lib/services/notification/notification.service.ts +119 -0
- package/{lib/utils/coercion.d.ts → src/lib/utils/coercion.ts} +7 -1
- package/src/lib/utils/date-utils.ts +184 -0
- package/src/lib/utils/file-utils.ts +80 -0
- package/src/lib/utils/regex.ts +44 -0
- package/src/lib/validators/it-validators.ts +193 -0
- package/{public_api.d.ts → src/public_api.ts} +43 -0
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +24 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.schematics.json +25 -0
- package/tsconfig.spec.json +9 -0
- package/esm2022/design-angular-kit.mjs +0 -5
- package/esm2022/lib/abstracts/abstract-form.component.mjs +0 -186
- package/esm2022/lib/abstracts/abstract.component.mjs +0 -46
- package/esm2022/lib/components/core/accordion/accordion.component.mjs +0 -39
- package/esm2022/lib/components/core/alert/alert.component.mjs +0 -71
- package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +0 -43
- package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +0 -40
- package/esm2022/lib/components/core/avatar/avatar.directive.mjs +0 -78
- package/esm2022/lib/components/core/avatar/avatar.module.mjs +0 -33
- package/esm2022/lib/components/core/badge/badge.directive.mjs +0 -39
- package/esm2022/lib/components/core/button/button.directive.mjs +0 -80
- package/esm2022/lib/components/core/callout/callout.component.mjs +0 -64
- package/esm2022/lib/components/core/card/card.component.mjs +0 -59
- package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +0 -84
- package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +0 -19
- package/esm2022/lib/components/core/carousel/carousel.module.mjs +0 -18
- package/esm2022/lib/components/core/chip/chip.component.mjs +0 -136
- package/esm2022/lib/components/core/collapse/collapse.component.mjs +0 -116
- package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +0 -27
- package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +0 -11
- package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +0 -55
- package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +0 -19
- package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +0 -144
- package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +0 -61
- package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +0 -18
- package/esm2022/lib/components/core/forward/forward.directive.mjs +0 -57
- package/esm2022/lib/components/core/link/link.component.mjs +0 -42
- package/esm2022/lib/components/core/list/list/list.component.mjs +0 -22
- package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +0 -56
- package/esm2022/lib/components/core/list/list.module.mjs +0 -18
- package/esm2022/lib/components/core/modal/modal.component.mjs +0 -194
- package/esm2022/lib/components/core/notifications/notifications.component.mjs +0 -111
- package/esm2022/lib/components/core/pagination/pagination.component.mjs +0 -130
- package/esm2022/lib/components/core/popover/popover.directive.mjs +0 -176
- package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +0 -34
- package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +0 -25
- package/esm2022/lib/components/core/spinner/spinner.component.mjs +0 -30
- package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +0 -116
- package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +0 -22
- package/esm2022/lib/components/core/steppers/steppers.module.mjs +0 -18
- package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +0 -97
- package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +0 -39
- package/esm2022/lib/components/core/tab/tab.module.mjs +0 -18
- package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +0 -134
- package/esm2022/lib/components/core/table/sort/sort.directive.mjs +0 -123
- package/esm2022/lib/components/core/table/table.component.mjs +0 -45
- package/esm2022/lib/components/core/table/table.module.mjs +0 -19
- package/esm2022/lib/components/core/timeline/timeline-item/timeline-item.component.mjs +0 -90
- package/esm2022/lib/components/core/timeline/timeline.component.mjs +0 -36
- package/esm2022/lib/components/core/timeline/timeline.module.mjs +0 -18
- package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +0 -143
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +0 -112
- package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +0 -48
- package/esm2022/lib/components/form/form.module.mjs +0 -63
- package/esm2022/lib/components/form/input/input.component.mjs +0 -190
- package/esm2022/lib/components/form/password-input/password-input.component.mjs +0 -149
- package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +0 -60
- package/esm2022/lib/components/form/range/range.component.mjs +0 -64
- package/esm2022/lib/components/form/rating/rating.component.mjs +0 -50
- package/esm2022/lib/components/form/select/select.component.mjs +0 -70
- package/esm2022/lib/components/form/textarea/textarea.component.mjs +0 -55
- package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +0 -191
- package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +0 -2
- package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +0 -70
- package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +0 -72
- package/esm2022/lib/components/form/transfer/transfer.component.mjs +0 -149
- package/esm2022/lib/components/form/transfer/transfer.model.mjs +0 -6
- package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +0 -142
- package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +0 -107
- package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +0 -67
- package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +0 -68
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +0 -51
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +0 -21
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +0 -18
- package/esm2022/lib/components/navigation/header/header.component.mjs +0 -97
- package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +0 -27
- package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +0 -40
- package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +0 -11
- package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +0 -18
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +0 -98
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +0 -44
- package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +0 -116
- package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +0 -2
- package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +0 -68
- package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +0 -23
- package/esm2022/lib/components/navigation/sidebar/sidebar.component.mjs +0 -50
- package/esm2022/lib/components/navigation/skiplink/skiplink/skiplink.component.mjs +0 -27
- package/esm2022/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.mjs +0 -26
- package/esm2022/lib/components/navigation/skiplink/skiplink.module.mjs +0 -18
- package/esm2022/lib/components/utils/error-page/error-page.component.mjs +0 -74
- package/esm2022/lib/components/utils/icon/icon.component.mjs +0 -63
- package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +0 -50
- package/esm2022/lib/design-angular-kit.module.mjs +0 -233
- package/esm2022/lib/enums/colors.enums.mjs +0 -12
- package/esm2022/lib/enums/sizes.enum.mjs +0 -9
- package/esm2022/lib/interfaces/core.mjs +0 -16
- package/esm2022/lib/interfaces/design-angular-kit-config.mjs +0 -7
- package/esm2022/lib/interfaces/form.mjs +0 -2
- package/esm2022/lib/interfaces/icon.mjs +0 -168
- package/esm2022/lib/interfaces/sortable-table.mjs +0 -6
- package/esm2022/lib/interfaces/utils.mjs +0 -2
- package/esm2022/lib/pipes/date-ago.pipe.mjs +0 -56
- package/esm2022/lib/pipes/duration.pipe.mjs +0 -115
- package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +0 -48
- package/esm2022/lib/provide-design-angular-kit.mjs +0 -64
- package/esm2022/lib/services/notification/notification.service.mjs +0 -120
- package/esm2022/lib/utils/coercion.mjs +0 -18
- package/esm2022/lib/utils/date-utils.mjs +0 -162
- package/esm2022/lib/utils/file-utils.mjs +0 -73
- package/esm2022/lib/utils/regex.mjs +0 -35
- package/esm2022/lib/validators/it-validators.mjs +0 -156
- package/esm2022/public_api.mjs +0 -110
- package/fesm2022/design-angular-kit.mjs +0 -6704
- package/fesm2022/design-angular-kit.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/abstracts/abstract-form.component.d.ts +0 -87
- package/lib/abstracts/abstract.component.d.ts +0 -30
- package/lib/components/core/accordion/accordion.component.d.ts +0 -18
- package/lib/components/core/alert/alert.component.d.ts +0 -44
- package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +0 -29
- package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +0 -15
- package/lib/components/core/avatar/avatar.directive.d.ts +0 -33
- package/lib/components/core/avatar/avatar.module.d.ts +0 -9
- package/lib/components/core/badge/badge.directive.d.ts +0 -23
- package/lib/components/core/button/button.directive.d.ts +0 -48
- package/lib/components/core/callout/callout.component.d.ts +0 -50
- package/lib/components/core/card/card.component.d.ts +0 -69
- package/lib/components/core/carousel/carousel/carousel.component.d.ts +0 -65
- package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +0 -15
- package/lib/components/core/carousel/carousel.module.d.ts +0 -8
- package/lib/components/core/chip/chip.component.d.ts +0 -76
- package/lib/components/core/collapse/collapse.component.d.ts +0 -67
- package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +0 -12
- package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +0 -5
- package/lib/components/core/dimmer/dimmer.component.d.ts +0 -24
- package/lib/components/core/dimmer/dimmer.module.d.ts +0 -9
- package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +0 -94
- package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +0 -42
- package/lib/components/core/dropdown/dropdown.module.d.ts +0 -8
- package/lib/components/core/forward/forward.directive.d.ts +0 -14
- package/lib/components/core/link/link.component.d.ts +0 -35
- package/lib/components/core/list/list/list.component.d.ts +0 -24
- package/lib/components/core/list/list-item/list-item.component.d.ts +0 -41
- package/lib/components/core/list/list.module.d.ts +0 -8
- package/lib/components/core/modal/modal.component.d.ts +0 -135
- package/lib/components/core/notifications/notifications.component.d.ts +0 -45
- package/lib/components/core/pagination/pagination.component.d.ts +0 -92
- package/lib/components/core/popover/popover.directive.d.ts +0 -99
- package/lib/components/core/progress-bar/progress-bar.component.d.ts +0 -31
- package/lib/components/core/progress-button/progress-button.component.d.ts +0 -21
- package/lib/components/core/spinner/spinner.component.d.ts +0 -24
- package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +0 -130
- package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +0 -24
- package/lib/components/core/steppers/steppers.module.d.ts +0 -8
- package/lib/components/core/tab/tab-container/tab-container.component.d.ts +0 -60
- package/lib/components/core/tab/tab-item/tab-item.component.d.ts +0 -38
- package/lib/components/core/tab/tab.module.d.ts +0 -8
- package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +0 -72
- package/lib/components/core/table/sort/sort.directive.d.ts +0 -53
- package/lib/components/core/table/table.component.d.ts +0 -60
- package/lib/components/core/table/table.module.d.ts +0 -9
- package/lib/components/core/timeline/timeline-item/timeline-item.component.d.ts +0 -79
- package/lib/components/core/timeline/timeline.component.d.ts +0 -21
- package/lib/components/core/timeline/timeline.module.d.ts +0 -8
- package/lib/components/core/tooltip/tooltip.directive.d.ts +0 -82
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -59
- package/lib/components/form/checkbox/checkbox.component.d.ts +0 -41
- package/lib/components/form/form.module.d.ts +0 -18
- package/lib/components/form/input/input.component.d.ts +0 -95
- package/lib/components/form/password-input/password-input.component.d.ts +0 -80
- package/lib/components/form/radio-button/radio-button.component.d.ts +0 -38
- package/lib/components/form/range/range.component.d.ts +0 -42
- package/lib/components/form/rating/rating.component.d.ts +0 -24
- package/lib/components/form/select/select.component.d.ts +0 -36
- package/lib/components/form/textarea/textarea.component.d.ts +0 -34
- package/lib/components/form/transfer/store/transfer.reducers.d.ts +0 -103
- package/lib/components/form/transfer/store/transfer.state.d.ts +0 -18
- package/lib/components/form/transfer/store/transfer.store.d.ts +0 -23
- package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +0 -48
- package/lib/components/form/transfer/transfer.component.d.ts +0 -75
- package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +0 -60
- package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +0 -62
- package/lib/components/navigation/back-button/back-button.component.d.ts +0 -47
- package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +0 -50
- package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +0 -28
- package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +0 -23
- package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +0 -8
- package/lib/components/navigation/header/header.component.d.ts +0 -36
- package/lib/components/navigation/megamenu/megamenu.component.d.ts +0 -22
- package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +0 -16
- package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +0 -5
- package/lib/components/navigation/navbar/navbar.module.d.ts +0 -8
- package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +0 -16
- package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +0 -7
- package/lib/components/navigation/navscroll/navscroll.component.d.ts +0 -47
- package/lib/components/navigation/navscroll/navscroll.store.d.ts +0 -16
- package/lib/components/navigation/navscroll/navscroll.utils.d.ts +0 -6
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +0 -26
- package/lib/components/navigation/skiplink/skiplink/skiplink.component.d.ts +0 -17
- package/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.d.ts +0 -24
- package/lib/components/navigation/skiplink/skiplink.module.d.ts +0 -8
- package/lib/components/utils/error-page/error-page.component.d.ts +0 -44
- package/lib/components/utils/icon/icon.component.d.ts +0 -53
- package/lib/components/utils/language-switcher/language-switcher.component.d.ts +0 -27
- package/lib/design-angular-kit.module.d.ts +0 -53
- package/lib/enums/colors.enums.d.ts +0 -10
- package/lib/enums/sizes.enum.d.ts +0 -7
- package/lib/interfaces/design-angular-kit-config.d.ts +0 -30
- package/lib/interfaces/form.d.ts +0 -67
- package/lib/interfaces/icon.d.ts +0 -4
- package/lib/interfaces/sortable-table.d.ts +0 -33
- package/lib/interfaces/utils.d.ts +0 -10
- package/lib/pipes/date-ago.pipe.d.ts +0 -17
- package/lib/pipes/duration.pipe.d.ts +0 -35
- package/lib/pipes/mark-matching-text.pipe.d.ts +0 -18
- package/lib/provide-design-angular-kit.d.ts +0 -7
- package/lib/services/notification/notification.service.d.ts +0 -63
- package/lib/utils/date-utils.d.ts +0 -79
- package/lib/utils/file-utils.d.ts +0 -32
- package/lib/utils/regex.d.ts +0 -34
- package/lib/validators/it-validators.d.ts +0 -69
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -29
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/index.spec.d.ts +0 -1
- package/schematics/ng-add/index.spec.js +0 -43
- package/schematics/ng-add/index.spec.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-animations.d.ts +0 -2
- package/schematics/ng-add/rules/setup-project/add-animations.js +0 -11
- package/schematics/ng-add/rules/setup-project/add-animations.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-assets.d.ts +0 -3
- package/schematics/ng-add/rules/setup-project/add-assets.js +0 -50
- package/schematics/ng-add/rules/setup-project/add-assets.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +0 -3
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +0 -43
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +0 -2
- package/schematics/ng-add/rules/setup-project/add-http-client.js +0 -11
- package/schematics/ng-add/rules/setup-project/add-http-client.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +0 -11
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +0 -112
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +0 -3
- package/schematics/ng-add/rules/setup-project/add-localisation.js +0 -50
- package/schematics/ng-add/rules/setup-project/add-localisation.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +0 -2
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js +0 -13
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/exceptions.d.ts +0 -7
- package/schematics/ng-add/rules/setup-project/exceptions.js +0 -17
- package/schematics/ng-add/rules/setup-project/exceptions.js.map +0 -1
- package/schematics/ng-add/rules/setup-project/index.js +0 -23
- package/schematics/ng-add/rules/setup-project/index.js.map +0 -1
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/setup-project.d.ts +0 -3
- package/schematics/ng-add/setup-project.js +0 -37
- package/schematics/ng-add/setup-project.js.map +0 -1
- package/schematics/ng-add/setup-project.spec.d.ts +0 -1
- package/schematics/ng-add/setup-project.spec.js +0 -139
- package/schematics/ng-add/setup-project.spec.js.map +0 -1
- package/schematics/ng-add/utils.d.ts +0 -14
- package/schematics/ng-add/utils.js +0 -49
- package/schematics/ng-add/utils.js.map +0 -1
- package/schematics/ng-add/versions-helper.d.ts +0 -3
- package/schematics/ng-add/versions-helper.js +0 -40
- package/schematics/ng-add/versions-helper.js.map +0 -1
- /package/schematics/ng-add/rules/setup-project/{index.d.ts → index.ts} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ItDimmerComponent } from './dimmer.component';
|
|
3
|
+
import { ItDimmerIconComponent } from './dimmer-icon/dimmer-icon.component';
|
|
4
|
+
import { ItDimmerButtonsComponent } from './dimmer-buttons/dimmer-buttons.component';
|
|
5
|
+
|
|
6
|
+
const dimmerComponents = [ItDimmerComponent, ItDimmerIconComponent, ItDimmerButtonsComponent];
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
imports: dimmerComponents,
|
|
10
|
+
exports: dimmerComponents,
|
|
11
|
+
})
|
|
12
|
+
export class ItDimmerModule {}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<div class="dropdown {{ direction }}" [class.nav-item]="mode === 'nav'" [class.megamenu]="megamenu">
|
|
2
|
+
@if (mode === 'button') {
|
|
3
|
+
<button
|
|
4
|
+
#dropdownButton
|
|
5
|
+
[id]="id"
|
|
6
|
+
[class]="buttonClass"
|
|
7
|
+
type="button"
|
|
8
|
+
data-bs-toggle="dropdown"
|
|
9
|
+
aria-haspopup="true"
|
|
10
|
+
aria-expanded="false">
|
|
11
|
+
<ng-container *ngTemplateOutlet="buttonContent"></ng-container>
|
|
12
|
+
<it-icon svgClass="icon-expand" name="expand" size="sm" [color]="this.color ? 'light' : 'primary'"></it-icon>
|
|
13
|
+
</button>
|
|
14
|
+
} @else {
|
|
15
|
+
<a
|
|
16
|
+
#dropdownButton
|
|
17
|
+
[id]="id"
|
|
18
|
+
[class.btn]="mode === 'link'"
|
|
19
|
+
[class.btn-dropdown]="mode === 'link'"
|
|
20
|
+
[class.nav-link]="mode === 'nav'"
|
|
21
|
+
class="dropdown-toggle"
|
|
22
|
+
role="button"
|
|
23
|
+
data-bs-toggle="dropdown"
|
|
24
|
+
aria-haspopup="true"
|
|
25
|
+
aria-expanded="false">
|
|
26
|
+
<ng-container *ngTemplateOutlet="buttonContent"></ng-container>
|
|
27
|
+
<it-icon svgClass="icon-expand" name="expand" size="sm"></it-icon>
|
|
28
|
+
</a>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<div class="dropdown-menu" [class.full-width]="fullWidth" [class.dark]="dark" [attr.aria-labelledby]="id">
|
|
32
|
+
<div class="link-list-wrapper">
|
|
33
|
+
<div class="link-list-heading">
|
|
34
|
+
<ng-content select="[listHeading]"></ng-content>
|
|
35
|
+
</div>
|
|
36
|
+
<ul class="link-list">
|
|
37
|
+
<ng-content select="[list]"></ng-content>
|
|
38
|
+
</ul>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<ng-template #buttonContent>
|
|
44
|
+
<ng-content select="[button]"></ng-content>
|
|
45
|
+
</ng-template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItDropdownComponent } from './dropdown.component';
|
|
4
|
+
import { tb_base } from '../../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItDropdownComponent', () => {
|
|
7
|
+
let component: ItDropdownComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItDropdownComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItDropdownComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterViewInit,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
ContentChildren,
|
|
6
|
+
ElementRef,
|
|
7
|
+
EventEmitter,
|
|
8
|
+
Input,
|
|
9
|
+
OnChanges,
|
|
10
|
+
Output,
|
|
11
|
+
QueryList,
|
|
12
|
+
SimpleChanges,
|
|
13
|
+
ViewChild,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import { ItAbstractComponent } from '../../../../abstracts/abstract.component';
|
|
16
|
+
import { ButtonColor, DropdownDirection } from '../../../../interfaces/core';
|
|
17
|
+
import { ItDropdownItemComponent } from '../dropdown-item/dropdown-item.component';
|
|
18
|
+
import { Dropdown } from 'bootstrap-italia';
|
|
19
|
+
import { ItIconComponent } from '../../../utils/icon/icon.component';
|
|
20
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
21
|
+
import { inputToBoolean } from '../../../../utils/coercion';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
standalone: true,
|
|
25
|
+
selector: 'it-dropdown',
|
|
26
|
+
templateUrl: './dropdown.component.html',
|
|
27
|
+
styleUrls: ['./dropdown.component.scss'],
|
|
28
|
+
exportAs: 'itDropdown',
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
+
imports: [ItIconComponent, NgTemplateOutlet],
|
|
31
|
+
})
|
|
32
|
+
export class ItDropdownComponent extends ItAbstractComponent implements AfterViewInit, OnChanges {
|
|
33
|
+
/**
|
|
34
|
+
* Dropdown mode
|
|
35
|
+
*/
|
|
36
|
+
@Input() mode: 'button' | 'link' | 'nav' = 'button';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Button color
|
|
40
|
+
*/
|
|
41
|
+
@Input() color?: ButtonColor;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* To open menu items to:
|
|
45
|
+
* - <strong>dropup</strong>: up
|
|
46
|
+
* - <strong>dropend</strong>: right
|
|
47
|
+
* - <strong>dropstart</strong>: left
|
|
48
|
+
*/
|
|
49
|
+
@Input() direction: DropdownDirection | undefined;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* To get a dropdown menu as wide as the element containing the dropdown button
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
@Input({ transform: inputToBoolean }) fullWidth?: boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Contains a Megamenu element
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
@Input({ transform: inputToBoolean }) megamenu?: boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Dark menu style
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
@Input({ transform: inputToBoolean }) dark?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The dropdown items
|
|
71
|
+
*/
|
|
72
|
+
@ContentChildren(ItDropdownItemComponent) items?: QueryList<ItDropdownItemComponent>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Fires immediately when the show instance method is called.
|
|
76
|
+
*/
|
|
77
|
+
@Output() showEvent: EventEmitter<Event> = new EventEmitter();
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Fired when the dropdown has been made visible to the user and CSS transitions have completed.
|
|
81
|
+
*/
|
|
82
|
+
@Output() shownEvent: EventEmitter<Event> = new EventEmitter();
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Fires immediately when the hide instance method has been called.
|
|
86
|
+
*/
|
|
87
|
+
@Output() hideEvent: EventEmitter<Event> = new EventEmitter();
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Fired when the dropdown has finished being hidden from the user and CSS transitions have completed.
|
|
91
|
+
*/
|
|
92
|
+
@Output() hiddenEvent: EventEmitter<Event> = new EventEmitter();
|
|
93
|
+
|
|
94
|
+
private dropdown?: Dropdown;
|
|
95
|
+
|
|
96
|
+
@ViewChild('dropdownButton') private dropdownButton?: ElementRef<HTMLButtonElement>;
|
|
97
|
+
|
|
98
|
+
get buttonClass(): string {
|
|
99
|
+
let btnClass = 'btn dropdown-toggle';
|
|
100
|
+
if (this.color) {
|
|
101
|
+
btnClass += ` btn-${this.color}`;
|
|
102
|
+
} else {
|
|
103
|
+
btnClass += ` btn-dropdown`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return btnClass;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
override ngOnChanges(changes: SimpleChanges): void {
|
|
110
|
+
if (changes['dark'] && !changes['dark'].firstChange) {
|
|
111
|
+
this.setDarkItems();
|
|
112
|
+
}
|
|
113
|
+
if (changes['mode'] && !changes['mode'].firstChange) {
|
|
114
|
+
this.updateListeners();
|
|
115
|
+
}
|
|
116
|
+
super.ngOnChanges(changes);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
override ngAfterViewInit() {
|
|
120
|
+
super.ngAfterViewInit();
|
|
121
|
+
this.setDarkItems();
|
|
122
|
+
this.updateListeners();
|
|
123
|
+
this.items?.forEach(item => {
|
|
124
|
+
item.mode = this.mode;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Set child items dark mode
|
|
130
|
+
* @private
|
|
131
|
+
*/
|
|
132
|
+
private setDarkItems(): void {
|
|
133
|
+
if (this.dark !== undefined) {
|
|
134
|
+
this.items?.forEach(item => {
|
|
135
|
+
item.setDark(!!this.dark);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private updateListeners(): void {
|
|
141
|
+
if (this.dropdownButton) {
|
|
142
|
+
const element = this.dropdownButton.nativeElement;
|
|
143
|
+
this.dropdown = Dropdown.getOrCreateInstance(element);
|
|
144
|
+
|
|
145
|
+
element.addEventListener('show.bs.dropdown', event => this.showEvent.emit(event));
|
|
146
|
+
element.addEventListener('shown.bs.dropdown', event => this.shownEvent.emit(event));
|
|
147
|
+
element.addEventListener('hide.bs.dropdown', event => this.hideEvent.emit(event));
|
|
148
|
+
element.addEventListener('hidden.bs.dropdown', event => this.hiddenEvent.emit(event));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Toggles the dropdown menu of a given navbar or tabbed navigation.
|
|
154
|
+
*/
|
|
155
|
+
public toggle(): void {
|
|
156
|
+
this.dropdown?.toggle();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Shows the dropdown menu of a given navbar or tabbed navigation.
|
|
161
|
+
*/
|
|
162
|
+
public show(): void {
|
|
163
|
+
this.dropdown?.show();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Hides the dropdown menu of a given navbar or tabbed navigation.
|
|
168
|
+
*/
|
|
169
|
+
public hide(): void {
|
|
170
|
+
this.dropdown?.hide();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Updates the position of an element's dropdown.
|
|
175
|
+
*/
|
|
176
|
+
public update(): void {
|
|
177
|
+
this.dropdown?.update();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Destroys an element's dropdown. (Removes stored data on the DOM element)
|
|
182
|
+
*/
|
|
183
|
+
public dispose(): void {
|
|
184
|
+
this.dropdown?.dispose();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<li>
|
|
2
|
+
@if (divider) {
|
|
3
|
+
<span class="divider"></span>
|
|
4
|
+
} @else {
|
|
5
|
+
<it-link [class]="linkClass" [id]="id" [href]="href" [externalLink]="externalLink" [disabled]="disabled">
|
|
6
|
+
@if (iconName && iconPosition === 'left') {
|
|
7
|
+
<it-icon size="sm" [name]="iconName" [color]="isDark ? 'light' : 'primary'" [svgClass]="iconPosition"></it-icon>
|
|
8
|
+
}
|
|
9
|
+
<span><ng-content></ng-content></span>
|
|
10
|
+
@if (iconName && iconPosition === 'right') {
|
|
11
|
+
<it-icon size="sm" [name]="iconName" [color]="isDark ? 'light' : 'primary'" [svgClass]="iconPosition"></it-icon>
|
|
12
|
+
}
|
|
13
|
+
@if (active) {
|
|
14
|
+
<span class="visually-hidden">{{ 'it.core.active' | translate }}</span>
|
|
15
|
+
}
|
|
16
|
+
</it-link>
|
|
17
|
+
}
|
|
18
|
+
</li>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItDropdownItemComponent } from './dropdown-item.component';
|
|
4
|
+
import { tb_base } from '../../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItDropdownItemComponent', () => {
|
|
7
|
+
let component: ItDropdownItemComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItDropdownItemComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItDropdownItemComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
+
import { IconName } from '../../../../interfaces/icon';
|
|
3
|
+
import { ItLinkComponent } from '../../link/link.component';
|
|
4
|
+
import { ItIconComponent } from '../../../utils/icon/icon.component';
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
|
+
|
|
7
|
+
import { inputToBoolean } from '../../../../utils/coercion';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
standalone: true,
|
|
11
|
+
selector: 'it-dropdown-item',
|
|
12
|
+
templateUrl: './dropdown-item.component.html',
|
|
13
|
+
styleUrls: ['./dropdown-item.component.scss'],
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
imports: [ItIconComponent, TranslateModule, ItLinkComponent],
|
|
16
|
+
})
|
|
17
|
+
export class ItDropdownItemComponent extends ItLinkComponent {
|
|
18
|
+
/**
|
|
19
|
+
* Show divider
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
@Input({ transform: inputToBoolean }) divider?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Active item
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
@Input({ transform: inputToBoolean }) active?: boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* To increase the size of links
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
@Input({ transform: inputToBoolean }) large?: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The name of icon to show
|
|
38
|
+
*/
|
|
39
|
+
@Input() iconName: IconName | undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The icon position
|
|
43
|
+
* @default right
|
|
44
|
+
*/
|
|
45
|
+
@Input() iconPosition: 'left' | 'right' = 'right';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Dropdown mode
|
|
49
|
+
*/
|
|
50
|
+
@Input() mode?: 'button' | 'link' | 'nav' = 'button';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Change icon color if menu is dark
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
isDark: boolean = false;
|
|
57
|
+
|
|
58
|
+
get linkClass(): string {
|
|
59
|
+
let linkClass = `list-item ${this.active ? 'active' : 'dropdown-item'}`;
|
|
60
|
+
if (this.mode === 'nav') {
|
|
61
|
+
linkClass += ' nav-link';
|
|
62
|
+
}
|
|
63
|
+
if (this.disabled) {
|
|
64
|
+
linkClass += ' disabled';
|
|
65
|
+
}
|
|
66
|
+
if (this.large) {
|
|
67
|
+
linkClass += ' large';
|
|
68
|
+
}
|
|
69
|
+
if (this.iconName) {
|
|
70
|
+
linkClass += ` ${this.iconPosition === 'right' ? 'right-icon' : 'left-icon'}`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return linkClass;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setDark(dark: boolean): void {
|
|
77
|
+
if (this.isDark !== dark) {
|
|
78
|
+
this.isDark = dark;
|
|
79
|
+
this._changeDetectorRef.detectChanges();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ItDropdownComponent } from './dropdown/dropdown.component';
|
|
3
|
+
import { ItDropdownItemComponent } from './dropdown-item/dropdown-item.component';
|
|
4
|
+
|
|
5
|
+
const dropdownComponents = [ItDropdownComponent, ItDropdownItemComponent];
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
imports: dropdownComponents,
|
|
9
|
+
exports: dropdownComponents,
|
|
10
|
+
})
|
|
11
|
+
export class ItDropdownModule {}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ItForwardDirective } from './forward.directive';
|
|
2
|
+
import { Component, QueryList, ViewChildren } from '@angular/core';
|
|
3
|
+
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
|
4
|
+
import { By } from '@angular/platform-browser';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'it-unit-test',
|
|
8
|
+
template: `
|
|
9
|
+
<a href="#" [itForward]="'idH3'">first</a>
|
|
10
|
+
<a href="#" [itForward]="refH3">second</a>
|
|
11
|
+
<h3>Text H3</h3>
|
|
12
|
+
`,
|
|
13
|
+
})
|
|
14
|
+
class UnitTestComponent {
|
|
15
|
+
@ViewChildren(ItForwardDirective) directives: QueryList<ItForwardDirective>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('ItForwardDirective', () => {
|
|
19
|
+
let component: UnitTestComponent;
|
|
20
|
+
let fixture: ComponentFixture<UnitTestComponent>;
|
|
21
|
+
beforeEach(fakeAsync(() => {
|
|
22
|
+
TestBed.configureTestingModule({
|
|
23
|
+
declarations: [UnitTestComponent],
|
|
24
|
+
imports: [ItForwardDirective],
|
|
25
|
+
}).compileComponents();
|
|
26
|
+
|
|
27
|
+
fixture = TestBed.createComponent(UnitTestComponent);
|
|
28
|
+
component = fixture.componentInstance;
|
|
29
|
+
fixture.detectChanges();
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
it('should create an instance', () => {
|
|
33
|
+
const directive = new ItForwardDirective();
|
|
34
|
+
expect(directive).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should trigger this.document.querySelector(...)?.scrollIntoView() if i pass a string', () => {
|
|
38
|
+
component.directives.changes.subscribe(() => {
|
|
39
|
+
spyOn(
|
|
40
|
+
component.directives.first['document'].querySelector(<string>component.directives.first.itForward),
|
|
41
|
+
'scrollIntoView'
|
|
42
|
+
).and.returnValue();
|
|
43
|
+
const aElement = fixture.debugElement.query(By.css('#firstA'));
|
|
44
|
+
aElement.nativeElement.click();
|
|
45
|
+
expect(
|
|
46
|
+
component.directives.first['document'].querySelector(<string>component.directives.first.itForward).scrollIntoView
|
|
47
|
+
).toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should trigger this.itForward.scrollIntoView() if i pass an HTMLElement', async () => {
|
|
52
|
+
component.directives.changes.subscribe(() => {
|
|
53
|
+
const itForward = <HTMLElement>component.directives.last.itForward;
|
|
54
|
+
spyOn(itForward, 'scrollIntoView').and.returnValue();
|
|
55
|
+
const aElement = fixture.debugElement.query(By.css('#secondA'));
|
|
56
|
+
aElement.nativeElement.click();
|
|
57
|
+
expect(itForward.scrollIntoView).toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { Directive, HostListener, Inject, Input } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
standalone: true,
|
|
6
|
+
selector: '[itForward]',
|
|
7
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
8
|
+
host: { class: 'forward' },
|
|
9
|
+
})
|
|
10
|
+
export class ItForwardDirective {
|
|
11
|
+
/**
|
|
12
|
+
* Indica, se HTMLElement, l'elemento a cui navigare, o se stringa, il selettore che selezionerà l'elemento a cui navigare.
|
|
13
|
+
*/
|
|
14
|
+
@Input() set itForward(value: HTMLElement | string | undefined) {
|
|
15
|
+
this._itForward = value;
|
|
16
|
+
}
|
|
17
|
+
get itForward(): HTMLElement | string | undefined {
|
|
18
|
+
return this._itForward;
|
|
19
|
+
}
|
|
20
|
+
private _itForward: HTMLElement | string | undefined = undefined;
|
|
21
|
+
|
|
22
|
+
constructor(@Inject(DOCUMENT) private document?: Document) {}
|
|
23
|
+
|
|
24
|
+
@HostListener('click', ['$event'])
|
|
25
|
+
onClick(event: any) {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
if (this.itForward) {
|
|
28
|
+
if (typeof this.itForward === 'string') {
|
|
29
|
+
this.document?.querySelector(this.itForward)?.scrollIntoView({
|
|
30
|
+
behavior: 'smooth',
|
|
31
|
+
block: 'start',
|
|
32
|
+
inline: 'nearest',
|
|
33
|
+
});
|
|
34
|
+
} else if (this.itForward instanceof HTMLElement) {
|
|
35
|
+
this.itForward.scrollIntoView({
|
|
36
|
+
behavior: 'smooth',
|
|
37
|
+
block: 'start',
|
|
38
|
+
inline: 'nearest',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@if (!externalLink) {
|
|
2
|
+
<a [id]="id" [class]="class" [routerLinkActive]="'active'" [routerLink]="(disabled ? null : href)!">
|
|
3
|
+
<ng-container *ngTemplateOutlet="linkContent"></ng-container>
|
|
4
|
+
</a>
|
|
5
|
+
} @else {
|
|
6
|
+
<a [id]="id" [class]="class" [attr.href]="disabled ? null : href">
|
|
7
|
+
<ng-container *ngTemplateOutlet="linkContent"></ng-container>
|
|
8
|
+
</a>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
<ng-template #linkContent>
|
|
12
|
+
<ng-content></ng-content>
|
|
13
|
+
</ng-template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItLinkComponent } from './link.component';
|
|
4
|
+
import { tb_base } from '../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItLinkComponent', () => {
|
|
7
|
+
let component: ItLinkComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItLinkComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItLinkComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ItAbstractComponent } from '../../../abstracts/abstract.component';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
5
|
+
import { inputToBoolean } from '../../../utils/coercion';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
standalone: true,
|
|
9
|
+
selector: 'it-link',
|
|
10
|
+
templateUrl: './link.component.html',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
imports: [RouterLink, RouterLinkActive, NgTemplateOutlet],
|
|
13
|
+
})
|
|
14
|
+
export class ItLinkComponent extends ItAbstractComponent implements AfterViewInit, OnChanges {
|
|
15
|
+
/**
|
|
16
|
+
* The router link action
|
|
17
|
+
*
|
|
18
|
+
* Commands to pass to Router#createUrlTree.
|
|
19
|
+
* - array: commands to pass to Router#createUrlTree.
|
|
20
|
+
* - string: shorthand for array of commands with just the string, i.e. ['/route']
|
|
21
|
+
* - null|undefined: Disables the link by removing the href
|
|
22
|
+
*/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
@Input() href: any[] | string | null | undefined;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Is an external link (false to not use Angular router link)
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
@Input({ transform: inputToBoolean }) externalLink?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Is disabled link
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
@Input({ transform: inputToBoolean }) disabled?: boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Custom class
|
|
40
|
+
*/
|
|
41
|
+
@Input() class: string = '';
|
|
42
|
+
|
|
43
|
+
override ngAfterViewInit(): void {
|
|
44
|
+
super.ngAfterViewInit();
|
|
45
|
+
this._renderer.removeAttribute(this._elementRef.nativeElement, 'class');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
override ngOnChanges(changes: SimpleChanges): void {
|
|
49
|
+
super.ngOnChanges(changes);
|
|
50
|
+
if (changes['class']) {
|
|
51
|
+
this._changeDetectorRef.markForCheck();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@if (!linkSubList) {
|
|
2
|
+
<div [class.multiline]="multiline" [class]="linkList ? 'link-list-wrapper' : 'it-list-wrapper'">
|
|
3
|
+
<ul [class]="linkList ? 'link-list' : 'it-list'">
|
|
4
|
+
<ng-container *ngTemplateOutlet="contentTpl"></ng-container>
|
|
5
|
+
</ul>
|
|
6
|
+
</div>
|
|
7
|
+
}
|
|
8
|
+
@if (linkSubList) {
|
|
9
|
+
<ul class="link-sublist">
|
|
10
|
+
<ng-container *ngTemplateOutlet="contentTpl"></ng-container>
|
|
11
|
+
</ul>
|
|
12
|
+
}
|
|
13
|
+
<ng-template #contentTpl><ng-content></ng-content></ng-template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItListComponent } from './list.component';
|
|
4
|
+
import { tb_base } from '../../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItListComponent', () => {
|
|
7
|
+
let component: ItListComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItListComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItListComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import { inputToBoolean } from '../../../../utils/coercion';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
standalone: true,
|
|
7
|
+
selector: 'it-list',
|
|
8
|
+
templateUrl: './list.component.html',
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
imports: [NgTemplateOutlet],
|
|
11
|
+
})
|
|
12
|
+
export class ItListComponent {
|
|
13
|
+
/**
|
|
14
|
+
* Add 'link-list' class for navigation menu
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
@Input({ transform: inputToBoolean }) linkList?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Add 'link-sublist' class for navigation menu
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
@Input({ transform: inputToBoolean }) linkSubList?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Add 'multiline' class for wrapper
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
@Input({ transform: inputToBoolean }) multiline?: boolean;
|
|
30
|
+
}
|