@vipl520/dk-ui 1.0.76 → 1.0.78

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/dist/attributes.json +8 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +288 -15
  4. package/dist/index.min.js +5 -5
  5. package/dist/index.min.js.map +1 -1
  6. package/dist/index.min.mjs +5 -5
  7. package/dist/index.min.mjs.map +1 -1
  8. package/dist/index.mjs +285 -14
  9. package/dist/tags.json +7 -0
  10. package/dist/web-types.json +35 -1
  11. package/es/index.d.ts +1 -0
  12. package/es/index.mjs +4 -1
  13. package/es/index.mjs.map +1 -1
  14. package/es/index.scss +79 -0
  15. package/es/page-diy/src/page-diy.vue.mjs +3 -3
  16. package/es/page-diy/src/page-diy.vue.mjs.map +1 -1
  17. package/es/style-custom-input/style/index.scss +0 -1
  18. package/es/table-form/index.d.ts +53 -0
  19. package/es/table-form/index.mjs +8 -0
  20. package/es/table-form/index.mjs.map +1 -0
  21. package/es/table-form/src/props.d.ts +23 -0
  22. package/es/table-form/src/props.mjs +26 -0
  23. package/es/table-form/src/props.mjs.map +1 -0
  24. package/es/table-form/src/table-form.vue.d.ts +52 -0
  25. package/es/table-form/src/table-form.vue.mjs +7 -0
  26. package/es/table-form/src/table-form.vue.mjs.map +1 -0
  27. package/es/table-form/src/table-form.vue2.mjs +250 -0
  28. package/es/table-form/src/table-form.vue2.mjs.map +1 -0
  29. package/es/table-form/style/index.css +1 -0
  30. package/es/table-form/style/index.scss +110 -0
  31. package/lib/index.d.ts +1 -0
  32. package/lib/index.js +187 -182
  33. package/lib/index.js.map +1 -1
  34. package/lib/index.scss +79 -0
  35. package/lib/page-diy/src/page-diy.vue.js +3 -3
  36. package/lib/page-diy/src/page-diy.vue.js.map +1 -1
  37. package/lib/style-custom-input/style/index.scss +0 -1
  38. package/lib/table-form/index.d.ts +53 -0
  39. package/lib/table-form/index.js +14 -0
  40. package/lib/table-form/index.js.map +1 -0
  41. package/lib/table-form/src/props.d.ts +23 -0
  42. package/lib/table-form/src/props.js +28 -0
  43. package/lib/table-form/src/props.js.map +1 -0
  44. package/lib/table-form/src/table-form.vue.d.ts +52 -0
  45. package/lib/table-form/src/table-form.vue.js +11 -0
  46. package/lib/table-form/src/table-form.vue.js.map +1 -0
  47. package/lib/table-form/src/table-form.vue2.js +254 -0
  48. package/lib/table-form/src/table-form.vue2.js.map +1 -0
  49. package/lib/table-form/style/index.css +1 -0
  50. package/lib/table-form/style/index.scss +110 -0
  51. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-form.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,250 @@
