fangguo-component 1.2.3 → 1.2.5

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 (52) hide show
  1. package/dist/{ErrorImage-CFVt1ht_.js → ErrorImage-Ao9kEEUg.js} +2 -2
  2. package/dist/FgCascader.css +2 -14
  3. package/dist/{FgCascader.vue_vue_type_style_index_0_lang-CstlYwHs.js → FgCascader.vue_vue_type_style_index_0_lang-CtUPO8fk.js} +20 -26
  4. package/dist/{HSelect-DgFjd08Y.js → HSelect-0w2mSrtm.js} +1 -1
  5. package/dist/{HSelectAll.vue_vue_type_script_setup_true_lang-C6qzdQT-.js → HSelectAll.vue_vue_type_script_setup_true_lang-xHFbYs59.js} +1 -1
  6. package/dist/{HSelectSJ-DOFUzTZV.js → HSelectSJ-Cm573j6B.js} +1 -1
  7. package/dist/{ImgViewerHost.vue_vue_type_script_setup_true_lang-DBs42WOq.js → ImgViewerHost.vue_vue_type_script_setup_true_lang-DO9s-b9s.js} +42 -3
  8. package/dist/{LazyPopover-7ebuh-QG.js → LazyPopover-CcvilJ6U.js} +25 -3
  9. package/dist/LazyPopover.css +1 -1
  10. package/dist/{SelectTree-DUH92Iwr.js → SelectTree-BHvvkiQi.js} +1 -1
  11. package/dist/ViewImg-CLRjYOUN.js +556 -0
  12. package/dist/ViewImg.css +60 -35
  13. package/dist/ViewImgPopover-BtFnYval.js +463 -0
  14. package/dist/ViewImgPopover.css +28 -26
  15. package/dist/components/cascader/index.js +1 -1
  16. package/dist/components/errorImage/index.js +2 -2
  17. package/dist/components/hSelect/index.js +1 -1
  18. package/dist/components/hSelectAll/index.js +1 -1
  19. package/dist/components/hSelectSJ/index.js +1 -1
  20. package/dist/components/imgViewerHost/ImgViewerHost.vue.d.ts +7 -1
  21. package/dist/components/imgViewerHost/imgViewerAutoHost.d.ts +2 -0
  22. package/dist/components/imgViewerHost/imgViewerHostRegistry.d.ts +5 -0
  23. package/dist/components/imgViewerHost/index.js +2 -2
  24. package/dist/components/index.js +22 -18
  25. package/dist/components/lazyPopover/LazyPopover.vue.d.ts +2 -0
  26. package/dist/components/lazyPopover/index.js +1 -1
  27. package/dist/components/selectTree/index.js +1 -1
  28. package/dist/components/viewImg/ViewImg.vue.d.ts +44 -19
  29. package/dist/components/viewImg/ViewImgErrorFallback.vue.d.ts +17 -0
  30. package/dist/components/viewImg/defaults.d.ts +28 -0
  31. package/dist/components/viewImg/index.d.ts +3 -0
  32. package/dist/components/viewImg/index.js +6 -2
  33. package/dist/components/viewImgPopover/ViewImgPopover.vue.d.ts +207 -99
  34. package/dist/components/viewImgPopover/index.js +1 -1
  35. package/dist/components/viewImgPreview/ViewImgPreview.vue.d.ts +6 -6
  36. package/dist/imgViewerAutoHost-BQVVGop1.js +32 -0
  37. package/dist/{imgViewerStore-DK3zvGf4.js → imgViewerStore-Ajm-L7R5.js} +7 -0
  38. package/dist/{index-Qkq7I01c.js → index-DsfY1yqo.js} +6 -1
  39. package/dist/{index-Ce_edAQB.js → index-wDrpgKQT.js} +17 -13
  40. package/dist/index.d.ts +8 -3
  41. package/dist/index.js +58 -49
  42. package/dist/montageImgUrl-B9ZmJ7TF.js +464 -0
  43. package/dist/tools/ImageParserUtils/index.d.ts +1 -1
  44. package/dist/tools/imgUrl/imageUrl.d.ts +246 -0
  45. package/dist/tools/imgUrl/index.d.ts +2 -0
  46. package/dist/tools/imgUrl/index.js +13 -8
  47. package/dist/tools/imgUrl/montageImgUrl.d.ts +11 -5
  48. package/dist/tools/index.js +19 -14
  49. package/package.json +2 -2
  50. package/dist/ViewImg-DXhF20SL.js +0 -254
  51. package/dist/ViewImgPopover-QblZG0z5.js +0 -343
  52. package/dist/montageImgUrl-CwgYnB2h.js +0 -204
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
30
  };
31
31
  }
32
32
  });
33
- const FgErrorImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-612063c5"]]);
33
+ const ErrorImage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-612063c5"]]);
34
34
  export {
35
- FgErrorImage as F
35
+ ErrorImage as E
36
36
  };
@@ -1,26 +1,14 @@
1
1
 
