@unipin/angular-applet 18.9.3 → 18.9.5
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/.editorconfig +16 -0
- package/.eslintrc.json +72 -0
- package/.github/ISSUE_TEMPLATE/bug_fix.yml +60 -0
- package/.github/ISSUE_TEMPLATE/dependency_update.yml +20 -0
- package/.github/ISSUE_TEMPLATE/documentation.yml +13 -0
- package/.github/ISSUE_TEMPLATE/engineering.yml +22 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +38 -0
- package/.github/ISSUE_TEMPLATE/testing.yml +38 -0
- package/.github/dependabot.yml +11 -0
- package/.github/pull_request_template.md +77 -0
- package/.github/workflows/npm_publish.yml +52 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.ts +19 -0
- package/.storybook/test-runner.ts +29 -0
- package/.storybook/tsconfig.json +14 -0
- package/.storybook/typings.d.ts +4 -0
- package/.vscode/extensions.json +7 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/settings.json +16 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +11 -8
- package/angular.json +102 -0
- package/codegen.yml +8 -0
- package/package.json +86 -38
- package/projects/unipin-angular/README.md +24 -0
- package/projects/unipin-angular/documentation.json +116258 -0
- package/projects/unipin-angular/ng-package.json +19 -0
- package/projects/unipin-angular/package-lock.json +23 -0
- package/projects/unipin-angular/package.json +32 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_accordion.scss +149 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_alert.scss +71 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_badge.scss +38 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_breadcrumb.scss +40 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_button-group.scss +142 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_buttons.scss +209 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_card.scss +234 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_carousel.scss +226 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_close.scss +40 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_containers.scss +41 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_dropdown.scss +249 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_forms.scss +9 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_functions.scss +302 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_grid.scss +33 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_helpers.scss +10 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_images.scss +42 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_list-group.scss +192 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_maps.scss +54 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_mixins.scss +43 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_modal.scss +237 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_nav.scss +172 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_navbar.scss +278 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_offcanvas.scss +144 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_pagination.scss +109 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_placeholders.scss +51 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_popover.scss +196 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_progress.scss +59 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_reboot.scss +610 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_root.scss +73 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_spinners.scss +85 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_tables.scss +164 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_toasts.scss +73 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_tooltip.scss +120 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_transitions.scss +27 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_type.scss +106 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_utilities.scss +647 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/_variables.scss +1634 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/bootstrap-grid.scss +64 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/bootstrap-reboot.scss +9 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/bootstrap-utilities.scss +18 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/bootstrap.scss +24 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_floating-labels.scss +75 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_form-check.scss +175 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_form-control.scss +195 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_form-range.scss +91 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_form-select.scss +71 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_form-text.scss +11 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_input-group.scss +132 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_labels.scss +36 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/forms/_validation.scss +12 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_clearfix.scss +3 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_color-bg.scss +10 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_colored-links.scss +12 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_position.scss +36 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_ratio.scss +26 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_stacks.scss +15 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_stretched-link.scss +15 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_text-truncation.scss +7 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_visually-hidden.scss +8 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/helpers/_vr.scss +8 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_alert.scss +15 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_backdrop.scss +14 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_banner.scss +9 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_border-radius.scss +78 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_box-shadow.scss +18 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_breakpoints.scss +127 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_buttons.scss +70 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_caret.scss +64 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_clearfix.scss +9 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_color-scheme.scss +7 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_container.scss +11 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_deprecate.scss +10 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_forms.scss +152 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_gradients.scss +47 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_grid.scss +151 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_image.scss +16 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_list-group.scss +24 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_lists.scss +7 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_pagination.scss +10 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_reset-text.scss +17 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_resize.scss +6 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_table-variants.scss +24 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_text-truncate.scss +8 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_transition.scss +26 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_utilities.scss +97 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/mixins/_visually-hidden.scss +29 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/utilities/_api.scss +47 -0
- package/projects/unipin-angular/src/assets/private/scss/bootstrap/vendor/_rfs.scss +354 -0
- package/projects/unipin-angular/src/assets/private/scss/theme/variables.scss +59 -0
- package/projects/unipin-angular/src/graphql/generated.d.ts +715 -0
- package/projects/unipin-angular/src/graphql/generated.mjs +49 -0
- package/projects/unipin-angular/src/graphql/generated.ts +19998 -0
- package/projects/unipin-angular/src/lib/components/approval/detail/approval-detail.component.html +14 -0
- package/projects/unipin-angular/src/lib/components/approval/detail/approval-detail.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/approval/detail/approval-detail.component.ts +90 -0
- package/projects/unipin-angular/src/lib/components/approval/detail/approval-detail.stories.ts +61 -0
- package/projects/unipin-angular/src/lib/components/approval/form/approval-form.component.html +41 -0
- package/projects/unipin-angular/src/lib/components/approval/form/approval-form.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/approval/form/approval-form.component.ts +152 -0
- package/projects/unipin-angular/src/lib/components/approval/form/approval-form.stories.ts +111 -0
- package/{lib/components/approval/index.d.ts → projects/unipin-angular/src/lib/components/approval/index.ts} +1 -0
- package/projects/unipin-angular/src/lib/components/approval/list/approval-list.component.html +15 -0
- package/projects/unipin-angular/src/lib/components/approval/list/approval-list.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/approval/list/approval-list.component.ts +136 -0
- package/projects/unipin-angular/src/lib/components/approval/list/approval-list.stories.ts +141 -0
- package/projects/unipin-angular/src/lib/components/approval/list/provide-approval-entities.util.ts +10 -0
- package/projects/unipin-angular/src/lib/components/approval/services/approval.service.ts +46 -0
- package/projects/unipin-angular/src/lib/components/audit/detail/audit-detail.component.html +50 -0
- package/projects/unipin-angular/src/lib/components/audit/detail/audit-detail.component.scss +4 -0
- package/projects/unipin-angular/src/lib/components/audit/detail/audit-detail.component.spec.ts +51 -0
- package/projects/unipin-angular/src/lib/components/audit/detail/audit-detail.component.ts +141 -0
- package/projects/unipin-angular/src/lib/components/audit/detail/audit-detail.stories.ts +126 -0
- package/projects/unipin-angular/src/lib/components/audit/list/audit-list.component.html +5 -0
- package/projects/unipin-angular/src/lib/components/audit/list/audit-list.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/audit/list/audit-list.component.ts +85 -0
- package/projects/unipin-angular/src/lib/components/audit/list/audit-list.stories.ts +170 -0
- package/projects/unipin-angular/src/lib/components/audit/service/audit.service.ts +48 -0
- package/projects/unipin-angular/src/lib/components/audit/types/audit-detail-form.type.ts +13 -0
- package/projects/unipin-angular/src/lib/components/buttons/group/btn-group.component.html +42 -0
- package/projects/unipin-angular/src/lib/components/buttons/group/btn-group.component.scss +19 -0
- package/projects/unipin-angular/src/lib/components/buttons/group/btn-group.component.ts +72 -0
- package/projects/unipin-angular/src/lib/components/buttons/group/btn-group.stories.ts +132 -0
- package/projects/unipin-angular/src/lib/components/buttons/group/interfaces/btn-group-config.interface.ts +63 -0
- package/projects/unipin-angular/src/lib/components/buttons/loading/btn-loading.component.html +9 -0
- package/projects/unipin-angular/src/lib/components/buttons/loading/btn-loading.component.scss +8 -0
- package/projects/unipin-angular/src/lib/components/buttons/loading/btn-loading.component.ts +87 -0
- package/projects/unipin-angular/src/lib/components/buttons/loading/btn-loading.stories.ts +188 -0
- package/projects/unipin-angular/src/lib/components/containers/applet-container/applet-container.component.html +39 -0
- package/projects/unipin-angular/src/lib/components/containers/applet-container/applet-container.component.scss +68 -0
- package/projects/unipin-angular/src/lib/components/containers/applet-container/applet-container.component.ts +98 -0
- package/projects/unipin-angular/src/lib/components/containers/applet-container/provide-applet-config.util.ts +23 -0
- package/projects/unipin-angular/src/lib/components/containers/colum-header-container/column-header-container.component.html +17 -0
- package/projects/unipin-angular/src/lib/components/containers/colum-header-container/column-header-container.component.scss +4 -0
- package/projects/unipin-angular/src/lib/components/containers/colum-header-container/column-header-container.component.ts +32 -0
- package/projects/unipin-angular/src/lib/components/containers/colum-header-container/column-header.stories.ts +77 -0
- package/projects/unipin-angular/src/lib/components/containers/column-container/column-container.component.html +17 -0
- package/projects/unipin-angular/src/lib/components/containers/column-container/column-container.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/containers/column-container/column-container.component.ts +139 -0
- package/projects/unipin-angular/src/lib/components/containers/column-container/directives/lazy-route.directive.ts +86 -0
- package/{lib/components/containers/index.d.ts → projects/unipin-angular/src/lib/components/containers/index.ts} +1 -0
- package/{lib/components/containers/list-container/interfaces/list-container-config.interface.d.ts → projects/unipin-angular/src/lib/components/containers/list-container/interfaces/list-container-config.interface.ts} +5 -4
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.html +19 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.scss +7 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.ts +113 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-pagination-container/list-pagination-container.stories.ts +207 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.html +19 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.scss +7 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.ts +114 -0
- package/projects/unipin-angular/src/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.stories.ts +212 -0
- package/projects/unipin-angular/src/lib/components/containers/modal-container/modal-container.component.html +15 -0
- package/projects/unipin-angular/src/lib/components/containers/modal-container/modal-container.component.scss +2 -0
- package/projects/unipin-angular/src/lib/components/containers/modal-container/modal-container.component.ts +88 -0
- package/projects/unipin-angular/src/lib/components/containers/modal-container/modal-container.stories.ts +66 -0
- package/projects/unipin-angular/src/lib/components/filter/filter.component.html +113 -0
- package/projects/unipin-angular/src/lib/components/filter/filter.component.scss +28 -0
- package/projects/unipin-angular/src/lib/components/filter/filter.component.ts +329 -0
- package/projects/unipin-angular/src/lib/components/filter/filter.stories.ts +176 -0
- package/{lib/components/filter/index.d.ts → projects/unipin-angular/src/lib/components/filter/index.ts} +1 -1
- package/projects/unipin-angular/src/lib/components/filter/interfaces/filter-config.interface.ts +17 -0
- package/projects/unipin-angular/src/lib/components/filter/interfaces/filter-field.interface.ts +80 -0
- package/projects/unipin-angular/src/lib/components/filter/interfaces/filter-search-event.interface.ts +15 -0
- package/projects/unipin-angular/src/lib/components/forms/country-input/form-country-input.component.html +19 -0
- package/projects/unipin-angular/src/lib/components/forms/country-input/form-country-input.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/country-input/form-country-input.component.ts +210 -0
- package/projects/unipin-angular/src/lib/components/forms/country-input/form-country-input.stories.ts +175 -0
- package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.component.html +42 -0
- package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.component.scss +4 -0
- package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.component.ts +285 -0
- package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.spec.ts +119 -0
- package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.stories.ts +243 -0
- package/projects/unipin-angular/src/lib/components/forms/date/form-date.component.html +27 -0
- package/projects/unipin-angular/src/lib/components/forms/date/form-date.component.scss +7 -0
- package/projects/unipin-angular/src/lib/components/forms/date/form-date.component.ts +225 -0
- package/projects/unipin-angular/src/lib/components/forms/date/form-date.stories.ts +201 -0
- package/projects/unipin-angular/src/lib/components/forms/image-picker/directives/drag-n-drop.directive.ts +40 -0
- package/projects/unipin-angular/src/lib/components/forms/image-picker/form-image-picker.component.html +29 -0
- package/projects/unipin-angular/src/lib/components/forms/image-picker/form-image-picker.component.scss +40 -0
- package/projects/unipin-angular/src/lib/components/forms/image-picker/form-image-picker.component.ts +109 -0
- package/projects/unipin-angular/src/lib/components/forms/image-picker/form-image-picker.stories.ts +133 -0
- package/projects/unipin-angular/src/lib/components/forms/input/form-input.component.html +22 -0
- package/projects/unipin-angular/src/lib/components/forms/input/form-input.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/input/form-input.component.ts +177 -0
- package/projects/unipin-angular/src/lib/components/forms/input/form-input.stories.ts +185 -0
- package/projects/unipin-angular/src/lib/components/forms/number/form-number.component.html +6 -0
- package/projects/unipin-angular/src/lib/components/forms/number/form-number.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/number/form-number.component.ts +176 -0
- package/projects/unipin-angular/src/lib/components/forms/number/form-number.spec.ts +62 -0
- package/projects/unipin-angular/src/lib/components/forms/number/form-number.stories.ts +150 -0
- package/projects/unipin-angular/src/lib/components/forms/number/pipes/locale-number.pipe.ts +32 -0
- package/projects/unipin-angular/src/lib/components/forms/password/form-password.component.html +11 -0
- package/projects/unipin-angular/src/lib/components/forms/password/form-password.component.scss +5 -0
- package/projects/unipin-angular/src/lib/components/forms/password/form-password.component.ts +177 -0
- package/projects/unipin-angular/src/lib/components/forms/password/form-password.stories.ts +151 -0
- package/projects/unipin-angular/src/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.html +30 -0
- package/projects/unipin-angular/src/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.ts +271 -0
- package/projects/unipin-angular/src/lib/components/forms/rate-group-code-input/form-rate-group-code-input.stories.ts +248 -0
- package/projects/unipin-angular/src/lib/components/forms/searchable-select/form-searchable-select.component.html +28 -0
- package/projects/unipin-angular/src/lib/components/forms/searchable-select/form-searchable-select.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/searchable-select/form-searchable-select.component.ts +281 -0
- package/projects/unipin-angular/src/lib/components/forms/searchable-select/form-searchable-select.stories.ts +267 -0
- package/projects/unipin-angular/src/lib/components/forms/select/form-select.component.html +25 -0
- package/projects/unipin-angular/src/lib/components/forms/select/form-select.component.scss +1 -0
- package/projects/unipin-angular/src/lib/components/forms/select/form-select.component.ts +223 -0
- package/projects/unipin-angular/src/lib/components/forms/select/form-select.stories.ts +220 -0
- package/projects/unipin-angular/src/lib/components/forms/textarea/form-textarea.component.html +9 -0
- package/projects/unipin-angular/src/lib/components/forms/textarea/form-textarea.component.scss +0 -0
- package/projects/unipin-angular/src/lib/components/forms/textarea/form-textarea.component.ts +146 -0
- package/projects/unipin-angular/src/lib/components/forms/textarea/form-textarea.stories.ts +163 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-pagination/grid-pagination.component.html +17 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-pagination/grid-pagination.component.scss +8 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-pagination/grid-pagination.component.ts +224 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-pagination/grid-pagination.stories.ts +219 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-snapshot/grid-snapshot.component.html +17 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-snapshot/grid-snapshot.component.scss +8 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-snapshot/grid-snapshot.component.ts +229 -0
- package/projects/unipin-angular/src/lib/components/grids/grid-snapshot/grid-snapshot.stories.ts +173 -0
- package/projects/unipin-angular/src/lib/components/grids/interfaces/grid-config.interface.ts +44 -0
- package/projects/unipin-angular/src/lib/components/grids/services/grid.service.ts +23 -0
- package/{lib/components/index.d.ts → projects/unipin-angular/src/lib/components/index.ts} +14 -2
- package/projects/unipin-angular/src/lib/components/infinite-scroll/directive/infinite-scroll.directive.ts +72 -0
- package/projects/unipin-angular/src/lib/components/infinite-scroll/infinite-scroll.component.html +13 -0
- package/projects/unipin-angular/src/lib/components/infinite-scroll/infinite-scroll.component.scss +10 -0
- package/projects/unipin-angular/src/lib/components/infinite-scroll/infinite-scroll.component.ts +61 -0
- package/projects/unipin-angular/src/lib/components/infinite-scroll/infinite-scroll.stories.ts +80 -0
- package/{lib/components/tabs/index.d.ts → projects/unipin-angular/src/lib/components/tabs/index.ts} +3 -2
- package/projects/unipin-angular/src/lib/components/tabs/tab-content/tab-content.component.html +3 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab-content/tab-content.component.scss +6 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab-content/tab-content.component.ts +56 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab-group/tab-group.component.html +24 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab-group/tab-group.component.scss +39 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab-group/tab-group.component.ts +92 -0
- package/projects/unipin-angular/src/lib/components/tabs/tab.stories.ts +117 -0
- package/projects/unipin-angular/src/lib/guards/auth/auth.guard.ts +11 -0
- package/projects/unipin-angular/src/lib/interceptors/header/header.interceptor.ts +36 -0
- package/projects/unipin-angular/src/lib/interceptors/refresh-token/refresh-token.interceptor.ts +123 -0
- package/projects/unipin-angular/src/lib/interfaces/user/user.interface.ts +27 -0
- package/projects/unipin-angular/src/lib/modules/index.ts +11 -0
- package/projects/unipin-angular/src/lib/modules/micro-frontend/utils/mf-bootstrap.util.ts +74 -0
- package/projects/unipin-angular/src/lib/modules/micro-frontend/utils/mf-global-state.util.ts +20 -0
- package/projects/unipin-angular/src/lib/modules/permission/directive/permission.directive.spec.ts +50 -0
- package/projects/unipin-angular/src/lib/modules/permission/directive/permission.directive.ts +68 -0
- package/projects/unipin-angular/src/lib/modules/permission/guards/permission.guard.spec.ts +76 -0
- package/projects/unipin-angular/src/lib/modules/permission/guards/permission.guard.ts +30 -0
- package/{lib/modules/permission/index.d.ts → projects/unipin-angular/src/lib/modules/permission/index.ts} +1 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/401/unauthorized.page.html +3 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/401/unauthorized.page.scss +3 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/401/unauthorized.page.ts +14 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/loading/loading.page.html +2 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/loading/loading.page.scss +4 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/loading/loading.page.ts +76 -0
- package/projects/unipin-angular/src/lib/modules/permission/pages/loading/provide-loading-config.util.ts +18 -0
- package/projects/unipin-angular/src/lib/modules/permission/services/permission.service.spec.ts +62 -0
- package/projects/unipin-angular/src/lib/modules/permission/services/permission.service.ts +78 -0
- package/projects/unipin-angular/src/lib/resolvers/auth/auth.resolver.spec.ts +46 -0
- package/projects/unipin-angular/src/lib/resolvers/auth/auth.resolver.ts +144 -0
- package/projects/unipin-angular/src/lib/services/auth/auth.service.ts +243 -0
- package/projects/unipin-angular/src/lib/services/country/country.service.ts +47 -0
- package/projects/unipin-angular/src/lib/services/currency/currency.service.ts +44 -0
- package/projects/unipin-angular/src/lib/services/profile/profile.service.ts +86 -0
- package/projects/unipin-angular/src/lib/services/rate-group-code/rate-group-code.service.ts +29 -0
- package/projects/unipin-angular/src/lib/utils/contrast-color-generator/contrast-color-generator.util.spec.ts +19 -0
- package/projects/unipin-angular/src/lib/utils/contrast-color-generator/contrast-color-generator.util.ts +28 -0
- package/projects/unipin-angular/src/lib/utils/form-error-message/form-error-message.util.spec.ts +58 -0
- package/projects/unipin-angular/src/lib/utils/form-error-message/form-error-message.util.ts +30 -0
- package/projects/unipin-angular/src/lib/utils/format-capitalize/format-capitalize.util.spec.ts +30 -0
- package/projects/unipin-angular/src/lib/utils/format-capitalize/format-capitalize.util.ts +22 -0
- package/projects/unipin-angular/src/lib/utils/redirect-to-first-menu/redirect-to-first-menu.util.ts +15 -0
- package/projects/unipin-angular/src/public-api.ts +126 -0
- package/projects/unipin-angular/tsconfig.lib.json +14 -0
- package/projects/unipin-angular/tsconfig.lib.prod.json +10 -0
- package/projects/unipin-angular/tsconfig.spec.json +14 -0
- package/snapshot-serializer.js +12 -0
- package/test-runner-jest.config.js +13 -0
- package/tsconfig.json +51 -0
- package/esm2022/graphql/generated.mjs +0 -938
- package/esm2022/lib/components/approval/detail/approval-detail.component.mjs +0 -78
- package/esm2022/lib/components/approval/form/approval-form.component.mjs +0 -128
- package/esm2022/lib/components/approval/index.mjs +0 -5
- package/esm2022/lib/components/approval/list/approval-list.component.mjs +0 -114
- package/esm2022/lib/components/approval/list/provide-approval-entities.util.mjs +0 -9
- package/esm2022/lib/components/approval/services/approval.service.mjs +0 -46
- package/esm2022/lib/components/audit/detail/audit-detail.component.mjs +0 -123
- package/esm2022/lib/components/audit/index.mjs +0 -3
- package/esm2022/lib/components/audit/list/audit-list.component.mjs +0 -81
- package/esm2022/lib/components/audit/service/audit.service.mjs +0 -49
- package/esm2022/lib/components/audit/types/audit-detail-form.type.mjs +0 -2
- package/esm2022/lib/components/buttons/group/btn-group.component.mjs +0 -43
- package/esm2022/lib/components/buttons/group/interfaces/btn-group-config.interface.mjs +0 -2
- package/esm2022/lib/components/buttons/index.mjs +0 -3
- package/esm2022/lib/components/buttons/loading/btn-loading.component.mjs +0 -48
- package/esm2022/lib/components/containers/applet-container/applet-container.component.mjs +0 -55
- package/esm2022/lib/components/containers/applet-container/provide-applet-config.util.mjs +0 -9
- package/esm2022/lib/components/containers/colum-header-container/column-header-container.component.mjs +0 -23
- package/esm2022/lib/components/containers/column-container/column-container.component.mjs +0 -79
- package/esm2022/lib/components/containers/column-container/directives/lazy-route.directive.mjs +0 -57
- package/esm2022/lib/components/containers/index.mjs +0 -7
- package/esm2022/lib/components/containers/list-container/index.mjs +0 -3
- package/esm2022/lib/components/containers/list-container/interfaces/list-container-config.interface.mjs +0 -2
- package/esm2022/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.mjs +0 -58
- package/esm2022/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.mjs +0 -57
- package/esm2022/lib/components/containers/modal-container/modal-container.component.mjs +0 -40
- package/esm2022/lib/components/filter/filter.component.mjs +0 -222
- package/esm2022/lib/components/filter/index.mjs +0 -2
- package/esm2022/lib/components/filter/interfaces/filter-config.interface.mjs +0 -2
- package/esm2022/lib/components/filter/interfaces/filter-field.interface.mjs +0 -2
- package/esm2022/lib/components/filter/interfaces/filter-search-event.interface.mjs +0 -2
- package/esm2022/lib/components/forms/country-input/form-country-input.component.mjs +0 -122
- package/esm2022/lib/components/forms/currency-input/form-currency-input.component.mjs +0 -157
- package/esm2022/lib/components/forms/date/form-date.component.mjs +0 -114
- package/esm2022/lib/components/forms/image-picker/directives/drag-n-drop.directive.mjs +0 -49
- package/esm2022/lib/components/forms/image-picker/form-image-picker.component.mjs +0 -68
- package/esm2022/lib/components/forms/index.mjs +0 -12
- package/esm2022/lib/components/forms/input/form-input.component.mjs +0 -98
- package/esm2022/lib/components/forms/number/form-number.component.mjs +0 -97
- package/esm2022/lib/components/forms/number/pipes/locale-number.pipe.mjs +0 -33
- package/esm2022/lib/components/forms/password/form-password.component.mjs +0 -100
- package/esm2022/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.mjs +0 -135
- package/esm2022/lib/components/forms/searchable-select/form-searchable-select.component.mjs +0 -138
- package/esm2022/lib/components/forms/select/form-select.component.mjs +0 -116
- package/esm2022/lib/components/forms/textarea/form-textarea.component.mjs +0 -88
- package/esm2022/lib/components/grids/grid-pagination/grid-pagination.component.mjs +0 -111
- package/esm2022/lib/components/grids/grid-snapshot/grid-snapshot.component.mjs +0 -109
- package/esm2022/lib/components/grids/index.mjs +0 -4
- package/esm2022/lib/components/grids/interfaces/grid-config.interface.mjs +0 -2
- package/esm2022/lib/components/grids/services/grid.service.mjs +0 -25
- package/esm2022/lib/components/index.mjs +0 -9
- package/esm2022/lib/components/infinite-scroll/directive/infinite-scroll.directive.mjs +0 -43
- package/esm2022/lib/components/infinite-scroll/index.mjs +0 -3
- package/esm2022/lib/components/infinite-scroll/infinite-scroll.component.mjs +0 -36
- package/esm2022/lib/components/tabs/index.mjs +0 -3
- package/esm2022/lib/components/tabs/tab-content/tab-content.component.mjs +0 -37
- package/esm2022/lib/components/tabs/tab-group/tab-group.component.mjs +0 -47
- package/esm2022/lib/guards/auth/auth.guard.mjs +0 -10
- package/esm2022/lib/guards/index.mjs +0 -2
- package/esm2022/lib/interceptors/header/header.interceptor.mjs +0 -29
- package/esm2022/lib/interceptors/index.mjs +0 -3
- package/esm2022/lib/interceptors/refresh-token/refresh-token.interceptor.mjs +0 -83
- package/esm2022/lib/interfaces/index.mjs +0 -2
- package/esm2022/lib/interfaces/user/user.interface.mjs +0 -2
- package/esm2022/lib/modules/index.mjs +0 -3
- package/esm2022/lib/modules/micro-frontend/index.mjs +0 -2
- package/esm2022/lib/modules/micro-frontend/utils/mf-bootstrap.util.mjs +0 -55
- package/esm2022/lib/modules/micro-frontend/utils/mf-global-state.util.mjs +0 -14
- package/esm2022/lib/modules/permission/directive/permission.directive.mjs +0 -41
- package/esm2022/lib/modules/permission/guards/permission.guard.mjs +0 -26
- package/esm2022/lib/modules/permission/index.mjs +0 -7
- package/esm2022/lib/modules/permission/pages/401/unauthorized.page.mjs +0 -15
- package/esm2022/lib/modules/permission/pages/loading/loading.page.mjs +0 -65
- package/esm2022/lib/modules/permission/pages/loading/provide-loading-config.util.mjs +0 -9
- package/esm2022/lib/modules/permission/services/permission.service.mjs +0 -50
- package/esm2022/lib/resolvers/auth/auth.resolver.mjs +0 -87
- package/esm2022/lib/resolvers/index.mjs +0 -2
- package/esm2022/lib/services/auth/auth.service.mjs +0 -171
- package/esm2022/lib/services/country/country.service.mjs +0 -43
- package/esm2022/lib/services/currency/currency.service.mjs +0 -40
- package/esm2022/lib/services/index.mjs +0 -6
- package/esm2022/lib/services/profile/profile.service.mjs +0 -82
- package/esm2022/lib/services/rate-group-code/rate-group-code.service.mjs +0 -31
- package/esm2022/lib/utils/contrast-color-generator/contrast-color-generator.util.mjs +0 -16
- package/esm2022/lib/utils/form-error-message/form-error-message.util.mjs +0 -21
- package/esm2022/lib/utils/format-capitalize/format-capitalize.util.mjs +0 -18
- package/esm2022/lib/utils/index.mjs +0 -5
- package/esm2022/lib/utils/redirect-to-first-menu/redirect-to-first-menu.util.mjs +0 -9
- package/esm2022/public-api.mjs +0 -10
- package/esm2022/unipin-angular-applet.mjs +0 -2
- package/fesm2022/unipin-angular-applet.mjs +0 -4614
- package/fesm2022/unipin-angular-applet.mjs.map +0 -1
- package/graphql/generated.d.ts +0 -16225
- package/index.d.ts +0 -2
- package/lib/components/approval/detail/approval-detail.component.d.ts +0 -26
- package/lib/components/approval/form/approval-form.component.d.ts +0 -33
- package/lib/components/approval/list/approval-list.component.d.ts +0 -33
- package/lib/components/approval/list/provide-approval-entities.util.d.ts +0 -3
- package/lib/components/approval/services/approval.service.d.ts +0 -18
- package/lib/components/audit/detail/audit-detail.component.d.ts +0 -33
- package/lib/components/audit/list/audit-list.component.d.ts +0 -31
- package/lib/components/audit/service/audit.service.d.ts +0 -15
- package/lib/components/audit/types/audit-detail-form.type.d.ts +0 -12
- package/lib/components/buttons/group/btn-group.component.d.ts +0 -18
- package/lib/components/buttons/group/interfaces/btn-group-config.interface.d.ts +0 -11
- package/lib/components/buttons/loading/btn-loading.component.d.ts +0 -19
- package/lib/components/containers/applet-container/applet-container.component.d.ts +0 -22
- package/lib/components/containers/applet-container/provide-applet-config.util.d.ts +0 -15
- package/lib/components/containers/colum-header-container/column-header-container.component.d.ts +0 -7
- package/lib/components/containers/column-container/column-container.component.d.ts +0 -26
- package/lib/components/containers/column-container/directives/lazy-route.directive.d.ts +0 -17
- package/lib/components/containers/list-container/list-pagination-container/list-pagination-container.component.d.ts +0 -23
- package/lib/components/containers/list-container/list-snapshot-container/list-snapshot-container.component.d.ts +0 -23
- package/lib/components/containers/modal-container/modal-container.component.d.ts +0 -16
- package/lib/components/filter/filter.component.d.ts +0 -44
- package/lib/components/filter/interfaces/filter-config.interface.d.ts +0 -5
- package/lib/components/filter/interfaces/filter-field.interface.d.ts +0 -23
- package/lib/components/filter/interfaces/filter-search-event.interface.d.ts +0 -4
- package/lib/components/forms/country-input/form-country-input.component.d.ts +0 -41
- package/lib/components/forms/currency-input/form-currency-input.component.d.ts +0 -52
- package/lib/components/forms/date/form-date.component.d.ts +0 -32
- package/lib/components/forms/image-picker/directives/drag-n-drop.directive.d.ts +0 -10
- package/lib/components/forms/image-picker/form-image-picker.component.d.ts +0 -21
- package/lib/components/forms/input/form-input.component.d.ts +0 -31
- package/lib/components/forms/number/form-number.component.d.ts +0 -27
- package/lib/components/forms/number/pipes/locale-number.pipe.d.ts +0 -8
- package/lib/components/forms/password/form-password.component.d.ts +0 -27
- package/lib/components/forms/rate-group-code-input/form-rate-group-code-input.component.d.ts +0 -41
- package/lib/components/forms/searchable-select/form-searchable-select.component.d.ts +0 -42
- package/lib/components/forms/select/form-select.component.d.ts +0 -33
- package/lib/components/forms/textarea/form-textarea.component.d.ts +0 -26
- package/lib/components/grids/grid-pagination/grid-pagination.component.d.ts +0 -33
- package/lib/components/grids/grid-snapshot/grid-snapshot.component.d.ts +0 -36
- package/lib/components/grids/interfaces/grid-config.interface.d.ts +0 -16
- package/lib/components/grids/services/grid.service.d.ts +0 -12
- package/lib/components/infinite-scroll/directive/infinite-scroll.directive.d.ts +0 -15
- package/lib/components/infinite-scroll/infinite-scroll.component.d.ts +0 -12
- package/lib/components/tabs/tab-content/tab-content.component.d.ts +0 -14
- package/lib/components/tabs/tab-group/tab-group.component.d.ts +0 -18
- package/lib/guards/auth/auth.guard.d.ts +0 -1
- package/lib/interceptors/header/header.interceptor.d.ts +0 -9
- package/lib/interceptors/refresh-token/refresh-token.interceptor.d.ts +0 -14
- package/lib/interfaces/user/user.interface.d.ts +0 -27
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/micro-frontend/utils/mf-bootstrap.util.d.ts +0 -9
- package/lib/modules/micro-frontend/utils/mf-global-state.util.d.ts +0 -4
- package/lib/modules/permission/directive/permission.directive.d.ts +0 -16
- package/lib/modules/permission/guards/permission.guard.d.ts +0 -2
- package/lib/modules/permission/pages/401/unauthorized.page.d.ts +0 -5
- package/lib/modules/permission/pages/loading/loading.page.d.ts +0 -18
- package/lib/modules/permission/pages/loading/provide-loading-config.util.d.ts +0 -10
- package/lib/modules/permission/services/permission.service.d.ts +0 -21
- package/lib/resolvers/auth/auth.resolver.d.ts +0 -14
- package/lib/services/auth/auth.service.d.ts +0 -39
- package/lib/services/country/country.service.d.ts +0 -16
- package/lib/services/currency/currency.service.d.ts +0 -16
- package/lib/services/profile/profile.service.d.ts +0 -12
- package/lib/services/rate-group-code/rate-group-code.service.d.ts +0 -14
- package/lib/utils/contrast-color-generator/contrast-color-generator.util.d.ts +0 -4
- package/lib/utils/form-error-message/form-error-message.util.d.ts +0 -2
- package/lib/utils/format-capitalize/format-capitalize.util.d.ts +0 -1
- package/lib/utils/redirect-to-first-menu/redirect-to-first-menu.util.d.ts +0 -2
- package/public-api.d.ts +0 -11
- /package/{src → projects/unipin-angular/src}/assets/scss/forms.scss +0 -0
- /package/{src → projects/unipin-angular/src}/assets/scss/grid.scss +0 -0
- /package/{src → projects/unipin-angular/src}/assets/scss/select.scss +0 -0
- /package/{lib/components/audit/index.d.ts → projects/unipin-angular/src/lib/components/audit/index.ts} +0 -0
- /package/{lib/components/buttons/index.d.ts → projects/unipin-angular/src/lib/components/buttons/index.ts} +0 -0
- /package/{lib/components/containers/list-container/index.d.ts → projects/unipin-angular/src/lib/components/containers/list-container/index.ts} +0 -0
- /package/{lib/components/forms/index.d.ts → projects/unipin-angular/src/lib/components/forms/index.ts} +0 -0
- /package/{lib/components/grids/index.d.ts → projects/unipin-angular/src/lib/components/grids/index.ts} +0 -0
- /package/{lib/components/infinite-scroll/index.d.ts → projects/unipin-angular/src/lib/components/infinite-scroll/index.ts} +0 -0
- /package/{lib/guards/index.d.ts → projects/unipin-angular/src/lib/guards/index.ts} +0 -0
- /package/{lib/interceptors/index.d.ts → projects/unipin-angular/src/lib/interceptors/index.ts} +0 -0
- /package/{lib/interfaces/index.d.ts → projects/unipin-angular/src/lib/interfaces/index.ts} +0 -0
- /package/{lib/modules/micro-frontend/index.d.ts → projects/unipin-angular/src/lib/modules/micro-frontend/index.ts} +0 -0
- /package/{lib/resolvers/index.d.ts → projects/unipin-angular/src/lib/resolvers/index.ts} +0 -0
- /package/{lib/services/index.d.ts → projects/unipin-angular/src/lib/services/index.ts} +0 -0
- /package/{lib/utils/index.d.ts → projects/unipin-angular/src/lib/utils/index.ts} +0 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { Attribute, ChangeDetectorRef, ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
2
|
+
import { AsyncPipe } from '@angular/common';
|
|
3
|
+
import { AbstractControl, ControlValueAccessor, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';
|
|
4
|
+
import { Observable, Subject, catchError, concat, debounceTime, distinctUntilChanged, map, of, switchMap, tap } from 'rxjs';
|
|
5
|
+
import { NgSelectComponent, NgSelectModule } from '@ng-select/ng-select';
|
|
6
|
+
import { getFormErrorMessage } from '../../../utils';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
standalone: true,
|
|
10
|
+
selector: 'up-searchable-select',
|
|
11
|
+
styleUrl: './form-searchable-select.component.scss',
|
|
12
|
+
templateUrl: './form-searchable-select.component.html',
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
host: {
|
|
15
|
+
class: 'd-block'
|
|
16
|
+
},
|
|
17
|
+
imports: [
|
|
18
|
+
AsyncPipe,
|
|
19
|
+
FormsModule,
|
|
20
|
+
NgSelectModule
|
|
21
|
+
],
|
|
22
|
+
providers: [
|
|
23
|
+
{
|
|
24
|
+
multi: true,
|
|
25
|
+
provide: NG_VALUE_ACCESSOR,
|
|
26
|
+
useExisting: FormSearchableSelectComponent
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
multi: true,
|
|
30
|
+
provide: NG_VALIDATORS,
|
|
31
|
+
useExisting: FormSearchableSelectComponent
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
export class FormSearchableSelectComponent implements ControlValueAccessor, Validator, OnChanges {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Input variable for the function to retrieve items based on a search keyword.
|
|
39
|
+
* @type {(keyword: string) => Observable<any>}
|
|
40
|
+
* @required
|
|
41
|
+
*/
|
|
42
|
+
@Input({ required: true }) public queryFunc!: (keyword: string) => Observable<any>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Input variable to determine whether the select input is clearable.
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
@Input() public clearable: boolean = true;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Input variable for the label associated with the select input.
|
|
53
|
+
* @type {string}
|
|
54
|
+
* @default ''
|
|
55
|
+
*/
|
|
56
|
+
@Input() public label: string = '';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Input variable for the initial items to be displayed in the select input.
|
|
60
|
+
* @type {any[]}
|
|
61
|
+
* @default []
|
|
62
|
+
*/
|
|
63
|
+
@Input() public initialItems: any[] = [];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Input variable to determine whether the select input is required.
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
@Input() public required: boolean = false;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Input variable to determine whether tags can be added to the select input.
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
@Input() public addTag: boolean = false;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Input variable to determine whether the select input is disabled.
|
|
81
|
+
* @type {boolean}
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
@Input() public disabled: boolean = false;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Input variable to determine whether the select input allows multiple selections.
|
|
88
|
+
* @type {boolean}
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
@Input() public multiple: boolean = false;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Input variable specifying the property to bind as the label for items in the select input.
|
|
95
|
+
* @type {string}
|
|
96
|
+
* @default 'label'
|
|
97
|
+
*/
|
|
98
|
+
@Input() public bindLabel: string = 'label';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Input variable specifying the property to bind as the value for items in the select input.
|
|
102
|
+
* @type {string}
|
|
103
|
+
* @default 'value'
|
|
104
|
+
*/
|
|
105
|
+
@Input() public bindValue: string = 'value';
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Input variable specifying append dropdown to body or any other element using css selector. For correct positioning body should have position:relative.
|
|
109
|
+
* @type {string}
|
|
110
|
+
* @default ''
|
|
111
|
+
*/
|
|
112
|
+
@Input() public appendTo: string = '';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Output variable to emit changes when the select input value changes.
|
|
116
|
+
* @type {EventEmitter<any>}
|
|
117
|
+
*/
|
|
118
|
+
@Output() public onChange: EventEmitter<any> = new EventEmitter<any>();
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* ViewChild for the ng-select component to act as helper to manipulate the ng-select component.
|
|
122
|
+
* @type {NgSelectComponent}
|
|
123
|
+
*/
|
|
124
|
+
@ViewChild(NgSelectComponent) public readonly ngSelect!: NgSelectComponent;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Subject for handling typeahead events to trigger item queries based on the search keyword.
|
|
128
|
+
* @type {Subject<string>}
|
|
129
|
+
*/
|
|
130
|
+
public readonly typeahead: Subject<string> = new Subject<string>();
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Observable for handling item queries based on the search keyword.
|
|
134
|
+
* @type {Observable<any[]>}
|
|
135
|
+
*/
|
|
136
|
+
protected readonly query$: Observable<any[]> = this.typeahead.pipe(
|
|
137
|
+
distinctUntilChanged(),
|
|
138
|
+
debounceTime(300),
|
|
139
|
+
tap(() => this.isLoading = true),
|
|
140
|
+
switchMap((k: string) => this.queryFunc(k).pipe(
|
|
141
|
+
map((result: any[]) => result.length === 0? this.initialItems : result),
|
|
142
|
+
catchError(() => of(this.initialItems))
|
|
143
|
+
)),
|
|
144
|
+
tap(() => this.isLoading = false)
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Observable for displaying items in the select input.
|
|
149
|
+
* @type {Observable<any[]>}
|
|
150
|
+
*/
|
|
151
|
+
public items$: Observable<any[]> = this.query$;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Boolean flag indicating whether the select input is loading.
|
|
155
|
+
* @type {boolean}
|
|
156
|
+
* @default false
|
|
157
|
+
*/
|
|
158
|
+
public isLoading: boolean = false;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Boolean flag indicating whether the select input has been touched.
|
|
162
|
+
* @type {boolean}
|
|
163
|
+
* @default false
|
|
164
|
+
*/
|
|
165
|
+
public isTouched: boolean = false;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The value of the select input.
|
|
169
|
+
* @type {any | null}
|
|
170
|
+
* @default null
|
|
171
|
+
*/
|
|
172
|
+
public value: any | null = null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Error message associated with the select input.
|
|
176
|
+
* @type {string}
|
|
177
|
+
* @default undefined
|
|
178
|
+
*/
|
|
179
|
+
public errorMsg!: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The form control associated with the select input.
|
|
183
|
+
* @type {AbstractControl}
|
|
184
|
+
*/
|
|
185
|
+
protected formControl!: AbstractControl;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Callback function to handle value changes in the select input.
|
|
189
|
+
* @type {(_val: any) => void}
|
|
190
|
+
*/
|
|
191
|
+
protected changed: (_val: any) => void = (_val: any) => {};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Callback function to handle touch events in the select input.
|
|
195
|
+
* @type {() => void}
|
|
196
|
+
*/
|
|
197
|
+
protected onTouched: () => void = () => {};
|
|
198
|
+
|
|
199
|
+
constructor(
|
|
200
|
+
@Attribute('placeholder') public placeholder: string,
|
|
201
|
+
protected readonly ch: ChangeDetectorRef
|
|
202
|
+
) { }
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Lifecycle hook called when changes occur to input properties.
|
|
206
|
+
* Updates the items$ observable when the initialItems input changes.
|
|
207
|
+
* @param {SimpleChanges} changes - Object containing the changed properties.
|
|
208
|
+
*/
|
|
209
|
+
public ngOnChanges(changes: SimpleChanges): void{
|
|
210
|
+
if (changes['initialItems']) this.items$ = concat(of(this.initialItems), this.query$);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Registers a callback function to be called when the select input value changes.
|
|
215
|
+
* @param {(_val: any) => void} fn - Callback function for value changes.
|
|
216
|
+
*/
|
|
217
|
+
public registerOnChange(fn: any): void{ this.changed = fn; }
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Registers a callback function to be called when the select input is touched.
|
|
221
|
+
* @param {() => void} fn - Callback function for touch events.
|
|
222
|
+
*/
|
|
223
|
+
public registerOnTouched(fn: any): void{ this.onTouched = fn; }
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Writes a new value to the select input.
|
|
227
|
+
* @param {*} val - The new value to be set.
|
|
228
|
+
*/
|
|
229
|
+
public writeValue(val: any): void{
|
|
230
|
+
this.value = val;
|
|
231
|
+
|
|
232
|
+
if (this.ngSelect && !val) {
|
|
233
|
+
this.ngSelect.handleClearClick();
|
|
234
|
+
}
|
|
235
|
+
this.ch.markForCheck();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Sets the disabled state of the select input.
|
|
240
|
+
* @param {boolean} d - The new disabled state.
|
|
241
|
+
*/
|
|
242
|
+
public setDisabledState?(d: boolean): void{
|
|
243
|
+
this.disabled = d;
|
|
244
|
+
this.ch.markForCheck();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Validates the select input.
|
|
249
|
+
* @param {AbstractControl} control - The abstract control representing the select input.
|
|
250
|
+
* @returns {(ValidationErrors | null)} - Validation errors if any, otherwise null.
|
|
251
|
+
*/
|
|
252
|
+
public validate(control: AbstractControl): ValidationErrors | null{
|
|
253
|
+
this.formControl = control;
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Event handler for changes in the select input.
|
|
259
|
+
* Emits the onChange event, updates the initialItems, and handles validation based on form control errors and label.
|
|
260
|
+
* @param {any} e - The event containing the new select input value.
|
|
261
|
+
*/
|
|
262
|
+
public change(e?: any): void{
|
|
263
|
+
this.onChange.emit(e);
|
|
264
|
+
this.initialItems = e;
|
|
265
|
+
|
|
266
|
+
if (!this.isTouched) {
|
|
267
|
+
this.onTouched();
|
|
268
|
+
this.isTouched = true;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (!this.disabled) {
|
|
272
|
+
if (!e) this.value = null;
|
|
273
|
+
else {
|
|
274
|
+
this.value = !this.multiple? e[this.bindValue] : e.map((o: any) => o[this.bindValue]);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
this.changed(this.value);
|
|
278
|
+
this.errorMsg = getFormErrorMessage(this.formControl.errors, this.label);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
import { argsToTemplate, moduleMetadata, type Meta, type StoryObj } from '@storybook/angular';
|
|
3
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
4
|
+
import { of } from 'rxjs';
|
|
5
|
+
import { FormSearchableSelectComponent } from './form-searchable-select.component';
|
|
6
|
+
|
|
7
|
+
const ctrl = new FormControl();
|
|
8
|
+
ctrl.markAsTouched();
|
|
9
|
+
|
|
10
|
+
const meta: Meta<FormSearchableSelectComponent> = {
|
|
11
|
+
title: 'Form/Searchable Select',
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
component: FormSearchableSelectComponent,
|
|
14
|
+
decorators: [
|
|
15
|
+
moduleMetadata({
|
|
16
|
+
imports: [ NgSelectModule, FormSearchableSelectComponent ],
|
|
17
|
+
})
|
|
18
|
+
],
|
|
19
|
+
argTypes: {
|
|
20
|
+
addTag: {
|
|
21
|
+
defaultValue: false,
|
|
22
|
+
description: 'Allows to create custom options.',
|
|
23
|
+
table: {
|
|
24
|
+
category: 'Input'
|
|
25
|
+
},
|
|
26
|
+
type: {
|
|
27
|
+
required: false,
|
|
28
|
+
name: 'boolean'
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
bindLabel: {
|
|
32
|
+
defaultValue: 'label',
|
|
33
|
+
description: 'Binds the property of the items to be displayed as the label in the dropdown. Default `label`.',
|
|
34
|
+
table: {
|
|
35
|
+
category: 'Input'
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
required: false,
|
|
39
|
+
name: 'string'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
bindValue: {
|
|
43
|
+
defaultValue: 'value',
|
|
44
|
+
description: 'Binds the property of the items to be used as the value when an option is selected.',
|
|
45
|
+
table: {
|
|
46
|
+
category: 'Input'
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
required: false,
|
|
50
|
+
name: 'string'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
clearable: {
|
|
54
|
+
defaultValue: true,
|
|
55
|
+
description: 'Allow to clear selected value. Default `true`',
|
|
56
|
+
table: {
|
|
57
|
+
category: 'Input'
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
required: false,
|
|
61
|
+
name: 'boolean'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
disabled: {
|
|
65
|
+
defaultValue: false,
|
|
66
|
+
description: 'If `true`, the user cannot interact with the select.',
|
|
67
|
+
table: {
|
|
68
|
+
category: 'Input'
|
|
69
|
+
},
|
|
70
|
+
type: {
|
|
71
|
+
required: false,
|
|
72
|
+
name: 'boolean'
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
initialItems: {
|
|
76
|
+
defaultValue: [],
|
|
77
|
+
description: 'The initial array of items to be displayed in the dropdown that available before fetching from the API.',
|
|
78
|
+
table: {
|
|
79
|
+
category: 'Input'
|
|
80
|
+
},
|
|
81
|
+
type: {
|
|
82
|
+
name: 'array',
|
|
83
|
+
value: {
|
|
84
|
+
name: 'string'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
label: {
|
|
89
|
+
defaultValue: undefined,
|
|
90
|
+
description: 'The visible label associated with the select',
|
|
91
|
+
table: {
|
|
92
|
+
category: 'Input'
|
|
93
|
+
},
|
|
94
|
+
type: {
|
|
95
|
+
required: false,
|
|
96
|
+
name: 'string'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
multiple: {
|
|
100
|
+
defaultValue: false,
|
|
101
|
+
description: 'Allows to select multiple items.',
|
|
102
|
+
table: {
|
|
103
|
+
category: 'Input'
|
|
104
|
+
},
|
|
105
|
+
type: {
|
|
106
|
+
required: false,
|
|
107
|
+
name: 'boolean'
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
placeholder: {
|
|
111
|
+
defaultValue: undefined,
|
|
112
|
+
description: 'Instructional text that shows before the select has a value.',
|
|
113
|
+
table: {
|
|
114
|
+
category: 'Input',
|
|
115
|
+
subcategory: 'Attribute'
|
|
116
|
+
},
|
|
117
|
+
type: {
|
|
118
|
+
required: false,
|
|
119
|
+
name: 'string'
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
queryFunc: {
|
|
123
|
+
defaultValue: undefined,
|
|
124
|
+
description: 'A function that takes a keyword as a parameter and returns an Observable of items based on the query.',
|
|
125
|
+
table: {
|
|
126
|
+
category: 'Input'
|
|
127
|
+
},
|
|
128
|
+
type: {
|
|
129
|
+
required: true,
|
|
130
|
+
name: 'string'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
required: {
|
|
134
|
+
defaultValue: false,
|
|
135
|
+
description: 'If `true`, the user must fill in a value before submitting a form.',
|
|
136
|
+
table: {
|
|
137
|
+
category: 'Input'
|
|
138
|
+
},
|
|
139
|
+
type: {
|
|
140
|
+
required: false,
|
|
141
|
+
name: 'boolean'
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
change: {
|
|
145
|
+
table: { disable: true },
|
|
146
|
+
control: { disable: true }
|
|
147
|
+
},
|
|
148
|
+
errorMsg: {
|
|
149
|
+
table: { disable: true },
|
|
150
|
+
control: { disable: true }
|
|
151
|
+
},
|
|
152
|
+
items$: {
|
|
153
|
+
table: { disable: true },
|
|
154
|
+
control: { disable: true }
|
|
155
|
+
},
|
|
156
|
+
isLoading: {
|
|
157
|
+
table: { disable: true },
|
|
158
|
+
control: { disable: true }
|
|
159
|
+
},
|
|
160
|
+
isTouched: {
|
|
161
|
+
table: { disable: true },
|
|
162
|
+
control: { disable: true }
|
|
163
|
+
},
|
|
164
|
+
ngOnChanges: {
|
|
165
|
+
table: { disable: true },
|
|
166
|
+
control: { disable: true }
|
|
167
|
+
},
|
|
168
|
+
onChange: {
|
|
169
|
+
table: { disable: true },
|
|
170
|
+
control: { disable: true }
|
|
171
|
+
},
|
|
172
|
+
registerOnChange: {
|
|
173
|
+
table: { disable: true },
|
|
174
|
+
control: { disable: true }
|
|
175
|
+
},
|
|
176
|
+
registerOnTouched: {
|
|
177
|
+
table: { disable: true },
|
|
178
|
+
control: { disable: true }
|
|
179
|
+
},
|
|
180
|
+
setDisabledState: {
|
|
181
|
+
table: { disable: true },
|
|
182
|
+
control: { disable: true }
|
|
183
|
+
},
|
|
184
|
+
typeahead: {
|
|
185
|
+
table: { disable: true },
|
|
186
|
+
control: { disable: true }
|
|
187
|
+
},
|
|
188
|
+
validate: {
|
|
189
|
+
table: { disable: true },
|
|
190
|
+
control: { disable: true }
|
|
191
|
+
},
|
|
192
|
+
value: {
|
|
193
|
+
table: { disable: true },
|
|
194
|
+
control: { disable: true }
|
|
195
|
+
},
|
|
196
|
+
writeValue: {
|
|
197
|
+
table: { disable: true },
|
|
198
|
+
control: { disable: true }
|
|
199
|
+
},
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export default meta;
|
|
204
|
+
type Story = StoryObj<FormSearchableSelectComponent>;
|
|
205
|
+
|
|
206
|
+
export const Default: Story = {
|
|
207
|
+
args: {
|
|
208
|
+
label: 'Country',
|
|
209
|
+
initialItems: [{ label: 'Indonesia', value: 'ID' }, { label: 'Malaysia', value: 'MY' }],
|
|
210
|
+
queryFunc: (name: string) => {
|
|
211
|
+
return of([{ label: name, value: name }]);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
render: (props) => ({
|
|
215
|
+
props,
|
|
216
|
+
template: `
|
|
217
|
+
<div style="width: 250px">
|
|
218
|
+
<up-searchable-select ${ argsToTemplate(props) } />
|
|
219
|
+
</div>
|
|
220
|
+
`
|
|
221
|
+
})
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const Required: Story = {
|
|
225
|
+
args: {
|
|
226
|
+
...Default.args,
|
|
227
|
+
required: true
|
|
228
|
+
},
|
|
229
|
+
render: (props) => ({
|
|
230
|
+
props,
|
|
231
|
+
template: `
|
|
232
|
+
<div style="width: 250px">
|
|
233
|
+
<up-searchable-select ${ argsToTemplate(props) } />
|
|
234
|
+
</div>
|
|
235
|
+
`
|
|
236
|
+
})
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const Disabled: Story = {
|
|
240
|
+
args: {
|
|
241
|
+
...Default.args,
|
|
242
|
+
disabled: true,
|
|
243
|
+
},
|
|
244
|
+
render: (props) => ({
|
|
245
|
+
props,
|
|
246
|
+
template: `
|
|
247
|
+
<div style="width: 250px">
|
|
248
|
+
<up-searchable-select ${ argsToTemplate(props) } />
|
|
249
|
+
</div>
|
|
250
|
+
`
|
|
251
|
+
})
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const Error: Story = {
|
|
255
|
+
args: {
|
|
256
|
+
...Required.args,
|
|
257
|
+
errorMsg: 'Field is required',
|
|
258
|
+
},
|
|
259
|
+
render: (props) => ({
|
|
260
|
+
props,
|
|
261
|
+
template: `
|
|
262
|
+
<div style="width: 250px">
|
|
263
|
+
<up-searchable-select ${ argsToTemplate(props) } />
|
|
264
|
+
</div>
|
|
265
|
+
`
|
|
266
|
+
})
|
|
267
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<label class="form-label d-flex align-items-center" [class.required]="required">
|
|
2
|
+
<ng-content select="[icon]"/>
|
|
3
|
+
<span>{{ label }}</span>
|
|
4
|
+
</label>
|
|
5
|
+
|
|
6
|
+
<ng-select
|
|
7
|
+
bindLabel="{{ bindLabel }}"
|
|
8
|
+
bindValue="{{ bindValue }}"
|
|
9
|
+
placeholder="{{ placeholder }}"
|
|
10
|
+
[virtualScroll]="true"
|
|
11
|
+
[items]="items"
|
|
12
|
+
[ngModel]="value"
|
|
13
|
+
[addTag]="addTag"
|
|
14
|
+
[multiple]="multiple"
|
|
15
|
+
[readonly]="disabled"
|
|
16
|
+
[appendTo]="appendTo"
|
|
17
|
+
[clearable]="clearable"
|
|
18
|
+
[searchable]="searchable"
|
|
19
|
+
[groupBy]="groupBy"
|
|
20
|
+
(change)="change($event);"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
@if (errorMsg) {
|
|
24
|
+
<label class="is-invalid">{{ errorMsg }}</label>
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./../../../../assets/scss/select.scss";
|