monkey-front-components 0.0.381 → 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.381.tgz +0 -0
- package/monkey-front-components.d.ts +0 -5
- package/public-api.d.ts +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<mecx-products-filter (onChangeFilter)="onHandleChangeFilter($event)"></mecx-products-filter>
|
|
2
|
+
<div class="products-list">
|
|
3
|
+
<div *ngFor="let product of _filteredProducts" class="product">
|
|
4
|
+
<span class="title" *ngIf="_hasMoreProducts">{{ 'PRODUCTS.'+product.name | translate }}</span>
|
|
5
|
+
<div class="items">
|
|
6
|
+
<div *ngFor="let item of product.items" class="item"
|
|
7
|
+
(click)="onAccess.next(item)">
|
|
8
|
+
<div class="icon">
|
|
9
|
+
<img [src]="item.logo" #img (error)="onImgError(img)">
|
|
10
|
+
</div>
|
|
11
|
+
<span class="name">{{ item.name }}</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
|
|
6
|
+
.products-list {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
overflow: auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.product {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
|
|
16
|
+
.title {
|
|
17
|
+
font-style: normal;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
font-size: 24px;
|
|
20
|
+
line-height: 32px;
|
|
21
|
+
letter-spacing: 0.04em;
|
|
22
|
+
color: #4b4a53;
|
|
23
|
+
margin: 32px 0px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.items {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: repeat(2, 1fr);
|
|
29
|
+
grid-column-gap: 10px;
|
|
30
|
+
grid-row-gap: 10px;
|
|
31
|
+
|
|
32
|
+
.item {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
min-height: 100px;
|
|
39
|
+
padding: 12px;
|
|
40
|
+
|
|
41
|
+
.icon {
|
|
42
|
+
margin: 12px 0px;
|
|
43
|
+
|
|
44
|
+
img {
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: 140px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.no-image {
|
|
50
|
+
width: 52px;
|
|
51
|
+
height: 52px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.name {
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
font-size: 18px;
|
|
59
|
+
line-height: 24px;
|
|
60
|
+
color: #72717e;
|
|
61
|
+
margin-top: 8px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
box-shadow: 0px 25px 52px 8px rgba(234, 234, 234, 0.88);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { MonkeyEcxTokenStorageService } from 'monkey-front-core';
|
|
3
|
+
import { takeUntil } from 'rxjs/operators';
|
|
4
|
+
import { BaseComponent } from '../../base/base-component';
|
|
5
|
+
import { ProductsModel } from './providers';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'mecx-products',
|
|
9
|
+
templateUrl: './products.component.html',
|
|
10
|
+
styleUrls: ['./products.component.scss']
|
|
11
|
+
})
|
|
12
|
+
export class MECXProductsComponent extends BaseComponent implements OnInit {
|
|
13
|
+
@Output() onAccess = new EventEmitter<any>();
|
|
14
|
+
|
|
15
|
+
_products: any[];
|
|
16
|
+
|
|
17
|
+
_filteredProducts: any[];
|
|
18
|
+
|
|
19
|
+
_filter = '';
|
|
20
|
+
|
|
21
|
+
_hasMoreProducts = false;
|
|
22
|
+
|
|
23
|
+
constructor(private tokenStorage: MonkeyEcxTokenStorageService) {
|
|
24
|
+
super();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
onImgError(img: HTMLImageElement) {
|
|
28
|
+
const index = Math.floor(Math.random() * (6 - 1 + 1)) + 1;
|
|
29
|
+
img.src = `https://assets.monkeyecx.com/icons/icon-${index}.svg`;
|
|
30
|
+
img.className = 'no-image';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private onHandleProducts() {
|
|
34
|
+
const { _filter } = this;
|
|
35
|
+
|
|
36
|
+
this._filteredProducts = this._products.map(({ name, items }) => {
|
|
37
|
+
const found = items?.filter((_: any) => {
|
|
38
|
+
const cmpA = `${_.name}`.toLowerCase();
|
|
39
|
+
const cmpB = `${_filter}`.toLowerCase();
|
|
40
|
+
return cmpA.includes(cmpB);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
if (found && found.length) {
|
|
44
|
+
return {
|
|
45
|
+
name,
|
|
46
|
+
items: found
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return null;
|
|
51
|
+
}).filter((_: any) => { return _; });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private onHandleMe() {
|
|
55
|
+
const programs: ProductsModel[] = this.tokenStorage.getMe()?.programs?.map((_: any) => {
|
|
56
|
+
return new ProductsModel(_);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const onlyUnique = (value: any, index: any, self: any) => {
|
|
60
|
+
return self.indexOf(value) === index;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const products = programs.map(({ product }) => {
|
|
64
|
+
return product;
|
|
65
|
+
}).filter(onlyUnique);
|
|
66
|
+
|
|
67
|
+
this._hasMoreProducts = (products?.length || 0) > 1;
|
|
68
|
+
|
|
69
|
+
this._products = Object.entries(products).map(([key, value]) => {
|
|
70
|
+
const found = programs.filter(({ product }) => {
|
|
71
|
+
return `${product}` === `${value}`;
|
|
72
|
+
})?.sort((a, b) => {
|
|
73
|
+
const groupA = `${a?.name}`.toLowerCase();
|
|
74
|
+
const groupB = `${b?.name}`.toLowerCase();
|
|
75
|
+
return groupA !== groupB ? 1 : -1;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
name: value,
|
|
80
|
+
items: found
|
|
81
|
+
};
|
|
82
|
+
})?.sort((a, b) => {
|
|
83
|
+
const groupA = `${a?.name}`.toLowerCase();
|
|
84
|
+
const groupB = `${b?.name}`.toLowerCase();
|
|
85
|
+
return groupA !== groupB ? -1 : 1;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
this._filteredProducts = this._products;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
ngOnInit() {
|
|
92
|
+
this.tokenStorage
|
|
93
|
+
.meHasChanged()
|
|
94
|
+
.pipe(takeUntil(this.__unsubscribeAll))
|
|
95
|
+
.subscribe(() => {
|
|
96
|
+
this.onHandleMe();
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
onHandleChangeFilter(event: string) {
|
|
101
|
+
this._filter = event;
|
|
102
|
+
this.onHandleProducts();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
+
import { MonkeyButtonModule, MonkeyInputModule } from 'monkey-style-guide';
|
|
5
|
+
import { MECXProductsFilterComponent } from './filter/filter.component';
|
|
6
|
+
import { MECXProductsComponent } from './products.component';
|
|
7
|
+
|
|
8
|
+
@NgModule({
|
|
9
|
+
declarations: [MECXProductsComponent, MECXProductsFilterComponent],
|
|
10
|
+
imports: [CommonModule, TranslateModule.forChild(), MonkeyInputModule, MonkeyButtonModule],
|
|
11
|
+
exports: [MECXProductsComponent]
|
|
12
|
+
})
|
|
13
|
+
export class MECXProductsModule {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './products.model';
|
|
1
|
+
export * from './products.model';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export class ProductsModel {
|
|
2
|
+
url: string;
|
|
3
|
+
|
|
4
|
+
token: string;
|
|
5
|
+
|
|
6
|
+
username: string;
|
|
7
|
+
|
|
8
|
+
ownerGovernmentId: string;
|
|
9
|
+
|
|
10
|
+
ownerName: string;
|
|
11
|
+
|
|
12
|
+
product: string;
|
|
13
|
+
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
type: string;
|
|
17
|
+
|
|
18
|
+
logo: string;
|
|
19
|
+
|
|
20
|
+
constructor(data?: any) {
|
|
21
|
+
this.url = data?.url;
|
|
22
|
+
this.token = data?.token;
|
|
23
|
+
this.username = data?.username;
|
|
24
|
+
this.ownerGovernmentId = data?.ownerGovernmentId;
|
|
25
|
+
this.ownerName = data?.ownerName;
|
|
26
|
+
this.product = data?.product;
|
|
27
|
+
this.name = data?.name;
|
|
28
|
+
this.type = data?.type;
|
|
29
|
+
this.handleLogo();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private handleLogo() {
|
|
33
|
+
const { product, token, url } = this;
|
|
34
|
+
if (!url) return;
|
|
35
|
+
|
|
36
|
+
const sufix = {
|
|
37
|
+
SALES_FINANCE: 'SF_',
|
|
38
|
+
SPIKE: 'SF_',
|
|
39
|
+
SUPPLY_CHAIN: 'SF_'
|
|
40
|
+
}[product];
|
|
41
|
+
|
|
42
|
+
const { hostname } = new URL(url);
|
|
43
|
+
const lastDot = hostname?.lastIndexOf('.');
|
|
44
|
+
const previousLastDot = hostname?.lastIndexOf('.', lastDot - 1);
|
|
45
|
+
const domain = hostname?.substring(previousLastDot + 1, hostname?.length);
|
|
46
|
+
|
|
47
|
+
const handledToken = token?.replace(sufix, '');
|
|
48
|
+
|
|
49
|
+
const path = {
|
|
50
|
+
'monkeyecx.com': 'scf/br',
|
|
51
|
+
'monkey.exchange': 'scf/br',
|
|
52
|
+
'monkeyexchange.cl': 'scf/cl',
|
|
53
|
+
'sales.finance': 'sf',
|
|
54
|
+
'spike.cash': 'spike',
|
|
55
|
+
'monkey.credit': 'credit'
|
|
56
|
+
}[domain];
|
|
57
|
+
|
|
58
|
+
this.logo = `https://assets.monkey.exchange/${path}/wl/${handledToken}/login.svg`.toLowerCase();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './progress-bar.component';
|
|
2
|
-
export * from './progress-bar.module';
|
|
3
|
-
export * from './progress-bar.service';
|
|
1
|
+
export * from './progress-bar.component';
|
|
2
|
+
export * from './progress-bar.module';
|
|
3
|
+
export * from './progress-bar.service';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
|
2
|
+
import { takeUntil } from 'rxjs/operators';
|
|
3
|
+
import { BaseComponent } from '../../base/base-component';
|
|
4
|
+
import { MECXProgressBarService } from './progress-bar.service';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'mecx-progress-bar',
|
|
8
|
+
templateUrl: './progress-bar.component.html',
|
|
9
|
+
styleUrls: ['./progress-bar.component.scss'],
|
|
10
|
+
encapsulation: ViewEncapsulation.None
|
|
11
|
+
})
|
|
12
|
+
export class MECXProgressBarComponent extends BaseComponent implements OnInit, OnDestroy {
|
|
13
|
+
visible: boolean = false;
|
|
14
|
+
|
|
15
|
+
constructor(private progressBarService: MECXProgressBarService) {
|
|
16
|
+
super();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.progressBarService
|
|
21
|
+
.visibleConfig()
|
|
22
|
+
.pipe(takeUntil(this.__unsubscribeAll))
|
|
23
|
+
.subscribe((visible: boolean) => {
|
|
24
|
+
this.visible = visible;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { MECXProgressBarComponent } from './progress-bar.component';
|
|
4
|
+
|
|
5
|
+
@NgModule({
|
|
6
|
+
declarations: [MECXProgressBarComponent],
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
exports: [MECXProgressBarComponent]
|
|
9
|
+
})
|
|
10
|
+
export class MECXProgressBarModule {}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
NavigationCancel,
|
|
4
|
+
NavigationEnd,
|
|
5
|
+
NavigationError,
|
|
6
|
+
NavigationStart,
|
|
7
|
+
Router
|
|
8
|
+
} from '@angular/router';
|
|
9
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
10
|
+
import { filter } from 'rxjs/operators';
|
|
11
|
+
|
|
12
|
+
@Injectable({
|
|
13
|
+
providedIn: 'root'
|
|
14
|
+
})
|
|
15
|
+
export class MECXProgressBarService {
|
|
16
|
+
private visible: BehaviorSubject<any> = new BehaviorSubject(false);
|
|
17
|
+
|
|
18
|
+
constructor(private router: Router) {
|
|
19
|
+
this.init();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private init() {
|
|
23
|
+
this.router.events
|
|
24
|
+
.pipe(
|
|
25
|
+
filter((event: any) => {
|
|
26
|
+
return event instanceof NavigationStart;
|
|
27
|
+
})
|
|
28
|
+
)
|
|
29
|
+
.subscribe(() => {
|
|
30
|
+
this.show();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
this.router.events
|
|
34
|
+
.pipe(
|
|
35
|
+
filter((event: any) => {
|
|
36
|
+
return (
|
|
37
|
+
event instanceof NavigationEnd ||
|
|
38
|
+
event instanceof NavigationError ||
|
|
39
|
+
event instanceof NavigationCancel
|
|
40
|
+
);
|
|
41
|
+
})
|
|
42
|
+
)
|
|
43
|
+
.subscribe(() => {
|
|
44
|
+
this.hide();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
show() {
|
|
49
|
+
this.visible.next(true);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
hide() {
|
|
53
|
+
this.visible.next(false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
visibleConfig(): Observable<any> {
|
|
57
|
+
return this.visible.asObservable();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface MECXFieldConfigValidator {
|
|
2
|
+
name: string;
|
|
3
|
+
param: string | number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface MECXFieldConfigStyle {
|
|
7
|
+
class: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface MECXFieldConfigValue {
|
|
11
|
+
description: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface MECXFieldConfigFunctions {
|
|
16
|
+
onChange: string;
|
|
17
|
+
onClick: string;
|
|
18
|
+
onHandleUpload: {
|
|
19
|
+
func: string;
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
onHandleGenericLoad: {
|
|
23
|
+
func: string;
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MECXFieldConfig {
|
|
29
|
+
fieldType?: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
helperMessage?: string;
|
|
33
|
+
mask?: string;
|
|
34
|
+
prefix?: string;
|
|
35
|
+
internationalNumber?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
color?: string;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
value?: string | number | Date | undefined | MECXFieldConfigValue | MECXFieldConfigValue[];
|
|
42
|
+
validations?: MECXFieldConfigValidator[];
|
|
43
|
+
functions?: MECXFieldConfigFunctions;
|
|
44
|
+
style?: MECXFieldConfigStyle;
|
|
45
|
+
maxSize?: number;
|
|
46
|
+
maxLength?: number;
|
|
47
|
+
onlyNumber?: boolean;
|
|
48
|
+
currency?: boolean;
|
|
49
|
+
maxDateToday?: boolean;
|
|
50
|
+
allowedExtensions?: string[];
|
|
51
|
+
alwaysShow?: boolean;
|
|
52
|
+
alwaysShowPlusValidation: {
|
|
53
|
+
field?: string;
|
|
54
|
+
operator?: string;
|
|
55
|
+
value?: string;
|
|
56
|
+
};
|
|
57
|
+
fieldToCompare?: string;
|
|
58
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './field-config';
|
|
1
|
+
export * from './field-config';
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js';
|
|
4
|
+
import 'zone.js/testing';
|
|
5
|
+
import { getTestBed } from '@angular/core/testing';
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
+
keys(): string[];
|
|
14
|
+
<T>(id: string): T;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// First, initialize the Angular testing environment.
|
|
19
|
+
getTestBed().initTestEnvironment(
|
|
20
|
+
BrowserDynamicTestingModule,
|
|
21
|
+
platformBrowserDynamicTesting()
|
|
22
|
+
);
|
|
23
|
+
// Then we find all the tests.
|
|
24
|
+
const context = require.context('./', true, /\.spec\.ts$/);
|
|
25
|
+
// And load the modules.
|
|
26
|
+
context.keys().map(context);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"target": "es2015",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": [],
|
|
11
|
+
"lib": [
|
|
12
|
+
"dom",
|
|
13
|
+
"es2018"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"exclude": [
|
|
17
|
+
"src/test.ts",
|
|
18
|
+
"**/*.spec.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|