@acorex/components 5.1.2 → 5.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -23
- package/karma.conf.js +32 -0
- package/ng-package.json +10 -0
- package/package.json +13 -35
- package/src/lib/accordion/accordion.component.ts +43 -0
- package/src/lib/accordion/accordion.module.ts +11 -0
- package/src/lib/accordion/api.ts +2 -0
- package/src/lib/base/base-page.class.ts +116 -0
- package/src/lib/base/components.class.ts +9 -0
- package/src/lib/base/element.class.ts +344 -0
- package/src/lib/base/events.class.ts +32 -0
- package/src/lib/button/button.component.html +17 -0
- package/src/lib/button/button.component.ts +72 -0
- package/src/lib/button/button.module.ts +14 -0
- package/src/lib/calendar/calendar-box/calendar-box.component.html +68 -0
- package/src/lib/calendar/calendar-box/calendar-box.component.ts +461 -0
- package/src/lib/calendar/calendar-box/calendar-box.module.ts +16 -0
- package/src/lib/calendar/scheduler/scheduler-views.property.ts +38 -0
- package/src/lib/calendar/scheduler/scheduler.class.ts +50 -0
- package/src/lib/calendar/scheduler/scheduler.component.html +9 -0
- package/src/lib/calendar/scheduler/scheduler.component.scss +181 -0
- package/src/lib/calendar/scheduler/scheduler.component.ts +249 -0
- package/src/lib/calendar/scheduler/scheduler.module.ts +45 -0
- package/src/lib/calendar/scheduler/toolbars/scheduler-toolbar-navigator.ts +133 -0
- package/src/lib/calendar/scheduler/toolbars/scheduler-toolbar-views.ts +33 -0
- package/src/lib/calendar/scheduler/views/agenda/scheduler-agenda-view.component.html +43 -0
- package/src/lib/calendar/scheduler/views/agenda/scheduler-agenda-view.component.scss +66 -0
- package/src/lib/calendar/scheduler/views/agenda/scheduler-agenda-view.component.ts +50 -0
- package/src/lib/calendar/scheduler/views/daytime/scheduler-daytime-view.component.html +45 -0
- package/src/lib/calendar/scheduler/views/daytime/scheduler-daytime-view.component.scss +19 -0
- package/src/lib/calendar/scheduler/views/daytime/scheduler-daytime-view.component.ts +103 -0
- package/src/lib/calendar/scheduler/views/month/scheduler-month-view.component.html +39 -0
- package/src/lib/calendar/scheduler/views/month/scheduler-month-view.component.scss +55 -0
- package/src/lib/calendar/scheduler/views/month/scheduler-month-view.component.ts +233 -0
- package/src/lib/calendar/scheduler/views/scheduler-view.component.ts +124 -0
- package/src/lib/calendar/scheduler/views/timeline/scheduler-timeline-view.component.html +50 -0
- package/src/lib/calendar/scheduler/views/timeline/scheduler-timeline-view.component.scss +4 -0
- package/src/lib/calendar/scheduler/views/timeline/scheduler-timeline-view.component.ts +92 -0
- package/src/lib/checkbox/checkbox.component.html +22 -0
- package/src/lib/checkbox/checkbox.component.ts +107 -0
- package/src/lib/checkbox/checkbox.module.ts +11 -0
- package/src/lib/color-picker/color-box/color-box.component.html +37 -0
- package/src/lib/color-picker/color-box/color-box.component.scss +60 -0
- package/src/lib/color-picker/color-box/color-box.component.ts +438 -0
- package/src/lib/color-picker/color-picker.component.html +31 -0
- package/src/lib/color-picker/color-picker.component.ts +87 -0
- package/src/lib/color-picker/color-picker.module.ts +16 -0
- package/src/lib/context-menu/context-menu.component.html +42 -0
- package/src/lib/context-menu/context-menu.component.ts +78 -0
- package/src/lib/context-menu/context-menu.directive.ts +159 -0
- package/src/lib/context-menu/context-menu.module.ts +15 -0
- package/src/lib/data-filter/columns/filter-column-date.component.ts +123 -0
- package/src/lib/data-filter/columns/filter-column-number.component.ts +100 -0
- package/src/lib/data-filter/columns/filter-column-selection.component.ts +69 -0
- package/src/lib/data-filter/columns/filter-column-string.component.ts +100 -0
- package/src/lib/data-filter/filter-panel/filter-panel.component.html +120 -0
- package/src/lib/data-filter/filter-panel/filter-panel.component.scss +143 -0
- package/src/lib/data-filter/filter-panel/filter-panel.component.ts +266 -0
- package/src/lib/data-filter/filter.class.ts +73 -0
- package/src/lib/data-filter/filter.module.ts +52 -0
- package/src/lib/data-filter/toolbar/filter-toolbar.component.html +5 -0
- package/src/lib/data-filter/toolbar/filter-toolbar.component.scss +17 -0
- package/src/lib/data-filter/toolbar/filter-toolbar.component.ts +179 -0
- package/src/lib/data-list/core/data-list.component.ts +62 -0
- package/src/lib/data-list/list/list.component.html +32 -0
- package/src/lib/data-list/list/list.component.scss +64 -0
- package/src/lib/data-list/list/list.component.ts +149 -0
- package/src/lib/data-list/list/list.module.ts +14 -0
- package/src/lib/data-list/list/toolbar-list-view.component.ts +63 -0
- package/src/lib/data-source/datasource.component.ts +50 -0
- package/src/lib/data-source/datasource.module.ts +11 -0
- package/src/lib/data-source/read-param.ts +50 -0
- package/src/lib/date-picker/date-picker.component.html +30 -0
- package/src/lib/date-picker/date-picker.component.scss +5 -0
- package/src/lib/date-picker/date-picker.component.ts +720 -0
- package/src/lib/date-picker/date-picker.module.ts +17 -0
- package/src/lib/dialog/dialog.component.html +5 -0
- package/src/lib/dialog/dialog.component.scss +32 -0
- package/src/lib/dialog/dialog.component.ts +32 -0
- package/src/lib/dialog/dialog.module.ts +13 -0
- package/src/lib/dialog/dialog.service.ts +178 -0
- package/src/lib/drawer/content.component.ts +18 -0
- package/src/lib/drawer/drawer-container.component.ts +37 -0
- package/src/lib/drawer/drawer.component.ts +151 -0
- package/src/lib/drawer/drawer.module.ts +16 -0
- package/src/lib/dropdown/dropdown.component.html +26 -0
- package/src/lib/dropdown/dropdown.component.scss +8 -0
- package/src/lib/dropdown/dropdown.component.ts +197 -0
- package/src/lib/dropdown/dropdown.module.ts +19 -0
- package/src/lib/fieldset/fieldset.component.html +6 -0
- package/src/lib/fieldset/fieldset.component.ts +49 -0
- package/src/lib/fieldset/fieldset.module.ts +11 -0
- package/src/lib/form-group/form-group.component.html +15 -0
- package/src/lib/form-group/form-group.component.ts +39 -0
- package/src/lib/form-group/form-group.module.ts +14 -0
- package/src/lib/label/label.component.html +5 -0
- package/src/lib/label/label.component.ts +18 -0
- package/src/lib/label/label.module.ts +14 -0
- package/src/lib/loading/loading-indicator.component.html +27 -0
- package/src/lib/loading/loading-indicator.component.ts +16 -0
- package/src/lib/loading/loading-panel.component.ts +37 -0
- package/src/lib/loading/loading.module.ts +13 -0
- package/src/lib/loading/loading.service.ts +44 -0
- package/src/lib/menu/menu-item.component.ts +41 -0
- package/src/lib/menu/menu.component.html +74 -0
- package/src/lib/menu/menu.component.ts +111 -0
- package/src/lib/menu/menu.module.ts +13 -0
- package/src/lib/menu/menu2.component.scss +59 -0
- package/src/lib/menu/menu2.component.ts +98 -0
- package/src/lib/number-box/number-box.component.html +32 -0
- package/src/lib/number-box/number-box.component.ts +641 -0
- package/src/lib/number-box/number-box.module.ts +13 -0
- package/src/lib/page/content.component.ts +18 -0
- package/src/lib/page/footer.component.ts +13 -0
- package/src/lib/page/page.component.ts +43 -0
- package/src/lib/page/page.module.ts +14 -0
- package/src/lib/panel-box/panel-box.component.html +19 -0
- package/src/lib/panel-box/panel-box.component.scss +25 -0
- package/src/lib/panel-box/panel-box.component.ts +87 -0
- package/src/lib/panel-box/panel-box.module.ts +10 -0
- package/src/lib/password-box/password-box.component.html +22 -0
- package/src/lib/password-box/password-box.component.ts +30 -0
- package/src/lib/password-box/password-box.module.ts +16 -0
- package/src/lib/popover/custom-cdk-overlay.service.ts +82 -0
- package/src/lib/popover/overlay.service.ts +110 -0
- package/src/lib/popover/popover.component.html +5 -0
- package/src/lib/popover/popover.component.scss +9 -0
- package/src/lib/popover/popover.component.ts +117 -0
- package/src/lib/popover/popover.module.ts +11 -0
- package/src/lib/popup/popup.component.html +33 -0
- package/src/lib/popup/popup.component.scss +173 -0
- package/src/lib/popup/popup.component.ts +182 -0
- package/src/lib/popup/popup.module.ts +16 -0
- package/src/lib/popup/popup.service.ts +103 -0
- package/src/lib/progress-bar/progress-bar.component.html +5 -0
- package/src/lib/progress-bar/progress-bar.component.ts +10 -0
- package/src/lib/progress-bar/progress-bar.module.ts +11 -0
- package/src/lib/property-editor/editors/check-editor/check-editor.ts +44 -0
- package/src/lib/property-editor/editors/check-editor/check.module.ts +14 -0
- package/src/lib/property-editor/editors/color-editor/color.editor.ts +30 -0
- package/src/lib/property-editor/editors/color-editor/color.module.ts +20 -0
- package/src/lib/property-editor/editors/column-editor/column.editor.html +75 -0
- package/src/lib/property-editor/editors/column-editor/column.editor.scss +193 -0
- package/src/lib/property-editor/editors/column-editor/column.editor.ts +124 -0
- package/src/lib/property-editor/editors/column-editor/column.module.ts +28 -0
- package/src/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.html +80 -0
- package/src/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.scss +71 -0
- package/src/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.ts +232 -0
- package/src/lib/property-editor/editors/conditional-color-editor/conditional-color.module.ts +52 -0
- package/src/lib/property-editor/editors/date-editor/date.editor.ts +49 -0
- package/src/lib/property-editor/editors/date-editor/date.module.ts +20 -0
- package/src/lib/property-editor/editors/number-editor/number.editor.ts +46 -0
- package/src/lib/property-editor/editors/number-editor/number.module.ts +20 -0
- package/src/lib/property-editor/editors/range-editor/range.editor.html +67 -0
- package/src/lib/property-editor/editors/range-editor/range.editor.scss +68 -0
- package/src/lib/property-editor/editors/range-editor/range.editor.ts +153 -0
- package/src/lib/property-editor/editors/range-editor/range.module.ts +37 -0
- package/src/lib/property-editor/editors/searchbar-selectbox-editor/searchbar-selectbox-editor.html +8 -0
- package/src/lib/property-editor/editors/searchbar-selectbox-editor/searchbar-selectbox-editor.ts +70 -0
- package/src/lib/property-editor/editors/selectbox-editor/selectbox.editor.html +8 -0
- package/src/lib/property-editor/editors/selectbox-editor/selectbox.editor.ts +77 -0
- package/src/lib/property-editor/editors/selectbox-editor/selectbox.module.ts +18 -0
- package/src/lib/property-editor/editors/selection-editor/selection-editor.ts +52 -0
- package/src/lib/property-editor/editors/selection-editor/selection.module.ts +14 -0
- package/src/lib/property-editor/editors/switch-editor/number.editor.ts +26 -0
- package/src/lib/property-editor/editors/switch-editor/number.module.ts +21 -0
- package/src/lib/property-editor/editors/text-editor/text.editor.html +5 -0
- package/src/lib/property-editor/editors/text-editor/text.editor.ts +31 -0
- package/src/lib/property-editor/editors/text-editor/text.module.ts +20 -0
- package/src/lib/property-editor/editors/textarea-editor/textarea.editor.html +9 -0
- package/src/lib/property-editor/editors/textarea-editor/textarea.editor.ts +37 -0
- package/src/lib/property-editor/editors/textarea-editor/textarea.module.ts +20 -0
- package/src/lib/property-editor/editors/time-editor/time.editor.ts +38 -0
- package/src/lib/property-editor/editors/time-editor/time.module.ts +20 -0
- package/src/lib/property-editor/property-editor-renderer.directive.ts +165 -0
- package/src/lib/property-editor/property-editor.class.ts +178 -0
- package/src/lib/property-editor/property-editor.module.ts +115 -0
- package/src/lib/query-builder/query-builder-group.component.html +68 -0
- package/src/lib/query-builder/query-builder-group.component.ts +122 -0
- package/src/lib/query-builder/query-builder-popup/query-builder-popup.component.html +82 -0
- package/src/lib/query-builder/query-builder-popup/query-builder-popup.component.ts +178 -0
- package/src/lib/query-builder/query-builder-rule.component.html +135 -0
- package/src/lib/query-builder/query-builder-rule.component.ts +390 -0
- package/src/lib/query-builder/query-builder.class.ts +53 -0
- package/src/lib/query-builder/query-builder.component.html +3 -0
- package/src/lib/query-builder/query-builder.component.scss +286 -0
- package/src/lib/query-builder/query-builder.component.ts +220 -0
- package/src/lib/query-builder/query-builder.module.ts +44 -0
- package/src/lib/query-builder/query-builder.service.ts +188 -0
- package/src/lib/search-bar/search-bar.component.html +31 -0
- package/src/lib/search-bar/search-bar.component.scss +24 -0
- package/src/lib/search-bar/search-bar.component.ts +250 -0
- package/src/lib/search-bar/search-bar.module.ts +33 -0
- package/src/lib/searchbox/searchbox.component.html +25 -0
- package/src/lib/searchbox/searchbox.component.ts +85 -0
- package/src/lib/searchbox/searchbox.module.ts +17 -0
- package/src/lib/selectbox/selectbox.component.html +100 -0
- package/src/lib/selectbox/selectbox.component.ts +984 -0
- package/src/lib/selectbox/selectbox.module.ts +31 -0
- package/src/lib/selectbox/selectbox2.component.html +78 -0
- package/src/lib/selectbox/selectbox2.component.ts +603 -0
- package/src/lib/selection-list/selection-list.component.html +21 -0
- package/src/lib/selection-list/selection-list.component.ts +115 -0
- package/src/lib/selection-list/selection-list.module.ts +13 -0
- package/src/lib/switch/switch.component.html +4 -0
- package/src/lib/switch/switch.component.scss +65 -0
- package/src/lib/switch/switch.component.ts +57 -0
- package/src/lib/switch/switch.module.ts +14 -0
- package/src/lib/tab-page/tab-page-Renderer.component.ts +70 -0
- package/src/lib/tab-page/tab-page-host.component.ts +110 -0
- package/src/lib/tab-page/tab-page.module.ts +13 -0
- package/src/lib/tab-page/tab-page.service.ts +176 -0
- package/src/lib/tab-strip/tab-strip.component.html +6 -0
- package/src/lib/tab-strip/tab-strip.component.ts +47 -0
- package/src/lib/tab-strip/tab-strip.module.ts +11 -0
- package/src/lib/tab-view/dynamic-tabs.directive.ts +17 -0
- package/src/lib/tab-view/tab-view.component.html +33 -0
- package/src/lib/tab-view/tab-view.component.scss +0 -0
- package/src/lib/tab-view/tab-view.component.ts +129 -0
- package/src/lib/tab-view/tab-view.module.ts +12 -0
- package/src/lib/tab-view/tab.component.html +8 -0
- package/src/lib/tab-view/tab.component.ts +15 -0
- package/src/lib/textarea/textarea.component.html +13 -0
- package/src/lib/textarea/textarea.component.ts +24 -0
- package/src/lib/textarea/textarea.module.ts +14 -0
- package/src/lib/textbox/textbox.component.html +22 -0
- package/src/lib/textbox/textbox.component.ts +38 -0
- package/src/lib/textbox/textbox.module.ts +16 -0
- package/src/lib/time-picker/time-picker.component.html +21 -0
- package/src/lib/time-picker/time-picker.component.ts +1003 -0
- package/src/lib/time-picker/time-picker.module.ts +15 -0
- package/src/lib/toast/toast-message/toast-message.component.html +17 -0
- package/src/lib/toast/toast-message/toast-message.component.scss +75 -0
- package/src/lib/toast/toast-message/toast-message.component.ts +64 -0
- package/src/lib/toast/toast-wrapper/toast-wrapper.component.scss +15 -0
- package/src/lib/toast/toast-wrapper/toast-wrapper.component.ts +13 -0
- package/src/lib/toast/toast.module.ts +12 -0
- package/src/lib/toast/toast.service.ts +64 -0
- package/src/lib/toolbar/group-button/toolbar-group-button.component.ts +54 -0
- package/src/lib/toolbar/menu/toolbar-menu.component.html +4 -0
- package/src/lib/toolbar/menu/toolbar-menu.component.ts +81 -0
- package/src/lib/toolbar/search/toolbar-search.component.html +4 -0
- package/src/lib/toolbar/search/toolbar-search.component.scss +24 -0
- package/src/lib/toolbar/search/toolbar-search.component.ts +61 -0
- package/src/lib/toolbar/title/toolbar-title.component.ts +35 -0
- package/src/lib/toolbar/toolbar-item.ts +4 -0
- package/src/lib/toolbar/toolbar.component.html +4 -0
- package/src/lib/toolbar/toolbar.component.scss +9 -0
- package/src/lib/toolbar/toolbar.component.ts +16 -0
- package/src/lib/toolbar/toolbar.module.ts +25 -0
- package/src/lib/tooltip/tooltip.directive.ts +101 -0
- package/src/lib/tooltip/tooltip.module.ts +11 -0
- package/src/lib/tree-side-menu/tree-side-menu.component.html +43 -0
- package/src/lib/tree-side-menu/tree-side-menu.component.ts +698 -0
- package/src/lib/tree-side-menu/tree-side-menu.module.ts +19 -0
- package/src/lib/tree-view/tree-view.component.html +45 -0
- package/src/lib/tree-view/tree-view.component.ts +781 -0
- package/src/lib/tree-view/tree-view.module.ts +16 -0
- package/src/lib/upload-file/upload-file.component.html +16 -0
- package/src/lib/upload-file/upload-file.component.ts +189 -0
- package/src/lib/upload-file/upload-file.events.ts +11 -0
- package/src/lib/upload-file/upload-file.module.ts +16 -0
- package/src/lib/validation/validation-form.component.ts +78 -0
- package/src/lib/validation/validation-rule.widget.ts +112 -0
- package/src/lib/validation/validation.class.ts +22 -0
- package/src/lib/validation/validation.component.ts +92 -0
- package/src/lib/validation/validation.module.ts +28 -0
- package/src/public-api.ts +214 -0
- package/src/test.ts +28 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.lib.prod.json +6 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/acorex-components.d.ts +0 -5
- package/esm2020/acorex-components.mjs +0 -5
- package/esm2020/lib/action-sheet/action-sheet-item.component.mjs +0 -37
- package/esm2020/lib/action-sheet/action-sheet.component.mjs +0 -87
- package/esm2020/lib/action-sheet/action-sheet.module.mjs +0 -22
- package/esm2020/lib/action-sheet/index.mjs +0 -4
- package/esm2020/lib/alert/alert-button.component.mjs +0 -51
- package/esm2020/lib/alert/alert-content.component.mjs +0 -21
- package/esm2020/lib/alert/alert-footer.component.mjs +0 -27
- package/esm2020/lib/alert/alert-suffix.component.mjs +0 -27
- package/esm2020/lib/alert/alert-title.component.mjs +0 -23
- package/esm2020/lib/alert/alert.component.mjs +0 -123
- package/esm2020/lib/alert/alert.module.mjs +0 -44
- package/esm2020/lib/alert/index.mjs +0 -8
- package/esm2020/lib/avatar/avatar-group.component.mjs +0 -17
- package/esm2020/lib/avatar/avatar.component.mjs +0 -42
- package/esm2020/lib/avatar/avatar.module.mjs +0 -22
- package/esm2020/lib/avatar/index.mjs +0 -4
- package/esm2020/lib/badge/badge.component.mjs +0 -28
- package/esm2020/lib/badge/badge.module.mjs +0 -21
- package/esm2020/lib/badge/index.mjs +0 -3
- package/esm2020/lib/base/common.module.mjs +0 -19
- package/esm2020/lib/base/custom-cdk-overlay.service.mjs +0 -47
- package/esm2020/lib/base/drawing.class.mjs +0 -11
- package/esm2020/lib/base/events.class.mjs +0 -58
- package/esm2020/lib/base/index.mjs +0 -8
- package/esm2020/lib/base/infinite-scroll.directive.mjs +0 -63
- package/esm2020/lib/base/mixin/base-components.class.mjs +0 -100
- package/esm2020/lib/base/mixin/base-menu-mixin.class.mjs +0 -135
- package/esm2020/lib/base/mixin/button-mixin.class.mjs +0 -91
- package/esm2020/lib/base/mixin/clickable-mixin.class.mjs +0 -24
- package/esm2020/lib/base/mixin/color-look-mixing.class.mjs +0 -48
- package/esm2020/lib/base/mixin/constratctor.mjs +0 -2
- package/esm2020/lib/base/mixin/datalist-component.class.mjs +0 -145
- package/esm2020/lib/base/mixin/datalist.class.mjs +0 -3
- package/esm2020/lib/base/mixin/dropdown-mixin.class.mjs +0 -102
- package/esm2020/lib/base/mixin/index.mjs +0 -3
- package/esm2020/lib/base/mixin/interactive-mixin.class.mjs +0 -83
- package/esm2020/lib/base/mixin/loading-mixin.class.mjs +0 -18
- package/esm2020/lib/base/mixin/mixin.class.mjs +0 -27
- package/esm2020/lib/base/mixin/selection-component.class.mjs +0 -181
- package/esm2020/lib/base/mixin/sizable-mixin.class.mjs +0 -18
- package/esm2020/lib/base/mixin/textbox-mixin.class.mjs +0 -34
- package/esm2020/lib/base/mixin/value-mixin.class.mjs +0 -209
- package/esm2020/lib/base/overlay.service.mjs +0 -91
- package/esm2020/lib/base/responsive.directive.mjs +0 -34
- package/esm2020/lib/base/styles.class.mjs +0 -4
- package/esm2020/lib/breadcrumbs/breadcrumbs-item.class.mjs +0 -2
- package/esm2020/lib/breadcrumbs/breadcrumbs-item.component.mjs +0 -20
- package/esm2020/lib/breadcrumbs/breadcrumbs.component.mjs +0 -18
- package/esm2020/lib/breadcrumbs/breadcrumbs.module.mjs +0 -20
- package/esm2020/lib/breadcrumbs/index.mjs +0 -5
- package/esm2020/lib/button/button-group.component.mjs +0 -124
- package/esm2020/lib/button/button-item.class.mjs +0 -2
- package/esm2020/lib/button/button-item.component.mjs +0 -80
- package/esm2020/lib/button/button.component.mjs +0 -63
- package/esm2020/lib/button/button.module.mjs +0 -33
- package/esm2020/lib/button/index.mjs +0 -6
- package/esm2020/lib/calendar/calendar.class.mjs +0 -126
- package/esm2020/lib/calendar/calendar.component.mjs +0 -279
- package/esm2020/lib/calendar/calendar.module.mjs +0 -25
- package/esm2020/lib/calendar/index.mjs +0 -3
- package/esm2020/lib/carousel/carousel-arrows.component.mjs +0 -54
- package/esm2020/lib/carousel/carousel-item.component.mjs +0 -21
- package/esm2020/lib/carousel/carousel-pager.component.mjs +0 -74
- package/esm2020/lib/carousel/carousel-splidejs.class.mjs +0 -88
- package/esm2020/lib/carousel/carousel.class.mjs +0 -10
- package/esm2020/lib/carousel/carousel.component.mjs +0 -389
- package/esm2020/lib/carousel/carousel.module.mjs +0 -24
- package/esm2020/lib/carousel/index.mjs +0 -7
- package/esm2020/lib/checkbox/checkbox.component.mjs +0 -41
- package/esm2020/lib/checkbox/checkbox.module.mjs +0 -21
- package/esm2020/lib/checkbox/index.mjs +0 -3
- package/esm2020/lib/collapse/collapse-group.component.mjs +0 -46
- package/esm2020/lib/collapse/collapse.component.mjs +0 -43
- package/esm2020/lib/collapse/collapse.module.mjs +0 -20
- package/esm2020/lib/collapse/index.mjs +0 -4
- package/esm2020/lib/datalist/datalist.component.mjs +0 -75
- package/esm2020/lib/datalist/datalist.module.mjs +0 -24
- package/esm2020/lib/datalist/index.mjs +0 -3
- package/esm2020/lib/datepicker/datepicker.component.mjs +0 -178
- package/esm2020/lib/datepicker/datepicker.module.mjs +0 -47
- package/esm2020/lib/datepicker/index.mjs +0 -3
- package/esm2020/lib/decorators/addon.component.mjs +0 -20
- package/esm2020/lib/decorators/content.component.mjs +0 -26
- package/esm2020/lib/decorators/decorators.module.mjs +0 -25
- package/esm2020/lib/decorators/header.component.mjs +0 -26
- package/esm2020/lib/decorators/index.mjs +0 -8
- package/esm2020/lib/decorators/prefix.component.mjs +0 -26
- package/esm2020/lib/decorators/suffix.component.mjs +0 -26
- package/esm2020/lib/dialog/dialog.class.mjs +0 -2
- package/esm2020/lib/dialog/dialog.component.mjs +0 -40
- package/esm2020/lib/dialog/dialog.module.mjs +0 -26
- package/esm2020/lib/dialog/dialog.service.mjs +0 -144
- package/esm2020/lib/dialog/index.mjs +0 -5
- package/esm2020/lib/drawer/drawer-container.component.mjs +0 -83
- package/esm2020/lib/drawer/drawer-content.component.mjs +0 -27
- package/esm2020/lib/drawer/drawer.component.mjs +0 -172
- package/esm2020/lib/drawer/drawer.module.mjs +0 -23
- package/esm2020/lib/drawer/index.mjs +0 -5
- package/esm2020/lib/dropdown/dropdown-panel.component.mjs +0 -80
- package/esm2020/lib/dropdown/dropdown.module.mjs +0 -24
- package/esm2020/lib/dropdown/index.mjs +0 -3
- package/esm2020/lib/form/form-field.component.mjs +0 -20
- package/esm2020/lib/form/form-field.module.mjs +0 -21
- package/esm2020/lib/form/form-hint.component.mjs +0 -20
- package/esm2020/lib/form/form.component.mjs +0 -59
- package/esm2020/lib/form/index.mjs +0 -5
- package/esm2020/lib/icon/icon.component.mjs +0 -28
- package/esm2020/lib/icon/icon.module.mjs +0 -21
- package/esm2020/lib/icon/index.mjs +0 -3
- package/esm2020/lib/input-mask/index.mjs +0 -3
- package/esm2020/lib/input-mask/input-mask.component.mjs +0 -56
- package/esm2020/lib/input-mask/input-mask.module.mjs +0 -24
- package/esm2020/lib/label/index.mjs +0 -3
- package/esm2020/lib/label/label.component.mjs +0 -25
- package/esm2020/lib/label/label.module.mjs +0 -21
- package/esm2020/lib/loading/index.mjs +0 -6
- package/esm2020/lib/loading/loading-spinner.component.mjs +0 -35
- package/esm2020/lib/loading/loading.component.mjs +0 -62
- package/esm2020/lib/loading/loading.directive.mjs +0 -67
- package/esm2020/lib/loading/loading.module.mjs +0 -35
- package/esm2020/lib/loading/loading.service.mjs +0 -154
- package/esm2020/lib/menu/index.mjs +0 -3
- package/esm2020/lib/menu/menu.component.mjs +0 -76
- package/esm2020/lib/menu/menu.module.mjs +0 -24
- package/esm2020/lib/number-box/index.mjs +0 -3
- package/esm2020/lib/number-box/number-box.component.mjs +0 -221
- package/esm2020/lib/number-box/number-box.module.mjs +0 -38
- package/esm2020/lib/page/base-page.class.mjs +0 -86
- package/esm2020/lib/page/index.mjs +0 -6
- package/esm2020/lib/page/page-footer.component.mjs +0 -28
- package/esm2020/lib/page/page-header.component.mjs +0 -28
- package/esm2020/lib/page/page.component.mjs +0 -58
- package/esm2020/lib/page/page.module.mjs +0 -19
- package/esm2020/lib/password-box/index.mjs +0 -3
- package/esm2020/lib/password-box/password-box.component.mjs +0 -59
- package/esm2020/lib/password-box/password-box.module.mjs +0 -35
- package/esm2020/lib/picker/index.mjs +0 -3
- package/esm2020/lib/picker/picker.component.mjs +0 -24
- package/esm2020/lib/picker/picker.module.mjs +0 -20
- package/esm2020/lib/popover/index.mjs +0 -3
- package/esm2020/lib/popover/popover.component.mjs +0 -231
- package/esm2020/lib/popover/popover.module.mjs +0 -19
- package/esm2020/lib/popup/index.mjs +0 -4
- package/esm2020/lib/popup/popup.component.mjs +0 -122
- package/esm2020/lib/popup/popup.module.mjs +0 -25
- package/esm2020/lib/popup/popup.service.mjs +0 -95
- package/esm2020/lib/progress-bar/index.mjs +0 -3
- package/esm2020/lib/progress-bar/progress-bar.component.mjs +0 -34
- package/esm2020/lib/progress-bar/progress-bar.module.mjs +0 -19
- package/esm2020/lib/radio/index.mjs +0 -3
- package/esm2020/lib/radio/radio.component.mjs +0 -34
- package/esm2020/lib/radio/radio.module.mjs +0 -22
- package/esm2020/lib/range-slider/index.mjs +0 -3
- package/esm2020/lib/range-slider/range-slider.component.mjs +0 -16
- package/esm2020/lib/range-slider/range-slider.module.mjs +0 -21
- package/esm2020/lib/rating/index.mjs +0 -3
- package/esm2020/lib/rating/rating.component.mjs +0 -41
- package/esm2020/lib/rating/rating.component.module.mjs +0 -19
- package/esm2020/lib/result/index.mjs +0 -3
- package/esm2020/lib/result/result.component.mjs +0 -23
- package/esm2020/lib/result/result.module.mjs +0 -19
- package/esm2020/lib/selectbox/index.mjs +0 -3
- package/esm2020/lib/selectbox/selectbox.component.mjs +0 -322
- package/esm2020/lib/selectbox/selectbox.module.mjs +0 -69
- package/esm2020/lib/selection-list/index.mjs +0 -3
- package/esm2020/lib/selection-list/selection-list.component.mjs +0 -50
- package/esm2020/lib/selection-list/selection-list.module.mjs +0 -24
- package/esm2020/lib/switch/index.mjs +0 -3
- package/esm2020/lib/switch/switch.component.mjs +0 -33
- package/esm2020/lib/switch/switch.module.mjs +0 -21
- package/esm2020/lib/tabs/index.mjs +0 -6
- package/esm2020/lib/tabs/tab-content.directive.mjs +0 -29
- package/esm2020/lib/tabs/tab-item.component.mjs +0 -121
- package/esm2020/lib/tabs/tabs.class.mjs +0 -4
- package/esm2020/lib/tabs/tabs.component.mjs +0 -95
- package/esm2020/lib/tabs/tabs.module.mjs +0 -25
- package/esm2020/lib/textarea/index.mjs +0 -3
- package/esm2020/lib/textarea/textarea.component.mjs +0 -25
- package/esm2020/lib/textarea/textarea.module.mjs +0 -26
- package/esm2020/lib/textbox/index.mjs +0 -3
- package/esm2020/lib/textbox/textbox.component.mjs +0 -27
- package/esm2020/lib/textbox/textbox.module.mjs +0 -43
- package/esm2020/lib/time-box/index.mjs +0 -3
- package/esm2020/lib/time-box/time-box.component.mjs +0 -262
- package/esm2020/lib/time-box/time-box.module.mjs +0 -32
- package/esm2020/lib/toast/index.mjs +0 -5
- package/esm2020/lib/toast/toast.class.mjs +0 -2
- package/esm2020/lib/toast/toast.component.mjs +0 -52
- package/esm2020/lib/toast/toast.module.mjs +0 -22
- package/esm2020/lib/toast/toast.service.mjs +0 -114
- package/esm2020/lib/tooltip/index.mjs +0 -4
- package/esm2020/lib/tooltip/tooltip.component.mjs +0 -38
- package/esm2020/lib/tooltip/tooltip.directive.mjs +0 -86
- package/esm2020/lib/tooltip/tooltip.module.mjs +0 -23
- package/esm2020/lib/treeview/index.mjs +0 -3
- package/esm2020/lib/treeview/tree-view.component.mjs +0 -108
- package/esm2020/lib/treeview/tree-view.module.mjs +0 -20
- package/esm2020/lib/validation/index.mjs +0 -3
- package/esm2020/lib/validation/validation-rule.widget.mjs +0 -113
- package/esm2020/lib/validation/validation.class.mjs +0 -2
- package/esm2020/lib/validation/validation.module.mjs +0 -32
- package/esm2020/public-api.mjs +0 -51
- package/fesm2015/acorex-components.mjs +0 -8045
- package/fesm2015/acorex-components.mjs.map +0 -1
- package/fesm2020/acorex-components.mjs +0 -8012
- package/fesm2020/acorex-components.mjs.map +0 -1
- package/lib/action-sheet/action-sheet-item.component.d.ts +0 -15
- package/lib/action-sheet/action-sheet.component.d.ts +0 -19
- package/lib/action-sheet/action-sheet.module.d.ts +0 -11
- package/lib/action-sheet/index.d.ts +0 -3
- package/lib/alert/alert-button.component.d.ts +0 -13
- package/lib/alert/alert-content.component.d.ts +0 -5
- package/lib/alert/alert-footer.component.d.ts +0 -5
- package/lib/alert/alert-suffix.component.d.ts +0 -5
- package/lib/alert/alert-title.component.d.ts +0 -5
- package/lib/alert/alert.component.d.ts +0 -75
- package/lib/alert/alert.module.d.ts +0 -14
- package/lib/alert/index.d.ts +0 -7
- package/lib/avatar/avatar-group.component.d.ts +0 -8
- package/lib/avatar/avatar.component.d.ts +0 -22
- package/lib/avatar/avatar.module.d.ts +0 -9
- package/lib/avatar/index.d.ts +0 -3
- package/lib/badge/badge.component.d.ts +0 -41
- package/lib/badge/badge.module.d.ts +0 -8
- package/lib/badge/index.d.ts +0 -2
- package/lib/base/common.module.d.ts +0 -8
- package/lib/base/custom-cdk-overlay.service.d.ts +0 -19
- package/lib/base/drawing.class.d.ts +0 -9
- package/lib/base/events.class.d.ts +0 -85
- package/lib/base/index.d.ts +0 -7
- package/lib/base/infinite-scroll.directive.d.ts +0 -25
- package/lib/base/mixin/base-components.class.d.ts +0 -85
- package/lib/base/mixin/base-menu-mixin.class.d.ts +0 -51
- package/lib/base/mixin/button-mixin.class.d.ts +0 -63
- package/lib/base/mixin/clickable-mixin.class.d.ts +0 -35
- package/lib/base/mixin/color-look-mixing.class.d.ts +0 -43
- package/lib/base/mixin/constratctor.d.ts +0 -4
- package/lib/base/mixin/datalist-component.class.d.ts +0 -57
- package/lib/base/mixin/datalist.class.d.ts +0 -11
- package/lib/base/mixin/dropdown-mixin.class.d.ts +0 -48
- package/lib/base/mixin/index.d.ts +0 -2
- package/lib/base/mixin/interactive-mixin.class.d.ts +0 -59
- package/lib/base/mixin/loading-mixin.class.d.ts +0 -39
- package/lib/base/mixin/mixin.class.d.ts +0 -686
- package/lib/base/mixin/selection-component.class.d.ts +0 -60
- package/lib/base/mixin/sizable-mixin.class.d.ts +0 -33
- package/lib/base/mixin/textbox-mixin.class.d.ts +0 -56
- package/lib/base/mixin/value-mixin.class.d.ts +0 -64
- package/lib/base/overlay.service.d.ts +0 -31
- package/lib/base/responsive.directive.d.ts +0 -10
- package/lib/base/styles.class.d.ts +0 -17
- package/lib/breadcrumbs/breadcrumbs-item.class.d.ts +0 -9
- package/lib/breadcrumbs/breadcrumbs-item.component.d.ts +0 -12
- package/lib/breadcrumbs/breadcrumbs.component.d.ts +0 -11
- package/lib/breadcrumbs/breadcrumbs.module.d.ts +0 -9
- package/lib/breadcrumbs/index.d.ts +0 -4
- package/lib/button/button-group.component.d.ts +0 -36
- package/lib/button/button-item.class.d.ts +0 -22
- package/lib/button/button-item.component.d.ts +0 -79
- package/lib/button/button.component.d.ts +0 -21
- package/lib/button/button.module.d.ts +0 -12
- package/lib/button/index.d.ts +0 -5
- package/lib/calendar/calendar.class.d.ts +0 -50
- package/lib/calendar/calendar.component.d.ts +0 -41
- package/lib/calendar/calendar.module.d.ts +0 -12
- package/lib/calendar/index.d.ts +0 -2
- package/lib/carousel/carousel-arrows.component.d.ts +0 -14
- package/lib/carousel/carousel-item.component.d.ts +0 -8
- package/lib/carousel/carousel-pager.component.d.ts +0 -22
- package/lib/carousel/carousel-splidejs.class.d.ts +0 -18
- package/lib/carousel/carousel.class.d.ts +0 -66
- package/lib/carousel/carousel.component.d.ts +0 -98
- package/lib/carousel/carousel.module.d.ts +0 -11
- package/lib/carousel/index.d.ts +0 -6
- package/lib/checkbox/checkbox.component.d.ts +0 -11
- package/lib/checkbox/checkbox.module.d.ts +0 -10
- package/lib/checkbox/index.d.ts +0 -2
- package/lib/collapse/collapse-group.component.d.ts +0 -14
- package/lib/collapse/collapse.component.d.ts +0 -17
- package/lib/collapse/collapse.module.d.ts +0 -9
- package/lib/collapse/index.d.ts +0 -3
- package/lib/datalist/datalist.component.d.ts +0 -25
- package/lib/datalist/datalist.module.d.ts +0 -11
- package/lib/datalist/index.d.ts +0 -2
- package/lib/datepicker/datepicker.component.d.ts +0 -150
- package/lib/datepicker/datepicker.module.d.ts +0 -16
- package/lib/datepicker/index.d.ts +0 -2
- package/lib/decorators/addon.component.d.ts +0 -8
- package/lib/decorators/content.component.d.ts +0 -8
- package/lib/decorators/decorators.module.d.ts +0 -12
- package/lib/decorators/header.component.d.ts +0 -8
- package/lib/decorators/index.d.ts +0 -7
- package/lib/decorators/prefix.component.d.ts +0 -8
- package/lib/decorators/suffix.component.d.ts +0 -8
- package/lib/dialog/dialog.class.d.ts +0 -12
- package/lib/dialog/dialog.component.d.ts +0 -15
- package/lib/dialog/dialog.module.d.ts +0 -13
- package/lib/dialog/dialog.service.d.ts +0 -36
- package/lib/dialog/index.d.ts +0 -4
- package/lib/drawer/drawer-container.component.d.ts +0 -13
- package/lib/drawer/drawer-content.component.d.ts +0 -8
- package/lib/drawer/drawer.component.d.ts +0 -33
- package/lib/drawer/drawer.module.d.ts +0 -10
- package/lib/drawer/index.d.ts +0 -4
- package/lib/dropdown/dropdown-panel.component.d.ts +0 -27
- package/lib/dropdown/dropdown.module.d.ts +0 -13
- package/lib/dropdown/index.d.ts +0 -2
- package/lib/form/form-field.component.d.ts +0 -8
- package/lib/form/form-field.module.d.ts +0 -10
- package/lib/form/form-hint.component.d.ts +0 -8
- package/lib/form/form.component.d.ts +0 -21
- package/lib/form/index.d.ts +0 -4
- package/lib/icon/icon.component.d.ts +0 -10
- package/lib/icon/icon.module.d.ts +0 -8
- package/lib/icon/index.d.ts +0 -2
- package/lib/input-mask/index.d.ts +0 -2
- package/lib/input-mask/input-mask.component.d.ts +0 -25
- package/lib/input-mask/input-mask.module.d.ts +0 -10
- package/lib/label/index.d.ts +0 -2
- package/lib/label/label.component.d.ts +0 -12
- package/lib/label/label.module.d.ts +0 -8
- package/lib/loading/index.d.ts +0 -5
- package/lib/loading/loading-spinner.component.d.ts +0 -6
- package/lib/loading/loading.component.d.ts +0 -21
- package/lib/loading/loading.directive.d.ts +0 -22
- package/lib/loading/loading.module.d.ts +0 -13
- package/lib/loading/loading.service.d.ts +0 -48
- package/lib/menu/index.d.ts +0 -2
- package/lib/menu/menu.component.d.ts +0 -37
- package/lib/menu/menu.module.d.ts +0 -11
- package/lib/number-box/index.d.ts +0 -2
- package/lib/number-box/number-box.component.d.ts +0 -75
- package/lib/number-box/number-box.module.d.ts +0 -13
- package/lib/page/base-page.class.d.ts +0 -45
- package/lib/page/index.d.ts +0 -5
- package/lib/page/page-footer.component.d.ts +0 -7
- package/lib/page/page-header.component.d.ts +0 -7
- package/lib/page/page.component.d.ts +0 -14
- package/lib/page/page.module.d.ts +0 -8
- package/lib/password-box/index.d.ts +0 -2
- package/lib/password-box/password-box.component.d.ts +0 -23
- package/lib/password-box/password-box.module.d.ts +0 -12
- package/lib/picker/index.d.ts +0 -2
- package/lib/picker/picker.component.d.ts +0 -18
- package/lib/picker/picker.module.d.ts +0 -9
- package/lib/popover/index.d.ts +0 -2
- package/lib/popover/popover.component.d.ts +0 -46
- package/lib/popover/popover.module.d.ts +0 -8
- package/lib/popup/index.d.ts +0 -3
- package/lib/popup/popup.component.d.ts +0 -45
- package/lib/popup/popup.module.d.ts +0 -12
- package/lib/popup/popup.service.d.ts +0 -38
- package/lib/progress-bar/index.d.ts +0 -2
- package/lib/progress-bar/progress-bar.component.d.ts +0 -18
- package/lib/progress-bar/progress-bar.module.d.ts +0 -8
- package/lib/radio/index.d.ts +0 -2
- package/lib/radio/radio.component.d.ts +0 -17
- package/lib/radio/radio.module.d.ts +0 -9
- package/lib/range-slider/index.d.ts +0 -2
- package/lib/range-slider/range-slider.component.d.ts +0 -8
- package/lib/range-slider/range-slider.module.d.ts +0 -8
- package/lib/rating/index.d.ts +0 -2
- package/lib/rating/rating.component.d.ts +0 -21
- package/lib/rating/rating.component.module.d.ts +0 -8
- package/lib/result/index.d.ts +0 -2
- package/lib/result/result.component.d.ts +0 -12
- package/lib/result/result.module.d.ts +0 -8
- package/lib/selectbox/index.d.ts +0 -2
- package/lib/selectbox/selectbox.component.d.ts +0 -74
- package/lib/selectbox/selectbox.module.d.ts +0 -20
- package/lib/selection-list/index.d.ts +0 -2
- package/lib/selection-list/selection-list.component.d.ts +0 -21
- package/lib/selection-list/selection-list.module.d.ts +0 -13
- package/lib/switch/index.d.ts +0 -2
- package/lib/switch/switch.component.d.ts +0 -12
- package/lib/switch/switch.module.d.ts +0 -10
- package/lib/tabs/index.d.ts +0 -5
- package/lib/tabs/tab-content.directive.d.ts +0 -11
- package/lib/tabs/tab-item.component.d.ts +0 -49
- package/lib/tabs/tabs.class.d.ts +0 -6
- package/lib/tabs/tabs.component.d.ts +0 -24
- package/lib/tabs/tabs.module.d.ts +0 -12
- package/lib/textarea/index.d.ts +0 -2
- package/lib/textarea/textarea.component.d.ts +0 -12
- package/lib/textarea/textarea.module.d.ts +0 -9
- package/lib/textbox/index.d.ts +0 -2
- package/lib/textbox/textbox.component.d.ts +0 -16
- package/lib/textbox/textbox.module.d.ts +0 -13
- package/lib/time-box/index.d.ts +0 -2
- package/lib/time-box/time-box.component.d.ts +0 -48
- package/lib/time-box/time-box.module.d.ts +0 -11
- package/lib/toast/index.d.ts +0 -4
- package/lib/toast/toast.class.d.ts +0 -14
- package/lib/toast/toast.component.d.ts +0 -24
- package/lib/toast/toast.module.d.ts +0 -9
- package/lib/toast/toast.service.d.ts +0 -18
- package/lib/tooltip/index.d.ts +0 -3
- package/lib/tooltip/tooltip.component.d.ts +0 -10
- package/lib/tooltip/tooltip.directive.d.ts +0 -18
- package/lib/tooltip/tooltip.module.d.ts +0 -10
- package/lib/treeview/index.d.ts +0 -2
- package/lib/treeview/tree-view.component.d.ts +0 -33
- package/lib/treeview/tree-view.module.d.ts +0 -9
- package/lib/validation/index.d.ts +0 -2
- package/lib/validation/validation-rule.widget.d.ts +0 -25
- package/lib/validation/validation.class.d.ts +0 -17
- package/lib/validation/validation.module.d.ts +0 -9
- package/public-api.d.ts +0 -49
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { AXQueryBuilderGroup, AXQueryBuilderStringType } from './query-builder.class';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { AXPopupService } from '../popup/popup.service';
|
|
4
|
+
import { AXQueryBuilderPopupComponent } from './query-builder-popup/query-builder-popup.component';
|
|
5
|
+
import { AXToastService } from '../toast/toast.service';
|
|
6
|
+
import { AXDateTime } from '@acorex/core';
|
|
7
|
+
@Injectable({ providedIn: 'root' })
|
|
8
|
+
export class AXQueryBuilderService {
|
|
9
|
+
constructor(private popup: AXPopupService, private toast: AXToastService) { }
|
|
10
|
+
canOpen: boolean = false;
|
|
11
|
+
canRun: boolean = false;
|
|
12
|
+
public runQuery(group: AXQueryBuilderGroup, provideData) {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
this.canOpen = false;
|
|
15
|
+
for (let i = 0; i < group.items.length; i++) {
|
|
16
|
+
this.getNoValueRule(group.items[i]);
|
|
17
|
+
}
|
|
18
|
+
if (this.canOpen) {
|
|
19
|
+
this.canRun = true;
|
|
20
|
+
for (let i = 0; i < group.items.length; i++) {
|
|
21
|
+
if (this.canRun == true) {
|
|
22
|
+
this.findNullValue(group.items[i]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (this.canRun) {
|
|
26
|
+
this.popup.open(AXQueryBuilderPopupComponent, { data: { group: group, provideData: provideData }, title: 'دریافت مقادیر' }).then((c) => {
|
|
27
|
+
resolve(c);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
resolve(group);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
findNullValue(gr) {
|
|
37
|
+
if (this.canRun == true) {
|
|
38
|
+
if (gr.condition) {
|
|
39
|
+
for (let i = 0; i < gr.items.length; i++) {
|
|
40
|
+
this.findNullValue(gr.items[i]);
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
if (gr.onDemandLabel == '????|') {
|
|
44
|
+
this.canRun = false;
|
|
45
|
+
this.toast.error('لطفا نام متغیر های مورد نیاز را کامل کنید');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private getNoValueRule(gr) {
|
|
52
|
+
// for (let i = 0; i < gr.items.length; i++) {
|
|
53
|
+
if (gr.condition) {
|
|
54
|
+
for (let i = 0; i < gr.items.length; i++) {
|
|
55
|
+
this.getNoValueRule(gr.items[i]);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
if (gr.onDemandLabel?.indexOf('????') == 0) {
|
|
59
|
+
this.canOpen = true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async getQueryStringSimple(group: AXQueryBuilderGroup) {
|
|
67
|
+
return new Promise<string>(async (resolve, reject) => {
|
|
68
|
+
var query: string;
|
|
69
|
+
if (group.items.length > 0) {
|
|
70
|
+
query = ' ( ';
|
|
71
|
+
}
|
|
72
|
+
var id = 0;
|
|
73
|
+
for await (const iterator of group.items) {
|
|
74
|
+
const item: any = group.items[id];
|
|
75
|
+
|
|
76
|
+
if (item.condition) {
|
|
77
|
+
await this.getQueryStringSimple(item).then((c) => {
|
|
78
|
+
query = query + c;
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
let codeOperator: string = null;
|
|
82
|
+
switch (item.operator) {
|
|
83
|
+
case 'equal':
|
|
84
|
+
codeOperator = '==';
|
|
85
|
+
break;
|
|
86
|
+
case 'not-equal':
|
|
87
|
+
codeOperator = '!=';
|
|
88
|
+
break;
|
|
89
|
+
case 'not-null':
|
|
90
|
+
codeOperator = '!= null';
|
|
91
|
+
break;
|
|
92
|
+
case 'null':
|
|
93
|
+
codeOperator = '== null';
|
|
94
|
+
break;
|
|
95
|
+
case 'gt':
|
|
96
|
+
codeOperator = '>';
|
|
97
|
+
break;
|
|
98
|
+
case 'gte':
|
|
99
|
+
codeOperator = '>=';
|
|
100
|
+
break;
|
|
101
|
+
case 'lt':
|
|
102
|
+
codeOperator = '<';
|
|
103
|
+
break;
|
|
104
|
+
case 'lte':
|
|
105
|
+
codeOperator = '<=';
|
|
106
|
+
break;
|
|
107
|
+
case 'contains':
|
|
108
|
+
codeOperator = item.operator;
|
|
109
|
+
break;
|
|
110
|
+
case 'start-with':
|
|
111
|
+
codeOperator = item.operator;
|
|
112
|
+
break;
|
|
113
|
+
case 'end-with':
|
|
114
|
+
codeOperator = item.operator;
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
codeOperator = item.operator;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
if (item.dataType == 'datetime' && item.text && item.text != '' && item.text != null) {
|
|
121
|
+
query = query + ' ' + item.caption + ' ' + codeOperator + ' (' + AXDateTime.convert(item.text, 'jalali') + ')';
|
|
122
|
+
} else if (item.dataType != 'datetime') {
|
|
123
|
+
query = query + ' ' + item.caption + ' ' + codeOperator + ' ' + item.text;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
if (id !== group.items.length - 1 && query != ' ( ') {
|
|
128
|
+
query = query + ' ' + group.condition;
|
|
129
|
+
}
|
|
130
|
+
id += 1;
|
|
131
|
+
}
|
|
132
|
+
if (group.items.length > 0) {
|
|
133
|
+
query = query + ' ) ';
|
|
134
|
+
}
|
|
135
|
+
resolve(query);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public getQueryString(group: AXQueryBuilderGroup, type: AXQueryBuilderStringType): string {
|
|
140
|
+
let query = '';
|
|
141
|
+
switch (type) {
|
|
142
|
+
case 'simple':
|
|
143
|
+
if (group.items.length > 0) {
|
|
144
|
+
query = ' ( ';
|
|
145
|
+
}
|
|
146
|
+
for (let i = 0; i < group.items.length; i++) {
|
|
147
|
+
const item = group.items[i];
|
|
148
|
+
if (item instanceof AXQueryBuilderGroup) {
|
|
149
|
+
query = query + item.queryString;
|
|
150
|
+
} else {
|
|
151
|
+
query = query + ' ' + item.caption + ' ' + item.operator + ' ' + item.value;
|
|
152
|
+
}
|
|
153
|
+
if (i !== group.items.length - 1 && query != ' ( ') {
|
|
154
|
+
query = query + ' ' + group.condition;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (group.items.length > 0) {
|
|
158
|
+
query = query + ' ) ';
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
|
|
162
|
+
case 'elastic':
|
|
163
|
+
if (group.items.length > 0) {
|
|
164
|
+
query = ' ( ';
|
|
165
|
+
}
|
|
166
|
+
for (let i = 0; i < group.items.length; i++) {
|
|
167
|
+
const item = group.items[i];
|
|
168
|
+
if (item instanceof AXQueryBuilderGroup) {
|
|
169
|
+
query = query + item.queryStringElastic;
|
|
170
|
+
} else {
|
|
171
|
+
query = query + ' ' + item.dataField + ' ' + item.operator + ' ' + item.value;
|
|
172
|
+
}
|
|
173
|
+
if (i !== group.items.length - 1 && query != ' ( ') {
|
|
174
|
+
query = query + ' ' + group.condition;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (group.items.length > 0) {
|
|
178
|
+
query = query + ' ) ';
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
break;
|
|
182
|
+
case 'sql':
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return query;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<div class="d-flex align-items-center">
|
|
2
|
+
<ax-button #searchBtnTarget end icon="far fa-sliders-h icon" [selected]="_filterItems.length ? true:false"
|
|
3
|
+
[type]=" _filterItems.length ? 'primary':'primary outline'" [disabled]="disabled" [size]="size" [tabIndex]="-1"
|
|
4
|
+
(click)="handleButtonClick()"> {{'common.search' | trans}} <span *ngIf="_filterItems.length"
|
|
5
|
+
class="search-count">{{_filterItems.length}}</span></ax-button>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<ax-popover #searchPop [target]="searchBtnTarget"
|
|
9
|
+
[position]="{originX:'center',originY:'bottom',overlayX:'center',overlayY:'top',offsetY:50,offsetX:10}">
|
|
10
|
+
<div class="panel-box ax-dropdown-container-bordered" [ngStyle]="{'width' : popoverWidth }">
|
|
11
|
+
<ax-validation-form #form>
|
|
12
|
+
<ng-container *ngFor="let item of _items">
|
|
13
|
+
<div class="row">
|
|
14
|
+
<ng-container *ngFor="let prop of item.items">
|
|
15
|
+
<div *ngIf="prop.property.visible != false" class="{{renderCol(prop.property.col)}}">
|
|
16
|
+
<div>
|
|
17
|
+
<ax-label>{{prop.property.title}}</ax-label>
|
|
18
|
+
<ng-container ax-property-editor-renderer [validationForm]="form" [property]="prop"
|
|
19
|
+
[context]="_context" (onValueChange)="handleValueChange($event)"></ng-container>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</ng-container>
|
|
23
|
+
</div>
|
|
24
|
+
</ng-container>
|
|
25
|
+
<div class="footer-button">
|
|
26
|
+
<ax-button (click)="search()">{{'common.search' | trans}}</ax-button>
|
|
27
|
+
<ax-button type="blank danger" (click)="clear()">{{'dataGrid.clearFilter' | trans}}</ax-button>
|
|
28
|
+
</div>
|
|
29
|
+
</ax-validation-form>
|
|
30
|
+
</div>
|
|
31
|
+
</ax-popover>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.panel-box {
|
|
2
|
+
padding: 1rem;
|
|
3
|
+
|
|
4
|
+
.footer-button {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.5rem;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.search-count {
|
|
13
|
+
background: rgb(255 255 255 / 20%);
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
color: var(--ax-white-color);
|
|
16
|
+
padding: 0.125rem;
|
|
17
|
+
width: 1.75rem;
|
|
18
|
+
height: 1.75rem;
|
|
19
|
+
font-size: 0.875rem;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
margin-inline-start: 0.5rem;
|
|
24
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { AXConfig, AXDateTime } from '@acorex/core';
|
|
2
|
+
import { ChangeDetectorRef, Component, EventEmitter, Input, Output, QueryList, ViewChild, ViewChildren } from '@angular/core';
|
|
3
|
+
import * as _ from 'lodash';
|
|
4
|
+
import { AXElementSize } from '../base/element.class';
|
|
5
|
+
import { AXPopoverComponent } from '../popover/popover.component';
|
|
6
|
+
import { AXPropertyEditorRendererDirective } from '../property-editor/property-editor-renderer.directive';
|
|
7
|
+
import { AXPropertyColDef, AXPropertyConfig, AXProperyEditorValueChangeEvent, FilterModel } from '../property-editor/property-editor.class';
|
|
8
|
+
import { AXValidationFormComponent } from '../validation/validation-form.component';
|
|
9
|
+
|
|
10
|
+
export interface FilterTextItemsModel {
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
value: any;
|
|
14
|
+
textValue: string;
|
|
15
|
+
filterOptions?: FilterModel;
|
|
16
|
+
component: AXPropertyConfig;
|
|
17
|
+
uniqueNumber?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'ax-search-bar',
|
|
22
|
+
templateUrl: './search-bar.component.html',
|
|
23
|
+
styleUrls: ['./search-bar.component.scss']
|
|
24
|
+
})
|
|
25
|
+
export class AXSearchBarComponent {
|
|
26
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
27
|
+
|
|
28
|
+
@ViewChild('searchPop') searchPopover: AXPopoverComponent;
|
|
29
|
+
@ViewChildren(AXPropertyEditorRendererDirective) _editors: QueryList<AXPropertyEditorRendererDirective>;
|
|
30
|
+
@ViewChild(AXValidationFormComponent) form: AXValidationFormComponent;
|
|
31
|
+
|
|
32
|
+
@Input()
|
|
33
|
+
size: AXElementSize = 'md';
|
|
34
|
+
|
|
35
|
+
@Input()
|
|
36
|
+
disabled: boolean = false;
|
|
37
|
+
|
|
38
|
+
@Input()
|
|
39
|
+
fitParent: boolean = false;
|
|
40
|
+
|
|
41
|
+
@Input()
|
|
42
|
+
popoverWidth: string = '60%';
|
|
43
|
+
|
|
44
|
+
@Input()
|
|
45
|
+
rtl: boolean = AXConfig.get('layout.rtl');
|
|
46
|
+
|
|
47
|
+
@Input()
|
|
48
|
+
loadOnInit: boolean = false;
|
|
49
|
+
|
|
50
|
+
@Input()
|
|
51
|
+
public set items(v: AXPropertyConfig[]) {
|
|
52
|
+
this._defultValueCount = v.filter((x) => x.value);
|
|
53
|
+
v.forEach((el) => {
|
|
54
|
+
el.property.uniqueNumber = Math.random();
|
|
55
|
+
if (el.value != null) {
|
|
56
|
+
this._filterItems.push({
|
|
57
|
+
name: el.property.name,
|
|
58
|
+
title: el.property.title,
|
|
59
|
+
textValue: this._handleTextValue(el),
|
|
60
|
+
value: el.value ? this._handleDefultVlaue(el) : null,
|
|
61
|
+
component: el
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
this._items = _.chain(v)
|
|
66
|
+
.groupBy((x) => x.property.row)
|
|
67
|
+
.map((value, key) => ({ row: key, items: value }))
|
|
68
|
+
.value();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@Output()
|
|
72
|
+
onValueChange: EventEmitter<any> = new EventEmitter();
|
|
73
|
+
|
|
74
|
+
@Output()
|
|
75
|
+
onSearchValue: EventEmitter<FilterTextItemsModel[]> = new EventEmitter();
|
|
76
|
+
|
|
77
|
+
_items: any[] = [];
|
|
78
|
+
_filterItems: FilterTextItemsModel[] = [];
|
|
79
|
+
_filterItemsClone: FilterTextItemsModel[] = [];
|
|
80
|
+
_defultValueCount: any = [];
|
|
81
|
+
_context: any = {};
|
|
82
|
+
_isEmitted: boolean = false;
|
|
83
|
+
public clearItem(name: string) {
|
|
84
|
+
this._editors.find((x) => x.property.property.name === name).clear();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public refresh() {
|
|
88
|
+
this.loadOnInit = true;
|
|
89
|
+
this._defultValueCount = [];
|
|
90
|
+
this._filterItems = [];
|
|
91
|
+
this._filterItemsClone = [];
|
|
92
|
+
this.items = this._items[0].items;
|
|
93
|
+
this.cdr.detectChanges();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
handleButtonClick() {
|
|
97
|
+
this.searchPopover.open();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async handleValueChange(e: AXProperyEditorValueChangeEvent) {
|
|
101
|
+
await this._handleInitVlaue(e);
|
|
102
|
+
this.onValueChange.emit(e);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
handleItemRemoveClick(item: FilterTextItemsModel) {
|
|
106
|
+
this._editors.forEach((e) => {
|
|
107
|
+
if (e.property.property.name == item.name) {
|
|
108
|
+
e.clear();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this._filterItems = this._filterItems.filter((el) => el.name != item.name);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public search() {
|
|
115
|
+
this.form.validate().then((c) => {
|
|
116
|
+
if (c.result) {
|
|
117
|
+
this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value != null && el.value != '')));
|
|
118
|
+
this.searchPopover.close();
|
|
119
|
+
this.onSearchValue.emit(this._filterItems);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
clear() {
|
|
125
|
+
this._editors.forEach((e) => {
|
|
126
|
+
e.clear();
|
|
127
|
+
});
|
|
128
|
+
this._filterItems = [];
|
|
129
|
+
this._filterItemsClone = [];
|
|
130
|
+
this.searchPopover.close();
|
|
131
|
+
this.onSearchValue.emit(this._filterItems);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
renderCol(e: number | AXPropertyColDef) {
|
|
135
|
+
let className: string[] = [];
|
|
136
|
+
if (typeof e == 'number') {
|
|
137
|
+
className.push(`col-${e}`);
|
|
138
|
+
} else {
|
|
139
|
+
for (const key in e) {
|
|
140
|
+
switch (key) {
|
|
141
|
+
case 'lg':
|
|
142
|
+
className.push(`col-lg-${e[key]}`);
|
|
143
|
+
break;
|
|
144
|
+
case 'md':
|
|
145
|
+
className.push(`col-md-${e[key]}`);
|
|
146
|
+
break;
|
|
147
|
+
case 'sm':
|
|
148
|
+
className.push(`col-sm-${e[key]}`);
|
|
149
|
+
break;
|
|
150
|
+
case 'xs':
|
|
151
|
+
className.push(`col-xs-${e[key]}`);
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return className.toString().replace(/,/g, ' ');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
_handleShowTitleSelected(item) {
|
|
160
|
+
if (item.title) {
|
|
161
|
+
return item.title + ':';
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
_handleShowValueSelected(item) {
|
|
166
|
+
if (item.component.property.editorClass === 'ax/editors/check') {
|
|
167
|
+
return item.component.property.editorOptions.label;
|
|
168
|
+
} else {
|
|
169
|
+
return item.textValue;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
private _handleTextValue(dataItem: any) {
|
|
174
|
+
let text = '';
|
|
175
|
+
if (Array.isArray(dataItem.value)) {
|
|
176
|
+
if (dataItem.value.length) {
|
|
177
|
+
dataItem.value.forEach((element, index) => {
|
|
178
|
+
text +=
|
|
179
|
+
index === dataItem.value.length - 1
|
|
180
|
+
? element[dataItem.property.editorOptions.textField]
|
|
181
|
+
: element[dataItem.property.editorOptions.textField] + ',';
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return text;
|
|
185
|
+
} else if (dataItem.property.editorClass === 'ax/editors/date') {
|
|
186
|
+
if (dataItem.value) {
|
|
187
|
+
return new AXDateTime(dataItem.value, 'jalali').format('yyyy/MM/DD');
|
|
188
|
+
} else {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private async _handleDefultVlaue(dataItem: any) {
|
|
197
|
+
await this._handleInitVlaue(dataItem);
|
|
198
|
+
this._filterItems = JSON.parse(JSON.stringify(this._filterItemsClone.filter((el) => el.value != null && el.value != '')));
|
|
199
|
+
if (this._filterItems.length === this._defultValueCount.length && this.loadOnInit && !this._isEmitted) {
|
|
200
|
+
this._isEmitted = true;
|
|
201
|
+
this.onSearchValue.emit(this._filterItems);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
private async _handleInitVlaue(e) {
|
|
206
|
+
let value = [];
|
|
207
|
+
let text: any = [];
|
|
208
|
+
if (e.property.editorOptions?.valueField && e.value != null) {
|
|
209
|
+
if (e.property.editorOptions.returnAllData) {
|
|
210
|
+
value = e.value;
|
|
211
|
+
text = await this._handleTextValue(e);
|
|
212
|
+
} else if (e.property.editorOptions?.mode == 'multiple') {
|
|
213
|
+
e.value.forEach((element) => {
|
|
214
|
+
value.push(element[e.property.editorOptions.valueField]);
|
|
215
|
+
text.push(element[e.property.editorOptions.textField]);
|
|
216
|
+
});
|
|
217
|
+
} else {
|
|
218
|
+
if (e.value.length) {
|
|
219
|
+
value = e.value[0][e.property.editorOptions.valueField];
|
|
220
|
+
text = e.value[0][e.property.editorOptions.textField];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
} else {
|
|
224
|
+
value = e.value;
|
|
225
|
+
text = e.value;
|
|
226
|
+
}
|
|
227
|
+
const findEl = this._filterItemsClone.find((el) => el.uniqueNumber == e.property.uniqueNumber);
|
|
228
|
+
if (findEl) {
|
|
229
|
+
findEl.value = value;
|
|
230
|
+
findEl.textValue = e.property.editorClass === 'ax/editors/date' ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD') : text;
|
|
231
|
+
} else if (e.value != null) {
|
|
232
|
+
this._filterItemsClone.push({
|
|
233
|
+
name: e.property.name,
|
|
234
|
+
title: e.property.title,
|
|
235
|
+
uniqueNumber: e.property.uniqueNumber,
|
|
236
|
+
value,
|
|
237
|
+
textValue: e.property.editorClass === 'ax/editors/date' ? new AXDateTime(text, 'jalali').format('yyyy/MM/DD') : text,
|
|
238
|
+
component: e,
|
|
239
|
+
filterOptions: {
|
|
240
|
+
filters: e.property?.filterOptions?.filters ? e.property.filterOptions.filters : [],
|
|
241
|
+
logic: e.property?.filterOptions?.logic ? e.property.filterOptions.logic : 'and',
|
|
242
|
+
ignoreCase: e.property?.filterOptions?.ignoreCase ? e.property.filterOptions.ignoreCase : true,
|
|
243
|
+
joinType: e.property?.filterOptions?.joinType ? e.property.filterOptions.joinType : 'INNER',
|
|
244
|
+
operator: e.property?.filterOptions?.operator ? e.property.filterOptions.operator : null,
|
|
245
|
+
truncateDate: e.property?.filterOptions?.truncateDate ? e.property.filterOptions.truncateDate : true
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AXTranslatorModule } from '@acorex/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NgModule } from '@angular/core';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { AXButtonModule } from '../button/button.module';
|
|
6
|
+
import { AXDropdownModule } from '../dropdown/dropdown.module';
|
|
7
|
+
import { AXFormGroupModule } from '../form-group/form-group.module';
|
|
8
|
+
import { AXLabelModule } from '../label/label.module';
|
|
9
|
+
import { AXPopoverModule } from '../popover/popover.module';
|
|
10
|
+
import { AXProppertyEditorModule } from '../property-editor/property-editor.module';
|
|
11
|
+
import { AXTextBoxModule } from '../textbox/textbox.module';
|
|
12
|
+
import { AXValidationModule } from '../validation/validation.module';
|
|
13
|
+
import { AXSearchBarComponent } from './search-bar.component';
|
|
14
|
+
|
|
15
|
+
@NgModule({
|
|
16
|
+
declarations: [AXSearchBarComponent],
|
|
17
|
+
imports: [
|
|
18
|
+
CommonModule,
|
|
19
|
+
FormsModule,
|
|
20
|
+
AXDropdownModule,
|
|
21
|
+
AXButtonModule,
|
|
22
|
+
AXTextBoxModule,
|
|
23
|
+
AXProppertyEditorModule,
|
|
24
|
+
AXFormGroupModule,
|
|
25
|
+
AXLabelModule,
|
|
26
|
+
AXTranslatorModule,
|
|
27
|
+
AXValidationModule,
|
|
28
|
+
AXPopoverModule
|
|
29
|
+
],
|
|
30
|
+
exports: [AXSearchBarComponent],
|
|
31
|
+
providers: []
|
|
32
|
+
})
|
|
33
|
+
export class AXSearchBarModule {}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div class="ax form-item" [class.disabled]="disabled" [attr.id]="uid">
|
|
2
|
+
<div class="ax items-wrapper">
|
|
3
|
+
<ng-content select="[start]">
|
|
4
|
+
</ng-content>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="content" #content>
|
|
7
|
+
<div class="ax input form-control {{size}}" [class.disabled]="disabled" [class.readonly]="readonly"
|
|
8
|
+
[class.icon]="icon">
|
|
9
|
+
<input #input type="text" class="ax {{size}}" [(ngModel)]="value"
|
|
10
|
+
(input)="onSearchChanged($event.target.value)" [placeholder]="placeholder" [readonly]="readonly"
|
|
11
|
+
[disabled]="disabled" [ngClass]="setTextAlign()" [class.clear]="value && allowClear"
|
|
12
|
+
(focus)="handleInputFocus($event)" (blur)="handleInputBlur($event)" (keyup)="handleKeyEvent($event)"
|
|
13
|
+
(keydown)="handleKeyEvent($event)">
|
|
14
|
+
<i class="{{icon}}" *ngIf="icon"></i>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="ax items-wrapper">
|
|
18
|
+
<ax-button [size]="size" *ngIf="value && allowClear" icon="far fa-times" type="danger blank" (click)="clear()" [tabIndex]="-1">
|
|
19
|
+
</ax-button>
|
|
20
|
+
<ax-button [size]="size" type="light blank" icon="far fa-search" end (click)="click($event)" [tabIndex]="-1">
|
|
21
|
+
</ax-button>
|
|
22
|
+
<ng-content select="[end]">
|
|
23
|
+
</ng-content>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectorRef, ElementRef, ChangeDetectionStrategy, ViewChild } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
4
|
+
import { AXBaseTextComponent } from '../base/element.class';
|
|
5
|
+
import { AXBaseEvent, AXValueEvent } from '../base/events.class';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'ax-search-box',
|
|
10
|
+
templateUrl: './searchbox.component.html',
|
|
11
|
+
host: { style:'width: 100%' },
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
13
|
+
})
|
|
14
|
+
export class AXSearchBoxComponent extends AXBaseTextComponent {
|
|
15
|
+
|
|
16
|
+
@Output()
|
|
17
|
+
public textChanged: EventEmitter<AXValueEvent<any>> = new EventEmitter<AXValueEvent<any>>();
|
|
18
|
+
@Output()
|
|
19
|
+
onButtonClick: EventEmitter<AXValueEvent<any>> = new EventEmitter<AXValueEvent<any>>();
|
|
20
|
+
|
|
21
|
+
@Input()
|
|
22
|
+
placeholder: string = 'جستجو ...';
|
|
23
|
+
|
|
24
|
+
constructor(protected cdr: ChangeDetectorRef, ref: ElementRef) {
|
|
25
|
+
super(cdr, ref);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private _text: string;
|
|
29
|
+
@Input()
|
|
30
|
+
public get text(): string {
|
|
31
|
+
return this._text;
|
|
32
|
+
}
|
|
33
|
+
public set text(v: string) {
|
|
34
|
+
if (v !== this._text) {
|
|
35
|
+
const old = this._text;
|
|
36
|
+
this._text = v;
|
|
37
|
+
this.textChanged.emit({
|
|
38
|
+
component: this,
|
|
39
|
+
value: v,
|
|
40
|
+
oldValue: old
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
this.value = '';
|
|
47
|
+
this.text = '';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onSearchChanged(text: string) {
|
|
51
|
+
if (!this.searchChangeObserver) {
|
|
52
|
+
Observable.create(observer => {
|
|
53
|
+
|
|
54
|
+
this.searchChangeObserver = observer;
|
|
55
|
+
})
|
|
56
|
+
.pipe(debounceTime(this.delay))
|
|
57
|
+
.pipe(distinctUntilChanged())
|
|
58
|
+
.subscribe(c => {
|
|
59
|
+
this.text = c;
|
|
60
|
+
this.value = c;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
this.searchChangeObserver.next(text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@Input()
|
|
68
|
+
delay: number = 500;
|
|
69
|
+
|
|
70
|
+
private searchChangeObserver: any;
|
|
71
|
+
|
|
72
|
+
handleKeyEvent(e: KeyboardEvent) {
|
|
73
|
+
// this.searchChangeObserver.next(this.text);
|
|
74
|
+
this.onkey.emit(e);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
click(e: MouseEvent) {
|
|
78
|
+
this.onButtonClick.emit({
|
|
79
|
+
component: this,
|
|
80
|
+
htmlElement: this.ref.nativeElement,
|
|
81
|
+
value: this.text
|
|
82
|
+
});
|
|
83
|
+
// this.searchChangeObserver.next(this.text);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { AXSearchBoxComponent } from './searchbox.component';
|
|
4
|
+
import { AXTextBoxModule } from '../textbox/textbox.module';
|
|
5
|
+
import { AXButtonModule } from '../button/button.module';
|
|
6
|
+
import { AXFormGroupModule } from '../form-group/form-group.module';
|
|
7
|
+
import { AXTranslatorModule } from '@acorex/core';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
declarations: [AXSearchBoxComponent],
|
|
13
|
+
imports: [CommonModule, AXTextBoxModule, AXButtonModule, AXFormGroupModule, AXTranslatorModule, FormsModule],
|
|
14
|
+
exports: [AXSearchBoxComponent],
|
|
15
|
+
providers: []
|
|
16
|
+
})
|
|
17
|
+
export class AXSearchBoxModule { }
|