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,141 @@
|
|
|
1
|
+
import { AfterViewInit, Directive, ElementRef, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
|
|
2
|
+
import { ElementPlacement } from '../../../interfaces/core';
|
|
3
|
+
import { Tooltip } from 'bootstrap-italia';
|
|
4
|
+
import { inputToBoolean } from '../../../utils/coercion';
|
|
5
|
+
|
|
6
|
+
@Directive({
|
|
7
|
+
standalone: true,
|
|
8
|
+
selector: '[itTooltip]',
|
|
9
|
+
exportAs: 'itTooltip',
|
|
10
|
+
})
|
|
11
|
+
export class ItTooltipDirective implements AfterViewInit, OnDestroy {
|
|
12
|
+
/**
|
|
13
|
+
* Define the tooltip title
|
|
14
|
+
* @param title the tooltip title
|
|
15
|
+
*/
|
|
16
|
+
@Input('itTooltip') set title(title: string | undefined) {
|
|
17
|
+
if (title) {
|
|
18
|
+
// this.element.setAttribute("title", title);
|
|
19
|
+
this.element.setAttribute('data-bs-original-title', title);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Define the tooltip placement
|
|
25
|
+
* @param placement
|
|
26
|
+
*/
|
|
27
|
+
@Input() set tooltipPlacement(placement: ElementPlacement) {
|
|
28
|
+
this.element.setAttribute('data-bs-placement', placement);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether the title contains html
|
|
33
|
+
* @param html true if contain html
|
|
34
|
+
*/
|
|
35
|
+
@Input({ transform: inputToBoolean }) set tooltipHtml(html: boolean) {
|
|
36
|
+
this.element.setAttribute('data-bs-html', html ? 'true' : 'false');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This event fires immediately when the show method is called.
|
|
41
|
+
*/
|
|
42
|
+
@Output() showEvent: EventEmitter<Event> = new EventEmitter();
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This event is triggered when the tooltip has been made visible to the user (it will wait for the CSS transitions to complete).
|
|
46
|
+
*/
|
|
47
|
+
@Output() shownEvent: EventEmitter<Event> = new EventEmitter();
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* This event fires immediately when the hide method is called.
|
|
51
|
+
*/
|
|
52
|
+
@Output() hideEvent: EventEmitter<Event> = new EventEmitter();
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* This event is raised when the tooltip has finished being hidden from the user (it will wait for the CSS transitions to complete).
|
|
56
|
+
*/
|
|
57
|
+
@Output() hiddenEvent: EventEmitter<Event> = new EventEmitter();
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* This event fires after the show event when the tooltip template has been added to the DOM.
|
|
61
|
+
*/
|
|
62
|
+
@Output() insertedEvent: EventEmitter<Event> = new EventEmitter();
|
|
63
|
+
|
|
64
|
+
private readonly element: HTMLElement;
|
|
65
|
+
private tooltip?: Tooltip;
|
|
66
|
+
|
|
67
|
+
constructor(private readonly _elementRef: ElementRef) {
|
|
68
|
+
this.element = this._elementRef.nativeElement;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ngAfterViewInit(): void {
|
|
72
|
+
this.element.setAttribute('data-bs-toggle', 'tooltip');
|
|
73
|
+
this.tooltip = Tooltip.getOrCreateInstance(this.element);
|
|
74
|
+
|
|
75
|
+
this.element.addEventListener('show.bs.tooltip', event => this.showEvent.emit(event));
|
|
76
|
+
this.element.addEventListener('shown.bs.tooltip', event => this.shownEvent.emit(event));
|
|
77
|
+
this.element.addEventListener('hide.bs.tooltip', event => this.hideEvent.emit(event));
|
|
78
|
+
this.element.addEventListener('hidden.bs.tooltip', event => this.hiddenEvent.emit(event));
|
|
79
|
+
this.element.addEventListener('inserted.bs.tooltip', event => this.insertedEvent.emit(event));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ngOnDestroy(): void {
|
|
83
|
+
this.dispose();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Shows the tooltip of an item.
|
|
88
|
+
*/
|
|
89
|
+
public show(): void {
|
|
90
|
+
this.tooltip?.show();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Hide the tooltip of an element.
|
|
95
|
+
*/
|
|
96
|
+
public hide(): void {
|
|
97
|
+
this.tooltip?.hide();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Activate / Deactivate the tooltip of an element
|
|
102
|
+
*/
|
|
103
|
+
public toggle(): void {
|
|
104
|
+
this.tooltip?.toggle();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Hides and destroys the tooltip of an element.
|
|
109
|
+
*/
|
|
110
|
+
public dispose(): void {
|
|
111
|
+
this.tooltip?.dispose();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Gives the tooltip of an element a chance to be shown.
|
|
116
|
+
*/
|
|
117
|
+
public enable(): void {
|
|
118
|
+
this.tooltip?.enable();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Removes the ability to show the tooltip of an element.
|
|
123
|
+
*/
|
|
124
|
+
public disable(): void {
|
|
125
|
+
this.tooltip?.disable();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Toggles the possibility that the tooltip of an element is shown or hidden.
|
|
130
|
+
*/
|
|
131
|
+
public toggleEnabled(): void {
|
|
132
|
+
this.tooltip?.disable();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Updates the position of an element's tooltip.
|
|
137
|
+
*/
|
|
138
|
+
public update(): void {
|
|
139
|
+
this.tooltip?.disable();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<div class="form-group" [class.autocomplete-wrapper-big]="big">
|
|
2
|
+
@if (label) {
|
|
3
|
+
<label [for]="id" [class.visually-hidden]="!isActiveLabel" [class.active]="isActiveLabel">
|
|
4
|
+
{{ label }}
|
|
5
|
+
</label>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
<input
|
|
9
|
+
[id]="id"
|
|
10
|
+
type="search"
|
|
11
|
+
class="autocomplete form-control"
|
|
12
|
+
[placeholder]="placeholder"
|
|
13
|
+
[formControl]="control"
|
|
14
|
+
[class.is-invalid]="isInvalid"
|
|
15
|
+
[class.is-valid]="isValid"
|
|
16
|
+
(blur)="markAsTouched()"
|
|
17
|
+
(keydown)="onKeyDown()" />
|
|
18
|
+
|
|
19
|
+
<span class="autocomplete-icon" aria-hidden="true">
|
|
20
|
+
<it-icon [labelWaria]="labelWaria" name="search" size="sm"></it-icon>
|
|
21
|
+
</span>
|
|
22
|
+
|
|
23
|
+
@if (autocompleteResults$ | async; as autocomplete) {
|
|
24
|
+
<ul class="autocomplete-list" [class.autocomplete-list-show]="autocomplete.relatedEntries?.length && showAutocompletion">
|
|
25
|
+
@for (entry of autocomplete.relatedEntries; track autocompleteItemTrackByValueFn($index, entry)) {
|
|
26
|
+
<li>
|
|
27
|
+
<a [href]="entry.link" (click)="onEntryClick(entry, $event)">
|
|
28
|
+
@if (entry.avatarSrcPath) {
|
|
29
|
+
<div class="avatar size-sm">
|
|
30
|
+
<img [src]="entry.avatarSrcPath" [alt]="entry.avatarAltText" />
|
|
31
|
+
</div>
|
|
32
|
+
}
|
|
33
|
+
@if (entry.icon) {
|
|
34
|
+
<it-icon [name]="entry.icon" size="sm"></it-icon>
|
|
35
|
+
}
|
|
36
|
+
<span class="autocomplete-list-text">
|
|
37
|
+
<span [innerHTML]="entry.value | itMarkMatchingText: autocomplete.searchedValue"></span>
|
|
38
|
+
@if (entry.label) {
|
|
39
|
+
<em>{{ entry.label }}</em>
|
|
40
|
+
}
|
|
41
|
+
</span>
|
|
42
|
+
</a>
|
|
43
|
+
</li>
|
|
44
|
+
}
|
|
45
|
+
</ul>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@if (isInvalid) {
|
|
49
|
+
<div class="form-feedback just-validate-error-label" [id]="id + '-error'">
|
|
50
|
+
<div #customError>
|
|
51
|
+
<ng-content select="[error]"></ng-content>
|
|
52
|
+
</div>
|
|
53
|
+
@if (!customError.hasChildNodes()) {
|
|
54
|
+
{{ invalidMessage | async }}
|
|
55
|
+
}
|
|
56
|
+
</div>
|
|
57
|
+
}
|
|
58
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItAutocompleteComponent } from './autocomplete.component';
|
|
4
|
+
import { tb_base } from '../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('AutocompleteComponent', () => {
|
|
7
|
+
let component: ItAutocompleteComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItAutocompleteComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItAutocompleteComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { debounceTime, distinctUntilChanged, map, Observable, of, switchMap } from 'rxjs';
|
|
3
|
+
import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
6
|
+
import { ItMarkMatchingTextPipe } from '../../../pipes/mark-matching-text.pipe';
|
|
7
|
+
import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
|
|
8
|
+
import { AutocompleteItem } from '../../../interfaces/form';
|
|
9
|
+
import { inputToBoolean } from '../../../utils/coercion';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
standalone: true,
|
|
13
|
+
selector: 'it-autocomplete',
|
|
14
|
+
templateUrl: './autocomplete.component.html',
|
|
15
|
+
imports: [AsyncPipe, ItIconComponent, ItMarkMatchingTextPipe, NgTemplateOutlet, ReactiveFormsModule],
|
|
16
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
+
})
|
|
18
|
+
export class ItAutocompleteComponent extends ItAbstractFormComponent<string | null | undefined> implements OnInit {
|
|
19
|
+
/**
|
|
20
|
+
* Indicates the list of searchable elements on which to base the input autocomplete system
|
|
21
|
+
* If you need to retrieve items via API, can pass a function of Observable
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
@Input({ required: true }) autocompleteData!: Array<AutocompleteItem> | ((search?: string | null) => Observable<Array<AutocompleteItem>>);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* To get a large version of Autocomplete
|
|
28
|
+
*/
|
|
29
|
+
@Input({ transform: inputToBoolean }) big?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Time span [ms] has passed without another source emission, to delay data filtering.
|
|
33
|
+
* Useful when the user is typing multiple letters
|
|
34
|
+
* @default 300 [ms]
|
|
35
|
+
*/
|
|
36
|
+
@Input() debounceTime = 300;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The input placeholder
|
|
40
|
+
*/
|
|
41
|
+
@Input() placeholder = '';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The input label even get labelWaria icon
|
|
45
|
+
*/
|
|
46
|
+
@Input() labelWaria: string | undefined = undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Show the label
|
|
50
|
+
*/
|
|
51
|
+
@Input({ transform: inputToBoolean }) forceShowLabel: boolean = true;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Fired when the Autocomplete Item has been selected
|
|
55
|
+
*/
|
|
56
|
+
@Output() autocompleteSelectedEvent: EventEmitter<AutocompleteItem> = new EventEmitter();
|
|
57
|
+
|
|
58
|
+
protected showAutocompletion = false;
|
|
59
|
+
|
|
60
|
+
/** Observable da cui vengono emessi i risultati dell'auto completamento */
|
|
61
|
+
protected autocompleteResults$: Observable<{
|
|
62
|
+
searchedValue: string | undefined | null;
|
|
63
|
+
relatedEntries: Array<AutocompleteItem>;
|
|
64
|
+
}> = new Observable();
|
|
65
|
+
|
|
66
|
+
override ngOnInit() {
|
|
67
|
+
super.ngOnInit();
|
|
68
|
+
this.autocompleteResults$ = this.getAutocompleteResults$();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Create the autocomplete list
|
|
73
|
+
*/
|
|
74
|
+
private getAutocompleteResults$(): Observable<{
|
|
75
|
+
searchedValue: string | null | undefined;
|
|
76
|
+
relatedEntries: Array<AutocompleteItem>;
|
|
77
|
+
}> {
|
|
78
|
+
return this.control.valueChanges.pipe(
|
|
79
|
+
debounceTime(this.debounceTime), // Delay filter data after time span has passed without another source emission, useful when the user is typing multiple letters
|
|
80
|
+
distinctUntilChanged(), // Only if searchValue is distinct in comparison to the last value
|
|
81
|
+
switchMap(searchedValue => {
|
|
82
|
+
if (!this.autocompleteData) {
|
|
83
|
+
return of({
|
|
84
|
+
searchedValue,
|
|
85
|
+
relatedEntries: <Array<AutocompleteItem>>[],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const autoCompleteData$ = Array.isArray(this.autocompleteData) ? of(this.autocompleteData) : this.autocompleteData(searchedValue);
|
|
90
|
+
return autoCompleteData$.pipe(
|
|
91
|
+
map(autocompleteData => {
|
|
92
|
+
if (!searchedValue || typeof searchedValue === 'number') {
|
|
93
|
+
return { searchedValue, relatedEntries: [] };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const lowercaseValue = searchedValue.toLowerCase();
|
|
97
|
+
const relatedEntries = autocompleteData.filter(item => item.value?.toLowerCase().includes(lowercaseValue));
|
|
98
|
+
|
|
99
|
+
return { searchedValue, relatedEntries };
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
protected onEntryClick(entry: AutocompleteItem, event: Event) {
|
|
107
|
+
// Se non è stato definito un link associato all'elemento dell'autocomplete, probabilmente il desiderata
|
|
108
|
+
// non è effettuare la navigazione al default '#', pertanto in tal caso meglio annullare la navigazione.
|
|
109
|
+
if (!entry.link) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
this.autocompleteSelectedEvent.next(entry);
|
|
114
|
+
this.control.setValue(entry.value);
|
|
115
|
+
this.showAutocompletion = false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
protected autocompleteItemTrackByValueFn(index: number, item: AutocompleteItem) {
|
|
119
|
+
return item.value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
protected onKeyDown() {
|
|
123
|
+
this.showAutocompletion = true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
protected get isActiveLabel(): boolean {
|
|
127
|
+
const value = this.control.value;
|
|
128
|
+
return this.forceShowLabel && (!!value || !!this.placeholder);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<ng-container>
|
|
2
|
+
<div class="form-check" [class.form-check-group]="group" [class.form-check-inline]="inline">
|
|
3
|
+
@if (toggle) {
|
|
4
|
+
<div class="toggles">
|
|
5
|
+
<label [for]="id">
|
|
6
|
+
<ng-container *ngTemplateOutlet="htmlLabel"></ng-container>
|
|
7
|
+
<input
|
|
8
|
+
[id]="id"
|
|
9
|
+
type="checkbox"
|
|
10
|
+
[formControl]="control"
|
|
11
|
+
[attr.aria-describedby]="id + '-help'"
|
|
12
|
+
(click)="$event.stopPropagation()" />
|
|
13
|
+
<span class="lever"></span>
|
|
14
|
+
</label>
|
|
15
|
+
</div>
|
|
16
|
+
} @else {
|
|
17
|
+
<input
|
|
18
|
+
[id]="id"
|
|
19
|
+
type="checkbox"
|
|
20
|
+
[class.is-invalid]="isInvalid"
|
|
21
|
+
[class.is-valid]="isValid"
|
|
22
|
+
[class.semi-checked]="indeterminate"
|
|
23
|
+
[formControl]="control"
|
|
24
|
+
[attr.aria-describedby]="id + '-help'"
|
|
25
|
+
(click)="$event.stopPropagation()" />
|
|
26
|
+
<label class="form-check-label" [for]="id">
|
|
27
|
+
<ng-container *ngTemplateOutlet="htmlLabel"></ng-container>
|
|
28
|
+
</label>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@if (group) {
|
|
32
|
+
<small [id]="id + '-help'" class="form-text">
|
|
33
|
+
<ng-content></ng-content>
|
|
34
|
+
</small>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@if (isInvalid && group) {
|
|
38
|
+
<div class="form-feedback just-validate-error-label" [id]="id + '-error'">
|
|
39
|
+
<ng-container *ngTemplateOutlet="error"></ng-container>
|
|
40
|
+
</div>
|
|
41
|
+
}
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
@if (isInvalid && !group) {
|
|
45
|
+
<div class="form-feedback just-validate-error-label" [id]="id + '-error'">
|
|
46
|
+
<ng-container *ngTemplateOutlet="error"></ng-container>
|
|
47
|
+
</div>
|
|
48
|
+
}
|
|
49
|
+
</ng-container>
|
|
50
|
+
|
|
51
|
+
<ng-template #error>
|
|
52
|
+
<div #customError>
|
|
53
|
+
<ng-content select="[error]"></ng-content>
|
|
54
|
+
</div>
|
|
55
|
+
@if (!customError.hasChildNodes()) {
|
|
56
|
+
{{ invalidMessage | async }}
|
|
57
|
+
}
|
|
58
|
+
</ng-template>
|
|
59
|
+
|
|
60
|
+
<ng-template #htmlLabel>
|
|
61
|
+
<div #customLabel>
|
|
62
|
+
<ng-content select="[label]"></ng-content>
|
|
63
|
+
</div>
|
|
64
|
+
@if (!customLabel.hasChildNodes()) {
|
|
65
|
+
{{ label }}
|
|
66
|
+
}
|
|
67
|
+
</ng-template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItCheckboxComponent } from './checkbox.component';
|
|
4
|
+
import { tb_base } from '../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItCheckboxComponent', () => {
|
|
7
|
+
let component: ItCheckboxComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItCheckboxComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItCheckboxComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
|
|
3
|
+
import { AsyncPipe, NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { inputToBoolean } from '../../../utils/coercion';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
standalone: true,
|
|
9
|
+
selector: 'it-checkbox',
|
|
10
|
+
templateUrl: './checkbox.component.html',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
imports: [NgTemplateOutlet, ReactiveFormsModule, AsyncPipe],
|
|
13
|
+
})
|
|
14
|
+
export class ItCheckboxComponent extends ItAbstractFormComponent<boolean | null | undefined> implements OnInit, OnChanges {
|
|
15
|
+
/**
|
|
16
|
+
* If show checkbox as toggle
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
@Input({ transform: inputToBoolean }) toggle?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* If show checkbox inline
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
@Input({ transform: inputToBoolean }) inline?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* If is checkbox group
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
@Input({ transform: inputToBoolean }) group?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* If checkbox is checked
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
@Input({ transform: inputToBoolean }) checked?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* If checkbox is indeterminate
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
@Input({ transform: inputToBoolean }) indeterminate?: boolean;
|
|
44
|
+
|
|
45
|
+
override ngOnInit() {
|
|
46
|
+
super.ngOnInit();
|
|
47
|
+
this.markAsChecked();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override ngOnChanges(changes: SimpleChanges) {
|
|
51
|
+
if (changes['checked']) {
|
|
52
|
+
this.markAsChecked();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private markAsChecked(): void {
|
|
57
|
+
if (this.control.value || this.checked === undefined) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const value = this.checked;
|
|
62
|
+
this.writeValue(value);
|
|
63
|
+
return this.onChange(value);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { ItCheckboxComponent } from './checkbox/checkbox.component';
|
|
3
|
+
import { ItInputComponent } from './input/input.component';
|
|
4
|
+
import { ItPasswordInputComponent } from './password-input/password-input.component';
|
|
5
|
+
import { ItRadioButtonComponent } from './radio-button/radio-button.component';
|
|
6
|
+
import { ItRangeComponent } from './range/range.component';
|
|
7
|
+
import { ItRatingComponent } from './rating/rating.component';
|
|
8
|
+
import { ItSelectComponent } from './select/select.component';
|
|
9
|
+
import { ItTextareaComponent } from './textarea/textarea.component';
|
|
10
|
+
import { ItUploadDragDropComponent } from './upload-drag-drop/upload-drag-drop.component';
|
|
11
|
+
import { ItUploadFileListComponent } from './upload-file-list/upload-file-list.component';
|
|
12
|
+
import { ItAutocompleteComponent } from './autocomplete/autocomplete.component';
|
|
13
|
+
import { ItTransferComponent } from './transfer/transfer.component';
|
|
14
|
+
|
|
15
|
+
const formComponents = [
|
|
16
|
+
ItAutocompleteComponent,
|
|
17
|
+
ItCheckboxComponent,
|
|
18
|
+
ItInputComponent,
|
|
19
|
+
ItPasswordInputComponent,
|
|
20
|
+
ItRadioButtonComponent,
|
|
21
|
+
ItRangeComponent,
|
|
22
|
+
ItRatingComponent,
|
|
23
|
+
ItSelectComponent,
|
|
24
|
+
ItTextareaComponent,
|
|
25
|
+
ItTransferComponent,
|
|
26
|
+
ItUploadDragDropComponent,
|
|
27
|
+
ItUploadFileListComponent,
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
@NgModule({
|
|
31
|
+
imports: formComponents,
|
|
32
|
+
exports: formComponents,
|
|
33
|
+
})
|
|
34
|
+
export class ItFormModule {}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<div class="form-group">
|
|
2
|
+
<div
|
|
3
|
+
class="input-group"
|
|
4
|
+
[class.disabled]="!control.enabled"
|
|
5
|
+
[class.input-number]="type === 'number'"
|
|
6
|
+
[class.input-number-currency]="currency"
|
|
7
|
+
[class.input-number-percentage]="percentage"
|
|
8
|
+
[class.input-number-adaptive]="adaptive">
|
|
9
|
+
<span class="input-group-text" #prependText>
|
|
10
|
+
<ng-content select="[prependText]"></ng-content>
|
|
11
|
+
</span>
|
|
12
|
+
@if (label) {
|
|
13
|
+
<label
|
|
14
|
+
[for]="id"
|
|
15
|
+
[class.active]="isActiveLabel"
|
|
16
|
+
[class.input-symbol-label]="percentage || currency"
|
|
17
|
+
[class.input-number-label]="type === 'number'"
|
|
18
|
+
[class.empty-prepend-label]="!(percentage || currency) && !prependText.clientWidth">
|
|
19
|
+
{{ label }}
|
|
20
|
+
</label>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@if (type === 'number') {
|
|
24
|
+
@if (currency || percentage) {
|
|
25
|
+
<span class="input-group-text fw-semibold">{{ symbol }}</span>
|
|
26
|
+
}
|
|
27
|
+
<input
|
|
28
|
+
type="number"
|
|
29
|
+
[id]="id"
|
|
30
|
+
[step]="step ?? null"
|
|
31
|
+
[min]="min ?? ''"
|
|
32
|
+
[max]="max ?? ''"
|
|
33
|
+
[class.form-control]="readonly !== 'plaintext'"
|
|
34
|
+
[class.form-control-plaintext]="readonly === 'plaintext'"
|
|
35
|
+
[class.is-invalid]="isInvalid"
|
|
36
|
+
[class.just-validate-success-field]="isValid"
|
|
37
|
+
[formControl]="control"
|
|
38
|
+
[placeholder]="placeholder"
|
|
39
|
+
[readonly]="isReadonly"
|
|
40
|
+
[autocomplete]="autocomplete"
|
|
41
|
+
[attr.aria-describedby]="id + '-description'"
|
|
42
|
+
(blur)="markAsTouched()" />
|
|
43
|
+
<span class="input-group-text align-buttons flex-column">
|
|
44
|
+
<button type="button" class="input-number-add" [disabled]="!control.enabled" (click)="incrementNumber()">
|
|
45
|
+
<span class="visually-hidden">{{ 'it.form.increase-value' | translate }}</span>
|
|
46
|
+
</button>
|
|
47
|
+
<button type="button" class="input-number-sub" [disabled]="!control.enabled" (click)="incrementNumber(true)">
|
|
48
|
+
<span class="visually-hidden">{{ 'it.form.decrease-value' | translate }}</span>
|
|
49
|
+
</button>
|
|
50
|
+
</span>
|
|
51
|
+
} @else {
|
|
52
|
+
<input
|
|
53
|
+
[id]="id"
|
|
54
|
+
[type]="type"
|
|
55
|
+
[max]="type === 'date' ? maxDate : undefined"
|
|
56
|
+
[min]="type === 'date' ? minDate : undefined"
|
|
57
|
+
[class.form-control]="readonly !== 'plaintext'"
|
|
58
|
+
[class.form-control-plaintext]="readonly === 'plaintext'"
|
|
59
|
+
[class.is-invalid]="isInvalid"
|
|
60
|
+
[class.just-validate-success-field]="isValid"
|
|
61
|
+
[formControl]="control"
|
|
62
|
+
[placeholder]="placeholder"
|
|
63
|
+
[readonly]="isReadonly"
|
|
64
|
+
[autocomplete]="autocomplete"
|
|
65
|
+
[attr.aria-describedby]="id + '-description'"
|
|
66
|
+
(blur)="markAsTouched()" />
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
<div class="input-group-append">
|
|
70
|
+
<ng-content select="[append]"></ng-content>
|
|
71
|
+
|
|
72
|
+
<div class="input-group-text">
|
|
73
|
+
<ng-content select="[appendText]"></ng-content>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
@if (description) {
|
|
79
|
+
<small [id]="id + '-description'" class="form-text">{{ description }}</small>
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@if (isInvalid) {
|
|
83
|
+
<div class="form-feedback just-validate-error-label" [id]="id + '-error'">
|
|
84
|
+
<div #customError>
|
|
85
|
+
<ng-content select="[error]"></ng-content>
|
|
86
|
+
</div>
|
|
87
|
+
@if (!customError.hasChildNodes()) {
|
|
88
|
+
{{ invalidMessage | async }}
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.form-group {
|
|
2
|
+
label {
|
|
3
|
+
z-index: 1000;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
input:focus:not(.focus--mouse) {
|
|
7
|
+
box-shadow: inherit !important;
|
|
8
|
+
border-color: inherit !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.input-number {
|
|
12
|
+
.align-buttons {
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.input-group-text:empty {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
label.empty-prepend-label {
|
|
22
|
+
left: auto !important;
|
|
23
|
+
max-width: 100% !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
label:not(.active):has(+ input:-webkit-autofill) {
|
|
27
|
+
transform: translateY(-75%);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ItInputComponent } from './input.component';
|
|
4
|
+
import { tb_base } from '../../../../test';
|
|
5
|
+
|
|
6
|
+
describe('ItInputComponent', () => {
|
|
7
|
+
let component: ItInputComponent;
|
|
8
|
+
let fixture: ComponentFixture<ItInputComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
+
|
|
13
|
+
fixture = TestBed.createComponent(ItInputComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|