@fangzhongya/fang-ui 0.1.37 → 0.1.38

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 (95) 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/use.cjs +4 -2
  5. package/dist/components/common/use.js +4 -2
  6. package/dist/components/dates2/src/data.cjs +1 -1
  7. package/dist/components/dates2/src/data.d.ts +1 -1
  8. package/dist/components/dates2/src/data.js +1 -1
  9. package/dist/components/forms/src/setup.cjs +8 -23
  10. package/dist/components/forms/src/setup.d.ts +1 -1
  11. package/dist/components/forms/src/setup.js +11 -26
  12. package/dist/components/forms/src/util.cjs +85 -17
  13. package/dist/components/forms/src/util.d.ts +2 -1
  14. package/dist/components/forms/src/util.js +87 -19
  15. package/dist/components/list/index.css +1 -1
  16. package/dist/components/list/index.scss +1 -1
  17. package/dist/components/list/src/data.cjs +3 -0
  18. package/dist/components/list/src/data.d.ts +3 -0
  19. package/dist/components/list/src/data.js +3 -0
  20. package/dist/components/list/src/index2.cjs +18 -13
  21. package/dist/components/list/src/index2.js +16 -11
  22. package/dist/components/list/src/util.cjs +12 -2
  23. package/dist/components/list/src/util.d.ts +1 -0
  24. package/dist/components/list/src/util.js +12 -2
  25. package/dist/components/list/style/index2.scss +1 -0
  26. package/dist/components/lists/index.css +1 -1
  27. package/dist/components/lists/src/data.d.ts +3 -3
  28. package/dist/components/lists/src/index2.cjs +9 -9
  29. package/dist/components/lists/src/index2.js +9 -9
  30. package/dist/components/listsp/index.css +1 -1
  31. package/dist/components/listspd/index.css +1 -1
  32. package/dist/components/no-data/src/data.cjs +2 -2
  33. package/dist/components/no-data/src/data.d.ts +2 -2
  34. package/dist/components/no-data/src/data.js +2 -2
  35. package/dist/components/no-data/src/index2.cjs +2 -2
  36. package/dist/components/no-data/src/index2.js +2 -2
  37. package/dist/components/page/index.css +1 -1
  38. package/dist/components/tables/common/com-but.cjs +4 -0
  39. package/dist/components/tables/common/com-but.js +4 -0
  40. package/dist/components/tables/common/{table-but2.cjs → com-but2.cjs} +17 -13
  41. package/dist/components/tables/common/{table-but2.js → com-but2.js} +14 -10
  42. package/dist/components/tables/common/com-color.cjs +4 -0
  43. package/dist/components/tables/common/com-color.js +4 -0
  44. package/dist/components/tables/common/{table-color2.cjs → com-color2.cjs} +21 -8
  45. package/dist/components/tables/common/{table-color2.js → com-color2.js} +23 -10
  46. package/dist/components/tables/common/com-fig.cjs +4 -0
  47. package/dist/components/tables/common/com-fig.js +4 -0
  48. package/dist/components/tables/common/com-fig2.cjs +92 -0
  49. package/dist/components/tables/common/com-fig2.js +92 -0
  50. package/dist/components/tables/common/com-lis.cjs +4 -0
  51. package/dist/components/tables/common/com-lis.js +4 -0
  52. package/dist/components/tables/common/com-lis2.cjs +151 -0
  53. package/dist/components/tables/common/com-lis2.js +151 -0
  54. package/dist/components/tables/common/pagin.d.ts +14 -6
  55. package/dist/components/tables/common/util.cjs +12 -0
  56. package/dist/components/tables/common/util.d.ts +1 -0
  57. package/dist/components/tables/common/util.js +12 -0
  58. package/dist/components/tables/src/column.cjs +5 -2
  59. package/dist/components/tables/src/column.js +6 -3
  60. package/dist/components/tables/src/columns2.cjs +9 -7
  61. package/dist/components/tables/src/columns2.js +9 -7
  62. package/dist/components/tables/src/data.d.ts +3 -3
  63. package/dist/components/tables/style/index2.scss +1 -0
  64. package/dist/components/tablesv/src/column.cjs +5 -2
  65. package/dist/components/tablesv/src/column.js +6 -3
  66. package/dist/components/tablesv/src/columns2.cjs +9 -7
  67. package/dist/components/tablesv/src/columns2.js +9 -7
  68. package/dist/components/tablesv/src/data.d.ts +3 -3
  69. package/dist/components/window/src/data.cjs +1 -1
  70. package/dist/components/window/src/data.d.ts +1 -1
  71. package/dist/components/window/src/data.js +1 -1
  72. package/dist/css/index.css +1 -1
  73. package/dist/css/list.css +1 -1
  74. package/dist/css/lists.css +1 -1
  75. package/dist/css/listsp.css +1 -1
  76. package/dist/css/listspd.css +1 -1
  77. package/dist/css/page.css +1 -1
  78. package/dist/icons/index.json +1 -1
  79. package/dist/index.css +1 -1
  80. package/dist/type.d.ts +12 -3
  81. package/package.json +2 -2
  82. package/dist/components/tables/common/img.cjs +0 -4
  83. package/dist/components/tables/common/img.js +0 -4
  84. package/dist/components/tables/common/img2.cjs +0 -37
  85. package/dist/components/tables/common/img2.js +0 -37
  86. package/dist/components/tables/common/table-but.cjs +0 -4
  87. package/dist/components/tables/common/table-but.js +0 -4
  88. package/dist/components/tables/common/table-color.cjs +0 -4
  89. package/dist/components/tables/common/table-color.js +0 -4
  90. package/dist/components/tables/common/table-list.cjs +0 -4
  91. package/dist/components/tables/common/table-list.js +0 -4
  92. package/dist/components/tables/common/table-list2.cjs +0 -125
  93. package/dist/components/tables/common/table-list2.js +0 -125
  94. /package/dist/components/{global-config → keep-com}/index.css +0 -0
  95. /package/dist/css/{global-config.css → keep-com.css} +0 -0
