ngx-axis-appforge 0.0.3 → 0.0.4
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/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 +40 -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/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 +12 -0
- package/package.json +16 -217
- package/providers/ng-package.json +5 -0
- package/{fesm2022/ngx-axis-appforge-providers.mjs → providers/providers.ts} +8 -16
- package/providers/public-api.ts +1 -0
- package/public-api.ts +1 -0
- package/tsconfig.json +35 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +11 -0
- package/axis-components/badge/design/index.d.ts +0 -5
- package/axis-components/badge/index.d.ts +0 -27
- package/axis-components/button/design/index.d.ts +0 -5
- package/axis-components/button/index.d.ts +0 -32
- package/axis-components/desc/design/index.d.ts +0 -5
- package/axis-components/desc/index.d.ts +0 -30
- package/axis-components/design/design/index.d.ts +0 -5
- package/axis-components/design/index.d.ts +0 -246
- package/axis-components/dynamic-container/design/index.d.ts +0 -5
- package/axis-components/dynamic-container/index.d.ts +0 -14
- package/axis-components/editor/index.d.ts +0 -33
- package/axis-components/flex/design/index.d.ts +0 -5
- package/axis-components/flex/index.d.ts +0 -20
- package/axis-components/form/design/index.d.ts +0 -5
- package/axis-components/form/index.d.ts +0 -30
- package/axis-components/form-item/design/index.d.ts +0 -5
- package/axis-components/form-item/index.d.ts +0 -34
- package/axis-components/icon/design/index.d.ts +0 -5
- package/axis-components/icon/index.d.ts +0 -16
- package/axis-components/image/design/index.d.ts +0 -5
- package/axis-components/image/index.d.ts +0 -16
- package/axis-components/index.d.ts +0 -5
- package/axis-components/input/design/index.d.ts +0 -5
- package/axis-components/input/index.d.ts +0 -27
- package/axis-components/input-component/design/index.d.ts +0 -5
- package/axis-components/input-component/index.d.ts +0 -33
- package/axis-components/input-icon/design/index.d.ts +0 -5
- package/axis-components/input-icon/index.d.ts +0 -24
- package/axis-components/input-json/design/index.d.ts +0 -5
- package/axis-components/input-json/index.d.ts +0 -24
- package/axis-components/input-number/design/index.d.ts +0 -5
- package/axis-components/input-number/index.d.ts +0 -25
- package/axis-components/modal/design/index.d.ts +0 -5
- package/axis-components/modal/index.d.ts +0 -33
- package/axis-components/scope/design/index.d.ts +0 -5
- package/axis-components/scope/index.d.ts +0 -24
- package/axis-components/single-selector/design/index.d.ts +0 -5
- package/axis-components/single-selector/index.d.ts +0 -37
- package/axis-components/splitter/design/index.d.ts +0 -5
- package/axis-components/splitter/index.d.ts +0 -28
- package/axis-components/table/design/index.d.ts +0 -5
- package/axis-components/table/index.d.ts +0 -183
- package/axis-components/text/design/index.d.ts +0 -5
- package/axis-components/text/index.d.ts +0 -24
- package/axis-components/textarea/design/index.d.ts +0 -5
- package/axis-components/textarea/index.d.ts +0 -25
- package/axis-components/tree-selector/design/index.d.ts +0 -5
- package/axis-components/tree-selector/index.d.ts +0 -76
- package/axis-components/upload/design/index.d.ts +0 -5
- package/axis-components/upload/index.d.ts +0 -51
- package/core/index.d.ts +0 -773
- package/fesm2022/ngx-axis-appforge-axis-components-badge-design.mjs +0 -191
- package/fesm2022/ngx-axis-appforge-axis-components-badge-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-badge.mjs +0 -39
- package/fesm2022/ngx-axis-appforge-axis-components-badge.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs +0 -116
- package/fesm2022/ngx-axis-appforge-axis-components-button-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs +0 -78
- package/fesm2022/ngx-axis-appforge-axis-components-button.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs +0 -224
- package/fesm2022/ngx-axis-appforge-axis-components-desc-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs +0 -51
- package/fesm2022/ngx-axis-appforge-axis-components-desc.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs +0 -69
- package/fesm2022/ngx-axis-appforge-axis-components-design-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs +0 -1746
- package/fesm2022/ngx-axis-appforge-axis-components-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs +0 -65
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container.mjs +0 -26
- package/fesm2022/ngx-axis-appforge-axis-components-dynamic-container.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-editor.mjs +0 -99
- package/fesm2022/ngx-axis-appforge-axis-components-editor.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-flex-design.mjs +0 -98
- package/fesm2022/ngx-axis-appforge-axis-components-flex-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-flex.mjs +0 -31
- package/fesm2022/ngx-axis-appforge-axis-components-flex.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form-design.mjs +0 -108
- package/fesm2022/ngx-axis-appforge-axis-components-form-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form-item-design.mjs +0 -242
- package/fesm2022/ngx-axis-appforge-axis-components-form-item-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs +0 -144
- package/fesm2022/ngx-axis-appforge-axis-components-form-item.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs +0 -132
- package/fesm2022/ngx-axis-appforge-axis-components-form.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs +0 -88
- package/fesm2022/ngx-axis-appforge-axis-components-icon-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-icon.mjs +0 -28
- package/fesm2022/ngx-axis-appforge-axis-components-icon.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs +0 -75
- package/fesm2022/ngx-axis-appforge-axis-components-image-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs +0 -43
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs +0 -70
- package/fesm2022/ngx-axis-appforge-axis-components-input-component-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs +0 -61
- package/fesm2022/ngx-axis-appforge-axis-components-input-component.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-design.mjs +0 -142
- package/fesm2022/ngx-axis-appforge-axis-components-input-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon-design.mjs +0 -71
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs +0 -64
- package/fesm2022/ngx-axis-appforge-axis-components-input-icon.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-json-design.mjs +0 -60
- package/fesm2022/ngx-axis-appforge-axis-components-input-json-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs +0 -70
- package/fesm2022/ngx-axis-appforge-axis-components-input-json.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-number-design.mjs +0 -107
- package/fesm2022/ngx-axis-appforge-axis-components-input-number-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input-number.mjs +0 -48
- package/fesm2022/ngx-axis-appforge-axis-components-input-number.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-input.mjs +0 -68
- package/fesm2022/ngx-axis-appforge-axis-components-input.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-modal-design.mjs +0 -181
- package/fesm2022/ngx-axis-appforge-axis-components-modal-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs +0 -74
- package/fesm2022/ngx-axis-appforge-axis-components-modal.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs +0 -330
- package/fesm2022/ngx-axis-appforge-axis-components-scope-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs +0 -55
- package/fesm2022/ngx-axis-appforge-axis-components-scope.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs +0 -120
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector.mjs +0 -102
- package/fesm2022/ngx-axis-appforge-axis-components-single-selector.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs +0 -178
- package/fesm2022/ngx-axis-appforge-axis-components-splitter-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs +0 -49
- package/fesm2022/ngx-axis-appforge-axis-components-splitter.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs +0 -442
- package/fesm2022/ngx-axis-appforge-axis-components-table-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs +0 -452
- package/fesm2022/ngx-axis-appforge-axis-components-table.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-text-design.mjs +0 -95
- package/fesm2022/ngx-axis-appforge-axis-components-text-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-text.mjs +0 -64
- package/fesm2022/ngx-axis-appforge-axis-components-text.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-textarea-design.mjs +0 -94
- package/fesm2022/ngx-axis-appforge-axis-components-textarea-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-textarea.mjs +0 -64
- package/fesm2022/ngx-axis-appforge-axis-components-textarea.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs +0 -222
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs +0 -295
- package/fesm2022/ngx-axis-appforge-axis-components-tree-selector.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs +0 -146
- package/fesm2022/ngx-axis-appforge-axis-components-upload-design.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +0 -156
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +0 -988
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +0 -3169
- package/fesm2022/ngx-axis-appforge-core.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge-providers.mjs.map +0 -1
- package/fesm2022/ngx-axis-appforge.mjs +0 -6
- package/fesm2022/ngx-axis-appforge.mjs.map +0 -1
- package/index.d.ts +0 -2
- package/providers/index.d.ts +0 -13
|
@@ -1,3169 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, effect, inject, input, ElementRef, isSignal, Directive, Optional, Inject, Injectable, Injector, HostBinding, model, ViewChild, ViewContainerRef, forwardRef, Pipe, signal, ChangeDetectionStrategy, Component, computed, ContentChild } from '@angular/core';
|
|
3
|
-
import { map, catchError, of, BehaviorSubject, Subject, switchMap, debounceTime, Observable, isObservable, merge, NEVER, filter, take, mergeMap, from, mergeWith } from 'rxjs';
|
|
4
|
-
import * as i1 from '@angular/common/http';
|
|
5
|
-
import { HttpRequest, HttpClient } from '@angular/common/http';
|
|
6
|
-
import * as i4 from '@angular/router';
|
|
7
|
-
import { ActivatedRoute } from '@angular/router';
|
|
8
|
-
import * as i2 from 'ng-zorro-antd/message';
|
|
9
|
-
import * as i2$1 from 'ng-zorro-antd/modal';
|
|
10
|
-
import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
11
|
-
import * as i2$4 from 'ng-zorro-antd/dropdown';
|
|
12
|
-
import { NzContextMenuService, NzDropDownModule } from 'ng-zorro-antd/dropdown';
|
|
13
|
-
import * as i3$2 from '@angular/forms';
|
|
14
|
-
import { FormGroup, FormArray, FormBuilder, NG_VALUE_ACCESSOR, FormsModule, NgModel, Validators, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
|
15
|
-
import * as i1$1 from 'ng-zorro-antd/divider';
|
|
16
|
-
import { NzDividerModule } from 'ng-zorro-antd/divider';
|
|
17
|
-
import * as i3 from 'ng-zorro-antd/icon';
|
|
18
|
-
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
19
|
-
import * as i2$2 from 'ng-zorro-antd/menu';
|
|
20
|
-
import { NzListModule } from 'ng-zorro-antd/list';
|
|
21
|
-
import * as i3$1 from 'ng-zorro-antd/flex';
|
|
22
|
-
import { NzFlexModule } from 'ng-zorro-antd/flex';
|
|
23
|
-
import * as i4$1 from 'ng-zorro-antd/input';
|
|
24
|
-
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
25
|
-
import * as i6 from 'ng-zorro-antd/button';
|
|
26
|
-
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
27
|
-
import * as i5$1 from 'ng-zorro-antd/radio';
|
|
28
|
-
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
29
|
-
import * as i10 from 'ngx-clipboard';
|
|
30
|
-
import { ClipboardModule } from 'ngx-clipboard';
|
|
31
|
-
import * as i11 from 'ng-zorro-antd/alert';
|
|
32
|
-
import { NzAlertModule } from 'ng-zorro-antd/alert';
|
|
33
|
-
import * as i12 from 'ng-zorro-antd/empty';
|
|
34
|
-
import { NzEmptyModule } from 'ng-zorro-antd/empty';
|
|
35
|
-
import * as i4$2 from 'ng-zorro-antd/select';
|
|
36
|
-
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
37
|
-
import * as i14 from 'ng-zorro-antd/splitter';
|
|
38
|
-
import { NzSplitterModule } from 'ng-zorro-antd/splitter';
|
|
39
|
-
import * as i1$2 from 'ng-zorro-antd/collapse';
|
|
40
|
-
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
41
|
-
import * as i16 from 'ng-zorro-antd/checkbox';
|
|
42
|
-
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
|
|
43
|
-
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
44
|
-
import * as i7 from 'ng-zorro-antd/core/transition-patch';
|
|
45
|
-
import * as i8 from 'ng-zorro-antd/core/wave';
|
|
46
|
-
import * as i2$3 from 'ng-zorro-antd/form';
|
|
47
|
-
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
48
|
-
import * as i4$3 from 'ng-zorro-antd/switch';
|
|
49
|
-
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
50
|
-
import * as i1$3 from 'ng-zorro-antd/grid';
|
|
51
|
-
import * as i7$1 from 'ng-zorro-antd/tree';
|
|
52
|
-
import { NzTreeModule } from 'ng-zorro-antd/tree';
|
|
53
|
-
import * as i5 from 'ng-zorro-antd/auto-complete';
|
|
54
|
-
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
|
|
55
|
-
import { NzTagModule } from 'ng-zorro-antd/tag';
|
|
56
|
-
import { CommonModule } from '@angular/common';
|
|
57
|
-
|
|
58
|
-
const AXIS_DESIGN_OPTIONS_NODE_FOR_MENU = new InjectionToken('axis.design.optionsNodeForMenu');
|
|
59
|
-
const AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN = new InjectionToken('axis.design.scopeInfosGetter');
|
|
60
|
-
const AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN = new InjectionToken('axis.design.optionsNodesForSetting');
|
|
61
|
-
const AXIS_DESIGN_ALL_PERMISSIONS_TOKEN = new InjectionToken('axis.design.allPermissions');
|
|
62
|
-
const AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN = new InjectionToken('axis.design.chooseComponentFunc');
|
|
63
|
-
const AXIS_DESIGN_CMPLIBS_TOKEN = new InjectionToken('axis.design.cmplibs');
|
|
64
|
-
const AXIS_COMPONENTS_TOKEN = new InjectionToken('axis.components');
|
|
65
|
-
const AXIS_COMPONENTS_LOADER_TOKEN = new InjectionToken('axis.componentsLoader');
|
|
66
|
-
const AXIS_SCRIPTS_TOKEN = new InjectionToken('axis.scripts');
|
|
67
|
-
const AXIS_EVENT_HANDLERS_TOKEN = new InjectionToken('axis.eventHandlers');
|
|
68
|
-
const AXIS_EVENT_HANDLER_DESCS_TOKEN = new InjectionToken('axis.eventHandlersDescs');
|
|
69
|
-
const AXIS_INJECT_DATA_TOKEN = new InjectionToken('axis.injectData');
|
|
70
|
-
const AXIS_INJECT_FUNC_TOKEN = new InjectionToken('axis.injectFunc');
|
|
71
|
-
const AXIS_CURRENT_USER_PERMISSIONS_TOKEN = new InjectionToken('axis.currentUserPermissions');
|
|
72
|
-
const AXIS_FORM_REGISTE_CONTROL_TOKEN = new InjectionToken('axis.form.registeControl');
|
|
73
|
-
const AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN = new InjectionToken('axis.form-item.registeValueAccess');
|
|
74
|
-
|
|
75
|
-
const notDefinedRegDefault = /^(.*) is not defined$/;
|
|
76
|
-
const notDefinedRegIOS = /^Can't find variable: (.*)$/;
|
|
77
|
-
function fn(fnBody, argsObj, ignoreUndefined = false, printError = true) {
|
|
78
|
-
let argsName = [];
|
|
79
|
-
let args = [];
|
|
80
|
-
if (argsObj) {
|
|
81
|
-
argsName = Object.keys(argsObj);
|
|
82
|
-
args = argsName.map(n => argsObj[n]);
|
|
83
|
-
}
|
|
84
|
-
while (true) {
|
|
85
|
-
try {
|
|
86
|
-
const fun = new Function(...argsName, fnBody);
|
|
87
|
-
if (fun && fun instanceof Function) {
|
|
88
|
-
return fun(...args);
|
|
89
|
-
}
|
|
90
|
-
else if (printError) {
|
|
91
|
-
_consoleError(fnBody, args, argsName);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
if (ignoreUndefined && e instanceof ReferenceError && (notDefinedRegDefault.test(e.message) || notDefinedRegIOS.test(e.message))) {
|
|
96
|
-
const defaultMatch = notDefinedRegDefault.exec(e.message);
|
|
97
|
-
const iosMatch = notDefinedRegIOS.exec(e.message);
|
|
98
|
-
if (defaultMatch) {
|
|
99
|
-
argsName.push(defaultMatch[1]);
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
else if (iosMatch && iosMatch[1]) {
|
|
103
|
-
argsName.push(iosMatch[1]);
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (printError) {
|
|
108
|
-
_consoleError(fnBody, args, argsName, e);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function _consoleError(fnBody, args, argsName, e) {
|
|
115
|
-
let ds = [];
|
|
116
|
-
args.forEach((e, i) => {
|
|
117
|
-
ds[i] = { name: argsName[i], value: e };
|
|
118
|
-
});
|
|
119
|
-
console.groupCollapsed(`%c 函数${e ? '编译' : '执行'}失败`, "color:red");
|
|
120
|
-
if (e) {
|
|
121
|
-
console.error("失败原因", e.message);
|
|
122
|
-
}
|
|
123
|
-
console.log("函数体", fnBody);
|
|
124
|
-
console.log("数据源", ds);
|
|
125
|
-
console.groupEnd();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const loadedMap = new Map();
|
|
129
|
-
const loadingMap = new Map();
|
|
130
|
-
function loadScripts(path) {
|
|
131
|
-
if (loadedMap.has(path)) {
|
|
132
|
-
return Promise.resolve(loadedMap.get(path));
|
|
133
|
-
}
|
|
134
|
-
if (loadingMap.has(path)) {
|
|
135
|
-
return loadingMap.get(path);
|
|
136
|
-
}
|
|
137
|
-
loadingMap.set(path, downloadScript(path).then(script => {
|
|
138
|
-
loadedMap.set(path, script);
|
|
139
|
-
loadingMap.delete(path);
|
|
140
|
-
return script;
|
|
141
|
-
}));
|
|
142
|
-
return loadingMap.get(path);
|
|
143
|
-
}
|
|
144
|
-
function syncLoadScript(path) {
|
|
145
|
-
return loadedMap.get(path);
|
|
146
|
-
}
|
|
147
|
-
async function downloadScript(path) {
|
|
148
|
-
return await (await fetch(path)).text();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
class DesignBuilder {
|
|
152
|
-
buildElement;
|
|
153
|
-
buildScope;
|
|
154
|
-
constructor(buildElement, buildScope) {
|
|
155
|
-
this.buildElement = buildElement;
|
|
156
|
-
this.buildScope = buildScope;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function sendApi(opt, http) {
|
|
161
|
-
return http.request(new HttpRequest(opt.method?.toUpperCase() || "GET", opt.url, opt.body))
|
|
162
|
-
.pipe(map((h) => h.body), catchError(e => of(undefined)));
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function listSort(list, compareField, reverse = false) {
|
|
166
|
-
const type = typeof list.map(e => e[compareField]).find(e => e != null);
|
|
167
|
-
const factor = reverse ? -1 : 1;
|
|
168
|
-
if (type == "number") {
|
|
169
|
-
list.sort((a, b) => (a[compareField] - b[compareField]) * factor);
|
|
170
|
-
}
|
|
171
|
-
else if (type == "string") {
|
|
172
|
-
list.sort((a, b) => ((a[compareField] || "") + "").localeCompare(b[compareField]) * factor);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function trackByFn(trackByField) {
|
|
176
|
-
return (index, item) => {
|
|
177
|
-
return item[trackByField];
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
function copy(obj, deepCopy = false) {
|
|
181
|
-
let newobj = obj;
|
|
182
|
-
if (obj instanceof Array) {
|
|
183
|
-
newobj = [];
|
|
184
|
-
obj.forEach((item, i) => {
|
|
185
|
-
try {
|
|
186
|
-
newobj[i] = copy(item, deepCopy);
|
|
187
|
-
}
|
|
188
|
-
catch (e) {
|
|
189
|
-
console.error("复制对象失败", obj);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
else if (obj instanceof Object) {
|
|
194
|
-
newobj = Object.assign({}, obj);
|
|
195
|
-
if (deepCopy) {
|
|
196
|
-
for (const n in newobj) {
|
|
197
|
-
if (newobj[n] instanceof Object) {
|
|
198
|
-
newobj[n] = copy(newobj[n], deepCopy);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
return newobj;
|
|
204
|
-
}
|
|
205
|
-
function deepMerge(...objs) {
|
|
206
|
-
const temp = {};
|
|
207
|
-
objs = objs.filter(e => e);
|
|
208
|
-
objs.forEach(o => {
|
|
209
|
-
Object.keys(o).filter(k => o[k] != null && typeof o[k] == "object" && !(o[k] instanceof Array)).forEach(k => {
|
|
210
|
-
if (!temp.hasOwnProperty(k)) {
|
|
211
|
-
temp[k] = {};
|
|
212
|
-
}
|
|
213
|
-
temp[k] = deepMerge(temp[k], o[k]);
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
objs.push(temp);
|
|
217
|
-
return Object.assign({}, ...objs);
|
|
218
|
-
}
|
|
219
|
-
function obj2Arr(obj) {
|
|
220
|
-
const arr = [];
|
|
221
|
-
if (obj) {
|
|
222
|
-
for (let n in obj) {
|
|
223
|
-
arr.push(obj[n]);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return arr;
|
|
227
|
-
}
|
|
228
|
-
function recursionArray(arr, options, offsetLevel = 0, parent) {
|
|
229
|
-
const childrenField = options.childrenField ?? "children";
|
|
230
|
-
if (options.before || options.after) {
|
|
231
|
-
for (let i = 0; i < arr.length; i++) {
|
|
232
|
-
const n = arr[i];
|
|
233
|
-
let ctn = options.before?.(n, offsetLevel, parent);
|
|
234
|
-
if (ctn === false) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (Array.isArray(n[childrenField])) {
|
|
238
|
-
if (recursionArray(n[childrenField], options, offsetLevel + 1, n) === false) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
ctn = options.after?.(n, offsetLevel, parent);
|
|
243
|
-
if (ctn === false) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function recursionObject(obj, handler, keys = [], parent) {
|
|
250
|
-
if (!obj) {
|
|
251
|
-
handler(keys, obj, parent);
|
|
252
|
-
}
|
|
253
|
-
else if (obj instanceof Array) {
|
|
254
|
-
obj.forEach((v, i) => {
|
|
255
|
-
const nextKeys = [].concat(keys);
|
|
256
|
-
nextKeys.push(i.toString());
|
|
257
|
-
recursionObject(v, handler, nextKeys, obj);
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
else if (typeof (obj) == "object") {
|
|
261
|
-
Object.keys(obj).forEach(k => {
|
|
262
|
-
const nextKeys = [].concat(keys);
|
|
263
|
-
nextKeys.push(k);
|
|
264
|
-
recursionObject(obj[k], handler, nextKeys, obj);
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
handler(keys, obj, parent);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function rebuildObject(targetObj, sourceObj) {
|
|
272
|
-
if (sourceObj) {
|
|
273
|
-
if (!targetObj) {
|
|
274
|
-
targetObj = {};
|
|
275
|
-
}
|
|
276
|
-
Object.keys(targetObj).forEach(k => {
|
|
277
|
-
delete targetObj[k];
|
|
278
|
-
});
|
|
279
|
-
Object.assign(targetObj, sourceObj);
|
|
280
|
-
}
|
|
281
|
-
return targetObj;
|
|
282
|
-
}
|
|
283
|
-
function assignDefaultField(targetObj, sourceObj) {
|
|
284
|
-
if (!targetObj) {
|
|
285
|
-
return sourceObj;
|
|
286
|
-
}
|
|
287
|
-
else if (!sourceObj) {
|
|
288
|
-
return targetObj;
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
Object.keys(sourceObj).forEach(k => {
|
|
292
|
-
if (targetObj[k] == undefined) {
|
|
293
|
-
targetObj[k] = sourceObj[k];
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
return targetObj;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function isEquals(objA, objB) {
|
|
300
|
-
if (objA !== objB) {
|
|
301
|
-
const t = typeof (objA);
|
|
302
|
-
if (t != typeof (objB)) {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
switch (t) {
|
|
306
|
-
case "object":
|
|
307
|
-
if (!objA && !objB) {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
else if (objA && objB) {
|
|
311
|
-
const keysA = Object.keys(objA);
|
|
312
|
-
const keysB = Object.keys(objB);
|
|
313
|
-
if (keysA.length != keysB.length) {
|
|
314
|
-
return false;
|
|
315
|
-
}
|
|
316
|
-
for (const k of keysA) {
|
|
317
|
-
if (!isEquals(objA[k], objB[k])) {
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
break;
|
|
326
|
-
default:
|
|
327
|
-
return objA == objB;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
return true;
|
|
331
|
-
}
|
|
332
|
-
function objDiff(last, current) {
|
|
333
|
-
const diff = new Set();
|
|
334
|
-
if (last && current) {
|
|
335
|
-
for (const key of new Set(Object.keys(last).concat(Object.keys(current)))) {
|
|
336
|
-
if (last[key] != current[key]) {
|
|
337
|
-
diff.add(key);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
else if (last) {
|
|
342
|
-
return new Set(Object.keys(last));
|
|
343
|
-
}
|
|
344
|
-
else if (current) {
|
|
345
|
-
return new Set(Object.keys(current));
|
|
346
|
-
}
|
|
347
|
-
return diff;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
class ScopeDirective {
|
|
351
|
-
constructor() {
|
|
352
|
-
effect(() => {
|
|
353
|
-
if (!this.oriDataSources || !isEquals(this.oriDataSources, this.dataSources())) {
|
|
354
|
-
this.oriDataSources = copy(this.dataSources(), true);
|
|
355
|
-
this.initDs();
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
oriDataSources;
|
|
360
|
-
http = inject(HttpClient);
|
|
361
|
-
axisScope = input.required(...(ngDevMode ? [{ debugName: "axisScope" }] : []));
|
|
362
|
-
scopeName = input.required(...(ngDevMode ? [{ debugName: "scopeName" }] : []));
|
|
363
|
-
isRoot = input(false, ...(ngDevMode ? [{ debugName: "isRoot" }] : []));
|
|
364
|
-
_parentScope = inject(ScopeDirective, { optional: true, skipSelf: true });
|
|
365
|
-
scripts = inject(AXIS_SCRIPTS_TOKEN, { optional: true });
|
|
366
|
-
injectData = inject(AXIS_INJECT_DATA_TOKEN, { optional: true });
|
|
367
|
-
injectFuncs = inject(AXIS_INJECT_FUNC_TOKEN, { optional: true });
|
|
368
|
-
dataSources = input(...(ngDevMode ? [undefined, { debugName: "dataSources" }] : []));
|
|
369
|
-
designBuilder = inject(DesignBuilder, { optional: true });
|
|
370
|
-
ds = new Map();
|
|
371
|
-
updateDs = new Map();
|
|
372
|
-
dynamicOptionsSubs = [];
|
|
373
|
-
rootSubs = [];
|
|
374
|
-
injectDataSub;
|
|
375
|
-
instanceMap = new Map();
|
|
376
|
-
changeSubject = new BehaviorSubject(void (0));
|
|
377
|
-
latestUpdateOptions = new Map();
|
|
378
|
-
get parentScope() {
|
|
379
|
-
return this.isRoot() ? null : this._parentScope;
|
|
380
|
-
}
|
|
381
|
-
host = inject(ElementRef);
|
|
382
|
-
ngOnInit() {
|
|
383
|
-
this.designBuilder?.buildScope(this);
|
|
384
|
-
}
|
|
385
|
-
initDs() {
|
|
386
|
-
for (const s of this.dynamicOptionsSubs.values()) {
|
|
387
|
-
s.unsubscribe();
|
|
388
|
-
}
|
|
389
|
-
this.dynamicOptionsSubs = [];
|
|
390
|
-
for (const oriopt of this.dataSources() ?? []) {
|
|
391
|
-
let needConnect = false;
|
|
392
|
-
if (!this.updateDs.has(oriopt.name)) {
|
|
393
|
-
needConnect = true;
|
|
394
|
-
this.updateDs.set(oriopt.name, new Subject());
|
|
395
|
-
}
|
|
396
|
-
const updateSubject = this.updateDs.get(oriopt.name);
|
|
397
|
-
if (!this.ds.has(oriopt.name)) {
|
|
398
|
-
needConnect = true;
|
|
399
|
-
this.ds.set(oriopt.name, new BehaviorSubject(undefined));
|
|
400
|
-
}
|
|
401
|
-
if (needConnect) {
|
|
402
|
-
this.rootSubs.push(updateSubject.pipe(switchMap(opt => this.updateDataSource(opt)))
|
|
403
|
-
.subscribe(this.ds.get(oriopt.name)));
|
|
404
|
-
}
|
|
405
|
-
if (oriopt.type != 'local') {
|
|
406
|
-
delete oriopt.data;
|
|
407
|
-
}
|
|
408
|
-
const io = this.dynamicOptions(oriopt, oriopt.type == 'api');
|
|
409
|
-
if (io.init !== undefined) {
|
|
410
|
-
updateSubject.next(io.init);
|
|
411
|
-
}
|
|
412
|
-
if (io.obs) {
|
|
413
|
-
this.dynamicOptionsSubs.push(io.obs.pipe(debounceTime(100)).subscribe(updateSubject));
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
this.changeSubject.next();
|
|
417
|
-
}
|
|
418
|
-
updateDataSource(opt) {
|
|
419
|
-
return new Observable(sub => {
|
|
420
|
-
this.latestUpdateOptions.set(opt.name, opt);
|
|
421
|
-
switch (opt.type) {
|
|
422
|
-
case 'api':
|
|
423
|
-
if (opt.api?.url) {
|
|
424
|
-
this.rootSubs.push(sendApi(opt.api, this.http).subscribe({
|
|
425
|
-
next: (res) => sub.next(res),
|
|
426
|
-
}));
|
|
427
|
-
}
|
|
428
|
-
break;
|
|
429
|
-
case 'local':
|
|
430
|
-
if (opt.data !== undefined) {
|
|
431
|
-
sub.next(opt.data);
|
|
432
|
-
}
|
|
433
|
-
break;
|
|
434
|
-
case 'inject':
|
|
435
|
-
if (opt.injectField) {
|
|
436
|
-
this.injectDataSub?.unsubscribe();
|
|
437
|
-
if (this.injectData) {
|
|
438
|
-
if (isObservable(this.injectData)) {
|
|
439
|
-
this.injectDataSub = this.injectData
|
|
440
|
-
.subscribe((injectData) => {
|
|
441
|
-
sub.next(injectData?.[opt.injectField]);
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
sub.next(this.injectData?.[opt.injectField]);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
break;
|
|
450
|
-
case 'cache':
|
|
451
|
-
if (opt.cacheKey) {
|
|
452
|
-
const cacheData = localStorage.getItem(opt.cacheKey);
|
|
453
|
-
if (cacheData != null) {
|
|
454
|
-
sub.next(JSON.parse(cacheData));
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
break;
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
get(name, init = true) {
|
|
462
|
-
let res;
|
|
463
|
-
if (this.ds.has(name)) {
|
|
464
|
-
res = this.ds.get(name)?.asObservable();
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
res = this.parentScope?.get(name, false);
|
|
468
|
-
}
|
|
469
|
-
if (!res && init) {
|
|
470
|
-
this.ds.set(name, new BehaviorSubject(undefined));
|
|
471
|
-
res = this.ds.get(name).asObservable();
|
|
472
|
-
}
|
|
473
|
-
return res;
|
|
474
|
-
}
|
|
475
|
-
snapshot(name) {
|
|
476
|
-
if (this.ds.has(name)) {
|
|
477
|
-
return this.ds.get(name).value;
|
|
478
|
-
}
|
|
479
|
-
return this.parentScope?.snapshot(name);
|
|
480
|
-
}
|
|
481
|
-
snapshotAll() {
|
|
482
|
-
const data = {};
|
|
483
|
-
this.ds.forEach((d, name) => {
|
|
484
|
-
data[name] = d.value;
|
|
485
|
-
});
|
|
486
|
-
if (this.parentScope) {
|
|
487
|
-
return Object.assign(this.parentScope.snapshotAll(), data);
|
|
488
|
-
}
|
|
489
|
-
else {
|
|
490
|
-
return data;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
getSnapshoptAllWithScopeId(scopeId) {
|
|
494
|
-
if (this.axisScope() == scopeId) {
|
|
495
|
-
const data = {};
|
|
496
|
-
this.ds.forEach((d, name) => {
|
|
497
|
-
data[name] = d.getValue();
|
|
498
|
-
});
|
|
499
|
-
return data;
|
|
500
|
-
}
|
|
501
|
-
else {
|
|
502
|
-
return this.parentScope?.getSnapshoptAllWithScopeId(scopeId);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
getAllWithScopeId(scopeId) {
|
|
506
|
-
if (this.axisScope() == scopeId) {
|
|
507
|
-
return this.changeSubject.pipe(switchMap(_ => this.ds.size ? merge(...this.ds.values()) : of(null)), map(() => this.getSnapshoptAllWithScopeId(scopeId)));
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
return this.parentScope?.getAllWithScopeId(scopeId) ?? NEVER;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
dynamicField(obj, field, deep = false, tempDataSource) {
|
|
514
|
-
const res = {
|
|
515
|
-
firstDefinedFields: [],
|
|
516
|
-
definedFields: [],
|
|
517
|
-
};
|
|
518
|
-
if (Object.hasOwn(obj, `$${field}`)) {
|
|
519
|
-
const $obj = obj[`$${field}`];
|
|
520
|
-
if (typeof $obj == 'object' && $obj) {
|
|
521
|
-
if ($obj.listen && Object.keys($obj.listen).length) {
|
|
522
|
-
res.firstDefinedFields = [];
|
|
523
|
-
res.definedFields = [];
|
|
524
|
-
res.obs = merge(...Object.entries($obj.listen).map(en => {
|
|
525
|
-
const obs = this.get(en[0]);
|
|
526
|
-
switch (en[1]) {
|
|
527
|
-
case "firstDefined":
|
|
528
|
-
res.firstDefinedFields?.push(en[0]);
|
|
529
|
-
return obs.pipe(filter(v => v !== undefined), take(1));
|
|
530
|
-
case "defined":
|
|
531
|
-
res.definedFields?.push(en[0]);
|
|
532
|
-
return obs.pipe(filter(v => v !== undefined));
|
|
533
|
-
default:
|
|
534
|
-
return obs;
|
|
535
|
-
}
|
|
536
|
-
})).pipe(map(_ => this.runFnWithImports($obj.fn, Object.assign(this.snapshotAll(), tempDataSource), $obj.imports)));
|
|
537
|
-
}
|
|
538
|
-
if (!$obj.listen || Object.entries($obj.listen).every(en => en[1] == "aways" || (!this.ds.get(en[0])?.closed && this.ds.get(en[0])?.value !== undefined))) {
|
|
539
|
-
res.init = this.runFnWithImports($obj.fn, Object.assign(this.snapshotAll(), tempDataSource), $obj.imports);
|
|
540
|
-
}
|
|
541
|
-
return res;
|
|
542
|
-
}
|
|
543
|
-
else {
|
|
544
|
-
throw new Error(`$${field} is not a valid dynamic field`);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
if (deep && obj[field] && typeof obj[field] == "object" && !Array.isArray(obj[field])) {
|
|
548
|
-
return this.dynamicOptions(obj[field], true, tempDataSource);
|
|
549
|
-
}
|
|
550
|
-
res.init = obj[field];
|
|
551
|
-
return res;
|
|
552
|
-
}
|
|
553
|
-
snapshotField(obj, field, tempDataSource) {
|
|
554
|
-
if (Object.hasOwn(obj, `$${field}`)) {
|
|
555
|
-
const $obj = obj[`$${field}`];
|
|
556
|
-
if (typeof $obj == 'object') {
|
|
557
|
-
const args = this.snapshotAll();
|
|
558
|
-
if (tempDataSource) {
|
|
559
|
-
Object.assign(args, tempDataSource);
|
|
560
|
-
}
|
|
561
|
-
return this.runFnWithImports($obj.fn, args, $obj.imports);
|
|
562
|
-
}
|
|
563
|
-
throw new Error(`$${field} is not a valid dynamic field`);
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
if (obj[field] && typeof obj[field] == "object" && !Array.isArray(obj[field])) {
|
|
567
|
-
return this.snapshotOptions(obj[field], tempDataSource);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
return obj[field];
|
|
571
|
-
}
|
|
572
|
-
bindOptions(optionsConfig, options, tempDataSource) {
|
|
573
|
-
const subs = [];
|
|
574
|
-
for (const en of Object.entries(options)) {
|
|
575
|
-
if (isSignal(en[1])) {
|
|
576
|
-
const io = this.dynamicField(optionsConfig, en[0], false, tempDataSource);
|
|
577
|
-
if (io.init !== undefined) {
|
|
578
|
-
en[1].set(io.init);
|
|
579
|
-
}
|
|
580
|
-
if (io.obs) {
|
|
581
|
-
subs.push(io.obs.pipe(filter(v => v !== undefined))
|
|
582
|
-
.subscribe(en[1].set));
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
options[en[0]] = this.snapshotField(optionsConfig, en[0], tempDataSource);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
return subs;
|
|
590
|
-
}
|
|
591
|
-
dynamicOptions(optionsConfig, deep = false, tempDataSource) {
|
|
592
|
-
const res = {
|
|
593
|
-
definedFields: [],
|
|
594
|
-
firstDefinedFields: []
|
|
595
|
-
};
|
|
596
|
-
const obs = [];
|
|
597
|
-
const empptObj = {};
|
|
598
|
-
let setInit = true;
|
|
599
|
-
for (const en of Object.entries(optionsConfig)) {
|
|
600
|
-
if (en[1] === undefined) {
|
|
601
|
-
continue;
|
|
602
|
-
}
|
|
603
|
-
const field = en[0].replace(/^\$/, '');
|
|
604
|
-
const r = this.dynamicField(optionsConfig, field, deep, tempDataSource);
|
|
605
|
-
if (r.init !== undefined) {
|
|
606
|
-
empptObj[field] = r.init;
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
setInit = false;
|
|
610
|
-
}
|
|
611
|
-
if (r.obs) {
|
|
612
|
-
if (r.definedFields) {
|
|
613
|
-
res.definedFields = res.definedFields?.concat(r.definedFields);
|
|
614
|
-
}
|
|
615
|
-
if (r.firstDefinedFields) {
|
|
616
|
-
res.firstDefinedFields = res.firstDefinedFields?.concat(r.firstDefinedFields);
|
|
617
|
-
}
|
|
618
|
-
obs.push(r.obs.pipe(map(v => ({ [field]: v }))));
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
if (setInit && Object.keys(empptObj).length) {
|
|
622
|
-
res.init = empptObj;
|
|
623
|
-
}
|
|
624
|
-
if (obs.length) {
|
|
625
|
-
res.obs = merge(...obs).pipe(map(v => Object.assign(empptObj, v)), filter(_ => {
|
|
626
|
-
for (const f of res.definedFields) {
|
|
627
|
-
if (this.ds.get(f)?.value === undefined) {
|
|
628
|
-
return false;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
for (const f of res.firstDefinedFields) {
|
|
632
|
-
if (this.ds.get(f)?.value === undefined) {
|
|
633
|
-
return false;
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
res.firstDefinedFields = res.firstDefinedFields?.filter(ff => ff != f);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
return true;
|
|
640
|
-
}));
|
|
641
|
-
}
|
|
642
|
-
return res;
|
|
643
|
-
}
|
|
644
|
-
snapshotOptions(optionsConfig, tempDataSource) {
|
|
645
|
-
const res = {};
|
|
646
|
-
for (const en of Object.entries(optionsConfig)) {
|
|
647
|
-
const field = en[0].replace(/^\$/, '');
|
|
648
|
-
res[field] = this.snapshotField(optionsConfig, field, tempDataSource);
|
|
649
|
-
}
|
|
650
|
-
return res;
|
|
651
|
-
}
|
|
652
|
-
registInstance(id, instance) {
|
|
653
|
-
if (id) {
|
|
654
|
-
this.instanceMap.set(id, instance);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
unRegistInstance(id) {
|
|
658
|
-
this.instanceMap.delete(id);
|
|
659
|
-
}
|
|
660
|
-
findInstance(id) {
|
|
661
|
-
return this.instanceMap.get(id) ?? this.parentScope?.findInstance(id);
|
|
662
|
-
}
|
|
663
|
-
findScope(scopeId) {
|
|
664
|
-
if (this.axisScope() == scopeId) {
|
|
665
|
-
return this;
|
|
666
|
-
}
|
|
667
|
-
else {
|
|
668
|
-
return this.parentScope?.findScope(scopeId);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
ngOnDestroy() {
|
|
672
|
-
for (const s of this.dynamicOptionsSubs.values()) {
|
|
673
|
-
s.unsubscribe();
|
|
674
|
-
}
|
|
675
|
-
for (const s of this.rootSubs.values()) {
|
|
676
|
-
s.unsubscribe();
|
|
677
|
-
}
|
|
678
|
-
this.changeSubject.unsubscribe();
|
|
679
|
-
for (const d of this.ds.values()) {
|
|
680
|
-
d.unsubscribe();
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
onEvents(e) {
|
|
684
|
-
if (e.id === this.axisScope() || !e.id) {
|
|
685
|
-
switch (e.name) {
|
|
686
|
-
case "setDataSource":
|
|
687
|
-
return this.setDataSourceEventHandler(e.data);
|
|
688
|
-
case "refreshDataSource":
|
|
689
|
-
return this.refreshDataSourceEventHandler(e.data);
|
|
690
|
-
default:
|
|
691
|
-
return undefined;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
else {
|
|
695
|
-
return this.parentScope?.onEvents(e) ?? of(true);
|
|
696
|
-
;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
setDataSourceEventHandler(data) {
|
|
700
|
-
if (this.ds.has(data.name)) {
|
|
701
|
-
this.ds.get(data.name).next(data.data);
|
|
702
|
-
const opt = this.latestUpdateOptions.get(data.name);
|
|
703
|
-
if (opt?.type == "cache" && opt.cacheKey) {
|
|
704
|
-
localStorage.setItem(opt.cacheKey, JSON.stringify(data.data));
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
else {
|
|
708
|
-
this.ds.set(data.name, new BehaviorSubject(data.data));
|
|
709
|
-
this.changeSubject.next();
|
|
710
|
-
}
|
|
711
|
-
return of(true);
|
|
712
|
-
}
|
|
713
|
-
refreshDataSourceEventHandler(data) {
|
|
714
|
-
if (this.latestUpdateOptions.has(data.name)) {
|
|
715
|
-
if (data.setNull) {
|
|
716
|
-
this.ds.get(data.name).next(null);
|
|
717
|
-
}
|
|
718
|
-
this.updateDs.get(data.name)?.next(this.latestUpdateOptions.get(data.name));
|
|
719
|
-
}
|
|
720
|
-
return of(true);
|
|
721
|
-
}
|
|
722
|
-
async preloadImports(obj) {
|
|
723
|
-
if (this.scripts) {
|
|
724
|
-
const imports = new Set();
|
|
725
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
726
|
-
if (key.startsWith("$")) {
|
|
727
|
-
value.imports?.forEach(i => imports.add(i));
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
if (imports.size) {
|
|
731
|
-
await Promise.all(Array.from(imports.values()).map(i => loadScripts(this.scripts[i] + ".js")));
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
runFnWithImports(fnstr, args, imports) {
|
|
736
|
-
const libs = [];
|
|
737
|
-
for (const i of imports ?? []) {
|
|
738
|
-
if (this.scripts?.hasOwnProperty(i)) {
|
|
739
|
-
const js = syncLoadScript(`${this.scripts[i]}.js`);
|
|
740
|
-
if (js) {
|
|
741
|
-
libs.push(js);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
return fn(`${libs.join("\n")}\n${fnstr}`, Object.assign({}, args, this.injectFuncs), true);
|
|
746
|
-
}
|
|
747
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ScopeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
748
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.2", type: ScopeDirective, isStandalone: true, selector: "[axisScope]", inputs: { axisScope: { classPropertyName: "axisScope", publicName: "axisScope", isSignal: true, isRequired: true, transformFunction: null }, scopeName: { classPropertyName: "scopeName", publicName: "scopeName", isSignal: true, isRequired: true, transformFunction: null }, isRoot: { classPropertyName: "isRoot", publicName: "isRoot", isSignal: true, isRequired: false, transformFunction: null }, dataSources: { classPropertyName: "dataSources", publicName: "dataSources", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
749
|
-
}
|
|
750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ScopeDirective, decorators: [{
|
|
751
|
-
type: Directive,
|
|
752
|
-
args: [{
|
|
753
|
-
selector: '[axisScope]'
|
|
754
|
-
}]
|
|
755
|
-
}], ctorParameters: () => [] });
|
|
756
|
-
|
|
757
|
-
class EventsHandlerService {
|
|
758
|
-
http;
|
|
759
|
-
msg;
|
|
760
|
-
modal;
|
|
761
|
-
router;
|
|
762
|
-
otherHandlers;
|
|
763
|
-
constructor(http, msg, modal, router, otherHandlers) {
|
|
764
|
-
this.http = http;
|
|
765
|
-
this.msg = msg;
|
|
766
|
-
this.modal = modal;
|
|
767
|
-
this.router = router;
|
|
768
|
-
this.otherHandlers = otherHandlers;
|
|
769
|
-
}
|
|
770
|
-
onEvents(e) {
|
|
771
|
-
switch (e.name) {
|
|
772
|
-
case "api":
|
|
773
|
-
return this.apiEventHandler(e);
|
|
774
|
-
case "msgTip":
|
|
775
|
-
return this.msgTipEventHandler(e);
|
|
776
|
-
case "arrayFilter":
|
|
777
|
-
return this.arrayFilterEventHandler(e);
|
|
778
|
-
case "route":
|
|
779
|
-
return this.routeEventHandler(e);
|
|
780
|
-
default:
|
|
781
|
-
if (this.otherHandlers) {
|
|
782
|
-
for (const h of this.otherHandlers) {
|
|
783
|
-
const r = h.onEvents(e);
|
|
784
|
-
if (r != undefined) {
|
|
785
|
-
return r;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
return undefined;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
apiEventHandler(e) {
|
|
793
|
-
const opt = e.data;
|
|
794
|
-
return this.http.request(new HttpRequest(opt.method?.toUpperCase() || "GET", opt.url, opt.body))
|
|
795
|
-
.pipe(map((h) => h.body), catchError(e => of(undefined)), mergeMap(res => {
|
|
796
|
-
if (e.ref) {
|
|
797
|
-
return e.ref.triggeEvents("apiResponse", { ...e.tempDataSource, apiResponse: res }, e.triggeEvents);
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
return of(true);
|
|
801
|
-
}
|
|
802
|
-
}));
|
|
803
|
-
}
|
|
804
|
-
msgTipEventHandler(e) {
|
|
805
|
-
switch (e.data?.tipWay) {
|
|
806
|
-
case "modal":
|
|
807
|
-
switch (e.data?.type) {
|
|
808
|
-
case "info":
|
|
809
|
-
this.modal.info({
|
|
810
|
-
nzTitle: "提醒",
|
|
811
|
-
nzContent: e.data.content
|
|
812
|
-
});
|
|
813
|
-
break;
|
|
814
|
-
case "success":
|
|
815
|
-
this.modal.success({
|
|
816
|
-
nzTitle: "成功",
|
|
817
|
-
nzContent: e.data.content
|
|
818
|
-
});
|
|
819
|
-
break;
|
|
820
|
-
case "warning":
|
|
821
|
-
this.modal.warning({
|
|
822
|
-
nzTitle: "警告",
|
|
823
|
-
nzContent: e.data.content
|
|
824
|
-
});
|
|
825
|
-
break;
|
|
826
|
-
case "error":
|
|
827
|
-
this.modal.error({
|
|
828
|
-
nzTitle: "失败",
|
|
829
|
-
nzContent: e.data.content
|
|
830
|
-
});
|
|
831
|
-
break;
|
|
832
|
-
}
|
|
833
|
-
break;
|
|
834
|
-
case "message":
|
|
835
|
-
switch (e.data?.type) {
|
|
836
|
-
case "info":
|
|
837
|
-
this.msg.info(e.data.content);
|
|
838
|
-
break;
|
|
839
|
-
case "success":
|
|
840
|
-
this.msg.success(e.data.content);
|
|
841
|
-
break;
|
|
842
|
-
case "warning":
|
|
843
|
-
this.msg.warning(e.data.content);
|
|
844
|
-
break;
|
|
845
|
-
case "error":
|
|
846
|
-
this.msg.error(e.data.content);
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
break;
|
|
850
|
-
}
|
|
851
|
-
return of(true);
|
|
852
|
-
}
|
|
853
|
-
arrayFilterEventHandler(e) {
|
|
854
|
-
const { inputArray, filterData, filterOptions } = e.data ?? {};
|
|
855
|
-
let outputArray;
|
|
856
|
-
if (!inputArray?.length || !filterOptions?.length || !filterData || !Object.keys(filterData).length) {
|
|
857
|
-
outputArray = inputArray;
|
|
858
|
-
}
|
|
859
|
-
else {
|
|
860
|
-
outputArray = inputArray.filter((r) => {
|
|
861
|
-
return filterOptions
|
|
862
|
-
.every(e => {
|
|
863
|
-
if (filterData[e.field] == undefined || (e.mode == "between" && filterData[e.field].length < 2)) {
|
|
864
|
-
return true;
|
|
865
|
-
}
|
|
866
|
-
const effectFields = e.effectFields || [e.field];
|
|
867
|
-
return effectFields.some(field => {
|
|
868
|
-
const rowData = r[field];
|
|
869
|
-
switch (e.mode) {
|
|
870
|
-
case "startsWith":
|
|
871
|
-
return rowData?.startsWith(filterData[e.field]);
|
|
872
|
-
case "endsWith":
|
|
873
|
-
return rowData?.endsWith(filterData[e.field]);
|
|
874
|
-
case "like":
|
|
875
|
-
return rowData != null && String(rowData).toUpperCase().includes(filterData[e.field].toUpperCase());
|
|
876
|
-
case "equalGreater":
|
|
877
|
-
return rowData != undefined && r[field] >= filterData[e.field];
|
|
878
|
-
case "equalLess":
|
|
879
|
-
return rowData != undefined && r[field] <= filterData[e.field];
|
|
880
|
-
case "between":
|
|
881
|
-
return rowData != undefined && r[field] >= filterData[e.field][0] && r[field] <= filterData[e.field][1];
|
|
882
|
-
case "containAll":
|
|
883
|
-
return rowData != undefined && (!filterData[e.field].length || filterData[e.field].every((r) => rowData.includes(r)));
|
|
884
|
-
case "containAny":
|
|
885
|
-
return rowData != undefined && (!filterData[e.field].length || filterData[e.field].some((r) => rowData.includes(r)));
|
|
886
|
-
default:
|
|
887
|
-
return rowData == filterData[e.field];
|
|
888
|
-
}
|
|
889
|
-
});
|
|
890
|
-
});
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
return e.ref?.triggeEvents("output", { ...e.tempDataSource, outputArray }, e.triggeEvents) ?? of(true);
|
|
894
|
-
;
|
|
895
|
-
}
|
|
896
|
-
routeEventHandler(e) {
|
|
897
|
-
let { type, newtab, path } = e.data;
|
|
898
|
-
switch (type) {
|
|
899
|
-
case "web":
|
|
900
|
-
if (newtab) {
|
|
901
|
-
let url;
|
|
902
|
-
if (typeof path == "string") {
|
|
903
|
-
url = path;
|
|
904
|
-
}
|
|
905
|
-
else if (Array.isArray(path)) {
|
|
906
|
-
url = path.join("/");
|
|
907
|
-
}
|
|
908
|
-
if (url) {
|
|
909
|
-
window.open(url, "_blank");
|
|
910
|
-
return of(true);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
else {
|
|
914
|
-
let url;
|
|
915
|
-
if (typeof path == "string") {
|
|
916
|
-
if (path.startsWith("http")) {
|
|
917
|
-
window.open(path, "_self");
|
|
918
|
-
return of(true);
|
|
919
|
-
}
|
|
920
|
-
url = [path];
|
|
921
|
-
}
|
|
922
|
-
else if (Array.isArray(path)) {
|
|
923
|
-
url = path;
|
|
924
|
-
}
|
|
925
|
-
if (url?.[0]) {
|
|
926
|
-
if (e.ref?.isDesign) {
|
|
927
|
-
this.msg.info("设计模式下禁止路由跳转");
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
const route = e.ref?.injector.get(ActivatedRoute);
|
|
931
|
-
return from(this.router.navigate(url, { relativeTo: route, queryParams: e.data?.params }));
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
break;
|
|
936
|
-
}
|
|
937
|
-
return of(false);
|
|
938
|
-
}
|
|
939
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EventsHandlerService, deps: [{ token: i1.HttpClient }, { token: i2.NzMessageService }, { token: i2$1.NzModalService }, { token: i4.Router }, { token: AXIS_EVENT_HANDLERS_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
940
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EventsHandlerService, providedIn: 'root' });
|
|
941
|
-
}
|
|
942
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EventsHandlerService, decorators: [{
|
|
943
|
-
type: Injectable,
|
|
944
|
-
args: [{
|
|
945
|
-
providedIn: 'root'
|
|
946
|
-
}]
|
|
947
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.NzMessageService }, { type: i2$1.NzModalService }, { type: i4.Router }, { type: undefined, decorators: [{
|
|
948
|
-
type: Optional
|
|
949
|
-
}, {
|
|
950
|
-
type: Inject,
|
|
951
|
-
args: [AXIS_EVENT_HANDLERS_TOKEN]
|
|
952
|
-
}] }] });
|
|
953
|
-
|
|
954
|
-
class Base {
|
|
955
|
-
onAfterViewInit;
|
|
956
|
-
injector = inject(Injector);
|
|
957
|
-
isDesign = false;
|
|
958
|
-
options;
|
|
959
|
-
eventsService = inject(EventsHandlerService);
|
|
960
|
-
scope = inject(ScopeDirective, { optional: true });
|
|
961
|
-
_sub = { "default": [] };
|
|
962
|
-
get style() {
|
|
963
|
-
return this.options.style();
|
|
964
|
-
}
|
|
965
|
-
ngAfterViewInit() {
|
|
966
|
-
this.onAfterViewInit?.();
|
|
967
|
-
}
|
|
968
|
-
async preloadImports(optionsConfig) {
|
|
969
|
-
const imports = new Set();
|
|
970
|
-
Object.entries(optionsConfig).forEach(([key, value]) => {
|
|
971
|
-
if (key.startsWith("$")) {
|
|
972
|
-
value.imports.forEach(i => imports.add(i));
|
|
973
|
-
}
|
|
974
|
-
});
|
|
975
|
-
await Promise.all(Array.from(imports.values()).map(i => loadScripts(i)));
|
|
976
|
-
}
|
|
977
|
-
bindWithConfig(optionsConfig, config) {
|
|
978
|
-
let options = config?.options ?? this.options;
|
|
979
|
-
let snapshot = config?.snapshot ?? false;
|
|
980
|
-
if (!snapshot) {
|
|
981
|
-
this.unsubscribe([options?.tag]);
|
|
982
|
-
}
|
|
983
|
-
if (this.scope && !snapshot) {
|
|
984
|
-
this.addAllSubscribe(this.scope.bindOptions(optionsConfig, options, config?.tempDataSource), options?.tag ?? "bindWithConfig");
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
if (this.scope && snapshot) {
|
|
988
|
-
optionsConfig = this.scope.snapshotOptions(optionsConfig, config?.tempDataSource);
|
|
989
|
-
}
|
|
990
|
-
for (const en of Object.entries(options)) {
|
|
991
|
-
const value = optionsConfig[en[0]];
|
|
992
|
-
if (value !== undefined) {
|
|
993
|
-
if (isSignal(en[1])) {
|
|
994
|
-
en[1].set(value);
|
|
995
|
-
}
|
|
996
|
-
else {
|
|
997
|
-
options[en[0]] = value;
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
unsubscribeAll() {
|
|
1004
|
-
Object.values(this._sub).forEach(srr => srr.forEach(s => s.unsubscribe()));
|
|
1005
|
-
this._sub = { "default": [] };
|
|
1006
|
-
}
|
|
1007
|
-
unsubscribe(tags) {
|
|
1008
|
-
Object.keys(this._sub)
|
|
1009
|
-
.filter(tag => tags.includes(tag))
|
|
1010
|
-
.forEach(tag => {
|
|
1011
|
-
this._sub[tag].forEach(s => s.unsubscribe());
|
|
1012
|
-
delete this._sub[tag];
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
addSubscribe(sub, tag = "default") {
|
|
1016
|
-
if (!this._sub[tag]) {
|
|
1017
|
-
this._sub[tag] = [];
|
|
1018
|
-
}
|
|
1019
|
-
this._sub[tag].push(sub);
|
|
1020
|
-
}
|
|
1021
|
-
addAllSubscribe(subs, tag = "default") {
|
|
1022
|
-
if (!this._sub[tag]) {
|
|
1023
|
-
this._sub[tag] = [];
|
|
1024
|
-
}
|
|
1025
|
-
this._sub[tag] = this._sub[tag].concat(subs);
|
|
1026
|
-
}
|
|
1027
|
-
hasEventHandler(trigger, triggeEvents) {
|
|
1028
|
-
const te = triggeEvents ?? this.options.triggeEvents();
|
|
1029
|
-
return !!te?.[trigger]?.length;
|
|
1030
|
-
}
|
|
1031
|
-
triggeEvents(trigger, tempDataSource, triggeEvents, scope) {
|
|
1032
|
-
scope ??= this.scope ?? undefined;
|
|
1033
|
-
const te = triggeEvents ?? this.options.triggeEvents();
|
|
1034
|
-
if (te && te[trigger]) {
|
|
1035
|
-
return merge(...te[trigger].filter(e => !scope?.snapshotField(e, "disabled", tempDataSource)).map(e => {
|
|
1036
|
-
if (scope) {
|
|
1037
|
-
e = scope.snapshotOptions(e, tempDataSource);
|
|
1038
|
-
}
|
|
1039
|
-
e.tempDataSource = tempDataSource;
|
|
1040
|
-
return this.triggeEvent(e, scope);
|
|
1041
|
-
}));
|
|
1042
|
-
}
|
|
1043
|
-
return of(true);
|
|
1044
|
-
}
|
|
1045
|
-
triggeEvent(e, scope) {
|
|
1046
|
-
scope ??= this.scope ?? undefined;
|
|
1047
|
-
console.log("triggeEvent", e);
|
|
1048
|
-
e.ref = this;
|
|
1049
|
-
let obs;
|
|
1050
|
-
switch (e.target) {
|
|
1051
|
-
case "component":
|
|
1052
|
-
if (e.id) {
|
|
1053
|
-
obs = (scope)?.findInstance(e.id)?.onEvents?.(e);
|
|
1054
|
-
}
|
|
1055
|
-
break;
|
|
1056
|
-
case "service":
|
|
1057
|
-
obs = this.eventsService.onEvents(e);
|
|
1058
|
-
break;
|
|
1059
|
-
case "scope":
|
|
1060
|
-
obs = scope?.onEvents(e);
|
|
1061
|
-
break;
|
|
1062
|
-
}
|
|
1063
|
-
return obs ?? of(true);
|
|
1064
|
-
}
|
|
1065
|
-
getScope() {
|
|
1066
|
-
return this.scope;
|
|
1067
|
-
}
|
|
1068
|
-
ngOnDestroy() {
|
|
1069
|
-
this.unsubscribeAll();
|
|
1070
|
-
}
|
|
1071
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: Base, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1072
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.2", type: Base, isStandalone: true, host: { properties: { "style": "this.style" } }, ngImport: i0 });
|
|
1073
|
-
}
|
|
1074
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: Base, decorators: [{
|
|
1075
|
-
type: Directive
|
|
1076
|
-
}], propDecorators: { style: [{
|
|
1077
|
-
type: HostBinding,
|
|
1078
|
-
args: ['style']
|
|
1079
|
-
}] } });
|
|
1080
|
-
|
|
1081
|
-
class ValueAccess extends Base {
|
|
1082
|
-
constructor() {
|
|
1083
|
-
super();
|
|
1084
|
-
effect(() => {
|
|
1085
|
-
if (this.options.initValue() !== undefined) {
|
|
1086
|
-
this.setInitValue(this.options.initValue());
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1091
|
-
registe = inject(AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN, { optional: true });
|
|
1092
|
-
setInitValue(value) {
|
|
1093
|
-
this.registValueAccess({
|
|
1094
|
-
initValue: value,
|
|
1095
|
-
});
|
|
1096
|
-
this.value.set(value);
|
|
1097
|
-
if (value !== undefined && this.options.emitInitEvent()) {
|
|
1098
|
-
this.triggeEvents("valueChange", { value: value });
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
onChange;
|
|
1102
|
-
onTouched;
|
|
1103
|
-
writeValue(value) {
|
|
1104
|
-
this.value.set(value);
|
|
1105
|
-
if (value !== undefined) {
|
|
1106
|
-
this.triggeEvents("valueChange", { value: value });
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
registerOnChange(fn) {
|
|
1110
|
-
this.onChange = (value) => {
|
|
1111
|
-
this.triggeEvents("valueChange", { value: value });
|
|
1112
|
-
fn?.(value);
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
registerOnTouched(fn) {
|
|
1116
|
-
this.onTouched = fn;
|
|
1117
|
-
}
|
|
1118
|
-
onEvents(e) {
|
|
1119
|
-
const obs = super.onEvents?.(e);
|
|
1120
|
-
if (obs) {
|
|
1121
|
-
return obs;
|
|
1122
|
-
}
|
|
1123
|
-
switch (e.name) {
|
|
1124
|
-
case "setValue":
|
|
1125
|
-
this.writeValue(e.data?.data);
|
|
1126
|
-
return of(true);
|
|
1127
|
-
}
|
|
1128
|
-
return undefined;
|
|
1129
|
-
}
|
|
1130
|
-
registValueAccess(opt) {
|
|
1131
|
-
this.registe?.(opt);
|
|
1132
|
-
}
|
|
1133
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ValueAccess, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1134
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.2", type: ValueAccess, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0 });
|
|
1135
|
-
}
|
|
1136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ValueAccess, decorators: [{
|
|
1137
|
-
type: Directive
|
|
1138
|
-
}], ctorParameters: () => [] });
|
|
1139
|
-
|
|
1140
|
-
class BaseMenu {
|
|
1141
|
-
contextMenuService = inject(NzContextMenuService);
|
|
1142
|
-
optionsNodes = inject(AXIS_DESIGN_OPTIONS_NODE_FOR_MENU);
|
|
1143
|
-
menu;
|
|
1144
|
-
onChange;
|
|
1145
|
-
contextMenu(e) {
|
|
1146
|
-
e.preventDefault();
|
|
1147
|
-
e.stopPropagation();
|
|
1148
|
-
this.contextMenuService.create(e, this.menu);
|
|
1149
|
-
}
|
|
1150
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BaseMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1151
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.2", type: BaseMenu, isStandalone: true, viewQueries: [{ propertyName: "menu", first: true, predicate: ["menu"], descendants: true, static: true }], ngImport: i0 });
|
|
1152
|
-
}
|
|
1153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BaseMenu, decorators: [{
|
|
1154
|
-
type: Directive
|
|
1155
|
-
}], propDecorators: { menu: [{
|
|
1156
|
-
type: ViewChild,
|
|
1157
|
-
args: ["menu", { static: true }]
|
|
1158
|
-
}] } });
|
|
1159
|
-
|
|
1160
|
-
function updateAndValidAll(form, options = { markAsDirty: true }) {
|
|
1161
|
-
let isValid = true;
|
|
1162
|
-
if (form instanceof FormGroup) {
|
|
1163
|
-
Object.values(form.controls).forEach(control => {
|
|
1164
|
-
if (!updateAndValidAll(control, options)) {
|
|
1165
|
-
isValid = false;
|
|
1166
|
-
}
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
else if (form instanceof FormArray) {
|
|
1170
|
-
form.controls.forEach(control => {
|
|
1171
|
-
if (!updateAndValidAll(control, options)) {
|
|
1172
|
-
isValid = false;
|
|
1173
|
-
}
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
else {
|
|
1177
|
-
if (options.markAsDirty ?? true) {
|
|
1178
|
-
form.markAsDirty();
|
|
1179
|
-
}
|
|
1180
|
-
form.updateValueAndValidity({ onlySelf: true });
|
|
1181
|
-
isValid = form.valid;
|
|
1182
|
-
}
|
|
1183
|
-
return isValid;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
class FunFieldBase {
|
|
1187
|
-
orivalue;
|
|
1188
|
-
fb = inject(FormBuilder);
|
|
1189
|
-
funFields = {};
|
|
1190
|
-
reset(value) {
|
|
1191
|
-
this.orivalue = value;
|
|
1192
|
-
this.fg.patchValue(this.buildFunField(value), { emitEvent: false });
|
|
1193
|
-
}
|
|
1194
|
-
getValue() {
|
|
1195
|
-
return this.recoverFunField(this.fg.value);
|
|
1196
|
-
}
|
|
1197
|
-
valid() {
|
|
1198
|
-
return updateAndValidAll(this.fg);
|
|
1199
|
-
}
|
|
1200
|
-
buildFunField(obj, funFields) {
|
|
1201
|
-
funFields ??= this.funFields;
|
|
1202
|
-
const cloneObj = obj ? copy(obj) : {};
|
|
1203
|
-
if (funFields) {
|
|
1204
|
-
Object.keys(funFields).forEach(f => {
|
|
1205
|
-
let value;
|
|
1206
|
-
if (funFields[f].child) {
|
|
1207
|
-
if (Array.isArray(cloneObj[f])) {
|
|
1208
|
-
value = cloneObj[f].map(item => this.buildFunField(item, funFields[f].child));
|
|
1209
|
-
}
|
|
1210
|
-
else {
|
|
1211
|
-
value = this.buildFunField(cloneObj[f], funFields[f].child);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
else {
|
|
1215
|
-
value = {
|
|
1216
|
-
funMode: cloneObj.hasOwnProperty(`$${f}`),
|
|
1217
|
-
originValue: undefined,
|
|
1218
|
-
fnValue: {
|
|
1219
|
-
fn: "return undefined;"
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
if (value.funMode) {
|
|
1223
|
-
value.fnValue = cloneObj[`$${f}`];
|
|
1224
|
-
if (typeof (cloneObj[`$${f}`]) == "string") {
|
|
1225
|
-
value.fnValue = {
|
|
1226
|
-
fn: cloneObj[`$${f}`]
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
delete cloneObj[`$${f}`];
|
|
1230
|
-
}
|
|
1231
|
-
else {
|
|
1232
|
-
if (cloneObj[f] !== undefined) {
|
|
1233
|
-
value.originValue = cloneObj[f];
|
|
1234
|
-
}
|
|
1235
|
-
else {
|
|
1236
|
-
value.originValue = funFields[f].defaultValue;
|
|
1237
|
-
}
|
|
1238
|
-
value.fnValue = {
|
|
1239
|
-
fn: `return ${JSON.stringify(value.originValue)}`
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
cloneObj[f] = value;
|
|
1244
|
-
});
|
|
1245
|
-
}
|
|
1246
|
-
return cloneObj;
|
|
1247
|
-
}
|
|
1248
|
-
recoverFunField(obj, funFields, oriObj) {
|
|
1249
|
-
funFields ??= this.funFields;
|
|
1250
|
-
oriObj ??= this.orivalue ?? {};
|
|
1251
|
-
const cloneObj = obj ? copy(obj) : {};
|
|
1252
|
-
const cloneOriObj = copy(oriObj);
|
|
1253
|
-
if (obj && funFields) {
|
|
1254
|
-
Object.keys(funFields).forEach(k => {
|
|
1255
|
-
const f = cloneObj[k];
|
|
1256
|
-
if (f) {
|
|
1257
|
-
if (funFields[k].child) {
|
|
1258
|
-
if (Array.isArray(cloneObj[k])) {
|
|
1259
|
-
cloneObj[k] = cloneObj[k].map((item, i) => this.recoverFunField(item, funFields[k].child, cloneOriObj[k][i]));
|
|
1260
|
-
}
|
|
1261
|
-
else {
|
|
1262
|
-
cloneObj[k] = this.recoverFunField(cloneObj[k], funFields[k].child, cloneOriObj[k] ?? {});
|
|
1263
|
-
}
|
|
1264
|
-
delete cloneObj[`$${k}`];
|
|
1265
|
-
}
|
|
1266
|
-
else {
|
|
1267
|
-
if (f.funMode) {
|
|
1268
|
-
cloneObj[`$${k}`] = f.fnValue;
|
|
1269
|
-
delete cloneObj[k];
|
|
1270
|
-
}
|
|
1271
|
-
else {
|
|
1272
|
-
cloneObj[k] = f.originValue;
|
|
1273
|
-
delete cloneObj[`$${k}`];
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
delete cloneOriObj[k];
|
|
1277
|
-
delete cloneOriObj[`$${k}`];
|
|
1278
|
-
}
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
return Object.assign({}, cloneOriObj, cloneObj);
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
class FunFieldValueBase extends FunFieldBase {
|
|
1286
|
-
onChange;
|
|
1287
|
-
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
1288
|
-
formValue = model(...(ngDevMode ? [undefined, { debugName: "formValue" }] : []));
|
|
1289
|
-
sub;
|
|
1290
|
-
sendInitValue = false;
|
|
1291
|
-
writeValue(value) {
|
|
1292
|
-
this.value.set(value);
|
|
1293
|
-
this.reset(value);
|
|
1294
|
-
}
|
|
1295
|
-
registerOnChange(fn) {
|
|
1296
|
-
this.onChange = fn;
|
|
1297
|
-
}
|
|
1298
|
-
registerOnTouched(fn) {
|
|
1299
|
-
}
|
|
1300
|
-
reset(value) {
|
|
1301
|
-
super.reset(value);
|
|
1302
|
-
this.formValue.set(this.fg.value);
|
|
1303
|
-
}
|
|
1304
|
-
ngOnInit() {
|
|
1305
|
-
this.formValue.set(this.fg.value);
|
|
1306
|
-
if (this.sendInitValue) {
|
|
1307
|
-
this.value.set(this.recoverFunField(this.fg.value));
|
|
1308
|
-
this.onChange?.(this.value());
|
|
1309
|
-
}
|
|
1310
|
-
this.sub = this.fg.valueChanges.subscribe(v => {
|
|
1311
|
-
this.formValue.set(v);
|
|
1312
|
-
if (updateAndValidAll(this.fg)) {
|
|
1313
|
-
this.value.set(this.recoverFunField(v));
|
|
1314
|
-
this.onChange?.(this.value());
|
|
1315
|
-
}
|
|
1316
|
-
else {
|
|
1317
|
-
console.log("invalid", v);
|
|
1318
|
-
}
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
ngOnDestroy() {
|
|
1322
|
-
this.sub.unsubscribe();
|
|
1323
|
-
}
|
|
1324
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FunFieldValueBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1325
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.2", type: FunFieldValueBase, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, formValue: { classPropertyName: "formValue", publicName: "formValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", formValue: "formValueChange" }, usesInheritance: true, ngImport: i0 });
|
|
1326
|
-
}
|
|
1327
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FunFieldValueBase, decorators: [{
|
|
1328
|
-
type: Directive
|
|
1329
|
-
}] });
|
|
1330
|
-
|
|
1331
|
-
const DynamicComponentsMap = new Map();
|
|
1332
|
-
class DynamicDirective {
|
|
1333
|
-
axisDynamic = input.required(...(ngDevMode ? [{ debugName: "axisDynamic" }] : []));
|
|
1334
|
-
standalone = input(false, ...(ngDevMode ? [{ debugName: "standalone" }] : []));
|
|
1335
|
-
isDesign = input(false, ...(ngDevMode ? [{ debugName: "isDesign" }] : []));
|
|
1336
|
-
component;
|
|
1337
|
-
sub;
|
|
1338
|
-
id;
|
|
1339
|
-
injector = inject(Injector);
|
|
1340
|
-
_designBuilder = inject(DesignBuilder, { optional: true });
|
|
1341
|
-
loader = inject(AXIS_COMPONENTS_LOADER_TOKEN);
|
|
1342
|
-
currentUserPermissions = inject(AXIS_CURRENT_USER_PERMISSIONS_TOKEN, { optional: true });
|
|
1343
|
-
container = inject(ViewContainerRef);
|
|
1344
|
-
_scope = inject(ScopeDirective, { optional: true });
|
|
1345
|
-
ref;
|
|
1346
|
-
get scope() {
|
|
1347
|
-
return this.standalone() ? null : this._scope;
|
|
1348
|
-
}
|
|
1349
|
-
get designBuilder() {
|
|
1350
|
-
return !this.standalone() || this.isDesign() ? this._designBuilder : null;
|
|
1351
|
-
}
|
|
1352
|
-
get valueInstance() {
|
|
1353
|
-
if (this.ref?.instance && this.ref.instance instanceof ValueAccess) {
|
|
1354
|
-
return this.ref.instance;
|
|
1355
|
-
}
|
|
1356
|
-
return undefined;
|
|
1357
|
-
}
|
|
1358
|
-
onChange;
|
|
1359
|
-
onTouched;
|
|
1360
|
-
triggeEvent;
|
|
1361
|
-
onEvents;
|
|
1362
|
-
value;
|
|
1363
|
-
constructor() {
|
|
1364
|
-
effect(() => {
|
|
1365
|
-
if (!this.axisDynamic()?.component) {
|
|
1366
|
-
this.destoryInstance();
|
|
1367
|
-
return;
|
|
1368
|
-
}
|
|
1369
|
-
this.sub?.unsubscribe();
|
|
1370
|
-
if (!this.hasPermission() && !this.designBuilder) {
|
|
1371
|
-
return;
|
|
1372
|
-
}
|
|
1373
|
-
let inuse = this.axisDynamic().inuse;
|
|
1374
|
-
if (this.scope) {
|
|
1375
|
-
const io = this.scope.dynamicField(this.axisDynamic(), "inuse");
|
|
1376
|
-
if (io.init !== undefined) {
|
|
1377
|
-
inuse = io.init;
|
|
1378
|
-
}
|
|
1379
|
-
if (io.obs) {
|
|
1380
|
-
this.sub = io.obs.subscribe(inuse => {
|
|
1381
|
-
if (inuse) {
|
|
1382
|
-
if (this.id != this.axisDynamic().id) {
|
|
1383
|
-
if (this.id) {
|
|
1384
|
-
this.scope.unRegistInstance(this.id);
|
|
1385
|
-
}
|
|
1386
|
-
this.id = this.axisDynamic().id;
|
|
1387
|
-
}
|
|
1388
|
-
this.render();
|
|
1389
|
-
}
|
|
1390
|
-
else {
|
|
1391
|
-
this.destoryInstance();
|
|
1392
|
-
}
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
if (inuse) {
|
|
1397
|
-
if (this.id != this.axisDynamic().id) {
|
|
1398
|
-
this.id = this.axisDynamic().id;
|
|
1399
|
-
}
|
|
1400
|
-
this.render();
|
|
1401
|
-
}
|
|
1402
|
-
else {
|
|
1403
|
-
this.destoryInstance();
|
|
1404
|
-
}
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
hasPermission() {
|
|
1408
|
-
const { requiredPermissions } = this.axisDynamic();
|
|
1409
|
-
if (!requiredPermissions?.length) {
|
|
1410
|
-
return true;
|
|
1411
|
-
}
|
|
1412
|
-
return requiredPermissions.every(permission => this.currentUserPermissions?.includes(permission));
|
|
1413
|
-
}
|
|
1414
|
-
async render() {
|
|
1415
|
-
if (this.axisDynamic()?.component && (!this.component || this.component != this.axisDynamic().component)) {
|
|
1416
|
-
this.component = this.axisDynamic().component;
|
|
1417
|
-
let componentType;
|
|
1418
|
-
if (DynamicComponentsMap.has(this.component)) {
|
|
1419
|
-
componentType = DynamicComponentsMap.get(this.component);
|
|
1420
|
-
}
|
|
1421
|
-
else {
|
|
1422
|
-
try {
|
|
1423
|
-
componentType = await this.loader.loadComponent(this.component);
|
|
1424
|
-
DynamicComponentsMap.set(this.component, componentType);
|
|
1425
|
-
}
|
|
1426
|
-
catch (error) {
|
|
1427
|
-
console.error(error);
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
await this.scope?.preloadImports(this.axisDynamic());
|
|
1431
|
-
this.container.clear();
|
|
1432
|
-
this.ref = this.container.createComponent(componentType, { injector: this.buildInjector() });
|
|
1433
|
-
this.onEvents = this.ref.instance.onEvents?.bind(this.ref.instance);
|
|
1434
|
-
this.triggeEvent = this.ref.instance.triggeEvent?.bind(this.ref.instance);
|
|
1435
|
-
this.scope?.registInstance(this.axisDynamic().id, this.ref.instance);
|
|
1436
|
-
this.ref.instance?.bindWithConfig(this.axisDynamic());
|
|
1437
|
-
this.valueInstance?.registerOnChange(this.onChange);
|
|
1438
|
-
this.valueInstance?.registerOnTouched(this.onTouched);
|
|
1439
|
-
if (this.value !== undefined) {
|
|
1440
|
-
this.valueInstance?.writeValue(this.value);
|
|
1441
|
-
}
|
|
1442
|
-
if (this.designBuilder) {
|
|
1443
|
-
this.ref.instance.isDesign = true;
|
|
1444
|
-
this.ref.instance.onAfterViewInit = () => {
|
|
1445
|
-
this.designBuilder.buildElement(this.ref, this.axisDynamic());
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
else {
|
|
1450
|
-
this.ref?.instance?.bindWithConfig(this.axisDynamic());
|
|
1451
|
-
this.designBuilder?.buildElement(this.ref, this.axisDynamic());
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
buildInjector() {
|
|
1455
|
-
if (this.standalone()) {
|
|
1456
|
-
return Injector.create({
|
|
1457
|
-
providers: [
|
|
1458
|
-
{
|
|
1459
|
-
provide: ScopeDirective,
|
|
1460
|
-
useValue: null
|
|
1461
|
-
},
|
|
1462
|
-
{
|
|
1463
|
-
provide: DynamicDirective,
|
|
1464
|
-
useValue: null
|
|
1465
|
-
},
|
|
1466
|
-
{
|
|
1467
|
-
provide: DesignBuilder,
|
|
1468
|
-
useValue: this.isDesign() ? this.designBuilder : null
|
|
1469
|
-
}, {
|
|
1470
|
-
provide: AXIS_FORM_REGISTE_CONTROL_TOKEN,
|
|
1471
|
-
useValue: null
|
|
1472
|
-
}, {
|
|
1473
|
-
provide: AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN,
|
|
1474
|
-
useValue: null
|
|
1475
|
-
}
|
|
1476
|
-
],
|
|
1477
|
-
parent: this.injector
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
return this.injector;
|
|
1481
|
-
}
|
|
1482
|
-
forceRender() {
|
|
1483
|
-
this.component = undefined;
|
|
1484
|
-
this.id = undefined;
|
|
1485
|
-
this.render();
|
|
1486
|
-
}
|
|
1487
|
-
writeValue(value) {
|
|
1488
|
-
this.valueInstance?.writeValue(value);
|
|
1489
|
-
this.value = value;
|
|
1490
|
-
}
|
|
1491
|
-
registerOnChange(fn) {
|
|
1492
|
-
this.onChange = fn;
|
|
1493
|
-
this.valueInstance?.registerOnChange(fn);
|
|
1494
|
-
}
|
|
1495
|
-
registerOnTouched(fn) {
|
|
1496
|
-
this.onTouched = fn;
|
|
1497
|
-
this.valueInstance?.registerOnTouched(fn);
|
|
1498
|
-
}
|
|
1499
|
-
destoryInstance() {
|
|
1500
|
-
if (this.id) {
|
|
1501
|
-
this.scope?.unRegistInstance(this.id);
|
|
1502
|
-
this.id = undefined;
|
|
1503
|
-
}
|
|
1504
|
-
this.component = undefined;
|
|
1505
|
-
this.container.clear();
|
|
1506
|
-
}
|
|
1507
|
-
ngOnDestroy() {
|
|
1508
|
-
this.sub?.unsubscribe();
|
|
1509
|
-
this.destoryInstance();
|
|
1510
|
-
}
|
|
1511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DynamicDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1512
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.2", type: DynamicDirective, isStandalone: true, selector: "[axisDynamic]", inputs: { axisDynamic: { classPropertyName: "axisDynamic", publicName: "axisDynamic", isSignal: true, isRequired: true, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, isDesign: { classPropertyName: "isDesign", publicName: "isDesign", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1513
|
-
{
|
|
1514
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1515
|
-
useExisting: forwardRef(() => DynamicDirective),
|
|
1516
|
-
multi: true
|
|
1517
|
-
},
|
|
1518
|
-
], exportAs: ["axisDynamic"], ngImport: i0 });
|
|
1519
|
-
}
|
|
1520
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DynamicDirective, decorators: [{
|
|
1521
|
-
type: Directive,
|
|
1522
|
-
args: [{
|
|
1523
|
-
selector: '[axisDynamic]',
|
|
1524
|
-
exportAs: 'axisDynamic',
|
|
1525
|
-
providers: [
|
|
1526
|
-
{
|
|
1527
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1528
|
-
useExisting: forwardRef(() => DynamicDirective),
|
|
1529
|
-
multi: true
|
|
1530
|
-
},
|
|
1531
|
-
]
|
|
1532
|
-
}]
|
|
1533
|
-
}], ctorParameters: () => [] });
|
|
1534
|
-
|
|
1535
|
-
class HowLongPipe {
|
|
1536
|
-
cdr;
|
|
1537
|
-
constructor(cdr) {
|
|
1538
|
-
this.cdr = cdr;
|
|
1539
|
-
}
|
|
1540
|
-
timer;
|
|
1541
|
-
lastValue = "";
|
|
1542
|
-
date;
|
|
1543
|
-
ngOnDestroy() {
|
|
1544
|
-
if (this.timer != undefined) {
|
|
1545
|
-
clearTimeout(this.timer);
|
|
1546
|
-
this.timer = undefined;
|
|
1547
|
-
this.lastValue = "";
|
|
1548
|
-
this.date = undefined;
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
transform(date) {
|
|
1552
|
-
if (!this.date) {
|
|
1553
|
-
if (date) {
|
|
1554
|
-
this.date = date;
|
|
1555
|
-
let offset = (new Date().getTime() - date.getTime()) / 1000;
|
|
1556
|
-
let sufix = offset > 0 ? "前" : "后";
|
|
1557
|
-
let time = "";
|
|
1558
|
-
offset = Math.floor(Math.abs(offset));
|
|
1559
|
-
let refreshTimer = 0;
|
|
1560
|
-
if (offset < 10) {
|
|
1561
|
-
time = "几秒钟";
|
|
1562
|
-
refreshTimer = 1;
|
|
1563
|
-
}
|
|
1564
|
-
else if (offset < 60) {
|
|
1565
|
-
time = `${offset}秒钟`;
|
|
1566
|
-
refreshTimer = 1;
|
|
1567
|
-
}
|
|
1568
|
-
else if (offset < 3600) {
|
|
1569
|
-
refreshTimer = 60 - (offset % 60);
|
|
1570
|
-
time = `${Math.floor(offset / 60)}分钟`;
|
|
1571
|
-
}
|
|
1572
|
-
else if (offset < 86400) {
|
|
1573
|
-
refreshTimer = 3600 - (offset % 3600);
|
|
1574
|
-
time = `${Math.floor(offset / 3600)}小时`;
|
|
1575
|
-
}
|
|
1576
|
-
else {
|
|
1577
|
-
refreshTimer = 86400 - (offset % 86400);
|
|
1578
|
-
time = `${Math.floor(offset / 86400)}天`;
|
|
1579
|
-
}
|
|
1580
|
-
this.lastValue = `${time}${sufix}`;
|
|
1581
|
-
this.timer = setTimeout(() => {
|
|
1582
|
-
this.ngOnDestroy();
|
|
1583
|
-
this.cdr.markForCheck();
|
|
1584
|
-
}, refreshTimer * 1000);
|
|
1585
|
-
}
|
|
1586
|
-
else {
|
|
1587
|
-
this.lastValue = "";
|
|
1588
|
-
}
|
|
1589
|
-
return this.lastValue;
|
|
1590
|
-
}
|
|
1591
|
-
if (date !== this.date) {
|
|
1592
|
-
this.ngOnDestroy();
|
|
1593
|
-
return this.transform(date);
|
|
1594
|
-
}
|
|
1595
|
-
return this.lastValue;
|
|
1596
|
-
}
|
|
1597
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: HowLongPipe, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1598
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: HowLongPipe, isStandalone: true, name: "axisHowLong", pure: false });
|
|
1599
|
-
}
|
|
1600
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: HowLongPipe, decorators: [{
|
|
1601
|
-
type: Pipe,
|
|
1602
|
-
args: [{
|
|
1603
|
-
name: 'axisHowLong', pure: false
|
|
1604
|
-
}]
|
|
1605
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
1606
|
-
|
|
1607
|
-
class BaseOptions {
|
|
1608
|
-
component = "";
|
|
1609
|
-
id = "";
|
|
1610
|
-
inuse = signal(true, ...(ngDevMode ? [{ debugName: "inuse" }] : []));
|
|
1611
|
-
requiredPermissions = [];
|
|
1612
|
-
triggeEvents = signal(undefined, ...(ngDevMode ? [{ debugName: "triggeEvents" }] : []));
|
|
1613
|
-
style = signal(undefined, ...(ngDevMode ? [{ debugName: "style" }] : []));
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
class ValueAccessOptions extends BaseOptions {
|
|
1617
|
-
initValue = signal(undefined, ...(ngDevMode ? [{ debugName: "initValue" }] : []));
|
|
1618
|
-
emitInitEvent = signal(true, ...(ngDevMode ? [{ debugName: "emitInitEvent" }] : []));
|
|
1619
|
-
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1620
|
-
readonly = signal(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
class OptionsNode {
|
|
1624
|
-
config;
|
|
1625
|
-
constructor(config) {
|
|
1626
|
-
this.config = config;
|
|
1627
|
-
if (config.parentObj != undefined) {
|
|
1628
|
-
config.rootOptions = undefined;
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
get id() {
|
|
1632
|
-
return this.config.id ?? this.options.id;
|
|
1633
|
-
}
|
|
1634
|
-
get parentId() {
|
|
1635
|
-
return this.config.parentId;
|
|
1636
|
-
}
|
|
1637
|
-
get scopeId() {
|
|
1638
|
-
return this.config.scopeId;
|
|
1639
|
-
}
|
|
1640
|
-
get name() {
|
|
1641
|
-
return this.config.name;
|
|
1642
|
-
}
|
|
1643
|
-
get dragType() {
|
|
1644
|
-
return this.config.dragType;
|
|
1645
|
-
}
|
|
1646
|
-
get dropType() {
|
|
1647
|
-
return this.config.dropType;
|
|
1648
|
-
}
|
|
1649
|
-
get canSetting() {
|
|
1650
|
-
return this.config.canSetting ?? false;
|
|
1651
|
-
}
|
|
1652
|
-
get canDrag() {
|
|
1653
|
-
return this.config.canDrag ?? false;
|
|
1654
|
-
}
|
|
1655
|
-
get childDirection() {
|
|
1656
|
-
return this.config.childDirection ?? "horizontal";
|
|
1657
|
-
}
|
|
1658
|
-
get canDrop() {
|
|
1659
|
-
return this.config.canDrop ?? false;
|
|
1660
|
-
}
|
|
1661
|
-
get dropObj() {
|
|
1662
|
-
return this.config.dropObj;
|
|
1663
|
-
}
|
|
1664
|
-
get parentObj() {
|
|
1665
|
-
return this.config.parentObj;
|
|
1666
|
-
}
|
|
1667
|
-
get indexOfParentObj() {
|
|
1668
|
-
return this.config.indexOfParentObj;
|
|
1669
|
-
}
|
|
1670
|
-
get options() {
|
|
1671
|
-
if (this.parentObj != undefined && this.indexOfParentObj != undefined) {
|
|
1672
|
-
return this.parentObj[this.indexOfParentObj];
|
|
1673
|
-
}
|
|
1674
|
-
return this.config.rootOptions;
|
|
1675
|
-
}
|
|
1676
|
-
get defaultDropIndex() {
|
|
1677
|
-
return this.config.defaultDropIndex;
|
|
1678
|
-
}
|
|
1679
|
-
get isRoot() {
|
|
1680
|
-
return this.config.rootOptions != undefined;
|
|
1681
|
-
}
|
|
1682
|
-
get icon() {
|
|
1683
|
-
return this.config.icon;
|
|
1684
|
-
}
|
|
1685
|
-
get children() {
|
|
1686
|
-
return this.config.children;
|
|
1687
|
-
}
|
|
1688
|
-
get settingType() {
|
|
1689
|
-
return this.config.settingType;
|
|
1690
|
-
}
|
|
1691
|
-
get contextMenu() {
|
|
1692
|
-
return this.config.contextMenu;
|
|
1693
|
-
}
|
|
1694
|
-
toElementNode(elements) {
|
|
1695
|
-
return new ElementNode(this.id, elements);
|
|
1696
|
-
}
|
|
1697
|
-
updateOptions(options) {
|
|
1698
|
-
if (this.isRoot) {
|
|
1699
|
-
this.config.rootOptions = options;
|
|
1700
|
-
}
|
|
1701
|
-
else {
|
|
1702
|
-
this.parentObj[this.indexOfParentObj] = options;
|
|
1703
|
-
}
|
|
1704
|
-
if (this.config.updateId) {
|
|
1705
|
-
this.config.id = this.config.updateId(options);
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
copyWith(config) {
|
|
1709
|
-
return new OptionsNode(Object.assign({}, this.config, config));
|
|
1710
|
-
}
|
|
1711
|
-
refresh() {
|
|
1712
|
-
console.log("refresh", this.id, this.indexOfParentObj, this.parentObj.indexOf(this.options));
|
|
1713
|
-
}
|
|
1714
|
-
}
|
|
1715
|
-
class ElementNode {
|
|
1716
|
-
id;
|
|
1717
|
-
constructor(id, elements) {
|
|
1718
|
-
this.id = id;
|
|
1719
|
-
this.element = elements.element;
|
|
1720
|
-
this.dropElement = elements.dropElement;
|
|
1721
|
-
}
|
|
1722
|
-
element;
|
|
1723
|
-
dropElement;
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
class FilteredTreeResult {
|
|
1727
|
-
treeData;
|
|
1728
|
-
needsToExpanded;
|
|
1729
|
-
constructor(treeData, needsToExpanded = []) {
|
|
1730
|
-
this.treeData = treeData;
|
|
1731
|
-
this.needsToExpanded = needsToExpanded;
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
class DataOptions extends BaseOptions {
|
|
1736
|
-
data = signal(undefined, ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
class CommonMenu {
|
|
1740
|
-
baseMenu = input.required(...(ngDevMode ? [{ debugName: "baseMenu" }] : []));
|
|
1741
|
-
chooseComponentFunc = inject(AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN);
|
|
1742
|
-
get canAddParent() {
|
|
1743
|
-
const { optionsNodes } = this.baseMenu();
|
|
1744
|
-
return !optionsNodes.current.isRoot && (!!optionsNodes.parent?.canDrop && optionsNodes.parent?.dropType == "component");
|
|
1745
|
-
}
|
|
1746
|
-
get canAddChild() {
|
|
1747
|
-
const { optionsNodes } = this.baseMenu();
|
|
1748
|
-
return optionsNodes.current.dropType == "component" && (Array.isArray(optionsNodes.current.dropObj) || !optionsNodes.current.dropObj[optionsNodes.current.defaultDropIndex]);
|
|
1749
|
-
}
|
|
1750
|
-
get canRemove() {
|
|
1751
|
-
return this.baseMenu().optionsNodes.current.canSetting;
|
|
1752
|
-
}
|
|
1753
|
-
addParent() {
|
|
1754
|
-
this.chooseComponentFunc("wrap").subscribe(res => {
|
|
1755
|
-
const { options, config } = res;
|
|
1756
|
-
if (options && config) {
|
|
1757
|
-
const { optionsNodes } = this.baseMenu();
|
|
1758
|
-
const node = config.buildOptionsNodes?.({ currentObject: options });
|
|
1759
|
-
if (node) {
|
|
1760
|
-
const { treeNode } = node;
|
|
1761
|
-
treeNode.dropObj[treeNode.defaultDropIndex] = optionsNodes.current.options;
|
|
1762
|
-
optionsNodes.parent.dropObj[optionsNodes.current.indexOfParentObj] = treeNode.options;
|
|
1763
|
-
this.baseMenu().onChange();
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
});
|
|
1767
|
-
}
|
|
1768
|
-
addChild() {
|
|
1769
|
-
this.chooseComponentFunc().subscribe(res => {
|
|
1770
|
-
if (res.options) {
|
|
1771
|
-
const { optionsNodes } = this.baseMenu();
|
|
1772
|
-
optionsNodes.current.dropObj[optionsNodes.current.defaultDropIndex] = res.options;
|
|
1773
|
-
this.baseMenu().onChange();
|
|
1774
|
-
}
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1777
|
-
remove() {
|
|
1778
|
-
if (this.baseMenu().optionsNodes.current.isRoot) {
|
|
1779
|
-
this.baseMenu().onChange(null);
|
|
1780
|
-
}
|
|
1781
|
-
else {
|
|
1782
|
-
if (Array.isArray(this.baseMenu().optionsNodes.current.parentObj)) {
|
|
1783
|
-
this.baseMenu().optionsNodes.current.parentObj.splice(this.baseMenu().optionsNodes.current.indexOfParentObj, 1);
|
|
1784
|
-
}
|
|
1785
|
-
else {
|
|
1786
|
-
this.baseMenu().optionsNodes.current.parentObj[this.baseMenu().optionsNodes.current.indexOfParentObj] = null;
|
|
1787
|
-
}
|
|
1788
|
-
this.baseMenu().onChange();
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: CommonMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1792
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: CommonMenu, isStandalone: true, selector: "axis-common-menu", inputs: { baseMenu: { classPropertyName: "baseMenu", publicName: "baseMenu", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (canAddParent) {\n<li nz-menu-item (click)=\"addParent()\">\n <i nz-icon nzType=\"pic-center\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u6DFB\u52A0\u7236\u7EC4\u4EF6</span>\n</li>\n}\n@if (canAddChild) {\n<li nz-menu-item (click)=\"addChild()\">\n <i nz-icon nzType=\"plus\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u6DFB\u52A0\u5B50\u7EC4\u4EF6</span>\n</li>\n}\n@if (canRemove) {\n<li nz-menu-item style=\"color: #f81d22\" (click)=\"remove()\">\n <i nz-icon nzType=\"delete\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u5220\u9664</span>\n</li>\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: NzDividerModule }, { kind: "component", type: i1$1.NzDividerComponent, selector: "nz-divider", inputs: ["nzText", "nzType", "nzOrientation", "nzVariant", "nzDashed", "nzPlain"], exportAs: ["nzDivider"] }, { kind: "ngmodule", type: NzDropDownModule }, { kind: "component", type: i2$2.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1793
|
-
}
|
|
1794
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: CommonMenu, decorators: [{
|
|
1795
|
-
type: Component,
|
|
1796
|
-
args: [{ selector: 'axis-common-menu', imports: [NzDividerModule, NzDropDownModule, NzIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (canAddParent) {\n<li nz-menu-item (click)=\"addParent()\">\n <i nz-icon nzType=\"pic-center\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u6DFB\u52A0\u7236\u7EC4\u4EF6</span>\n</li>\n}\n@if (canAddChild) {\n<li nz-menu-item (click)=\"addChild()\">\n <i nz-icon nzType=\"plus\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u6DFB\u52A0\u5B50\u7EC4\u4EF6</span>\n</li>\n}\n@if (canRemove) {\n<li nz-menu-item style=\"color: #f81d22\" (click)=\"remove()\">\n <i nz-icon nzType=\"delete\" nzTheme=\"outline\"></i>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <span>\u5220\u9664</span>\n</li>\n}" }]
|
|
1797
|
-
}] });
|
|
1798
|
-
|
|
1799
|
-
// 生成变量的类型声明
|
|
1800
|
-
function generateDeclarations(args) {
|
|
1801
|
-
return Object.entries(args).map(([name, value]) => `declare const ${name}: ${convertToTsType(value)};`).join('\n');
|
|
1802
|
-
}
|
|
1803
|
-
// 将 JavaScript 值转换为 TypeScript 类型表达式
|
|
1804
|
-
function convertToTsType(value) {
|
|
1805
|
-
if (value === null)
|
|
1806
|
-
return 'null';
|
|
1807
|
-
if (value === undefined)
|
|
1808
|
-
return 'undefined';
|
|
1809
|
-
const type = typeof value;
|
|
1810
|
-
if (type === 'string')
|
|
1811
|
-
return 'string';
|
|
1812
|
-
if (type === 'number')
|
|
1813
|
-
return 'number';
|
|
1814
|
-
if (type === 'boolean')
|
|
1815
|
-
return 'boolean';
|
|
1816
|
-
if (type === 'function')
|
|
1817
|
-
return 'Function';
|
|
1818
|
-
if (Array.isArray(value)) {
|
|
1819
|
-
if (value.length > 0) {
|
|
1820
|
-
return `Array<${convertToTsType(value[0])}>`;
|
|
1821
|
-
}
|
|
1822
|
-
return 'any[]';
|
|
1823
|
-
}
|
|
1824
|
-
if (type === 'object') {
|
|
1825
|
-
const props = Object.entries(value)
|
|
1826
|
-
.map(([key, val]) => `${key}: ${convertToTsType(val)};`)
|
|
1827
|
-
.join('\n ');
|
|
1828
|
-
return `{\n ${props}\n}`;
|
|
1829
|
-
}
|
|
1830
|
-
return 'any';
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
class FunField {
|
|
1834
|
-
msg;
|
|
1835
|
-
constructor(msg) {
|
|
1836
|
-
this.msg = msg;
|
|
1837
|
-
this._sub.push(this.execFnSubject.pipe(debounceTime(300))
|
|
1838
|
-
.subscribe(async (_) => {
|
|
1839
|
-
if (!this.onlyFun() && !(this.editValue() ?? this.value()).funMode) {
|
|
1840
|
-
this.computeResult.set(this.value().originValue);
|
|
1841
|
-
}
|
|
1842
|
-
else {
|
|
1843
|
-
const args = this.ds();
|
|
1844
|
-
const libs = [];
|
|
1845
|
-
for (const i of (this.editValue() ?? this.value())?.fnValue?.imports ?? []) {
|
|
1846
|
-
if (this.scripts?.hasOwnProperty(i)) {
|
|
1847
|
-
libs.push(await loadScripts(`${this.scripts[i]}.js`));
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
try {
|
|
1851
|
-
this.success.set("");
|
|
1852
|
-
this.warn.set("");
|
|
1853
|
-
this.error.set("");
|
|
1854
|
-
this.computeResult.set(fn(`${libs.join("\n")}\n${this.editFn()}`, args, true, false));
|
|
1855
|
-
if (!this.onlyFun() && this.editValue()?.funMode) {
|
|
1856
|
-
this.editValue().originValue = this.computeResult();
|
|
1857
|
-
this.updateContentValue();
|
|
1858
|
-
}
|
|
1859
|
-
if (this.computeResult() == undefined) {
|
|
1860
|
-
this.warn.set(`警告:执行结果为${this.computeResult()}`);
|
|
1861
|
-
}
|
|
1862
|
-
else {
|
|
1863
|
-
if (typeof (this.computeResult()) == "object") {
|
|
1864
|
-
this.resultResultEditorMode = "json";
|
|
1865
|
-
}
|
|
1866
|
-
else {
|
|
1867
|
-
this.resultResultEditorMode = "plain_text";
|
|
1868
|
-
}
|
|
1869
|
-
this.successResult = JSON.stringify(this.computeResult(), undefined, "\t");
|
|
1870
|
-
this.success.set("函数运行成功!");
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
catch (e) {
|
|
1874
|
-
this.error.set(`报错:${e.message}`);
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
}));
|
|
1878
|
-
effect(() => {
|
|
1879
|
-
this.buildImportDeclarations();
|
|
1880
|
-
});
|
|
1881
|
-
}
|
|
1882
|
-
scopes = input(...(ngDevMode ? [undefined, { debugName: "scopes" }] : []));
|
|
1883
|
-
exclude = input([], ...(ngDevMode ? [{ debugName: "exclude" }] : []));
|
|
1884
|
-
scopeId = input(...(ngDevMode ? [undefined, { debugName: "scopeId" }] : []));
|
|
1885
|
-
onlyFun = input(false, ...(ngDevMode ? [{ debugName: "onlyFun" }] : []));
|
|
1886
|
-
noListen = input(false, ...(ngDevMode ? [{ debugName: "noListen" }] : []));
|
|
1887
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1888
|
-
getScopeInfos = inject(AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN);
|
|
1889
|
-
scopeInfos = toSignal(toObservable(this.scopeId).pipe(switchMap(scopeId => this.getScopeInfos(scopeId))));
|
|
1890
|
-
scripts = inject(AXIS_SCRIPTS_TOKEN, { optional: true });
|
|
1891
|
-
funcs = inject(AXIS_INJECT_FUNC_TOKEN, { optional: true });
|
|
1892
|
-
funcsNames = Object.keys(this.funcs ?? {});
|
|
1893
|
-
scopeds = computed(() => this.buildScopeDs(), ...(ngDevMode ? [{ debugName: "scopeds" }] : []));
|
|
1894
|
-
ds = computed(() => this.buildDs(), ...(ngDevMode ? [{ debugName: "ds" }] : []));
|
|
1895
|
-
argsName = computed(() => this.buildArgsName(), ...(ngDevMode ? [{ debugName: "argsName" }] : []));
|
|
1896
|
-
importsList = computed(() => this.buildImportsList(), ...(ngDevMode ? [{ debugName: "importsList" }] : []));
|
|
1897
|
-
importDeclarations = signal([], ...(ngDevMode ? [{ debugName: "importDeclarations" }] : []));
|
|
1898
|
-
showDataSource = signal(undefined, ...(ngDevMode ? [{ debugName: "showDataSource" }] : []));
|
|
1899
|
-
editValue = signal(undefined, ...(ngDevMode ? [{ debugName: "editValue" }] : []));
|
|
1900
|
-
editFn = signal(undefined, ...(ngDevMode ? [{ debugName: "editFn" }] : []));
|
|
1901
|
-
editTip = input(...(ngDevMode ? [undefined, { debugName: "editTip" }] : []));
|
|
1902
|
-
funEditor;
|
|
1903
|
-
monaco;
|
|
1904
|
-
contentModel;
|
|
1905
|
-
execFnSubject = new Subject();
|
|
1906
|
-
successResult;
|
|
1907
|
-
computeResult = signal(undefined, ...(ngDevMode ? [{ debugName: "computeResult" }] : []));
|
|
1908
|
-
resultResultEditorMode = "json";
|
|
1909
|
-
isShowSuccessResult = false;
|
|
1910
|
-
_sub = [];
|
|
1911
|
-
ngOnDestroy() {
|
|
1912
|
-
this._sub.forEach(s => s.unsubscribe());
|
|
1913
|
-
}
|
|
1914
|
-
onChange;
|
|
1915
|
-
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
1916
|
-
writeValue(v) {
|
|
1917
|
-
this.value.set(v);
|
|
1918
|
-
if (this.onlyFun() && this.noListen()) {
|
|
1919
|
-
this.editFn.set(v || "return undefined");
|
|
1920
|
-
this.execFnSubject.next();
|
|
1921
|
-
}
|
|
1922
|
-
else if (v) {
|
|
1923
|
-
if (v?.funMode) {
|
|
1924
|
-
this.editFn.set(this.value().fnValue.fn);
|
|
1925
|
-
this.execFnSubject.next();
|
|
1926
|
-
}
|
|
1927
|
-
else {
|
|
1928
|
-
this.value().fnValue = {
|
|
1929
|
-
listen: {},
|
|
1930
|
-
fn: `return ${JSON.stringify(this.value().originValue)};`
|
|
1931
|
-
};
|
|
1932
|
-
this.editFn.set(this.value().fnValue.fn);
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
this.updateContentValue();
|
|
1936
|
-
}
|
|
1937
|
-
updateContentValue() {
|
|
1938
|
-
if (!this.onlyFun() && this.value()) {
|
|
1939
|
-
this.contentModel?.control.setValue(this.value().originValue, { emitModelToViewChange: true, emitViewToModelChange: false });
|
|
1940
|
-
}
|
|
1941
|
-
}
|
|
1942
|
-
registerOnChange(fn) {
|
|
1943
|
-
this.onChange = fn;
|
|
1944
|
-
}
|
|
1945
|
-
registerOnTouched(_) {
|
|
1946
|
-
}
|
|
1947
|
-
_templateDataSource = [];
|
|
1948
|
-
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
1949
|
-
success = signal("", ...(ngDevMode ? [{ debugName: "success" }] : []));
|
|
1950
|
-
error = signal("", ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1951
|
-
warn = signal("", ...(ngDevMode ? [{ debugName: "warn" }] : []));
|
|
1952
|
-
showCreateListenModal = model(false, ...(ngDevMode ? [{ debugName: "showCreateListenModal" }] : []));
|
|
1953
|
-
showAddImportModal = false;
|
|
1954
|
-
createListenDataSourceName = model("", ...(ngDevMode ? [{ debugName: "createListenDataSourceName" }] : []));
|
|
1955
|
-
ngAfterContentInit() {
|
|
1956
|
-
setTimeout(() => {
|
|
1957
|
-
if (this.value()?.fnValue?.fn) {
|
|
1958
|
-
this.execFnSubject.next();
|
|
1959
|
-
}
|
|
1960
|
-
this.updateContentValue();
|
|
1961
|
-
});
|
|
1962
|
-
if (this.contentModel?.update) {
|
|
1963
|
-
this._sub.push(this.contentModel.update.subscribe(v => {
|
|
1964
|
-
if (this.value() !== undefined) {
|
|
1965
|
-
this.value().originValue = v;
|
|
1966
|
-
this.changeValue();
|
|
1967
|
-
// this.computeResult.set(v);
|
|
1968
|
-
}
|
|
1969
|
-
}));
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
buildScopeDs() {
|
|
1973
|
-
let scopes = copy((this.scopes() ?? []).concat(this.scopeInfos() ?? []), true);
|
|
1974
|
-
const sdname = new Set();
|
|
1975
|
-
for (const scope of scopes) {
|
|
1976
|
-
for (const name in scope.ds) {
|
|
1977
|
-
sdname.add(name);
|
|
1978
|
-
if (this.exclude()?.includes(name)) {
|
|
1979
|
-
delete scope.ds[name];
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
const unknownScope = {
|
|
1984
|
-
scopeId: "__unknown__",
|
|
1985
|
-
scopeName: "未知",
|
|
1986
|
-
ds: {},
|
|
1987
|
-
};
|
|
1988
|
-
scopes.unshift(unknownScope);
|
|
1989
|
-
for (const en of Object.entries((this.editValue() ?? this.value())?.fnValue?.listen ?? {})) {
|
|
1990
|
-
if (!sdname.has(en[0])) {
|
|
1991
|
-
unknownScope.ds[en[0]] = "示例数据";
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
this.execFnSubject.next();
|
|
1995
|
-
return scopes.filter(s => Object.keys(s.ds ?? {}).length);
|
|
1996
|
-
}
|
|
1997
|
-
getDsNames(scope) {
|
|
1998
|
-
return Object.keys(scope.ds);
|
|
1999
|
-
}
|
|
2000
|
-
buildDs() {
|
|
2001
|
-
const ds = {};
|
|
2002
|
-
for (const scope of this.scopeds()) {
|
|
2003
|
-
Object.assign(ds, scope.ds);
|
|
2004
|
-
}
|
|
2005
|
-
Object.assign(ds, this.funcs);
|
|
2006
|
-
return ds;
|
|
2007
|
-
}
|
|
2008
|
-
openFunModal() {
|
|
2009
|
-
this.open.set(true);
|
|
2010
|
-
this.editValue.set(copy(this.value(), true));
|
|
2011
|
-
}
|
|
2012
|
-
buildArgsName() {
|
|
2013
|
-
return Object.keys(this.ds()).join(",");
|
|
2014
|
-
}
|
|
2015
|
-
buildImportsList() {
|
|
2016
|
-
return Object.keys(this.scripts ?? {})
|
|
2017
|
-
.map((name) => ({ label: name, value: name }));
|
|
2018
|
-
}
|
|
2019
|
-
changeLinstenMode(name, mode) {
|
|
2020
|
-
if (!this.editValue().fnValue?.listen) {
|
|
2021
|
-
this.editValue().fnValue.listen = {};
|
|
2022
|
-
}
|
|
2023
|
-
if (mode == "none") {
|
|
2024
|
-
delete this.editValue().fnValue.listen[name];
|
|
2025
|
-
}
|
|
2026
|
-
else {
|
|
2027
|
-
this.editValue().fnValue.listen[name] = mode;
|
|
2028
|
-
}
|
|
2029
|
-
this.editValue.set({ ...this.editValue() });
|
|
2030
|
-
}
|
|
2031
|
-
changeImports(imports) {
|
|
2032
|
-
this.editValue().fnValue.imports = imports;
|
|
2033
|
-
this.editValue.set({ ...this.editValue() });
|
|
2034
|
-
this.execFnSubject.next();
|
|
2035
|
-
}
|
|
2036
|
-
onCancel() {
|
|
2037
|
-
this.open.set(false);
|
|
2038
|
-
}
|
|
2039
|
-
onOk() {
|
|
2040
|
-
this.value.set(this.editValue());
|
|
2041
|
-
this.changeValue();
|
|
2042
|
-
this.open.set(false);
|
|
2043
|
-
}
|
|
2044
|
-
toogleMode() {
|
|
2045
|
-
if (this.value() && !this.onlyFun()) {
|
|
2046
|
-
this.value().funMode = !this.value().funMode;
|
|
2047
|
-
if (this.value().funMode && !this.value().fnValue) {
|
|
2048
|
-
this.value().fnValue = { fn: `return ${JSON.stringify(this.value().originValue)};` };
|
|
2049
|
-
}
|
|
2050
|
-
this.changeValue();
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
changeValue() {
|
|
2054
|
-
if (this.noListen() && this.onlyFun()) {
|
|
2055
|
-
this.value.set(this.editFn());
|
|
2056
|
-
this.onChange(this.value());
|
|
2057
|
-
return;
|
|
2058
|
-
}
|
|
2059
|
-
else if (this.onlyFun() || this.value()?.funMode) {
|
|
2060
|
-
this.value().funMode = true;
|
|
2061
|
-
for (const en of Object.entries(this.value().fnValue.listen)) {
|
|
2062
|
-
if (en[1] == "none") {
|
|
2063
|
-
delete this.value().fnValue.listen[en[0]];
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
this.value().fnValue.fn = this.editFn();
|
|
2067
|
-
}
|
|
2068
|
-
this.value.set(copy(this.value()));
|
|
2069
|
-
this.onChange(this.value());
|
|
2070
|
-
}
|
|
2071
|
-
doShowDataSource(name) {
|
|
2072
|
-
this.showDataSource.set({
|
|
2073
|
-
name: name,
|
|
2074
|
-
data: JSON.stringify(this.ds()[name], undefined, '\t')
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
copySuccess() {
|
|
2078
|
-
this.msg.info("已复制");
|
|
2079
|
-
}
|
|
2080
|
-
addListen() {
|
|
2081
|
-
if (this.createListenDataSourceName()) {
|
|
2082
|
-
if (this.ds().hasOwnProperty(this.createListenDataSourceName())) {
|
|
2083
|
-
this.msg.error("数据源名称重复");
|
|
2084
|
-
return;
|
|
2085
|
-
}
|
|
2086
|
-
if (!this.editValue().fnValue.listen) {
|
|
2087
|
-
this.editValue().fnValue.listen = {};
|
|
2088
|
-
}
|
|
2089
|
-
this.editValue().fnValue.listen[this.createListenDataSourceName()] = "defined";
|
|
2090
|
-
this.editValue.set({ ...this.editValue() });
|
|
2091
|
-
}
|
|
2092
|
-
this.showCreateListenModal.set(false);
|
|
2093
|
-
this.createListenDataSourceName.set("");
|
|
2094
|
-
this.execFnSubject.next();
|
|
2095
|
-
}
|
|
2096
|
-
removeListen(name) {
|
|
2097
|
-
delete this.editValue().fnValue.listen[name];
|
|
2098
|
-
this.editValue.set({ ...this.editValue() });
|
|
2099
|
-
this.execFnSubject.next();
|
|
2100
|
-
}
|
|
2101
|
-
async buildImportDeclarations() {
|
|
2102
|
-
const libs = [];
|
|
2103
|
-
for (const name in this.scripts) {
|
|
2104
|
-
if (this.editValue().fnValue?.imports?.includes(name)) {
|
|
2105
|
-
const filePath = this.scripts[name] + ".d.ts";
|
|
2106
|
-
const dtsContent = await loadScripts(filePath);
|
|
2107
|
-
libs.push({ content: dtsContent, filePath });
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
libs.push({ content: generateDeclarations(this.ds()) });
|
|
2111
|
-
this.importDeclarations.set(libs);
|
|
2112
|
-
}
|
|
2113
|
-
layoutEditor() {
|
|
2114
|
-
this.funEditor?.onEvents?.({ name: "layout", target: "component" })?.subscribe();
|
|
2115
|
-
}
|
|
2116
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FunField, deps: [{ token: i2.NzMessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2117
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: FunField, isStandalone: true, selector: "axis-fun-field", inputs: { scopes: { classPropertyName: "scopes", publicName: "scopes", isSignal: true, isRequired: false, transformFunction: null }, exclude: { classPropertyName: "exclude", publicName: "exclude", isSignal: true, isRequired: false, transformFunction: null }, scopeId: { classPropertyName: "scopeId", publicName: "scopeId", isSignal: true, isRequired: false, transformFunction: null }, onlyFun: { classPropertyName: "onlyFun", publicName: "onlyFun", isSignal: true, isRequired: false, transformFunction: null }, noListen: { classPropertyName: "noListen", publicName: "noListen", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, editTip: { classPropertyName: "editTip", publicName: "editTip", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, showCreateListenModal: { classPropertyName: "showCreateListenModal", publicName: "showCreateListenModal", isSignal: true, isRequired: false, transformFunction: null }, createListenDataSourceName: { classPropertyName: "createListenDataSourceName", publicName: "createListenDataSourceName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", open: "openChange", showCreateListenModal: "showCreateListenModalChange", createListenDataSourceName: "createListenDataSourceNameChange" }, providers: [
|
|
2118
|
-
{
|
|
2119
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2120
|
-
useExisting: forwardRef(() => FunField),
|
|
2121
|
-
multi: true
|
|
2122
|
-
}
|
|
2123
|
-
], queries: [{ propertyName: "contentModel", first: true, predicate: NgModel, descendants: true }], viewQueries: [{ propertyName: "funEditor", first: true, predicate: ["funEditor"], descendants: true }], ngImport: i0, template: "@if (!onlyFun()) {\n<div nz-flex nzAlign=\"center\">\n @if (!value()?.funMode) {\n <div nz-flex nzFlex=\"1 0 0\">\n <ng-content #content></ng-content>\n </div>\n }@else{\n <nz-input-group nz-flex nzFlex=\"1 0 0\" [nzSuffix]=\"suffixTemplate\" [nzPrefix]=\"prefixTemplate\">\n <input nz-input readonly type=\"text\" [class]=\"{success:success(),warn:warn(),error:error()}\"\n [placeholder]=\"success() || warn() || error()\" (click)=\"openFunModal()\" />\n </nz-input-group>\n }\n <a nz-button nzType=\"link\" [disabled]=\"disabled()\" (click)=\"toogleMode()\"><i style=\"margin: 0 auto;display: block;\"\n nz-icon [nzType]=\"value()?.funMode?'rollback':'function'\" nzTheme=\"outline\"></i></a>\n</div>\n}@else{\n<nz-input-group [nzSuffix]=\"suffixTemplate\" [nzPrefix]=\"prefixTemplate\">\n <input nz-input readonly type=\"text\" [class]=\"{success:success(),warn:warn(),error:error()}\"\n [placeholder]=\"success() || warn() || error() || ''\" (click)=\"openFunModal()\" />\n</nz-input-group>\n}\n<ng-template #prefixTemplate>\n <i nz-icon nzType=\"function\" style=\"margin-right: 5px;\"></i>\n @if (success()) {\n <i nz-icon nzType=\"check-circle\" style=\"color:#52c41a;\"></i>\n }@else if (warn()) {\n <i nz-icon nzType=\"exclamation-circle\" style=\"color:#faad14;\"></i>\n }@else if (error()) {\n <i nz-icon nzType=\"close-circle\" style=\"color:#ff4d4f;\"></i>\n }\n</ng-template>\n<ng-template #suffixTemplate>\n <i style=\"color:rgba(150, 150, 150, 0.5);\" nz-icon nzType=\"edit\" nzTheme=\"outline\"></i>\n</ng-template>\n<nz-modal nzWidth=\"1000px\" [nzBodyStyle]=\"{padding:'0'}\" [(nzVisible)]=\"open\" (nzOnCancel)=\"onCancel()\"\n (nzOnOk)=\"onOk()\" (nzAfterClose)=\"editValue.set(undefined);\">\n <ng-container *nzModalTitle>\n <i nz-icon nzType=\"function\" style=\"margin-right: 8px;\"></i>\u7F16\u8F91\u811A\u672C\n @if (editTip()) {\n <span style=\"font-size: 12px;margin-left: 30px;color:var(--ant-error-color)\">\n <nz-icon nzType=\"info-circle\" nzTheme=\"outline\" />\n {{editTip()}}\n </span>\n }\n </ng-container>\n <ng-container *nzModalContent>\n <nz-splitter style=\"height: 400px;\" (nzResize)=\"layoutEditor()\">\n <nz-splitter-panel [nzDefaultSize]=\"250\" [nzMin]=\"250\" nzMax=\"70%\" [nzCollapsible]=\"true\">\n <nz-collapse nzAccordion [nzBordered]=\"false\">\n @if (funcsNames.length) {\n <nz-collapse-panel nzHeader=\"\u6CE8\u5165\u51FD\u6570\" [nzExtra]=\"funcsNames.length.toString()\">\n @for (item of funcsNames; track $index) {\n <div><span style=\"color:#C52727\">function</span> {{item}}</div>\n }\n </nz-collapse-panel>\n }\n @if (importsList().length) {\n <nz-collapse-panel nzHeader=\"\u51FD\u6570\u5E93\u5BFC\u5165\"\n [nzExtra]=\"(editValue().fnValue?.imports?.length ?? 0) + '/'+importsList().length\">\n <nz-checkbox-group [nzOptions]=\"importsList()\" [ngModel]=\"editValue().fnValue?.imports\"\n (ngModelChange)=\"changeImports($event)\" />\n </nz-collapse-panel>\n }\n <nz-collapse-panel nzActive nzHeader=\"\u6570\u636E\u6E90\" [nzExtra]=\"addListenBtn\">\n <ng-template #addListenBtn>\n <a nz-button nzType=\"link\" nzSize=\"small\"\n (click)=\"$event.stopPropagation();showCreateListenModal.set(true)\">\n <nz-icon nzType=\"plus\"></nz-icon>\n \u6DFB\u52A0\n </a>\n </ng-template>\n @if (!scopeds().length) {\n <nz-empty nzNotFoundContent=\"\u6682\u65E0\u6570\u636E\u6E90\"></nz-empty>\n }@else{\n @for (scope of scopeds(); track scope.scopeId) {\n <div class=\"scope-tag\">{{scope.scopeName}}</div>\n @for (item of getDsNames(scope); track item;) {\n <div nz-flex nzVertical style=\"margin-top: 2px;\">\n <div nz-flex nzAlign=\"center\">\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"doShowDataSource(item)\">\n <i nz-icon nzType=\"search\" nzTheme=\"outline\"></i>\n {{item}}\n </a>\n <a nz-button nzType=\"link\" nzSize=\"small\" ngxClipboard [cbContent]=\"item\"\n (cbOnSuccess)=\"copySuccess()\">\n <i nz-icon nzType=\"copy\" nzTheme=\"outline\"></i>\n </a>\n @if (scope.scopeId == '__unknown__') {\n <a nz-button nzType=\"link\" nzSize=\"small\" nzDanger (click)=\"removeListen(item)\">\n <i nz-icon nzType=\"delete\" nzTheme=\"outline\"></i>\n </a>\n }\n </div>\n @if (!noListen()) {\n <nz-select style=\"margin-left:16px;font-size: 12px;width: fit-content;\"\n [nzDropdownMatchSelectWidth]=\"false\" nzVariant=\"borderless\"\n [ngModel]=\"editValue().fnValue?.listen?.[item]??'none'\"\n (ngModelChange)=\"changeLinstenMode(item,$event)\" nzSize=\"small\">\n <nz-option nzCustomContent nzLabel=\"\u4E0D\u76D1\u542C\" nzValue=\"none\">\n <span style=\"font-size: 12px;\">\u4E0D\u76D1\u542C</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u9996\u6B21\u6709\u5B9A\u4E49\" nzValue=\"firstDefined\">\n <span style=\"font-size: 12px;\">\u9996\u6B21\u6709\u5B9A\u4E49</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u6709\u5B9A\u4E49\" nzValue=\"defined\">\n <span style=\"font-size: 12px;\">\u6709\u5B9A\u4E49</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u603B\u662F\" nzValue=\"aways\">\n <span style=\"font-size: 12px;\">\u603B\u662F</span>\n </nz-option>\n </nz-select>\n }\n </div>\n }\n }\n }\n </nz-collapse-panel>\n </nz-collapse>\n </nz-splitter-panel>\n <nz-splitter-panel>\n <div nz-flex nzVertical style=\"height: 100%;\">\n <div class=\"code-row\"><span style=\"color: #C52727;\">function</span>({{argsName()}})\n {{'{'}}</div>\n <div nz-flex nzFlex=\"1 1 0\">\n <ng-container #funEditor=\"axisDynamic\"\n [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'javascript',typescriptExtLibs:importDeclarations()}\"\n [standalone]=\"true\" [(ngModel)]=\"editFn\"\n (ngModelChange)=\"execFnSubject.next()\"></ng-container>\n </div>\n <div class=\"code-row\"> {{'}'}}</div>\n </div>\n </nz-splitter-panel>\n </nz-splitter>\n @if (success()) {\n <nz-alert nzShowIcon nzType=\"success\" nzCloseable [nzDescription]=\"success()\" (nzOnClose)=\"success.set('')\"\n [nzAction]=\"showSuccessResultBtn\">\n </nz-alert>\n <ng-template #showSuccessResultBtn>\n <button nz-button (click)=\"isShowSuccessResult=true\">\u67E5\u770B\u6267\u884C\u7ED3\u679C</button>\n </ng-template>\n }@else if(error()){\n <nz-alert nzShowIcon nzType=\"error\" nzCloseable [nzDescription]=\"error()\" (nzOnClose)=\"error.set('')\">\n </nz-alert>\n }@else if(warn()){\n <nz-alert nzShowIcon nzType=\"warning\" nzCloseable [nzDescription]=\"warn()\" (nzOnClose)=\"warn.set('')\">\n </nz-alert>\n }\n </ng-container>\n</nz-modal>\n\n<nz-modal [nzVisible]=\"!!isShowSuccessResult\" nzTitle=\"\u51FD\u6570\u6267\u884C\u7ED3\u679C\" [nzOkText]=\"null\"\n (nzOnCancel)=\"isShowSuccessResult=false;\" [nzBodyStyle]=\"{padding:'0',position:'relative'}\" nzCancelText=\"\u5173\u95ED\">\n <div *nzModalContent style=\"height: 400px;\" nz-flex>\n <ng-container [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}\"\n [standalone]=\"true\" [ngModel]=\"successResult\"></ng-container>\n </div>\n</nz-modal>\n\n<nz-modal nzWidth=\"800px\" [nzVisible]=\"!!showDataSource()\" [nzTitle]=\"'\u67E5\u770B\u6570\u636E\u6E90-'+showDataSource()?.name\" [nzOkText]=\"null\"\n (nzOnCancel)=\"showDataSource.set(undefined)\" [nzBodyStyle]=\"{padding:'0'}\" nzCancelText=\"\u5173\u95ED\">\n <div *nzModalContent style=\"height: 400px;\" nz-flex>\n <ng-container [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}\"\n [standalone]=\"true\" [ngModel]=\"showDataSource()?.data ??''\"></ng-container>\n </div>\n</nz-modal>\n\n<nz-modal [(nzVisible)]=\"showCreateListenModal\" nzDraggable nzTitle=\"\u521B\u5EFA\u76D1\u542C\" (nzOnOk)=\"addListen()\"\n (nzOnCancel)=\"showCreateListenModal.set(false)\" nzWidth=\"400px\">\n <ng-container *nzModalContent>\n <div nz-flex nzAlign=\"center\">\n <div>\u6570\u636E\u6E90\u540D\u79F0\uFF1A</div>\n <input style=\"flex:1\" nz-input [(ngModel)]=\"createListenDataSourceName\" />\n </div>\n </ng-container>\n</nz-modal>", styles: [".black{width:100%;height:500px;padding-left:42px}.modal .ant-modal-body{padding:0!important}nz-list{display:flex;flex-direction:column;height:100%}nz-list ::ng-deep nz-spin{overflow:auto}.code-row{padding-left:50px}.success::placeholder{color:#52c41a}.warn::placeholder{color:#faad14}.error::placeholder{color:#ff4d4f}.scope-tag{padding:0 20px;font-size:12px;background:#7d7d7d1a;color:#0000008a}.scope-tag:not(:first-child){margin-top:8px}nz-splitter ::ng-deep .ant-splitter-panel{overflow-y:visible}.scope-item-container{width:100%;overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i2$1.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "directive", type: i2$1.NzModalContentDirective, selector: "[nzModalContent]", exportAs: ["nzModalContent"] }, { kind: "directive", type: i2$1.NzModalTitleDirective, selector: "[nzModalTitle]", exportAs: ["nzModalTitle"] }, { kind: "ngmodule", type: NzListModule }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i4$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i4$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i10.ClipboardDirective, selector: "[ngxClipboard]", inputs: ["ngxClipboard", "container", "cbContent", "cbSuccessMsg"], outputs: ["cbOnSuccess", "cbOnError"] }, { kind: "ngmodule", type: NzAlertModule }, { kind: "component", type: i11.NzAlertComponent, selector: "nz-alert", inputs: ["nzAction", "nzCloseText", "nzIconType", "nzMessage", "nzDescription", "nzType", "nzCloseable", "nzShowIcon", "nzBanner", "nzNoAnimation", "nzIcon"], outputs: ["nzOnClose"], exportAs: ["nzAlert"] }, { kind: "ngmodule", type: NzEmptyModule }, { kind: "component", type: i12.NzEmptyComponent, selector: "nz-empty", inputs: ["nzNotFoundImage", "nzNotFoundContent", "nzNotFoundFooter"], exportAs: ["nzEmpty"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: NzSplitterModule }, { kind: "component", type: i14.NzSplitterComponent, selector: "nz-splitter", inputs: ["nzLayout", "nzLazy"], outputs: ["nzResizeStart", "nzResize", "nzResizeEnd"], exportAs: ["nzSplitter"] }, { kind: "component", type: i14.NzSplitterPanelComponent, selector: "nz-splitter-panel", inputs: ["nzDefaultSize", "nzMin", "nzMax", "nzSize", "nzCollapsible", "nzResizable"], exportAs: ["nzSplitterPanel"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i1$2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i1$2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "component", type: i16.NzCheckboxGroupComponent, selector: "nz-checkbox-group", inputs: ["nzName", "nzDisabled", "nzOptions"], exportAs: ["nzCheckboxGroup"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2124
|
-
}
|
|
2125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FunField, decorators: [{
|
|
2126
|
-
type: Component,
|
|
2127
|
-
args: [{ selector: 'axis-fun-field', imports: [NzModalModule, NzListModule, NzFlexModule, NzInputModule, NzIconModule, NzButtonModule, NzRadioModule, FormsModule, ClipboardModule, NzAlertModule, NzEmptyModule, NzSelectModule, NzSplitterModule, NzCollapseModule, NzCheckboxModule, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2128
|
-
{
|
|
2129
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2130
|
-
useExisting: forwardRef(() => FunField),
|
|
2131
|
-
multi: true
|
|
2132
|
-
}
|
|
2133
|
-
], template: "@if (!onlyFun()) {\n<div nz-flex nzAlign=\"center\">\n @if (!value()?.funMode) {\n <div nz-flex nzFlex=\"1 0 0\">\n <ng-content #content></ng-content>\n </div>\n }@else{\n <nz-input-group nz-flex nzFlex=\"1 0 0\" [nzSuffix]=\"suffixTemplate\" [nzPrefix]=\"prefixTemplate\">\n <input nz-input readonly type=\"text\" [class]=\"{success:success(),warn:warn(),error:error()}\"\n [placeholder]=\"success() || warn() || error()\" (click)=\"openFunModal()\" />\n </nz-input-group>\n }\n <a nz-button nzType=\"link\" [disabled]=\"disabled()\" (click)=\"toogleMode()\"><i style=\"margin: 0 auto;display: block;\"\n nz-icon [nzType]=\"value()?.funMode?'rollback':'function'\" nzTheme=\"outline\"></i></a>\n</div>\n}@else{\n<nz-input-group [nzSuffix]=\"suffixTemplate\" [nzPrefix]=\"prefixTemplate\">\n <input nz-input readonly type=\"text\" [class]=\"{success:success(),warn:warn(),error:error()}\"\n [placeholder]=\"success() || warn() || error() || ''\" (click)=\"openFunModal()\" />\n</nz-input-group>\n}\n<ng-template #prefixTemplate>\n <i nz-icon nzType=\"function\" style=\"margin-right: 5px;\"></i>\n @if (success()) {\n <i nz-icon nzType=\"check-circle\" style=\"color:#52c41a;\"></i>\n }@else if (warn()) {\n <i nz-icon nzType=\"exclamation-circle\" style=\"color:#faad14;\"></i>\n }@else if (error()) {\n <i nz-icon nzType=\"close-circle\" style=\"color:#ff4d4f;\"></i>\n }\n</ng-template>\n<ng-template #suffixTemplate>\n <i style=\"color:rgba(150, 150, 150, 0.5);\" nz-icon nzType=\"edit\" nzTheme=\"outline\"></i>\n</ng-template>\n<nz-modal nzWidth=\"1000px\" [nzBodyStyle]=\"{padding:'0'}\" [(nzVisible)]=\"open\" (nzOnCancel)=\"onCancel()\"\n (nzOnOk)=\"onOk()\" (nzAfterClose)=\"editValue.set(undefined);\">\n <ng-container *nzModalTitle>\n <i nz-icon nzType=\"function\" style=\"margin-right: 8px;\"></i>\u7F16\u8F91\u811A\u672C\n @if (editTip()) {\n <span style=\"font-size: 12px;margin-left: 30px;color:var(--ant-error-color)\">\n <nz-icon nzType=\"info-circle\" nzTheme=\"outline\" />\n {{editTip()}}\n </span>\n }\n </ng-container>\n <ng-container *nzModalContent>\n <nz-splitter style=\"height: 400px;\" (nzResize)=\"layoutEditor()\">\n <nz-splitter-panel [nzDefaultSize]=\"250\" [nzMin]=\"250\" nzMax=\"70%\" [nzCollapsible]=\"true\">\n <nz-collapse nzAccordion [nzBordered]=\"false\">\n @if (funcsNames.length) {\n <nz-collapse-panel nzHeader=\"\u6CE8\u5165\u51FD\u6570\" [nzExtra]=\"funcsNames.length.toString()\">\n @for (item of funcsNames; track $index) {\n <div><span style=\"color:#C52727\">function</span> {{item}}</div>\n }\n </nz-collapse-panel>\n }\n @if (importsList().length) {\n <nz-collapse-panel nzHeader=\"\u51FD\u6570\u5E93\u5BFC\u5165\"\n [nzExtra]=\"(editValue().fnValue?.imports?.length ?? 0) + '/'+importsList().length\">\n <nz-checkbox-group [nzOptions]=\"importsList()\" [ngModel]=\"editValue().fnValue?.imports\"\n (ngModelChange)=\"changeImports($event)\" />\n </nz-collapse-panel>\n }\n <nz-collapse-panel nzActive nzHeader=\"\u6570\u636E\u6E90\" [nzExtra]=\"addListenBtn\">\n <ng-template #addListenBtn>\n <a nz-button nzType=\"link\" nzSize=\"small\"\n (click)=\"$event.stopPropagation();showCreateListenModal.set(true)\">\n <nz-icon nzType=\"plus\"></nz-icon>\n \u6DFB\u52A0\n </a>\n </ng-template>\n @if (!scopeds().length) {\n <nz-empty nzNotFoundContent=\"\u6682\u65E0\u6570\u636E\u6E90\"></nz-empty>\n }@else{\n @for (scope of scopeds(); track scope.scopeId) {\n <div class=\"scope-tag\">{{scope.scopeName}}</div>\n @for (item of getDsNames(scope); track item;) {\n <div nz-flex nzVertical style=\"margin-top: 2px;\">\n <div nz-flex nzAlign=\"center\">\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"doShowDataSource(item)\">\n <i nz-icon nzType=\"search\" nzTheme=\"outline\"></i>\n {{item}}\n </a>\n <a nz-button nzType=\"link\" nzSize=\"small\" ngxClipboard [cbContent]=\"item\"\n (cbOnSuccess)=\"copySuccess()\">\n <i nz-icon nzType=\"copy\" nzTheme=\"outline\"></i>\n </a>\n @if (scope.scopeId == '__unknown__') {\n <a nz-button nzType=\"link\" nzSize=\"small\" nzDanger (click)=\"removeListen(item)\">\n <i nz-icon nzType=\"delete\" nzTheme=\"outline\"></i>\n </a>\n }\n </div>\n @if (!noListen()) {\n <nz-select style=\"margin-left:16px;font-size: 12px;width: fit-content;\"\n [nzDropdownMatchSelectWidth]=\"false\" nzVariant=\"borderless\"\n [ngModel]=\"editValue().fnValue?.listen?.[item]??'none'\"\n (ngModelChange)=\"changeLinstenMode(item,$event)\" nzSize=\"small\">\n <nz-option nzCustomContent nzLabel=\"\u4E0D\u76D1\u542C\" nzValue=\"none\">\n <span style=\"font-size: 12px;\">\u4E0D\u76D1\u542C</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u9996\u6B21\u6709\u5B9A\u4E49\" nzValue=\"firstDefined\">\n <span style=\"font-size: 12px;\">\u9996\u6B21\u6709\u5B9A\u4E49</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u6709\u5B9A\u4E49\" nzValue=\"defined\">\n <span style=\"font-size: 12px;\">\u6709\u5B9A\u4E49</span>\n </nz-option>\n <nz-option nzCustomContent nzLabel=\"\u603B\u662F\" nzValue=\"aways\">\n <span style=\"font-size: 12px;\">\u603B\u662F</span>\n </nz-option>\n </nz-select>\n }\n </div>\n }\n }\n }\n </nz-collapse-panel>\n </nz-collapse>\n </nz-splitter-panel>\n <nz-splitter-panel>\n <div nz-flex nzVertical style=\"height: 100%;\">\n <div class=\"code-row\"><span style=\"color: #C52727;\">function</span>({{argsName()}})\n {{'{'}}</div>\n <div nz-flex nzFlex=\"1 1 0\">\n <ng-container #funEditor=\"axisDynamic\"\n [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'javascript',typescriptExtLibs:importDeclarations()}\"\n [standalone]=\"true\" [(ngModel)]=\"editFn\"\n (ngModelChange)=\"execFnSubject.next()\"></ng-container>\n </div>\n <div class=\"code-row\"> {{'}'}}</div>\n </div>\n </nz-splitter-panel>\n </nz-splitter>\n @if (success()) {\n <nz-alert nzShowIcon nzType=\"success\" nzCloseable [nzDescription]=\"success()\" (nzOnClose)=\"success.set('')\"\n [nzAction]=\"showSuccessResultBtn\">\n </nz-alert>\n <ng-template #showSuccessResultBtn>\n <button nz-button (click)=\"isShowSuccessResult=true\">\u67E5\u770B\u6267\u884C\u7ED3\u679C</button>\n </ng-template>\n }@else if(error()){\n <nz-alert nzShowIcon nzType=\"error\" nzCloseable [nzDescription]=\"error()\" (nzOnClose)=\"error.set('')\">\n </nz-alert>\n }@else if(warn()){\n <nz-alert nzShowIcon nzType=\"warning\" nzCloseable [nzDescription]=\"warn()\" (nzOnClose)=\"warn.set('')\">\n </nz-alert>\n }\n </ng-container>\n</nz-modal>\n\n<nz-modal [nzVisible]=\"!!isShowSuccessResult\" nzTitle=\"\u51FD\u6570\u6267\u884C\u7ED3\u679C\" [nzOkText]=\"null\"\n (nzOnCancel)=\"isShowSuccessResult=false;\" [nzBodyStyle]=\"{padding:'0',position:'relative'}\" nzCancelText=\"\u5173\u95ED\">\n <div *nzModalContent style=\"height: 400px;\" nz-flex>\n <ng-container [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}\"\n [standalone]=\"true\" [ngModel]=\"successResult\"></ng-container>\n </div>\n</nz-modal>\n\n<nz-modal nzWidth=\"800px\" [nzVisible]=\"!!showDataSource()\" [nzTitle]=\"'\u67E5\u770B\u6570\u636E\u6E90-'+showDataSource()?.name\" [nzOkText]=\"null\"\n (nzOnCancel)=\"showDataSource.set(undefined)\" [nzBodyStyle]=\"{padding:'0'}\" nzCancelText=\"\u5173\u95ED\">\n <div *nzModalContent style=\"height: 400px;\" nz-flex>\n <ng-container [axisDynamic]=\"{component:'axis-components/editor',inuse:true,mode:'json',readonly:true}\"\n [standalone]=\"true\" [ngModel]=\"showDataSource()?.data ??''\"></ng-container>\n </div>\n</nz-modal>\n\n<nz-modal [(nzVisible)]=\"showCreateListenModal\" nzDraggable nzTitle=\"\u521B\u5EFA\u76D1\u542C\" (nzOnOk)=\"addListen()\"\n (nzOnCancel)=\"showCreateListenModal.set(false)\" nzWidth=\"400px\">\n <ng-container *nzModalContent>\n <div nz-flex nzAlign=\"center\">\n <div>\u6570\u636E\u6E90\u540D\u79F0\uFF1A</div>\n <input style=\"flex:1\" nz-input [(ngModel)]=\"createListenDataSourceName\" />\n </div>\n </ng-container>\n</nz-modal>", styles: [".black{width:100%;height:500px;padding-left:42px}.modal .ant-modal-body{padding:0!important}nz-list{display:flex;flex-direction:column;height:100%}nz-list ::ng-deep nz-spin{overflow:auto}.code-row{padding-left:50px}.success::placeholder{color:#52c41a}.warn::placeholder{color:#faad14}.error::placeholder{color:#ff4d4f}.scope-tag{padding:0 20px;font-size:12px;background:#7d7d7d1a;color:#0000008a}.scope-tag:not(:first-child){margin-top:8px}nz-splitter ::ng-deep .ant-splitter-panel{overflow-y:visible}.scope-item-container{width:100%;overflow:auto}\n"] }]
|
|
2134
|
-
}], ctorParameters: () => [{ type: i2.NzMessageService }], propDecorators: { funEditor: [{
|
|
2135
|
-
type: ViewChild,
|
|
2136
|
-
args: ["funEditor"]
|
|
2137
|
-
}], contentModel: [{
|
|
2138
|
-
type: ContentChild,
|
|
2139
|
-
args: [NgModel]
|
|
2140
|
-
}] } });
|
|
2141
|
-
|
|
2142
|
-
class FormValidators extends Validators {
|
|
2143
|
-
static required(control) {
|
|
2144
|
-
let error = Validators.required(control);
|
|
2145
|
-
if (error) {
|
|
2146
|
-
return { required: { 'zh-cn': "必填项" } };
|
|
2147
|
-
}
|
|
2148
|
-
return null;
|
|
2149
|
-
}
|
|
2150
|
-
static requiredFun(control) {
|
|
2151
|
-
let error = FormValidators.required(control);
|
|
2152
|
-
if (!error) {
|
|
2153
|
-
error = FormValidators.required(new UntypedFormControl(control.value?.funMode ? control.value?.fnValue.fn : control.value?.originValue));
|
|
2154
|
-
}
|
|
2155
|
-
if (error) {
|
|
2156
|
-
return { required: { 'zh-cn': "必填项" } };
|
|
2157
|
-
}
|
|
2158
|
-
return null;
|
|
2159
|
-
}
|
|
2160
|
-
static equal(comparedValue) {
|
|
2161
|
-
return (control) => {
|
|
2162
|
-
if (!control.value) {
|
|
2163
|
-
return null;
|
|
2164
|
-
}
|
|
2165
|
-
let cv;
|
|
2166
|
-
if (typeof (comparedValue) != "function") {
|
|
2167
|
-
cv = comparedValue;
|
|
2168
|
-
}
|
|
2169
|
-
else {
|
|
2170
|
-
try {
|
|
2171
|
-
cv = comparedValue();
|
|
2172
|
-
}
|
|
2173
|
-
catch { }
|
|
2174
|
-
}
|
|
2175
|
-
return control.value != cv ? { notEqual: true } : null;
|
|
2176
|
-
};
|
|
2177
|
-
}
|
|
2178
|
-
static minLength(minLength) {
|
|
2179
|
-
const validator = Validators.minLength(minLength);
|
|
2180
|
-
return (control) => {
|
|
2181
|
-
if (validator(control) === null) {
|
|
2182
|
-
return null;
|
|
2183
|
-
}
|
|
2184
|
-
return { minlength: { 'zh-cn': `最小长度为 ${minLength}` } };
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
static maxLength(maxLength) {
|
|
2188
|
-
const validator = Validators.maxLength(maxLength);
|
|
2189
|
-
return (control) => {
|
|
2190
|
-
if (validator(control) === null) {
|
|
2191
|
-
return null;
|
|
2192
|
-
}
|
|
2193
|
-
return { minlength: { 'zh-cn': `最大长度为 ${maxLength}` } };
|
|
2194
|
-
};
|
|
2195
|
-
}
|
|
2196
|
-
static min(minvalue) {
|
|
2197
|
-
const validator = Validators.min(minvalue);
|
|
2198
|
-
return (control) => {
|
|
2199
|
-
if (validator(control) === null) {
|
|
2200
|
-
return null;
|
|
2201
|
-
}
|
|
2202
|
-
return { minlength: { 'zh-cn': `最小值为 ${minvalue}` } };
|
|
2203
|
-
};
|
|
2204
|
-
}
|
|
2205
|
-
static max(maxvalue) {
|
|
2206
|
-
const validator = Validators.max(maxvalue);
|
|
2207
|
-
return (control) => {
|
|
2208
|
-
if (validator(control) === null) {
|
|
2209
|
-
return null;
|
|
2210
|
-
}
|
|
2211
|
-
return { minlength: { 'zh-cn': `最大值为 ${maxvalue}` } };
|
|
2212
|
-
};
|
|
2213
|
-
}
|
|
2214
|
-
static pattern(pattern) {
|
|
2215
|
-
const validator = Validators.pattern(pattern);
|
|
2216
|
-
return (control) => {
|
|
2217
|
-
if (validator(control) === null) {
|
|
2218
|
-
return null;
|
|
2219
|
-
}
|
|
2220
|
-
return { pattern: { 'zh-cn': "输入不正确" } };
|
|
2221
|
-
};
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
class BaseDesignSetting {
|
|
2226
|
-
element;
|
|
2227
|
-
constructor(element) {
|
|
2228
|
-
this.element = element;
|
|
2229
|
-
}
|
|
2230
|
-
showLine = signal(false, ...(ngDevMode ? [{ debugName: "showLine" }] : []));
|
|
2231
|
-
scopeId = input(...(ngDevMode ? [undefined, { debugName: "scopeId" }] : []));
|
|
2232
|
-
exclude = input([], ...(ngDevMode ? [{ debugName: "exclude" }] : []));
|
|
2233
|
-
allPermissions = Object.entries(inject(AXIS_DESIGN_ALL_PERMISSIONS_TOKEN));
|
|
2234
|
-
fg = input.required(...(ngDevMode ? [{ debugName: "fg" }] : []));
|
|
2235
|
-
ngAfterViewInit() {
|
|
2236
|
-
if (this.element.nativeElement.nextElementSibling) {
|
|
2237
|
-
this.showLine.set(true);
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BaseDesignSetting, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2241
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: BaseDesignSetting, isStandalone: true, selector: "axis-base-design-setting", inputs: { scopeId: { classPropertyName: "scopeId", publicName: "scopeId", isSignal: true, isRequired: false, transformFunction: null }, exclude: { classPropertyName: "exclude", publicName: "exclude", isSignal: true, isRequired: false, transformFunction: null }, fg: { classPropertyName: "fg", publicName: "fg", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<form [formGroup]=\"fg()\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u901A\u7528\u8BBE\u7F6E\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7EC4\u4EF6ID\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <input nz-input formControlName=\"id\" />\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u542F\u7528\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"inuse\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u6743\u9650\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <nz-select nzMode=\"multiple\" nzAllowClear formControlName=\"requiredPermissions\">\n @for (en of allPermissions; track en[0]) {\n <nz-option [nzLabel]=\"en[1]\" [nzValue]=\"en[0]\"></nz-option>\n }\n </nz-select>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u6837\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"style\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i1$2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i1$2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i4$3.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2242
|
-
}
|
|
2243
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: BaseDesignSetting, decorators: [{
|
|
2244
|
-
type: Component,
|
|
2245
|
-
args: [{ selector: 'axis-base-design-setting', imports: [NzCollapseModule, NzFormModule, FunField, NzSwitchModule, FormsModule, NzInputModule, ReactiveFormsModule, DynamicDirective, NzSelectModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg()\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u901A\u7528\u8BBE\u7F6E\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7EC4\u4EF6ID\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <input nz-input formControlName=\"id\" />\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u542F\u7528\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"inuse\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u6743\u9650\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <nz-select nzMode=\"multiple\" nzAllowClear formControlName=\"requiredPermissions\">\n @for (en of allPermissions; track en[0]) {\n <nz-option [nzLabel]=\"en[1]\" [nzValue]=\"en[0]\"></nz-option>\n }\n </nz-select>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u6837\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"style\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n </nz-collapse>\n</form>" }]
|
|
2246
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
2247
|
-
const baseFbConfig = {
|
|
2248
|
-
id: [undefined, [FormValidators.required]],
|
|
2249
|
-
inuse: [undefined, [FormValidators.requiredFun]],
|
|
2250
|
-
requiredPermissions: [],
|
|
2251
|
-
style: [],
|
|
2252
|
-
triggeEvents: []
|
|
2253
|
-
};
|
|
2254
|
-
const baseFunField = {
|
|
2255
|
-
inuse: {
|
|
2256
|
-
defaultValue: true
|
|
2257
|
-
},
|
|
2258
|
-
style: {
|
|
2259
|
-
defaultValue: undefined
|
|
2260
|
-
}
|
|
2261
|
-
};
|
|
2262
|
-
|
|
2263
|
-
class ApiHandler extends FunFieldValueBase {
|
|
2264
|
-
noListen = inject(InputTrigger).noListen;
|
|
2265
|
-
fg = this.fb.group({
|
|
2266
|
-
url: [undefined, FormValidators.requiredFun],
|
|
2267
|
-
method: [undefined, FormValidators.requiredFun],
|
|
2268
|
-
body: [],
|
|
2269
|
-
});
|
|
2270
|
-
funFields = {
|
|
2271
|
-
url: {
|
|
2272
|
-
defaultValue: "",
|
|
2273
|
-
},
|
|
2274
|
-
method: {
|
|
2275
|
-
defaultValue: "get"
|
|
2276
|
-
},
|
|
2277
|
-
body: {
|
|
2278
|
-
defaultValue: undefined
|
|
2279
|
-
},
|
|
2280
|
-
};
|
|
2281
|
-
successTipMode = signal(undefined, ...(ngDevMode ? [{ debugName: "successTipMode" }] : []));
|
|
2282
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ApiHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2283
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: ApiHandler, isStandalone: true, selector: "axis-api-handler", providers: [
|
|
2284
|
-
{
|
|
2285
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2286
|
-
useExisting: forwardRef(() => ApiHandler),
|
|
2287
|
-
multi: true
|
|
2288
|
-
}
|
|
2289
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u5730\u5740\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"url\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u8BF7\u6C42\u65B9\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"method\" [noListen]=\"noListen()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\">\n <nz-option nzValue=\"get\" nzLabel=\"GET\"></nz-option>\n <nz-option nzValue=\"post\" nzLabel=\"POST\"></nz-option>\n <nz-option nzValue=\"put\" nzLabel=\"PUT\"></nz-option>\n <nz-option nzValue=\"delete\" nzLabel=\"DELETE\"></nz-option>\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u8BF7\u6C42\u6570\u636E\u4F53\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"body\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "ngmodule", type: NzRadioModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2290
|
-
}
|
|
2291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ApiHandler, decorators: [{
|
|
2292
|
-
type: Component,
|
|
2293
|
-
args: [{ selector: 'axis-api-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2294
|
-
{
|
|
2295
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2296
|
-
useExisting: forwardRef(() => ApiHandler),
|
|
2297
|
-
multi: true
|
|
2298
|
-
}
|
|
2299
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u5730\u5740\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"url\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u8BF7\u6C42\u65B9\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"method\" [noListen]=\"noListen()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\">\n <nz-option nzValue=\"get\" nzLabel=\"GET\"></nz-option>\n <nz-option nzValue=\"post\" nzLabel=\"POST\"></nz-option>\n <nz-option nzValue=\"put\" nzLabel=\"PUT\"></nz-option>\n <nz-option nzValue=\"delete\" nzLabel=\"DELETE\"></nz-option>\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u8BF7\u6C42\u6570\u636E\u4F53\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"body\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
2300
|
-
}] });
|
|
2301
|
-
|
|
2302
|
-
class FilterOptions {
|
|
2303
|
-
constructor() {
|
|
2304
|
-
effect(() => {
|
|
2305
|
-
this.onChange?.(this.formValue()?.filters);
|
|
2306
|
-
});
|
|
2307
|
-
}
|
|
2308
|
-
onChange;
|
|
2309
|
-
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
2310
|
-
writeValue(v) {
|
|
2311
|
-
this.value.set(v);
|
|
2312
|
-
if (v?.length) {
|
|
2313
|
-
v.forEach((r) => {
|
|
2314
|
-
this.createFilter();
|
|
2315
|
-
r.effectFields?.forEach((f) => {
|
|
2316
|
-
if (!this.sourceDataChooseFields().includes(f) && !this.addFields().includes(f)) {
|
|
2317
|
-
this.addFields.set([...this.addFields(), f]);
|
|
2318
|
-
}
|
|
2319
|
-
});
|
|
2320
|
-
});
|
|
2321
|
-
}
|
|
2322
|
-
this.fg.reset({
|
|
2323
|
-
filters: v
|
|
2324
|
-
});
|
|
2325
|
-
}
|
|
2326
|
-
registerOnChange(fn) {
|
|
2327
|
-
this.onChange = fn;
|
|
2328
|
-
}
|
|
2329
|
-
registerOnTouched(fn) {
|
|
2330
|
-
}
|
|
2331
|
-
sourceDataFields = input([], ...(ngDevMode ? [{ debugName: "sourceDataFields" }] : []));
|
|
2332
|
-
sourceDataChooseFields = computed(() => this.sourceDataFields().concat(this.addFields()), ...(ngDevMode ? [{ debugName: "sourceDataChooseFields" }] : []));
|
|
2333
|
-
filterDataFields = input([], ...(ngDevMode ? [{ debugName: "filterDataFields" }] : []));
|
|
2334
|
-
addFields = signal([], ...(ngDevMode ? [{ debugName: "addFields" }] : []));
|
|
2335
|
-
fb = inject(FormBuilder);
|
|
2336
|
-
fg = this.fb.group({
|
|
2337
|
-
filters: this.fb.array([])
|
|
2338
|
-
});
|
|
2339
|
-
formValue = toSignal(this.fg.valueChanges);
|
|
2340
|
-
currentEffectFieldsControl;
|
|
2341
|
-
get fa() {
|
|
2342
|
-
return this.fg.get("filters");
|
|
2343
|
-
}
|
|
2344
|
-
;
|
|
2345
|
-
createFilter() {
|
|
2346
|
-
this.fa.push(this.fb.group({
|
|
2347
|
-
field: [undefined, FormValidators.required],
|
|
2348
|
-
mode: ["equals", FormValidators.required],
|
|
2349
|
-
effectFields: [[], FormValidators.required],
|
|
2350
|
-
}));
|
|
2351
|
-
}
|
|
2352
|
-
deleteFilter(i) {
|
|
2353
|
-
this.fa.removeAt(i);
|
|
2354
|
-
}
|
|
2355
|
-
addField(field) {
|
|
2356
|
-
if (!this.sourceDataChooseFields().includes(field)) {
|
|
2357
|
-
this.addFields.set([...this.addFields(), field]);
|
|
2358
|
-
if (this.currentEffectFieldsControl) {
|
|
2359
|
-
this.currentEffectFieldsControl.patchValue({ effectFields: [...this.currentEffectFieldsControl.value.effectFields, field] });
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FilterOptions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: FilterOptions, isStandalone: true, selector: "axis-design-filter-options", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, sourceDataFields: { classPropertyName: "sourceDataFields", publicName: "sourceDataFields", isSignal: true, isRequired: false, transformFunction: null }, filterDataFields: { classPropertyName: "filterDataFields", publicName: "filterDataFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
2365
|
-
{
|
|
2366
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2367
|
-
useExisting: forwardRef(() => FilterOptions),
|
|
2368
|
-
multi: true
|
|
2369
|
-
}
|
|
2370
|
-
], ngImport: i0, template: "<form [formGroup]=\"fg\">\n <ng-container formArrayName=\"filters\">\n @for (c of fa.controls; track $index;let index=$index;) {\n <div class=\"item\" [formGroupName]=\"index\">\n <div nz-flex nzJustify=\"space-between\">\n <h4>\u6761\u4EF6{{index+1}}:</h4>\n <a nz-button nzType=\"link\" nzSize=\"small\" nzDanger (click)=\"deleteFilter(index)\"><i nz-icon\n nzType=\"delete\" nzTheme=\"outline\"></i></a>\n </div>\n <div>\n <span>\u4F7F\u7528</span>\n <input nz-input nzVariant=\"underlined\" placeholder=\"\u9009\u62E9\u5B57\u6BB5\" style=\"width: 100px;\" nzSize=\"small\"\n [nzAutocomplete]=\"filterDataFieldsAuto\" formControlName=\"field\" />\n <span>\u5B57\u6BB5\u5E76\u901A\u8FC7</span>\n <nz-select style=\"width: 103px;\" nzVariant=\"underlined\" formControlName=\"mode\" nzSize=\"small\">\n <nz-option nzValue=\"equals\" nzLabel=\"\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"startsWith\" nzLabel=\"\u5934\u90E8\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"endsWith\" nzLabel=\"\u5C3E\u90E8\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"like\" nzLabel=\"\u6A21\u7CCA\u5339\u914D\"></nz-option>\n <nz-option nzValue=\"equalGreater\" nzLabel=\"\u5927\u4E8E\u7B49\u4E8E\"></nz-option>\n <nz-option nzValue=\"equalLess\" nzLabel=\"\u5C0F\u4E8E\u7B49\u4E8E\"></nz-option>\n <nz-option nzValue=\"between\" nzLabel=\"\u4E24\u8005\u4E4B\u95F4\"></nz-option>\n <nz-option nzValue=\"containAll\" nzLabel=\"\u5305\u542B\u6240\u6709\"></nz-option>\n <nz-option nzValue=\"containAny\" nzLabel=\"\u5305\u542B\u4EFB\u610F\"></nz-option>\n </nz-select>\n <span>\u7684\u65B9\u5F0F\u5339\u914D\u4EE5\u4E0B\u5B57\u6BB5:</span>\n <nz-select formControlName=\"effectFields\" style=\"min-width: 120px;\" nzSize=\"small\" nzMode=\"multiple\"\n nzVariant=\"underlined\" nzShowSearch nzAllowClear [nzDropdownRender]=\"renderTemplate\"\n nzPlaceHolder=\"\u9009\u62E9\u5B57\u6BB5\" (nzOpenChange)=\"$event && currentEffectFieldsControl=c\">\n @for (f of sourceDataChooseFields(); track f) {\n <nz-option [nzLabel]=\"f\" [nzValue]=\"f\"></nz-option>\n }\n </nz-select>\n </div>\n </div>\n }\n </ng-container>\n</form>\n<ng-template #renderTemplate>\n <div nz-flex nzGap=\"4px\" style=\"padding: 0 10px;\">\n <input type=\"text\" nz-input nzSize=\"small\" placeholder=\"\u5176\u4ED6\u5B57\u6BB5\" #inputElement />\n <a (click)=\"addField(inputElement.value);inputElement.value=''\">\n <nz-icon nzType=\"plus\" />\n </a>\n </div>\n</ng-template>\n<nz-autocomplete #filterDataFieldsAuto nzBackfill [nzWidth]=\"120\">\n @for (f of filterDataFields(); track f) {\n <nz-auto-option [nzLabel]=\"f\" [nzValue]=\"f\">\n {{f}}\n </nz-auto-option>\n }\n</nz-autocomplete>\n<a nz-button nzType=\"link\" (click)=\"createFilter()\">\n <i nz-icon nzType=\"plus\" nzTheme=\"outline\"></i>\n \u6DFB\u52A0\u8FC7\u6EE4\u6761\u4EF6\n</a>", styles: [".item{border:1px dashed rgba(150,150,150,.5);padding:10px;margin-bottom:10px}.desc{font-size:11px}.editable-tag{border-style:dashed;cursor:pointer}nz-tag{margin-top:2px;margin-bottom:2px}\n"], dependencies: [{ kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzAutocompleteModule }, { kind: "component", type: i5.NzAutocompleteComponent, selector: "nz-autocomplete", inputs: ["nzWidth", "nzOverlayClassName", "nzOverlayStyle", "nzDefaultActiveFirstOption", "nzBackfill", "compareWith", "nzDataSource"], outputs: ["selectionChange"], exportAs: ["nzAutocomplete"] }, { kind: "component", type: i5.NzAutocompleteOptionComponent, selector: "nz-auto-option", inputs: ["nzValue", "nzLabel", "nzDisabled"], outputs: ["selectionChange", "mouseEntered"], exportAs: ["nzAutoOption"] }, { kind: "directive", type: i5.NzAutocompleteTriggerDirective, selector: "input[nzAutocomplete], textarea[nzAutocomplete]", inputs: ["nzAutocomplete"], exportAs: ["nzAutocompleteTrigger"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i3$2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "ngmodule", type: NzTagModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }, { kind: "ngmodule", type: NzDividerModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2371
|
-
}
|
|
2372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: FilterOptions, decorators: [{
|
|
2373
|
-
type: Component,
|
|
2374
|
-
args: [{ selector: 'axis-design-filter-options', imports: [NzSelectModule, NzButtonModule, NzInputModule, NzAutocompleteModule, ReactiveFormsModule, NzTagModule, NzIconModule, NzFlexModule, NzDividerModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2375
|
-
{
|
|
2376
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2377
|
-
useExisting: forwardRef(() => FilterOptions),
|
|
2378
|
-
multi: true
|
|
2379
|
-
}
|
|
2380
|
-
], template: "<form [formGroup]=\"fg\">\n <ng-container formArrayName=\"filters\">\n @for (c of fa.controls; track $index;let index=$index;) {\n <div class=\"item\" [formGroupName]=\"index\">\n <div nz-flex nzJustify=\"space-between\">\n <h4>\u6761\u4EF6{{index+1}}:</h4>\n <a nz-button nzType=\"link\" nzSize=\"small\" nzDanger (click)=\"deleteFilter(index)\"><i nz-icon\n nzType=\"delete\" nzTheme=\"outline\"></i></a>\n </div>\n <div>\n <span>\u4F7F\u7528</span>\n <input nz-input nzVariant=\"underlined\" placeholder=\"\u9009\u62E9\u5B57\u6BB5\" style=\"width: 100px;\" nzSize=\"small\"\n [nzAutocomplete]=\"filterDataFieldsAuto\" formControlName=\"field\" />\n <span>\u5B57\u6BB5\u5E76\u901A\u8FC7</span>\n <nz-select style=\"width: 103px;\" nzVariant=\"underlined\" formControlName=\"mode\" nzSize=\"small\">\n <nz-option nzValue=\"equals\" nzLabel=\"\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"startsWith\" nzLabel=\"\u5934\u90E8\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"endsWith\" nzLabel=\"\u5C3E\u90E8\u76F8\u7B49\"></nz-option>\n <nz-option nzValue=\"like\" nzLabel=\"\u6A21\u7CCA\u5339\u914D\"></nz-option>\n <nz-option nzValue=\"equalGreater\" nzLabel=\"\u5927\u4E8E\u7B49\u4E8E\"></nz-option>\n <nz-option nzValue=\"equalLess\" nzLabel=\"\u5C0F\u4E8E\u7B49\u4E8E\"></nz-option>\n <nz-option nzValue=\"between\" nzLabel=\"\u4E24\u8005\u4E4B\u95F4\"></nz-option>\n <nz-option nzValue=\"containAll\" nzLabel=\"\u5305\u542B\u6240\u6709\"></nz-option>\n <nz-option nzValue=\"containAny\" nzLabel=\"\u5305\u542B\u4EFB\u610F\"></nz-option>\n </nz-select>\n <span>\u7684\u65B9\u5F0F\u5339\u914D\u4EE5\u4E0B\u5B57\u6BB5:</span>\n <nz-select formControlName=\"effectFields\" style=\"min-width: 120px;\" nzSize=\"small\" nzMode=\"multiple\"\n nzVariant=\"underlined\" nzShowSearch nzAllowClear [nzDropdownRender]=\"renderTemplate\"\n nzPlaceHolder=\"\u9009\u62E9\u5B57\u6BB5\" (nzOpenChange)=\"$event && currentEffectFieldsControl=c\">\n @for (f of sourceDataChooseFields(); track f) {\n <nz-option [nzLabel]=\"f\" [nzValue]=\"f\"></nz-option>\n }\n </nz-select>\n </div>\n </div>\n }\n </ng-container>\n</form>\n<ng-template #renderTemplate>\n <div nz-flex nzGap=\"4px\" style=\"padding: 0 10px;\">\n <input type=\"text\" nz-input nzSize=\"small\" placeholder=\"\u5176\u4ED6\u5B57\u6BB5\" #inputElement />\n <a (click)=\"addField(inputElement.value);inputElement.value=''\">\n <nz-icon nzType=\"plus\" />\n </a>\n </div>\n</ng-template>\n<nz-autocomplete #filterDataFieldsAuto nzBackfill [nzWidth]=\"120\">\n @for (f of filterDataFields(); track f) {\n <nz-auto-option [nzLabel]=\"f\" [nzValue]=\"f\">\n {{f}}\n </nz-auto-option>\n }\n</nz-autocomplete>\n<a nz-button nzType=\"link\" (click)=\"createFilter()\">\n <i nz-icon nzType=\"plus\" nzTheme=\"outline\"></i>\n \u6DFB\u52A0\u8FC7\u6EE4\u6761\u4EF6\n</a>", styles: [".item{border:1px dashed rgba(150,150,150,.5);padding:10px;margin-bottom:10px}.desc{font-size:11px}.editable-tag{border-style:dashed;cursor:pointer}nz-tag{margin-top:2px;margin-bottom:2px}\n"] }]
|
|
2381
|
-
}], ctorParameters: () => [] });
|
|
2382
|
-
|
|
2383
|
-
class ArrayFilterHandler extends FunFieldValueBase {
|
|
2384
|
-
noListen = inject(InputTrigger).noListen;
|
|
2385
|
-
fg = this.fb.group({
|
|
2386
|
-
inputArray: [],
|
|
2387
|
-
filterData: [],
|
|
2388
|
-
filterOptions: [],
|
|
2389
|
-
});
|
|
2390
|
-
funFields = {
|
|
2391
|
-
inputArray: {
|
|
2392
|
-
defaultValue: undefined,
|
|
2393
|
-
},
|
|
2394
|
-
filterData: {
|
|
2395
|
-
defaultValue: undefined,
|
|
2396
|
-
},
|
|
2397
|
-
};
|
|
2398
|
-
sourceDataFunField;
|
|
2399
|
-
filterDataFunField;
|
|
2400
|
-
sourceDataFields = computed(() => this.buildSourceDataFields(), ...(ngDevMode ? [{ debugName: "sourceDataFields" }] : []));
|
|
2401
|
-
filterDataFields = computed(() => this.buildfilterDataFields(), ...(ngDevMode ? [{ debugName: "filterDataFields" }] : []));
|
|
2402
|
-
buildSourceDataFields() {
|
|
2403
|
-
const sourceData = this.sourceDataFunField.computeResult();
|
|
2404
|
-
if (sourceData?.length) {
|
|
2405
|
-
return Object.keys(sourceData[0]);
|
|
2406
|
-
}
|
|
2407
|
-
return [];
|
|
2408
|
-
}
|
|
2409
|
-
buildfilterDataFields() {
|
|
2410
|
-
return Object.keys(this.filterDataFunField.computeResult() ?? {});
|
|
2411
|
-
}
|
|
2412
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ArrayFilterHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2413
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: ArrayFilterHandler, isStandalone: true, selector: "axis-array-filter-handler", providers: [
|
|
2414
|
-
{
|
|
2415
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2416
|
-
useExisting: forwardRef(() => ArrayFilterHandler),
|
|
2417
|
-
multi: true
|
|
2418
|
-
}
|
|
2419
|
-
], viewQueries: [{ propertyName: "sourceDataFunField", first: true, predicate: ["sourceDataFunField"], descendants: true, static: true }, { propertyName: "filterDataFunField", first: true, predicate: ["filterDataFunField"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u539F\u6570\u7EC4\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"inputArray\" [noListen]=\"noListen()\" #sourceDataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u8FC7\u6EE4\u5BF9\u8C61\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"filterData\" [noListen]=\"noListen()\" #filterDataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <axis-design-filter-options [sourceDataFields]=\"sourceDataFields()\" [filterDataFields]=\"filterDataFields()\"\n formControlName=\"filterOptions\"></axis-design-filter-options>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: FilterOptions, selector: "axis-design-filter-options", inputs: ["value", "sourceDataFields", "filterDataFields"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2420
|
-
}
|
|
2421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ArrayFilterHandler, decorators: [{
|
|
2422
|
-
type: Component,
|
|
2423
|
-
args: [{ selector: 'axis-array-filter-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule, FilterOptions], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2424
|
-
{
|
|
2425
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2426
|
-
useExisting: forwardRef(() => ArrayFilterHandler),
|
|
2427
|
-
multi: true
|
|
2428
|
-
}
|
|
2429
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u539F\u6570\u7EC4\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"inputArray\" [noListen]=\"noListen()\" #sourceDataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u8FC7\u6EE4\u5BF9\u8C61\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"filterData\" [noListen]=\"noListen()\" #filterDataFunField>\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <axis-design-filter-options [sourceDataFields]=\"sourceDataFields()\" [filterDataFields]=\"filterDataFields()\"\n formControlName=\"filterOptions\"></axis-design-filter-options>\n</form>" }]
|
|
2430
|
-
}], propDecorators: { sourceDataFunField: [{
|
|
2431
|
-
type: ViewChild,
|
|
2432
|
-
args: ["sourceDataFunField", { static: true }]
|
|
2433
|
-
}], filterDataFunField: [{
|
|
2434
|
-
type: ViewChild,
|
|
2435
|
-
args: ["filterDataFunField", { static: true }]
|
|
2436
|
-
}] } });
|
|
2437
|
-
|
|
2438
|
-
class DataHandler extends FunFieldValueBase {
|
|
2439
|
-
noListen = inject(InputTrigger).noListen;
|
|
2440
|
-
fg = this.fb.group({
|
|
2441
|
-
data: [],
|
|
2442
|
-
});
|
|
2443
|
-
funFields = {
|
|
2444
|
-
data: {
|
|
2445
|
-
defaultValue: null,
|
|
2446
|
-
},
|
|
2447
|
-
};
|
|
2448
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DataHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2449
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: DataHandler, isStandalone: true, selector: "axis-data-handler", providers: [
|
|
2450
|
-
{
|
|
2451
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2452
|
-
useExisting: forwardRef(() => DataHandler),
|
|
2453
|
-
multi: true
|
|
2454
|
-
}
|
|
2455
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6570\u636E\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"data\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "ngmodule", type: NzRadioModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2456
|
-
}
|
|
2457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DataHandler, decorators: [{
|
|
2458
|
-
type: Component,
|
|
2459
|
-
args: [{ selector: 'axis-data-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2460
|
-
{
|
|
2461
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2462
|
-
useExisting: forwardRef(() => DataHandler),
|
|
2463
|
-
multi: true
|
|
2464
|
-
}
|
|
2465
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\">\n \u6570\u636E\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"data\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
2466
|
-
}] });
|
|
2467
|
-
|
|
2468
|
-
class MsgTipHandler extends FunFieldValueBase {
|
|
2469
|
-
noListen = inject(InputTrigger).noListen;
|
|
2470
|
-
fg = this.fb.group({
|
|
2471
|
-
tipWay: [undefined, FormValidators.requiredFun],
|
|
2472
|
-
type: [undefined, FormValidators.requiredFun],
|
|
2473
|
-
content: [undefined, FormValidators.requiredFun],
|
|
2474
|
-
});
|
|
2475
|
-
funFields = {
|
|
2476
|
-
tipWay: {
|
|
2477
|
-
defaultValue: "message",
|
|
2478
|
-
},
|
|
2479
|
-
type: {
|
|
2480
|
-
defaultValue: "info",
|
|
2481
|
-
},
|
|
2482
|
-
content: {
|
|
2483
|
-
defaultValue: undefined,
|
|
2484
|
-
},
|
|
2485
|
-
};
|
|
2486
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MsgTipHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2487
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: MsgTipHandler, isStandalone: true, selector: "axis-msg-tip-handler", providers: [
|
|
2488
|
-
{
|
|
2489
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2490
|
-
useExisting: forwardRef(() => MsgTipHandler),
|
|
2491
|
-
multi: true
|
|
2492
|
-
}
|
|
2493
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u63D0\u9192\u65B9\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"tipWay\" [noListen]=\"noListen()\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\">\n <label nz-radio-button nzValue=\"message\">\u6D88\u606F</label>\n <label nz-radio-button nzValue=\"modal\">\u5F39\u7A97</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6D88\u606F\u7C7B\u578B\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"type\" [noListen]=\"noListen()\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"info\">\u63D0\u9192</label>\n <label nz-radio-button nzValue=\"success\">\u6210\u529F</label>\n <label nz-radio-button nzValue=\"warning\">\u8B66\u544A</label>\n <label nz-radio-button nzValue=\"error\">\u9519\u8BEF</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6D88\u606F\u5185\u5BB9\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"content\" [noListen]=\"noListen()\">\n <textarea nz-input ngModel [ngModelOptions]=\"{standalone:true}\"></textarea>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i5$1.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i5$1.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2494
|
-
}
|
|
2495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: MsgTipHandler, decorators: [{
|
|
2496
|
-
type: Component,
|
|
2497
|
-
args: [{ selector: 'axis-msg-tip-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, NzInputModule, NzRadioModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2498
|
-
{
|
|
2499
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2500
|
-
useExisting: forwardRef(() => MsgTipHandler),
|
|
2501
|
-
multi: true
|
|
2502
|
-
}
|
|
2503
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u63D0\u9192\u65B9\u5F0F\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"tipWay\" [noListen]=\"noListen()\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\">\n <label nz-radio-button nzValue=\"message\">\u6D88\u606F</label>\n <label nz-radio-button nzValue=\"modal\">\u5F39\u7A97</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6D88\u606F\u7C7B\u578B\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"type\" [noListen]=\"noListen()\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"info\">\u63D0\u9192</label>\n <label nz-radio-button nzValue=\"success\">\u6210\u529F</label>\n <label nz-radio-button nzValue=\"warning\">\u8B66\u544A</label>\n <label nz-radio-button nzValue=\"error\">\u9519\u8BEF</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6D88\u606F\u5185\u5BB9\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"content\" [noListen]=\"noListen()\">\n <textarea nz-input ngModel [ngModelOptions]=\"{standalone:true}\"></textarea>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
2504
|
-
}] });
|
|
2505
|
-
|
|
2506
|
-
class RefreshDataSourceHandler extends FunFieldValueBase {
|
|
2507
|
-
fg = this.fb.group({
|
|
2508
|
-
name: [undefined, FormValidators.requiredFun],
|
|
2509
|
-
setNull: [undefined, FormValidators.requiredFun],
|
|
2510
|
-
});
|
|
2511
|
-
funFields = {
|
|
2512
|
-
name: {
|
|
2513
|
-
defaultValue: null,
|
|
2514
|
-
},
|
|
2515
|
-
setNull: {
|
|
2516
|
-
defaultValue: false,
|
|
2517
|
-
},
|
|
2518
|
-
};
|
|
2519
|
-
inputTrigger = inject(InputTrigger);
|
|
2520
|
-
noListen = this.inputTrigger.noListen;
|
|
2521
|
-
getScopeInfos = inject(AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN);
|
|
2522
|
-
scopeDsNames = toSignal(this.inputTrigger.fg.valueChanges.pipe(mergeWith(of(this.inputTrigger.fg.value)), filter(v => v.id?.funMode === false), map(v => v.id.originValue), switchMap(scopeId => this.getScopeInfos(scopeId)
|
|
2523
|
-
.pipe(map(sis => Object.keys(scopeId ? sis.find(s => s.scopeId == scopeId)?.ds : sis[0]?.ds))))));
|
|
2524
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: RefreshDataSourceHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2525
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: RefreshDataSourceHandler, isStandalone: true, selector: "axis-refresh-data-source-handler", providers: [
|
|
2526
|
-
{
|
|
2527
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2528
|
-
useExisting: forwardRef(() => RefreshDataSourceHandler),
|
|
2529
|
-
multi: true
|
|
2530
|
-
}
|
|
2531
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6570\u636E\u6E90\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"name\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" [nzAutocomplete]=\"dsAuto\" />\n <nz-autocomplete #dsAuto nzBackfill>\n @for (name of scopeDsNames()??[]; track name) {\n <nz-auto-option [nzLabel]=\"name\" [nzValue]=\"name\">\n {{name}}\n </nz-auto-option>\n }\n </nz-autocomplete>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u5237\u65B0\u524D\u6E05\u7A7A\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"setNull\" [noListen]=\"noListen()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i4$3.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "ngmodule", type: NzAutocompleteModule }, { kind: "component", type: i5.NzAutocompleteComponent, selector: "nz-autocomplete", inputs: ["nzWidth", "nzOverlayClassName", "nzOverlayStyle", "nzDefaultActiveFirstOption", "nzBackfill", "compareWith", "nzDataSource"], outputs: ["selectionChange"], exportAs: ["nzAutocomplete"] }, { kind: "component", type: i5.NzAutocompleteOptionComponent, selector: "nz-auto-option", inputs: ["nzValue", "nzLabel", "nzDisabled"], outputs: ["selectionChange", "mouseEntered"], exportAs: ["nzAutoOption"] }, { kind: "directive", type: i5.NzAutocompleteTriggerDirective, selector: "input[nzAutocomplete], textarea[nzAutocomplete]", inputs: ["nzAutocomplete"], exportAs: ["nzAutocompleteTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2532
|
-
}
|
|
2533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: RefreshDataSourceHandler, decorators: [{
|
|
2534
|
-
type: Component,
|
|
2535
|
-
args: [{ selector: 'axis-refresh-data-source-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, NzInputModule, NzSwitchModule, NzRadioModule, NzAutocompleteModule, NzSwitchModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2536
|
-
{
|
|
2537
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2538
|
-
useExisting: forwardRef(() => RefreshDataSourceHandler),
|
|
2539
|
-
multi: true
|
|
2540
|
-
}
|
|
2541
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u6570\u636E\u6E90\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"name\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" [nzAutocomplete]=\"dsAuto\" />\n <nz-autocomplete #dsAuto nzBackfill>\n @for (name of scopeDsNames()??[]; track name) {\n <nz-auto-option [nzLabel]=\"name\" [nzValue]=\"name\">\n {{name}}\n </nz-auto-option>\n }\n </nz-autocomplete>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"6\" nzRequired>\n \u5237\u65B0\u524D\u6E05\u7A7A\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"setNull\" [noListen]=\"noListen()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
2542
|
-
}] });
|
|
2543
|
-
|
|
2544
|
-
class RouteHandler extends FunFieldValueBase {
|
|
2545
|
-
noListen = inject(InputTrigger).noListen;
|
|
2546
|
-
fg = this.fb.group({
|
|
2547
|
-
type: [undefined, FormValidators.requiredFun],
|
|
2548
|
-
newtab: [undefined, FormValidators.requiredFun],
|
|
2549
|
-
path: [undefined, FormValidators.requiredFun],
|
|
2550
|
-
params: [],
|
|
2551
|
-
});
|
|
2552
|
-
funFields = {
|
|
2553
|
-
type: {
|
|
2554
|
-
defaultValue: "web",
|
|
2555
|
-
},
|
|
2556
|
-
newtab: {
|
|
2557
|
-
defaultValue: false,
|
|
2558
|
-
},
|
|
2559
|
-
path: {
|
|
2560
|
-
defaultValue: undefined,
|
|
2561
|
-
},
|
|
2562
|
-
params: {
|
|
2563
|
-
defaultValue: undefined,
|
|
2564
|
-
},
|
|
2565
|
-
};
|
|
2566
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: RouteHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2567
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: RouteHandler, isStandalone: true, selector: "axis-route-handler", providers: [
|
|
2568
|
-
{
|
|
2569
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2570
|
-
useExisting: forwardRef(() => RouteHandler),
|
|
2571
|
-
multi: true
|
|
2572
|
-
}
|
|
2573
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u6253\u5F00\u7C7B\u578B\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"type\" [noListen]=\"noListen()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\">\n <nz-option nzValue=\"web\" nzLabel=\"\u7F51\u9875\"></nz-option>\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.type?.funMode || formValue()?.type?.originValue == \"web\") {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u65B0\u6D4F\u89C8\u5668\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"newtab\" [noListen]=\"noListen()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u94FE\u63A5\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"path\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.newtab.funMode || !formValue()?.newtab.originValue) {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u53C2\u6570\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"params\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n }\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i4$3.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2574
|
-
}
|
|
2575
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: RouteHandler, decorators: [{
|
|
2576
|
-
type: Component,
|
|
2577
|
-
args: [{ selector: 'axis-route-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, NzInputModule, NzSwitchModule, DynamicDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2578
|
-
{
|
|
2579
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2580
|
-
useExisting: forwardRef(() => RouteHandler),
|
|
2581
|
-
multi: true
|
|
2582
|
-
}
|
|
2583
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u6253\u5F00\u7C7B\u578B\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"type\" [noListen]=\"noListen()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\">\n <nz-option nzValue=\"web\" nzLabel=\"\u7F51\u9875\"></nz-option>\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.type?.funMode || formValue()?.type?.originValue == \"web\") {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u65B0\u6D4F\u89C8\u5668\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"newtab\" [noListen]=\"noListen()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u94FE\u63A5\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"path\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (formValue()?.newtab.funMode || !formValue()?.newtab.originValue) {\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u53C2\u6570\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"params\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n }\n</form>" }]
|
|
2584
|
-
}] });
|
|
2585
|
-
|
|
2586
|
-
class SetDataSourceHandler extends FunFieldValueBase {
|
|
2587
|
-
noListen = inject(InputTrigger).noListen;
|
|
2588
|
-
fg = this.fb.group({
|
|
2589
|
-
name: [undefined, FormValidators.requiredFun],
|
|
2590
|
-
data: [],
|
|
2591
|
-
});
|
|
2592
|
-
funFields = {
|
|
2593
|
-
name: {
|
|
2594
|
-
defaultValue: null,
|
|
2595
|
-
},
|
|
2596
|
-
data: {
|
|
2597
|
-
defaultValue: null,
|
|
2598
|
-
},
|
|
2599
|
-
};
|
|
2600
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SetDataSourceHandler, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2601
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: SetDataSourceHandler, isStandalone: true, selector: "axis-set-data-source-handler", providers: [
|
|
2602
|
-
{
|
|
2603
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2604
|
-
useExisting: forwardRef(() => SetDataSourceHandler),
|
|
2605
|
-
multi: true
|
|
2606
|
-
}
|
|
2607
|
-
], usesInheritance: true, ngImport: i0, template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u6570\u636E\u6E90\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"name\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\">\n \u6570\u636E\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"data\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i4$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "ngmodule", type: NzRadioModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2608
|
-
}
|
|
2609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SetDataSourceHandler, decorators: [{
|
|
2610
|
-
type: Component,
|
|
2611
|
-
args: [{ selector: 'axis-set-data-source-handler', imports: [NzFormModule, ReactiveFormsModule, FunField, FormsModule, NzSelectModule, DynamicDirective, NzInputModule, NzSwitchModule, NzRadioModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2612
|
-
{
|
|
2613
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2614
|
-
useExisting: forwardRef(() => SetDataSourceHandler),
|
|
2615
|
-
multi: true
|
|
2616
|
-
}
|
|
2617
|
-
], template: "<form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\" nzRequired>\n \u6570\u636E\u6E90\u540D\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"name\" [noListen]=\"noListen()\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label [nzSpan]=\"6\">\n \u6570\u636E\n </nz-form-label>\n <nz-form-control nzSpan=\"18\">\n <axis-fun-field formControlName=\"data\" [noListen]=\"noListen()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\" [standalone]=\"true\"\n ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n</form>" }]
|
|
2618
|
-
}] });
|
|
2619
|
-
|
|
2620
|
-
const baseEventHandlerDescs = {
|
|
2621
|
-
api: {
|
|
2622
|
-
name: "api",
|
|
2623
|
-
icon: "api",
|
|
2624
|
-
title: "调用接口",
|
|
2625
|
-
target: "service",
|
|
2626
|
-
dataComponent: ApiHandler,
|
|
2627
|
-
events: [
|
|
2628
|
-
{
|
|
2629
|
-
name: "apiResponse",
|
|
2630
|
-
title: "接口响应",
|
|
2631
|
-
ds: {
|
|
2632
|
-
apiResponse: {
|
|
2633
|
-
tip: "示例数据"
|
|
2634
|
-
}
|
|
2635
|
-
},
|
|
2636
|
-
}
|
|
2637
|
-
]
|
|
2638
|
-
},
|
|
2639
|
-
setDataSource: {
|
|
2640
|
-
name: "setDataSource",
|
|
2641
|
-
title: "设置数据源",
|
|
2642
|
-
icon: "database",
|
|
2643
|
-
dataComponent: SetDataSourceHandler,
|
|
2644
|
-
target: "scope",
|
|
2645
|
-
},
|
|
2646
|
-
refreshDataSource: {
|
|
2647
|
-
name: "refreshDataSource",
|
|
2648
|
-
title: "刷新数据源",
|
|
2649
|
-
icon: "reload",
|
|
2650
|
-
dataComponent: RefreshDataSourceHandler,
|
|
2651
|
-
target: "scope",
|
|
2652
|
-
},
|
|
2653
|
-
setValue: {
|
|
2654
|
-
name: "setValue",
|
|
2655
|
-
title: "设置值",
|
|
2656
|
-
icon: "flag",
|
|
2657
|
-
dataComponent: DataHandler,
|
|
2658
|
-
target: "component",
|
|
2659
|
-
},
|
|
2660
|
-
arrayFilter: {
|
|
2661
|
-
name: "arrayFilter",
|
|
2662
|
-
icon: "filter",
|
|
2663
|
-
title: "数组过滤",
|
|
2664
|
-
target: "service",
|
|
2665
|
-
dataComponent: ArrayFilterHandler,
|
|
2666
|
-
events: [
|
|
2667
|
-
{
|
|
2668
|
-
name: "output",
|
|
2669
|
-
title: "数据输出",
|
|
2670
|
-
ds: {
|
|
2671
|
-
outputArray: [{
|
|
2672
|
-
tip: "示例数据"
|
|
2673
|
-
}]
|
|
2674
|
-
},
|
|
2675
|
-
}
|
|
2676
|
-
]
|
|
2677
|
-
},
|
|
2678
|
-
msgTip: {
|
|
2679
|
-
name: "msgTip",
|
|
2680
|
-
icon: "bell",
|
|
2681
|
-
title: "消息提醒",
|
|
2682
|
-
target: "service",
|
|
2683
|
-
dataComponent: MsgTipHandler
|
|
2684
|
-
},
|
|
2685
|
-
route: {
|
|
2686
|
-
name: "route",
|
|
2687
|
-
icon: "right-square",
|
|
2688
|
-
title: "路由",
|
|
2689
|
-
target: "service",
|
|
2690
|
-
formStyle: {
|
|
2691
|
-
labelSpan: 8
|
|
2692
|
-
},
|
|
2693
|
-
dataComponent: RouteHandler
|
|
2694
|
-
},
|
|
2695
|
-
};
|
|
2696
|
-
const baseEventHandlerDescGroups = [
|
|
2697
|
-
{
|
|
2698
|
-
groupName: "基础",
|
|
2699
|
-
handlerDescs: [
|
|
2700
|
-
baseEventHandlerDescs["api"],
|
|
2701
|
-
baseEventHandlerDescs["setDataSource"],
|
|
2702
|
-
baseEventHandlerDescs["refreshDataSource"],
|
|
2703
|
-
baseEventHandlerDescs["setValue"],
|
|
2704
|
-
baseEventHandlerDescs["arrayFilter"],
|
|
2705
|
-
baseEventHandlerDescs["msgTip"],
|
|
2706
|
-
baseEventHandlerDescs["route"],
|
|
2707
|
-
]
|
|
2708
|
-
}
|
|
2709
|
-
];
|
|
2710
|
-
|
|
2711
|
-
class InputTrigger extends FunFieldBase {
|
|
2712
|
-
element;
|
|
2713
|
-
constructor(element) {
|
|
2714
|
-
super();
|
|
2715
|
-
this.element = element;
|
|
2716
|
-
}
|
|
2717
|
-
fg = this.fb.group({
|
|
2718
|
-
name: [undefined, FormValidators.required],
|
|
2719
|
-
disabled: [undefined, FormValidators.requiredFun],
|
|
2720
|
-
data: [],
|
|
2721
|
-
id: [],
|
|
2722
|
-
});
|
|
2723
|
-
funFields = {
|
|
2724
|
-
disabled: {
|
|
2725
|
-
defaultValue: false
|
|
2726
|
-
},
|
|
2727
|
-
id: {
|
|
2728
|
-
defaultValue: undefined
|
|
2729
|
-
},
|
|
2730
|
-
};
|
|
2731
|
-
onChange;
|
|
2732
|
-
noListen = signal(true, ...(ngDevMode ? [{ debugName: "noListen" }] : []));
|
|
2733
|
-
internalTriggers = input(...(ngDevMode ? [undefined, { debugName: "internalTriggers" }] : []));
|
|
2734
|
-
getScopeInfos = inject(AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN);
|
|
2735
|
-
componentsInfo = inject(AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN);
|
|
2736
|
-
canChooseComponentsInfo = signal([], ...(ngDevMode ? [{ debugName: "canChooseComponentsInfo" }] : []));
|
|
2737
|
-
value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
2738
|
-
nodes = computed(() => this.makeTreeNode(this.buildAllEventDesc(), this.value()), ...(ngDevMode ? [{ debugName: "nodes" }] : []));
|
|
2739
|
-
eventDesc = input(...(ngDevMode ? [undefined, { debugName: "eventDesc" }] : []));
|
|
2740
|
-
allEventDesc = computed(() => this.buildAllEventDesc(), ...(ngDevMode ? [{ debugName: "allEventDesc" }] : []));
|
|
2741
|
-
allEventHanderDescGroups = computed(() => this.buildAllEventHandlerDescGroups(), ...(ngDevMode ? [{ debugName: "allEventHanderDescGroups" }] : []));
|
|
2742
|
-
allEventHanderDescs = computed(() => this.buildAllEventHandlerDescs(), ...(ngDevMode ? [{ debugName: "allEventHanderDescs" }] : []));
|
|
2743
|
-
showLine = signal(false, ...(ngDevMode ? [{ debugName: "showLine" }] : []));
|
|
2744
|
-
isVisibleHandlerModal = model(false, ...(ngDevMode ? [{ debugName: "isVisibleHandlerModal" }] : []));
|
|
2745
|
-
handlerFunFieldScopes = signal([], ...(ngDevMode ? [{ debugName: "handlerFunFieldScopes" }] : []));
|
|
2746
|
-
editEventHandler = model(...(ngDevMode ? [undefined, { debugName: "editEventHandler" }] : []));
|
|
2747
|
-
treeExpandedKeys = signal([], ...(ngDevMode ? [{ debugName: "treeExpandedKeys" }] : []));
|
|
2748
|
-
selectedHandlerDesc = signal(undefined, ...(ngDevMode ? [{ debugName: "selectedHandlerDesc" }] : []));
|
|
2749
|
-
otherHandlerDescs = inject(AXIS_EVENT_HANDLER_DESCS_TOKEN, { optional: true });
|
|
2750
|
-
tree;
|
|
2751
|
-
dataContainer;
|
|
2752
|
-
scopeInfoSubject = computed(() => this.buildScopeInfoSubject(), ...(ngDevMode ? [{ debugName: "scopeInfoSubject" }] : []));
|
|
2753
|
-
editInfo;
|
|
2754
|
-
filterOption = (input, option) => {
|
|
2755
|
-
if (input) {
|
|
2756
|
-
return option.nzValue.includes(input) || option.nzLabel?.toString()?.includes(input);
|
|
2757
|
-
}
|
|
2758
|
-
return false;
|
|
2759
|
-
};
|
|
2760
|
-
writeValue(v) {
|
|
2761
|
-
this.value.set(v);
|
|
2762
|
-
}
|
|
2763
|
-
registerOnChange(fn) {
|
|
2764
|
-
this.onChange = fn;
|
|
2765
|
-
}
|
|
2766
|
-
registerOnTouched(fn) {
|
|
2767
|
-
}
|
|
2768
|
-
ngAfterViewInit() {
|
|
2769
|
-
if (this.element.nativeElement.nextElementSibling) {
|
|
2770
|
-
this.showLine.set(true);
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
onDragStart(e) {
|
|
2774
|
-
if (e.node?.origin["type"] == "event") {
|
|
2775
|
-
e.event?.stopPropagation();
|
|
2776
|
-
e.event?.preventDefault();
|
|
2777
|
-
const ele = e.event?.target;
|
|
2778
|
-
ele.draggable = false;
|
|
2779
|
-
setTimeout(() => {
|
|
2780
|
-
ele.parentElement?.classList.remove("dragging");
|
|
2781
|
-
});
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
|
-
beforeDrop = (e) => {
|
|
2785
|
-
const { dragNode, node, pos } = e;
|
|
2786
|
-
if (dragNode.origin["type"] == "handler" && node.origin["type"] == "handler" && pos != 0 && node.parentNode == dragNode.parentNode) {
|
|
2787
|
-
const dragV = dragNode.origin["value"];
|
|
2788
|
-
const dropV = node.origin["value"];
|
|
2789
|
-
const parentV = node.parentNode?.origin["value"];
|
|
2790
|
-
parentV.splice(parentV.indexOf(dragV), 1);
|
|
2791
|
-
parentV.splice(parentV.indexOf(dropV) + (pos == -1 ? 0 : 1), 0, dragV);
|
|
2792
|
-
this.onValueChange();
|
|
2793
|
-
return of(true);
|
|
2794
|
-
}
|
|
2795
|
-
return of(false);
|
|
2796
|
-
};
|
|
2797
|
-
buildAllEventHandlerDescGroups() {
|
|
2798
|
-
const groups = [
|
|
2799
|
-
...baseEventHandlerDescGroups,
|
|
2800
|
-
...this.otherHandlerDescs ?? [],
|
|
2801
|
-
];
|
|
2802
|
-
this.componentsInfo.forEach(c => {
|
|
2803
|
-
groups.push({
|
|
2804
|
-
groupName: c.componentName,
|
|
2805
|
-
handlerDescs: Array.from(Object.values(c.eventHandlerDescs))
|
|
2806
|
-
});
|
|
2807
|
-
});
|
|
2808
|
-
return groups;
|
|
2809
|
-
}
|
|
2810
|
-
buildAllEventHandlerDescs() {
|
|
2811
|
-
const descs = {
|
|
2812
|
-
...baseEventHandlerDescs
|
|
2813
|
-
};
|
|
2814
|
-
if (this.otherHandlerDescs) {
|
|
2815
|
-
this.otherHandlerDescs.forEach(g => {
|
|
2816
|
-
g.handlerDescs.forEach(d => {
|
|
2817
|
-
descs[d.name] = d;
|
|
2818
|
-
});
|
|
2819
|
-
});
|
|
2820
|
-
}
|
|
2821
|
-
this.componentsInfo.forEach(c => {
|
|
2822
|
-
Object.assign(descs, c.eventHandlerDescs);
|
|
2823
|
-
});
|
|
2824
|
-
return descs;
|
|
2825
|
-
}
|
|
2826
|
-
buildAllEventDesc() {
|
|
2827
|
-
let eventDesc = [];
|
|
2828
|
-
if (this.eventDesc()) {
|
|
2829
|
-
eventDesc = eventDesc.concat(this.eventDesc());
|
|
2830
|
-
}
|
|
2831
|
-
if (this.internalTriggers()) {
|
|
2832
|
-
for (const name of this.internalTriggers()) {
|
|
2833
|
-
switch (name) {
|
|
2834
|
-
case "valueChange":
|
|
2835
|
-
eventDesc.push({
|
|
2836
|
-
name: "valueChange",
|
|
2837
|
-
title: "值变化",
|
|
2838
|
-
ds: {
|
|
2839
|
-
value: "示例数据"
|
|
2840
|
-
}
|
|
2841
|
-
});
|
|
2842
|
-
break;
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
return eventDesc;
|
|
2847
|
-
}
|
|
2848
|
-
makeTreeNode(descs, value, treeNode = [], key = "") {
|
|
2849
|
-
for (const desc of descs) {
|
|
2850
|
-
const node = {
|
|
2851
|
-
...desc,
|
|
2852
|
-
type: "event",
|
|
2853
|
-
key: key + desc.name,
|
|
2854
|
-
isLeaf: !value?.[desc.name]?.length,
|
|
2855
|
-
children: [],
|
|
2856
|
-
selectable: false,
|
|
2857
|
-
value: value?.[desc.name],
|
|
2858
|
-
};
|
|
2859
|
-
if (!node.isLeaf) {
|
|
2860
|
-
for (let i = 0; i < value[desc.name].length; i++) {
|
|
2861
|
-
const handler = value[desc.name][i];
|
|
2862
|
-
const handlerDesc = this.allEventHanderDescs()[handler.name];
|
|
2863
|
-
const handlerNode = {
|
|
2864
|
-
type: "handler",
|
|
2865
|
-
key: key + desc.name + "." + i,
|
|
2866
|
-
selectable: false,
|
|
2867
|
-
isLeaf: !handlerDesc?.events?.length,
|
|
2868
|
-
children: [],
|
|
2869
|
-
title: handler.name,
|
|
2870
|
-
value: handler
|
|
2871
|
-
};
|
|
2872
|
-
if (handlerDesc) {
|
|
2873
|
-
Object.assign(handlerNode, handlerDesc);
|
|
2874
|
-
}
|
|
2875
|
-
if (handlerDesc && !handlerNode.isLeaf) {
|
|
2876
|
-
this.makeTreeNode(handlerDesc.events, handler.triggeEvents, handlerNode.children, handlerNode.key + ".");
|
|
2877
|
-
}
|
|
2878
|
-
node.children.push(handlerNode);
|
|
2879
|
-
}
|
|
2880
|
-
}
|
|
2881
|
-
treeNode.push(node);
|
|
2882
|
-
}
|
|
2883
|
-
return treeNode;
|
|
2884
|
-
}
|
|
2885
|
-
deleteHandler(e) {
|
|
2886
|
-
const parentValue = e.parentNode?.origin["value"];
|
|
2887
|
-
const value = e.origin["value"];
|
|
2888
|
-
if (parentValue && value && parentValue.includes(value)) {
|
|
2889
|
-
parentValue.splice(parentValue.indexOf(value), 1);
|
|
2890
|
-
}
|
|
2891
|
-
this.onValueChange();
|
|
2892
|
-
}
|
|
2893
|
-
onValueChange(value, expandedKey) {
|
|
2894
|
-
this.value.set(value ?? { ...this.value() });
|
|
2895
|
-
this.onChange(this.value());
|
|
2896
|
-
const expandedKeys = this.tree.getExpandedNodeList().map(n => n.key);
|
|
2897
|
-
if (expandedKey) {
|
|
2898
|
-
expandedKeys.push(expandedKey);
|
|
2899
|
-
}
|
|
2900
|
-
this.treeExpandedKeys.set(expandedKeys);
|
|
2901
|
-
}
|
|
2902
|
-
startAddHandler(node) {
|
|
2903
|
-
this.fg.reset(this.buildFunField({}));
|
|
2904
|
-
this.editInfo = {
|
|
2905
|
-
key: node.key,
|
|
2906
|
-
event: node.origin["name"],
|
|
2907
|
-
isAdd: true,
|
|
2908
|
-
parentValue: node.parentNode?.origin["value"],
|
|
2909
|
-
};
|
|
2910
|
-
this.handlerFunFieldScopes.set(this.buildHandlerFunFieldScopes(node));
|
|
2911
|
-
this.noListen.set(node.origin["noListen"] ?? true);
|
|
2912
|
-
this.isVisibleHandlerModal.set(true);
|
|
2913
|
-
}
|
|
2914
|
-
startSetHandler(node) {
|
|
2915
|
-
this.fg.reset(this.buildFunField(node.origin["value"]));
|
|
2916
|
-
this.editInfo = {
|
|
2917
|
-
key: node.key,
|
|
2918
|
-
event: node.parentNode.origin["name"],
|
|
2919
|
-
isAdd: false,
|
|
2920
|
-
value: node.origin["value"],
|
|
2921
|
-
parentValue: node.parentNode?.origin["value"],
|
|
2922
|
-
};
|
|
2923
|
-
this.handlerFunFieldScopes.set(this.buildHandlerFunFieldScopes(node));
|
|
2924
|
-
this.noListen.set(node.parentNode?.origin["noListen"] ?? true);
|
|
2925
|
-
this.isVisibleHandlerModal.set(true);
|
|
2926
|
-
}
|
|
2927
|
-
buildHandlerFunFieldScopes(node, scopes = []) {
|
|
2928
|
-
if (node.origin['type'] == "event" && node?.origin["ds"]) {
|
|
2929
|
-
scopes.push({
|
|
2930
|
-
scopeId: `__handler_scope_${node.key}__`,
|
|
2931
|
-
scopeName: node.title,
|
|
2932
|
-
ds: node?.origin["ds"]
|
|
2933
|
-
});
|
|
2934
|
-
}
|
|
2935
|
-
if (node.parentNode) {
|
|
2936
|
-
this.buildHandlerFunFieldScopes(node.parentNode, scopes);
|
|
2937
|
-
}
|
|
2938
|
-
return scopes;
|
|
2939
|
-
}
|
|
2940
|
-
buildScopeInfoSubject(scopeId) {
|
|
2941
|
-
const scopeInfos = this.getScopeInfos(scopeId);
|
|
2942
|
-
const scopeInfoSubject = new BehaviorSubject(this.handlerFunFieldScopes().concat(scopeInfos.value));
|
|
2943
|
-
scopeInfos.pipe(map(sis => this.handlerFunFieldScopes().concat(sis))).subscribe(scopeInfoSubject);
|
|
2944
|
-
return scopeInfoSubject;
|
|
2945
|
-
}
|
|
2946
|
-
onHandlerChange(name) {
|
|
2947
|
-
if (name && name != this.selectedHandlerDesc()?.name) {
|
|
2948
|
-
const desc = this.allEventHanderDescs()[name];
|
|
2949
|
-
this.selectedHandlerDesc.set(desc);
|
|
2950
|
-
const idCtrl = this.fg.get("id");
|
|
2951
|
-
if (desc.target == "component") {
|
|
2952
|
-
let canChooseComponentsInfo = this.componentsInfo;
|
|
2953
|
-
if (desc.targetComponent) {
|
|
2954
|
-
canChooseComponentsInfo = canChooseComponentsInfo.filter(info => info.component == desc.targetComponent);
|
|
2955
|
-
}
|
|
2956
|
-
this.canChooseComponentsInfo.set(canChooseComponentsInfo);
|
|
2957
|
-
idCtrl.setValidators(FormValidators.requiredFun);
|
|
2958
|
-
}
|
|
2959
|
-
else if (desc.target == "scope") {
|
|
2960
|
-
idCtrl.clearValidators();
|
|
2961
|
-
const scopes = this.scopeInfoSubject().value?.filter(s => s.scopeId.startsWith("__handler_scope__"));
|
|
2962
|
-
if (scopes?.length) {
|
|
2963
|
-
const { funMode, originValue } = idCtrl.value;
|
|
2964
|
-
if (!funMode && !originValue) {
|
|
2965
|
-
this.reset({ id: scopes[0].scopeId });
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
}
|
|
2969
|
-
else {
|
|
2970
|
-
idCtrl.clearValidators();
|
|
2971
|
-
}
|
|
2972
|
-
this.dataContainer?.clear();
|
|
2973
|
-
if (desc.dataComponent) {
|
|
2974
|
-
const injector = Injector.create({
|
|
2975
|
-
providers: [
|
|
2976
|
-
{ provide: AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, useValue: (scopeId) => this.buildScopeInfoSubject(scopeId) },
|
|
2977
|
-
{ provide: InputTrigger, useValue: this }
|
|
2978
|
-
]
|
|
2979
|
-
});
|
|
2980
|
-
const r = this.dataContainer?.createComponent(desc.dataComponent, { injector: injector });
|
|
2981
|
-
r?.instance?.writeValue(this.fg.value?.data);
|
|
2982
|
-
const control = this.fb.control(this.fg.value?.data, [() => {
|
|
2983
|
-
return r?.instance.valid() ? null : {
|
|
2984
|
-
invalid: true
|
|
2985
|
-
};
|
|
2986
|
-
}]);
|
|
2987
|
-
r?.instance.registerOnChange((v) => control.setValue(v));
|
|
2988
|
-
this.fg.setControl('data', control, { emitEvent: false });
|
|
2989
|
-
}
|
|
2990
|
-
}
|
|
2991
|
-
}
|
|
2992
|
-
onSetHandlerOk() {
|
|
2993
|
-
if (updateAndValidAll(this.fg)) {
|
|
2994
|
-
let value = this.value() ?? {};
|
|
2995
|
-
const formValue = this.recoverFunField(this.fg.value);
|
|
2996
|
-
formValue.target = this.selectedHandlerDesc().target;
|
|
2997
|
-
if (this.editInfo?.isAdd) {
|
|
2998
|
-
let array;
|
|
2999
|
-
if (this.editInfo?.parentValue) {
|
|
3000
|
-
if (!this.editInfo.parentValue.triggeEvents?.[this.editInfo.event]) {
|
|
3001
|
-
this.editInfo.parentValue.triggeEvents = {
|
|
3002
|
-
[this.editInfo.event]: []
|
|
3003
|
-
};
|
|
3004
|
-
}
|
|
3005
|
-
array = this.editInfo.parentValue.triggeEvents[this.editInfo.event];
|
|
3006
|
-
}
|
|
3007
|
-
else {
|
|
3008
|
-
if (!value[this.editInfo.event]) {
|
|
3009
|
-
value[this.editInfo.event] = [];
|
|
3010
|
-
}
|
|
3011
|
-
array = value[this.editInfo.event];
|
|
3012
|
-
}
|
|
3013
|
-
array.push(formValue);
|
|
3014
|
-
}
|
|
3015
|
-
else {
|
|
3016
|
-
Object.assign(this.editInfo.value, formValue);
|
|
3017
|
-
}
|
|
3018
|
-
this.isVisibleHandlerModal.set(false);
|
|
3019
|
-
this.onValueChange({ ...value }, this.editInfo?.key);
|
|
3020
|
-
}
|
|
3021
|
-
else {
|
|
3022
|
-
Object.values(this.fg.controls).forEach(control => {
|
|
3023
|
-
if (control.invalid) {
|
|
3024
|
-
control.markAsDirty();
|
|
3025
|
-
control.updateValueAndValidity({ onlySelf: true });
|
|
3026
|
-
}
|
|
3027
|
-
});
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
resetSetHandler() {
|
|
3031
|
-
this.fg.reset();
|
|
3032
|
-
this.selectedHandlerDesc.set(undefined);
|
|
3033
|
-
this.editInfo = undefined;
|
|
3034
|
-
}
|
|
3035
|
-
hasExpanded(node) {
|
|
3036
|
-
return node.isExpanded || node.children.some(c => this.hasExpanded(c));
|
|
3037
|
-
}
|
|
3038
|
-
expand(node, expanded) {
|
|
3039
|
-
node.isExpanded = expanded;
|
|
3040
|
-
node.children.forEach(c => this.expand(c, expanded));
|
|
3041
|
-
}
|
|
3042
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: InputTrigger, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3043
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: InputTrigger, isStandalone: true, selector: "axis-input-trigger", inputs: { internalTriggers: { classPropertyName: "internalTriggers", publicName: "internalTriggers", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, eventDesc: { classPropertyName: "eventDesc", publicName: "eventDesc", isSignal: true, isRequired: false, transformFunction: null }, isVisibleHandlerModal: { classPropertyName: "isVisibleHandlerModal", publicName: "isVisibleHandlerModal", isSignal: true, isRequired: false, transformFunction: null }, editEventHandler: { classPropertyName: "editEventHandler", publicName: "editEventHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", isVisibleHandlerModal: "isVisibleHandlerModalChange", editEventHandler: "editEventHandlerChange" }, providers: [
|
|
3044
|
-
{
|
|
3045
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3046
|
-
useExisting: forwardRef(() => InputTrigger),
|
|
3047
|
-
multi: true
|
|
3048
|
-
}
|
|
3049
|
-
], viewQueries: [{ propertyName: "tree", first: true, predicate: ["tree"], descendants: true, static: true }, { propertyName: "dataContainer", first: true, predicate: ["dataContainer"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: "<nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u4E8B\u4EF6\u8BBE\u7F6E\">\n <nz-tree #tree [nzData]=\"nodes()\" nzDraggable nzBlockNode [nzTreeTemplate]=\"nodeTemp\"\n [nzExpandedKeys]=\"treeExpandedKeys()\" (nzOnDragStart)=\"onDragStart($event)\" [nzBeforeDrop]=\"beforeDrop\"\n nzExpandAll></nz-tree>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n</nz-collapse>\n\n<ng-template #nodeTemp let-node>\n <nz-flex nzAlign=\"center\" style=\"width: 100%;\" nzGap=\"4px\">\n @switch (node.origin.type) {\n @case (\"event\") {\n <div style=\"white-space: nowrap;\">{{node.title}}</div>\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"startAddHandler(node)\"><nz-icon\n nzType=\"plus\"></nz-icon>\u64CD\u4F5C</a>\n @if (node.children.length) {\n <a class=\"expand-button\" nz-button nzType=\"text\" nzSize=\"small\" nzShape=\"circle\"\n (click)=\"expand(node,!hasExpanded(node))\"><nz-icon\n [nzType]=\"hasExpanded(node)?'shrink':'arrows-alt'\"></nz-icon></a>\n }\n }\n @case (\"handler\") {\n <nz-icon style=\"cursor: move;\" nzType=\"holder\" nzTheme=\"outline\" />\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"startSetHandler(node)\">\n <nz-icon [nzType]=\"node.icon\" nzTheme=\"outline\" />\n <span style=\"text-decoration: underline;white-space: nowrap;\">{{node.title}}</span>\n </a>\n <a nz-button nzType=\"link\" nzDanger nzSize=\"small\" (click)=\"deleteHandler(node)\"><nz-icon\n nzType=\"delete\"></nz-icon></a>\n @if (node.children.length) {\n <a class=\"expand-button\" nz-button nzType=\"text\" nzSize=\"small\" nzShape=\"circle\"\n (click)=\"expand(node,!hasExpanded(node))\"><nz-icon\n [nzType]=\"hasExpanded(node)?'shrink':'arrows-alt'\"></nz-icon></a>\n }\n }\n }\n </nz-flex>\n</ng-template>\n\n<nz-modal [nzWidth]=\"selectedHandlerDesc()?.formStyle?.width ?? '400px'\" [(nzVisible)]=\"isVisibleHandlerModal\"\n nzDraggable nzTitle=\"\u8BBE\u7F6E\u4E8B\u4EF6\u64CD\u4F5C\" (nzOnCancel)=\"isVisibleHandlerModal.set(false)\" (nzOnOk)=\"onSetHandlerOk()\"\n (nzAfterClose)=\"resetSetHandler()\" (nzAfterOpen)=\"onHandlerChange(fg.value.name)\">\n <ng-container *nzModalContent>\n <form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u64CD\u4F5C</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <nz-select formControlName=\"name\" nzShowSearch nzPlaceHolder=\"\u9009\u62E9\u64CD\u4F5C\" [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onHandlerChange($event)\">\n @for (item of allEventHanderDescGroups(); track item.groupName) {\n <nz-option-group [nzLabel]=\"item.groupName\">\n @for (item of item.handlerDescs; track item.name) {\n <nz-option nzCustomContent [nzValue]=\"item.name\" [nzLabel]=\"item.title\">\n @if (item.icon) {\n <nz-icon [nzType]=\"item.icon\" />\n }\n {{item.title}}\n </nz-option>\n }\n </nz-option-group>\n }\n </nz-select>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u7981\u7528</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"disabled\" [noListen]=\"noListen()\"\n [scopes]=\"handlerFunFieldScopes()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (selectedHandlerDesc()?.target == \"component\") {\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u76EE\u6807</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"id\" [noListen]=\"noListen()\" [scopes]=\"handlerFunFieldScopes()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\" nzShowSearch>\n @for (component of canChooseComponentsInfo(); track component.componentName) {\n <nz-option-group [nzLabel]=\"component.componentName\">\n @for(node of component.nodes; track node.id){\n <nz-option [nzLabel]=\"node.id\" [nzValue]=\"node.id\"></nz-option>\n }\n </nz-option-group>\n }\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }@else if (selectedHandlerDesc()?.target == \"scope\") {\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\">\u76EE\u6807\u57DF</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"id\" [noListen]=\"noListen()\" [scopes]=\"handlerFunFieldScopes()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\" nzShowSearch nzAllowClear\n nzPlaceHolder=\"\u9ED8\u8BA4\u5F53\u524D\u57DF\">\n @for (scope of scopeInfoSubject().value; track scope.scopeId) {\n @if (!scope.scopeId.startsWith(\"__handler_scope_\")) {\n <nz-option [nzLabel]=\"scope.scopeName\" [nzValue]=\"scope.scopeId\"></nz-option>\n }\n }\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <ng-container #dataContainer></ng-container>\n </form>\n </ng-container>\n</nz-modal>", styles: ["nz-tree{background-color:transparent;overflow-x:auto}[nz-button]{padding:0}.expand-button{opacity:0}nz-flex:hover .expand-button{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i1$2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i1$2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i3.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzTreeModule }, { kind: "component", type: i7$1.NzTreeComponent, selector: "nz-tree", inputs: ["nzShowIcon", "nzHideUnMatched", "nzBlockNode", "nzExpandAll", "nzSelectMode", "nzCheckStrictly", "nzShowExpand", "nzShowLine", "nzCheckable", "nzAsyncData", "nzDraggable", "nzMultiple", "nzExpandedIcon", "nzVirtualItemSize", "nzVirtualMaxBufferPx", "nzVirtualMinBufferPx", "nzVirtualHeight", "nzTreeTemplate", "nzBeforeDrop", "nzData", "nzExpandedKeys", "nzSelectedKeys", "nzCheckedKeys", "nzSearchValue", "nzSearchFunc"], outputs: ["nzExpandedKeysChange", "nzSelectedKeysChange", "nzCheckedKeysChange", "nzSearchValueChange", "nzClick", "nzDblClick", "nzContextMenu", "nzCheckboxChange", "nzExpandChange", "nzOnDragStart", "nzOnDragEnter", "nzOnDragOver", "nzOnDragLeave", "nzOnDrop", "nzOnDragEnd"], exportAs: ["nzTree"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i2$1.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "directive", type: i2$1.NzModalContentDirective, selector: "[nzModalContent]", exportAs: ["nzModalContent"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i4$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "component", type: i4$2.NzOptionGroupComponent, selector: "nz-option-group", inputs: ["nzLabel"], exportAs: ["nzOptionGroup"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i4$3.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3$1.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3050
|
-
}
|
|
3051
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: InputTrigger, decorators: [{
|
|
3052
|
-
type: Component,
|
|
3053
|
-
args: [{ selector: 'axis-input-trigger', imports: [NzCollapseModule, NzFormModule, NzButtonModule, NzIconModule, NzTreeModule, CommonModule, NzModalModule, NzSelectModule, ReactiveFormsModule, FunField, FormsModule, NzSwitchModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
3054
|
-
{
|
|
3055
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3056
|
-
useExisting: forwardRef(() => InputTrigger),
|
|
3057
|
-
multi: true
|
|
3058
|
-
}
|
|
3059
|
-
], template: "<nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u4E8B\u4EF6\u8BBE\u7F6E\">\n <nz-tree #tree [nzData]=\"nodes()\" nzDraggable nzBlockNode [nzTreeTemplate]=\"nodeTemp\"\n [nzExpandedKeys]=\"treeExpandedKeys()\" (nzOnDragStart)=\"onDragStart($event)\" [nzBeforeDrop]=\"beforeDrop\"\n nzExpandAll></nz-tree>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n</nz-collapse>\n\n<ng-template #nodeTemp let-node>\n <nz-flex nzAlign=\"center\" style=\"width: 100%;\" nzGap=\"4px\">\n @switch (node.origin.type) {\n @case (\"event\") {\n <div style=\"white-space: nowrap;\">{{node.title}}</div>\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"startAddHandler(node)\"><nz-icon\n nzType=\"plus\"></nz-icon>\u64CD\u4F5C</a>\n @if (node.children.length) {\n <a class=\"expand-button\" nz-button nzType=\"text\" nzSize=\"small\" nzShape=\"circle\"\n (click)=\"expand(node,!hasExpanded(node))\"><nz-icon\n [nzType]=\"hasExpanded(node)?'shrink':'arrows-alt'\"></nz-icon></a>\n }\n }\n @case (\"handler\") {\n <nz-icon style=\"cursor: move;\" nzType=\"holder\" nzTheme=\"outline\" />\n <a nz-button nzType=\"link\" nzSize=\"small\" (click)=\"startSetHandler(node)\">\n <nz-icon [nzType]=\"node.icon\" nzTheme=\"outline\" />\n <span style=\"text-decoration: underline;white-space: nowrap;\">{{node.title}}</span>\n </a>\n <a nz-button nzType=\"link\" nzDanger nzSize=\"small\" (click)=\"deleteHandler(node)\"><nz-icon\n nzType=\"delete\"></nz-icon></a>\n @if (node.children.length) {\n <a class=\"expand-button\" nz-button nzType=\"text\" nzSize=\"small\" nzShape=\"circle\"\n (click)=\"expand(node,!hasExpanded(node))\"><nz-icon\n [nzType]=\"hasExpanded(node)?'shrink':'arrows-alt'\"></nz-icon></a>\n }\n }\n }\n </nz-flex>\n</ng-template>\n\n<nz-modal [nzWidth]=\"selectedHandlerDesc()?.formStyle?.width ?? '400px'\" [(nzVisible)]=\"isVisibleHandlerModal\"\n nzDraggable nzTitle=\"\u8BBE\u7F6E\u4E8B\u4EF6\u64CD\u4F5C\" (nzOnCancel)=\"isVisibleHandlerModal.set(false)\" (nzOnOk)=\"onSetHandlerOk()\"\n (nzAfterClose)=\"resetSetHandler()\" (nzAfterOpen)=\"onHandlerChange(fg.value.name)\">\n <ng-container *nzModalContent>\n <form nz-form [formGroup]=\"fg\">\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u64CD\u4F5C</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <nz-select formControlName=\"name\" nzShowSearch nzPlaceHolder=\"\u9009\u62E9\u64CD\u4F5C\" [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onHandlerChange($event)\">\n @for (item of allEventHanderDescGroups(); track item.groupName) {\n <nz-option-group [nzLabel]=\"item.groupName\">\n @for (item of item.handlerDescs; track item.name) {\n <nz-option nzCustomContent [nzValue]=\"item.name\" [nzLabel]=\"item.title\">\n @if (item.icon) {\n <nz-icon [nzType]=\"item.icon\" />\n }\n {{item.title}}\n </nz-option>\n }\n </nz-option-group>\n }\n </nz-select>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u7981\u7528</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"disabled\" [noListen]=\"noListen()\"\n [scopes]=\"handlerFunFieldScopes()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n @if (selectedHandlerDesc()?.target == \"component\") {\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\" nzRequired>\u76EE\u6807</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"id\" [noListen]=\"noListen()\" [scopes]=\"handlerFunFieldScopes()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\" nzShowSearch>\n @for (component of canChooseComponentsInfo(); track component.componentName) {\n <nz-option-group [nzLabel]=\"component.componentName\">\n @for(node of component.nodes; track node.id){\n <nz-option [nzLabel]=\"node.id\" [nzValue]=\"node.id\"></nz-option>\n }\n </nz-option-group>\n }\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }@else if (selectedHandlerDesc()?.target == \"scope\") {\n <nz-form-item>\n <nz-form-label [nzSpan]=\"selectedHandlerDesc()?.formStyle?.labelSpan ?? 6\">\u76EE\u6807\u57DF</nz-form-label>\n <nz-form-control [nzSpan]=\"24 - (selectedHandlerDesc()?.formStyle?.labelSpan ?? 6)\">\n <axis-fun-field formControlName=\"id\" [noListen]=\"noListen()\" [scopes]=\"handlerFunFieldScopes()\">\n <nz-select ngModel [ngModelOptions]=\"{standalone:true}\" nzShowSearch nzAllowClear\n nzPlaceHolder=\"\u9ED8\u8BA4\u5F53\u524D\u57DF\">\n @for (scope of scopeInfoSubject().value; track scope.scopeId) {\n @if (!scope.scopeId.startsWith(\"__handler_scope_\")) {\n <nz-option [nzLabel]=\"scope.scopeName\" [nzValue]=\"scope.scopeId\"></nz-option>\n }\n }\n </nz-select>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n }\n <ng-container #dataContainer></ng-container>\n </form>\n </ng-container>\n</nz-modal>", styles: ["nz-tree{background-color:transparent;overflow-x:auto}[nz-button]{padding:0}.expand-button{opacity:0}nz-flex:hover .expand-button{opacity:1}\n"] }]
|
|
3060
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { tree: [{
|
|
3061
|
-
type: ViewChild,
|
|
3062
|
-
args: ["tree", { static: true }]
|
|
3063
|
-
}], dataContainer: [{
|
|
3064
|
-
type: ViewChild,
|
|
3065
|
-
args: ["dataContainer", { read: ViewContainerRef }]
|
|
3066
|
-
}] } });
|
|
3067
|
-
|
|
3068
|
-
class ValueDesignSetting {
|
|
3069
|
-
element;
|
|
3070
|
-
constructor(element) {
|
|
3071
|
-
this.element = element;
|
|
3072
|
-
}
|
|
3073
|
-
showLine = signal(false, ...(ngDevMode ? [{ debugName: "showLine" }] : []));
|
|
3074
|
-
scopeId = input(...(ngDevMode ? [undefined, { debugName: "scopeId" }] : []));
|
|
3075
|
-
exclude = input([], ...(ngDevMode ? [{ debugName: "exclude" }] : []));
|
|
3076
|
-
fg = input.required(...(ngDevMode ? [{ debugName: "fg" }] : []));
|
|
3077
|
-
ngAfterViewInit() {
|
|
3078
|
-
if (this.element.nativeElement.nextElementSibling) {
|
|
3079
|
-
this.showLine.set(true);
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3082
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ValueDesignSetting, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
3083
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: ValueDesignSetting, isStandalone: true, selector: "axis-value-design-setting", inputs: { scopeId: { classPropertyName: "scopeId", publicName: "scopeId", isSignal: true, isRequired: false, transformFunction: null }, exclude: { classPropertyName: "exclude", publicName: "exclude", isSignal: true, isRequired: false, transformFunction: null }, fg: { classPropertyName: "fg", publicName: "fg", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<form [formGroup]=\"fg()\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u503C\u7EC4\u4EF6\u8BBE\u7F6E\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u521D\u59CB\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"initValue\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u521D\u59CB\u4E8B\u4EF6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <nz-switch formControlName=\"emitInitEvent\"></nz-switch>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7981\u7528\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"disabled\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u53EA\u8BFB\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"readonly\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i1$2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i1$2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i1$3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i1$3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i2$3.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i2$3.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i2$3.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i2$3.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i4$3.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], exportAs: ["axisDynamic"] }, { kind: "ngmodule", type: NzSelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3084
|
-
}
|
|
3085
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ValueDesignSetting, decorators: [{
|
|
3086
|
-
type: Component,
|
|
3087
|
-
args: [{ selector: 'axis-value-design-setting', imports: [NzCollapseModule, NzFormModule, FunField, NzSwitchModule, FormsModule, NzInputModule, ReactiveFormsModule, DynamicDirective, NzSelectModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg()\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u503C\u7EC4\u4EF6\u8BBE\u7F6E\">\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u521D\u59CB\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"initValue\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <ng-container [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\" ngModel [ngModelOptions]=\"{standalone:true}\"></ng-container>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u521D\u59CB\u4E8B\u4EF6\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <nz-switch formControlName=\"emitInitEvent\"></nz-switch>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u7981\u7528\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"disabled\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u53EA\u8BFB\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"readonly\" [exclude]=\"exclude()\" [scopeId]=\"scopeId()\">\n <nz-switch ngModel [ngModelOptions]=\"{standalone:true}\"></nz-switch>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n @if (showLine()) {\n <div></div>\n }\n </nz-collapse>\n</form>" }]
|
|
3088
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
3089
|
-
const valueFbConfig = {
|
|
3090
|
-
initValue: [],
|
|
3091
|
-
emitInitEvent: [true, FormValidators.required],
|
|
3092
|
-
disabled: [undefined, [FormValidators.requiredFun]],
|
|
3093
|
-
readonly: [undefined, [FormValidators.requiredFun]],
|
|
3094
|
-
};
|
|
3095
|
-
const valueFunField = {
|
|
3096
|
-
initValue: {
|
|
3097
|
-
defaultValue: undefined
|
|
3098
|
-
},
|
|
3099
|
-
disabled: {
|
|
3100
|
-
defaultValue: false
|
|
3101
|
-
},
|
|
3102
|
-
readonly: {
|
|
3103
|
-
defaultValue: false
|
|
3104
|
-
}
|
|
3105
|
-
};
|
|
3106
|
-
|
|
3107
|
-
class SimpleMenu extends BaseMenu {
|
|
3108
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SimpleMenu, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.2", type: SimpleMenu, isStandalone: true, selector: "axis-design-simple-menu", usesInheritance: true, ngImport: i0, template: "<nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu>\n <axis-common-menu [baseMenu]=\"this\"></axis-common-menu>\n </ul>\n</nz-dropdown-menu>", styles: [""], dependencies: [{ kind: "ngmodule", type: NzDropDownModule }, { kind: "directive", type: i2$2.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i2$4.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "component", type: CommonMenu, selector: "axis-common-menu", inputs: ["baseMenu"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3110
|
-
}
|
|
3111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SimpleMenu, decorators: [{
|
|
3112
|
-
type: Component,
|
|
3113
|
-
args: [{ selector: 'axis-design-simple-menu', imports: [NzDropDownModule, NzIconModule, CommonMenu], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu>\n <axis-common-menu [baseMenu]=\"this\"></axis-common-menu>\n </ul>\n</nz-dropdown-menu>" }]
|
|
3114
|
-
}] });
|
|
3115
|
-
|
|
3116
|
-
class ComponentsLoader {
|
|
3117
|
-
components = inject(AXIS_COMPONENTS_TOKEN);
|
|
3118
|
-
loadedMap = new Map();
|
|
3119
|
-
loadingMap = new Map();
|
|
3120
|
-
loadComponent(component) {
|
|
3121
|
-
if (this.loadedMap.has(component)) {
|
|
3122
|
-
return Promise.resolve(this.loadedMap.get(component));
|
|
3123
|
-
}
|
|
3124
|
-
if (this.loadingMap.has(component)) {
|
|
3125
|
-
return this.loadingMap.get(component);
|
|
3126
|
-
}
|
|
3127
|
-
if (!this.components[component]) {
|
|
3128
|
-
return Promise.reject(`component ${component} not found`);
|
|
3129
|
-
}
|
|
3130
|
-
this.loadingMap.set(component, this.components[component]().then(module => {
|
|
3131
|
-
const m = module[Object.keys(module)[0]];
|
|
3132
|
-
this.loadedMap.set(component, m);
|
|
3133
|
-
this.loadingMap.delete(component);
|
|
3134
|
-
return m;
|
|
3135
|
-
}));
|
|
3136
|
-
return this.loadingMap.get(component);
|
|
3137
|
-
}
|
|
3138
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ComponentsLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3139
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ComponentsLoader });
|
|
3140
|
-
}
|
|
3141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: ComponentsLoader, decorators: [{
|
|
3142
|
-
type: Injectable
|
|
3143
|
-
}] });
|
|
3144
|
-
|
|
3145
|
-
function codeName(code, name) {
|
|
3146
|
-
if (code && name) {
|
|
3147
|
-
return `[${code}]${name}`;
|
|
3148
|
-
}
|
|
3149
|
-
if (code) {
|
|
3150
|
-
return `[${code}]`;
|
|
3151
|
-
}
|
|
3152
|
-
return name || "";
|
|
3153
|
-
}
|
|
3154
|
-
function nameCode(name, code) {
|
|
3155
|
-
if (code && name) {
|
|
3156
|
-
return `${name}[${code}]`;
|
|
3157
|
-
}
|
|
3158
|
-
if (code) {
|
|
3159
|
-
return `[${code}]`;
|
|
3160
|
-
}
|
|
3161
|
-
return name || "";
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
/**
|
|
3165
|
-
* Generated bundle index. Do not edit.
|
|
3166
|
-
*/
|
|
3167
|
-
|
|
3168
|
-
export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FORMITEM_REGISTE_VALUE_ACCESS_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
|
|
3169
|
-
//# sourceMappingURL=ngx-axis-appforge-core.mjs.map
|