2
- .fg-doc-view-img-loading__box[data-v-552a6f88] {
2
+ .fg-doc-view-img-loading__box[data-v-436c9599] {
3
3
  width: 200px;
4
4
  height: 120px;
5
5
  background: #fafafa;
6
6
  border: 1px dashed var(--el-border-color);
7
7
  border-radius: 8px;
8
8
  }
9
- .fg-doc-view-img-loading__box[data-v-552a6f88] .fg-view-img {
9
+ .fg-doc-view-img-loading__box[data-v-436c9599] .fg-view-img {
10
10
  width: 100%;
11
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
12
  }
25
13
  .cascader-virtual-list[data-v-a251fab9] {
26
14
  height: 100%;
@@ -50,13 +50,13 @@ 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, 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";
53
+ import { getCurrentScope, onScopeDispose, watch, computed, toValue, shallowRef, getCurrentInstance, onMounted, warn, defineComponent, ref, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, unref, h, inject, resolveComponent, normalizeClass, createBlock, withModifiers, createCommentVNode, Fragment, normalizeStyle, 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
- import { ElCheckbox as ElCheckbox$1, ElRadio as ElRadio$1, ElIcon as ElIcon$1 } from "element-plus/es";
59
- import { F as FgViewImg } from "./ViewImg-DXhF20SL.js";
58
+ import { ElButton, ElCheckbox as ElCheckbox$1, ElRadio as ElRadio$1, ElIcon as ElIcon$1 } from "element-plus/es";
59
+ import { F as FgViewImg } from "./ViewImg-CLRjYOUN.js";
60
60
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
61
61
  import { b as script$2 } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
62
62
  !!(process$1.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
@@ -316,46 +316,40 @@ const castArray = (arr) => {
316
316
  };
317
317
  const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
318
318
  const generateId = () => Math.floor(Math.random() * 1e4);
319
- const _hoisted_1$2 = { class: "fg-doc-view-img-loading pt-1" };
319
+ const _hoisted_1$2 = { class: "fg-doc-view-img-loading flex flex-col items-start gap-3 pt-1" };
320
320
  const _hoisted_2$1 = { class: "fg-doc-view-img-loading__box" };
321
321
  const src = "https://element-plus.org/images/element-plus-logo.svg";
322
322
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
323
323
  __name: "Loading",
324
324
  setup(__props) {
325
325
  const loading = ref(true);
326
- onMounted(() => {
327
- window.setTimeout(() => {
328
- loading.value = false;
329
- }, 2e3);
330
- });
326
+ function toggleLoading() {
327
+ loading.value = !loading.value;
328
+ }
331
329
  return (_ctx, _cache) => {
330
+ const _component_el_button = ElButton;
332
331
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
332
+ createVNode(_component_el_button, {
333
+ size: "small",
334
+ onClick: toggleLoading
335
+ }, {
336
+ default: withCtx(() => [
337
+ createTextVNode(toDisplayString(loading.value ? "关闭加载中" : "开启加载中"), 1)
338
+ ]),
339
+ _: 1
340
+ }),
333
341
  createElementVNode("div", _hoisted_2$1, [
334
342
  createVNode(unref(FgViewImg), {
335
343
  src,
336
344
  loading: loading.value,
337
345
  "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))
346
+ }, null, 8, ["loading"])
347
+ ])
354
348
  ]);
355
349
  };
356
350
  }
357
351
  });
358
- const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-552a6f88"]]);
352
+ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-436c9599"]]);
359
353
  const NodeContent = defineComponent({
360
354
  name: "NodeContent",
361
355
  setup() {
@@ -41,7 +41,7 @@ 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
42
  import { q as debounce } from "./common-D0EYVGB2.js";
43
43
  import { Check, ArrowDown, CircleClose } from "@element-plus/icons-vue";
44
- import { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
44
+ import { L as LazyPopover } from "./LazyPopover-CcvilJ6U.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";
@@ -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-DgFjd08Y.js";
2
+ import { H as HSelect } from "./HSelect-0w2mSrtm.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",
@@ -41,7 +41,7 @@ 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
42
  import { q as debounce } from "./common-D0EYVGB2.js";
43
43
  import { Check, ArrowDown, CircleClose } from "@element-plus/icons-vue";
44
- import { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
44
+ import { L as LazyPopover } from "./LazyPopover-CcvilJ6U.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";
@@ -1,11 +1,48 @@
1
- import { defineComponent, openBlock, createBlock, unref } from "vue";
1
+ import { defineComponent, onMounted, onBeforeUnmount, openBlock, createBlock, unref } from "vue";
2
2
  import { _ as _sfc_main$1 } from "./ViewImgPreview.vue_vue_type_style_index_0_lang-C2i0p5IK.js";
3
- import { u as useImgViewerState, I as ImgViewerStore } from "./imgViewerStore-DK3zvGf4.js";
3
+ import { u as useImgViewerState, I as ImgViewerStore } from "./imgViewerStore-Ajm-L7R5.js";
4
+ let manualHostCount = 0;
5
+ let autoHostCount = 0;
6
+ let autoHostCleanup = null;
7
+ function setImgViewerAutoHostCleanup(cleanup) {
8
+ autoHostCleanup = cleanup;
9
+ }
10
+ function registerImgViewerHost(kind = "manual") {
11
+ if (kind === "auto") {
12
+ autoHostCount += 1;
13
+ return;
14
+ }
15
+ manualHostCount += 1;
16
+ if (autoHostCount > 0) {
17
+ autoHostCleanup == null ? void 0 : autoHostCleanup();
18
+ }
19
+ }
20
+ function unregisterImgViewerHost(kind = "manual") {
21
+ if (kind === "auto") {
22
+ autoHostCount = Math.max(0, autoHostCount - 1);
23
+ return;
24
+ }
25
+ manualHostCount = Math.max(0, manualHostCount - 1);
26
+ }
27
+ function hasImgViewerHost() {
28
+ return manualHostCount > 0 || autoHostCount > 0;
29
+ }
4
30
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
31
  __name: "ImgViewerHost",
32
+ props: {
33
+ autoHost: { type: Boolean, default: false }
34
+ },
6
35
  setup(__props) {
36
+ const props = __props;
7
37
  const state = useImgViewerState();
8
38
  const imgViewerStore = ImgViewerStore();
39
+ const hostKind = props.autoHost ? "auto" : "manual";
40
+ onMounted(() => {
41
+ registerImgViewerHost(hostKind);
42
+ });
43
+ onBeforeUnmount(() => {
44
+ unregisterImgViewerHost(hostKind);
45
+ });
9
46
  function handlePreviewClose() {
10
47
  var _a;
11
48
  (_a = state.onClose) == null ? void 0 : _a.call(state);
@@ -49,5 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
86
  }
50
87
  });
51
88
  export {
52
- _sfc_main as _
89
+ _sfc_main as _,
90
+ hasImgViewerHost as h,
91
+ setImgViewerAutoHostCleanup as s
53
92
  };
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { defineComponent, useAttrs, computed, ref, openBlock, createElementBlock, Fragment, createElementVNode, mergeProps, renderSlot, createBlock, unref, withCtx, createCommentVNode } from "vue";
32
+ import { defineComponent, useAttrs, computed, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, mergeProps, renderSlot, createBlock, unref, withCtx, createCommentVNode } from "vue";
33
33
  import { ElPopover } from "element-plus";
34
34
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
35
35
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
@@ -37,7 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
37
37
  }), {
38
38
  __name: "LazyPopover",
39
39
  props: {
40
- props: { default: () => ({}) }
40
+ props: { default: () => ({}) },
41
+ disabled: { type: Boolean, default: false }
41
42
  },
42
43
  setup(__props) {
43
44
  const props = __props;
@@ -107,6 +108,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
107
108
  }, hideAfterMs.value);
108
109
  }
109
110
  function onTriggerMouseEnter() {
111
+ if (props.disabled) return;
110
112
  if (!mounted.value) {
111
113
  mounted.value = true;
112
114
  }
@@ -131,6 +133,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
131
133
  }
132
134
  const popoverBind = computed(() => {
133
135
  const userProps = __spreadValues(__spreadValues({}, attrsPopoverProps.value), props.props);
136
+ if (props.disabled) {
137
+ const rest2 = __spreadValues({}, userProps);
138
+ delete rest2.trigger;
139
+ delete rest2.visible;
140
+ return __spreadProps(__spreadValues({}, rest2), {
141
+ trigger: "manual",
142
+ visible: false
143
+ });
144
+ }
134
145
  if (!isHoverTrigger.value) {
135
146
  return userProps;
136
147
  }
@@ -150,6 +161,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
150
161
  visible: visible.value
151
162
  });
152
163
  });
164
+ watch(
165
+ () => props.disabled,
166
+ (disabled) => {
167
+ if (!disabled) return;
168
+ clearShowTimer();
169
+ clearHideTimer();
170
+ visible.value = false;
171
+ inTrigger = false;
172
+ inPopper = false;
173
+ }
174
+ );
153
175
  return (_ctx, _cache) => {
154
176
  return openBlock(), createElementBlock(Fragment, null, [
155
177
  createElementVNode("span", mergeProps({
@@ -182,7 +204,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
182
204
  };
183
205
  }
184
206
  }));
185
- const LazyPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0fad01ff"]]);
207
+ const LazyPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-63cfbcce"]]);
186
208
  export {
187
209
  LazyPopover as L
188
210
  };
@@ -1,5 +1,5 @@
1
1
 
2
- .fg-lazy-popover__trigger[data-v-0fad01ff] {
2
+ .fg-lazy-popover__trigger[data-v-63cfbcce] {
3
3
  display: inline-block;
4
4
  max-width: 100%;
5
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 { L as LazyPopover } from "./LazyPopover-7ebuh-QG.js";
22
+ import { L as LazyPopover } from "./LazyPopover-CcvilJ6U.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;