@@ -2,8 +2,9 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const util = require("./util.cjs");
5
+ const index = require("../../../hooks/cssname/index.cjs");
5
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
6
- __name: "table-color",
7
+ __name: "com-color",
7
8
  props: {
8
9
  class: {
9
10
  type: [String, Function]
@@ -44,8 +45,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
44
45
  },
45
46
  emits: ["color"],
46
47
  setup(__props, { emit: __emit }) {
48
+ const cs = index.useCssName("com-color");
47
49
  const props = __props;
48
50
  const emit = __emit;
51
+ const emptyDisplay = vue.computed(() => {
52
+ var _a, _b;
53
+ return util.setEmptyDisplay(
54
+ props.modelValue,
55
+ (_a = props.comscope.config) == null ? void 0 : _a.emptyDisplay,
56
+ (_b = props.comscope.config) == null ? void 0 : _b.isEmptyStr
57
+ );
58
+ });
49
59
  const className = vue.computed(() => {
50
60
  if (props.class) {
51
61
  if (typeof props.class == "function") {
@@ -111,19 +121,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
111
121
  emit("color", obj);
112
122
  }
113
123
  return (_ctx, _cache) => {
114
- return vue.openBlock(), vue.createElementBlock("span", {
115
- class: vue.normalizeClass(["table-color", className.value]),
116
- onClick: _cache[0] || (_cache[0] = ($event) => onClick($event)),
117
- style: vue.normalizeStyle(props.style)
124
+ return emptyDisplay.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
125
+ vue.createTextVNode(vue.toDisplayString(emptyDisplay.value), 1)
126
+ ], 64)) : (vue.openBlock(), vue.createElementBlock("span", {
127
+ key: 1,
128
+ class: vue.normalizeClass([vue.unref(cs).z(), className.value]),
129
+ style: vue.normalizeStyle(props.style),
130
+ onClick: _cache[0] || (_cache[0] = ($event) => onClick($event))
118
131
  }, [
119
132
  vue.createElementVNode("span", {
120
133
  style: vue.normalizeStyle({
121
134
  color: color.value,
122
135
  backgroundColor: backgroundColor.value
123
136
  }),
124
- class: "table-color-value"
125
- }, vue.toDisplayString(props.modelValue), 5)
126
- ], 6);
137
+ class: vue.normalizeClass([vue.unref(cs).z("value")])
138
+ }, vue.toDisplayString(props.modelValue), 7)
139
+ ], 6));
127
140
  };
128
141
  }
129
142
  });
