fangguo-component 1.1.5 → 1.2.0

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.
Files changed (64) hide show
  1. package/README.md +57 -0
  2. package/dist/{ErrorImage-Ao9kEEUg.js → ErrorImage-CFVt1ht_.js} +2 -2
  3. package/dist/FgCascader.css +24 -0
  4. package/dist/{FgCascader.vue_vue_type_style_index_0_lang-CM8FxFLJ.js → FgCascader.vue_vue_type_style_index_0_lang-Bm4HR37D.js} +45 -4
  5. package/dist/{HSelect-BFkWiCFi.js → HSelect-DgFjd08Y.js} +3 -3
  6. package/dist/{HSelectAll.vue_vue_type_script_setup_true_lang-BZX7ch2I.js → HSelectAll.vue_vue_type_script_setup_true_lang-C6qzdQT-.js} +1 -1
  7. package/dist/{HSelectSJ-DZmtdyjF.js → HSelectSJ-DOFUzTZV.js} +3 -3
  8. package/dist/ImgViewerHost.vue_vue_type_script_setup_true_lang-CMoh7eWo.js +52 -0
  9. package/dist/LazyPopover-7ebuh-QG.js +188 -0
  10. package/dist/LazyPopover.css +5 -0
  11. package/dist/{SelectTree-DHbWogEU.js → SelectTree-DUH92Iwr.js} +2 -2
  12. package/dist/{TextCopy-th0FAxwl.js → TextCopy-lpbeqOUI.js} +1 -1
  13. package/dist/ViewImg-Bg1AQ0T6.js +247 -0
  14. package/dist/ViewImg.css +56 -0
  15. package/dist/ViewImgPopover-b9PDEYbP.js +275 -0
  16. package/dist/ViewImgPopover.css +33 -0
  17. package/dist/ViewImgPreview.css +100 -0
  18. package/dist/ViewImgPreview.vue_vue_type_style_index_0_lang-CYuLovBR.js +306 -0
  19. package/dist/{common-B1nSpTGn.js → common-D0EYVGB2.js} +1 -1
  20. package/dist/components/cascader/index.js +1 -1
  21. package/dist/components/errorImage/index.js +2 -2
  22. package/dist/components/hSelect/index.js +1 -1
  23. package/dist/components/hSelectAll/index.js +1 -1
  24. package/dist/components/hSelectSJ/index.js +1 -1
  25. package/dist/components/imgViewerHost/ImgViewerHost.vue.d.ts +2 -0
  26. package/dist/components/imgViewerHost/imgViewerStore.d.ts +195 -0
  27. package/dist/components/imgViewerHost/index.d.ts +4 -0
  28. package/dist/components/imgViewerHost/index.js +10 -0
  29. package/dist/components/imgViewerHost/utils.d.ts +4 -0
  30. package/dist/components/index.d.ts +4 -0
  31. package/dist/components/index.js +45 -18
  32. package/dist/components/lazyPopover/LazyPopover.vue.d.ts +12 -15
  33. package/dist/components/lazyPopover/index.js +2 -2
  34. package/dist/components/selectTree/index.js +1 -1
  35. package/dist/components/textCopy/index.js +1 -1
  36. package/dist/components/viewImg/ViewImg.vue.d.ts +141 -0
  37. package/dist/components/viewImg/index.d.ts +1 -0
  38. package/dist/components/viewImg/index.js +4 -0
  39. package/dist/components/viewImgPopover/ViewImgPopover.vue.d.ts +705 -0
  40. package/dist/components/viewImgPopover/index.d.ts +1 -0
  41. package/dist/components/viewImgPopover/index.js +4 -0
  42. package/dist/components/viewImgPreview/ViewImgPreview.vue.d.ts +50 -0
  43. package/dist/components/viewImgPreview/index.d.ts +3 -0
  44. package/dist/components/viewImgPreview/index.js +17 -0
  45. package/dist/components/viewImgPreview/types.d.ts +78 -0
  46. package/dist/imgViewerStore-C5n16uYa.js +241 -0
  47. package/dist/{index-DzdLpetc.js → index-BtQgIf7F.js} +1414 -1402
  48. package/dist/{index-uQXqC9BF.js → index-CckJZ8N-.js} +40 -13
  49. package/dist/{index-BPnixsfc.js → index-Qkq7I01c.js} +15 -1
  50. package/dist/index.d.ts +17 -3
  51. package/dist/index.js +103 -60
  52. package/dist/montageImgUrl-CwgYnB2h.js +204 -0
  53. package/dist/tools/ImageParserUtils/index.js +346 -346
  54. package/dist/tools/common/index.js +1 -1
  55. package/dist/tools/imgUrl/config.d.ts +10 -0
  56. package/dist/tools/imgUrl/index.d.ts +4 -0
  57. package/dist/tools/imgUrl/index.js +16 -0
  58. package/dist/tools/imgUrl/montageImgUrl.d.ts +15 -0
  59. package/dist/tools/imgUrl/networkAdaptive.d.ts +7 -0
  60. package/dist/tools/index.d.ts +1 -0
  61. package/dist/tools/index.js +29 -15
  62. package/dist/types-BNFeGRer.js +32 -0
  63. package/package.json +1 -1
  64. package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js +0 -34
