design-angular-kit 1.2.1 → 1.2.2
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/esm2022/design-angular-kit.mjs +5 -0
- package/esm2022/lib/abstracts/abstract-form.component.mjs +186 -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 +84 -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/form/autocomplete/autocomplete.component.mjs +112 -0
- package/esm2022/lib/components/form/checkbox/checkbox.component.mjs +48 -0
- package/esm2022/lib/components/form/form.module.mjs +63 -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/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 +98 -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 +233 -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 +156 -0
- package/esm2022/public_api.mjs +110 -0
- package/fesm2022/design-angular-kit.mjs +6731 -0
- package/fesm2022/design-angular-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/abstracts/abstract-form.component.d.ts +87 -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/form/autocomplete/autocomplete.component.d.ts +59 -0
- package/lib/components/form/checkbox/checkbox.component.d.ts +41 -0
- package/lib/components/form/form.module.d.ts +18 -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/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 +53 -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 +69 -0
- package/package.json +14 -9
- package/{src/public_api.ts → public_api.d.ts} +0 -43
- 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,93 +0,0 @@
|
|
|
1
|
-
import { AsyncPipe, TitleCasePipe } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, ElementRef, HostAttributeToken, inject, ViewChild } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { combineLatest, distinctUntilChanged, map, shareReplay, skip, startWith, tap } from 'rxjs';
|
|
5
|
-
import { ItAbstractComponent } from '../../../../abstracts/abstract.component';
|
|
6
|
-
import { TransferStore } from '../store/transfer.store';
|
|
7
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
8
|
-
import { SourceType, TransferItem } from '../transfer.model';
|
|
9
|
-
|
|
10
|
-
interface SelectableTransferItem<T> extends TransferItem<T> {
|
|
11
|
-
selected: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@Component({
|
|
15
|
-
selector: 'it-transfer-list',
|
|
16
|
-
standalone: true,
|
|
17
|
-
imports: [TranslateModule, AsyncPipe, TitleCasePipe],
|
|
18
|
-
templateUrl: './transfer-list.component.html',
|
|
19
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
-
})
|
|
21
|
-
export class ItTransferListComponent<T> extends ItAbstractComponent {
|
|
22
|
-
/**
|
|
23
|
-
* Widget title
|
|
24
|
-
*/
|
|
25
|
-
readonly title = inject(new HostAttributeToken('title'), { optional: true });
|
|
26
|
-
|
|
27
|
-
readonly sourceType = inject(new HostAttributeToken('sourceType'), { optional: true }) as SourceType;
|
|
28
|
-
|
|
29
|
-
private readonly items = this.store.selectItems(this.sourceType).pipe(distinctUntilChanged(), shareReplay());
|
|
30
|
-
private readonly selected = this.store.selectSelectedItems(this.sourceType).pipe(distinctUntilChanged(), shareReplay());
|
|
31
|
-
|
|
32
|
-
readonly numberOfItems$ = this.items.pipe(
|
|
33
|
-
map(items => ({ length: items.length })),
|
|
34
|
-
startWith({ length: 0 })
|
|
35
|
-
);
|
|
36
|
-
readonly selectAllDisabled = this.items.pipe(map(items => items.length === 0));
|
|
37
|
-
/**
|
|
38
|
-
* Items of the list
|
|
39
|
-
* @default []
|
|
40
|
-
*/
|
|
41
|
-
readonly items$ = combineLatest([this.items, this.selected]).pipe(
|
|
42
|
-
map(([items, selected]) =>
|
|
43
|
-
items.map(item => {
|
|
44
|
-
(item as SelectableTransferItem<T>).selected = selected.has(item);
|
|
45
|
-
return item as SelectableTransferItem<T>;
|
|
46
|
-
})
|
|
47
|
-
)
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
@ViewChild('selectAllCheckbox')
|
|
51
|
-
selectAllCheckboxRef!: ElementRef<HTMLInputElement>;
|
|
52
|
-
|
|
53
|
-
readonly instanceId = this.getInstanceId();
|
|
54
|
-
|
|
55
|
-
constructor(private readonly store: TransferStore<T>) {
|
|
56
|
-
super();
|
|
57
|
-
this.onItemsUpdate();
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Checkbox selection click handler
|
|
61
|
-
*/
|
|
62
|
-
checkboxSelectionHandler(item: TransferItem<T>) {
|
|
63
|
-
this.store.checkboxSelection(item, this.sourceType);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Checkbox select all selection handler
|
|
67
|
-
*/
|
|
68
|
-
checkboxSelectAllHandler(event: Event) {
|
|
69
|
-
const checked = ((event as PointerEvent).target as HTMLInputElement).checked;
|
|
70
|
-
this.store.selectAllSelection(checked, this.sourceType);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Items update subscription
|
|
75
|
-
*/
|
|
76
|
-
private onItemsUpdate() {
|
|
77
|
-
this.items
|
|
78
|
-
.pipe(
|
|
79
|
-
takeUntilDestroyed(),
|
|
80
|
-
skip(1),
|
|
81
|
-
tap(() => {
|
|
82
|
-
if (this.selectAllCheckboxRef) {
|
|
83
|
-
this.selectAllCheckboxRef.nativeElement.checked = false;
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
)
|
|
87
|
-
.subscribe();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
private getInstanceId() {
|
|
91
|
-
return Math.floor(Math.random() * 100000000).toString();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
@if (label) {
|
|
3
|
-
<label [for]="id" [class.active]="!!control.value">{{ label }}</label>
|
|
4
|
-
}
|
|
5
|
-
<div class="row">
|
|
6
|
-
<div class="col-xs-12 col-md-5">
|
|
7
|
-
<it-transfer-list sourceType="source" [title]="'it.transfer.source' | translate"></it-transfer-list>
|
|
8
|
-
</div>
|
|
9
|
-
<!-- col -->
|
|
10
|
-
<div class="col-xs-12 col-md-2">
|
|
11
|
-
<!-- transfer buttons-->
|
|
12
|
-
<div class="it-transfer-buttons">
|
|
13
|
-
<a
|
|
14
|
-
class="transfer"
|
|
15
|
-
role="button"
|
|
16
|
-
href="#"
|
|
17
|
-
[ngClass]="{ active: transferEnabled | async }"
|
|
18
|
-
(click)="transferClickHandler($event)"
|
|
19
|
-
(keypress)="transferKeyPressHandler($event)"
|
|
20
|
-
[attr.aria-label]="'it.transfer.aria-label-move-forward' | translate">
|
|
21
|
-
<it-icon name="arrow-right"></it-icon>
|
|
22
|
-
</a>
|
|
23
|
-
<span class="visually-hidden">{{ 'it.transfer.label-move-forward' | translate }}</span>
|
|
24
|
-
<a
|
|
25
|
-
class="backtransfer"
|
|
26
|
-
role="button"
|
|
27
|
-
href="#"
|
|
28
|
-
[ngClass]="{ active: backtransferEnabled | async }"
|
|
29
|
-
(click)="backtransferClickHandler($event)"
|
|
30
|
-
(keypress)="backtransferKeyPressHandler($event)"
|
|
31
|
-
[attr.aria-label]="'it.transfer.aria-label-move-backward' | translate">
|
|
32
|
-
<it-icon name="arrow-left"></it-icon>
|
|
33
|
-
</a>
|
|
34
|
-
<span class="visually-hidden">{{ 'it.transfer.label-move-backward' | translate }}</span>
|
|
35
|
-
<a
|
|
36
|
-
class="reset"
|
|
37
|
-
role="button"
|
|
38
|
-
href="#"
|
|
39
|
-
[ngClass]="{ active: resetEnabled | async }"
|
|
40
|
-
(click)="resetClickHandler($event)"
|
|
41
|
-
(keypress)="resetKeyPressHandler($event)"
|
|
42
|
-
[attr.aria-label]="'it.transfer.aria-label-reset' | translate">
|
|
43
|
-
<it-icon name="restore"></it-icon>
|
|
44
|
-
</a>
|
|
45
|
-
<span class="visually-hidden">{{ 'it.transfer.label-reset' | translate }}</span>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="col-xs-12 col-md-5">
|
|
49
|
-
<it-transfer-list sourceType="target" [title]="'it.transfer.target' | translate"></it-transfer-list>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { tb_base } from 'projects/design-angular-kit/src/test';
|
|
4
|
-
import { TransferStore } from './store/transfer.store';
|
|
5
|
-
import { ItTransferComponent } from './transfer.component';
|
|
6
|
-
|
|
7
|
-
describe('ItTransferComponent', () => {
|
|
8
|
-
let component: ItTransferComponent;
|
|
9
|
-
let fixture: ComponentFixture<ItTransferComponent>;
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
const { imports, providers } = tb_base;
|
|
13
|
-
|
|
14
|
-
await TestBed.configureTestingModule({
|
|
15
|
-
imports,
|
|
16
|
-
providers: [...providers, TransferStore],
|
|
17
|
-
}).compileComponents();
|
|
18
|
-
|
|
19
|
-
fixture = TestBed.createComponent(ItTransferComponent);
|
|
20
|
-
component = fixture.componentInstance;
|
|
21
|
-
fixture.detectChanges();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should create', () => {
|
|
25
|
-
expect(component).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { AsyncPipe, NgClass } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, EventEmitter, inject, Input, OnInit, Optional, Output, Self } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { FormControlName, NgControl, NgModel, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
6
|
-
import { tap } from 'rxjs';
|
|
7
|
-
import { ItAbstractFormComponent } from '../../../abstracts/abstract-form.component';
|
|
8
|
-
import { TransferStore } from './store/transfer.store';
|
|
9
|
-
import { ItTransferListComponent } from './transfer-list/transfer-list.component';
|
|
10
|
-
import { TransferItem } from './transfer.model';
|
|
11
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
12
|
-
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Transfer
|
|
16
|
-
* @description Component that allows the creation of checkbox lists.
|
|
17
|
-
*/
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'it-transfer',
|
|
20
|
-
standalone: true,
|
|
21
|
-
templateUrl: './transfer.component.html',
|
|
22
|
-
imports: [TranslateModule, ItIconComponent, ItTransferListComponent, NgClass, AsyncPipe, ReactiveFormsModule],
|
|
23
|
-
providers: [TransferStore],
|
|
24
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
-
})
|
|
26
|
-
export class ItTransferComponent<T = any> extends ItAbstractFormComponent<T> implements OnInit {
|
|
27
|
-
/**
|
|
28
|
-
* The select options (left side)
|
|
29
|
-
*/
|
|
30
|
-
@Input() options = [];
|
|
31
|
-
/**
|
|
32
|
-
* The selected options (right side)
|
|
33
|
-
*/
|
|
34
|
-
@Input() selected = [];
|
|
35
|
-
/**
|
|
36
|
-
* Fired when there is a transfer, a backtransfer or a reset event
|
|
37
|
-
*/
|
|
38
|
-
@Output() readonly transferChanges = new EventEmitter<TransferItem<T>[]>();
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Enable transfer button
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
readonly transferEnabled = this.store.transferEnabled;
|
|
45
|
-
/**
|
|
46
|
-
* Enable backtransfer button
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
readonly backtransferEnabled = this.store.backtransferEnabled;
|
|
50
|
-
/**
|
|
51
|
-
* Enable reset button
|
|
52
|
-
* @default false
|
|
53
|
-
*/
|
|
54
|
-
readonly resetEnabled = this.store.resetEnabled;
|
|
55
|
-
|
|
56
|
-
private readonly destroyRef = inject(DestroyRef);
|
|
57
|
-
|
|
58
|
-
constructor(
|
|
59
|
-
@Self()
|
|
60
|
-
@Optional()
|
|
61
|
-
override readonly _ngControl: NgControl,
|
|
62
|
-
override readonly _translateService: TranslateService,
|
|
63
|
-
private readonly store: TransferStore<T>
|
|
64
|
-
) {
|
|
65
|
-
super(_translateService, _ngControl);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
override ngOnInit() {
|
|
69
|
-
super.ngOnInit();
|
|
70
|
-
this.storeInit();
|
|
71
|
-
this.onStoreValueChanged();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Transfer button click handler
|
|
76
|
-
*/
|
|
77
|
-
transferClickHandler(event: MouseEvent) {
|
|
78
|
-
this.buttonEventHandler(event, () => this.store.transfer());
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Transfer button keypress handler
|
|
82
|
-
*/
|
|
83
|
-
transferKeyPressHandler(event: KeyboardEvent) {
|
|
84
|
-
this.buttonEventHandler(event, () => this.store.transfer());
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Backtransfer button click handler
|
|
88
|
-
*/
|
|
89
|
-
backtransferClickHandler(event: MouseEvent) {
|
|
90
|
-
this.buttonEventHandler(event, () => this.store.backtransfer());
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Backtransfer button keypress handler
|
|
94
|
-
*/
|
|
95
|
-
backtransferKeyPressHandler(event: KeyboardEvent) {
|
|
96
|
-
this.buttonEventHandler(event, () => this.store.backtransfer());
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Reset button click handler
|
|
100
|
-
*/
|
|
101
|
-
resetClickHandler(event: MouseEvent) {
|
|
102
|
-
this.buttonEventHandler(event, () => this.store.reset());
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Reset button keypress handler
|
|
106
|
-
*/
|
|
107
|
-
resetKeyPressHandler(event: KeyboardEvent) {
|
|
108
|
-
this.buttonEventHandler(event, () => this.store.reset());
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
private buttonEventHandler(event: Event, updateStoreCb: () => void) {
|
|
112
|
-
event.preventDefault();
|
|
113
|
-
updateStoreCb();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
private storeInit() {
|
|
117
|
-
let target = [];
|
|
118
|
-
const ngControl = this._ngControl;
|
|
119
|
-
const isNgControlDefined = Boolean(this._ngControl);
|
|
120
|
-
|
|
121
|
-
// if ngControl is defined, take values from it. Input() target will be ignored
|
|
122
|
-
if (isNgControlDefined) {
|
|
123
|
-
console.debug('ngControl instanceof NgModel:', ngControl instanceof NgModel);
|
|
124
|
-
console.debug('ngControl instanceof FormControlName:', ngControl instanceof FormControlName);
|
|
125
|
-
|
|
126
|
-
// if ngControl is an ngModel (template-driven form use case), take values from it
|
|
127
|
-
if (ngControl instanceof NgModel) {
|
|
128
|
-
console.debug('ngControl instanceof NgModel');
|
|
129
|
-
const model = (ngControl as NgModel).model;
|
|
130
|
-
target = Array.isArray(model) ? model : [];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// if ngControl is an FormControlName (reactive form use case), take values from it
|
|
134
|
-
if (ngControl instanceof FormControlName) {
|
|
135
|
-
console.debug('ngControl instanceof FormControlName');
|
|
136
|
-
const model = (ngControl as FormControlName).control.value;
|
|
137
|
-
target = Array.isArray(model) ? model : [];
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
console.debug('ngControl is defined. Input() target will be ignored');
|
|
141
|
-
} else if (this.selected && Array.isArray(this.selected)) {
|
|
142
|
-
target = [...this.selected];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
console.debug('target:', this.selected, 'formControl:', this.control.value, 'ngModel:', this._ngControl);
|
|
146
|
-
this.store.init({ source: [...this.options], target });
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
private onStoreValueChanged() {
|
|
150
|
-
this.store.valueChanged
|
|
151
|
-
.pipe(
|
|
152
|
-
takeUntilDestroyed(this.destroyRef),
|
|
153
|
-
tap(value => this.writeValue(value as T)),
|
|
154
|
-
tap(value => this.onChange(value as T)),
|
|
155
|
-
tap(value => this.transferChanges.emit(value))
|
|
156
|
-
)
|
|
157
|
-
.subscribe();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<div class="upload-dragdrop" [class.dragover]="isDragover" [class.loading]="isLoading" [class.success]="isSuccess">
|
|
2
|
-
<div class="upload-dragdrop-image">
|
|
3
|
-
<img
|
|
4
|
-
[ngSrc]="assetBasePath + '/dist/assets/upload-drag-drop-icon.svg'"
|
|
5
|
-
alt="drag-drop-icon"
|
|
6
|
-
aria-hidden="true"
|
|
7
|
-
[width]="180"
|
|
8
|
-
[height]="180" />
|
|
9
|
-
<div class="upload-dragdrop-loading">
|
|
10
|
-
<div class="progress-donut" #donutElement></div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="upload-dragdrop-success">
|
|
13
|
-
<it-icon name="check"></it-icon>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="upload-dragdrop-text">
|
|
17
|
-
<p class="upload-dragdrop-weight">
|
|
18
|
-
<it-icon name="file" size="xs"></it-icon>
|
|
19
|
-
{{ extension }} ({{ fileSize }})
|
|
20
|
-
</p>
|
|
21
|
-
<h5>{{ filename || ('it.form.upload-drag-file' | translate) }}</h5>
|
|
22
|
-
@if (isLoading) {
|
|
23
|
-
<p>{{ 'it.form.upload-loading' | translate }}</p>
|
|
24
|
-
}
|
|
25
|
-
@if (isSuccess) {
|
|
26
|
-
<p>{{ 'it.form.upload-complete' | translate }}</p>
|
|
27
|
-
}
|
|
28
|
-
@if (!isLoading && !isSuccess) {
|
|
29
|
-
<p>
|
|
30
|
-
{{ 'it.form.upload-or' | translate }}
|
|
31
|
-
<input type="file" [id]="id" class="upload-dragdrop-input" [accept]="accept" (change)="onLoadFile($event)" />
|
|
32
|
-
<label [for]="id">{{ 'it.form.upload-select-device' | translate }}</label>
|
|
33
|
-
</p>
|
|
34
|
-
}
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ItUploadDragDropComponent } from './upload-drag-drop.component';
|
|
4
|
-
import { tb_base } from '../../../../test';
|
|
5
|
-
|
|
6
|
-
describe('ItUploadDragDropComponent', () => {
|
|
7
|
-
let component: ItUploadDragDropComponent;
|
|
8
|
-
let fixture: ComponentFixture<ItUploadDragDropComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(ItUploadDragDropComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AfterViewInit,
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
ElementRef,
|
|
6
|
-
EventEmitter,
|
|
7
|
-
HostListener,
|
|
8
|
-
inject,
|
|
9
|
-
Input,
|
|
10
|
-
Output,
|
|
11
|
-
ViewChild,
|
|
12
|
-
} from '@angular/core';
|
|
13
|
-
import { ItAbstractComponent } from '../../../abstracts/abstract.component';
|
|
14
|
-
import { ItFileUtils } from '../../../utils/file-utils';
|
|
15
|
-
import { ProgressDonut } from 'bootstrap-italia';
|
|
16
|
-
import { ItIconComponent } from '../../utils/icon/icon.component';
|
|
17
|
-
import { NgOptimizedImage } from '@angular/common';
|
|
18
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
19
|
-
import { IT_ASSET_BASE_PATH } from '../../../interfaces/design-angular-kit-config';
|
|
20
|
-
|
|
21
|
-
@Component({
|
|
22
|
-
standalone: true,
|
|
23
|
-
selector: 'it-upload-drag-drop',
|
|
24
|
-
templateUrl: './upload-drag-drop.component.html',
|
|
25
|
-
exportAs: 'itUploadDragDrop',
|
|
26
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
-
imports: [ItIconComponent, TranslateModule, NgOptimizedImage],
|
|
28
|
-
})
|
|
29
|
-
export class ItUploadDragDropComponent extends ItAbstractComponent implements AfterViewInit {
|
|
30
|
-
/**
|
|
31
|
-
* The accepted file type to upload <br>
|
|
32
|
-
* Possible values: <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types">MIME Types</a> separated by comma
|
|
33
|
-
* @example application/pdf,image/png
|
|
34
|
-
* @default *
|
|
35
|
-
*/
|
|
36
|
-
@Input() accept: string = '*';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Fired when file start to upload
|
|
40
|
-
*/
|
|
41
|
-
@Output() fileStartUpload = new EventEmitter<File>();
|
|
42
|
-
|
|
43
|
-
protected isDragover: boolean = false;
|
|
44
|
-
protected isLoading: boolean = false;
|
|
45
|
-
protected isSuccess: boolean = false;
|
|
46
|
-
|
|
47
|
-
protected donut?: ProgressDonut;
|
|
48
|
-
|
|
49
|
-
@ViewChild('donutElement') private donutElement?: ElementRef<HTMLDivElement>;
|
|
50
|
-
|
|
51
|
-
protected filename?: string;
|
|
52
|
-
protected extension?: string;
|
|
53
|
-
protected fileSize?: string;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The bootstrap-italia asset folder path
|
|
57
|
-
* @default ./bootstrap-italia
|
|
58
|
-
*/
|
|
59
|
-
protected assetBasePath: string;
|
|
60
|
-
|
|
61
|
-
constructor() {
|
|
62
|
-
super();
|
|
63
|
-
this.assetBasePath = inject(IT_ASSET_BASE_PATH);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
override ngAfterViewInit(): void {
|
|
67
|
-
super.ngAfterViewInit();
|
|
68
|
-
if (this.donutElement) {
|
|
69
|
-
this.donut = ProgressDonut.getOrCreateInstance(this.donutElement.nativeElement);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Dragover listener
|
|
74
|
-
@HostListener('dragover', ['$event'])
|
|
75
|
-
public onDragOver(evt: DragEvent): void {
|
|
76
|
-
evt.preventDefault();
|
|
77
|
-
evt.stopPropagation();
|
|
78
|
-
this.isDragover = !this.isLoading;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Dragleave listener
|
|
82
|
-
@HostListener('dragleave', ['$event'])
|
|
83
|
-
public onDragLeave(evt: DragEvent): void {
|
|
84
|
-
evt.preventDefault();
|
|
85
|
-
evt.stopPropagation();
|
|
86
|
-
this.isDragover = false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Drop leave listener
|
|
90
|
-
@HostListener('drop', ['$event'])
|
|
91
|
-
public onDrop(evt: DragEvent): void {
|
|
92
|
-
evt.preventDefault();
|
|
93
|
-
evt.stopPropagation();
|
|
94
|
-
|
|
95
|
-
this.isDragover = false;
|
|
96
|
-
const files = evt.dataTransfer?.files;
|
|
97
|
-
if (this.isLoading || !files?.length) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
this.start(files[0]);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* On load file from input
|
|
105
|
-
* @param event
|
|
106
|
-
*/
|
|
107
|
-
onLoadFile(event: Event): void {
|
|
108
|
-
const files = (event.target as HTMLInputElement)?.files;
|
|
109
|
-
if (!files?.length) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.start(files[0]);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Start the upload file
|
|
117
|
-
* @param file
|
|
118
|
-
*/
|
|
119
|
-
public start(file: File): void {
|
|
120
|
-
if (this.accept !== '*' && !this.accept.includes(file.type)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
this.reset();
|
|
125
|
-
this.isLoading = true;
|
|
126
|
-
|
|
127
|
-
const splitName = file.name.split('.');
|
|
128
|
-
this.filename = splitName[0];
|
|
129
|
-
this.extension = splitName[1]?.toUpperCase();
|
|
130
|
-
this.fileSize = ItFileUtils.getFileSizeString(file);
|
|
131
|
-
|
|
132
|
-
this.fileStartUpload.emit(file);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Percentage of upload
|
|
137
|
-
* @param value the percentage [0 - 100]
|
|
138
|
-
*/
|
|
139
|
-
public progress(value: number) {
|
|
140
|
-
if (!this.isLoading) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (value >= 100) {
|
|
145
|
-
this.success();
|
|
146
|
-
} else {
|
|
147
|
-
this.donut?.set((value < 0 ? 0 : value) / 100);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Upload success
|
|
153
|
-
*/
|
|
154
|
-
public success(): void {
|
|
155
|
-
this.isLoading = false;
|
|
156
|
-
this.isSuccess = true;
|
|
157
|
-
this._changeDetectorRef.detectChanges();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Reset file uploader
|
|
162
|
-
*/
|
|
163
|
-
public reset(): void {
|
|
164
|
-
this.isLoading = false;
|
|
165
|
-
this.isSuccess = false;
|
|
166
|
-
this.filename = this.extension = this.fileSize = undefined;
|
|
167
|
-
this.donut?.set(0);
|
|
168
|
-
this._changeDetectorRef.detectChanges();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
@if (!hideLoadButton) {
|
|
2
|
-
<input type="file" [id]="id" class="upload" [accept]="accept" [multiple]="multiple" (change)="onLoadFiles($event)" />
|
|
3
|
-
<label [for]="id">
|
|
4
|
-
<it-icon name="upload" size="sm"></it-icon>
|
|
5
|
-
<span>{{ 'it.form.upload' | translate }}</span>
|
|
6
|
-
</label>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@if (fileList.length) {
|
|
10
|
-
<ul class="upload-file-list" [class.upload-file-list-image]="images">
|
|
11
|
-
@for (item of fileList; track item.id) {
|
|
12
|
-
<li
|
|
13
|
-
class="upload-file"
|
|
14
|
-
[class.error]="item.error"
|
|
15
|
-
[class.uploading]="!item.error && item.progress !== undefined && item.progress > 0 && item.progress < 100"
|
|
16
|
-
[class.success]="!item.error && (!item.progress || item.progress >= 100)">
|
|
17
|
-
@if (images) {
|
|
18
|
-
<div class="upload-image">
|
|
19
|
-
<img [attr.src]="previewImages.get(item.id)" [alt]="item.file.name" />
|
|
20
|
-
</div>
|
|
21
|
-
} @else {
|
|
22
|
-
<it-icon name="file" size="sm" [color]="!item.error ? (item.progress ? 'secondary' : 'primary') : 'danger'"></it-icon>
|
|
23
|
-
}
|
|
24
|
-
<p [itTooltip]="item.tooltip">
|
|
25
|
-
<span class="visually-hidden">{{ 'it.form.uploaded-file' | translate: { name: item.file.name } }}</span>
|
|
26
|
-
{{ item.file.name }} <span class="upload-file-weight">{{ getFileSize(item.file) }}</span>
|
|
27
|
-
</p>
|
|
28
|
-
@if (item.removable && (!item.progress || item.progress < 100)) {
|
|
29
|
-
<button type="button" (click)="deleteItem.emit(item)">
|
|
30
|
-
<span class="visually-hidden">{{ 'it.form.delete-file' | translate: { name: item.file.name } }}</span>
|
|
31
|
-
<it-icon name="close"></it-icon>
|
|
32
|
-
</button>
|
|
33
|
-
}
|
|
34
|
-
@if ((!item.removable && !item.progress) || (item.progress !== undefined && item.progress >= 100)) {
|
|
35
|
-
<button type="button" disabled>
|
|
36
|
-
<span class="visually-hidden">{{ 'it.form.upload-complete' | translate }}</span>
|
|
37
|
-
<it-icon name="check"></it-icon>
|
|
38
|
-
</button>
|
|
39
|
-
}
|
|
40
|
-
@if (!item.error && item.progress !== undefined && item.progress > 0 && item.progress < 100) {
|
|
41
|
-
<it-progress-bar [value]="item.progress!"></it-progress-bar>
|
|
42
|
-
}
|
|
43
|
-
</li>
|
|
44
|
-
}
|
|
45
|
-
</ul>
|
|
46
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ItUploadFileListComponent } from './upload-file-list.component';
|
|
4
|
-
import { tb_base } from '../../../../test';
|
|
5
|
-
|
|
6
|
-
describe('ItUploadFileListComponent', () => {
|
|
7
|
-
let component: ItUploadFileListComponent;
|
|
8
|
-
let fixture: ComponentFixture<ItUploadFileListComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(async () => {
|
|
11
|
-
await TestBed.configureTestingModule(tb_base).compileComponents();
|
|
12
|
-
|
|
13
|
-
fixture = TestBed.createComponent(ItUploadFileListComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
component.fileList = [];
|
|
16
|
-
fixture.detectChanges();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create', () => {
|
|
20
|
-
expect(component).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
});
|