yahee-components 0.0.108 → 0.0.110

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 (67) hide show
  1. package/es/annex-upload/annex-upload.vue.js +51 -154
  2. package/es/annex-upload/annex-upload.vue2.js +119 -2
  3. package/es/annex-upload/index.js +3 -3
  4. package/es/border-wrap/border-wrap.vue.js +64 -95
  5. package/es/border-wrap/border-wrap.vue2.js +46 -2
  6. package/es/common-import/common-import.vue.js +369 -693
  7. package/es/common-import/common-import.vue2.js +364 -2
  8. package/es/common-import/index.js +3 -3
  9. package/es/complex-search/batch-search-dialog.vue.js +116 -4
  10. package/es/complex-search/batch-search-dialog.vue2.js +27 -136
  11. package/es/complex-search/complex-search.vue.js +14 -14
  12. package/es/copy/copy.vue.js +37 -55
  13. package/es/copy/copy.vue2.js +34 -2
  14. package/es/copy/index.js +3 -3
  15. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +114 -213
  16. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
  17. package/es/drop-down-condition/drop-down-condition.vue.js +115 -215
  18. package/es/drop-down-condition/drop-down-condition.vue2.js +127 -2
  19. package/es/echart-gauge/echart-gauge.vue.js +12 -140
  20. package/es/echart-gauge/echart-gauge.vue2.js +147 -2
  21. package/es/echart-gauge/index.js +3 -3
  22. package/es/file-download-wrapper/file-download-wrapper.vue.js +143 -244
  23. package/es/file-download-wrapper/file-download-wrapper.vue2.js +113 -2
  24. package/es/file-download-wrapper/index.js +4 -4
  25. package/es/filter-container/filter-container.vue.js +18 -66
  26. package/es/filter-container/filter-container.vue2.js +59 -2
  27. package/es/filter-container/index.js +4 -4
  28. package/es/filter-wrapper/filter-wrapper.vue.js +16 -4
  29. package/es/filter-wrapper/filter-wrapper.vue2.js +40 -45
  30. package/es/height-collapse/height-collapse.vue.js +24 -51
  31. package/es/height-collapse/height-collapse.vue2.js +42 -2
  32. package/es/height-collapse/index.js +4 -4
  33. package/es/help-tag/help-tag.vue.js +44 -78
  34. package/es/help-tag/help-tag.vue2.js +49 -2
  35. package/es/help-tag/index.js +3 -3
  36. package/es/image-upload/image-upload.vue.js +109 -170
  37. package/es/image-upload/image-upload.vue2.js +91 -2
  38. package/es/image-upload/index.js +3 -3
  39. package/es/left-condition/index.js +3 -3
  40. package/es/left-condition/left-condition-sub.vue.js +32 -91
  41. package/es/left-condition/left-condition-sub.vue2.js +76 -2
  42. package/es/left-condition/left-condition.vue.js +70 -218
  43. package/es/left-condition/left-condition.vue2.js +160 -2
  44. package/es/left-condition-enum/index.js +3 -3
  45. package/es/left-condition-enum/left-condition-enum.vue.js +20 -49
  46. package/es/left-condition-enum/left-condition-enum.vue2.js +40 -2
  47. package/es/operation-log/operation-log-content.vue.js +71 -92
  48. package/es/operation-log/operation-log-content.vue2.js +39 -2
  49. package/es/operation-log/operation-log-dialog.vue.js +45 -67
  50. package/es/operation-log/operation-log-dialog.vue2.js +38 -2
  51. package/es/operation-log/operation-log-form.vue.js +108 -183
  52. package/es/operation-log/operation-log-form.vue2.js +104 -2
  53. package/es/operation-log/operation-log.vue.js +119 -228
  54. package/es/operation-log/operation-log.vue2.js +135 -2
  55. package/es/packages/components/api/log-server.js +6 -6
  56. package/es/packages/components/api/upload-server.js +1 -1
  57. package/es/packages/components/hooks/useEcharts.js +19 -19
  58. package/es/packages/components/hooks/useImg.js +8 -8
  59. package/es/scale-screen/index.js +4 -4
  60. package/es/scale-screen/scale-screen.vue.js +19 -126
  61. package/es/scale-screen/scale-screen.vue2.js +125 -2
  62. package/es/yahee-components.css +1 -1
  63. package/package.json +1 -1
  64. package/types/src/installs.d.ts +4 -4
  65. package/types/src/operation-log/index.d.ts +4 -4
  66. package/types/src/operation-log/operation-log-form.vue.d.ts +3 -3
  67. package/types/src/operation-log/operation-log.vue.d.ts +4 -4