package/README.md CHANGED
@@ -82,6 +82,63 @@
82
82
  9. **`pnpm build:npm`**:构建 npm 发布产物到根目录 `dist/`(发版前执行)。
83
83
  10. **Jenkins 构建文档站**:在 Jenkins dev 栏目下 `fangguo-component` 项目执行构建,发布最新文档站。
84
84
 
85
+ ## 在方果 ERP 或实际项目中本地调试
86
+
87
+ 本地调试的核心是把业务项目依赖的 `fangguo-component` 指向本地组件库目录。组件库对外交付的是构建产物 `dist/`,因此 **每次改完组件库源码后,需在组件库目录执行 `pnpm build:npm` 重新生成 `dist/`**,业务项目才会拿到最新代码(`dist/` 不会随源码自动更新)。
88
+
89
+ ### 方式一:pnpm(推荐)
90
+
91
+ 在业务项目(如方果 ERP)根目录的 `pnpm-workspace.yaml` 中加入 `overrides`,用 `link:` 协议把 `fangguo-component` 指向本地组件库目录,再重新安装依赖,该包就会 link 到本地组件库(其 `package.json` 的 `exports` 会解析到本地 `dist/`):
92
+
93
+ ```yaml
94
+ # pnpm-workspace.yaml
95
+ overrides:
96
+ fangguo-component: link:D:/yutong_work/fangguo-component
97
+ ```
98
+
99
+ > 注意:`overrides` 写在 `pnpm-workspace.yaml`(或 `package.json` 的 `pnpm.overrides` 字段),**不要**写在 `pnpm-lock.yaml`——后者是自动生成的锁文件,手动改动会被覆盖。
100
+
101
+ 然后在业务项目根目录重新安装:
102
+
103
+ ```bash
104
+ pnpm install
105
+ ```
106
+
107
+ `link:` 建立的是软链接,之后组件库 `dist/` 更新即时生效(源码改动仍需重新 `pnpm build:npm`)。
108
+
109
+ ### 方式二:npm
110
+
111
+ npm 不支持 `link:` 协议的 `overrides`,本地调试可用以下任一方式:
112
+
113
+ - **`npm link`(软链,推荐)**
114
+
115
+ ```bash
116
+ # 1. 在组件库目录注册全局链接
117
+ cd D:/yutong_work/fangguo-component
118
+ npm link
119
+
120
+ # 2. 在业务项目目录链接该包
121
+ cd <业务项目目录>
122
+ npm link fangguo-component
123
+ ```
124
+
125
+ - **`file:` 协议(写进业务项目 `package.json`)**
126
+
127
+ ```jsonc
128
+ // 业务项目 package.json
129
+ "dependencies": {
130
+ "fangguo-component": "file:D:/yutong_work/fangguo-component"
131
+ }
132
+ ```
133
+
134
+ 随后执行 `npm install`。
135
+
136
+ ### 结束调试 / 还原
137
+
138
+ - pnpm:删除 `pnpm-workspace.yaml` 中的 `overrides` 条目,重新 `pnpm install`。
139
+ - `npm link`:业务项目执行 `npm unlink fangguo-component`(组件库目录可 `npm unlink`),再重装正式版本。
140
+ - `file:` 协议:把依赖改回正常版本号,重新 `npm install`。
141
+
85
142
  ## 文档站(VitePress)与相关命令
86
143
 
