design-angular-kit 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +461 -0
- package/assets/i18n/en.json +89 -0
- package/assets/i18n/it.json +89 -0
- package/esm2022/design-angular-kit.mjs +5 -0
- package/esm2022/lib/abstracts/abstract-form.component.mjs +199 -0
- package/esm2022/lib/abstracts/abstract.component.mjs +46 -0
- package/esm2022/lib/components/core/accordion/accordion.component.mjs +39 -0
- package/esm2022/lib/components/core/alert/alert.component.mjs +71 -0
- package/esm2022/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.mjs +43 -0
- package/esm2022/lib/components/core/avatar/avatar-group/avatar-group.component.mjs +40 -0
- package/esm2022/lib/components/core/avatar/avatar.directive.mjs +78 -0
- package/esm2022/lib/components/core/avatar/avatar.module.mjs +33 -0
- package/esm2022/lib/components/core/badge/badge.directive.mjs +39 -0
- package/esm2022/lib/components/core/button/button.directive.mjs +80 -0
- package/esm2022/lib/components/core/callout/callout.component.mjs +64 -0
- package/esm2022/lib/components/core/card/card.component.mjs +59 -0
- package/esm2022/lib/components/core/carousel/carousel/carousel.component.mjs +86 -0
- package/esm2022/lib/components/core/carousel/carousel-item/carousel-item.component.mjs +19 -0
- package/esm2022/lib/components/core/carousel/carousel.module.mjs +18 -0
- package/esm2022/lib/components/core/chip/chip.component.mjs +136 -0
- package/esm2022/lib/components/core/collapse/collapse.component.mjs +116 -0
- package/esm2022/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.mjs +27 -0
- package/esm2022/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.mjs +11 -0
- package/esm2022/lib/components/core/dimmer/dimmer.component.mjs +55 -0
- package/esm2022/lib/components/core/dimmer/dimmer.module.mjs +19 -0
- package/esm2022/lib/components/core/dropdown/dropdown/dropdown.component.mjs +147 -0
- package/esm2022/lib/components/core/dropdown/dropdown-item/dropdown-item.component.mjs +70 -0
- package/esm2022/lib/components/core/dropdown/dropdown.module.mjs +18 -0
- package/esm2022/lib/components/core/forward/forward.directive.mjs +57 -0
- package/esm2022/lib/components/core/link/link.component.mjs +42 -0
- package/esm2022/lib/components/core/list/list/list.component.mjs +22 -0
- package/esm2022/lib/components/core/list/list-item/list-item.component.mjs +56 -0
- package/esm2022/lib/components/core/list/list.module.mjs +18 -0
- package/esm2022/lib/components/core/modal/modal.component.mjs +194 -0
- package/esm2022/lib/components/core/notifications/notifications.component.mjs +111 -0
- package/esm2022/lib/components/core/pagination/pagination.component.mjs +130 -0
- package/esm2022/lib/components/core/popover/popover.directive.mjs +176 -0
- package/esm2022/lib/components/core/progress-bar/progress-bar.component.mjs +34 -0
- package/esm2022/lib/components/core/progress-button/progress-button.component.mjs +25 -0
- package/esm2022/lib/components/core/spinner/spinner.component.mjs +30 -0
- package/esm2022/lib/components/core/steppers/steppers-container/steppers-container.component.mjs +116 -0
- package/esm2022/lib/components/core/steppers/steppers-item/steppers-item.component.mjs +22 -0
- package/esm2022/lib/components/core/steppers/steppers.module.mjs +18 -0
- package/esm2022/lib/components/core/tab/tab-container/tab-container.component.mjs +97 -0
- package/esm2022/lib/components/core/tab/tab-item/tab-item.component.mjs +39 -0
- package/esm2022/lib/components/core/tab/tab.module.mjs +18 -0
- package/esm2022/lib/components/core/table/sort/sort-header/sort-header.component.mjs +134 -0
- package/esm2022/lib/components/core/table/sort/sort.directive.mjs +123 -0
- package/esm2022/lib/components/core/table/table.component.mjs +45 -0
- package/esm2022/lib/components/core/table/table.module.mjs +19 -0
- package/esm2022/lib/components/core/timeline/timeline-item/timeline-item.component.mjs +90 -0
- package/esm2022/lib/components/core/timeline/timeline.component.mjs +36 -0
- package/esm2022/lib/components/core/timeline/timeline.module.mjs +18 -0
- package/esm2022/lib/components/core/tooltip/tooltip.directive.mjs +143 -0
- package/esm2022/lib/components/core/video-player/video-player-i18n.model.mjs +2 -0
- package/esm2022/lib/components/core/video-player/video-player-i18n.service.mjs +130 -0
- package/esm2022/lib/components/core/video-player/video-player.component.mjs +303 -0
- package/esm2022/lib/components/core/video-player/video-player.config.mjs +43 -0
- package/esm2022/lib/components/core/video-player/video-player.cookie.mjs +25 -0
- package/esm2022/lib/components/core/video-player/video-player.model.mjs +3 -0
- package/esm2022/lib/components/core/video-player/video-player.module.mjs +16 -0
- package/esm2022/lib/components/form/autocomplete/autocomplete.component.mjs +178 -0
- package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +48 -0
- package/esm2022/lib/components/form/form.module.mjs +67 -0
- package/esm2022/lib/components/form/input/input.component.mjs +190 -0
- package/esm2022/lib/components/form/password-input/password-input.component.mjs +149 -0
- package/esm2022/lib/components/form/radio-button/radio-button.component.mjs +60 -0
- package/esm2022/lib/components/form/range/range.component.mjs +64 -0
- package/esm2022/lib/components/form/rating/rating.component.mjs +50 -0
- package/esm2022/lib/components/form/search/search.component.mjs +112 -0
- package/esm2022/lib/components/form/select/select.component.mjs +70 -0
- package/esm2022/lib/components/form/textarea/textarea.component.mjs +55 -0
- package/esm2022/lib/components/form/transfer/store/transfer.reducers.mjs +191 -0
- package/esm2022/lib/components/form/transfer/store/transfer.state.mjs +2 -0
- package/esm2022/lib/components/form/transfer/store/transfer.store.mjs +70 -0
- package/esm2022/lib/components/form/transfer/transfer-list/transfer-list.component.mjs +72 -0
- package/esm2022/lib/components/form/transfer/transfer.component.mjs +149 -0
- package/esm2022/lib/components/form/transfer/transfer.model.mjs +6 -0
- package/esm2022/lib/components/form/upload-drag-drop/upload-drag-drop.component.mjs +142 -0
- package/esm2022/lib/components/form/upload-file-list/upload-file-list.component.mjs +107 -0
- package/esm2022/lib/components/navigation/back-button/back-button.component.mjs +67 -0
- package/esm2022/lib/components/navigation/back-to-top/back-to-top.component.mjs +68 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.mjs +51 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.mjs +21 -0
- package/esm2022/lib/components/navigation/breadcrumbs/breadcrumbs.module.mjs +18 -0
- package/esm2022/lib/components/navigation/header/header.component.mjs +103 -0
- package/esm2022/lib/components/navigation/megamenu/megamenu.component.mjs +27 -0
- package/esm2022/lib/components/navigation/navbar/navbar/navbar.component.mjs +49 -0
- package/esm2022/lib/components/navigation/navbar/navbar-item/navbar-item.component.mjs +11 -0
- package/esm2022/lib/components/navigation/navbar/navbar.module.mjs +18 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-item.component.mjs +97 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll-list-items.component.mjs +44 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.component.mjs +116 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.model.mjs +2 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.store.mjs +68 -0
- package/esm2022/lib/components/navigation/navscroll/navscroll.utils.mjs +23 -0
- package/esm2022/lib/components/navigation/sidebar/sidebar.component.mjs +50 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink/skiplink.component.mjs +27 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.mjs +26 -0
- package/esm2022/lib/components/navigation/skiplink/skiplink.module.mjs +18 -0
- package/esm2022/lib/components/utils/error-page/error-page.component.mjs +74 -0
- package/esm2022/lib/components/utils/icon/icon.component.mjs +63 -0
- package/esm2022/lib/components/utils/language-switcher/language-switcher.component.mjs +50 -0
- package/esm2022/lib/design-angular-kit.module.mjs +237 -0
- package/esm2022/lib/enums/colors.enums.mjs +12 -0
- package/esm2022/lib/enums/sizes.enum.mjs +9 -0
- package/esm2022/lib/interfaces/core.mjs +16 -0
- package/esm2022/lib/interfaces/design-angular-kit-config.mjs +7 -0
- package/esm2022/lib/interfaces/form.mjs +2 -0
- package/esm2022/lib/interfaces/icon.mjs +168 -0
- package/esm2022/lib/interfaces/sortable-table.mjs +6 -0
- package/esm2022/lib/interfaces/utils.mjs +2 -0
- package/esm2022/lib/pipes/date-ago.pipe.mjs +56 -0
- package/esm2022/lib/pipes/duration.pipe.mjs +115 -0
- package/esm2022/lib/pipes/mark-matching-text.pipe.mjs +48 -0
- package/esm2022/lib/provide-design-angular-kit.mjs +64 -0
- package/esm2022/lib/services/notification/notification.service.mjs +120 -0
- package/esm2022/lib/utils/coercion.mjs +18 -0
- package/esm2022/lib/utils/date-utils.mjs +162 -0
- package/esm2022/lib/utils/file-utils.mjs +73 -0
- package/esm2022/lib/utils/regex.mjs +35 -0
- package/esm2022/lib/validators/it-validators.mjs +161 -0
- package/esm2022/public_api.mjs +114 -0
- package/fesm2022/design-angular-kit.mjs +7423 -0
- package/fesm2022/design-angular-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/abstracts/abstract-form.component.d.ts +89 -0
- package/lib/abstracts/abstract.component.d.ts +30 -0
- package/lib/components/core/accordion/accordion.component.d.ts +18 -0
- package/lib/components/core/alert/alert.component.d.ts +44 -0
- package/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.d.ts +29 -0
- package/lib/components/core/avatar/avatar-group/avatar-group.component.d.ts +15 -0
- package/lib/components/core/avatar/avatar.directive.d.ts +33 -0
- package/lib/components/core/avatar/avatar.module.d.ts +9 -0
- package/lib/components/core/badge/badge.directive.d.ts +23 -0
- package/lib/components/core/button/button.directive.d.ts +48 -0
- package/lib/components/core/callout/callout.component.d.ts +50 -0
- package/lib/components/core/card/card.component.d.ts +69 -0
- package/lib/components/core/carousel/carousel/carousel.component.d.ts +65 -0
- package/lib/components/core/carousel/carousel-item/carousel-item.component.d.ts +15 -0
- package/lib/components/core/carousel/carousel.module.d.ts +8 -0
- package/lib/components/core/chip/chip.component.d.ts +76 -0
- package/lib/components/core/collapse/collapse.component.d.ts +67 -0
- package/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.d.ts +12 -0
- package/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.d.ts +5 -0
- package/lib/components/core/dimmer/dimmer.component.d.ts +24 -0
- package/lib/components/core/dimmer/dimmer.module.d.ts +9 -0
- package/lib/components/core/dropdown/dropdown/dropdown.component.d.ts +94 -0
- package/lib/components/core/dropdown/dropdown-item/dropdown-item.component.d.ts +46 -0
- package/lib/components/core/dropdown/dropdown.module.d.ts +8 -0
- package/lib/components/core/forward/forward.directive.d.ts +14 -0
- package/lib/components/core/link/link.component.d.ts +35 -0
- package/lib/components/core/list/list/list.component.d.ts +24 -0
- package/lib/components/core/list/list-item/list-item.component.d.ts +41 -0
- package/lib/components/core/list/list.module.d.ts +8 -0
- package/lib/components/core/modal/modal.component.d.ts +135 -0
- package/lib/components/core/notifications/notifications.component.d.ts +45 -0
- package/lib/components/core/pagination/pagination.component.d.ts +92 -0
- package/lib/components/core/popover/popover.directive.d.ts +99 -0
- package/lib/components/core/progress-bar/progress-bar.component.d.ts +31 -0
- package/lib/components/core/progress-button/progress-button.component.d.ts +21 -0
- package/lib/components/core/spinner/spinner.component.d.ts +24 -0
- package/lib/components/core/steppers/steppers-container/steppers-container.component.d.ts +130 -0
- package/lib/components/core/steppers/steppers-item/steppers-item.component.d.ts +24 -0
- package/lib/components/core/steppers/steppers.module.d.ts +8 -0
- package/lib/components/core/tab/tab-container/tab-container.component.d.ts +60 -0
- package/lib/components/core/tab/tab-item/tab-item.component.d.ts +38 -0
- package/lib/components/core/tab/tab.module.d.ts +8 -0
- package/lib/components/core/table/sort/sort-header/sort-header.component.d.ts +72 -0
- package/lib/components/core/table/sort/sort.directive.d.ts +53 -0
- package/lib/components/core/table/table.component.d.ts +60 -0
- package/lib/components/core/table/table.module.d.ts +9 -0
- package/lib/components/core/timeline/timeline-item/timeline-item.component.d.ts +79 -0
- package/lib/components/core/timeline/timeline.component.d.ts +21 -0
- package/lib/components/core/timeline/timeline.module.d.ts +8 -0
- package/lib/components/core/tooltip/tooltip.directive.d.ts +82 -0
- package/lib/components/core/video-player/video-player-i18n.model.d.ts +179 -0
- package/lib/components/core/video-player/video-player-i18n.service.d.ts +17 -0
- package/lib/components/core/video-player/video-player.component.d.ts +48 -0
- package/lib/components/core/video-player/video-player.config.d.ts +68 -0
- package/lib/components/core/video-player/video-player.cookie.d.ts +6 -0
- package/lib/components/core/video-player/video-player.model.d.ts +44 -0
- package/lib/components/core/video-player/video-player.module.d.ts +7 -0
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +75 -0
- package/lib/components/form/checkbox/checkbox.component.d.ts +41 -0
- package/lib/components/form/form.module.d.ts +19 -0
- package/lib/components/form/input/input.component.d.ts +95 -0
- package/lib/components/form/password-input/password-input.component.d.ts +80 -0
- package/lib/components/form/radio-button/radio-button.component.d.ts +38 -0
- package/lib/components/form/range/range.component.d.ts +42 -0
- package/lib/components/form/rating/rating.component.d.ts +24 -0
- package/lib/components/form/search/search.component.d.ts +59 -0
- package/lib/components/form/select/select.component.d.ts +36 -0
- package/lib/components/form/textarea/textarea.component.d.ts +34 -0
- package/lib/components/form/transfer/store/transfer.reducers.d.ts +103 -0
- package/lib/components/form/transfer/store/transfer.state.d.ts +18 -0
- package/lib/components/form/transfer/store/transfer.store.d.ts +23 -0
- package/lib/components/form/transfer/transfer-list/transfer-list.component.d.ts +48 -0
- package/lib/components/form/transfer/transfer.component.d.ts +75 -0
- package/{src/lib/components/form/transfer/transfer.model.ts → lib/components/form/transfer/transfer.model.d.ts} +2 -9
- package/lib/components/form/upload-drag-drop/upload-drag-drop.component.d.ts +60 -0
- package/lib/components/form/upload-file-list/upload-file-list.component.d.ts +62 -0
- package/lib/components/navigation/back-button/back-button.component.d.ts +47 -0
- package/lib/components/navigation/back-to-top/back-to-top.component.d.ts +50 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +28 -0
- package/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +23 -0
- package/lib/components/navigation/breadcrumbs/breadcrumbs.module.d.ts +8 -0
- package/lib/components/navigation/header/header.component.d.ts +38 -0
- package/lib/components/navigation/megamenu/megamenu.component.d.ts +22 -0
- package/lib/components/navigation/navbar/navbar/navbar.component.d.ts +19 -0
- package/lib/components/navigation/navbar/navbar-item/navbar-item.component.d.ts +5 -0
- package/lib/components/navigation/navbar/navbar.module.d.ts +8 -0
- package/lib/components/navigation/navscroll/navscroll-list-item.component.d.ts +16 -0
- package/lib/components/navigation/navscroll/navscroll-list-items.component.d.ts +7 -0
- package/lib/components/navigation/navscroll/navscroll.component.d.ts +47 -0
- package/{src/lib/components/navigation/navscroll/navscroll.model.ts → lib/components/navigation/navscroll/navscroll.model.d.ts} +5 -7
- package/lib/components/navigation/navscroll/navscroll.store.d.ts +16 -0
- package/lib/components/navigation/navscroll/navscroll.utils.d.ts +6 -0
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +26 -0
- package/lib/components/navigation/skiplink/skiplink/skiplink.component.d.ts +17 -0
- package/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.d.ts +24 -0
- package/lib/components/navigation/skiplink/skiplink.module.d.ts +8 -0
- package/lib/components/utils/error-page/error-page.component.d.ts +44 -0
- package/lib/components/utils/icon/icon.component.d.ts +53 -0
- package/lib/components/utils/language-switcher/language-switcher.component.d.ts +27 -0
- package/lib/design-angular-kit.module.d.ts +54 -0
- package/lib/enums/colors.enums.d.ts +10 -0
- package/lib/enums/sizes.enum.d.ts +7 -0
- package/{src/lib/interfaces/core.ts → lib/interfaces/core.d.ts} +53 -95
- package/lib/interfaces/design-angular-kit-config.d.ts +30 -0
- package/lib/interfaces/form.d.ts +67 -0
- package/lib/interfaces/icon.d.ts +4 -0
- package/lib/interfaces/sortable-table.d.ts +33 -0
- package/lib/interfaces/utils.d.ts +10 -0
- package/lib/pipes/date-ago.pipe.d.ts +17 -0
- package/lib/pipes/duration.pipe.d.ts +35 -0
- package/lib/pipes/mark-matching-text.pipe.d.ts +18 -0
- package/lib/provide-design-angular-kit.d.ts +7 -0
- package/lib/services/notification/notification.service.d.ts +63 -0
- package/{src/lib/utils/coercion.ts → lib/utils/coercion.d.ts} +1 -7
- package/lib/utils/date-utils.d.ts +79 -0
- package/lib/utils/file-utils.d.ts +32 -0
- package/lib/utils/regex.d.ts +34 -0
- package/lib/validators/it-validators.d.ts +70 -0
- package/package.json +33 -15
- package/{src/public_api.ts → public_api.d.ts} +6 -45
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +29 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/index.spec.d.ts +1 -0
- package/schematics/ng-add/index.spec.js +43 -0
- package/schematics/ng-add/index.spec.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-animations.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/add-animations.js +11 -0
- package/schematics/ng-add/rules/setup-project/add-animations.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-assets.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-assets.js +50 -0
- package/schematics/ng-add/rules/setup-project/add-assets.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js +43 -0
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.js +11 -0
- package/schematics/ng-add/rules/setup-project/add-http-client.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.d.ts +11 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js +112 -0
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.d.ts +3 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.js +50 -0
- package/schematics/ng-add/rules/setup-project/add-localisation.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.d.ts +2 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js +13 -0
- package/schematics/ng-add/rules/setup-project/angular-json-helper.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/exceptions.d.ts +7 -0
- package/schematics/ng-add/rules/setup-project/exceptions.js +17 -0
- package/schematics/ng-add/rules/setup-project/exceptions.js.map +1 -0
- package/schematics/ng-add/rules/setup-project/index.js +23 -0
- package/schematics/ng-add/rules/setup-project/index.js.map +1 -0
- package/schematics/ng-add/{schema.ts → schema.d.ts} +1 -1
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/setup-project.d.ts +3 -0
- package/schematics/ng-add/setup-project.js +37 -0
- package/schematics/ng-add/setup-project.js.map +1 -0
- package/schematics/ng-add/setup-project.spec.d.ts +1 -0
- package/schematics/ng-add/setup-project.spec.js +139 -0
- package/schematics/ng-add/setup-project.spec.js.map +1 -0
- package/schematics/ng-add/utils.d.ts +14 -0
- package/schematics/ng-add/utils.js +49 -0
- package/schematics/ng-add/utils.js.map +1 -0
- package/schematics/ng-add/versions-helper.d.ts +3 -0
- package/schematics/ng-add/versions-helper.js +40 -0
- package/schematics/ng-add/versions-helper.js.map +1 -0
- package/.eslintrc.json +0 -31
- package/karma.conf.js +0 -38
- package/ng-package.json +0 -9
- package/ng-package.prod.json +0 -8
- package/schematics/ng-add/index.spec.ts +0 -45
- package/schematics/ng-add/index.ts +0 -36
- package/schematics/ng-add/rules/setup-project/add-animations.ts +0 -7
- package/schematics/ng-add/rules/setup-project/add-assets.ts +0 -45
- package/schematics/ng-add/rules/setup-project/add-design-angular-kit.ts +0 -40
- package/schematics/ng-add/rules/setup-project/add-http-client.ts +0 -7
- package/schematics/ng-add/rules/setup-project/add-import-to-style-file.ts +0 -120
- package/schematics/ng-add/rules/setup-project/add-localisation.ts +0 -45
- package/schematics/ng-add/rules/setup-project/angular-json-helper.ts +0 -11
- package/schematics/ng-add/rules/setup-project/exceptions.ts +0 -13
- package/schematics/ng-add/setup-project.spec.ts +0 -166
- package/schematics/ng-add/setup-project.ts +0 -31
- package/schematics/ng-add/utils.ts +0 -71
- package/schematics/ng-add/versions-helper.ts +0 -41
- package/src/lib/abstracts/abstract-form.component.ts +0 -200
- package/src/lib/abstracts/abstract.component.ts +0 -63
- package/src/lib/components/core/accordion/accordion.component.html +0 -27
- package/src/lib/components/core/accordion/accordion.component.spec.ts +0 -21
- package/src/lib/components/core/accordion/accordion.component.ts +0 -40
- package/src/lib/components/core/alert/alert.component.html +0 -19
- package/src/lib/components/core/alert/alert.component.scss +0 -3
- package/src/lib/components/core/alert/alert.component.spec.ts +0 -62
- package/src/lib/components/core/alert/alert.component.ts +0 -75
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.html +0 -23
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.scss +0 -17
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.spec.ts +0 -21
- package/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.ts +0 -50
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.html +0 -7
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.spec.ts +0 -38
- package/src/lib/components/core/avatar/avatar-group/avatar-group.component.ts +0 -25
- package/src/lib/components/core/avatar/avatar.directive.ts +0 -73
- package/src/lib/components/core/avatar/avatar.module.ts +0 -18
- package/src/lib/components/core/badge/badge.directive.spec.ts +0 -59
- package/src/lib/components/core/badge/badge.directive.ts +0 -39
- package/src/lib/components/core/button/button.directive.spec.ts +0 -96
- package/src/lib/components/core/button/button.directive.ts +0 -89
- package/src/lib/components/core/callout/callout.component.html +0 -25
- package/src/lib/components/core/callout/callout.component.spec.ts +0 -138
- package/src/lib/components/core/callout/callout.component.ts +0 -92
- package/src/lib/components/core/card/card.component.html +0 -35
- package/src/lib/components/core/card/card.component.scss +0 -30
- package/src/lib/components/core/card/card.component.spec.ts +0 -21
- package/src/lib/components/core/card/card.component.ts +0 -78
- package/src/lib/components/core/carousel/carousel/carousel.component.html +0 -29
- package/src/lib/components/core/carousel/carousel/carousel.component.scss +0 -1
- package/src/lib/components/core/carousel/carousel/carousel.component.spec.ts +0 -21
- package/src/lib/components/core/carousel/carousel/carousel.component.ts +0 -119
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.html +0 -3
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.spec.ts +0 -22
- package/src/lib/components/core/carousel/carousel-item/carousel-item.component.ts +0 -20
- package/src/lib/components/core/carousel/carousel.module.ts +0 -11
- package/src/lib/components/core/chip/chip.component.html +0 -26
- package/src/lib/components/core/chip/chip.component.spec.ts +0 -87
- package/src/lib/components/core/chip/chip.component.ts +0 -154
- package/src/lib/components/core/collapse/collapse.component.html +0 -3
- package/src/lib/components/core/collapse/collapse.component.spec.ts +0 -21
- package/src/lib/components/core/collapse/collapse.component.ts +0 -124
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.html +0 -3
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.spec.ts +0 -35
- package/src/lib/components/core/dimmer/dimmer-buttons/dimmer-buttons.component.ts +0 -23
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.html +0 -3
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.spec.ts +0 -22
- package/src/lib/components/core/dimmer/dimmer-icon/dimmer-icon.component.ts +0 -10
- package/src/lib/components/core/dimmer/dimmer.component.html +0 -7
- package/src/lib/components/core/dimmer/dimmer.component.spec.ts +0 -49
- package/src/lib/components/core/dimmer/dimmer.component.ts +0 -50
- package/src/lib/components/core/dimmer/dimmer.module.ts +0 -12
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.html +0 -45
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.scss +0 -3
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.spec.ts +0 -21
- package/src/lib/components/core/dropdown/dropdown/dropdown.component.ts +0 -186
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.html +0 -18
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.scss +0 -4
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.spec.ts +0 -21
- package/src/lib/components/core/dropdown/dropdown-item/dropdown-item.component.ts +0 -82
- package/src/lib/components/core/dropdown/dropdown.module.ts +0 -11
- package/src/lib/components/core/forward/forward.directive.spec.ts +0 -60
- package/src/lib/components/core/forward/forward.directive.ts +0 -43
- package/src/lib/components/core/link/link.component.html +0 -13
- package/src/lib/components/core/link/link.component.spec.ts +0 -21
- package/src/lib/components/core/link/link.component.ts +0 -54
- package/src/lib/components/core/list/list/list.component.html +0 -13
- package/src/lib/components/core/list/list/list.component.spec.ts +0 -21
- package/src/lib/components/core/list/list/list.component.ts +0 -30
- package/src/lib/components/core/list/list-item/list-item.component.html +0 -42
- package/src/lib/components/core/list/list-item/list-item.component.scss +0 -16
- package/src/lib/components/core/list/list-item/list-item.component.spec.ts +0 -21
- package/src/lib/components/core/list/list-item/list-item.component.ts +0 -75
- package/src/lib/components/core/list/list.module.ts +0 -11
- package/src/lib/components/core/modal/modal.component.html +0 -36
- package/src/lib/components/core/modal/modal.component.scss +0 -3
- package/src/lib/components/core/modal/modal.component.spec.ts +0 -21
- package/src/lib/components/core/modal/modal.component.ts +0 -218
- package/src/lib/components/core/notifications/notifications.component.html +0 -25
- package/src/lib/components/core/notifications/notifications.component.scss +0 -3
- package/src/lib/components/core/notifications/notifications.component.spec.ts +0 -21
- package/src/lib/components/core/notifications/notifications.component.ts +0 -123
- package/src/lib/components/core/pagination/pagination.component.html +0 -107
- package/src/lib/components/core/pagination/pagination.component.spec.ts +0 -21
- package/src/lib/components/core/pagination/pagination.component.ts +0 -157
- package/src/lib/components/core/popover/popover.directive.spec.ts +0 -21
- package/src/lib/components/core/popover/popover.directive.ts +0 -171
- package/src/lib/components/core/progress-bar/progress-bar.component.html +0 -20
- package/src/lib/components/core/progress-bar/progress-bar.component.spec.ts +0 -21
- package/src/lib/components/core/progress-bar/progress-bar.component.ts +0 -46
- package/src/lib/components/core/progress-button/progress-button.component.html +0 -5
- package/src/lib/components/core/progress-button/progress-button.component.spec.ts +0 -21
- package/src/lib/components/core/progress-button/progress-button.component.ts +0 -39
- package/src/lib/components/core/spinner/spinner.component.html +0 -7
- package/src/lib/components/core/spinner/spinner.component.spec.ts +0 -80
- package/src/lib/components/core/spinner/spinner.component.ts +0 -31
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.html +0 -126
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.spec.ts +0 -21
- package/src/lib/components/core/steppers/steppers-container/steppers-container.component.ts +0 -185
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.html +0 -3
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.spec.ts +0 -22
- package/src/lib/components/core/steppers/steppers-item/steppers-item.component.ts +0 -33
- package/src/lib/components/core/steppers/steppers.module.ts +0 -11
- package/src/lib/components/core/tab/tab-container/tab-container.component.html +0 -78
- package/src/lib/components/core/tab/tab-container/tab-container.component.spec.ts +0 -21
- package/src/lib/components/core/tab/tab-container/tab-container.component.ts +0 -137
- package/src/lib/components/core/tab/tab-item/tab-item.component.html +0 -3
- package/src/lib/components/core/tab/tab-item/tab-item.component.spec.ts +0 -22
- package/src/lib/components/core/tab/tab-item/tab-item.component.ts +0 -50
- package/src/lib/components/core/tab/tab.module.ts +0 -11
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.html +0 -27
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.scss +0 -65
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.spec.ts +0 -25
- package/src/lib/components/core/table/sort/sort-header/sort-header.component.ts +0 -164
- package/src/lib/components/core/table/sort/sort.directive.spec.ts +0 -73
- package/src/lib/components/core/table/sort/sort.directive.ts +0 -142
- package/src/lib/components/core/table/table.component.html +0 -23
- package/src/lib/components/core/table/table.component.scss +0 -7
- package/src/lib/components/core/table/table.component.spec.ts +0 -21
- package/src/lib/components/core/table/table.component.ts +0 -70
- package/src/lib/components/core/table/table.module.ts +0 -12
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.html +0 -47
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.spec.ts +0 -24
- package/src/lib/components/core/timeline/timeline-item/timeline-item.component.ts +0 -102
- package/src/lib/components/core/timeline/timeline.component.html +0 -21
- package/src/lib/components/core/timeline/timeline.component.spec.ts +0 -21
- package/src/lib/components/core/timeline/timeline.component.ts +0 -31
- package/src/lib/components/core/timeline/timeline.module.ts +0 -11
- package/src/lib/components/core/tooltip/tooltip.directive.spec.ts +0 -20
- package/src/lib/components/core/tooltip/tooltip.directive.ts +0 -141
- package/src/lib/components/form/autocomplete/autocomplete.component.html +0 -58
- package/src/lib/components/form/autocomplete/autocomplete.component.spec.ts +0 -21
- package/src/lib/components/form/autocomplete/autocomplete.component.ts +0 -130
- package/src/lib/components/form/checkbox/checkbox.component.html +0 -67
- package/src/lib/components/form/checkbox/checkbox.component.spec.ts +0 -21
- package/src/lib/components/form/checkbox/checkbox.component.ts +0 -65
- package/src/lib/components/form/form.module.ts +0 -34
- package/src/lib/components/form/input/input.component.html +0 -92
- package/src/lib/components/form/input/input.component.scss +0 -29
- package/src/lib/components/form/input/input.component.spec.ts +0 -21
- package/src/lib/components/form/input/input.component.ts +0 -234
- package/src/lib/components/form/password-input/password-input.component.html +0 -65
- package/src/lib/components/form/password-input/password-input.component.scss +0 -9
- package/src/lib/components/form/password-input/password-input.component.spec.ts +0 -21
- package/src/lib/components/form/password-input/password-input.component.ts +0 -171
- package/src/lib/components/form/radio-button/radio-button.component.html +0 -50
- package/src/lib/components/form/radio-button/radio-button.component.scss +0 -14
- package/src/lib/components/form/radio-button/radio-button.component.spec.ts +0 -21
- package/src/lib/components/form/radio-button/radio-button.component.ts +0 -82
- package/src/lib/components/form/range/range.component.html +0 -17
- package/src/lib/components/form/range/range.component.scss +0 -17
- package/src/lib/components/form/range/range.component.spec.ts +0 -21
- package/src/lib/components/form/range/range.component.ts +0 -100
- package/src/lib/components/form/rating/rating.component.html +0 -24
- package/src/lib/components/form/rating/rating.component.spec.ts +0 -21
- package/src/lib/components/form/rating/rating.component.ts +0 -52
- package/src/lib/components/form/select/select.component.html +0 -54
- package/src/lib/components/form/select/select.component.scss +0 -3
- package/src/lib/components/form/select/select.component.spec.ts +0 -22
- package/src/lib/components/form/select/select.component.ts +0 -91
- package/src/lib/components/form/textarea/textarea.component.html +0 -28
- package/src/lib/components/form/textarea/textarea.component.scss +0 -12
- package/src/lib/components/form/textarea/textarea.component.spec.ts +0 -21
- package/src/lib/components/form/textarea/textarea.component.ts +0 -61
- package/src/lib/components/form/transfer/store/transfer.reducers.ts +0 -242
- package/src/lib/components/form/transfer/store/transfer.state.ts +0 -20
- package/src/lib/components/form/transfer/store/transfer.store.ts +0 -88
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.html +0 -42
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.spec.ts +0 -33
- package/src/lib/components/form/transfer/transfer-list/transfer-list.component.ts +0 -93
- package/src/lib/components/form/transfer/transfer.component.html +0 -52
- package/src/lib/components/form/transfer/transfer.component.spec.ts +0 -27
- package/src/lib/components/form/transfer/transfer.component.ts +0 -159
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.html +0 -36
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.spec.ts +0 -21
- package/src/lib/components/form/upload-drag-drop/upload-drag-drop.component.ts +0 -170
- package/src/lib/components/form/upload-file-list/upload-file-list.component.html +0 -46
- package/src/lib/components/form/upload-file-list/upload-file-list.component.spec.ts +0 -22
- package/src/lib/components/form/upload-file-list/upload-file-list.component.ts +0 -120
- package/src/lib/components/navigation/back-button/back-button.component.html +0 -25
- package/src/lib/components/navigation/back-button/back-button.component.spec.ts +0 -91
- package/src/lib/components/navigation/back-button/back-button.component.ts +0 -67
- package/src/lib/components/navigation/back-to-top/back-to-top.component.html +0 -11
- package/src/lib/components/navigation/back-to-top/back-to-top.component.spec.ts +0 -21
- package/src/lib/components/navigation/back-to-top/back-to-top.component.ts +0 -80
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.html +0 -23
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.spec.ts +0 -21
- package/src/lib/components/navigation/breadcrumbs/breadcrumb/breadcrumb.component.ts +0 -68
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.html +0 -3
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.spec.ts +0 -22
- package/src/lib/components/navigation/breadcrumbs/breadcrumb-item/breadcrumb-item.component.ts +0 -29
- package/src/lib/components/navigation/breadcrumbs/breadcrumbs.module.ts +0 -11
- package/src/lib/components/navigation/header/header.component.html +0 -102
- package/src/lib/components/navigation/header/header.component.scss +0 -3
- package/src/lib/components/navigation/header/header.component.spec.ts +0 -21
- package/src/lib/components/navigation/header/header.component.ts +0 -107
- package/src/lib/components/navigation/megamenu/megamenu.component.html +0 -34
- package/src/lib/components/navigation/megamenu/megamenu.component.scss +0 -5
- package/src/lib/components/navigation/megamenu/megamenu.component.ts +0 -30
- package/src/lib/components/navigation/navbar/navbar/navbar.component.html +0 -28
- package/src/lib/components/navigation/navbar/navbar/navbar.component.ts +0 -45
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.html +0 -3
- package/src/lib/components/navigation/navbar/navbar-item/navbar-item.component.ts +0 -10
- package/src/lib/components/navigation/navbar/navbar.module.ts +0 -11
- package/src/lib/components/navigation/navscroll/navscroll-list-item.component.ts +0 -95
- package/src/lib/components/navigation/navscroll/navscroll-list-items.component.ts +0 -27
- package/src/lib/components/navigation/navscroll/navscroll.component.html +0 -101
- package/src/lib/components/navigation/navscroll/navscroll.component.scss +0 -9
- package/src/lib/components/navigation/navscroll/navscroll.component.ts +0 -143
- package/src/lib/components/navigation/navscroll/navscroll.store.ts +0 -96
- package/src/lib/components/navigation/navscroll/navscroll.utils.ts +0 -28
- package/src/lib/components/navigation/sidebar/sidebar.component.html +0 -11
- package/src/lib/components/navigation/sidebar/sidebar.component.spec.ts +0 -21
- package/src/lib/components/navigation/sidebar/sidebar.component.ts +0 -39
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.html +0 -15
- package/src/lib/components/navigation/skiplink/skiplink/skiplink.component.ts +0 -27
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.html +0 -15
- package/src/lib/components/navigation/skiplink/skiplink-item/skiplink-item.component.ts +0 -38
- package/src/lib/components/navigation/skiplink/skiplink.module.ts +0 -11
- package/src/lib/components/utils/error-page/error-page.component.html +0 -33
- package/src/lib/components/utils/error-page/error-page.component.spec.ts +0 -21
- package/src/lib/components/utils/error-page/error-page.component.ts +0 -79
- package/src/lib/components/utils/icon/icon.component.html +0 -6
- package/src/lib/components/utils/icon/icon.component.spec.ts +0 -21
- package/src/lib/components/utils/icon/icon.component.ts +0 -95
- package/src/lib/components/utils/language-switcher/language-switcher.component.html +0 -21
- package/src/lib/components/utils/language-switcher/language-switcher.component.spec.ts +0 -21
- package/src/lib/components/utils/language-switcher/language-switcher.component.ts +0 -56
- package/src/lib/design-angular-kit.module.ts +0 -131
- package/src/lib/enums/colors.enums.ts +0 -10
- package/src/lib/enums/sizes.enum.ts +0 -7
- package/src/lib/interfaces/design-angular-kit-config.ts +0 -34
- package/src/lib/interfaces/form.ts +0 -78
- package/src/lib/interfaces/icon.ts +0 -176
- package/src/lib/interfaces/sortable-table.ts +0 -42
- package/src/lib/interfaces/utils.ts +0 -11
- package/src/lib/pipes/date-ago.pipe.ts +0 -57
- package/src/lib/pipes/duration.pipe.ts +0 -112
- package/src/lib/pipes/mark-matching-text.pipe.ts +0 -43
- package/src/lib/provide-design-angular-kit.ts +0 -73
- package/src/lib/services/notification/notification.service.spec.ts +0 -16
- package/src/lib/services/notification/notification.service.ts +0 -119
- package/src/lib/utils/date-utils.ts +0 -184
- package/src/lib/utils/file-utils.ts +0 -80
- package/src/lib/utils/regex.ts +0 -44
- package/src/lib/validators/it-validators.ts +0 -193
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -24
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.schematics.json +0 -25
- package/tsconfig.spec.json +0 -9
- /package/schematics/ng-add/rules/setup-project/{index.ts → index.d.ts} +0 -0
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
2
|
-
import { ItAbstractComponent } from '../../../abstracts/abstract.component';
|
|
3
|
-
import { Modal } from 'bootstrap-italia';
|
|
4
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
-
import { Modal as BSModal } from 'bootstrap';
|
|
6
|
-
import { inputToBoolean } from '../../../utils/coercion';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Modal windows
|
|
10
|
-
* @description To show featured content, notifications to users, or personalized content.
|
|
11
|
-
*/
|
|
12
|
-
@Component({
|
|
13
|
-
standalone: true,
|
|
14
|
-
selector: 'it-modal',
|
|
15
|
-
templateUrl: './modal.component.html',
|
|
16
|
-
styleUrls: ['./modal.component.scss'],
|
|
17
|
-
exportAs: 'itModal',
|
|
18
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
-
imports: [TranslateModule],
|
|
20
|
-
})
|
|
21
|
-
export class ItModalComponent extends ItAbstractComponent implements AfterViewInit {
|
|
22
|
-
/**
|
|
23
|
-
* Show/Hide close button on header
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
@Input({ transform: inputToBoolean }) closeButton: boolean = true;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* To correctly format the contents of the modal with icon
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
@Input({ transform: inputToBoolean }) alertModal?: boolean;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* To correctly format the contents of the modal with Link List
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
@Input({ transform: inputToBoolean }) dialogLinkList?: boolean;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Modal type Popconfirm can be used for short confirmation messages.
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
@Input({ transform: inputToBoolean }) popconfirm?: boolean;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* You can choose to use a scroll inside the modal, keeping the header and footer of the modal always visible
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
@Input({ transform: inputToBoolean }) scrollable?: boolean;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* To have modals that appear with fades
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
@Input({ transform: inputToBoolean }) fade?: boolean = true;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Modal alignment
|
|
60
|
-
* - <b>centered</b>: to vertically center the modal
|
|
61
|
-
* - <b>left</b>: to left-align the modal
|
|
62
|
-
* - <b>right</b>: to right-align the modal
|
|
63
|
-
* @default undefined
|
|
64
|
-
*/
|
|
65
|
-
@Input() alignment: 'centered' | 'left' | 'right' | undefined;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* The modal size
|
|
69
|
-
* @default undefined
|
|
70
|
-
*/
|
|
71
|
-
@Input() size: 'sm' | 'lg' | 'xl' | undefined;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Includes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn’t close the modal when clicked.
|
|
75
|
-
* @default true
|
|
76
|
-
*/
|
|
77
|
-
@Input() backdrop: 'static' | boolean = true;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Puts the focus on the modal when initialized.
|
|
81
|
-
* @default true
|
|
82
|
-
*/
|
|
83
|
-
@Input({ transform: inputToBoolean }) focus: boolean = true;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Closes the modal when escape key is pressed.
|
|
87
|
-
* @default true
|
|
88
|
-
*/
|
|
89
|
-
@Input({ transform: inputToBoolean }) keyboard: boolean = true;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* To better distinguish the footer element with a shadow
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
@Input({ transform: inputToBoolean }) footerShadow?: boolean;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Modal options
|
|
99
|
-
*/
|
|
100
|
-
@Input() options?: Partial<BSModal.Options>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* This event fires immediately when the instance method show is called.
|
|
104
|
-
*/
|
|
105
|
-
@Output() public showEvent: EventEmitter<Event> = new EventEmitter();
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* This event fires when the modal has been made visible to the user (it will wait for CSS transitions to complete).
|
|
109
|
-
*/
|
|
110
|
-
@Output() public shownEvent: EventEmitter<Event> = new EventEmitter();
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* This event is raised immediately when the instance method hide has been called.
|
|
114
|
-
*/
|
|
115
|
-
@Output() public hideEvent: EventEmitter<Event> = new EventEmitter();
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* This event fires when the modal has finished hiding from the user (it will wait for CSS transitions to complete).
|
|
119
|
-
*/
|
|
120
|
-
@Output() public hiddenEvent: EventEmitter<Event> = new EventEmitter();
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* This event is fired when the modal is displayed, its background is static and a click outside the modal or a press
|
|
124
|
-
* of the esc key occurs and data-bs-keyboard is set to false.
|
|
125
|
-
*/
|
|
126
|
-
@Output() public hidePreventedEvent: EventEmitter<Event> = new EventEmitter();
|
|
127
|
-
|
|
128
|
-
private modal?: Modal;
|
|
129
|
-
|
|
130
|
-
@ViewChild('modalElement', { static: false }) private modalElement?: ElementRef<HTMLDivElement>;
|
|
131
|
-
|
|
132
|
-
override ngAfterViewInit(): void {
|
|
133
|
-
super.ngAfterViewInit();
|
|
134
|
-
this._renderer.removeAttribute(this._elementRef.nativeElement, 'title');
|
|
135
|
-
|
|
136
|
-
if (this.modalElement) {
|
|
137
|
-
const element = this.modalElement.nativeElement;
|
|
138
|
-
this.modal = Modal.getOrCreateInstance(element, {
|
|
139
|
-
...this.options,
|
|
140
|
-
backdrop: this.backdrop === 'static' ? 'static' : this.backdrop,
|
|
141
|
-
focus: this.focus,
|
|
142
|
-
keyboard: this.keyboard,
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
element.addEventListener('show.bs.modal', event => this.showEvent.emit(event));
|
|
146
|
-
element.addEventListener('shown.bs.modal', event => this.shownEvent.emit(event));
|
|
147
|
-
element.addEventListener('hide.bs.modal', event => this.hideEvent.emit(event));
|
|
148
|
-
element.addEventListener('hidden.bs.modal', event => this.hiddenEvent.emit(event));
|
|
149
|
-
element.addEventListener('hidePrevented.bs.modal', event => this.hidePreventedEvent.emit(event));
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
protected get modalClass(): string {
|
|
154
|
-
let modalClass = 'modal';
|
|
155
|
-
if (this.fade) {
|
|
156
|
-
modalClass += ` fade`;
|
|
157
|
-
}
|
|
158
|
-
if (this.alertModal) {
|
|
159
|
-
modalClass += ` alert-modal`;
|
|
160
|
-
}
|
|
161
|
-
if (this.dialogLinkList) {
|
|
162
|
-
modalClass += ` it-dialog-link-list`;
|
|
163
|
-
}
|
|
164
|
-
if (this.popconfirm) {
|
|
165
|
-
modalClass += ` popconfirm-modal`;
|
|
166
|
-
}
|
|
167
|
-
if (this.scrollable) {
|
|
168
|
-
modalClass += ` it-dialog-scrollable`;
|
|
169
|
-
}
|
|
170
|
-
return modalClass;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
protected get dialogClass(): string {
|
|
174
|
-
let dialogClass = 'modal-dialog';
|
|
175
|
-
if (this.alignment) {
|
|
176
|
-
dialogClass += ` modal-dialog-${this.alignment}`;
|
|
177
|
-
}
|
|
178
|
-
if (this.size) {
|
|
179
|
-
dialogClass += ` modal-${this.size}`;
|
|
180
|
-
}
|
|
181
|
-
return dialogClass;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Manually activate/deactivate a modal. Returns to the caller before the modal has actually been shown or hidden
|
|
186
|
-
*/
|
|
187
|
-
public toggle(): void {
|
|
188
|
-
this.modal?.toggle();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Manually open a modal. Returns to the caller before the modal has actually been displayed
|
|
193
|
-
*/
|
|
194
|
-
public show(): void {
|
|
195
|
-
this.modal?.show();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Manually hide a modal. Returns to the caller before the modal has actually been hidden
|
|
200
|
-
*/
|
|
201
|
-
public hide(): void {
|
|
202
|
-
this.modal?.hide();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Manually reposition the modal if the height of the modal changes when it is opened (in case a scroll bar appears).
|
|
207
|
-
*/
|
|
208
|
-
public handleUpdate(): void {
|
|
209
|
-
this.modal?.handleUpdate();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Destroys the modal of an element.
|
|
214
|
-
*/
|
|
215
|
-
public dispose(): void {
|
|
216
|
-
this.modal?.dispose();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@for (notification of notifications; track notification.id) {
|
|
2
|
-
<div
|
|
3
|
-
[id]="notification.id"
|
|
4
|
-
class="notification {{ notification.position }} {{ notification.type }}"
|
|
5
|
-
[class.with-icon]="!!notification.icon"
|
|
6
|
-
[class.dismissable]="notification.dismissible"
|
|
7
|
-
role="alert"
|
|
8
|
-
[attr.aria-labelledby]="notification.id + '-title'">
|
|
9
|
-
<h2 [id]="notification.id + '-title'" class="h5">
|
|
10
|
-
@if (notification.icon) {
|
|
11
|
-
<it-icon [name]="notification.icon"></it-icon>
|
|
12
|
-
}
|
|
13
|
-
<ng-container>{{ notification.title }}</ng-container>
|
|
14
|
-
</h2>
|
|
15
|
-
@if (notification.message) {
|
|
16
|
-
<p>{{ notification.message }}</p>
|
|
17
|
-
}
|
|
18
|
-
@if (notification.dismissible) {
|
|
19
|
-
<button type="button" class="btn notification-close" (click)="hideNotification(notification.id)">
|
|
20
|
-
<it-icon name="close"></it-icon>
|
|
21
|
-
<span class="visually-hidden">{{ 'it.core.close-notification' | translate: { title: notification.title } }}</span>
|
|
22
|
-
</button>
|
|
23
|
-
}
|
|
24
|
-
</div>
|
|
25
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ItNotificationsComponent } from './notifications.component';
|
|
4
|
-
import { tb_base } from '../../../../test';
|
|
5
|
-
|
|
6
|
-
describe('ItNotificationsComponent', () => {
|
|
7
|
-
let component: ItNotificationsComponent;
|
|
8
|
-
let fixture: ComponentFixture<ItNotificationsComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(ItNotificationsComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy } from '@angular/core';
|
|
2
|
-
import { Subscription } from 'rxjs';
|
|
3
|
-
import { ItNotificationService } from '../../../services/notification/notification.service';
|
|
4
|
-
import { Notification, NotificationPosition, NotificationType } from '../../../interfaces/core';
|
|
5
|
-
import { Notification as BSNotification } from 'bootstrap-italia';
|
|
6
|
-
import { IconName } from '../../../interfaces/icon';
|
|
7
|
-
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
8
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
9
|
-
import { inputToBoolean } from '../../../utils/coercion';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
standalone: true,
|
|
13
|
-
selector: 'it-notifications',
|
|
14
|
-
templateUrl: './notifications.component.html',
|
|
15
|
-
styleUrls: ['./notifications.component.scss'],
|
|
16
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
-
imports: [ItIconComponent, TranslateModule],
|
|
18
|
-
})
|
|
19
|
-
export class ItNotificationsComponent implements OnDestroy {
|
|
20
|
-
/**
|
|
21
|
-
* Default notifications duration (milliseconds)
|
|
22
|
-
* @default 8000
|
|
23
|
-
*/
|
|
24
|
-
@Input() duration: number = 8000;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Default notifications position
|
|
28
|
-
*/
|
|
29
|
-
@Input() position: NotificationPosition | undefined;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Default notifications is dismissible
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
@Input({ transform: inputToBoolean }) dismissible: boolean = true;
|
|
36
|
-
|
|
37
|
-
private subscription: Subscription;
|
|
38
|
-
private notificationCount: number = 0;
|
|
39
|
-
protected notifications: Array<Notification & { id: string }> = [];
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
private readonly _changeDetectorRef: ChangeDetectorRef,
|
|
43
|
-
private readonly _notificationService: ItNotificationService
|
|
44
|
-
) {
|
|
45
|
-
this.subscription = this._notificationService.onNotification().subscribe(notification => {
|
|
46
|
-
if (!notification.duration) {
|
|
47
|
-
notification.duration = this.duration; // Add duration if not is set
|
|
48
|
-
}
|
|
49
|
-
if (!notification.position && this.position) {
|
|
50
|
-
notification.position = this.position; // Add position if not is set
|
|
51
|
-
}
|
|
52
|
-
if (notification.dismissible === undefined && this.dismissible) {
|
|
53
|
-
notification.dismissible = true; // Add dismissible if not is set
|
|
54
|
-
}
|
|
55
|
-
if (!notification.icon) {
|
|
56
|
-
notification.icon = this.getNotificationIcon(notification);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const newNotification = {
|
|
60
|
-
...notification,
|
|
61
|
-
id: `${notification.type}-${this.notificationCount++}-notification`,
|
|
62
|
-
};
|
|
63
|
-
this.notifications.push(newNotification);
|
|
64
|
-
this._changeDetectorRef.detectChanges();
|
|
65
|
-
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
// Show the notification
|
|
68
|
-
new BSNotification(document.getElementById(newNotification.id)!, {
|
|
69
|
-
timeout: notification.duration,
|
|
70
|
-
}).show();
|
|
71
|
-
|
|
72
|
-
// Clear notification after the duration
|
|
73
|
-
setTimeout(() => {
|
|
74
|
-
const index = this.notifications.findIndex(n => n.id === newNotification.id);
|
|
75
|
-
if (index > -1) {
|
|
76
|
-
this.notifications.splice(index, 1);
|
|
77
|
-
if (!this.notifications.length) {
|
|
78
|
-
this.notificationCount = 0;
|
|
79
|
-
}
|
|
80
|
-
this._changeDetectorRef.detectChanges();
|
|
81
|
-
}
|
|
82
|
-
}, notification.duration);
|
|
83
|
-
}, 200);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
ngOnDestroy(): void {
|
|
88
|
-
this.subscription.unsubscribe();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
protected get NotificationType(): typeof NotificationType {
|
|
92
|
-
return NotificationType;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Hide the notification
|
|
97
|
-
* @param id
|
|
98
|
-
*/
|
|
99
|
-
protected hideNotification(id: string): void {
|
|
100
|
-
BSNotification.getInstance(document.getElementById(id)!)?.hide();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Retrieve the icon name by notification type
|
|
105
|
-
* @param notification the notification
|
|
106
|
-
* @protected
|
|
107
|
-
*/
|
|
108
|
-
private getNotificationIcon(notification: Notification): IconName | undefined {
|
|
109
|
-
switch (notification.type) {
|
|
110
|
-
case NotificationType.Success:
|
|
111
|
-
return 'check-circle';
|
|
112
|
-
case NotificationType.Error:
|
|
113
|
-
return 'close-circle';
|
|
114
|
-
case NotificationType.Warning:
|
|
115
|
-
return 'error';
|
|
116
|
-
case NotificationType.Info:
|
|
117
|
-
return 'info-circle';
|
|
118
|
-
case NotificationType.Standard:
|
|
119
|
-
default:
|
|
120
|
-
return undefined;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
<nav
|
|
2
|
-
class="pagination-wrapper"
|
|
3
|
-
[class.justify-content-center]="alignment === 'center'"
|
|
4
|
-
[class.justify-content-end]="alignment === 'end'"
|
|
5
|
-
[class.pagination-total]="totalNumberText.hasChildNodes()">
|
|
6
|
-
@if (pages.length) {
|
|
7
|
-
<ul class="pagination">
|
|
8
|
-
<li class="page-item" [class.disabled]="currentPage < 1">
|
|
9
|
-
<a class="page-link" [class.text]="textLinks" href="#" (click)="pageChange($event, currentPage)">
|
|
10
|
-
@if (!textLinks) {
|
|
11
|
-
<it-icon name="chevron-left" color="primary"></it-icon>
|
|
12
|
-
}
|
|
13
|
-
<span class="visually-hidden">
|
|
14
|
-
{{ (textLinks ? 'it.core.page' : 'it.core.previous-page') | translate }}
|
|
15
|
-
</span>
|
|
16
|
-
@if (textLinks) {
|
|
17
|
-
{{ 'it.core.previous' | translate }}
|
|
18
|
-
}
|
|
19
|
-
</a>
|
|
20
|
-
</li>
|
|
21
|
-
@if (simpleMode) {
|
|
22
|
-
<li class="page-item">
|
|
23
|
-
<span class="page-link" aria-current="page">{{ currentPage + 1 }}</span>
|
|
24
|
-
</li>
|
|
25
|
-
<li class="page-item"><span class="page-link">/</span></li>
|
|
26
|
-
<li class="page-item">
|
|
27
|
-
<span class="page-link">{{ pageNumbers }}</span>
|
|
28
|
-
</li>
|
|
29
|
-
<li class="page-item visually-hidden">
|
|
30
|
-
<a class="page-link" href="#" aria-current="page">
|
|
31
|
-
{{ 'it.core.page-of-total' | translate: { page: currentPage + 1, total: pageNumbers } }}
|
|
32
|
-
</a>
|
|
33
|
-
</li>
|
|
34
|
-
} @else {
|
|
35
|
-
@if (pageNumbers > visiblePages && pages[0] >= 2) {
|
|
36
|
-
<li class="page-item">
|
|
37
|
-
<a class="page-link" href="#" (click)="pageChange($event, 1)">1</a>
|
|
38
|
-
</li>
|
|
39
|
-
@if (pages[0] >= 3) {
|
|
40
|
-
<li class="page-item">
|
|
41
|
-
<span class="page-link">...</span>
|
|
42
|
-
</li>
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
@for (page of pages; track page) {
|
|
46
|
-
<li class="page-item">
|
|
47
|
-
@if (page === currentPage + 1) {
|
|
48
|
-
<a class="page-link" aria-current="page">
|
|
49
|
-
<span class="d-inline-block d-sm-none">{{ 'it.core.page' | translate }}</span> {{ page }}
|
|
50
|
-
</a>
|
|
51
|
-
} @else {
|
|
52
|
-
<a class="page-link" href="#" (click)="pageChange($event, page)">{{ page }}</a>
|
|
53
|
-
}
|
|
54
|
-
</li>
|
|
55
|
-
}
|
|
56
|
-
@if (pageNumbers > visiblePages && pages[pages.length - 1] < pageNumbers) {
|
|
57
|
-
@if (pages[pages.length - 1] < pageNumbers - 1) {
|
|
58
|
-
<li class="page-item">
|
|
59
|
-
<span class="page-link">...</span>
|
|
60
|
-
</li>
|
|
61
|
-
}
|
|
62
|
-
<li class="page-item">
|
|
63
|
-
<a class="page-link" href="#" (click)="pageChange($event, pageNumbers)">{{ pageNumbers }}</a>
|
|
64
|
-
</li>
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
<li class="page-item" [class.disabled]="currentPage >= pageNumbers - 1">
|
|
68
|
-
<a class="page-link" [class.text]="textLinks" href="#" (click)="pageChange($event, currentPage + 2)">
|
|
69
|
-
<span class="visually-hidden">
|
|
70
|
-
{{ (textLinks ? 'it.core.page' : 'it.core.next-page') | translate }}
|
|
71
|
-
</span>
|
|
72
|
-
@if (textLinks) {
|
|
73
|
-
{{ 'it.core.next' | translate }}
|
|
74
|
-
} @else {
|
|
75
|
-
<it-icon name="chevron-right" color="primary"></it-icon>
|
|
76
|
-
}
|
|
77
|
-
</a>
|
|
78
|
-
</li>
|
|
79
|
-
</ul>
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@if (currentChanger !== undefined) {
|
|
83
|
-
<it-dropdown>
|
|
84
|
-
<span button>{{ currentChanger }} / {{ 'it.core.page' | translate | lowercase }}</span>
|
|
85
|
-
<ng-container list>
|
|
86
|
-
@for (value of changerValues; track value) {
|
|
87
|
-
<it-dropdown-item href="#" externalLink="true" (click)="changerChange($event, value)">
|
|
88
|
-
{{ value }} / {{ 'it.core.page' | translate | lowercase }}
|
|
89
|
-
</it-dropdown-item>
|
|
90
|
-
}
|
|
91
|
-
</ng-container>
|
|
92
|
-
</it-dropdown>
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@if (showJumpToPage) {
|
|
96
|
-
<it-input
|
|
97
|
-
type="number"
|
|
98
|
-
[min]="1"
|
|
99
|
-
[max]="pageNumbers"
|
|
100
|
-
[label]="('it.core.go-to' | translate) + '...'"
|
|
101
|
-
[formControl]="jumpToPage"></it-input>
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
<p [class.d-none]="!totalNumberText.hasChildNodes()" #totalNumberText>
|
|
105
|
-
<ng-content></ng-content>
|
|
106
|
-
</p>
|
|
107
|
-
</nav>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ItPaginationComponent } from './pagination.component';
|
|
4
|
-
import { tb_base } from '../../../../test';
|
|
5
|
-
|
|
6
|
-
describe('ItPaginationComponent', () => {
|
|
7
|
-
let component: ItPaginationComponent;
|
|
8
|
-
let fixture: ComponentFixture<ItPaginationComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(ItPaginationComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
-
import { debounceTime, distinctUntilChanged, filter } from 'rxjs';
|
|
4
|
-
import { LowerCasePipe } from '@angular/common';
|
|
5
|
-
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
6
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
-
import { ItDropdownModule } from '../dropdown/dropdown.module';
|
|
8
|
-
import { ItInputComponent } from '../../form/input/input.component';
|
|
9
|
-
import { inputToBoolean } from '../../../utils/coercion';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
standalone: true,
|
|
13
|
-
selector: 'it-pagination',
|
|
14
|
-
templateUrl: './pagination.component.html',
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
-
imports: [ItIconComponent, TranslateModule, LowerCasePipe, ItDropdownModule, ItInputComponent, ReactiveFormsModule],
|
|
17
|
-
})
|
|
18
|
-
export class ItPaginationComponent implements OnChanges {
|
|
19
|
-
/**
|
|
20
|
-
* Index of page (start 0)
|
|
21
|
-
*/
|
|
22
|
-
@Input({ required: true }) currentPage!: number;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Max number of page (counter)
|
|
26
|
-
*/
|
|
27
|
-
@Input({ required: true }) pageNumbers!: number;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Number of pages closest to the current one to display
|
|
31
|
-
* @default 5
|
|
32
|
-
*/
|
|
33
|
-
@Input() visiblePages: number = 5;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Pagination alignment (justify-content)
|
|
37
|
-
*/
|
|
38
|
-
@Input() alignment: 'center' | 'end' | undefined;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Enable/Disable simple mode
|
|
42
|
-
* Pagination in the "Simple mode" version is optimized for mobile devices.
|
|
43
|
-
* @default false - disabled
|
|
44
|
-
*/
|
|
45
|
-
@Input({ transform: inputToBoolean }) simpleMode?: boolean;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Enable/Disable text links
|
|
49
|
-
* Chevron icons used as navigation links are replaced by text links such as “previous” and “next”.
|
|
50
|
-
* @default false - disabled
|
|
51
|
-
*/
|
|
52
|
-
@Input({ transform: inputToBoolean }) textLinks?: boolean;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Current value of Changer
|
|
56
|
-
* If is set show the Changer
|
|
57
|
-
* @default undefined - hide the Changer
|
|
58
|
-
*/
|
|
59
|
-
@Input() currentChanger: number | undefined;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Available Changer values
|
|
63
|
-
* @default [10, 25, 50, 100]
|
|
64
|
-
*/
|
|
65
|
-
@Input() changerValues: Array<number> = [10, 25, 50, 100];
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Hide/Show "Jump to page" input
|
|
69
|
-
* @default false - hidden
|
|
70
|
-
*/
|
|
71
|
-
@Input({ transform: inputToBoolean }) showJumpToPage?: boolean;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Fired when page is changed. Emit the new index of page
|
|
75
|
-
*/
|
|
76
|
-
@Output() pageEvent = new EventEmitter<number>();
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Fired when changer is changed. Emit the new changer value
|
|
80
|
-
*/
|
|
81
|
-
@Output() changerEvent = new EventEmitter<number>();
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* The pages
|
|
85
|
-
* @protected
|
|
86
|
-
*/
|
|
87
|
-
protected pages: Array<number> = [];
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Jump to page input
|
|
91
|
-
* @protected
|
|
92
|
-
*/
|
|
93
|
-
protected jumpToPage: FormControl<number | null> = new FormControl<number | null>(null);
|
|
94
|
-
|
|
95
|
-
constructor() {
|
|
96
|
-
this.jumpToPage.valueChanges
|
|
97
|
-
.pipe(
|
|
98
|
-
debounceTime(300), // Delay filter data after time span has passed without another source emission
|
|
99
|
-
distinctUntilChanged(),
|
|
100
|
-
filter(value => !!value && this.jumpToPage.valid)
|
|
101
|
-
)
|
|
102
|
-
.subscribe(value => {
|
|
103
|
-
this.pageEvent.emit(value! - 1);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
108
|
-
this.pages = this.calculatePages();
|
|
109
|
-
if (changes['currentPage']) {
|
|
110
|
-
this.jumpToPage.setValue(null, { emitEvent: false });
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Create array to generate pagination of `visiblePages` element
|
|
116
|
-
*/
|
|
117
|
-
private calculatePages(): Array<number> {
|
|
118
|
-
if (this.simpleMode) {
|
|
119
|
-
return [this.currentPage];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const length = this.pageNumbers > this.visiblePages ? this.visiblePages : this.pageNumbers;
|
|
123
|
-
|
|
124
|
-
const halfVisiblePages = Math.floor(this.visiblePages / 2);
|
|
125
|
-
let start = this.currentPage > halfVisiblePages && this.pageNumbers > this.visiblePages ? this.currentPage - halfVisiblePages + 1 : 1;
|
|
126
|
-
|
|
127
|
-
if (this.pageNumbers > this.visiblePages) {
|
|
128
|
-
if (this.currentPage + 1 >= this.pageNumbers) {
|
|
129
|
-
start -= halfVisiblePages;
|
|
130
|
-
} else if (this.currentPage >= this.pageNumbers - halfVisiblePages) {
|
|
131
|
-
start -= this.pageNumbers - (this.currentPage + 1);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return Array.from({ length }, (_, i) => i + start);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* On click page change
|
|
140
|
-
* @param event click event
|
|
141
|
-
* @param newPage the new page of table
|
|
142
|
-
*/
|
|
143
|
-
protected pageChange(event: Event, newPage: number): void {
|
|
144
|
-
event.preventDefault();
|
|
145
|
-
this.pageEvent.emit(newPage - 1); // emit new page index
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* On click changer
|
|
150
|
-
* @param event click event
|
|
151
|
-
* @param value the new changer value
|
|
152
|
-
*/
|
|
153
|
-
protected changerChange(event: Event, value: number): void {
|
|
154
|
-
event.preventDefault();
|
|
155
|
-
this.changerEvent.emit(value); // emit new changer value
|
|
156
|
-
}
|
|
157
|
-
}
|