@web-utils/component 2.8.1 → 2.8.2

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 (83) hide show
  1. package/base.css +1 -1
  2. package/card/index.mjs +33 -37
  3. package/chat/index.mjs +132 -123
  4. package/chunks/{dataformat.25e22176.mjs → dataformat.ab62230f.mjs} +1 -1
  5. package/chunks/{detail.6e53ede8.mjs → detail.6e46de33.mjs} +1 -1
  6. package/chunks/dic.7f13b573.mjs +130 -0
  7. package/chunks/{event.a018cb06.mjs → event.1ac32f1d.mjs} +2 -2
  8. package/chunks/{init.f04c7036.mjs → init.47ce5ed9.mjs} +2 -2
  9. package/chunks/util.505913d9.mjs +266 -0
  10. package/column/index.mjs +2 -2
  11. package/column-default/index.mjs +1 -1
  12. package/column-dynamic/index.mjs +1 -1
  13. package/column-menu/index.mjs +81 -79
  14. package/column-slot/index.mjs +8 -7
  15. package/comment/index.mjs +6 -10
  16. package/data-pay/index.mjs +16 -13
  17. package/data-table-picker/index.mjs +22 -22
  18. package/dialog-excel/index.mjs +8 -8
  19. package/dialog-filter/index.mjs +4 -2
  20. package/dialog-form/index.mjs +6 -6
  21. package/editable-tree/index.mjs +5 -5
  22. package/flow/index.mjs +11 -11
  23. package/flow/style.css +1 -1
  24. package/flow-node/index.mjs +2 -2
  25. package/form-button/index.mjs +16 -38
  26. package/form-group/index.mjs +28 -33
  27. package/form-temp/index.mjs +15 -27
  28. package/fy-array/index.mjs +44 -42
  29. package/fy-cascader/index.mjs +1 -1
  30. package/fy-checkbox/index.mjs +2 -1
  31. package/fy-code/index.mjs +1 -1
  32. package/fy-curd/index.mjs +29 -31
  33. package/fy-date/index.mjs +1 -1
  34. package/fy-dialog-form/index.mjs +5 -11
  35. package/fy-draggable/index.mjs +3 -3
  36. package/fy-dynamic/index.mjs +3 -3
  37. package/fy-empty/index.mjs +1 -1
  38. package/fy-form/index.mjs +133 -122
  39. package/fy-form-design/index.mjs +2595 -2610
  40. package/fy-form-design/style.css +1 -1
  41. package/fy-input/index.mjs +10 -15
  42. package/fy-input-color/index.mjs +1 -1
  43. package/fy-input-icon/index.mjs +21 -16
  44. package/fy-input-map/index.mjs +22 -19
  45. package/fy-input-number/index.mjs +1 -1
  46. package/fy-input-table/index.mjs +1 -1
  47. package/fy-input-tree/index.mjs +5 -6
  48. package/fy-radio/index.mjs +3 -1
  49. package/fy-rate/index.mjs +2 -1
  50. package/fy-select/index.mjs +29 -28
  51. package/fy-slider/index.mjs +2 -2
  52. package/fy-switch/index.mjs +2 -1
  53. package/fy-tabs/index.mjs +19 -17
  54. package/fy-time/index.mjs +1 -1
  55. package/fy-title/index.mjs +1 -1
  56. package/fy-tree/index.mjs +8 -6
  57. package/fy-u-editor/index.mjs +10 -14
  58. package/fy-upload/index.mjs +85 -84
  59. package/header-menu/index.mjs +1 -1
  60. package/header-search/index.mjs +7 -5
  61. package/image-cropper/index.mjs +1 -1
  62. package/image-preview/index.mjs +1 -1
  63. package/index.cjs +39 -39
  64. package/index.css +1 -1
  65. package/index.mjs +16577 -16591
  66. package/license/index.mjs +1 -1
  67. package/login/index.mjs +1 -1
  68. package/monaco-editor/index.mjs +3 -3
  69. package/package.json +1 -1
  70. package/process-designer/index.mjs +10 -2
  71. package/queue/index.mjs +3 -8
  72. package/queue/style.css +1 -0
  73. package/record-video/index.mjs +1 -1
  74. package/search/index.mjs +2 -2
  75. package/search-popover/index.mjs +25 -24
  76. package/sign/index.mjs +17 -18
  77. package/sign/style.css +1 -1
  78. package/table-page/index.mjs +21 -23
  79. package/text-ellipsis/index.mjs +1 -1
  80. package/verify/index.mjs +1 -1
  81. package/web-types.json +52 -166
  82. package/chunks/dic.e8280157.mjs +0 -130
  83. package/chunks/util.17330567.mjs +0 -266
