@fangzhongya/fang-ui 0.1.37 → 0.1.39

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 (116) hide show
  1. package/dist/components/box-adjust/src/data.cjs +2 -2
  2. package/dist/components/box-adjust/src/data.d.ts +2 -2
  3. package/dist/components/box-adjust/src/data.js +2 -2
  4. package/dist/components/common/css.d.ts +7 -0
  5. package/dist/components/common/list.d.ts +7 -0
  6. package/dist/components/common/urls.d.ts +6 -0
  7. package/dist/components/common/use.cjs +18 -35
  8. package/dist/components/common/use.d.ts +91 -5
  9. package/dist/components/common/use.js +18 -35
  10. package/dist/components/dates2/src/data.cjs +1 -1
  11. package/dist/components/dates2/src/data.d.ts +1 -1
  12. package/dist/components/dates2/src/data.js +1 -1
  13. package/dist/components/forms/src/setup.cjs +8 -23
  14. package/dist/components/forms/src/setup.d.ts +11 -1
  15. package/dist/components/forms/src/setup.js +11 -26
  16. package/dist/components/forms/src/util.cjs +85 -17
  17. package/dist/components/forms/src/util.d.ts +13 -7
  18. package/dist/components/forms/src/util.js +87 -19
  19. package/dist/components/forms-item/src/label.cjs +0 -1
  20. package/dist/components/forms-item/src/label.js +0 -1
  21. package/dist/components/list/index.css +1 -1
  22. package/dist/components/list/index.scss +1 -1
  23. package/dist/components/list/src/data.cjs +3 -0
  24. package/dist/components/list/src/data.d.ts +3 -0
  25. package/dist/components/list/src/data.js +3 -0
  26. package/dist/components/list/src/index2.cjs +19 -24
  27. package/dist/components/list/src/index2.js +17 -22
  28. package/dist/components/list/src/util.cjs +14 -6
  29. package/dist/components/list/src/util.d.ts +2 -1
  30. package/dist/components/list/src/util.js +14 -6
  31. package/dist/components/list/style/index2.scss +1 -0
  32. package/dist/components/lists/index.css +1 -1
  33. package/dist/components/lists/src/data.d.ts +3 -3
  34. package/dist/components/lists/src/index2.cjs +9 -9
  35. package/dist/components/lists/src/index2.js +9 -9
  36. package/dist/components/listsp/index.css +1 -1
  37. package/dist/components/listspd/index.css +1 -1
  38. package/dist/components/no-data/src/data.cjs +2 -2
  39. package/dist/components/no-data/src/data.d.ts +2 -2
  40. package/dist/components/no-data/src/data.js +2 -2
  41. package/dist/components/no-data/src/index2.cjs +2 -2
  42. package/dist/components/no-data/src/index2.js +2 -2
  43. package/dist/components/page/index.css +1 -1
  44. package/dist/components/tables/common/com-but.cjs +4 -0
  45. package/dist/components/tables/common/com-but.js +4 -0
  46. package/dist/components/tables/common/{table-but2.cjs → com-but2.cjs} +17 -13
  47. package/dist/components/tables/common/{table-but2.js → com-but2.js} +14 -10
  48. package/dist/components/tables/common/com-color.cjs +4 -0
  49. package/dist/components/tables/common/com-color.js +4 -0
  50. package/dist/components/tables/common/{table-color2.cjs → com-color2.cjs} +21 -8
  51. package/dist/components/tables/common/{table-color2.js → com-color2.js} +23 -10
  52. package/dist/components/tables/common/com-fig.cjs +4 -0
  53. package/dist/components/tables/common/com-fig.js +4 -0
  54. package/dist/components/tables/common/com-fig2.cjs +92 -0
  55. package/dist/components/tables/common/com-fig2.js +92 -0
  56. package/dist/components/tables/common/com-lis.cjs +4 -0
  57. package/dist/components/tables/common/com-lis.js +4 -0
  58. package/dist/components/tables/common/com-lis2.cjs +151 -0
  59. package/dist/components/tables/common/com-lis2.js +151 -0
  60. package/dist/components/tables/common/pagin.d.ts +24 -6
  61. package/dist/components/tables/common/util.cjs +56 -4
  62. package/dist/components/tables/common/util.d.ts +14 -0
  63. package/dist/components/tables/common/util.js +57 -5
  64. package/dist/components/tables/src/column.cjs +5 -3
  65. package/dist/components/tables/src/column.js +6 -4
  66. package/dist/components/tables/src/columns2.cjs +9 -7
  67. package/dist/components/tables/src/columns2.js +9 -7
  68. package/dist/components/tables/src/data.d.ts +3 -3
  69. package/dist/components/tables/src/index2.cjs +1 -1
  70. package/dist/components/tables/src/index2.js +1 -1
  71. package/dist/components/tables/style/index2.scss +1 -0
  72. package/dist/components/tablesv/src/column.cjs +5 -3
  73. package/dist/components/tablesv/src/column.js +6 -4
  74. package/dist/components/tablesv/src/columns2.cjs +9 -7
  75. package/dist/components/tablesv/src/columns2.js +9 -7
  76. package/dist/components/tablesv/src/data.d.ts +3 -3
  77. package/dist/components/tablesv/src/index2.cjs +1 -1
  78. package/dist/components/tablesv/src/index2.js +1 -1
  79. package/dist/components/window/src/data.cjs +1 -1
  80. package/dist/components/window/src/data.d.ts +1 -1
  81. package/dist/components/window/src/data.js +1 -1
  82. package/dist/css/index.css +1 -1
  83. package/dist/css/list.css +1 -1
  84. package/dist/css/lists.css +1 -1
  85. package/dist/css/listsp.css +1 -1
  86. package/dist/css/listspd.css +1 -1
  87. package/dist/css/page.css +1 -1
  88. package/dist/icons/index.json +1 -1
  89. package/dist/index.css +1 -1
  90. package/dist/locale/en.cjs +2 -1
  91. package/dist/locale/en.d.ts +1 -0
  92. package/dist/locale/en.js +2 -1
  93. package/dist/locale/zh-cn.cjs +2 -1
  94. package/dist/locale/zh-cn.d.ts +1 -0
  95. package/dist/locale/zh-cn.js +2 -1
  96. package/dist/type.d.ts +12 -3
  97. package/dist/utils/css.cjs +4 -0
  98. package/dist/utils/css.d.ts +1 -0
  99. package/dist/utils/css.js +4 -0
  100. package/package.json +2 -2
  101. package/dist/components/tables/common/img.cjs +0 -4
  102. package/dist/components/tables/common/img.js +0 -4
  103. package/dist/components/tables/common/img2.cjs +0 -37
  104. package/dist/components/tables/common/img2.js +0 -37
  105. package/dist/components/tables/common/table-but.cjs +0 -4
  106. package/dist/components/tables/common/table-but.js +0 -4
  107. package/dist/components/tables/common/table-color.cjs +0 -4
  108. package/dist/components/tables/common/table-color.js +0 -4
  109. package/dist/components/tables/common/table-list.cjs +0 -4
  110. package/dist/components/tables/common/table-list.js +0 -4
  111. package/dist/components/tables/common/table-list2.cjs +0 -125
  112. package/dist/components/tables/common/table-list2.js +0 -125
  113. /package/dist/components/{global-config → draggable}/index.css +0 -0
  114. /package/dist/components/{forms-item → forms-items}/index.css +0 -0
  115. /package/dist/css/{global-config.css → draggable.css} +0 -0
  116. /package/dist/css/{forms-item.css → forms-items.css} +0 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index$1 = require("../../image/index.cjs");
