@fangzhongya/fang-ui 0.0.53 → 0.0.55

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 (85) hide show
  1. package/dist/components/common/use.cjs +2 -0
  2. package/dist/components/common/use.js +2 -0
  3. package/dist/components/index.cjs +84 -80
  4. package/dist/components/index.d.ts +3 -1
  5. package/dist/components/index.js +5 -1
  6. package/dist/components/index.scss +3 -1
  7. package/dist/components/index2.scss +3 -1
  8. package/dist/components/list/index.cjs +9 -0
  9. package/dist/components/list/index.css +96 -0
  10. package/dist/components/list/index.d.ts +2 -0
  11. package/dist/components/list/index.js +9 -0
  12. package/dist/components/list/index.scss +110 -0
  13. package/dist/components/list/src/data.cjs +97 -0
  14. package/dist/components/list/src/data.d.ts +100 -0
  15. package/dist/components/list/src/data.js +97 -0
  16. package/dist/components/list/src/index.cjs +4 -0
  17. package/dist/components/list/src/index.js +4 -0
  18. package/dist/components/list/src/index2.cjs +337 -0
  19. package/dist/components/list/src/index2.js +337 -0
  20. package/dist/components/lists/index.cjs +2 -2
  21. package/dist/components/lists/index.css +27 -72
  22. package/dist/components/lists/index.scss +30 -98
  23. package/dist/components/lists/src/data.cjs +80 -49
  24. package/dist/components/lists/src/data.d.ts +103 -48
  25. package/dist/components/lists/src/data.js +81 -50
  26. package/dist/components/lists/src/index.cjs +2 -2
  27. package/dist/components/lists/src/index2.cjs +237 -303
  28. package/dist/components/lists/src/index2.js +237 -303
  29. package/dist/components/listsp/index.cjs +9 -0
  30. package/dist/components/listsp/index.css +86 -0
  31. package/dist/components/listsp/index.d.ts +2 -0
  32. package/dist/components/listsp/index.js +9 -0
  33. package/dist/components/listsp/index.scss +23 -0
  34. package/dist/components/listsp/src/data.d.ts +14 -0
  35. package/dist/components/listsp/src/index.cjs +4 -0
  36. package/dist/components/listsp/src/index.js +4 -0
  37. package/dist/components/listsp/src/index2.cjs +98 -0
  38. package/dist/components/listsp/src/index2.js +98 -0
  39. package/dist/components/listsp/style/index2.scss +4 -0
  40. package/dist/components/page/index.css +35 -38
  41. package/dist/components/page/index.scss +1 -1
  42. package/dist/components/page/src/index2.cjs +2 -2
  43. package/dist/components/page/src/index2.js +2 -2
  44. package/dist/components/page/style/index2.scss +1 -1
  45. package/dist/components/scss/function.scss +1 -1
  46. package/dist/components/tables/common/pagin.cjs +23 -7
  47. package/dist/components/tables/common/pagin.d.ts +8 -1
  48. package/dist/components/tables/common/pagin.js +23 -7
  49. package/dist/components/tables/index.css +1 -4
  50. package/dist/components/tables/index.scss +1 -4
  51. package/dist/components/tablesp/index.css +1 -4
  52. package/dist/css/index.css +100 -46
  53. package/dist/css/list.css +96 -0
  54. package/dist/css/lists.css +27 -72
  55. package/dist/css/listsp.css +86 -0
  56. package/dist/css/page.css +35 -38
  57. package/dist/css/tables.css +1 -4
  58. package/dist/css/tablesp.css +1 -4
  59. package/dist/directives/scroll/index.cjs +36 -11
  60. package/dist/directives/scroll/index.js +36 -11
  61. package/dist/expand/{chunk-LSKJOV4K.cjs → chunk-S7R2FI5L.cjs} +6 -2
  62. package/dist/expand/{chunk-ZS2GF6MH.js → chunk-VCOMWNQB.js} +6 -2
  63. package/dist/expand/components.cjs +5 -5
  64. package/dist/expand/components.js +1 -1
  65. package/dist/expand/config.cjs +2 -2
  66. package/dist/expand/config.js +1 -1
  67. package/dist/icons/index.css +32 -32
  68. package/dist/icons/index.json +10 -10
  69. package/dist/index.cjs +102 -98
  70. package/dist/index.css +100 -46
  71. package/dist/index.js +5 -1
  72. package/dist/type.d.ts +7 -0
  73. package/package.json +4 -4
  74. /package/dist/components/{forms-item → forms-items}/index.css +0 -0
  75. /package/dist/components/{cascader-panel → keep-com}/index.css +0 -0
  76. /package/dist/components/{lists → list}/src/setup.d.ts +0 -0
  77. /package/dist/components/{lists → list}/src/util.cjs +0 -0
  78. /package/dist/components/{lists → list}/src/util.d.ts +0 -0
  79. /package/dist/components/{lists → list}/src/util.js +0 -0
  80. /package/dist/components/{lists → tables}/common/img.cjs +0 -0
  81. /package/dist/components/{lists → tables}/common/img.js +0 -0
  82. /package/dist/components/{lists → tables}/common/img2.cjs +0 -0
  83. /package/dist/components/{lists → tables}/common/img2.js +0 -0
  84. /package/dist/css/{forms-item.css → forms-items.css} +0 -0
  85. /package/dist/css/{cascader-panel.css → keep-com.css} +0 -0
