vc-create-dashboard 2.9.6 → 2.9.7
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/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +11 -25
- package/src/lib/categoryList.ts +23 -0
- package/src/lib/configurations.ts +8 -0
- package/src/lib/create-dashboard-container/categories/categories-config.ts +18 -0
- package/src/lib/create-dashboard-container/categories/categories.component.html +84 -0
- package/src/lib/create-dashboard-container/categories/categories.component.less +252 -0
- package/src/lib/create-dashboard-container/categories/categories.component.spec.ts +43 -0
- package/src/lib/create-dashboard-container/categories/categories.component.ts +205 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.html +70 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.less +381 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.spec.ts +48 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.ts +545 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.ts +9 -0
- package/src/lib/create-dashboard-container/configure-widgets/configure-widgets.module.ts +29 -0
- package/src/lib/create-dashboard-container/create-dashboard-config.ts +24 -0
- package/src/lib/create-dashboard-container/create-dashboard-mockData.ts +341 -0
- package/src/lib/create-dashboard-container/create-dashboard.component.html +1258 -0
- package/src/lib/create-dashboard-container/create-dashboard.component.less +1277 -0
- package/src/lib/create-dashboard-container/create-dashboard.component.spec.ts +755 -0
- package/src/lib/create-dashboard-container/create-dashboard.component.ts +1281 -0
- package/src/lib/create-dashboard-container/create-dashboard.module.ts +76 -0
- package/src/lib/create-dashboard-container/directives/directives.module.ts +18 -0
- package/src/lib/create-dashboard-container/directives/scroll-in-view.directive.ts +28 -0
- package/src/lib/create-dashboard-container/form-group/form-group.component.html +287 -0
- package/src/lib/create-dashboard-container/form-group/form-group.component.less +450 -0
- package/src/lib/create-dashboard-container/form-group/form-group.component.spec.ts +90 -0
- package/src/lib/create-dashboard-container/form-group/form-group.component.ts +162 -0
- package/src/lib/create-dashboard-container/frequency/frequency.component.html +61 -0
- package/src/lib/create-dashboard-container/frequency/frequency.component.less +183 -0
- package/src/lib/create-dashboard-container/frequency/frequency.component.spec.ts +120 -0
- package/src/lib/create-dashboard-container/frequency/frequency.component.ts +303 -0
- package/{lib/create-dashboard-container/interfaces/widget-data-model.d.ts → src/lib/create-dashboard-container/interfaces/widget-data-model.ts} +1 -1
- package/src/lib/create-dashboard-container/pipes/filter.pipe.ts +25 -0
- package/src/lib/create-dashboard-container/pipes/search.pipe.ts +23 -0
- package/src/lib/create-dashboard-container/pipes/text-count.pipe.spec.ts +8 -0
- package/src/lib/create-dashboard-container/pipes/text-count.pipe.ts +15 -0
- package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.html +44 -0
- package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.less +181 -0
- package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.spec.ts +41 -0
- package/src/lib/create-dashboard-container/responsibility-center/responsibility-center.component.ts +136 -0
- package/src/lib/create-dashboard-container/risk-categories/risk-categories-config.ts +18 -0
- package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.html +83 -0
- package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.less +230 -0
- package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.spec.ts +39 -0
- package/src/lib/create-dashboard-container/risk-categories/risk-categories.component.ts +191 -0
- package/src/lib/create-dashboard-container/services/auth.service.ts +27 -0
- package/src/lib/create-dashboard-container/services/configure-widgets.service.spec.ts +19 -0
- package/src/lib/create-dashboard-container/services/configure-widgets.service.ts +228 -0
- package/src/lib/create-dashboard-container/services/create-dashboard.service.spec.ts +19 -0
- package/src/lib/create-dashboard-container/services/create-dashboard.service.ts +139 -0
- package/src/lib/create-dashboard-container/services/pagination.service.spec.ts +16 -0
- package/src/lib/create-dashboard-container/services/pagination.service.ts +25 -0
- package/src/lib/create-dashboard-container/user-list/user-list.component.html +146 -0
- package/src/lib/create-dashboard-container/user-list/user-list.component.less +451 -0
- package/src/lib/create-dashboard-container/user-list/user-list.component.spec.ts +153 -0
- package/src/lib/create-dashboard-container/user-list/user-list.component.ts +433 -0
- package/{lib/create-dashboard-container/user-list/user-list.config.d.ts → src/lib/create-dashboard-container/user-list/user-list.config.ts} +6 -6
- package/src/lib/create-dashboard.service.ts +8 -0
- package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.html +22 -0
- package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.less +218 -0
- package/src/lib/ui-kit/action-dialog/access-capability/access-capability.component.ts +30 -0
- package/src/lib/ui-kit/action-dialog/action-dialog.module.ts +53 -0
- package/src/lib/ui-kit/action-dialog/active/active.component.html +1 -0
- package/src/lib/ui-kit/action-dialog/active/active.component.less +0 -0
- package/src/lib/ui-kit/action-dialog/active/active.component.ts +12 -0
- package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.html +18 -0
- package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.less +98 -0
- package/src/lib/ui-kit/action-dialog/assesment-confirmation/assesment-confirmation.component.ts +18 -0
- package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.html +20 -0
- package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.less +325 -0
- package/src/lib/ui-kit/action-dialog/confirmation/confirmation.component.ts +26 -0
- package/src/lib/ui-kit/action-dialog/delete/delete.component.html +24 -0
- package/src/lib/ui-kit/action-dialog/delete/delete.component.less +240 -0
- package/src/lib/ui-kit/action-dialog/delete/delete.component.ts +22 -0
- package/src/lib/ui-kit/action-dialog/error/error.component.html +20 -0
- package/src/lib/ui-kit/action-dialog/error/error.component.less +103 -0
- package/src/lib/ui-kit/action-dialog/error/error.component.ts +18 -0
- package/src/lib/ui-kit/action-dialog/inactive/inactive.component.html +23 -0
- package/src/lib/ui-kit/action-dialog/inactive/inactive.component.less +167 -0
- package/src/lib/ui-kit/action-dialog/inactive/inactive.component.ts +12 -0
- package/src/lib/ui-kit/action-dialog/link/link.component.html +57 -0
- package/src/lib/ui-kit/action-dialog/link/link.component.less +222 -0
- package/src/lib/ui-kit/action-dialog/link/link.component.ts +18 -0
- package/src/lib/ui-kit/action-dialog/move/move.component.html +43 -0
- package/src/lib/ui-kit/action-dialog/move/move.component.less +157 -0
- package/src/lib/ui-kit/action-dialog/move/move.component.ts +25 -0
- package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.html +19 -0
- package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.less +97 -0
- package/src/lib/ui-kit/action-dialog/my-rating/my-rating.component.ts +18 -0
- package/src/lib/ui-kit/action-dialog/upload/upload.component.html +19 -0
- package/src/lib/ui-kit/action-dialog/upload/upload.component.less +97 -0
- package/src/lib/ui-kit/action-dialog/upload/upload.component.ts +12 -0
- package/src/lib/ui-kit/chart/bar/bar.component.html +28 -0
- package/src/lib/ui-kit/chart/bar/bar.component.less +13 -0
- package/src/lib/ui-kit/chart/bar/bar.component.ts +44 -0
- package/src/lib/ui-kit/chart/chart.module.ts +12 -0
- package/src/lib/ui-kit/chart/pipes/segmenter.pipe.ts +28 -0
- package/src/lib/ui-kit/chart/pipes/x-calculator.pipe.ts +22 -0
- package/src/lib/ui-kit/circle-progresss/circle/circle.component.html +37 -0
- package/src/lib/ui-kit/circle-progresss/circle/circle.component.less +1448 -0
- package/src/lib/ui-kit/circle-progresss/circle/circle.component.ts +19 -0
- package/src/lib/ui-kit/circle-progresss/circle-progresss.module.ts +10 -0
- package/src/lib/ui-kit/click-outside/click-outside.directive.ts +16 -0
- package/src/lib/ui-kit/click-outside/click-outside.module.ts +16 -0
- package/src/lib/ui-kit/color-palette/color-palette.component.html +110 -0
- package/src/lib/ui-kit/color-palette/color-palette.component.less +54 -0
- package/src/lib/ui-kit/color-palette/color-palette.component.ts +28 -0
- package/src/lib/ui-kit/color-palette/color-palette.module.ts +10 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.html +37 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.less +335 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.spec.ts +25 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.ts +44 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer-config.ts +11 -0
- package/src/lib/ui-kit/dashboard-footer/dashboard-footer.module.ts +22 -0
- package/src/lib/ui-kit/dialog/dialog-config.ts +6 -0
- package/src/lib/ui-kit/dialog/dialog-injector.ts +18 -0
- package/src/lib/ui-kit/dialog/dialog-ref.ts +12 -0
- package/src/lib/ui-kit/dialog/dialog.component.css +89 -0
- package/src/lib/ui-kit/dialog/dialog.component.html +27 -0
- package/src/lib/ui-kit/dialog/dialog.component.ts +96 -0
- package/src/lib/ui-kit/dialog/dialog.module.ts +11 -0
- package/src/lib/ui-kit/dialog/dialog.service.ts +57 -0
- package/src/lib/ui-kit/dialog/insertion.directive.ts +8 -0
- package/src/lib/ui-kit/floating-bar/floating-bar.component.html +42 -0
- package/src/lib/ui-kit/floating-bar/floating-bar.component.less +355 -0
- package/src/lib/ui-kit/floating-bar/floating-bar.component.spec.ts +25 -0
- package/src/lib/ui-kit/floating-bar/floating-bar.component.ts +40 -0
- package/src/lib/ui-kit/floating-bar/floating-bar.module.ts +22 -0
- package/src/lib/ui-kit/formgroup/click-outside.directive.ts +16 -0
- package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.html +11 -0
- package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.less +102 -0
- package/src/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.ts +19 -0
- package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.html +11 -0
- package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.less +125 -0
- package/src/lib/ui-kit/formgroup/cs-radio/cs-radio.component.ts +21 -0
- package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.html +4 -0
- package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.less +0 -0
- package/src/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.ts +12 -0
- package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.html +78 -0
- package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.less +259 -0
- package/src/lib/ui-kit/formgroup/cs-select/cs-select.component.ts +92 -0
- package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.html +30 -0
- package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.less +103 -0
- package/src/lib/ui-kit/formgroup/cs-switch/cs-switch.component.ts +23 -0
- package/src/lib/ui-kit/formgroup/formgroup.module.ts +35 -0
- package/src/lib/ui-kit/formgroup/pipes/pascal.pipe.ts +13 -0
- package/src/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.ts +18 -0
- package/src/lib/ui-kit/line-loader/line-loader.component.html +3 -0
- package/src/lib/ui-kit/line-loader/line-loader.component.less +34 -0
- package/src/lib/ui-kit/line-loader/line-loader.component.ts +14 -0
- package/src/lib/ui-kit/line-loader/line-loader.module.ts +10 -0
- package/src/lib/ui-kit/longpress/longpress.directive.ts +28 -0
- package/src/lib/ui-kit/longpress/longpress.module.ts +10 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.html +51 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.less +365 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.spec.ts +24 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect/cs-multiselect.component.ts +139 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.html +9 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.less +105 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.spec.ts +27 -0
- package/src/lib/ui-kit/multi-select/cs-multiselect-option/cs-multiselect-option.component.ts +24 -0
- package/src/lib/ui-kit/multi-select/multi-select.module.ts +24 -0
- package/src/lib/ui-kit/multi-select/multi-select.service.ts +10 -0
- package/src/lib/ui-kit/no-data/no-data.component.html +14 -0
- package/src/lib/ui-kit/no-data/no-data.component.less +87 -0
- package/src/lib/ui-kit/no-data/no-data.component.ts +26 -0
- package/src/lib/ui-kit/no-data/no-data.module.ts +10 -0
- package/src/lib/ui-kit/pagination/pagination.component.html +11 -0
- package/src/lib/ui-kit/pagination/pagination.component.less +72 -0
- package/src/lib/ui-kit/pagination/pagination.component.spec.ts +25 -0
- package/src/lib/ui-kit/pagination/pagination.component.ts +138 -0
- package/src/lib/ui-kit/pagination/pagination.module.ts +10 -0
- package/src/lib/ui-kit/pipes/pipes.module.ts +10 -0
- package/src/lib/ui-kit/pipes/safeHTML.pipe.ts +12 -0
- package/src/lib/ui-kit/pipes/trim.pipe.ts +10 -0
- package/src/lib/ui-kit/popover/popover.component.html +6 -0
- package/src/lib/ui-kit/popover/popover.component.less +20 -0
- package/src/lib/ui-kit/popover/popover.component.ts +124 -0
- package/src/lib/ui-kit/popover/popover.directive.ts +72 -0
- package/src/lib/ui-kit/popover/popover.module.ts +13 -0
- package/src/lib/ui-kit/popover/popover.service.ts +17 -0
- package/src/lib/ui-kit/ripple/ripple.directive.ts +33 -0
- package/src/lib/ui-kit/ripple/ripple.module.ts +10 -0
- package/src/lib/ui-kit/select/cs-option/cs-option.component.html +8 -0
- package/src/lib/ui-kit/select/cs-option/cs-option.component.less +49 -0
- package/src/lib/ui-kit/select/cs-option/cs-option.component.ts +31 -0
- package/src/lib/ui-kit/select/cs-select/cs-select.component.html +16 -0
- package/src/lib/ui-kit/select/cs-select/cs-select.component.less +142 -0
- package/src/lib/ui-kit/select/cs-select/cs-select.component.ts +96 -0
- package/src/lib/ui-kit/select/safe-html.pipe.ts +13 -0
- package/src/lib/ui-kit/select/select.module.ts +13 -0
- package/src/lib/ui-kit/services/cs-select.service.ts +10 -0
- package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.html +30 -0
- package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.less +442 -0
- package/src/lib/ui-kit/smiley-dialog/smiley-dialog.component.ts +40 -0
- package/src/lib/ui-kit/smiley-dialog/smiley-dialog.module.ts +11 -0
- package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.html +10 -0
- package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.less +110 -0
- package/src/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.ts +42 -0
- package/src/lib/ui-kit/snack-bar/snack-bar.module.ts +10 -0
- package/src/lib/ui-kit/snack-bar/snack-bar.service.ts +18 -0
- package/src/lib/ui-kit/time-filter/time-filter.component.html +84 -0
- package/src/lib/ui-kit/time-filter/time-filter.component.less +481 -0
- package/src/lib/ui-kit/time-filter/time-filter.component.ts +284 -0
- package/src/lib/ui-kit/time-filter/time-filter.module.ts +10 -0
- package/src/lib/ui-kit/tooltip/tooltip.directive.ts +127 -0
- package/src/lib/ui-kit/tooltip/tooltip.module.ts +10 -0
- package/src/lib/ui-kit/v-loader/loader/loader.component.html +6 -0
- package/src/lib/ui-kit/v-loader/loader/loader.component.less +52 -0
- package/src/lib/ui-kit/v-loader/loader/loader.component.ts +22 -0
- package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.html +6 -0
- package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.less +52 -0
- package/src/lib/ui-kit/v-loader/loader-inline/loader-inline.component.ts +22 -0
- package/src/lib/ui-kit/v-loader/v-loader.module.ts +11 -0
- package/src/public-api.ts +11 -0
- package/src/test.ts +28 -0
- package/tsconfig.lib.json +20 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2022/lib/configurations.mjs +0 -7
- package/esm2022/lib/create-dashboard-container/categories/categories-config.mjs +0 -2
- package/esm2022/lib/create-dashboard-container/categories/categories.component.mjs +0 -210
- package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.mjs +0 -549
- package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.mjs +0 -2
- package/esm2022/lib/create-dashboard-container/configure-widgets/configure-widgets.module.mjs +0 -45
- package/esm2022/lib/create-dashboard-container/create-dashboard-config.mjs +0 -2
- package/esm2022/lib/create-dashboard-container/create-dashboard.component.mjs +0 -1080
- package/esm2022/lib/create-dashboard-container/create-dashboard.module.mjs +0 -125
- package/esm2022/lib/create-dashboard-container/directives/directives.module.mjs +0 -24
- package/esm2022/lib/create-dashboard-container/directives/scroll-in-view.directive.mjs +0 -36
- package/esm2022/lib/create-dashboard-container/form-group/form-group.component.mjs +0 -152
- package/esm2022/lib/create-dashboard-container/frequency/frequency.component.mjs +0 -309
- package/esm2022/lib/create-dashboard-container/interfaces/widget-data-model.mjs +0 -2
- package/esm2022/lib/create-dashboard-container/pipes/filter.pipe.mjs +0 -30
- package/esm2022/lib/create-dashboard-container/pipes/search.pipe.mjs +0 -25
- package/esm2022/lib/create-dashboard-container/pipes/text-count.pipe.mjs +0 -19
- package/esm2022/lib/create-dashboard-container/responsibility-center/responsibility-center.component.mjs +0 -145
- package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories-config.mjs +0 -2
- package/esm2022/lib/create-dashboard-container/risk-categories/risk-categories.component.mjs +0 -195
- package/esm2022/lib/create-dashboard-container/services/auth.service.mjs +0 -31
- package/esm2022/lib/create-dashboard-container/services/configure-widgets.service.mjs +0 -227
- package/esm2022/lib/create-dashboard-container/services/create-dashboard.service.mjs +0 -126
- package/esm2022/lib/create-dashboard-container/services/pagination.service.mjs +0 -28
- package/esm2022/lib/create-dashboard-container/user-list/user-list.component.mjs +0 -421
- package/esm2022/lib/create-dashboard-container/user-list/user-list.config.mjs +0 -2
- package/esm2022/lib/create-dashboard.service.mjs +0 -14
- package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.mjs +0 -52
- package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer-config.mjs +0 -2
- package/esm2022/lib/ui-kit/dashboard-footer/dashboard-footer.module.mjs +0 -32
- package/esm2022/lib/ui-kit/dialog/dialog-config.mjs +0 -7
- package/esm2022/lib/ui-kit/dialog/dialog-injector.mjs +0 -17
- package/esm2022/lib/ui-kit/dialog/dialog-ref.mjs +0 -11
- package/esm2022/lib/ui-kit/dialog/dialog.component.mjs +0 -96
- package/esm2022/lib/ui-kit/dialog/dialog.module.mjs +0 -20
- package/esm2022/lib/ui-kit/dialog/dialog.service.mjs +0 -56
- package/esm2022/lib/ui-kit/dialog/insertion.directive.mjs +0 -17
- package/esm2022/lib/ui-kit/floating-bar/floating-bar.component.mjs +0 -57
- package/esm2022/lib/ui-kit/floating-bar/floating-bar.module.mjs +0 -32
- package/esm2022/lib/ui-kit/formgroup/click-outside.directive.mjs +0 -30
- package/esm2022/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.mjs +0 -29
- package/esm2022/lib/ui-kit/formgroup/cs-radio/cs-radio.component.mjs +0 -34
- package/esm2022/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.mjs +0 -14
- package/esm2022/lib/ui-kit/formgroup/cs-select/cs-select.component.mjs +0 -119
- package/esm2022/lib/ui-kit/formgroup/cs-switch/cs-switch.component.mjs +0 -39
- package/esm2022/lib/ui-kit/formgroup/formgroup.module.mjs +0 -55
- package/esm2022/lib/ui-kit/formgroup/pipes/pascal.pipe.mjs +0 -19
- package/esm2022/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.mjs +0 -24
- package/esm2022/lib/ui-kit/no-data/no-data.component.mjs +0 -47
- package/esm2022/lib/ui-kit/no-data/no-data.module.mjs +0 -18
- package/esm2022/lib/ui-kit/pagination/pagination.component.mjs +0 -130
- package/esm2022/lib/ui-kit/pagination/pagination.module.mjs +0 -18
- package/esm2022/lib/ui-kit/popover/popover.component.mjs +0 -142
- package/esm2022/lib/ui-kit/popover/popover.directive.mjs +0 -93
- package/esm2022/lib/ui-kit/popover/popover.module.mjs +0 -21
- package/esm2022/lib/ui-kit/popover/popover.service.mjs +0 -23
- package/esm2022/lib/ui-kit/select/cs-option/cs-option.component.mjs +0 -41
- package/esm2022/lib/ui-kit/select/cs-select/cs-select.component.mjs +0 -105
- package/esm2022/lib/ui-kit/select/safe-html.pipe.mjs +0 -21
- package/esm2022/lib/ui-kit/select/select.module.mjs +0 -21
- package/esm2022/lib/ui-kit/services/cs-select.service.mjs +0 -16
- package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.component.mjs +0 -52
- package/esm2022/lib/ui-kit/smiley-dialog/smiley-dialog.module.mjs +0 -18
- package/esm2022/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.mjs +0 -46
- package/esm2022/lib/ui-kit/snack-bar/snack-bar.module.mjs +0 -18
- package/esm2022/lib/ui-kit/snack-bar/snack-bar.service.mjs +0 -23
- package/esm2022/lib/ui-kit/tooltip/tooltip.directive.mjs +0 -161
- package/esm2022/lib/ui-kit/tooltip/tooltip.module.mjs +0 -18
- package/esm2022/lib/ui-kit/v-loader/loader/loader.component.mjs +0 -23
- package/esm2022/lib/ui-kit/v-loader/loader-inline/loader-inline.component.mjs +0 -23
- package/esm2022/lib/ui-kit/v-loader/v-loader.module.mjs +0 -19
- package/esm2022/public-api.mjs +0 -10
- package/esm2022/vc-create-dashboard.mjs +0 -5
- package/fesm2022/vc-create-dashboard.mjs +0 -5338
- package/fesm2022/vc-create-dashboard.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/configurations.d.ts +0 -4
- package/lib/create-dashboard-container/categories/categories-config.d.ts +0 -18
- package/lib/create-dashboard-container/categories/categories.component.d.ts +0 -31
- package/lib/create-dashboard-container/configure-widgets/configure-widgets/configure-widgets.component.d.ts +0 -88
- package/lib/create-dashboard-container/configure-widgets/configure-widgets/widget.interface.d.ts +0 -9
- package/lib/create-dashboard-container/configure-widgets/configure-widgets.module.d.ts +0 -14
- package/lib/create-dashboard-container/create-dashboard-config.d.ts +0 -18
- package/lib/create-dashboard-container/create-dashboard.component.d.ts +0 -173
- package/lib/create-dashboard-container/create-dashboard.module.d.ts +0 -36
- package/lib/create-dashboard-container/directives/directives.module.d.ts +0 -8
- package/lib/create-dashboard-container/directives/scroll-in-view.directive.d.ts +0 -12
- package/lib/create-dashboard-container/form-group/form-group.component.d.ts +0 -47
- package/lib/create-dashboard-container/frequency/frequency.component.d.ts +0 -39
- package/lib/create-dashboard-container/pipes/filter.pipe.d.ts +0 -7
- package/lib/create-dashboard-container/pipes/search.pipe.d.ts +0 -7
- package/lib/create-dashboard-container/pipes/text-count.pipe.d.ts +0 -7
- package/lib/create-dashboard-container/responsibility-center/responsibility-center.component.d.ts +0 -27
- package/lib/create-dashboard-container/risk-categories/risk-categories-config.d.ts +0 -18
- package/lib/create-dashboard-container/risk-categories/risk-categories.component.d.ts +0 -31
- package/lib/create-dashboard-container/services/auth.service.d.ts +0 -11
- package/lib/create-dashboard-container/services/configure-widgets.service.d.ts +0 -38
- package/lib/create-dashboard-container/services/create-dashboard.service.d.ts +0 -47
- package/lib/create-dashboard-container/services/pagination.service.d.ts +0 -12
- package/lib/create-dashboard-container/user-list/user-list.component.d.ts +0 -88
- package/lib/create-dashboard.service.d.ts +0 -6
- package/lib/ui-kit/dashboard-footer/dashboard-footer/dashboard-footer.component.d.ts +0 -17
- package/lib/ui-kit/dashboard-footer/dashboard-footer-config.d.ts +0 -11
- package/lib/ui-kit/dashboard-footer/dashboard-footer.module.d.ts +0 -10
- package/lib/ui-kit/dialog/dialog-config.d.ts +0 -6
- package/lib/ui-kit/dialog/dialog-injector.d.ts +0 -7
- package/lib/ui-kit/dialog/dialog-ref.d.ts +0 -7
- package/lib/ui-kit/dialog/dialog.component.d.ts +0 -33
- package/lib/ui-kit/dialog/dialog.module.d.ts +0 -9
- package/lib/ui-kit/dialog/dialog.service.d.ts +0 -17
- package/lib/ui-kit/dialog/insertion.directive.d.ts +0 -8
- package/lib/ui-kit/floating-bar/floating-bar.component.d.ts +0 -20
- package/lib/ui-kit/floating-bar/floating-bar.module.d.ts +0 -10
- package/lib/ui-kit/formgroup/click-outside.directive.d.ts +0 -10
- package/lib/ui-kit/formgroup/cs-checkbox/cs-checkbox.component.d.ts +0 -13
- package/lib/ui-kit/formgroup/cs-radio/cs-radio.component.d.ts +0 -15
- package/lib/ui-kit/formgroup/cs-radio-group/cs-radio-group.component.d.ts +0 -8
- package/lib/ui-kit/formgroup/cs-select/cs-select.component.d.ts +0 -36
- package/lib/ui-kit/formgroup/cs-switch/cs-switch.component.d.ts +0 -15
- package/lib/ui-kit/formgroup/formgroup.module.d.ts +0 -17
- package/lib/ui-kit/formgroup/pipes/pascal.pipe.d.ts +0 -7
- package/lib/ui-kit/formgroup/pipes/searchMultiSelect.pipe.d.ts +0 -7
- package/lib/ui-kit/no-data/no-data.component.d.ts +0 -19
- package/lib/ui-kit/no-data/no-data.module.d.ts +0 -8
- package/lib/ui-kit/pagination/pagination.component.d.ts +0 -21
- package/lib/ui-kit/pagination/pagination.module.d.ts +0 -8
- package/lib/ui-kit/popover/popover.component.d.ts +0 -28
- package/lib/ui-kit/popover/popover.directive.d.ts +0 -17
- package/lib/ui-kit/popover/popover.module.d.ts +0 -9
- package/lib/ui-kit/popover/popover.service.d.ts +0 -13
- package/lib/ui-kit/select/cs-option/cs-option.component.d.ts +0 -16
- package/lib/ui-kit/select/cs-select/cs-select.component.d.ts +0 -32
- package/lib/ui-kit/select/safe-html.pipe.d.ts +0 -10
- package/lib/ui-kit/select/select.module.d.ts +0 -11
- package/lib/ui-kit/services/cs-select.service.d.ts +0 -7
- package/lib/ui-kit/smiley-dialog/smiley-dialog.component.d.ts +0 -17
- package/lib/ui-kit/smiley-dialog/smiley-dialog.module.d.ts +0 -8
- package/lib/ui-kit/snack-bar/snack-bar/snack-bar.component.d.ts +0 -17
- package/lib/ui-kit/snack-bar/snack-bar.module.d.ts +0 -8
- package/lib/ui-kit/snack-bar/snack-bar.service.d.ts +0 -9
- package/lib/ui-kit/tooltip/tooltip.directive.d.ts +0 -27
- package/lib/ui-kit/tooltip/tooltip.module.d.ts +0 -8
- package/lib/ui-kit/v-loader/loader/loader.component.d.ts +0 -11
- package/lib/ui-kit/v-loader/loader-inline/loader-inline.component.d.ts +0 -11
- package/lib/ui-kit/v-loader/v-loader.module.d.ts +0 -9
- package/public-api.d.ts +0 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<div class="create-frequency" [class.animate-slideInRight]="animation">
|
|
2
|
+
<div class="create-frequency-head vx-d-flex vx-align-center vx-justify-between vx-pl-4 vx-pr-4 vx-mb-4">
|
|
3
|
+
<div class="vx-fs-14 vx-fw-500 vx-label-txt">Select a Frequency</div>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="create-frequency-body vx-pl-4 vx-pr-4">
|
|
6
|
+
<div class="create-frequency-body-inner">
|
|
7
|
+
<div class="create-frequency-tab" [ngSwitch]="frequencyTab">
|
|
8
|
+
<div class="create-frequency-tab-head">
|
|
9
|
+
<ul class="navigation">
|
|
10
|
+
<li><button [class.active]="frequencyTab == 'weekly'" (click)="changeTab('weekly')">Weekly</button></li>
|
|
11
|
+
<li><button [class.active]="frequencyTab == 'monthly'" (click)="changeTab('monthly')">Monthly</button></li>
|
|
12
|
+
<li><button [class.active]="frequencyTab == 'quarterly'" (click)="changeTab('quarterly')">Quarterly</button></li>
|
|
13
|
+
</ul>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="create-frequency-tab-body vx-pl-4 vx-pr-4">
|
|
16
|
+
<div class="vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1">Email Reminder Frequency:</div>
|
|
17
|
+
<div class="checkbox-list" *ngSwitchCase="'weekly'">
|
|
18
|
+
<div class="frequency-checkbox vx-d-flex vx-align-center">
|
|
19
|
+
<div class="frequency-checkbox-item vx-p-3 vx-pr-4 vx-d-flex vx-align-center" *ngFor="let day of dayNames; let dayIndex = index">
|
|
20
|
+
<app-cs-checkbox (ngValueChange)="daySelectionChange($event, dayIndex)" [ngValue]="selectedDays.includes(dayIndex)">{{day}}</app-cs-checkbox>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="checkbox-list month" *ngSwitchCase="'monthly'">
|
|
25
|
+
<div class="frequency-top vx-d-flex vx-align-center">
|
|
26
|
+
<div class="vx-fs-13 vx-paragraph-txt">Day</div>
|
|
27
|
+
<input type="number" (focusout)="checkDateValidity(monthlyDate,'monthly')" [(ngModel)]="monthlyDate" class="countNum" onkeydown="return event.keyCode !== 190" min="1" oninput="this.value = Math.abs(this.value)">
|
|
28
|
+
<div class="vx-fs-13 vx-paragraph-txt">of</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="frequency-checkbox vx-d-flex vx-align-center vx-flex-wrap">
|
|
31
|
+
<div class="frequency-checkbox-item vx-p-3 vx-pr-4 vx-d-flex vx-align-center" *ngFor="let month of monthNames; let monthIndex = index">
|
|
32
|
+
<app-cs-checkbox (ngValueChange)="monthSelectionChange($event, monthIndex)" [ngValue]="selectedMonths.includes(monthIndex)">{{month}}</app-cs-checkbox>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="checkbox-list" *ngSwitchCase="'quarterly'">
|
|
37
|
+
<ng-container *ngIf="showRadio">
|
|
38
|
+
<div class="frequency-top vx-d-flex vx-align-center">
|
|
39
|
+
<div class="vx-fs-13 vx-paragraph-txt">Day</div>
|
|
40
|
+
<input type="number" (focusout)="checkDateValidity(quarterlyDate,'quarterly')" [(ngModel)]="quarterlyDate" class="countNum" onkeydown="return event.keyCode !== 190" min="1" oninput="this.value = Math.abs(this.value)">
|
|
41
|
+
<div class="vx-fs-13 vx-paragraph-txt">of</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="frequency-checkbox vx-d-flex vx-align-center">
|
|
44
|
+
<div class="frequency-checkbox-item vx-p-3 vx-pr-4 vx-d-flex vx-align-center vx-w-100" *ngFor="let quarter of quarters, let quarterIndex = index">
|
|
45
|
+
<app-cs-radio (checkedEvent)="quarterSelectionChange($event, quarterIndex)" [checked]="selectedQuarter === quarterIndex">{{quarter}}</app-cs-radio>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</ng-container>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="create-frequency-footer">
|
|
55
|
+
<app-dashboard-footer
|
|
56
|
+
[footerDetails]="footerDetails"
|
|
57
|
+
(cancelEvent)="closeFrequencyPopup.emit()"
|
|
58
|
+
(submitEvent)="submitFrequency()"
|
|
59
|
+
></app-dashboard-footer>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
@import url("https://cdn.v-comply.com/design-system/css/icons/icons.css");
|
|
2
|
+
@import url("https://cdn.v-comply.com/design-system/css/display/display.css");
|
|
3
|
+
@import url("https://cdn.v-comply.com/design-system/css/alignment/alignment.css");
|
|
4
|
+
@import url("https://cdn.v-comply.com/design-system/css/text/text.css");
|
|
5
|
+
@import url("https://cdn.v-comply.com/design-system/css/color/color.css");
|
|
6
|
+
@import url("https://cdn.v-comply.com/design-system/css/width/width.css");
|
|
7
|
+
@import url("https://cdn.v-comply.com/design-system/css/margin/margin.css");
|
|
8
|
+
@import url("https://cdn.v-comply.com/design-system/css/margin/margin-top.css");
|
|
9
|
+
@import url("https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css");
|
|
10
|
+
@import url("https://cdn.v-comply.com/design-system/css/margin/margin-left.css");
|
|
11
|
+
@import url("https://cdn.v-comply.com/design-system/css/margin/margin-right.css");
|
|
12
|
+
@import url("https://cdn.v-comply.com/design-system/css/padding/padding.css");
|
|
13
|
+
@import url("https://cdn.v-comply.com/design-system/css/padding/padding-top.css");
|
|
14
|
+
@import url("https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css");
|
|
15
|
+
@import url("https://cdn.v-comply.com/design-system/css/padding/padding-left.css");
|
|
16
|
+
@import url("https://cdn.v-comply.com/design-system/css/padding/padding-right.css");
|
|
17
|
+
|
|
18
|
+
::ng-deep .create-frequency {
|
|
19
|
+
background: #FFFFFF;
|
|
20
|
+
border-right: 1px solid #F1F1F1;
|
|
21
|
+
position: fixed;
|
|
22
|
+
top: 0;
|
|
23
|
+
right: 500px;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
|
|
27
|
+
&-head {
|
|
28
|
+
background: #fbfbfb;
|
|
29
|
+
height: 2.75rem;
|
|
30
|
+
border-bottom: 1px solid #f1f1f1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-body {
|
|
34
|
+
height: calc(100vh - 9.75rem);
|
|
35
|
+
margin: 0 auto 1rem;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
overflow-y: auto;
|
|
38
|
+
width: calc(100% - 2.5rem);
|
|
39
|
+
|
|
40
|
+
&::-webkit-scrollbar-track {
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-inner {
|
|
45
|
+
width: 54.5rem;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
|
|
48
|
+
@media screen and (min-width: 1366px) {
|
|
49
|
+
width: auto;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&-tab {
|
|
55
|
+
&-head {
|
|
56
|
+
border: none!important;
|
|
57
|
+
border-bottom: 1px solid #f1f1f1!important;
|
|
58
|
+
margin-bottom: 1.5rem;
|
|
59
|
+
|
|
60
|
+
ul {
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin : 0;
|
|
63
|
+
|
|
64
|
+
&.navigation {
|
|
65
|
+
display : flex;
|
|
66
|
+
|
|
67
|
+
li {
|
|
68
|
+
list-style : none;
|
|
69
|
+
padding : 0;
|
|
70
|
+
margin: 0 1.5rem 0 0;
|
|
71
|
+
display : flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
|
|
74
|
+
button {
|
|
75
|
+
background : transparent;
|
|
76
|
+
border-radius: 0;
|
|
77
|
+
border : none;
|
|
78
|
+
border-bottom: 0.125rem solid transparent;
|
|
79
|
+
font-size : 11px;
|
|
80
|
+
font-weight : 500;
|
|
81
|
+
color : #747576;
|
|
82
|
+
line-height : 1.5rem;
|
|
83
|
+
position : relative;
|
|
84
|
+
text-transform: uppercase;
|
|
85
|
+
cursor : pointer;
|
|
86
|
+
padding : 0;
|
|
87
|
+
|
|
88
|
+
&.active {
|
|
89
|
+
color: #1e5dd3;
|
|
90
|
+
border-color: #1e5dd3;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-body {
|
|
99
|
+
.checkbox-list {
|
|
100
|
+
border-radius: .25rem;
|
|
101
|
+
border: 1px solid #f1f1f1;
|
|
102
|
+
|
|
103
|
+
.frequency {
|
|
104
|
+
&-top {
|
|
105
|
+
padding : 12px;
|
|
106
|
+
border-bottom: 1px solid #F1F1F1;
|
|
107
|
+
|
|
108
|
+
input.countNum {
|
|
109
|
+
-webkit-appearance: textfield;
|
|
110
|
+
-moz-appearance : textfield;
|
|
111
|
+
border: none;
|
|
112
|
+
border-bottom: 1px solid #DBDBDB;
|
|
113
|
+
color: #161b2f;
|
|
114
|
+
display: inline-block;
|
|
115
|
+
font-size: 13px;
|
|
116
|
+
text-align: center;
|
|
117
|
+
width: 2.75rem;
|
|
118
|
+
padding: 0.125rem;
|
|
119
|
+
margin: 0 0.5rem;
|
|
120
|
+
outline: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&-checkbox {
|
|
125
|
+
background: #fff;
|
|
126
|
+
border-radius: .25rem;
|
|
127
|
+
|
|
128
|
+
&-item {
|
|
129
|
+
border-right: 1px solid #f1f1f1;
|
|
130
|
+
height: 2.75rem;
|
|
131
|
+
|
|
132
|
+
@media screen and (max-width: 1280px) {
|
|
133
|
+
padding: 0 .5rem !important;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:last-of-type {
|
|
137
|
+
border-right: none;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
app-cs-checkbox,
|
|
144
|
+
app-cs-radio {
|
|
145
|
+
display: flex;
|
|
146
|
+
|
|
147
|
+
label {
|
|
148
|
+
span.value {
|
|
149
|
+
font-size : 12px !important;
|
|
150
|
+
color : #161b2f !important;
|
|
151
|
+
font-weight: 400 !important;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.month {
|
|
157
|
+
.frequency-checkbox {
|
|
158
|
+
&-item {
|
|
159
|
+
width : calc(100% / 6);
|
|
160
|
+
|
|
161
|
+
&:first-of-type,
|
|
162
|
+
&:nth-child(2),
|
|
163
|
+
&:nth-child(3),
|
|
164
|
+
&:nth-child(4),
|
|
165
|
+
&:nth-child(5),
|
|
166
|
+
&:nth-child(6) {
|
|
167
|
+
border-bottom: 1px solid #f1f1f1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:nth-child(6) {
|
|
171
|
+
border-right: none;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&-footer {
|
|
181
|
+
padding: 0 2rem;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { FrequencyComponent } from './frequency.component';
|
|
4
|
+
|
|
5
|
+
describe('FrequencyComponent', () => {
|
|
6
|
+
let component: FrequencyComponent;
|
|
7
|
+
let fixture: ComponentFixture<FrequencyComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ FrequencyComponent ],
|
|
12
|
+
imports: []
|
|
13
|
+
})
|
|
14
|
+
.compileComponents();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
fixture = TestBed.createComponent(FrequencyComponent);
|
|
19
|
+
component = fixture.componentInstance;
|
|
20
|
+
fixture.detectChanges();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should create', () => {
|
|
24
|
+
expect(component).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('frequency tab should be weekly by default', () => {
|
|
28
|
+
expect(component.frequencyTab).toEqual('weekly');
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('on init, tab should be updated to the saved tab', () => {
|
|
32
|
+
component.savedFrequencyTab = 'monthly';
|
|
33
|
+
component.savedFrequencies = ['January', 'February'];
|
|
34
|
+
component.ngOnInit();
|
|
35
|
+
expect(component.frequencyTab).toEqual('monthly');
|
|
36
|
+
//expect(component.selectedMonths).toEqual([0,2]);
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('should output the correct weekly string', () => {
|
|
40
|
+
component.frequencyTab = 'weekly';
|
|
41
|
+
component.selectedDays = [1,0,4,2];
|
|
42
|
+
let selectedFreq : any;
|
|
43
|
+
component.saveFrequency.pipe().subscribe((obj: any) => selectedFreq = obj);
|
|
44
|
+
|
|
45
|
+
component.submitFrequency();
|
|
46
|
+
|
|
47
|
+
expect(selectedFreq).toBeTruthy();
|
|
48
|
+
expect(selectedFreq.frequencyString).toEqual('Every Monday, Tuesday, Wednesday, Friday');
|
|
49
|
+
expect(selectedFreq.frequencyType).toEqual('weekly');
|
|
50
|
+
//expect(selectedFreq.frequencies).toEqual([0,1,2,4]);
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('day selection change should updated selectedDays', () => {
|
|
54
|
+
component.selectedDays = [];
|
|
55
|
+
|
|
56
|
+
component.daySelectionChange(true, 2);
|
|
57
|
+
component.daySelectionChange(true, 5);
|
|
58
|
+
|
|
59
|
+
expect(component.selectedDays.includes(2)).toBeTrue();
|
|
60
|
+
expect(component.selectedDays.includes(5)).toBeTrue();
|
|
61
|
+
|
|
62
|
+
component.daySelectionChange(false, 2);
|
|
63
|
+
expect(component.selectedDays.includes(2)).toBeFalse();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should set Default Values', () => {
|
|
67
|
+
component.setToDefaultValues();
|
|
68
|
+
expect(component.selectedDays).toEqual([0]);
|
|
69
|
+
expect(component.selectedMonths).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
|
70
|
+
expect(component.selectedQuarter).toEqual(0);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('is frequency change Tab working for weekly', () => {
|
|
74
|
+
component.changeTab('weekly');
|
|
75
|
+
expect(component.frequencyTab).toEqual('weekly');
|
|
76
|
+
component.savedFrequencies = [0]
|
|
77
|
+
component.savedFrequencyTab = 'weekly';
|
|
78
|
+
expect(component.savedFrequencies).toEqual(component.selectedDays);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('is frequency change Tab working for months', () => {
|
|
82
|
+
component.changeTab('monthly');
|
|
83
|
+
expect(component.frequencyTab).toEqual('monthly');
|
|
84
|
+
component.savedFrequencies = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
85
|
+
component.savedFrequencyTab = 'monthly';
|
|
86
|
+
expect(component.savedFrequencies).toEqual(component.selectedMonths);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('is frequency change Tab working for quarterly', () => {
|
|
90
|
+
component.changeTab('quarterly');
|
|
91
|
+
expect(component.frequencyTab).toEqual('quarterly');
|
|
92
|
+
component.savedFrequencies = 0;
|
|
93
|
+
component.savedFrequencyTab = 'quarterly';
|
|
94
|
+
expect(component.savedFrequencies).toEqual(component.selectedQuarter);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('month Selection Change for true', () => {
|
|
98
|
+
component.monthSelectionChange(true, 5);
|
|
99
|
+
component.monthSelectionChange(true, 8);
|
|
100
|
+
expect(component.selectedMonths).toContain(5);
|
|
101
|
+
expect(component.selectedMonths).toContain(8);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('month Selection Change for false', () => {
|
|
105
|
+
component.monthSelectionChange(false, 2);
|
|
106
|
+
component.monthSelectionChange(false, 6);
|
|
107
|
+
expect(component.selectedMonths).not.toContain(2);
|
|
108
|
+
expect(component.selectedMonths).not.toContain(6);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('quarter Selection Change', () => {
|
|
112
|
+
component.quarterSelectionChange(true, 2);
|
|
113
|
+
expect(component.selectedQuarter).toEqual(2);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('quarter Selection Change', () => {
|
|
117
|
+
component.quarterSelectionChange(true, 0);
|
|
118
|
+
expect(component.selectedQuarter).toEqual(0);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { DashboardFooterConfig } from '../../ui-kit/dashboard-footer/dashboard-footer-config';
|
|
3
|
+
import { SnackBarService } from '../../ui-kit/snack-bar/snack-bar.service';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-frequency',
|
|
8
|
+
templateUrl: './frequency.component.html',
|
|
9
|
+
styleUrls: ['./frequency.component.less']
|
|
10
|
+
})
|
|
11
|
+
export class FrequencyComponent implements OnInit,OnChanges {
|
|
12
|
+
animation = true;
|
|
13
|
+
@Input() savedFrequencyTab: string | undefined;
|
|
14
|
+
monthlyDate = 1;
|
|
15
|
+
quarterlyDate = 1;
|
|
16
|
+
@Input() savedFrequencies: any;
|
|
17
|
+
@Input() selectedDate: any;
|
|
18
|
+
frequencyTab = 'weekly';
|
|
19
|
+
showFrequency = true;
|
|
20
|
+
dayNames = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
|
|
21
|
+
monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
22
|
+
quarters = ['January, April, July, October', 'February, May, August, November', 'March, June, September, December'];
|
|
23
|
+
selectedDays: any[] = [0];
|
|
24
|
+
selectedMonths: any[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
25
|
+
selectedQuarter = 0;
|
|
26
|
+
@Output() closeFrequencyPopup = new EventEmitter<string>();
|
|
27
|
+
@Output() saveFrequency = new EventEmitter<any>();
|
|
28
|
+
footerDetails: DashboardFooterConfig = {
|
|
29
|
+
selectedData: [],
|
|
30
|
+
nonRemovableList:[],
|
|
31
|
+
displayElementKey: '',
|
|
32
|
+
elementId: '',
|
|
33
|
+
singularText: '',
|
|
34
|
+
pluralText: '',
|
|
35
|
+
showFrequency: true,
|
|
36
|
+
frequencyText: 'You have selected a <strong>' + this.frequencyTab + '</strong> frequency.',
|
|
37
|
+
isDisabled: false
|
|
38
|
+
|
|
39
|
+
};
|
|
40
|
+
showRadio = true;
|
|
41
|
+
constructor(private snackBar:SnackBarService) { }
|
|
42
|
+
ngOnChanges(){
|
|
43
|
+
this.savedFrequencies = [...new Set(this.savedFrequencies)]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnInit(): void {
|
|
47
|
+
this.animation = true;
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
this.animation = false;
|
|
50
|
+
}, 300);
|
|
51
|
+
if (this.savedFrequencyTab) {
|
|
52
|
+
this.changeTab(this.savedFrequencyTab);
|
|
53
|
+
}
|
|
54
|
+
if (this.selectedDate) {
|
|
55
|
+
switch (this.savedFrequencyTab) {
|
|
56
|
+
case 'weekly':
|
|
57
|
+
this.selectedDays = [...new Set(this.savedFrequencies)]
|
|
58
|
+
break;
|
|
59
|
+
case 'monthly':
|
|
60
|
+
this.monthlyDate = this.selectedDate;
|
|
61
|
+
this.selectedMonths = [...new Set(this.savedFrequencies)]
|
|
62
|
+
|
|
63
|
+
break;
|
|
64
|
+
case 'quarterly':
|
|
65
|
+
this.showRadio = false;
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
this.showRadio = true
|
|
68
|
+
}, 100);
|
|
69
|
+
this.quarterlyDate = this.selectedDate
|
|
70
|
+
this.selectedQuarter = this.savedFrequencies;
|
|
71
|
+
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
closeFrequency() {
|
|
79
|
+
this.closeFrequencyPopup.emit();
|
|
80
|
+
}
|
|
81
|
+
daySelectionChange(event: any, index: any) {
|
|
82
|
+
if (event) { //checkbox was selected
|
|
83
|
+
this.selectedDays.push(index);
|
|
84
|
+
} else {
|
|
85
|
+
let unselectedElementIndex = this.selectedDays.indexOf(index);
|
|
86
|
+
this.selectedDays.splice(unselectedElementIndex, 1);
|
|
87
|
+
}
|
|
88
|
+
this.checkFrequencyValidity();
|
|
89
|
+
}
|
|
90
|
+
monthSelectionChange(event: any, index: any) {
|
|
91
|
+
if (event) {
|
|
92
|
+
this.selectedMonths.push(index);
|
|
93
|
+
} else {
|
|
94
|
+
let unselectedElementIndex = this.selectedMonths.indexOf(index);
|
|
95
|
+
this.selectedMonths.splice(unselectedElementIndex, 1);
|
|
96
|
+
}
|
|
97
|
+
this.checkDateValidity(this.monthlyDate,'monthly')
|
|
98
|
+
this.checkFrequencyValidity();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
quarterSelectionChange(event: any, index: any) {
|
|
102
|
+
this.selectedQuarter = index;
|
|
103
|
+
this.checkDateValidity(this.quarterlyDate,'quarterly');
|
|
104
|
+
this.checkFrequencyValidity();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
changeTab(tabValue: string) {
|
|
108
|
+
this.frequencyTab = tabValue;
|
|
109
|
+
this.footerDetails.frequencyText = 'You have selected a <strong>' + this.frequencyTab + '</strong> frequency.';
|
|
110
|
+
this.footerDetails.isDisabled = false;
|
|
111
|
+
this.setToDefaultValues()
|
|
112
|
+
if (this.frequencyTab === this.savedFrequencyTab) {
|
|
113
|
+
switch (this.frequencyTab) {
|
|
114
|
+
case 'weekly': {
|
|
115
|
+
this.selectedDays = [...this.savedFrequencies];
|
|
116
|
+
this.monthlyDate = 1;
|
|
117
|
+
this.quarterlyDate = 1;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case 'monthly': {
|
|
121
|
+
this.selectedMonths = [...this.savedFrequencies];
|
|
122
|
+
this.monthlyDate = this.selectedDate;
|
|
123
|
+
this.quarterlyDate = 1;
|
|
124
|
+
this.checkDateValidity(this.monthlyDate,'monthly')
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case 'quarterly': {
|
|
128
|
+
this.selectedQuarter = this.savedFrequencies;
|
|
129
|
+
this.quarterlyDate = this.selectedDate;
|
|
130
|
+
this.monthlyDate = 1;
|
|
131
|
+
this.checkDateValidity(this.quarterlyDate,'quarterly')
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
setToDefaultValues() {
|
|
139
|
+
this.selectedDays = [0];
|
|
140
|
+
this.selectedMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
141
|
+
this.selectedQuarter = 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
submitFrequency() {
|
|
145
|
+
let stringVal = "Every ";
|
|
146
|
+
let frequencies;
|
|
147
|
+
let selectedDate = 1;
|
|
148
|
+
switch (this.frequencyTab) {
|
|
149
|
+
case 'weekly': {
|
|
150
|
+
if (this.selectedDays.length > 0) {
|
|
151
|
+
this.selectedDays.sort();
|
|
152
|
+
frequencies = this.selectedDays;
|
|
153
|
+
this.selectedDays.forEach((dayIndex, index) => {
|
|
154
|
+
stringVal += index === 0 ? this.dayNames[dayIndex] : ', ' + this.dayNames[dayIndex];
|
|
155
|
+
})
|
|
156
|
+
} else {
|
|
157
|
+
// nothing was selected
|
|
158
|
+
this.closeFrequency();
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case 'monthly': {
|
|
163
|
+
stringVal = " of every ";
|
|
164
|
+
if (this.selectedMonths.length > 0) {
|
|
165
|
+
frequencies = this.selectedMonths;
|
|
166
|
+
this.monthNames.forEach((monthNames: string, monthIndex: number) => {
|
|
167
|
+
if (this.selectedMonths.includes(monthIndex)) {
|
|
168
|
+
stringVal += monthIndex === 0 ? monthNames : ', ' + monthNames;
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
let monthDateName;
|
|
173
|
+
if (this.monthlyDate == 1) {
|
|
174
|
+
monthDateName = '1st'
|
|
175
|
+
}
|
|
176
|
+
else if (this.monthlyDate == 2) {
|
|
177
|
+
monthDateName = '2nd'
|
|
178
|
+
}
|
|
179
|
+
else if (this.monthlyDate == 3) {
|
|
180
|
+
monthDateName = '3rd'
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
monthDateName = this.monthlyDate + 'th'
|
|
184
|
+
}
|
|
185
|
+
stringVal = monthDateName + stringVal;
|
|
186
|
+
selectedDate = this.monthlyDate;
|
|
187
|
+
} else {
|
|
188
|
+
// nothing was selected
|
|
189
|
+
this.closeFrequency();
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case 'quarterly': {
|
|
194
|
+
stringVal = " of every ";
|
|
195
|
+
|
|
196
|
+
if (this.selectedQuarter >= 0) {
|
|
197
|
+
frequencies = this.selectedQuarter;
|
|
198
|
+
stringVal += this.quarters[this.selectedQuarter];
|
|
199
|
+
selectedDate = this.quarterlyDate;
|
|
200
|
+
let monthDateName;
|
|
201
|
+
if (this.quarterlyDate == 1) {
|
|
202
|
+
monthDateName = '1st'
|
|
203
|
+
}
|
|
204
|
+
else if (this.quarterlyDate == 2) {
|
|
205
|
+
monthDateName = '2nd'
|
|
206
|
+
}
|
|
207
|
+
else if (this.quarterlyDate == 3) {
|
|
208
|
+
monthDateName = '3rd'
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
monthDateName = this.quarterlyDate + 'th'
|
|
212
|
+
}
|
|
213
|
+
stringVal = monthDateName + stringVal;
|
|
214
|
+
selectedDate = this.quarterlyDate;
|
|
215
|
+
} else {
|
|
216
|
+
// nothing was selected
|
|
217
|
+
this.closeFrequency();
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
this.saveFrequency.emit({
|
|
223
|
+
frequencyString: stringVal,
|
|
224
|
+
frequencyType: this.frequencyTab,
|
|
225
|
+
frequencies: frequencies,
|
|
226
|
+
selectedDate
|
|
227
|
+
})
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
checkDateValidity(date:number, type:string){
|
|
231
|
+
if(date>31 || date<1){
|
|
232
|
+
this.snackBar.show('Select valid date.','alert');
|
|
233
|
+
this.footerDetails.isDisabled = true;
|
|
234
|
+
return
|
|
235
|
+
}else{
|
|
236
|
+
this.footerDetails.isDisabled = false;
|
|
237
|
+
}
|
|
238
|
+
const monthList=[{name:'January',maxDays:31,value:0},{name:'February',maxDays:28,value:1},{name:'March',maxDays:31,value:2},
|
|
239
|
+
{name:'April',maxDays:30,value:3},{name:'May',maxDays:31,value:4},{name:'June',maxDays:30,value:5},
|
|
240
|
+
{name:'July',maxDays:31,value:6},{name:'August',maxDays:31,value:7},{name:'September',maxDays:30,value:8},
|
|
241
|
+
{name:'October',maxDays:31,value:9},{name:'November',maxDays:30,value:10},{name:'December',maxDays:31,value:11}]
|
|
242
|
+
switch (type) {
|
|
243
|
+
case 'monthly':
|
|
244
|
+
if(this.selectedMonths.length==1){
|
|
245
|
+
const index = monthList.findIndex((ele:any)=>ele.value==this.selectedMonths[0]);
|
|
246
|
+
if(date<=monthList[index].maxDays){
|
|
247
|
+
this.footerDetails.isDisabled = false;
|
|
248
|
+
|
|
249
|
+
}else{
|
|
250
|
+
this.snackBar.show('Select valid date.','alert');
|
|
251
|
+
this.footerDetails.isDisabled = true;
|
|
252
|
+
}
|
|
253
|
+
}else if(this.selectedMonths.length==0){
|
|
254
|
+
this.footerDetails.isDisabled = true;
|
|
255
|
+
}else{
|
|
256
|
+
this.footerDetails.isDisabled = false;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
break;
|
|
260
|
+
default:
|
|
261
|
+
this.footerDetails.isDisabled = false;
|
|
262
|
+
return true;
|
|
263
|
+
break;
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
checkFrequencyValidity(){
|
|
270
|
+
switch (this.frequencyTab) {
|
|
271
|
+
case 'weekly': {
|
|
272
|
+
if (this.selectedDays.length > 0) {
|
|
273
|
+
this.footerDetails.isDisabled = false;
|
|
274
|
+
|
|
275
|
+
} else {
|
|
276
|
+
this.footerDetails.isDisabled = true;
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
case 'monthly': {
|
|
281
|
+
|
|
282
|
+
if (this.selectedMonths.length > 0) {
|
|
283
|
+
this.footerDetails.isDisabled = false;
|
|
284
|
+
|
|
285
|
+
} else {
|
|
286
|
+
this.footerDetails.isDisabled = true;
|
|
287
|
+
}
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
case 'quarterly': {
|
|
291
|
+
|
|
292
|
+
if (this.selectedQuarter >= 0){
|
|
293
|
+
this.footerDetails.isDisabled = false;
|
|
294
|
+
|
|
295
|
+
} else {
|
|
296
|
+
this.footerDetails.isDisabled = true;
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
}
|