5
+ const index = require("../../../hooks/cssname/index.cjs");
6
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
+ __name: "com-fig",
8
+ props: {
9
+ prefix: String,
10
+ maxHeight: {
11
+ type: String,
12
+ default: "100px"
13
+ },
14
+ class: {
15
+ type: String
16
+ },
17
+ style: {
18
+ type: Object
19
+ },
20
+ modelValue: {
21
+ type: [String, Array]
22
+ },
23
+ listobj: {
24
+ type: Object,
25
+ default() {
26
+ return {};
27
+ }
28
+ },
29
+ /**
30
+ * table数据
31
+ * row, column, $index
32
+ *
33
+ */
34
+ valueobj: {
35
+ type: Object,
36
+ default() {
37
+ return {};
38
+ }
39
+ },
40
+ comscope: {
41
+ type: Object,
42
+ default() {
43
+ return {};
44
+ }
45
+ }
46
+ },
47
+ setup(__props, { expose: __expose }) {
48
+ const cs = index.useCssName("com-fig");
49
+ const props = __props;
50
+ const value = vue.computed(() => {
51
+ const v = props.modelValue || void 0;
52
+ let arr;
53
+ if (typeof v === "string") {
54
+ arr = v.split(",");
55
+ } else {
56
+ arr = v;
57
+ }
58
+ if (props.prefix) {
59
+ return arr == null ? void 0 : arr.map((r) => {
60
+ return props.prefix + r;
61
+ });
62
+ } else {
63
+ return arr;
64
+ }
65
+ });
66
+ __expose({});
67
+ return (_ctx, _cache) => {
68
+ var _a, _b;
69
+ return value.value && value.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
70
+ key: 0,
71
+ class: vue.normalizeClass([vue.unref(cs).z(), props.class]),
72
+ style: vue.normalizeStyle({
73
+ maxHeight: props.maxHeight,
74
+ ...props.style
75
+ })
76
+ }, [
77
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(value.value, (item, index2) => {
78
+ return vue.openBlock(), vue.createBlock(vue.unref(index$1.Image), {
79
+ key: index2,
80
+ fit: "contain",
81
+ src: item,
82
+ "preview-teleported": "",
83
+ "preview-src-list": value.value
84
+ }, null, 8, ["src", "preview-src-list"]);
85
+ }), 128))
86
+ ], 6)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
87
+ vue.createTextVNode(vue.toDisplayString((_b = (_a = props.comscope) == null ? void 0 : _a.config) == null ? void 0 : _b.emptyDisplay), 1)
88
+ ], 64));
89
+ };
90
+ }
91
+ });
92
+ exports.default = _sfc_main;
@@ -0,0 +1,92 @@
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, Fragment, renderList, createBlock, createTextVNode, toDisplayString } from "vue";
2
+ import { Image } from "../../image/index.js";
3
+ import { useCssName } from "../../../hooks/cssname/index.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "com-fig",
6
+ props: {
7
+ prefix: String,
8
+ maxHeight: {
9
+ type: String,
10
+ default: "100px"
11
+ },
12
+ class: {
13
+ type: String
14
+ },
15
+ style: {
16
+ type: Object
17
+ },
18
+ modelValue: {
19
+ type: [String, Array]
20
+ },
21
+ listobj: {
22
+ type: Object,
23
+ default() {
24
+ return {};
25
+ }
26
+ },
27
+ /**
28
+ * table数据
29
+ * row, column, $index
30
+ *
31
+ */
32
+ valueobj: {
33
+ type: Object,
34
+ default() {
35
+ return {};
36
+ }
37
+ },
38
+ comscope: {
39
+ type: Object,
40
+ default() {
41
+ return {};
42
+ }
43
+ }
44
+ },
45
+ setup(__props, { expose: __expose }) {
46
+ const cs = useCssName("com-fig");
47
+ const props = __props;
48
+ const value = computed(() => {
49
+ const v = props.modelValue || void 0;
50
+ let arr;
51
+ if (typeof v === "string") {
52
+ arr = v.split(",");
53
+ } else {
54
+ arr = v;
55
+ }
56
+ if (props.prefix) {
57
+ return arr == null ? void 0 : arr.map((r) => {
58
+ return props.prefix + r;
59
+ });
60
+ } else {
61
+ return arr;
62
+ }
63
+ });
64
+ __expose({});
65
+ return (_ctx, _cache) => {
66
+ var _a, _b;
67
+ return value.value && value.value.length > 0 ? (openBlock(), createElementBlock("div", {
68
+ key: 0,
69
+ class: normalizeClass([unref(cs).z(), props.class]),
70
+ style: normalizeStyle({
71
+ maxHeight: props.maxHeight,
72
+ ...props.style
73
+ })
74
+ }, [
75
+ (openBlock(true), createElementBlock(Fragment, null, renderList(value.value, (item, index) => {
76
+ return openBlock(), createBlock(unref(Image), {
77
+ key: index,
78
+ fit: "contain",
79
+ src: item,
80
+ "preview-teleported": "",
81
+ "preview-src-list": value.value
82
+ }, null, 8, ["src", "preview-src-list"]);
83
+ }), 128))
84
+ ], 6)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
85
+ createTextVNode(toDisplayString((_b = (_a = props.comscope) == null ? void 0 : _a.config) == null ? void 0 : _b.emptyDisplay), 1)
86
+ ], 64));
87
+ };
88
+ }
89
+ });
90
+ export {
91
+ _sfc_main as default
92
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const comLis_vue_vue_type_script_setup_true_lang = require("./com-lis2.cjs");
4
+ exports.default = comLis_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./com-lis2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const util = require("./util.cjs");
5
+ const use = require("../../common/use.cjs");
6
+ const index = require("../../../hooks/cssname/index.cjs");
7
+ const _hoisted_1 = ["onClick"];
8
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
+ __name: "com-lis",
10
+ props: {
11
+ class: {
12
+ type: [String, Function]
13
+ },
14
+ formatter: Function,
15
+ modelValue: {
16
+ type: String
17
+ },
18
+ list: {
19
+ type: Array,
20
+ default() {
21
+ return [];
22
+ }
23
+ },
24
+ listobj: {
25
+ type: Object,
26
+ default() {
27
+ return {};
28
+ }
29
+ },
30
+ /**
31
+ * table数据
32
+ * row, column, $index
33
+ *
34
+ */
35
+ valueobj: {
36
+ type: Object,
37
+ default() {
38
+ return {};
39
+ }
40
+ },
41
+ comscope: {
42
+ type: Object,
43
+ default() {
44
+ return {};
45
+ }
46
+ }
47
+ },
48
+ emits: ["lis"],
49
+ setup(__props, { emit: __emit }) {
50
+ const cs = index.useCssName("com-lis");
51
+ const props = __props;
52
+ const emit = __emit;
53
+ const className = vue.computed(() => {
54
+ if (props.class) {
55
+ if (typeof props.class == "function") {
56
+ return props.class(
57
+ props.valueobj,
58
+ props.listobj,
59
+ props.modelValue,
60
+ 0,
61
+ props.comscope
62
+ );
63
+ } else {
64
+ return props.class;
65
+ }
66
+ }
67
+ return;
68
+ });
69
+ function setValue(item, index2) {
70
+ const value = use.useGetDomValue(
71
+ item,
72
+ props.valueobj,
73
+ props.comscope.options,
74
+ index2
75
+ );
76
+ return { ...item, value };
77
+ }
78
+ function getValue() {
79
+ if (props.formatter) {
80
+ return props.formatter(
81
+ props.valueobj,
82
+ props.listobj,
83
+ props.modelValue,
84
+ 0,
85
+ props.comscope
86
+ );
87
+ } else {
88
+ const v = props.list || [{ value: props.modelValue }];
89
+ return v.map((o, i) => {
90
+ return setValue(o, i);
91
+ });
92
+ }
93
+ }
94
+ const valueArr = vue.computed(() => {
95
+ return getValue();
96
+ });
97
+ const emptyDisplay = vue.computed(() => {
98
+ var _a, _b, _c;
99
+ let is = true;
100
+ for (const obj of valueArr.value) {
101
+ const v = util.setEmptyDisplay(
102
+ obj.value,
103
+ (_a = props.comscope.config) == null ? void 0 : _a.emptyDisplay,
104
+ (_b = props.comscope.config) == null ? void 0 : _b.isEmptyStr
105
+ );
106
+ if (!v) {
107
+ is = false;
108
+ }
109
+ }
110
+ if (is) {
111
+ return (_c = props.comscope.config) == null ? void 0 : _c.emptyDisplay;
112
+ }
113
+ });
114
+ function onClickList(obj, index2, $event) {
115
+ var _a;
116
+ util.eventAliass(
117
+ (callback) => {
118
+ callback(
119
+ "lis",
120
+ obj,
121
+ props.valueobj,
122
+ props.listobj,
123
+ props.comscope
124
+ );
125
+ },
126
+ "click",
127
+ ((_a = props.listobj) == null ? void 0 : _a.events) || {},
128
+ $event
129
+ );
130
+ emit("lis", obj, index2);
131
+ }
132
+ return (_ctx, _cache) => {
133
+ return emptyDisplay.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
134
+ vue.createTextVNode(vue.toDisplayString(emptyDisplay.value), 1)
135
+ ], 64)) : (vue.openBlock(), vue.createElementBlock("span", {
136
+ key: 1,
137
+ class: vue.normalizeClass([vue.unref(cs).z(), className.value])
138
+ }, [
139
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(valueArr.value, (item, index2) => {
140
+ return vue.openBlock(), vue.createElementBlock("span", {
141
+ key: index2,
142
+ class: vue.normalizeClass([vue.unref(cs).z("li"), item.class]),
143
+ style: vue.normalizeStyle(item.style),
144
+ onClick: ($event) => onClickList(item, index2, $event)
145
+ }, vue.toDisplayString(item.value), 15, _hoisted_1);
146
+ }), 128))
147
+ ], 2));
148
+ };
149
+ }
150
+ });
151
+ exports.default = _sfc_main;
@@ -0,0 +1,151 @@
1
+ import { defineComponent, computed, createElementBlock, openBlock, Fragment, createTextVNode, toDisplayString, normalizeClass, unref, renderList, normalizeStyle } from "vue";
2
+ import { setEmptyDisplay, eventAliass } from "./util.js";
3
+ import { useGetDomValue } from "../../common/use.js";
4
+ import { useCssName } from "../../../hooks/cssname/index.js";
5
+ const _hoisted_1 = ["onClick"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "com-lis",
8
+ props: {
9
+ class: {
10
+ type: [String, Function]
11
+ },
12
+ formatter: Function,
13
+ modelValue: {
14
+ type: String
15
+ },
16
+ list: {
17
+ type: Array,
18
+ default() {
19
+ return [];
20
+ }
21
+ },
22
+ listobj: {
23
+ type: Object,
24
+ default() {
25
+ return {};
26
+ }
27
+ },
28
+ /**
29
+ * table数据
30
+ * row, column, $index
31
+ *
32
+ */
33
+ valueobj: {
34
+ type: Object,
35
+ default() {
36
+ return {};
37
+ }
38
+ },
39
+ comscope: {
40
+ type: Object,
41
+ default() {
42
+ return {};
43
+ }
44
+ }
45
+ },
46
+ emits: ["lis"],
47
+ setup(__props, { emit: __emit }) {
48
+ const cs = useCssName("com-lis");
49
+ const props = __props;
50
+ const emit = __emit;
51
+ const className = computed(() => {
52
+ if (props.class) {
53
+ if (typeof props.class == "function") {
54
+ return props.class(
55
+ props.valueobj,
56
+ props.listobj,
57
+ props.modelValue,
58
+ 0,
59
+ props.comscope
60
+ );
61
+ } else {
62
+ return props.class;
63
+ }
64
+ }
65
+ return;
66
+ });
67
+ function setValue(item, index) {
68
+ const value = useGetDomValue(
69
+ item,
70
+ props.valueobj,
71
+ props.comscope.options,
72
+ index
73
+ );
74
+ return { ...item, value };
75
+ }
76
+ function getValue() {
77
+ if (props.formatter) {
78
+ return props.formatter(
79
+ props.valueobj,
80
+ props.listobj,
81
+ props.modelValue,
82
+ 0,
83
+ props.comscope
84
+ );
85
+ } else {
86
+ const v = props.list || [{ value: props.modelValue }];
87
+ return v.map((o, i) => {
88
+ return setValue(o, i);
89
+ });
90
+ }
91
+ }
92
+ const valueArr = computed(() => {
93
+ return getValue();
94
+ });
95
+ const emptyDisplay = computed(() => {
96
+ var _a, _b, _c;
97
+ let is = true;
98
+ for (const obj of valueArr.value) {
99
+ const v = setEmptyDisplay(
100
+ obj.value,
101
+ (_a = props.comscope.config) == null ? void 0 : _a.emptyDisplay,
102
+ (_b = props.comscope.config) == null ? void 0 : _b.isEmptyStr
103
+ );
104
+ if (!v) {
105
+ is = false;
106
+ }
107
+ }
108
+ if (is) {
109
+ return (_c = props.comscope.config) == null ? void 0 : _c.emptyDisplay;
110
+ }
111
+ });
112
+ function onClickList(obj, index, $event) {
113
+ var _a;
114
+ eventAliass(
115
+ (callback) => {
116
+ callback(
117
+ "lis",
118
+ obj,
119
+ props.valueobj,
120
+ props.listobj,
121
+ props.comscope
122
+ );
123
+ },
124
+ "click",
125
+ ((_a = props.listobj) == null ? void 0 : _a.events) || {},
126
+ $event
127
+ );
128
+ emit("lis", obj, index);
129
+ }
130
+ return (_ctx, _cache) => {
131
+ return emptyDisplay.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
132
+ createTextVNode(toDisplayString(emptyDisplay.value), 1)
133
+ ], 64)) : (openBlock(), createElementBlock("span", {
134
+ key: 1,
135
+ class: normalizeClass([unref(cs).z(), className.value])
136
+ }, [
137
+ (openBlock(true), createElementBlock(Fragment, null, renderList(valueArr.value, (item, index) => {
138
+ return openBlock(), createElementBlock("span", {
139
+ key: index,
140
+ class: normalizeClass([unref(cs).z("li"), item.class]),
141
+ style: normalizeStyle(item.style),
142
+ onClick: ($event) => onClickList(item, index, $event)
143
+ }, toDisplayString(item.value), 15, _hoisted_1);
144
+ }), 128))
145
+ ], 2));
146
+ };
147
+ }
148
+ });
149
+ export {
150
+ _sfc_main as default
151
+ };
@@ -93,6 +93,16 @@ export declare const dataProps: {
93
93
  };