87
144
  文档根目录为 `docs/`;**`docs/.vitepress/config.ts`** 与 **`src/docConfig.ts`(侧栏)** 由人工维护,`pnpm docs:gen` 不会覆盖。站点集成 [vitepress-demo-plugin](https://vitepress-demo.fe-dev.cn/) 与 **`colocatedDemoPlugin`**(解析 `vue="demos/…"`)。**更新日志**正文在根目录 **`CHANGELOG.md`**,`docs/guide/changelog.md` 仅 `@include` 引入。
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
30
  };
31
31
  }
32
32
  });
33
- const ErrorImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-612063c5"]]);
33
+ const FgErrorImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-612063c5"]]);
34
34
  export {
35
- ErrorImage as E
35
+ FgErrorImage as F
36
36
  };
@@ -1,3 +1,27 @@
1
+
2
+ .fg-doc-view-img-loading__box[data-v-552a6f88] {
3
+ width: 200px;
4
+ height: 120px;
5
+ background: #fafafa;
6
+ border: 1px dashed var(--el-border-color);
7
+ border-radius: 8px;
8
+ }
9
+ .fg-doc-view-img-loading__box[data-v-552a6f88] .fg-view-img {
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+ .fg-doc-view-img-loading__ph[data-v-552a6f88] {
14
+ font-size: 13px;
15
+ color: var(--el-color-primary);
16
+ }
17
+ .fg-doc-view-img-loading__hint[data-v-552a6f88] {
18
+ margin-top: 8px;
19
+ font-size: 13px;
20
+ color: var(--vp-c-text-2);
21
+ }
22
+ .fg-doc-view-img-loading__hint code[data-v-552a6f88] {
23
+ font-size: 12px;
24
+ }
1
25
  .cascader-virtual-list[data-v-a251fab9] {
2
26
  height: 100%;
3
27
  min-height: 204px;
@@ -50,14 +50,15 @@ var __async = (__this, __arguments, generator) => {
50
50
  step((generator = generator.apply(__this, __arguments)).next());
51
51
  });
52
52
  };
53
- import { getCurrentScope, onScopeDispose, watch, computed, toValue, shallowRef, getCurrentInstance, onMounted, warn, defineComponent, h, inject, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, withModifiers, withCtx, createElementVNode, createVNode, createCommentVNode, Fragment, ref, normalizeStyle, createTextVNode, toDisplayString, provide, reactive, onBeforeUpdate, nextTick, renderList, useAttrs, unref, withDirectives, vShow, renderSlot, withKeys, vModelText, useSlots, useModel, onBeforeUnmount, mergeProps, mergeModels, render } from "vue";
53
+ import { getCurrentScope, onScopeDispose, watch, computed, toValue, shallowRef, getCurrentInstance, onMounted, warn, defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, h, inject, resolveComponent, normalizeClass, createBlock, withModifiers, createCommentVNode, Fragment, normalizeStyle, toDisplayString, provide, reactive, onBeforeUpdate, nextTick, renderList, useAttrs, withDirectives, vShow, renderSlot, withKeys, vModelText, useSlots, useModel, onBeforeUnmount, mergeProps, mergeModels, render } from "vue";
54
54
  import { p as process$1 } from "./index-C9zyi90j.js";
55
55
  import { fromPairs, isEqual, flattenDeep, cloneDeep, debounce } from "lodash-unified";
56
56
  import { ArrowRight, Loading, Check, CircleClose, ArrowDown } from "@element-plus/icons-vue";
57
57
  import { useNamespace, ElIcon, ElRadio, ElCheckbox, ElScrollbar, useLocale, UPDATE_MODEL_EVENT, CHANGE_EVENT, EVENT_CODE, tagProps, useTooltipContentProps, CommonProps as CommonProps$1, useSizeProp, useFormItem, useFormSize, ElConfigProvider, ElTooltip, ElInput, ElTag, ClickOutside } from "element-plus";
58
58
  import { ElCheckbox as ElCheckbox$1, ElRadio as ElRadio$1, ElIcon as ElIcon$1 } from "element-plus/es";