@@ -1,4 +1,115 @@
1
- import f from "./file-download-wrapper.vue.js";
1
+ import { defineComponent as q, ref as L, watch as A, onMounted as O, computed as E } from "vue";
2
+ import { ElMessage as f } from "element-plus";
3
+ import "element-plus/theme-chalk/src/base.scss";
4
+ import "element-plus/theme-chalk/src/badge.scss";
5
+ import "element-plus/theme-chalk/src/message.scss";
6
+ import j from "../_virtual/jszip.min.js";
7
+ import { Document as M } from "@element-plus/icons-vue";
8
+ import { FILE_TYPE_REGEX as u } from "./key.js";
9
+ import z from "../packages/components/hooks/useImgPath.js";
10
+ const m = "[文件批量下载调试]", re = /* @__PURE__ */ q({
11
+ __name: "file-download-wrapper",
12
+ props: {
13
+ fileId: { type: String, required: !0 },
14
+ fileName: { type: String, required: !0 },
15
+ fileUrl: { type: String, required: !0 },
16
+ files: { type: Array, required: !0 },
17
+ showBatchDownload: { type: Boolean, required: !0 }
18
+ },
19
+ setup(_, { expose: I }) {
20
+ I();
21
+ const l = _, o = (e, t) => {
22
+ t ? console.log(`${m} ${e}`, t) : console.log(`${m} ${e}`);
23
+ }, r = L([]), $ = L(!1), g = () => {
24
+ var e;
25
+ if ((e = l.files) != null && e.length) {
26
+ r.value = l.files.map((t) => ({
27
+ ...t,
28
+ checked: !1
29
+ })), o("初始化多文件列表:", r.value);
30
+ return;
31
+ }
32
+ l.fileName && (r.value = [
33
+ {
34
+ fileId: l.fileId,
35
+ fileName: l.fileName,
36
+ fileUrl: l.fileUrl,
37
+ checked: !1
38
+ }
39
+ ], o("初始化单文件列表:", r.value));
40
+ };
41
+ A(
42
+ () => [l.files, l.fileId, l.fileName, l.fileUrl],
43
+ () => g(),
44
+ { deep: !0, immediate: !0 }
45
+ ), O(() => g());
46
+ const b = E(() => {
47
+ const e = r.value.filter((t) => t.checked);
48
+ return o("当前选中的文件:", e), e;
49
+ }), T = E(() => r.value.length > 1 && l.showBatchDownload), U = (e) => e.fileUrl ? e.fileUrl : e.fileId ? `http://qas-service.yahee.com.cn:8088/FMSService/Latest/${e.fileId}` : "", k = {
50
+ isImageFile: (e) => u.image.test(e),
51
+ isWordFile: (e) => u.word.test(e),
52
+ isPdfFile: (e) => u.pdf.test(e),
53
+ isPptFile: (e) => u.ppt.test(e),
54
+ isExcelFile: (e) => u.excel.test(e),
55
+ isTxtFile: (e) => u.txt.test(e)
56
+ }, { isImageFile: N, isWordFile: S, isPdfFile: R, isPptFile: C, isExcelFile: D, isTxtFile: x } = k, y = { props: l, DEBUG_TAG: m, debugLog: o, fileList: r, isAllChecked: $, initFileList: g, selectedFiles: b, isMultiMode: T, getFileUrl: U, fileTypeJudge: k, isImageFile: N, isWordFile: S, isPdfFile: R, isPptFile: C, isExcelFile: D, isTxtFile: x, handleSingleCheck: () => {
57
+ $.value = r.value.every((e) => e.checked);
58
+ }, handleAllCheck: (e) => {
59
+ r.value.forEach((t) => {
60
+ t.checked = e;
61
+ });
62
+ }, handleTxtSingleDownload: async (e) => {
63
+ try {
64
+ const t = U(e);
65
+ o("开始单个TXT文件下载,URL:", t), o("使用的文件名:", e.fileName);
66
+ const a = await fetch(t);
67
+ if (!a.ok) throw new Error("文件请求失败");
68
+ const p = await a.blob(), i = window.URL.createObjectURL(p), n = document.createElement("a");
69
+ n.href = i, n.download = e.fileName, document.body.appendChild(n), n.click(), document.body.removeChild(n), window.URL.revokeObjectURL(i), f.success("下载成功");
70
+ } catch (t) {
71
+ console.error(`${m} TXT文件下载失败:`, t), f.error("文件下载失败,请重试");
72
+ }
73
+ }, handleBatchDownload: async () => {
74
+ if (b.value.length === 0) {
75
+ f.warning("请先选择要下载的文件");
76
+ return;
77
+ }
78
+ o("========== 开始批量下载流程 ==========");
79
+ const e = new j(), t = [];
80
+ f.info("正在加载文件并打包,请稍候...");
81
+ try {
82
+ b.value.forEach((n, d) => {
83
+ const v = U(n), c = n.fileName;
84
+ o(`[文件 ${d + 1}] 开始处理`), o(`[文件 ${d + 1}] 请求URL:`, v), o(`[文件 ${d + 1}] 使用的文件名:`, c);
85
+ const P = fetch(v).then((s) => {
86
+ if (!s.ok) throw new Error(`【${c}】加载失败,状态码:${s.status}`);
87
+ return s.blob();
88
+ }).then((s) => {
89
+ let h = c, F = 1;
90
+ for (; e.files[h]; ) {
91
+ const w = c.lastIndexOf("."), B = w > -1 ? c.slice(w) : "";
92
+ h = `${w > -1 ? c.slice(0, w) : c}(${F})${B}`, F++;
93
+ }
94
+ h !== c && o(`[文件 ${d + 1}] 检测到重名,重命名为:`, h), e.file(h, s), o(`[文件 ${d + 1}] 已加入压缩包`);
95
+ }).catch((s) => {
96
+ throw console.error(`${m} [文件 ${d + 1}] 处理失败:`, s), s;
97
+ });
98
+ t.push(P);
99
+ }), o("等待所有文件加载完成..."), await Promise.all(t), o("所有文件加载完成,开始生成压缩包...");
100
+ const a = await e.generateAsync({ type: "blob" }), p = window.URL.createObjectURL(a), i = document.createElement("a");
101
+ i.href = p, i.download = `批量文件下载_${Date.now()}.zip`, document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(p), o("========== 批量下载流程完成 =========="), f.success("批量打包下载完成");
102
+ } catch (a) {
103
+ console.error(`${m} 批量下载失败:`, a), f.error("打包下载失败,请检查控制台日志");
104
+ }
105
+ }, get Document() {
106
+ return M;
107
+ }, get useImagePath() {
108
+ return z;
109
+ } };
110
+ return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
111
+ }
112
+ });
2
113
  export {
3
- f as default
114
+ re as default
4
115
  };