94
94
  };
95
95
  export declare const dataEmit: string[];
96
+ /**
97
+ * 初始化表格组件的核心逻辑,包括分页、排序、选择、跨页多选等功能。
98
+ *
99
+ * @param props 组件传入的属性对象,包含配置信息和事件回调等
100
+ * @param emit 用于触发自定义事件的方法
101
+ * @param refTable 表格实例引用,用于调用表格方法(如清空选中)
102
+ * @param getLocale 国际化翻译函数
103
+ * @param defaultConfig 默认表格配置项
104
+ * @returns 包含各种状态、方法和响应式数据的对象
105
+ */
96
106
  export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit: Function, refTable: Ref, getLocale: Translator, defaultConfig?: TableConfig) => {
97
107
  height: ComputedRef<any>;
98
108
  tableConfig: Ref<{
@@ -232,10 +242,14 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
232
242
  hide?: (boolean | HideFun) | undefined;
233
243
  rules?: any[] | undefined;
234
244
  rule?: string | boolean | 0 | 1 | {
235
- type: 1 | 2;
236
- must: boolean;
237
- judge: string;
245
+ trigger?: string | string[] | number | undefined;
246
+ required?: boolean | undefined;
247
+ judge?: (string | Function) | undefined;
238
248
  error?: string | undefined;
249
+ linkage?: string | {
250
+ prop?: string | undefined;
251
+ judge?: Function | undefined;
252
+ } | undefined;
239
253
  } | undefined;
240
254
  class?: string | undefined;
241
255
  style?: (ObjAny | SetFun) | undefined;
@@ -266,10 +280,14 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
266
280
  hide?: (boolean | HideFun) | undefined;
267
281
  rules?: any[] | undefined;
268
282
  rule?: string | boolean | 0 | 1 | {
269
- type: 1 | 2;
270
- must: boolean;
271
- judge: string;
283
+ trigger?: string | string[] | number | undefined;
284
+ required?: boolean | undefined;
285
+ judge?: (string | Function) | undefined;
272
286
  error?: string | undefined;
287
+ linkage?: string | {
288
+ prop?: string | undefined;
289
+ judge?: Function | undefined;
290
+ } | undefined;
273
291
  } | undefined;
274
292
  class?: string | undefined;
275
293
  style?: (ObjAny | SetFun) | undefined;
@@ -1,9 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("vue");
4
+ const use = require("../../common/use.cjs");
4
5
  const firstUpper = require("@fangzhongya/utils/basic/string/firstUpper");
5
6
  const splitUpper = require("@fangzhongya/utils/basic/string/splitUpper");
6
7
  const getAttrValue = require("../../../utils/vues/getAttrValue.cjs");
8
+ const css = require("../../../utils/css.cjs");
9
+ function getVNodeWidth(vnode) {
10
+ const container = document.createElement("div");
11
+ Object.assign(container.style, {
12
+ position: "absolute",
13
+ left: "-9999px",
14
+ top: "-9999px",
15
+ whiteSpace: "pre-wrap",
16
+ display: "inline-block",
17
+ visibility: "hidden"
18
+ });
19
+ document.body.appendChild(container);
20
+ vue.render(vnode, container);
21
+ const width = container.offsetWidth;
22
+ container.remove();
23
+ vue.render(null, container);
24
+ return width;
25
+ }
26
+ function setLabelWidth(obj, config) {
27
+ let label = use.useGetDomLabel(obj, {}, {}, {}, {}, () => {
28
+ }, 0);
29
+ if (!vue.isVNode(label)) {
30
+ label = vue.h(
31
+ "div",
32
+ {
33
+ style: {
34
+ whiteSpace: "pre-wrap",
35
+ display: "inline-block"
36
+ }
37
+ },
38
+ label
39
+ );
40
+ }
41
+ const width = getVNodeWidth(label);
42
+ const interval = config.intervalHorizon ?? config.interval;
43
+ return width + css.getCssNumber(interval) * 2;
44
+ }
7
45
  function setMinWidth(obj, props) {
8
46
  const config = (props == null ? void 0 : props.table) ?? {};
9
47
  if (obj.width) {
@@ -14,16 +52,18 @@ function setMinWidth(obj, props) {
14
52
  if (typeof minWidth == "function") {
15
53
  return minWidth(obj, config);
16
54
  } else if (typeof minWidth == "boolean") {
17
- return (obj.label || "").length * 16 + 24;
55
+ return setLabelWidth(obj, config);
18
56
  } else {
19
57
  return minWidth;
20
58
  }
21
59
  } else {
22
60
  const minWidth2 = getAttrValue.getAttrValue(config, "minWidth");
23
- if (minWidth2) {
24
- return minWidth2;
61
+ if (typeof minWidth2 == "function") {
62
+ return minWidth2(obj, config);
63
+ } else if (typeof minWidth2 == "boolean") {
64
+ return setLabelWidth(obj, config);
25
65
  } else {
26
- return;
66
+ return minWidth2;
27
67
  }
28
68
  }
29
69
  }
@@ -112,5 +152,17 @@ function eventAliass(callback, arr, obj, $event) {
112
152
  }
113
153
  return is;
114
154
  }
155
+ function setEmptyDisplay(value, emptyDisplay, isStr) {
156
+ if (isStr) {
157
+ if (value === "" || value === void 0 || value === null) {
158
+ return emptyDisplay;
159
+ }
160
+ } else {
161
+ if (value === void 0 || value === null) {
162
+ return emptyDisplay;
163
+ }
164
+ }
165
+ }
115
166
  exports.eventAliass = eventAliass;
167
+ exports.setEmptyDisplay = setEmptyDisplay;
116
168
  exports.setMinWidth = setMinWidth;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * 设置对象的最小宽度
3
+ * @param obj - 需要设置最小宽度的对象
4
+ * @param props - 可选的配置属性对象
5
+ * @returns 返回设置的最小宽度值,可能为具体数值、函数执行结果或undefined
6
+ */
1
7
  export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
2
8
  /**
3
9
  * 支持事件别名处理
@@ -7,3 +13,11 @@ export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
7
13
  * @param {*} $event
8
14
  */
9
15
  export declare function eventAliass(callback: Function, arr: string | string[], obj: ObjAny, $event: Event): boolean;
16
+ /**
17
+ * 设置空值显示内容
18
+ * @param value 需要检查的值
19
+ * @param emptyDisplay 空值时显示的内容,默认为undefined
20
+ * @param isStr 是否为字符串类型检查,默认为undefined
21
+ * @returns 如果值为空则返回emptyDisplay,否则返回undefined
22
+ */
23
+ export declare function setEmptyDisplay(value: any, emptyDisplay?: string, isStr?: boolean): string | undefined;