1
+ import { defineComponent, ref, markRaw, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, resolveDynamicComponent, unref, withCtx, createElementVNode, createVNode, createTextVNode, createCommentVNode } from 'vue';
2
+ import formCreate from '@form-create/element-ui';
3
+ import { tableFormProps } from './props.mjs';
4
+
5
+ const __default__ = defineComponent({
6
+ name: "DkTableForm"
7
+ });
8
+ var _sfc_main = /* @__PURE__ */ defineComponent({
9
+ ...__default__,
10
+ props: tableFormProps,
11
+ emits: ["change", "add", "delete", "update:modelValue"],
12
+ setup(__props, { emit }) {
13
+ const props = __props;
14
+ const rule = ref([]);
15
+ const trs = ref([]);
16
+ const fapi = ref({});
17
+ const Form = markRaw(props.formCreateInject?.form?.$form() || {});
18
+ const copyTrs = ref("");
19
+ const oldValue = ref("");
20
+ const formChange = (field, _, rule2, api, flag) => {
21
+ if (!flag) {
22
+ updateValue();
23
+ }
24
+ };
25
+ const updateValue = () => {
26
+ const value = trs.value.map((tr, idx) => ({
27
+ // Vue: Spread types may only be created from object types.
28
+ ...props.modelValue[idx] || {},
29
+ ...fapi.value.getChildrenFormData(tr)
30
+ })).filter((v) => {
31
+ if (v === void 0 || v === null) {
32
+ return false;
33
+ }
34
+ let flag = false;
35
+ Object.keys(v).forEach((k) => {
36
+ flag = flag || v[k] !== void 0 && v[k] !== "" && v[k] !== null;
37
+ });
38
+ return flag;
39
+ });
40
+ const str = JSON.stringify(value);
41
+ if (str !== oldValue.value) {
42
+ oldValue.value = str;
43
+ emit("update:modelValue", value);
44
+ emit("change", value);
45
+ }
46
+ };
47
+ const setRawData = (idx, formData) => {
48
+ const raw = trs.value[idx];
49
+ fapi.value.setChildrenFormData(raw, formData, true);
50
+ };
51
+ const updateTable = () => {
52
+ const str = JSON.stringify(props.modelValue);
53
+ if (oldValue.value === str) {
54
+ return;
55
+ }
56
+ oldValue.value = str;
57
+ trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null));
58
+ if (!props.modelValue.length) {
59
+ addRaw();
60
+ }
61
+ props.modelValue.forEach((data, idx) => {
62
+ if (!trs.value[idx]) {
63
+ addRaw();
64
+ }
65
+ setRawData(idx, data);
66
+ });
67
+ rule.value[0].children[1].children = trs.value;
68
+ };
69
+ const delRaw = (idx) => {
70
+ if (props.disabled) {
71
+ return;
72
+ }
73
+ trs.value.splice(idx, 1);
74
+ updateValue();
75
+ if (trs.value.length) {
76
+ trs.value.forEach(updateRaw);
77
+ } else {
78
+ addRaw();
79
+ }
80
+ emit("delete", idx);
81
+ };
82
+ const addRaw = (flag = false) => {
83
+ if (flag && props.disabled) {
84
+ return;
85
+ }
86
+ const tr = formCreate.parseJson(copyTrs.value)[0];
87
+ trs.value.push(tr);
88
+ updateRaw(tr);
89
+ if (flag)
90
+ emit("add", trs.value.length);
91
+ };
92
+ const updateRaw = (tr) => {
93
+ const idx = trs.value.indexOf(tr);
94
+ tr.children[0].props.innerText = idx + 1;
95
+ tr.children[tr.children.length - 1].children[0].props.onClick = () => {
96
+ delRaw(idx);
97
+ };
98
+ };
99
+ const loadRule = () => {
100
+ const header = [
101
+ {
102
+ type: "th",
103
+ native: true,
104
+ class: "dk-tf-head-idx",
105
+ props: {
106
+ innerText: "#"
107
+ }
108
+ }
109
+ ];
110
+ const body = [
111
+ {
112
+ type: "td",
113
+ class: "dk-tf-idx",
114
+ native: true,
115
+ props: {
116
+ innerText: "0"
117
+ }
118
+ }
119
+ ];
120
+ props.columns.forEach((column) => {
121
+ header.push({
122
+ type: "th",
123
+ native: true,
124
+ style: column.style,
125
+ props: {
126
+ innerText: column.label || ""
127
+ }
128
+ });
129
+ body.push({
130
+ type: "td",
131
+ native: true,
132
+ children: [...column.rule || []]
133
+ });
134
+ });
135
+ header.push({
136
+ type: "th",
137
+ native: true,
138
+ class: "dk-tf-edit fc-clock",
139
+ props: {
140
+ innerText: "\u64CD\u4F5C"
141
+ }
142
+ });
143
+ body.push({
144
+ type: "td",
145
+ native: true,
146
+ class: "dk-tf-btn fc-clock",
147
+ children: [
148
+ {
149
+ type: "dk-icon",
150
+ native: true,
151
+ class: "fc-icon icon-delete",
152
+ props: {
153
+ icon: "DeleteFilled"
154
+ }
155
+ }
156
+ ]
157
+ });
158
+ copyTrs.value = formCreate.toJson([
159
+ {
160
+ type: "tr",
161
+ native: true,
162
+ subRule: true,
163
+ children: body
164
+ }
165
+ ]);
166
+ rule.value = [
167
+ {
168
+ type: "table",
169
+ native: true,
170
+ class: "dk-tf-table",
171
+ props: {
172
+ border: "1",
173
+ cellspacing: "0",
174
+ cellpadding: "0"
175
+ },
176
+ children: [
177
+ {
178
+ type: "thead",
179
+ native: true,
180
+ children: [
181
+ {
182
+ type: "tr",
183
+ native: true,
184
+ children: header
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ type: "tbody",
190
+ native: true,
191
+ children: trs.value
192
+ }
193
+ ]
194
+ }
195
+ ];
196
+ addRaw();
197
+ };
198
+ watch(() => props.modelValue, updateTable, { deep: true });
199
+ onMounted(() => {
200
+ loadRule();
201
+ updateTable();
202
+ });
203
+ return (_ctx, _cache) => {
204
+ const _component_dk_icon = resolveComponent("dk-icon");
205
+ const _component_el_button = resolveComponent("el-button");
206
+ return openBlock(), createElementBlock(
207
+ "div",
208
+ {
209
+ class: normalizeClass(["dk-table-form", { "dk-disabled": _ctx.disabled }])
210
+ },
211
+ [
212
+ (openBlock(), createBlock(resolveDynamicComponent(unref(Form)), {
213
+ api: fapi.value,
214
+ "onUpdate:api": _cache[0] || (_cache[0] = ($event) => fapi.value = $event),
215
+ option: _ctx.options,
216
+ rule: rule.value,
217
+ "extend-option": true,
218
+ disabled: _ctx.disabled,
219
+ onChange: formChange,
220
+ onEmitEvent: _ctx.$emit
221
+ }, null, 40, ["api", "option", "rule", "disabled", "onEmitEvent"])),
222
+ !_ctx.max || _ctx.max > trs.value.length ? (openBlock(), createBlock(_component_el_button, {
223
+ key: 0,
224
+ link: "",
225
+ type: "primary",
226
+ class: "fc-clock",
227
+ onClick: _cache[1] || (_cache[1] = ($event) => addRaw(true))
228
+ }, {
229
+ default: withCtx(() => [
230
+ createElementVNode("span", null, [
231
+ createVNode(_component_dk_icon, {
232
+ icon: "CirclePlusFilled",
233
+ size: 14
234
+ }),
235
+ createTextVNode(" \u6DFB\u52A0")
236
+ ])
237
+ ]),
238
+ _: 1
239
+ /* STABLE */
240
+ })) : createCommentVNode("v-if", true)
241
+ ],
242
+ 2
243
+ /* CLASS */
244
+ );
245
+ };
246
+ }
247
+ });
248
+
249
+ export { _sfc_main as default };
250
+ //# sourceMappingURL=table-form.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-form.vue2.mjs","sources":["../../../src/table-form/src/table-form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableForm',\n});\n</script>\n<template>\n <div class=\"dk-table-form\" :class=\"{ 'dk-disabled': disabled }\">\n <component\n :is=\"Form\"\n v-model:api=\"fapi\"\n :option=\"options\"\n :rule=\"rule\"\n :extend-option=\"true\"\n :disabled=\"disabled\"\n @change=\"formChange\"\n @emit-event=\"$emit\"\n ></component>\n <el-button v-if=\"!max || max > trs.length\" link type=\"primary\" class=\"fc-clock\" @click=\"addRaw(true)\">\n <span> <dk-icon icon=\"CirclePlusFilled\" :size=\"14\"></dk-icon> 添加</span>\n </el-button>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, watch, onMounted, markRaw } from 'vue'\nimport formCreate from '@form-create/element-ui' // 根据实际情况调整导入路径\nimport { tableFormProps } from './props'\n\n\n\nconst props = defineProps(tableFormProps)\n\n// 定义事件发射器\nconst emit = defineEmits(['change', 'add', 'delete', 'update:modelValue'])\n\n// 初始化数据\nconst rule: any = ref([])\n// const trs = ref([])\nconst trs = ref<((typeof props.modelValue)[number] | null)[]>([])\nconst fapi: any = ref({})\nconst Form = markRaw(props.formCreateInject?.form?.$form() || {})\nconst copyTrs = ref('')\nconst oldValue = ref('')\n\n// 方法定义\nconst formChange = (field: any, _: any, rule: any, api: any, flag: boolean) => {\n if (!flag) {\n updateValue()\n }\n}\n\nconst updateValue = () => {\n const value = trs.value\n .map((tr: any, idx: number) => ({\n // Vue: Spread types may only be created from object types.\n ...((props.modelValue[idx] as Record<string, any>) || {}),\n ...fapi.value.getChildrenFormData(tr),\n }))\n .filter((v) => {\n if (v === undefined || v === null) {\n return false\n }\n let flag = false\n Object.keys(v).forEach((k) => {\n flag = flag || (v[k] !== undefined && v[k] !== '' && v[k] !== null)\n })\n return flag\n })\n\n const str = JSON.stringify(value)\n if (str !== oldValue.value) {\n oldValue.value = str\n emit('update:modelValue', value)\n emit('change', value)\n }\n}\n\nconst setRawData = (idx: number, formData: any) => {\n const raw = trs.value[idx]\n fapi.value.setChildrenFormData(raw, formData, true)\n}\n\nconst updateTable = () => {\n const str = JSON.stringify(props.modelValue)\n // 定义 trs 的类型为 modelValue 中元素的类型或 null\n if (oldValue.value === str) {\n return\n }\n oldValue.value = str\n // trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null))\n trs.value.splice(0, trs.value.length, ...props.modelValue.map(() => null as any))\n if (!props.modelValue.length) {\n addRaw()\n }\n props.modelValue.forEach((data: any, idx: number) => {\n if (!trs.value[idx]) {\n addRaw()\n }\n setRawData(idx, data)\n })\n rule.value[0].children[1].children = trs.value\n}\n\nconst delRaw = (idx: number) => {\n if (props.disabled) {\n return\n }\n trs.value.splice(idx, 1)\n updateValue()\n if (trs.value.length) {\n trs.value.forEach(updateRaw)\n } else {\n addRaw()\n }\n emit('delete', idx)\n}\n\nconst addRaw = (flag: boolean = false) => {\n if (flag && props.disabled) {\n return\n }\n const tr = formCreate.parseJson(copyTrs.value)[0]\n trs.value.push(tr)\n updateRaw(tr)\n if (flag) emit('add', trs.value.length)\n}\n\nconst updateRaw = (tr: any) => {\n const idx = trs.value.indexOf(tr)\n tr.children[0].props.innerText = idx + 1\n tr.children[tr.children.length - 1].children[0].props.onClick = () => {\n delRaw(idx)\n }\n}\n\nconst loadRule = () => {\n const header: any = [\n {\n type: 'th',\n native: true,\n class: 'dk-tf-head-idx',\n props: {\n innerText: '#',\n },\n },\n ]\n const body: any = [\n {\n type: 'td',\n class: 'dk-tf-idx',\n native: true,\n props: {\n innerText: '0',\n },\n },\n ]\n\n props.columns.forEach((column: any) => {\n header.push({\n type: 'th',\n native: true,\n style: column.style,\n props: {\n innerText: column.label || '',\n },\n })\n body.push({\n type: 'td',\n native: true,\n children: [...(column.rule || [])],\n })\n })\n\n header.push({\n type: 'th',\n native: true,\n class: 'dk-tf-edit fc-clock',\n props: {\n innerText: '操作',\n },\n })\n\n body.push({\n type: 'td',\n native: true,\n class: 'dk-tf-btn fc-clock',\n children: [\n {\n type: 'dk-icon',\n native: true,\n class: 'fc-icon icon-delete',\n props: {\n icon: 'DeleteFilled',\n },\n },\n ],\n })\n\n copyTrs.value = formCreate.toJson([\n {\n type: 'tr',\n native: true,\n subRule: true,\n children: body,\n },\n ])\n\n rule.value = [\n {\n type: 'table',\n native: true,\n class: 'dk-tf-table',\n props: {\n border: '1',\n cellspacing: '0',\n cellpadding: '0',\n },\n children: [\n {\n type: 'thead',\n native: true,\n children: [\n {\n type: 'tr',\n native: true,\n children: header,\n },\n ],\n },\n {\n type: 'tbody',\n native: true,\n children: trs.value,\n },\n ],\n },\n ]\n\n addRaw()\n}\n\n// 监听和生命周期钩子\nwatch(() => props.modelValue, updateTable, { deep: true })\n\nonMounted(() => {\n loadRule()\n updateTable()\n})\n</script>\n"],"names":["__MACROS_defineComponent","rule"],"mappings":";;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,aAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAiCD,IAAM,MAAA,IAAA,GAAY,GAAI,CAAA,EAAE,CAAA,CAAA;AAExB,IAAM,MAAA,GAAA,GAAM,GAAkD,CAAA,EAAE,CAAA,CAAA;AAChE,IAAM,MAAA,IAAA,GAAY,GAAI,CAAA,EAAE,CAAA,CAAA;AACxB,IAAM,MAAA,IAAA,GAAO,QAAQ,KAAM,CAAA,gBAAA,EAAkB,MAAM,KAAM,EAAA,IAAK,EAAE,CAAA,CAAA;AAChE,IAAM,MAAA,OAAA,GAAU,IAAI,EAAE,CAAA,CAAA;AACtB,IAAM,MAAA,QAAA,GAAW,IAAI,EAAE,CAAA,CAAA;AAGvB,IAAA,MAAM,aAAa,CAAC,KAAA,EAAY,CAAQC,EAAAA,KAAAA,EAAW,KAAU,IAAkB,KAAA;AAC7E,MAAA,IAAI,CAAC,IAAM,EAAA;AACT,QAAY,WAAA,EAAA,CAAA;AAAA,OACd;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,cAAc,MAAM;AACxB,MAAA,MAAM,QAAQ,GAAI,CAAA,KAAA,CACf,GAAI,CAAA,CAAC,IAAS,GAAiB,MAAA;AAAA;AAAA,QAE9B,GAAK,KAAA,CAAM,UAAW,CAAA,GAAG,KAA6B,EAAC;AAAA,QACvD,GAAG,IAAA,CAAK,KAAM,CAAA,mBAAA,CAAoB,EAAE,CAAA;AAAA,OACpC,CAAA,CAAA,CACD,MAAO,CAAA,CAAC,CAAM,KAAA;AACb,QAAI,IAAA,CAAA,KAAM,KAAa,CAAA,IAAA,CAAA,KAAM,IAAM,EAAA;AACjC,UAAO,OAAA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AAA;AAAA,SACZ;AAAA,OACD,CAAA,CAAA;AAED,MAAA,IAAA,CAAK,KAAQ,GAAA;AAAA,QACX;AAAA,UACE,IAAM,EAAA,OAAA;AAAA,UACN,MAAQ,EAAA,IAAA;AAAA,UACR,KAAO,EAAA,aAAA;AAAA,UACP,KAAO,EAAA;AAAA,YACL,MAAQ,EAAA,GAAA;AAAA,YACR,WAAa,EAAA,GAAA;AAAA,YACb,WAAa,EAAA,GAAA;AAAA,WACf;AAAA,UACA,QAAU,EAAA;AAAA,YACR;AAAA,cACE,IAAM,EAAA,OAAA;AAAA,cACN,MAAQ,EAAA,IAAA;AAAA,cACR,QAAU,EAAA;AAAA,gBACR;AAAA,kBACE,IAAM,EAAA,IAAA;AAAA,kBACN,MAAQ,EAAA,IAAA;AAAA,kBACR,QAAU,EAAA,MAAA;AAAA,iBACZ;AAAA,eACF;AAAA,aACF;AAAA,YACA;AAAA,cACE,IAAM,EAAA,OAAA;AAAA,cACN,MAAQ,EAAA,IAAA;AAAA,cACR,UAAU,GAAI,CAAA,KAAA;AAAA,aAChB;AAAA,WACF;AAAA,SACF;AAAA,OACF,CAAA;AAEA,MAAO,MAAA,EAAA,CAAA;AAAA,KACT,CAAA;AAGA,IAAA,KAAA,CAAM,MAAM,KAAM,CAAA,UAAA,EAAY,aAAa,EAAE,IAAA,EAAM,MAAM,CAAA,CAAA;AAEzD,IAAA,SAAA,CAAU,MAAM;AACd,MAAS,QAAA,EAAA,CAAA;AACT,MAAY,WAAA,EAAA,CAAA;AAAA,KACb,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ .dk-table-form{overflow:auto;color:#666}.dk-table-form .form-create .el-form-item{margin-bottom:1px}.dk-table-form .form-create .el-form-item.is-error{margin-bottom:22px}.dk-table-form .form-create .el-form-item__label{display:none!important}.dk-table-form .form-create .el-form-item__content{display:flex;margin-left:0!important;width:100%!important}.dk-table-form .dk-tf-head-idx,.dk-table-form .dk-tf-idx{width:40px;min-width:40px;font-weight:500;text-align:center}.dk-table-form .dk-tf-btn,.dk-table-form .dk-tf-edit{width:70px;min-width:70px;text-align:center}.dk-table-form .dk-tf-btn .fc-icon,.dk-table-form .dk-tf-edit .fc-icon{cursor:pointer}.dk-table-form.dk-disabled .dk-tf-btn .fc-icon,.dk-table-form.dk-disabled>.el-button{cursor:not-allowed}.dk-table-form .dk-tf-table{width:100%;height:100%;overflow:hidden;table-layout:fixed;border:1px solid #ebeef5;border-bottom:0 none}.dk-table-form .dk-tf-table thead tr th{border:0 none;border-bottom:1px solid #ebeef5;height:40px;font-weight:500}.dk-table-form .dk-tf-table thead tr th:not(:first-child){border-left:1px solid #ebeef5}.dk-table-form .dk-tf-table tr{min-height:50px}.dk-table-form .dk-tf-table .dk-read-view{text-align:center;width:100%}.dk-table-form .dk-tf-table td{padding:5px;min-height:50px;min-width:80px;position:relative;box-sizing:border-box;overflow-wrap:break-word;overflow:hidden;border:0 none;border-bottom:1px solid #ebeef5}.dk-table-form .dk-tf-table td:not(:first-child){border-left:1px solid #ebeef5}.dk-table-form .dk-tf-table td .el-cascader,.dk-table-form .dk-tf-table td .el-date-editor,.dk-table-form .dk-tf-table td .el-input-number,.dk-table-form .dk-tf-table td .el-select,.dk-table-form .dk-tf-table td .el-slider{width:100%}
@@ -0,0 +1,110 @@
1
+ /* stylelint-disable */
2
+ .dk-table-form {
3
+ overflow: auto;
4
+ color: #666666;
5
+
6
+ .form-create {
7
+ .el-form-item {
8
+ margin-bottom: 1px;
9
+
10
+ &.is-error {
11
+ margin-bottom: 22px;
12
+ }
13
+
14
+ &__label {
15
+ display: none !important;
16
+ }
17
+
18
+ &__content {
19
+ display: flex;
20
+ margin-left: 0px !important;
21
+ width: 100% !important;
22
+ }
23
+ }
24
+ }
25
+
26
+ .dk-tf-head-idx,
27
+ .dk-tf-idx {
28
+ width: 40px;
29
+ min-width: 40px;
30
+ font-weight: 500;
31
+ text-align: center;
32
+ }
33
+
34
+ .dk-tf-edit,
35
+ .dk-tf-btn {
36
+ width: 70px;
37
+ min-width: 70px;
38
+ text-align: center;
39
+
40
+ .fc-icon {
41
+ cursor: pointer;
42
+ }
43
+ }
44
+
45
+ &.dk-disabled {
46
+ .dk-tf-btn .fc-icon,
47
+ > .el-button {
48
+ cursor: not-allowed;
49
+ }
50
+ }
51
+
52
+ .dk-tf-table {
53
+ width: 100%;
54
+ height: 100%;
55
+ overflow: hidden;
56
+ table-layout: fixed;
57
+ border: 1px solid #ebeef5;
58
+ border-bottom: 0 none;
59
+
60
+ thead {
61
+ tr {
62
+ th {
63
+ border: 0 none;
64
+ border-bottom: 1px solid #ebeef5;
65
+ height: 40px;
66
+ font-weight: 500;
67
+
68
+ &:not(:first-child) {
69
+ border-left: 1px solid #ebeef5;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ tr {
76
+ min-height: 50px;
77
+ }
78
+
79
+ .dk-read-view {
80
+ text-align: center;
81
+ width: 100%;
82
+ }
83
+
84
+ td {
85
+ padding: 5px;
86
+ min-height: 50px;
87
+ min-width: 80px;
88
+ position: relative;
89
+ box-sizing: border-box;
90
+ overflow-wrap: break-word;
91
+ // white-space: nowrap;
92
+ overflow: hidden;
93
+ border: 0 none;
94
+ border-bottom: 1px solid #ebeef5;
95
+
96
+ &:not(:first-child) {
97
+ border-left: 1px solid #ebeef5;
98
+ }
99
+
100
+ .el-input-number,
101
+ .el-select,
102
+ .el-slider,
103
+ .el-cascader,
104
+ .el-date-editor {
105
+ width: 100%;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ /* stylelint-enable */
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { App } from 'vue';
2
2
  export * from './tiny-editor';
3
3
  export * from './icon';
4
4
  export * from './group';
5
+ export * from './table-form';
5
6
  export * from './color-input';
6
7
  export * from './hot-area-input';
7
8
  export * from './form';