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,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterViewInit,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
OnChanges,
|
|
9
|
+
Output,
|
|
10
|
+
SimpleChanges,
|
|
11
|
+
ViewChild,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
14
|
+
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
15
|
+
import { ItNavBarModule } from '../navbar/navbar.module';
|
|
16
|
+
import { ItNavBarComponent } from '../navbar/navbar/navbar.component';
|
|
17
|
+
|
|
18
|
+
import { ItButtonDirective } from '../../core/button/button.directive';
|
|
19
|
+
import { inputToBoolean } from '../../../utils/coercion';
|
|
20
|
+
import { HeaderSticky } from 'bootstrap-italia';
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
standalone: true,
|
|
24
|
+
selector: 'it-header',
|
|
25
|
+
templateUrl: './header.component.html',
|
|
26
|
+
styleUrls: ['./header.component.scss'],
|
|
27
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
|
+
imports: [TranslateModule, ItIconComponent, ItButtonDirective, ItNavBarModule],
|
|
29
|
+
})
|
|
30
|
+
export class ItHeaderComponent implements AfterViewInit, OnChanges {
|
|
31
|
+
@Input({ transform: inputToBoolean }) light?: boolean;
|
|
32
|
+
|
|
33
|
+
@Input({ transform: inputToBoolean }) sticky?: boolean;
|
|
34
|
+
|
|
35
|
+
@Input({ transform: inputToBoolean }) showSlim?: boolean = true;
|
|
36
|
+
|
|
37
|
+
@Input({ transform: inputToBoolean }) smallHeader?: boolean = true;
|
|
38
|
+
|
|
39
|
+
@Input({ transform: inputToBoolean }) showSearch?: boolean = true;
|
|
40
|
+
|
|
41
|
+
@Input() slimTitle: string | undefined;
|
|
42
|
+
@Input() slimTitleLink: string | undefined = '#';
|
|
43
|
+
|
|
44
|
+
@Input() loginStyle: 'none' | 'default' | 'full' = 'none';
|
|
45
|
+
|
|
46
|
+
@Output() loginClick: EventEmitter<Event>;
|
|
47
|
+
|
|
48
|
+
@Output() searchClick: EventEmitter<Event>;
|
|
49
|
+
|
|
50
|
+
@ViewChild('headerWrapper') private headerWrapper?: ElementRef<HTMLButtonElement>;
|
|
51
|
+
|
|
52
|
+
@ViewChild(ItNavBarComponent) private itNavBarComponent?: ItNavBarComponent;
|
|
53
|
+
|
|
54
|
+
@Input({ transform: inputToBoolean }) megamenu?: boolean;
|
|
55
|
+
@Input({ transform: inputToBoolean }) expand?: boolean = true;
|
|
56
|
+
|
|
57
|
+
private stickyHeader?: HeaderSticky;
|
|
58
|
+
|
|
59
|
+
constructor() {
|
|
60
|
+
this.loginClick = new EventEmitter<Event>();
|
|
61
|
+
this.searchClick = new EventEmitter<Event>();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
ngAfterViewInit() {
|
|
65
|
+
this.updateListeners();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
69
|
+
if (changes['sticky'] && changes['sticky'].currentValue == true && !changes['sticky'].firstChange) {
|
|
70
|
+
this.updateListeners();
|
|
71
|
+
}
|
|
72
|
+
if (changes['sticky'] && changes['sticky'].currentValue == false) {
|
|
73
|
+
this.stickyHeader?._elementObj?._unsetSticky();
|
|
74
|
+
this.stickyHeader?._elementObj?.dispose();
|
|
75
|
+
delete this.stickyHeader;
|
|
76
|
+
this.stickyHeader = undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
updateListeners() {
|
|
81
|
+
if (!this.stickyHeader && this.headerWrapper && this.sticky) {
|
|
82
|
+
this.stickyHeader = new HeaderSticky(this.headerWrapper.nativeElement);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
openNavBar() {
|
|
87
|
+
this.itNavBarComponent?.open();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
closeNavBar() {
|
|
91
|
+
this.itNavBarComponent?.close();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected emitLoginClick(event: Event): void {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
this.loginClick.emit(event);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
protected emitSearchClick(event: Event): void {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
this.searchClick.emit(event);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
toggleCollapse() {
|
|
105
|
+
this.itNavBarComponent?.toggleCollapse();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<div class="megamenu pb-5 pt-3 py-lg-0">
|
|
2
|
+
<div class="row">
|
|
3
|
+
@if (mode === 'left-section') {
|
|
4
|
+
<div class="col-xs-12 col-lg-4 px-0">
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-12 it-vertical it-description pb-lg-3">
|
|
7
|
+
<div class="description-content ps-4 ps-sm-5 ms-3">
|
|
8
|
+
<ng-content select="[megamenuLeftZone]"></ng-content>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
}
|
|
14
|
+
<div class="col-12" [class.col-lg-8]="mode !== 'normal'">
|
|
15
|
+
@if (header) {
|
|
16
|
+
<div class="it-heading-link-wrapper">
|
|
17
|
+
<ng-content select="[megamenuHeadingLink]"></ng-content>
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
20
|
+
<div class="row">
|
|
21
|
+
<ng-content select="[megamenuLinkList]"></ng-content>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
@if (footer || mode === 'right-section') {
|
|
25
|
+
<div [class.col-xs-12]="mode === 'right-section'" [class.col-lg-4]="mode === 'right-section'" [class.px-0]="mode === 'right-section'">
|
|
26
|
+
<div [class.it-footer-link-wrapper]="footer" [class.it-footer-link-wrapper-vertical]="mode === 'right-section'">
|
|
27
|
+
<div class="d-flex flex-column justify-content-around" [class.flex-lg-row]="mode !== 'right-section'">
|
|
28
|
+
<ng-content select="[megamenuFooter]"></ng-content>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
@@ -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-megamenu',
|
|
8
|
+
templateUrl: './megamenu.component.html',
|
|
9
|
+
styleUrls: ['./megamenu.component.scss'],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
imports: [NgTemplateOutlet],
|
|
12
|
+
})
|
|
13
|
+
export class ItMegamenuComponent {
|
|
14
|
+
/**
|
|
15
|
+
* Megamenu mode
|
|
16
|
+
*/
|
|
17
|
+
@Input() mode: 'right-section' | 'left-section' | 'normal' = 'normal';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* To show Megamenu header
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
@Input({ transform: inputToBoolean }) header?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* To show Megamenu footer
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
@Input({ transform: inputToBoolean }) footer?: boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<nav
|
|
2
|
+
class="navbar"
|
|
3
|
+
[class.navbar-expand-lg]="expand"
|
|
4
|
+
[class.has-megamenu]="megamenu"
|
|
5
|
+
[attr.aria-label]="'it.navbar.aria-label-main' | translate">
|
|
6
|
+
<button
|
|
7
|
+
(click)="toggleCollapse()"
|
|
8
|
+
#collapseButton
|
|
9
|
+
class="custom-navbar-toggler"
|
|
10
|
+
type="button"
|
|
11
|
+
[attr.aria-label]="'it.navbar.aria-label-toggle' | translate">
|
|
12
|
+
<it-icon name="burger"></it-icon>
|
|
13
|
+
</button>
|
|
14
|
+
<div #collapseView class="navbar-collapsable" style="display: none">
|
|
15
|
+
<div class="overlay" style="display: none"></div>
|
|
16
|
+
<div class="close-div">
|
|
17
|
+
<button class="btn close-menu" type="button">
|
|
18
|
+
<span class="visually-hidden">{{ 'it.navbar.hide' | translate }}</span>
|
|
19
|
+
<it-icon name="close-big"></it-icon>
|
|
20
|
+
</button>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="menu-wrapper">
|
|
23
|
+
<ul class="navbar-nav">
|
|
24
|
+
<ng-content select="[navItems]"></ng-content>
|
|
25
|
+
</ul>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</nav>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild } from '@angular/core';
|
|
2
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
3
|
+
import { ItIconComponent } from '../../../utils/icon/icon.component';
|
|
4
|
+
import { ItButtonDirective } from '../../../core/button/button.directive';
|
|
5
|
+
import { inputToBoolean } from '../../../../utils/coercion';
|
|
6
|
+
import { NavBarCollapsible } from 'bootstrap-italia';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
standalone: true,
|
|
10
|
+
selector: 'it-navbar',
|
|
11
|
+
templateUrl: './navbar.component.html',
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
imports: [TranslateModule, ItIconComponent, ItButtonDirective],
|
|
14
|
+
})
|
|
15
|
+
export class ItNavBarComponent implements AfterViewInit {
|
|
16
|
+
@Input({ transform: inputToBoolean }) megamenu?: boolean;
|
|
17
|
+
@Input({ transform: inputToBoolean }) expand?: boolean = true;
|
|
18
|
+
|
|
19
|
+
@ViewChild('collapseButton') private collapseButton?: ElementRef<HTMLButtonElement>;
|
|
20
|
+
@ViewChild('collapseView') private collapseView?: ElementRef<HTMLButtonElement>;
|
|
21
|
+
|
|
22
|
+
private navbar?: NavBarCollapsible;
|
|
23
|
+
|
|
24
|
+
ngAfterViewInit() {
|
|
25
|
+
if (this.collapseButton && this.collapseView) {
|
|
26
|
+
this.navbar = NavBarCollapsible.getOrCreateInstance(this.collapseView.nativeElement);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get isOpen() {
|
|
31
|
+
return this.navbar?._isShown;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
open() {
|
|
35
|
+
this.navbar?.show(this.collapseButton?.nativeElement);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
close() {
|
|
39
|
+
this.navbar?.hide();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
toggleCollapse() {
|
|
43
|
+
this.navbar?.toggle(this.collapseButton?.nativeElement);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
standalone: true,
|
|
5
|
+
selector: 'it-navbar-item',
|
|
6
|
+
templateUrl: './navbar-item.component.html',
|
|
7
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8
|
+
imports: [],
|
|
9
|
+
})
|
|
10
|
+
export class ItNavBarItemComponent {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ItNavBarComponent } from './navbar/navbar.component';
|
|
3
|
+
import { ItNavBarItemComponent } from './navbar-item/navbar-item.component';
|
|
4
|
+
|
|
5
|
+
const navbarComponents = [ItNavBarComponent, ItNavBarItemComponent];
|
|
6
|
+
|
|
7
|
+
@NgModule({
|
|
8
|
+
imports: navbarComponents,
|
|
9
|
+
exports: navbarComponents,
|
|
10
|
+
})
|
|
11
|
+
export class ItNavBarModule {}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, inject, Input, OnInit, Output, ViewChild } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import {
|
|
5
|
+
IsActiveMatchOptions,
|
|
6
|
+
NavigationEnd,
|
|
7
|
+
Router,
|
|
8
|
+
Event as RouterEvent,
|
|
9
|
+
RouterLink,
|
|
10
|
+
RouterLinkActive,
|
|
11
|
+
RouterLinkWithHref,
|
|
12
|
+
Scroll,
|
|
13
|
+
} from '@angular/router';
|
|
14
|
+
import { AsyncSubject, filter, switchMap, tap } from 'rxjs';
|
|
15
|
+
import { ItNavscrollListItemsComponent } from './navscroll-list-items.component';
|
|
16
|
+
import { NavscrollItem } from './navscroll.model';
|
|
17
|
+
import { NavscrollStore } from './navscroll.store';
|
|
18
|
+
|
|
19
|
+
const ROUTER_LINK_ACTIVE_OPTIONS: IsActiveMatchOptions = {
|
|
20
|
+
fragment: 'exact',
|
|
21
|
+
paths: 'exact',
|
|
22
|
+
queryParams: 'exact',
|
|
23
|
+
matrixParams: 'exact',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'it-navscroll-list-item',
|
|
28
|
+
standalone: true,
|
|
29
|
+
imports: [RouterLink, RouterLinkActive, RouterLinkWithHref, ItNavscrollListItemsComponent, AsyncPipe],
|
|
30
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
|
+
template: `
|
|
32
|
+
<a
|
|
33
|
+
class="nav-link"
|
|
34
|
+
[class.active]="active | async"
|
|
35
|
+
[routerLink]="[]"
|
|
36
|
+
routerLinkActive
|
|
37
|
+
[fragment]="item?.href"
|
|
38
|
+
[routerLinkActiveOptions]="routerLinkActiveOptions"
|
|
39
|
+
ariaCurrentWhenActive="page"
|
|
40
|
+
#rtl="routerLinkActive"
|
|
41
|
+
(click)="clickHandler($event)"
|
|
42
|
+
><span>{{ item?.title }}</span></a
|
|
43
|
+
>
|
|
44
|
+
`,
|
|
45
|
+
})
|
|
46
|
+
export class ItNavscrollListItemComponent implements OnInit {
|
|
47
|
+
@Input() item!: NavscrollItem;
|
|
48
|
+
|
|
49
|
+
@Output() readonly checkActive = new EventEmitter<NavscrollItem>();
|
|
50
|
+
|
|
51
|
+
@ViewChild('rtl')
|
|
52
|
+
readonly rtl: any;
|
|
53
|
+
|
|
54
|
+
readonly routerLinkActiveOptions = ROUTER_LINK_ACTIVE_OPTIONS;
|
|
55
|
+
|
|
56
|
+
readonly #initIsActive = new AsyncSubject<NavscrollItem>();
|
|
57
|
+
|
|
58
|
+
readonly active = this.#initIsActive.asObservable().pipe(switchMap(item => this.#store.isActive$(item)));
|
|
59
|
+
|
|
60
|
+
readonly #router = inject(Router);
|
|
61
|
+
|
|
62
|
+
readonly #store = inject(NavscrollStore);
|
|
63
|
+
|
|
64
|
+
readonly #destroyRef = inject(DestroyRef);
|
|
65
|
+
|
|
66
|
+
ngOnInit() {
|
|
67
|
+
this.#initIsActiveSub();
|
|
68
|
+
this.#router.events
|
|
69
|
+
.pipe(
|
|
70
|
+
takeUntilDestroyed(this.#destroyRef),
|
|
71
|
+
filter((event: RouterEvent) => {
|
|
72
|
+
const isNavigationEndEvent = event instanceof NavigationEnd;
|
|
73
|
+
const isScrollEvent = event instanceof Scroll && (event as Scroll).routerEvent instanceof NavigationEnd;
|
|
74
|
+
return isNavigationEndEvent || isScrollEvent;
|
|
75
|
+
}),
|
|
76
|
+
tap(() => {
|
|
77
|
+
if (this.rtl?.isActive) {
|
|
78
|
+
this.#store.setActive(this.item);
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
.subscribe();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
clickHandler(event: Event) {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
this.#store.selectMenuItem();
|
|
88
|
+
this.#router.navigate([], { fragment: this.item.href });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#initIsActiveSub() {
|
|
92
|
+
this.#initIsActive.next(this.item);
|
|
93
|
+
this.#initIsActive.complete();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JsonPipe, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
3
|
+
import { RouterLink, RouterLinkActive, RouterLinkWithHref } from '@angular/router';
|
|
4
|
+
import { ItNavscrollListItemComponent } from './navscroll-list-item.component';
|
|
5
|
+
import { NavscrollItems } from './navscroll.model';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'it-navscroll-list-items',
|
|
9
|
+
standalone: true,
|
|
10
|
+
imports: [NgTemplateOutlet, RouterLink, RouterLinkActive, RouterLinkWithHref, JsonPipe, ItNavscrollListItemComponent],
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
template: `
|
|
13
|
+
<ul class="link-list">
|
|
14
|
+
@for (item of items; track item.href) {
|
|
15
|
+
<li class="nav-item">
|
|
16
|
+
<it-navscroll-list-item [item]="item"></it-navscroll-list-item>
|
|
17
|
+
@if (item.childs?.length) {
|
|
18
|
+
<it-navscroll-list-items [items]="item.childs"></it-navscroll-list-items>
|
|
19
|
+
}
|
|
20
|
+
</li>
|
|
21
|
+
}
|
|
22
|
+
</ul>
|
|
23
|
+
`,
|
|
24
|
+
})
|
|
25
|
+
export class ItNavscrollListItemsComponent {
|
|
26
|
+
@Input() items!: NavscrollItems;
|
|
27
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<div class="container py-lg-5">
|
|
2
|
+
<div class="row">
|
|
3
|
+
<div class="col-12 col-lg-4">
|
|
4
|
+
<div class="it-navscroll-sticky" [ngClass]="{ 'it-navscroll-sticky-mobile': isMobile | async }" data-bs-stackable="true">
|
|
5
|
+
<nav
|
|
6
|
+
class="navbar it-navscroll-wrapper navbar-expand-lg"
|
|
7
|
+
[class.it-top-navscroll]="alignment === 'top'"
|
|
8
|
+
[class.it-bottom-navscroll]="alignment === 'bottom'"
|
|
9
|
+
[class.it-left-side]="borderPosition === 'left'"
|
|
10
|
+
[class.it-right-side]="borderPosition === 'right'"
|
|
11
|
+
[class.theme-dark-mobile]="theme === 'dark'"
|
|
12
|
+
[class.theme-dark-desktop]="theme === 'dark'">
|
|
13
|
+
<button
|
|
14
|
+
class="custom-navbar-toggler"
|
|
15
|
+
type="button"
|
|
16
|
+
aria-controls="navbarNav"
|
|
17
|
+
aria-expanded="false"
|
|
18
|
+
aria-label="Toggle navigation"
|
|
19
|
+
data-bs-toggle="navbarcollapsible"
|
|
20
|
+
data-bs-target="#navbarNav"
|
|
21
|
+
#toggleButtonRef>
|
|
22
|
+
<span class="it-list"></span>{{ selectedTitle | async }}
|
|
23
|
+
</button>
|
|
24
|
+
<div class="progress custom-navbar-progressbar">
|
|
25
|
+
<div
|
|
26
|
+
class="progress-bar it-navscroll-progressbar"
|
|
27
|
+
role="progressbar"
|
|
28
|
+
[style.width.%]="progressBarValue | async"
|
|
29
|
+
[attr.aria-valuenow]="progressBarValue | async"
|
|
30
|
+
aria-valuemin="0"
|
|
31
|
+
aria-valuemax="100"></div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="navbar-collapsable" id="navbarNav">
|
|
34
|
+
<div class="overlay"></div>
|
|
35
|
+
<div class="close-div visually-hidden">
|
|
36
|
+
<button class="btn close-menu" type="button"><span class="it-close"></span>Chiudi</button>
|
|
37
|
+
</div>
|
|
38
|
+
<button type="button" class="it-back-button btn w-100 text-start">
|
|
39
|
+
<svg class="icon icon-sm icon-primary align-top">
|
|
40
|
+
<use
|
|
41
|
+
href="/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left"
|
|
42
|
+
xlink:href="/bootstrap-italia/dist/svg/sprites.svg#it-chevron-left"></use>
|
|
43
|
+
</svg>
|
|
44
|
+
<span>Indietro</span>
|
|
45
|
+
</button>
|
|
46
|
+
<div class="menu-wrapper">
|
|
47
|
+
<div class="link-list-wrapper">
|
|
48
|
+
<h3>{{ header }}</h3>
|
|
49
|
+
<div class="progress">
|
|
50
|
+
<div
|
|
51
|
+
class="progress-bar it-navscroll-progressbar"
|
|
52
|
+
role="progressbar"
|
|
53
|
+
[style.width.%]="progressBarValue | async"
|
|
54
|
+
[attr.aria-valuenow]="progressBarValue | async"
|
|
55
|
+
aria-valuemin="0"
|
|
56
|
+
aria-valuemax="100"></div>
|
|
57
|
+
</div>
|
|
58
|
+
<it-navscroll-list-items [items]="items"></it-navscroll-list-items>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</nav>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="col-12 col-lg-8 it-page-sections-container">
|
|
66
|
+
<ng-container
|
|
67
|
+
*ngTemplateOutlet="pageSectionsTemplate ? pageSectionsTemplate : defaultPageSectionsTemplate; context: { items: items }">
|
|
68
|
+
</ng-container>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<ng-template #defaultPageSectionsTemplate let-items="items">
|
|
74
|
+
@for (item of items; track item.href) {
|
|
75
|
+
<ng-container *ngTemplateOutlet="paragraphTemplate; context: { item: item, level: 1 }"></ng-container>
|
|
76
|
+
}
|
|
77
|
+
</ng-template>
|
|
78
|
+
|
|
79
|
+
<ng-template #paragraphTemplate let-item="item" let-level="level" let-nextLevel="level+1">
|
|
80
|
+
@switch (level) {
|
|
81
|
+
@case (1) {
|
|
82
|
+
<h2 class="it-page-section" id="{{ item.href }}">{{ item.title }}</h2>
|
|
83
|
+
}
|
|
84
|
+
@case (2) {
|
|
85
|
+
<h3 class="it-page-section" id="{{ item.href }}">{{ item.title }}</h3>
|
|
86
|
+
}
|
|
87
|
+
@case (3) {
|
|
88
|
+
<h4 class="it-page-section" id="{{ item.href }}">{{ item.title }}</h4>
|
|
89
|
+
}
|
|
90
|
+
@case (4) {
|
|
91
|
+
<h5 class="it-page-section" id="{{ item.href }}">{{ item.title }}</h5>
|
|
92
|
+
}
|
|
93
|
+
@default {
|
|
94
|
+
<h6 class="it-page-section" id="{{ item.href }}">{{ item.title }}</h6>
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
<p>{{ item.text }}</p>
|
|
98
|
+
@for (item of item.childs; track item.href) {
|
|
99
|
+
<ng-container *ngTemplateOutlet="paragraphTemplate; context: { item: item, level: nextLevel }"></ng-container>
|
|
100
|
+
}
|
|
101
|
+
</ng-template>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { AsyncPipe, NgClass, NgTemplateOutlet, ViewportScroller } from '@angular/common';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
DestroyRef,
|
|
6
|
+
ElementRef,
|
|
7
|
+
HostListener,
|
|
8
|
+
inject,
|
|
9
|
+
Input,
|
|
10
|
+
OnInit,
|
|
11
|
+
TemplateRef,
|
|
12
|
+
ViewChild,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
15
|
+
import { RouterLink, RouterLinkActive, RouterLinkWithHref } from '@angular/router';
|
|
16
|
+
import { delay, filter, map, tap, withLatestFrom } from 'rxjs';
|
|
17
|
+
import { ItNavscrollListItemsComponent } from './navscroll-list-items.component';
|
|
18
|
+
import { NavscrollItem } from './navscroll.model';
|
|
19
|
+
import { NavscrollStore } from './navscroll.store';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Navscroll
|
|
23
|
+
* @description Show a list of links to anchor of the document.
|
|
24
|
+
*/
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'it-navscroll',
|
|
27
|
+
standalone: true,
|
|
28
|
+
imports: [
|
|
29
|
+
ItNavscrollListItemsComponent,
|
|
30
|
+
AsyncPipe,
|
|
31
|
+
NgTemplateOutlet,
|
|
32
|
+
RouterLink,
|
|
33
|
+
RouterLinkActive,
|
|
34
|
+
RouterLinkWithHref,
|
|
35
|
+
AsyncPipe,
|
|
36
|
+
NgClass,
|
|
37
|
+
],
|
|
38
|
+
templateUrl: './navscroll.component.html',
|
|
39
|
+
styleUrl: './navscroll.component.scss',
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
providers: [NavscrollStore],
|
|
42
|
+
})
|
|
43
|
+
export class ItNavscrollComponent implements OnInit {
|
|
44
|
+
/**
|
|
45
|
+
* Header of the Navscroll
|
|
46
|
+
*/
|
|
47
|
+
@Input() header = '';
|
|
48
|
+
/**
|
|
49
|
+
* A list of links
|
|
50
|
+
*/
|
|
51
|
+
@Input() items!: Array<NavscrollItem>;
|
|
52
|
+
/**
|
|
53
|
+
* Border position
|
|
54
|
+
* @default left
|
|
55
|
+
*/
|
|
56
|
+
@Input() borderPosition: 'left' | 'right' = 'left';
|
|
57
|
+
/**
|
|
58
|
+
* Alignment
|
|
59
|
+
* @default top
|
|
60
|
+
*/
|
|
61
|
+
@Input() alignment: 'top' | 'bottom' = 'top';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Theme
|
|
65
|
+
* @default light
|
|
66
|
+
*/
|
|
67
|
+
@Input() theme: 'light' | 'dark' = 'light';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Custom template for the content section
|
|
71
|
+
*/
|
|
72
|
+
@Input()
|
|
73
|
+
pageSectionsTemplate?: TemplateRef<any>;
|
|
74
|
+
|
|
75
|
+
@HostListener('window:scroll', ['$event']) // for window scroll events
|
|
76
|
+
onScroll() {
|
|
77
|
+
const sectionContainer = this.#elementRef.nativeElement.querySelector('.it-page-sections-container');
|
|
78
|
+
this.#store.updateProgressBar(sectionContainer);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@HostListener('window:resize', ['$event'])
|
|
82
|
+
onResize() {
|
|
83
|
+
this.#setMobile();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@ViewChild('toggleButtonRef')
|
|
87
|
+
readonly toggleButtonRef!: ElementRef<HTMLButtonElement>;
|
|
88
|
+
|
|
89
|
+
readonly #store = inject(NavscrollStore);
|
|
90
|
+
|
|
91
|
+
readonly #scroller = inject(ViewportScroller);
|
|
92
|
+
|
|
93
|
+
readonly #destroyRef = inject(DestroyRef);
|
|
94
|
+
|
|
95
|
+
readonly #elementRef = inject(ElementRef);
|
|
96
|
+
|
|
97
|
+
readonly selectedTitle = this.#store.selected.pipe(map(selected => selected?.title ?? ''));
|
|
98
|
+
|
|
99
|
+
readonly progressBarValue = this.#store.progressBar;
|
|
100
|
+
|
|
101
|
+
readonly isMobile = this.#store.isMobile;
|
|
102
|
+
|
|
103
|
+
constructor() {
|
|
104
|
+
this.#store.menuItemSelected
|
|
105
|
+
.pipe(
|
|
106
|
+
takeUntilDestroyed(),
|
|
107
|
+
withLatestFrom(this.isMobile),
|
|
108
|
+
tap(v => {
|
|
109
|
+
const isMobile = v[1];
|
|
110
|
+
if (isMobile) {
|
|
111
|
+
this.toggleButtonRef.nativeElement.click();
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
)
|
|
115
|
+
.subscribe();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ngOnInit(): void {
|
|
119
|
+
this.#initViewScrollerSubscription();
|
|
120
|
+
this.#store.init(this.items);
|
|
121
|
+
this.#setMobile();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#initViewScrollerSubscription() {
|
|
125
|
+
this.#store.selected
|
|
126
|
+
.pipe(
|
|
127
|
+
takeUntilDestroyed(this.#destroyRef),
|
|
128
|
+
filter(selected => Boolean(selected)),
|
|
129
|
+
map(v => v as NavscrollItem),
|
|
130
|
+
delay(0), //WA
|
|
131
|
+
tap({
|
|
132
|
+
next: ({ href }) => {
|
|
133
|
+
this.#scroller.scrollToAnchor(href);
|
|
134
|
+
},
|
|
135
|
+
})
|
|
136
|
+
)
|
|
137
|
+
.subscribe();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#setMobile() {
|
|
141
|
+
this.#store.setMobile(window);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export interface NavscrollItem {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
title: string;
|
|
3
|
+
text: string;
|
|
4
|
+
href: string;
|
|
5
|
+
childs: NavscrollItems;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
export type NavscrollItems = Array<NavscrollItem>;
|
|
9
|
+
|
|
8
10
|
export interface NavscrollItemActive {
|
|
9
|
-
|
|
11
|
+
active: boolean;
|
|
10
12
|
}
|