@@ -1,7 +1,8 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, toDisplayString } from "vue";
2
- import { eventAliass } from "./util.js";
1
+ import { defineComponent, computed, createElementBlock, openBlock, Fragment, createTextVNode, toDisplayString, normalizeStyle, normalizeClass, unref, createElementVNode } from "vue";
2
+ import { setEmptyDisplay, eventAliass } from "./util.js";
3
+ import { useCssName } from "../../../hooks/cssname/index.js";
3
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "table-color",
5
+ __name: "com-color",
5
6
  props: {
6
7
  class: {
7
8
  type: [String, Function]
@@ -42,8 +43,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
43
  },
43
44
  emits: ["color"],
44
45
  setup(__props, { emit: __emit }) {
46
+ const cs = useCssName("com-color");
45
47
  const props = __props;
46
48
  const emit = __emit;
49
+ const emptyDisplay = computed(() => {
50
+ var _a, _b;
51
+ return setEmptyDisplay(
52
+ props.modelValue,
53
+ (_a = props.comscope.config) == null ? void 0 : _a.emptyDisplay,
54
+ (_b = props.comscope.config) == null ? void 0 : _b.isEmptyStr
55
+ );
56
+ });
47
57
  const className = computed(() => {
48
58
  if (props.class) {
49
59
  if (typeof props.class == "function") {
@@ -109,19 +119,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
109
119
  emit("color", obj);
110
120
  }
111
121
  return (_ctx, _cache) => {
112
- return openBlock(), createElementBlock("span", {
113
- class: normalizeClass(["table-color", className.value]),
114
- onClick: _cache[0] || (_cache[0] = ($event) => onClick($event)),
115
- style: normalizeStyle(props.style)
122
+ return emptyDisplay.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
123
+ createTextVNode(toDisplayString(emptyDisplay.value), 1)
124
+ ], 64)) : (openBlock(), createElementBlock("span", {
125
+ key: 1,
126
+ class: normalizeClass([unref(cs).z(), className.value]),
127
+ style: normalizeStyle(props.style),
128
+ onClick: _cache[0] || (_cache[0] = ($event) => onClick($event))
116
129
  }, [
117
130
  createElementVNode("span", {
118
131
  style: normalizeStyle({
119
132
  color: color.value,
120
133
  backgroundColor: backgroundColor.value
121
134
  }),
122
- class: "table-color-value"
123
- }, toDisplayString(props.modelValue), 5)
124
- ], 6);
135
+ class: normalizeClass([unref(cs).z("value")])
136
+ }, toDisplayString(props.modelValue), 7)
137
+ ], 6));
125
138
  };
126
139
  }
127
140
  });
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const comFig_vue_vue_type_script_setup_true_lang = require("./com-fig2.cjs");
4
+ exports.default = comFig_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./com-fig2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -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
+ };
@@ -232,10 +232,14 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
232
232
  hide?: (boolean | HideFun) | undefined;
233
233
  rules?: any[] | undefined;
234
234
  rule?: string | boolean | 0 | 1 | {
235
- type: 1 | 2;
236
- must: boolean;
237
- judge: string;
235
+ trigger?: string | string[] | number | undefined;
236
+ required?: boolean | undefined;
237
+ judge?: (string | Function) | undefined;
238
238
  error?: string | undefined;
239
+ linkage?: string | {
240
+ prop?: string | undefined;
241
+ judge?: Function | undefined;
242
+ } | undefined;
239
243
  } | undefined;
240
244
  class?: string | undefined;
241
245
  style?: (ObjAny | SetFun) | undefined;
@@ -266,10 +270,14 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
266
270
  hide?: (boolean | HideFun) | undefined;
267
271
  rules?: any[] | undefined;
268
272
  rule?: string | boolean | 0 | 1 | {
269
- type: 1 | 2;
270
- must: boolean;
271
- judge: string;
273
+ trigger?: string | string[] | number | undefined;
274
+ required?: boolean | undefined;
275
+ judge?: (string | Function) | undefined;
272
276
  error?: string | undefined;
277
+ linkage?: string | {
278
+ prop?: string | undefined;
279
+ judge?: Function | undefined;
280
+ } | undefined;
273
281
  } | undefined;
274
282
  class?: string | undefined;
275
283
  style?: (ObjAny | SetFun) | undefined;
@@ -112,5 +112,17 @@ function eventAliass(callback, arr, obj, $event) {
112
112
  }
113
113
  return is;
114
114
  }
115
+ function setEmptyDisplay(value, emptyDisplay, isStr) {
116
+ if (isStr) {
117
+ if (value === "" || value === void 0 || value === null) {
118
+ return emptyDisplay;
119
+ }
120
+ } else {
121
+ if (value === void 0 || value === null) {
122
+ return emptyDisplay;
123
+ }
124
+ }
125
+ }
115
126
  exports.eventAliass = eventAliass;
127
+ exports.setEmptyDisplay = setEmptyDisplay;
116
128
  exports.setMinWidth = setMinWidth;
@@ -7,3 +7,4 @@ export declare function setMinWidth(obj: ObjAny, props?: ObjAny): any;
7
7
  * @param {*} $event
8
8
  */
9
9
  export declare function eventAliass(callback: Function, arr: string | string[], obj: ObjAny, $event: Event): boolean;
10
+ export declare function setEmptyDisplay(value: any, emptyDisplay?: string, isStr?: boolean): string | undefined;