monkey-front-components 0.0.383 → 0.0.384
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/monkey-front-components-0.0.384.tgz +0 -0
- package/ng-package.json +10 -0
- package/package.json +7 -27
- package/src/lib/components/base/base-component.ts +359 -0
- package/src/lib/components/base/base-dynamic-array.ts +233 -0
- package/src/lib/components/base/base-dynamic.ts +90 -0
- package/src/lib/components/base/base-scroll-component.ts +52 -0
- package/src/lib/components/base/base-validators.ts +19 -0
- package/{lib/components/base/index.d.ts → src/lib/components/base/index.ts} +5 -5
- package/src/lib/components/dynamic/button/button.component.html +4 -0
- package/src/lib/components/dynamic/button/button.component.scss +7 -0
- package/src/lib/components/dynamic/button/button.component.ts +47 -0
- package/{lib/components/dynamic/button/index.d.ts → src/lib/components/dynamic/button/index.ts} +1 -1
- package/src/lib/components/dynamic/dynamic-directive.ts +102 -0
- package/src/lib/components/dynamic/dynamic.module.ts +53 -0
- package/src/lib/components/dynamic/file-upload/file-upload.component.html +10 -0
- package/src/lib/components/dynamic/file-upload/file-upload.component.ts +46 -0
- package/{lib/components/dynamic/file-upload/index.d.ts → src/lib/components/dynamic/file-upload/index.ts} +1 -1
- package/src/lib/components/dynamic/form/dynamic-form-array.component.html +19 -0
- package/src/lib/components/dynamic/form/dynamic-form-array.component.scss +10 -0
- package/src/lib/components/dynamic/form/dynamic-form-array.component.ts +75 -0
- package/src/lib/components/dynamic/form/dynamic-form.component.html +7 -0
- package/src/lib/components/dynamic/form/dynamic-form.component.ts +49 -0
- package/{lib/components/dynamic/form/index.d.ts → src/lib/components/dynamic/form/index.ts} +2 -2
- package/{lib/components/dynamic/index.d.ts → src/lib/components/dynamic/index.ts} +8 -8
- package/{lib/components/dynamic/input/index.d.ts → src/lib/components/dynamic/input/index.ts} +1 -1
- package/src/lib/components/dynamic/input/input.component.html +9 -0
- package/src/lib/components/dynamic/input/input.component.ts +58 -0
- package/{lib/components/dynamic/input-phone/index.d.ts → src/lib/components/dynamic/input-phone/index.ts} +1 -1
- package/src/lib/components/dynamic/input-phone/input-phone.component.html +7 -0
- package/src/lib/components/dynamic/input-phone/input-phone.component.ts +58 -0
- package/{lib/components/dynamic/radio/index.d.ts → src/lib/components/dynamic/radio/index.ts} +1 -1
- package/src/lib/components/dynamic/radio/radio.component.html +8 -0
- package/src/lib/components/dynamic/radio/radio.component.ts +22 -0
- package/{lib/components/dynamic/select/index.d.ts → src/lib/components/dynamic/select/index.ts} +1 -1
- package/src/lib/components/dynamic/select/select.component.html +14 -0
- package/src/lib/components/dynamic/select/select.component.ts +75 -0
- package/{lib/components/dynamic/select-search/index.d.ts → src/lib/components/dynamic/select-search/index.ts} +1 -1
- package/src/lib/components/dynamic/select-search/select-search.component.html +15 -0
- package/src/lib/components/dynamic/select-search/select-search.component.ts +76 -0
- package/{lib/components/index.d.ts → src/lib/components/index.ts} +3 -3
- package/src/lib/components/shared/filter/filter.component.html +51 -0
- package/src/lib/components/shared/filter/filter.component.scss +79 -0
- package/src/lib/components/shared/filter/filter.component.ts +117 -0
- package/src/lib/components/shared/filter/filter.module.ts +36 -0
- package/{lib/components/shared/filter/index.d.ts → src/lib/components/shared/filter/index.ts} +2 -2
- package/{lib/components/shared/filter/menu/index.d.ts → src/lib/components/shared/filter/menu/index.ts} +1 -1
- package/src/lib/components/shared/filter/menu/menu.component.html +28 -0
- package/src/lib/components/shared/filter/menu/menu.component.scss +62 -0
- package/src/lib/components/shared/filter/menu/menu.component.ts +122 -0
- package/src/lib/components/shared/filter/menu/menu.module.ts +41 -0
- package/src/lib/components/shared/filter/options/children/children.component.html +6 -0
- package/src/lib/components/shared/filter/options/children/children.component.scss +30 -0
- package/src/lib/components/shared/filter/options/children/children.component.ts +58 -0
- package/{lib/components/shared/filter/options/children/index.d.ts → src/lib/components/shared/filter/options/children/index.ts} +1 -1
- package/src/lib/components/shared/filter/options/currency/currency.component.html +3 -0
- package/src/lib/components/shared/filter/options/currency/currency.component.scss +19 -0
- package/src/lib/components/shared/filter/options/currency/currency.component.ts +52 -0
- package/{lib/components/shared/filter/options/currency/index.d.ts → src/lib/components/shared/filter/options/currency/index.ts} +1 -1
- package/src/lib/components/shared/filter/options/date-range/date-range.component.html +3 -0
- package/src/lib/components/shared/filter/options/date-range/date-range.component.scss +34 -0
- package/src/lib/components/shared/filter/options/date-range/date-range.component.ts +72 -0
- package/{lib/components/shared/filter/options/date-range/index.d.ts → src/lib/components/shared/filter/options/date-range/index.ts} +1 -1
- package/{lib/components/shared/filter/options/index.d.ts → src/lib/components/shared/filter/options/index.ts} +1 -1
- package/{lib/components/shared/filter/options/input/index.d.ts → src/lib/components/shared/filter/options/input/index.ts} +1 -1
- package/src/lib/components/shared/filter/options/input/input.component.html +3 -0
- package/src/lib/components/shared/filter/options/input/input.component.scss +19 -0
- package/src/lib/components/shared/filter/options/input/input.component.ts +52 -0
- package/src/lib/components/shared/filter/options/options.component.html +43 -0
- package/src/lib/components/shared/filter/options/options.component.scss +56 -0
- package/src/lib/components/shared/filter/options/options.component.ts +58 -0
- package/src/lib/components/shared/filter/options/options.module.ts +58 -0
- package/{lib/components/shared/filter/options/status/index.d.ts → src/lib/components/shared/filter/options/status/index.ts} +1 -1
- package/src/lib/components/shared/filter/options/status/status.component.html +4 -0
- package/src/lib/components/shared/filter/options/status/status.component.scss +29 -0
- package/src/lib/components/shared/filter/options/status/status.component.ts +73 -0
- package/{lib/components/shared/filter/selected/index.d.ts → src/lib/components/shared/filter/selected/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/children/children.component.html +19 -0
- package/src/lib/components/shared/filter/selected/item/children/children.component.scss +68 -0
- package/src/lib/components/shared/filter/selected/item/children/children.component.ts +49 -0
- package/{lib/components/shared/filter/selected/item/children/index.d.ts → src/lib/components/shared/filter/selected/item/children/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/currency/currency.component.html +1 -0
- package/src/lib/components/shared/filter/selected/item/currency/currency.component.scss +4 -0
- package/src/lib/components/shared/filter/selected/item/currency/currency.component.ts +26 -0
- package/{lib/components/shared/filter/selected/item/currency/index.d.ts → src/lib/components/shared/filter/selected/item/currency/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.html +2 -0
- package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.scss +4 -0
- package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.ts +39 -0
- package/{lib/components/shared/filter/selected/item/date-range/index.d.ts → src/lib/components/shared/filter/selected/item/date-range/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.html +1 -0
- package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.scss +4 -0
- package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.ts +29 -0
- package/{lib/components/shared/filter/selected/item/date-with-action/index.d.ts → src/lib/components/shared/filter/selected/item/date-with-action/index.ts} +1 -1
- package/{lib/components/shared/filter/selected/item/index.d.ts → src/lib/components/shared/filter/selected/item/index.ts} +7 -7
- package/{lib/components/shared/filter/selected/item/input/index.d.ts → src/lib/components/shared/filter/selected/item/input/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/input/input.component.html +1 -0
- package/src/lib/components/shared/filter/selected/item/input/input.component.scss +4 -0
- package/src/lib/components/shared/filter/selected/item/input/input.component.ts +26 -0
- package/src/lib/components/shared/filter/selected/item/item.component.html +38 -0
- package/src/lib/components/shared/filter/selected/item/item.component.scss +72 -0
- package/src/lib/components/shared/filter/selected/item/item.component.ts +71 -0
- package/{lib/components/shared/filter/selected/item/status/index.d.ts → src/lib/components/shared/filter/selected/item/status/index.ts} +1 -1
- package/src/lib/components/shared/filter/selected/item/status/status.component.html +1 -0
- package/src/lib/components/shared/filter/selected/item/status/status.component.scss +4 -0
- package/src/lib/components/shared/filter/selected/item/status/status.component.ts +36 -0
- package/src/lib/components/shared/filter/selected/selected.component.html +3 -0
- package/src/lib/components/shared/filter/selected/selected.component.scss +9 -0
- package/src/lib/components/shared/filter/selected/selected.component.ts +76 -0
- package/src/lib/components/shared/filter/selected/selected.module.ts +60 -0
- package/{lib/components/shared/index.d.ts → src/lib/components/shared/index.ts} +4 -4
- package/{lib/components/shared/password-strength/index.d.ts → src/lib/components/shared/password-strength/index.ts} +2 -2
- package/src/lib/components/shared/password-strength/password-strength.component.html +50 -0
- package/src/lib/components/shared/password-strength/password-strength.component.scss +70 -0
- package/src/lib/components/shared/password-strength/password-strength.component.ts +89 -0
- package/src/lib/components/shared/password-strength/password-strength.module.ts +24 -0
- package/src/lib/components/shared/password-strength/password-strength.ts +5 -0
- package/src/lib/components/shared/products/filter/filter.component.html +6 -0
- package/src/lib/components/shared/products/filter/filter.component.scss +20 -0
- package/src/lib/components/shared/products/filter/filter.component.ts +34 -0
- package/{lib/components/shared/products/index.d.ts → src/lib/components/shared/products/index.ts} +2 -2
- package/src/lib/components/shared/products/products.component.html +15 -0
- package/src/lib/components/shared/products/products.component.scss +70 -0
- package/src/lib/components/shared/products/products.component.ts +104 -0
- package/src/lib/components/shared/products/products.module.ts +13 -0
- package/{lib/components/shared/products/providers/index.d.ts → src/lib/components/shared/products/providers/index.ts} +1 -1
- package/src/lib/components/shared/products/providers/products.model.ts +60 -0
- package/{lib/components/shared/progress-bar/index.d.ts → src/lib/components/shared/progress-bar/index.ts} +3 -3
- package/src/lib/components/shared/progress-bar/progress-bar.component.html +3 -0
- package/src/lib/components/shared/progress-bar/progress-bar.component.scss +6 -0
- package/src/lib/components/shared/progress-bar/progress-bar.component.ts +27 -0
- package/src/lib/components/shared/progress-bar/progress-bar.module.ts +10 -0
- package/src/lib/components/shared/progress-bar/progress-bar.service.ts +59 -0
- package/src/lib/interfaces/field-config.ts +58 -0
- package/{lib/interfaces/index.d.ts → src/lib/interfaces/index.ts} +1 -1
- package/src/public-api.ts +5 -0
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +20 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/components/base/base-component.mjs +0 -322
- package/esm2020/lib/components/base/base-dynamic-array.mjs +0 -221
- package/esm2020/lib/components/base/base-dynamic.mjs +0 -99
- package/esm2020/lib/components/base/base-scroll-component.mjs +0 -55
- package/esm2020/lib/components/base/base-validators.mjs +0 -19
- package/esm2020/lib/components/base/index.mjs +0 -6
- package/esm2020/lib/components/dynamic/button/button.component.mjs +0 -52
- package/esm2020/lib/components/dynamic/button/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/dynamic-directive.mjs +0 -95
- package/esm2020/lib/components/dynamic/dynamic.module.mjs +0 -84
- package/esm2020/lib/components/dynamic/file-upload/file-upload.component.mjs +0 -52
- package/esm2020/lib/components/dynamic/file-upload/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/form/dynamic-form-array.component.mjs +0 -72
- package/esm2020/lib/components/dynamic/form/dynamic-form.component.mjs +0 -46
- package/esm2020/lib/components/dynamic/form/index.mjs +0 -3
- package/esm2020/lib/components/dynamic/index.mjs +0 -9
- package/esm2020/lib/components/dynamic/input/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/input/input.component.mjs +0 -65
- package/esm2020/lib/components/dynamic/input-phone/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/input-phone/input-phone.component.mjs +0 -65
- package/esm2020/lib/components/dynamic/radio/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/radio/radio.component.mjs +0 -33
- package/esm2020/lib/components/dynamic/select/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/select/select.component.mjs +0 -80
- package/esm2020/lib/components/dynamic/select-search/index.mjs +0 -2
- package/esm2020/lib/components/dynamic/select-search/select-search.component.mjs +0 -80
- package/esm2020/lib/components/index.mjs +0 -4
- package/esm2020/lib/components/shared/filter/filter.component.mjs +0 -119
- package/esm2020/lib/components/shared/filter/filter.module.mjs +0 -63
- package/esm2020/lib/components/shared/filter/index.mjs +0 -3
- package/esm2020/lib/components/shared/filter/menu/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/menu/menu.component.mjs +0 -120
- package/esm2020/lib/components/shared/filter/menu/menu.module.mjs +0 -70
- package/esm2020/lib/components/shared/filter/options/children/children.component.mjs +0 -50
- package/esm2020/lib/components/shared/filter/options/children/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/currency/currency.component.mjs +0 -46
- package/esm2020/lib/components/shared/filter/options/currency/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/date-range/date-range.component.mjs +0 -65
- package/esm2020/lib/components/shared/filter/options/date-range/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/input/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/input/input.component.mjs +0 -46
- package/esm2020/lib/components/shared/filter/options/options.component.mjs +0 -68
- package/esm2020/lib/components/shared/filter/options/options.module.mjs +0 -95
- package/esm2020/lib/components/shared/filter/options/status/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/options/status/status.component.mjs +0 -66
- package/esm2020/lib/components/shared/filter/selected/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/children/children.component.mjs +0 -57
- package/esm2020/lib/components/shared/filter/selected/item/children/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/currency/currency.component.mjs +0 -29
- package/esm2020/lib/components/shared/filter/selected/item/currency/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/date-range/date-range.component.mjs +0 -42
- package/esm2020/lib/components/shared/filter/selected/item/date-range/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.mjs +0 -33
- package/esm2020/lib/components/shared/filter/selected/item/date-with-action/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/index.mjs +0 -8
- package/esm2020/lib/components/shared/filter/selected/item/input/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/input/input.component.mjs +0 -28
- package/esm2020/lib/components/shared/filter/selected/item/item.component.mjs +0 -74
- package/esm2020/lib/components/shared/filter/selected/item/status/index.mjs +0 -2
- package/esm2020/lib/components/shared/filter/selected/item/status/status.component.mjs +0 -39
- package/esm2020/lib/components/shared/filter/selected/selected.component.mjs +0 -80
- package/esm2020/lib/components/shared/filter/selected/selected.module.mjs +0 -90
- package/esm2020/lib/components/shared/index.mjs +0 -5
- package/esm2020/lib/components/shared/password-strength/index.mjs +0 -3
- package/esm2020/lib/components/shared/password-strength/password-strength.component.mjs +0 -85
- package/esm2020/lib/components/shared/password-strength/password-strength.mjs +0 -2
- package/esm2020/lib/components/shared/password-strength/password-strength.module.mjs +0 -50
- package/esm2020/lib/components/shared/products/filter/filter.component.mjs +0 -36
- package/esm2020/lib/components/shared/products/index.mjs +0 -3
- package/esm2020/lib/components/shared/products/products.component.mjs +0 -91
- package/esm2020/lib/components/shared/products/products.module.mjs +0 -22
- package/esm2020/lib/components/shared/products/providers/index.mjs +0 -2
- package/esm2020/lib/components/shared/products/providers/products.model.mjs +0 -38
- package/esm2020/lib/components/shared/progress-bar/index.mjs +0 -4
- package/esm2020/lib/components/shared/progress-bar/progress-bar.component.mjs +0 -28
- package/esm2020/lib/components/shared/progress-bar/progress-bar.module.mjs +0 -18
- package/esm2020/lib/components/shared/progress-bar/progress-bar.service.mjs +0 -49
- package/esm2020/lib/interfaces/field-config.mjs +0 -2
- package/esm2020/lib/interfaces/index.mjs +0 -2
- package/esm2020/monkey-front-components.mjs +0 -5
- package/esm2020/public-api.mjs +0 -5
- package/fesm2015/monkey-front-components.mjs +0 -2877
- package/fesm2015/monkey-front-components.mjs.map +0 -1
- package/fesm2020/monkey-front-components.mjs +0 -2859
- package/fesm2020/monkey-front-components.mjs.map +0 -1
- package/lib/components/base/base-component.d.ts +0 -50
- package/lib/components/base/base-dynamic-array.d.ts +0 -34
- package/lib/components/base/base-dynamic.d.ts +0 -24
- package/lib/components/base/base-scroll-component.d.ts +0 -16
- package/lib/components/base/base-validators.d.ts +0 -1
- package/lib/components/dynamic/button/button.component.d.ts +0 -17
- package/lib/components/dynamic/dynamic-directive.d.ts +0 -22
- package/lib/components/dynamic/dynamic.module.d.ts +0 -20
- package/lib/components/dynamic/file-upload/file-upload.component.d.ts +0 -17
- package/lib/components/dynamic/form/dynamic-form-array.component.d.ts +0 -16
- package/lib/components/dynamic/form/dynamic-form.component.d.ts +0 -14
- package/lib/components/dynamic/input/input.component.d.ts +0 -20
- package/lib/components/dynamic/input-phone/input-phone.component.d.ts +0 -20
- package/lib/components/dynamic/radio/radio.component.d.ts +0 -11
- package/lib/components/dynamic/select/select.component.d.ts +0 -16
- package/lib/components/dynamic/select-search/select-search.component.d.ts +0 -16
- package/lib/components/shared/filter/filter.component.d.ts +0 -32
- package/lib/components/shared/filter/filter.module.d.ts +0 -14
- package/lib/components/shared/filter/menu/menu.component.d.ts +0 -24
- package/lib/components/shared/filter/menu/menu.module.d.ts +0 -14
- package/lib/components/shared/filter/options/children/children.component.d.ts +0 -17
- package/lib/components/shared/filter/options/currency/currency.component.d.ts +0 -17
- package/lib/components/shared/filter/options/date-range/date-range.component.d.ts +0 -24
- package/lib/components/shared/filter/options/input/input.component.d.ts +0 -17
- package/lib/components/shared/filter/options/options.component.d.ts +0 -20
- package/lib/components/shared/filter/options/options.module.d.ts +0 -18
- package/lib/components/shared/filter/options/status/status.component.d.ts +0 -19
- package/lib/components/shared/filter/selected/item/children/children.component.d.ts +0 -16
- package/lib/components/shared/filter/selected/item/currency/currency.component.d.ts +0 -11
- package/lib/components/shared/filter/selected/item/date-range/date-range.component.d.ts +0 -12
- package/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.d.ts +0 -11
- package/lib/components/shared/filter/selected/item/input/input.component.d.ts +0 -11
- package/lib/components/shared/filter/selected/item/item.component.d.ts +0 -20
- package/lib/components/shared/filter/selected/item/status/status.component.d.ts +0 -13
- package/lib/components/shared/filter/selected/selected.component.d.ts +0 -18
- package/lib/components/shared/filter/selected/selected.module.d.ts +0 -21
- package/lib/components/shared/password-strength/password-strength.component.d.ts +0 -23
- package/lib/components/shared/password-strength/password-strength.d.ts +0 -5
- package/lib/components/shared/password-strength/password-strength.module.d.ts +0 -12
- package/lib/components/shared/products/filter/filter.component.d.ts +0 -12
- package/lib/components/shared/products/products.component.d.ts +0 -20
- package/lib/components/shared/products/products.module.d.ts +0 -11
- package/lib/components/shared/products/providers/products.model.d.ts +0 -13
- package/lib/components/shared/progress-bar/progress-bar.component.d.ts +0 -12
- package/lib/components/shared/progress-bar/progress-bar.module.d.ts +0 -8
- package/lib/components/shared/progress-bar/progress-bar.service.d.ts +0 -14
- package/lib/interfaces/field-config.d.ts +0 -54
- package/monkey-front-components-0.0.383.tgz +0 -0
- package/monkey-front-components.d.ts +0 -5
- package/public-api.d.ts +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<div class="d-flex flex-column" #actionElement>
|
|
2
|
+
<ng-container *ngFor="let menu of _model; let index = index">
|
|
3
|
+
<ng-container *ngIf="menu?.children; else withoutChildren">
|
|
4
|
+
<div class="item no-action">
|
|
5
|
+
{{ menu.label | translate }}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="separator"></div>
|
|
8
|
+
<ng-container *ngFor="let child of menu?.children">
|
|
9
|
+
<div class="item children" (click)="onHandleChildrenAction(menu, child)">
|
|
10
|
+
{{ child.label | translate }}
|
|
11
|
+
</div>
|
|
12
|
+
</ng-container>
|
|
13
|
+
</ng-container>
|
|
14
|
+
<ng-template #withoutChildren>
|
|
15
|
+
<div class="item" (click)="onHandleShowMenu(menu)">
|
|
16
|
+
{{ menu.label | translate }}
|
|
17
|
+
</div>
|
|
18
|
+
</ng-template>
|
|
19
|
+
<ng-container *ngIf="_model[index+1]?.group as next; _model[index]?.group as current">
|
|
20
|
+
<div class="separator" *ngIf="next !== current"></div>
|
|
21
|
+
</ng-container>
|
|
22
|
+
</ng-container>
|
|
23
|
+
</div>
|
|
24
|
+
<ng-container
|
|
25
|
+
*monkeyecxPopover="_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'rt'">
|
|
26
|
+
<mecx-filter-options [option]="_menuOption" (onClose)="onHandleClose()"
|
|
27
|
+
(onSubmit)="onHandleSubmit($event)" [closeDirectly]="true"></mecx-filter-options>
|
|
28
|
+
</ng-container>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@import 'node_modules/monkey-style-guide/assets/scss/partials/variables';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
background: #fafafa;
|
|
7
|
+
border: 1px solid #d6d6d6;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
box-shadow: 0px 4px 36px -8px #6d6d6d3a;
|
|
10
|
+
border-radius: 16px !important;
|
|
11
|
+
min-width: 192px;
|
|
12
|
+
margin: 4px 8px;
|
|
13
|
+
overflow: auto;
|
|
14
|
+
max-height: 500px;
|
|
15
|
+
|
|
16
|
+
::ng-deep monkey-button {
|
|
17
|
+
width: 100%;
|
|
18
|
+
|
|
19
|
+
button {
|
|
20
|
+
justify-content: flex-start !important;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.item {
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
line-height: 24px;
|
|
30
|
+
color: #72717e;
|
|
31
|
+
padding: 8px 24px 8px 24px;
|
|
32
|
+
|
|
33
|
+
&.no-action {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
padding: 8px;
|
|
36
|
+
margin: 0px !important;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:first-child {
|
|
41
|
+
margin: 12px 0px 0px 0px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:last-child {
|
|
45
|
+
margin: 0px 0px 12px 0px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:not(.no-action) {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: map-get($mecx-theme, 200) !important;
|
|
53
|
+
color: map-get($mecx-theme, main) !important;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.separator {
|
|
60
|
+
border-bottom: 1px solid #ebebeb;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { MonkeyEcxFilterMenu, MonkeyEcxFilterMenuChildren, MonkeyEcxUtils } from 'monkey-front-core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'mecx-filter-menu',
|
|
6
|
+
templateUrl: './menu.component.html',
|
|
7
|
+
styleUrls: ['./menu.component.scss']
|
|
8
|
+
})
|
|
9
|
+
export class MECXFilterMenuComponent implements OnChanges {
|
|
10
|
+
@Input() model: MonkeyEcxFilterMenu[] = [];
|
|
11
|
+
|
|
12
|
+
@Output() onClose = new EventEmitter<any>();
|
|
13
|
+
|
|
14
|
+
@Output() onSubmit = new EventEmitter<any>();
|
|
15
|
+
|
|
16
|
+
_onHandleSubmit: Function = null;
|
|
17
|
+
|
|
18
|
+
_model: MonkeyEcxFilterMenu[] = [];
|
|
19
|
+
|
|
20
|
+
_showMenu = false;
|
|
21
|
+
|
|
22
|
+
_menuOption: MonkeyEcxFilterMenu | MonkeyEcxFilterMenuChildren = null;
|
|
23
|
+
|
|
24
|
+
closeMenu = () => {
|
|
25
|
+
this._showMenu = false;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
// not to do
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private validateValue({ field, value, getValue }: any) {
|
|
33
|
+
try {
|
|
34
|
+
value = value || getValue()?.[field];
|
|
35
|
+
if (!value) return false;
|
|
36
|
+
if (typeof value === 'object') {
|
|
37
|
+
return value && JSON.stringify(value) !== '{}';
|
|
38
|
+
}
|
|
39
|
+
return MonkeyEcxUtils.persistNullEmptyUndefined(value);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
// not to do
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private onHandleSubmitValue(value: any) {
|
|
47
|
+
this.onSubmit.next(value);
|
|
48
|
+
this.onHandleClose();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private onHandleMenus(value: any[]) {
|
|
52
|
+
this._model = value?.map((_: any) => {
|
|
53
|
+
const { children } = _;
|
|
54
|
+
let obj = null;
|
|
55
|
+
if (children) {
|
|
56
|
+
obj = {
|
|
57
|
+
..._,
|
|
58
|
+
children: children?.filter((_: any) => {
|
|
59
|
+
return !this.validateValue(_);
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
} else if (!this.validateValue(_)) {
|
|
63
|
+
obj = {
|
|
64
|
+
..._,
|
|
65
|
+
...obj || {}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return obj;
|
|
70
|
+
})?.filter((_) => {
|
|
71
|
+
return _;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
this._model = this._model?.sort((a, b) => {
|
|
75
|
+
const groupA = `${a?.group}`.toLowerCase();
|
|
76
|
+
const groupB = `${b?.group}`.toLowerCase();
|
|
77
|
+
return groupA !== groupB ? 1 : -1;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
82
|
+
if (changes.model) {
|
|
83
|
+
const { currentValue } = changes.model;
|
|
84
|
+
if (currentValue && JSON.stringify(currentValue) !== '{}') {
|
|
85
|
+
this.onHandleMenus(currentValue);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
onHandleChildrenAction(option: MonkeyEcxFilterMenu, child: MonkeyEcxFilterMenuChildren) {
|
|
91
|
+
const { field, type, action } = child;
|
|
92
|
+
if (type === 'with-action') {
|
|
93
|
+
this.onHandleSubmitValue({
|
|
94
|
+
[option.field]: JSON.stringify({
|
|
95
|
+
[field]: action()
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
this._showMenu = true;
|
|
100
|
+
this._menuOption = child;
|
|
101
|
+
this.onHandleSubmit = (event: any) => {
|
|
102
|
+
this.onHandleSubmitValue({
|
|
103
|
+
[option.field]: JSON.stringify(event)
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
onHandleShowMenu(option: MonkeyEcxFilterMenu) {
|
|
110
|
+
this._showMenu = true;
|
|
111
|
+
this._menuOption = option;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
onHandleClose() {
|
|
115
|
+
this._showMenu = false;
|
|
116
|
+
this.onClose.next();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
onHandleSubmit(event: any) {
|
|
120
|
+
this.onHandleSubmitValue(event);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { RouterModule } from '@angular/router';
|
|
3
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { MonkeyEcxDirectivesModule } from 'monkey-front-core';
|
|
7
|
+
import {
|
|
8
|
+
MonkeyBadgeModule,
|
|
9
|
+
MonkeyButtonModule,
|
|
10
|
+
MonkeyCheckboxModule,
|
|
11
|
+
MonkeyDateRangePickerModule,
|
|
12
|
+
MonkeyIconModule,
|
|
13
|
+
MonkeyInputModule,
|
|
14
|
+
MonkeyOptionModule,
|
|
15
|
+
MonkeySelectModule
|
|
16
|
+
} from 'monkey-style-guide';
|
|
17
|
+
import { MECXFilterOptionsModule } from '../options';
|
|
18
|
+
import { MECXFilterMenuComponent } from './menu.component';
|
|
19
|
+
|
|
20
|
+
@NgModule({
|
|
21
|
+
declarations: [MECXFilterMenuComponent],
|
|
22
|
+
imports: [
|
|
23
|
+
CommonModule,
|
|
24
|
+
FormsModule,
|
|
25
|
+
ReactiveFormsModule,
|
|
26
|
+
MonkeyEcxDirectivesModule,
|
|
27
|
+
MonkeyButtonModule,
|
|
28
|
+
MonkeyBadgeModule,
|
|
29
|
+
MonkeyIconModule,
|
|
30
|
+
MonkeyInputModule,
|
|
31
|
+
MonkeyCheckboxModule,
|
|
32
|
+
MonkeySelectModule,
|
|
33
|
+
MonkeyOptionModule,
|
|
34
|
+
MonkeyDateRangePickerModule,
|
|
35
|
+
RouterModule,
|
|
36
|
+
MECXFilterOptionsModule,
|
|
37
|
+
TranslateModule.forChild()
|
|
38
|
+
],
|
|
39
|
+
exports: [MECXFilterMenuComponent]
|
|
40
|
+
})
|
|
41
|
+
export class MECXFilterMenuModule {}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import 'node_modules/monkey-style-guide/assets/scss/partials/variables';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
min-width: 180px;
|
|
7
|
+
|
|
8
|
+
.item {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
font-style: normal;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
line-height: 24px;
|
|
14
|
+
color: #72717e;
|
|
15
|
+
padding: 8px 24px 8px 24px;
|
|
16
|
+
|
|
17
|
+
&.selected {
|
|
18
|
+
cursor: not-allowed !important;
|
|
19
|
+
background-color: map-get($mecx-theme, 400) !important;
|
|
20
|
+
color: map-get(map-get($mecx-theme, contrast), main) !important;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: map-get($mecx-theme, 100) !important;
|
|
26
|
+
color: #72717e !important;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { MonkeyEcxFilterMenu } from 'monkey-front-core';
|
|
3
|
+
import { Subscription } from 'rxjs';
|
|
4
|
+
import { debounceTime } from 'rxjs/operators';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'mecx-filter-options-children',
|
|
8
|
+
templateUrl: './children.component.html',
|
|
9
|
+
styleUrls: ['./children.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class MECXFilterOptionsChildrenComponent implements OnInit, OnDestroy {
|
|
12
|
+
@Input() option: MonkeyEcxFilterMenu = null;
|
|
13
|
+
|
|
14
|
+
@Output() onSubmit = new EventEmitter<any>();
|
|
15
|
+
|
|
16
|
+
@Output() onShow = new EventEmitter<any>();
|
|
17
|
+
|
|
18
|
+
private eventHandle = new EventEmitter<any>();
|
|
19
|
+
|
|
20
|
+
private eventSubscription: Subscription;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
// not to do
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
const {
|
|
28
|
+
eventHandle,
|
|
29
|
+
onSubmit,
|
|
30
|
+
option: { field }
|
|
31
|
+
} = this;
|
|
32
|
+
|
|
33
|
+
this.eventSubscription = eventHandle.pipe(debounceTime(100)).subscribe((value: any) => {
|
|
34
|
+
onSubmit.next({ [field]: value });
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnDestroy() {
|
|
39
|
+
this.eventSubscription.unsubscribe();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
onHandleChildrenAction(child: any) {
|
|
43
|
+
const { field, type, action } = child;
|
|
44
|
+
if (type === 'with-action') {
|
|
45
|
+
this.eventHandle.next(
|
|
46
|
+
JSON.stringify({
|
|
47
|
+
[field]: action()
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
} else {
|
|
51
|
+
this.onShow.next(child);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
onHandleValidateSelected({ field, getValue }: any) {
|
|
56
|
+
return !!getValue()?.[field];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './children.component';
|
|
1
|
+
export * from './children.component';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import 'node_modules/monkey-style-guide/assets/scss/partials/variables';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
max-width: 232px;
|
|
7
|
+
min-width: 180px;
|
|
8
|
+
padding: 12px 12px 8px 12px;
|
|
9
|
+
color: #72717e;
|
|
10
|
+
|
|
11
|
+
.title {
|
|
12
|
+
color: #4b4a53;
|
|
13
|
+
font-size: 18px;
|
|
14
|
+
line-height: 21px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
text-align: left;
|
|
17
|
+
margin-bottom: 4px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { MonkeyEcxFilterMenu } from 'monkey-front-core';
|
|
3
|
+
import { Subscription } from 'rxjs';
|
|
4
|
+
import { debounceTime } from 'rxjs/operators';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'mecx-filter-options-currency',
|
|
8
|
+
templateUrl: './currency.component.html',
|
|
9
|
+
styleUrls: ['./currency.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class MECXFilterOptionsCurrencyComponent implements OnInit, OnChanges, OnDestroy {
|
|
12
|
+
@Input() option: MonkeyEcxFilterMenu = null;
|
|
13
|
+
|
|
14
|
+
@Output() onSubmit = new EventEmitter<any>();
|
|
15
|
+
|
|
16
|
+
_value = 0;
|
|
17
|
+
|
|
18
|
+
private eventHandle = new EventEmitter<any>();
|
|
19
|
+
|
|
20
|
+
private eventSubscription: Subscription;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
// not to do
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
const { eventHandle, onSubmit, option: { field } } = this;
|
|
28
|
+
|
|
29
|
+
this.eventSubscription = eventHandle
|
|
30
|
+
.pipe(debounceTime(800))
|
|
31
|
+
.subscribe((value: number) => {
|
|
32
|
+
onSubmit.next({ [field]: value });
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ngOnDestroy() {
|
|
37
|
+
this.eventSubscription.unsubscribe();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
41
|
+
if (changes.option) {
|
|
42
|
+
const { currentValue } = changes.option;
|
|
43
|
+
if (currentValue && JSON.stringify(currentValue) !== '{}') {
|
|
44
|
+
this._value = currentValue?.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onChangeFilter(value: number) {
|
|
50
|
+
this.eventHandle.next(value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './currency.component';
|
|
1
|
+
export * from './currency.component';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import 'node_modules/monkey-style-guide/assets/scss/partials/variables';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
padding: 12px 12px 8px 12px;
|
|
7
|
+
|
|
8
|
+
.title {
|
|
9
|
+
color: #4b4a53;
|
|
10
|
+
font-size: 18px;
|
|
11
|
+
line-height: 21px;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
text-align: left;
|
|
14
|
+
margin-bottom: 4px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
::ng-deep mecx-date-range-picker-group-action {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
::ng-deep
|
|
22
|
+
monkey-date-range-picker
|
|
23
|
+
mecx-date-range-picker-group
|
|
24
|
+
mecx-date-range-picker-group-info {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
::ng-deep
|
|
29
|
+
monkey-date-range-picker
|
|
30
|
+
mecx-date-range-picker-group
|
|
31
|
+
mecx-date-range-picker-group-header {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { MonkeyEcxFilterMenu, MonkeyEcxFilterMenuChildren, MonkeyEcxUtils } from 'monkey-front-core';
|
|
4
|
+
import { Subscription } from 'rxjs';
|
|
5
|
+
import { debounceTime } from 'rxjs/operators';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'mecx-filter-options-date-range',
|
|
9
|
+
templateUrl: './date-range.component.html',
|
|
10
|
+
styleUrls: ['./date-range.component.scss']
|
|
11
|
+
})
|
|
12
|
+
export class MECXFilterOptionsDateRangeComponent implements OnInit, OnChanges, OnDestroy {
|
|
13
|
+
@Input() option: MonkeyEcxFilterMenu | MonkeyEcxFilterMenuChildren = null;
|
|
14
|
+
|
|
15
|
+
@Output() onSubmit = new EventEmitter<any>();
|
|
16
|
+
|
|
17
|
+
_value: any = {
|
|
18
|
+
startDate: null,
|
|
19
|
+
endDate: null
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
_form: FormGroup;
|
|
23
|
+
|
|
24
|
+
_moveDaysForward = true;
|
|
25
|
+
|
|
26
|
+
private eventHandle = new EventEmitter<any>();
|
|
27
|
+
|
|
28
|
+
private eventSubscription: Subscription;
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
// not to do
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private onHandleSelectedValue({ field, value, getValue }: any) {
|
|
35
|
+
try {
|
|
36
|
+
value = value || getValue()?.[field];
|
|
37
|
+
if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
|
|
38
|
+
this._value = JSON.parse(value);
|
|
39
|
+
}
|
|
40
|
+
} catch (e) {
|
|
41
|
+
// not to do
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
const { eventHandle, onSubmit, option: { field } } = this;
|
|
47
|
+
|
|
48
|
+
this.eventSubscription = eventHandle
|
|
49
|
+
.pipe(debounceTime(800))
|
|
50
|
+
.subscribe((value: number) => {
|
|
51
|
+
onSubmit.next({ [field]: value });
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this.eventSubscription.unsubscribe();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
60
|
+
if (changes.option) {
|
|
61
|
+
const { currentValue } = changes.option;
|
|
62
|
+
if (currentValue && JSON.stringify(currentValue) !== '{}') {
|
|
63
|
+
this.onHandleSelectedValue(currentValue);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
onChangeFilter(value: { startDate: string, endDate: string }) {
|
|
69
|
+
if (!value?.endDate) return;
|
|
70
|
+
this.eventHandle.next(JSON.stringify(value));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './date-range.component';
|
|
1
|
+
export * from './date-range.component';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './options.module';
|
|
1
|
+
export * from './options.module';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './input.component';
|
|
1
|
+
export * from './input.component';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import 'node_modules/monkey-style-guide/assets/scss/partials/variables';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
max-width: 232px;
|
|
7
|
+
min-width: 180px;
|
|
8
|
+
padding: 12px 12px 8px 12px;
|
|
9
|
+
color: #72717e;
|
|
10
|
+
|
|
11
|
+
.title {
|
|
12
|
+
color: #4b4a53;
|
|
13
|
+
font-size: 18px;
|
|
14
|
+
line-height: 21px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
text-align: left;
|
|
17
|
+
margin-bottom: 4px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { MonkeyEcxFilterMenu } from 'monkey-front-core';
|
|
3
|
+
import { Subscription } from 'rxjs';
|
|
4
|
+
import { debounceTime } from 'rxjs/operators';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'mecx-filter-options-input',
|
|
8
|
+
templateUrl: './input.component.html',
|
|
9
|
+
styleUrls: ['./input.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class MECXFilterOptionsInputComponent implements OnInit, OnChanges, OnDestroy {
|
|
12
|
+
@Input() option: MonkeyEcxFilterMenu = null;
|
|
13
|
+
|
|
14
|
+
@Output() onSubmit = new EventEmitter<any>();
|
|
15
|
+
|
|
16
|
+
_value = '';
|
|
17
|
+
|
|
18
|
+
private eventHandle = new EventEmitter<any>();
|
|
19
|
+
|
|
20
|
+
private eventSubscription: Subscription;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
// not to do
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
const { eventHandle, onSubmit, option: { field } } = this;
|
|
28
|
+
|
|
29
|
+
this.eventSubscription = eventHandle
|
|
30
|
+
.pipe(debounceTime(800))
|
|
31
|
+
.subscribe((value: string) => {
|
|
32
|
+
onSubmit.next({ [field]: value });
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ngOnDestroy() {
|
|
37
|
+
this.eventSubscription.unsubscribe();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
41
|
+
if (changes.option) {
|
|
42
|
+
const { currentValue } = changes.option;
|
|
43
|
+
if (currentValue && JSON.stringify(currentValue) !== '{}') {
|
|
44
|
+
this._value = currentValue?.value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onChangeFilter(value: number) {
|
|
50
|
+
this.eventHandle.next(value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<div class="d-flex justify-content-between header">
|
|
2
|
+
<span class="title">
|
|
3
|
+
{{ option?.label | translate }}
|
|
4
|
+
</span>
|
|
5
|
+
<div class="close" #actionElement (click)="onHandleShowMenu()">
|
|
6
|
+
<monkey-icon icon="close-12" color="#474747"></monkey-icon>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<ng-container *ngIf="option?.type as type">
|
|
10
|
+
<ng-container *ngIf="option?.children; else withoutChildren">
|
|
11
|
+
<mecx-filter-options-children [option]="option" (onSubmit)="onHandleSubmitChildren($event)"
|
|
12
|
+
(onShow)="onShowFromChildren.next($event)">
|
|
13
|
+
</mecx-filter-options-children>
|
|
14
|
+
</ng-container>
|
|
15
|
+
<ng-template #withoutChildren>
|
|
16
|
+
<ng-container [ngSwitch]="type">
|
|
17
|
+
<mecx-filter-options-status *ngSwitchCase="'status'" [option]="option"
|
|
18
|
+
(onSubmit)="onHandleSubmit($event)">
|
|
19
|
+
</mecx-filter-options-status>
|
|
20
|
+
<mecx-filter-options-date-range *ngSwitchCase="'date-range'" [option]="option"
|
|
21
|
+
(onSubmit)="onHandleSubmit($event)">
|
|
22
|
+
</mecx-filter-options-date-range>
|
|
23
|
+
<mecx-filter-options-currency *ngSwitchCase="'currency'" [option]="option"
|
|
24
|
+
(onSubmit)="onHandleSubmit($event)">
|
|
25
|
+
</mecx-filter-options-currency>
|
|
26
|
+
<mecx-filter-options-input *ngSwitchCase="'input'" [option]="option"
|
|
27
|
+
(onSubmit)="onHandleSubmit($event)">
|
|
28
|
+
</mecx-filter-options-input>
|
|
29
|
+
</ng-container>
|
|
30
|
+
</ng-template>
|
|
31
|
+
</ng-container>
|
|
32
|
+
|
|
33
|
+
<ng-container
|
|
34
|
+
*monkeyecxPopover="_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'">
|
|
35
|
+
<div class="close-menu">
|
|
36
|
+
<monkey-button type="tertiary" color="error" (click)="onRemove.next()" size="sm">
|
|
37
|
+
{{ 'BUTTONS.REMOVE' | translate }}
|
|
38
|
+
</monkey-button>
|
|
39
|
+
<monkey-button type="tertiary" color="theme" (click)="onClose.next()" size="sm">
|
|
40
|
+
{{ 'BUTTONS.CLOSE' | translate }}
|
|
41
|
+
</monkey-button>
|
|
42
|
+
</div>
|
|
43
|
+
</ng-container>
|