@ibiz-template/vue3-util 0.6.1-dev.0 → 0.6.1-dev.2
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/dist/index.min.css +1 -1
- package/lib/_virtual/_commonjsHelpers.cjs +46 -0
- package/lib/common/badge/badge.cjs +34 -0
- package/lib/common/badge/badge.css +1 -0
- package/lib/common/code-list/code-list.cjs +105 -0
- package/lib/common/code-list/code-list.css +1 -0
- package/lib/common/control-base/control-base.cjs +102 -0
- package/lib/common/control-base/control-base.css +1 -0
- package/lib/common/control-loading-placeholder/control-loading-placeholder.cjs +32 -0
- package/lib/common/control-shell/control-shell.cjs +58 -0
- package/lib/common/control-shell/control-shell.css +1 -0
- package/lib/common/icon/icon.cjs +103 -0
- package/lib/common/index.cjs +21 -0
- package/lib/common/router-view/router-view.cjs +77 -0
- package/lib/common/view-shell/view-shell.cjs +137 -0
- package/lib/common/view-shell/view-shell.css +1 -0
- package/lib/control/index.cjs +10 -0
- package/lib/control/panel/index.cjs +9 -0
- package/lib/control/panel/panel/index.cjs +18 -0
- package/lib/control/panel/panel/panel.cjs +142 -0
- package/lib/control/panel/panel/panel.css +1 -0
- package/lib/control/panel/panel/panel.provider.cjs +10 -0
- package/lib/control/panel/view-layout-panel/index.cjs +24 -0
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +144 -0
- package/lib/control/panel/view-layout-panel/view-layout-panel.css +1 -0
- package/lib/control/panel/view-layout-panel/view-layout-panel.provider.cjs +10 -0
- package/lib/hooks/app/app.hooks.cjs +26 -0
- package/lib/hooks/index.cjs +7 -0
- package/lib/interface/index.cjs +5 -0
- package/lib/interface/util/index.cjs +5 -0
- package/lib/interface/util/route/route.cjs +3 -0
- package/lib/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.cjs +540 -0
- package/lib/panel-component/grid-container/grid-container.cjs +108 -0
- package/lib/panel-component/grid-container/grid-container.controller.cjs +14 -0
- package/lib/panel-component/grid-container/grid-container.css +1 -0
- package/lib/panel-component/grid-container/grid-container.provider.cjs +17 -0
- package/lib/panel-component/grid-container/grid-container.state.cjs +9 -0
- package/lib/panel-component/grid-container/index.cjs +25 -0
- package/lib/panel-component/index.cjs +73 -0
- package/lib/panel-component/multi-data-container/index.cjs +28 -0
- package/lib/panel-component/multi-data-container/multi-data-container-item.controller.cjs +119 -0
- package/lib/panel-component/multi-data-container/multi-data-container-itm.state.cjs +19 -0
- package/lib/panel-component/multi-data-container/multi-data-container.cjs +89 -0
- package/lib/panel-component/multi-data-container/multi-data-container.controller.cjs +262 -0
- package/lib/panel-component/multi-data-container/multi-data-container.css +1 -0
- package/lib/panel-component/multi-data-container/multi-data-container.provider.cjs +17 -0
- package/lib/panel-component/multi-data-container/multi-data-container.state.cjs +19 -0
- package/lib/panel-component/nav-pos/index.cjs +22 -0
- package/lib/panel-component/nav-pos/nav-pos.cjs +107 -0
- package/lib/panel-component/nav-pos/nav-pos.controller.cjs +312 -0
- package/lib/panel-component/nav-pos/nav-pos.css +1 -0
- package/lib/panel-component/nav-pos/nav-pos.provider.cjs +26 -0
- package/lib/panel-component/nav-pos/nav-pos.state.cjs +49 -0
- package/lib/panel-component/panel-container/index.cjs +29 -0
- package/lib/panel-component/panel-container/panel-container.cjs +72 -0
- package/lib/panel-component/panel-container/panel-container.controller.cjs +14 -0
- package/lib/panel-component/panel-container/panel-container.css +1 -0
- package/lib/panel-component/panel-container/panel-container.provider.cjs +17 -0
- package/lib/panel-component/panel-container/panel-container.state.cjs +9 -0
- package/lib/panel-component/panel-container-group/index.cjs +28 -0
- package/lib/panel-component/panel-container-group/panel-container-group.cjs +110 -0
- package/lib/panel-component/panel-container-group/panel-container-group.controller.cjs +37 -0
- package/lib/panel-component/panel-container-group/panel-container-group.css +1 -0
- package/lib/panel-component/panel-container-group/panel-container-group.provider.cjs +17 -0
- package/lib/panel-component/panel-container-group/panel-container-group.state.cjs +9 -0
- package/lib/panel-component/panel-container-image/index.cjs +28 -0
- package/lib/panel-component/panel-container-image/panel-container-image.cjs +95 -0
- package/lib/panel-component/panel-container-image/panel-container-image.controller.cjs +14 -0
- package/lib/panel-component/panel-container-image/panel-container-image.css +1 -0
- package/lib/panel-component/panel-container-image/panel-container-image.provider.cjs +17 -0
- package/lib/panel-component/panel-container-image/panel-container-image.state.cjs +9 -0
- package/lib/panel-component/panel-ctrl-pos/index.cjs +20 -0
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.cjs +47 -0
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.controller.cjs +25 -0
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.css +1 -0
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.provider.cjs +17 -0
- package/lib/panel-component/panel-field/index.cjs +20 -0
- package/lib/panel-component/panel-field/panel-field.cjs +78 -0
- package/lib/panel-component/panel-field/panel-field.controller.cjs +132 -0
- package/lib/panel-component/panel-field/panel-field.css +1 -0
- package/lib/panel-component/panel-field/panel-field.provider.cjs +17 -0
- package/lib/panel-component/panel-field/panel-field.state.cjs +9 -0
- package/lib/panel-component/panel-item-render/index.cjs +24 -0
- package/lib/panel-component/panel-item-render/panel-item-render.cjs +49 -0
- package/lib/panel-component/panel-item-render/panel-item-render.controller.cjs +31 -0
- package/lib/panel-component/panel-item-render/panel-item-render.provider.cjs +17 -0
- package/lib/panel-component/panel-rawitem/index.cjs +32 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +61 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.controller.cjs +30 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.css +1 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.provider.cjs +17 -0
- package/lib/panel-component/panel-tab-page/index.cjs +18 -0
- package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +65 -0
- package/lib/panel-component/panel-tab-page/panel-tab-page.provider.cjs +17 -0
- package/lib/panel-component/scroll-container/index.cjs +55 -0
- package/lib/panel-component/scroll-container/scroll-container/index.cjs +9 -0
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.cjs +114 -0
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.controller.cjs +14 -0
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.css +1 -0
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.provider.cjs +17 -0
- package/lib/panel-component/scroll-container/scroll-container-item/index.cjs +9 -0
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.cjs +66 -0
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.cjs +9 -0
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.css +1 -0
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.provider.cjs +17 -0
- package/lib/panel-component/single-data-container/index.cjs +28 -0
- package/lib/panel-component/single-data-container/single-data-container.cjs +79 -0
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +287 -0
- package/lib/panel-component/single-data-container/single-data-container.css +1 -0
- package/lib/panel-component/single-data-container/single-data-container.provider.cjs +17 -0
- package/lib/panel-component/single-data-container/single-data-container.state.cjs +19 -0
- package/lib/plugin/index.cjs +7 -0
- package/{src/plugin/plugin-factory/plugin-factory.ts → lib/plugin/plugin-factory/plugin-factory.cjs} +137 -182
- package/lib/props/common.cjs +17 -0
- package/lib/props/editor/array.cjs +14 -0
- package/lib/props/editor/autocomplete.cjs +14 -0
- package/lib/props/editor/cascader.cjs +14 -0
- package/lib/props/editor/check-box-list.cjs +14 -0
- package/lib/props/editor/check-box.cjs +14 -0
- package/lib/props/editor/code.cjs +23 -0
- package/lib/props/editor/color-picker.cjs +14 -0
- package/lib/props/editor/common.cjs +62 -0
- package/lib/props/editor/data-picker.cjs +14 -0
- package/lib/props/editor/date-picker.cjs +14 -0
- package/lib/props/editor/date-range.cjs +14 -0
- package/lib/props/editor/dropdown-list.cjs +14 -0
- package/lib/props/editor/html.cjs +14 -0
- package/lib/props/editor/index.cjs +86 -0
- package/lib/props/editor/list-box.cjs +14 -0
- package/lib/props/editor/markdown.cjs +22 -0
- package/lib/props/editor/number-range.cjs +14 -0
- package/lib/props/editor/radio-button-list.cjs +14 -0
- package/lib/props/editor/rate.cjs +14 -0
- package/lib/props/editor/raw.cjs +14 -0
- package/lib/props/editor/slider.cjs +14 -0
- package/lib/props/editor/span.cjs +14 -0
- package/lib/props/editor/stepper.cjs +14 -0
- package/lib/props/editor/switch.cjs +14 -0
- package/lib/props/editor/text-box.cjs +30 -0
- package/lib/props/editor/upload.cjs +14 -0
- package/lib/props/index.cjs +89 -0
- package/lib/use/click-outside/click-outside.cjs +50 -0
- package/lib/use/control/index.cjs +7 -0
- package/lib/use/control/use-control-controller/use-control-controller.cjs +78 -0
- package/lib/use/event/event.cjs +39 -0
- package/lib/use/focus-blur/focus-blur.cjs +48 -0
- package/lib/use/index.cjs +34 -0
- package/lib/use/namespace/namespace.cjs +10 -0
- package/lib/use/route/route.cjs +31 -0
- package/lib/use/util/index.cjs +14 -0
- package/lib/use/view/index.cjs +7 -0
- package/lib/use/view/use-view-controller/use-view-controller.cjs +86 -0
- package/lib/use/vue/vue.cjs +64 -0
- package/lib/util/control/prepare-control.cjs +24 -0
- package/lib/util/index.cjs +43 -0
- package/lib/util/install.cjs +11 -0
- package/lib/util/overlay-container/overlay-container.cjs +116 -0
- package/lib/util/overlay-popover-container/overlay-popover-container.cjs +12 -0
- package/lib/util/overlay-view-util/overlay-view-util.cjs +70 -0
- package/lib/util/render/render.cjs +22 -0
- package/lib/util/route/route-listener.cjs +75 -0
- package/lib/util/route/route.cjs +302 -0
- package/lib/util/router-callback/router-callback-item.cjs +74 -0
- package/{src/util/router-callback/router-callback.ts → lib/util/router-callback/router-callback.cjs} +28 -40
- package/lib/util/store/app-store/app-store.cjs +12 -0
- package/lib/util/store/index.cjs +12 -0
- package/lib/util/store/ui-store/ui-store.cjs +17 -0
- package/lib/util/store/ui-store/z-index.cjs +20 -0
- package/lib/view/app-redirect-view/app-redirect-view.cjs +29 -0
- package/lib/view/common/index.cjs +15 -0
- package/lib/view/common/view.cjs +129 -0
- package/lib/view/common/view.css +1 -0
- package/lib/view/common/view.provider.cjs +10 -0
- package/lib/view/de-redirect-view/de-redirect-view.cjs +64 -0
- package/lib/view/de-redirect-view/de-redirect-view.provider.cjs +10 -0
- package/lib/view/de-redirect-view/index.cjs +22 -0
- package/lib/view/index.cjs +15 -0
- package/lib/view/portal-view/index.cjs +23 -0
- package/lib/view/portal-view/portal-view.cjs +95 -0
- package/lib/view/portal-view/portal-view.provider.cjs +10 -0
- package/lib/view/todo-redirect/todo-redirect.cjs +54 -0
- package/package.json +11 -7
- package/src/common/badge/badge.scss +0 -29
- package/src/common/badge/badge.tsx +0 -26
- package/src/common/code-list/code-list.scss +0 -15
- package/src/common/code-list/code-list.tsx +0 -127
- package/src/common/control-base/control-base.scss +0 -4
- package/src/common/control-base/control-base.tsx +0 -130
- package/src/common/control-loading-placeholder/control-loading-placeholder.tsx +0 -22
- package/src/common/control-shell/control-shell.scss +0 -5
- package/src/common/control-shell/control-shell.tsx +0 -70
- package/src/common/icon/icon.tsx +0 -82
- package/src/common/index.ts +0 -8
- package/src/common/router-view/router-view.tsx +0 -74
- package/src/common/view-shell/view-shell.scss +0 -5
- package/src/common/view-shell/view-shell.tsx +0 -163
- package/src/control/index.ts +0 -1
- package/src/control/panel/index.ts +0 -2
- package/src/control/panel/panel/index.ts +0 -12
- package/src/control/panel/panel/panel.provider.ts +0 -14
- package/src/control/panel/panel/panel.scss +0 -9
- package/src/control/panel/panel/panel.tsx +0 -166
- package/src/control/panel/view-layout-panel/index.ts +0 -18
- package/src/control/panel/view-layout-panel/view-layout-panel.provider.ts +0 -14
- package/src/control/panel/view-layout-panel/view-layout-panel.scss +0 -9
- package/src/control/panel/view-layout-panel/view-layout-panel.tsx +0 -178
- package/src/hooks/app/app.hooks.ts +0 -31
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +0 -18
- package/src/interface/index.ts +0 -1
- package/src/interface/util/index.ts +0 -1
- package/src/interface/util/route/route.ts +0 -116
- package/src/panel-component/grid-container/grid-container.controller.ts +0 -18
- package/src/panel-component/grid-container/grid-container.provider.ts +0 -30
- package/src/panel-component/grid-container/grid-container.scss +0 -17
- package/src/panel-component/grid-container/grid-container.state.ts +0 -12
- package/src/panel-component/grid-container/grid-container.tsx +0 -119
- package/src/panel-component/grid-container/index.ts +0 -19
- package/src/panel-component/index.ts +0 -13
- package/src/panel-component/multi-data-container/index.ts +0 -22
- package/src/panel-component/multi-data-container/multi-data-container-item.controller.ts +0 -166
- package/src/panel-component/multi-data-container/multi-data-container-itm.state.ts +0 -20
- package/src/panel-component/multi-data-container/multi-data-container.controller.ts +0 -308
- package/src/panel-component/multi-data-container/multi-data-container.provider.ts +0 -30
- package/src/panel-component/multi-data-container/multi-data-container.scss +0 -10
- package/src/panel-component/multi-data-container/multi-data-container.state.ts +0 -20
- package/src/panel-component/multi-data-container/multi-data-container.tsx +0 -109
- package/src/panel-component/nav-pos/index.ts +0 -16
- package/src/panel-component/nav-pos/nav-pos.controller.ts +0 -401
- package/src/panel-component/nav-pos/nav-pos.provider.ts +0 -38
- package/src/panel-component/nav-pos/nav-pos.scss +0 -4
- package/src/panel-component/nav-pos/nav-pos.state.ts +0 -52
- package/src/panel-component/nav-pos/nav-pos.tsx +0 -121
- package/src/panel-component/panel-container/index.ts +0 -27
- package/src/panel-component/panel-container/panel-container.controller.ts +0 -18
- package/src/panel-component/panel-container/panel-container.provider.ts +0 -30
- package/src/panel-component/panel-container/panel-container.scss +0 -15
- package/src/panel-component/panel-container/panel-container.state.ts +0 -12
- package/src/panel-component/panel-container/panel-container.tsx +0 -72
- package/src/panel-component/panel-container-group/index.ts +0 -22
- package/src/panel-component/panel-container-group/panel-container-group.controller.ts +0 -43
- package/src/panel-component/panel-container-group/panel-container-group.provider.ts +0 -30
- package/src/panel-component/panel-container-group/panel-container-group.scss +0 -91
- package/src/panel-component/panel-container-group/panel-container-group.state.ts +0 -12
- package/src/panel-component/panel-container-group/panel-container-group.tsx +0 -112
- package/src/panel-component/panel-container-image/index.ts +0 -22
- package/src/panel-component/panel-container-image/panel-container-image.controller.ts +0 -18
- package/src/panel-component/panel-container-image/panel-container-image.provider.ts +0 -30
- package/src/panel-component/panel-container-image/panel-container-image.scss +0 -18
- package/src/panel-component/panel-container-image/panel-container-image.state.ts +0 -12
- package/src/panel-component/panel-container-image/panel-container-image.tsx +0 -95
- package/src/panel-component/panel-ctrl-pos/index.ts +0 -14
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.controller.ts +0 -53
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.provider.ts +0 -30
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.scss +0 -8
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.tsx +0 -53
- package/src/panel-component/panel-field/index.ts +0 -14
- package/src/panel-component/panel-field/panel-field.controller.ts +0 -174
- package/src/panel-component/panel-field/panel-field.provider.ts +0 -28
- package/src/panel-component/panel-field/panel-field.scss +0 -36
- package/src/panel-component/panel-field/panel-field.state.ts +0 -12
- package/src/panel-component/panel-field/panel-field.tsx +0 -81
- package/src/panel-component/panel-item-render/index.ts +0 -18
- package/src/panel-component/panel-item-render/panel-item-render.controller.ts +0 -52
- package/src/panel-component/panel-item-render/panel-item-render.provider.ts +0 -30
- package/src/panel-component/panel-item-render/panel-item-render.tsx +0 -50
- package/src/panel-component/panel-rawitem/index.ts +0 -26
- package/src/panel-component/panel-rawitem/panel-rawitem.controller.ts +0 -34
- package/src/panel-component/panel-rawitem/panel-rawitem.provider.ts +0 -28
- package/src/panel-component/panel-rawitem/panel-rawitem.scss +0 -8
- package/src/panel-component/panel-rawitem/panel-rawitem.tsx +0 -61
- package/src/panel-component/panel-tab-page/index.ts +0 -12
- package/src/panel-component/panel-tab-page/panel-tab-page.provider.ts +0 -27
- package/src/panel-component/panel-tab-page/panel-tab-page.tsx +0 -55
- package/src/panel-component/scroll-container/index.ts +0 -44
- package/src/panel-component/scroll-container/scroll-container/index.ts +0 -2
- package/src/panel-component/scroll-container/scroll-container/scroll-container.controller.ts +0 -32
- package/src/panel-component/scroll-container/scroll-container/scroll-container.provider.ts +0 -30
- package/src/panel-component/scroll-container/scroll-container/scroll-container.scss +0 -34
- package/src/panel-component/scroll-container/scroll-container/scroll-container.tsx +0 -110
- package/src/panel-component/scroll-container/scroll-container-item/index.ts +0 -2
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.ts +0 -25
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.provider.ts +0 -30
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.scss +0 -9
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.tsx +0 -60
- package/src/panel-component/single-data-container/index.ts +0 -22
- package/src/panel-component/single-data-container/single-data-container.controller.ts +0 -345
- package/src/panel-component/single-data-container/single-data-container.provider.ts +0 -30
- package/src/panel-component/single-data-container/single-data-container.scss +0 -10
- package/src/panel-component/single-data-container/single-data-container.state.ts +0 -20
- package/src/panel-component/single-data-container/single-data-container.tsx +0 -95
- package/src/plugin/index.ts +0 -1
- package/src/props/common.ts +0 -30
- package/src/props/editor/array.ts +0 -27
- package/src/props/editor/autocomplete.ts +0 -27
- package/src/props/editor/cascader.ts +0 -27
- package/src/props/editor/check-box-list.ts +0 -27
- package/src/props/editor/check-box.ts +0 -27
- package/src/props/editor/code.ts +0 -36
- package/src/props/editor/color-picker.ts +0 -27
- package/src/props/editor/common.ts +0 -94
- package/src/props/editor/data-picker.ts +0 -27
- package/src/props/editor/date-picker.ts +0 -27
- package/src/props/editor/date-range.ts +0 -23
- package/src/props/editor/dropdown-list.ts +0 -27
- package/src/props/editor/html.ts +0 -27
- package/src/props/editor/index.ts +0 -25
- package/src/props/editor/list-box.ts +0 -27
- package/src/props/editor/markdown.ts +0 -35
- package/src/props/editor/number-range.ts +0 -23
- package/src/props/editor/radio-button-list.ts +0 -27
- package/src/props/editor/rate.ts +0 -23
- package/src/props/editor/raw.ts +0 -23
- package/src/props/editor/slider.ts +0 -23
- package/src/props/editor/span.ts +0 -27
- package/src/props/editor/stepper.ts +0 -23
- package/src/props/editor/switch.ts +0 -23
- package/src/props/editor/text-box.ts +0 -79
- package/src/props/editor/upload.ts +0 -27
- package/src/props/index.ts +0 -2
- package/src/types/index.d.ts +0 -8
- package/src/use/click-outside/click-outside.ts +0 -72
- package/src/use/control/index.ts +0 -1
- package/src/use/control/use-control-controller/use-control-controller.ts +0 -153
- package/src/use/event/event.ts +0 -57
- package/src/use/focus-blur/focus-blur.ts +0 -83
- package/src/use/index.ts +0 -9
- package/src/use/namespace/namespace.ts +0 -14
- package/src/use/route/route.ts +0 -47
- package/src/use/util/index.ts +0 -26
- package/src/use/view/index.ts +0 -1
- package/src/use/view/use-view-controller/use-view-controller.ts +0 -153
- package/src/use/vue/vue.ts +0 -142
- package/src/util/control/prepare-control.ts +0 -33
- package/src/util/index.ts +0 -10
- package/src/util/install.ts +0 -14
- package/src/util/overlay-container/overlay-container.ts +0 -155
- package/src/util/overlay-popover-container/overlay-popover-container.ts +0 -30
- package/src/util/overlay-view-util/overlay-view-util.ts +0 -89
- package/src/util/render/render.ts +0 -28
- package/src/util/route/route-listener.ts +0 -91
- package/src/util/route/route.ts +0 -520
- package/src/util/router-callback/router-callback-item.ts +0 -98
- package/src/util/store/app-store/app-store.ts +0 -10
- package/src/util/store/index.ts +0 -6
- package/src/util/store/ui-store/ui-store.ts +0 -27
- package/src/util/store/ui-store/z-index.ts +0 -53
- package/src/view/app-redirect-view/app-redirect-view.tsx +0 -26
- package/src/view/common/index.ts +0 -10
- package/src/view/common/view.provider.ts +0 -14
- package/src/view/common/view.scss +0 -38
- package/src/view/common/view.tsx +0 -152
- package/src/view/de-redirect-view/de-redirect-view.provider.ts +0 -14
- package/src/view/de-redirect-view/de-redirect-view.tsx +0 -62
- package/src/view/de-redirect-view/index.ts +0 -17
- package/src/view/index.ts +0 -5
- package/src/view/portal-view/index.ts +0 -18
- package/src/view/portal-view/portal-view.provider.ts +0 -14
- package/src/view/portal-view/portal-view.tsx +0 -79
- package/src/view/todo-redirect/todo-redirect.tsx +0 -51
package/{src/plugin/plugin-factory/plugin-factory.ts → lib/plugin/plugin-factory/plugin-factory.cjs}
RENAMED
|
@@ -1,94 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
IPluginFactory,
|
|
4
|
-
IPluginItem,
|
|
5
|
-
ISystemImportMap,
|
|
6
|
-
RemotePluginConfig,
|
|
7
|
-
RemotePluginItem,
|
|
8
|
-
} from '@ibiz-template/runtime';
|
|
9
|
-
import { IAppPFPluginRef, ISysPFPlugin } from '@ibiz/model-core';
|
|
10
|
-
import path, { join } from 'path-browserify';
|
|
11
|
-
import { App, Plugin } from 'vue';
|
|
12
|
-
import { AppHooks } from '../../hooks';
|
|
1
|
+
'use strict';
|
|
13
2
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* @export
|
|
20
|
-
* @class PluginFactory
|
|
21
|
-
*/
|
|
22
|
-
export class PluginFactory implements IPluginFactory {
|
|
23
|
-
/**
|
|
24
|
-
* 是否为 http || https 开头
|
|
25
|
-
*
|
|
26
|
-
* @author chitanda
|
|
27
|
-
* @date 2022-11-07 14:11:28
|
|
28
|
-
* @protected
|
|
29
|
-
*/
|
|
30
|
-
protected urlReg = /^http[s]?:\/\/[^\s]*/;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 是否已经加载过文件缓存
|
|
34
|
-
*
|
|
35
|
-
* @author chitanda
|
|
36
|
-
* @date 2022-10-31 14:10:17
|
|
37
|
-
* @protected
|
|
38
|
-
* @type {Map<string, boolean>}
|
|
39
|
-
*/
|
|
40
|
-
protected cache: Map<string, boolean> = new Map();
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 插件缓存
|
|
44
|
-
*
|
|
45
|
-
* @author chitanda
|
|
46
|
-
* @date 2022-10-31 14:10:28
|
|
47
|
-
* @protected
|
|
48
|
-
* @type {Map<string, RemotePluginItem>}
|
|
49
|
-
*/
|
|
50
|
-
protected pluginCache: Map<string, RemotePluginItem> = new Map();
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 所有的插件
|
|
54
|
-
*
|
|
55
|
-
* @author chitanda
|
|
56
|
-
* @date 2023-02-02 16:02:55
|
|
57
|
-
* @protected
|
|
58
|
-
* @type {Plugin[]}
|
|
59
|
-
*/
|
|
60
|
-
protected pluginCodes: Plugin[] = [];
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 预定义插件集合
|
|
64
|
-
*
|
|
65
|
-
* @author chitanda
|
|
66
|
-
* @date 2023-03-09 17:03:46
|
|
67
|
-
* @protected
|
|
68
|
-
* @type {Map<string, IPluginItem>}
|
|
69
|
-
*/
|
|
70
|
-
protected predefinedPlugins: Map<string, IPluginItem> = new Map();
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 忽略加载的插件规则,支持正则。配配规则为插件包地址,如:@ibiz-template-vue/vue3-plugin-*
|
|
74
|
-
*
|
|
75
|
-
* @author chitanda
|
|
76
|
-
* @date 2023-12-04 15:12:58
|
|
77
|
-
* @protected
|
|
78
|
-
* @type {((string | RegExp)[])}
|
|
79
|
-
*/
|
|
80
|
-
protected ignoreRules: (string | RegExp)[] = [];
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* 插件加载队列
|
|
84
|
-
*
|
|
85
|
-
* @author chitanda
|
|
86
|
-
* @date 2023-12-05 16:12:04
|
|
87
|
-
* @protected
|
|
88
|
-
* @type {Map<string, Promise<boolean>>}
|
|
89
|
-
*/
|
|
90
|
-
protected loadQueue: Map<string, Promise<boolean>> = new Map();
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
4
|
+
var runtime = require('@ibiz-template/runtime');
|
|
5
|
+
var index = require('../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.cjs');
|
|
6
|
+
require('../../hooks/index.cjs');
|
|
7
|
+
var app_hooks = require('../../hooks/app/app.hooks.cjs');
|
|
91
8
|
|
|
9
|
+
"use strict";
|
|
10
|
+
class PluginFactory {
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* 是否为 http || https 开头
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2022-11-07 14:11:28
|
|
17
|
+
* @protected
|
|
18
|
+
*/
|
|
19
|
+
this.urlReg = /^http[s]?:\/\/[^\s]*/;
|
|
20
|
+
/**
|
|
21
|
+
* 是否已经加载过文件缓存
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2022-10-31 14:10:17
|
|
25
|
+
* @protected
|
|
26
|
+
* @type {Map<string, boolean>}
|
|
27
|
+
*/
|
|
28
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
29
|
+
/**
|
|
30
|
+
* 插件缓存
|
|
31
|
+
*
|
|
32
|
+
* @author chitanda
|
|
33
|
+
* @date 2022-10-31 14:10:28
|
|
34
|
+
* @protected
|
|
35
|
+
* @type {Map<string, RemotePluginItem>}
|
|
36
|
+
*/
|
|
37
|
+
this.pluginCache = /* @__PURE__ */ new Map();
|
|
38
|
+
/**
|
|
39
|
+
* 所有的插件
|
|
40
|
+
*
|
|
41
|
+
* @author chitanda
|
|
42
|
+
* @date 2023-02-02 16:02:55
|
|
43
|
+
* @protected
|
|
44
|
+
* @type {Plugin[]}
|
|
45
|
+
*/
|
|
46
|
+
this.pluginCodes = [];
|
|
47
|
+
/**
|
|
48
|
+
* 预定义插件集合
|
|
49
|
+
*
|
|
50
|
+
* @author chitanda
|
|
51
|
+
* @date 2023-03-09 17:03:46
|
|
52
|
+
* @protected
|
|
53
|
+
* @type {Map<string, IPluginItem>}
|
|
54
|
+
*/
|
|
55
|
+
this.predefinedPlugins = /* @__PURE__ */ new Map();
|
|
56
|
+
/**
|
|
57
|
+
* 忽略加载的插件规则,支持正则。配配规则为插件包地址,如:@ibiz-template-vue/vue3-plugin-*
|
|
58
|
+
*
|
|
59
|
+
* @author chitanda
|
|
60
|
+
* @date 2023-12-04 15:12:58
|
|
61
|
+
* @protected
|
|
62
|
+
* @type {((string | RegExp)[])}
|
|
63
|
+
*/
|
|
64
|
+
this.ignoreRules = [];
|
|
65
|
+
/**
|
|
66
|
+
* 插件加载队列
|
|
67
|
+
*
|
|
68
|
+
* @author chitanda
|
|
69
|
+
* @date 2023-12-05 16:12:04
|
|
70
|
+
* @protected
|
|
71
|
+
* @type {Map<string, Promise<boolean>>}
|
|
72
|
+
*/
|
|
73
|
+
this.loadQueue = /* @__PURE__ */ new Map();
|
|
74
|
+
}
|
|
92
75
|
/**
|
|
93
76
|
* 是否忽略插件加载
|
|
94
77
|
*
|
|
@@ -98,15 +81,14 @@ export class PluginFactory implements IPluginFactory {
|
|
|
98
81
|
* @param {string} pluginPath
|
|
99
82
|
* @return {*} {boolean}
|
|
100
83
|
*/
|
|
101
|
-
|
|
102
|
-
return this.ignoreRules.some(rule => {
|
|
103
|
-
if (typeof rule ===
|
|
84
|
+
isIgnore(pluginPath) {
|
|
85
|
+
return this.ignoreRules.some((rule) => {
|
|
86
|
+
if (typeof rule === "string") {
|
|
104
87
|
return pluginPath === rule;
|
|
105
88
|
}
|
|
106
89
|
return rule.test(pluginPath);
|
|
107
90
|
});
|
|
108
91
|
}
|
|
109
|
-
|
|
110
92
|
/**
|
|
111
93
|
* 设置本地开发忽略远程加载的插件
|
|
112
94
|
*
|
|
@@ -114,10 +96,9 @@ export class PluginFactory implements IPluginFactory {
|
|
|
114
96
|
* @date 2023-12-04 17:12:49
|
|
115
97
|
* @param {(string | RegExp)} rule
|
|
116
98
|
*/
|
|
117
|
-
setDevIgnore(rule
|
|
99
|
+
setDevIgnore(rule) {
|
|
118
100
|
this.ignoreRules.push(rule);
|
|
119
101
|
}
|
|
120
|
-
|
|
121
102
|
/**
|
|
122
103
|
* 注册视图默认插件
|
|
123
104
|
*
|
|
@@ -125,10 +106,9 @@ export class PluginFactory implements IPluginFactory {
|
|
|
125
106
|
* @date 2023-02-06 21:02:10
|
|
126
107
|
* @param {IPluginItem} plugin
|
|
127
108
|
*/
|
|
128
|
-
registerPredefinedPlugin(plugin
|
|
109
|
+
registerPredefinedPlugin(plugin) {
|
|
129
110
|
this.predefinedPlugins.set(plugin.name, plugin);
|
|
130
111
|
}
|
|
131
|
-
|
|
132
112
|
/**
|
|
133
113
|
* 给入应用实例,将已经加载的过插件注入。主要用于多实例的情况
|
|
134
114
|
*
|
|
@@ -136,12 +116,11 @@ export class PluginFactory implements IPluginFactory {
|
|
|
136
116
|
* @date 2023-02-02 16:02:51
|
|
137
117
|
* @param {App} app
|
|
138
118
|
*/
|
|
139
|
-
register(app
|
|
140
|
-
this.pluginCodes.forEach(plugin => {
|
|
119
|
+
register(app) {
|
|
120
|
+
this.pluginCodes.forEach((plugin) => {
|
|
141
121
|
app.use(plugin);
|
|
142
122
|
});
|
|
143
123
|
}
|
|
144
|
-
|
|
145
124
|
/**
|
|
146
125
|
* 加载预置插件
|
|
147
126
|
*
|
|
@@ -150,15 +129,14 @@ export class PluginFactory implements IPluginFactory {
|
|
|
150
129
|
* @param {string} name
|
|
151
130
|
* @return {*} {Promise<void>}
|
|
152
131
|
*/
|
|
153
|
-
async loadPredefinedPlugin(name
|
|
132
|
+
async loadPredefinedPlugin(name) {
|
|
154
133
|
if (this.predefinedPlugins.has(name)) {
|
|
155
|
-
const plugin = this.predefinedPlugins.get(name)
|
|
134
|
+
const plugin = this.predefinedPlugins.get(name);
|
|
156
135
|
if (plugin) {
|
|
157
136
|
await this.loadPluginRef(plugin.name, plugin.path);
|
|
158
137
|
}
|
|
159
138
|
}
|
|
160
139
|
}
|
|
161
|
-
|
|
162
140
|
/**
|
|
163
141
|
* 插件刚加载完成回来,设置到目前所有的 vue 实例当中
|
|
164
142
|
*
|
|
@@ -167,12 +145,10 @@ export class PluginFactory implements IPluginFactory {
|
|
|
167
145
|
* @protected
|
|
168
146
|
* @param {Plugin} code
|
|
169
147
|
*/
|
|
170
|
-
|
|
148
|
+
setPluginCode(code) {
|
|
171
149
|
this.pluginCodes.push(code);
|
|
172
|
-
|
|
173
|
-
AppHooks.useComponent.callSync(null, code as any);
|
|
150
|
+
app_hooks.AppHooks.useComponent.callSync(null, code);
|
|
174
151
|
}
|
|
175
|
-
|
|
176
152
|
/**
|
|
177
153
|
* 加载插件
|
|
178
154
|
*
|
|
@@ -181,12 +157,12 @@ export class PluginFactory implements IPluginFactory {
|
|
|
181
157
|
* @param {ISysPFPlugin} plugin
|
|
182
158
|
* @return {*} {Promise<boolean>}
|
|
183
159
|
*/
|
|
184
|
-
async loadPlugin(plugin
|
|
160
|
+
async loadPlugin(plugin) {
|
|
185
161
|
if (plugin.runtimeObject === true) {
|
|
186
|
-
const pluginRef = plugin
|
|
162
|
+
const pluginRef = plugin;
|
|
187
163
|
if (pluginRef) {
|
|
188
|
-
const rtObjectName = pluginRef.rtobjectName
|
|
189
|
-
const rtObjectRepo = pluginRef.rtobjectRepo
|
|
164
|
+
const rtObjectName = pluginRef.rtobjectName;
|
|
165
|
+
const rtObjectRepo = pluginRef.rtobjectRepo;
|
|
190
166
|
if (this.isIgnore(rtObjectRepo)) {
|
|
191
167
|
return true;
|
|
192
168
|
}
|
|
@@ -194,7 +170,7 @@ export class PluginFactory implements IPluginFactory {
|
|
|
194
170
|
return true;
|
|
195
171
|
}
|
|
196
172
|
if (this.loadQueue.has(rtObjectRepo)) {
|
|
197
|
-
const p = await this.loadQueue.get(rtObjectRepo)
|
|
173
|
+
const p = await this.loadQueue.get(rtObjectRepo);
|
|
198
174
|
try {
|
|
199
175
|
const result = await p;
|
|
200
176
|
return result;
|
|
@@ -204,14 +180,14 @@ export class PluginFactory implements IPluginFactory {
|
|
|
204
180
|
}
|
|
205
181
|
try {
|
|
206
182
|
const p = this.loadPluginRef(
|
|
207
|
-
pluginRef.rtobjectName
|
|
208
|
-
pluginRef.rtobjectRepo
|
|
183
|
+
pluginRef.rtobjectName,
|
|
184
|
+
pluginRef.rtobjectRepo
|
|
209
185
|
);
|
|
210
186
|
this.loadQueue.set(rtObjectRepo, p);
|
|
211
187
|
const result = await p;
|
|
212
188
|
return result;
|
|
213
189
|
} catch (error) {
|
|
214
|
-
throw new RuntimeModelError(pluginRef,
|
|
190
|
+
throw new core.RuntimeModelError(pluginRef, "\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25");
|
|
215
191
|
} finally {
|
|
216
192
|
this.loadQueue.delete(rtObjectRepo);
|
|
217
193
|
}
|
|
@@ -219,7 +195,6 @@ export class PluginFactory implements IPluginFactory {
|
|
|
219
195
|
}
|
|
220
196
|
return false;
|
|
221
197
|
}
|
|
222
|
-
|
|
223
198
|
/**
|
|
224
199
|
* 加载应用插件
|
|
225
200
|
*
|
|
@@ -228,36 +203,31 @@ export class PluginFactory implements IPluginFactory {
|
|
|
228
203
|
* @param {IPSAppPFPluginRef} pluginRef
|
|
229
204
|
* @return {*} {Promise<boolean>}
|
|
230
205
|
*/
|
|
231
|
-
async loadPluginRef(
|
|
232
|
-
rtObjectName: string,
|
|
233
|
-
rtObjectRepo: string,
|
|
234
|
-
): Promise<boolean> {
|
|
206
|
+
async loadPluginRef(rtObjectName, rtObjectRepo) {
|
|
235
207
|
if (this.isIgnore(rtObjectRepo)) {
|
|
236
208
|
return true;
|
|
237
209
|
}
|
|
238
210
|
if (this.pluginCache.has(rtObjectName)) {
|
|
239
211
|
return true;
|
|
240
212
|
}
|
|
241
|
-
let configData
|
|
213
|
+
let configData = null;
|
|
242
214
|
{
|
|
243
|
-
const pluginPath
|
|
244
|
-
const configUrl = this.urlReg.test(pluginPath)
|
|
245
|
-
? `${pluginPath}/package.json`
|
|
246
|
-
: `${ibiz.env.pluginBaseUrl}/${join(pluginPath, 'package.json')}`;
|
|
215
|
+
const pluginPath = rtObjectRepo;
|
|
216
|
+
const configUrl = this.urlReg.test(pluginPath) ? "".concat(pluginPath, "/package.json") : "".concat(ibiz.env.pluginBaseUrl, "/").concat(index.pathBrowserify.join(pluginPath, "package.json"));
|
|
247
217
|
const res = await ibiz.net.axios({
|
|
248
|
-
method:
|
|
249
|
-
headers: {
|
|
250
|
-
url: configUrl
|
|
218
|
+
method: "get",
|
|
219
|
+
headers: { "Access-Control-Allow-Origin": "*" },
|
|
220
|
+
url: configUrl
|
|
251
221
|
});
|
|
252
222
|
if (res.status !== 200) {
|
|
253
|
-
throw new Error(
|
|
223
|
+
throw new Error("\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25");
|
|
254
224
|
}
|
|
255
225
|
configData = res.data;
|
|
256
226
|
}
|
|
257
|
-
const remotePlugin = new RemotePluginItem(
|
|
227
|
+
const remotePlugin = new runtime.RemotePluginItem(
|
|
258
228
|
rtObjectName,
|
|
259
229
|
rtObjectRepo,
|
|
260
|
-
configData
|
|
230
|
+
configData
|
|
261
231
|
);
|
|
262
232
|
if (remotePlugin) {
|
|
263
233
|
await this.loadPluginExternal(remotePlugin.config);
|
|
@@ -271,7 +241,6 @@ export class PluginFactory implements IPluginFactory {
|
|
|
271
241
|
}
|
|
272
242
|
return false;
|
|
273
243
|
}
|
|
274
|
-
|
|
275
244
|
/**
|
|
276
245
|
* 加载插件
|
|
277
246
|
*
|
|
@@ -281,47 +250,46 @@ export class PluginFactory implements IPluginFactory {
|
|
|
281
250
|
* @param {RemotePluginItem} remotePlugin
|
|
282
251
|
* @return {*} {Promise<void>}
|
|
283
252
|
*/
|
|
284
|
-
|
|
285
|
-
const pluginPath
|
|
253
|
+
async loadScript(remotePlugin) {
|
|
254
|
+
const pluginPath = remotePlugin.repo;
|
|
286
255
|
const { name, system, styles = [] } = remotePlugin.config;
|
|
287
|
-
let scriptUrl =
|
|
288
|
-
scriptUrl = join(pluginPath, system);
|
|
256
|
+
let scriptUrl = "";
|
|
257
|
+
scriptUrl = index.pathBrowserify.join(pluginPath, system);
|
|
289
258
|
if (scriptUrl) {
|
|
290
259
|
if (this.cache.has(scriptUrl)) {
|
|
291
260
|
return;
|
|
292
261
|
}
|
|
293
|
-
let data
|
|
262
|
+
let data = null;
|
|
294
263
|
const url = this.parseUrl(scriptUrl);
|
|
295
|
-
const styleUrls = (typeof styles ===
|
|
296
|
-
styleUrl => this.parseUrl(
|
|
264
|
+
const styleUrls = (typeof styles === "string" ? [styles] : styles).map(
|
|
265
|
+
(styleUrl) => this.parseUrl(index.default.join(pluginPath, styleUrl))
|
|
297
266
|
);
|
|
298
267
|
System.addImportMap({
|
|
299
268
|
imports: {
|
|
300
|
-
[name]: url
|
|
269
|
+
[name]: url
|
|
301
270
|
},
|
|
302
271
|
styles: {
|
|
303
|
-
[name]: styleUrls
|
|
304
|
-
}
|
|
272
|
+
[name]: styleUrls
|
|
273
|
+
}
|
|
305
274
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
306
|
-
}
|
|
275
|
+
});
|
|
307
276
|
data = await System.import(name);
|
|
308
277
|
if (data) {
|
|
309
278
|
if (data.default) {
|
|
310
279
|
this.setPluginCode(data.default);
|
|
311
280
|
} else {
|
|
312
|
-
throw new RuntimeError(
|
|
313
|
-
|
|
281
|
+
throw new core.RuntimeError(
|
|
282
|
+
"\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u8FDC\u7A0B\u63D2\u4EF6\u672A\u627E\u5230[default]\u9ED8\u8BA4\u5BFC\u51FA"
|
|
314
283
|
);
|
|
315
284
|
}
|
|
316
285
|
this.cache.set(scriptUrl, true);
|
|
317
286
|
} else {
|
|
318
|
-
throw new RuntimeError(
|
|
319
|
-
|
|
287
|
+
throw new core.RuntimeError(
|
|
288
|
+
"\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u672A\u627E\u5230\u6587\u4EF6\u6216\u6587\u4EF6\u5185\u5BB9\u683C\u5F0F\u4E0D\u6B63\u786E"
|
|
320
289
|
);
|
|
321
290
|
}
|
|
322
291
|
}
|
|
323
292
|
}
|
|
324
|
-
|
|
325
293
|
/**
|
|
326
294
|
* 编译请求文件地址
|
|
327
295
|
*
|
|
@@ -332,33 +300,29 @@ export class PluginFactory implements IPluginFactory {
|
|
|
332
300
|
* @param {string} [baseUrl=ibiz.env.pluginBaseUrl]
|
|
333
301
|
* @return {*} {string}
|
|
334
302
|
*/
|
|
335
|
-
|
|
336
|
-
pathUrl: string,
|
|
337
|
-
baseUrl: string = ibiz.env.pluginBaseUrl,
|
|
338
|
-
): string {
|
|
303
|
+
parseUrl(pathUrl, baseUrl = ibiz.env.pluginBaseUrl) {
|
|
339
304
|
if (this.urlReg.test(pathUrl)) {
|
|
340
305
|
return pathUrl;
|
|
341
306
|
}
|
|
342
|
-
let url
|
|
307
|
+
let url = "";
|
|
343
308
|
if (this.urlReg.test(baseUrl)) {
|
|
344
|
-
if (pathUrl.startsWith(
|
|
309
|
+
if (pathUrl.startsWith("/")) {
|
|
345
310
|
url = baseUrl + pathUrl;
|
|
346
311
|
} else {
|
|
347
|
-
url =
|
|
312
|
+
url = "".concat(baseUrl, "/").concat(pathUrl);
|
|
348
313
|
}
|
|
349
314
|
} else {
|
|
350
|
-
url =
|
|
315
|
+
url = "".concat(index.pathBrowserify.join(baseUrl, pathUrl));
|
|
351
316
|
}
|
|
352
317
|
const { origin, pathname } = window.location;
|
|
353
|
-
if (pathname.endsWith(
|
|
318
|
+
if (pathname.endsWith("/") && url.startsWith("/")) {
|
|
354
319
|
url = url.substring(1);
|
|
355
320
|
}
|
|
356
321
|
if (this.urlReg.test(url) === false) {
|
|
357
|
-
url =
|
|
322
|
+
url = "".concat(origin).concat(pathname).concat(url);
|
|
358
323
|
}
|
|
359
324
|
return url;
|
|
360
325
|
}
|
|
361
|
-
|
|
362
326
|
/**
|
|
363
327
|
* 加载插件的外部依赖
|
|
364
328
|
*
|
|
@@ -368,34 +332,28 @@ export class PluginFactory implements IPluginFactory {
|
|
|
368
332
|
* @param {RemotePluginConfig} config
|
|
369
333
|
* @return {*} {Promise<void>}
|
|
370
334
|
*/
|
|
371
|
-
|
|
372
|
-
config
|
|
373
|
-
): Promise<void> {
|
|
374
|
-
if (!config['systemjs-importmap']) {
|
|
335
|
+
async loadPluginExternal(config) {
|
|
336
|
+
if (!config["systemjs-importmap"]) {
|
|
375
337
|
return;
|
|
376
338
|
}
|
|
377
|
-
const importMap = this.handleSystemImportMap(config[
|
|
339
|
+
const importMap = this.handleSystemImportMap(config["systemjs-importmap"]);
|
|
378
340
|
if (importMap.packages) {
|
|
379
341
|
const pkgs = importMap.packages;
|
|
380
|
-
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
|
381
342
|
for (const key in pkgs) {
|
|
382
343
|
const pkgPath = pkgs[key];
|
|
383
|
-
// eslint-disable-next-line no-await-in-loop
|
|
384
344
|
const res = await ibiz.net.axios({
|
|
385
|
-
method:
|
|
386
|
-
headers: {
|
|
387
|
-
url: pkgPath
|
|
345
|
+
method: "get",
|
|
346
|
+
headers: { "Access-Control-Allow-Origin": "*" },
|
|
347
|
+
url: pkgPath
|
|
388
348
|
});
|
|
389
349
|
if (res.status !== 200) {
|
|
390
|
-
throw new Error(
|
|
350
|
+
throw new Error("\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25");
|
|
391
351
|
}
|
|
392
|
-
|
|
393
|
-
await this.loadPluginExternal(res.data!);
|
|
352
|
+
await this.loadPluginExternal(res.data);
|
|
394
353
|
}
|
|
395
354
|
}
|
|
396
355
|
System.addImportMap(importMap);
|
|
397
356
|
}
|
|
398
|
-
|
|
399
357
|
/**
|
|
400
358
|
* 处理 systemjs importmap 配置
|
|
401
359
|
*
|
|
@@ -405,13 +363,10 @@ export class PluginFactory implements IPluginFactory {
|
|
|
405
363
|
* @param {ISystemImportMap} importMap
|
|
406
364
|
* @return {*} {IParams}
|
|
407
365
|
*/
|
|
408
|
-
|
|
409
|
-
importMap: ISystemImportMap,
|
|
410
|
-
): ISystemImportMap | null {
|
|
366
|
+
handleSystemImportMap(importMap) {
|
|
411
367
|
if (importMap) {
|
|
412
368
|
if (importMap.packages) {
|
|
413
369
|
const pkgs = importMap.packages;
|
|
414
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
415
370
|
for (const key in pkgs) {
|
|
416
371
|
if (Object.prototype.hasOwnProperty.call(pkgs, key)) {
|
|
417
372
|
const url = pkgs[key];
|
|
@@ -421,7 +376,6 @@ export class PluginFactory implements IPluginFactory {
|
|
|
421
376
|
}
|
|
422
377
|
if (importMap.imports) {
|
|
423
378
|
const imps = importMap.imports;
|
|
424
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
425
379
|
for (const key in imps) {
|
|
426
380
|
if (Object.prototype.hasOwnProperty.call(imps, key)) {
|
|
427
381
|
const url = imps[key];
|
|
@@ -431,15 +385,14 @@ export class PluginFactory implements IPluginFactory {
|
|
|
431
385
|
}
|
|
432
386
|
if (importMap.styles) {
|
|
433
387
|
const styles = importMap.styles;
|
|
434
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
435
388
|
for (const key in styles) {
|
|
436
389
|
if (Object.prototype.hasOwnProperty.call(styles, key)) {
|
|
437
390
|
const urls = styles[key];
|
|
438
|
-
if (typeof urls ===
|
|
391
|
+
if (typeof urls === "string") {
|
|
439
392
|
styles[key] = this.parseUrl(urls, importMap.baseUrl);
|
|
440
393
|
} else {
|
|
441
|
-
styles[key] = urls.map(
|
|
442
|
-
this.parseUrl(url, importMap.baseUrl)
|
|
394
|
+
styles[key] = urls.map(
|
|
395
|
+
(url) => this.parseUrl(url, importMap.baseUrl)
|
|
443
396
|
);
|
|
444
397
|
}
|
|
445
398
|
}
|
|
@@ -450,3 +403,5 @@ export class PluginFactory implements IPluginFactory {
|
|
|
450
403
|
return null;
|
|
451
404
|
}
|
|
452
405
|
}
|
|
406
|
+
|
|
407
|
+
exports.PluginFactory = PluginFactory;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
class RequiredProp {
|
|
5
|
+
constructor(type, _default, validator) {
|
|
6
|
+
this.required = true;
|
|
7
|
+
if (_default) {
|
|
8
|
+
this.default = _default;
|
|
9
|
+
}
|
|
10
|
+
if (validator) {
|
|
11
|
+
this.validator = validator;
|
|
12
|
+
}
|
|
13
|
+
this.type = type;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.RequiredProp = RequiredProp;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getArrayProps() {
|
|
7
|
+
return { ...common.getEditorProps(), value: [Array, Array] };
|
|
8
|
+
}
|
|
9
|
+
function getGridArrayProps() {
|
|
10
|
+
return { ...getArrayProps(), ...common.getGridEditorCommonProps() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getArrayProps = getArrayProps;
|
|
14
|
+
exports.getGridArrayProps = getGridArrayProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getAutoCompleteProps() {
|
|
7
|
+
return { ...common.getEditorProps(), value: [String, Number] };
|
|
8
|
+
}
|
|
9
|
+
function getGridAutoCompleteProps() {
|
|
10
|
+
return { ...getAutoCompleteProps(), ...common.getGridEditorCommonProps() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getAutoCompleteProps = getAutoCompleteProps;
|
|
14
|
+
exports.getGridAutoCompleteProps = getGridAutoCompleteProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getCascaderProps() {
|
|
7
|
+
return { ...common.getEditorProps(), value: String };
|
|
8
|
+
}
|
|
9
|
+
function getGridCascaderProps() {
|
|
10
|
+
return { ...getCascaderProps(), ...common.getGridEditorCommonProps() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getCascaderProps = getCascaderProps;
|
|
14
|
+
exports.getGridCascaderProps = getGridCascaderProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getCheckboxListProps() {
|
|
7
|
+
return { ...common.getEditorProps(), value: [String, Number] };
|
|
8
|
+
}
|
|
9
|
+
function getGridCheckboxListProps() {
|
|
10
|
+
return { ...getCheckboxListProps(), ...common.getGridEditorCommonProps() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getCheckboxListProps = getCheckboxListProps;
|
|
14
|
+
exports.getGridCheckboxListProps = getGridCheckboxListProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getCheckboxProps() {
|
|
7
|
+
return { ...common.getEditorProps(), value: [String, Number] };
|
|
8
|
+
}
|
|
9
|
+
function getGridCheckboxProps() {
|
|
10
|
+
return { ...getCheckboxProps(), ...common.getGridEditorCommonProps() };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.getCheckboxProps = getCheckboxProps;
|
|
14
|
+
exports.getGridCheckboxProps = getGridCheckboxProps;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('./common.cjs');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
function getCodeProps() {
|
|
7
|
+
return {
|
|
8
|
+
...common.getEditorProps(),
|
|
9
|
+
value: String,
|
|
10
|
+
language: {
|
|
11
|
+
type: String
|
|
12
|
+
},
|
|
13
|
+
theme: {
|
|
14
|
+
type: String
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function getGridCodeProps() {
|
|
19
|
+
return { ...getCodeProps(), ...common.getGridEditorCommonProps() };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.getCodeProps = getCodeProps;
|
|
23
|
+
exports.getGridCodeProps = getGridCodeProps;
|