ngx-axis-appforge 0.0.0
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/.editorconfig +17 -0
- package/README.md +111 -0
- package/angular.json +40 -0
- package/axis-components/badge/badge.css +3 -0
- package/axis-components/badge/badge.html +20 -0
- package/axis-components/badge/badge.options.ts +23 -0
- package/axis-components/badge/badge.ts +17 -0
- package/axis-components/badge/design/config.ts +52 -0
- package/axis-components/badge/design/ng-package.json +5 -0
- package/axis-components/badge/design/setting/setting.css +0 -0
- package/axis-components/badge/design/setting/setting.html +181 -0
- package/axis-components/badge/design/setting/setting.ts +126 -0
- package/axis-components/badge/ng-package.json +5 -0
- package/axis-components/button/button.css +3 -0
- package/axis-components/button/button.html +13 -0
- package/axis-components/button/button.options.ts +17 -0
- package/axis-components/button/button.ts +56 -0
- package/axis-components/button/design/config.ts +30 -0
- package/axis-components/button/design/ng-package.json +5 -0
- package/axis-components/button/design/setting/setting.css +0 -0
- package/axis-components/button/design/setting/setting.html +151 -0
- package/axis-components/button/design/setting/setting.ts +76 -0
- package/axis-components/button/ng-package.json +5 -0
- package/axis-components/cmp-map.ts +52 -0
- package/axis-components/cmplib.ts +9 -0
- package/axis-components/desc/desc.css +8 -0
- package/axis-components/desc/desc.html +19 -0
- package/axis-components/desc/desc.options.ts +24 -0
- package/axis-components/desc/desc.ts +29 -0
- package/axis-components/desc/design/config.ts +113 -0
- package/axis-components/desc/design/desc-item-setting/desc-item-setting.css +0 -0
- package/axis-components/desc/design/desc-item-setting/desc-item-setting.html +47 -0
- package/axis-components/desc/design/desc-item-setting/desc-item-setting.ts +40 -0
- package/axis-components/desc/design/desc-items-menu/desc-items-menu.css +0 -0
- package/axis-components/desc/design/desc-items-menu/desc-items-menu.html +9 -0
- package/axis-components/desc/design/desc-items-menu/desc-items-menu.ts +23 -0
- package/axis-components/desc/design/desc-setting/desc-setting.css +0 -0
- package/axis-components/desc/design/desc-setting/desc-setting.html +76 -0
- package/axis-components/desc/design/desc-setting/desc-setting.ts +51 -0
- package/axis-components/desc/design/ng-package.json +5 -0
- package/axis-components/desc/ng-package.json +5 -0
- package/axis-components/design/cmplib/cmplib.css +5 -0
- package/axis-components/design/cmplib/cmplib.html +52 -0
- package/axis-components/design/cmplib/cmplib.ts +96 -0
- package/axis-components/design/design/config.ts +29 -0
- package/axis-components/design/design/ng-package.json +5 -0
- package/axis-components/design/design/setting/setting.css +0 -0
- package/axis-components/design/design/setting/setting.html +33 -0
- package/axis-components/design/design/setting/setting.ts +33 -0
- package/axis-components/design/design.css +15 -0
- package/axis-components/design/design.html +51 -0
- package/axis-components/design/design.options.ts +9 -0
- package/axis-components/design/design.ts +509 -0
- package/axis-components/design/ng-package.json +5 -0
- package/axis-components/design/preview/drag.service.ts +148 -0
- package/axis-components/design/preview/drop-handler.ts +56 -0
- package/axis-components/design/preview/preview.css +3 -0
- package/axis-components/design/preview/preview.html +1 -0
- package/axis-components/design/preview/preview.ts +250 -0
- package/axis-components/design/preview/select.service.ts +140 -0
- package/axis-components/design/shortcut-key.ts +160 -0
- package/axis-components/design/toolbar/toolbar.css +24 -0
- package/axis-components/design/toolbar/toolbar.html +96 -0
- package/axis-components/design/toolbar/toolbar.ts +65 -0
- package/axis-components/design/tree/drag-drop.ts +125 -0
- package/axis-components/design/tree/tree.css +30 -0
- package/axis-components/design/tree/tree.html +49 -0
- package/axis-components/design/tree/tree.ts +292 -0
- package/axis-components/dynamic-container/design/config.ts +30 -0
- package/axis-components/dynamic-container/design/ng-package.json +5 -0
- package/axis-components/dynamic-container/design/setting/setting.css +0 -0
- package/axis-components/dynamic-container/design/setting/setting.html +20 -0
- package/axis-components/dynamic-container/design/setting/setting.ts +30 -0
- package/axis-components/dynamic-container/dynamic-container.css +3 -0
- package/axis-components/dynamic-container/dynamic-container.html +2 -0
- package/axis-components/dynamic-container/dynamic-container.options.ts +6 -0
- package/axis-components/dynamic-container/dynamic-container.ts +17 -0
- package/axis-components/dynamic-container/ng-package.json +5 -0
- package/axis-components/editor/editor.css +47 -0
- package/axis-components/editor/editor.html +10 -0
- package/axis-components/editor/editor.options.ts +10 -0
- package/axis-components/editor/editor.ts +86 -0
- package/axis-components/editor/ng-package.json +5 -0
- package/axis-components/examples/examples/badge.ts +17 -0
- package/axis-components/examples/examples/button.ts +38 -0
- package/axis-components/examples/examples/desc.ts +31 -0
- package/axis-components/examples/examples/design.ts +15 -0
- package/axis-components/examples/examples/dynamic-container.ts +21 -0
- package/axis-components/examples/examples/flex.ts +18 -0
- package/axis-components/examples/examples/form-item.ts +39 -0
- package/axis-components/examples/examples/form.ts +315 -0
- package/axis-components/examples/examples/icon.ts +16 -0
- package/axis-components/examples/examples/image.ts +15 -0
- package/axis-components/examples/examples/input-component.ts +15 -0
- package/axis-components/examples/examples/input-icon.ts +15 -0
- package/axis-components/examples/examples/input-json.ts +15 -0
- package/axis-components/examples/examples/input-number.ts +15 -0
- package/axis-components/examples/examples/input.ts +15 -0
- package/axis-components/examples/examples/modal.ts +15 -0
- package/axis-components/examples/examples/scope.ts +17 -0
- package/axis-components/examples/examples/single-selector.ts +25 -0
- package/axis-components/examples/examples/splitter.ts +36 -0
- package/axis-components/examples/examples/table.ts +126 -0
- package/axis-components/examples/examples/text.ts +15 -0
- package/axis-components/examples/examples/textarea.ts +15 -0
- package/axis-components/examples/examples/tree-selector.ts +35 -0
- package/axis-components/examples/examples/upload.ts +15 -0
- package/axis-components/examples/examples.ts +73 -0
- package/axis-components/flex/design/config.ts +49 -0
- package/axis-components/flex/design/ng-package.json +5 -0
- package/axis-components/flex/design/setting/setting.css +0 -0
- package/axis-components/flex/design/setting/setting.html +72 -0
- package/axis-components/flex/design/setting/setting.ts +43 -0
- package/axis-components/flex/flex.css +5 -0
- package/axis-components/flex/flex.html +6 -0
- package/axis-components/flex/flex.options.ts +12 -0
- package/axis-components/flex/flex.ts +15 -0
- package/axis-components/flex/ng-package.json +5 -0
- package/axis-components/form/design/config.ts +71 -0
- package/axis-components/form/design/ng-package.json +5 -0
- package/axis-components/form/design/setting/setting.css +0 -0
- package/axis-components/form/design/setting/setting.html +21 -0
- package/axis-components/form/design/setting/setting.ts +31 -0
- package/axis-components/form/form.css +3 -0
- package/axis-components/form/form.html +3 -0
- package/axis-components/form/form.options.ts +9 -0
- package/axis-components/form/form.ts +121 -0
- package/axis-components/form/ng-package.json +5 -0
- package/axis-components/form-item/design/config.ts +43 -0
- package/axis-components/form-item/design/ng-package.json +5 -0
- package/axis-components/form-item/design/setting/input-validator/input-validator.css +8 -0
- package/axis-components/form-item/design/setting/input-validator/input-validator.html +140 -0
- package/axis-components/form-item/design/setting/input-validator/input-validator.ts +158 -0
- package/axis-components/form-item/design/setting/setting.css +0 -0
- package/axis-components/form-item/design/setting/setting.html +39 -0
- package/axis-components/form-item/design/setting/setting.ts +40 -0
- package/axis-components/form-item/form-item.css +4 -0
- package/axis-components/form-item/form-item.html +16 -0
- package/axis-components/form-item/form-item.options.ts +12 -0
- package/axis-components/form-item/form-item.ts +128 -0
- package/axis-components/form-item/ng-package.json +5 -0
- package/axis-components/icon/design/config.ts +29 -0
- package/axis-components/icon/design/ng-package.json +5 -0
- package/axis-components/icon/design/setting/setting.css +0 -0
- package/axis-components/icon/design/setting/setting.html +67 -0
- package/axis-components/icon/design/setting/setting.ts +48 -0
- package/axis-components/icon/icon.css +0 -0
- package/axis-components/icon/icon.html +7 -0
- package/axis-components/icon/icon.options.ts +10 -0
- package/axis-components/icon/icon.ts +17 -0
- package/axis-components/icon/ng-package.json +5 -0
- package/axis-components/image/design/config.ts +30 -0
- package/axis-components/image/design/ng-package.json +5 -0
- package/axis-components/image/design/setting/setting.css +0 -0
- package/axis-components/image/design/setting/setting.html +42 -0
- package/axis-components/image/design/setting/setting.ts +37 -0
- package/axis-components/image/image.css +58 -0
- package/axis-components/image/image.html +14 -0
- package/axis-components/image/image.options.ts +8 -0
- package/axis-components/image/image.ts +29 -0
- package/axis-components/image/ng-package.json +5 -0
- package/axis-components/input/design/config.ts +80 -0
- package/axis-components/input/design/ng-package.json +5 -0
- package/axis-components/input/design/setting/setting.css +0 -0
- package/axis-components/input/design/setting/setting.html +79 -0
- package/axis-components/input/design/setting/setting.ts +51 -0
- package/axis-components/input/input.css +4 -0
- package/axis-components/input/input.html +32 -0
- package/axis-components/input/input.options.ts +14 -0
- package/axis-components/input/input.ts +53 -0
- package/axis-components/input/ng-package.json +5 -0
- package/axis-components/input-component/design/config.ts +30 -0
- package/axis-components/input-component/design/ng-package.json +5 -0
- package/axis-components/input-component/design/setting/setting.css +0 -0
- package/axis-components/input-component/design/setting/setting.html +33 -0
- package/axis-components/input-component/design/setting/setting.ts +33 -0
- package/axis-components/input-component/input-component.css +4 -0
- package/axis-components/input-component/input-component.html +25 -0
- package/axis-components/input-component/input-component.options.ts +7 -0
- package/axis-components/input-component/input-component.ts +50 -0
- package/axis-components/input-component/ng-package.json +5 -0
- package/axis-components/input-icon/design/config.ts +30 -0
- package/axis-components/input-icon/design/ng-package.json +5 -0
- package/axis-components/input-icon/design/setting/setting.css +0 -0
- package/axis-components/input-icon/design/setting/setting.html +29 -0
- package/axis-components/input-icon/design/setting/setting.ts +33 -0
- package/axis-components/input-icon/input-icon.css +4 -0
- package/axis-components/input-icon/input-icon.html +70 -0
- package/axis-components/input-icon/input-icon.options.ts +7 -0
- package/axis-components/input-icon/input-icon.ts +51 -0
- package/axis-components/input-icon/ng-package.json +5 -0
- package/axis-components/input-json/design/config.ts +29 -0
- package/axis-components/input-json/design/ng-package.json +5 -0
- package/axis-components/input-json/design/setting/setting.css +0 -0
- package/axis-components/input-json/design/setting/setting.html +7 -0
- package/axis-components/input-json/design/setting/setting.ts +26 -0
- package/axis-components/input-json/input-json.css +4 -0
- package/axis-components/input-json/input-json.html +19 -0
- package/axis-components/input-json/input-json.ts +67 -0
- package/axis-components/input-json/ng-package.json +5 -0
- package/axis-components/input-number/design/config.ts +30 -0
- package/axis-components/input-number/design/ng-package.json +5 -0
- package/axis-components/input-number/design/setting/setting.css +0 -0
- package/axis-components/input-number/design/setting/setting.html +118 -0
- package/axis-components/input-number/design/setting/setting.ts +66 -0
- package/axis-components/input-number/input-number.css +22 -0
- package/axis-components/input-number/input-number.html +11 -0
- package/axis-components/input-number/input-number.options.ts +17 -0
- package/axis-components/input-number/input-number.ts +30 -0
- package/axis-components/input-number/ng-package.json +5 -0
- package/axis-components/modal/design/config.ts +50 -0
- package/axis-components/modal/design/ng-package.json +5 -0
- package/axis-components/modal/design/set-modal-visible-handler/set-modal-visible-handler.css +0 -0
- package/axis-components/modal/design/set-modal-visible-handler/set-modal-visible-handler.html +15 -0
- package/axis-components/modal/design/set-modal-visible-handler/set-modal-visible-handler.ts +34 -0
- package/axis-components/modal/design/setting/setting.css +0 -0
- package/axis-components/modal/design/setting/setting.html +139 -0
- package/axis-components/modal/design/setting/setting.ts +92 -0
- package/axis-components/modal/modal.css +0 -0
- package/axis-components/modal/modal.html +7 -0
- package/axis-components/modal/modal.options.ts +20 -0
- package/axis-components/modal/modal.ts +57 -0
- package/axis-components/modal/ng-package.json +5 -0
- package/axis-components/ng-package.json +5 -0
- package/axis-components/scope/design/config.ts +59 -0
- package/axis-components/scope/design/ng-package.json +5 -0
- package/axis-components/scope/design/setting/datasource-editor/datasource-editor.css +28 -0
- package/axis-components/scope/design/setting/datasource-editor/datasource-editor.html +188 -0
- package/axis-components/scope/design/setting/datasource-editor/datasource-editor.ts +245 -0
- package/axis-components/scope/design/setting/setting.css +0 -0
- package/axis-components/scope/design/setting/setting.html +19 -0
- package/axis-components/scope/design/setting/setting.ts +30 -0
- package/axis-components/scope/ng-package.json +5 -0
- package/axis-components/scope/scope.css +6 -0
- package/axis-components/scope/scope.html +4 -0
- package/axis-components/scope/scope.options.ts +8 -0
- package/axis-components/scope/scope.ts +48 -0
- package/axis-components/single-selector/design/config.ts +30 -0
- package/axis-components/single-selector/design/ng-package.json +5 -0
- package/axis-components/single-selector/design/setting/setting.css +0 -0
- package/axis-components/single-selector/design/setting/setting.html +164 -0
- package/axis-components/single-selector/design/setting/setting.ts +80 -0
- package/axis-components/single-selector/ng-package.json +5 -0
- package/axis-components/single-selector/single-selector.css +8 -0
- package/axis-components/single-selector/single-selector.html +51 -0
- package/axis-components/single-selector/single-selector.options.ts +22 -0
- package/axis-components/single-selector/single-selector.ts +80 -0
- package/axis-components/splitter/design/config.ts +84 -0
- package/axis-components/splitter/design/ng-package.json +5 -0
- package/axis-components/splitter/design/splitter-menu/splitter-menu.css +0 -0
- package/axis-components/splitter/design/splitter-menu/splitter-menu.html +10 -0
- package/axis-components/splitter/design/splitter-menu/splitter-menu.ts +22 -0
- package/axis-components/splitter/design/splitter-panel-setting/splitter-panel-setting.css +0 -0
- package/axis-components/splitter/design/splitter-panel-setting/splitter-panel-setting.html +66 -0
- package/axis-components/splitter/design/splitter-panel-setting/splitter-panel-setting.ts +47 -0
- package/axis-components/splitter/design/splitter-setting/splitter-setting.css +0 -0
- package/axis-components/splitter/design/splitter-setting/splitter-setting.html +28 -0
- package/axis-components/splitter/design/splitter-setting/splitter-setting.ts +30 -0
- package/axis-components/splitter/ng-package.json +5 -0
- package/axis-components/splitter/splitter.css +7 -0
- package/axis-components/splitter/splitter.html +12 -0
- package/axis-components/splitter/splitter.options.ts +18 -0
- package/axis-components/splitter/splitter.ts +29 -0
- package/axis-components/table/design/config.ts +147 -0
- package/axis-components/table/design/ng-package.json +5 -0
- package/axis-components/table/design/table-field-setting/table-field-setting.css +0 -0
- package/axis-components/table/design/table-field-setting/table-field-setting.html +259 -0
- package/axis-components/table/design/table-field-setting/table-field-setting.ts +105 -0
- package/axis-components/table/design/table-fields-menu/table-fields-menu.css +0 -0
- package/axis-components/table/design/table-fields-menu/table-fields-menu.html +9 -0
- package/axis-components/table/design/table-fields-menu/table-fields-menu.ts +24 -0
- package/axis-components/table/design/table-setting/table-setting.css +0 -0
- package/axis-components/table/design/table-setting/table-setting.html +417 -0
- package/axis-components/table/design/table-setting/table-setting.ts +173 -0
- package/axis-components/table/expand.ts +12 -0
- package/axis-components/table/ng-package.json +5 -0
- package/axis-components/table/select.ts +66 -0
- package/axis-components/table/table-setter/table-setter.css +55 -0
- package/axis-components/table/table-setter/table-setter.html +38 -0
- package/axis-components/table/table-setter/table-setter.ts +121 -0
- package/axis-components/table/table.css +5 -0
- package/axis-components/table/table.html +191 -0
- package/axis-components/table/table.options.ts +72 -0
- package/axis-components/table/table.ts +204 -0
- package/axis-components/text/design/config.ts +30 -0
- package/axis-components/text/design/ng-package.json +5 -0
- package/axis-components/text/design/setting/setting.css +0 -0
- package/axis-components/text/design/setting/setting.html +84 -0
- package/axis-components/text/design/setting/setting.ts +54 -0
- package/axis-components/text/ng-package.json +5 -0
- package/axis-components/text/text.css +3 -0
- package/axis-components/text/text.html +17 -0
- package/axis-components/text/text.options.ts +10 -0
- package/axis-components/text/text.ts +54 -0
- package/axis-components/textarea/design/config.ts +30 -0
- package/axis-components/textarea/design/ng-package.json +5 -0
- package/axis-components/textarea/design/setting/setting.css +0 -0
- package/axis-components/textarea/design/setting/setting.html +76 -0
- package/axis-components/textarea/design/setting/setting.ts +55 -0
- package/axis-components/textarea/ng-package.json +5 -0
- package/axis-components/textarea/textarea.css +4 -0
- package/axis-components/textarea/textarea.html +11 -0
- package/axis-components/textarea/textarea.options.ts +13 -0
- package/axis-components/textarea/textarea.ts +49 -0
- package/axis-components/tree-selector/design/config.ts +55 -0
- package/axis-components/tree-selector/design/ng-package.json +5 -0
- package/axis-components/tree-selector/design/tree-selector-menu/tree-selector-menu.css +0 -0
- package/axis-components/tree-selector/design/tree-selector-menu/tree-selector-menu.html +9 -0
- package/axis-components/tree-selector/design/tree-selector-menu/tree-selector-menu.ts +26 -0
- package/axis-components/tree-selector/design/tree-selector-menu-setting/tree-selector-menu-setting.css +0 -0
- package/axis-components/tree-selector/design/tree-selector-menu-setting/tree-selector-menu-setting.html +80 -0
- package/axis-components/tree-selector/design/tree-selector-menu-setting/tree-selector-menu-setting.ts +58 -0
- package/axis-components/tree-selector/design/tree-selector-setting/tree-selector-setting.css +0 -0
- package/axis-components/tree-selector/design/tree-selector-setting/tree-selector-setting.html +235 -0
- package/axis-components/tree-selector/design/tree-selector-setting/tree-selector-setting.ts +87 -0
- package/axis-components/tree-selector/ng-package.json +5 -0
- package/axis-components/tree-selector/tree-selector.css +43 -0
- package/axis-components/tree-selector/tree-selector.html +65 -0
- package/axis-components/tree-selector/tree-selector.options.ts +50 -0
- package/axis-components/tree-selector/tree-selector.ts +252 -0
- package/axis-components/upload/design/config.ts +37 -0
- package/axis-components/upload/design/ng-package.json +5 -0
- package/axis-components/upload/design/setting/setting.css +0 -0
- package/axis-components/upload/design/setting/setting.html +288 -0
- package/axis-components/upload/design/setting/setting.ts +96 -0
- package/axis-components/upload/ng-package.json +5 -0
- package/axis-components/upload/upload.css +3 -0
- package/axis-components/upload/upload.html +36 -0
- package/axis-components/upload/upload.options.ts +29 -0
- package/axis-components/upload/upload.ts +130 -0
- package/axis-components-covers/badge.svg +1 -0
- package/axis-components-covers/button.svg +14 -0
- package/axis-components-covers/desc.svg +39 -0
- package/axis-components-covers/design.jpg +0 -0
- package/axis-components-covers/dynamic-container.svg +9 -0
- package/axis-components-covers/flex.svg +33 -0
- package/axis-components-covers/form-item.svg +22 -0
- package/axis-components-covers/form.svg +38 -0
- package/axis-components-covers/icon.svg +22 -0
- package/axis-components-covers/image.svg +13 -0
- package/axis-components-covers/input-component.svg +27 -0
- package/axis-components-covers/input-icon.svg +29 -0
- package/axis-components-covers/input-json.svg +29 -0
- package/axis-components-covers/input-number.svg +35 -0
- package/axis-components-covers/input.svg +21 -0
- package/axis-components-covers/modal.svg +23 -0
- package/axis-components-covers/scope.svg +9 -0
- package/axis-components-covers/single-selector.svg +20 -0
- package/axis-components-covers/splitter.svg +8 -0
- package/axis-components-covers/table.svg +27 -0
- package/axis-components-covers/text.svg +22 -0
- package/axis-components-covers/textarea.svg +9 -0
- package/axis-components-covers/tree-selector.svg +77 -0
- package/axis-components-covers/upload.svg +26 -0
- package/core/base/base-menu.ts +22 -0
- package/core/base/base.ts +143 -0
- package/core/base/design-builder.ts +8 -0
- package/core/base/funfield-base.ts +106 -0
- package/core/base/funfield-value-base.ts +53 -0
- package/core/base/value-access.ts +70 -0
- package/core/directives/dynamic.ts +216 -0
- package/core/directives/scope.ts +432 -0
- package/core/models/api.options.ts +5 -0
- package/core/models/base.options.ts +11 -0
- package/core/models/cmplib.ts +7 -0
- package/core/models/data-source.options.ts +11 -0
- package/core/models/data.options.ts +6 -0
- package/core/models/design-build.ts +26 -0
- package/core/models/design-config.ts +14 -0
- package/core/models/design-tree-node.ts +16 -0
- package/core/models/event-desc.ts +28 -0
- package/core/models/event-handler.ts +6 -0
- package/core/models/event.options.ts +14 -0
- package/core/models/examples.ts +21 -0
- package/core/models/form-registe.options.ts +12 -0
- package/core/models/fun-field.options.ts +6 -0
- package/core/models/initobs.ts +8 -0
- package/core/models/options-node.ts +149 -0
- package/core/models/static-data-source.options.ts +4 -0
- package/core/models/trigge-events.options.ts +3 -0
- package/core/models/value-access.options.ts +10 -0
- package/core/ng-package.json +5 -0
- package/core/pipes/how-long.pipe.ts +69 -0
- package/core/public-api.ts +39 -0
- package/core/share/api-handler/api-handler.css +0 -0
- package/core/share/api-handler/api-handler.html +38 -0
- package/core/share/api-handler/api-handler.ts +51 -0
- package/core/share/array-filter-handler/array-filter-handler.css +0 -0
- package/core/share/array-filter-handler/array-filter-handler.html +26 -0
- package/core/share/array-filter-handler/array-filter-handler.ts +65 -0
- package/core/share/array-filter-handler/input-filter-options/filter-options.css +19 -0
- package/core/share/array-filter-handler/input-filter-options/filter-options.html +57 -0
- package/core/share/array-filter-handler/input-filter-options/filter-options.ts +100 -0
- package/core/share/base-design-setting/base-design-setting.css +0 -0
- package/core/share/base-design-setting/base-design-setting.html +50 -0
- package/core/share/base-design-setting/base-design-setting.ts +55 -0
- package/core/share/base-event-handler-descs.ts +100 -0
- package/core/share/common-menu/common-menu.css +0 -0
- package/core/share/common-menu/common-menu.html +21 -0
- package/core/share/common-menu/common-menu.ts +73 -0
- package/core/share/data-handler/data-handler.css +0 -0
- package/core/share/data-handler/data-handler.html +13 -0
- package/core/share/data-handler/data-handler.ts +39 -0
- package/core/share/events-handler.service.ts +185 -0
- package/core/share/fun-field/fun-field.css +55 -0
- package/core/share/fun-field/fun-field.html +175 -0
- package/core/share/fun-field/fun-field.ts +363 -0
- package/core/share/input-trigger/input-trigger.css +16 -0
- package/core/share/input-trigger/input-trigger.html +114 -0
- package/core/share/input-trigger/input-trigger.ts +394 -0
- package/core/share/msg-tip-handler/msg-tip-handler.css +0 -0
- package/core/share/msg-tip-handler/msg-tip-handler.html +40 -0
- package/core/share/msg-tip-handler/msg-tip-handler.ts +46 -0
- package/core/share/refresh-data-source-handler/refresh-data-source-handler.css +0 -0
- package/core/share/refresh-data-source-handler/refresh-data-source-handler.html +29 -0
- package/core/share/refresh-data-source-handler/refresh-data-source-handler.ts +55 -0
- package/core/share/route-handler/route-handler.css +0 -0
- package/core/share/route-handler/route-handler.html +49 -0
- package/core/share/route-handler/route-handler.ts +51 -0
- package/core/share/set-data-source-handler/set-data-source-handler.css +0 -0
- package/core/share/set-data-source-handler/set-data-source-handler.html +23 -0
- package/core/share/set-data-source-handler/set-data-source-handler.ts +44 -0
- package/core/share/simple-menu/simple-menu.css +0 -0
- package/core/share/simple-menu/simple-menu.html +5 -0
- package/core/share/simple-menu/simple-menu.ts +17 -0
- package/core/share/tokens.ts +29 -0
- package/core/share/value-design-setting/value-design-setting.css +0 -0
- package/core/share/value-design-setting/value-design-setting.html +48 -0
- package/core/share/value-design-setting/value-design-setting.ts +54 -0
- package/core/utils/code-name.utils.ts +19 -0
- package/core/utils/components-loader.ts +29 -0
- package/core/utils/declaration.utils.ts +38 -0
- package/core/utils/dynamic.util.ts +57 -0
- package/core/utils/form-validators.ts +160 -0
- package/core/utils/form.util.ts +25 -0
- package/core/utils/http.utils.ts +8 -0
- package/core/utils/object.utils.ts +182 -0
- package/core/utils/scripts-loader.ts +25 -0
- package/ng-package.json +13 -0
- package/package.json +37 -0
- package/providers/ng-package.json +5 -0
- package/providers/providers.ts +44 -0
- package/providers/public-api.ts +1 -0
- package/public-api.ts +1 -0
- package/tsconfig.json +38 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +11 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Type } from "@angular/core";
|
|
2
|
+
import { FunFieldValueBase } from "../base/funfield-value-base";
|
|
3
|
+
import { BaseMenu } from "../base/base-menu";
|
|
4
|
+
|
|
5
|
+
export class OptionsNode {
|
|
6
|
+
constructor(protected config: OptionsNodeConfig) {
|
|
7
|
+
if (config.parentObj != undefined) {
|
|
8
|
+
config.rootOptions = undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get id(): string {
|
|
13
|
+
return this.config.id ?? this.options.id;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get parentId(): string | undefined {
|
|
17
|
+
return this.config.parentId;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get scopeId(): string | undefined {
|
|
21
|
+
return this.config.scopeId;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get name(): string | undefined {
|
|
25
|
+
return this.config.name;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get dragType(): string | undefined {
|
|
29
|
+
return this.config.dragType;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get dropType(): string | undefined {
|
|
33
|
+
return this.config.dropType;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get canSetting(): boolean {
|
|
37
|
+
return this.config.canSetting ?? false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get canDrag(): boolean {
|
|
41
|
+
return this.config.canDrag ?? false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get childDirection(): "horizontal" | "vertical" {
|
|
45
|
+
return this.config.childDirection ?? "horizontal";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get canDrop(): boolean {
|
|
49
|
+
return this.config.canDrop ?? false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get dropObj(): any {
|
|
53
|
+
return this.config.dropObj;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get parentObj(): any {
|
|
57
|
+
return this.config.parentObj;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
get indexOfParentObj(): number | string | undefined {
|
|
61
|
+
return this.config.indexOfParentObj;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get options(): any {
|
|
65
|
+
if (this.parentObj != undefined && this.indexOfParentObj != undefined) {
|
|
66
|
+
return this.parentObj[this.indexOfParentObj];
|
|
67
|
+
}
|
|
68
|
+
return this.config.rootOptions;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get defaultDropIndex(): number | string | undefined {
|
|
72
|
+
return this.config.defaultDropIndex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get isRoot(): boolean {
|
|
76
|
+
return this.config.rootOptions != undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get icon(): string | undefined {
|
|
80
|
+
return this.config.icon;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get children(): OptionsNode[] | undefined {
|
|
84
|
+
return this.config.children;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get settingType(): Type<FunFieldValueBase> | undefined {
|
|
88
|
+
return this.config.settingType;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get contextMenu(): Type<BaseMenu> | undefined {
|
|
92
|
+
return this.config.contextMenu;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
toElementNode(elements: { element?: HTMLElement, dropElement?: HTMLElement }): ElementNode {
|
|
96
|
+
return new ElementNode(this.id, elements);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
updateOptions(options: any): void {
|
|
100
|
+
if (this.isRoot) {
|
|
101
|
+
this.config.rootOptions = options;
|
|
102
|
+
} else {
|
|
103
|
+
this.parentObj[this.indexOfParentObj!] = options;
|
|
104
|
+
}
|
|
105
|
+
if (this.config.updateId) {
|
|
106
|
+
this.config.id = this.config.updateId(options);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
copyWith(config: OptionsNodeConfig): OptionsNode {
|
|
111
|
+
return new OptionsNode(Object.assign({}, this.config, config));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
refresh(): void {
|
|
115
|
+
console.log("refresh", this.id, this.indexOfParentObj, this.parentObj.indexOf(this.options))
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export class ElementNode {
|
|
120
|
+
constructor(public id: string, elements: { element?: HTMLElement, dropElement?: HTMLElement }) {
|
|
121
|
+
this.element = elements.element;
|
|
122
|
+
this.dropElement = elements.dropElement;
|
|
123
|
+
}
|
|
124
|
+
element?: HTMLElement;
|
|
125
|
+
dropElement?: HTMLElement;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface OptionsNodeConfig {
|
|
129
|
+
id?: string;
|
|
130
|
+
updateId?: (newOptions: any) => string;
|
|
131
|
+
parentId?: string;
|
|
132
|
+
scopeId?: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
canSetting?: boolean;
|
|
135
|
+
canDrag?: boolean;
|
|
136
|
+
canDrop?: boolean;
|
|
137
|
+
childDirection?: "horizontal" | "vertical";
|
|
138
|
+
dragType?: string;
|
|
139
|
+
dropType?: string;
|
|
140
|
+
parentObj?: any;
|
|
141
|
+
dropObj?: any;
|
|
142
|
+
indexOfParentObj?: number | string;
|
|
143
|
+
rootOptions?: any;
|
|
144
|
+
defaultDropIndex?: number | string;
|
|
145
|
+
settingType?: Type<FunFieldValueBase>;
|
|
146
|
+
icon?: string;
|
|
147
|
+
children?: OptionsNode[];
|
|
148
|
+
contextMenu?: Type<BaseMenu>;
|
|
149
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { signal } from "@angular/core";
|
|
2
|
+
import { BaseOptions } from "./base.options";
|
|
3
|
+
|
|
4
|
+
export class ValueAccessOptions extends BaseOptions {
|
|
5
|
+
|
|
6
|
+
initValue = signal<any>(undefined);
|
|
7
|
+
emitInitEvent = signal(true);
|
|
8
|
+
disabled = signal(false);
|
|
9
|
+
readonly = signal(false);
|
|
10
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'axisHowLong', pure: false
|
|
5
|
+
})
|
|
6
|
+
export class HowLongPipe implements PipeTransform {
|
|
7
|
+
|
|
8
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
9
|
+
|
|
10
|
+
timer?: any;
|
|
11
|
+
|
|
12
|
+
lastValue = "";
|
|
13
|
+
|
|
14
|
+
date?: Date;
|
|
15
|
+
|
|
16
|
+
ngOnDestroy(): void {
|
|
17
|
+
if (this.timer != undefined) {
|
|
18
|
+
clearTimeout(this.timer);
|
|
19
|
+
this.timer = undefined;
|
|
20
|
+
this.lastValue = "";
|
|
21
|
+
this.date = undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
transform(date?: Date): string | undefined {
|
|
26
|
+
if (!this.date) {
|
|
27
|
+
if (date) {
|
|
28
|
+
this.date = date;
|
|
29
|
+
let offset = (new Date().getTime() - date.getTime()) / 1000;
|
|
30
|
+
let sufix = offset > 0 ? "前" : "后";
|
|
31
|
+
let time = "";
|
|
32
|
+
offset = Math.floor(Math.abs(offset));
|
|
33
|
+
let refreshTimer = 0;
|
|
34
|
+
if (offset < 10) {
|
|
35
|
+
time = "几秒钟";
|
|
36
|
+
refreshTimer = 1;
|
|
37
|
+
} else if (offset < 60) {
|
|
38
|
+
time = `${offset}秒钟`;
|
|
39
|
+
refreshTimer = 1;
|
|
40
|
+
} else if (offset < 3600) {
|
|
41
|
+
refreshTimer = 60 - (offset % 60);
|
|
42
|
+
time = `${Math.floor(offset / 60)}分钟`;
|
|
43
|
+
} else if (offset < 86400) {
|
|
44
|
+
refreshTimer = 3600 - (offset % 3600);
|
|
45
|
+
time = `${Math.floor(offset / 3600)}小时`;
|
|
46
|
+
} else {
|
|
47
|
+
refreshTimer = 86400 - (offset % 86400);
|
|
48
|
+
time = `${Math.floor(offset / 86400)}天`;
|
|
49
|
+
}
|
|
50
|
+
this.lastValue = `${time}${sufix}`;
|
|
51
|
+
this.timer = setTimeout(() => {
|
|
52
|
+
this.ngOnDestroy();
|
|
53
|
+
this.cdr.markForCheck();
|
|
54
|
+
}, refreshTimer * 1000);
|
|
55
|
+
} else {
|
|
56
|
+
this.lastValue = "";
|
|
57
|
+
}
|
|
58
|
+
return this.lastValue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (date !== this.date) {
|
|
62
|
+
this.ngOnDestroy();
|
|
63
|
+
return this.transform(date);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return this.lastValue;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export * from './base/base'
|
|
2
|
+
export * from './base/value-access'
|
|
3
|
+
export * from './base/base-menu'
|
|
4
|
+
export * from './base/funfield-base'
|
|
5
|
+
export * from './base/funfield-value-base'
|
|
6
|
+
export * from './base/design-builder'
|
|
7
|
+
export * from './directives/dynamic'
|
|
8
|
+
export * from './directives/scope'
|
|
9
|
+
export * from './pipes/how-long.pipe'
|
|
10
|
+
export * from './models/base.options'
|
|
11
|
+
export * from './models/value-access.options'
|
|
12
|
+
export * from './models/design-config'
|
|
13
|
+
export * from './models/options-node'
|
|
14
|
+
export * from './models/design-build'
|
|
15
|
+
export * from './models/event-desc'
|
|
16
|
+
export * from './models/design-tree-node'
|
|
17
|
+
export * from './models/data-source.options'
|
|
18
|
+
export * from './models/data.options'
|
|
19
|
+
export * from './models/event.options'
|
|
20
|
+
export * from './models/fun-field.options'
|
|
21
|
+
export * from './models/examples'
|
|
22
|
+
export * from './models/form-registe.options'
|
|
23
|
+
export * from './models/trigge-events.options'
|
|
24
|
+
export * from './models/cmplib'
|
|
25
|
+
export * from './models/event-handler'
|
|
26
|
+
export * from './share/tokens'
|
|
27
|
+
export * from './share/common-menu/common-menu'
|
|
28
|
+
export * from './share/fun-field/fun-field'
|
|
29
|
+
export * from './share/base-design-setting/base-design-setting'
|
|
30
|
+
export * from './share/input-trigger/input-trigger'
|
|
31
|
+
export * from './share/value-design-setting/value-design-setting'
|
|
32
|
+
export * from './share/data-handler/data-handler'
|
|
33
|
+
export * from './share/simple-menu/simple-menu'
|
|
34
|
+
export * from './utils/form-validators'
|
|
35
|
+
export * from './utils/object.utils'
|
|
36
|
+
export * from './utils/components-loader'
|
|
37
|
+
export * from './utils/form.util'
|
|
38
|
+
export * from './utils/code-name.utils'
|
|
39
|
+
export * from './utils/dynamic.util'
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<form nz-form [formGroup]="fg">
|
|
2
|
+
<nz-form-item>
|
|
3
|
+
<nz-form-label nzSpan="6" nzRequired>
|
|
4
|
+
地址
|
|
5
|
+
</nz-form-label>
|
|
6
|
+
<nz-form-control nzSpan="18">
|
|
7
|
+
<axis-fun-field formControlName="url" [noListen]="noListen()">
|
|
8
|
+
<input nz-input ngModel [ngModelOptions]="{standalone:true}" />
|
|
9
|
+
</axis-fun-field>
|
|
10
|
+
</nz-form-control>
|
|
11
|
+
</nz-form-item>
|
|
12
|
+
<nz-form-item>
|
|
13
|
+
<nz-form-label nzSpan="6" nzRequired>
|
|
14
|
+
请求方式
|
|
15
|
+
</nz-form-label>
|
|
16
|
+
<nz-form-control nzSpan="18">
|
|
17
|
+
<axis-fun-field formControlName="method" [noListen]="noListen()">
|
|
18
|
+
<nz-select ngModel [ngModelOptions]="{standalone:true}">
|
|
19
|
+
<nz-option nzValue="get" nzLabel="GET"></nz-option>
|
|
20
|
+
<nz-option nzValue="post" nzLabel="POST"></nz-option>
|
|
21
|
+
<nz-option nzValue="put" nzLabel="PUT"></nz-option>
|
|
22
|
+
<nz-option nzValue="delete" nzLabel="DELETE"></nz-option>
|
|
23
|
+
</nz-select>
|
|
24
|
+
</axis-fun-field>
|
|
25
|
+
</nz-form-control>
|
|
26
|
+
</nz-form-item>
|
|
27
|
+
<nz-form-item>
|
|
28
|
+
<nz-form-label nzSpan="6">
|
|
29
|
+
请求数据体
|
|
30
|
+
</nz-form-label>
|
|
31
|
+
<nz-form-control nzSpan="18">
|
|
32
|
+
<axis-fun-field formControlName="body" [noListen]="noListen()">
|
|
33
|
+
<ng-container [axisDynamic]="{component:'axis-components/input-json',inuse:true}" [standalone]="true"
|
|
34
|
+
ngModel [ngModelOptions]="{standalone:true}"></ng-container>
|
|
35
|
+
</axis-fun-field>
|
|
36
|
+
</nz-form-control>
|
|
37
|
+
</nz-form-item>
|
|
38
|
+
</form>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, forwardRef, inject, signal } from '@angular/core';
|
|
2
|
+
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
4
|
+
import { FunField } from '../fun-field/fun-field';
|
|
5
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
6
|
+
import { DynamicDirective } from '../../directives/dynamic';
|
|
7
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
8
|
+
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
9
|
+
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
10
|
+
import { FunFieldValueBase } from '../../base/funfield-value-base';
|
|
11
|
+
import { FormValidators } from '../../utils/form-validators';
|
|
12
|
+
import { FunFieldOptions } from '../../models/fun-field.options';
|
|
13
|
+
import { InputTrigger } from '../input-trigger/input-trigger';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'axis-api-handler',
|
|
17
|
+
imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule],
|
|
18
|
+
templateUrl: './api-handler.html',
|
|
19
|
+
styleUrl: './api-handler.css',
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
providers: [
|
|
22
|
+
{
|
|
23
|
+
provide: NG_VALUE_ACCESSOR,
|
|
24
|
+
useExisting: forwardRef(() => ApiHandler),
|
|
25
|
+
multi: true
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
export class ApiHandler extends FunFieldValueBase {
|
|
30
|
+
readonly noListen = inject(InputTrigger).noListen;
|
|
31
|
+
override fg: UntypedFormGroup = this.fb.group({
|
|
32
|
+
url: [undefined, FormValidators.requiredFun],
|
|
33
|
+
method: [undefined, FormValidators.requiredFun],
|
|
34
|
+
body: [],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
protected override funFields: FunFieldOptions = {
|
|
38
|
+
url: {
|
|
39
|
+
defaultValue: "",
|
|
40
|
+
},
|
|
41
|
+
method: {
|
|
42
|
+
defaultValue: "get"
|
|
43
|
+
},
|
|
44
|
+
body: {
|
|
45
|
+
defaultValue: undefined
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
readonly successTipMode = signal(undefined);
|
|
51
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<form nz-form [formGroup]="fg">
|
|
2
|
+
<nz-form-item>
|
|
3
|
+
<nz-form-label nzSpan="6">
|
|
4
|
+
原数组
|
|
5
|
+
</nz-form-label>
|
|
6
|
+
<nz-form-control nzSpan="18">
|
|
7
|
+
<axis-fun-field formControlName="inputArray" [noListen]="noListen()" #sourceDataFunField>
|
|
8
|
+
<ng-container [axisDynamic]="{component:'axis-components/input-json',inuse:true}" [standalone]="true"
|
|
9
|
+
ngModel [ngModelOptions]="{standalone:true}"></ng-container>
|
|
10
|
+
</axis-fun-field>
|
|
11
|
+
</nz-form-control>
|
|
12
|
+
</nz-form-item>
|
|
13
|
+
<nz-form-item>
|
|
14
|
+
<nz-form-label nzSpan="6">
|
|
15
|
+
过滤对象
|
|
16
|
+
</nz-form-label>
|
|
17
|
+
<nz-form-control nzSpan="18">
|
|
18
|
+
<axis-fun-field formControlName="filterData" [noListen]="noListen()" #filterDataFunField>
|
|
19
|
+
<ng-container [axisDynamic]="{component:'axis-components/input-json',inuse:true}" [standalone]="true"
|
|
20
|
+
ngModel [ngModelOptions]="{standalone:true}"></ng-container>
|
|
21
|
+
</axis-fun-field>
|
|
22
|
+
</nz-form-control>
|
|
23
|
+
</nz-form-item>
|
|
24
|
+
<axis-design-filter-options [sourceDataFields]="sourceDataFields()" [filterDataFields]="filterDataFields()"
|
|
25
|
+
formControlName="filterOptions"></axis-design-filter-options>
|
|
26
|
+
</form>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, ViewChild } from '@angular/core';
|
|
2
|
+
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
|
|
3
|
+
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
4
|
+
import { FunField } from '../fun-field/fun-field';
|
|
5
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
6
|
+
import { DynamicDirective } from '../../directives/dynamic';
|
|
7
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
8
|
+
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
9
|
+
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
10
|
+
import { FunFieldValueBase } from '../../base/funfield-value-base';
|
|
11
|
+
import { FunFieldOptions } from '../../models/fun-field.options';
|
|
12
|
+
import { FilterOptions } from './input-filter-options/filter-options';
|
|
13
|
+
import { InputTrigger } from '../input-trigger/input-trigger';
|
|
14
|
+
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'axis-array-filter-handler',
|
|
17
|
+
imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule, FilterOptions],
|
|
18
|
+
templateUrl: './array-filter-handler.html',
|
|
19
|
+
styleUrl: './array-filter-handler.css',
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
providers: [
|
|
22
|
+
{
|
|
23
|
+
provide: NG_VALUE_ACCESSOR,
|
|
24
|
+
useExisting: forwardRef(() => ArrayFilterHandler),
|
|
25
|
+
multi: true
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
export class ArrayFilterHandler extends FunFieldValueBase {
|
|
30
|
+
readonly noListen = inject(InputTrigger).noListen;
|
|
31
|
+
override fg: UntypedFormGroup = this.fb.group({
|
|
32
|
+
inputArray: [],
|
|
33
|
+
filterData: [],
|
|
34
|
+
filterOptions: [],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
protected override funFields: FunFieldOptions = {
|
|
38
|
+
inputArray: {
|
|
39
|
+
defaultValue: undefined,
|
|
40
|
+
},
|
|
41
|
+
filterData: {
|
|
42
|
+
defaultValue: undefined,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
@ViewChild("sourceDataFunField", { static: true })
|
|
47
|
+
sourceDataFunField!: FunField;
|
|
48
|
+
@ViewChild("filterDataFunField", { static: true })
|
|
49
|
+
filterDataFunField!: FunField;
|
|
50
|
+
|
|
51
|
+
readonly sourceDataFields = computed(() => this.buildSourceDataFields())
|
|
52
|
+
readonly filterDataFields = computed(() => this.buildfilterDataFields())
|
|
53
|
+
|
|
54
|
+
private buildSourceDataFields(): string[] {
|
|
55
|
+
const sourceData = this.sourceDataFunField.computeResult();
|
|
56
|
+
if (sourceData?.length) {
|
|
57
|
+
return Object.keys(sourceData[0]);
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private buildfilterDataFields(): string[] {
|
|
63
|
+
return Object.keys(this.filterDataFunField.computeResult() ?? {});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.item {
|
|
2
|
+
border: 1px dashed rgba(150, 150, 150, 0.5);
|
|
3
|
+
padding: 10px;
|
|
4
|
+
margin-bottom: 10px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.desc {
|
|
8
|
+
font-size: 11px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.editable-tag {
|
|
12
|
+
border-style: dashed;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
nz-tag {
|
|
17
|
+
margin-top: 2px;
|
|
18
|
+
margin-bottom: 2px;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<form [formGroup]="fg">
|
|
2
|
+
<ng-container formArrayName="filters">
|
|
3
|
+
@for (c of fa.controls; track $index;let index=$index;) {
|
|
4
|
+
<div class="item" [formGroupName]="index">
|
|
5
|
+
<div nz-flex nzJustify="space-between">
|
|
6
|
+
<h4>条件{{index+1}}:</h4>
|
|
7
|
+
<a nz-button nzType="link" nzSize="small" nzDanger (click)="deleteFilter(index)"><i nz-icon
|
|
8
|
+
nzType="delete" nzTheme="outline"></i></a>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<span>使用</span>
|
|
12
|
+
<input nz-input nzVariant="underlined" placeholder="选择字段" style="width: 100px;" nzSize="small"
|
|
13
|
+
[nzAutocomplete]="filterDataFieldsAuto" formControlName="field" />
|
|
14
|
+
<span>字段并通过</span>
|
|
15
|
+
<nz-select style="width: 103px;" nzVariant="underlined" formControlName="mode" nzSize="small">
|
|
16
|
+
<nz-option nzValue="equals" nzLabel="相等"></nz-option>
|
|
17
|
+
<nz-option nzValue="startsWith" nzLabel="头部相等"></nz-option>
|
|
18
|
+
<nz-option nzValue="endsWith" nzLabel="尾部相等"></nz-option>
|
|
19
|
+
<nz-option nzValue="like" nzLabel="模糊匹配"></nz-option>
|
|
20
|
+
<nz-option nzValue="equalGreater" nzLabel="大于等于"></nz-option>
|
|
21
|
+
<nz-option nzValue="equalLess" nzLabel="小于等于"></nz-option>
|
|
22
|
+
<nz-option nzValue="between" nzLabel="两者之间"></nz-option>
|
|
23
|
+
<nz-option nzValue="containAll" nzLabel="包含所有"></nz-option>
|
|
24
|
+
<nz-option nzValue="containAny" nzLabel="包含任意"></nz-option>
|
|
25
|
+
</nz-select>
|
|
26
|
+
<span>的方式匹配以下字段:</span>
|
|
27
|
+
<nz-select formControlName="effectFields" style="min-width: 120px;" nzSize="small" nzMode="multiple"
|
|
28
|
+
nzVariant="underlined" nzShowSearch nzAllowClear [nzDropdownRender]="renderTemplate"
|
|
29
|
+
nzPlaceHolder="选择字段" (nzOpenChange)="$event && currentEffectFieldsControl=c">
|
|
30
|
+
@for (f of sourceDataChooseFields(); track f) {
|
|
31
|
+
<nz-option [nzLabel]="f" [nzValue]="f"></nz-option>
|
|
32
|
+
}
|
|
33
|
+
</nz-select>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
}
|
|
37
|
+
</ng-container>
|
|
38
|
+
</form>
|
|
39
|
+
<ng-template #renderTemplate>
|
|
40
|
+
<div nz-flex nzGap="4px" style="padding: 0 10px;">
|
|
41
|
+
<input type="text" nz-input nzSize="small" placeholder="其他字段" #inputElement />
|
|
42
|
+
<a (click)="addField(inputElement.value);inputElement.value=''">
|
|
43
|
+
<nz-icon nzType="plus" />
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
46
|
+
</ng-template>
|
|
47
|
+
<nz-autocomplete #filterDataFieldsAuto nzBackfill [nzWidth]="120">
|
|
48
|
+
@for (f of filterDataFields(); track f) {
|
|
49
|
+
<nz-auto-option [nzLabel]="f" [nzValue]="f">
|
|
50
|
+
{{f}}
|
|
51
|
+
</nz-auto-option>
|
|
52
|
+
}
|
|
53
|
+
</nz-autocomplete>
|
|
54
|
+
<a nz-button nzType="link" (click)="createFilter()">
|
|
55
|
+
<i nz-icon nzType="plus" nzTheme="outline"></i>
|
|
56
|
+
添加过滤条件
|
|
57
|
+
</a>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, effect, forwardRef, inject, input, model, signal } from '@angular/core';
|
|
2
|
+
import { AbstractControl, ControlValueAccessor, FormArray, FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { FormValidators } from '../../../utils/form-validators';
|
|
4
|
+
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
|
|
5
|
+
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
6
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
7
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
8
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
9
|
+
import { NzTagModule } from 'ng-zorro-antd/tag';
|
|
10
|
+
import { NzFlexModule } from 'ng-zorro-antd/flex';
|
|
11
|
+
import { NzDividerModule } from 'ng-zorro-antd/divider';
|
|
12
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'axis-design-filter-options',
|
|
16
|
+
templateUrl: './filter-options.html',
|
|
17
|
+
styleUrls: ['./filter-options.css'],
|
|
18
|
+
imports: [NzSelectModule, NzButtonModule, NzInputModule, NzAutocompleteModule, ReactiveFormsModule, NzTagModule, NzIconModule, NzFlexModule, NzDividerModule],
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: NG_VALUE_ACCESSOR,
|
|
23
|
+
useExisting: forwardRef(() => FilterOptions),
|
|
24
|
+
multi: true
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
export class FilterOptions implements ControlValueAccessor {
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
effect(() => {
|
|
32
|
+
this.onChange?.(this.formValue()?.filters);
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onChange: any;
|
|
37
|
+
readonly value = model<any[]>();
|
|
38
|
+
|
|
39
|
+
writeValue(v: any): void {
|
|
40
|
+
this.value.set(v);
|
|
41
|
+
if (v?.length) {
|
|
42
|
+
v.forEach((r: any) => {
|
|
43
|
+
this.createFilter();
|
|
44
|
+
r.effectFields?.forEach((f: any) => {
|
|
45
|
+
if (!this.sourceDataChooseFields().includes(f) && !this.addFields().includes(f)) {
|
|
46
|
+
this.addFields.set([...this.addFields(), f]);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
this.fg.reset({
|
|
52
|
+
filters: v
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
registerOnChange(fn: any): void {
|
|
57
|
+
this.onChange = fn;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
registerOnTouched(fn: any): void {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
readonly sourceDataFields = input<string[]>([]);
|
|
64
|
+
readonly sourceDataChooseFields = computed(() => this.sourceDataFields().concat(this.addFields()));
|
|
65
|
+
readonly filterDataFields = input<string[]>([]);
|
|
66
|
+
readonly addFields = signal<string[]>([]);
|
|
67
|
+
private readonly fb = inject(FormBuilder);
|
|
68
|
+
readonly fg = this.fb.group({
|
|
69
|
+
filters: this.fb.array([])
|
|
70
|
+
});
|
|
71
|
+
readonly formValue = toSignal(this.fg.valueChanges);
|
|
72
|
+
currentEffectFieldsControl?: AbstractControl;
|
|
73
|
+
|
|
74
|
+
get fa(): FormArray {
|
|
75
|
+
return this.fg.get("filters") as FormArray;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
createFilter() {
|
|
79
|
+
this.fa.push(this.fb.group({
|
|
80
|
+
field: [undefined, FormValidators.required],
|
|
81
|
+
mode: ["equals", FormValidators.required],
|
|
82
|
+
effectFields: [[], FormValidators.required],
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
deleteFilter(i: number) {
|
|
87
|
+
this.fa.removeAt(i);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
addField(field: string) {
|
|
91
|
+
if (!this.sourceDataChooseFields().includes(field)) {
|
|
92
|
+
this.addFields.set([...this.addFields(), field]);
|
|
93
|
+
if (this.currentEffectFieldsControl) {
|
|
94
|
+
this.currentEffectFieldsControl!.patchValue({ effectFields: [...this.currentEffectFieldsControl!.value.effectFields, field] });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
File without changes
|