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