@sarasanalytics-com/design-system 0.0.43 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -34
- package/esm2022/interfaces/avatar-interface.mjs +2 -0
- package/esm2022/interfaces/button-interface.mjs +10 -0
- package/esm2022/interfaces/card-carousel-interface.mjs +2 -0
- package/esm2022/interfaces/chip-interface.mjs +2 -0
- package/esm2022/interfaces/grid-interface.mjs +2 -0
- package/esm2022/interfaces/guide-card-interface.mjs +2 -0
- package/esm2022/interfaces/icon-interface.mjs +16 -0
- package/esm2022/interfaces/message-banner.mjs +2 -0
- package/esm2022/interfaces/option-interface.mjs +2 -0
- package/esm2022/interfaces/select-interface.mjs +2 -0
- package/esm2022/interfaces/tab-interface.mjs +2 -0
- package/esm2022/interfaces/toast-interface.mjs +2 -0
- package/esm2022/lib/accordion/accordion.component.mjs +115 -0
- package/esm2022/lib/avatar/avatar.component.mjs +56 -0
- package/esm2022/lib/button/button.component.mjs +100 -0
- package/esm2022/lib/calendar-header/calendar-header.component.mjs +168 -0
- package/esm2022/lib/card/card-body/card-body.component.mjs +11 -0
- package/esm2022/lib/card/card-custom-header/card-custom-header.component.mjs +11 -0
- package/esm2022/lib/card/card-footer-actions/card-footer-actions.component.mjs +11 -0
- package/esm2022/lib/card/card-icon/card-icon.component.mjs +11 -0
- package/esm2022/lib/card/card-title-actions/card-title-actions.component.mjs +11 -0
- package/esm2022/lib/card/card.component.mjs +97 -0
- package/esm2022/lib/card/checkbox-card/checkbox-card.component.mjs +41 -0
- package/esm2022/lib/card/guide-card/guide-card.component.mjs +19 -0
- package/esm2022/lib/card-carousel/card-carousel.component.mjs +87 -0
- package/esm2022/lib/checkbox/checkbox.component.mjs +38 -0
- package/esm2022/lib/chips/chips.component.mjs +62 -0
- package/esm2022/lib/component-library.component.mjs +19 -0
- package/esm2022/lib/component-library.service.mjs +14 -0
- package/esm2022/lib/datepicker/datepicker.component.mjs +40 -0
- package/esm2022/lib/form-input/form-input.component.mjs +219 -0
- package/esm2022/lib/form-select/form-select.component.mjs +77 -0
- package/esm2022/lib/grid-cell/grid-cell.component.mjs +84 -0
- package/esm2022/lib/header/header.component.mjs +37 -0
- package/esm2022/lib/icon/icon.component.mjs +73 -0
- package/esm2022/lib/icon/icon.service.mjs +28 -0
- package/esm2022/lib/left-nav/left-nav.component.mjs +146 -0
- package/esm2022/lib/list/list.component.mjs +23 -0
- package/esm2022/lib/message-banner/message-banner.component.mjs +43 -0
- package/esm2022/lib/page-layout/page-layout.component.mjs +21 -0
- package/esm2022/lib/progress-bar/progress-bar.component.mjs +29 -0
- package/esm2022/lib/radio-button/radio-button.component.mjs +33 -0
- package/esm2022/lib/scrolling-cards/scrolling-cards.component.mjs +59 -0
- package/esm2022/lib/spinner/spinner.component.mjs +22 -0
- package/esm2022/lib/stepper/stepper.component.mjs +64 -0
- package/esm2022/lib/tabs/tabs.component.mjs +38 -0
- package/esm2022/lib/toast/toast.component.mjs +100 -0
- package/esm2022/lib/tool-tip/tool-tip.component.mjs +41 -0
- package/esm2022/public-api.mjs +56 -0
- package/esm2022/sarasanalytics-com-design-system.mjs +5 -0
- package/esm2022/utils/validators.mjs +97 -0
- package/fesm2022/sarasanalytics-com-design-system.mjs +1987 -0
- package/fesm2022/sarasanalytics-com-design-system.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/interfaces/avatar-interface.d.ts +6 -0
- package/interfaces/button-interface.d.ts +22 -0
- package/{projects/component-library/src/interfaces/card-carousel-interface.ts → interfaces/card-carousel-interface.d.ts} +1 -2
- package/interfaces/chip-interface.d.ts +11 -0
- package/interfaces/grid-interface.d.ts +24 -0
- package/interfaces/icon-interface.d.ts +4 -0
- package/interfaces/select-interface.d.ts +20 -0
- package/interfaces/tab-interface.d.ts +6 -0
- package/{projects/component-library/src/interfaces/toast-interface.ts → interfaces/toast-interface.d.ts} +1 -1
- package/lib/accordion/accordion.component.d.ts +25 -0
- package/lib/avatar/avatar.component.d.ts +18 -0
- package/lib/button/button.component.d.ts +32 -0
- package/lib/calendar-header/calendar-header.component.d.ts +31 -0
- package/lib/card/card-body/card-body.component.d.ts +5 -0
- package/lib/card/card-custom-header/card-custom-header.component.d.ts +5 -0
- package/lib/card/card-footer-actions/card-footer-actions.component.d.ts +5 -0
- package/lib/card/card-icon/card-icon.component.d.ts +5 -0
- package/lib/card/card-title-actions/card-title-actions.component.d.ts +5 -0
- package/lib/card/card.component.d.ts +28 -0
- package/lib/card/checkbox-card/checkbox-card.component.d.ts +12 -0
- package/lib/card/guide-card/guide-card.component.d.ts +8 -0
- package/lib/card-carousel/card-carousel.component.d.ts +27 -0
- package/lib/checkbox/checkbox.component.d.ts +9 -0
- package/lib/chips/chips.component.d.ts +22 -0
- package/lib/component-library.component.d.ts +5 -0
- package/lib/component-library.service.d.ts +6 -0
- package/lib/datepicker/datepicker.component.d.ts +9 -0
- package/lib/form-input/form-input.component.d.ts +67 -0
- package/lib/form-select/form-select.component.d.ts +18 -0
- package/lib/grid-cell/grid-cell.component.d.ts +20 -0
- package/lib/header/header.component.d.ts +14 -0
- package/lib/icon/icon.component.d.ts +24 -0
- package/lib/icon/icon.service.d.ts +12 -0
- package/lib/left-nav/left-nav.component.d.ts +47 -0
- package/lib/list/list.component.d.ts +10 -0
- package/lib/message-banner/message-banner.component.d.ts +19 -0
- package/lib/page-layout/page-layout.component.d.ts +8 -0
- package/lib/progress-bar/progress-bar.component.d.ts +13 -0
- package/lib/radio-button/radio-button.component.d.ts +12 -0
- package/lib/scrolling-cards/scrolling-cards.component.d.ts +36 -0
- package/lib/spinner/spinner.component.d.ts +7 -0
- package/lib/stepper/stepper.component.d.ts +17 -0
- package/lib/tabs/tabs.component.d.ts +15 -0
- package/lib/toast/toast.component.d.ts +33 -0
- package/lib/tool-tip/tool-tip.component.d.ts +15 -0
- package/package.json +19 -74
- package/{projects/component-library/src/public-api.ts → public-api.d.ts} +0 -12
- package/utils/validators.d.ts +6 -0
- package/.editorconfig +0 -16
- package/.eslintrc.json +0 -23
- package/.storybook/main.ts +0 -21
- package/.storybook/manager.ts +0 -17
- package/.storybook/preview-head.html +0 -5
- package/.storybook/preview.ts +0 -66
- package/.storybook/tsconfig.doc.json +0 -10
- package/.storybook/tsconfig.json +0 -11
- package/.storybook/typings.d.ts +0 -4
- package/.vscode/extensions.json +0 -7
- package/.vscode/launch.json +0 -20
- package/.vscode/settings.json +0 -13
- package/.vscode/tasks.json +0 -42
- package/angular.json +0 -195
- package/build-storybook.log +0 -45
- package/documentation.json +0 -0
- package/generate-public-api.js +0 -59
- package/projects/component-library/README.md +0 -24
- package/projects/component-library/ng-package.json +0 -8
- package/projects/component-library/package.json +0 -12
- package/projects/component-library/src/interfaces/avatar-interface.ts +0 -6
- package/projects/component-library/src/interfaces/button-interface.ts +0 -37
- package/projects/component-library/src/interfaces/chip-interface.ts +0 -11
- package/projects/component-library/src/interfaces/grid-interface.ts +0 -24
- package/projects/component-library/src/interfaces/icon-interface.ts +0 -21
- package/projects/component-library/src/interfaces/select-interface.ts +0 -20
- package/projects/component-library/src/interfaces/tab-interface.ts +0 -6
- package/projects/component-library/src/lib/accordion/accordion.component.css +0 -188
- package/projects/component-library/src/lib/accordion/accordion.component.html +0 -151
- package/projects/component-library/src/lib/accordion/accordion.component.spec.ts +0 -23
- package/projects/component-library/src/lib/accordion/accordion.component.ts +0 -129
- package/projects/component-library/src/lib/avatar/avatar.component.css +0 -48
- package/projects/component-library/src/lib/avatar/avatar.component.html +0 -5
- package/projects/component-library/src/lib/avatar/avatar.component.spec.ts +0 -23
- package/projects/component-library/src/lib/avatar/avatar.component.ts +0 -50
- package/projects/component-library/src/lib/button/button.component.css +0 -145
- package/projects/component-library/src/lib/button/button.component.html +0 -25
- package/projects/component-library/src/lib/button/button.component.spec.ts +0 -23
- package/projects/component-library/src/lib/button/button.component.ts +0 -82
- package/projects/component-library/src/lib/calendar-header/calendar-header.component.css +0 -67
- package/projects/component-library/src/lib/calendar-header/calendar-header.component.html +0 -20
- package/projects/component-library/src/lib/calendar-header/calendar-header.component.spec.ts +0 -23
- package/projects/component-library/src/lib/calendar-header/calendar-header.component.ts +0 -191
- package/projects/component-library/src/lib/card/card-body/card-body.component.css +0 -0
- package/projects/component-library/src/lib/card/card-body/card-body.component.html +0 -1
- package/projects/component-library/src/lib/card/card-body/card-body.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card-body/card-body.component.ts +0 -12
- package/projects/component-library/src/lib/card/card-custom-header/card-custom-header.component.css +0 -70
- package/projects/component-library/src/lib/card/card-custom-header/card-custom-header.component.html +0 -1
- package/projects/component-library/src/lib/card/card-custom-header/card-custom-header.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card-custom-header/card-custom-header.component.ts +0 -13
- package/projects/component-library/src/lib/card/card-footer-actions/card-footer-actions.component.css +0 -4
- package/projects/component-library/src/lib/card/card-footer-actions/card-footer-actions.component.html +0 -3
- package/projects/component-library/src/lib/card/card-footer-actions/card-footer-actions.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card-footer-actions/card-footer-actions.component.ts +0 -12
- package/projects/component-library/src/lib/card/card-icon/card-icon.component.css +0 -0
- package/projects/component-library/src/lib/card/card-icon/card-icon.component.html +0 -1
- package/projects/component-library/src/lib/card/card-icon/card-icon.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card-icon/card-icon.component.ts +0 -12
- package/projects/component-library/src/lib/card/card-title-actions/card-title-actions.component.css +0 -3
- package/projects/component-library/src/lib/card/card-title-actions/card-title-actions.component.html +0 -1
- package/projects/component-library/src/lib/card/card-title-actions/card-title-actions.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card-title-actions/card-title-actions.component.ts +0 -12
- package/projects/component-library/src/lib/card/card.component.css +0 -149
- package/projects/component-library/src/lib/card/card.component.html +0 -46
- package/projects/component-library/src/lib/card/card.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/card.component.ts +0 -47
- package/projects/component-library/src/lib/card/checkbox-card/checkbox-card.component.css +0 -79
- package/projects/component-library/src/lib/card/checkbox-card/checkbox-card.component.html +0 -55
- package/projects/component-library/src/lib/card/checkbox-card/checkbox-card.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/checkbox-card/checkbox-card.component.ts +0 -44
- package/projects/component-library/src/lib/card/guide-card/guide-card.component.css +0 -80
- package/projects/component-library/src/lib/card/guide-card/guide-card.component.html +0 -24
- package/projects/component-library/src/lib/card/guide-card/guide-card.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card/guide-card/guide-card.component.ts +0 -19
- package/projects/component-library/src/lib/card-carousel/card-carousel.component.css +0 -91
- package/projects/component-library/src/lib/card-carousel/card-carousel.component.html +0 -54
- package/projects/component-library/src/lib/card-carousel/card-carousel.component.spec.ts +0 -23
- package/projects/component-library/src/lib/card-carousel/card-carousel.component.ts +0 -89
- package/projects/component-library/src/lib/checkbox/checkbox.component.css +0 -79
- package/projects/component-library/src/lib/checkbox/checkbox.component.html +0 -27
- package/projects/component-library/src/lib/checkbox/checkbox.component.spec.ts +0 -23
- package/projects/component-library/src/lib/checkbox/checkbox.component.ts +0 -38
- package/projects/component-library/src/lib/chips/chips.component.css +0 -129
- package/projects/component-library/src/lib/chips/chips.component.html +0 -17
- package/projects/component-library/src/lib/chips/chips.component.spec.ts +0 -23
- package/projects/component-library/src/lib/chips/chips.component.ts +0 -54
- package/projects/component-library/src/lib/component-library.component.spec.ts +0 -23
- package/projects/component-library/src/lib/component-library.component.ts +0 -16
- package/projects/component-library/src/lib/component-library.service.spec.ts +0 -16
- package/projects/component-library/src/lib/component-library.service.ts +0 -9
- package/projects/component-library/src/lib/datepicker/datepicker.component.css +0 -33
- package/projects/component-library/src/lib/datepicker/datepicker.component.html +0 -11
- package/projects/component-library/src/lib/datepicker/datepicker.component.spec.ts +0 -23
- package/projects/component-library/src/lib/datepicker/datepicker.component.ts +0 -36
- package/projects/component-library/src/lib/form-input/form-input.component.css +0 -164
- package/projects/component-library/src/lib/form-input/form-input.component.html +0 -55
- package/projects/component-library/src/lib/form-input/form-input.component.spec.ts +0 -23
- package/projects/component-library/src/lib/form-input/form-input.component.ts +0 -282
- package/projects/component-library/src/lib/form-select/form-select.component.css +0 -158
- package/projects/component-library/src/lib/form-select/form-select.component.html +0 -38
- package/projects/component-library/src/lib/form-select/form-select.component.spec.ts +0 -23
- package/projects/component-library/src/lib/form-select/form-select.component.ts +0 -72
- package/projects/component-library/src/lib/grid-cell/grid-cell.component.css +0 -78
- package/projects/component-library/src/lib/grid-cell/grid-cell.component.html +0 -31
- package/projects/component-library/src/lib/grid-cell/grid-cell.component.spec.ts +0 -23
- package/projects/component-library/src/lib/grid-cell/grid-cell.component.ts +0 -89
- package/projects/component-library/src/lib/header/header.component.css +0 -62
- package/projects/component-library/src/lib/header/header.component.html +0 -23
- package/projects/component-library/src/lib/header/header.component.spec.ts +0 -23
- package/projects/component-library/src/lib/header/header.component.ts +0 -28
- package/projects/component-library/src/lib/icon/icon.component.css +0 -65
- package/projects/component-library/src/lib/icon/icon.component.html +0 -9
- package/projects/component-library/src/lib/icon/icon.component.ts +0 -64
- package/projects/component-library/src/lib/icon/icon.service.ts +0 -26
- package/projects/component-library/src/lib/left-nav/left-nav.component.css +0 -109
- package/projects/component-library/src/lib/left-nav/left-nav.component.html +0 -51
- package/projects/component-library/src/lib/left-nav/left-nav.component.spec.ts +0 -23
- package/projects/component-library/src/lib/left-nav/left-nav.component.ts +0 -180
- package/projects/component-library/src/lib/list/list.component.css +0 -28
- package/projects/component-library/src/lib/list/list.component.html +0 -10
- package/projects/component-library/src/lib/list/list.component.spec.ts +0 -23
- package/projects/component-library/src/lib/list/list.component.ts +0 -15
- package/projects/component-library/src/lib/message-banner/message-banner.component.css +0 -52
- package/projects/component-library/src/lib/message-banner/message-banner.component.html +0 -15
- package/projects/component-library/src/lib/message-banner/message-banner.component.spec.ts +0 -23
- package/projects/component-library/src/lib/message-banner/message-banner.component.ts +0 -31
- package/projects/component-library/src/lib/page-layout/page-layout.component.css +0 -76
- package/projects/component-library/src/lib/page-layout/page-layout.component.html +0 -30
- package/projects/component-library/src/lib/page-layout/page-layout.component.spec.ts +0 -23
- package/projects/component-library/src/lib/page-layout/page-layout.component.ts +0 -14
- package/projects/component-library/src/lib/progress-bar/progress-bar.component.css +0 -30
- package/projects/component-library/src/lib/progress-bar/progress-bar.component.html +0 -4
- package/projects/component-library/src/lib/progress-bar/progress-bar.component.spec.ts +0 -23
- package/projects/component-library/src/lib/progress-bar/progress-bar.component.ts +0 -24
- package/projects/component-library/src/lib/radio-button/radio-button.component.css +0 -128
- package/projects/component-library/src/lib/radio-button/radio-button.component.html +0 -28
- package/projects/component-library/src/lib/radio-button/radio-button.component.spec.ts +0 -23
- package/projects/component-library/src/lib/radio-button/radio-button.component.ts +0 -35
- package/projects/component-library/src/lib/scrolling-cards/scrolling-cards.component.css +0 -118
- package/projects/component-library/src/lib/scrolling-cards/scrolling-cards.component.html +0 -11
- package/projects/component-library/src/lib/scrolling-cards/scrolling-cards.component.spec.ts +0 -23
- package/projects/component-library/src/lib/scrolling-cards/scrolling-cards.component.ts +0 -74
- package/projects/component-library/src/lib/spinner/spinner.component.css +0 -41
- package/projects/component-library/src/lib/spinner/spinner.component.html +0 -1
- package/projects/component-library/src/lib/spinner/spinner.component.spec.ts +0 -23
- package/projects/component-library/src/lib/spinner/spinner.component.ts +0 -15
- package/projects/component-library/src/lib/stepper/stepper.component.css +0 -96
- package/projects/component-library/src/lib/stepper/stepper.component.html +0 -14
- package/projects/component-library/src/lib/stepper/stepper.component.spec.ts +0 -23
- package/projects/component-library/src/lib/stepper/stepper.component.ts +0 -61
- package/projects/component-library/src/lib/tabs/tabs.component.css +0 -100
- package/projects/component-library/src/lib/tabs/tabs.component.html +0 -16
- package/projects/component-library/src/lib/tabs/tabs.component.spec.ts +0 -23
- package/projects/component-library/src/lib/tabs/tabs.component.ts +0 -37
- package/projects/component-library/src/lib/toast/toast.component.css +0 -115
- package/projects/component-library/src/lib/toast/toast.component.html +0 -29
- package/projects/component-library/src/lib/toast/toast.component.spec.ts +0 -23
- package/projects/component-library/src/lib/toast/toast.component.ts +0 -87
- package/projects/component-library/src/lib/tool-tip/tool-tip.component.css +0 -144
- package/projects/component-library/src/lib/tool-tip/tool-tip.component.html +0 -31
- package/projects/component-library/src/lib/tool-tip/tool-tip.component.spec.ts +0 -23
- package/projects/component-library/src/lib/tool-tip/tool-tip.component.ts +0 -37
- package/projects/component-library/src/shared/formly-field-wrapper/formly-field-wrapper.component.css +0 -0
- package/projects/component-library/src/shared/formly-field-wrapper/formly-field-wrapper.component.html +0 -22
- package/projects/component-library/src/shared/formly-field-wrapper/formly-field-wrapper.component.spec.ts +0 -23
- package/projects/component-library/src/shared/formly-field-wrapper/formly-field-wrapper.component.ts +0 -13
- package/projects/component-library/src/utils/validators.ts +0 -100
- package/projects/component-library/tsconfig.lib.json +0 -14
- package/projects/component-library/tsconfig.lib.prod.json +0 -10
- package/projects/component-library/tsconfig.spec.json +0 -14
- package/sarasanalytics-com-design-system-0.0.21.tgz +0 -0
- package/src/Saras-logo.svg +0 -15
- package/src/app/app.component.css +0 -82
- package/src/app/app.component.html +0 -663
- package/src/app/app.component.spec.ts +0 -29
- package/src/app/app.component.ts +0 -1341
- package/src/app/app.config.ts +0 -56
- package/src/app/app.routes.ts +0 -3
- package/src/app/data.ts +0 -52
- package/src/app/kitchen-sink/kitchen-sink.component.css +0 -30
- package/src/app/kitchen-sink/kitchen-sink.component.html +0 -7
- package/src/app/kitchen-sink/kitchen-sink.component.spec.ts +0 -23
- package/src/app/kitchen-sink/kitchen-sink.component.ts +0 -92
- package/src/assets/.gitkeep +0 -0
- package/src/assets/analysis.svg +0 -1
- package/src/assets/arrowRightOutlined.svg +0 -1
- package/src/assets/avatar.svg +0 -1
- package/src/assets/bpn.svg +0 -1
- package/src/assets/businessStatsFilled.svg +0 -1
- package/src/assets/channelkey.svg +0 -1
- package/src/assets/chatHelpOutlined.svg +0 -1
- package/src/assets/checkCircleFilled.svg +0 -1
- package/src/assets/checkCircleOutlined.svg +0 -1
- package/src/assets/checkOutlined.svg +0 -1
- package/src/assets/circleFilled.svg +0 -1
- package/src/assets/closeBlueOutlined.svg +0 -1
- package/src/assets/closeCircleFilled.svg +0 -1
- package/src/assets/closeOutlined.svg +0 -1
- package/src/assets/dataonavatar.svg +0 -1
- package/src/assets/datonAvatar.png +0 -0
- package/src/assets/desktopSpeakerOutlined.svg +0 -1
- package/src/assets/disabledCheckboxFilled.svg +0 -1
- package/src/assets/doubleDownOutlined.svg +0 -1
- package/src/assets/downChevronOutlined.svg +0 -3
- package/src/assets/downOutlined.svg +0 -1
- package/src/assets/errorCircleOutlined.svg +0 -1
- package/src/assets/errorCrossOutlined.svg +0 -3
- package/src/assets/eyeFilled.svg +0 -1
- package/src/assets/eyeOff.svg +0 -3
- package/src/assets/eyeOutlined.svg +0 -1
- package/src/assets/formDetailsOutlined.svg +0 -1
- package/src/assets/gridViewOutlined.svg +0 -1
- package/src/assets/headsetOutlined.svg +0 -3
- package/src/assets/homeOutlined.svg +0 -1
- package/src/assets/icons/analysis1.svg +0 -1
- package/src/assets/infoCircleOutlined.svg +0 -3
- package/src/assets/infoTriangleFilled.svg +0 -1
- package/src/assets/infoTriangleOutlined.svg +0 -1
- package/src/assets/innosupps.svg +0 -1
- package/src/assets/leftChevronCircle.svg +0 -2
- package/src/assets/locationOutlined.svg +0 -1
- package/src/assets/loginDashboard.png +0 -0
- package/src/assets/mailOutlined.svg +0 -1
- package/src/assets/multiConnectionHub.svg +0 -1
- package/src/assets/murad.svg +0 -1
- package/src/assets/personOutlined.svg +0 -1
- package/src/assets/pricingIcon.svg +0 -3
- package/src/assets/rightChevronCircle.svg +0 -1
- package/src/assets/rightChevronOutlined.svg +0 -1
- package/src/assets/sarasFullLogo.svg +0 -13
- package/src/assets/sarasWhite.svg +0 -1
- package/src/assets/settingsOutlined.svg +0 -1
- package/src/assets/sourcesOutlined.svg +0 -1
- package/src/assets/tabDesktopArrowClockwiseOutlined.svg +0 -1
- package/src/assets/targetScanOutlined.svg +0 -1
- package/src/assets/timerOutlined.svg +0 -5
- package/src/assets/upwardTriangleFilled.svg +0 -1
- package/src/custom-theme.scss +0 -37
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -23
- package/src/main.ts +0 -6
- package/src/stories/GettingStarted.mdx +0 -233
- package/src/stories/KitchenSink.stories.ts +0 -109
- package/src/stories/accordion.stories.ts +0 -234
- package/src/stories/avatar.stories.ts +0 -45
- package/src/stories/card-carousel.stories.ts +0 -136
- package/src/stories/card.stories.ts +0 -242
- package/src/stories/checkbox.stories.ts +0 -238
- package/src/stories/chips.stories.ts +0 -61
- package/src/stories/custom-button.stories.ts +0 -89
- package/src/stories/datepicker.stories.ts +0 -78
- package/src/stories/form-input.stories.ts +0 -166
- package/src/stories/gridCell.stories.ts +0 -234
- package/src/stories/header.stories.ts +0 -61
- package/src/stories/icon.stories.ts +0 -65
- package/src/stories/leftnav.stories.ts +0 -67
- package/src/stories/message-banner.stories.ts +0 -116
- package/src/stories/page-layout.stories.ts +0 -200
- package/src/stories/progress-bar.stories.ts +0 -40
- package/src/stories/radio-button.stories.ts +0 -80
- package/src/stories/scrolling-card.stories.ts +0 -36
- package/src/stories/selectInput.stories.ts +0 -176
- package/src/stories/stepper.stories.ts +0 -92
- package/src/stories/tabs.stories.ts +0 -97
- package/src/stories/toast.stories.ts +0 -74
- package/src/stories/tool-tip.stories.ts +0 -45
- package/src/svg.d.ts +0 -1
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -42
- package/tsconfig.spec.json +0 -14
- /package/{projects/component-library/src/interfaces/guide-card-interface.ts → interfaces/guide-card-interface.d.ts} +0 -0
- /package/{projects/component-library/src/interfaces/message-banner.ts → interfaces/message-banner.d.ts} +0 -0
- /package/{projects/component-library/src/interfaces/option-interface.ts → interfaces/option-interface.d.ts} +0 -0
- /package/{src → styles}/styles.css +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { TestLibraryService } from './component-library.service';
|
|
4
|
-
|
|
5
|
-
describe('TestLibraryService', () => {
|
|
6
|
-
let service: TestLibraryService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(TestLibraryService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
::ng-deep .cdk-overlay-container {
|
|
2
|
-
--mat-datepicker-calendar-container-elevation-shadow: none;
|
|
3
|
-
--mat-datepicker-calendar-container-shape: 0px;
|
|
4
|
-
--mat-datepicker-calendar-date-selected-state-background-color: var(--primary-500);
|
|
5
|
-
--mat-datepicker-calendar-date-hover-state-background-color: var(--grey-50);
|
|
6
|
-
--mat-datepicker-calendar-date-in-range-state-background-color: var(--grey-50);
|
|
7
|
-
--mat-datepicker-calendar-date-focus-state-background-color: var(--grey-50);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
::ng-deep .cdk-overlay-container .mat-datepicker-popup {
|
|
11
|
-
border-top: 1px solid var(--grey-50);
|
|
12
|
-
border-right: 1px solid var(--grey-50);
|
|
13
|
-
border-bottom: 1px solid var(--grey-50);
|
|
14
|
-
border-radius: var(--small-8px, 8px);
|
|
15
|
-
height: 356px;
|
|
16
|
-
padding: 12px;
|
|
17
|
-
margin-top: 0px;
|
|
18
|
-
margin-left: 180px;
|
|
19
|
-
background-color: white;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
::ng-deep .cdk-overlay-container .mat-datepicker-content .mat-calendar {
|
|
23
|
-
box-shadow: none;
|
|
24
|
-
height: 300px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
::ng-deep .mat-calendar-content .mat-calendar-table-header-divider {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.date-picker {
|
|
32
|
-
margin: 30px
|
|
33
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<mat-form-field class="date-picker">
|
|
2
|
-
<mat-label>Choose a date</mat-label>
|
|
3
|
-
<mat-date-range-input [rangePicker]="picker" [formGroup]="range">
|
|
4
|
-
<input formControlName="start" matStartDate placeholder="Start date">
|
|
5
|
-
<input formControlName="end" matEndDate placeholder="End date">
|
|
6
|
-
</mat-date-range-input>
|
|
7
|
-
<mat-hint>MM/DD/YYYY</mat-hint>
|
|
8
|
-
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
|
|
9
|
-
<mat-date-range-picker [calendarHeaderComponent]="CalendarHeaderComponent" #picker>
|
|
10
|
-
</mat-date-range-picker>
|
|
11
|
-
</mat-form-field>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DatepickerComponent } from './datepicker.component';
|
|
4
|
-
|
|
5
|
-
describe('DatepickerComponent', () => {
|
|
6
|
-
let component: DatepickerComponent;
|
|
7
|
-
let fixture: ComponentFixture<DatepickerComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [DatepickerComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(DatepickerComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
3
|
-
import { MatInputModule } from '@angular/material/input';
|
|
4
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
5
|
-
import { MatNativeDateModule } from '@angular/material/core';
|
|
6
|
-
import { NgFor } from '@angular/common';
|
|
7
|
-
import { NgIf } from '@angular/common';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import { FieldType, FieldTypeConfig } from '@ngx-formly/core';
|
|
10
|
-
import { CalendarHeaderComponent } from '../calendar-header/calendar-header.component';
|
|
11
|
-
import { CommonModule } from '@angular/common';
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'sa-datepicker',
|
|
15
|
-
standalone: true,
|
|
16
|
-
providers: [],
|
|
17
|
-
imports: [
|
|
18
|
-
MatFormFieldModule,
|
|
19
|
-
MatInputModule,
|
|
20
|
-
MatDatepickerModule,
|
|
21
|
-
NgFor,
|
|
22
|
-
NgIf,
|
|
23
|
-
ReactiveFormsModule,
|
|
24
|
-
CalendarHeaderComponent,
|
|
25
|
-
CommonModule,
|
|
26
|
-
MatNativeDateModule
|
|
27
|
-
],
|
|
28
|
-
templateUrl: './datepicker.component.html',
|
|
29
|
-
styleUrl: './datepicker.component.css'
|
|
30
|
-
})
|
|
31
|
-
export class DatepickerComponent extends FieldType<FieldTypeConfig> {
|
|
32
|
-
@Input() range: any;
|
|
33
|
-
|
|
34
|
-
readonly CalendarHeaderComponent = CalendarHeaderComponent;
|
|
35
|
-
|
|
36
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
* {
|
|
2
|
-
--error-red: #e25c61
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.idle {
|
|
6
|
-
--border: 1px solid var(--grey-50);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.focus {
|
|
10
|
-
--border: 1px solid var(--primary-300);
|
|
11
|
-
}
|
|
12
|
-
.masked{
|
|
13
|
-
font-size: 28px;
|
|
14
|
-
font-weight: 500;
|
|
15
|
-
padding-top: 4px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.disabled .sa-input-field,
|
|
19
|
-
[disabled] {
|
|
20
|
-
/* border: 1px solid var(--grey-50) !important; */
|
|
21
|
-
background-color: #FAFAFA;
|
|
22
|
-
cursor: not-allowed;
|
|
23
|
-
}
|
|
24
|
-
.disabled .sa-input-field input{
|
|
25
|
-
color: #989DA3
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* .sa-input-field>input:focus-visible, .sa-input-field>input:focus-visible {
|
|
29
|
-
--border: 1px solid var(--primary-300);
|
|
30
|
-
} */
|
|
31
|
-
.sa-input-field>input,
|
|
32
|
-
.sa-input-field>input:focus-visible {
|
|
33
|
-
--border: 1px solid var(--primary-300);
|
|
34
|
-
border: none;
|
|
35
|
-
outline: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.sa-input-field:hover {
|
|
39
|
-
--border: 1px solid var(--primary-300);
|
|
40
|
-
--font-color: var(--text-highemphasis);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.sa-input-field sa-icon{
|
|
44
|
-
color: var(--icon-grey1);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.sa-input-field>input:focus-visible~sa-icon,
|
|
48
|
-
.sa-input-field:hover sa-icon {
|
|
49
|
-
color: var(--primary-300);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.sa-input-field.invalid>input,
|
|
53
|
-
.sa-input-field.invalid sa-icon,
|
|
54
|
-
.sa-input-field.invalid .sa-input-pretext {
|
|
55
|
-
color: #e25c61 !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.sa-input-field.invalid {
|
|
59
|
-
--border: 1px solid #e25c61;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.sa-input-field.invalid sa-icon {
|
|
63
|
-
--form-email-icon-color: #e25c61;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.sa-input-field.idle sa-icon {
|
|
67
|
-
--form-email-icon-color: #33961F;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.sa-input {
|
|
71
|
-
position: relative;
|
|
72
|
-
padding: 8px 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sa-input-field {
|
|
76
|
-
width: 100%;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
position: relative;
|
|
79
|
-
display: inline-flex;
|
|
80
|
-
padding: 0px var(--small-12px);
|
|
81
|
-
height: 40px;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
align-items: center;
|
|
84
|
-
border: var(--border);
|
|
85
|
-
border-radius: var(--small-4px);
|
|
86
|
-
font-size: 14px;
|
|
87
|
-
font-style: normal;
|
|
88
|
-
font-weight: 400;
|
|
89
|
-
line-height: 20px;
|
|
90
|
-
letter-spacing: 0.25px;
|
|
91
|
-
--font-color: var(--text-lowemphasis);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.sa-input-field input {
|
|
95
|
-
width: inherit;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.sa-input-tag {
|
|
99
|
-
position: absolute;
|
|
100
|
-
background: #fff;
|
|
101
|
-
padding: 2px 6px;
|
|
102
|
-
top: -1px;
|
|
103
|
-
left: 12px;
|
|
104
|
-
z-index: 2;
|
|
105
|
-
font-size: 11px;
|
|
106
|
-
font-weight: 500;
|
|
107
|
-
line-height: 16px;
|
|
108
|
-
letter-spacing: 0.5px;
|
|
109
|
-
text-align: left;
|
|
110
|
-
color: var(--text-lowemphasis);
|
|
111
|
-
/*989DA3*/
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.support-label {
|
|
115
|
-
font-family: var(--font);
|
|
116
|
-
font-size: 11px;
|
|
117
|
-
font-style: normal;
|
|
118
|
-
font-weight: 400;
|
|
119
|
-
line-height: 16px;
|
|
120
|
-
letter-spacing: 0.5px;
|
|
121
|
-
color: var(--text-lowemphasis);
|
|
122
|
-
padding: var(--small-4px) var(--small-16px) 0px var(--small-16px);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.support-label.invalid {
|
|
126
|
-
color: var(--error-red);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.hide {
|
|
130
|
-
display: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.sa-input-big-label-container {
|
|
134
|
-
display: flex;
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
gap: var(--small-8px, 8px);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.sa-input-big-label {
|
|
140
|
-
color: var(--text-highemphasis, #1C1B20);
|
|
141
|
-
font-family: var(--font-roboto, Roboto);
|
|
142
|
-
font-size: var(--medium-22px, 22px);
|
|
143
|
-
font-style: normal;
|
|
144
|
-
font-weight: 500;
|
|
145
|
-
line-height: var(--medium-28px, 28px);
|
|
146
|
-
margin: 0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.sa-input-big-description {
|
|
150
|
-
color: var(--text-mediumemphasis, #6D6979);
|
|
151
|
-
font-family: var(--font-roboto, Roboto);
|
|
152
|
-
font-size: var(--small-14px, 14px);
|
|
153
|
-
font-style: normal;
|
|
154
|
-
font-weight: 400;
|
|
155
|
-
line-height: var(--medium-20px, 20px);
|
|
156
|
-
letter-spacing: 0.25px;
|
|
157
|
-
margin: 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.sa-input-container {
|
|
161
|
-
display: flex;
|
|
162
|
-
flex-direction: column;
|
|
163
|
-
gap: var(--medium-20px, 20px);
|
|
164
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<div class="sa-input-container">
|
|
2
|
-
@if (!!props?.['bigLabel'] || !!props?.['bigDescription']) {
|
|
3
|
-
<div class="sa-input-big-label-container" [ngClass]="disabled ? 'disabled' : '' ">
|
|
4
|
-
<h2 class="sa-input-big-label">
|
|
5
|
-
{{props?.['bigLabel']}}
|
|
6
|
-
</h2>
|
|
7
|
-
<p class="sa-input-big-description">
|
|
8
|
-
{{props?.['bigDescription']}}
|
|
9
|
-
</p>
|
|
10
|
-
</div>
|
|
11
|
-
}
|
|
12
|
-
<div class="sa-input" [ngClass]="disabled ? 'disabled' : '' ">
|
|
13
|
-
@if(pretext || (!!inputVal?.length && (!!params?.placeholder || !!props?.placeholder))){
|
|
14
|
-
<span class="sa-input-tag">{{params?.placeholder || props?.placeholder}}</span>
|
|
15
|
-
}
|
|
16
|
-
<div class="sa-input-field" [ngClass]="formControl.invalid && formControl.touched ? 'invalid' : 'idle' "
|
|
17
|
-
(click)="onInputFieldClick($event)">
|
|
18
|
-
@if(pretext){
|
|
19
|
-
<div class="sa-input-pretext">
|
|
20
|
-
{{pretext}}
|
|
21
|
-
</div>
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
<input
|
|
25
|
-
[ngClass]="(!!inputVal && (params?.type === 'password' || props?.type === 'password') && icon.name !== 'eyeOff') ? 'masked' : ''"
|
|
26
|
-
matInput [type]="type" value="" [pattern]="type==='tel' ? '[0-9]' : '' "
|
|
27
|
-
[disabled]="field.props.disabled || false"
|
|
28
|
-
[placeholder]="!pretext && props?.placeholder || params?.placeholder || ''" (focus)="onFocus()"
|
|
29
|
-
(blur)="onBlur()" (input)="onInput($event)" [(ngModel)]="inputVal" #formInput />
|
|
30
|
-
|
|
31
|
-
@if(params?.type === 'password'){
|
|
32
|
-
<sa-icon class="flex" icon="eyeOutlined" [size]="icon.size || '24'" (click)="inputIconClick()"
|
|
33
|
-
[ngClass]="!icon.name || icon.name === 'eyeOutlined' ? '' : 'hide'"></sa-icon>
|
|
34
|
-
<sa-icon class="flex" icon="eyeOff" [size]="icon.size || '24'" (click)="inputIconClick()"
|
|
35
|
-
[ngClass]="icon.name === 'eyeOff' ? '' : 'hide'"></sa-icon>
|
|
36
|
-
}@else if(params?.type === 'email' && icon.show){
|
|
37
|
-
<sa-icon class="flex" [icon]="icon.name || 'checkCircleOutlined'" [size]="icon.size || '24'"
|
|
38
|
-
(click)="inputIconClick()" [ngClass]="showEmailIcon ? '' : 'hide'"></sa-icon>
|
|
39
|
-
}
|
|
40
|
-
@else if(icon.name){
|
|
41
|
-
<sa-icon class="flex" [icon]="icon.name" [size]="icon.size || '24'" [color]="icon.color || ''"
|
|
42
|
-
[ngClass]="icon.show ? '' : 'hide'"></sa-icon>
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<!-- <sa-icon [icon]="icon" size="24" (click)="inputIconClick()"></sa-icon> -->
|
|
47
|
-
</div>
|
|
48
|
-
@if((!formControl.valid) || (params?.supportText)){
|
|
49
|
-
<div class="support-label" [ngClass]="formControl.invalid && formControl.touched ? 'invalid' : 'idle'">
|
|
50
|
-
<!-- {{!formControl.valid ? inputErrorText : params.supportText}} -->
|
|
51
|
-
{{getFormSupportText()}}
|
|
52
|
-
</div>
|
|
53
|
-
}
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { FormInputComponent } from './form-input.component';
|
|
4
|
-
|
|
5
|
-
describe('FormInputComponent', () => {
|
|
6
|
-
let component: FormInputComponent;
|
|
7
|
-
let fixture: ComponentFixture<FormInputComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [FormInputComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(FormInputComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, Input, ViewChild } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
AbstractControl,
|
|
4
|
-
FormControl,
|
|
5
|
-
FormsModule,
|
|
6
|
-
ReactiveFormsModule,
|
|
7
|
-
Validators,
|
|
8
|
-
} from '@angular/forms';
|
|
9
|
-
import { FormlyModule } from '@ngx-formly/core';
|
|
10
|
-
import { FieldType, FieldTypeConfig } from '@ngx-formly/core';
|
|
11
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
12
|
-
import { CommonModule } from '@angular/common';
|
|
13
|
-
import {
|
|
14
|
-
getValidationMessage,
|
|
15
|
-
phoneNumberValidator,
|
|
16
|
-
} from '../../utils/validators';
|
|
17
|
-
import { IconComponent } from '../icon/icon.component';
|
|
18
|
-
|
|
19
|
-
@Component({
|
|
20
|
-
selector: 'sa-input',
|
|
21
|
-
standalone: true,
|
|
22
|
-
imports: [
|
|
23
|
-
CommonModule,
|
|
24
|
-
FormsModule,
|
|
25
|
-
ReactiveFormsModule,
|
|
26
|
-
FormlyModule,
|
|
27
|
-
IconComponent,
|
|
28
|
-
],
|
|
29
|
-
templateUrl: './form-input.component.html',
|
|
30
|
-
styleUrl: './form-input.component.css',
|
|
31
|
-
})
|
|
32
|
-
export class FormInputComponent extends FieldType<FieldTypeConfig> {
|
|
33
|
-
@ViewChild('formInput') formInput!: ElementRef;
|
|
34
|
-
|
|
35
|
-
@Input('icon') icon: IInputIcon;
|
|
36
|
-
|
|
37
|
-
pretext: string;
|
|
38
|
-
|
|
39
|
-
inputState = 'idle';
|
|
40
|
-
inputVal = '';
|
|
41
|
-
params: IInputParam | null;
|
|
42
|
-
dependent: AbstractControl<any, any> | null;
|
|
43
|
-
dependentVal: any = null;
|
|
44
|
-
// dynamicIcon: DynamicIcon | null;
|
|
45
|
-
// icon: IInputIcon | null;
|
|
46
|
-
|
|
47
|
-
type: string = '';
|
|
48
|
-
validators: any[];
|
|
49
|
-
asyncValidators: any[];
|
|
50
|
-
|
|
51
|
-
inputErrorText: string = 'invalid input';
|
|
52
|
-
|
|
53
|
-
showEmailIcon: boolean = false;
|
|
54
|
-
disabled: boolean = false;
|
|
55
|
-
|
|
56
|
-
private suppressOnBlur = false;
|
|
57
|
-
|
|
58
|
-
constructor() {
|
|
59
|
-
super();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ngOnInit() {
|
|
63
|
-
this.inputVal = this.field.props['value'] || this.model[this.key as string] || '';
|
|
64
|
-
this.disabled = this.field.props.disabled || false;
|
|
65
|
-
this.formControl?.setValue(this.inputVal);
|
|
66
|
-
|
|
67
|
-
this.params = this.field.props['params'];
|
|
68
|
-
this.icon = this.field.props['icon'] || {};
|
|
69
|
-
this.type = this.params?.type || '';
|
|
70
|
-
|
|
71
|
-
// this.dynamicIcon = this.field.props['dynamicIcon'];
|
|
72
|
-
this.setValidators();
|
|
73
|
-
this.setDependents();
|
|
74
|
-
|
|
75
|
-
this.formControl.statusChanges.subscribe((state) => {
|
|
76
|
-
if (this.type === 'email') {
|
|
77
|
-
if (!!this.inputVal && !this.formControl.touched) {
|
|
78
|
-
this.formControl.markAsTouched();
|
|
79
|
-
}
|
|
80
|
-
this.showEmailIcon =
|
|
81
|
-
state === 'VALID' ||
|
|
82
|
-
(state === 'INVALID' &&
|
|
83
|
-
this.formControl.hasError('invalid') &&
|
|
84
|
-
!!this.formControl.value);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
this.formControl.valueChanges.subscribe((val) => {
|
|
88
|
-
this.formInput.nativeElement.value = val;
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
setValidators() {
|
|
93
|
-
this.validators = this.params?.validators || [];
|
|
94
|
-
this.asyncValidators = this.params?.asyncValidators || [];
|
|
95
|
-
this.formControl?.setValidators([
|
|
96
|
-
...(this.type ? this.predefinedValidators[this.type] || [] : []),
|
|
97
|
-
...this.validators,
|
|
98
|
-
]);
|
|
99
|
-
if (this.asyncValidators)
|
|
100
|
-
this.formControl?.setAsyncValidators(this.asyncValidators);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/*
|
|
104
|
-
Assuming dependent field is a single select dropdown
|
|
105
|
-
*/
|
|
106
|
-
setDependents() {
|
|
107
|
-
if (this.params?.dependent) {
|
|
108
|
-
this.dependent = this.form.get([this.params?.dependent]);
|
|
109
|
-
|
|
110
|
-
this.dependentVal = this.getDependentVal(this.dependent.value);
|
|
111
|
-
if (this.type === 'tel') {
|
|
112
|
-
this.pretext = this.dependentVal?.dial_code;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
this.dependent?.valueChanges.subscribe((val) => {
|
|
116
|
-
this.dependentVal = this.getDependentVal(val);
|
|
117
|
-
this.formControl.reset();
|
|
118
|
-
this.formControl.setValue(this.inputVal);
|
|
119
|
-
if (this.type === 'tel') {
|
|
120
|
-
this.pretext = this.dependentVal?.dial_code;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
getDependentVal(value: any) {
|
|
126
|
-
let dependentValue: any;
|
|
127
|
-
if (Array.isArray(value)) {
|
|
128
|
-
dependentValue = value.length ? value[0] : null;
|
|
129
|
-
} else {
|
|
130
|
-
dependentValue = value;
|
|
131
|
-
}
|
|
132
|
-
return dependentValue;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
checkValidity(defaultInputState = 'focus') {
|
|
136
|
-
if (
|
|
137
|
-
this.formControl &&
|
|
138
|
-
!this.formControl.valid &&
|
|
139
|
-
this.formControl.touched &&
|
|
140
|
-
!this.formControl.pending
|
|
141
|
-
) {
|
|
142
|
-
this.inputState = 'invalid';
|
|
143
|
-
this.inputErrorText =
|
|
144
|
-
getValidationMessage(this.formControl.errors) || 'invalid input';
|
|
145
|
-
} else {
|
|
146
|
-
this.inputState = defaultInputState;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
onFocus() {
|
|
151
|
-
if (this.formControl.valid) this.inputState = 'focus';
|
|
152
|
-
}
|
|
153
|
-
onBlur() {
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
if (!this.suppressOnBlur) {
|
|
156
|
-
this.formControl.markAsTouched();
|
|
157
|
-
this.checkValidity('idle');
|
|
158
|
-
}
|
|
159
|
-
this.suppressOnBlur = false;
|
|
160
|
-
}, 200);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
onInput(event: any) {
|
|
164
|
-
if (this.params?.type === 'tel') {
|
|
165
|
-
this.inputVal = this.inputVal.replace(/[^0-9()+\- ]/g, '');
|
|
166
|
-
this.inputVal = this.hyphenatePhoneNumber();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
this.formControl?.setValue(this.inputVal);
|
|
170
|
-
this.checkValidity();
|
|
171
|
-
/*if (this.params?.eventListener) {
|
|
172
|
-
this.params?.eventListener({
|
|
173
|
-
type: IInputEventType.INPUT_CHANGE,
|
|
174
|
-
value: this.inputVal,
|
|
175
|
-
formControl: this.formControl
|
|
176
|
-
} as IInputEvent).then(this.onFieldCallback.bind(this));
|
|
177
|
-
}*/
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
hyphenatePhoneNumber() {
|
|
181
|
-
let newStr = '';
|
|
182
|
-
let i = 0;
|
|
183
|
-
let hyphenatedCount = 1;
|
|
184
|
-
const value = this.inputVal.replaceAll('-', '');
|
|
185
|
-
for (; i < value.length; i++) {
|
|
186
|
-
newStr = newStr + value.charAt(i);
|
|
187
|
-
if (!(hyphenatedCount % 3)) {
|
|
188
|
-
if (!((i + 1) % 10)) {
|
|
189
|
-
newStr = newStr + '-';
|
|
190
|
-
hyphenatedCount++;
|
|
191
|
-
}
|
|
192
|
-
} else if (
|
|
193
|
-
!((i + 1 - Math.floor(hyphenatedCount / 3)) % 3) &&
|
|
194
|
-
i + 1 < value.length
|
|
195
|
-
) {
|
|
196
|
-
newStr = newStr + '-';
|
|
197
|
-
hyphenatedCount++;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return newStr;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
onInputFieldClick(event: any = 'input') {
|
|
205
|
-
if (
|
|
206
|
-
event === 'input' ||
|
|
207
|
-
event.target.classList.contains('sa-input-field')
|
|
208
|
-
) {
|
|
209
|
-
this.formInput.nativeElement.focus();
|
|
210
|
-
if (this.params?.type !== 'email')
|
|
211
|
-
setTimeout(() => {
|
|
212
|
-
this.formInput.nativeElement.setSelectionRange(
|
|
213
|
-
this.inputVal.length,
|
|
214
|
-
this.inputVal.length,
|
|
215
|
-
);
|
|
216
|
-
}, 10);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
inputIconClick() {
|
|
221
|
-
if (this.params?.type === 'password') {
|
|
222
|
-
this.suppressOnBlur = true;
|
|
223
|
-
if (this.type === 'password') {
|
|
224
|
-
this.type = 'text';
|
|
225
|
-
this.icon.name = 'eyeOff';
|
|
226
|
-
} else {
|
|
227
|
-
this.type = 'password';
|
|
228
|
-
this.icon.name = 'eyeOutlined';
|
|
229
|
-
}
|
|
230
|
-
this.onInputFieldClick();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/*onFieldCallback(param: IInputParam) {
|
|
235
|
-
this.icon = param.icon || this.icon;
|
|
236
|
-
this.checkValidity();
|
|
237
|
-
}*/
|
|
238
|
-
|
|
239
|
-
getFormSupportText() {
|
|
240
|
-
if (this.formControl.invalid && this.formControl.touched) {
|
|
241
|
-
return getValidationMessage(this.formControl.errors) || 'invalid input';
|
|
242
|
-
} else {
|
|
243
|
-
return this.params?.supportText || '';
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
predefinedValidators: any = {
|
|
248
|
-
email: [Validators.email, Validators.required],
|
|
249
|
-
password: [Validators.required],
|
|
250
|
-
tel: [Validators.pattern('^[0-9 +\\-()]*$')],
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export interface IInputIcon {
|
|
255
|
-
name: string;
|
|
256
|
-
show?: boolean;
|
|
257
|
-
color?: string;
|
|
258
|
-
size?: string;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export interface IInputParam {
|
|
262
|
-
validators?: any[];
|
|
263
|
-
asyncValidators?: any[];
|
|
264
|
-
supportText?: string;
|
|
265
|
-
placeholder?: string;
|
|
266
|
-
type?: string;
|
|
267
|
-
dependent?: string;
|
|
268
|
-
eventListener?: Function;
|
|
269
|
-
icon?: IInputIcon;
|
|
270
|
-
errors?: { [key: string]: any };
|
|
271
|
-
}
|
|
272
|
-
export interface IInputEvent {
|
|
273
|
-
type: IInputEventType;
|
|
274
|
-
value: string;
|
|
275
|
-
callBack: any;
|
|
276
|
-
formControl: FormControl;
|
|
277
|
-
}
|
|
278
|
-
export enum IInputEventType {
|
|
279
|
-
INPUT_CHANGE = 'INPUT_CHANGE',
|
|
280
|
-
STATE_CHANGE = 'STATE_CHANGE',
|
|
281
|
-
ICON_CLICK = 'ICON_CLICK',
|
|
282
|
-
}
|