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,175 @@
|
|
|
1
|
+
@if (!onlyFun()) {
|
|
2
|
+
<div nz-flex nzAlign="center">
|
|
3
|
+
@if (!value()?.funMode) {
|
|
4
|
+
<div nz-flex nzFlex="1 0 0">
|
|
5
|
+
<ng-content #content></ng-content>
|
|
6
|
+
</div>
|
|
7
|
+
}@else{
|
|
8
|
+
<nz-input-group nz-flex nzFlex="1 0 0" [nzSuffix]="suffixTemplate" [nzPrefix]="prefixTemplate">
|
|
9
|
+
<input nz-input readonly type="text" [class]="{success:success(),warn:warn(),error:error()}"
|
|
10
|
+
[placeholder]="success() || warn() || error()" (click)="openFunModal()" />
|
|
11
|
+
</nz-input-group>
|
|
12
|
+
}
|
|
13
|
+
<a nz-button nzType="link" [disabled]="disabled()" (click)="toogleMode()"><i style="margin: 0 auto;display: block;"
|
|
14
|
+
nz-icon [nzType]="value()?.funMode?'rollback':'function'" nzTheme="outline"></i></a>
|
|
15
|
+
</div>
|
|
16
|
+
}@else{
|
|
17
|
+
<nz-input-group [nzSuffix]="suffixTemplate" [nzPrefix]="prefixTemplate">
|
|
18
|
+
<input nz-input readonly type="text" [class]="{success:success(),warn:warn(),error:error()}"
|
|
19
|
+
[placeholder]="success() || warn() || error() || ''" (click)="openFunModal()" />
|
|
20
|
+
</nz-input-group>
|
|
21
|
+
}
|
|
22
|
+
<ng-template #prefixTemplate>
|
|
23
|
+
<i nz-icon nzType="function" style="margin-right: 5px;"></i>
|
|
24
|
+
@if (success()) {
|
|
25
|
+
<i nz-icon nzType="check-circle" style="color:#52c41a;"></i>
|
|
26
|
+
}@else if (warn()) {
|
|
27
|
+
<i nz-icon nzType="exclamation-circle" style="color:#faad14;"></i>
|
|
28
|
+
}@else if (error()) {
|
|
29
|
+
<i nz-icon nzType="close-circle" style="color:#ff4d4f;"></i>
|
|
30
|
+
}
|
|
31
|
+
</ng-template>
|
|
32
|
+
<ng-template #suffixTemplate>
|
|
33
|
+
<i style="color:rgba(150, 150, 150, 0.5);" nz-icon nzType="edit" nzTheme="outline"></i>
|
|
34
|
+
</ng-template>
|
|
35
|
+
<nz-modal nzWidth="1000px" [nzBodyStyle]="{padding:'0'}" [(nzVisible)]="open" (nzOnCancel)="onCancel()"
|
|
36
|
+
(nzOnOk)="onOk()" (nzAfterClose)="editValue.set(undefined);">
|
|
37
|
+
<ng-container *nzModalTitle>
|
|
38
|
+
<i nz-icon nzType="function" style="margin-right: 8px;"></i>编辑脚本
|
|
39
|
+
@if (editTip()) {
|
|
40
|
+
<span style="font-size: 12px;margin-left: 30px;color:var(--ant-error-color)">
|
|
41
|
+
<nz-icon nzType="info-circle" nzTheme="outline" />
|
|
42
|
+
{{editTip()}}
|
|
43
|
+
</span>
|
|
44
|
+
}
|
|
45
|
+
</ng-container>
|
|
46
|
+
<ng-container *nzModalContent>
|
|
47
|
+
<nz-splitter style="height: 400px;" (nzResize)="layoutEditor()">
|
|
48
|
+
<nz-splitter-panel [nzDefaultSize]="250" [nzMin]="250" nzMax="70%" [nzCollapsible]="true">
|
|
49
|
+
<nz-collapse nzAccordion [nzBordered]="false">
|
|
50
|
+
@if (funcsNames.length) {
|
|
51
|
+
<nz-collapse-panel nzHeader="注入函数" [nzExtra]="funcsNames.length.toString()">
|
|
52
|
+
@for (item of funcsNames; track $index) {
|
|
53
|
+
<div><span style="color:#C52727">function</span> {{item}}</div>
|
|
54
|
+
}
|
|
55
|
+
</nz-collapse-panel>
|
|
56
|
+
}
|
|
57
|
+
@if (importsList().length) {
|
|
58
|
+
<nz-collapse-panel nzHeader="函数库导入"
|
|
59
|
+
[nzExtra]="(editValue().fnValue?.imports?.length ?? 0) + '/'+importsList().length">
|
|
60
|
+
<nz-checkbox-group [nzOptions]="importsList()" [ngModel]="editValue().fnValue?.imports"
|
|
61
|
+
(ngModelChange)="changeImports($event)" />
|
|
62
|
+
</nz-collapse-panel>
|
|
63
|
+
}
|
|
64
|
+
<nz-collapse-panel nzActive nzHeader="数据源" [nzExtra]="addListenBtn">
|
|
65
|
+
<ng-template #addListenBtn>
|
|
66
|
+
<a nz-button nzType="link" nzSize="small"
|
|
67
|
+
(click)="$event.stopPropagation();showCreateListenModal.set(true)">
|
|
68
|
+
<nz-icon nzType="plus"></nz-icon>
|
|
69
|
+
添加
|
|
70
|
+
</a>
|
|
71
|
+
</ng-template>
|
|
72
|
+
@if (!scopeds().length) {
|
|
73
|
+
<nz-empty nzNotFoundContent="暂无数据源"></nz-empty>
|
|
74
|
+
}@else{
|
|
75
|
+
@for (scope of scopeds(); track scope.scopeId) {
|
|
76
|
+
<div class="scope-tag">{{scope.scopeName}}</div>
|
|
77
|
+
@for (item of getDsNames(scope); track item;) {
|
|
78
|
+
<div nz-flex nzVertical style="margin-top: 2px;">
|
|
79
|
+
<div nz-flex nzAlign="center">
|
|
80
|
+
<a nz-button nzType="link" nzSize="small" (click)="doShowDataSource(item)">
|
|
81
|
+
<i nz-icon nzType="search" nzTheme="outline"></i>
|
|
82
|
+
{{item}}
|
|
83
|
+
</a>
|
|
84
|
+
<a nz-button nzType="link" nzSize="small" ngxClipboard [cbContent]="item"
|
|
85
|
+
(cbOnSuccess)="copySuccess()">
|
|
86
|
+
<i nz-icon nzType="copy" nzTheme="outline"></i>
|
|
87
|
+
</a>
|
|
88
|
+
@if (scope.scopeId == '__unknown__') {
|
|
89
|
+
<a nz-button nzType="link" nzSize="small" nzDanger (click)="removeListen(item)">
|
|
90
|
+
<i nz-icon nzType="delete" nzTheme="outline"></i>
|
|
91
|
+
</a>
|
|
92
|
+
}
|
|
93
|
+
</div>
|
|
94
|
+
@if (!noListen()) {
|
|
95
|
+
<nz-select style="margin-left:16px;font-size: 12px;width: fit-content;"
|
|
96
|
+
[nzDropdownMatchSelectWidth]="false" nzVariant="borderless"
|
|
97
|
+
[ngModel]="editValue().fnValue?.listen?.[item]??'none'"
|
|
98
|
+
(ngModelChange)="changeLinstenMode(item,$event)" nzSize="small">
|
|
99
|
+
<nz-option nzCustomContent nzLabel="不监听" nzValue="none">
|
|
100
|
+
<span style="font-size: 12px;">不监听</span>
|
|
101
|
+
</nz-option>
|
|
102
|
+
<nz-option nzCustomContent nzLabel="首次有定义" nzValue="firstDefined">
|
|
103
|
+
<span style="font-size: 12px;">首次有定义</span>
|
|
104
|
+
</nz-option>
|
|
105
|
+
<nz-option nzCustomContent nzLabel="有定义" nzValue="defined">
|
|
106
|
+
<span style="font-size: 12px;">有定义</span>
|
|
107
|
+
</nz-option>
|
|
108
|
+
<nz-option nzCustomContent nzLabel="总是" nzValue="aways">
|
|
109
|
+
<span style="font-size: 12px;">总是</span>
|
|
110
|
+
</nz-option>
|
|
111
|
+
</nz-select>
|
|
112
|
+
}
|
|
113
|
+
</div>
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
</nz-collapse-panel>
|
|
118
|
+
</nz-collapse>
|
|
119
|
+
</nz-splitter-panel>
|
|
120
|
+
<nz-splitter-panel>
|
|
121
|
+
<div nz-flex nzVertical style="height: 100%;">
|
|
122
|
+
<div class="code-row"><span style="color: #C52727;">function</span>({{argsName()}})
|
|
123
|
+
{{'{'}}</div>
|
|
124
|
+
<div nz-flex nzFlex="1 1 0">
|
|
125
|
+
<ng-container #funEditor="axisDynamic"
|
|
126
|
+
[axisDynamic]="{component:'axis-components/editor',inuse:true,mode:'javascript',typescriptExtLibs:importDeclarations()}"
|
|
127
|
+
[standalone]="true" [(ngModel)]="editFn"
|
|
128
|
+
(ngModelChange)="execFnSubject.next()"></ng-container>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="code-row"> {{'}'}}</div>
|
|
131
|
+
</div>
|
|
132
|
+
</nz-splitter-panel>
|
|
133
|
+
</nz-splitter>
|
|
134
|
+
@if (success()) {
|
|
135
|
+
<nz-alert nzShowIcon nzType="success" nzCloseable [nzDescription]="success()" (nzOnClose)="success.set('')"
|
|
136
|
+
[nzAction]="showSuccessResultBtn">
|
|
137
|
+
</nz-alert>
|
|
138
|
+
<ng-template #showSuccessResultBtn>
|
|
139
|
+
<button nz-button (click)="isShowSuccessResult=true">查看执行结果</button>
|
|
140
|
+
</ng-template>
|
|
141
|
+
}@else if(error()){
|
|
142
|
+
<nz-alert nzShowIcon nzType="error" nzCloseable [nzDescription]="error()" (nzOnClose)="error.set('')">
|
|
143
|
+
</nz-alert>
|
|
144
|
+
}@else if(warn()){
|
|
145
|
+
<nz-alert nzShowIcon nzType="warning" nzCloseable [nzDescription]="warn()" (nzOnClose)="warn.set('')">
|
|
146
|
+
</nz-alert>
|
|
147
|
+
}
|
|
148
|
+
</ng-container>
|
|
149
|
+
</nz-modal>
|
|
150
|
+
|
|
151
|
+
<nz-modal [nzVisible]="!!isShowSuccessResult" nzTitle="函数执行结果" [nzOkText]="null"
|
|
152
|
+
(nzOnCancel)="isShowSuccessResult=false;" [nzBodyStyle]="{padding:'0',position:'relative'}" nzCancelText="关闭">
|
|
153
|
+
<div *nzModalContent style="height: 400px;" nz-flex>
|
|
154
|
+
<ng-container [axisDynamic]="{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}"
|
|
155
|
+
[standalone]="true" [ngModel]="successResult"></ng-container>
|
|
156
|
+
</div>
|
|
157
|
+
</nz-modal>
|
|
158
|
+
|
|
159
|
+
<nz-modal nzWidth="800px" [nzVisible]="!!showDataSource()" [nzTitle]="'查看数据源-'+showDataSource()?.name" [nzOkText]="null"
|
|
160
|
+
(nzOnCancel)="showDataSource.set(undefined)" [nzBodyStyle]="{padding:'0'}" nzCancelText="关闭">
|
|
161
|
+
<div *nzModalContent style="height: 400px;" nz-flex>
|
|
162
|
+
<ng-container [axisDynamic]="{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}"
|
|
163
|
+
[standalone]="true" [ngModel]="showDataSource()?.data ??''"></ng-container>
|
|
164
|
+
</div>
|
|
165
|
+
</nz-modal>
|
|
166
|
+
|
|
167
|
+
<nz-modal [(nzVisible)]="showCreateListenModal" nzDraggable nzTitle="创建监听" (nzOnOk)="addListen()"
|
|
168
|
+
(nzOnCancel)="showCreateListenModal.set(false)" nzWidth="400px">
|
|
169
|
+
<ng-container *nzModalContent>
|
|
170
|
+
<div nz-flex nzAlign="center">
|
|
171
|
+
<div>数据源名称:</div>
|
|
172
|
+
<input style="flex:1" nz-input [(ngModel)]="createListenDataSourceName" />
|
|
173
|
+
</div>
|
|
174
|
+
</ng-container>
|
|
175
|
+
</nz-modal>
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { AfterContentInit, ChangeDetectionStrategy, Component, computed, ContentChild, effect, forwardRef, inject, input, model, OnDestroy, signal, ViewChild } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, NgModel, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
3
|
+
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
4
|
+
import { debounceTime, Subject, Subscription, switchMap } from 'rxjs';
|
|
5
|
+
import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
6
|
+
import { NzListModule } from 'ng-zorro-antd/list';
|
|
7
|
+
import { NzFlexModule } from 'ng-zorro-antd/flex';
|
|
8
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
9
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
10
|
+
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
11
|
+
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
12
|
+
import { ClipboardModule } from 'ngx-clipboard';
|
|
13
|
+
import { NzAlertModule } from 'ng-zorro-antd/alert';
|
|
14
|
+
import { NzEmptyModule } from 'ng-zorro-antd/empty';
|
|
15
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
16
|
+
import { NzSplitterModule } from 'ng-zorro-antd/splitter';
|
|
17
|
+
import { AXIS_SCRIPTS_TOKEN, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_INJECT_FUNC_TOKEN } from '../tokens';
|
|
18
|
+
import { fn } from '../../utils/dynamic.util';
|
|
19
|
+
import { ScopeInfo } from '../../models/design-build';
|
|
20
|
+
import { copy } from '../../utils/object.utils';
|
|
21
|
+
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
22
|
+
import { NzCheckboxModule, NzCheckboxOption } from 'ng-zorro-antd/checkbox';
|
|
23
|
+
import { loadScripts } from '../../utils/scripts-loader';
|
|
24
|
+
import { generateDeclarations } from '../../utils/declaration.utils';
|
|
25
|
+
import { DynamicDirective } from '../../directives/dynamic';
|
|
26
|
+
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'axis-fun-field',
|
|
30
|
+
imports: [NzModalModule, NzListModule, NzFlexModule, NzInputModule, NzIconModule, NzButtonModule, NzRadioModule, FormsModule, ClipboardModule, NzAlertModule, NzEmptyModule, NzSelectModule, NzSplitterModule, NzCollapseModule, NzCheckboxModule, DynamicDirective],
|
|
31
|
+
templateUrl: './fun-field.html',
|
|
32
|
+
styleUrls: ['./fun-field.css'],
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
providers: [
|
|
35
|
+
{
|
|
36
|
+
provide: NG_VALUE_ACCESSOR,
|
|
37
|
+
useExisting: forwardRef(() => FunField),
|
|
38
|
+
multi: true
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
export class FunField implements ControlValueAccessor, OnDestroy, AfterContentInit {
|
|
43
|
+
constructor(private msg: NzMessageService) {
|
|
44
|
+
this._sub.push(this.execFnSubject.pipe(debounceTime(300))
|
|
45
|
+
.subscribe(async _ => {
|
|
46
|
+
if (!this.onlyFun() && !(this.editValue() ?? this.value()).funMode) {
|
|
47
|
+
this.computeResult.set(this.value().originValue);
|
|
48
|
+
} else {
|
|
49
|
+
const args = this.ds();
|
|
50
|
+
const libs: string[] = [];
|
|
51
|
+
for (const i of (this.editValue() ?? this.value())?.fnValue?.imports ?? []) {
|
|
52
|
+
if (this.scripts?.hasOwnProperty(i)) {
|
|
53
|
+
libs.push(await loadScripts(`${this.scripts[i]}.js`));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
this.success.set("");
|
|
58
|
+
this.warn.set("");
|
|
59
|
+
this.error.set("");
|
|
60
|
+
this.computeResult.set(fn(`${libs.join("\n")}\n${this.editFn()}`, args, true, false));
|
|
61
|
+
if (!this.onlyFun() && this.editValue()?.funMode) {
|
|
62
|
+
this.editValue().originValue = this.computeResult();
|
|
63
|
+
this.updateContentValue();
|
|
64
|
+
}
|
|
65
|
+
if (this.computeResult() == undefined) {
|
|
66
|
+
this.warn.set(`警告:执行结果为${this.computeResult()}`);
|
|
67
|
+
} else {
|
|
68
|
+
if (typeof (this.computeResult()) == "object") {
|
|
69
|
+
this.resultResultEditorMode = "json";
|
|
70
|
+
} else {
|
|
71
|
+
this.resultResultEditorMode = "plain_text";
|
|
72
|
+
}
|
|
73
|
+
this.successResult = JSON.stringify(this.computeResult(), undefined, "\t");
|
|
74
|
+
this.success.set("函数运行成功!");
|
|
75
|
+
}
|
|
76
|
+
} catch (e: any) {
|
|
77
|
+
this.error.set(`报错:${e.message}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
effect(() => {
|
|
82
|
+
this.buildImportDeclarations();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
readonly scopes = input<ScopeInfo[]>();
|
|
87
|
+
readonly exclude = input<string[] | undefined>([]);
|
|
88
|
+
readonly scopeId = input<string>();
|
|
89
|
+
readonly onlyFun = input(false);
|
|
90
|
+
readonly noListen = input(false);
|
|
91
|
+
readonly disabled = input(false);
|
|
92
|
+
readonly getScopeInfos = inject(AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN);
|
|
93
|
+
readonly scopeInfos = toSignal(toObservable(this.scopeId).pipe(switchMap(scopeId => this.getScopeInfos(scopeId))));
|
|
94
|
+
readonly scripts = inject(AXIS_SCRIPTS_TOKEN, { optional: true });
|
|
95
|
+
readonly funcs = inject(AXIS_INJECT_FUNC_TOKEN, { optional: true });
|
|
96
|
+
readonly funcsNames = Object.keys(this.funcs ?? {});
|
|
97
|
+
readonly scopeds = computed(() => this.buildScopeDs());
|
|
98
|
+
readonly ds = computed(() => this.buildDs());
|
|
99
|
+
readonly argsName = computed(() => this.buildArgsName());
|
|
100
|
+
readonly importsList = computed(() => this.buildImportsList());
|
|
101
|
+
readonly importDeclarations = signal<any[]>([]);
|
|
102
|
+
readonly showDataSource = signal<any>(undefined);
|
|
103
|
+
readonly editValue = signal<any>(undefined);
|
|
104
|
+
readonly editFn = signal<any>(undefined);
|
|
105
|
+
readonly editTip = input<string>();
|
|
106
|
+
|
|
107
|
+
@ViewChild("funEditor")
|
|
108
|
+
funEditor?: DynamicDirective;
|
|
109
|
+
monaco?: any;
|
|
110
|
+
|
|
111
|
+
@ContentChild(NgModel)
|
|
112
|
+
contentModel?: NgModel;
|
|
113
|
+
|
|
114
|
+
execFnSubject = new Subject<void>();
|
|
115
|
+
|
|
116
|
+
successResult: any;
|
|
117
|
+
computeResult = signal<any>(undefined);
|
|
118
|
+
|
|
119
|
+
resultResultEditorMode: string = "json";
|
|
120
|
+
|
|
121
|
+
isShowSuccessResult = false;
|
|
122
|
+
|
|
123
|
+
_sub: Subscription[] = [];
|
|
124
|
+
|
|
125
|
+
ngOnDestroy(): void {
|
|
126
|
+
this._sub.forEach(s => s.unsubscribe());
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
onChange: any;
|
|
130
|
+
|
|
131
|
+
value = model<any>();
|
|
132
|
+
|
|
133
|
+
writeValue(v: FunFieldValue | undefined): void {
|
|
134
|
+
this.value.set(v);
|
|
135
|
+
if (this.onlyFun() && this.noListen()) {
|
|
136
|
+
this.editFn.set(v as any || "return undefined");
|
|
137
|
+
this.execFnSubject.next();
|
|
138
|
+
} else if (v) {
|
|
139
|
+
if (v?.funMode) {
|
|
140
|
+
this.editFn.set(this.value()!.fnValue.fn);
|
|
141
|
+
this.execFnSubject.next();
|
|
142
|
+
} else {
|
|
143
|
+
this.value()!.fnValue = {
|
|
144
|
+
listen: {},
|
|
145
|
+
fn: `return ${JSON.stringify(this.value()!.originValue)};`
|
|
146
|
+
};
|
|
147
|
+
this.editFn.set(this.value()!.fnValue.fn);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
this.updateContentValue();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private updateContentValue() {
|
|
154
|
+
if (!this.onlyFun() && this.value()) {
|
|
155
|
+
this.contentModel?.control.setValue(this.value()!.originValue, { emitModelToViewChange: true, emitViewToModelChange: false });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
registerOnChange(fn: any): void {
|
|
160
|
+
this.onChange = fn;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
registerOnTouched(_: any): void {
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
_templateDataSource?: any[] = [];
|
|
167
|
+
|
|
168
|
+
readonly open = model(false);
|
|
169
|
+
readonly success = signal<string>("");
|
|
170
|
+
readonly error = signal<string>("");
|
|
171
|
+
readonly warn = signal<string>("");
|
|
172
|
+
|
|
173
|
+
showCreateListenModal = model(false);
|
|
174
|
+
|
|
175
|
+
showAddImportModal = false;
|
|
176
|
+
|
|
177
|
+
createListenDataSourceName = model("");
|
|
178
|
+
|
|
179
|
+
ngAfterContentInit(): void {
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
if (this.value()?.fnValue?.fn) {
|
|
182
|
+
this.execFnSubject.next();
|
|
183
|
+
}
|
|
184
|
+
this.updateContentValue();
|
|
185
|
+
});
|
|
186
|
+
if (this.contentModel?.update) {
|
|
187
|
+
this._sub.push(this.contentModel.update.subscribe(v => {
|
|
188
|
+
if (this.value() !== undefined) {
|
|
189
|
+
this.value()!.originValue = v;
|
|
190
|
+
this.changeValue();
|
|
191
|
+
// this.computeResult.set(v);
|
|
192
|
+
}
|
|
193
|
+
}))
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
private buildScopeDs(): ScopeInfo[] {
|
|
198
|
+
let scopes: any[] = copy((this.scopes() ?? []).concat(this.scopeInfos() ?? []), true);
|
|
199
|
+
const sdname = new Set<string>();
|
|
200
|
+
for (const scope of scopes) {
|
|
201
|
+
for (const name in scope.ds) {
|
|
202
|
+
sdname.add(name);
|
|
203
|
+
if (this.exclude()?.includes(name)) {
|
|
204
|
+
delete scope.ds[name];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const unknownScope: any = {
|
|
209
|
+
scopeId: "__unknown__",
|
|
210
|
+
scopeName: "未知",
|
|
211
|
+
ds: {},
|
|
212
|
+
}
|
|
213
|
+
scopes.unshift(unknownScope);
|
|
214
|
+
for (const en of Object.entries((this.editValue() ?? this.value())?.fnValue?.listen ?? {})) {
|
|
215
|
+
if (!sdname.has(en[0])) {
|
|
216
|
+
unknownScope.ds[en[0]] = "示例数据";
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
this.execFnSubject.next();
|
|
220
|
+
return scopes.filter(s => Object.keys(s.ds ?? {}).length);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
getDsNames(scope: ScopeInfo): string[] {
|
|
224
|
+
return Object.keys(scope.ds);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
private buildDs(): any {
|
|
228
|
+
const ds: any = {};
|
|
229
|
+
for (const scope of this.scopeds()) {
|
|
230
|
+
Object.assign(ds, scope.ds);
|
|
231
|
+
}
|
|
232
|
+
Object.assign(ds, this.funcs)
|
|
233
|
+
return ds;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
openFunModal() {
|
|
237
|
+
this.open.set(true);
|
|
238
|
+
this.editValue.set(copy(this.value(), true));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private buildArgsName(): string {
|
|
242
|
+
return Object.keys(this.ds()).join(",");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
private buildImportsList(): NzCheckboxOption[] {
|
|
246
|
+
return Object.keys(this.scripts ?? {})
|
|
247
|
+
.map((name) => ({ label: name, value: name }))
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
changeLinstenMode(name: string, mode: string) {
|
|
251
|
+
if (!this.editValue()!.fnValue?.listen) {
|
|
252
|
+
this.editValue()!.fnValue.listen = {};
|
|
253
|
+
}
|
|
254
|
+
if (mode == "none") {
|
|
255
|
+
delete this.editValue()!.fnValue.listen![name];
|
|
256
|
+
} else {
|
|
257
|
+
this.editValue()!.fnValue.listen![name] = mode;
|
|
258
|
+
}
|
|
259
|
+
this.editValue.set({ ...this.editValue() });
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
changeImports(imports: string[]) {
|
|
263
|
+
this.editValue().fnValue.imports = imports;
|
|
264
|
+
this.editValue.set({ ...this.editValue() });
|
|
265
|
+
this.execFnSubject.next();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
onCancel() {
|
|
269
|
+
this.open.set(false);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
onOk() {
|
|
273
|
+
this.value.set(this.editValue());
|
|
274
|
+
this.changeValue();
|
|
275
|
+
this.open.set(false);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
toogleMode() {
|
|
279
|
+
if (this.value() && !this.onlyFun()) {
|
|
280
|
+
this.value()!.funMode = !this.value()!.funMode;
|
|
281
|
+
if (this.value()!.funMode && !this.value()!.fnValue) {
|
|
282
|
+
this.value()!.fnValue = { fn: `return ${JSON.stringify(this.value()!.originValue)};` };
|
|
283
|
+
}
|
|
284
|
+
this.changeValue();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
changeValue() {
|
|
289
|
+
if (this.noListen() && this.onlyFun()) {
|
|
290
|
+
this.value.set(this.editFn());
|
|
291
|
+
this.onChange(this.value());
|
|
292
|
+
return;
|
|
293
|
+
} else if (this.onlyFun() || this.value()?.funMode) {
|
|
294
|
+
this.value()!.funMode = true;
|
|
295
|
+
for (const en of Object.entries(this.value()!.fnValue.listen)) {
|
|
296
|
+
if (en[1] == "none") {
|
|
297
|
+
delete this.value()!.fnValue.listen[en[0]];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
this.value().fnValue.fn = this.editFn();
|
|
301
|
+
}
|
|
302
|
+
this.value.set(copy(this.value()));
|
|
303
|
+
this.onChange(this.value());
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
doShowDataSource(name: string) {
|
|
307
|
+
this.showDataSource.set({
|
|
308
|
+
name: name,
|
|
309
|
+
data: JSON.stringify(this.ds()[name], undefined, '\t')
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
copySuccess() {
|
|
314
|
+
this.msg.info("已复制");
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
addListen() {
|
|
318
|
+
if (this.createListenDataSourceName()) {
|
|
319
|
+
if (this.ds().hasOwnProperty(this.createListenDataSourceName())) {
|
|
320
|
+
this.msg.error("数据源名称重复");
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
if (!this.editValue().fnValue.listen) {
|
|
324
|
+
this.editValue().fnValue.listen = {};
|
|
325
|
+
}
|
|
326
|
+
this.editValue().fnValue.listen[this.createListenDataSourceName()] = "defined";
|
|
327
|
+
this.editValue.set({ ...this.editValue() });
|
|
328
|
+
}
|
|
329
|
+
this.showCreateListenModal.set(false);
|
|
330
|
+
this.createListenDataSourceName.set("");
|
|
331
|
+
this.execFnSubject.next();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
removeListen(name: string) {
|
|
335
|
+
delete this.editValue().fnValue.listen[name];
|
|
336
|
+
this.editValue.set({ ...this.editValue() });
|
|
337
|
+
this.execFnSubject.next();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async buildImportDeclarations() {
|
|
341
|
+
const libs: { content: string; filePath?: string; }[] = [];
|
|
342
|
+
for (const name in this.scripts) {
|
|
343
|
+
if (this.editValue().fnValue?.imports?.includes(name)) {
|
|
344
|
+
const filePath = this.scripts[name] + ".d.ts";
|
|
345
|
+
const dtsContent = await loadScripts(filePath);
|
|
346
|
+
libs.push({ content: dtsContent, filePath });
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
libs.push({ content: generateDeclarations(this.ds()) });
|
|
350
|
+
this.importDeclarations.set(libs);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
layoutEditor() {
|
|
354
|
+
this.funEditor?.onEvents?.({ name: "layout", target: "component" })?.subscribe();
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface FunFieldValue {
|
|
360
|
+
funMode: boolean;
|
|
361
|
+
originValue: any;
|
|
362
|
+
fnValue: any;
|
|
363
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<nz-collapse [nzBordered]="false">
|
|
2
|
+
<nz-collapse-panel nzHeader="事件设置">
|
|
3
|
+
<nz-tree #tree [nzData]="nodes()" nzDraggable nzBlockNode [nzTreeTemplate]="nodeTemp"
|
|
4
|
+
[nzExpandedKeys]="treeExpandedKeys()" (nzOnDragStart)="onDragStart($event)" [nzBeforeDrop]="beforeDrop"
|
|
5
|
+
nzExpandAll></nz-tree>
|
|
6
|
+
</nz-collapse-panel>
|
|
7
|
+
@if (showLine()) {
|
|
8
|
+
<div></div>
|
|
9
|
+
}
|
|
10
|
+
</nz-collapse>
|
|
11
|
+
|
|
12
|
+
<ng-template #nodeTemp let-node>
|
|
13
|
+
<nz-flex nzAlign="center" style="width: 100%;" nzGap="4px">
|
|
14
|
+
@switch (node.origin.type) {
|
|
15
|
+
@case ("event") {
|
|
16
|
+
<div style="white-space: nowrap;">{{node.title}}</div>
|
|
17
|
+
<a nz-button nzType="link" nzSize="small" (click)="startAddHandler(node)"><nz-icon
|
|
18
|
+
nzType="plus"></nz-icon>操作</a>
|
|
19
|
+
@if (node.children.length) {
|
|
20
|
+
<a class="expand-button" nz-button nzType="text" nzSize="small" nzShape="circle"
|
|
21
|
+
(click)="expand(node,!hasExpanded(node))"><nz-icon
|
|
22
|
+
[nzType]="hasExpanded(node)?'shrink':'arrows-alt'"></nz-icon></a>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
@case ("handler") {
|
|
26
|
+
<nz-icon style="cursor: move;" nzType="holder" nzTheme="outline" />
|
|
27
|
+
<a nz-button nzType="link" nzSize="small" (click)="startSetHandler(node)">
|
|
28
|
+
<nz-icon [nzType]="node.icon" nzTheme="outline" />
|
|
29
|
+
<span style="text-decoration: underline;white-space: nowrap;">{{node.title}}</span>
|
|
30
|
+
</a>
|
|
31
|
+
<a nz-button nzType="link" nzDanger nzSize="small" (click)="deleteHandler(node)"><nz-icon
|
|
32
|
+
nzType="delete"></nz-icon></a>
|
|
33
|
+
@if (node.children.length) {
|
|
34
|
+
<a class="expand-button" nz-button nzType="text" nzSize="small" nzShape="circle"
|
|
35
|
+
(click)="expand(node,!hasExpanded(node))"><nz-icon
|
|
36
|
+
[nzType]="hasExpanded(node)?'shrink':'arrows-alt'"></nz-icon></a>
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</nz-flex>
|
|
41
|
+
</ng-template>
|
|
42
|
+
|
|
43
|
+
<nz-modal [nzWidth]="selectedHandlerDesc()?.formStyle?.width ?? '400px'" [(nzVisible)]="isVisibleHandlerModal"
|
|
44
|
+
nzDraggable nzTitle="设置事件操作" (nzOnCancel)="isVisibleHandlerModal.set(false)" (nzOnOk)="onSetHandlerOk()"
|
|
45
|
+
(nzAfterClose)="resetSetHandler()" (nzAfterOpen)="onHandlerChange(fg.value.name)">
|
|
46
|
+
<ng-container *nzModalContent>
|
|
47
|
+
<form nz-form [formGroup]="fg">
|
|
48
|
+
<nz-form-item>
|
|
49
|
+
<nz-form-label [nzSpan]="selectedHandlerDesc()?.formStyle?.labelSpan ?? 6" nzRequired>操作</nz-form-label>
|
|
50
|
+
<nz-form-control [nzSpan]="24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)">
|
|
51
|
+
<nz-select formControlName="name" nzShowSearch nzPlaceHolder="选择操作" [nzFilterOption]="filterOption"
|
|
52
|
+
(ngModelChange)="onHandlerChange($event)">
|
|
53
|
+
@for (item of allEventHanderDescGroups(); track item.groupName) {
|
|
54
|
+
<nz-option-group [nzLabel]="item.groupName">
|
|
55
|
+
@for (item of item.handlerDescs; track item.name) {
|
|
56
|
+
<nz-option nzCustomContent [nzValue]="item.name" [nzLabel]="item.title">
|
|
57
|
+
@if (item.icon) {
|
|
58
|
+
<nz-icon [nzType]="item.icon" />
|
|
59
|
+
}
|
|
60
|
+
{{item.title}}
|
|
61
|
+
</nz-option>
|
|
62
|
+
}
|
|
63
|
+
</nz-option-group>
|
|
64
|
+
}
|
|
65
|
+
</nz-select>
|
|
66
|
+
</nz-form-control>
|
|
67
|
+
</nz-form-item>
|
|
68
|
+
<nz-form-item>
|
|
69
|
+
<nz-form-label [nzSpan]="selectedHandlerDesc()?.formStyle?.labelSpan ?? 6" nzRequired>禁用</nz-form-label>
|
|
70
|
+
<nz-form-control [nzSpan]="24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)">
|
|
71
|
+
<axis-fun-field formControlName="disabled" [noListen]="noListen()"
|
|
72
|
+
[scopes]="handlerFunFieldScopes()">
|
|
73
|
+
<nz-switch ngModel [ngModelOptions]="{standalone:true}"></nz-switch>
|
|
74
|
+
</axis-fun-field>
|
|
75
|
+
</nz-form-control>
|
|
76
|
+
</nz-form-item>
|
|
77
|
+
@if (selectedHandlerDesc()?.target == "component") {
|
|
78
|
+
<nz-form-item>
|
|
79
|
+
<nz-form-label [nzSpan]="selectedHandlerDesc()?.formStyle?.labelSpan ?? 6" nzRequired>目标</nz-form-label>
|
|
80
|
+
<nz-form-control [nzSpan]="24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)">
|
|
81
|
+
<axis-fun-field formControlName="id" [noListen]="noListen()" [scopes]="handlerFunFieldScopes()">
|
|
82
|
+
<nz-select ngModel [ngModelOptions]="{standalone:true}" nzShowSearch>
|
|
83
|
+
@for (component of canChooseComponentsInfo(); track component.componentName) {
|
|
84
|
+
<nz-option-group [nzLabel]="component.componentName">
|
|
85
|
+
@for(node of component.nodes; track node.id){
|
|
86
|
+
<nz-option [nzLabel]="node.id" [nzValue]="node.id"></nz-option>
|
|
87
|
+
}
|
|
88
|
+
</nz-option-group>
|
|
89
|
+
}
|
|
90
|
+
</nz-select>
|
|
91
|
+
</axis-fun-field>
|
|
92
|
+
</nz-form-control>
|
|
93
|
+
</nz-form-item>
|
|
94
|
+
}@else if (selectedHandlerDesc()?.target == "scope") {
|
|
95
|
+
<nz-form-item>
|
|
96
|
+
<nz-form-label [nzSpan]="selectedHandlerDesc()?.formStyle?.labelSpan ?? 6">目标域</nz-form-label>
|
|
97
|
+
<nz-form-control [nzSpan]="24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)">
|
|
98
|
+
<axis-fun-field formControlName="id" [noListen]="noListen()" [scopes]="handlerFunFieldScopes()">
|
|
99
|
+
<nz-select ngModel [ngModelOptions]="{standalone:true}" nzShowSearch nzAllowClear
|
|
100
|
+
nzPlaceHolder="默认当前域">
|
|
101
|
+
@for (scope of scopeInfoSubject().value; track scope.scopeId) {
|
|
102
|
+
@if (!scope.scopeId.startsWith("__handler_scope_")) {
|
|
103
|
+
<nz-option [nzLabel]="scope.scopeName" [nzValue]="scope.scopeId"></nz-option>
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</nz-select>
|
|
107
|
+
</axis-fun-field>
|
|
108
|
+
</nz-form-control>
|
|
109
|
+
</nz-form-item>
|
|
110
|
+
}
|
|
111
|
+
<ng-container #dataContainer></ng-container>
|
|
112
|
+
</form>
|
|
113
|
+
</ng-container>
|
|
114
|
+
</nz-modal>
|