@gct-paas/core-web 0.1.4-dev.11 → 0.1.4-dev.12
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.esm.min.js +9864 -0
- package/dist/index.min.css +2 -1
- package/dist/monaco-editor-BHuf3IVH.js +280 -0
- package/dist/useMonacoEditor-CfhCBaPa.js +2852 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
- package/es/components/app-modal/app-modal-component.mjs +102 -133
- package/es/components/assets-svg-icon/assets-svg-icon.mjs +161 -232
- package/es/components/assets-svg-icon/request.mjs +60 -43
- package/es/components/assets-svg-icon/utils.mjs +21 -19
- package/es/components/assets-svg-icon/validate.mjs +27 -41
- package/es/components/base-button/base-button.vue.mjs +7 -7
- package/es/components/base-button/base-button.vue_vue_type_script_setup_true_name_BaseButton_lang.mjs +181 -0
- package/es/components/basic-button/basic-button.vue.mjs +7 -7
- package/es/components/basic-button/basic-button.vue_vue_type_script_setup_true_name_BasicButton_lang.mjs +148 -0
- package/es/components/code-editor/code-editor.mjs +59 -63
- package/es/components/copy-module-key/copy-module-key.vue.mjs +7 -7
- package/es/components/copy-module-key/copy-module-key.vue_vue_type_script_setup_true_name_copy-module-key_lang.mjs +92 -0
- package/es/components/double-input/double-input.vue.mjs +5 -158
- package/es/components/double-input/double-input.vue_vue_type_script_setup_true_lang.mjs +121 -0
- package/es/components/icon-next/hooks/useIconAsset.mjs +32 -44
- package/es/components/icon-next/hooks/useIconPark.mjs +48 -48
- package/es/components/icon-next/hooks/useIconPlatform.mjs +37 -42
- package/es/components/icon-next/index.mjs +3 -0
- package/es/components/icon-next/src/IconNext.vue.mjs +7 -0
- package/es/components/icon-next/src/IconNext.vue_vue_type_script_setup_true_name_IconNext_lang.mjs +113 -0
- package/es/components/icon-next/src/IconNextPicker.vue.mjs +6 -0
- package/es/components/icon-next/src/IconNextPicker.vue_vue_type_script_setup_true_name_IconNextPicker_lang.mjs +379 -0
- package/es/components/icon-next/types/index.mjs +10 -9
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +23 -34
- package/es/components/layout/view-container/view-container.mjs +24 -35
- package/es/components/svg-icon/svg-icon.vue.mjs +6 -50
- package/es/components/svg-icon/svg-icon.vue_vue_type_script_setup_true_name_SvgIcon_lang.mjs +52 -0
- package/es/components/vue3-grid-dnd-item/vue3-grid-dnd-item.css +103 -0
- package/es/components/vue3-grid-dnd-item/vue3-grid-dnd-item.d.ts +44 -0
- package/es/components/vue3-grid-dnd-item/vue3-grid-dnd-item.mjs +122 -0
- package/es/components/wujie-container/wujie-container.mjs +58 -81
- package/es/create-app-vue.mjs +27 -19
- package/es/directives/drag-resize.mjs +38 -39
- package/es/directives/ellipsis-title.d.ts +7 -0
- package/es/directives/ellipsis-title.mjs +21 -0
- package/es/directives/index.mjs +14 -6
- package/es/directives/target-loading.mjs +28 -36
- package/es/hooks/index.mjs +4 -0
- package/es/hooks/useDesign.mjs +7 -8
- package/es/hooks/useDragLine.mjs +66 -75
- package/es/hooks/useLocale.mjs +27 -28
- package/es/hooks/useTheme.mjs +13 -17
- package/es/index.mjs +92 -137
- package/es/modules/code-editor/index.mjs +6 -7
- package/es/modules/code-editor/monaco-editor.vue.mjs +7 -7
- package/es/modules/code-editor/monaco-editor.vue_vue_type_script_setup_true_name_code-editor_lang.mjs +398 -0
- package/es/modules/code-editor/useEditorConsole.mjs +146 -187
- package/es/modules/code-editor/useMonacoEditor.mjs +24 -23
- package/es/modules/color-picker/index.mjs +1 -0
- package/es/modules/color-picker/src/ColorPicker.vue.mjs +8 -8
- package/es/modules/color-picker/src/ColorPicker.vue_vue_type_script_setup_true_name_ColorPicker_lang.mjs +482 -0
- package/es/modules/formula-editor/constants/index.mjs +8 -6
- package/es/modules/formula-editor/formula-editor.mjs +40 -59
- package/es/modules/formula-editor/index.mjs +2 -0
- package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.mjs +158 -193
- package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.mjs +81 -95
- package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.mjs +178 -237
- package/es/modules/gct-dnd/constants/index.mjs +10 -18
- package/es/modules/gct-dnd/index.mjs +4 -0
- package/es/modules/gct-form/components/flex-container/flex-container.css +67 -0
- package/es/modules/gct-form/components/flex-container/flex-container.d.ts +14 -0
- package/es/modules/gct-form/components/flex-container/flex-container.mjs +61 -0
- package/es/modules/gct-form/components/flex-item/flex-item.d.ts +13 -0
- package/es/modules/gct-form/components/flex-item/flex-item.mjs +37 -0
- package/es/modules/gct-form/components/grid-container/grid-container.d.ts +10 -0
- package/es/modules/gct-form/components/grid-container/grid-container.mjs +36 -0
- package/es/modules/gct-form/components/index.d.ts +3 -0
- package/es/modules/gct-form/components/index.mjs +3 -0
- package/es/modules/gct-form/constants/editor-register/editor-register.mjs +17 -5
- package/es/modules/gct-form/constants/editor-type/editor-type.mjs +133 -34
- package/es/modules/gct-form/constants/index.mjs +5 -2
- package/es/modules/gct-form/controller/edit-form/edit-form.controller.d.ts +1 -16
- package/es/modules/gct-form/controller/edit-form/edit-form.controller.mjs +48 -69
- package/es/modules/gct-form/controller/editor-item/editor-item.controller.mjs +18 -22
- package/es/modules/gct-form/controller/form-collapse/form-collapse.controller.mjs +20 -10
- package/es/modules/gct-form/controller/form-collapse-pane/form-collapse-pane.controller.mjs +20 -10
- package/es/modules/gct-form/controller/form-edit-item/form-edit-item.controller.mjs +84 -89
- package/es/modules/gct-form/controller/form-group/form-group.controller.mjs +20 -10
- package/es/modules/gct-form/controller/form-item/form-item.controller.mjs +35 -36
- package/es/modules/gct-form/controller/form-item-basic/form-item-basic.controller.mjs +61 -42
- package/es/modules/gct-form/controller/form-item-hidden/form-item-hidden.controller.mjs +16 -6
- package/es/modules/gct-form/controller/form-line/form-line.controller.mjs +20 -10
- package/es/modules/gct-form/controller/form-tab/form-tab.controller.mjs +20 -10
- package/es/modules/gct-form/controller/form-tab-pane/form-tab-pane.controller.mjs +20 -10
- package/es/modules/gct-form/controller/gct-form/gct-form.controller.mjs +198 -221
- package/es/modules/gct-form/controller/index.mjs +13 -0
- package/es/modules/gct-form/editor/gct-form-action/gct-form-action.mjs +44 -49
- package/es/modules/gct-form/editor/gct-form-action/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-check-switch/gct-form-check-switch.mjs +54 -55
- package/es/modules/gct-form/editor/gct-form-check-switch/gct-form-check-switch.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-check-switch/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-checkbox/gct-form-checkbox.mjs +100 -125
- package/es/modules/gct-form/editor/gct-form-checkbox/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-color/gct-form-color.mjs +36 -41
- package/es/modules/gct-form/editor/gct-form-color/gct-form-color.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-color/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-date/gct-form-date.mjs +71 -78
- package/es/modules/gct-form/editor/gct-form-date/gct-form-date.provider.mjs +12 -4
- package/es/modules/gct-form/editor/gct-form-date/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-date-format-select/gct-form-date-format-select.mjs +102 -107
- package/es/modules/gct-form/editor/gct-form-date-format-select/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-empty/gct-form-empty.mjs +13 -15
- package/es/modules/gct-form/editor/gct-form-empty/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-formula/gct-form-formula.mjs +66 -66
- package/es/modules/gct-form/editor/gct-form-formula/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-group-select/gct-form-group-select.mjs +159 -227
- package/es/modules/gct-form/editor/gct-form-group-select/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-i18n/gct-form-i18n.mjs +87 -113
- package/es/modules/gct-form/editor/gct-form-i18n/gct-form-i18n.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-i18n/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-icon-select/gct-form-icon-select.mjs +61 -70
- package/es/modules/gct-form/editor/gct-form-icon-select/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-info/gct-form-info.mjs +38 -49
- package/es/modules/gct-form/editor/gct-form-info/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-length-unit/gct-form-length-unit.mjs +36 -41
- package/es/modules/gct-form/editor/gct-form-length-unit/gct-form-length-unit.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-length-unit/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-model-select/gct-form-model-select.mjs +141 -170
- package/es/modules/gct-form/editor/gct-form-model-select/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-multiple-choice/gct-form-multiple-choice.mjs +60 -66
- package/es/modules/gct-form/editor/gct-form-multiple-choice/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-number/gct-form-number.mjs +41 -42
- package/es/modules/gct-form/editor/gct-form-number/gct-form-number.provider.mjs +5 -4
- package/es/modules/gct-form/editor/gct-form-number/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-picker/gct-form-picker.mjs +89 -111
- package/es/modules/gct-form/editor/gct-form-picker/gct-form-picker.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-picker/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-pixel-config/gct-form-pixel-config.mjs +60 -66
- package/es/modules/gct-form/editor/gct-form-pixel-config/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-radio/gct-form-radio.mjs +76 -91
- package/es/modules/gct-form/editor/gct-form-radio/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-select/gct-form-select.mjs +109 -126
- package/es/modules/gct-form/editor/gct-form-select/gct-form-select.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-select/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-span/gct-form-span.mjs +67 -97
- package/es/modules/gct-form/editor/gct-form-span/gct-form-span.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-span/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-switch/gct-form-switch.mjs +32 -37
- package/es/modules/gct-form/editor/gct-form-switch/gct-form-switch.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-switch/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-table/gct-form-table.mjs +29 -30
- package/es/modules/gct-form/editor/gct-form-table/index.mjs +10 -14
- package/es/modules/gct-form/editor/gct-form-text/gct-form-text.mjs +51 -54
- package/es/modules/gct-form/editor/gct-form-text/gct-form-text.provider.mjs +14 -4
- package/es/modules/gct-form/editor/gct-form-text/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-form-textarea/gct-form-textarea.mjs +43 -44
- package/es/modules/gct-form/editor/gct-form-textarea/gct-form-textarea.provider.mjs +5 -4
- package/es/modules/gct-form/editor/gct-form-textarea/index.mjs +8 -12
- package/es/modules/gct-form/editor/gct-select-form-table/gct-select-form-table.mjs +59 -76
- package/es/modules/gct-form/editor/gct-select-form-table/index.mjs +10 -14
- package/es/modules/gct-form/editor/index.mjs +32 -34
- package/es/modules/gct-form/hooks/index.mjs +2 -0
- package/es/modules/gct-form/hooks/use-form/use-form.mjs +12 -5
- package/es/modules/gct-form/hooks/use-gct-form-value/use-gct-form-value.mjs +80 -84
- package/es/modules/gct-form/index.mjs +51 -16
- package/es/modules/gct-form/props/gct-form-item/gct-form-item.props.mjs +54 -62
- package/es/modules/gct-form/register/editor-register/editor-register.mjs +63 -56
- package/es/modules/gct-form/register/form-item-register/form-item-register.mjs +45 -41
- package/es/modules/gct-form/state/form/form.state.mjs +26 -16
- package/es/modules/gct-form/state/form-collapse/form-collapse.state.mjs +14 -5
- package/es/modules/gct-form/state/form-collapse-pane/form-collapse-pane.state.mjs +14 -5
- package/es/modules/gct-form/state/form-edit-item/form-edit-item.state.mjs +18 -9
- package/es/modules/gct-form/state/form-group/form-group.state.mjs +22 -13
- package/es/modules/gct-form/state/form-item/form-item.state.mjs +14 -5
- package/es/modules/gct-form/state/form-item-basic/form-item-basic.state.mjs +18 -8
- package/es/modules/gct-form/state/form-line/form-line.state.mjs +11 -5
- package/es/modules/gct-form/state/form-tab/form-tab.state.mjs +16 -6
- package/es/modules/gct-form/state/form-tab-pane/form-tab-pane.state.mjs +14 -5
- package/es/modules/gct-form/utils/width-install/width-install.mjs +19 -16
- package/es/modules/gct-form/widgets/gct-edit-form/gct-edit-form.d.ts +1 -5
- package/es/modules/gct-form/widgets/gct-edit-form/gct-edit-form.mjs +122 -148
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse/gct-form-collapse.mjs +66 -76
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse/index.mjs +10 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.mjs +50 -72
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.mjs +11 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-collapse-pane/index.mjs +10 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-group/gct-form-group.css +5 -5
- package/es/modules/gct-form/widgets/gct-form/gct-form-group/gct-form-group.mjs +72 -89
- package/es/modules/gct-form/widgets/gct-form/gct-form-group/gct-form-group.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-group/index.mjs +10 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.mjs +11 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-hidden-item/index.mjs +1 -0
- package/es/modules/gct-form/widgets/gct-form/gct-form-item/gct-form-item.css +27 -24
- package/es/modules/gct-form/widgets/gct-form/gct-form-item/gct-form-item.mjs +127 -159
- package/es/modules/gct-form/widgets/gct-form/gct-form-item/gct-form-item.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-item/index.mjs +3 -0
- package/es/modules/gct-form/widgets/gct-form/gct-form-line/gct-form-line.css +2 -2
- package/es/modules/gct-form/widgets/gct-form/gct-form-line/gct-form-line.mjs +38 -45
- package/es/modules/gct-form/widgets/gct-form/gct-form-line/gct-form-line.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-line/index.mjs +10 -12
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab/gct-form-tab.mjs +63 -69
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab/gct-form-tab.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab/index.mjs +10 -12
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.mjs +48 -66
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-tab-pane/index.mjs +10 -15
- package/es/modules/gct-form/widgets/gct-form/gct-form-title-group/gct-form-title-group.css +4 -4
- package/es/modules/gct-form/widgets/gct-form/gct-form-title-group/gct-form-title-group.mjs +50 -68
- package/es/modules/gct-form/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.mjs +11 -13
- package/es/modules/gct-form/widgets/gct-form/gct-form-title-group/index.mjs +11 -16
- package/es/modules/gct-form/widgets/gct-form/gct-form.css +2 -2
- package/es/modules/gct-form/widgets/gct-form/gct-form.mjs +125 -143
- package/es/modules/gct-form/widgets/gct-form/index.mjs +30 -33
- package/es/modules/gct-table/controller/gct-table/gct-table.controller.mjs +138 -140
- package/es/modules/gct-table/controller/index.mjs +5 -0
- package/es/modules/gct-table/controller/table-item/table-action-item.controller.mjs +14 -5
- package/es/modules/gct-table/controller/table-item/table-edit-item.controller.mjs +25 -15
- package/es/modules/gct-table/controller/table-item/table-item.controller.mjs +32 -25
- package/es/modules/gct-table/controller/table-row/table-row.controller.mjs +76 -69
- package/es/modules/gct-table/editor/gct-table-date/gct-table-date.mjs +47 -90
- package/es/modules/gct-table/editor/gct-table-date/gct-table-date.provider.mjs +12 -4
- package/es/modules/gct-table/editor/gct-table-date/index.mjs +10 -52
- package/es/modules/gct-table/editor/gct-table-span/gct-table-span.mjs +26 -37
- package/es/modules/gct-table/editor/gct-table-span/gct-table-span.provider.mjs +14 -4
- package/es/modules/gct-table/editor/gct-table-span/index.mjs +10 -52
- package/es/modules/gct-table/editor/gct-table-text/gct-table-text.mjs +60 -103
- package/es/modules/gct-table/editor/gct-table-text/gct-table-text.provider.mjs +14 -4
- package/es/modules/gct-table/editor/gct-table-text/index.mjs +10 -52
- package/es/modules/gct-table/editor/index.mjs +9 -11
- package/es/modules/gct-table/hooks/index.mjs +1 -0
- package/es/modules/gct-table/hooks/use-ant-table/use-ant-table.mjs +66 -82
- package/es/modules/gct-table/index.mjs +22 -15
- package/es/modules/gct-table/register/table-editor-register/table-editor-register.mjs +67 -60
- package/es/modules/gct-table/state/table/table.state.mjs +46 -36
- package/es/modules/gct-table/state/table-item/table-edit-item.state.mjs +19 -9
- package/es/modules/gct-table/state/table-item/table-item.state.mjs +29 -19
- package/es/modules/gct-table/state/table-row/table-row.state.mjs +16 -6
- package/es/modules/gct-table/utils/count-latch/count-latch.mjs +97 -94
- package/es/modules/gct-table/utils/index.mjs +2 -0
- package/es/modules/gct-table/utils/width-install/width-install.mjs +18 -16
- package/es/modules/gct-table/widgets/gct-table/gct-table.mjs +310 -409
- package/es/modules/gct-table/widgets/gct-table/index.mjs +8 -10
- package/es/modules/gct-table/widgets/index.mjs +7 -9
- package/es/modules/global-modal/index.mjs +10 -16
- package/es/modules/global-modal/src/BasicModal.vue.mjs +5 -221
- package/es/modules/global-modal/src/BasicModal.vue_vue_type_script_setup_true_name_BasicModal_lang.mjs +201 -0
- package/es/modules/global-modal/src/components/GlboalModal.mjs +30 -39
- package/es/modules/global-modal/src/components/ModalClose.vue.mjs +6 -79
- package/es/modules/global-modal/src/components/ModalClose.vue_vue_type_script_setup_true_name_ModalClose_lang.mjs +67 -0
- package/es/modules/global-modal/src/components/ModalFooter.vue.mjs +5 -44
- package/es/modules/global-modal/src/components/ModalFooter.vue_vue_type_script_setup_true_name_BasicModalFooter_lang.mjs +40 -0
- package/es/modules/global-modal/src/components/ModalHeader.vue.mjs +9 -9
- package/es/modules/global-modal/src/components/ModalHeader.vue_vue_type_script_lang.mjs +11 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue.mjs +18 -24
- package/es/modules/global-modal/src/components/ModalWrapper.vue_vue_type_script_lang.mjs +126 -0
- package/es/modules/global-modal/src/hooks/useModal.mjs +102 -116
- package/es/modules/global-modal/src/hooks/useModalContext.mjs +6 -6
- package/es/modules/global-modal/src/hooks/useModalDrag.mjs +69 -79
- package/es/modules/global-modal/src/hooks/useModalFullScreen.mjs +17 -13
- package/es/modules/global-modal/src/props.mjs +87 -55
- package/es/modules/target-loading/index.mjs +3 -0
- package/es/modules/target-loading/src/createLoading.mjs +42 -54
- package/es/modules/target-loading/src/target-loading.vue.mjs +7 -52
- package/es/modules/target-loading/src/target-loading.vue_vue_type_script_setup_true_name_target-loading_lang.mjs +55 -0
- package/es/modules/target-loading/src/useLoading.mjs +2 -0
- package/es/setup-app.mjs +3 -3
- package/es/utils/index.mjs +4 -0
- package/es/utils/message-util/message-util.mjs +25 -25
- package/es/utils/monaco-loader/monaco-loader.mjs +83 -87
- package/es/utils/overlay-controller/overlay-controller.mjs +29 -20
- package/es/utils/with-install.mjs +10 -11
- package/package.json +5 -5
- package/dist/index-B8zoAUhR.cjs +0 -20
- package/dist/index-BH5PTZ_c.js +0 -20
- package/dist/index-Cna4DZog.js +0 -109381
- package/dist/index.esm.min.mjs +0 -91
- package/dist/index.min.cjs +0 -1
- package/dist/index.system.min.js +0 -1
- package/dist/monaco-editor-4E2xdOou.cjs +0 -1
- package/dist/monaco-editor-C-wvzgow.js +0 -1
- package/dist/monaco-editor-Cel355Cg.js +0 -350
- package/es/components/base-button/base-button.vue3.mjs +0 -179
- package/es/components/basic-button/basic-button.vue3.mjs +0 -130
- package/es/components/copy-module-key/copy-module-key.vue3.mjs +0 -104
- package/es/components/double-input/double-input.vue2.mjs +0 -5
- package/es/components/icon-next/src/IconNext.vue2.mjs +0 -7
- package/es/components/icon-next/src/IconNext.vue3.mjs +0 -108
- package/es/components/icon-next/src/IconNextPicker.vue2.mjs +0 -452
- package/es/components/icon-next/src/IconNextPicker.vue3.mjs +0 -6
- package/es/components/svg-icon/svg-icon.vue3.mjs +0 -6
- package/es/modules/code-editor/monaco-editor.vue2.mjs +0 -440
- package/es/modules/color-picker/src/ColorPicker.vue2.mjs +0 -545
- package/es/modules/gct-form/widgets/gct-edit-form/index.d.ts +0 -5
- package/es/modules/gct-form/widgets/gct-edit-form/index.mjs +0 -10
- package/es/modules/global-modal/src/BasicModal.vue2.mjs +0 -5
- package/es/modules/global-modal/src/components/ModalClose.vue3.mjs +0 -6
- package/es/modules/global-modal/src/components/ModalFooter.vue2.mjs +0 -5
- package/es/modules/global-modal/src/components/ModalHeader.vue2.mjs +0 -13
- package/es/modules/global-modal/src/components/ModalWrapper.vue2.mjs +0 -136
- package/es/modules/target-loading/src/target-loading.vue3.mjs +0 -7
- /package/es/components/base-button/{base-button.css → base-button.vue_vue_type_style_index_0_scoped_5375ec2b_lang.css} +0 -0
- /package/es/components/basic-button/{basic-button.css → basic-button.vue_vue_type_style_index_0_scoped_1dbcb2fa_lang.css} +0 -0
- /package/es/components/copy-module-key/{copy-module-key.css → copy-module-key.vue_vue_type_style_index_0_scoped_531b3cd2_lang.css} +0 -0
- /package/es/components/icon-next/src/{IconNext.css → IconNext.vue_vue_type_style_index_0_scoped_c5a83130_lang.css} +0 -0
- /package/es/components/icon-next/src/{IconNextPicker.css → IconNextPicker.vue_vue_type_style_index_0_lang.css} +0 -0
- /package/es/components/svg-icon/{svg-icon.css → svg-icon.vue_vue_type_style_index_0_lang.css} +0 -0
- /package/es/modules/code-editor/{monaco-editor.css → monaco-editor.vue_vue_type_style_index_0_scoped_254c9227_lang.css} +0 -0
- /package/es/modules/color-picker/src/{ColorPicker.css → ColorPicker.vue_vue_type_style_index_0_scoped_7bfd9ca3_lang.css} +0 -0
- /package/es/modules/color-picker/src/{ColorPicker2.css → ColorPicker.vue_vue_type_style_index_1_lang.css} +0 -0
- /package/es/modules/global-modal/src/components/{ModalClose.css → ModalClose.vue_vue_type_style_index_0_lang.css} +0 -0
- /package/es/modules/target-loading/src/{target-loading.css → target-loading.vue_vue_type_style_index_0_scoped_d448466c_lang.css} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return target;
|
|
1
|
+
//#region \0plugin-vue:export-helper
|
|
2
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
3
|
+
const target = sfc.__vccOpts || sfc;
|
|
4
|
+
for (const [key, val] of props) target[key] = val;
|
|
5
|
+
return target;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
export {
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _plugin_vue_export_helper_default as default };
|
|
@@ -1,140 +1,109 @@
|
|
|
1
|
-
import { defineComponent, ref, provide, createVNode, h, resolveComponent, isVNode } from 'vue';
|
|
2
|
-
import { ConfigProvider } from 'ant-design-vue';
|
|
3
|
-
import { OverlayContainer, useNamespace, Modal } from '@gct-paas/core';
|
|
4
|
-
import { DndProvider } from 'vue3-dnd';
|
|
5
|
-
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
6
1
|
import './app-modal-component.css';/* empty css */
|
|
7
|
-
|
|
2
|
+
import { createVNode, defineComponent, h, isVNode, provide, ref, resolveComponent } from "vue";
|
|
3
|
+
import { Modal, OverlayContainer, useNamespace } from "@gct-paas/core";
|
|
4
|
+
import { ConfigProvider } from "ant-design-vue";
|
|
5
|
+
import { DndProvider } from "vue3-dnd";
|
|
6
|
+
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
7
|
+
//#region src/components/app-modal/app-modal-component.tsx
|
|
8
8
|
function _isSlot(s) {
|
|
9
|
-
|
|
9
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
slot[0].props.modal = modal;
|
|
95
|
-
}
|
|
96
|
-
return createVNode(ConfigProvider, {
|
|
97
|
-
"locale": getAntdLocale
|
|
98
|
-
}, {
|
|
99
|
-
default: () => [createVNode(DndProvider, {
|
|
100
|
-
"backend": HTML5Backend
|
|
101
|
-
}, _isSlot(_slot = h(resolveComponent('a-modal'), {
|
|
102
|
-
visible: isShow.value,
|
|
103
|
-
class: [ns.b(), options.value.placement && ns.m(options.value.placement), options.value.modalClass, ns.is('hidden-footer', options.value.showFooter === false), ns.is('hidden-close-btn', options.value.showCloseBtn === false), ns.is('hidden-cancel-btn', options.value.showCancelBtn === false), ns.is('full-screen', isFullScreen.value)],
|
|
104
|
-
centered: true,
|
|
105
|
-
onOk: ok,
|
|
106
|
-
confirmLoading: isConfirmLoading.value,
|
|
107
|
-
onCancel: cancel,
|
|
108
|
-
okText: '确认',
|
|
109
|
-
okButtonProps: {
|
|
110
|
-
disabled: modal.state.okDisabled
|
|
111
|
-
},
|
|
112
|
-
...options.value
|
|
113
|
-
}, [options.value.canFullscreen !== false ? createVNode("div", {
|
|
114
|
-
"class": ns.e('full-screen'),
|
|
115
|
-
"onClick": onFullScreen
|
|
116
|
-
}, [createVNode("i", {
|
|
117
|
-
"class": `iconfont ${isFullScreen.value ? 'icon-tuichuquanping' : 'icon-quanping'}`
|
|
118
|
-
}, null)]) : null, slot])) ? _slot : {
|
|
119
|
-
default: () => [_slot]
|
|
120
|
-
})]
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
}
|
|
11
|
+
var AppModalComponent = /* @__PURE__ */ defineComponent({
|
|
12
|
+
props: { opts: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
} },
|
|
16
|
+
setup(props, ctx) {
|
|
17
|
+
const ns = useNamespace("modal");
|
|
18
|
+
const isShow = ref(false);
|
|
19
|
+
const isFullScreen = ref(props.opts.defaultFullscreen ? true : false);
|
|
20
|
+
const onFullScreen = () => {
|
|
21
|
+
isFullScreen.value = !isFullScreen.value;
|
|
22
|
+
};
|
|
23
|
+
const options = ref({});
|
|
24
|
+
if (props.opts) Object.assign(options.value, props.opts);
|
|
25
|
+
let data = null;
|
|
26
|
+
const modal = new Modal({
|
|
27
|
+
dismiss: (result) => {
|
|
28
|
+
isShow.value = false;
|
|
29
|
+
data = result;
|
|
30
|
+
ctx.emit("dismiss", data);
|
|
31
|
+
},
|
|
32
|
+
setOptions(opt) {
|
|
33
|
+
Object.assign(options.value, opt);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
provide("modal", modal);
|
|
37
|
+
const dismiss = (_data) => {
|
|
38
|
+
return modal.dismiss(_data);
|
|
39
|
+
};
|
|
40
|
+
const present = () => {
|
|
41
|
+
isShow.value = true;
|
|
42
|
+
};
|
|
43
|
+
ctx.expose({
|
|
44
|
+
present,
|
|
45
|
+
dismiss
|
|
46
|
+
});
|
|
47
|
+
const isConfirmLoading = ref(false);
|
|
48
|
+
const ok = async () => {
|
|
49
|
+
if (modal.ok) try {
|
|
50
|
+
isConfirmLoading.value = true;
|
|
51
|
+
const result = await modal.ok();
|
|
52
|
+
isConfirmLoading.value = false;
|
|
53
|
+
if (result && (result.ok === true || result.close === true)) dismiss(result);
|
|
54
|
+
} finally {
|
|
55
|
+
isConfirmLoading.value = false;
|
|
56
|
+
}
|
|
57
|
+
else console.warn("打开模态未实现ok方法");
|
|
58
|
+
};
|
|
59
|
+
const cancel = async () => {
|
|
60
|
+
if (modal.cancel) {
|
|
61
|
+
if (await modal.cancel() === false) return;
|
|
62
|
+
}
|
|
63
|
+
dismiss();
|
|
64
|
+
};
|
|
65
|
+
const { getAntdLocale } = { getAntdLocale: { locale: {} } };
|
|
66
|
+
return () => {
|
|
67
|
+
let _slot;
|
|
68
|
+
const slot = ctx.slots.default?.();
|
|
69
|
+
if (slot && slot.length > 0) slot[0].props.modal = modal;
|
|
70
|
+
return createVNode(ConfigProvider, { "locale": getAntdLocale }, { default: () => [createVNode(DndProvider, { "backend": HTML5Backend }, _isSlot(_slot = h(resolveComponent("a-modal"), {
|
|
71
|
+
visible: isShow.value,
|
|
72
|
+
class: [
|
|
73
|
+
ns.b(),
|
|
74
|
+
options.value.placement && ns.m(options.value.placement),
|
|
75
|
+
options.value.modalClass,
|
|
76
|
+
ns.is("hidden-footer", options.value.showFooter === false),
|
|
77
|
+
ns.is("hidden-close-btn", options.value.showCloseBtn === false),
|
|
78
|
+
ns.is("hidden-cancel-btn", options.value.showCancelBtn === false),
|
|
79
|
+
ns.is("full-screen", isFullScreen.value)
|
|
80
|
+
],
|
|
81
|
+
centered: true,
|
|
82
|
+
onOk: ok,
|
|
83
|
+
confirmLoading: isConfirmLoading.value,
|
|
84
|
+
onCancel: cancel,
|
|
85
|
+
okText: "确认",
|
|
86
|
+
okButtonProps: { disabled: modal.state.okDisabled },
|
|
87
|
+
...options.value
|
|
88
|
+
}, [options.value.canFullscreen !== false ? createVNode("div", {
|
|
89
|
+
"class": ns.e("full-screen"),
|
|
90
|
+
"onClick": onFullScreen
|
|
91
|
+
}, [createVNode("i", { "class": `iconfont ${isFullScreen.value ? "icon-tuichuquanping" : "icon-quanping"}` }, null)]) : null, slot])) ? _slot : { default: () => [_slot] })] });
|
|
92
|
+
};
|
|
93
|
+
}
|
|
124
94
|
});
|
|
125
|
-
|
|
126
95
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
96
|
+
* 创建模态框
|
|
97
|
+
*
|
|
98
|
+
* @author zhanghanrui
|
|
99
|
+
* @date 2024-03-19 21:03:37
|
|
100
|
+
* @export
|
|
101
|
+
* @param {() => VNode} render
|
|
102
|
+
* @param {(IModalOptions)} [opts]
|
|
103
|
+
* @return {*} {IOverlayContainer}
|
|
104
|
+
*/
|
|
136
105
|
function createModal(render, opts) {
|
|
137
|
-
|
|
106
|
+
return new OverlayContainer(AppModalComponent, render, opts);
|
|
138
107
|
}
|
|
139
|
-
|
|
140
|
-
export {
|
|
108
|
+
//#endregion
|
|
109
|
+
export { createModal };
|
|
@@ -1,238 +1,167 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ioniconContent, getSvgContent } from './request.mjs';
|
|
4
|
-
import { isRTL, getSrc } from './utils.mjs';
|
|
1
|
+
import { getSrc, isRTL } from "./utils.mjs";
|
|
2
|
+
import { getSvgContent, ioniconContent } from "./request.mjs";
|
|
5
3
|
import './assets-svg-icon.css';/* empty css */
|
|
6
|
-
|
|
4
|
+
import { computed, createVNode, defineComponent, getCurrentInstance, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
5
|
+
import { useNamespace } from "@gct-paas/core";
|
|
6
|
+
//#region src/components/assets-svg-icon/assets-svg-icon.tsx
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
* Create color classes for the icon.
|
|
9
|
+
* @param color - The color of the icon.
|
|
10
|
+
* @returns The color classes for the icon.
|
|
11
|
+
*/
|
|
12
|
+
var createColorClasses = (color) => {
|
|
13
|
+
return color ? {
|
|
14
|
+
"ion-color": true,
|
|
15
|
+
[`ion-color-${color}`]: true
|
|
16
|
+
} : null;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
18
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const el = instance?.vnode.el;
|
|
167
|
-
if (el) {
|
|
168
|
-
/**
|
|
169
|
-
* purposely do not return the promise here because loading
|
|
170
|
-
* the svg file should not hold up loading the app
|
|
171
|
-
* only load the svg if it's visible
|
|
172
|
-
*/
|
|
173
|
-
waitUntilVisible(el, '50px', () => {
|
|
174
|
-
isVisible.value = true;
|
|
175
|
-
loadIcon();
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
nextTick(() => {
|
|
179
|
-
if (!didLoadIcon.value) {
|
|
180
|
-
loadIcon();
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
onUnmounted(() => {
|
|
185
|
-
if (io) {
|
|
186
|
-
io.disconnect();
|
|
187
|
-
io = undefined;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// Watch for src prop changes
|
|
192
|
-
watch(() => props.src, () => {
|
|
193
|
-
loadIcon();
|
|
194
|
-
});
|
|
195
|
-
const classes = computed(() => {
|
|
196
|
-
const {
|
|
197
|
-
flipRtl,
|
|
198
|
-
size,
|
|
199
|
-
color
|
|
200
|
-
} = props;
|
|
201
|
-
const el = instance?.vnode.el;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* if flipRtl is true, the icon should change direction when `dir` changes
|
|
205
|
-
*/
|
|
206
|
-
const shouldBeFlippable = flipRtl;
|
|
207
|
-
return {
|
|
208
|
-
...createColorClasses(color),
|
|
209
|
-
[`icon-${size}`]: !!size,
|
|
210
|
-
'flip-rtl': shouldBeFlippable,
|
|
211
|
-
'icon-rtl': shouldBeFlippable && isRTL(el),
|
|
212
|
-
[ns.b()]: true
|
|
213
|
-
};
|
|
214
|
-
});
|
|
215
|
-
return {
|
|
216
|
-
ns,
|
|
217
|
-
svgContent,
|
|
218
|
-
classes
|
|
219
|
-
};
|
|
220
|
-
},
|
|
221
|
-
render() {
|
|
222
|
-
const {
|
|
223
|
-
svgContent,
|
|
224
|
-
classes
|
|
225
|
-
} = this;
|
|
226
|
-
return createVNode("div", {
|
|
227
|
-
"role": "img",
|
|
228
|
-
"class": classes
|
|
229
|
-
}, [typeof window !== 'undefined' && svgContent ? createVNode("div", {
|
|
230
|
-
"class": "icon-inner",
|
|
231
|
-
"innerHTML": svgContent
|
|
232
|
-
}, null) : createVNode("div", {
|
|
233
|
-
"class": "icon-inner"
|
|
234
|
-
}, null)]);
|
|
235
|
-
}
|
|
19
|
+
* SVG图标组件 - 简化版本 (仅浏览器环境)
|
|
20
|
+
*
|
|
21
|
+
* 此组件是基于Stencil ion-icon组件简化的Vue实现,
|
|
22
|
+
* 专门用于浏览器环境,仅支持通过src属性加载SVG。
|
|
23
|
+
*
|
|
24
|
+
* ## 功能
|
|
25
|
+
* - 支持通过直接URL加载SVG图标
|
|
26
|
+
* - 支持懒加载
|
|
27
|
+
* - 支持RTL文本方向自动翻转
|
|
28
|
+
* - 支持颜色和大小变化
|
|
29
|
+
* - 支持SVG内容安全检查
|
|
30
|
+
*
|
|
31
|
+
* ## 使用示例
|
|
32
|
+
*
|
|
33
|
+
* // 使用 src 属性
|
|
34
|
+
* <SvgIcon src="/path/to/icon.svg" />
|
|
35
|
+
*
|
|
36
|
+
* // 设置大小和颜色
|
|
37
|
+
* <SvgIcon src="/path/to/icon.svg" size="large" color="primary" />
|
|
38
|
+
*
|
|
39
|
+
* // RTL 支持
|
|
40
|
+
* <SvgIcon src="/path/to/icon.svg" flipRtl={true} />
|
|
41
|
+
*
|
|
42
|
+
* // 懒加载
|
|
43
|
+
* <SvgIcon src="/path/to/icon.svg" lazy={true} />
|
|
44
|
+
*
|
|
45
|
+
* // 禁用 SVG 清理
|
|
46
|
+
* <SvgIcon src="/path/to/icon.svg" sanitize={false} />
|
|
47
|
+
*/
|
|
48
|
+
var AssetsSvgIcon = /* @__PURE__ */ defineComponent({
|
|
49
|
+
name: "AssetsSvgIcon",
|
|
50
|
+
props: {
|
|
51
|
+
color: { type: String },
|
|
52
|
+
flipRtl: { type: Boolean },
|
|
53
|
+
src: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
size: { type: String },
|
|
58
|
+
lazy: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
sanitize: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
setup(props) {
|
|
68
|
+
const ns = useNamespace("assets-svg-icon");
|
|
69
|
+
const instance = getCurrentInstance();
|
|
70
|
+
let io;
|
|
71
|
+
const didLoadIcon = ref(false);
|
|
72
|
+
const svgContent = ref(void 0);
|
|
73
|
+
const isVisible = ref(false);
|
|
74
|
+
/**
|
|
75
|
+
* Wait until the icon is visible in the viewport.
|
|
76
|
+
* @param el - The element to observe.
|
|
77
|
+
* @param rootMargin - The root margin of the observer.
|
|
78
|
+
* @param cb - The callback to call when the element is visible.
|
|
79
|
+
*/
|
|
80
|
+
const waitUntilVisible = (el, rootMargin, cb) => {
|
|
81
|
+
/**
|
|
82
|
+
* browser doesn't support IntersectionObserver
|
|
83
|
+
* so just fallback to always show it
|
|
84
|
+
*/
|
|
85
|
+
if (!Boolean(typeof window !== "undefined" && props.lazy && window.IntersectionObserver)) return cb();
|
|
86
|
+
const intersectionObserver = io = new window.IntersectionObserver((data) => {
|
|
87
|
+
if (data[0]?.isIntersecting) {
|
|
88
|
+
intersectionObserver.disconnect();
|
|
89
|
+
io = void 0;
|
|
90
|
+
cb();
|
|
91
|
+
}
|
|
92
|
+
}, { rootMargin });
|
|
93
|
+
intersectionObserver.observe(el);
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Load the icon using only src URL
|
|
97
|
+
*/
|
|
98
|
+
const loadIcon = () => {
|
|
99
|
+
if (typeof window !== "undefined" && isVisible.value && props.src) {
|
|
100
|
+
const url = getSrc(props.src);
|
|
101
|
+
if (url) {
|
|
102
|
+
if (ioniconContent.has(url)) svgContent.value = ioniconContent.get(url);
|
|
103
|
+
else getSvgContent(url, props.sanitize).then(() => {
|
|
104
|
+
svgContent.value = ioniconContent.get(url);
|
|
105
|
+
});
|
|
106
|
+
didLoadIcon.value = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
const el = instance?.vnode.el;
|
|
112
|
+
if (el)
|
|
113
|
+
/**
|
|
114
|
+
* purposely do not return the promise here because loading
|
|
115
|
+
* the svg file should not hold up loading the app
|
|
116
|
+
* only load the svg if it's visible
|
|
117
|
+
*/
|
|
118
|
+
waitUntilVisible(el, "50px", () => {
|
|
119
|
+
isVisible.value = true;
|
|
120
|
+
loadIcon();
|
|
121
|
+
});
|
|
122
|
+
nextTick(() => {
|
|
123
|
+
if (!didLoadIcon.value) loadIcon();
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
onUnmounted(() => {
|
|
127
|
+
if (io) {
|
|
128
|
+
io.disconnect();
|
|
129
|
+
io = void 0;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
watch(() => props.src, () => {
|
|
133
|
+
loadIcon();
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
ns,
|
|
137
|
+
svgContent,
|
|
138
|
+
classes: computed(() => {
|
|
139
|
+
const { flipRtl, size, color } = props;
|
|
140
|
+
const el = instance?.vnode.el;
|
|
141
|
+
/**
|
|
142
|
+
* if flipRtl is true, the icon should change direction when `dir` changes
|
|
143
|
+
*/
|
|
144
|
+
const shouldBeFlippable = flipRtl;
|
|
145
|
+
return {
|
|
146
|
+
...createColorClasses(color),
|
|
147
|
+
[`icon-${size}`]: !!size,
|
|
148
|
+
"flip-rtl": shouldBeFlippable,
|
|
149
|
+
"icon-rtl": shouldBeFlippable && isRTL(el),
|
|
150
|
+
[ns.b()]: true
|
|
151
|
+
};
|
|
152
|
+
})
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
render() {
|
|
156
|
+
const { svgContent, classes } = this;
|
|
157
|
+
return createVNode("div", {
|
|
158
|
+
"role": "img",
|
|
159
|
+
"class": classes
|
|
160
|
+
}, [typeof window !== "undefined" && svgContent ? createVNode("div", {
|
|
161
|
+
"class": "icon-inner",
|
|
162
|
+
"innerHTML": svgContent
|
|
163
|
+
}, null) : createVNode("div", { "class": "icon-inner" }, null)]);
|
|
164
|
+
}
|
|
236
165
|
});
|
|
237
|
-
|
|
166
|
+
//#endregion
|
|
238
167
|
export { AssetsSvgIcon };
|