@unipin/angular-applet 18.9.2 → 18.9.4
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 +112 -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 +73 -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 +24 -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 +216 -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 -888
- 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 -4564
- package/fesm2022/unipin-angular-applet.mjs.map +0 -1
- package/graphql/generated.d.ts +0 -15719
- 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
package/projects/unipin-angular/src/lib/components/forms/currency-input/form-currency-input.spec.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
4
|
+
import { Observable, of } from 'rxjs';
|
|
5
|
+
import { FormCurrencyInputComponent } from './form-currency-input.component';
|
|
6
|
+
import { CurrencyService } from '../../../services';
|
|
7
|
+
|
|
8
|
+
describe('FormCurrencyInputComponent', () => {
|
|
9
|
+
let component: FormCurrencyInputComponent;
|
|
10
|
+
let fixture: ComponentFixture<FormCurrencyInputComponent>;
|
|
11
|
+
let currencyServiceStub: Partial<CurrencyService>;
|
|
12
|
+
|
|
13
|
+
currencyServiceStub = {
|
|
14
|
+
query: (): Observable<any> => {
|
|
15
|
+
return of({
|
|
16
|
+
data: {
|
|
17
|
+
webConfigMsCurrency: {
|
|
18
|
+
data: [
|
|
19
|
+
{ code: 'IDR', name: 'Indonesia Rupiah', magnifyValue: 0 },
|
|
20
|
+
{ code: 'MYR', name: 'Malaysia Ringgit', magnifyValue: 100 }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
beforeEach(waitForAsync(() => {
|
|
29
|
+
TestBed.configureTestingModule({
|
|
30
|
+
declarations: [FormCurrencyInputComponent],
|
|
31
|
+
imports: [FormsModule, NgSelectModule],
|
|
32
|
+
providers: [{ provide: CurrencyService, useValue: currencyServiceStub }]
|
|
33
|
+
}).compileComponents();
|
|
34
|
+
}));
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
fixture = TestBed.createComponent(FormCurrencyInputComponent);
|
|
38
|
+
component = fixture.componentInstance;
|
|
39
|
+
fixture.detectChanges();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should create', () => {
|
|
43
|
+
expect(component).toBeTruthy();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should have correct initial values', () => {
|
|
47
|
+
expect(component.clearable).toBe(true);
|
|
48
|
+
expect(component.isInputNumber).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// it('ngOnInit should set bindLabel to value when isInputNumber is true', () => {
|
|
52
|
+
// component.isInputNumber = true;
|
|
53
|
+
// expect(component.bindLabel).toBe('value');
|
|
54
|
+
// });
|
|
55
|
+
|
|
56
|
+
// it('ngOnChanges should update items$ and decimalLimiter when initialItems change', () => {
|
|
57
|
+
// const mockInitialItems = [{ label: 'Indonesia Rupiah', value: 'IDR', magnifyValue: 0 }];
|
|
58
|
+
// component.initialItems = mockInitialItems;
|
|
59
|
+
// component.ngOnChanges({ initialItems: {
|
|
60
|
+
// currentValue: mockInitialItems,
|
|
61
|
+
// previousValue: undefined,
|
|
62
|
+
// firstChange: false,
|
|
63
|
+
// isFirstChange: function (): boolean {
|
|
64
|
+
// throw new Error('Function not implemented.');
|
|
65
|
+
// }
|
|
66
|
+
// } });
|
|
67
|
+
// expect(component.items$).toBeDefined();
|
|
68
|
+
// });
|
|
69
|
+
|
|
70
|
+
it('writeValue should set the value correctly', () => {
|
|
71
|
+
const mockValue = { label: 'Indonesia Rupiah', value: 'IDR', magnifyValue: 0 };
|
|
72
|
+
component.writeValue(mockValue);
|
|
73
|
+
expect(component.value).toEqual(mockValue);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('validate should return null', () => {
|
|
77
|
+
const mockFormControl: any = {};
|
|
78
|
+
const validation = component.validate(mockFormControl);
|
|
79
|
+
expect(validation).toBeNull();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// it('change should emit correct values and update internal state', () => {
|
|
83
|
+
// const mockValue = { label: 'IDR', value: 'Indonesia Rupiah', magnifyValue: 0 };
|
|
84
|
+
// spyOn(component.onChange, 'emit');
|
|
85
|
+
// component.change(mockValue);
|
|
86
|
+
// expect(component.onChange.emit).toHaveBeenCalledWith({ ccy: mockValue, number: null });
|
|
87
|
+
// expect(component.initialItems).toEqual([mockValue]);
|
|
88
|
+
// expect(component.isTouched).toBe(true);
|
|
89
|
+
// });
|
|
90
|
+
|
|
91
|
+
// it('numberInput should update numberValue and emit correct event', () => {
|
|
92
|
+
// const mockValue = 100;
|
|
93
|
+
// spyOn(component.onChange, 'emit');
|
|
94
|
+
// component.numberInput({ value: mockValue });
|
|
95
|
+
// expect(component.numberValue).toBe(mockValue);
|
|
96
|
+
// expect(component.onChange.emit).toHaveBeenCalledWith({ ccy: component.initialItems, number: mockValue });
|
|
97
|
+
// });
|
|
98
|
+
|
|
99
|
+
it('limitDecimal should limit the number of decimal places allowed', () => {
|
|
100
|
+
const mockEvent: any = { charCode: 46, preventDefault: () => {}, target: { value: '10.00' }};
|
|
101
|
+
spyOn(mockEvent, 'preventDefault');
|
|
102
|
+
component.limitDecimal(mockEvent);
|
|
103
|
+
expect(mockEvent.preventDefault).toHaveBeenCalled();
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// it('queryFunc should return correct data based on the provided keyword', () => {
|
|
107
|
+
// component.items$.subscribe((data) => {
|
|
108
|
+
// expect(data).toEqual([{ label: 'Indonesia Rupiah', value: 'IDR', magnifyValue: 0 }]);
|
|
109
|
+
// });
|
|
110
|
+
// });
|
|
111
|
+
|
|
112
|
+
// it('typeahead should emit correct values and trigger queryFunc', () => {
|
|
113
|
+
// const mockKeyword = 'IDR';
|
|
114
|
+
// component.typeahead.next(mockKeyword);
|
|
115
|
+
// component.items$.subscribe((data) => {
|
|
116
|
+
// expect(data).toEqual([{ label: 'Indonesia Rupiah', value: 'IDR', magnifyValue: 0 }]);
|
|
117
|
+
// });
|
|
118
|
+
// });
|
|
119
|
+
});
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { importProvidersFrom } from '@angular/core';
|
|
2
|
+
import { provideHttpClient } from '@angular/common/http';
|
|
3
|
+
import { FormControl } from '@angular/forms';
|
|
4
|
+
import { InMemoryCache } from '@apollo/client';
|
|
5
|
+
import { APOLLO_OPTIONS, ApolloModule } from 'apollo-angular';
|
|
6
|
+
import { HttpLink } from 'apollo-angular/http';
|
|
7
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
8
|
+
import { moduleMetadata, type Meta, type StoryObj, applicationConfig, argsToTemplate } from '@storybook/angular';
|
|
9
|
+
import { FormCurrencyInputComponent } from './form-currency-input.component';
|
|
10
|
+
|
|
11
|
+
const ctrl = new FormControl();
|
|
12
|
+
ctrl.markAsTouched();
|
|
13
|
+
|
|
14
|
+
const meta: Meta<FormCurrencyInputComponent> = {
|
|
15
|
+
title: 'Form/Currency Input',
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
component: FormCurrencyInputComponent,
|
|
18
|
+
decorators: [
|
|
19
|
+
applicationConfig({
|
|
20
|
+
providers: [
|
|
21
|
+
provideHttpClient(),
|
|
22
|
+
importProvidersFrom([
|
|
23
|
+
ApolloModule
|
|
24
|
+
]),
|
|
25
|
+
{
|
|
26
|
+
provide: APOLLO_OPTIONS,
|
|
27
|
+
deps: [ HttpLink ],
|
|
28
|
+
useFactory: (httpLink: HttpLink) => ({ cache: new InMemoryCache(), link: httpLink.create({ uri: 'https://ms-gateway.up.unipin.dev/graphql' }) }),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
}),
|
|
32
|
+
moduleMetadata({
|
|
33
|
+
imports: [ NgSelectModule, FormCurrencyInputComponent ],
|
|
34
|
+
})
|
|
35
|
+
],
|
|
36
|
+
argTypes: {
|
|
37
|
+
clearable: {
|
|
38
|
+
defaultValue: true,
|
|
39
|
+
description: 'Allow to clear selected value. Default `true`',
|
|
40
|
+
table: {
|
|
41
|
+
category: 'Input'
|
|
42
|
+
},
|
|
43
|
+
type: {
|
|
44
|
+
required: false,
|
|
45
|
+
name: 'boolean'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
disabled: {
|
|
49
|
+
defaultValue: false,
|
|
50
|
+
description: 'If `true`, the user cannot interact with the select.',
|
|
51
|
+
table: {
|
|
52
|
+
category: 'Input'
|
|
53
|
+
},
|
|
54
|
+
type: {
|
|
55
|
+
required: false,
|
|
56
|
+
name: 'boolean'
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
isInputNumber: {
|
|
60
|
+
defaultValue: false,
|
|
61
|
+
description: 'If true the input number form will shown.',
|
|
62
|
+
table: {
|
|
63
|
+
category: 'Input'
|
|
64
|
+
},
|
|
65
|
+
type: {
|
|
66
|
+
name: 'boolean',
|
|
67
|
+
required: false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
isNumberDisabled: {
|
|
71
|
+
defaultValue: false,
|
|
72
|
+
description: 'If `true`, the user cannot interact with the input number.',
|
|
73
|
+
table: {
|
|
74
|
+
category: 'Input'
|
|
75
|
+
},
|
|
76
|
+
type: {
|
|
77
|
+
required: false,
|
|
78
|
+
name: 'boolean'
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
numberValue: {
|
|
82
|
+
defaultValue: null,
|
|
83
|
+
description: 'To set the input number form value.',
|
|
84
|
+
table: {
|
|
85
|
+
category: 'Input'
|
|
86
|
+
},
|
|
87
|
+
type: {
|
|
88
|
+
required: false,
|
|
89
|
+
name: 'number'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
numberPlaceholder: {
|
|
93
|
+
defaultValue: undefined,
|
|
94
|
+
description: 'Instructional text that shows before the input number has a value.',
|
|
95
|
+
table: {
|
|
96
|
+
category: 'Input',
|
|
97
|
+
subcategory: 'Attribute'
|
|
98
|
+
},
|
|
99
|
+
type: {
|
|
100
|
+
required: false,
|
|
101
|
+
name: 'string'
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
required: {
|
|
105
|
+
defaultValue: false,
|
|
106
|
+
description: 'If `true`, the user must fill in a value before submitting a form.',
|
|
107
|
+
table: {
|
|
108
|
+
category: 'Input'
|
|
109
|
+
},
|
|
110
|
+
type: {
|
|
111
|
+
required: false,
|
|
112
|
+
name: 'boolean'
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
change: {
|
|
116
|
+
table: { disable: true },
|
|
117
|
+
control: { disable: true }
|
|
118
|
+
},
|
|
119
|
+
errorMsg: {
|
|
120
|
+
table: { disable: true },
|
|
121
|
+
control: { disable: true }
|
|
122
|
+
},
|
|
123
|
+
isLoading: {
|
|
124
|
+
table: { disable: true },
|
|
125
|
+
control: { disable: true }
|
|
126
|
+
},
|
|
127
|
+
isTouched: {
|
|
128
|
+
table: { disable: true },
|
|
129
|
+
control: { disable: true }
|
|
130
|
+
},
|
|
131
|
+
limitDecimal: {
|
|
132
|
+
table: { disable: true },
|
|
133
|
+
control: { disable: true }
|
|
134
|
+
},
|
|
135
|
+
numberInput: {
|
|
136
|
+
table: { disable: true },
|
|
137
|
+
control: { disable: true }
|
|
138
|
+
},
|
|
139
|
+
onChange: {
|
|
140
|
+
table: { disable: true },
|
|
141
|
+
control: { disable: true }
|
|
142
|
+
},
|
|
143
|
+
registerOnChange: {
|
|
144
|
+
table: { disable: true },
|
|
145
|
+
control: { disable: true }
|
|
146
|
+
},
|
|
147
|
+
registerOnTouched: {
|
|
148
|
+
table: { disable: true },
|
|
149
|
+
control: { disable: true }
|
|
150
|
+
},
|
|
151
|
+
setDisabledState: {
|
|
152
|
+
table: { disable: true },
|
|
153
|
+
control: { disable: true }
|
|
154
|
+
},
|
|
155
|
+
validate: {
|
|
156
|
+
table: { disable: true },
|
|
157
|
+
control: { disable: true }
|
|
158
|
+
},
|
|
159
|
+
value: {
|
|
160
|
+
table: { disable: true },
|
|
161
|
+
control: { disable: true }
|
|
162
|
+
},
|
|
163
|
+
writeValue: {
|
|
164
|
+
table: { disable: true },
|
|
165
|
+
control: { disable: true }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export default meta;
|
|
171
|
+
type Story = StoryObj<FormCurrencyInputComponent>;
|
|
172
|
+
|
|
173
|
+
export const Default: Story = {
|
|
174
|
+
render: (props) => ({
|
|
175
|
+
props,
|
|
176
|
+
template: `
|
|
177
|
+
<div style="width: 400px">
|
|
178
|
+
<up-currency-input ${ argsToTemplate(props) } />
|
|
179
|
+
</div>
|
|
180
|
+
`,
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const Required: Story = {
|
|
185
|
+
args: {
|
|
186
|
+
...Default.args,
|
|
187
|
+
required: true
|
|
188
|
+
},
|
|
189
|
+
render: (props) => ({
|
|
190
|
+
props,
|
|
191
|
+
template: `
|
|
192
|
+
<div style="width: 400px">
|
|
193
|
+
<up-currency-input ${ argsToTemplate(props) } />
|
|
194
|
+
</div>
|
|
195
|
+
`,
|
|
196
|
+
}),
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const Disabled: Story = {
|
|
200
|
+
args: {
|
|
201
|
+
...Default.args,
|
|
202
|
+
disabled: true,
|
|
203
|
+
},
|
|
204
|
+
render: (props) => ({
|
|
205
|
+
props,
|
|
206
|
+
template: `
|
|
207
|
+
<div style="width: 400px">
|
|
208
|
+
<up-currency-input ${ argsToTemplate(props) } />
|
|
209
|
+
</div>
|
|
210
|
+
`,
|
|
211
|
+
}),
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const Error: Story = {
|
|
215
|
+
args: {
|
|
216
|
+
...Required.args,
|
|
217
|
+
errorMsg: 'Field is required',
|
|
218
|
+
},
|
|
219
|
+
render: (props) => ({
|
|
220
|
+
props,
|
|
221
|
+
template: `
|
|
222
|
+
<div style="width: 400px">
|
|
223
|
+
<up-currency-input ${ argsToTemplate(props) } />
|
|
224
|
+
</div>
|
|
225
|
+
`,
|
|
226
|
+
}),
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const ShowInputNumber: Story = {
|
|
230
|
+
args: {
|
|
231
|
+
...Required.args,
|
|
232
|
+
isInputNumber: true,
|
|
233
|
+
numberPlaceholder: 'Amount'
|
|
234
|
+
},
|
|
235
|
+
render: (props) => ({
|
|
236
|
+
props,
|
|
237
|
+
template: `
|
|
238
|
+
<div style="width: 400px">
|
|
239
|
+
<up-currency-input ${ argsToTemplate(props) } />
|
|
240
|
+
</div>
|
|
241
|
+
`,
|
|
242
|
+
}),
|
|
243
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<label class="form-label d-flex align-items-center">
|
|
2
|
+
<ng-content select="[icon]" />
|
|
3
|
+
<span>{{ label }}</span>
|
|
4
|
+
</label>
|
|
5
|
+
|
|
6
|
+
<input readonly type="text" id="{{ name }}-date" placeholder="{{ placeholder }}" class="form-control cursor-pointer" [disabled]="disabled" [required]="required" [value]="value | date:dateFormat ">
|
|
7
|
+
<ion-icon name="calendar" class="position-absolute fs-4 cursor-pointer" />
|
|
8
|
+
|
|
9
|
+
<ion-modal trigger="{{ name }}-date">
|
|
10
|
+
<ng-template>
|
|
11
|
+
<ion-datetime
|
|
12
|
+
mode="md"
|
|
13
|
+
hourCycle="h23"
|
|
14
|
+
value="{{ localValue }}"
|
|
15
|
+
[min]="minDate"
|
|
16
|
+
[max]="maxDate"
|
|
17
|
+
[showDefaultButtons]="true"
|
|
18
|
+
[presentation]="presentation"
|
|
19
|
+
[showClearButton]="clearButton"
|
|
20
|
+
(ionChange)="changeDate($event)"
|
|
21
|
+
/>
|
|
22
|
+
</ng-template>
|
|
23
|
+
</ion-modal>
|
|
24
|
+
|
|
25
|
+
@if (errorMsg) {
|
|
26
|
+
<label class="is-invalid">{{ errorMsg }}</label>
|
|
27
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Attribute, ChangeDetectorRef, ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { DatePipe } from '@angular/common';
|
|
3
|
+
import { AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';
|
|
4
|
+
import { IonicModule } from '@ionic/angular';
|
|
5
|
+
import { getFormErrorMessage } from '../../../utils';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
standalone: true,
|
|
9
|
+
selector: 'up-date',
|
|
10
|
+
styleUrl: './form-date.component.scss',
|
|
11
|
+
templateUrl: './form-date.component.html',
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
host: {
|
|
14
|
+
class: 'd-block position-relative'
|
|
15
|
+
},
|
|
16
|
+
imports: [
|
|
17
|
+
DatePipe,
|
|
18
|
+
IonicModule
|
|
19
|
+
],
|
|
20
|
+
providers: [
|
|
21
|
+
{
|
|
22
|
+
multi: true,
|
|
23
|
+
provide: NG_VALUE_ACCESSOR,
|
|
24
|
+
useExisting: FormDateComponent
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
multi: true,
|
|
28
|
+
provide: NG_VALIDATORS,
|
|
29
|
+
useExisting: FormDateComponent
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
export class FormDateComponent implements ControlValueAccessor, Validator, OnInit {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Input variable for the name associated with the date input.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @required
|
|
39
|
+
*/
|
|
40
|
+
@Input({ required: true }) public name!: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Input variable for the label associated with the date input.
|
|
44
|
+
* @type {string | undefined}
|
|
45
|
+
*/
|
|
46
|
+
@Input() public label?: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Input variable to determine whether the date input is required.
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
@Input() public required: boolean = false;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Input variable to determine whether the date input is disabled.
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
@Input() public disabled: boolean = false;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Input variable to determine whether the date picker is date only or date and time.
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @default 'date'
|
|
66
|
+
*/
|
|
67
|
+
@Input() public presentation: 'date' | 'date-time' | 'month-year' = 'date';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Input variable to determine what is the minimum date allowed.
|
|
71
|
+
* @type {string}
|
|
72
|
+
*/
|
|
73
|
+
@Input() public minDate?: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Input variable to determine what is the maximum date allowed.
|
|
77
|
+
* @type {string}
|
|
78
|
+
*/
|
|
79
|
+
@Input() public maxDate?: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Input variable to determine if the date picker should show a clear button
|
|
83
|
+
* @type {boolean}
|
|
84
|
+
*/
|
|
85
|
+
@Input() public clearButton: boolean = false;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The format of date.
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @default 'dd LLL yyyy'
|
|
91
|
+
*/
|
|
92
|
+
@Input() public dateFormat: string = 'dd LLL yyyy';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Boolean flag indicating whether the date input has been touched.
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
public isTouched: boolean = false;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The value of the date input.
|
|
103
|
+
* @type {string}
|
|
104
|
+
* @default ''
|
|
105
|
+
*/
|
|
106
|
+
public value: string = '';
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The value of the localization date.
|
|
110
|
+
* @type {string}
|
|
111
|
+
* @default ''
|
|
112
|
+
*/
|
|
113
|
+
public localValue: string= '';
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Error message associated with the date input.
|
|
117
|
+
* @type {string}
|
|
118
|
+
* @default undefined
|
|
119
|
+
*/
|
|
120
|
+
public errorMsg!: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The form control associated with the date input.
|
|
124
|
+
* @type {AbstractControl}
|
|
125
|
+
*/
|
|
126
|
+
protected formControl!: AbstractControl;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Callback function to handle value changes in the date input.
|
|
130
|
+
* @type {(_val: any) => void}
|
|
131
|
+
*/
|
|
132
|
+
protected onChange: (_val: any) => void = (_val: any) => {};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Callback function to handle touch events in the date input.
|
|
136
|
+
* @type {() => void}
|
|
137
|
+
*/
|
|
138
|
+
protected onTouched: () => void = () => {};
|
|
139
|
+
|
|
140
|
+
constructor(
|
|
141
|
+
@Attribute('placeholder') public placeholder: string,
|
|
142
|
+
protected readonly ch: ChangeDetectorRef
|
|
143
|
+
) {}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Lifecycle hook called a moment before the component is created.
|
|
147
|
+
* Check if the presentation is 'date-time' then the date format should be changed to dd LLL yyyy HH:mm.
|
|
148
|
+
*/
|
|
149
|
+
public ngOnInit(): void{
|
|
150
|
+
if (this.presentation === 'date-time') this.dateFormat = `${ this.dateFormat } HH:mm`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Registers a callback function to be called when the date input value changes.
|
|
155
|
+
* @param {(_val: any) => void} fn - Callback function for value changes.
|
|
156
|
+
*/
|
|
157
|
+
public registerOnChange(fn: any): void{ this.onChange = fn; }
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Registers a callback function to be called when the date input is touched.
|
|
161
|
+
* @param {() => void} fn - Callback function for touch events.
|
|
162
|
+
*/
|
|
163
|
+
public registerOnTouched(fn: any): void{ this.onTouched = fn; }
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Writes a new value to the date input.
|
|
167
|
+
* Calculate and writes the local value for ionic datetime picker.
|
|
168
|
+
* @param {*} val - The new value to be set.
|
|
169
|
+
*/
|
|
170
|
+
public writeValue(val: any): void{
|
|
171
|
+
this.value = val;
|
|
172
|
+
if (!val) {
|
|
173
|
+
this.ch.markForCheck();
|
|
174
|
+
return;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
let localTime = new Date(val);
|
|
178
|
+
|
|
179
|
+
localTime = new Date(localTime.getTime() - (localTime.getTimezoneOffset() * 60000));
|
|
180
|
+
this.localValue = localTime.toISOString();
|
|
181
|
+
|
|
182
|
+
this.ch.markForCheck();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Sets the disabled state of the date input.
|
|
187
|
+
* @param {boolean} d - Whether the date input should be disabled or not.
|
|
188
|
+
*/
|
|
189
|
+
public setDisabledState?(d: boolean): void{
|
|
190
|
+
this.disabled = d;
|
|
191
|
+
this.ch.markForCheck();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Validates the date input.
|
|
196
|
+
* @param {AbstractControl} control - The abstract control representing the date input.
|
|
197
|
+
* @returns {(ValidationErrors | null)} - Validation errors if any, otherwise null.
|
|
198
|
+
*/
|
|
199
|
+
public validate(control: AbstractControl): ValidationErrors | null{
|
|
200
|
+
this.formControl = control;
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Event handler for date changes in the date input.
|
|
206
|
+
* If not touched, marks the input as touched.
|
|
207
|
+
* If not disabled, updates the value, triggers change detection, and emits the change event.
|
|
208
|
+
* Updates the error message based on form control errors and label.
|
|
209
|
+
* @param {any} param0 - Event detail containing the new date value.
|
|
210
|
+
*/
|
|
211
|
+
public changeDate({ detail: { value }}: any): void{
|
|
212
|
+
if (!this.isTouched) {
|
|
213
|
+
this.onTouched();
|
|
214
|
+
this.isTouched = true;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (!this.disabled) {
|
|
218
|
+
this.value = this.localValue = value;
|
|
219
|
+
this.ch.markForCheck();
|
|
220
|
+
|
|
221
|
+
this.onChange(this.value);
|
|
222
|
+
this.errorMsg = getFormErrorMessage(this.formControl.errors, this.label);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|