@pepperi-addons/ngx-lib 0.3.9-beta.21 → 0.3.9-beta.24
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/address/address.component.d.ts +27 -27
- package/address/address.module.d.ts +2 -2
- package/address/pepperi-addons-ngx-lib-address.d.ts +4 -4
- package/address/public-api.d.ts +2 -2
- package/attachment/attachment.component.d.ts +82 -82
- package/attachment/attachment.module.d.ts +2 -2
- package/attachment/pepperi-addons-ngx-lib-attachment.d.ts +4 -4
- package/attachment/public-api.d.ts +2 -2
- package/bread-crumbs/bread-crumbs.component.d.ts +23 -23
- package/bread-crumbs/bread-crumbs.model.d.ts +11 -11
- package/bread-crumbs/bread-crumbs.module.d.ts +5 -5
- package/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.d.ts +4 -4
- package/bread-crumbs/public-api.d.ts +3 -3
- package/bundles/pepperi-addons-ngx-lib-address.umd.js +124 -124
- package/bundles/pepperi-addons-ngx-lib-attachment.umd.js +247 -247
- package/bundles/pepperi-addons-ngx-lib-bread-crumbs.umd.js +121 -121
- package/bundles/pepperi-addons-ngx-lib-button.umd.js +158 -158
- package/bundles/pepperi-addons-ngx-lib-carousel.umd.js +788 -788
- package/bundles/pepperi-addons-ngx-lib-checkbox.umd.js +192 -192
- package/bundles/pepperi-addons-ngx-lib-color.umd.js +296 -296
- package/bundles/pepperi-addons-ngx-lib-date.umd.js +660 -660
- package/bundles/pepperi-addons-ngx-lib-dialog.umd.js +171 -171
- package/bundles/pepperi-addons-ngx-lib-draggable-items.umd.js +151 -151
- package/bundles/pepperi-addons-ngx-lib-field-title.umd.js +57 -57
- package/bundles/pepperi-addons-ngx-lib-files-uploader.umd.js +260 -260
- package/bundles/pepperi-addons-ngx-lib-form.umd.js +3237 -3229
- package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-group-buttons.umd.js +87 -87
- package/bundles/pepperi-addons-ngx-lib-icon.umd.js +681 -681
- package/bundles/pepperi-addons-ngx-lib-image.umd.js +322 -316
- package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-images-filmstrip.umd.js +413 -413
- package/bundles/pepperi-addons-ngx-lib-link.umd.js +464 -464
- package/bundles/pepperi-addons-ngx-lib-list.umd.js +3187 -3187
- package/bundles/pepperi-addons-ngx-lib-menu.umd.js +646 -646
- package/bundles/pepperi-addons-ngx-lib-page-layout.umd.js +60 -60
- package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js +543 -543
- package/bundles/pepperi-addons-ngx-lib-quantity-selector.umd.js +914 -914
- package/bundles/pepperi-addons-ngx-lib-query-builder.umd.js +1060 -1060
- package/bundles/pepperi-addons-ngx-lib-rich-html-textarea.umd.js +275 -275
- package/bundles/pepperi-addons-ngx-lib-search.umd.js +326 -326
- package/bundles/pepperi-addons-ngx-lib-select.umd.js +575 -576
- package/bundles/pepperi-addons-ngx-lib-select.umd.js.map +1 -1
- package/bundles/pepperi-addons-ngx-lib-separator.umd.js +79 -79
- package/bundles/pepperi-addons-ngx-lib-side-bar.umd.js +163 -163
- package/bundles/pepperi-addons-ngx-lib-signature.umd.js +283 -283
- package/bundles/pepperi-addons-ngx-lib-size-detector.umd.js +113 -113
- package/bundles/pepperi-addons-ngx-lib-slider.umd.js +124 -124
- package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +1780 -1780
- package/bundles/pepperi-addons-ngx-lib-textarea.umd.js +211 -211
- package/bundles/pepperi-addons-ngx-lib-textbox-icon.umd.js +80 -80
- package/bundles/pepperi-addons-ngx-lib-textbox.umd.js +506 -506
- package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +129 -129
- package/bundles/pepperi-addons-ngx-lib.umd.js +4719 -4719
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/button/button.component.d.ts +99 -99
- package/button/button.model.d.ts +14 -14
- package/button/button.module.d.ts +2 -2
- package/button/pepperi-addons-ngx-lib-button.d.ts +4 -4
- package/button/public-api.d.ts +3 -3
- package/carousel/carousel-item.directive.d.ts +9 -9
- package/carousel/carousel.component.d.ts +145 -145
- package/carousel/carousel.module.d.ts +2 -2
- package/carousel/pepperi-addons-ngx-lib-carousel.d.ts +4 -4
- package/carousel/public-api.d.ts +3 -3
- package/checkbox/checkbox.component.d.ts +47 -47
- package/checkbox/checkbox.module.d.ts +5 -5
- package/checkbox/pepperi-addons-ngx-lib-checkbox.d.ts +4 -4
- package/checkbox/public-api.d.ts +2 -2
- package/color/color-picker.component.d.ts +52 -52
- package/color/color.component.d.ts +26 -26
- package/color/color.model.d.ts +1 -1
- package/color/color.module.d.ts +5 -5
- package/color/pepperi-addons-ngx-lib-color.d.ts +5 -5
- package/color/public-api.d.ts +3 -3
- package/core/clipboard/clipboard.directive.d.ts +2 -2
- package/core/clipboard/clipboard.service.d.ts +2 -2
- package/core/clipboard/index.d.ts +1 -1
- package/core/clipboard/public-api.d.ts +2 -2
- package/core/common/directives/auto-width.directive.d.ts +16 -16
- package/core/common/directives/button-blur.directive.d.ts +6 -6
- package/core/common/directives/button-loader.directive.d.ts +23 -23
- package/core/common/directives/data-qa.directive.d.ts +8 -8
- package/core/common/directives/index.d.ts +1 -1
- package/core/common/directives/menu-blur.directive.d.ts +7 -7
- package/core/common/directives/prevent-multi-click.directive.d.ts +4 -4
- package/core/common/directives/print.directive.d.ts +72 -72
- package/core/common/directives/public-api.d.ts +7 -7
- package/core/common/index.d.ts +1 -1
- package/core/common/model/index.d.ts +1 -1
- package/core/common/model/papi.model.d.ts +2 -2
- package/core/common/model/public-api.d.ts +3 -3
- package/core/common/model/utilities.model.d.ts +5 -5
- package/core/common/model/wapi.model.d.ts +200 -200
- package/core/common/pipes/common-pipes.d.ts +36 -36
- package/core/common/pipes/index.d.ts +1 -1
- package/core/common/pipes/public-api.d.ts +1 -1
- package/core/common/public-api.d.ts +4 -4
- package/core/common/services/addon.service.d.ts +32 -32
- package/core/common/services/color.service.d.ts +48 -48
- package/core/common/services/cookie.service.d.ts +50 -50
- package/core/common/services/data-convertor.service.d.ts +39 -39
- package/core/common/services/file.service.d.ts +24 -24
- package/core/common/services/index.d.ts +1 -1
- package/core/common/services/jwt-helper.service.d.ts +10 -10
- package/core/common/services/public-api.d.ts +11 -11
- package/core/common/services/session.service.d.ts +15 -15
- package/core/common/services/translate.service.d.ts +9 -9
- package/core/common/services/utilities.service.d.ts +18 -18
- package/core/common/services/validator.service.d.ts +28 -28
- package/core/common/services/window-scrolling.service.d.ts +7 -7
- package/core/customization/customization.model.d.ts +264 -264
- package/core/customization/customization.service.d.ts +155 -155
- package/core/customization/index.d.ts +1 -1
- package/core/customization/public-api.d.ts +2 -2
- package/core/http/index.d.ts +1 -1
- package/core/http/interceptors/error.interceptor.d.ts +5 -5
- package/core/http/interceptors/index.d.ts +11 -11
- package/core/http/interceptors/loader.interceptor.d.ts +8 -8
- package/core/http/interceptors/profiler.interceptor.d.ts +5 -5
- package/core/http/public-api.d.ts +2 -2
- package/core/http/services/http.service.d.ts +25 -25
- package/core/http/services/loader.service.d.ts +10 -10
- package/core/index.d.ts +1 -1
- package/core/layout/index.d.ts +1 -1
- package/core/layout/layout.service.d.ts +33 -33
- package/core/layout/public-api.d.ts +2 -2
- package/core/layout/rtl.directive.d.ts +16 -16
- package/core/portal/attach.directive.d.ts +10 -10
- package/core/portal/index.d.ts +1 -1
- package/core/portal/portal.service.d.ts +9 -9
- package/core/portal/public-api.d.ts +3 -3
- package/core/portal/target.directive.d.ts +9 -9
- package/core/public-api.d.ts +7 -7
- package/core/scroll-to/index.d.ts +1 -1
- package/core/scroll-to/public-api.d.ts +1 -1
- package/core/scroll-to/scroll-to.service.d.ts +8 -8
- package/date/date.component.d.ts +65 -65
- package/date/date.model.d.ts +26 -26
- package/date/date.module.d.ts +5 -5
- package/date/pepperi-addons-ngx-lib-date.d.ts +5 -5
- package/date/public-api.d.ts +2 -2
- package/dialog/default-dialog.component.d.ts +8 -8
- package/dialog/dialog.component.d.ts +6 -6
- package/dialog/dialog.model.d.ts +27 -27
- package/dialog/dialog.module.d.ts +5 -5
- package/dialog/dialog.service.d.ts +24 -24
- package/dialog/pepperi-addons-ngx-lib-dialog.d.ts +5 -5
- package/dialog/public-api.d.ts +4 -4
- package/draggable-items/draggable-item/draggable-item.component.d.ts +8 -8
- package/draggable-items/draggable-items.component.d.ts +33 -33
- package/draggable-items/draggable-items.model.d.ts +7 -7
- package/draggable-items/draggable-items.module.d.ts +5 -5
- package/draggable-items/pepperi-addons-ngx-lib-draggable-items.d.ts +4 -4
- package/draggable-items/pepperi-addons-ngx-lib-draggable-items.metadata.json +1 -1
- package/draggable-items/public-api.d.ts +4 -4
- package/esm2015/address/address.component.js +96 -96
- package/esm2015/address/address.module.js +30 -30
- package/esm2015/address/pepperi-addons-ngx-lib-address.js +4 -4
- package/esm2015/address/public-api.js +5 -5
- package/esm2015/attachment/attachment.component.js +208 -208
- package/esm2015/attachment/attachment.module.js +28 -28
- package/esm2015/attachment/pepperi-addons-ngx-lib-attachment.js +4 -4
- package/esm2015/attachment/public-api.js +5 -5
- package/esm2015/bread-crumbs/bread-crumbs.component.js +78 -78
- package/esm2015/bread-crumbs/bread-crumbs.model.js +6 -6
- package/esm2015/bread-crumbs/bread-crumbs.module.js +34 -34
- package/esm2015/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.js +4 -4
- package/esm2015/bread-crumbs/public-api.js +6 -6
- package/esm2015/button/button.component.js +127 -127
- package/esm2015/button/button.model.js +5 -5
- package/esm2015/button/button.module.js +26 -26
- package/esm2015/button/pepperi-addons-ngx-lib-button.js +4 -4
- package/esm2015/button/public-api.js +6 -6
- package/esm2015/carousel/carousel-item.directive.js +26 -26
- package/esm2015/carousel/carousel.component.js +699 -699
- package/esm2015/carousel/carousel.module.js +11 -11
- package/esm2015/carousel/pepperi-addons-ngx-lib-carousel.js +4 -4
- package/esm2015/carousel/public-api.js +7 -7
- package/esm2015/checkbox/checkbox.component.js +151 -151
- package/esm2015/checkbox/checkbox.module.js +39 -39
- package/esm2015/checkbox/pepperi-addons-ngx-lib-checkbox.js +4 -4
- package/esm2015/checkbox/public-api.js +5 -5
- package/esm2015/color/color-picker.component.js +194 -194
- package/esm2015/color/color.component.js +74 -74
- package/esm2015/color/color.model.js +1 -1
- package/esm2015/color/color.module.js +57 -57
- package/esm2015/color/pepperi-addons-ngx-lib-color.js +5 -5
- package/esm2015/color/public-api.js +6 -6
- package/esm2015/core/clipboard/clipboard.directive.js +19 -19
- package/esm2015/core/clipboard/clipboard.service.js +11 -11
- package/esm2015/core/clipboard/index.js +4 -4
- package/esm2015/core/clipboard/public-api.js +5 -5
- package/esm2015/core/common/directives/auto-width.directive.js +77 -77
- package/esm2015/core/common/directives/button-blur.directive.js +22 -22
- package/esm2015/core/common/directives/button-loader.directive.js +102 -102
- package/esm2015/core/common/directives/data-qa.directive.js +22 -22
- package/esm2015/core/common/directives/index.js +4 -4
- package/esm2015/core/common/directives/menu-blur.directive.js +28 -28
- package/esm2015/core/common/directives/prevent-multi-click.directive.js +21 -21
- package/esm2015/core/common/directives/print.directive.js +134 -134
- package/esm2015/core/common/directives/public-api.js +11 -11
- package/esm2015/core/common/index.js +4 -4
- package/esm2015/core/common/model/index.js +4 -4
- package/esm2015/core/common/model/papi.model.js +2 -2
- package/esm2015/core/common/model/public-api.js +6 -6
- package/esm2015/core/common/model/utilities.model.js +56 -56
- package/esm2015/core/common/model/wapi.model.js +155 -155
- package/esm2015/core/common/pipes/common-pipes.js +141 -141
- package/esm2015/core/common/pipes/index.js +4 -4
- package/esm2015/core/common/pipes/public-api.js +4 -4
- package/esm2015/core/common/public-api.js +7 -7
- package/esm2015/core/common/services/addon.service.js +123 -123
- package/esm2015/core/common/services/color.service.js +356 -356
- package/esm2015/core/common/services/cookie.service.js +147 -147
- package/esm2015/core/common/services/data-convertor.service.js +111 -111
- package/esm2015/core/common/services/file.service.js +211 -211
- package/esm2015/core/common/services/index.js +4 -4
- package/esm2015/core/common/services/jwt-helper.service.js +103 -103
- package/esm2015/core/common/services/public-api.js +14 -14
- package/esm2015/core/common/services/session.service.js +72 -72
- package/esm2015/core/common/services/translate.service.js +47 -47
- package/esm2015/core/common/services/utilities.service.js +123 -123
- package/esm2015/core/common/services/validator.service.js +272 -272
- package/esm2015/core/common/services/window-scrolling.service.js +30 -30
- package/esm2015/core/customization/customization.model.js +290 -290
- package/esm2015/core/customization/customization.service.js +774 -774
- package/esm2015/core/customization/index.js +4 -4
- package/esm2015/core/customization/public-api.js +5 -5
- package/esm2015/core/http/index.js +4 -4
- package/esm2015/core/http/interceptors/error.interceptor.js +23 -23
- package/esm2015/core/http/interceptors/index.js +23 -23
- package/esm2015/core/http/interceptors/loader.interceptor.js +32 -32
- package/esm2015/core/http/interceptors/profiler.interceptor.js +28 -28
- package/esm2015/core/http/public-api.js +5 -5
- package/esm2015/core/http/services/http.service.js +160 -160
- package/esm2015/core/http/services/loader.service.js +48 -48
- package/esm2015/core/index.js +4 -4
- package/esm2015/core/layout/index.js +4 -4
- package/esm2015/core/layout/layout.service.js +168 -168
- package/esm2015/core/layout/public-api.js +5 -5
- package/esm2015/core/layout/rtl.directive.js +46 -46
- package/esm2015/core/portal/attach.directive.js +26 -26
- package/esm2015/core/portal/index.js +4 -4
- package/esm2015/core/portal/portal.service.js +34 -34
- package/esm2015/core/portal/public-api.js +6 -6
- package/esm2015/core/portal/target.directive.js +23 -23
- package/esm2015/core/public-api.js +10 -10
- package/esm2015/core/scroll-to/index.js +4 -4
- package/esm2015/core/scroll-to/public-api.js +5 -5
- package/esm2015/core/scroll-to/scroll-to.service.js +81 -81
- package/esm2015/date/date.component.js +244 -244
- package/esm2015/date/date.model.js +44 -44
- package/esm2015/date/date.module.js +50 -50
- package/esm2015/date/pepperi-addons-ngx-lib-date.js +5 -5
- package/esm2015/date/public-api.js +5 -5
- package/esm2015/dialog/default-dialog.component.js +28 -28
- package/esm2015/dialog/dialog.component.js +21 -21
- package/esm2015/dialog/dialog.model.js +21 -21
- package/esm2015/dialog/dialog.module.js +39 -39
- package/esm2015/dialog/dialog.service.js +73 -73
- package/esm2015/dialog/pepperi-addons-ngx-lib-dialog.js +5 -5
- package/esm2015/dialog/public-api.js +7 -7
- package/esm2015/draggable-items/draggable-item/draggable-item.component.js +24 -24
- package/esm2015/draggable-items/draggable-items.component.js +91 -91
- package/esm2015/draggable-items/draggable-items.model.js +1 -1
- package/esm2015/draggable-items/draggable-items.module.js +42 -42
- package/esm2015/draggable-items/pepperi-addons-ngx-lib-draggable-items.js +4 -4
- package/esm2015/draggable-items/public-api.js +7 -7
- package/esm2015/field-title/field-title.component.js +31 -31
- package/esm2015/field-title/field-title.module.js +31 -31
- package/esm2015/field-title/pepperi-addons-ngx-lib-field-title.js +4 -4
- package/esm2015/field-title/public-api.js +5 -5
- package/esm2015/files-uploader/files-uploader.component.js +220 -220
- package/esm2015/files-uploader/files-uploader.module.js +49 -49
- package/esm2015/files-uploader/pepperi-addons-ngx-lib-files-uploader.js +4 -4
- package/esm2015/files-uploader/public-api.js +5 -5
- package/esm2015/form/field-generator.component.js +121 -121
- package/esm2015/form/form.component.js +1189 -1181
- package/esm2015/form/form.model.js +1 -1
- package/esm2015/form/form.module.js +107 -107
- package/esm2015/form/indicators.component.js +20 -20
- package/esm2015/form/internal-button.component.js +165 -165
- package/esm2015/form/internal-carusel.component.js +115 -115
- package/esm2015/form/internal-carusel.service.js +31 -31
- package/esm2015/form/internal-list.component.js +494 -494
- package/esm2015/form/internal-menu.component.js +54 -54
- package/esm2015/form/internal-page.component.js +350 -350
- package/esm2015/form/internal-page.service.js +120 -120
- package/esm2015/form/pepperi-addons-ngx-lib-form.js +13 -13
- package/esm2015/form/public-api.js +6 -6
- package/esm2015/group-buttons/group-buttons.component.js +57 -57
- package/esm2015/group-buttons/group-buttons.module.js +37 -37
- package/esm2015/group-buttons/pepperi-addons-ngx-lib-group-buttons.js +4 -4
- package/esm2015/group-buttons/public-api.js +5 -5
- package/esm2015/icon/icon-generated-all.model.js +100 -100
- package/esm2015/icon/icon-generated.model.js +389 -389
- package/esm2015/icon/icon-registry.service.js +22 -22
- package/esm2015/icon/icon.component.js +124 -124
- package/esm2015/icon/icon.module.js +14 -14
- package/esm2015/icon/icon.service.js +31 -31
- package/esm2015/icon/pepperi-addons-ngx-lib-icon.js +4 -4
- package/esm2015/icon/public-api.js +10 -10
- package/esm2015/image/image.component.js +229 -223
- package/esm2015/image/image.module.js +48 -48
- package/esm2015/image/image.service.js +54 -54
- package/esm2015/image/pepperi-addons-ngx-lib-image.js +4 -4
- package/esm2015/image/public-api.js +6 -6
- package/esm2015/images-filmstrip/images-filmstrip.component.js +363 -363
- package/esm2015/images-filmstrip/images-filmstrip.module.js +70 -70
- package/esm2015/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.js +4 -4
- package/esm2015/images-filmstrip/public-api.js +5 -5
- package/esm2015/link/link.component.js +390 -390
- package/esm2015/link/link.module.js +50 -50
- package/esm2015/link/link.pipes.js +14 -14
- package/esm2015/link/pepperi-addons-ngx-lib-link.js +5 -5
- package/esm2015/link/public-api.js +5 -5
- package/esm2015/list/list-actions.component.js +35 -35
- package/esm2015/list/list-carousel.component.js +94 -94
- package/esm2015/list/list-chooser.component.js +57 -57
- package/esm2015/list/list-pager.component.js +112 -112
- package/esm2015/list/list-sorting.component.js +54 -54
- package/esm2015/list/list-total.component.js +23 -23
- package/esm2015/list/list-views.component.js +71 -71
- package/esm2015/list/list.component.js +1123 -1123
- package/esm2015/list/list.model.js +3 -3
- package/esm2015/list/list.module.js +87 -87
- package/esm2015/list/list.pipes.js +39 -39
- package/esm2015/list/pepperi-addons-ngx-lib-list.js +6 -6
- package/esm2015/list/public-api.js +14 -14
- package/esm2015/list/virtual-scroller.js +1018 -1018
- package/esm2015/menu/menu-item.component.js +102 -102
- package/esm2015/menu/menu.component.js +173 -173
- package/esm2015/menu/menu.model.js +18 -18
- package/esm2015/menu/menu.module.js +39 -39
- package/esm2015/menu/pepperi-addons-ngx-lib-menu.js +5 -5
- package/esm2015/menu/public-api.js +6 -6
- package/esm2015/ngx-lib.module.js +76 -76
- package/esm2015/page-layout/page-layout.component.js +41 -41
- package/esm2015/page-layout/page-layout.module.js +20 -20
- package/esm2015/page-layout/pepperi-addons-ngx-lib-page-layout.js +4 -4
- package/esm2015/page-layout/public-api.js +5 -5
- package/esm2015/pepperi-addons-ngx-lib.js +8 -8
- package/esm2015/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.js +4 -4
- package/esm2015/profile-data-views-list/profile-data-view/profile-data-view.component.js +38 -38
- package/esm2015/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.js +59 -59
- package/esm2015/profile-data-views-list/profile-data-views-list.component.js +86 -86
- package/esm2015/profile-data-views-list/profile-data-views-list.model.js +1 -1
- package/esm2015/profile-data-views-list/profile-data-views-list.module.js +56 -56
- package/esm2015/profile-data-views-list/public-api.js +8 -8
- package/esm2015/public-api.js +5 -5
- package/esm2015/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.js +6 -6
- package/esm2015/quantity-selector/public-api.js +5 -5
- package/esm2015/quantity-selector/quantity-selector-validation.directive.js +43 -43
- package/esm2015/quantity-selector/quantity-selector.component.js +460 -460
- package/esm2015/quantity-selector/quantity-selector.module.js +52 -52
- package/esm2015/quantity-selector/quantity-selector.pipes.js +18 -18
- package/esm2015/query-builder/common/model/field.js +1 -1
- package/esm2015/query-builder/common/model/filter.js +1 -1
- package/esm2015/query-builder/common/model/legacy.js +1 -1
- package/esm2015/query-builder/common/model/operator-unit.js +41 -41
- package/esm2015/query-builder/common/model/operator.js +206 -206
- package/esm2015/query-builder/common/model/structure.js +1 -1
- package/esm2015/query-builder/common/model/type-map.js +26 -26
- package/esm2015/query-builder/common/model/type.js +5 -5
- package/esm2015/query-builder/common/services/output-query.service.js +110 -110
- package/esm2015/query-builder/common/services/type-convertor.service.js +39 -39
- package/esm2015/query-builder/pepperi-addons-ngx-lib-query-builder.js +8 -8
- package/esm2015/query-builder/public-api.js +7 -7
- package/esm2015/query-builder/query-builder-item/query-builder-item.component.js +115 -115
- package/esm2015/query-builder/query-builder-section/query-builder-section.component.js +63 -63
- package/esm2015/query-builder/query-builder.component.js +103 -103
- package/esm2015/query-builder/query-builder.module.js +34 -34
- package/esm2015/query-builder/query-builder.service.js +281 -281
- package/esm2015/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.js +4 -4
- package/esm2015/rich-html-textarea/public-api.js +5 -5
- package/esm2015/rich-html-textarea/rich-html-textarea.component.js +219 -219
- package/esm2015/rich-html-textarea/rich-html-textarea.module.js +56 -56
- package/esm2015/search/pepperi-addons-ngx-lib-search.js +4 -4
- package/esm2015/search/public-api.js +6 -6
- package/esm2015/search/search.component.js +273 -273
- package/esm2015/search/search.model.js +1 -1
- package/esm2015/search/search.module.js +44 -44
- package/esm2015/select/pepperi-addons-ngx-lib-select.js +4 -4
- package/esm2015/select/public-api.js +5 -5
- package/esm2015/select/select.component.js +212 -213
- package/esm2015/select/select.module.js +42 -42
- package/esm2015/separator/pepperi-addons-ngx-lib-separator.js +4 -4
- package/esm2015/separator/public-api.js +5 -5
- package/esm2015/separator/separator.component.js +62 -62
- package/esm2015/separator/separator.module.js +12 -12
- package/esm2015/side-bar/pepperi-addons-ngx-lib-side-bar.js +4 -4
- package/esm2015/side-bar/public-api.js +6 -6
- package/esm2015/side-bar/side-bar.component.js +130 -130
- package/esm2015/side-bar/side-bar.model.js +1 -1
- package/esm2015/side-bar/side-bar.module.js +33 -33
- package/esm2015/signature/pepperi-addons-ngx-lib-signature.js +4 -4
- package/esm2015/signature/public-api.js +5 -5
- package/esm2015/signature/signature.component.js +230 -230
- package/esm2015/signature/signature.module.js +54 -54
- package/esm2015/size-detector/pepperi-addons-ngx-lib-size-detector.js +4 -4
- package/esm2015/size-detector/public-api.js +5 -5
- package/esm2015/size-detector/size-detector.component.js +88 -88
- package/esm2015/size-detector/size-detector.module.js +21 -21
- package/esm2015/slider/pepperi-addons-ngx-lib-slider.js +4 -4
- package/esm2015/slider/public-api.js +5 -5
- package/esm2015/slider/slider.component.js +95 -95
- package/esm2015/slider/slider.module.js +24 -24
- package/esm2015/smart-filters/boolean-filter/boolean-filter.component.js +41 -41
- package/esm2015/smart-filters/common/filter-actions.component.js +25 -25
- package/esm2015/smart-filters/common/model/base-filter-component.js +259 -259
- package/esm2015/smart-filters/common/model/creator.js +75 -75
- package/esm2015/smart-filters/common/model/field.js +116 -116
- package/esm2015/smart-filters/common/model/filter.js +1 -1
- package/esm2015/smart-filters/common/model/operator.js +215 -215
- package/esm2015/smart-filters/common/model/type.js +1 -1
- package/esm2015/smart-filters/date-filter/date-filter.component.js +143 -143
- package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +152 -152
- package/esm2015/smart-filters/number-filter/number-filter.component.js +102 -102
- package/esm2015/smart-filters/pepperi-addons-ngx-lib-smart-filters.js +4 -4
- package/esm2015/smart-filters/public-api.js +18 -18
- package/esm2015/smart-filters/smart-filters.component.js +129 -129
- package/esm2015/smart-filters/smart-filters.module.js +90 -90
- package/esm2015/smart-filters/text-filter/text-filter.component.js +78 -78
- package/esm2015/textarea/pepperi-addons-ngx-lib-textarea.js +4 -4
- package/esm2015/textarea/public-api.js +5 -5
- package/esm2015/textarea/textarea.component.js +160 -160
- package/esm2015/textarea/textarea.module.js +50 -50
- package/esm2015/textbox/pepperi-addons-ngx-lib-textbox.js +5 -5
- package/esm2015/textbox/public-api.js +5 -5
- package/esm2015/textbox/textbox-validation.directive.js +85 -85
- package/esm2015/textbox/textbox.component.js +368 -368
- package/esm2015/textbox/textbox.module.js +44 -44
- package/esm2015/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.js +4 -4
- package/esm2015/textbox-icon/public-api.js +5 -5
- package/esm2015/textbox-icon/textbox-icon.component.js +40 -40
- package/esm2015/textbox-icon/textbox-icon.module.js +46 -46
- package/esm2015/top-bar/pepperi-addons-ngx-lib-top-bar.js +4 -4
- package/esm2015/top-bar/public-api.js +6 -6
- package/esm2015/top-bar/top-bar.component.js +98 -98
- package/esm2015/top-bar/top-bar.model.js +1 -1
- package/esm2015/top-bar/top-bar.module.js +40 -40
- package/fesm2015/pepperi-addons-ngx-lib-address.js +116 -116
- package/fesm2015/pepperi-addons-ngx-lib-attachment.js +227 -227
- package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.js +109 -109
- package/fesm2015/pepperi-addons-ngx-lib-button.js +149 -149
- package/fesm2015/pepperi-addons-ngx-lib-carousel.js +731 -731
- package/fesm2015/pepperi-addons-ngx-lib-checkbox.js +178 -178
- package/fesm2015/pepperi-addons-ngx-lib-color.js +292 -292
- package/fesm2015/pepperi-addons-ngx-lib-date.js +313 -313
- package/fesm2015/pepperi-addons-ngx-lib-dialog.js +157 -157
- package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js +143 -143
- package/fesm2015/pepperi-addons-ngx-lib-field-title.js +55 -55
- package/fesm2015/pepperi-addons-ngx-lib-files-uploader.js +252 -252
- package/fesm2015/pepperi-addons-ngx-lib-form.js +2685 -2677
- package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-group-buttons.js +84 -84
- package/fesm2015/pepperi-addons-ngx-lib-icon.js +662 -662
- package/fesm2015/pepperi-addons-ngx-lib-image.js +306 -300
- package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.js +400 -400
- package/fesm2015/pepperi-addons-ngx-lib-link.js +434 -434
- package/fesm2015/pepperi-addons-ngx-lib-list.js +2657 -2657
- package/fesm2015/pepperi-addons-ngx-lib-menu.js +314 -314
- package/fesm2015/pepperi-addons-ngx-lib-page-layout.js +55 -55
- package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js +219 -219
- package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.js +549 -549
- package/fesm2015/pepperi-addons-ngx-lib-query-builder.js +976 -976
- package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.js +256 -256
- package/fesm2015/pepperi-addons-ngx-lib-search.js +301 -301
- package/fesm2015/pepperi-addons-ngx-lib-select.js +241 -242
- package/fesm2015/pepperi-addons-ngx-lib-select.js.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-separator.js +71 -71
- package/fesm2015/pepperi-addons-ngx-lib-side-bar.js +154 -154
- package/fesm2015/pepperi-addons-ngx-lib-signature.js +267 -267
- package/fesm2015/pepperi-addons-ngx-lib-size-detector.js +103 -103
- package/fesm2015/pepperi-addons-ngx-lib-slider.js +112 -112
- package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1351 -1351
- package/fesm2015/pepperi-addons-ngx-lib-textarea.js +194 -194
- package/fesm2015/pepperi-addons-ngx-lib-textbox-icon.js +78 -78
- package/fesm2015/pepperi-addons-ngx-lib-textbox.js +478 -478
- package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +125 -125
- package/fesm2015/pepperi-addons-ngx-lib.js +4087 -4087
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/field-title/field-title.component.d.ts +11 -11
- package/field-title/field-title.module.d.ts +5 -5
- package/field-title/pepperi-addons-ngx-lib-field-title.d.ts +4 -4
- package/field-title/public-api.d.ts +2 -2
- package/files-uploader/files-uploader.component.d.ts +53 -53
- package/files-uploader/files-uploader.module.d.ts +5 -5
- package/files-uploader/pepperi-addons-ngx-lib-files-uploader.d.ts +4 -4
- package/files-uploader/public-api.d.ts +2 -2
- package/form/field-generator.component.d.ts +36 -36
- package/form/form.component.d.ts +88 -88
- package/form/form.model.d.ts +20 -20
- package/form/form.module.d.ts +5 -5
- package/form/indicators.component.d.ts +7 -7
- package/form/internal-button.component.d.ts +39 -39
- package/form/internal-carusel.component.d.ts +38 -38
- package/form/internal-carusel.service.d.ts +7 -7
- package/form/internal-list.component.d.ts +92 -92
- package/form/internal-menu.component.d.ts +16 -16
- package/form/internal-page.component.d.ts +72 -72
- package/form/internal-page.service.d.ts +19 -19
- package/form/pepperi-addons-ngx-lib-form.d.ts +13 -13
- package/form/public-api.d.ts +3 -3
- package/group-buttons/group-buttons.component.d.ts +20 -20
- package/group-buttons/group-buttons.module.d.ts +5 -5
- package/group-buttons/pepperi-addons-ngx-lib-group-buttons.d.ts +4 -4
- package/group-buttons/public-api.d.ts +2 -2
- package/icon/icon-generated-all.model.d.ts +99 -99
- package/icon/icon-generated.model.d.ts +394 -394
- package/icon/icon-registry.service.d.ts +6 -6
- package/icon/icon.component.d.ts +46 -46
- package/icon/icon.module.d.ts +2 -2
- package/icon/icon.service.d.ts +10 -10
- package/icon/pepperi-addons-ngx-lib-icon.d.ts +4 -4
- package/icon/public-api.d.ts +6 -6
- package/image/image.component.d.ts +63 -62
- package/image/image.module.d.ts +5 -5
- package/image/image.service.d.ts +11 -11
- package/image/pepperi-addons-ngx-lib-image.d.ts +4 -4
- package/image/pepperi-addons-ngx-lib-image.metadata.json +1 -1
- package/image/public-api.d.ts +3 -3
- package/images-filmstrip/images-filmstrip.component.d.ts +82 -82
- package/images-filmstrip/images-filmstrip.module.d.ts +5 -5
- package/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.d.ts +4 -4
- package/images-filmstrip/public-api.d.ts +2 -2
- package/link/link.component.d.ts +136 -136
- package/link/link.module.d.ts +5 -5
- package/link/link.pipes.d.ts +4 -4
- package/link/pepperi-addons-ngx-lib-link.d.ts +5 -5
- package/link/public-api.d.ts +2 -2
- package/list/list-actions.component.d.ts +14 -14
- package/list/list-carousel.component.d.ts +36 -36
- package/list/list-chooser.component.d.ts +25 -25
- package/list/list-pager.component.d.ts +35 -35
- package/list/list-sorting.component.d.ts +26 -26
- package/list/list-total.component.d.ts +7 -7
- package/list/list-views.component.d.ts +31 -31
- package/list/list.component.d.ts +159 -159
- package/list/list.model.d.ts +30 -30
- package/list/list.module.d.ts +5 -5
- package/list/list.pipes.d.ts +11 -11
- package/list/pepperi-addons-ngx-lib-list.d.ts +6 -6
- package/list/public-api.d.ts +10 -10
- package/list/virtual-scroller.d.ts +176 -176
- package/menu/menu-item.component.d.ts +25 -25
- package/menu/menu.component.d.ts +43 -43
- package/menu/menu.model.d.ts +25 -25
- package/menu/menu.module.d.ts +5 -5
- package/menu/pepperi-addons-ngx-lib-menu.d.ts +5 -5
- package/menu/public-api.d.ts +3 -3
- package/ngx-lib.module.d.ts +2 -2
- package/package.json +1 -1
- package/page-layout/page-layout.component.d.ts +16 -16
- package/page-layout/page-layout.module.d.ts +2 -2
- package/page-layout/pepperi-addons-ngx-lib-page-layout.d.ts +4 -4
- package/page-layout/public-api.d.ts +2 -2
- package/pepperi-addons-ngx-lib.d.ts +8 -8
- package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.d.ts +4 -4
- package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +15 -15
- package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +21 -21
- package/profile-data-views-list/profile-data-views-list.component.d.ts +32 -32
- package/profile-data-views-list/profile-data-views-list.model.d.ts +18 -18
- package/profile-data-views-list/profile-data-views-list.module.d.ts +5 -5
- package/profile-data-views-list/public-api.d.ts +5 -5
- package/public-api.d.ts +2 -2
- package/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.d.ts +6 -6
- package/quantity-selector/public-api.d.ts +2 -2
- package/quantity-selector/quantity-selector-validation.directive.d.ts +13 -13
- package/quantity-selector/quantity-selector.component.d.ts +96 -96
- package/quantity-selector/quantity-selector.module.d.ts +5 -5
- package/quantity-selector/quantity-selector.pipes.d.ts +4 -4
- package/query-builder/common/model/field.d.ts +8 -8
- package/query-builder/common/model/filter.d.ts +6 -6
- package/query-builder/common/model/legacy.d.ts +29 -29
- package/query-builder/common/model/operator-unit.d.ts +13 -13
- package/query-builder/common/model/operator.d.ts +21 -21
- package/query-builder/common/model/structure.d.ts +4 -4
- package/query-builder/common/model/type-map.d.ts +12 -12
- package/query-builder/common/model/type.d.ts +4 -4
- package/query-builder/common/services/output-query.service.d.ts +44 -44
- package/query-builder/common/services/type-convertor.service.d.ts +10 -10
- package/query-builder/pepperi-addons-ngx-lib-query-builder.d.ts +8 -8
- package/query-builder/public-api.d.ts +4 -4
- package/query-builder/query-builder-item/query-builder-item.component.d.ts +37 -37
- package/query-builder/query-builder-section/query-builder-section.component.d.ts +27 -27
- package/query-builder/query-builder.component.d.ts +35 -35
- package/query-builder/query-builder.module.d.ts +2 -2
- package/query-builder/query-builder.service.d.ts +94 -94
- package/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.d.ts +4 -4
- package/rich-html-textarea/public-api.d.ts +2 -2
- package/rich-html-textarea/rich-html-textarea.component.d.ts +75 -75
- package/rich-html-textarea/rich-html-textarea.module.d.ts +5 -5
- package/search/pepperi-addons-ngx-lib-search.d.ts +4 -4
- package/search/public-api.d.ts +3 -3
- package/search/search.component.d.ts +61 -61
- package/search/search.model.d.ts +14 -14
- package/search/search.module.d.ts +5 -5
- package/select/pepperi-addons-ngx-lib-select.d.ts +4 -4
- package/select/public-api.d.ts +2 -2
- package/select/select.component.d.ts +50 -50
- package/select/select.module.d.ts +5 -5
- package/separator/pepperi-addons-ngx-lib-separator.d.ts +4 -4
- package/separator/public-api.d.ts +2 -2
- package/separator/separator.component.d.ts +19 -19
- package/separator/separator.module.d.ts +2 -2
- package/side-bar/pepperi-addons-ngx-lib-side-bar.d.ts +4 -4
- package/side-bar/public-api.d.ts +3 -3
- package/side-bar/side-bar.component.d.ts +38 -38
- package/side-bar/side-bar.model.d.ts +4 -4
- package/side-bar/side-bar.module.d.ts +5 -5
- package/signature/pepperi-addons-ngx-lib-signature.d.ts +4 -4
- package/signature/public-api.d.ts +2 -2
- package/signature/signature.component.d.ts +64 -64
- package/signature/signature.module.d.ts +5 -5
- package/size-detector/pepperi-addons-ngx-lib-size-detector.d.ts +4 -4
- package/size-detector/public-api.d.ts +2 -2
- package/size-detector/size-detector.component.d.ts +26 -26
- package/size-detector/size-detector.module.d.ts +2 -2
- package/slider/pepperi-addons-ngx-lib-slider.d.ts +4 -4
- package/slider/public-api.d.ts +2 -2
- package/slider/slider.component.d.ts +36 -36
- package/slider/slider.module.d.ts +2 -2
- package/smart-filters/boolean-filter/boolean-filter.component.d.ts +12 -12
- package/smart-filters/common/filter-actions.component.d.ts +9 -9
- package/smart-filters/common/model/base-filter-component.d.ts +67 -67
- package/smart-filters/common/model/creator.d.ts +6 -6
- package/smart-filters/common/model/field.d.ts +69 -69
- package/smart-filters/common/model/filter.d.ts +11 -11
- package/smart-filters/common/model/operator.d.ts +38 -38
- package/smart-filters/common/model/type.d.ts +4 -4
- package/smart-filters/date-filter/date-filter.component.d.ts +41 -41
- package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +39 -39
- package/smart-filters/number-filter/number-filter.component.d.ts +38 -38
- package/smart-filters/pepperi-addons-ngx-lib-smart-filters.d.ts +4 -4
- package/smart-filters/public-api.d.ts +14 -14
- package/smart-filters/smart-filters.component.d.ts +32 -32
- package/smart-filters/smart-filters.module.d.ts +5 -5
- package/smart-filters/text-filter/text-filter.component.d.ts +17 -17
- package/src/core/style/abstracts/functions.scss +10 -10
- package/src/core/style/abstracts/mixins.scss +96 -96
- package/src/core/style/base/typography.scss +8 -0
- package/textarea/pepperi-addons-ngx-lib-textarea.d.ts +4 -4
- package/textarea/public-api.d.ts +2 -2
- package/textarea/textarea.component.d.ts +51 -51
- package/textarea/textarea.module.d.ts +5 -5
- package/textbox/pepperi-addons-ngx-lib-textbox.d.ts +5 -5
- package/textbox/public-api.d.ts +2 -2
- package/textbox/textbox-validation.directive.d.ts +18 -18
- package/textbox/textbox.component.d.ts +131 -131
- package/textbox/textbox.module.d.ts +5 -5
- package/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.d.ts +4 -4
- package/textbox-icon/public-api.d.ts +2 -2
- package/textbox-icon/textbox-icon.component.d.ts +10 -10
- package/textbox-icon/textbox-icon.module.d.ts +5 -5
- package/theming.scss +0 -15
- package/top-bar/pepperi-addons-ngx-lib-top-bar.d.ts +4 -4
- package/top-bar/public-api.d.ts +3 -3
- package/top-bar/top-bar.component.d.ts +36 -36
- package/top-bar/top-bar.model.d.ts +4 -4
- package/top-bar/top-bar.module.d.ts +5 -5
|
@@ -4,1814 +4,1814 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = global['pepperi-addons']['ngx-lib'] || {}, global['pepperi-addons']['ngx-lib']['smart-filters'] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.flexLayout, global.ng.material.core, global.ng.material.checkbox, global.ng.material.chips, global.ng.material.expansion, global.ng.material.icon, global.ng.material.formField, global.ng.material.input, global.ng.material.radio, global.ngxVirtualScroller, global['pepperi-addons']['ngx-lib'], global['pepperi-addons']['ngx-lib'].checkbox, global['pepperi-addons']['ngx-lib'].date, global['pepperi-addons']['ngx-lib'].select, global['pepperi-addons']['ngx-lib'].textbox, global['pepperi-addons']['ngx-lib'].search, global['pepperi-addons']['ngx-lib'].button, global['pepperi-addons']['ngx-lib'].icon, global['pepperi-addons']['ngx-lib']['group-buttons'], global.rxjs.operators, global.rxjs, global.translate));
|
|
5
5
|
}(this, (function (exports, core, common, forms, flexLayout, core$2, checkbox, chips, expansion, icon$1, formField, input, radio, ngxVirtualScroller, ngxLib, checkbox$1, date, select, textbox, search, button, icon, groupButtons, operators, rxjs, core$1) { 'use strict';
|
|
6
6
|
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
var extendStatics = function (d, b) {
|
|
23
|
-
extendStatics = Object.setPrototypeOf ||
|
|
24
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
-
function (d, b) { for (var p in b)
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
-
d[p] = b[p]; };
|
|
28
|
-
return extendStatics(d, b);
|
|
29
|
-
};
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
if (typeof b !== "function" && b !== null)
|
|
32
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
-
extendStatics(d, b);
|
|
34
|
-
function __() { this.constructor = d; }
|
|
35
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
-
}
|
|
37
|
-
var __assign = function () {
|
|
38
|
-
__assign = Object.assign || function __assign(t) {
|
|
39
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
-
s = arguments[i];
|
|
41
|
-
for (var p in s)
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
-
t[p] = s[p];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
|
-
return __assign.apply(this, arguments);
|
|
48
|
-
};
|
|
49
|
-
function __rest(s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s)
|
|
52
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
-
t[p] = s[p];
|
|
54
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
-
t[p[i]] = s[p[i]];
|
|
58
|
-
}
|
|
59
|
-
return t;
|
|
60
|
-
}
|
|
61
|
-
function __decorate(decorators, target, key, desc) {
|
|
62
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
-
else
|
|
66
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
-
if (d = decorators[i])
|
|
68
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
-
}
|
|
71
|
-
function __param(paramIndex, decorator) {
|
|
72
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
-
}
|
|
74
|
-
function __metadata(metadataKey, metadataValue) {
|
|
75
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
-
}
|
|
78
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
-
function fulfilled(value) { try {
|
|
82
|
-
step(generator.next(value));
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
reject(e);
|
|
86
|
-
} }
|
|
87
|
-
function rejected(value) { try {
|
|
88
|
-
step(generator["throw"](value));
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
reject(e);
|
|
92
|
-
} }
|
|
93
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function __generator(thisArg, body) {
|
|
98
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
-
function step(op) {
|
|
103
|
-
if (f)
|
|
104
|
-
throw new TypeError("Generator is already executing.");
|
|
105
|
-
while (_)
|
|
106
|
-
try {
|
|
107
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
108
|
-
return t;
|
|
109
|
-
if (y = 0, t)
|
|
110
|
-
op = [op[0] & 2, t.value];
|
|
111
|
-
switch (op[0]) {
|
|
112
|
-
case 0:
|
|
113
|
-
case 1:
|
|
114
|
-
t = op;
|
|
115
|
-
break;
|
|
116
|
-
case 4:
|
|
117
|
-
_.label++;
|
|
118
|
-
return { value: op[1], done: false };
|
|
119
|
-
case 5:
|
|
120
|
-
_.label++;
|
|
121
|
-
y = op[1];
|
|
122
|
-
op = [0];
|
|
123
|
-
continue;
|
|
124
|
-
case 7:
|
|
125
|
-
op = _.ops.pop();
|
|
126
|
-
_.trys.pop();
|
|
127
|
-
continue;
|
|
128
|
-
default:
|
|
129
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
-
_ = 0;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
-
_.label = op[1];
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
-
_.label = t[1];
|
|
139
|
-
t = op;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (t && _.label < t[2]) {
|
|
143
|
-
_.label = t[2];
|
|
144
|
-
_.ops.push(op);
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
if (t[2])
|
|
148
|
-
_.ops.pop();
|
|
149
|
-
_.trys.pop();
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
op = body.call(thisArg, _);
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
op = [6, e];
|
|
156
|
-
y = 0;
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
f = t = 0;
|
|
160
|
-
}
|
|
161
|
-
if (op[0] & 5)
|
|
162
|
-
throw op[1];
|
|
163
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
-
if (k2 === undefined)
|
|
168
|
-
k2 = k;
|
|
169
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
-
}) : (function (o, m, k, k2) {
|
|
171
|
-
if (k2 === undefined)
|
|
172
|
-
k2 = k;
|
|
173
|
-
o[k2] = m[k];
|
|
174
|
-
});
|
|
175
|
-
function __exportStar(m, o) {
|
|
176
|
-
for (var p in m)
|
|
177
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
-
__createBinding(o, m, p);
|
|
179
|
-
}
|
|
180
|
-
function __values(o) {
|
|
181
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
-
if (m)
|
|
183
|
-
return m.call(o);
|
|
184
|
-
if (o && typeof o.length === "number")
|
|
185
|
-
return {
|
|
186
|
-
next: function () {
|
|
187
|
-
if (o && i >= o.length)
|
|
188
|
-
o = void 0;
|
|
189
|
-
return { value: o && o[i++], done: !o };
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
-
}
|
|
194
|
-
function __read(o, n) {
|
|
195
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
-
if (!m)
|
|
197
|
-
return o;
|
|
198
|
-
var i = m.call(o), r, ar = [], e;
|
|
199
|
-
try {
|
|
200
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
-
ar.push(r.value);
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
e = { error: error };
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
try {
|
|
208
|
-
if (r && !r.done && (m = i["return"]))
|
|
209
|
-
m.call(i);
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
if (e)
|
|
213
|
-
throw e.error;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return ar;
|
|
217
|
-
}
|
|
218
|
-
/** @deprecated */
|
|
219
|
-
function __spread() {
|
|
220
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
-
ar = ar.concat(__read(arguments[i]));
|
|
222
|
-
return ar;
|
|
223
|
-
}
|
|
224
|
-
/** @deprecated */
|
|
225
|
-
function __spreadArrays() {
|
|
226
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
-
s += arguments[i].length;
|
|
228
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
-
r[k] = a[j];
|
|
231
|
-
return r;
|
|
232
|
-
}
|
|
233
|
-
function __spreadArray(to, from) {
|
|
234
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
235
|
-
to[j] = from[i];
|
|
236
|
-
return to;
|
|
237
|
-
}
|
|
238
|
-
function __await(v) {
|
|
239
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
240
|
-
}
|
|
241
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
242
|
-
if (!Symbol.asyncIterator)
|
|
243
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
244
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
245
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
246
|
-
function verb(n) { if (g[n])
|
|
247
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
248
|
-
function resume(n, v) { try {
|
|
249
|
-
step(g[n](v));
|
|
250
|
-
}
|
|
251
|
-
catch (e) {
|
|
252
|
-
settle(q[0][3], e);
|
|
253
|
-
} }
|
|
254
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
255
|
-
function fulfill(value) { resume("next", value); }
|
|
256
|
-
function reject(value) { resume("throw", value); }
|
|
257
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
258
|
-
resume(q[0][0], q[0][1]); }
|
|
259
|
-
}
|
|
260
|
-
function __asyncDelegator(o) {
|
|
261
|
-
var i, p;
|
|
262
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
263
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
264
|
-
}
|
|
265
|
-
function __asyncValues(o) {
|
|
266
|
-
if (!Symbol.asyncIterator)
|
|
267
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
268
|
-
var m = o[Symbol.asyncIterator], i;
|
|
269
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
270
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
271
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
272
|
-
}
|
|
273
|
-
function __makeTemplateObject(cooked, raw) {
|
|
274
|
-
if (Object.defineProperty) {
|
|
275
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
cooked.raw = raw;
|
|
279
|
-
}
|
|
280
|
-
return cooked;
|
|
281
|
-
}
|
|
282
|
-
;
|
|
283
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
284
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
285
|
-
}) : function (o, v) {
|
|
286
|
-
o["default"] = v;
|
|
287
|
-
};
|
|
288
|
-
function __importStar(mod) {
|
|
289
|
-
if (mod && mod.__esModule)
|
|
290
|
-
return mod;
|
|
291
|
-
var result = {};
|
|
292
|
-
if (mod != null)
|
|
293
|
-
for (var k in mod)
|
|
294
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
295
|
-
__createBinding(result, mod, k);
|
|
296
|
-
__setModuleDefault(result, mod);
|
|
297
|
-
return result;
|
|
298
|
-
}
|
|
299
|
-
function __importDefault(mod) {
|
|
300
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
301
|
-
}
|
|
302
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
303
|
-
if (kind === "a" && !f)
|
|
304
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
305
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
306
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
307
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
308
|
-
}
|
|
309
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
310
|
-
if (kind === "m")
|
|
311
|
-
throw new TypeError("Private method is not writable");
|
|
312
|
-
if (kind === "a" && !f)
|
|
313
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
314
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
315
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
316
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
/*! *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
/* global Reflect, Promise */
|
|
22
|
+
var extendStatics = function (d, b) {
|
|
23
|
+
extendStatics = Object.setPrototypeOf ||
|
|
24
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
25
|
+
function (d, b) { for (var p in b)
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
27
|
+
d[p] = b[p]; };
|
|
28
|
+
return extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
function __extends(d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
extendStatics(d, b);
|
|
34
|
+
function __() { this.constructor = d; }
|
|
35
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
+
}
|
|
37
|
+
var __assign = function () {
|
|
38
|
+
__assign = Object.assign || function __assign(t) {
|
|
39
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
+
s = arguments[i];
|
|
41
|
+
for (var p in s)
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
43
|
+
t[p] = s[p];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
return __assign.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
function __rest(s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s)
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
+
t[p] = s[p];
|
|
54
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
+
t[p[i]] = s[p[i]];
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function __decorate(decorators, target, key, desc) {
|
|
62
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
63
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
64
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
65
|
+
else
|
|
66
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
67
|
+
if (d = decorators[i])
|
|
68
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
69
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
70
|
+
}
|
|
71
|
+
function __param(paramIndex, decorator) {
|
|
72
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
73
|
+
}
|
|
74
|
+
function __metadata(metadataKey, metadataValue) {
|
|
75
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
76
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
77
|
+
}
|
|
78
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
79
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
80
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
81
|
+
function fulfilled(value) { try {
|
|
82
|
+
step(generator.next(value));
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
reject(e);
|
|
86
|
+
} }
|
|
87
|
+
function rejected(value) { try {
|
|
88
|
+
step(generator["throw"](value));
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
reject(e);
|
|
92
|
+
} }
|
|
93
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
94
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function __generator(thisArg, body) {
|
|
98
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
99
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
100
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
101
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
102
|
+
function step(op) {
|
|
103
|
+
if (f)
|
|
104
|
+
throw new TypeError("Generator is already executing.");
|
|
105
|
+
while (_)
|
|
106
|
+
try {
|
|
107
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
108
|
+
return t;
|
|
109
|
+
if (y = 0, t)
|
|
110
|
+
op = [op[0] & 2, t.value];
|
|
111
|
+
switch (op[0]) {
|
|
112
|
+
case 0:
|
|
113
|
+
case 1:
|
|
114
|
+
t = op;
|
|
115
|
+
break;
|
|
116
|
+
case 4:
|
|
117
|
+
_.label++;
|
|
118
|
+
return { value: op[1], done: false };
|
|
119
|
+
case 5:
|
|
120
|
+
_.label++;
|
|
121
|
+
y = op[1];
|
|
122
|
+
op = [0];
|
|
123
|
+
continue;
|
|
124
|
+
case 7:
|
|
125
|
+
op = _.ops.pop();
|
|
126
|
+
_.trys.pop();
|
|
127
|
+
continue;
|
|
128
|
+
default:
|
|
129
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
130
|
+
_ = 0;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
134
|
+
_.label = op[1];
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
138
|
+
_.label = t[1];
|
|
139
|
+
t = op;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (t && _.label < t[2]) {
|
|
143
|
+
_.label = t[2];
|
|
144
|
+
_.ops.push(op);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
if (t[2])
|
|
148
|
+
_.ops.pop();
|
|
149
|
+
_.trys.pop();
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
op = body.call(thisArg, _);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
op = [6, e];
|
|
156
|
+
y = 0;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
f = t = 0;
|
|
160
|
+
}
|
|
161
|
+
if (op[0] & 5)
|
|
162
|
+
throw op[1];
|
|
163
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
167
|
+
if (k2 === undefined)
|
|
168
|
+
k2 = k;
|
|
169
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
170
|
+
}) : (function (o, m, k, k2) {
|
|
171
|
+
if (k2 === undefined)
|
|
172
|
+
k2 = k;
|
|
173
|
+
o[k2] = m[k];
|
|
174
|
+
});
|
|
175
|
+
function __exportStar(m, o) {
|
|
176
|
+
for (var p in m)
|
|
177
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
178
|
+
__createBinding(o, m, p);
|
|
179
|
+
}
|
|
180
|
+
function __values(o) {
|
|
181
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
182
|
+
if (m)
|
|
183
|
+
return m.call(o);
|
|
184
|
+
if (o && typeof o.length === "number")
|
|
185
|
+
return {
|
|
186
|
+
next: function () {
|
|
187
|
+
if (o && i >= o.length)
|
|
188
|
+
o = void 0;
|
|
189
|
+
return { value: o && o[i++], done: !o };
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
193
|
+
}
|
|
194
|
+
function __read(o, n) {
|
|
195
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
196
|
+
if (!m)
|
|
197
|
+
return o;
|
|
198
|
+
var i = m.call(o), r, ar = [], e;
|
|
199
|
+
try {
|
|
200
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
201
|
+
ar.push(r.value);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
e = { error: error };
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
try {
|
|
208
|
+
if (r && !r.done && (m = i["return"]))
|
|
209
|
+
m.call(i);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
if (e)
|
|
213
|
+
throw e.error;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return ar;
|
|
217
|
+
}
|
|
218
|
+
/** @deprecated */
|
|
219
|
+
function __spread() {
|
|
220
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
221
|
+
ar = ar.concat(__read(arguments[i]));
|
|
222
|
+
return ar;
|
|
223
|
+
}
|
|
224
|
+
/** @deprecated */
|
|
225
|
+
function __spreadArrays() {
|
|
226
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
227
|
+
s += arguments[i].length;
|
|
228
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
229
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
230
|
+
r[k] = a[j];
|
|
231
|
+
return r;
|
|
232
|
+
}
|
|
233
|
+
function __spreadArray(to, from) {
|
|
234
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
235
|
+
to[j] = from[i];
|
|
236
|
+
return to;
|
|
237
|
+
}
|
|
238
|
+
function __await(v) {
|
|
239
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
240
|
+
}
|
|
241
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
242
|
+
if (!Symbol.asyncIterator)
|
|
243
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
244
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
245
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
246
|
+
function verb(n) { if (g[n])
|
|
247
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
248
|
+
function resume(n, v) { try {
|
|
249
|
+
step(g[n](v));
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
settle(q[0][3], e);
|
|
253
|
+
} }
|
|
254
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
255
|
+
function fulfill(value) { resume("next", value); }
|
|
256
|
+
function reject(value) { resume("throw", value); }
|
|
257
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
258
|
+
resume(q[0][0], q[0][1]); }
|
|
259
|
+
}
|
|
260
|
+
function __asyncDelegator(o) {
|
|
261
|
+
var i, p;
|
|
262
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
263
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
264
|
+
}
|
|
265
|
+
function __asyncValues(o) {
|
|
266
|
+
if (!Symbol.asyncIterator)
|
|
267
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
268
|
+
var m = o[Symbol.asyncIterator], i;
|
|
269
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
270
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
271
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
272
|
+
}
|
|
273
|
+
function __makeTemplateObject(cooked, raw) {
|
|
274
|
+
if (Object.defineProperty) {
|
|
275
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
cooked.raw = raw;
|
|
279
|
+
}
|
|
280
|
+
return cooked;
|
|
281
|
+
}
|
|
282
|
+
;
|
|
283
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
284
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
285
|
+
}) : function (o, v) {
|
|
286
|
+
o["default"] = v;
|
|
287
|
+
};
|
|
288
|
+
function __importStar(mod) {
|
|
289
|
+
if (mod && mod.__esModule)
|
|
290
|
+
return mod;
|
|
291
|
+
var result = {};
|
|
292
|
+
if (mod != null)
|
|
293
|
+
for (var k in mod)
|
|
294
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
295
|
+
__createBinding(result, mod, k);
|
|
296
|
+
__setModuleDefault(result, mod);
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
function __importDefault(mod) {
|
|
300
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
301
|
+
}
|
|
302
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
303
|
+
if (kind === "a" && !f)
|
|
304
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
305
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
306
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
307
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
308
|
+
}
|
|
309
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
310
|
+
if (kind === "m")
|
|
311
|
+
throw new TypeError("Private method is not writable");
|
|
312
|
+
if (kind === "a" && !f)
|
|
313
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
314
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
315
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
316
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
var PepSmartFiltersComponent = /** @class */ (function () {
|
|
320
|
-
function PepSmartFiltersComponent(hostElement, layoutService) {
|
|
321
|
-
this.hostElement = hostElement;
|
|
322
|
-
this.layoutService = layoutService;
|
|
323
|
-
this.title = '';
|
|
324
|
-
this.filtersDataMap = new Map();
|
|
325
|
-
this._filters = [];
|
|
326
|
-
this._fields = [];
|
|
327
|
-
this._useAsWebComponent = false;
|
|
328
|
-
// @Output()
|
|
329
|
-
// filtersClear: EventEmitter<void> = new EventEmitter<void>();
|
|
330
|
-
this.filtersChange = new core.EventEmitter();
|
|
331
|
-
this.fieldToggleChange = new core.EventEmitter();
|
|
332
|
-
this.expansionPanelHeaderHeight = '*';
|
|
333
|
-
}
|
|
334
|
-
Object.defineProperty(PepSmartFiltersComponent.prototype, "filters", {
|
|
335
|
-
get: function () {
|
|
336
|
-
var _this = this;
|
|
337
|
-
this._filters = __spreadArray([], __read(this.filtersDataMap.keys())).map(function (key) {
|
|
338
|
-
if (key) {
|
|
339
|
-
return _this.filtersDataMap.get(key);
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
return this._filters;
|
|
343
|
-
},
|
|
344
|
-
set: function (value) {
|
|
345
|
-
this._filters = value;
|
|
346
|
-
this.setupFilters(value);
|
|
347
|
-
},
|
|
348
|
-
enumerable: false,
|
|
349
|
-
configurable: true
|
|
350
|
-
});
|
|
351
|
-
Object.defineProperty(PepSmartFiltersComponent.prototype, "fields", {
|
|
352
|
-
get: function () {
|
|
353
|
-
return this._fields;
|
|
354
|
-
},
|
|
355
|
-
set: function (value) {
|
|
356
|
-
this._fields = value;
|
|
357
|
-
},
|
|
358
|
-
enumerable: false,
|
|
359
|
-
configurable: true
|
|
360
|
-
});
|
|
361
|
-
Object.defineProperty(PepSmartFiltersComponent.prototype, "useAsWebComponent", {
|
|
362
|
-
get: function () {
|
|
363
|
-
return this._useAsWebComponent;
|
|
364
|
-
},
|
|
365
|
-
set: function (value) {
|
|
366
|
-
if (value) {
|
|
367
|
-
this.exportFunctionsOnHostElement();
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
enumerable: false,
|
|
371
|
-
configurable: true
|
|
372
|
-
});
|
|
373
|
-
PepSmartFiltersComponent.prototype.exportFunctionsOnHostElement = function () {
|
|
374
|
-
// This is for web component usage for use those functions.
|
|
375
|
-
this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
|
|
376
|
-
this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
|
|
377
|
-
this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
|
|
378
|
-
};
|
|
379
|
-
PepSmartFiltersComponent.prototype.setupFilters = function (value) {
|
|
380
|
-
var _this = this;
|
|
381
|
-
this.filtersDataMap.clear();
|
|
382
|
-
if (value) {
|
|
383
|
-
value.forEach(function (filter) {
|
|
384
|
-
// Validate before add the filter into the map.
|
|
385
|
-
var currentField = null;
|
|
386
|
-
if (_this.fields && _this.fields.length > 0) {
|
|
387
|
-
currentField = _this.fields.find(function (field) { return field.id === filter.fieldId; });
|
|
388
|
-
}
|
|
389
|
-
if (currentField) {
|
|
390
|
-
// Only if the operator is from the same type
|
|
391
|
-
if (filter.operator.componentType.includes(currentField.componentType)) {
|
|
392
|
-
var isOperatorUnitValid = true;
|
|
393
|
-
if (filter.operatorUnit) {
|
|
394
|
-
// Only if the operator unit is not from the same type
|
|
395
|
-
if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
|
|
396
|
-
isOperatorUnitValid = false;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
// Add the filter.
|
|
400
|
-
if (isOperatorUnitValid) {
|
|
401
|
-
_this.filtersDataMap.set(filter.fieldId, filter);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
PepSmartFiltersComponent.prototype.raiseFiltersChange = function () {
|
|
409
|
-
this.filtersChange.emit(this.filters);
|
|
410
|
-
};
|
|
411
|
-
PepSmartFiltersComponent.prototype.toggleField = function (index, isOpen) {
|
|
412
|
-
this.fields[index].isOpen = isOpen;
|
|
413
|
-
this.fieldToggleChange.emit(this.fields[index]);
|
|
414
|
-
};
|
|
415
|
-
PepSmartFiltersComponent.prototype.clearFilters = function () {
|
|
416
|
-
this.filtersDataMap.clear();
|
|
417
|
-
};
|
|
418
|
-
PepSmartFiltersComponent.prototype.clearFilter = function (fieldId) {
|
|
419
|
-
this.filtersDataMap.delete(fieldId);
|
|
420
|
-
};
|
|
421
|
-
// Clear all the filters and raise event that filters has change.
|
|
422
|
-
PepSmartFiltersComponent.prototype.onFiltersClear = function () {
|
|
423
|
-
this.clearFilters();
|
|
424
|
-
this.raiseFiltersChange();
|
|
425
|
-
};
|
|
426
|
-
// Clear the filter and raise event that filters has change.
|
|
427
|
-
PepSmartFiltersComponent.prototype.onFilterClear = function (field) {
|
|
428
|
-
this.clearFilter(field.id);
|
|
429
|
-
this.raiseFiltersChange();
|
|
430
|
-
};
|
|
431
|
-
// Set the filter and raise event that filters has change.
|
|
432
|
-
PepSmartFiltersComponent.prototype.onFilterChange = function (field, filterData) {
|
|
433
|
-
this.clearFilter(field.id);
|
|
434
|
-
this.filtersDataMap.set(field.id, filterData);
|
|
435
|
-
this.raiseFiltersChange();
|
|
436
|
-
};
|
|
437
|
-
return PepSmartFiltersComponent;
|
|
438
|
-
}());
|
|
439
|
-
PepSmartFiltersComponent.decorators = [
|
|
440
|
-
{ type: core.Component, args: [{
|
|
441
|
-
selector: 'pep-smart-filters',
|
|
442
|
-
template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>",
|
|
443
|
-
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
444
|
-
styles: [".smart-filters-container .title{height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 .25rem;margin:0 var(--pep-spacing-xs,.25rem);padding:0 .75rem;padding:0 var(--pep-spacing-md,.75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;-webkit-margin-end:.5rem;margin-inline-end:.5rem;-webkit-margin-end:var(--pep-spacing-sm,.5rem);margin-inline-end:var(--pep-spacing-sm,.5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}", ".smart-filters-container .clear-filter.weak{background:rgba(26,26,26,.12);background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:rgba(26,26,26,.16);background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:0 .125rem .25rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-xs-offset,0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);position:relative;box-shadow:0 0 0 .25rem rgba(23,102,166,.5);box-shadow:0 0 0 var(--pep-spacing-xs,.25rem) hsla(var(--pep-color-text-link-h,207),var(--pep-color-text-link-s,76%),var(--pep-color-text-link-l,37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:#fff;background:hsl(var(--pep-color-system-primary-invert-h,255),var(--pep-color-system-primary-invert-s,100%),var(--pep-color-system-primary-invert-l,100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid #1a1a1a;border:1px solid hsl(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:0 .125rem .25rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-xs-offset,0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:#fff;background:hsl(var(--pep-color-system-primary-invert-h,255),var(--pep-color-system-primary-invert-s,100%),var(--pep-color-system-primary-invert-l,100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid #1a1a1a;border:1px solid hsl(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:rgba(26,26,26,.35)!important;color:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)!important;background:rgba(26,26,26,.04)!important;background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:rgba(26,26,26,.35);fill:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:rgba(26,26,26,.35);stroke:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)}"]
|
|
445
|
-
},] }
|
|
446
|
-
];
|
|
447
|
-
PepSmartFiltersComponent.ctorParameters = function () { return [
|
|
448
|
-
{ type: core.ElementRef },
|
|
449
|
-
{ type: ngxLib.PepLayoutService }
|
|
450
|
-
]; };
|
|
451
|
-
PepSmartFiltersComponent.propDecorators = {
|
|
452
|
-
title: [{ type: core.Input }],
|
|
453
|
-
filters: [{ type: core.Input }],
|
|
454
|
-
fields: [{ type: core.Input }],
|
|
455
|
-
useAsWebComponent: [{ type: core.Input }],
|
|
456
|
-
filtersChange: [{ type: core.Output }],
|
|
457
|
-
fieldToggleChange: [{ type: core.Output }]
|
|
319
|
+
var PepSmartFiltersComponent = /** @class */ (function () {
|
|
320
|
+
function PepSmartFiltersComponent(hostElement, layoutService) {
|
|
321
|
+
this.hostElement = hostElement;
|
|
322
|
+
this.layoutService = layoutService;
|
|
323
|
+
this.title = '';
|
|
324
|
+
this.filtersDataMap = new Map();
|
|
325
|
+
this._filters = [];
|
|
326
|
+
this._fields = [];
|
|
327
|
+
this._useAsWebComponent = false;
|
|
328
|
+
// @Output()
|
|
329
|
+
// filtersClear: EventEmitter<void> = new EventEmitter<void>();
|
|
330
|
+
this.filtersChange = new core.EventEmitter();
|
|
331
|
+
this.fieldToggleChange = new core.EventEmitter();
|
|
332
|
+
this.expansionPanelHeaderHeight = '*';
|
|
333
|
+
}
|
|
334
|
+
Object.defineProperty(PepSmartFiltersComponent.prototype, "filters", {
|
|
335
|
+
get: function () {
|
|
336
|
+
var _this = this;
|
|
337
|
+
this._filters = __spreadArray([], __read(this.filtersDataMap.keys())).map(function (key) {
|
|
338
|
+
if (key) {
|
|
339
|
+
return _this.filtersDataMap.get(key);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
return this._filters;
|
|
343
|
+
},
|
|
344
|
+
set: function (value) {
|
|
345
|
+
this._filters = value;
|
|
346
|
+
this.setupFilters(value);
|
|
347
|
+
},
|
|
348
|
+
enumerable: false,
|
|
349
|
+
configurable: true
|
|
350
|
+
});
|
|
351
|
+
Object.defineProperty(PepSmartFiltersComponent.prototype, "fields", {
|
|
352
|
+
get: function () {
|
|
353
|
+
return this._fields;
|
|
354
|
+
},
|
|
355
|
+
set: function (value) {
|
|
356
|
+
this._fields = value;
|
|
357
|
+
},
|
|
358
|
+
enumerable: false,
|
|
359
|
+
configurable: true
|
|
360
|
+
});
|
|
361
|
+
Object.defineProperty(PepSmartFiltersComponent.prototype, "useAsWebComponent", {
|
|
362
|
+
get: function () {
|
|
363
|
+
return this._useAsWebComponent;
|
|
364
|
+
},
|
|
365
|
+
set: function (value) {
|
|
366
|
+
if (value) {
|
|
367
|
+
this.exportFunctionsOnHostElement();
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
enumerable: false,
|
|
371
|
+
configurable: true
|
|
372
|
+
});
|
|
373
|
+
PepSmartFiltersComponent.prototype.exportFunctionsOnHostElement = function () {
|
|
374
|
+
// This is for web component usage for use those functions.
|
|
375
|
+
this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
|
|
376
|
+
this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
|
|
377
|
+
this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
|
|
378
|
+
};
|
|
379
|
+
PepSmartFiltersComponent.prototype.setupFilters = function (value) {
|
|
380
|
+
var _this = this;
|
|
381
|
+
this.filtersDataMap.clear();
|
|
382
|
+
if (value) {
|
|
383
|
+
value.forEach(function (filter) {
|
|
384
|
+
// Validate before add the filter into the map.
|
|
385
|
+
var currentField = null;
|
|
386
|
+
if (_this.fields && _this.fields.length > 0) {
|
|
387
|
+
currentField = _this.fields.find(function (field) { return field.id === filter.fieldId; });
|
|
388
|
+
}
|
|
389
|
+
if (currentField) {
|
|
390
|
+
// Only if the operator is from the same type
|
|
391
|
+
if (filter.operator.componentType.includes(currentField.componentType)) {
|
|
392
|
+
var isOperatorUnitValid = true;
|
|
393
|
+
if (filter.operatorUnit) {
|
|
394
|
+
// Only if the operator unit is not from the same type
|
|
395
|
+
if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
|
|
396
|
+
isOperatorUnitValid = false;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// Add the filter.
|
|
400
|
+
if (isOperatorUnitValid) {
|
|
401
|
+
_this.filtersDataMap.set(filter.fieldId, filter);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
PepSmartFiltersComponent.prototype.raiseFiltersChange = function () {
|
|
409
|
+
this.filtersChange.emit(this.filters);
|
|
410
|
+
};
|
|
411
|
+
PepSmartFiltersComponent.prototype.toggleField = function (index, isOpen) {
|
|
412
|
+
this.fields[index].isOpen = isOpen;
|
|
413
|
+
this.fieldToggleChange.emit(this.fields[index]);
|
|
414
|
+
};
|
|
415
|
+
PepSmartFiltersComponent.prototype.clearFilters = function () {
|
|
416
|
+
this.filtersDataMap.clear();
|
|
417
|
+
};
|
|
418
|
+
PepSmartFiltersComponent.prototype.clearFilter = function (fieldId) {
|
|
419
|
+
this.filtersDataMap.delete(fieldId);
|
|
420
|
+
};
|
|
421
|
+
// Clear all the filters and raise event that filters has change.
|
|
422
|
+
PepSmartFiltersComponent.prototype.onFiltersClear = function () {
|
|
423
|
+
this.clearFilters();
|
|
424
|
+
this.raiseFiltersChange();
|
|
425
|
+
};
|
|
426
|
+
// Clear the filter and raise event that filters has change.
|
|
427
|
+
PepSmartFiltersComponent.prototype.onFilterClear = function (field) {
|
|
428
|
+
this.clearFilter(field.id);
|
|
429
|
+
this.raiseFiltersChange();
|
|
430
|
+
};
|
|
431
|
+
// Set the filter and raise event that filters has change.
|
|
432
|
+
PepSmartFiltersComponent.prototype.onFilterChange = function (field, filterData) {
|
|
433
|
+
this.clearFilter(field.id);
|
|
434
|
+
this.filtersDataMap.set(field.id, filterData);
|
|
435
|
+
this.raiseFiltersChange();
|
|
436
|
+
};
|
|
437
|
+
return PepSmartFiltersComponent;
|
|
438
|
+
}());
|
|
439
|
+
PepSmartFiltersComponent.decorators = [
|
|
440
|
+
{ type: core.Component, args: [{
|
|
441
|
+
selector: 'pep-smart-filters',
|
|
442
|
+
template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>",
|
|
443
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
444
|
+
styles: [".smart-filters-container .title{height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 .25rem;margin:0 var(--pep-spacing-xs,.25rem);padding:0 .75rem;padding:0 var(--pep-spacing-md,.75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;-webkit-margin-end:.5rem;margin-inline-end:.5rem;-webkit-margin-end:var(--pep-spacing-sm,.5rem);margin-inline-end:var(--pep-spacing-sm,.5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}", ".smart-filters-container .clear-filter.weak{background:rgba(26,26,26,.12);background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:rgba(26,26,26,.16);background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:0 .125rem .25rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-xs-offset,0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);position:relative;box-shadow:0 0 0 .25rem rgba(23,102,166,.5);box-shadow:0 0 0 var(--pep-spacing-xs,.25rem) hsla(var(--pep-color-text-link-h,207),var(--pep-color-text-link-s,76%),var(--pep-color-text-link-l,37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:#fff;background:hsl(var(--pep-color-system-primary-invert-h,255),var(--pep-color-system-primary-invert-s,100%),var(--pep-color-system-primary-invert-l,100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid #1a1a1a;border:1px solid hsl(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:0 .125rem .25rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-xs-offset,0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:#fff;background:hsl(var(--pep-color-system-primary-invert-h,255),var(--pep-color-system-primary-invert-s,100%),var(--pep-color-system-primary-invert-l,100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid #1a1a1a;border:1px solid hsl(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:rgba(26,26,26,.35)!important;color:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)!important;background:rgba(26,26,26,.04)!important;background:hsla(var(--pep-color-weak-h,0),var(--pep-color-weak-s,0%),var(--pep-color-weak-l,10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:rgba(26,26,26,.35);fill:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:rgba(26,26,26,.35);stroke:hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.35)}"]
|
|
445
|
+
},] }
|
|
446
|
+
];
|
|
447
|
+
PepSmartFiltersComponent.ctorParameters = function () { return [
|
|
448
|
+
{ type: core.ElementRef },
|
|
449
|
+
{ type: ngxLib.PepLayoutService }
|
|
450
|
+
]; };
|
|
451
|
+
PepSmartFiltersComponent.propDecorators = {
|
|
452
|
+
title: [{ type: core.Input }],
|
|
453
|
+
filters: [{ type: core.Input }],
|
|
454
|
+
fields: [{ type: core.Input }],
|
|
455
|
+
useAsWebComponent: [{ type: core.Input }],
|
|
456
|
+
filtersChange: [{ type: core.Output }],
|
|
457
|
+
fieldToggleChange: [{ type: core.Output }]
|
|
458
458
|
};
|
|
459
459
|
|
|
460
|
-
var PepFilterActionsComponent = /** @class */ (function () {
|
|
461
|
-
function PepFilterActionsComponent() {
|
|
462
|
-
this.clearClick = new core.EventEmitter();
|
|
463
|
-
this.applyClick = new core.EventEmitter();
|
|
464
|
-
}
|
|
465
|
-
PepFilterActionsComponent.prototype.clear = function () {
|
|
466
|
-
this.clearClick.emit();
|
|
467
|
-
};
|
|
468
|
-
PepFilterActionsComponent.prototype.apply = function () {
|
|
469
|
-
this.applyClick.emit();
|
|
470
|
-
};
|
|
471
|
-
return PepFilterActionsComponent;
|
|
472
|
-
}());
|
|
473
|
-
PepFilterActionsComponent.decorators = [
|
|
474
|
-
{ type: core.Component, args: [{
|
|
475
|
-
selector: 'pep-filter-actions',
|
|
476
|
-
template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>",
|
|
477
|
-
styles: [".filter-actions{margin:1rem 0 calc(1rem / 2);margin:var(--pep-spacing-lg,1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}"]
|
|
478
|
-
},] }
|
|
479
|
-
];
|
|
480
|
-
PepFilterActionsComponent.propDecorators = {
|
|
481
|
-
form: [{ type: core.Input }],
|
|
482
|
-
clearClick: [{ type: core.Output }],
|
|
483
|
-
applyClick: [{ type: core.Output }]
|
|
460
|
+
var PepFilterActionsComponent = /** @class */ (function () {
|
|
461
|
+
function PepFilterActionsComponent() {
|
|
462
|
+
this.clearClick = new core.EventEmitter();
|
|
463
|
+
this.applyClick = new core.EventEmitter();
|
|
464
|
+
}
|
|
465
|
+
PepFilterActionsComponent.prototype.clear = function () {
|
|
466
|
+
this.clearClick.emit();
|
|
467
|
+
};
|
|
468
|
+
PepFilterActionsComponent.prototype.apply = function () {
|
|
469
|
+
this.applyClick.emit();
|
|
470
|
+
};
|
|
471
|
+
return PepFilterActionsComponent;
|
|
472
|
+
}());
|
|
473
|
+
PepFilterActionsComponent.decorators = [
|
|
474
|
+
{ type: core.Component, args: [{
|
|
475
|
+
selector: 'pep-filter-actions',
|
|
476
|
+
template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>",
|
|
477
|
+
styles: [".filter-actions{margin:1rem 0 calc(1rem / 2);margin:var(--pep-spacing-lg,1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}"]
|
|
478
|
+
},] }
|
|
479
|
+
];
|
|
480
|
+
PepFilterActionsComponent.propDecorators = {
|
|
481
|
+
form: [{ type: core.Input }],
|
|
482
|
+
clearClick: [{ type: core.Output }],
|
|
483
|
+
applyClick: [{ type: core.Output }]
|
|
484
484
|
};
|
|
485
485
|
|
|
486
|
-
var IPepSmartFilterOperator = /** @class */ (function () {
|
|
487
|
-
function IPepSmartFilterOperator() {
|
|
488
|
-
}
|
|
489
|
-
return IPepSmartFilterOperator;
|
|
490
|
-
}());
|
|
491
|
-
var Equals = {
|
|
492
|
-
id: 'eq',
|
|
493
|
-
name: 'EQUAL',
|
|
494
|
-
short: '=',
|
|
495
|
-
componentType: [
|
|
496
|
-
'number',
|
|
497
|
-
'boolean'
|
|
498
|
-
// 'multi-select',
|
|
499
|
-
// 'date',
|
|
500
|
-
// 'text',
|
|
501
|
-
// 'auto-complete',
|
|
502
|
-
// 'select',
|
|
503
|
-
],
|
|
504
|
-
};
|
|
505
|
-
var NotEqual = {
|
|
506
|
-
id: 'neq',
|
|
507
|
-
name: 'NOT_EQUAL',
|
|
508
|
-
short: '<>',
|
|
509
|
-
componentType: [
|
|
510
|
-
'number',
|
|
511
|
-
// 'multi-select',
|
|
512
|
-
// 'date',
|
|
513
|
-
// 'text',
|
|
514
|
-
// 'auto-complete',
|
|
515
|
-
// 'select',
|
|
516
|
-
],
|
|
517
|
-
};
|
|
518
|
-
var LessThan = {
|
|
519
|
-
id: 'lt',
|
|
520
|
-
name: 'LESS_THEN',
|
|
521
|
-
short: '<',
|
|
522
|
-
componentType: ['number'],
|
|
523
|
-
};
|
|
524
|
-
// const LessThanOrEquals: IPepSmartFilterOperator = {
|
|
525
|
-
// id: 'ltoe',
|
|
526
|
-
// name: 'LESS_THEN_OR_EQUAL',
|
|
527
|
-
// short: '<=',
|
|
528
|
-
// type: ['number'],
|
|
529
|
-
// };
|
|
530
|
-
var GreaterThan = {
|
|
531
|
-
id: 'gt',
|
|
532
|
-
name: 'GREATER_THEN',
|
|
533
|
-
short: '>',
|
|
534
|
-
componentType: ['number'],
|
|
535
|
-
};
|
|
536
|
-
// const GreaterThanOrEquals: IPepSmartFilterOperator = {
|
|
537
|
-
// id: 'gtoe',
|
|
538
|
-
// name: 'GREATER_THEN_OR_EQUAL',
|
|
539
|
-
// short: '>=',
|
|
540
|
-
// type: ['number'],
|
|
541
|
-
// };
|
|
542
|
-
var NumberRange = {
|
|
543
|
-
id: 'numberRange',
|
|
544
|
-
name: 'NUMBER_RANGE',
|
|
545
|
-
short: 'Range',
|
|
546
|
-
componentType: ['number'],
|
|
547
|
-
};
|
|
548
|
-
var Contains = {
|
|
549
|
-
id: 'contains',
|
|
550
|
-
name: 'CONTAINS',
|
|
551
|
-
short: 'Contains',
|
|
552
|
-
componentType: ['text'],
|
|
553
|
-
};
|
|
554
|
-
// const BeginsWith: Operator = {
|
|
555
|
-
// id: 'beginsWith',
|
|
556
|
-
// name: 'Begins With',
|
|
557
|
-
// short: 'Begins With',
|
|
558
|
-
// type: ['text'],
|
|
559
|
-
// };
|
|
560
|
-
// const EndsWith: Operator = {
|
|
561
|
-
// id: 'endsWith',
|
|
562
|
-
// name: 'Ends With',
|
|
563
|
-
// short: 'End With',
|
|
564
|
-
// type: ['text'],
|
|
565
|
-
// };
|
|
566
|
-
// const After: Operator = {
|
|
567
|
-
// id: 'after',
|
|
568
|
-
// name: 'After',
|
|
569
|
-
// short: 'After',
|
|
570
|
-
// type: ['date'],
|
|
571
|
-
// };
|
|
572
|
-
// const Before: Operator = {
|
|
573
|
-
// id: 'before',
|
|
574
|
-
// name: 'Before',
|
|
575
|
-
// short: 'Before',
|
|
576
|
-
// type: ['date'],
|
|
577
|
-
// };
|
|
578
|
-
var InTheLast = {
|
|
579
|
-
id: 'inTheLast',
|
|
580
|
-
name: 'IN_THE_LAST',
|
|
581
|
-
short: 'In the last',
|
|
582
|
-
componentType: ['date'],
|
|
583
|
-
};
|
|
584
|
-
var Today = {
|
|
585
|
-
id: 'today',
|
|
586
|
-
name: 'TODAY',
|
|
587
|
-
short: 'Today',
|
|
588
|
-
componentType: ['date'],
|
|
589
|
-
};
|
|
590
|
-
var ThisWeek = {
|
|
591
|
-
id: 'thisWeek',
|
|
592
|
-
name: 'THIS_WEEK',
|
|
593
|
-
short: 'This week',
|
|
594
|
-
componentType: ['date'],
|
|
595
|
-
};
|
|
596
|
-
var ThisMonth = {
|
|
597
|
-
id: 'thisMonth',
|
|
598
|
-
name: 'THIS_MONTH',
|
|
599
|
-
short: 'This month',
|
|
600
|
-
componentType: ['date'],
|
|
601
|
-
};
|
|
602
|
-
var DateRange = {
|
|
603
|
-
id: 'dateRange',
|
|
604
|
-
name: 'DATE_RANGE',
|
|
605
|
-
short: 'Range',
|
|
606
|
-
componentType: ['date'],
|
|
607
|
-
};
|
|
608
|
-
var DueIn = {
|
|
609
|
-
id: 'dueIn',
|
|
610
|
-
name: 'DUE_IN',
|
|
611
|
-
short: 'Due in',
|
|
612
|
-
componentType: ['date'],
|
|
613
|
-
};
|
|
614
|
-
var On = {
|
|
615
|
-
id: 'on',
|
|
616
|
-
name: 'ON',
|
|
617
|
-
short: 'On',
|
|
618
|
-
componentType: ['date'],
|
|
619
|
-
};
|
|
620
|
-
var NotInTheLast = {
|
|
621
|
-
id: 'notInTheLast',
|
|
622
|
-
name: 'NOT_IN_THE_LAST',
|
|
623
|
-
short: 'Not in the last',
|
|
624
|
-
componentType: ['date'],
|
|
625
|
-
};
|
|
626
|
-
var NotDueIn = {
|
|
627
|
-
id: 'notDueIn',
|
|
628
|
-
name: 'NOT_DUE_IN',
|
|
629
|
-
short: 'Not due in',
|
|
630
|
-
componentType: ['date'],
|
|
631
|
-
};
|
|
632
|
-
var IsEmpty = {
|
|
633
|
-
id: 'isEmpty',
|
|
634
|
-
name: 'IS_EMPTY',
|
|
635
|
-
short: 'Is empty',
|
|
636
|
-
componentType: ['date'],
|
|
637
|
-
};
|
|
638
|
-
var IsNotEmpty = {
|
|
639
|
-
id: 'isNotEmpty',
|
|
640
|
-
name: 'IS_NOT_EMPTY',
|
|
641
|
-
short: 'Is not empty',
|
|
642
|
-
componentType: ['date'],
|
|
643
|
-
};
|
|
644
|
-
var In = {
|
|
645
|
-
id: 'in',
|
|
646
|
-
name: 'IN',
|
|
647
|
-
short: 'In',
|
|
648
|
-
componentType: ['multi-select'],
|
|
649
|
-
};
|
|
650
|
-
var PepSmartFilterOperators = {
|
|
651
|
-
Equals: Equals,
|
|
652
|
-
NotEqual: NotEqual,
|
|
653
|
-
LessThan: LessThan,
|
|
654
|
-
// LessThanOrEquals: LessThanOrEquals,
|
|
655
|
-
GreaterThan: GreaterThan,
|
|
656
|
-
// GreaterThanOrEquals: GreaterThanOrEquals,
|
|
657
|
-
NumberRange: NumberRange,
|
|
658
|
-
Contains: Contains,
|
|
659
|
-
// BeginsWith: BeginsWith,
|
|
660
|
-
// EndsWith: EndsWith,
|
|
661
|
-
// After: After,
|
|
662
|
-
// Before: Before,
|
|
663
|
-
InTheLast: InTheLast,
|
|
664
|
-
Today: Today,
|
|
665
|
-
ThisWeek: ThisWeek,
|
|
666
|
-
ThisMonth: ThisMonth,
|
|
667
|
-
DateRange: DateRange,
|
|
668
|
-
DueIn: DueIn,
|
|
669
|
-
On: On,
|
|
670
|
-
NotInTheLast: NotInTheLast,
|
|
671
|
-
NotDueIn: NotDueIn,
|
|
672
|
-
IsEmpty: IsEmpty,
|
|
673
|
-
IsNotEmpty: IsNotEmpty,
|
|
674
|
-
In: In,
|
|
675
|
-
};
|
|
676
|
-
var IPepSmartFilterOperatorUnit = /** @class */ (function () {
|
|
677
|
-
function IPepSmartFilterOperatorUnit() {
|
|
678
|
-
}
|
|
679
|
-
return IPepSmartFilterOperatorUnit;
|
|
680
|
-
}());
|
|
681
|
-
var Days = {
|
|
682
|
-
id: 'days',
|
|
683
|
-
name: 'DAYS',
|
|
684
|
-
componentType: ['date'],
|
|
685
|
-
};
|
|
686
|
-
var Weeks = {
|
|
687
|
-
id: 'weeks',
|
|
688
|
-
name: 'WEEKS',
|
|
689
|
-
componentType: ['date'],
|
|
690
|
-
};
|
|
691
|
-
var Months = {
|
|
692
|
-
id: 'months',
|
|
693
|
-
name: 'MONTHS',
|
|
694
|
-
componentType: ['date'],
|
|
695
|
-
};
|
|
696
|
-
var Years = {
|
|
697
|
-
id: 'years',
|
|
698
|
-
name: 'YEARS',
|
|
699
|
-
componentType: ['date'],
|
|
700
|
-
};
|
|
701
|
-
var PepSmartFilterOperatorUnits = {
|
|
702
|
-
Days: Days,
|
|
703
|
-
Weeks: Weeks,
|
|
704
|
-
Months: Months,
|
|
705
|
-
Years: Years,
|
|
486
|
+
var IPepSmartFilterOperator = /** @class */ (function () {
|
|
487
|
+
function IPepSmartFilterOperator() {
|
|
488
|
+
}
|
|
489
|
+
return IPepSmartFilterOperator;
|
|
490
|
+
}());
|
|
491
|
+
var Equals = {
|
|
492
|
+
id: 'eq',
|
|
493
|
+
name: 'EQUAL',
|
|
494
|
+
short: '=',
|
|
495
|
+
componentType: [
|
|
496
|
+
'number',
|
|
497
|
+
'boolean'
|
|
498
|
+
// 'multi-select',
|
|
499
|
+
// 'date',
|
|
500
|
+
// 'text',
|
|
501
|
+
// 'auto-complete',
|
|
502
|
+
// 'select',
|
|
503
|
+
],
|
|
504
|
+
};
|
|
505
|
+
var NotEqual = {
|
|
506
|
+
id: 'neq',
|
|
507
|
+
name: 'NOT_EQUAL',
|
|
508
|
+
short: '<>',
|
|
509
|
+
componentType: [
|
|
510
|
+
'number',
|
|
511
|
+
// 'multi-select',
|
|
512
|
+
// 'date',
|
|
513
|
+
// 'text',
|
|
514
|
+
// 'auto-complete',
|
|
515
|
+
// 'select',
|
|
516
|
+
],
|
|
517
|
+
};
|
|
518
|
+
var LessThan = {
|
|
519
|
+
id: 'lt',
|
|
520
|
+
name: 'LESS_THEN',
|
|
521
|
+
short: '<',
|
|
522
|
+
componentType: ['number'],
|
|
523
|
+
};
|
|
524
|
+
// const LessThanOrEquals: IPepSmartFilterOperator = {
|
|
525
|
+
// id: 'ltoe',
|
|
526
|
+
// name: 'LESS_THEN_OR_EQUAL',
|
|
527
|
+
// short: '<=',
|
|
528
|
+
// type: ['number'],
|
|
529
|
+
// };
|
|
530
|
+
var GreaterThan = {
|
|
531
|
+
id: 'gt',
|
|
532
|
+
name: 'GREATER_THEN',
|
|
533
|
+
short: '>',
|
|
534
|
+
componentType: ['number'],
|
|
535
|
+
};
|
|
536
|
+
// const GreaterThanOrEquals: IPepSmartFilterOperator = {
|
|
537
|
+
// id: 'gtoe',
|
|
538
|
+
// name: 'GREATER_THEN_OR_EQUAL',
|
|
539
|
+
// short: '>=',
|
|
540
|
+
// type: ['number'],
|
|
541
|
+
// };
|
|
542
|
+
var NumberRange = {
|
|
543
|
+
id: 'numberRange',
|
|
544
|
+
name: 'NUMBER_RANGE',
|
|
545
|
+
short: 'Range',
|
|
546
|
+
componentType: ['number'],
|
|
547
|
+
};
|
|
548
|
+
var Contains = {
|
|
549
|
+
id: 'contains',
|
|
550
|
+
name: 'CONTAINS',
|
|
551
|
+
short: 'Contains',
|
|
552
|
+
componentType: ['text'],
|
|
553
|
+
};
|
|
554
|
+
// const BeginsWith: Operator = {
|
|
555
|
+
// id: 'beginsWith',
|
|
556
|
+
// name: 'Begins With',
|
|
557
|
+
// short: 'Begins With',
|
|
558
|
+
// type: ['text'],
|
|
559
|
+
// };
|
|
560
|
+
// const EndsWith: Operator = {
|
|
561
|
+
// id: 'endsWith',
|
|
562
|
+
// name: 'Ends With',
|
|
563
|
+
// short: 'End With',
|
|
564
|
+
// type: ['text'],
|
|
565
|
+
// };
|
|
566
|
+
// const After: Operator = {
|
|
567
|
+
// id: 'after',
|
|
568
|
+
// name: 'After',
|
|
569
|
+
// short: 'After',
|
|
570
|
+
// type: ['date'],
|
|
571
|
+
// };
|
|
572
|
+
// const Before: Operator = {
|
|
573
|
+
// id: 'before',
|
|
574
|
+
// name: 'Before',
|
|
575
|
+
// short: 'Before',
|
|
576
|
+
// type: ['date'],
|
|
577
|
+
// };
|
|
578
|
+
var InTheLast = {
|
|
579
|
+
id: 'inTheLast',
|
|
580
|
+
name: 'IN_THE_LAST',
|
|
581
|
+
short: 'In the last',
|
|
582
|
+
componentType: ['date'],
|
|
583
|
+
};
|
|
584
|
+
var Today = {
|
|
585
|
+
id: 'today',
|
|
586
|
+
name: 'TODAY',
|
|
587
|
+
short: 'Today',
|
|
588
|
+
componentType: ['date'],
|
|
589
|
+
};
|
|
590
|
+
var ThisWeek = {
|
|
591
|
+
id: 'thisWeek',
|
|
592
|
+
name: 'THIS_WEEK',
|
|
593
|
+
short: 'This week',
|
|
594
|
+
componentType: ['date'],
|
|
595
|
+
};
|
|
596
|
+
var ThisMonth = {
|
|
597
|
+
id: 'thisMonth',
|
|
598
|
+
name: 'THIS_MONTH',
|
|
599
|
+
short: 'This month',
|
|
600
|
+
componentType: ['date'],
|
|
601
|
+
};
|
|
602
|
+
var DateRange = {
|
|
603
|
+
id: 'dateRange',
|
|
604
|
+
name: 'DATE_RANGE',
|
|
605
|
+
short: 'Range',
|
|
606
|
+
componentType: ['date'],
|
|
607
|
+
};
|
|
608
|
+
var DueIn = {
|
|
609
|
+
id: 'dueIn',
|
|
610
|
+
name: 'DUE_IN',
|
|
611
|
+
short: 'Due in',
|
|
612
|
+
componentType: ['date'],
|
|
613
|
+
};
|
|
614
|
+
var On = {
|
|
615
|
+
id: 'on',
|
|
616
|
+
name: 'ON',
|
|
617
|
+
short: 'On',
|
|
618
|
+
componentType: ['date'],
|
|
619
|
+
};
|
|
620
|
+
var NotInTheLast = {
|
|
621
|
+
id: 'notInTheLast',
|
|
622
|
+
name: 'NOT_IN_THE_LAST',
|
|
623
|
+
short: 'Not in the last',
|
|
624
|
+
componentType: ['date'],
|
|
625
|
+
};
|
|
626
|
+
var NotDueIn = {
|
|
627
|
+
id: 'notDueIn',
|
|
628
|
+
name: 'NOT_DUE_IN',
|
|
629
|
+
short: 'Not due in',
|
|
630
|
+
componentType: ['date'],
|
|
631
|
+
};
|
|
632
|
+
var IsEmpty = {
|
|
633
|
+
id: 'isEmpty',
|
|
634
|
+
name: 'IS_EMPTY',
|
|
635
|
+
short: 'Is empty',
|
|
636
|
+
componentType: ['date'],
|
|
637
|
+
};
|
|
638
|
+
var IsNotEmpty = {
|
|
639
|
+
id: 'isNotEmpty',
|
|
640
|
+
name: 'IS_NOT_EMPTY',
|
|
641
|
+
short: 'Is not empty',
|
|
642
|
+
componentType: ['date'],
|
|
643
|
+
};
|
|
644
|
+
var In = {
|
|
645
|
+
id: 'in',
|
|
646
|
+
name: 'IN',
|
|
647
|
+
short: 'In',
|
|
648
|
+
componentType: ['multi-select'],
|
|
649
|
+
};
|
|
650
|
+
var PepSmartFilterOperators = {
|
|
651
|
+
Equals: Equals,
|
|
652
|
+
NotEqual: NotEqual,
|
|
653
|
+
LessThan: LessThan,
|
|
654
|
+
// LessThanOrEquals: LessThanOrEquals,
|
|
655
|
+
GreaterThan: GreaterThan,
|
|
656
|
+
// GreaterThanOrEquals: GreaterThanOrEquals,
|
|
657
|
+
NumberRange: NumberRange,
|
|
658
|
+
Contains: Contains,
|
|
659
|
+
// BeginsWith: BeginsWith,
|
|
660
|
+
// EndsWith: EndsWith,
|
|
661
|
+
// After: After,
|
|
662
|
+
// Before: Before,
|
|
663
|
+
InTheLast: InTheLast,
|
|
664
|
+
Today: Today,
|
|
665
|
+
ThisWeek: ThisWeek,
|
|
666
|
+
ThisMonth: ThisMonth,
|
|
667
|
+
DateRange: DateRange,
|
|
668
|
+
DueIn: DueIn,
|
|
669
|
+
On: On,
|
|
670
|
+
NotInTheLast: NotInTheLast,
|
|
671
|
+
NotDueIn: NotDueIn,
|
|
672
|
+
IsEmpty: IsEmpty,
|
|
673
|
+
IsNotEmpty: IsNotEmpty,
|
|
674
|
+
In: In,
|
|
675
|
+
};
|
|
676
|
+
var IPepSmartFilterOperatorUnit = /** @class */ (function () {
|
|
677
|
+
function IPepSmartFilterOperatorUnit() {
|
|
678
|
+
}
|
|
679
|
+
return IPepSmartFilterOperatorUnit;
|
|
680
|
+
}());
|
|
681
|
+
var Days = {
|
|
682
|
+
id: 'days',
|
|
683
|
+
name: 'DAYS',
|
|
684
|
+
componentType: ['date'],
|
|
685
|
+
};
|
|
686
|
+
var Weeks = {
|
|
687
|
+
id: 'weeks',
|
|
688
|
+
name: 'WEEKS',
|
|
689
|
+
componentType: ['date'],
|
|
690
|
+
};
|
|
691
|
+
var Months = {
|
|
692
|
+
id: 'months',
|
|
693
|
+
name: 'MONTHS',
|
|
694
|
+
componentType: ['date'],
|
|
695
|
+
};
|
|
696
|
+
var Years = {
|
|
697
|
+
id: 'years',
|
|
698
|
+
name: 'YEARS',
|
|
699
|
+
componentType: ['date'],
|
|
700
|
+
};
|
|
701
|
+
var PepSmartFilterOperatorUnits = {
|
|
702
|
+
Days: Days,
|
|
703
|
+
Weeks: Weeks,
|
|
704
|
+
Months: Months,
|
|
705
|
+
Years: Years,
|
|
706
706
|
};
|
|
707
707
|
|
|
708
|
-
var BaseFilterComponent = /** @class */ (function () {
|
|
709
|
-
function BaseFilterComponent(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
|
|
710
|
-
this.viewContainerRef = viewContainerRef;
|
|
711
|
-
this.injector = injector;
|
|
712
|
-
this.resolver = resolver;
|
|
713
|
-
this.builder = builder;
|
|
714
|
-
this.translate = translate;
|
|
715
|
-
this.validator = validator;
|
|
716
|
-
this.renderer = renderer;
|
|
717
|
-
this._fieldIdWithNoDots = '';
|
|
718
|
-
this.emitOnChange = false;
|
|
719
|
-
this.inline = false;
|
|
720
|
-
this.showActionButtons = true;
|
|
721
|
-
this.renderTitle = true;
|
|
722
|
-
this.filterClear = new core.EventEmitter();
|
|
723
|
-
this.filterChange = new core.EventEmitter();
|
|
724
|
-
this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
|
|
725
|
-
this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
|
|
726
|
-
this._destroyed = new rxjs.Subject();
|
|
727
|
-
}
|
|
728
|
-
Object.defineProperty(BaseFilterComponent.prototype, "field", {
|
|
729
|
-
get: function () {
|
|
730
|
-
return this._field;
|
|
731
|
-
},
|
|
732
|
-
set: function (value) {
|
|
733
|
-
this._field = value;
|
|
734
|
-
this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
|
|
735
|
-
this.setupForm();
|
|
736
|
-
},
|
|
737
|
-
enumerable: false,
|
|
738
|
-
configurable: true
|
|
739
|
-
});
|
|
740
|
-
Object.defineProperty(BaseFilterComponent.prototype, "filter", {
|
|
741
|
-
get: function () {
|
|
742
|
-
return this._filter;
|
|
743
|
-
},
|
|
744
|
-
set: function (value) {
|
|
745
|
-
this._filter = value;
|
|
746
|
-
this.setupFilter();
|
|
747
|
-
},
|
|
748
|
-
enumerable: false,
|
|
749
|
-
configurable: true
|
|
750
|
-
});
|
|
751
|
-
Object.defineProperty(BaseFilterComponent.prototype, "parentForm", {
|
|
752
|
-
set: function (form) {
|
|
753
|
-
this._parentForm = form;
|
|
754
|
-
this.updateParentForm();
|
|
755
|
-
},
|
|
756
|
-
enumerable: false,
|
|
757
|
-
configurable: true
|
|
758
|
-
});
|
|
759
|
-
Object.defineProperty(BaseFilterComponent.prototype, "operator", {
|
|
760
|
-
get: function () {
|
|
761
|
-
return this._operator;
|
|
762
|
-
},
|
|
763
|
-
set: function (operator) {
|
|
764
|
-
var _a;
|
|
765
|
-
if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
766
|
-
// Validate operator
|
|
767
|
-
var index = this.operators.findIndex(function (o) { return o.id === operator.id; });
|
|
768
|
-
if (index >= 0) {
|
|
769
|
-
this._operator = this.operators[index];
|
|
770
|
-
}
|
|
771
|
-
else {
|
|
772
|
-
this._operator = this.operators[0];
|
|
773
|
-
}
|
|
774
|
-
this.form.reset();
|
|
775
|
-
this.updateValidity();
|
|
776
|
-
}
|
|
777
|
-
},
|
|
778
|
-
enumerable: false,
|
|
779
|
-
configurable: true
|
|
780
|
-
});
|
|
781
|
-
Object.defineProperty(BaseFilterComponent.prototype, "operatorUnit", {
|
|
782
|
-
get: function () {
|
|
783
|
-
return this._operatorUnit;
|
|
784
|
-
},
|
|
785
|
-
set: function (operatorUnit) {
|
|
786
|
-
// Validate operator unit
|
|
787
|
-
if (operatorUnit) {
|
|
788
|
-
var index = this.operatorUnits.findIndex(function (ou) { return ou.id === operatorUnit.id; });
|
|
789
|
-
if (index >= 0) {
|
|
790
|
-
this._operatorUnit = this.operatorUnits[index];
|
|
791
|
-
}
|
|
792
|
-
else {
|
|
793
|
-
this._operatorUnit = this.operatorUnits[0];
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
else {
|
|
797
|
-
this._operatorUnit = undefined;
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
enumerable: false,
|
|
801
|
-
configurable: true
|
|
802
|
-
});
|
|
803
|
-
Object.defineProperty(BaseFilterComponent.prototype, "firstControlKey", {
|
|
804
|
-
get: function () {
|
|
805
|
-
return this.field ? this._fieldIdWithNoDots + "_first" : 'first';
|
|
806
|
-
},
|
|
807
|
-
enumerable: false,
|
|
808
|
-
configurable: true
|
|
809
|
-
});
|
|
810
|
-
Object.defineProperty(BaseFilterComponent.prototype, "firstControl", {
|
|
811
|
-
get: function () {
|
|
812
|
-
return this.form.get(this.firstControlKey);
|
|
813
|
-
},
|
|
814
|
-
enumerable: false,
|
|
815
|
-
configurable: true
|
|
816
|
-
});
|
|
817
|
-
Object.defineProperty(BaseFilterComponent.prototype, "secondControlKey", {
|
|
818
|
-
get: function () {
|
|
819
|
-
return this.field ? this._fieldIdWithNoDots + "_second" : 'second';
|
|
820
|
-
},
|
|
821
|
-
enumerable: false,
|
|
822
|
-
configurable: true
|
|
823
|
-
});
|
|
824
|
-
Object.defineProperty(BaseFilterComponent.prototype, "secondControl", {
|
|
825
|
-
get: function () {
|
|
826
|
-
return this.form.get(this.secondControlKey);
|
|
827
|
-
},
|
|
828
|
-
enumerable: false,
|
|
829
|
-
configurable: true
|
|
830
|
-
});
|
|
831
|
-
BaseFilterComponent.prototype.createActionsComponent = function () {
|
|
832
|
-
var _this = this;
|
|
833
|
-
var factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
|
|
834
|
-
this.actionsContainerRef = factory.create(this.injector);
|
|
835
|
-
this.actionsContainerRef.instance.form = this.form;
|
|
836
|
-
this.actionsContainerRef.instance.applyClick.subscribe(function () { return _this.applyFilter(); });
|
|
837
|
-
this.actionsContainerRef.instance.clearClick.subscribe(function () { return _this.clearFilter(); });
|
|
838
|
-
this.viewContainerRef.insert(this.actionsContainerRef.hostView);
|
|
839
|
-
};
|
|
840
|
-
BaseFilterComponent.prototype.setupForm = function () {
|
|
841
|
-
var formValue = {};
|
|
842
|
-
formValue[this.firstControlKey] = [];
|
|
843
|
-
formValue[this.secondControlKey] = [];
|
|
844
|
-
// this.form.patchValue(formValue);
|
|
845
|
-
this.form = this.builder.group(formValue);
|
|
846
|
-
// this.form[this.firstControlKey] = [];
|
|
847
|
-
// this.form[this.secondControlKey] = [];
|
|
848
|
-
this.setupOperators();
|
|
849
|
-
if (this.showActionButtons) {
|
|
850
|
-
this.createActionsComponent();
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
BaseFilterComponent.prototype.setupOperators = function () {
|
|
854
|
-
var _this = this;
|
|
855
|
-
var _a, _b;
|
|
856
|
-
// Get the operators by componentType.
|
|
857
|
-
this.operators = Object.keys(PepSmartFilterOperators)
|
|
858
|
-
.filter(function (key) {
|
|
859
|
-
return PepSmartFilterOperators[key].componentType.includes(_this.field.componentType);
|
|
860
|
-
})
|
|
861
|
-
.map(function (key) { return PepSmartFilterOperators[key]; });
|
|
862
|
-
// Filter by from field.operators input if exist.
|
|
863
|
-
if (((_a = this.field.operators) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
864
|
-
this.operators = this.operators.filter(function (o1) { return _this.field.operators.some(function (o2) { return o1.id === o2; }); });
|
|
865
|
-
}
|
|
866
|
-
// Get the operator units by componentType.
|
|
867
|
-
this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
|
|
868
|
-
.filter(function (key) {
|
|
869
|
-
return PepSmartFilterOperatorUnits[key].componentType.includes(_this.field.componentType);
|
|
870
|
-
})
|
|
871
|
-
.map(function (key) { return PepSmartFilterOperatorUnits[key]; });
|
|
872
|
-
// Filter by from field.operatorsUnits input if exist.
|
|
873
|
-
if (((_b = this.field.operatorUnits) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
874
|
-
this.operatorUnits = this.operatorUnits.filter(function (o1) { return _this.field.operatorUnits.some(function (o2) { return o1.id === o2; }); });
|
|
875
|
-
}
|
|
876
|
-
// Load translation before get the options in the children.
|
|
877
|
-
this.translate.get('SMART_FILTERS.TITLE').subscribe(function (res) {
|
|
878
|
-
_this.loadOperatorsOptions();
|
|
879
|
-
});
|
|
880
|
-
};
|
|
881
|
-
BaseFilterComponent.prototype.setupFilter = function () {
|
|
882
|
-
if (this.filter) {
|
|
883
|
-
this.operator = this.filter.operator;
|
|
884
|
-
this.operatorUnit = this.filter.operatorUnit;
|
|
885
|
-
var formValue = {};
|
|
886
|
-
formValue[this.firstControlKey] = this.filter.value.first;
|
|
887
|
-
formValue[this.secondControlKey] = this.filter.value.second;
|
|
888
|
-
this.form.patchValue(formValue);
|
|
889
|
-
}
|
|
890
|
-
else {
|
|
891
|
-
this.operator = this.getDefaultOperator();
|
|
892
|
-
this.operatorUnit = this.getDefaultOperatorUnit();
|
|
893
|
-
this.clearFilter(false);
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
BaseFilterComponent.prototype.updateParentForm = function () {
|
|
897
|
-
this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
|
|
898
|
-
this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
|
|
899
|
-
this._parentForm.setControl('operator', this.builder.control(this.operator));
|
|
900
|
-
this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
|
|
901
|
-
this._parentForm.setControl('values', this.builder.group({
|
|
902
|
-
first: this.firstControl,
|
|
903
|
-
second: this.secondControl
|
|
904
|
-
}));
|
|
905
|
-
};
|
|
906
|
-
BaseFilterComponent.prototype.getDestroyer = function () {
|
|
907
|
-
return operators.takeUntil(this._destroyed);
|
|
908
|
-
};
|
|
909
|
-
BaseFilterComponent.prototype.updateValidity = function () {
|
|
910
|
-
this.setFieldsStateAndValidators();
|
|
911
|
-
this.firstControl.updateValueAndValidity();
|
|
912
|
-
this.secondControl.updateValueAndValidity();
|
|
913
|
-
};
|
|
914
|
-
// Load the operators options from the translation.
|
|
915
|
-
BaseFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
916
|
-
// Not implemented in the base
|
|
917
|
-
};
|
|
918
|
-
// Set default validators - some childs override this.
|
|
919
|
-
BaseFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
920
|
-
this.firstControl.setValidators(forms.Validators.required);
|
|
921
|
-
this.secondControl.setValidators(forms.Validators.required);
|
|
922
|
-
this.secondControl.disable();
|
|
923
|
-
};
|
|
924
|
-
// Return undefined - some childs override this.
|
|
925
|
-
BaseFilterComponent.prototype.getDefaultOperatorUnit = function () {
|
|
926
|
-
return undefined;
|
|
927
|
-
};
|
|
928
|
-
BaseFilterComponent.prototype.initFilter = function () {
|
|
929
|
-
// Not implemented in the base
|
|
930
|
-
};
|
|
931
|
-
BaseFilterComponent.prototype.clearFilter = function (emitEvent) {
|
|
932
|
-
if (emitEvent === void 0) { emitEvent = true; }
|
|
933
|
-
this._filter = null;
|
|
934
|
-
this.form.reset();
|
|
935
|
-
this.initFilter();
|
|
936
|
-
if (emitEvent) {
|
|
937
|
-
this.filterClear.emit();
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
BaseFilterComponent.prototype.applyFilter = function () {
|
|
941
|
-
var filterValue = this.getFilterValue();
|
|
942
|
-
// If the filter is not null declare it, else - clear it.
|
|
943
|
-
if (filterValue) {
|
|
944
|
-
var filter = {
|
|
945
|
-
fieldId: this.field.id,
|
|
946
|
-
operator: this.operator,
|
|
947
|
-
operatorUnit: this.operatorUnit,
|
|
948
|
-
value: filterValue,
|
|
949
|
-
};
|
|
950
|
-
this._filter = filter;
|
|
951
|
-
this.filterChange.emit(filter);
|
|
952
|
-
}
|
|
953
|
-
else {
|
|
954
|
-
this.clearFilter();
|
|
955
|
-
}
|
|
956
|
-
};
|
|
957
|
-
BaseFilterComponent.prototype.ngOnInit = function () {
|
|
958
|
-
if (this.form) {
|
|
959
|
-
this.updateValidity();
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
BaseFilterComponent.prototype.ngOnChanges = function () {
|
|
963
|
-
// if (this.form) {
|
|
964
|
-
// this.updateValidity();
|
|
965
|
-
// }
|
|
966
|
-
};
|
|
967
|
-
BaseFilterComponent.prototype.ngOnDestroy = function () {
|
|
968
|
-
this._destroyed.next();
|
|
969
|
-
this._destroyed.complete();
|
|
970
|
-
if (this.showActionButtons) {
|
|
971
|
-
this.actionsContainerRef.destroy();
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
return BaseFilterComponent;
|
|
975
|
-
}());
|
|
976
|
-
BaseFilterComponent.decorators = [
|
|
977
|
-
{ type: core.Directive, args: [{},] }
|
|
978
|
-
];
|
|
979
|
-
BaseFilterComponent.ctorParameters = function () { return [
|
|
980
|
-
{ type: core.ViewContainerRef },
|
|
981
|
-
{ type: core.Injector },
|
|
982
|
-
{ type: core.ComponentFactoryResolver },
|
|
983
|
-
{ type: forms.FormBuilder },
|
|
984
|
-
{ type: core$1.TranslateService },
|
|
985
|
-
{ type: ngxLib.PepValidatorService },
|
|
986
|
-
{ type: core.Renderer2 }
|
|
987
|
-
]; };
|
|
988
|
-
BaseFilterComponent.propDecorators = {
|
|
989
|
-
field: [{ type: core.Input }],
|
|
990
|
-
filter: [{ type: core.Input }],
|
|
991
|
-
parentForm: [{ type: core.Input }],
|
|
992
|
-
emitOnChange: [{ type: core.Input }],
|
|
993
|
-
inline: [{ type: core.Input }],
|
|
994
|
-
showActionButtons: [{ type: core.Input }],
|
|
995
|
-
renderTitle: [{ type: core.Input }],
|
|
996
|
-
filterClear: [{ type: core.Output }],
|
|
997
|
-
filterChange: [{ type: core.Output }]
|
|
708
|
+
var BaseFilterComponent = /** @class */ (function () {
|
|
709
|
+
function BaseFilterComponent(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
|
|
710
|
+
this.viewContainerRef = viewContainerRef;
|
|
711
|
+
this.injector = injector;
|
|
712
|
+
this.resolver = resolver;
|
|
713
|
+
this.builder = builder;
|
|
714
|
+
this.translate = translate;
|
|
715
|
+
this.validator = validator;
|
|
716
|
+
this.renderer = renderer;
|
|
717
|
+
this._fieldIdWithNoDots = '';
|
|
718
|
+
this.emitOnChange = false;
|
|
719
|
+
this.inline = false;
|
|
720
|
+
this.showActionButtons = true;
|
|
721
|
+
this.renderTitle = true;
|
|
722
|
+
this.filterClear = new core.EventEmitter();
|
|
723
|
+
this.filterChange = new core.EventEmitter();
|
|
724
|
+
this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
|
|
725
|
+
this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
|
|
726
|
+
this._destroyed = new rxjs.Subject();
|
|
727
|
+
}
|
|
728
|
+
Object.defineProperty(BaseFilterComponent.prototype, "field", {
|
|
729
|
+
get: function () {
|
|
730
|
+
return this._field;
|
|
731
|
+
},
|
|
732
|
+
set: function (value) {
|
|
733
|
+
this._field = value;
|
|
734
|
+
this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
|
|
735
|
+
this.setupForm();
|
|
736
|
+
},
|
|
737
|
+
enumerable: false,
|
|
738
|
+
configurable: true
|
|
739
|
+
});
|
|
740
|
+
Object.defineProperty(BaseFilterComponent.prototype, "filter", {
|
|
741
|
+
get: function () {
|
|
742
|
+
return this._filter;
|
|
743
|
+
},
|
|
744
|
+
set: function (value) {
|
|
745
|
+
this._filter = value;
|
|
746
|
+
this.setupFilter();
|
|
747
|
+
},
|
|
748
|
+
enumerable: false,
|
|
749
|
+
configurable: true
|
|
750
|
+
});
|
|
751
|
+
Object.defineProperty(BaseFilterComponent.prototype, "parentForm", {
|
|
752
|
+
set: function (form) {
|
|
753
|
+
this._parentForm = form;
|
|
754
|
+
this.updateParentForm();
|
|
755
|
+
},
|
|
756
|
+
enumerable: false,
|
|
757
|
+
configurable: true
|
|
758
|
+
});
|
|
759
|
+
Object.defineProperty(BaseFilterComponent.prototype, "operator", {
|
|
760
|
+
get: function () {
|
|
761
|
+
return this._operator;
|
|
762
|
+
},
|
|
763
|
+
set: function (operator) {
|
|
764
|
+
var _a;
|
|
765
|
+
if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
766
|
+
// Validate operator
|
|
767
|
+
var index = this.operators.findIndex(function (o) { return o.id === operator.id; });
|
|
768
|
+
if (index >= 0) {
|
|
769
|
+
this._operator = this.operators[index];
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
this._operator = this.operators[0];
|
|
773
|
+
}
|
|
774
|
+
this.form.reset();
|
|
775
|
+
this.updateValidity();
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
enumerable: false,
|
|
779
|
+
configurable: true
|
|
780
|
+
});
|
|
781
|
+
Object.defineProperty(BaseFilterComponent.prototype, "operatorUnit", {
|
|
782
|
+
get: function () {
|
|
783
|
+
return this._operatorUnit;
|
|
784
|
+
},
|
|
785
|
+
set: function (operatorUnit) {
|
|
786
|
+
// Validate operator unit
|
|
787
|
+
if (operatorUnit) {
|
|
788
|
+
var index = this.operatorUnits.findIndex(function (ou) { return ou.id === operatorUnit.id; });
|
|
789
|
+
if (index >= 0) {
|
|
790
|
+
this._operatorUnit = this.operatorUnits[index];
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
this._operatorUnit = this.operatorUnits[0];
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
this._operatorUnit = undefined;
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
enumerable: false,
|
|
801
|
+
configurable: true
|
|
802
|
+
});
|
|
803
|
+
Object.defineProperty(BaseFilterComponent.prototype, "firstControlKey", {
|
|
804
|
+
get: function () {
|
|
805
|
+
return this.field ? this._fieldIdWithNoDots + "_first" : 'first';
|
|
806
|
+
},
|
|
807
|
+
enumerable: false,
|
|
808
|
+
configurable: true
|
|
809
|
+
});
|
|
810
|
+
Object.defineProperty(BaseFilterComponent.prototype, "firstControl", {
|
|
811
|
+
get: function () {
|
|
812
|
+
return this.form.get(this.firstControlKey);
|
|
813
|
+
},
|
|
814
|
+
enumerable: false,
|
|
815
|
+
configurable: true
|
|
816
|
+
});
|
|
817
|
+
Object.defineProperty(BaseFilterComponent.prototype, "secondControlKey", {
|
|
818
|
+
get: function () {
|
|
819
|
+
return this.field ? this._fieldIdWithNoDots + "_second" : 'second';
|
|
820
|
+
},
|
|
821
|
+
enumerable: false,
|
|
822
|
+
configurable: true
|
|
823
|
+
});
|
|
824
|
+
Object.defineProperty(BaseFilterComponent.prototype, "secondControl", {
|
|
825
|
+
get: function () {
|
|
826
|
+
return this.form.get(this.secondControlKey);
|
|
827
|
+
},
|
|
828
|
+
enumerable: false,
|
|
829
|
+
configurable: true
|
|
830
|
+
});
|
|
831
|
+
BaseFilterComponent.prototype.createActionsComponent = function () {
|
|
832
|
+
var _this = this;
|
|
833
|
+
var factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
|
|
834
|
+
this.actionsContainerRef = factory.create(this.injector);
|
|
835
|
+
this.actionsContainerRef.instance.form = this.form;
|
|
836
|
+
this.actionsContainerRef.instance.applyClick.subscribe(function () { return _this.applyFilter(); });
|
|
837
|
+
this.actionsContainerRef.instance.clearClick.subscribe(function () { return _this.clearFilter(); });
|
|
838
|
+
this.viewContainerRef.insert(this.actionsContainerRef.hostView);
|
|
839
|
+
};
|
|
840
|
+
BaseFilterComponent.prototype.setupForm = function () {
|
|
841
|
+
var formValue = {};
|
|
842
|
+
formValue[this.firstControlKey] = [];
|
|
843
|
+
formValue[this.secondControlKey] = [];
|
|
844
|
+
// this.form.patchValue(formValue);
|
|
845
|
+
this.form = this.builder.group(formValue);
|
|
846
|
+
// this.form[this.firstControlKey] = [];
|
|
847
|
+
// this.form[this.secondControlKey] = [];
|
|
848
|
+
this.setupOperators();
|
|
849
|
+
if (this.showActionButtons) {
|
|
850
|
+
this.createActionsComponent();
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
BaseFilterComponent.prototype.setupOperators = function () {
|
|
854
|
+
var _this = this;
|
|
855
|
+
var _a, _b;
|
|
856
|
+
// Get the operators by componentType.
|
|
857
|
+
this.operators = Object.keys(PepSmartFilterOperators)
|
|
858
|
+
.filter(function (key) {
|
|
859
|
+
return PepSmartFilterOperators[key].componentType.includes(_this.field.componentType);
|
|
860
|
+
})
|
|
861
|
+
.map(function (key) { return PepSmartFilterOperators[key]; });
|
|
862
|
+
// Filter by from field.operators input if exist.
|
|
863
|
+
if (((_a = this.field.operators) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
864
|
+
this.operators = this.operators.filter(function (o1) { return _this.field.operators.some(function (o2) { return o1.id === o2; }); });
|
|
865
|
+
}
|
|
866
|
+
// Get the operator units by componentType.
|
|
867
|
+
this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
|
|
868
|
+
.filter(function (key) {
|
|
869
|
+
return PepSmartFilterOperatorUnits[key].componentType.includes(_this.field.componentType);
|
|
870
|
+
})
|
|
871
|
+
.map(function (key) { return PepSmartFilterOperatorUnits[key]; });
|
|
872
|
+
// Filter by from field.operatorsUnits input if exist.
|
|
873
|
+
if (((_b = this.field.operatorUnits) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
874
|
+
this.operatorUnits = this.operatorUnits.filter(function (o1) { return _this.field.operatorUnits.some(function (o2) { return o1.id === o2; }); });
|
|
875
|
+
}
|
|
876
|
+
// Load translation before get the options in the children.
|
|
877
|
+
this.translate.get('SMART_FILTERS.TITLE').subscribe(function (res) {
|
|
878
|
+
_this.loadOperatorsOptions();
|
|
879
|
+
});
|
|
880
|
+
};
|
|
881
|
+
BaseFilterComponent.prototype.setupFilter = function () {
|
|
882
|
+
if (this.filter) {
|
|
883
|
+
this.operator = this.filter.operator;
|
|
884
|
+
this.operatorUnit = this.filter.operatorUnit;
|
|
885
|
+
var formValue = {};
|
|
886
|
+
formValue[this.firstControlKey] = this.filter.value.first;
|
|
887
|
+
formValue[this.secondControlKey] = this.filter.value.second;
|
|
888
|
+
this.form.patchValue(formValue);
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
this.operator = this.getDefaultOperator();
|
|
892
|
+
this.operatorUnit = this.getDefaultOperatorUnit();
|
|
893
|
+
this.clearFilter(false);
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
BaseFilterComponent.prototype.updateParentForm = function () {
|
|
897
|
+
this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
|
|
898
|
+
this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
|
|
899
|
+
this._parentForm.setControl('operator', this.builder.control(this.operator));
|
|
900
|
+
this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
|
|
901
|
+
this._parentForm.setControl('values', this.builder.group({
|
|
902
|
+
first: this.firstControl,
|
|
903
|
+
second: this.secondControl
|
|
904
|
+
}));
|
|
905
|
+
};
|
|
906
|
+
BaseFilterComponent.prototype.getDestroyer = function () {
|
|
907
|
+
return operators.takeUntil(this._destroyed);
|
|
908
|
+
};
|
|
909
|
+
BaseFilterComponent.prototype.updateValidity = function () {
|
|
910
|
+
this.setFieldsStateAndValidators();
|
|
911
|
+
this.firstControl.updateValueAndValidity();
|
|
912
|
+
this.secondControl.updateValueAndValidity();
|
|
913
|
+
};
|
|
914
|
+
// Load the operators options from the translation.
|
|
915
|
+
BaseFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
916
|
+
// Not implemented in the base
|
|
917
|
+
};
|
|
918
|
+
// Set default validators - some childs override this.
|
|
919
|
+
BaseFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
920
|
+
this.firstControl.setValidators(forms.Validators.required);
|
|
921
|
+
this.secondControl.setValidators(forms.Validators.required);
|
|
922
|
+
this.secondControl.disable();
|
|
923
|
+
};
|
|
924
|
+
// Return undefined - some childs override this.
|
|
925
|
+
BaseFilterComponent.prototype.getDefaultOperatorUnit = function () {
|
|
926
|
+
return undefined;
|
|
927
|
+
};
|
|
928
|
+
BaseFilterComponent.prototype.initFilter = function () {
|
|
929
|
+
// Not implemented in the base
|
|
930
|
+
};
|
|
931
|
+
BaseFilterComponent.prototype.clearFilter = function (emitEvent) {
|
|
932
|
+
if (emitEvent === void 0) { emitEvent = true; }
|
|
933
|
+
this._filter = null;
|
|
934
|
+
this.form.reset();
|
|
935
|
+
this.initFilter();
|
|
936
|
+
if (emitEvent) {
|
|
937
|
+
this.filterClear.emit();
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
BaseFilterComponent.prototype.applyFilter = function () {
|
|
941
|
+
var filterValue = this.getFilterValue();
|
|
942
|
+
// If the filter is not null declare it, else - clear it.
|
|
943
|
+
if (filterValue) {
|
|
944
|
+
var filter = {
|
|
945
|
+
fieldId: this.field.id,
|
|
946
|
+
operator: this.operator,
|
|
947
|
+
operatorUnit: this.operatorUnit,
|
|
948
|
+
value: filterValue,
|
|
949
|
+
};
|
|
950
|
+
this._filter = filter;
|
|
951
|
+
this.filterChange.emit(filter);
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
this.clearFilter();
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
BaseFilterComponent.prototype.ngOnInit = function () {
|
|
958
|
+
if (this.form) {
|
|
959
|
+
this.updateValidity();
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
BaseFilterComponent.prototype.ngOnChanges = function () {
|
|
963
|
+
// if (this.form) {
|
|
964
|
+
// this.updateValidity();
|
|
965
|
+
// }
|
|
966
|
+
};
|
|
967
|
+
BaseFilterComponent.prototype.ngOnDestroy = function () {
|
|
968
|
+
this._destroyed.next();
|
|
969
|
+
this._destroyed.complete();
|
|
970
|
+
if (this.showActionButtons) {
|
|
971
|
+
this.actionsContainerRef.destroy();
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
return BaseFilterComponent;
|
|
975
|
+
}());
|
|
976
|
+
BaseFilterComponent.decorators = [
|
|
977
|
+
{ type: core.Directive, args: [{},] }
|
|
978
|
+
];
|
|
979
|
+
BaseFilterComponent.ctorParameters = function () { return [
|
|
980
|
+
{ type: core.ViewContainerRef },
|
|
981
|
+
{ type: core.Injector },
|
|
982
|
+
{ type: core.ComponentFactoryResolver },
|
|
983
|
+
{ type: forms.FormBuilder },
|
|
984
|
+
{ type: core$1.TranslateService },
|
|
985
|
+
{ type: ngxLib.PepValidatorService },
|
|
986
|
+
{ type: core.Renderer2 }
|
|
987
|
+
]; };
|
|
988
|
+
BaseFilterComponent.propDecorators = {
|
|
989
|
+
field: [{ type: core.Input }],
|
|
990
|
+
filter: [{ type: core.Input }],
|
|
991
|
+
parentForm: [{ type: core.Input }],
|
|
992
|
+
emitOnChange: [{ type: core.Input }],
|
|
993
|
+
inline: [{ type: core.Input }],
|
|
994
|
+
showActionButtons: [{ type: core.Input }],
|
|
995
|
+
renderTitle: [{ type: core.Input }],
|
|
996
|
+
filterClear: [{ type: core.Output }],
|
|
997
|
+
filterChange: [{ type: core.Output }]
|
|
998
998
|
};
|
|
999
999
|
|
|
1000
|
-
var PepTextFilterComponent = /** @class */ (function (_super) {
|
|
1001
|
-
__extends(PepTextFilterComponent, _super);
|
|
1002
|
-
function PepTextFilterComponent() {
|
|
1003
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1004
|
-
_this.chooseTypeOptions = [];
|
|
1005
|
-
_this.operatorWidth = '38%';
|
|
1006
|
-
_this.firstControlWidth = '62%';
|
|
1007
|
-
return _this;
|
|
1008
|
-
}
|
|
1009
|
-
PepTextFilterComponent.prototype.ngOnInit = function () {
|
|
1010
|
-
var _this = this;
|
|
1011
|
-
this.firstControl.valueChanges
|
|
1012
|
-
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1013
|
-
.subscribe(function () {
|
|
1014
|
-
_this.setFieldsStateAndValidators();
|
|
1015
|
-
});
|
|
1016
|
-
};
|
|
1017
|
-
// Override
|
|
1018
|
-
PepTextFilterComponent.prototype.getDefaultOperator = function () {
|
|
1019
|
-
return PepSmartFilterOperators.Equals;
|
|
1020
|
-
};
|
|
1021
|
-
// Override
|
|
1022
|
-
PepTextFilterComponent.prototype.getFilterValue = function () {
|
|
1023
|
-
var filterValue = {
|
|
1024
|
-
first: this.firstControl.value,
|
|
1025
|
-
};
|
|
1026
|
-
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1027
|
-
filterValue['second'] = this.secondControl.value;
|
|
1028
|
-
}
|
|
1029
|
-
return filterValue;
|
|
1030
|
-
};
|
|
1031
|
-
// Override
|
|
1032
|
-
PepTextFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1033
|
-
var _this = this;
|
|
1034
|
-
this.chooseTypeOptions = this.operators.map(function (operator) {
|
|
1035
|
-
return {
|
|
1036
|
-
key: operator.id,
|
|
1037
|
-
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1038
|
-
};
|
|
1039
|
-
});
|
|
1040
|
-
};
|
|
1041
|
-
// Override
|
|
1042
|
-
PepTextFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1043
|
-
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1044
|
-
var firstValidators = [forms.Validators.required];
|
|
1045
|
-
if (this.secondControl.value) {
|
|
1046
|
-
firstValidators.push(this.validator.isLessThan(this.secondControl));
|
|
1047
|
-
}
|
|
1048
|
-
this.firstControl.setValidators(firstValidators);
|
|
1049
|
-
}
|
|
1050
|
-
else {
|
|
1051
|
-
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1052
|
-
}
|
|
1053
|
-
};
|
|
1054
|
-
PepTextFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1055
|
-
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1056
|
-
this.operator = operator;
|
|
1057
|
-
if (this._parentForm) {
|
|
1058
|
-
this.updateParentForm();
|
|
1059
|
-
}
|
|
1060
|
-
if (this.emitOnChange) {
|
|
1061
|
-
this.applyFilter();
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
PepTextFilterComponent.prototype.onValueChanged = function () {
|
|
1065
|
-
if (this.emitOnChange) {
|
|
1066
|
-
this.applyFilter();
|
|
1067
|
-
}
|
|
1068
|
-
};
|
|
1069
|
-
return PepTextFilterComponent;
|
|
1070
|
-
}(BaseFilterComponent));
|
|
1071
|
-
PepTextFilterComponent.decorators = [
|
|
1072
|
-
{ type: core.Component, args: [{
|
|
1073
|
-
selector: 'pep-text-filter',
|
|
1074
|
-
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.AMOUNT' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n</div>",
|
|
1075
|
-
styles: [""]
|
|
1076
|
-
},] }
|
|
1000
|
+
var PepTextFilterComponent = /** @class */ (function (_super) {
|
|
1001
|
+
__extends(PepTextFilterComponent, _super);
|
|
1002
|
+
function PepTextFilterComponent() {
|
|
1003
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1004
|
+
_this.chooseTypeOptions = [];
|
|
1005
|
+
_this.operatorWidth = '38%';
|
|
1006
|
+
_this.firstControlWidth = '62%';
|
|
1007
|
+
return _this;
|
|
1008
|
+
}
|
|
1009
|
+
PepTextFilterComponent.prototype.ngOnInit = function () {
|
|
1010
|
+
var _this = this;
|
|
1011
|
+
this.firstControl.valueChanges
|
|
1012
|
+
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1013
|
+
.subscribe(function () {
|
|
1014
|
+
_this.setFieldsStateAndValidators();
|
|
1015
|
+
});
|
|
1016
|
+
};
|
|
1017
|
+
// Override
|
|
1018
|
+
PepTextFilterComponent.prototype.getDefaultOperator = function () {
|
|
1019
|
+
return PepSmartFilterOperators.Equals;
|
|
1020
|
+
};
|
|
1021
|
+
// Override
|
|
1022
|
+
PepTextFilterComponent.prototype.getFilterValue = function () {
|
|
1023
|
+
var filterValue = {
|
|
1024
|
+
first: this.firstControl.value,
|
|
1025
|
+
};
|
|
1026
|
+
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1027
|
+
filterValue['second'] = this.secondControl.value;
|
|
1028
|
+
}
|
|
1029
|
+
return filterValue;
|
|
1030
|
+
};
|
|
1031
|
+
// Override
|
|
1032
|
+
PepTextFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1033
|
+
var _this = this;
|
|
1034
|
+
this.chooseTypeOptions = this.operators.map(function (operator) {
|
|
1035
|
+
return {
|
|
1036
|
+
key: operator.id,
|
|
1037
|
+
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1038
|
+
};
|
|
1039
|
+
});
|
|
1040
|
+
};
|
|
1041
|
+
// Override
|
|
1042
|
+
PepTextFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1043
|
+
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1044
|
+
var firstValidators = [forms.Validators.required];
|
|
1045
|
+
if (this.secondControl.value) {
|
|
1046
|
+
firstValidators.push(this.validator.isLessThan(this.secondControl));
|
|
1047
|
+
}
|
|
1048
|
+
this.firstControl.setValidators(firstValidators);
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
PepTextFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1055
|
+
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1056
|
+
this.operator = operator;
|
|
1057
|
+
if (this._parentForm) {
|
|
1058
|
+
this.updateParentForm();
|
|
1059
|
+
}
|
|
1060
|
+
if (this.emitOnChange) {
|
|
1061
|
+
this.applyFilter();
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
PepTextFilterComponent.prototype.onValueChanged = function () {
|
|
1065
|
+
if (this.emitOnChange) {
|
|
1066
|
+
this.applyFilter();
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
return PepTextFilterComponent;
|
|
1070
|
+
}(BaseFilterComponent));
|
|
1071
|
+
PepTextFilterComponent.decorators = [
|
|
1072
|
+
{ type: core.Component, args: [{
|
|
1073
|
+
selector: 'pep-text-filter',
|
|
1074
|
+
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.AMOUNT' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n</div>",
|
|
1075
|
+
styles: [""]
|
|
1076
|
+
},] }
|
|
1077
1077
|
];
|
|
1078
1078
|
|
|
1079
|
-
var PepBooleanFilterComponent = /** @class */ (function (_super) {
|
|
1080
|
-
__extends(PepBooleanFilterComponent, _super);
|
|
1081
|
-
function PepBooleanFilterComponent() {
|
|
1082
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1083
|
-
_this.options = [];
|
|
1084
|
-
return _this;
|
|
1085
|
-
// // Override
|
|
1086
|
-
// setFieldsStateAndValidators(): void {
|
|
1087
|
-
// this.secondControl.disable();
|
|
1088
|
-
// }
|
|
1089
|
-
}
|
|
1090
|
-
PepBooleanFilterComponent.prototype.ngOnInit = function () {
|
|
1091
|
-
//
|
|
1092
|
-
};
|
|
1093
|
-
// Override
|
|
1094
|
-
PepBooleanFilterComponent.prototype.getDefaultOperator = function () {
|
|
1095
|
-
return PepSmartFilterOperators.Equals;
|
|
1096
|
-
};
|
|
1097
|
-
// Override
|
|
1098
|
-
PepBooleanFilterComponent.prototype.getFilterValue = function () {
|
|
1099
|
-
var filterValue = { first: this.firstControl.value || false };
|
|
1100
|
-
return filterValue;
|
|
1101
|
-
};
|
|
1102
|
-
PepBooleanFilterComponent.prototype.onValueChanged = function (value) {
|
|
1103
|
-
this.firstControl.setValue(value);
|
|
1104
|
-
if (this.emitOnChange) {
|
|
1105
|
-
this.applyFilter();
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
return PepBooleanFilterComponent;
|
|
1109
|
-
}(BaseFilterComponent));
|
|
1110
|
-
PepBooleanFilterComponent.decorators = [
|
|
1111
|
-
{ type: core.Component, args: [{
|
|
1112
|
-
selector: 'pep-boolean-filter',
|
|
1113
|
-
template: "<ng-container *ngIf=\"inline\">\n <pep-select [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"true\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n\n</ng-container>\n\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n</div>",
|
|
1114
|
-
styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}"]
|
|
1115
|
-
},] }
|
|
1116
|
-
];
|
|
1117
|
-
PepBooleanFilterComponent.propDecorators = {
|
|
1118
|
-
options: [{ type: core.Input }]
|
|
1079
|
+
var PepBooleanFilterComponent = /** @class */ (function (_super) {
|
|
1080
|
+
__extends(PepBooleanFilterComponent, _super);
|
|
1081
|
+
function PepBooleanFilterComponent() {
|
|
1082
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1083
|
+
_this.options = [];
|
|
1084
|
+
return _this;
|
|
1085
|
+
// // Override
|
|
1086
|
+
// setFieldsStateAndValidators(): void {
|
|
1087
|
+
// this.secondControl.disable();
|
|
1088
|
+
// }
|
|
1089
|
+
}
|
|
1090
|
+
PepBooleanFilterComponent.prototype.ngOnInit = function () {
|
|
1091
|
+
//
|
|
1092
|
+
};
|
|
1093
|
+
// Override
|
|
1094
|
+
PepBooleanFilterComponent.prototype.getDefaultOperator = function () {
|
|
1095
|
+
return PepSmartFilterOperators.Equals;
|
|
1096
|
+
};
|
|
1097
|
+
// Override
|
|
1098
|
+
PepBooleanFilterComponent.prototype.getFilterValue = function () {
|
|
1099
|
+
var filterValue = { first: this.firstControl.value || false };
|
|
1100
|
+
return filterValue;
|
|
1101
|
+
};
|
|
1102
|
+
PepBooleanFilterComponent.prototype.onValueChanged = function (value) {
|
|
1103
|
+
this.firstControl.setValue(value);
|
|
1104
|
+
if (this.emitOnChange) {
|
|
1105
|
+
this.applyFilter();
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
return PepBooleanFilterComponent;
|
|
1109
|
+
}(BaseFilterComponent));
|
|
1110
|
+
PepBooleanFilterComponent.decorators = [
|
|
1111
|
+
{ type: core.Component, args: [{
|
|
1112
|
+
selector: 'pep-boolean-filter',
|
|
1113
|
+
template: "<ng-container *ngIf=\"inline\">\n <pep-select [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"true\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n\n</ng-container>\n\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n</div>",
|
|
1114
|
+
styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}"]
|
|
1115
|
+
},] }
|
|
1116
|
+
];
|
|
1117
|
+
PepBooleanFilterComponent.propDecorators = {
|
|
1118
|
+
options: [{ type: core.Input }]
|
|
1119
1119
|
};
|
|
1120
1120
|
|
|
1121
|
-
var PepDateFilterComponent = /** @class */ (function (_super) {
|
|
1122
|
-
__extends(PepDateFilterComponent, _super);
|
|
1123
|
-
function PepDateFilterComponent() {
|
|
1124
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1125
|
-
_this.PepSmartFilterOperators = PepSmartFilterOperators;
|
|
1126
|
-
_this.chooseTimeOptions = [];
|
|
1127
|
-
_this.chooseTimeUnitOptions = [];
|
|
1128
|
-
return _this;
|
|
1129
|
-
}
|
|
1130
|
-
PepDateFilterComponent.prototype.ngOnInit = function () {
|
|
1131
|
-
if (this.inline) {
|
|
1132
|
-
this.setControlsWidth();
|
|
1133
|
-
}
|
|
1134
|
-
};
|
|
1135
|
-
// Override
|
|
1136
|
-
PepDateFilterComponent.prototype.getDefaultOperator = function () {
|
|
1137
|
-
return PepSmartFilterOperators.InTheLast;
|
|
1138
|
-
};
|
|
1139
|
-
// Override
|
|
1140
|
-
PepDateFilterComponent.prototype.getDefaultOperatorUnit = function () {
|
|
1141
|
-
if (this.operator === PepSmartFilterOperators.InTheLast ||
|
|
1142
|
-
this.operator === PepSmartFilterOperators.NotInTheLast ||
|
|
1143
|
-
this.operator === PepSmartFilterOperators.DueIn ||
|
|
1144
|
-
this.operator === PepSmartFilterOperators.NotDueIn) {
|
|
1145
|
-
return PepSmartFilterOperatorUnits.Months;
|
|
1146
|
-
}
|
|
1147
|
-
else {
|
|
1148
|
-
return undefined;
|
|
1149
|
-
}
|
|
1150
|
-
};
|
|
1151
|
-
// Override
|
|
1152
|
-
PepDateFilterComponent.prototype.getFilterValue = function () {
|
|
1153
|
-
var filterValue = {
|
|
1154
|
-
first: this.firstControl.value,
|
|
1155
|
-
};
|
|
1156
|
-
if (this.operator === PepSmartFilterOperators.DateRange) {
|
|
1157
|
-
filterValue['second'] = this.secondControl.value;
|
|
1158
|
-
}
|
|
1159
|
-
return filterValue;
|
|
1160
|
-
};
|
|
1161
|
-
// Override
|
|
1162
|
-
PepDateFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1163
|
-
var _this = this;
|
|
1164
|
-
this.chooseTimeOptions = this.operators.map(function (operator) {
|
|
1165
|
-
return {
|
|
1166
|
-
key: operator.id,
|
|
1167
|
-
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1168
|
-
};
|
|
1169
|
-
});
|
|
1170
|
-
this.chooseTimeUnitOptions = this.operatorUnits.map(function (operatorUnit) {
|
|
1171
|
-
return {
|
|
1172
|
-
key: operatorUnit.id,
|
|
1173
|
-
value: _this.translate.instant(_this.OPERATOR_UNITS_TRANSLATION_PREFIX + "." + operatorUnit.name),
|
|
1174
|
-
};
|
|
1175
|
-
});
|
|
1176
|
-
};
|
|
1177
|
-
// Override
|
|
1178
|
-
PepDateFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1179
|
-
this.firstControl.enable();
|
|
1180
|
-
if (this.operator === PepSmartFilterOperators.DateRange) {
|
|
1181
|
-
this.firstControl.setValidators(forms.Validators.required);
|
|
1182
|
-
this.secondControl.enable();
|
|
1183
|
-
this.secondControl.setValidators(forms.Validators.required);
|
|
1184
|
-
}
|
|
1185
|
-
else if (this.operator === PepSmartFilterOperators.InTheLast ||
|
|
1186
|
-
this.operator === PepSmartFilterOperators.NotInTheLast ||
|
|
1187
|
-
this.operator === PepSmartFilterOperators.DueIn ||
|
|
1188
|
-
this.operator === PepSmartFilterOperators.NotDueIn) {
|
|
1189
|
-
this.firstControl.setValidators([
|
|
1190
|
-
forms.Validators.required,
|
|
1191
|
-
this.validator.numberValidator(),
|
|
1192
|
-
]);
|
|
1193
|
-
this.secondControl.disable();
|
|
1194
|
-
}
|
|
1195
|
-
else {
|
|
1196
|
-
// Disable 'first' field.
|
|
1197
|
-
if (this.operator === PepSmartFilterOperators.Today ||
|
|
1198
|
-
this.operator === PepSmartFilterOperators.ThisWeek ||
|
|
1199
|
-
this.operator === PepSmartFilterOperators.ThisMonth ||
|
|
1200
|
-
this.operator === PepSmartFilterOperators.IsEmpty ||
|
|
1201
|
-
this.operator === PepSmartFilterOperators.IsNotEmpty) {
|
|
1202
|
-
this.firstControl.disable();
|
|
1203
|
-
}
|
|
1204
|
-
// Default disable 'second' field.
|
|
1205
|
-
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1206
|
-
}
|
|
1207
|
-
};
|
|
1208
|
-
PepDateFilterComponent.prototype.setControlsWidth = function () {
|
|
1209
|
-
if (this.operator === PepSmartFilterOperators.Today ||
|
|
1210
|
-
this.operator === PepSmartFilterOperators.ThisWeek ||
|
|
1211
|
-
this.operator === PepSmartFilterOperators.ThisMonth ||
|
|
1212
|
-
this.operator === PepSmartFilterOperators.IsEmpty ||
|
|
1213
|
-
this.operator === PepSmartFilterOperators.IsNotEmpty) {
|
|
1214
|
-
this.operatorWidth = 'auto';
|
|
1215
|
-
this.fieldsWidth = '0%';
|
|
1216
|
-
}
|
|
1217
|
-
else if (this.operator === PepSmartFilterOperators.On) {
|
|
1218
|
-
this.operatorWidth = '38%';
|
|
1219
|
-
this.fieldsWidth = '62%';
|
|
1220
|
-
}
|
|
1221
|
-
else {
|
|
1222
|
-
this.operatorWidth = '30%';
|
|
1223
|
-
this.fieldsWidth = '70%';
|
|
1224
|
-
}
|
|
1225
|
-
};
|
|
1226
|
-
PepDateFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1227
|
-
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1228
|
-
this.operator = operator;
|
|
1229
|
-
this.operatorUnit = this.getDefaultOperatorUnit();
|
|
1230
|
-
if (this.inline) {
|
|
1231
|
-
this.setControlsWidth();
|
|
1232
|
-
}
|
|
1233
|
-
if (this._parentForm) {
|
|
1234
|
-
this.updateParentForm();
|
|
1235
|
-
}
|
|
1236
|
-
if (this.emitOnChange) {
|
|
1237
|
-
this.applyFilter();
|
|
1238
|
-
}
|
|
1239
|
-
};
|
|
1240
|
-
PepDateFilterComponent.prototype.onTimeUnitChanged = function (value) {
|
|
1241
|
-
var operatorUnit = Object.values(PepSmartFilterOperatorUnits).find(function (operatorUnit) { return operatorUnit.id === value; });
|
|
1242
|
-
this.operatorUnit = operatorUnit;
|
|
1243
|
-
if (this._parentForm) {
|
|
1244
|
-
this.updateParentForm();
|
|
1245
|
-
}
|
|
1246
|
-
if (this.emitOnChange) {
|
|
1247
|
-
this.applyFilter();
|
|
1248
|
-
}
|
|
1249
|
-
};
|
|
1250
|
-
PepDateFilterComponent.prototype.onDateValueChanged = function () {
|
|
1251
|
-
if (this.emitOnChange) {
|
|
1252
|
-
this.applyFilter();
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
return PepDateFilterComponent;
|
|
1256
|
-
}(BaseFilterComponent));
|
|
1257
|
-
PepDateFilterComponent.decorators = [
|
|
1258
|
-
{ type: core.Component, args: [{
|
|
1259
|
-
selector: 'pep-date-filter',
|
|
1260
|
-
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n</div>",
|
|
1261
|
-
styles: [""]
|
|
1262
|
-
},] }
|
|
1121
|
+
var PepDateFilterComponent = /** @class */ (function (_super) {
|
|
1122
|
+
__extends(PepDateFilterComponent, _super);
|
|
1123
|
+
function PepDateFilterComponent() {
|
|
1124
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1125
|
+
_this.PepSmartFilterOperators = PepSmartFilterOperators;
|
|
1126
|
+
_this.chooseTimeOptions = [];
|
|
1127
|
+
_this.chooseTimeUnitOptions = [];
|
|
1128
|
+
return _this;
|
|
1129
|
+
}
|
|
1130
|
+
PepDateFilterComponent.prototype.ngOnInit = function () {
|
|
1131
|
+
if (this.inline) {
|
|
1132
|
+
this.setControlsWidth();
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
// Override
|
|
1136
|
+
PepDateFilterComponent.prototype.getDefaultOperator = function () {
|
|
1137
|
+
return PepSmartFilterOperators.InTheLast;
|
|
1138
|
+
};
|
|
1139
|
+
// Override
|
|
1140
|
+
PepDateFilterComponent.prototype.getDefaultOperatorUnit = function () {
|
|
1141
|
+
if (this.operator === PepSmartFilterOperators.InTheLast ||
|
|
1142
|
+
this.operator === PepSmartFilterOperators.NotInTheLast ||
|
|
1143
|
+
this.operator === PepSmartFilterOperators.DueIn ||
|
|
1144
|
+
this.operator === PepSmartFilterOperators.NotDueIn) {
|
|
1145
|
+
return PepSmartFilterOperatorUnits.Months;
|
|
1146
|
+
}
|
|
1147
|
+
else {
|
|
1148
|
+
return undefined;
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
// Override
|
|
1152
|
+
PepDateFilterComponent.prototype.getFilterValue = function () {
|
|
1153
|
+
var filterValue = {
|
|
1154
|
+
first: this.firstControl.value,
|
|
1155
|
+
};
|
|
1156
|
+
if (this.operator === PepSmartFilterOperators.DateRange) {
|
|
1157
|
+
filterValue['second'] = this.secondControl.value;
|
|
1158
|
+
}
|
|
1159
|
+
return filterValue;
|
|
1160
|
+
};
|
|
1161
|
+
// Override
|
|
1162
|
+
PepDateFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1163
|
+
var _this = this;
|
|
1164
|
+
this.chooseTimeOptions = this.operators.map(function (operator) {
|
|
1165
|
+
return {
|
|
1166
|
+
key: operator.id,
|
|
1167
|
+
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1168
|
+
};
|
|
1169
|
+
});
|
|
1170
|
+
this.chooseTimeUnitOptions = this.operatorUnits.map(function (operatorUnit) {
|
|
1171
|
+
return {
|
|
1172
|
+
key: operatorUnit.id,
|
|
1173
|
+
value: _this.translate.instant(_this.OPERATOR_UNITS_TRANSLATION_PREFIX + "." + operatorUnit.name),
|
|
1174
|
+
};
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
// Override
|
|
1178
|
+
PepDateFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1179
|
+
this.firstControl.enable();
|
|
1180
|
+
if (this.operator === PepSmartFilterOperators.DateRange) {
|
|
1181
|
+
this.firstControl.setValidators(forms.Validators.required);
|
|
1182
|
+
this.secondControl.enable();
|
|
1183
|
+
this.secondControl.setValidators(forms.Validators.required);
|
|
1184
|
+
}
|
|
1185
|
+
else if (this.operator === PepSmartFilterOperators.InTheLast ||
|
|
1186
|
+
this.operator === PepSmartFilterOperators.NotInTheLast ||
|
|
1187
|
+
this.operator === PepSmartFilterOperators.DueIn ||
|
|
1188
|
+
this.operator === PepSmartFilterOperators.NotDueIn) {
|
|
1189
|
+
this.firstControl.setValidators([
|
|
1190
|
+
forms.Validators.required,
|
|
1191
|
+
this.validator.numberValidator(),
|
|
1192
|
+
]);
|
|
1193
|
+
this.secondControl.disable();
|
|
1194
|
+
}
|
|
1195
|
+
else {
|
|
1196
|
+
// Disable 'first' field.
|
|
1197
|
+
if (this.operator === PepSmartFilterOperators.Today ||
|
|
1198
|
+
this.operator === PepSmartFilterOperators.ThisWeek ||
|
|
1199
|
+
this.operator === PepSmartFilterOperators.ThisMonth ||
|
|
1200
|
+
this.operator === PepSmartFilterOperators.IsEmpty ||
|
|
1201
|
+
this.operator === PepSmartFilterOperators.IsNotEmpty) {
|
|
1202
|
+
this.firstControl.disable();
|
|
1203
|
+
}
|
|
1204
|
+
// Default disable 'second' field.
|
|
1205
|
+
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
PepDateFilterComponent.prototype.setControlsWidth = function () {
|
|
1209
|
+
if (this.operator === PepSmartFilterOperators.Today ||
|
|
1210
|
+
this.operator === PepSmartFilterOperators.ThisWeek ||
|
|
1211
|
+
this.operator === PepSmartFilterOperators.ThisMonth ||
|
|
1212
|
+
this.operator === PepSmartFilterOperators.IsEmpty ||
|
|
1213
|
+
this.operator === PepSmartFilterOperators.IsNotEmpty) {
|
|
1214
|
+
this.operatorWidth = 'auto';
|
|
1215
|
+
this.fieldsWidth = '0%';
|
|
1216
|
+
}
|
|
1217
|
+
else if (this.operator === PepSmartFilterOperators.On) {
|
|
1218
|
+
this.operatorWidth = '38%';
|
|
1219
|
+
this.fieldsWidth = '62%';
|
|
1220
|
+
}
|
|
1221
|
+
else {
|
|
1222
|
+
this.operatorWidth = '30%';
|
|
1223
|
+
this.fieldsWidth = '70%';
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
PepDateFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1227
|
+
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1228
|
+
this.operator = operator;
|
|
1229
|
+
this.operatorUnit = this.getDefaultOperatorUnit();
|
|
1230
|
+
if (this.inline) {
|
|
1231
|
+
this.setControlsWidth();
|
|
1232
|
+
}
|
|
1233
|
+
if (this._parentForm) {
|
|
1234
|
+
this.updateParentForm();
|
|
1235
|
+
}
|
|
1236
|
+
if (this.emitOnChange) {
|
|
1237
|
+
this.applyFilter();
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
PepDateFilterComponent.prototype.onTimeUnitChanged = function (value) {
|
|
1241
|
+
var operatorUnit = Object.values(PepSmartFilterOperatorUnits).find(function (operatorUnit) { return operatorUnit.id === value; });
|
|
1242
|
+
this.operatorUnit = operatorUnit;
|
|
1243
|
+
if (this._parentForm) {
|
|
1244
|
+
this.updateParentForm();
|
|
1245
|
+
}
|
|
1246
|
+
if (this.emitOnChange) {
|
|
1247
|
+
this.applyFilter();
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1250
|
+
PepDateFilterComponent.prototype.onDateValueChanged = function () {
|
|
1251
|
+
if (this.emitOnChange) {
|
|
1252
|
+
this.applyFilter();
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
return PepDateFilterComponent;
|
|
1256
|
+
}(BaseFilterComponent));
|
|
1257
|
+
PepDateFilterComponent.decorators = [
|
|
1258
|
+
{ type: core.Component, args: [{
|
|
1259
|
+
selector: 'pep-date-filter',
|
|
1260
|
+
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n</div>",
|
|
1261
|
+
styles: [""]
|
|
1262
|
+
},] }
|
|
1263
1263
|
];
|
|
1264
1264
|
|
|
1265
|
-
var PepMultiSelectFilterOption = /** @class */ (function () {
|
|
1266
|
-
function PepMultiSelectFilterOption() {
|
|
1267
|
-
this.selected = false;
|
|
1268
|
-
}
|
|
1269
|
-
return PepMultiSelectFilterOption;
|
|
1270
|
-
}());
|
|
1271
|
-
var PepMultiSelectFilterComponent = /** @class */ (function (_super) {
|
|
1272
|
-
__extends(PepMultiSelectFilterComponent, _super);
|
|
1273
|
-
function PepMultiSelectFilterComponent() {
|
|
1274
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1275
|
-
_this.options = [];
|
|
1276
|
-
_this.searchControl = new forms.FormControl();
|
|
1277
|
-
//inline props
|
|
1278
|
-
_this.selected = '';
|
|
1279
|
-
_this.inlineOptions = [];
|
|
1280
|
-
_this.MAX_OPTIONS_TO_SHOW = 6.35;
|
|
1281
|
-
_this.numberOptionsToShowSearch = 10;
|
|
1282
|
-
return _this;
|
|
1283
|
-
}
|
|
1284
|
-
PepMultiSelectFilterComponent.prototype.ngOnInit = function () {
|
|
1285
|
-
_super.prototype.ngOnInit;
|
|
1286
|
-
if (this.inline) {
|
|
1287
|
-
this.inlineControlInit();
|
|
1288
|
-
}
|
|
1289
|
-
else {
|
|
1290
|
-
this.noneInlineControlInit();
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
PepMultiSelectFilterComponent.prototype.ngAfterViewInit = function () {
|
|
1294
|
-
// Calc for the first time.
|
|
1295
|
-
this.calcOptionsHeight(this.options.length);
|
|
1296
|
-
};
|
|
1297
|
-
PepMultiSelectFilterComponent.prototype.inlineControlInit = function () {
|
|
1298
|
-
var _a, _b, _c, _d;
|
|
1299
|
-
//load options from field
|
|
1300
|
-
this.inlineOptions = ((_b = (_a = this.field) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this.field.options : [];
|
|
1301
|
-
// Init the selected values from first value.
|
|
1302
|
-
if (((_d = (_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
1303
|
-
this.selected = this.firstControl.value.join(';');
|
|
1304
|
-
}
|
|
1305
|
-
};
|
|
1306
|
-
PepMultiSelectFilterComponent.prototype.noneInlineControlInit = function () {
|
|
1307
|
-
var _this = this;
|
|
1308
|
-
var _a;
|
|
1309
|
-
if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1310
|
-
this.options = this.field.options.map(function (opt) {
|
|
1311
|
-
return { value: opt.value, count: opt.count, selected: false };
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
else {
|
|
1315
|
-
this.searchControl.disable();
|
|
1316
|
-
}
|
|
1317
|
-
// Init the selected values from first value.
|
|
1318
|
-
var firstControl = this.firstControl;
|
|
1319
|
-
if (firstControl.value) {
|
|
1320
|
-
this.initOptionsSelectedValues(firstControl.value);
|
|
1321
|
-
}
|
|
1322
|
-
// Add subscription for the first value change to set the selected options.
|
|
1323
|
-
firstControl.valueChanges
|
|
1324
|
-
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1325
|
-
.subscribe(function (selectedValues) {
|
|
1326
|
-
_this.initOptionsSelectedValues(selectedValues);
|
|
1327
|
-
});
|
|
1328
|
-
// Filter the options by the search control.
|
|
1329
|
-
this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), operators.startWith(''), operators.map(function (option) { return typeof option === 'string' ? option : option && option.value; }), operators.map(function (value) { return (value ? _this.filterOptions(value) : _this.options); }));
|
|
1330
|
-
// Each time the filter change.
|
|
1331
|
-
this.filteredOptions$.subscribe(function (filterdOptions) {
|
|
1332
|
-
_this.calcOptionsHeight(filterdOptions.length);
|
|
1333
|
-
setTimeout(function () {
|
|
1334
|
-
// 8 is the padding top of the multi-select-options
|
|
1335
|
-
_this.virtualScroller.scrollToPosition(-8);
|
|
1336
|
-
}, 125);
|
|
1337
|
-
});
|
|
1338
|
-
};
|
|
1339
|
-
PepMultiSelectFilterComponent.prototype.initOptionsSelectedValues = function (selectedValues) {
|
|
1340
|
-
this.options.forEach(function (opt) {
|
|
1341
|
-
var isValueSelected = selectedValues && selectedValues.includes(opt.value);
|
|
1342
|
-
opt.selected = isValueSelected;
|
|
1343
|
-
});
|
|
1344
|
-
};
|
|
1345
|
-
PepMultiSelectFilterComponent.prototype.calcOptionsHeight = function (optionsCount) {
|
|
1346
|
-
if (this.optionsContainer) {
|
|
1347
|
-
var optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
|
|
1348
|
-
? this.MAX_OPTIONS_TO_SHOW
|
|
1349
|
-
: optionsCount;
|
|
1350
|
-
// optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
|
|
1351
|
-
var optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
|
|
1352
|
-
this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
|
|
1353
|
-
}
|
|
1354
|
-
};
|
|
1355
|
-
PepMultiSelectFilterComponent.prototype.filterOptions = function (value) {
|
|
1356
|
-
var filterValue = value.toLowerCase();
|
|
1357
|
-
return this.options.filter(function (opt) { return opt.value &&
|
|
1358
|
-
opt.value.toLowerCase().includes(filterValue.toLowerCase()); });
|
|
1359
|
-
};
|
|
1360
|
-
// Override
|
|
1361
|
-
PepMultiSelectFilterComponent.prototype.getDefaultOperator = function () {
|
|
1362
|
-
return PepSmartFilterOperators.In;
|
|
1363
|
-
};
|
|
1364
|
-
// Override
|
|
1365
|
-
PepMultiSelectFilterComponent.prototype.getFilterValue = function () {
|
|
1366
|
-
if (this.inline) {
|
|
1367
|
-
return {
|
|
1368
|
-
first: this.firstControl.value
|
|
1369
|
-
};
|
|
1370
|
-
}
|
|
1371
|
-
else {
|
|
1372
|
-
var selectedValues = this.options
|
|
1373
|
-
.filter(function (opt) { return opt.selected; })
|
|
1374
|
-
.map(function (opt) { return opt.value; });
|
|
1375
|
-
var filterValue = {
|
|
1376
|
-
first: selectedValues,
|
|
1377
|
-
};
|
|
1378
|
-
return selectedValues.length > 0 ? filterValue : null;
|
|
1379
|
-
}
|
|
1380
|
-
};
|
|
1381
|
-
// Override
|
|
1382
|
-
PepMultiSelectFilterComponent.prototype.initFilter = function () {
|
|
1383
|
-
this.options.forEach(function (opt) { return (opt.selected = false); });
|
|
1384
|
-
this.searchControl.setValue('');
|
|
1385
|
-
};
|
|
1386
|
-
PepMultiSelectFilterComponent.prototype.onOptionChange = function (option, event) {
|
|
1387
|
-
option.selected = event.checked;
|
|
1388
|
-
this.firstControl.setValue(this.options.filter(function (opt) { return opt.selected; }).map(function (opt) { return opt.value; }), { emitEvent: false });
|
|
1389
|
-
};
|
|
1390
|
-
PepMultiSelectFilterComponent.prototype.onMultiSelectChanged = function (value) {
|
|
1391
|
-
if (value) {
|
|
1392
|
-
var selected = value.split(';');
|
|
1393
|
-
this.firstControl.setValue(selected);
|
|
1394
|
-
}
|
|
1395
|
-
else {
|
|
1396
|
-
this.firstControl.setValue(null);
|
|
1397
|
-
}
|
|
1398
|
-
if (this.emitOnChange) {
|
|
1399
|
-
this.applyFilter();
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
return PepMultiSelectFilterComponent;
|
|
1403
|
-
}(BaseFilterComponent));
|
|
1404
|
-
PepMultiSelectFilterComponent.decorators = [
|
|
1405
|
-
{ type: core.Component, args: [{
|
|
1406
|
-
selector: 'pep-multi-select-filter',
|
|
1407
|
-
template: "<ng-container *ngIf=\"inline\">\n <pep-select [key]=\"'multi1'\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>",
|
|
1408
|
-
styles: [".multi-select-options{margin:.5rem calc(.25rem * -1) 0;margin:var(--pep-spacing-sm,.5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(.5rem * -1) calc(.25rem * -1) 0;margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:.5rem .75rem;padding:var(--pep-spacing-sm,.5rem) var(--pep-spacing-md,.75rem)}.multi-select-options .flip-scroll{padding:.5rem .25rem;padding:var(--pep-spacing-sm,.5rem) var(--pep-spacing-xs,.25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll.rtl,.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;-webkit-padding-end:0;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep.mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep.mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 .25rem;margin:0 var(--pep-spacing-xs,.25rem)}"]
|
|
1409
|
-
},] }
|
|
1410
|
-
];
|
|
1411
|
-
PepMultiSelectFilterComponent.propDecorators = {
|
|
1412
|
-
optionsContainer: [{ type: core.ViewChild, args: ['optionsContainer',] }],
|
|
1413
|
-
virtualScroller: [{ type: core.ViewChild, args: [ngxVirtualScroller.VirtualScrollerComponent,] }]
|
|
1265
|
+
var PepMultiSelectFilterOption = /** @class */ (function () {
|
|
1266
|
+
function PepMultiSelectFilterOption() {
|
|
1267
|
+
this.selected = false;
|
|
1268
|
+
}
|
|
1269
|
+
return PepMultiSelectFilterOption;
|
|
1270
|
+
}());
|
|
1271
|
+
var PepMultiSelectFilterComponent = /** @class */ (function (_super) {
|
|
1272
|
+
__extends(PepMultiSelectFilterComponent, _super);
|
|
1273
|
+
function PepMultiSelectFilterComponent() {
|
|
1274
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1275
|
+
_this.options = [];
|
|
1276
|
+
_this.searchControl = new forms.FormControl();
|
|
1277
|
+
//inline props
|
|
1278
|
+
_this.selected = '';
|
|
1279
|
+
_this.inlineOptions = [];
|
|
1280
|
+
_this.MAX_OPTIONS_TO_SHOW = 6.35;
|
|
1281
|
+
_this.numberOptionsToShowSearch = 10;
|
|
1282
|
+
return _this;
|
|
1283
|
+
}
|
|
1284
|
+
PepMultiSelectFilterComponent.prototype.ngOnInit = function () {
|
|
1285
|
+
_super.prototype.ngOnInit;
|
|
1286
|
+
if (this.inline) {
|
|
1287
|
+
this.inlineControlInit();
|
|
1288
|
+
}
|
|
1289
|
+
else {
|
|
1290
|
+
this.noneInlineControlInit();
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1293
|
+
PepMultiSelectFilterComponent.prototype.ngAfterViewInit = function () {
|
|
1294
|
+
// Calc for the first time.
|
|
1295
|
+
this.calcOptionsHeight(this.options.length);
|
|
1296
|
+
};
|
|
1297
|
+
PepMultiSelectFilterComponent.prototype.inlineControlInit = function () {
|
|
1298
|
+
var _a, _b, _c, _d;
|
|
1299
|
+
//load options from field
|
|
1300
|
+
this.inlineOptions = ((_b = (_a = this.field) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this.field.options : [];
|
|
1301
|
+
// Init the selected values from first value.
|
|
1302
|
+
if (((_d = (_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.length) > 0) {
|
|
1303
|
+
this.selected = this.firstControl.value.join(';');
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
PepMultiSelectFilterComponent.prototype.noneInlineControlInit = function () {
|
|
1307
|
+
var _this = this;
|
|
1308
|
+
var _a;
|
|
1309
|
+
if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1310
|
+
this.options = this.field.options.map(function (opt) {
|
|
1311
|
+
return { value: opt.value, count: opt.count, selected: false };
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
this.searchControl.disable();
|
|
1316
|
+
}
|
|
1317
|
+
// Init the selected values from first value.
|
|
1318
|
+
var firstControl = this.firstControl;
|
|
1319
|
+
if (firstControl.value) {
|
|
1320
|
+
this.initOptionsSelectedValues(firstControl.value);
|
|
1321
|
+
}
|
|
1322
|
+
// Add subscription for the first value change to set the selected options.
|
|
1323
|
+
firstControl.valueChanges
|
|
1324
|
+
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1325
|
+
.subscribe(function (selectedValues) {
|
|
1326
|
+
_this.initOptionsSelectedValues(selectedValues);
|
|
1327
|
+
});
|
|
1328
|
+
// Filter the options by the search control.
|
|
1329
|
+
this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), operators.startWith(''), operators.map(function (option) { return typeof option === 'string' ? option : option && option.value; }), operators.map(function (value) { return (value ? _this.filterOptions(value) : _this.options); }));
|
|
1330
|
+
// Each time the filter change.
|
|
1331
|
+
this.filteredOptions$.subscribe(function (filterdOptions) {
|
|
1332
|
+
_this.calcOptionsHeight(filterdOptions.length);
|
|
1333
|
+
setTimeout(function () {
|
|
1334
|
+
// 8 is the padding top of the multi-select-options
|
|
1335
|
+
_this.virtualScroller.scrollToPosition(-8);
|
|
1336
|
+
}, 125);
|
|
1337
|
+
});
|
|
1338
|
+
};
|
|
1339
|
+
PepMultiSelectFilterComponent.prototype.initOptionsSelectedValues = function (selectedValues) {
|
|
1340
|
+
this.options.forEach(function (opt) {
|
|
1341
|
+
var isValueSelected = selectedValues && selectedValues.includes(opt.value);
|
|
1342
|
+
opt.selected = isValueSelected;
|
|
1343
|
+
});
|
|
1344
|
+
};
|
|
1345
|
+
PepMultiSelectFilterComponent.prototype.calcOptionsHeight = function (optionsCount) {
|
|
1346
|
+
if (this.optionsContainer) {
|
|
1347
|
+
var optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
|
|
1348
|
+
? this.MAX_OPTIONS_TO_SHOW
|
|
1349
|
+
: optionsCount;
|
|
1350
|
+
// optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
|
|
1351
|
+
var optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
|
|
1352
|
+
this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
PepMultiSelectFilterComponent.prototype.filterOptions = function (value) {
|
|
1356
|
+
var filterValue = value.toLowerCase();
|
|
1357
|
+
return this.options.filter(function (opt) { return opt.value &&
|
|
1358
|
+
opt.value.toLowerCase().includes(filterValue.toLowerCase()); });
|
|
1359
|
+
};
|
|
1360
|
+
// Override
|
|
1361
|
+
PepMultiSelectFilterComponent.prototype.getDefaultOperator = function () {
|
|
1362
|
+
return PepSmartFilterOperators.In;
|
|
1363
|
+
};
|
|
1364
|
+
// Override
|
|
1365
|
+
PepMultiSelectFilterComponent.prototype.getFilterValue = function () {
|
|
1366
|
+
if (this.inline) {
|
|
1367
|
+
return {
|
|
1368
|
+
first: this.firstControl.value
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
else {
|
|
1372
|
+
var selectedValues = this.options
|
|
1373
|
+
.filter(function (opt) { return opt.selected; })
|
|
1374
|
+
.map(function (opt) { return opt.value; });
|
|
1375
|
+
var filterValue = {
|
|
1376
|
+
first: selectedValues,
|
|
1377
|
+
};
|
|
1378
|
+
return selectedValues.length > 0 ? filterValue : null;
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
// Override
|
|
1382
|
+
PepMultiSelectFilterComponent.prototype.initFilter = function () {
|
|
1383
|
+
this.options.forEach(function (opt) { return (opt.selected = false); });
|
|
1384
|
+
this.searchControl.setValue('');
|
|
1385
|
+
};
|
|
1386
|
+
PepMultiSelectFilterComponent.prototype.onOptionChange = function (option, event) {
|
|
1387
|
+
option.selected = event.checked;
|
|
1388
|
+
this.firstControl.setValue(this.options.filter(function (opt) { return opt.selected; }).map(function (opt) { return opt.value; }), { emitEvent: false });
|
|
1389
|
+
};
|
|
1390
|
+
PepMultiSelectFilterComponent.prototype.onMultiSelectChanged = function (value) {
|
|
1391
|
+
if (value) {
|
|
1392
|
+
var selected = value.split(';');
|
|
1393
|
+
this.firstControl.setValue(selected);
|
|
1394
|
+
}
|
|
1395
|
+
else {
|
|
1396
|
+
this.firstControl.setValue(null);
|
|
1397
|
+
}
|
|
1398
|
+
if (this.emitOnChange) {
|
|
1399
|
+
this.applyFilter();
|
|
1400
|
+
}
|
|
1401
|
+
};
|
|
1402
|
+
return PepMultiSelectFilterComponent;
|
|
1403
|
+
}(BaseFilterComponent));
|
|
1404
|
+
PepMultiSelectFilterComponent.decorators = [
|
|
1405
|
+
{ type: core.Component, args: [{
|
|
1406
|
+
selector: 'pep-multi-select-filter',
|
|
1407
|
+
template: "<ng-container *ngIf=\"inline\">\n <pep-select [key]=\"'multi1'\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>",
|
|
1408
|
+
styles: [".multi-select-options{margin:.5rem calc(.25rem * -1) 0;margin:var(--pep-spacing-sm,.5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(.5rem * -1) calc(.25rem * -1) 0;margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:.5rem .75rem;padding:var(--pep-spacing-sm,.5rem) var(--pep-spacing-md,.75rem)}.multi-select-options .flip-scroll{padding:.5rem .25rem;padding:var(--pep-spacing-sm,.5rem) var(--pep-spacing-xs,.25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll.rtl,.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;-webkit-padding-end:0;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep.mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep.mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 .25rem;margin:0 var(--pep-spacing-xs,.25rem)}"]
|
|
1409
|
+
},] }
|
|
1410
|
+
];
|
|
1411
|
+
PepMultiSelectFilterComponent.propDecorators = {
|
|
1412
|
+
optionsContainer: [{ type: core.ViewChild, args: ['optionsContainer',] }],
|
|
1413
|
+
virtualScroller: [{ type: core.ViewChild, args: [ngxVirtualScroller.VirtualScrollerComponent,] }]
|
|
1414
1414
|
};
|
|
1415
1415
|
|
|
1416
|
-
var PepNumberFilterComponent = /** @class */ (function (_super) {
|
|
1417
|
-
__extends(PepNumberFilterComponent, _super);
|
|
1418
|
-
function PepNumberFilterComponent() {
|
|
1419
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1420
|
-
_this.PepSmartFilterOperators = PepSmartFilterOperators;
|
|
1421
|
-
_this.chooseTypeOptions = [];
|
|
1422
|
-
_this.operatorWidth = '38%';
|
|
1423
|
-
_this.fieldsWidth = '70%';
|
|
1424
|
-
return _this;
|
|
1425
|
-
}
|
|
1426
|
-
PepNumberFilterComponent.prototype.ngOnInit = function () {
|
|
1427
|
-
var _this = this;
|
|
1428
|
-
this.firstControl.valueChanges
|
|
1429
|
-
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1430
|
-
.subscribe(function () {
|
|
1431
|
-
_this.setFieldsStateAndValidators();
|
|
1432
|
-
});
|
|
1433
|
-
this.secondControl.valueChanges
|
|
1434
|
-
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1435
|
-
.subscribe(function () {
|
|
1436
|
-
_this.setFieldsStateAndValidators();
|
|
1437
|
-
});
|
|
1438
|
-
this.setControlsWidth();
|
|
1439
|
-
};
|
|
1440
|
-
// Override
|
|
1441
|
-
PepNumberFilterComponent.prototype.getDefaultOperator = function () {
|
|
1442
|
-
return PepSmartFilterOperators.Equals;
|
|
1443
|
-
};
|
|
1444
|
-
// Override
|
|
1445
|
-
PepNumberFilterComponent.prototype.getFilterValue = function () {
|
|
1446
|
-
var filterValue = {
|
|
1447
|
-
first: this.firstControl.value,
|
|
1448
|
-
};
|
|
1449
|
-
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1450
|
-
filterValue['second'] = this.secondControl.value;
|
|
1451
|
-
}
|
|
1452
|
-
return filterValue;
|
|
1453
|
-
};
|
|
1454
|
-
// Override
|
|
1455
|
-
PepNumberFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1456
|
-
var _this = this;
|
|
1457
|
-
this.chooseTypeOptions = this.operators.map(function (operator) {
|
|
1458
|
-
return {
|
|
1459
|
-
key: operator.id,
|
|
1460
|
-
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1461
|
-
};
|
|
1462
|
-
});
|
|
1463
|
-
};
|
|
1464
|
-
// Override
|
|
1465
|
-
PepNumberFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1466
|
-
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1467
|
-
var firstValidators = [forms.Validators.required];
|
|
1468
|
-
if (this.secondControl.value) {
|
|
1469
|
-
firstValidators.push(this.validator.isLessThan(this.secondControl));
|
|
1470
|
-
}
|
|
1471
|
-
this.firstControl.setValidators(firstValidators);
|
|
1472
|
-
this.secondControl.enable();
|
|
1473
|
-
var secondValidators = [forms.Validators.required];
|
|
1474
|
-
if (this.firstControl.value) {
|
|
1475
|
-
secondValidators.push(this.validator.isGreaterThan(this.firstControl));
|
|
1476
|
-
}
|
|
1477
|
-
this.secondControl.setValidators(secondValidators);
|
|
1478
|
-
}
|
|
1479
|
-
else {
|
|
1480
|
-
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
PepNumberFilterComponent.prototype.setControlsWidth = function () {
|
|
1484
|
-
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1485
|
-
this.operatorWidth = '30%';
|
|
1486
|
-
this.fieldsWidth = '70%';
|
|
1487
|
-
}
|
|
1488
|
-
else {
|
|
1489
|
-
this.operatorWidth = '38%';
|
|
1490
|
-
this.fieldsWidth = '62%';
|
|
1491
|
-
}
|
|
1492
|
-
};
|
|
1493
|
-
PepNumberFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1494
|
-
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1495
|
-
this.operator = operator;
|
|
1496
|
-
if (this._parentForm) {
|
|
1497
|
-
this.updateParentForm();
|
|
1498
|
-
}
|
|
1499
|
-
if (this.emitOnChange) {
|
|
1500
|
-
this.applyFilter();
|
|
1501
|
-
}
|
|
1502
|
-
this.setControlsWidth();
|
|
1503
|
-
};
|
|
1504
|
-
PepNumberFilterComponent.prototype.onValueChanged = function () {
|
|
1505
|
-
if (this.emitOnChange) {
|
|
1506
|
-
this.applyFilter();
|
|
1507
|
-
}
|
|
1508
|
-
};
|
|
1509
|
-
return PepNumberFilterComponent;
|
|
1510
|
-
}(BaseFilterComponent));
|
|
1511
|
-
PepNumberFilterComponent.decorators = [
|
|
1512
|
-
{ type: core.Component, args: [{
|
|
1513
|
-
selector: 'pep-number-filter',
|
|
1514
|
-
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator !== PepSmartFilterOperators.NumberRange\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n <div *ngIf=\"operator === PepSmartFilterOperators.NumberRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n</div>",
|
|
1515
|
-
styles: [""]
|
|
1516
|
-
},] }
|
|
1416
|
+
var PepNumberFilterComponent = /** @class */ (function (_super) {
|
|
1417
|
+
__extends(PepNumberFilterComponent, _super);
|
|
1418
|
+
function PepNumberFilterComponent() {
|
|
1419
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1420
|
+
_this.PepSmartFilterOperators = PepSmartFilterOperators;
|
|
1421
|
+
_this.chooseTypeOptions = [];
|
|
1422
|
+
_this.operatorWidth = '38%';
|
|
1423
|
+
_this.fieldsWidth = '70%';
|
|
1424
|
+
return _this;
|
|
1425
|
+
}
|
|
1426
|
+
PepNumberFilterComponent.prototype.ngOnInit = function () {
|
|
1427
|
+
var _this = this;
|
|
1428
|
+
this.firstControl.valueChanges
|
|
1429
|
+
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1430
|
+
.subscribe(function () {
|
|
1431
|
+
_this.setFieldsStateAndValidators();
|
|
1432
|
+
});
|
|
1433
|
+
this.secondControl.valueChanges
|
|
1434
|
+
.pipe(this.getDestroyer(), operators.distinctUntilChanged())
|
|
1435
|
+
.subscribe(function () {
|
|
1436
|
+
_this.setFieldsStateAndValidators();
|
|
1437
|
+
});
|
|
1438
|
+
this.setControlsWidth();
|
|
1439
|
+
};
|
|
1440
|
+
// Override
|
|
1441
|
+
PepNumberFilterComponent.prototype.getDefaultOperator = function () {
|
|
1442
|
+
return PepSmartFilterOperators.Equals;
|
|
1443
|
+
};
|
|
1444
|
+
// Override
|
|
1445
|
+
PepNumberFilterComponent.prototype.getFilterValue = function () {
|
|
1446
|
+
var filterValue = {
|
|
1447
|
+
first: this.firstControl.value,
|
|
1448
|
+
};
|
|
1449
|
+
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1450
|
+
filterValue['second'] = this.secondControl.value;
|
|
1451
|
+
}
|
|
1452
|
+
return filterValue;
|
|
1453
|
+
};
|
|
1454
|
+
// Override
|
|
1455
|
+
PepNumberFilterComponent.prototype.loadOperatorsOptions = function () {
|
|
1456
|
+
var _this = this;
|
|
1457
|
+
this.chooseTypeOptions = this.operators.map(function (operator) {
|
|
1458
|
+
return {
|
|
1459
|
+
key: operator.id,
|
|
1460
|
+
value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
|
|
1461
|
+
};
|
|
1462
|
+
});
|
|
1463
|
+
};
|
|
1464
|
+
// Override
|
|
1465
|
+
PepNumberFilterComponent.prototype.setFieldsStateAndValidators = function () {
|
|
1466
|
+
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1467
|
+
var firstValidators = [forms.Validators.required];
|
|
1468
|
+
if (this.secondControl.value) {
|
|
1469
|
+
firstValidators.push(this.validator.isLessThan(this.secondControl));
|
|
1470
|
+
}
|
|
1471
|
+
this.firstControl.setValidators(firstValidators);
|
|
1472
|
+
this.secondControl.enable();
|
|
1473
|
+
var secondValidators = [forms.Validators.required];
|
|
1474
|
+
if (this.firstControl.value) {
|
|
1475
|
+
secondValidators.push(this.validator.isGreaterThan(this.firstControl));
|
|
1476
|
+
}
|
|
1477
|
+
this.secondControl.setValidators(secondValidators);
|
|
1478
|
+
}
|
|
1479
|
+
else {
|
|
1480
|
+
_super.prototype.setFieldsStateAndValidators.call(this);
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
PepNumberFilterComponent.prototype.setControlsWidth = function () {
|
|
1484
|
+
if (this.operator === PepSmartFilterOperators.NumberRange) {
|
|
1485
|
+
this.operatorWidth = '30%';
|
|
1486
|
+
this.fieldsWidth = '70%';
|
|
1487
|
+
}
|
|
1488
|
+
else {
|
|
1489
|
+
this.operatorWidth = '38%';
|
|
1490
|
+
this.fieldsWidth = '62%';
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
PepNumberFilterComponent.prototype.onOperatorChanged = function (value) {
|
|
1494
|
+
var operator = Object.values(PepSmartFilterOperators).find(function (operator) { return operator.id === value; });
|
|
1495
|
+
this.operator = operator;
|
|
1496
|
+
if (this._parentForm) {
|
|
1497
|
+
this.updateParentForm();
|
|
1498
|
+
}
|
|
1499
|
+
if (this.emitOnChange) {
|
|
1500
|
+
this.applyFilter();
|
|
1501
|
+
}
|
|
1502
|
+
this.setControlsWidth();
|
|
1503
|
+
};
|
|
1504
|
+
PepNumberFilterComponent.prototype.onValueChanged = function () {
|
|
1505
|
+
if (this.emitOnChange) {
|
|
1506
|
+
this.applyFilter();
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
return PepNumberFilterComponent;
|
|
1510
|
+
}(BaseFilterComponent));
|
|
1511
|
+
PepNumberFilterComponent.decorators = [
|
|
1512
|
+
{ type: core.Component, args: [{
|
|
1513
|
+
selector: 'pep-number-filter',
|
|
1514
|
+
template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator !== PepSmartFilterOperators.NumberRange\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n <div *ngIf=\"operator === PepSmartFilterOperators.NumberRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n</div>",
|
|
1515
|
+
styles: [""]
|
|
1516
|
+
},] }
|
|
1517
1517
|
];
|
|
1518
1518
|
|
|
1519
|
-
var PepSmartFiltersModule = /** @class */ (function () {
|
|
1520
|
-
function PepSmartFiltersModule(pepIconRegistry) {
|
|
1521
|
-
this.pepIconRegistry = pepIconRegistry;
|
|
1522
|
-
this.pepIconRegistry.registerIcons([
|
|
1523
|
-
icon.pepIconNumberMinus,
|
|
1524
|
-
icon.pepIconNumberPlus,
|
|
1525
|
-
]);
|
|
1526
|
-
}
|
|
1527
|
-
return PepSmartFiltersModule;
|
|
1528
|
-
}());
|
|
1529
|
-
PepSmartFiltersModule.decorators = [
|
|
1530
|
-
{ type: core.NgModule, args: [{
|
|
1531
|
-
imports: [
|
|
1532
|
-
common.CommonModule,
|
|
1533
|
-
forms.ReactiveFormsModule,
|
|
1534
|
-
flexLayout.FlexLayoutModule,
|
|
1535
|
-
// Material modules
|
|
1536
|
-
core$2.MatCommonModule,
|
|
1537
|
-
checkbox.MatCheckboxModule,
|
|
1538
|
-
chips.MatChipsModule,
|
|
1539
|
-
expansion.MatExpansionModule,
|
|
1540
|
-
icon$1.MatIconModule,
|
|
1541
|
-
formField.MatFormFieldModule,
|
|
1542
|
-
input.MatInputModule,
|
|
1543
|
-
radio.MatRadioModule,
|
|
1544
|
-
// External modules
|
|
1545
|
-
ngxVirtualScroller.VirtualScrollerModule,
|
|
1546
|
-
// ngx-lib modules
|
|
1547
|
-
ngxLib.PepNgxLibModule,
|
|
1548
|
-
checkbox$1.PepCheckboxModule,
|
|
1549
|
-
date.PepDateModule,
|
|
1550
|
-
select.PepSelectModule,
|
|
1551
|
-
textbox.PepTextboxModule,
|
|
1552
|
-
search.PepSearchModule,
|
|
1553
|
-
icon.PepIconModule,
|
|
1554
|
-
button.PepButtonModule,
|
|
1555
|
-
groupButtons.PepGroupButtonsModule
|
|
1556
|
-
],
|
|
1557
|
-
exports: [
|
|
1558
|
-
PepSmartFiltersComponent,
|
|
1559
|
-
PepTextFilterComponent,
|
|
1560
|
-
PepBooleanFilterComponent,
|
|
1561
|
-
PepDateFilterComponent,
|
|
1562
|
-
PepMultiSelectFilterComponent,
|
|
1563
|
-
PepNumberFilterComponent
|
|
1564
|
-
],
|
|
1565
|
-
declarations: [
|
|
1566
|
-
// BaseFilterComponent,
|
|
1567
|
-
PepSmartFiltersComponent,
|
|
1568
|
-
PepFilterActionsComponent,
|
|
1569
|
-
PepTextFilterComponent,
|
|
1570
|
-
PepBooleanFilterComponent,
|
|
1571
|
-
PepDateFilterComponent,
|
|
1572
|
-
PepMultiSelectFilterComponent,
|
|
1573
|
-
PepNumberFilterComponent
|
|
1574
|
-
],
|
|
1575
|
-
},] }
|
|
1576
|
-
];
|
|
1577
|
-
PepSmartFiltersModule.ctorParameters = function () { return [
|
|
1578
|
-
{ type: icon.PepIconRegistry }
|
|
1519
|
+
var PepSmartFiltersModule = /** @class */ (function () {
|
|
1520
|
+
function PepSmartFiltersModule(pepIconRegistry) {
|
|
1521
|
+
this.pepIconRegistry = pepIconRegistry;
|
|
1522
|
+
this.pepIconRegistry.registerIcons([
|
|
1523
|
+
icon.pepIconNumberMinus,
|
|
1524
|
+
icon.pepIconNumberPlus,
|
|
1525
|
+
]);
|
|
1526
|
+
}
|
|
1527
|
+
return PepSmartFiltersModule;
|
|
1528
|
+
}());
|
|
1529
|
+
PepSmartFiltersModule.decorators = [
|
|
1530
|
+
{ type: core.NgModule, args: [{
|
|
1531
|
+
imports: [
|
|
1532
|
+
common.CommonModule,
|
|
1533
|
+
forms.ReactiveFormsModule,
|
|
1534
|
+
flexLayout.FlexLayoutModule,
|
|
1535
|
+
// Material modules
|
|
1536
|
+
core$2.MatCommonModule,
|
|
1537
|
+
checkbox.MatCheckboxModule,
|
|
1538
|
+
chips.MatChipsModule,
|
|
1539
|
+
expansion.MatExpansionModule,
|
|
1540
|
+
icon$1.MatIconModule,
|
|
1541
|
+
formField.MatFormFieldModule,
|
|
1542
|
+
input.MatInputModule,
|
|
1543
|
+
radio.MatRadioModule,
|
|
1544
|
+
// External modules
|
|
1545
|
+
ngxVirtualScroller.VirtualScrollerModule,
|
|
1546
|
+
// ngx-lib modules
|
|
1547
|
+
ngxLib.PepNgxLibModule,
|
|
1548
|
+
checkbox$1.PepCheckboxModule,
|
|
1549
|
+
date.PepDateModule,
|
|
1550
|
+
select.PepSelectModule,
|
|
1551
|
+
textbox.PepTextboxModule,
|
|
1552
|
+
search.PepSearchModule,
|
|
1553
|
+
icon.PepIconModule,
|
|
1554
|
+
button.PepButtonModule,
|
|
1555
|
+
groupButtons.PepGroupButtonsModule
|
|
1556
|
+
],
|
|
1557
|
+
exports: [
|
|
1558
|
+
PepSmartFiltersComponent,
|
|
1559
|
+
PepTextFilterComponent,
|
|
1560
|
+
PepBooleanFilterComponent,
|
|
1561
|
+
PepDateFilterComponent,
|
|
1562
|
+
PepMultiSelectFilterComponent,
|
|
1563
|
+
PepNumberFilterComponent
|
|
1564
|
+
],
|
|
1565
|
+
declarations: [
|
|
1566
|
+
// BaseFilterComponent,
|
|
1567
|
+
PepSmartFiltersComponent,
|
|
1568
|
+
PepFilterActionsComponent,
|
|
1569
|
+
PepTextFilterComponent,
|
|
1570
|
+
PepBooleanFilterComponent,
|
|
1571
|
+
PepDateFilterComponent,
|
|
1572
|
+
PepMultiSelectFilterComponent,
|
|
1573
|
+
PepNumberFilterComponent
|
|
1574
|
+
],
|
|
1575
|
+
},] }
|
|
1576
|
+
];
|
|
1577
|
+
PepSmartFiltersModule.ctorParameters = function () { return [
|
|
1578
|
+
{ type: icon.PepIconRegistry }
|
|
1579
1579
|
]; };
|
|
1580
1580
|
|
|
1581
|
-
// Base field
|
|
1582
|
-
// ------------------------------
|
|
1583
|
-
var PepSmartFilterBaseField = /** @class */ (function () {
|
|
1584
|
-
function PepSmartFilterBaseField(field) {
|
|
1585
|
-
this.id = field.id;
|
|
1586
|
-
this.name = field.name;
|
|
1587
|
-
this.isOpen = field.isOpen;
|
|
1588
|
-
this.options = field.options;
|
|
1589
|
-
this.operators = field.operators;
|
|
1590
|
-
this.operatorUnits = field.operatorUnits;
|
|
1591
|
-
this._type = this.getType();
|
|
1592
|
-
}
|
|
1593
|
-
Object.defineProperty(PepSmartFilterBaseField.prototype, "componentType", {
|
|
1594
|
-
get: function () {
|
|
1595
|
-
return this._componentType;
|
|
1596
|
-
},
|
|
1597
|
-
enumerable: false,
|
|
1598
|
-
configurable: true
|
|
1599
|
-
});
|
|
1600
|
-
Object.defineProperty(PepSmartFilterBaseField.prototype, "type", {
|
|
1601
|
-
get: function () {
|
|
1602
|
-
return this._type;
|
|
1603
|
-
},
|
|
1604
|
-
enumerable: false,
|
|
1605
|
-
configurable: true
|
|
1606
|
-
});
|
|
1607
|
-
return PepSmartFilterBaseField;
|
|
1608
|
-
}());
|
|
1609
|
-
// Text field
|
|
1610
|
-
// ------------------------------
|
|
1611
|
-
var PepSmartFilterTextField = /** @class */ (function (_super) {
|
|
1612
|
-
__extends(PepSmartFilterTextField, _super);
|
|
1613
|
-
function PepSmartFilterTextField(field) {
|
|
1614
|
-
var _this = _super.call(this, field) || this;
|
|
1615
|
-
_this._componentType = 'text';
|
|
1616
|
-
return _this;
|
|
1617
|
-
}
|
|
1618
|
-
PepSmartFilterTextField.prototype.getType = function () {
|
|
1619
|
-
return 'text';
|
|
1620
|
-
};
|
|
1621
|
-
return PepSmartFilterTextField;
|
|
1622
|
-
}(PepSmartFilterBaseField));
|
|
1623
|
-
// Boolean field
|
|
1624
|
-
// ------------------------------
|
|
1625
|
-
var PepSmartFilterBooleanField = /** @class */ (function (_super) {
|
|
1626
|
-
__extends(PepSmartFilterBooleanField, _super);
|
|
1627
|
-
function PepSmartFilterBooleanField(field) {
|
|
1628
|
-
var _this = _super.call(this, field) || this;
|
|
1629
|
-
_this._componentType = 'boolean';
|
|
1630
|
-
return _this;
|
|
1631
|
-
}
|
|
1632
|
-
PepSmartFilterBooleanField.prototype.getType = function () {
|
|
1633
|
-
return 'boolean';
|
|
1634
|
-
};
|
|
1635
|
-
return PepSmartFilterBooleanField;
|
|
1636
|
-
}(PepSmartFilterBaseField));
|
|
1637
|
-
// Date fields
|
|
1638
|
-
// ------------------------------
|
|
1639
|
-
var PepSmartFilterDateBaseField = /** @class */ (function (_super) {
|
|
1640
|
-
__extends(PepSmartFilterDateBaseField, _super);
|
|
1641
|
-
function PepSmartFilterDateBaseField(field) {
|
|
1642
|
-
var _this = _super.call(this, field) || this;
|
|
1643
|
-
_this._componentType = 'date';
|
|
1644
|
-
return _this;
|
|
1645
|
-
}
|
|
1646
|
-
return PepSmartFilterDateBaseField;
|
|
1647
|
-
}(PepSmartFilterBaseField));
|
|
1648
|
-
var PepSmartFilterDateField = /** @class */ (function (_super) {
|
|
1649
|
-
__extends(PepSmartFilterDateField, _super);
|
|
1650
|
-
function PepSmartFilterDateField(field) {
|
|
1651
|
-
return _super.call(this, field) || this;
|
|
1652
|
-
}
|
|
1653
|
-
PepSmartFilterDateField.prototype.getType = function () {
|
|
1654
|
-
return 'date';
|
|
1655
|
-
};
|
|
1656
|
-
return PepSmartFilterDateField;
|
|
1657
|
-
}(PepSmartFilterDateBaseField));
|
|
1658
|
-
var PepSmartFilterDateTimeField = /** @class */ (function (_super) {
|
|
1659
|
-
__extends(PepSmartFilterDateTimeField, _super);
|
|
1660
|
-
function PepSmartFilterDateTimeField(field) {
|
|
1661
|
-
return _super.call(this, field) || this;
|
|
1662
|
-
}
|
|
1663
|
-
PepSmartFilterDateTimeField.prototype.getType = function () {
|
|
1664
|
-
return 'date-time';
|
|
1665
|
-
};
|
|
1666
|
-
return PepSmartFilterDateTimeField;
|
|
1667
|
-
}(PepSmartFilterDateBaseField));
|
|
1668
|
-
// Multi select field
|
|
1669
|
-
// ------------------------------
|
|
1670
|
-
var PepSmartFilterMultiSelectField = /** @class */ (function (_super) {
|
|
1671
|
-
__extends(PepSmartFilterMultiSelectField, _super);
|
|
1672
|
-
function PepSmartFilterMultiSelectField(field) {
|
|
1673
|
-
var _this = _super.call(this, field) || this;
|
|
1674
|
-
_this._componentType = 'multi-select';
|
|
1675
|
-
return _this;
|
|
1676
|
-
}
|
|
1677
|
-
PepSmartFilterMultiSelectField.prototype.getType = function () {
|
|
1678
|
-
return 'multi-select';
|
|
1679
|
-
};
|
|
1680
|
-
return PepSmartFilterMultiSelectField;
|
|
1681
|
-
}(PepSmartFilterBaseField));
|
|
1682
|
-
// Number fields
|
|
1683
|
-
// ------------------------------
|
|
1684
|
-
var PepSmartFilterNumberBaseField = /** @class */ (function (_super) {
|
|
1685
|
-
__extends(PepSmartFilterNumberBaseField, _super);
|
|
1686
|
-
function PepSmartFilterNumberBaseField(field) {
|
|
1687
|
-
var _this = _super.call(this, field) || this;
|
|
1688
|
-
_this._componentType = 'number';
|
|
1689
|
-
return _this;
|
|
1690
|
-
}
|
|
1691
|
-
return PepSmartFilterNumberBaseField;
|
|
1692
|
-
}(PepSmartFilterBaseField));
|
|
1693
|
-
var PepSmartFilterIntField = /** @class */ (function (_super) {
|
|
1694
|
-
__extends(PepSmartFilterIntField, _super);
|
|
1695
|
-
function PepSmartFilterIntField(field) {
|
|
1696
|
-
return _super.call(this, field) || this;
|
|
1697
|
-
}
|
|
1698
|
-
PepSmartFilterIntField.prototype.getType = function () {
|
|
1699
|
-
return 'int';
|
|
1700
|
-
};
|
|
1701
|
-
return PepSmartFilterIntField;
|
|
1702
|
-
}(PepSmartFilterNumberBaseField));
|
|
1703
|
-
var PepSmartFilterRealField = /** @class */ (function (_super) {
|
|
1704
|
-
__extends(PepSmartFilterRealField, _super);
|
|
1705
|
-
function PepSmartFilterRealField(field) {
|
|
1706
|
-
return _super.call(this, field) || this;
|
|
1707
|
-
}
|
|
1708
|
-
PepSmartFilterRealField.prototype.getType = function () {
|
|
1709
|
-
return 'real';
|
|
1710
|
-
};
|
|
1711
|
-
return PepSmartFilterRealField;
|
|
1712
|
-
}(PepSmartFilterNumberBaseField));
|
|
1713
|
-
var PepSmartFilterCurrencyField = /** @class */ (function (_super) {
|
|
1714
|
-
__extends(PepSmartFilterCurrencyField, _super);
|
|
1715
|
-
function PepSmartFilterCurrencyField(field) {
|
|
1716
|
-
return _super.call(this, field) || this;
|
|
1717
|
-
}
|
|
1718
|
-
PepSmartFilterCurrencyField.prototype.getType = function () {
|
|
1719
|
-
return 'currency';
|
|
1720
|
-
};
|
|
1721
|
-
return PepSmartFilterCurrencyField;
|
|
1722
|
-
}(PepSmartFilterNumberBaseField));
|
|
1723
|
-
var PepSmartFilterPercentageField = /** @class */ (function (_super) {
|
|
1724
|
-
__extends(PepSmartFilterPercentageField, _super);
|
|
1725
|
-
function PepSmartFilterPercentageField(field) {
|
|
1726
|
-
return _super.call(this, field) || this;
|
|
1727
|
-
}
|
|
1728
|
-
PepSmartFilterPercentageField.prototype.getType = function () {
|
|
1729
|
-
return 'percentage';
|
|
1730
|
-
};
|
|
1731
|
-
return PepSmartFilterPercentageField;
|
|
1581
|
+
// Base field
|
|
1582
|
+
// ------------------------------
|
|
1583
|
+
var PepSmartFilterBaseField = /** @class */ (function () {
|
|
1584
|
+
function PepSmartFilterBaseField(field) {
|
|
1585
|
+
this.id = field.id;
|
|
1586
|
+
this.name = field.name;
|
|
1587
|
+
this.isOpen = field.isOpen;
|
|
1588
|
+
this.options = field.options;
|
|
1589
|
+
this.operators = field.operators;
|
|
1590
|
+
this.operatorUnits = field.operatorUnits;
|
|
1591
|
+
this._type = this.getType();
|
|
1592
|
+
}
|
|
1593
|
+
Object.defineProperty(PepSmartFilterBaseField.prototype, "componentType", {
|
|
1594
|
+
get: function () {
|
|
1595
|
+
return this._componentType;
|
|
1596
|
+
},
|
|
1597
|
+
enumerable: false,
|
|
1598
|
+
configurable: true
|
|
1599
|
+
});
|
|
1600
|
+
Object.defineProperty(PepSmartFilterBaseField.prototype, "type", {
|
|
1601
|
+
get: function () {
|
|
1602
|
+
return this._type;
|
|
1603
|
+
},
|
|
1604
|
+
enumerable: false,
|
|
1605
|
+
configurable: true
|
|
1606
|
+
});
|
|
1607
|
+
return PepSmartFilterBaseField;
|
|
1608
|
+
}());
|
|
1609
|
+
// Text field
|
|
1610
|
+
// ------------------------------
|
|
1611
|
+
var PepSmartFilterTextField = /** @class */ (function (_super) {
|
|
1612
|
+
__extends(PepSmartFilterTextField, _super);
|
|
1613
|
+
function PepSmartFilterTextField(field) {
|
|
1614
|
+
var _this = _super.call(this, field) || this;
|
|
1615
|
+
_this._componentType = 'text';
|
|
1616
|
+
return _this;
|
|
1617
|
+
}
|
|
1618
|
+
PepSmartFilterTextField.prototype.getType = function () {
|
|
1619
|
+
return 'text';
|
|
1620
|
+
};
|
|
1621
|
+
return PepSmartFilterTextField;
|
|
1622
|
+
}(PepSmartFilterBaseField));
|
|
1623
|
+
// Boolean field
|
|
1624
|
+
// ------------------------------
|
|
1625
|
+
var PepSmartFilterBooleanField = /** @class */ (function (_super) {
|
|
1626
|
+
__extends(PepSmartFilterBooleanField, _super);
|
|
1627
|
+
function PepSmartFilterBooleanField(field) {
|
|
1628
|
+
var _this = _super.call(this, field) || this;
|
|
1629
|
+
_this._componentType = 'boolean';
|
|
1630
|
+
return _this;
|
|
1631
|
+
}
|
|
1632
|
+
PepSmartFilterBooleanField.prototype.getType = function () {
|
|
1633
|
+
return 'boolean';
|
|
1634
|
+
};
|
|
1635
|
+
return PepSmartFilterBooleanField;
|
|
1636
|
+
}(PepSmartFilterBaseField));
|
|
1637
|
+
// Date fields
|
|
1638
|
+
// ------------------------------
|
|
1639
|
+
var PepSmartFilterDateBaseField = /** @class */ (function (_super) {
|
|
1640
|
+
__extends(PepSmartFilterDateBaseField, _super);
|
|
1641
|
+
function PepSmartFilterDateBaseField(field) {
|
|
1642
|
+
var _this = _super.call(this, field) || this;
|
|
1643
|
+
_this._componentType = 'date';
|
|
1644
|
+
return _this;
|
|
1645
|
+
}
|
|
1646
|
+
return PepSmartFilterDateBaseField;
|
|
1647
|
+
}(PepSmartFilterBaseField));
|
|
1648
|
+
var PepSmartFilterDateField = /** @class */ (function (_super) {
|
|
1649
|
+
__extends(PepSmartFilterDateField, _super);
|
|
1650
|
+
function PepSmartFilterDateField(field) {
|
|
1651
|
+
return _super.call(this, field) || this;
|
|
1652
|
+
}
|
|
1653
|
+
PepSmartFilterDateField.prototype.getType = function () {
|
|
1654
|
+
return 'date';
|
|
1655
|
+
};
|
|
1656
|
+
return PepSmartFilterDateField;
|
|
1657
|
+
}(PepSmartFilterDateBaseField));
|
|
1658
|
+
var PepSmartFilterDateTimeField = /** @class */ (function (_super) {
|
|
1659
|
+
__extends(PepSmartFilterDateTimeField, _super);
|
|
1660
|
+
function PepSmartFilterDateTimeField(field) {
|
|
1661
|
+
return _super.call(this, field) || this;
|
|
1662
|
+
}
|
|
1663
|
+
PepSmartFilterDateTimeField.prototype.getType = function () {
|
|
1664
|
+
return 'date-time';
|
|
1665
|
+
};
|
|
1666
|
+
return PepSmartFilterDateTimeField;
|
|
1667
|
+
}(PepSmartFilterDateBaseField));
|
|
1668
|
+
// Multi select field
|
|
1669
|
+
// ------------------------------
|
|
1670
|
+
var PepSmartFilterMultiSelectField = /** @class */ (function (_super) {
|
|
1671
|
+
__extends(PepSmartFilterMultiSelectField, _super);
|
|
1672
|
+
function PepSmartFilterMultiSelectField(field) {
|
|
1673
|
+
var _this = _super.call(this, field) || this;
|
|
1674
|
+
_this._componentType = 'multi-select';
|
|
1675
|
+
return _this;
|
|
1676
|
+
}
|
|
1677
|
+
PepSmartFilterMultiSelectField.prototype.getType = function () {
|
|
1678
|
+
return 'multi-select';
|
|
1679
|
+
};
|
|
1680
|
+
return PepSmartFilterMultiSelectField;
|
|
1681
|
+
}(PepSmartFilterBaseField));
|
|
1682
|
+
// Number fields
|
|
1683
|
+
// ------------------------------
|
|
1684
|
+
var PepSmartFilterNumberBaseField = /** @class */ (function (_super) {
|
|
1685
|
+
__extends(PepSmartFilterNumberBaseField, _super);
|
|
1686
|
+
function PepSmartFilterNumberBaseField(field) {
|
|
1687
|
+
var _this = _super.call(this, field) || this;
|
|
1688
|
+
_this._componentType = 'number';
|
|
1689
|
+
return _this;
|
|
1690
|
+
}
|
|
1691
|
+
return PepSmartFilterNumberBaseField;
|
|
1692
|
+
}(PepSmartFilterBaseField));
|
|
1693
|
+
var PepSmartFilterIntField = /** @class */ (function (_super) {
|
|
1694
|
+
__extends(PepSmartFilterIntField, _super);
|
|
1695
|
+
function PepSmartFilterIntField(field) {
|
|
1696
|
+
return _super.call(this, field) || this;
|
|
1697
|
+
}
|
|
1698
|
+
PepSmartFilterIntField.prototype.getType = function () {
|
|
1699
|
+
return 'int';
|
|
1700
|
+
};
|
|
1701
|
+
return PepSmartFilterIntField;
|
|
1702
|
+
}(PepSmartFilterNumberBaseField));
|
|
1703
|
+
var PepSmartFilterRealField = /** @class */ (function (_super) {
|
|
1704
|
+
__extends(PepSmartFilterRealField, _super);
|
|
1705
|
+
function PepSmartFilterRealField(field) {
|
|
1706
|
+
return _super.call(this, field) || this;
|
|
1707
|
+
}
|
|
1708
|
+
PepSmartFilterRealField.prototype.getType = function () {
|
|
1709
|
+
return 'real';
|
|
1710
|
+
};
|
|
1711
|
+
return PepSmartFilterRealField;
|
|
1712
|
+
}(PepSmartFilterNumberBaseField));
|
|
1713
|
+
var PepSmartFilterCurrencyField = /** @class */ (function (_super) {
|
|
1714
|
+
__extends(PepSmartFilterCurrencyField, _super);
|
|
1715
|
+
function PepSmartFilterCurrencyField(field) {
|
|
1716
|
+
return _super.call(this, field) || this;
|
|
1717
|
+
}
|
|
1718
|
+
PepSmartFilterCurrencyField.prototype.getType = function () {
|
|
1719
|
+
return 'currency';
|
|
1720
|
+
};
|
|
1721
|
+
return PepSmartFilterCurrencyField;
|
|
1722
|
+
}(PepSmartFilterNumberBaseField));
|
|
1723
|
+
var PepSmartFilterPercentageField = /** @class */ (function (_super) {
|
|
1724
|
+
__extends(PepSmartFilterPercentageField, _super);
|
|
1725
|
+
function PepSmartFilterPercentageField(field) {
|
|
1726
|
+
return _super.call(this, field) || this;
|
|
1727
|
+
}
|
|
1728
|
+
PepSmartFilterPercentageField.prototype.getType = function () {
|
|
1729
|
+
return 'percentage';
|
|
1730
|
+
};
|
|
1731
|
+
return PepSmartFilterPercentageField;
|
|
1732
1732
|
}(PepSmartFilterNumberBaseField));
|
|
1733
1733
|
|
|
1734
|
-
function createTextSmartFilterField(data) {
|
|
1735
|
-
return new PepSmartFilterTextField(data);
|
|
1736
|
-
}
|
|
1737
|
-
function createBooleanSmartFilterField(data) {
|
|
1738
|
-
return new PepSmartFilterBooleanField(data);
|
|
1739
|
-
}
|
|
1740
|
-
function createDateSmartFilterField(data) {
|
|
1741
|
-
return new PepSmartFilterDateField(data);
|
|
1742
|
-
}
|
|
1743
|
-
function createDateTimeSmartFilterField(data) {
|
|
1744
|
-
return new PepSmartFilterDateTimeField(data);
|
|
1745
|
-
}
|
|
1746
|
-
function createMultiSelectSmartFilterField(data) {
|
|
1747
|
-
return new PepSmartFilterMultiSelectField(data);
|
|
1748
|
-
}
|
|
1749
|
-
function createIntSmartFilterField(data) {
|
|
1750
|
-
return new PepSmartFilterIntField(data);
|
|
1751
|
-
}
|
|
1752
|
-
function createRealSmartFilterField(data) {
|
|
1753
|
-
return new PepSmartFilterRealField(data);
|
|
1754
|
-
}
|
|
1755
|
-
function createCurrencySmartFilterField(data) {
|
|
1756
|
-
return new PepSmartFilterCurrencyField(data);
|
|
1757
|
-
}
|
|
1758
|
-
function createPercentageSmartFilterField(data) {
|
|
1759
|
-
return new PepSmartFilterPercentageField(data);
|
|
1760
|
-
}
|
|
1761
|
-
function createSmartFilterField(data, type) {
|
|
1762
|
-
var field;
|
|
1763
|
-
switch (type) {
|
|
1764
|
-
case 'text':
|
|
1765
|
-
field = createTextSmartFilterField(data);
|
|
1766
|
-
break;
|
|
1767
|
-
case 'boolean':
|
|
1768
|
-
field = createBooleanSmartFilterField(data);
|
|
1769
|
-
break;
|
|
1770
|
-
case 'date':
|
|
1771
|
-
field = createDateSmartFilterField(data);
|
|
1772
|
-
break;
|
|
1773
|
-
case 'date-time':
|
|
1774
|
-
field = createDateTimeSmartFilterField(data);
|
|
1775
|
-
break;
|
|
1776
|
-
case 'multi-select':
|
|
1777
|
-
field = createMultiSelectSmartFilterField(data);
|
|
1778
|
-
break;
|
|
1779
|
-
case 'int':
|
|
1780
|
-
field = createIntSmartFilterField(data);
|
|
1781
|
-
break;
|
|
1782
|
-
case 'real':
|
|
1783
|
-
field = createRealSmartFilterField(data);
|
|
1784
|
-
break;
|
|
1785
|
-
case 'currency':
|
|
1786
|
-
field = createCurrencySmartFilterField(data);
|
|
1787
|
-
break;
|
|
1788
|
-
case 'percentage':
|
|
1789
|
-
field = createPercentageSmartFilterField(data);
|
|
1790
|
-
break;
|
|
1791
|
-
default:
|
|
1792
|
-
field = createMultiSelectSmartFilterField(data);
|
|
1793
|
-
break;
|
|
1794
|
-
}
|
|
1795
|
-
return field;
|
|
1796
|
-
}
|
|
1797
|
-
function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
|
|
1798
|
-
return {
|
|
1799
|
-
fieldId: fieldId,
|
|
1800
|
-
operator: operator,
|
|
1801
|
-
operatorUnit: operatorUnit,
|
|
1802
|
-
value: {
|
|
1803
|
-
first: first,
|
|
1804
|
-
second: second,
|
|
1805
|
-
},
|
|
1806
|
-
};
|
|
1734
|
+
function createTextSmartFilterField(data) {
|
|
1735
|
+
return new PepSmartFilterTextField(data);
|
|
1736
|
+
}
|
|
1737
|
+
function createBooleanSmartFilterField(data) {
|
|
1738
|
+
return new PepSmartFilterBooleanField(data);
|
|
1739
|
+
}
|
|
1740
|
+
function createDateSmartFilterField(data) {
|
|
1741
|
+
return new PepSmartFilterDateField(data);
|
|
1742
|
+
}
|
|
1743
|
+
function createDateTimeSmartFilterField(data) {
|
|
1744
|
+
return new PepSmartFilterDateTimeField(data);
|
|
1745
|
+
}
|
|
1746
|
+
function createMultiSelectSmartFilterField(data) {
|
|
1747
|
+
return new PepSmartFilterMultiSelectField(data);
|
|
1748
|
+
}
|
|
1749
|
+
function createIntSmartFilterField(data) {
|
|
1750
|
+
return new PepSmartFilterIntField(data);
|
|
1751
|
+
}
|
|
1752
|
+
function createRealSmartFilterField(data) {
|
|
1753
|
+
return new PepSmartFilterRealField(data);
|
|
1754
|
+
}
|
|
1755
|
+
function createCurrencySmartFilterField(data) {
|
|
1756
|
+
return new PepSmartFilterCurrencyField(data);
|
|
1757
|
+
}
|
|
1758
|
+
function createPercentageSmartFilterField(data) {
|
|
1759
|
+
return new PepSmartFilterPercentageField(data);
|
|
1760
|
+
}
|
|
1761
|
+
function createSmartFilterField(data, type) {
|
|
1762
|
+
var field;
|
|
1763
|
+
switch (type) {
|
|
1764
|
+
case 'text':
|
|
1765
|
+
field = createTextSmartFilterField(data);
|
|
1766
|
+
break;
|
|
1767
|
+
case 'boolean':
|
|
1768
|
+
field = createBooleanSmartFilterField(data);
|
|
1769
|
+
break;
|
|
1770
|
+
case 'date':
|
|
1771
|
+
field = createDateSmartFilterField(data);
|
|
1772
|
+
break;
|
|
1773
|
+
case 'date-time':
|
|
1774
|
+
field = createDateTimeSmartFilterField(data);
|
|
1775
|
+
break;
|
|
1776
|
+
case 'multi-select':
|
|
1777
|
+
field = createMultiSelectSmartFilterField(data);
|
|
1778
|
+
break;
|
|
1779
|
+
case 'int':
|
|
1780
|
+
field = createIntSmartFilterField(data);
|
|
1781
|
+
break;
|
|
1782
|
+
case 'real':
|
|
1783
|
+
field = createRealSmartFilterField(data);
|
|
1784
|
+
break;
|
|
1785
|
+
case 'currency':
|
|
1786
|
+
field = createCurrencySmartFilterField(data);
|
|
1787
|
+
break;
|
|
1788
|
+
case 'percentage':
|
|
1789
|
+
field = createPercentageSmartFilterField(data);
|
|
1790
|
+
break;
|
|
1791
|
+
default:
|
|
1792
|
+
field = createMultiSelectSmartFilterField(data);
|
|
1793
|
+
break;
|
|
1794
|
+
}
|
|
1795
|
+
return field;
|
|
1796
|
+
}
|
|
1797
|
+
function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
|
|
1798
|
+
return {
|
|
1799
|
+
fieldId: fieldId,
|
|
1800
|
+
operator: operator,
|
|
1801
|
+
operatorUnit: operatorUnit,
|
|
1802
|
+
value: {
|
|
1803
|
+
first: first,
|
|
1804
|
+
second: second,
|
|
1805
|
+
},
|
|
1806
|
+
};
|
|
1807
1807
|
}
|
|
1808
1808
|
|
|
1809
|
-
/*
|
|
1810
|
-
* Public API Surface of ngx-lib/smart-filters
|
|
1809
|
+
/*
|
|
1810
|
+
* Public API Surface of ngx-lib/smart-filters
|
|
1811
1811
|
*/
|
|
1812
1812
|
|
|
1813
|
-
/**
|
|
1814
|
-
* Generated bundle index. Do not edit.
|
|
1813
|
+
/**
|
|
1814
|
+
* Generated bundle index. Do not edit.
|
|
1815
1815
|
*/
|
|
1816
1816
|
|
|
1817
1817
|
exports.BaseFilterComponent = BaseFilterComponent;
|