package/web-types.json CHANGED
@@ -2,54 +2,11 @@
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@web-utils/component",
5
- "version": "2.8.1",
5
+ "version": "2.8.2",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "description-markup": "markdown",
9
9
  "tags": [
10
- {
11
- "name": "XInputTag",
12
- "description": "",
13
- "attributes": [
14
- {
15
- "name": "value",
16
- "value": {
17
- "kind": "expression",
18
- "type": "array|string"
19
- },
20
- "default": "() => []"
21
- },
22
- {
23
- "name": "disabled",
24
- "value": {
25
- "kind": "expression",
26
- "type": "boolean"
27
- },
28
- "default": ""
29
- },
30
- {
31
- "name": "separator",
32
- "value": {
33
- "kind": "expression",
34
- "type": "string"
35
- },
36
- "default": "','"
37
- },
38
- {
39
- "name": "arrayMode",
40
- "value": {
41
- "kind": "expression",
42
- "type": "boolean"
43
- },
44
- "default": "true"
45
- }
46
- ],
47
- "events": [
48
- {
49
- "name": "input"
50
- }
51
- ]
52
- },
53
10
  {
54
11
  "name": "AddressInput",
55
12
  "description": "",
@@ -317,14 +274,6 @@
317
274
  "name": "Card",
318
275
  "description": "",
319
276
  "attributes": [
320
- {
321
- "name": "props",
322
- "value": {
323
- "kind": "expression",
324
- "type": "object"
325
- },
326
- "default": "propsDefault"
327
- },
328
277
  {
329
278
  "name": "option",
330
279
  "value": {
@@ -858,14 +807,6 @@
858
807
  "type": "object"
859
808
  },
860
809
  "default": "propsDefault"
861
- },
862
- {
863
- "name": "option",
864
- "value": {
865
- "kind": "expression",
866
- "type": "object"
867
- },
868
- "default": "{}"
869
810
  }
870
811
  ],
871
812
  "slots": [
@@ -1519,6 +1460,14 @@
1519
1460
  "name": "DataTablePicker",
1520
1461
  "description": "",
1521
1462
  "attributes": [
1463
+ {
1464
+ "name": "visible",
1465
+ "value": {
1466
+ "kind": "expression",
1467
+ "type": "boolean"
1468
+ },
1469
+ "default": ""
1470
+ },
1522
1471
  {
1523
1472
  "name": "api",
1524
1473
  "value": {
@@ -4264,14 +4213,6 @@
4264
4213
  },
4265
4214
  "default": "true"
4266
4215
  },
4267
- {
4268
- "name": "card",
4269
- "value": {
4270
- "kind": "expression",
4271
- "type": "boolean"
4272
- },
4273
- "default": "false"
4274
- },
4275
4216
  {
4276
4217
  "name": "label",
4277
4218
  "value": {
@@ -7935,54 +7876,6 @@
7935
7876
  },
7936
7877
  "default": ""
7937
7878
  },
7938
- {
7939
- "name": "uploadBefore",
7940
- "value": {
7941
- "kind": "expression",
7942
- "type": "func"
7943
- },
7944
- "default": ""
7945
- },
7946
- {
7947
- "name": "uploadDelete",
7948
- "value": {
7949
- "kind": "expression",
7950
- "type": "func"
7951
- },
7952
- "default": ""
7953
- },
7954
- {
7955
- "name": "uploadAfter",
7956
- "value": {
7957
- "kind": "expression",
7958
- "type": "func"
7959
- },
7960
- "default": ""
7961
- },
7962
- {
7963
- "name": "uploadPreview",
7964
- "value": {
7965
- "kind": "expression",
7966
- "type": "func"
7967
- },
7968
- "default": ""
7969
- },
7970
- {
7971
- "name": "uploadError",
7972
- "value": {
7973
- "kind": "expression",
7974
- "type": "func"
7975
- },
7976
- "default": ""
7977
- },
7978
- {
7979
- "name": "uploadExceed",
7980
- "value": {
7981
- "kind": "expression",
7982
- "type": "func"
7983
- },
7984
- "default": ""
7985
- },
7986
7879
  {
7987
7880
  "name": "columnSlot",
7988
7881
  "value": {
@@ -7999,14 +7892,6 @@
7999
7892
  },
8000
7893
  "default": "{}"
8001
7894
  },
8002
- {
8003
- "name": "clearable",
8004
- "value": {
8005
- "kind": "expression",
8006
- "type": "boolean"
8007
- },
8008
- "default": ""
8009
- },
8010
7895
  {
8011
7896
  "name": "enter",
8012
7897
  "value": {
@@ -8047,14 +7932,6 @@
8047
7932
  },
8048
7933
  "default": ""
8049
7934
  },
8050
- {
8051
- "name": "placeholder",
8052
- "value": {
8053
- "kind": "expression",
8054
- "type": "string"
8055
- },
8056
- "default": ""
8057
- },
8058
7935
  {
8059
7936
  "name": "size",
8060
7937
  "value": {
@@ -10354,16 +10231,6 @@
10354
10231
  {
10355
10232
  "name": "FyDialogForm",
10356
10233
  "description": "",
10357
- "attributes": [
10358
- {
10359
- "name": "value",
10360
- "value": {
10361
- "kind": "expression",
10362
- "type": "object"
10363
- },
10364
- "default": "{}"
10365
- }
10366
- ],
10367
10234
  "slots": [
10368
10235
  {
10369
10236
  "name": "item"
@@ -11465,14 +11332,6 @@
11465
11332
  },
11466
11333
  "default": "false"
11467
11334
  },
11468
- {
11469
- "name": "target",
11470
- "value": {
11471
- "kind": "expression",
11472
- "type": "string"
11473
- },
11474
- "default": "' _blank'"
11475
- },
11476
11335
  {
11477
11336
  "name": "prefixIcon",
11478
11337
  "value": {
@@ -16599,14 +16458,6 @@
16599
16458
  },
16600
16459
  "default": "{}"
16601
16460
  },
16602
- {
16603
- "name": "options",
16604
- "value": {
16605
- "kind": "expression",
16606
- "type": "object"
16607
- },
16608
- "default": "{}"
16609
- },
16610
16461
  {
16611
16462
  "name": "ali",
16612
16463
  "value": {
@@ -19090,14 +18941,6 @@
19090
18941
  },
19091
18942
  "default": "'fadeInLeft'"
19092
18943
  },
19093
- {
19094
- "name": "leave",
19095
- "value": {
19096
- "kind": "expression",
19097
- "type": "string"
19098
- },
19099
- "default": "'fadeOutRight'"
19100
- },
19101
18944
  {
19102
18945
  "name": "block",
19103
18946
  "value": {
@@ -20926,6 +20769,49 @@
20926
20769
  "default": "'rgba(0,0,0,0)'"
20927
20770
  }
20928
20771
  ]
20772
+ },
20773
+ {
20774
+ "name": "XInputTag",
20775
+ "description": "",
20776
+ "attributes": [
20777
+ {
20778
+ "name": "value",
20779
+ "value": {
20780
+ "kind": "expression",
20781
+ "type": "array|string"
20782
+ },
20783
+ "default": "() => []"
20784
+ },
20785
+ {
20786
+ "name": "disabled",
20787
+ "value": {
20788
+ "kind": "expression",
20789
+ "type": "boolean"
20790
+ },
20791
+ "default": ""
20792
+ },
20793
+ {
20794
+ "name": "separator",
20795
+ "value": {
20796
+ "kind": "expression",
20797
+ "type": "string"
20798
+ },
20799
+ "default": "','"
20800
+ },
20801
+ {
20802
+ "name": "arrayMode",
20803
+ "value": {
20804
+ "kind": "expression",
20805
+ "type": "boolean"
20806
+ },
20807
+ "default": "true"
20808
+ }
20809
+ ],
20810
+ "events": [
20811
+ {
20812
+ "name": "input"
20813
+ }
20814
+ ]
20929
20815
  }
20930
20816
  ]
20931
20817
  }
@@ -1,130 +0,0 @@
1
- import { isBlank as w } from "@web-utils/core";
2
- import { l as D, m as E } from "./util.17330567.mjs";
3
- const F = (d, t = []) => new Promise((i, o) => {
4
- const c = [], a = [], s = {};
5
- d.forEach((e) => {
6
- e.parentProp && c.push(e);
7
- }), t.forEach((e, n) => {
8
- c.forEach((r) => {
9
- r.hide !== !0 && r.dicFlag !== !1 && a.push(
10
- new Promise((u) => {
11
- w(e[r.parentProp]) ? u({
12
- prop: r.prop,
13
- data: [],
14
- index: n
15
- }) : r.dicUrl && g({
16
- url: `${r.dicUrl.replace("{{key}}", e[r.parentProp])}`,
17
- props: r.props,
18
- method: r.dicMethod,
19
- headers: r.dicHeaders,
20
- formatter: r.dicFormatter,
21
- query: r.dicQuery,
22
- form: e
23
- }).then((l) => {
24
- u({
25
- prop: r.prop,
26
- data: l,
27
- index: n
28
- });
29
- });
30
- })
31
- );
32
- });
33
- }), Promise.all(a).then((e) => {
34
- e.forEach((n) => {
35
- w(s[n.index]) && (s[n.index] = {}), s[n.index][n.prop] = n.data;
36
- }), i(s);
37
- });
38
- }), U = (d) => {
39
- let t = [];
40
- return new Promise((i, o) => {
41
- t = k(d).ajaxdic, j(t).then((a) => {
42
- i(a);
43
- }).catch((a) => {
44
- o(a);
45
- });
46
- });
47
- }, K = (d) => {
48
- const t = {}, i = d.dicData || {};
49
- return d.column.forEach((o) => {
50
- o.dicData && (t[o.prop] = D(o.dicData, o.props, o.dataType));
51
- }), Object.assign(i, t);
52
- };
53
- function k(d) {
54
- const t = d.column || [], i = [], o = {};
55
- let c = [];
56
- return t.forEach((a) => {
57
- const s = a.dicData, e = a.dicUrl, n = a.prop, r = a.parentProp;
58
- c = c.concat(a.cascader || []), Array.isArray(s) && (o[n] = s), !(a.dicFlag === !1 || a.lazy === !0 || c.includes(n)) && e && !r && i.push({
59
- url: e,
60
- name: n,
61
- method: a.dicMethod,
62
- headers: t.dicHeaders,
63
- formatter: a.dicFormatter,
64
- props: a.props,
65
- dataType: a.dataType,
66
- resKey: (a.props || {}).res,
67
- query: a.dicQuery || {}
68
- });
69
- }), {
70
- ajaxdic: i,
71
- locationdic: o
72
- };
73
- }
74
- function j(d) {
75
- const t = {}, i = [];
76
- return new Promise((o) => {
77
- d.forEach((c) => {
78
- i.push(
79
- new Promise((a) => {
80
- g(Object.assign(c, {
81
- url: `${c.url.replace("{{key}}", "")}`
82
- })).then((s) => {
83
- s = D(s, c.props, c.dataType), a(s);
84
- }).catch(() => {
85
- a([]);
86
- });
87
- })
88
- );
89
- }), Promise.all(i).then((c) => {
90
- d.forEach((a, s) => {
91
- t[a.name] = c[s];
92
- }), o(t);
93
- });
94
- });
95
- }
96
- const g = (d) => {
97
- let { url: t, query: i, method: o, resKey: c, props: a, formatter: s, headers: e = {}, value: n = "", column: r, form: u = {} } = d;
98
- r && (t = r.dicUrl, o = r.dicMethod, e = r.headers || {}, i = r.dicQuery || {}, s = r.dicFormatter, a = r.props);
99
- const l = "key";
100
- t = t || "";
101
- let m;
102
- const y = {};
103
- return m = t.match(/[^{}]+(?=})/g) || [], m.forEach((p) => {
104
- const f = `{{${p}}}`, h = u[p];
105
- p === l ? t = t.replace(f, n) : t = t.replace(f, h);
106
- }), o === "post" && (m = Object.keys(i), m.forEach((p) => {
107
- const f = i[p];
108
- typeof f == "string" && f.match(/\{{|}}/g) ? y[p] = u[f.replace(/\{{|}}/g, "")] : y[p] = f;
109
- })), a && (c = (a || {}).res || c), new Promise((p) => {
110
- const f = (h) => {
111
- let P = [];
112
- typeof s == "function" ? P = s(h.data) : P = E(h.data, c), p(P);
113
- };
114
- o === "post" ? window.axios.post(t, y, { headers: e }).then(function(h) {
115
- f(h);
116
- }).catch(() => [
117
- p([])
118
- ]) : window.axios.get(t, { params: i, headers: e }).then(function(h) {
119
- f(h);
120
- }).catch(() => [
121
- p([])
122
- ]);
123
- });
124
- };
125
- export {
126
- U as a,
127
- F as b,
128
- K as l,
129
- g as s
130
- };
@@ -1,266 +0,0 @@
1
- import { isBlank, getObjType } from "@web-utils/core";
2
- const KEY_COMPONENT_NAME = "fy-", DIC_PROPS = {
3
- rowKey: "id",
4
- rowParentKey: "parentId",
5
- nodeKey: "id",
6
- label: "label",
7
- value: "value",
8
- desc: "desc",
9
- groups: "groups",
10
- title: "title",
11
- leaf: "leaf",
12
- children: "children",
13
- hasChildren: "hasChildren",
14
- labelText: "名称",
15
- disabled: "disabled"
16
- }, DIC_HTTP_PROPS = {
17
- name: "name",
18
- url: "url",
19
- fileName: "file",
20
- res: ""
21
- }, DATE_LIST = [
22
- "dates",
23
- "date",
24
- "datetime",
25
- "datetimerange",
26
- "daterange",
27
- "time",
28
- "timerange",
29
- "week",
30
- "month",
31
- "monthrange",
32
- "year"
33
- ], INPUT_LIST = ["tree", "number", "icon", "color", "table", "map"], ARRAY_LIST = ["img", "array", "url"], MULTIPLE_LIST = ["cascader", "tree", "select"], RANGE_LIST = ["slider"], ARRAY_VALUE_LIST = ARRAY_LIST.concat(["upload", "dynamic", "map", "checkbox", "cascader", "dynamic", "timerange", "monthrange", "daterange", "datetimerange", "dates"]), SELECT_LIST = DATE_LIST.concat(["select", "checkbox", "radio", "cascader", "tree", "color", "icon", "table", "map"]), DIC_SHOW_SPLIT = " | ", DIC_SPLIT = ",", typeList = {
34
- img: /\.(gif|jpg|jpeg|png|webp|svg|GIF|JPG|JPEG|PNG|WEBP|SVG)/,
35
- video: /\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|ogg|mp4)/,
36
- audio: /\.(mp3|wav|MP3|WAV)/
37
- }, isMediaType = (e, n) => {
38
- if (!isBlank(e))
39
- return typeList.audio.test(e) || n === "audio" ? "audio" : typeList.video.test(e) || n === "video" ? "video" : typeList.img.test(e) || n === "img" ? "img" : !1;
40
- };
41
- function getFixed(e = 0, n = 2) {
42
- return Number(e.toFixed(n));
43
- }
44
- function getAsVal(e, n = "") {
45
- let r = deepClone(e);
46
- return isBlank(n) || n.split(".").forEach((t) => {
47
- r = isBlank(r[t]) ? "" : r[t];
48
- }), r;
49
- }
50
- function setAsVal(obj, bind = "", value) {
51
- let result;
52
- const type = getObjType(value);
53
- return isBlank(value) ? type === "array" ? result = `obj.${bind}=[]` : type === "object" ? result = `obj.${bind}={}` : ["number", "boolean"].includes(type) ? result = `obj.${bind}=undefined` : result = `obj.${bind}=''` : type === "string" ? result = `obj.${bind}='${value}'` : result = `obj.${bind}=${value}`, eval(result), obj;
54
- }
55
- function downFile(e, n) {
56
- typeof e == "object" && e instanceof Blob && (e = URL.createObjectURL(e));
57
- const r = document.createElement("a");
58
- r.href = e, r.download = n || "";
59
- let t;
60
- window.MouseEvent ? t = new MouseEvent("click") : (t = document.createEvent("MouseEvents"), t.initMouseEvent(
61
- "click",
62
- !0,
63
- !1,
64
- window,
65
- 0,
66
- 0,
67
- 0,
68
- 0,
69
- 0,
70
- !1,
71
- !1,
72
- !1,
73
- !1,
74
- 0,
75
- null
76
- )), r.dispatchEvent(t);
77
- }
78
- function strCorNum(e) {
79
- return e.forEach((n, r) => {
80
- e[r] = Number(n);
81
- }), e;
82
- }
83
- function extend(...e) {
84
- let n = e[0] || {}, r = !1;
85
- const t = Array.prototype.slice.call(e);
86
- let s = 1, i, o, a, l, c = !1;
87
- for (typeof n == "boolean" && (r = n, s++, n = e[1]); s < t.length; s++)
88
- if ((i = t[s]) != null)
89
- for (a in i)
90
- l = i[a], o = n[a], r && (toString.call(l) === "[object Object]" || (c = toString.call(l) === "[object Array]")) ? (c ? o = toString.call(o) === "[object Array]" ? o : [] : o = toString.call(o) === "[object Object]" ? o : {}, n[a] = extend(r, o, l)) : l !== void 0 && l !== o && (n[a] = l);
91
- return n;
92
- }
93
- function createObj(e, n) {
94
- const r = n.split("."), t = r.splice(0, 1)[0], s = {};
95
- if (s[t] = {}, r.length >= 2) {
96
- const i = "{", o = "}";
97
- let a = "";
98
- r.forEach((l) => {
99
- a = `${a}${i}"${l}":`;
100
- }), a = `${a}""`;
101
- for (let l = 0; l < r.length; l++)
102
- a = `${a}${o}`;
103
- a = JSON.parse(a), s[t] = a;
104
- }
105
- return e = extend(!0, e, s), e;
106
- }
107
- function dataURLtoFile(e, n) {
108
- const r = e.split(","), t = r[0].match(/:(.*?);/)[1], s = atob(r[1]);
109
- let i = s.length;
110
- const o = new Uint8Array(i);
111
- for (; i--; )
112
- o[i] = s.charCodeAt(i);
113
- return new File([o], n, {
114
- type: t
115
- });
116
- }
117
- function findObject(e, n, r = "prop") {
118
- let t = -1;
119
- const s = (() => {
120
- let i;
121
- return e.forEach((o) => {
122
- o.column ? i = "group" : o.children && (i = "tree");
123
- }), i;
124
- })();
125
- return s === "group" ? e.forEach((i) => {
126
- const o = findArray(i.column, n, r, !0);
127
- o !== -1 && (t = o);
128
- }) : s === "tree" ? t = findLabelNode(e, n, { value: r }, !0) : t = findArray(e, n, r, !0), t;
129
- }
130
- function randomId() {
131
- const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", n = e.length;
132
- let r = "";
133
- for (let t = 0; t < 16; t++)
134
- r += e.charAt(Math.floor(Math.random() * n));
135
- return r;
136
- }
137
- const deepClone = (e) => {
138
- const n = getObjType(e);
139
- let r;
140
- if (n === "array")
141
- r = [];
142
- else if (n === "object")
143
- r = {};
144
- else
145
- return e;
146
- if (n === "array") {
147
- e = e;
148
- let t = 0;
149
- const s = e.length;
150
- for (; t < s; t++)
151
- e[t] && delete e[t].$parent, r.push(deepClone(e[t]));
152
- } else if (n === "object")
153
- for (const t in e) {
154
- const s = e[t];
155
- s && delete s.$parent, r[t] = deepClone(e[t]);
156
- }
157
- return r;
158
- }, setPx = (e, n = "") => (e || (e = n), e ? (e = `${e}`, e.indexOf("%") === -1 && e.indexOf("px") === -1 && (e = `${e}px`), e) : ""), detailDataType = (e, n) => isBlank(e) ? e : n === "number" ? Number(e) : n === "string" ? `${e}` : e, detailDic = (e = [], n = {}, r) => {
159
- const t = n.value || DIC_PROPS.value, s = n.children || DIC_PROPS.children;
160
- return e.forEach((i) => {
161
- i[t] = detailDataType(i[t], r), i[s] && detailDic(i[s], n, r);
162
- }), e;
163
- }, findByValue = (e, n, r) => {
164
- if (isBlank(e))
165
- return n;
166
- const t = n instanceof Array, s = t ? n : [n];
167
- r = r || DIC_PROPS;
168
- const i = [];
169
- for (let o = 0; o < s.length; o++)
170
- i.push(findLabelNode(e, s[o], r) || s[o]);
171
- return t ? i.join(DIC_SHOW_SPLIT) : i.join();
172
- }, filterParams = (e, n = ["", "$"], r = !0) => {
173
- const t = r ? deepClone(e) : e;
174
- for (const s in t)
175
- n.includes("") && isBlank(t[s]) && delete t[s], n.includes("$") && s.indexOf("$") !== -1 && delete t[s];
176
- return t;
177
- }, detailDicGroup = (e = [], n = {}) => {
178
- let r = deepClone(e);
179
- const t = n[DIC_PROPS.groups] || DIC_PROPS.groups;
180
- return e.forEach((s) => {
181
- s[t] && (r = r.concat(s[t]));
182
- }), r;
183
- }, findLabelNode = (e, n, r, t = null) => {
184
- let s;
185
- t || (e = detailDicGroup(e, r));
186
- const i = (o) => {
187
- const a = r.label || DIC_PROPS.label, l = r.value || DIC_PROPS.value, c = r.children || DIC_PROPS.children;
188
- for (let u = 0; u < o.length; u++) {
189
- const f = o[u], d = f[c] || [];
190
- f[l] === n ? s = t ? f : f[a] : i(d);
191
- }
192
- };
193
- return i(e), s;
194
- }, getDeepData = (e) => (Array.isArray(e) ? e : e.data) || [], getObjValue = (e, n = "", r = null) => {
195
- const t = n.split(".");
196
- let s = e;
197
- return t[0] === "" && r !== "object" ? getDeepData(e) : (t[0] !== "" && t.forEach((i) => {
198
- s = s[i];
199
- }), s);
200
- }, findArray = (e, n, r, t) => {
201
- r = r || DIC_PROPS.value;
202
- for (let s = 0; s < e.length; s++)
203
- if (e[s][r] === n)
204
- return t ? e[s] : s;
205
- return -1;
206
- }, getPasswordChar = (e = "", n) => {
207
- const r = e.toString().length;
208
- e = "";
209
- for (let t = 0; t < r; t++)
210
- e = e + n;
211
- return e;
212
- }, arraySort = (e = [], n, r) => e.filter((t) => !isBlank(t[n])).sort((t, s) => r(t, s)).concat(e.filter((t) => isBlank(t[n]))), clearVal = (e, n, r = []) => e ? (n.forEach((t) => {
213
- if (!r.includes(t)) {
214
- if (t.includes("$"))
215
- delete e[t];
216
- else if (!isBlank(e[t])) {
217
- const s = getObjType(e[t]);
218
- s === "array" ? e[t] = [] : s === "object" ? e[t] = {} : ["number", "boolean"].includes(s) ? e[t] = void 0 : e[t] = "";
219
- }
220
- }
221
- }), e) : {}, optVal = (e, n) => typeof e == "boolean" ? e : isBlank(e) ? n : e;
222
- function uploadFun(e = {}, n) {
223
- n = n || this;
224
- const r = ["uploadPreview", "uploadBefore", "uploadAfter", "uploadDelete", "uploadError", "uploadExceed"], t = {};
225
- return e.type === "upload" ? r.forEach((s) => {
226
- e[s] || (t[s] = n[s]);
227
- }) : r.forEach((s) => {
228
- t[s] = n[s];
229
- }), t;
230
- }
231
- export {
232
- ARRAY_VALUE_LIST as A,
233
- downFile as B,
234
- DIC_PROPS as D,
235
- INPUT_LIST as I,
236
- KEY_COMPONENT_NAME as K,
237
- MULTIPLE_LIST as M,
238
- RANGE_LIST as R,
239
- SELECT_LIST as S,
240
- arraySort as a,
241
- DIC_SHOW_SPLIT as b,
242
- DIC_SPLIT as c,
243
- deepClone as d,
244
- strCorNum as e,
245
- ARRAY_LIST as f,
246
- getAsVal as g,
247
- getPasswordChar as h,
248
- isMediaType as i,
249
- DATE_LIST as j,
250
- findByValue as k,
251
- detailDic as l,
252
- getObjValue as m,
253
- findObject as n,
254
- optVal as o,
255
- detailDataType as p,
256
- createObj as q,
257
- randomId as r,
258
- setPx as s,
259
- DIC_HTTP_PROPS as t,
260
- uploadFun as u,
261
- filterParams as v,
262
- getFixed as w,
263
- setAsVal as x,
264
- clearVal as y,
265
- dataURLtoFile as z
266
- };