@@ -1,7 +1,7 @@
1
1
  import { withInstall as o } from "../utils/install.js";
2
- import a from "./file-download-wrapper.vue.js";
3
- const e = o(a);
2
+ import r from "./file-download-wrapper.vue.js";
3
+ const l = o(r);
4
4
  export {
5
- e as YaheeFileDownloadWrapper,
6
- e as default
5
+ l as YaheeFileDownloadWrapper,
6
+ l as default
7
7
  };
@@ -1,72 +1,24 @@
1
- import { defineComponent as K, mergeDefaults as M, ref as v, computed as p, useSlots as S, provide as O, onMounted as V, onUnmounted as $, createElementBlock as l, openBlock as h, createCommentVNode as y, renderSlot as g } from "vue";
2
- import { defaultFilterContainerProps as x } from "./props.js";
3
- import { filterContainerKey as z } from "./key.js";
4
- import I from "../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js";
5
- const D = { class: "yahee-filter-container" }, N = {
1
+ import c from "./filter-container.vue2.js";
2
+ import { createElementBlock as e, openBlock as o, createCommentVNode as s, renderSlot as n } from "vue";
3
+ import i from "../_virtual/_plugin-vue_export-helper.js";
4
+ const a = { class: "yahee-filter-container" }, l = {
6
5
  key: 0,
7
6
  class: "filter-section"
8
- }, P = {
7
+ }, _ = {
9
8
  key: 1,
10
9
  class: "search-section"
11
- }, J = /* @__PURE__ */ K({
12
- name: "YaheeFilterContainer",
13
- __name: "filter-container",
14
- props: /* @__PURE__ */ M({
15
- debounceInterval: {},
16
- immediate: { type: Boolean },
17
- initialSearchItem: {},
18
- showSearchSection: { type: Boolean }
19
- }, x()),
20
- emits: ["change", "search"],
21
- setup(C, { expose: _, emit: b }) {
22
- const n = C, c = b, t = v({});
23
- n.initialSearchItem && Object.keys(n.initialSearchItem).length > 0 && (t.value = { ...n.initialSearchItem });
24
- const s = v(/* @__PURE__ */ new Map()), k = p(() => s.value.size > 0 || !!S().filters), A = p(() => n.showSearchSection || Array.from(s.value.values()).some((e) => e.type === "search") || !!S().search), m = I((e) => {
25
- c("change", e);
26
- }, n.debounceInterval), u = I((e) => {
27
- c("search", e);
28
- }, n.debounceInterval), w = (e, r, a = "filter") => {
29
- s.value.set(e, { methods: r, type: a });
30
- }, E = (e) => {
31
- s.value.delete(e);
32
- }, d = (e) => {
33
- const r = Array.isArray(e) ? e : [e], a = { ...t.value };
34
- r.forEach((j) => {
35
- const { filterKey: i, checkedValues: o } = j;
36
- o.length === 0 || o[0] === "" || o[0] === null || o[0] === void 0 ? delete a[i] : o.length === 1 ? a[i] = o[0] : a[i] = o;
37
- }), t.value = a, m({ ...a });
38
- }, B = (e) => {
39
- const r = { ...t.value, ...e };
40
- t.value = r, u({ ...r });
41
- }, F = () => {
42
- t.value = { ...n.initialSearchItem }, s.value.forEach((e) => {
43
- e.methods.reset && e.methods.reset();
44
- }), c("change", { ...t.value });
45
- }, f = () => ({ ...t.value });
46
- return O(z, {
47
- registerComponent: w,
48
- unregisterComponent: E,
49
- updateSearchItem: d,
50
- handleSearch: B,
51
- getCurrentSearchItem: f
52
- }), _({
53
- resetAllFilters: F,
54
- getCurrentSearchItem: f,
55
- updateSearchItem: d
56
- }), V(() => {
57
- n.immediate && Object.keys(t.value).length > 0 && c("change", { ...t.value });
58
- }), $(() => {
59
- m.cancel(), u.cancel();
60
- }), (e, r) => (h(), l("div", D, [
61
- k.value ? (h(), l("div", N, [
62
- g(e.$slots, "filters")
63
- ])) : y("", !0),
64
- A.value ? (h(), l("div", P, [
65
- g(e.$slots, "search")
66
- ])) : y("", !0)
67
- ]));
68
- }
69
- });
10
+ };
11
+ function f(t, m, d, r, p, h) {
12
+ return o(), e("div", a, [
13
+ r.hasFilters ? (o(), e("div", l, [
14
+ n(t.$slots, "filters")
15
+ ])) : s("", !0),
16
+ r.hasSearch ? (o(), e("div", _, [
17
+ n(t.$slots, "search")
18
+ ])) : s("", !0)
19
+ ]);
20
+ }
21
+ const $ = /* @__PURE__ */ i(c, [["render", f], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/filter-container/filter-container.vue"]]);
70
22
  export {
71
- J as default
23
+ $ as default
72
24
  };
@@ -1,4 +1,61 @@
1
- import f from "./filter-container.vue.js";
1
+ import { defineComponent as F, mergeDefaults as O, ref as g, computed as I, useSlots as b, provide as k, onMounted as x, onUnmounted as B } from "vue";
2
+ import { defaultFilterContainerProps as K } from "./props.js";
3
+ import { filterContainerKey as M } from "./key.js";
4
+ import _ from "../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js";
5
+ const U = /* @__PURE__ */ F({
6
+ name: "YaheeFilterContainer",
7
+ __name: "filter-container",
8
+ props: /* @__PURE__ */ O({
9
+ debounceInterval: { type: Number, required: !1 },
10
+ immediate: { type: Boolean, required: !1 },
11
+ initialSearchItem: { type: Object, required: !1 },
12
+ showSearchSection: { type: Boolean, required: !1 }
13
+ }, K()),
14
+ emits: ["change", "search"],
15
+ setup(C, { expose: A, emit: w }) {
16
+ const r = C, c = w, t = g({});
17
+ r.initialSearchItem && Object.keys(r.initialSearchItem).length > 0 && (t.value = { ...r.initialSearchItem });
18
+ const o = g(/* @__PURE__ */ new Map()), j = I(() => o.value.size > 0 || !!b().filters), q = I(() => r.showSearchSection || Array.from(o.value.values()).some((e) => e.type === "search") || !!b().search), i = _((e) => {
19
+ c("change", e);
20
+ }, r.debounceInterval), l = _((e) => {
21
+ c("search", e);
22
+ }, r.debounceInterval), d = (e, s, n = "filter") => {
23
+ o.value.set(e, { methods: s, type: n });
24
+ }, f = (e) => {
25
+ o.value.delete(e);
26
+ }, u = (e) => {
27
+ const s = Array.isArray(e) ? e : [e], n = { ...t.value };
28
+ s.forEach((E) => {
29
+ const { filterKey: h, checkedValues: a } = E;
30
+ a.length === 0 || a[0] === "" || a[0] === null || a[0] === void 0 ? delete n[h] : a.length === 1 ? n[h] = a[0] : n[h] = a;
31
+ }), t.value = n, i({ ...n });
32
+ }, p = (e) => {
33
+ const s = { ...t.value, ...e };
34
+ t.value = s, l({ ...s });
35
+ }, v = () => {
36
+ t.value = { ...r.initialSearchItem }, o.value.forEach((e) => {
37
+ e.methods.reset && e.methods.reset();
38
+ }), c("change", { ...t.value });
39
+ }, m = () => ({ ...t.value }), S = {
40
+ registerComponent: d,
41
+ unregisterComponent: f,
42
+ updateSearchItem: u,
43
+ handleSearch: p,
44
+ getCurrentSearchItem: m
45
+ };
46
+ k(M, S), A({
47
+ resetAllFilters: v,
48
+ getCurrentSearchItem: m,
49
+ updateSearchItem: u
50
+ }), x(() => {
51
+ r.immediate && Object.keys(t.value).length > 0 && c("change", { ...t.value });
52
+ }), B(() => {
53
+ i.cancel(), l.cancel();
54
+ });
55
+ const y = { props: r, emit: c, searchItem: t, registeredComponents: o, hasFilters: j, hasSearch: q, debouncedEmitChange: i, debouncedEmitSearch: l, registerComponent: d, unregisterComponent: f, updateSearchItem: u, handleSearch: p, resetAllFilters: v, getCurrentSearchItem: m, containerApi: S };
56
+ return Object.defineProperty(y, "__isScriptSetup", { enumerable: !1, value: !0 }), y;
57
+ }
58
+ });
2
59
  export {
3
- f as default
60
+ U as default
4
61
  };
@@ -1,7 +1,7 @@
1
1
  import { withInstall as t } from "../utils/install.js";
2
- import o from "./filter-container.vue.js";
3
- const e = t(o);
2
+ import r from "./filter-container.vue.js";
3
+ const i = t(r);
4
4
  export {
5
- e as YaheeFilterContainer,
6
- e as default
5
+ i as YaheeFilterContainer,
6
+ i as default
7
7
  };
@@ -1,7 +1,19 @@
1
- import r from "./filter-wrapper.vue2.js";
1
+ import t from "./filter-wrapper.vue2.js";
2
+ import { createElementBlock as o, openBlock as a, renderSlot as p } from "vue";
2
3
  /* empty css */
3
- import o from "../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(r, [["__scopeId", "data-v-1188ff04"]]);
4
+ import c from "../_virtual/_plugin-vue_export-helper.js";
5
+ const n = { class: "filter-wrapper yahee-filter-wrapper" };
6
+ function i(r, l, s, e, d, m) {
7
+ return a(), o("div", n, [
8
+ p(r.$slots, "default", {
9
+ register: e.register,
10
+ update: e.updateFilter,
11
+ getCurrentSearchItem: e.getCurrentSearchItem,
12
+ handleSearch: e.handleSearch
13
+ }, void 0, !0)
14
+ ]);
15
+ }
16
+ const g = /* @__PURE__ */ c(t, [["render", i], ["__scopeId", "data-v-d9497b3a"], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/filter-wrapper/filter-wrapper.vue"]]);
5
17
  export {
6
- a as default
18
+ g as default
7
19
  };
@@ -1,61 +1,56 @@
1
- import { defineComponent as u, mergeDefaults as f, inject as l, onMounted as d, onUnmounted as h, createElementBlock as y, openBlock as S, renderSlot as g } from "vue";
2
- import { defaultFilterWrapperProps as I } from "./props.js";
3
- import { filterContainerKey as _ } from "../filter-container/key.js";
4
- const K = { class: "filter-wrapper yahee-filter-wrapper" }, w = /* @__PURE__ */ u({
1
+ import { defineComponent as f, mergeDefaults as d, inject as l, onMounted as y, onUnmounted as S } from "vue";
2
+ import { defaultFilterWrapperProps as g } from "./props.js";
3
+ import { filterContainerKey as h } from "../filter-container/key.js";
4
+ const q = /* @__PURE__ */ f({
5
5
  name: "YaheeFilterWrapper",
6
6
  __name: "filter-wrapper",
7
- props: /* @__PURE__ */ f({
8
- id: {},
9
- filterKey: {},
10
- type: {},
11
- reset: { type: Function },
12
- immediate: { type: Boolean }
13
- }, I()),
14
- setup(c, { expose: m }) {
15
- const t = c, e = l(_), n = (r = {}) => {
7
+ props: /* @__PURE__ */ d({
8
+ id: { type: String, required: !0 },
9
+ filterKey: { type: String, required: !0 },
10
+ type: { type: String, required: !1 },
11
+ reset: { type: Function, required: !1 },
12
+ immediate: { type: Boolean, required: !1 }
13
+ }, g()),
14
+ setup(o, { expose: m }) {
15
+ const r = o, e = l(h), n = (t = {}) => {
16
16
  e && e.registerComponent(
17
- t.id,
17
+ r.id,
18
18
  {
19
- reset: t.reset || r.reset,
20
- ...r
19
+ reset: r.reset || t.reset,
20
+ ...t
21
21
  },
22
- t.type
22
+ r.type
23
23
  );
24
- }, a = (r) => {
24
+ }, i = (t) => {
25
25
  if (!e) return;
26
- const p = Array.isArray(r) ? r : [r];
26
+ const c = Array.isArray(t) ? t : [t];
27
27
  e.updateSearchItem({
28
- filterKey: t.filterKey,
29
- checkedValues: p
28
+ filterKey: r.filterKey,
29
+ checkedValues: c
30
30
  });
31
- }, o = () => e != null && e.getCurrentSearchItem ? e.getCurrentSearchItem() : {}, s = (r) => {
32
- e != null && e.handleSearch && e.handleSearch(r);
33
- }, i = () => {
34
- t.reset && t.reset();
31
+ }, a = () => e != null && e.getCurrentSearchItem ? e.getCurrentSearchItem() : {}, u = (t) => {
32
+ e != null && e.handleSearch && e.handleSearch(t);
33
+ }, s = () => {
34
+ r.reset && r.reset();
35
35
  };
36
- return m({
36
+ m({
37
37
  register: n,
38
- updateFilter: a,
39
- getCurrentSearchItem: o,
40
- handleSearch: s,
41
- reset: i
42
- }), d(() => {
43
- if (n({ reset: i }), t.immediate && (e != null && e.getCurrentSearchItem)) {
44
- const r = e.getCurrentSearchItem();
45
- r[t.filterKey] && a(r[t.filterKey]);
38
+ updateFilter: i,
39
+ getCurrentSearchItem: a,
40
+ handleSearch: u,
41
+ reset: s
42
+ }), y(() => {
43
+ if (n({ reset: s }), r.immediate && (e != null && e.getCurrentSearchItem)) {
44
+ const t = e.getCurrentSearchItem();
45
+ t[r.filterKey] && i(t[r.filterKey]);
46
46
  }
47
- }), h(() => {
48
- e && e.unregisterComponent(t.id);
49
- }), (r, p) => (S(), y("div", K, [
50
- g(r.$slots, "default", {
51
- register: n,
52
- update: a,
53
- getCurrentSearchItem: o,
54
- handleSearch: s
55
- }, void 0, !0)
56
- ]));
47
+ }), S(() => {
48
+ e && e.unregisterComponent(r.id);
49
+ });
50
+ const p = { props: r, filterContainer: e, register: n, updateFilter: i, getCurrentSearchItem: a, handleSearch: u, reset: s };
51
+ return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
57
52
  }
58
53
  });
59
54
  export {
60
- w as default
55
+ q as default
61
56
  };
@@ -1,53 +1,26 @@
1
- import { defineComponent as x, mergeDefaults as w, ref as s, watch as H, onMounted as y, onUnmounted as T, createElementBlock as u, openBlock as p, createElementVNode as k, createCommentVNode as E, normalizeStyle as v, renderSlot as _, normalizeClass as C, toDisplayString as z, nextTick as d } from "vue";
2
- import { defaultHeightCollapseProps as B } from "./props.js";
3
- const R = { class: "yahee-height-collapse-wrapper" }, S = ["title"], L = /* @__PURE__ */ x({
4
- __name: "height-collapse",
5
- props: /* @__PURE__ */ w({
6
- maxHeight: {},
7
- defaultExpand: { type: Boolean },
8
- expandTitle: {},
9
- collapseTitle: {}
10
- }, B()),
11
- emits: ["change"],
12
- setup(m, { emit: h }) {
13
- const l = m, f = h, e = s(l.defaultExpand), c = s(!1), t = s(null), i = s(l.maxHeight + 5);
14
- let o = null;
15
- const r = () => {
16
- if (!t.value) {
17
- i.value = l.maxHeight + 5;
18
- return;
19
- }
20
- e.value ? i.value = t.value.scrollHeight : i.value = Math.min(t.value.clientHeight, l.maxHeight);
21
- }, n = async () => {
22
- if (await d(), !t.value) return;
23
- const { scrollHeight: a } = t.value;
24
- c.value = a > l.maxHeight, r();
25
- }, g = async () => {
26
- e.value = !e.value, f("change", e.value), await d(), r();
27
- };
28
- return H(() => l.maxHeight, n), y(() => {
29
- n(), t.value && (o = new ResizeObserver(n), o.observe(t.value)), window.addEventListener("resize", n);
30
- }), T(() => {
31
- o == null || o.disconnect(), window.removeEventListener("resize", n);
32
- }), (a, $) => (p(), u("div", R, [
33
- k("div", {
34
- ref_key: "contentRef",
35
- ref: t,
36
- class: "height-collapse-content",
37
- style: v(e.value ? {} : { maxHeight: `${a.maxHeight}px`, overflow: "hidden" })
38
- }, [
39
- _(a.$slots, "default")
40
- ], 4),
41
- c.value ? (p(), u("div", {
42
- key: 0,
43
- title: e.value ? a.expandTitle : a.collapseTitle,
44
- class: C(["show-filters", { more: !e.value }]),
45
- style: v({ top: `${i.value}px` }),
46
- onClick: g
47
- }, z(e.value ? "∧" : "∨"), 15, S)) : E("", !0)
48
- ]));
49
- }
50
- });
1
+ import a from "./height-collapse.vue2.js";
2
+ import { createElementBlock as t, openBlock as l, createElementVNode as c, createCommentVNode as s, normalizeStyle as i, renderSlot as r, normalizeClass as d, toDisplayString as m } from "vue";
3
+ import p from "../_virtual/_plugin-vue_export-helper.js";
4
+ const h = { class: "yahee-height-collapse-wrapper" }, f = ["title"];
5
+ function _(n, g, o, e, x, E) {
6
+ return l(), t("div", h, [
7
+ c("div", {
8
+ ref: "contentRef",
9
+ class: "height-collapse-content",
10
+ style: i(e.isExpand ? {} : { maxHeight: `${o.maxHeight}px`, overflow: "hidden" })
11
+ }, [
12
+ r(n.$slots, "default")
13
+ ], 4),
14
+ e.isOverflow ? (l(), t("div", {
15
+ key: 0,
16
+ title: e.isExpand ? o.expandTitle : o.collapseTitle,
17
+ class: d(["show-filters", { more: !e.isExpand }]),
18
+ style: i({ top: `${e.buttonTop}px` }),
19
+ onClick: e.clickToggleFilter
20
+ }, m(e.isExpand ? "∧" : "∨"), 15, f)) : s("", !0)
21
+ ]);
22
+ }
23
+ const w = /* @__PURE__ */ p(a, [["render", _], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/height-collapse/height-collapse.vue"]]);
51
24
  export {
52
- L as default
25
+ w as default
53
26
  };
@@ -1,4 +1,44 @@
1
- import f from "./height-collapse.vue.js";
1
+ import { defineComponent as h, mergeDefaults as x, ref as i, watch as w, onMounted as H, onUnmounted as _, nextTick as f } from "vue";
2
+ import { defaultHeightCollapseProps as b } from "./props.js";
3
+ const E = /* @__PURE__ */ h({
4
+ __name: "height-collapse",
5
+ props: /* @__PURE__ */ x({
6
+ maxHeight: { type: Number, required: !1 },
7
+ defaultExpand: { type: Boolean, required: !1 },
8
+ expandTitle: { type: String, required: !1 },
9
+ collapseTitle: { type: String, required: !1 }
10
+ }, b()),
11
+ emits: ["change"],
12
+ setup(v, { expose: d, emit: m }) {
13
+ d();
14
+ const t = v, u = m, l = i(t.defaultExpand), c = i(!1), e = i(null), r = i(t.maxHeight + 5);
15
+ let a = null;
16
+ const s = () => {
17
+ if (!e.value) {
18
+ r.value = t.maxHeight + 5;
19
+ return;
20
+ }
21
+ l.value ? r.value = e.value.scrollHeight : r.value = Math.min(e.value.clientHeight, t.maxHeight);
22
+ }, n = async () => {
23
+ if (await f(), !e.value) return;
24
+ const { scrollHeight: o } = e.value;
25
+ c.value = o > t.maxHeight, s();
26
+ }, g = async () => {
27
+ l.value = !l.value, u("change", l.value), await f(), s();
28
+ };
29
+ w(() => t.maxHeight, n), H(() => {
30
+ n(), e.value && (a = new ResizeObserver(n), a.observe(e.value)), window.addEventListener("resize", n);
31
+ }), _(() => {
32
+ a == null || a.disconnect(), window.removeEventListener("resize", n);
33
+ });
34
+ const p = { props: t, emit: u, isExpand: l, isOverflow: c, contentRef: e, buttonTop: r, get resizeObserver() {
35
+ return a;
36
+ }, set resizeObserver(o) {
37
+ a = o;
38
+ }, updateButtonTop: s, calcOverflow: n, clickToggleFilter: g };
39
+ return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
40
+ }
41
+ });
2
42
  export {
3
- f as default
43
+ E as default
4
44
  };
@@ -1,7 +1,7 @@
1
1
  import { withInstall as t } from "../utils/install.js";
2
- import o from "./height-collapse.vue.js";
3
- const i = t(o);
2
+ import e from "./height-collapse.vue.js";
3
+ const a = t(e);
4
4
  export {
5
- i as YaheeHeightCollapse,
6
- i as default
5
+ a as YaheeHeightCollapse,
6
+ a as default
7
7
  };