@ibiz-template/vue3-util 0.7.41-alpha.13 → 0.7.41-alpha.131
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/dist/index.system.min.js +1 -1
- package/es/common/badge/badge.css +1 -1
- package/es/common/badge/badge.d.ts +6 -8
- package/es/common/badge/badge.d.ts.map +1 -1
- package/es/common/badge/badge.mjs +13 -7
- package/es/common/code-list/code-list.d.ts +10 -10
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +1 -1
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +9 -15
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +4 -4
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts.map +1 -1
- package/es/common/control-shell/control-shell.d.ts +7 -7
- package/es/common/control-shell/control-shell.d.ts.map +1 -1
- package/es/common/control-shell/control-shell.mjs +1 -1
- package/es/common/custom-render/custom-render.d.ts +4 -4
- package/es/common/custom-render/custom-render.d.ts.map +1 -1
- package/es/common/icon/icon.d.ts +4 -4
- package/es/common/icon/icon.d.ts.map +1 -1
- package/es/common/icon/icon.mjs +12 -0
- package/es/common/index.d.ts +1 -0
- package/es/common/index.d.ts.map +1 -1
- package/es/common/index.mjs +1 -0
- package/es/common/router-view/router-view.d.ts +7 -8
- package/es/common/router-view/router-view.d.ts.map +1 -1
- package/es/common/router-view/router-view.mjs +1 -1
- package/es/common/signature-pad/signature-pad.css +1 -0
- package/es/common/signature-pad/signature-pad.d.ts +19 -0
- package/es/common/signature-pad/signature-pad.d.ts.map +1 -0
- package/es/common/signature-pad/signature-pad.mjs +165 -0
- package/es/common/signature-pad/util/bezier.d.ts +58 -0
- package/es/common/signature-pad/util/bezier.d.ts.map +1 -0
- package/es/common/signature-pad/util/bezier.mjs +109 -0
- package/es/common/signature-pad/util/point.d.ts +55 -0
- package/es/common/signature-pad/util/point.d.ts.map +1 -0
- package/es/common/signature-pad/util/point.mjs +51 -0
- package/es/common/signature-pad/util/signature_pad.d.ts +593 -0
- package/es/common/signature-pad/util/signature_pad.d.ts.map +1 -0
- package/es/common/signature-pad/util/signature_pad.mjs +1018 -0
- package/es/common/view-shell/view-shell.d.ts +19 -12
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +42 -23
- package/es/control/panel/panel/index.d.ts +5 -5
- package/es/control/panel/panel/index.d.ts.map +1 -1
- package/es/control/panel/panel/panel.d.ts +6 -6
- package/es/control/panel/panel/panel.d.ts.map +1 -1
- package/es/control/panel/panel/panel.mjs +13 -5
- package/es/control/panel/view-layout-panel/index.d.ts +5 -5
- package/es/control/panel/view-layout-panel/index.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +7 -7
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +6 -6
- package/es/index.mjs +9 -11
- package/es/locale/en/index.d.ts +1 -0
- package/es/locale/en/index.d.ts.map +1 -1
- package/es/locale/en/index.mjs +2 -1
- package/es/locale/zh-CN/index.d.ts +1 -0
- package/es/locale/zh-CN/index.d.ts.map +1 -1
- package/es/locale/zh-CN/index.mjs +2 -1
- package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +2 -2
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.mjs +3 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +6 -4
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.mjs +17 -6
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts +6 -4
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.controller.d.ts +3 -3
- package/es/panel-component/grid-container/grid-container.controller.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.controller.mjs +2 -2
- package/es/panel-component/grid-container/grid-container.d.ts +8 -6
- package/es/panel-component/grid-container/grid-container.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.mjs +17 -6
- package/es/panel-component/grid-container/grid-container.state.d.ts +3 -3
- package/es/panel-component/grid-container/grid-container.state.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.state.mjs +2 -2
- package/es/panel-component/grid-container/index.d.ts +8 -6
- package/es/panel-component/grid-container/index.d.ts.map +1 -1
- package/es/panel-component/index.d.ts +0 -1
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +1 -5
- package/es/panel-component/multi-data-container/index.d.ts +6 -4
- package/es/panel-component/multi-data-container/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts +4 -4
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.mjs +88 -69
- package/es/panel-component/multi-data-container/multi-data-container.d.ts +7 -5
- package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.mjs +20 -6
- package/es/panel-component/multi-data-container/multi-data-container.state.d.ts +3 -3
- package/es/panel-component/multi-data-container/multi-data-container.state.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.state.mjs +2 -2
- package/es/panel-component/multi-data-container-raw/index.d.ts +6 -4
- package/es/panel-component/multi-data-container-raw/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts +4 -4
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs +88 -69
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +7 -5
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.mjs +23 -7
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts +3 -3
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.mjs +2 -2
- package/es/panel-component/nav-pos/index.d.ts +7 -5
- package/es/panel-component/nav-pos/index.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.d.ts +8 -6
- package/es/panel-component/nav-pos/nav-pos.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +20 -5
- package/es/panel-component/panel-container/index.d.ts +7 -6
- package/es/panel-component/panel-container/index.d.ts.map +1 -1
- package/es/panel-component/panel-container/index.mjs +1 -2
- package/es/panel-component/panel-container/panel-container.d.ts +7 -5
- package/es/panel-component/panel-container/panel-container.d.ts.map +1 -1
- package/es/panel-component/panel-container/panel-container.mjs +36 -15
- package/es/panel-component/panel-container/panel-container.provider.d.ts +2 -2
- package/es/panel-component/panel-container/panel-container.provider.d.ts.map +1 -1
- package/es/panel-component/panel-container/panel-container.provider.mjs +1 -1
- package/es/panel-component/panel-container-image/index.d.ts +6 -4
- package/es/panel-component/panel-container-image/index.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts +3 -3
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.controller.mjs +2 -2
- package/es/panel-component/panel-container-image/panel-container-image.css +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +6 -4
- package/es/panel-component/panel-container-image/panel-container-image.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.mjs +24 -10
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts +3 -3
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.state.mjs +2 -2
- package/es/panel-component/panel-container-tabs/index.d.ts +6 -6
- package/es/panel-component/panel-container-tabs/index.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +5 -5
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.mjs +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts +2 -2
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.mjs +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +6 -4
- package/es/panel-component/panel-ctrl-pos/index.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +6 -4
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.mjs +12 -4
- package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts +6 -4
- package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.css +1 -0
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts +7 -4
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.mjs +16 -8
- package/es/panel-component/panel-field/index.d.ts +7 -4
- package/es/panel-component/panel-field/index.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.controller.d.ts +12 -0
- package/es/panel-component/panel-field/panel-field.controller.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.controller.mjs +37 -3
- package/es/panel-component/panel-field/panel-field.css +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +7 -4
- package/es/panel-component/panel-field/panel-field.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.mjs +29 -12
- package/es/panel-component/panel-item-render/index.d.ts +6 -4
- package/es/panel-component/panel-item-render/index.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.controller.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.controller.mjs +7 -5
- package/es/panel-component/panel-item-render/panel-item-render.d.ts +6 -4
- package/es/panel-component/panel-item-render/panel-item-render.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.mjs +13 -4
- package/es/panel-component/panel-rawitem/index.d.ts +8 -6
- package/es/panel-component/panel-rawitem/index.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +8 -6
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.mjs +15 -10
- package/es/panel-component/panel-tab-page/index.d.ts +8 -6
- package/es/panel-component/panel-tab-page/index.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +10 -8
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.mjs +23 -8
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts +2 -2
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.mjs +2 -2
- package/es/panel-component/scroll-container/index.d.ts +6 -4
- package/es/panel-component/scroll-container/index.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.d.ts +3 -3
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.mjs +2 -2
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +6 -4
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.mjs +26 -15
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.d.ts +3 -3
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.mjs +2 -2
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +6 -4
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.mjs +21 -6
- package/es/panel-component/single-data-container/index.d.ts +6 -4
- package/es/panel-component/single-data-container/index.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts +4 -4
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.mjs +98 -73
- package/es/panel-component/single-data-container/single-data-container.d.ts +7 -5
- package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.mjs +22 -6
- package/es/panel-component/single-data-container/single-data-container.state.d.ts +3 -3
- package/es/panel-component/single-data-container/single-data-container.state.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.state.mjs +2 -2
- package/es/panel-component/teleport-placeholder/index.d.ts +7 -5
- package/es/panel-component/teleport-placeholder/index.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +7 -5
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.mjs +11 -4
- package/es/plugin/plugin-factory/plugin-factory.d.ts +15 -0
- package/es/plugin/plugin-factory/plugin-factory.d.ts.map +1 -1
- package/es/plugin/plugin-factory/plugin-factory.mjs +34 -6
- package/es/props/editor/autocomplete.d.ts +2 -2
- package/es/props/editor/check-box-list.d.ts +2 -2
- package/es/props/editor/check-box.d.ts +2 -2
- package/es/props/editor/code.d.ts +17 -0
- package/es/props/editor/code.d.ts.map +1 -1
- package/es/props/editor/code.mjs +7 -2
- package/es/props/editor/common.d.ts +7 -0
- package/es/props/editor/common.d.ts.map +1 -1
- package/es/props/editor/common.mjs +5 -1
- package/es/props/editor/data-picker.d.ts +2 -2
- package/es/props/editor/date-picker.d.ts +2 -2
- package/es/props/editor/date-range-select.d.ts +4 -0
- package/es/props/editor/date-range-select.d.ts.map +1 -1
- package/es/props/editor/date-range.d.ts +2 -2
- package/es/props/editor/dropdown-list.d.ts +2 -2
- package/es/props/editor/html.d.ts +17 -0
- package/es/props/editor/html.d.ts.map +1 -1
- package/es/props/editor/html.mjs +7 -2
- package/es/props/editor/index.mjs +3 -3
- package/es/props/editor/list-box.d.ts +2 -2
- package/es/props/editor/markdown.d.ts +89 -0
- package/es/props/editor/markdown.d.ts.map +1 -1
- package/es/props/editor/markdown.mjs +28 -3
- package/es/props/editor/number-range.d.ts +2 -2
- package/es/props/editor/radio-button-list.d.ts +2 -2
- package/es/props/editor/rate.d.ts +2 -2
- package/es/props/editor/raw.d.ts +2 -2
- package/es/props/editor/slider.d.ts +2 -2
- package/es/props/editor/span.d.ts +18 -2
- package/es/props/editor/span.d.ts.map +1 -1
- package/es/props/editor/span.mjs +6 -1
- package/es/props/editor/stepper.d.ts +2 -2
- package/es/props/editor/switch.d.ts +2 -2
- package/es/props/editor/text-box.d.ts +2 -2
- package/es/props/index.mjs +3 -3
- package/es/use/index.d.ts +2 -0
- package/es/use/index.d.ts.map +1 -1
- package/es/use/index.mjs +4 -2
- package/es/use/popover/popover.d.ts +7 -0
- package/es/use/popover/popover.d.ts.map +1 -1
- package/es/use/popover/popover.mjs +9 -2
- package/es/use/storage/index.d.ts +4 -6
- package/es/use/storage/index.d.ts.map +1 -1
- package/es/use/storage/index.mjs +16 -11
- package/es/use/tooltip/tooltip.d.ts +103 -0
- package/es/use/tooltip/tooltip.d.ts.map +1 -0
- package/es/use/tooltip/tooltip.mjs +68 -0
- package/es/use/use-semantic-node/use-semantic-node.d.ts +15 -0
- package/es/use/use-semantic-node/use-semantic-node.d.ts.map +1 -0
- package/es/use/use-semantic-node/use-semantic-node.mjs +100 -0
- package/es/use/vue/vue.d.ts +9 -0
- package/es/use/vue/vue.d.ts.map +1 -1
- package/es/use/vue/vue.mjs +15 -2
- package/es/util/index.d.ts +0 -1
- package/es/util/index.d.ts.map +1 -1
- package/es/util/index.mjs +0 -1
- package/es/util/install.d.ts.map +1 -1
- package/es/util/overlay-container/overlay-container.d.ts +1 -1
- package/es/util/overlay-container/overlay-container.d.ts.map +1 -1
- package/es/util/overlay-container/overlay-container.mjs +7 -2
- package/es/util/overlay-view-util/overlay-view-util.d.ts +2 -2
- package/es/util/overlay-view-util/overlay-view-util.d.ts.map +1 -1
- package/es/util/overlay-view-util/overlay-view-util.mjs +2 -1
- package/es/util/route/route.d.ts.map +1 -1
- package/es/util/route/route.mjs +13 -3
- package/es/util/store/app-store/app-store.d.ts +2 -2
- package/es/util/store/ui-store/ui-store.d.ts +2 -2
- package/es/view/app-redirect-view/app-redirect-view.d.ts +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts.map +1 -1
- package/es/view/app-redirect-view/app-redirect-view.mjs +1 -1
- package/es/view/common/index.d.ts +5 -5
- package/es/view/common/index.d.ts.map +1 -1
- package/es/view/common/view.d.ts +5 -5
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +17 -3
- package/es/view/de-redirect-view/de-redirect-view.d.ts +8 -8
- package/es/view/de-redirect-view/de-redirect-view.d.ts.map +1 -1
- package/es/view/de-redirect-view/de-redirect-view.mjs +1 -1
- package/es/view/de-redirect-view/index.d.ts +8 -8
- package/es/view/de-redirect-view/index.d.ts.map +1 -1
- package/es/view/html-view/html-view.d.ts +8 -9
- package/es/view/html-view/html-view.d.ts.map +1 -1
- package/es/view/html-view/html-view.mjs +10 -17
- package/es/view/html-view/index.d.ts +7 -8
- package/es/view/html-view/index.d.ts.map +1 -1
- package/es/view/portal-view/index.d.ts +5 -5
- package/es/view/portal-view/index.d.ts.map +1 -1
- package/es/view/portal-view/portal-view.d.ts +5 -5
- package/es/view/portal-view/portal-view.d.ts.map +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts.map +1 -1
- package/lib/common/badge/badge.cjs +12 -6
- package/lib/common/badge/badge.css +1 -1
- package/lib/common/control-base/control-base.cjs +8 -14
- package/lib/common/icon/icon.cjs +12 -0
- package/lib/common/index.cjs +2 -0
- package/lib/common/signature-pad/signature-pad.cjs +167 -0
- package/lib/common/signature-pad/signature-pad.css +1 -0
- package/lib/common/signature-pad/util/bezier.cjs +111 -0
- package/lib/common/signature-pad/util/point.cjs +53 -0
- package/lib/common/signature-pad/util/signature_pad.cjs +1022 -0
- package/lib/common/view-shell/view-shell.cjs +40 -21
- package/lib/control/panel/panel/panel.cjs +11 -3
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +4 -4
- package/lib/index.cjs +57 -47
- package/lib/locale/en/index.cjs +2 -1
- package/lib/locale/zh-CN/index.cjs +2 -1
- package/lib/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.cjs +2 -2
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.cjs +16 -5
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.cjs +3 -1
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
- package/lib/panel-component/grid-container/grid-container.cjs +16 -5
- package/lib/panel-component/grid-container/grid-container.controller.cjs +1 -1
- package/lib/panel-component/grid-container/grid-container.state.cjs +1 -1
- package/lib/panel-component/index.cjs +21 -22
- package/lib/panel-component/multi-data-container/multi-data-container.cjs +19 -5
- package/lib/panel-component/multi-data-container/multi-data-container.controller.cjs +87 -68
- package/lib/panel-component/multi-data-container/multi-data-container.state.cjs +1 -1
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.cjs +22 -6
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs +87 -68
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.state.cjs +1 -1
- package/lib/panel-component/nav-pos/nav-pos.cjs +18 -3
- package/lib/panel-component/panel-container/index.cjs +8 -4
- package/lib/panel-component/panel-container/panel-container.cjs +36 -15
- package/lib/panel-component/panel-container/panel-container.provider.cjs +2 -2
- package/lib/panel-component/panel-container-image/panel-container-image.cjs +23 -9
- package/lib/panel-component/panel-container-image/panel-container-image.controller.cjs +1 -1
- package/lib/panel-component/panel-container-image/panel-container-image.css +1 -1
- package/lib/panel-component/panel-container-image/panel-container-image.state.cjs +1 -1
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.cjs +2 -2
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.provider.cjs +2 -2
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.cjs +11 -3
- package/lib/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.cjs +15 -7
- package/lib/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.css +1 -0
- package/lib/panel-component/panel-field/panel-field.cjs +28 -11
- package/lib/panel-component/panel-field/panel-field.controller.cjs +37 -3
- package/lib/panel-component/panel-field/panel-field.css +1 -1
- package/lib/panel-component/panel-item-render/panel-item-render.cjs +12 -3
- package/lib/panel-component/panel-item-render/panel-item-render.controller.cjs +7 -5
- package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +14 -9
- package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +21 -6
- package/lib/panel-component/panel-tab-page/panel-tab-page.provider.cjs +1 -1
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.cjs +25 -14
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.controller.cjs +1 -1
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.cjs +20 -5
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.cjs +1 -1
- package/lib/panel-component/single-data-container/single-data-container.cjs +21 -5
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +97 -72
- package/lib/panel-component/single-data-container/single-data-container.state.cjs +1 -1
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.cjs +10 -3
- package/lib/plugin/plugin-factory/plugin-factory.cjs +33 -5
- package/lib/props/editor/code.cjs +6 -0
- package/lib/props/editor/common.cjs +5 -1
- package/lib/props/editor/html.cjs +6 -0
- package/lib/props/editor/index.cjs +3 -0
- package/lib/props/editor/markdown.cjs +27 -1
- package/lib/props/editor/span.cjs +6 -1
- package/lib/props/index.cjs +3 -0
- package/lib/use/index.cjs +8 -0
- package/lib/use/popover/popover.cjs +8 -0
- package/lib/use/storage/index.cjs +16 -11
- package/lib/use/tooltip/tooltip.cjs +72 -0
- package/lib/use/use-semantic-node/use-semantic-node.cjs +102 -0
- package/lib/use/vue/vue.cjs +14 -0
- package/lib/util/index.cjs +0 -2
- package/lib/util/overlay-container/overlay-container.cjs +7 -2
- package/lib/util/overlay-view-util/overlay-view-util.cjs +2 -1
- package/lib/util/route/route.cjs +13 -3
- package/lib/view/common/view.cjs +15 -1
- package/lib/view/html-view/html-view.cjs +8 -15
- package/package.json +8 -7
- package/src/common/badge/badge.scss +49 -0
- package/src/common/badge/badge.tsx +55 -0
- package/src/common/code-list/code-list.scss +15 -0
- package/src/common/code-list/code-list.tsx +184 -0
- package/src/common/control-base/control-base.scss +42 -0
- package/src/common/control-base/control-base.tsx +308 -0
- package/src/common/control-loading-placeholder/control-loading-placeholder.tsx +22 -0
- package/src/common/control-shell/control-shell.scss +5 -0
- package/src/common/control-shell/control-shell.tsx +90 -0
- package/src/common/custom-render/custom-render.scss +4 -0
- package/src/common/custom-render/custom-render.tsx +111 -0
- package/src/common/icon/icon.scss +13 -0
- package/src/common/icon/icon.tsx +105 -0
- package/src/common/index.ts +10 -0
- package/src/common/router-view/router-view.tsx +74 -0
- package/src/common/signature-pad/signature-pad.scss +10 -0
- package/src/common/signature-pad/signature-pad.tsx +174 -0
- package/src/common/signature-pad/util/bezier.ts +164 -0
- package/src/common/signature-pad/util/point.ts +96 -0
- package/src/common/signature-pad/util/signature_pad.ts +1543 -0
- package/src/common/view-shell/view-shell.scss +5 -0
- package/src/common/view-shell/view-shell.tsx +337 -0
- package/src/control/index.ts +1 -0
- package/src/control/panel/index.ts +2 -0
- package/src/control/panel/panel/index.ts +12 -0
- package/src/control/panel/panel/panel.provider.ts +14 -0
- package/src/control/panel/panel/panel.scss +9 -0
- package/src/control/panel/panel/panel.tsx +273 -0
- package/src/control/panel/view-layout-panel/index.ts +18 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.provider.ts +14 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.scss +9 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.tsx +266 -0
- package/src/hooks/app/app.hooks.ts +63 -0
- package/src/hooks/index.ts +1 -0
- package/src/index.ts +19 -0
- package/src/interface/index.ts +1 -0
- package/src/interface/util/index.ts +1 -0
- package/src/interface/util/route/route.ts +116 -0
- package/src/locale/en/index.ts +74 -0
- package/src/locale/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +66 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.ts +248 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.ts +28 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.scss +51 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.ts +58 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.tsx +109 -0
- package/src/panel-component/auth-wxmp-qrcode/index.ts +18 -0
- package/src/panel-component/grid-container/grid-container.controller.ts +24 -0
- package/src/panel-component/grid-container/grid-container.provider.ts +30 -0
- package/src/panel-component/grid-container/grid-container.scss +17 -0
- package/src/panel-component/grid-container/grid-container.state.ts +12 -0
- package/src/panel-component/grid-container/grid-container.tsx +141 -0
- package/src/panel-component/grid-container/index.ts +19 -0
- package/src/panel-component/index.ts +17 -0
- package/src/panel-component/multi-data-container/index.ts +22 -0
- package/src/panel-component/multi-data-container/multi-data-container-item.controller.ts +179 -0
- package/src/panel-component/multi-data-container/multi-data-container-itm.state.ts +20 -0
- package/src/panel-component/multi-data-container/multi-data-container.controller.ts +456 -0
- package/src/panel-component/multi-data-container/multi-data-container.provider.ts +30 -0
- package/src/panel-component/multi-data-container/multi-data-container.scss +10 -0
- package/src/panel-component/multi-data-container/multi-data-container.state.ts +19 -0
- package/src/panel-component/multi-data-container/multi-data-container.tsx +137 -0
- package/src/panel-component/multi-data-container-raw/index.ts +22 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.controller.ts +448 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.provider.ts +30 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.scss +12 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.state.ts +19 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.tsx +129 -0
- package/src/panel-component/nav-pos/index.ts +16 -0
- package/src/panel-component/nav-pos/nav-pos.controller.ts +438 -0
- package/src/panel-component/nav-pos/nav-pos.provider.ts +38 -0
- package/src/panel-component/nav-pos/nav-pos.scss +4 -0
- package/src/panel-component/nav-pos/nav-pos.state.ts +55 -0
- package/src/panel-component/nav-pos/nav-pos.tsx +166 -0
- package/src/panel-component/panel-container/index.ts +30 -0
- package/src/panel-component/panel-container/panel-container.provider.ts +30 -0
- package/src/panel-component/panel-container/panel-container.scss +21 -0
- package/src/panel-component/panel-container/panel-container.tsx +138 -0
- package/src/panel-component/panel-container-image/index.ts +22 -0
- package/src/panel-component/panel-container-image/panel-container-image.controller.ts +24 -0
- package/src/panel-component/panel-container-image/panel-container-image.provider.ts +30 -0
- package/src/panel-component/panel-container-image/panel-container-image.scss +17 -0
- package/src/panel-component/panel-container-image/panel-container-image.state.ts +12 -0
- package/src/panel-component/panel-container-image/panel-container-image.tsx +116 -0
- package/src/panel-component/panel-container-tabs/index.ts +18 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.provider.ts +30 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.scss +25 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.tsx +47 -0
- package/src/panel-component/panel-ctrl-pos/index.ts +14 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.controller.ts +50 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.provider.ts +30 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.scss +8 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.tsx +72 -0
- package/src/panel-component/panel-ctrl-view-page-caption/index.ts +18 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.controller.ts +32 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.provider.ts +30 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.scss +13 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.state.ts +17 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.tsx +77 -0
- package/src/panel-component/panel-field/index.ts +14 -0
- package/src/panel-component/panel-field/panel-field.controller.ts +272 -0
- package/src/panel-component/panel-field/panel-field.provider.ts +28 -0
- package/src/panel-component/panel-field/panel-field.scss +79 -0
- package/src/panel-component/panel-field/panel-field.state.ts +17 -0
- package/src/panel-component/panel-field/panel-field.tsx +138 -0
- package/src/panel-component/panel-item-render/index.ts +18 -0
- package/src/panel-component/panel-item-render/panel-item-render.controller.ts +53 -0
- package/src/panel-component/panel-item-render/panel-item-render.provider.ts +30 -0
- package/src/panel-component/panel-item-render/panel-item-render.tsx +69 -0
- package/src/panel-component/panel-rawitem/index.ts +26 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.controller.ts +54 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.provider.ts +28 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.scss +8 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.tsx +126 -0
- package/src/panel-component/panel-tab-page/index.ts +12 -0
- package/src/panel-component/panel-tab-page/panel-tab-page.provider.ts +28 -0
- package/src/panel-component/panel-tab-page/panel-tab-page.tsx +83 -0
- package/src/panel-component/scroll-container/index.ts +44 -0
- package/src/panel-component/scroll-container/scroll-container/index.ts +2 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.controller.ts +29 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.provider.ts +30 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.scss +40 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.tsx +155 -0
- package/src/panel-component/scroll-container/scroll-container-item/index.ts +2 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.ts +21 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.provider.ts +30 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.scss +9 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.tsx +80 -0
- package/src/panel-component/single-data-container/index.ts +22 -0
- package/src/panel-component/single-data-container/single-data-container.controller.ts +507 -0
- package/src/panel-component/single-data-container/single-data-container.provider.ts +30 -0
- package/src/panel-component/single-data-container/single-data-container.scss +10 -0
- package/src/panel-component/single-data-container/single-data-container.state.ts +17 -0
- package/src/panel-component/single-data-container/single-data-container.tsx +124 -0
- package/src/panel-component/teleport-placeholder/index.ts +20 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.controller.ts +54 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.provider.ts +30 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.scss +8 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.state.ts +17 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.tsx +65 -0
- package/src/plugin/index.ts +1 -0
- package/src/plugin/plugin-factory/plugin-factory.ts +519 -0
- package/src/props/common.ts +30 -0
- package/src/props/editor/array.ts +28 -0
- package/src/props/editor/autocomplete.ts +28 -0
- package/src/props/editor/cascader.ts +28 -0
- package/src/props/editor/check-box-list.ts +28 -0
- package/src/props/editor/check-box.ts +28 -0
- package/src/props/editor/code.ts +56 -0
- package/src/props/editor/color-picker.ts +28 -0
- package/src/props/editor/common.ts +120 -0
- package/src/props/editor/data-picker.ts +28 -0
- package/src/props/editor/date-picker.ts +29 -0
- package/src/props/editor/date-range-select.ts +52 -0
- package/src/props/editor/date-range.ts +29 -0
- package/src/props/editor/dropdown-list.ts +28 -0
- package/src/props/editor/html.ts +44 -0
- package/src/props/editor/index.ts +29 -0
- package/src/props/editor/input-ip.ts +28 -0
- package/src/props/editor/input-number.ts +28 -0
- package/src/props/editor/list-box.ts +28 -0
- package/src/props/editor/map-picker.ts +28 -0
- package/src/props/editor/markdown.ts +74 -0
- package/src/props/editor/number-range.ts +28 -0
- package/src/props/editor/radio-button-list.ts +28 -0
- package/src/props/editor/rate.ts +28 -0
- package/src/props/editor/raw.ts +28 -0
- package/src/props/editor/slider.ts +28 -0
- package/src/props/editor/span.ts +33 -0
- package/src/props/editor/stepper.ts +28 -0
- package/src/props/editor/switch.ts +28 -0
- package/src/props/editor/text-box.ts +28 -0
- package/src/props/editor/upload.ts +28 -0
- package/src/props/index.ts +2 -0
- package/src/types/index.d.ts +8 -0
- package/src/use/autofocus-blur/autofocus-blur.ts +31 -0
- package/src/use/click-outside/click-outside.ts +72 -0
- package/src/use/codeList-listen/codelist-listen.ts +28 -0
- package/src/use/control/index.ts +1 -0
- package/src/use/control/use-control-controller/use-control-controller.ts +186 -0
- package/src/use/event/event.ts +57 -0
- package/src/use/focus-blur/focus-blur.ts +83 -0
- package/src/use/index.ts +16 -0
- package/src/use/namespace/namespace.ts +14 -0
- package/src/use/popover/popover.ts +157 -0
- package/src/use/route/route.ts +47 -0
- package/src/use/storage/index.ts +46 -0
- package/src/use/tooltip/tooltip.ts +153 -0
- package/src/use/use-semantic-node/use-semantic-node.ts +154 -0
- package/src/use/util/index.ts +26 -0
- package/src/use/view/index.ts +2 -0
- package/src/use/view/use-view-controller/use-view-controller.ts +163 -0
- package/src/use/view/use-view-operation/use-view-operation.ts +44 -0
- package/src/use/vue/vue.ts +168 -0
- package/src/use/vue-use/computed-async.ts +151 -0
- package/src/use/vue-use/index.ts +1 -0
- package/src/util/index.ts +9 -0
- package/src/util/install.ts +14 -0
- package/src/util/overlay-container/overlay-container.ts +162 -0
- package/src/util/overlay-popover-container/overlay-popover-container.ts +30 -0
- package/src/util/overlay-view-util/overlay-view-util.ts +93 -0
- package/src/util/render/render.ts +54 -0
- package/src/util/route/route-listener.ts +91 -0
- package/src/util/route/route.ts +606 -0
- package/src/util/router-callback/router-callback-item.ts +98 -0
- package/src/util/router-callback/router-callback.ts +110 -0
- package/src/util/store/app-store/app-store.ts +10 -0
- package/src/util/store/index.ts +6 -0
- package/src/util/store/ui-store/ui-store.ts +37 -0
- package/src/util/store/ui-store/z-index.ts +53 -0
- package/src/view/app-data-upload-view/app-data-upload-view.provider.ts +31 -0
- package/src/view/app-redirect-view/app-redirect-view.tsx +26 -0
- package/src/view/common/index.ts +19 -0
- package/src/view/common/view.provider.ts +14 -0
- package/src/view/common/view.scss +39 -0
- package/src/view/common/view.tsx +285 -0
- package/src/view/de-redirect-view/de-redirect-view.provider.ts +14 -0
- package/src/view/de-redirect-view/de-redirect-view.tsx +86 -0
- package/src/view/de-redirect-view/index.ts +17 -0
- package/src/view/html-view/html-view.provider.ts +14 -0
- package/src/view/html-view/html-view.scss +7 -0
- package/src/view/html-view/html-view.tsx +86 -0
- package/src/view/html-view/index.ts +10 -0
- package/src/view/index.ts +6 -0
- package/src/view/md-custom-view/md-custom-view.provider.ts +30 -0
- package/src/view/portal-view/index.ts +18 -0
- package/src/view/portal-view/portal-view.provider.ts +14 -0
- package/src/view/portal-view/portal-view.tsx +83 -0
- package/src/view/todo-redirect/todo-redirect.tsx +51 -0
- package/es/panel-component/panel-container/panel-container.controller.d.ts +0 -21
- package/es/panel-component/panel-container/panel-container.controller.d.ts.map +0 -1
- package/es/panel-component/panel-container/panel-container.controller.mjs +0 -12
- package/es/panel-component/panel-container/panel-container.state.d.ts +0 -10
- package/es/panel-component/panel-container/panel-container.state.d.ts.map +0 -1
- package/es/panel-component/panel-container/panel-container.state.mjs +0 -7
- package/es/panel-component/panel-container-group/index.d.ts +0 -29
- package/es/panel-component/panel-container-group/index.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/index.mjs +0 -21
- package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts +0 -34
- package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.controller.mjs +0 -31
- package/es/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +0 -46
- package/es/panel-component/panel-container-group/panel-container-group.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.mjs +0 -119
- package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts +0 -16
- package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.provider.mjs +0 -15
- package/es/panel-component/panel-container-group/panel-container-group.state.d.ts +0 -13
- package/es/panel-component/panel-container-group/panel-container-group.state.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.state.mjs +0 -7
- package/es/util/control/prepare-control.d.ts +0 -15
- package/es/util/control/prepare-control.d.ts.map +0 -1
- package/es/util/control/prepare-control.mjs +0 -22
- package/lib/panel-component/panel-container/panel-container.controller.cjs +0 -14
- package/lib/panel-component/panel-container/panel-container.state.cjs +0 -9
- package/lib/panel-component/panel-container-group/index.cjs +0 -28
- package/lib/panel-component/panel-container-group/panel-container-group.cjs +0 -121
- package/lib/panel-component/panel-container-group/panel-container-group.controller.cjs +0 -33
- package/lib/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/lib/panel-component/panel-container-group/panel-container-group.provider.cjs +0 -17
- package/lib/panel-component/panel-container-group/panel-container-group.state.cjs +0 -9
- package/lib/util/control/prepare-control.cjs +0 -24
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
import { IControlItem } from '@ibiz/model-core';
|
|
3
|
+
import { h, type VNode, resolveComponent } from 'vue';
|
|
4
|
+
import { IControlController, ScriptFactory } from '@ibiz-template/runtime';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @description 位置
|
|
8
|
+
* @export
|
|
9
|
+
* @enum {string}
|
|
10
|
+
*/
|
|
11
|
+
export enum TooltipPlacement {
|
|
12
|
+
TOP = 'top',
|
|
13
|
+
TOP_START = 'top-start',
|
|
14
|
+
TOP_END = 'top-end',
|
|
15
|
+
BOTTOM = 'bottom',
|
|
16
|
+
BOTTOM_START = 'bottom-start',
|
|
17
|
+
BOTTOM_END = 'bottom-end',
|
|
18
|
+
LEFT = 'left',
|
|
19
|
+
LEFT_START = 'left-start',
|
|
20
|
+
LEFT_END = 'left-end',
|
|
21
|
+
RIGHT = 'right',
|
|
22
|
+
RIGHT_START = 'right-start',
|
|
23
|
+
RIGHT_END = 'right-end',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @description 触发方式
|
|
28
|
+
* @export
|
|
29
|
+
* @enum {string}
|
|
30
|
+
*/
|
|
31
|
+
export enum TooltipTrigger {
|
|
32
|
+
HOVER = 'hover',
|
|
33
|
+
CLICK = 'click',
|
|
34
|
+
FOCUS = 'focus',
|
|
35
|
+
CONTEXTMENU = 'contextmenu',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type TooltipContent = string | VNode | (() => VNode);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @description tooltip配置
|
|
42
|
+
* @export
|
|
43
|
+
* @interface TooltipOptions
|
|
44
|
+
*/
|
|
45
|
+
export interface TooltipOptions {
|
|
46
|
+
/**
|
|
47
|
+
* @description 内容
|
|
48
|
+
* @type {TooltipContent}
|
|
49
|
+
* @memberof TooltipOptions
|
|
50
|
+
*/
|
|
51
|
+
content: TooltipContent;
|
|
52
|
+
/**
|
|
53
|
+
* @description 位置
|
|
54
|
+
* @default 'top'
|
|
55
|
+
* @type {TooltipPlacement}
|
|
56
|
+
* @memberof TooltipOptions
|
|
57
|
+
*/
|
|
58
|
+
placement?: TooltipPlacement;
|
|
59
|
+
/**
|
|
60
|
+
* @description 触发方式
|
|
61
|
+
* @default 'hover'
|
|
62
|
+
* @type {TooltipTrigger}
|
|
63
|
+
* @memberof TooltipOptions
|
|
64
|
+
*/
|
|
65
|
+
trigger?: TooltipTrigger;
|
|
66
|
+
/**
|
|
67
|
+
* @description 出现位置的偏移量
|
|
68
|
+
* @type {number}
|
|
69
|
+
* @memberof TooltipOptions
|
|
70
|
+
*/
|
|
71
|
+
offset?: number;
|
|
72
|
+
/**
|
|
73
|
+
* @description 为 Tooltip 的 popper 添加类名
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof TooltipOptions
|
|
76
|
+
*/
|
|
77
|
+
popperClass?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @description 为 Tooltip 的 popper 添加自定义样式
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof TooltipOptions
|
|
82
|
+
*/
|
|
83
|
+
popperStyle?: string;
|
|
84
|
+
/**
|
|
85
|
+
* @description 是否有箭头
|
|
86
|
+
* @default true
|
|
87
|
+
* @type {boolean}
|
|
88
|
+
* @memberof TooltipOptions
|
|
89
|
+
*/
|
|
90
|
+
showArrow?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* @description 禁用
|
|
93
|
+
* @type {boolean}
|
|
94
|
+
* @memberof TooltipOptions
|
|
95
|
+
*/
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @description 绘制tooltip
|
|
101
|
+
* @export
|
|
102
|
+
* @param {IData} data 数据
|
|
103
|
+
* @param {IControlItem} model 部件项模型
|
|
104
|
+
* @param {IControlController} ctrl 部件控制器
|
|
105
|
+
* @param {string} [tooltipId = `${model.id?.toLowerCase()}_tooltip`] tooltip标识[默认部件项模型标识]
|
|
106
|
+
* @returns {*} {TooltipOptions}
|
|
107
|
+
*/
|
|
108
|
+
export function renderTooltip(
|
|
109
|
+
data: IData,
|
|
110
|
+
model: IControlItem,
|
|
111
|
+
ctrl: IControlController,
|
|
112
|
+
tooltipId = `${model.id?.toLowerCase()}_tooltip`,
|
|
113
|
+
): TooltipOptions {
|
|
114
|
+
const options: TooltipOptions = {
|
|
115
|
+
content: '',
|
|
116
|
+
disabled: true,
|
|
117
|
+
placement: TooltipPlacement.TOP,
|
|
118
|
+
};
|
|
119
|
+
const { controlRenders = [], id } = model;
|
|
120
|
+
const defaultTooltip = `${id?.toLowerCase()}_tooltip`;
|
|
121
|
+
let render = controlRenders.find(renderItem => renderItem.id === tooltipId);
|
|
122
|
+
// 如果找不到指定标识的tooltip,则找默认的tooltip
|
|
123
|
+
if (!render && tooltipId !== defaultTooltip)
|
|
124
|
+
render = controlRenders.find(
|
|
125
|
+
renderItem => renderItem.id === defaultTooltip,
|
|
126
|
+
);
|
|
127
|
+
if (render) {
|
|
128
|
+
if (render.renderType === 'LAYOUTPANEL_MODEL' && render.layoutPanelModel) {
|
|
129
|
+
let renderCode = render.layoutPanelModel;
|
|
130
|
+
// 兼容单行脚本
|
|
131
|
+
if (!renderCode.includes('return')) renderCode = `return (${renderCode})`;
|
|
132
|
+
options.content = ScriptFactory.execScriptFn(
|
|
133
|
+
{
|
|
134
|
+
...ctrl.getEventArgs(),
|
|
135
|
+
data,
|
|
136
|
+
model,
|
|
137
|
+
},
|
|
138
|
+
renderCode,
|
|
139
|
+
{ isAsync: false },
|
|
140
|
+
) as string;
|
|
141
|
+
options.disabled = false;
|
|
142
|
+
} else if (render.renderType === 'LAYOUTPANEL' && render.layoutPanel) {
|
|
143
|
+
options.content = h(resolveComponent('IBizControlShell'), {
|
|
144
|
+
data,
|
|
145
|
+
params: ctrl.params,
|
|
146
|
+
context: ctrl.context,
|
|
147
|
+
modelData: render.layoutPanel,
|
|
148
|
+
});
|
|
149
|
+
options.disabled = false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return options;
|
|
153
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ScriptFactory,
|
|
3
|
+
EditorController,
|
|
4
|
+
ControlController,
|
|
5
|
+
PanelItemController,
|
|
6
|
+
PredefinedAttributes,
|
|
7
|
+
} from '@ibiz-template/runtime';
|
|
8
|
+
import { IControl, IEditor } from '@ibiz/model-core';
|
|
9
|
+
import { useAttrs } from 'vue';
|
|
10
|
+
|
|
11
|
+
/** 语义化节点class */
|
|
12
|
+
export type UseSemanticClassReturn = (
|
|
13
|
+
key: string,
|
|
14
|
+
...args: IData[]
|
|
15
|
+
) => string | undefined;
|
|
16
|
+
|
|
17
|
+
/** 语义化节点style */
|
|
18
|
+
export type UseSemanticStyleReturn = (
|
|
19
|
+
key: string,
|
|
20
|
+
...args: IData[]
|
|
21
|
+
) => IData | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 语义化节点
|
|
25
|
+
* @param controller 控制器
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export function useSemanticNode(
|
|
29
|
+
controller: ControlController | PanelItemController | EditorController,
|
|
30
|
+
): {
|
|
31
|
+
semanticClass: UseSemanticClassReturn;
|
|
32
|
+
semanticStyle: UseSemanticStyleReturn;
|
|
33
|
+
} {
|
|
34
|
+
const controlType = (controller.model as IControl).controlType;
|
|
35
|
+
const editorType = (controller.model as IEditor).editorType;
|
|
36
|
+
|
|
37
|
+
// class埋点信息,可通过部件注入属性classNames设置,也可通过组件参数classNames设置,格式为字符串或函数,如 { root: 'semantic-mark-root' } 或 { root: (args) => 'semantic-mark-root' }
|
|
38
|
+
let classItems: IData = {};
|
|
39
|
+
const classNameAttr = controller.model.controlAttributes?.find(
|
|
40
|
+
item => item.attrName === PredefinedAttributes.CLASSNAMES,
|
|
41
|
+
);
|
|
42
|
+
if (classNameAttr && classNameAttr.attrValue) {
|
|
43
|
+
if (controlType) {
|
|
44
|
+
// 存在部件类型即为部件
|
|
45
|
+
classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
|
|
46
|
+
...(controller as ControlController).getEventArgs(),
|
|
47
|
+
}) as IData;
|
|
48
|
+
} else if (editorType) {
|
|
49
|
+
// 存在编辑器类型即为编辑器
|
|
50
|
+
const editor = controller as EditorController;
|
|
51
|
+
classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
|
|
52
|
+
...editor.ctrl.getEventArgs(),
|
|
53
|
+
}) as IData;
|
|
54
|
+
} else {
|
|
55
|
+
const panelItem = controller as PanelItemController;
|
|
56
|
+
classItems = ScriptFactory.execSingleLine(classNameAttr.attrValue, {
|
|
57
|
+
data: [panelItem.data],
|
|
58
|
+
value: panelItem.data[panelItem.model.id!],
|
|
59
|
+
}) as IData;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const attrs = useAttrs();
|
|
63
|
+
if (attrs.classNames) {
|
|
64
|
+
classItems = {
|
|
65
|
+
...classItems,
|
|
66
|
+
...attrs.classNames,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 解析指定 key 的用户自定义 class:
|
|
72
|
+
* - 未配置:返回 undefined
|
|
73
|
+
* - 字符串:直接返回
|
|
74
|
+
* - 函数:传入 controller 及 args 调用后返回
|
|
75
|
+
*/
|
|
76
|
+
const semanticClass: UseSemanticClassReturn = (
|
|
77
|
+
key: string,
|
|
78
|
+
...args: unknown[]
|
|
79
|
+
): string | undefined => {
|
|
80
|
+
const value = classItems?.[key];
|
|
81
|
+
if (value === undefined) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (typeof value === 'string') {
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
return value(controller, ...args);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// style埋点信息,可通过部件注入属性styles设置,也可通过组件参数styles设置,格式为字符串或函数,如 { root: 'color:var(--ibiz-color-text-0);font-size: 14px;' } 或 { root: (args) => 'color:var(--ibiz-color-text-0);font-size: 14px;' }
|
|
91
|
+
let styleItems: IData = {};
|
|
92
|
+
const styleAttr = controller.model.controlAttributes?.find(
|
|
93
|
+
item => item.attrName === PredefinedAttributes.STYLES,
|
|
94
|
+
);
|
|
95
|
+
if (styleAttr && styleAttr.attrValue) {
|
|
96
|
+
// 存在部件类型即为部件
|
|
97
|
+
if (controlType) {
|
|
98
|
+
styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
|
|
99
|
+
...(controller as ControlController).getEventArgs(),
|
|
100
|
+
}) as IData;
|
|
101
|
+
} else if (editorType) {
|
|
102
|
+
// 存在编辑器类型即为编辑器
|
|
103
|
+
const editor = controller as EditorController;
|
|
104
|
+
styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
|
|
105
|
+
...editor.ctrl.getEventArgs(),
|
|
106
|
+
}) as IData;
|
|
107
|
+
} else {
|
|
108
|
+
const panelItem = controller as PanelItemController;
|
|
109
|
+
styleItems = ScriptFactory.execSingleLine(styleAttr.attrValue, {
|
|
110
|
+
data: [panelItem.data],
|
|
111
|
+
value: panelItem.data[panelItem.model.id!],
|
|
112
|
+
}) as IData;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (attrs.styles) {
|
|
116
|
+
styleItems = {
|
|
117
|
+
...styleItems,
|
|
118
|
+
...attrs.styles,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 解析指定 key 的用户自定义 style:
|
|
124
|
+
* - 未配置:返回 undefined
|
|
125
|
+
* - 字符串:直接返回
|
|
126
|
+
* - 函数:传入 controller 及 args 调用后返回
|
|
127
|
+
*/
|
|
128
|
+
const semanticStyle: UseSemanticStyleReturn = (
|
|
129
|
+
key: string,
|
|
130
|
+
...args: unknown[]
|
|
131
|
+
): IData | undefined => {
|
|
132
|
+
const value = styleItems?.[key];
|
|
133
|
+
if (value === undefined) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
if (typeof value === 'string') {
|
|
137
|
+
const result = value.split(';').reduce((acc: IData, item) => {
|
|
138
|
+
if (item.trim().length === 0) {
|
|
139
|
+
return acc;
|
|
140
|
+
}
|
|
141
|
+
const [styleKey, styleValue] = item.split(':');
|
|
142
|
+
acc[styleKey.trim()] = styleValue.trim();
|
|
143
|
+
return acc;
|
|
144
|
+
}, {});
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
return value(controller, ...args);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
semanticClass,
|
|
152
|
+
semanticStyle,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CTX, IMobViewController } from '@ibiz-template/runtime';
|
|
2
|
+
import { inject } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 获取视图上下文环境对象
|
|
6
|
+
*
|
|
7
|
+
* @author chitanda
|
|
8
|
+
* @date 2023-06-16 15:06:16
|
|
9
|
+
* @export
|
|
10
|
+
* @return {*} {CTX}
|
|
11
|
+
*/
|
|
12
|
+
export function useCtx(): CTX {
|
|
13
|
+
return inject('ctx') as CTX;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 获取移动端视图上下文环境对象
|
|
18
|
+
*
|
|
19
|
+
* @author chitanda
|
|
20
|
+
* @date 2023-06-16 16:06:51
|
|
21
|
+
* @export
|
|
22
|
+
* @return {*} {CTX<IMobViewController>}
|
|
23
|
+
*/
|
|
24
|
+
export function useMobCtx(): CTX<IMobViewController> {
|
|
25
|
+
return inject('ctx') as CTX;
|
|
26
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import {
|
|
3
|
+
CTX,
|
|
4
|
+
IViewController,
|
|
5
|
+
IViewProvider,
|
|
6
|
+
ViewController,
|
|
7
|
+
} from '@ibiz-template/runtime';
|
|
8
|
+
import { clearAll } from 'qx-util';
|
|
9
|
+
import {
|
|
10
|
+
getCurrentInstance,
|
|
11
|
+
inject,
|
|
12
|
+
onActivated,
|
|
13
|
+
onBeforeUnmount,
|
|
14
|
+
onDeactivated,
|
|
15
|
+
provide,
|
|
16
|
+
reactive,
|
|
17
|
+
watch,
|
|
18
|
+
} from 'vue';
|
|
19
|
+
import { useForce, useProps } from '../../vue/vue';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 监听并更新上下文和视图参数(引用不变)
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2023-05-25 01:48:14
|
|
25
|
+
* @param {IData} props
|
|
26
|
+
* @param {IViewController} view
|
|
27
|
+
*/
|
|
28
|
+
function watchAndUpdateContextParams(
|
|
29
|
+
props: IData,
|
|
30
|
+
view: IViewController,
|
|
31
|
+
): void {
|
|
32
|
+
watch(
|
|
33
|
+
() => ({ context: props.context, params: props.params }),
|
|
34
|
+
newVal => {
|
|
35
|
+
// 不改变引用的情况下,重置控制器里的上下文和视图参数。
|
|
36
|
+
view.context.reset({}, newVal.context);
|
|
37
|
+
clearAll(view.params);
|
|
38
|
+
Object.assign(view.params, newVal.params);
|
|
39
|
+
// 重新计算上下文和视图参数
|
|
40
|
+
view.handleContextParams();
|
|
41
|
+
ibiz.log.debug(
|
|
42
|
+
ibiz.i18n.t('vue3Util.use.control.parameterChanges', {
|
|
43
|
+
id: view.model.id,
|
|
44
|
+
}),
|
|
45
|
+
newVal,
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 监听并更新state
|
|
53
|
+
* @author lxm
|
|
54
|
+
* @date 2023-05-26 03:43:23
|
|
55
|
+
* @param {IData} props
|
|
56
|
+
* @param {IViewController} view
|
|
57
|
+
*/
|
|
58
|
+
function watchAndUpdateState(props: IData, view: IViewController): void {
|
|
59
|
+
watch(
|
|
60
|
+
() => {
|
|
61
|
+
return props.state ? { ...props.state } : {};
|
|
62
|
+
},
|
|
63
|
+
(newVal, oldVal) => {
|
|
64
|
+
const changeProps: IData = {};
|
|
65
|
+
Object.keys(newVal).forEach(key => {
|
|
66
|
+
if (newVal[key] !== (oldVal || {})[key]) {
|
|
67
|
+
changeProps[key] = newVal[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
ibiz.log.debug(
|
|
71
|
+
ibiz.i18n.t('vue3Util.use.view.stateChange', {
|
|
72
|
+
name: view.model.name,
|
|
73
|
+
}),
|
|
74
|
+
changeProps,
|
|
75
|
+
);
|
|
76
|
+
Object.keys(changeProps).forEach(key => {
|
|
77
|
+
(view.state as any)[key] = changeProps[key];
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
{ immediate: true },
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 初始化视图控制器
|
|
86
|
+
*
|
|
87
|
+
* @description 此视图暂时控制器实例化只用于路由一级视图
|
|
88
|
+
* @author chitanda
|
|
89
|
+
* @date 2022-08-15 15:08:04
|
|
90
|
+
* @export
|
|
91
|
+
* @template T
|
|
92
|
+
* @param {(context: IContext, params: IParams, ctx?: CTX) => T} fn
|
|
93
|
+
* @return {*} {T}
|
|
94
|
+
*/
|
|
95
|
+
export function useViewController<T extends IViewController>(
|
|
96
|
+
fn: (...args: ConstructorParameters<typeof ViewController>) => T,
|
|
97
|
+
): T {
|
|
98
|
+
// 获取 props
|
|
99
|
+
const props = useProps();
|
|
100
|
+
// 获取上层组件的ctx
|
|
101
|
+
const ctx = inject<CTX | undefined>('ctx', undefined);
|
|
102
|
+
// 上下文里提前预告部件
|
|
103
|
+
ctx?.evt.emit('onForecast', props.modelData.name!);
|
|
104
|
+
|
|
105
|
+
// 实例化视图控制器
|
|
106
|
+
const provider = props.provider as IViewProvider | undefined;
|
|
107
|
+
let c: IViewController;
|
|
108
|
+
if (provider?.createController) {
|
|
109
|
+
// 如果适配器给了创建方法使用适配器的方法
|
|
110
|
+
c = provider.createController(
|
|
111
|
+
props.modelData,
|
|
112
|
+
props.context,
|
|
113
|
+
props.params,
|
|
114
|
+
ctx,
|
|
115
|
+
) as T;
|
|
116
|
+
} else {
|
|
117
|
+
c = fn(props.modelData, props.context, props.params, ctx) as T;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ibiz.util.viewStack.add(c.id, c);
|
|
121
|
+
|
|
122
|
+
watchAndUpdateContextParams(props, c);
|
|
123
|
+
watchAndUpdateState(props, c);
|
|
124
|
+
|
|
125
|
+
// 提供自身的ctx给下层组件
|
|
126
|
+
provide('ctx', (c as any).ctx);
|
|
127
|
+
// 让state 响应式
|
|
128
|
+
c.state = reactive(c.state) as any;
|
|
129
|
+
|
|
130
|
+
// 让state 响应式
|
|
131
|
+
c.slotProps = reactive(c.slotProps) as any;
|
|
132
|
+
|
|
133
|
+
// 从props赋值modal,如果存在的话。
|
|
134
|
+
if (props.modal) {
|
|
135
|
+
c.modal = props.modal;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
onActivated(() => {
|
|
139
|
+
c.onActivated();
|
|
140
|
+
ibiz.util.viewStack.active(c.id);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
onDeactivated(() => {
|
|
144
|
+
c.onDeactivated();
|
|
145
|
+
ibiz.util.viewStack.deactivate(c.id);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
c.force = useForce();
|
|
149
|
+
|
|
150
|
+
const vue = getCurrentInstance()!.proxy!;
|
|
151
|
+
c.evt.onAll((eventName, event) => {
|
|
152
|
+
vue.$emit(eventName.slice(2), event);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
c.created();
|
|
156
|
+
|
|
157
|
+
// 卸载时销毁
|
|
158
|
+
onBeforeUnmount(() => {
|
|
159
|
+
c.destroyed();
|
|
160
|
+
ibiz.util.viewStack.remove(c.id);
|
|
161
|
+
});
|
|
162
|
+
return c as T;
|
|
163
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
4
|
+
import { listenJSEvent } from '@ibiz-template/core';
|
|
5
|
+
import { ViewController } from '@ibiz-template/runtime';
|
|
6
|
+
import { onMounted, onUnmounted } from 'vue';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 监听视图操作
|
|
10
|
+
*
|
|
11
|
+
* @author tony001
|
|
12
|
+
* @date 2025-01-17 18:01:18
|
|
13
|
+
* @export
|
|
14
|
+
* @param {ViewController} view
|
|
15
|
+
*/
|
|
16
|
+
export function useViewOperation(view: ViewController): void {
|
|
17
|
+
let listenJSEventFuncs: Function[] = [];
|
|
18
|
+
|
|
19
|
+
onMounted(() => {
|
|
20
|
+
const viewElement = document.getElementById(view.id);
|
|
21
|
+
const listenJSEventNames = ['keydown', 'click'];
|
|
22
|
+
if (!viewElement) return;
|
|
23
|
+
// 冒泡阶段在目标源可能会阻止冒泡,因此界面操作存在未监听到的情况,调整未捕获阶段监听
|
|
24
|
+
listenJSEventFuncs = listenJSEventNames.map(eventName => {
|
|
25
|
+
return listenJSEvent(
|
|
26
|
+
viewElement,
|
|
27
|
+
eventName,
|
|
28
|
+
(event: UIEvent) => {
|
|
29
|
+
view.setOperateState('MANUAL');
|
|
30
|
+
},
|
|
31
|
+
{ once: true, capture: true },
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// 组件销毁时,移除事件监听
|
|
37
|
+
onUnmounted(() => {
|
|
38
|
+
if (listenJSEventFuncs && listenJSEventFuncs.length > 0) {
|
|
39
|
+
listenJSEventFuncs.forEach(listenJSEventFunc => {
|
|
40
|
+
listenJSEventFunc();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { isFunc } from 'qx-util';
|
|
2
|
+
import {
|
|
3
|
+
ComponentPublicInstance,
|
|
4
|
+
createCommentVNode,
|
|
5
|
+
getCurrentInstance,
|
|
6
|
+
isReactive,
|
|
7
|
+
toRaw,
|
|
8
|
+
VNode,
|
|
9
|
+
watch,
|
|
10
|
+
WatchOptions,
|
|
11
|
+
} from 'vue';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 获取组件的props,只能在setup里使用
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2022-08-14 16:08:19
|
|
18
|
+
* @export
|
|
19
|
+
* @return {*}
|
|
20
|
+
*/
|
|
21
|
+
export function useProps(): IData {
|
|
22
|
+
const vue = getCurrentInstance()!.proxy!;
|
|
23
|
+
return vue.$props;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 如果是reactive代理过的对象,返回原始对象
|
|
28
|
+
*
|
|
29
|
+
* @author lxm
|
|
30
|
+
* @date 2023-02-15 10:56:00
|
|
31
|
+
* @export
|
|
32
|
+
* @param {*} val
|
|
33
|
+
* @returns {*}
|
|
34
|
+
*/
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
export function getOrigin<T = any>(val: T): T {
|
|
37
|
+
return isReactive(val) ? toRaw<T>(val) : val;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 监听props的属性
|
|
42
|
+
*
|
|
43
|
+
* @author lxm
|
|
44
|
+
* @date 2022-08-22 22:08:11
|
|
45
|
+
* @export
|
|
46
|
+
* @param {string} key props的属性名
|
|
47
|
+
* @param {(newVal: T, oldVal: T) => void} callback 监听回调
|
|
48
|
+
* @param {(WatchOptions | undefined)} [options] 监听参数
|
|
49
|
+
*/
|
|
50
|
+
export function usePropsWatch<T = unknown>(
|
|
51
|
+
key: string,
|
|
52
|
+
callback: (newVal?: T, oldVal?: T) => void,
|
|
53
|
+
options?: WatchOptions | undefined,
|
|
54
|
+
): void {
|
|
55
|
+
const props = useProps();
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(props, key)) {
|
|
57
|
+
watch(
|
|
58
|
+
() => props[key],
|
|
59
|
+
(newVal, oldVal) => {
|
|
60
|
+
callback(getOrigin(newVal), getOrigin(oldVal));
|
|
61
|
+
},
|
|
62
|
+
options,
|
|
63
|
+
);
|
|
64
|
+
// immediate无效,模拟第一次赋值
|
|
65
|
+
callback(getOrigin(props[key]), undefined);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 获取force方法
|
|
71
|
+
*
|
|
72
|
+
* @author lxm
|
|
73
|
+
* @date 2022-08-24 11:08:56
|
|
74
|
+
* @export
|
|
75
|
+
* @returns {*} {(callback?: () => void) => void} callback回调会在这次更新渲染完成之后执行
|
|
76
|
+
*/
|
|
77
|
+
export function useForce(): (callback?: () => void) => void {
|
|
78
|
+
const vue = getCurrentInstance()!.proxy!;
|
|
79
|
+
return (callback?: () => void) => {
|
|
80
|
+
vue.$forceUpdate();
|
|
81
|
+
if (callback && isFunc(callback)) {
|
|
82
|
+
vue.$nextTick(() => {
|
|
83
|
+
callback();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* controller的force执行时,一起执行自己的force
|
|
91
|
+
*
|
|
92
|
+
* @author lxm
|
|
93
|
+
* @date 2022-08-22 23:08:36
|
|
94
|
+
* @export
|
|
95
|
+
* @param {{
|
|
96
|
+
* force: (callback?: () => void) => void;
|
|
97
|
+
* }} controller
|
|
98
|
+
*/
|
|
99
|
+
export function useForceTogether(
|
|
100
|
+
vue: ComponentPublicInstance,
|
|
101
|
+
controller: {
|
|
102
|
+
force: (callback?: () => void) => void;
|
|
103
|
+
},
|
|
104
|
+
): void {
|
|
105
|
+
const orignForce = controller.force;
|
|
106
|
+
const selfForce = useForce();
|
|
107
|
+
controller.force = (callback?: () => void): void => {
|
|
108
|
+
orignForce(callback);
|
|
109
|
+
selfForce();
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 控制器通用的vue实例能力绑定
|
|
115
|
+
*
|
|
116
|
+
* @author lxm
|
|
117
|
+
* @date 2022-09-15 09:09:06
|
|
118
|
+
* @export
|
|
119
|
+
* @param {Vue} vue
|
|
120
|
+
* @param {IData} controller
|
|
121
|
+
*/
|
|
122
|
+
export function useController(controller: IData): void {
|
|
123
|
+
controller.force = useForce();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** 全局唯一的空节点 */
|
|
127
|
+
export const EmptyVNode = createCommentVNode('EmptyVNode');
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 配合EmptyVNode,判断是否是空节点
|
|
131
|
+
* @author lxm
|
|
132
|
+
* @date 2023-03-28 02:20:06
|
|
133
|
+
* @export
|
|
134
|
+
* @param {(VNode[] | VNode)} nodes
|
|
135
|
+
* @return {*} {boolean}
|
|
136
|
+
*/
|
|
137
|
+
export function isEmptyVNode(nodes: VNode[] | VNode): boolean {
|
|
138
|
+
if (!Array.isArray(nodes)) {
|
|
139
|
+
return nodes === EmptyVNode;
|
|
140
|
+
}
|
|
141
|
+
return nodes.length === 1 && nodes[0] === EmptyVNode;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @description 过滤attr中指定属性,如果存在自定义过滤回调,则不针对filterKeys的值进行过滤
|
|
146
|
+
* @export
|
|
147
|
+
* @param {Record<string, string>} attrs 所有属性
|
|
148
|
+
* @param {(key: string) => boolean} [filter] 自定义过滤回调
|
|
149
|
+
* @param {string[]} [filterKeys=['class', 'style']] 需要过滤掉的属性
|
|
150
|
+
* @returns {*} {Record<string, string>}
|
|
151
|
+
*/
|
|
152
|
+
export function useFilterAttribute(
|
|
153
|
+
attrs: Record<string, string>,
|
|
154
|
+
filter?: (key: string) => boolean,
|
|
155
|
+
filterKeys: string[] = ['class', 'style'],
|
|
156
|
+
): Record<string, string> {
|
|
157
|
+
const result: Record<string, string> = {};
|
|
158
|
+
Object.keys(attrs).forEach(key => {
|
|
159
|
+
if (filter) {
|
|
160
|
+
if (filter(key)) {
|
|
161
|
+
result[key] = attrs[key];
|
|
162
|
+
}
|
|
163
|
+
} else if (!filterKeys.includes(key)) {
|
|
164
|
+
result[key] = attrs[key];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
return result;
|
|
168
|
+
}
|