@@ -0,0 +1,100 @@
1
+ import { ExtractPropTypes, Component } from 'vue';
2
+ export declare const dataProps: {
3
+ /**
4
+ * @props { Object } options={}
5
+ * 选择数据集合
6
+ */
7
+ options: {
8
+ type: ObjectConstructor;
9
+ default(): {};
10
+ };
11
+ /**
12
+ * @props { Object } compons={}
13
+ * 外部组件集合
14
+ */
15
+ compons: {
16
+ type: () => {
17
+ [key: string]: Component;
18
+ };
19
+ default(): {};
20
+ };
21
+ /**
22
+ * @props { Object } labelPosition='auto' ('left' | 'top' | 'right' | 'center' | 'auto')
23
+ * 标签位置
24
+ */
25
+ labelPosition: {
26
+ type: () => "left" | "top" | "right" | "center" | "auto";
27
+ default: string;
28
+ };
29
+ /**
30
+ * @props { Array<ListObj> } list=[]
31
+ * 列数据
32
+ */
33
+ list: {
34
+ type: {
35
+ (arrayLength: number): ListObj[];
36
+ (...items: ListObj[]): ListObj[];
37
+ new (arrayLength: number): ListObj[];
38
+ new (...items: ListObj[]): ListObj[];
39
+ isArray(arg: any): arg is any[];
40
+ readonly prototype: any[];
41
+ from<T>(arrayLike: ArrayLike<T>): T[];
42
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
43
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
44
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
45
+ of<T>(...items: T[]): T[];
46
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
47
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
48
+ readonly [Symbol.species]: ArrayConstructor;
49
+ };
50
+ default: () => never[];
51
+ };
52
+ value: {
53
+ type: ObjectConstructor;
54
+ default: () => {};
55
+ };
56
+ /**
57
+ * @props { Number } column=2
58
+ * 一行展示多少列
59
+ */
60
+ column: {
61
+ type: NumberConstructor;
62
+ default(): number;
63
+ };
64
+ /**
65
+ * @props { Boolean, String } colon
66
+ * 标签后面是否加内容 true 是 :
67
+ */
68
+ colon: (BooleanConstructor | StringConstructor)[];
69
+ /**
70
+ * @props {Number, String } labelWidth=[]
71
+ * 标签宽度
72
+ */
73
+ labelWidth: {
74
+ type: (StringConstructor | NumberConstructor)[];
75
+ };
76
+ /**
77
+ * @props { Boolean, String } border=true ( )
78
+ * 是否需要边框,边框颜色
79
+ */
80
+ border: {
81
+ type: (BooleanConstructor | StringConstructor)[];
82
+ };
83
+ /**
84
+ * @props { Boolean } aliquots=true ( )
85
+ * 是否等分
86
+ */
87
+ aliquots: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ /**
92
+ * @props { Boolean } componSelected
93
+ * 是否在选中时显示 compon 组件
94
+ */
95
+ componSelected: BooleanConstructor;
96
+ };
97
+ export type DataProps = ExtractPropTypes<typeof dataProps>;
98
+ export declare const dataEmits: string[];
99
+ export type DataEmits = typeof dataEmits;
100
+ export declare const dataExpose: never[];
@@ -0,0 +1,97 @@
1
+ const dataProps = {
2
+ /**
3
+ * @props { Object } options={}
4
+ * 选择数据集合
5
+ */
6
+ options: {
7
+ type: Object,
8
+ default() {
9
+ return {};
10
+ }
11
+ },
12
+ /**
13
+ * @props { Object } compons={}
14
+ * 外部组件集合
15
+ */
16
+ compons: {
17
+ type: Object,
18
+ default() {
19
+ return {};
20
+ }
21
+ },
22
+ /**
23
+ * @props { Object } labelPosition='auto' ('left' | 'top' | 'right' | 'center' | 'auto')
24
+ * 标签位置
25
+ */
26
+ labelPosition: {
27
+ type: String,
28
+ default: "auto"
29
+ },
30
+ /**
31
+ * @props { Array<ListObj> } list=[]
32
+ * 列数据
33
+ */
34
+ list: {
35
+ type: Array,
36
+ default: () => {
37
+ return [];
38
+ }
39
+ },
40
+ value: {
41
+ type: Object,
42
+ default: () => {
43
+ return {};
44
+ }
45
+ },
46
+ /**
47
+ * @props { Number } column=2
48
+ * 一行展示多少列
49
+ */
50
+ column: {
51
+ type: Number,
52
+ default() {
53
+ return 2;
54
+ }
55
+ },
56
+ /**
57
+ * @props { Boolean, String } colon
58
+ * 标签后面是否加内容 true 是 :
59
+ */
60
+ colon: [Boolean, String],
61
+ /**
62
+ * @props {Number, String } labelWidth=[]
63
+ * 标签宽度
64
+ */
65
+ labelWidth: {
66
+ type: [Number, String]
67
+ // default: '60px',
68
+ },
69
+ /**
70
+ * @props { Boolean, String } border=true ( )
71
+ * 是否需要边框,边框颜色
72
+ */
73
+ border: {
74
+ type: [Boolean, String]
75
+ // default: true
76
+ },
77
+ /**
78
+ * @props { Boolean } aliquots=true ( )
79
+ * 是否等分
80
+ */
81
+ aliquots: {
82
+ type: Boolean,
83
+ default: true
84
+ },
85
+ /**
86
+ * @props { Boolean } componSelected
87
+ * 是否在选中时显示 compon 组件
88
+ */
89
+ componSelected: Boolean
90
+ };
91
+ const dataEmits = ["list-events"];
92
+ const dataExpose = [];
93
+ export {
94
+ dataEmits,
95
+ dataExpose,
96
+ dataProps
97
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const index_vue_vue_type_script_lang = require("./index2.cjs");
4
+ exports.default = index_vue_vue_type_script_lang.default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./index2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,337 @@
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 css = require("../../common/css.cjs");
6
+ const use = require("../../common/use.cjs");
7
+ const compons = require("../../common/compons.cjs");
8
+ const index = require("../../../hooks/cssname/index.cjs");
9
+ const data = require("./data.cjs");
10
+ require("../../tables/common/img.cjs");
11
+ const img_vue_vue_type_script_setup_true_lang = require("../../tables/common/img2.cjs");
12
+ const Components = {
13
+ Img: img_vue_vue_type_script_setup_true_lang.default
14
+ };
15
+ const _sfc_main = vue.defineComponent({
16
+ emits: data.dataEmits,
17
+ components: Components,
18
+ expose: data.dataExpose,
19
+ props: data.dataProps,
20
+ setup(props, { emit, slots }) {
21
+ const compons$1 = compons.getCompons(props.compons);
22
+ const cs = index.useCssName("list");
23
+ const isfocus = vue.ref(false);
24
+ const rowObj = vue.ref();
25
+ const borderColor = vue.computed(() => {
26
+ const d = "#ccc";
27
+ if (typeof props.border === "boolean") {
28
+ return d;
29
+ } else {
30
+ return props.border ?? d;
31
+ }
32
+ });
33
+ function isComponSelected(obj) {
34
+ if (use.uesObjComponSelected(obj, props)) {
35
+ if (rowObj.value == obj) {
36
+ if (isfocus.value) {
37
+ return true;
38
+ } else {
39
+ return false;
40
+ }
41
+ } else {
42
+ return false;
43
+ }
44
+ } else {
45
+ return true;
46
+ }
47
+ }
48
+ const getLists = (arrs, listobj) => {
49
+ let arr = [], trs = [], lin = 0;
50
+ arrs.forEach((obj, index2) => {
51
+ if (listobj) {
52
+ obj.father = obj.father ?? listobj;
53
+ }
54
+ if (!use.useHide(obj, props.value)) {
55
+ let is = false;
56
+ if (obj.whole) {
57
+ lin = props.column;
58
+ is = true;
59
+ } else {
60
+ let k = (obj.column || 1) + lin;
61
+ if (k > props.column) {
62
+ lin = obj.column || 1;
63
+ is = true;
64
+ } else {
65
+ lin = k;
66
+ is = false;
67
+ }
68
+ }
69
+ if (is) {
70
+ arr.push(vue.h("tr", {}, trs));
71
+ trs = [];
72
+ }
73
+ trs.push(...getTd(obj, index2));
74
+ if (lin >= props.column) {
75
+ arr.push(vue.h("tr", {}, trs));
76
+ trs = [];
77
+ lin = 0;
78
+ }
79
+ }
80
+ });
81
+ if (trs.length > 0) {
82
+ arr.push(vue.h("tr", {}, trs));
83
+ }
84
+ return arr;
85
+ };
86
+ const getListTops = (arrs, listobj) => {
87
+ let arr = [], trvs = [], trls = [], lin = 0;
88
+ arrs.forEach((obj, index2) => {
89
+ if (listobj) {
90
+ obj.father = obj.father ?? listobj;
91
+ }
92
+ if (!use.useHide(obj, props.value)) {
93
+ let is = false;
94
+ if (obj.whole) {
95
+ lin = props.column;
96
+ is = true;
97
+ } else {
98
+ let k = (obj.column || 1) + lin;
99
+ if (k > props.column) {
100
+ lin = obj.column || 1;
101
+ is = true;
102
+ } else {
103
+ lin = k;
104
+ is = false;
105
+ }
106
+ }
107
+ if (is) {
108
+ arr.push(vue.h("tr", {}, trls));
109
+ trls = [];
110
+ arr.push(vue.h("tr", {}, trvs));
111
+ trvs = [];
112
+ }
113
+ if (obj.isdiv) {
114
+ trls.push(getValue(obj, index2, true));
115
+ } else {
116
+ trls.push(getlabel(obj, index2));
117
+ trvs.push(getValue(obj, index2));
118
+ }
119
+ if (lin >= props.column) {
120
+ arr.push(vue.h("tr", {}, trls));
121
+ arr.push(vue.h("tr", {}, trvs));
122
+ trls = [];
123
+ trvs = [];
124
+ lin = 0;
125
+ }
126
+ }
127
+ });
128
+ if (trls.length > 0) {
129
+ arr.push(vue.h("tr", {}, trls));
130
+ arr.push(vue.h("tr", {}, trvs));
131
+ }
132
+ return arr;
133
+ };
134
+ const getlabel = (obj, index2) => {
135
+ return vue.h(
136
+ "th",
137
+ {
138
+ style: {
139
+ width: obj.labelWidth ?? props.labelWidth
140
+ },
141
+ class: [
142
+ cs.z("table-th"),
143
+ cs.is("whole", obj.whole),
144
+ obj.class ?? ""
145
+ ].join(" "),
146
+ colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
147
+ onClick: (event) => {
148
+ isfocus.value = true;
149
+ rowObj.value = obj;
150
+ event.stopPropagation();
151
+ return false;
152
+ }
153
+ },
154
+ [
155
+ vue.h(
156
+ "span",
157
+ {
158
+ class: cs.z("table-label")
159
+ },
160
+ [
161
+ util.setLabel(
162
+ obj,
163
+ props,
164
+ compons$1,
165
+ emit,
166
+ slots,
167
+ isComponSelected,
168
+ index2
169
+ )
170
+ ]
171
+ )
172
+ ]
173
+ );
174
+ };
175
+ const getChildrenValue = (obj, index2) => {
176
+ if (obj.children) {
177
+ return [
178
+ vue.h(
179
+ "div",
180
+ {
181
+ class: cs.z("table-children")
182
+ },
183
+ [
184
+ props.labelPosition == "top" ? getListTops(obj.children, obj) : getLists(obj.children, obj)
185
+ ]
186
+ )
187
+ ];
188
+ } else {
189
+ return [
190
+ vue.h(
191
+ "span",
192
+ {
193
+ class: cs.z("table-value")
194
+ },
195
+ [
196
+ util.setSslot(
197
+ obj,
198
+ props.value,
199
+ props,
200
+ compons$1,
201
+ emit,
202
+ slots,
203
+ isComponSelected,
204
+ index2
205
+ )
206
+ ]
207
+ )
208
+ ];
209
+ }
210
+ };
211
+ const getValue = (obj, index2, isRow) => {
212
+ return vue.h(
213
+ "td",
214
+ {
215
+ style: css.setStyles(obj, props.value, props),
216
+ class: [
217
+ cs.z("table-td"),
218
+ cs.is("whole", obj.whole),
219
+ obj.class ?? ""
220
+ ].join(" "),
221
+ colspan: setColspan(obj),
222
+ rowspan: isRow ? 2 : void 0,
223
+ onClick: (event) => {
224
+ isfocus.value = true;
225
+ rowObj.value = obj;
226
+ event.stopPropagation();
227
+ return false;
228
+ }
229
+ },
230
+ [...getChildrenValue(obj, index2)]
231
+ );
232
+ };
233
+ const getTd = (obj, index2) => {
234
+ const arr = [getValue(obj, index2)];
235
+ if (!obj.isdiv) {
236
+ arr.unshift(getlabel(obj, index2));
237
+ }
238
+ if (props.labelPosition == "auto") {
239
+ return [
240
+ vue.h(
241
+ "td",
242
+ {
243
+ colspan: setColspan(obj),
244
+ class: cs.is("whole", obj.whole)
245
+ },
246
+ [
247
+ vue.h(
248
+ "div",
249
+ {
250
+ class: cs.z("table-auto")
251
+ },
252
+ arr
253
+ )
254
+ ]
255
+ )
256
+ ];
257
+ } else {
258
+ return arr;
259
+ }
260
+ };
261
+ const setColspan = (obj) => {
262
+ if (["auto", "top"].includes(props.labelPosition)) {
263
+ if (obj.whole) {
264
+ return props.column;
265
+ } else if (obj.column) {
266
+ return obj.column;
267
+ } else {
268
+ return "";
269
+ }
270
+ } else {
271
+ const j = !obj.isdiv ? 0 : 1;
272
+ if (obj.whole) {
273
+ return (props.column - 1) * 2 + 1 + j;
274
+ } else if (obj.column) {
275
+ return (obj.column - 1) * 2 + 1 + j;
276
+ } else {
277
+ return 1 + j;
278
+ }
279
+ }
280
+ };
281
+ const renderValue = () => {
282
+ if (props.list && props.list.length > 0) {
283
+ return vue.h(
284
+ "div",
285
+ {
286
+ class: cs.z("div"),
287
+ style: cs.vdo({
288
+ borderColor: borderColor.value
289
+ })
290
+ // onClick(event: Event) {
291
+ // isfocus.value = true;
292
+ // event.stopPropagation();
293
+ // return false;
294
+ // },
295
+ },
296
+ [
297
+ vue.h(
298
+ "table",
299
+ {
300
+ class: [
301
+ cs.z("table"),
302
+ props.labelPosition ?? "",
303
+ cs.is(
304
+ "border",
305
+ props.border ? true : false
306
+ ),
307
+ cs.is("aliquots", props.aliquots)
308
+ ].join(" "),
309
+ cellspacing: "0",
310
+ cellpadding: "0",
311
+ border: "0"
312
+ },
313
+ props.labelPosition == "top" ? getListTops(props.list) : getLists(props.list)
314
+ )
315
+ ]
316
+ );
317
+ } else {
318
+ return "";
319
+ }
320
+ };
321
+ vue.onMounted(() => {
322
+ if (window) {
323
+ window.addEventListener("click", () => {
324
+ isfocus.value = false;
325
+ });
326
+ }
327
+ });
328
+ return {
329
+ renderValue,
330
+ borderColor
331
+ };
332
+ },
333
+ render(props) {
334
+ return props.renderValue();
335
+ }
336
+ });
337
+ exports.default = _sfc_main;