59
- import { b as script$2 } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
59
+ import { F as FgViewImg } from "./ViewImg-Bg1AQ0T6.js";
60
60
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
61
+ import { b as script$2 } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
61
62
  !!(process$1.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
62
63
  !!(process$1.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
63
64
  const NOOP = () => {
@@ -315,6 +316,46 @@ const castArray = (arr) => {
315
316
  };
316
317
  const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
317
318
  const generateId = () => Math.floor(Math.random() * 1e4);
319
+ const _hoisted_1$2 = { class: "fg-doc-view-img-loading pt-1" };
320
+ const _hoisted_2$1 = { class: "fg-doc-view-img-loading__box" };
321
+ const src = "https://element-plus.org/images/element-plus-logo.svg";
322
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
323
+ __name: "Loading",
324
+ setup(__props) {
325
+ const loading = ref(true);
326
+ onMounted(() => {
327
+ window.setTimeout(() => {
328
+ loading.value = false;
329
+ }, 2e3);
330
+ });
331
+ return (_ctx, _cache) => {
332
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
333
+ createElementVNode("div", _hoisted_2$1, [
334
+ createVNode(unref(FgViewImg), {
335
+ src,
336
+ loading: loading.value,
337
+ "oss-process": false
338
+ }, {
339
+ placeholder: withCtx(() => [..._cache[0] || (_cache[0] = [
340
+ createElementVNode("span", { class: "fg-doc-view-img-loading__ph" }, "加载中…", -1)
341
+ ])]),
342
+ _: 1
343
+ }, 8, ["loading"])
344
+ ]),
345
+ _cache[1] || (_cache[1] = createElementVNode("p", { class: "fg-doc-view-img-loading__hint" }, [
346
+ createTextVNode(" 外部 "),
347
+ createElementVNode("code", null, "loading"),
348
+ createTextVNode(" 为 "),
349
+ createElementVNode("code", null, "true"),
350
+ createTextVNode(" 时展示 "),
351
+ createElementVNode("code", null, "#placeholder"),
352
+ createTextVNode(";约 2 秒后自动结束(模拟接口返回)。 ")
353
+ ], -1))
354
+ ]);
355
+ };
356
+ }
357
+ });
358
+ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-552a6f88"]]);
318
359
  const NodeContent = defineComponent({
319
360
  name: "NodeContent",
320
361
  setup() {
@@ -456,7 +497,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
456
497
  const _component_check = resolveComponent("check");
457
498
  const _component_el_icon = ElIcon$1;
458
499
  const _component_node_content = resolveComponent("node-content");
459
- const _component_loading = resolveComponent("loading");
500
+ const _component_loading = __unplugin_components_0;
460
501
  const _component_arrow_right = resolveComponent("arrow-right");
461
502
  return openBlock(), createElementBlock("li", {
462
503
  id: `${_ctx.menuId}-${_ctx.node.uid}`,
@@ -629,7 +670,7 @@ const _sfc_main$3 = defineComponent({
629
670
  });
630
671
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
631
672
  const _component_custom_cascader_node = resolveComponent("custom-cascader-node");
632
- const _component_loading = resolveComponent("loading");
673
+ const _component_loading = __unplugin_components_0;
633
674
  const _component_el_icon = ElIcon$1;
634
675
  const _component_RecycleScroller = resolveComponent("RecycleScroller");
635
676
  return _ctx.nodes.length ? (openBlock(), createBlock(_component_RecycleScroller, {
@@ -39,9 +39,9 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
  import { ElPopover, ElIcon, ElTag } from "element-plus/es";
41
41
  import { defineComponent, useModel, ref, watch, computed, nextTick, onUnmounted, onMounted, openBlock, createBlock, withCtx, createVNode, unref, createElementBlock, createCommentVNode, toDisplayString, withModifiers, renderSlot, createElementVNode, normalizeClass, normalizeStyle, Fragment, renderList, createTextVNode, withDirectives, vModelText, mergeModels } from "vue";
42
- import { q as debounce } from "./common-B1nSpTGn.js";
42
+ import { q as debounce } from "./common-D0EYVGB2.js";
43
43
  import { Check, ArrowDown, CircleClose } from "@element-plus/icons-vue";
44
- import { _ as _sfc_main$1 } from "./LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js";
44
+ import { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
45
45
  import { s as script$1, a as script } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
46
46
  import { isEqual } from "lodash-unified";
47
47
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
@@ -512,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
512
512
  ]),
513
513
  _: 1
514
514
  }),
515
- labelList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$1, {
515
+ labelList.value.length > 1 ? (openBlock(), createBlock(LazyPopover, {
516
516
  key: 0,
517
517
  width: `${__props.popwidth}px`
518
518
  }, {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, useSlots, ref, openBlock, createBlock, createSlots, withCtx, createElementVNode, renderSlot, toDisplayString, renderList, unref, normalizeProps, guardReactiveProps } from "vue";
2
- import { H as HSelect } from "./HSelect-BFkWiCFi.js";
2
+ import { H as HSelect } from "./HSelect-DgFjd08Y.js";
3
3
  const _hoisted_1 = { class: "px-[10px] py-[10px] bg-[#fff] border-b cursor-pointer" };
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "HSelectAll",
@@ -39,9 +39,9 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
  import { ElPopover, ElIcon, ElTag } from "element-plus/es";
41
41
  import { defineComponent, useModel, ref, watch, computed, nextTick, onUnmounted, onMounted, openBlock, createBlock, withCtx, createVNode, unref, createElementBlock, createCommentVNode, toDisplayString, withModifiers, renderSlot, createElementVNode, normalizeClass, normalizeStyle, Fragment, renderList, createTextVNode, withDirectives, vModelText, mergeModels } from "vue";
42
- import { q as debounce } from "./common-B1nSpTGn.js";
42
+ import { q as debounce } from "./common-D0EYVGB2.js";
43
43
  import { Check, ArrowDown, CircleClose } from "@element-plus/icons-vue";
44
- import { _ as _sfc_main$1 } from "./LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js";
44
+ import { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
45
45
  import { s as script$1, a as script } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
46
46
  import { isEqual } from "lodash-unified";
47
47
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
@@ -512,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
512
512
  ]),
513
513
  _: 1
514
514
  }),
515
- labelList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$1, {
515
+ labelList.value.length > 1 ? (openBlock(), createBlock(LazyPopover, {
516
516
  key: 0,
517
517
  width: `${__props.popwidth}px`
518
518
  }, {
@@ -0,0 +1,52 @@
1
+ import { defineComponent, openBlock, createBlock, unref } from "vue";
2
+ import { _ as _sfc_main$1 } from "./ViewImgPreview.vue_vue_type_style_index_0_lang-CYuLovBR.js";
3
+ import { u as useImgViewerState, I as ImgViewerStore } from "./imgViewerStore-C5n16uYa.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "ImgViewerHost",
6
+ setup(__props) {
7
+ const state = useImgViewerState();
8
+ const imgViewerStore = ImgViewerStore();
9
+ function handlePreviewClose() {
10
+ var _a;
11
+ (_a = state.onClose) == null ? void 0 : _a.call(state);
12
+ imgViewerStore.hideImgViewer();
13
+ }
14
+ function handlePreviewSwitch(index) {
15
+ var _a;
16
+ state.defImgPreviewIndex = index;
17
+ (_a = state.onSwitch) == null ? void 0 : _a.call(state, index);
18
+ }
19
+ function handlePreviewShow(payload) {
20
+ var _a;
21
+ (_a = state.onShow) == null ? void 0 : _a.call(state, payload);
22
+ }
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createBlock(_sfc_main$1, {
25
+ visible: unref(state).showImgPreview,
26
+ "url-list": unref(state).previewImgList,
27
+ "initial-index": unref(state).defImgPreviewIndex,
28
+ infinite: unref(state).infinite,
29
+ "z-index": unref(state).zIndex,
30
+ "toolbar-bg-color": unref(state).toolbarBgColor,
31
+ "toolbar-icon-color": unref(state).toolbarIconColor,
32
+ "hide-on-click-modal": unref(state).hideOnClickModal,
33
+ "close-on-press-escape": unref(state).closeOnPressEscape,
34
+ teleported: unref(state).teleported,
35
+ "zoom-rate": unref(state).zoomRate,
36
+ scale: unref(state).scale,
37
+ "min-scale": unref(state).minScale,
38
+ "max-scale": unref(state).maxScale,
39
+ "show-progress": unref(state).showProgress,
40
+ "simple-extra-tools": unref(state).simpleExtraTools,
41
+ "render-extra-tools": unref(state).renderExtraTools,
42
+ "original-toolbar": unref(state).originalToolbar,
43
+ onClose: handlePreviewClose,
44
+ onSwitch: handlePreviewSwitch,
45
+ onShow: handlePreviewShow
46
+ }, null, 8, ["visible", "url-list", "initial-index", "infinite", "z-index", "toolbar-bg-color", "toolbar-icon-color", "hide-on-click-modal", "close-on-press-escape", "teleported", "zoom-rate", "scale", "min-scale", "max-scale", "show-progress", "simple-extra-tools", "render-extra-tools", "original-toolbar"]);
47
+ };
48
+ }
49
+ });
50
+ export {
51
+ _sfc_main as _
52
+ };
@@ -0,0 +1,188 @@
1
+ import './LazyPopover.css';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { defineComponent, useAttrs, computed, ref, openBlock, createElementBlock, Fragment, createElementVNode, mergeProps, renderSlot, createBlock, unref, withCtx, createCommentVNode } from "vue";
33
+ import { ElPopover } from "element-plus";
34
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
35
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
36
+ inheritAttrs: false
37
+ }), {
38
+ __name: "LazyPopover",
39
+ props: {
40
+ props: { default: () => ({}) }
41
+ },
42
+ setup(__props) {
43
+ const props = __props;
44
+ const attrs = useAttrs();
45
+ const triggerAttrs = computed(() => {
46
+ const _a = attrs, { width: _w, placement: _p, trigger: _t, teleported: _tp, popperClass: _pc, "popper-class": _pcc } = _a, rest = __objRest(_a, ["width", "placement", "trigger", "teleported", "popperClass", "popper-class"]);
47
+ return rest;
48
+ });
49
+ const attrsPopoverProps = computed(() => {
50
+ const { width, placement, trigger, teleported, popperClass, "popper-class": popperClassKebab } = attrs;
51
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, width != null ? { width } : {}), placement != null ? { placement } : {}), trigger != null ? { trigger } : {}), teleported != null ? { teleported } : {}), popperClass != null ? { popperClass } : {}), popperClassKebab != null ? { popperClass: popperClassKebab } : {});
52
+ });
53
+ const mounted = ref(false);
54
+ const visible = ref(false);
55
+ const triggerRef = ref(null);
56
+ let showTimer = null;
57
+ let hideTimer = null;
58
+ let inTrigger = false;
59
+ let inPopper = false;
60
+ const resolvedTrigger = computed(
61
+ () => {
62
+ var _a, _b, _c;
63
+ return String((_c = (_b = attrsPopoverProps.value.trigger) != null ? _b : (_a = props.props) == null ? void 0 : _a.trigger) != null ? _c : "hover");
64
+ }
65
+ );
66
+ const isHoverTrigger = computed(() => resolvedTrigger.value === "hover");
67
+ const showAfterMs = computed(() => {
68
+ var _a, _b, _c;
69
+ const p = (_a = props.props) != null ? _a : {};
70
+ return Number((_c = (_b = p.showAfter) != null ? _b : p["show-after"]) != null ? _c : 0);
71
+ });
72
+ const hideAfterMs = computed(() => {
73
+ var _a, _b, _c;
74
+ const p = (_a = props.props) != null ? _a : {};
75
+ return Number((_c = (_b = p.hideAfter) != null ? _b : p["hide-after"]) != null ? _c : 200);
76
+ });
77
+ function clearShowTimer() {
78
+ if (showTimer) {
79
+ clearTimeout(showTimer);
80
+ showTimer = null;
81
+ }
82
+ }
83
+ function clearHideTimer() {
84
+ if (hideTimer) {
85
+ clearTimeout(hideTimer);
86
+ hideTimer = null;
87
+ }
88
+ }
89
+ function scheduleShow() {
90
+ if (!isHoverTrigger.value || visible.value) return;
91
+ clearHideTimer();
92
+ if (showTimer) return;
93
+ showTimer = setTimeout(() => {
94
+ showTimer = null;
95
+ visible.value = true;
96
+ }, showAfterMs.value);
97
+ }
98
+ function scheduleHide() {
99
+ if (!isHoverTrigger.value) return;
100
+ clearShowTimer();
101
+ if (hideTimer) return;
102
+ hideTimer = setTimeout(() => {
103
+ hideTimer = null;
104
+ if (!inTrigger && !inPopper) {
105
+ visible.value = false;
106
+ }
107
+ }, hideAfterMs.value);
108
+ }
109
+ function onTriggerMouseEnter() {
110
+ if (!mounted.value) {
111
+ mounted.value = true;
112
+ }
113
+ if (!isHoverTrigger.value) return;
114
+ inTrigger = true;
115
+ scheduleShow();
116
+ }
117
+ function onTriggerMouseLeave() {
118
+ if (!isHoverTrigger.value) return;
119
+ inTrigger = false;
120
+ scheduleHide();
121
+ }
122
+ function onPopperMouseEnter() {
123
+ if (!isHoverTrigger.value) return;
124
+ inPopper = true;
125
+ clearHideTimer();
126
+ }
127
+ function onPopperMouseLeave() {
128
+ if (!isHoverTrigger.value) return;
129
+ inPopper = false;
130
+ scheduleHide();
131
+ }
132
+ const popoverBind = computed(() => {
133
+ const userProps = __spreadValues(__spreadValues({}, attrsPopoverProps.value), props.props);
134
+ if (!isHoverTrigger.value) {
135
+ return userProps;
136
+ }
137
+ const _a = userProps, {
138
+ trigger: _trigger,
139
+ showAfter: _showAfter,
140
+ hideAfter: _hideAfter,
141
+ visible: _visible
142
+ } = _a, rest = __objRest(_a, [
143
+ "trigger",
144
+ "showAfter",
145
+ "hideAfter",
146
+ "visible"
147
+ ]);
148
+ return __spreadProps(__spreadValues({}, rest), {
149
+ trigger: "manual",
150
+ visible: visible.value
151
+ });
152
+ });
153
+ return (_ctx, _cache) => {
154
+ return openBlock(), createElementBlock(Fragment, null, [
155
+ createElementVNode("span", mergeProps({
156
+ ref_key: "triggerRef",
157
+ ref: triggerRef,
158
+ class: "fg-lazy-popover__trigger"
159
+ }, triggerAttrs.value, {
160
+ onMouseenter: onTriggerMouseEnter,
161
+ onMouseleave: onTriggerMouseLeave
162
+ }), [
163
+ renderSlot(_ctx.$slots, "reference", {}, void 0, true)
164
+ ], 16),
165
+ mounted.value ? (openBlock(), createBlock(unref(ElPopover), mergeProps({
166
+ key: 0,
167
+ "virtual-triggering": "",
168
+ "virtual-ref": triggerRef.value
169
+ }, popoverBind.value), {
170
+ default: withCtx(() => [
171
+ createElementVNode("div", {
172
+ class: "fg-lazy-popover__content",
173
+ onMouseenter: onPopperMouseEnter,
174
+ onMouseleave: onPopperMouseLeave
175
+ }, [
176
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
177
+ ], 32)
178
+ ]),
179
+ _: 3
180
+ }, 16, ["virtual-ref"])) : createCommentVNode("", true)
181
+ ], 64);
182
+ };
183
+ }
184
+ }));
185
+ const LazyPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0fad01ff"]]);
186
+ export {
187
+ LazyPopover as L
188
+ };
@@ -0,0 +1,5 @@
1
+
2
+ .fg-lazy-popover__trigger[data-v-0fad01ff] {
3
+ display: inline-block;
4
+ max-width: 100%;
5
+ }
@@ -19,7 +19,7 @@ import './SelectTree.css';var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { ElPopover, ElTreeV2, ElTag, ElIcon } from "element-plus/es";
22
- import { _ as _sfc_main$1 } from "./LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js";
22
+ import { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
23
23
  import { defineComponent, ref, computed, watch, nextTick, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode, createElementVNode, normalizeStyle, normalizeClass, createTextVNode, withDirectives, withModifiers, vModelText, toRaw } from "vue";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
25
25
  const global = globalThis || void 0 || self;
@@ -1110,7 +1110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1110
1110
  const _component_el_tag = ElTag;
1111
1111
  const _component_DynamicScrollerItem = resolveComponent("DynamicScrollerItem");
1112
1112
  const _component_DynamicScroller = resolveComponent("DynamicScroller");
1113
- const _component_LazyPopover = _sfc_main$1;
1113
+ const _component_LazyPopover = LazyPopover;
1114
1114
  const _component_ArrowDown = resolveComponent("ArrowDown");
1115
1115
  const _component_el_icon = ElIcon;
1116
1116
  const _component_CircleClose = resolveComponent("CircleClose");
@@ -1,7 +1,7 @@
1
1
  import { ElIcon } from "element-plus/es";
2
2
  import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, toDisplayString, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
3
3
  import { DocumentCopy } from "@element-plus/icons-vue";
4
- import { m as copyWord } from "./common-B1nSpTGn.js";
4
+ import { m as copyWord } from "./common-D0EYVGB2.js";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
6
6
  import './TextCopy.css';const _hoisted_1 = { class: "fg-text-copy leading-[16px] inline-flex items-center" };
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({