@web-utils/form-ui 1.0.0-beta5 → 1.0.0-beta50

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 (208) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/base.css +1 -1
  6. package/chunks/6yfBZFOB.mjs +56 -0
  7. package/chunks/B-zqRAXo.mjs +69 -0
  8. package/chunks/B1IPSTA6.mjs +198 -0
  9. package/chunks/B9gA65rt2.mjs +38 -0
  10. package/chunks/BA2KEptL.mjs +172 -0
  11. package/chunks/BBERmTup.mjs +83 -0
  12. package/chunks/BUGCiCnl.mjs +83 -0
  13. package/chunks/BbSPWDDZ.mjs +100 -0
  14. package/chunks/BfxDxIg0.mjs +106 -0
  15. package/chunks/BqWvBF14.mjs +35 -0
  16. package/chunks/BsZgAJX_2.mjs +81 -0
  17. package/chunks/BtcjAHE6.mjs +317 -0
  18. package/chunks/ByHz4mmh.mjs +87 -0
  19. package/chunks/C2zgFLYO.mjs +185 -0
  20. package/chunks/CAd1zK9Q.mjs +25 -0
  21. package/chunks/CJdkjadi.mjs +17 -0
  22. package/chunks/CabldOLo.mjs +157 -0
  23. package/chunks/CkOD-_VV.mjs +8 -0
  24. package/chunks/Cln3RBAD.mjs +660 -0
  25. package/chunks/CqoVAnxC2.mjs +93 -0
  26. package/chunks/CuAoMR3n.mjs +105 -0
  27. package/chunks/CxTg0r4n.mjs +166 -0
  28. package/chunks/D0Zg2CV0.mjs +57 -0
  29. package/chunks/DA7oGHSX.mjs +141 -0
  30. package/chunks/DOP3aBxf.mjs +93 -0
  31. package/chunks/DOZRzqlo.mjs +37 -0
  32. package/chunks/D_qiRmiE.mjs +230 -0
  33. package/chunks/DcTVYqeJ.mjs +113 -0
  34. package/chunks/Dkd5BC98.mjs +198 -0
  35. package/chunks/GI8krYU82.mjs +478 -0
  36. package/chunks/V2p-PCpL.mjs +176 -0
  37. package/chunks/bFbPPcdq.mjs +25 -0
  38. package/chunks/cqIZWDHo.mjs +614 -0
  39. package/chunks/eae6huQB.mjs +25 -0
  40. package/chunks/gCeDFHo1.mjs +32 -0
  41. package/chunks/gLPy4Sus.mjs +164 -0
  42. package/chunks/hlha6Bhc.mjs +107 -0
  43. package/chunks/hzaYr6Ud2.mjs +207 -0
  44. package/chunks/kflKDW4T2.mjs +146 -0
  45. package/chunks/pIzhYsBe.mjs +93 -0
  46. package/chunks/vXQf89tS.mjs +1361 -0
  47. package/chunks/wXeqV-_7.mjs +89 -0
  48. package/chunks/zwXzk9ff2.mjs +568 -0
  49. package/confirm-button/index.d.ts +115 -0
  50. package/confirm-button/index.mjs +35 -0
  51. package/confirmable/index.d.ts +86 -0
  52. package/confirmable/index.mjs +8 -0
  53. package/constants/index.d.ts +53 -0
  54. package/constants/index.mjs +4 -0
  55. package/dict-render/index.d.ts +28 -0
  56. package/dict-render/index.mjs +2 -0
  57. package/editable-tree/index.d.ts +254 -0
  58. package/editable-tree/index.mjs +2 -0
  59. package/editable-tree/style.css +1 -0
  60. package/element-dialog/index.d.ts +337 -16
  61. package/element-dialog/index.mjs +2 -91
  62. package/element-resize-observer/index.d.ts +8 -0
  63. package/element-resize-observer/index.mjs +40 -0
  64. package/element-resize-observer/style.css +1 -0
  65. package/empty-view/index.d.ts +2 -2
  66. package/empty-view/index.mjs +1 -1
  67. package/flex-scroll-area/index.d.ts +1 -1
  68. package/flex-scroll-area/index.mjs +1 -1
  69. package/form-advice/index.mjs +13 -12
  70. package/form-button/index.d.ts +116 -0
  71. package/form-button/index.mjs +36 -0
  72. package/form-card/index.d.ts +14 -0
  73. package/form-card/index.mjs +18 -0
  74. package/form-cascader/index.d.ts +472 -0
  75. package/form-cascader/index.mjs +2 -0
  76. package/form-checkbox/index.d.ts +236 -16
  77. package/form-checkbox/index.mjs +1 -1
  78. package/form-checkbox-group/index.d.ts +364 -0
  79. package/form-checkbox-group/index.mjs +2 -0
  80. package/form-checkbox-group/style.css +1 -0
  81. package/form-date-picker/index.d.ts +390 -19
  82. package/form-date-picker/index.mjs +1 -1
  83. package/form-holder/index.d.ts +87 -20
  84. package/form-holder/index.mjs +1 -1
  85. package/form-holder/style.css +1 -1
  86. package/form-image/index.d.ts +145 -13
  87. package/form-image/index.mjs +1 -1
  88. package/form-input/index.d.ts +301 -20
  89. package/form-input/index.mjs +1 -1
  90. package/form-input/style.css +1 -0
  91. package/form-input-cron-expression/index.d.ts +217 -0
  92. package/form-input-cron-expression/index.mjs +2 -0
  93. package/form-input-cron-expression/style.css +1 -0
  94. package/form-input-email/index.d.ts +307 -16
  95. package/form-input-email/index.mjs +1 -1
  96. package/form-input-id-card/index.d.ts +307 -16
  97. package/form-input-id-card/index.mjs +1 -1
  98. package/form-input-number/index.d.ts +246 -18
  99. package/form-input-number/index.mjs +1 -1
  100. package/form-input-phone-number/index.d.ts +307 -16
  101. package/form-input-phone-number/index.mjs +1 -1
  102. package/form-input-tag/index.d.ts +263 -1
  103. package/form-input-tag/index.mjs +1 -3
  104. package/form-input-time/index.d.ts +434 -1
  105. package/form-input-time/index.mjs +1 -3
  106. package/form-item-config-provider/index.d.ts +22 -0
  107. package/form-item-config-provider/index.mjs +24 -0
  108. package/form-item-group/index.d.ts +91 -17
  109. package/form-item-group/index.mjs +2 -78
  110. package/form-item-group/style.css +1 -1
  111. package/form-item-x/index.d.ts +141 -11
  112. package/form-item-x/index.mjs +1 -1
  113. package/form-item-x/style.css +1 -0
  114. package/form-radio-group/index.d.ts +303 -16
  115. package/form-radio-group/index.mjs +1 -1
  116. package/form-rate/index.d.ts +254 -14
  117. package/form-rate/index.mjs +1 -1
  118. package/form-red-table/index.mjs +27 -26
  119. package/form-row/index.d.ts +2 -2
  120. package/form-row/index.mjs +1 -1
  121. package/form-select/index.d.ts +537 -18
  122. package/form-select/index.mjs +1 -1
  123. package/form-slider/index.d.ts +283 -16
  124. package/form-slider/index.mjs +1 -1
  125. package/form-switch/index.d.ts +272 -14
  126. package/form-switch/index.mjs +1 -1
  127. package/form-table/index.d.ts +269 -0
  128. package/form-table/index.mjs +2 -0
  129. package/form-table-plus/index.d.ts +266 -0
  130. package/form-table-plus/index.mjs +2 -0
  131. package/form-text/index.d.ts +165 -13
  132. package/form-text/index.mjs +1 -1
  133. package/form-textarea/index.d.ts +351 -0
  134. package/form-textarea/index.mjs +2 -0
  135. package/form-time-select/index.d.ts +319 -0
  136. package/form-time-select/index.mjs +2 -0
  137. package/form-view/index.mjs +1 -1
  138. package/helper/dictionary.d.ts +15 -0
  139. package/helper/dictionary.mjs +97 -0
  140. package/hook/useDictionary.d.ts +60 -0
  141. package/hook/useDictionary.mjs +15 -0
  142. package/hook/useVisibilityChange.d.ts +4 -0
  143. package/hook/useVisibilityChange.mjs +14 -0
  144. package/iframe-window/index.d.ts +9 -0
  145. package/iframe-window/index.mjs +37 -0
  146. package/iframe-window/style.css +1 -0
  147. package/index.css +2 -0
  148. package/index.d.ts +57 -36
  149. package/index.mjs +59 -61
  150. package/package.json +10 -5
  151. package/pageable-table/index.d.ts +398 -0
  152. package/pageable-table/index.mjs +2 -0
  153. package/pageable-table/style.css +1 -0
  154. package/resolver/index.mjs +29 -0
  155. package/sub-table/index.d.ts +100 -0
  156. package/sub-table/index.mjs +472 -0
  157. package/sub-table/style.css +1 -0
  158. package/sub-table-plus/index.d.ts +97 -0
  159. package/sub-table-plus/index.mjs +2 -0
  160. package/sub-table-plus/style.css +1 -0
  161. package/table-column/index.d.ts +160 -0
  162. package/table-column/index.mjs +2 -0
  163. package/table-column/style.css +1 -0
  164. package/table-column-def/index.d.ts +95 -0
  165. package/table-column-def/index.mjs +11 -0
  166. package/table-view/index.d.ts +340 -1
  167. package/table-view/index.mjs +454 -6
  168. package/table-view/style.css +1 -0
  169. package/toolbar/index.d.ts +128 -1
  170. package/toolbar/index.mjs +1 -8
  171. package/toolbar/style.css +1 -0
  172. package/toolbar-button/index.d.ts +188 -1
  173. package/toolbar-button/index.mjs +1 -8
  174. package/vue-cron/index.d.ts +191 -0
  175. package/vue-cron/index.mjs +2 -0
  176. package/vue-cron/style.css +1 -0
  177. package/web-types.json +1 -1
  178. package/x-input-tag/index.d.ts +2 -0
  179. package/x-input-tag/index.mjs +228 -0
  180. package/x-input-tag/style.css +1 -0
  181. package/year-calendar/index.d.ts +99 -0
  182. package/year-calendar/index.mjs +2 -0
  183. package/year-calendar/style.css +1 -0
  184. package/chunks/B4M_TFeR.mjs +0 -152
  185. package/chunks/B5BIQCcK.mjs +0 -149
  186. package/chunks/BHNKrW1j.mjs +0 -61
  187. package/chunks/BO9jWhBl.mjs +0 -46
  188. package/chunks/BZ8aOa78.mjs +0 -35
  189. package/chunks/Bsz7y4Xp.mjs +0 -73
  190. package/chunks/Bxj372sF.mjs +0 -53
  191. package/chunks/C33EmJN8.mjs +0 -32
  192. package/chunks/C6Li3-l7.mjs +0 -28
  193. package/chunks/CBcdalMX.mjs +0 -35
  194. package/chunks/CdRsyF0n.mjs +0 -43
  195. package/chunks/ClNahmiU.mjs +0 -23
  196. package/chunks/CstztYMu.mjs +0 -28
  197. package/chunks/DC9b53M6.mjs +0 -32
  198. package/chunks/DDVAgRED.mjs +0 -36
  199. package/chunks/DpJQABVD.mjs +0 -91
  200. package/chunks/ZsLNWI9x.mjs +0 -46
  201. package/chunks/jn_iQrVZ.mjs +0 -28
  202. package/constants.d.ts +0 -1
  203. package/constants.mjs +0 -4
  204. package/form-check-box-group/index.d.ts +0 -93
  205. package/form-check-box-group/index.mjs +0 -2
  206. package/input/style.css +0 -1
  207. package/resolver.mjs +0 -79
  208. /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ .table-column-filter .el-drawer__body{padding:10px}.table-column-filter .el-drawer__header{border-bottom:1px solid #f0f0f0;min-height:20px;margin-bottom:0;padding:16px 10px 16px 24px}.pageable-table{flex:auto;height:100%;position:relative}.pageable-table .single-select-column .el-radio__label{padding:0}.pageable-table.auto-height{height:auto;position:static}.pageable-table.auto-height .el-table{min-height:200px;position:relative}.pageable-table.auto-height .pageable-table-wrapper{position:static}.pageable-table .pageable-table-wrapper{flex-direction:column;width:100%;height:100%;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.pageable-table .el-pagination{background-color:#fff}.pageable-table .table-status-icon{font-size:20px}.pageable-table .pageable-table-loading{align-items:center;display:inline-flex}.pageable-table .pageable-table-error{color:red;border:1px solid #fca4a4;align-items:center;display:inline-flex}.pageable-table .pageable-table-error:hover{background-color:#fff0f0}.pageable-table .pageable-table-total{padding:0 10px 10px}.pageable-table .underline{position:relative}.pageable-table .underline:after{z-index:1;content:"";background-color:#606266;width:100%;height:1px;position:absolute;bottom:0;left:0}.pageable-table .el-table th{color:#000000d9;word-break:break-word;background-color:#fafafa}.pageable-table .total{padding:10px}
@@ -0,0 +1,29 @@
1
+ import { componentNames as e, noStylesComponents as t } from "../index.mjs";
2
+ import { hyphenate as n } from "@web-utils/core";
3
+ //#region src/resolver/index.ts
4
+ var r = ({ importStyle: r = !1, excludeComponents: a = [] } = {}) => {
5
+ let o = {}, s = {}, c = {};
6
+ return e.forEach((e) => {
7
+ o[e] = !0;
8
+ }), t.forEach((e) => {
9
+ s[e] = !0;
10
+ }), a.forEach((e) => {
11
+ c[e] = !0;
12
+ }), (e) => {
13
+ if (c[e] === !0 || o[e] !== !0) return;
14
+ let t = n(e);
15
+ return {
16
+ from: `@web-utils/form-ui/${t}/index.mjs`,
17
+ sideEffects: i({
18
+ componentName: e,
19
+ name: t,
20
+ importStyle: r,
21
+ noStylesComponentNameMap: s
22
+ })
23
+ };
24
+ };
25
+ }, i = ({ componentName: e, name: t, importStyle: n = !1, noStylesComponentNameMap: r } = {}) => {
26
+ if (n && r[e] !== !0) return ["@web-utils/form-ui/base.css", `@web-utils/form-ui/${t}/style.css`];
27
+ };
28
+ //#endregion
29
+ export { r as FormUiResolver };
@@ -0,0 +1,100 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ modelValue: ArrayConstructor;
3
+ prop: StringConstructor;
4
+ columns: ArrayConstructor;
5
+ limit: {
6
+ type: NumberConstructor;
7
+ default: number;
8
+ };
9
+ maxLimit: {
10
+ type: NumberConstructor;
11
+ default: number;
12
+ };
13
+ disabled: BooleanConstructor;
14
+ showSummary: BooleanConstructor;
15
+ selectionWidth: StringConstructor;
16
+ allowEmpty: BooleanConstructor;
17
+ handleColumn: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ editable: BooleanConstructor;
22
+ fetchApi: FunctionConstructor;
23
+ delApi: FunctionConstructor;
24
+ showHandleColumnAddButton: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ showEmptyAddButton: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ }>, {}, {
33
+ rows: never[];
34
+ selectedRows: never[];
35
+ }, {
36
+ available(): boolean;
37
+ enabled(): boolean;
38
+ rowProps(): {};
39
+ filteredColumns(): unknown[];
40
+ }, {
41
+ getCellType(row: any, item: any): any;
42
+ getInputAttr(row: any, item: any): any;
43
+ isInputDisabled(row: any, item: any): any;
44
+ onInput(row: any, val: any, item: any): void;
45
+ onSelectionChange(selectedRows: any): void;
46
+ remove(row: any, index: any): void;
47
+ add(row: any, index: any): void;
48
+ addRow(): void;
49
+ delRow(): Promise<void>;
50
+ refresh(): void;
51
+ getVal(row: any, column: any, item: any): any;
52
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
53
+ 'add-row': null;
54
+ "update:modelValue": null;
55
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
56
+ modelValue: ArrayConstructor;
57
+ prop: StringConstructor;
58
+ columns: ArrayConstructor;
59
+ limit: {
60
+ type: NumberConstructor;
61
+ default: number;
62
+ };
63
+ maxLimit: {
64
+ type: NumberConstructor;
65
+ default: number;
66
+ };
67
+ disabled: BooleanConstructor;
68
+ showSummary: BooleanConstructor;
69
+ selectionWidth: StringConstructor;
70
+ allowEmpty: BooleanConstructor;
71
+ handleColumn: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
75
+ editable: BooleanConstructor;
76
+ fetchApi: FunctionConstructor;
77
+ delApi: FunctionConstructor;
78
+ showHandleColumnAddButton: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ showEmptyAddButton: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ }>> & Readonly<{
87
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
88
+ "onAdd-row"?: ((...args: any[]) => any) | undefined;
89
+ }>, {
90
+ disabled: boolean;
91
+ editable: boolean;
92
+ allowEmpty: boolean;
93
+ handleColumn: boolean;
94
+ showHandleColumnAddButton: boolean;
95
+ showEmptyAddButton: boolean;
96
+ limit: number;
97
+ showSummary: boolean;
98
+ maxLimit: number;
99
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
100
+ export default _default;
@@ -0,0 +1,472 @@
1
+ import e from "../confirmable/index.mjs";
2
+ import t from "../confirm-button/index.mjs";
3
+ import { t as n } from "../chunks/DOZRzqlo.mjs";
4
+ import { t as r } from "../chunks/CxTg0r4n.mjs";
5
+ import { t as i } from "../chunks/CkOD-_VV.mjs";
6
+ import { n as a } from "../chunks/D_qiRmiE.mjs";
7
+ import { t as o } from "../chunks/Dkd5BC98.mjs";
8
+ import { t as s } from "../chunks/CabldOLo.mjs";
9
+ import { t as c } from "../chunks/V2p-PCpL.mjs";
10
+ import { t as l } from "../chunks/B1IPSTA6.mjs";
11
+ import { t as u } from "../chunks/BbSPWDDZ.mjs";
12
+ import { t as d } from "../chunks/bFbPPcdq.mjs";
13
+ import { t as f } from "../chunks/BtcjAHE6.mjs";
14
+ import { t as p } from "../chunks/cqIZWDHo.mjs";
15
+ import m from "../table-column-def/index.mjs";
16
+ import { t as h } from "../chunks/CuAoMR3n.mjs";
17
+ import { findTreeChildren as g, isFunction as _ } from "@web-utils/core";
18
+ import { Fragment as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, mergeProps as E, openBlock as D, renderList as O, renderSlot as k, toDisplayString as A, withCtx as j, withModifiers as M } from "vue";
19
+ import { formContextKey as N, formItemContextKey as P } from "element-plus";
20
+ import { cloneDeep as F } from "@web-utils/integrations/lodash";
21
+ //#region src/components/table/SubTable.vue
22
+ var I = {
23
+ name: "SubTable",
24
+ emits: {
25
+ ...a,
26
+ "add-row": null
27
+ },
28
+ inject: {
29
+ elForm: {
30
+ from: N,
31
+ default: ""
32
+ },
33
+ elFormItem: {
34
+ from: P,
35
+ default: ""
36
+ }
37
+ },
38
+ props: {
39
+ modelValue: Array,
40
+ prop: String,
41
+ columns: Array,
42
+ limit: {
43
+ type: Number,
44
+ default: Infinity
45
+ },
46
+ maxLimit: {
47
+ type: Number,
48
+ default: Infinity
49
+ },
50
+ disabled: Boolean,
51
+ showSummary: Boolean,
52
+ selectionWidth: String,
53
+ allowEmpty: Boolean,
54
+ handleColumn: {
55
+ type: Boolean,
56
+ default: !0
57
+ },
58
+ editable: Boolean,
59
+ fetchApi: Function,
60
+ delApi: Function,
61
+ showHandleColumnAddButton: {
62
+ type: Boolean,
63
+ default: !0
64
+ },
65
+ showEmptyAddButton: {
66
+ type: Boolean,
67
+ default: !0
68
+ }
69
+ },
70
+ data() {
71
+ return {
72
+ rows: [],
73
+ selectedRows: []
74
+ };
75
+ },
76
+ computed: {
77
+ available() {
78
+ return this.editable && this.enabled;
79
+ },
80
+ enabled() {
81
+ return !this.disabled;
82
+ },
83
+ rowProps() {
84
+ let e = {};
85
+ return this.columns && this.columns.map((e) => e.prop).forEach((t) => {
86
+ e[t] = null;
87
+ }), e;
88
+ },
89
+ filteredColumns() {
90
+ return this.columns.filter((e) => e.label && !e.hide && !e.slot);
91
+ }
92
+ },
93
+ watch: {
94
+ modelValue: {
95
+ deep: !0,
96
+ immediate: !0,
97
+ handler(e) {
98
+ this.rows = e || [];
99
+ }
100
+ },
101
+ rows: {
102
+ deep: !0,
103
+ immediate: !0,
104
+ handler(e) {
105
+ this.$emit("update:modelValue", e);
106
+ }
107
+ }
108
+ },
109
+ methods: {
110
+ getCellType(e, t) {
111
+ return _(t.getType) ? t.getType(e, t) : t.type;
112
+ },
113
+ getInputAttr(e, t) {
114
+ return {
115
+ ...t.attrs,
116
+ ...t.getAttrs ? t.getAttrs(e) : {}
117
+ };
118
+ },
119
+ isInputDisabled(e, t) {
120
+ return t.isDisabled && t.isDisabled(e);
121
+ },
122
+ onInput(e, t, n) {
123
+ n.setValue ? n.setValue(e, t, n, this.rows) : e[n.prop] = t;
124
+ },
125
+ onSelectionChange(e) {
126
+ this.selectedRows = e;
127
+ },
128
+ remove(e, t) {
129
+ try {
130
+ this.rows.splice(t, 1);
131
+ } catch {}
132
+ },
133
+ add(e, t) {
134
+ let n = F(this.rowProps);
135
+ this.rows.splice(t + 1, 0, n);
136
+ },
137
+ addRow() {
138
+ this.$emit("add-row");
139
+ },
140
+ async delRow() {
141
+ if (!this.selectedRows.length) {
142
+ this.$message.warning("请选择要删除的记录!");
143
+ return;
144
+ }
145
+ try {
146
+ if (this.delApi) try {
147
+ await this.delApi(this.selectedRows.map((e) => e.id).join(",")), this.refresh();
148
+ } catch {
149
+ this.$message.error("删除失败!");
150
+ }
151
+ else this.$emit("update:modelValue", this.rows.filter((e) => !this.selectedRows.includes(e)));
152
+ this.$message.success("删除成功!");
153
+ } catch {}
154
+ },
155
+ refresh() {
156
+ this.$refs.table.getPage();
157
+ },
158
+ getVal(e, t, n) {
159
+ var r, i;
160
+ if (n.type === "select" && (r = n.attrs) != null && r.options) {
161
+ let r = n.attrs.options.find((n) => n.code === e[t.property]);
162
+ if (r) return r.name;
163
+ }
164
+ if (n.type === "cascader" && (i = n.attrs) != null && i.options) {
165
+ let [r] = g(n.attrs.options, (r) => r[n.attrs.valueKey || "value"] === e[t.property]);
166
+ if (r) return r[n.attrs.valueKey || "label"];
167
+ }
168
+ return e[t.property];
169
+ }
170
+ }
171
+ }, L = {
172
+ key: 0,
173
+ class: "table-header"
174
+ }, R = {
175
+ key: 0,
176
+ style: { color: "#f56c6c" }
177
+ }, z = ["onClick"];
178
+ function B(i, a, g, _, N, P) {
179
+ let F = r, I = t, B = s, V = d, H = f, U = l, W = o, G = c, K = u, q = h, J = n, Y = m, X = e, Z = p;
180
+ return D(), y(Z, E({
181
+ ref: "table",
182
+ class: "sub-table",
183
+ "auto-height": "",
184
+ data: N.rows,
185
+ api: g.fetchApi,
186
+ "show-summary": g.showSummary,
187
+ "selection-width": g.selectionWidth
188
+ }, i.$attrs, {
189
+ "hide-on-single-page": "",
190
+ selection: P.enabled,
191
+ onSelectionChange: P.onSelectionChange
192
+ }), C({
193
+ default: j(() => [
194
+ k(i.$slots, "columns", { columns: g.columns }, () => [(D(!0), x(v, null, O(P.filteredColumns, (e) => (D(), y(Y, {
195
+ key: e.prop,
196
+ label: e.label,
197
+ width: e.width,
198
+ align: e.align,
199
+ prop: e.prop,
200
+ options: e.options,
201
+ "show-overflow-tooltip": !P.available && e.showOverflowTooltip
202
+ }, {
203
+ header: j(() => [!g.disabled && e.required ? (D(), x("span", R, "*")) : b("v-if", !0), w(" " + A(e.label), 1)]),
204
+ default: j(({ row: t, column: n, $index: r }) => [
205
+ b("tag 插槽"),
206
+ k(i.$slots, "tag", {
207
+ row: t,
208
+ column: n,
209
+ index: r
210
+ }),
211
+ b("列默认插槽,名字和 prop 保持一致"),
212
+ k(i.$slots, e.prop, {
213
+ row: t,
214
+ column: n,
215
+ index: r
216
+ }, () => {
217
+ var i;
218
+ return [P.available && P.getCellType(t, e) === "input" ? (D(), y(B, E({
219
+ key: 0,
220
+ "model-value": t[n.property]
221
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
222
+ disabled: P.isInputDisabled(t, e),
223
+ prop: `${g.prop}[${r}].${e.prop}`,
224
+ required: e.required,
225
+ onInput: (n) => P.onInput(t, n, e)
226
+ }), null, 16, [
227
+ "model-value",
228
+ "disabled",
229
+ "prop",
230
+ "required",
231
+ "onInput"
232
+ ])) : P.available && P.getCellType(t, e) === "inputPhoneNumber" ? (D(), y(V, E({
233
+ key: 1,
234
+ "model-value": t[n.property]
235
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
236
+ disabled: P.isInputDisabled(t, e),
237
+ prop: `${g.prop}[${r}].${e.prop}`,
238
+ required: e.required,
239
+ onInput: (n) => P.onInput(t, n, e)
240
+ }), null, 16, [
241
+ "model-value",
242
+ "disabled",
243
+ "prop",
244
+ "required",
245
+ "onInput"
246
+ ])) : P.available && P.getCellType(t, e) === "select" ? (D(), x(v, { key: 2 }, [b(" <template v-else-if=\"available && getCellType(row, item) === 'user'\">\n <FormInputUser\n v-if=\"item.single\"\n v-model:name=\"row[column.property]\"\n v-bind=\"getInputAttr(row, item)\"\n :disabled=\"isInputDisabled(row, item)\"\n :prop=\"`${prop}[${$index}].${item.prop}`\"\n :required=\"item.required\"\n @input=\"val => onInput(row, val, item)\" />\n <FormInputUser\n v-else\n :model-value=\"row[column.property]\"\n v-bind=\"getInputAttr(row, item)\"\n :disabled=\"isInputDisabled(row, item)\"\n :prop=\"`${prop}[${$index}].${item.prop}`\"\n :required=\"item.required\"\n @input=\"val => onInput(row, val, item)\" />\n </template>\n <template v-else-if=\"available && getCellType(row, item) === 'department'\">\n <FormInputDepartment\n v-if=\"item.single\"\n v-model:name=\"row[column.property]\"\n :ou-type=\"item.ouType\"\n v-bind=\"getInputAttr(row, item)\"\n :disabled=\"isInputDisabled(row, item)\"\n :prop=\"`${prop}[${$index}].${item.prop}`\"\n :required=\"item.required\"\n @input=\"val => onInput(row, val, item)\" />\n <FormInputDepartment\n v-else\n :model-value=\"row[column.property]\"\n v-bind=\"getInputAttr(row, item)\"\n :disabled=\"isInputDisabled(row, item)\"\n :prop=\"`${prop}[${$index}].${item.prop}`\"\n :required=\"item.required\"\n @input=\"val => onInput(row, val, item)\" />\n </template>"), T(H, E({ "model-value": t[n.property] }, { ref_for: !0 }, P.getInputAttr(t, e), {
247
+ disabled: P.isInputDisabled(t, e),
248
+ prop: `${g.prop}[${r}].${e.prop}`,
249
+ options: e.options,
250
+ required: e.required,
251
+ onInput: (n) => P.onInput(t, n, e)
252
+ }), null, 16, [
253
+ "model-value",
254
+ "disabled",
255
+ "prop",
256
+ "options",
257
+ "required",
258
+ "onInput"
259
+ ])], 64)) : P.available && P.getCellType(t, e) === "datePicker" ? (D(), y(U, E({
260
+ key: 3,
261
+ ref_for: !0
262
+ }, P.getInputAttr(t, e), {
263
+ start: t[e.start],
264
+ "onUpdate:start": (n) => t[e.start] = n,
265
+ end: t[e.end],
266
+ "onUpdate:end": (n) => t[e.end] = n,
267
+ "model-value": t[n.property],
268
+ disabled: P.isInputDisabled(t, e),
269
+ prop: `${g.prop}[${r}].${e.prop}`,
270
+ required: e.required,
271
+ onInput: (n) => P.onInput(t, n, e)
272
+ }), null, 16, [
273
+ "start",
274
+ "onUpdate:start",
275
+ "end",
276
+ "onUpdate:end",
277
+ "model-value",
278
+ "disabled",
279
+ "prop",
280
+ "required",
281
+ "onInput"
282
+ ])) : P.available && P.getCellType(t, e) === "cascader" ? (D(), y(W, E({
283
+ key: 4,
284
+ "model-value": t[n.property]
285
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
286
+ disabled: P.isInputDisabled(t, e),
287
+ prop: `${g.prop}[${r}].${e.prop}`,
288
+ required: e.required,
289
+ "label-key": e.labelKey,
290
+ "value-key": e.valueKey,
291
+ onInput: (n) => P.onInput(t, n, e)
292
+ }), null, 16, [
293
+ "model-value",
294
+ "disabled",
295
+ "prop",
296
+ "required",
297
+ "label-key",
298
+ "value-key",
299
+ "onInput"
300
+ ])) : P.available && P.getCellType(t, e) === "checkbox" ? (D(), y(G, E({
301
+ key: 5,
302
+ "model-value": t[n.property]
303
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
304
+ disabled: P.isInputDisabled(t, e),
305
+ prop: `${g.prop}[${r}].${e.prop}`,
306
+ required: e.required,
307
+ onInput: (n) => P.onInput(t, n, e)
308
+ }), null, 16, [
309
+ "model-value",
310
+ "disabled",
311
+ "prop",
312
+ "required",
313
+ "onInput"
314
+ ])) : P.available && P.getCellType(t, e) === "number" ? (D(), y(K, E({
315
+ key: 6,
316
+ "model-value": t[n.property]
317
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
318
+ disabled: P.isInputDisabled(t, e),
319
+ prop: `${g.prop}[${r}].${e.prop}`,
320
+ required: e.required,
321
+ onInput: (n) => P.onInput(t, n, e)
322
+ }), null, 16, [
323
+ "model-value",
324
+ "disabled",
325
+ "prop",
326
+ "required",
327
+ "onInput"
328
+ ])) : P.available && P.getCellType(t, e) === "textarea" ? (D(), y(q, E({
329
+ key: 7,
330
+ rows: e.rows || "3",
331
+ "model-value": t[n.property]
332
+ }, { ref_for: !0 }, P.getInputAttr(t, e), {
333
+ disabled: P.isInputDisabled(t, e),
334
+ prop: `${g.prop}[${r}].${e.prop}`,
335
+ required: e.required,
336
+ onInput: (n) => P.onInput(t, n, e)
337
+ }), null, 16, [
338
+ "rows",
339
+ "model-value",
340
+ "disabled",
341
+ "prop",
342
+ "required",
343
+ "onInput"
344
+ ])) : e.dicType || (i = e.options) != null && i.length ? (D(), y(J, {
345
+ key: 8,
346
+ "dict-type": e.dicType,
347
+ "id-as-value": e.idAsValue,
348
+ "label-as-value": e.labelAsValue,
349
+ column: n,
350
+ row: t,
351
+ options: e.options
352
+ }, null, 8, [
353
+ "dict-type",
354
+ "id-as-value",
355
+ "label-as-value",
356
+ "column",
357
+ "row",
358
+ "options"
359
+ ])) : (D(), x(v, { key: 9 }, [w(A(P.getVal(t, n, e)), 1)], 64))];
360
+ })
361
+ ]),
362
+ _: 2
363
+ }, 1032, [
364
+ "label",
365
+ "width",
366
+ "align",
367
+ "prop",
368
+ "options",
369
+ "show-overflow-tooltip"
370
+ ]))), 128))]),
371
+ b(" 自定义操作列 "),
372
+ k(i.$slots, "handle", {
373
+ add: P.add,
374
+ remove: P.remove
375
+ }),
376
+ b(" 操作列 "),
377
+ (!g.modelValue || g.modelValue.length < g.limit) && !g.disabled && P.enabled && g.editable && g.handleColumn ? (D(), y(Y, {
378
+ key: 0,
379
+ label: "操作",
380
+ fixed: "right",
381
+ width: "80",
382
+ align: "center",
383
+ prop: "menu"
384
+ }, {
385
+ header: j(({ column: e, $index: t }) => [k(i.$slots, "handle-column-header", {
386
+ column: e,
387
+ index: t
388
+ }, () => [w(A(e.label), 1)])]),
389
+ default: j(({ row: e, $index: t }) => [g.showHandleColumnAddButton && g.modelValue.length < g.maxLimit ? (D(), x("i", {
390
+ key: 0,
391
+ class: "el-icon-circle-plus sub-table-handle-button table-button-add",
392
+ style: {
393
+ "margin-right": "5px",
394
+ "font-size": "20px",
395
+ cursor: "pointer"
396
+ },
397
+ title: "添加",
398
+ onClick: M((n) => P.add(e, t), ["stop"])
399
+ }, null, 8, z)) : b("v-if", !0), g.modelValue && g.modelValue.length > 1 || g.allowEmpty ? (D(), y(X, {
400
+ key: 1,
401
+ class: "el-icon-error sub-table-handle-button table-button-remove",
402
+ style: {
403
+ "font-size": "20px",
404
+ cursor: "pointer"
405
+ },
406
+ title: "删除",
407
+ message: "您确定要删除该行吗?",
408
+ onClick: M((n) => P.remove(e, t), ["stop"])
409
+ }, null, 8, ["onClick"])) : b("v-if", !0)]),
410
+ _: 3
411
+ })) : b("v-if", !0)
412
+ ]),
413
+ _: 2
414
+ }, [g.editable ? void 0 : {
415
+ name: "toolbar",
416
+ fn: j(() => [P.enabled || g.fetchApi ? (D(), x("div", L, [k(i.$slots, "toolbar", {
417
+ addRow: P.addRow,
418
+ delRow: P.delRow,
419
+ refresh: P.refresh
420
+ }, () => [P.enabled ? (D(), x(v, { key: 0 }, [T(F, {
421
+ class: "table-header-button add",
422
+ icon: "el-icon-circle-plus",
423
+ type: "text",
424
+ onClick: P.addRow
425
+ }, {
426
+ default: j(() => [...a[1] || (a[1] = [w(" 添加 ", -1)])]),
427
+ _: 1
428
+ }, 8, ["onClick"]), T(I, {
429
+ class: "table-header-button remove",
430
+ message: "您确定要删除选中的记录吗?",
431
+ icon: "el-icon-error",
432
+ type: "text",
433
+ onClick: P.delRow
434
+ }, {
435
+ default: j(() => [...a[2] || (a[2] = [w(" 删除 ", -1)])]),
436
+ _: 1
437
+ }, 8, ["onClick"])], 64)) : b("v-if", !0), g.fetchApi ? (D(), y(F, {
438
+ key: 1,
439
+ class: "table-header-button refresh",
440
+ icon: "el-icon-refresh-left",
441
+ type: "text",
442
+ disabled: !1,
443
+ onClick: P.refresh
444
+ }, {
445
+ default: j(() => [...a[3] || (a[3] = [w(" 刷新 ", -1)])]),
446
+ _: 1
447
+ }, 8, ["onClick"])) : b("v-if", !0)])])) : b("v-if", !0)]),
448
+ key: "0"
449
+ }, g.allowEmpty && !g.disabled && g.showEmptyAddButton ? {
450
+ name: "empty",
451
+ fn: j(() => [S("i", {
452
+ class: "el-icon-circle-plus sub-table-handle-button table-button-add",
453
+ style: {
454
+ "font-size": "20px",
455
+ cursor: "pointer"
456
+ },
457
+ title: "添加",
458
+ onClick: a[0] || (a[0] = M((e) => P.add(null, 0), ["stop"]))
459
+ })]),
460
+ key: "1"
461
+ } : void 0]), 1040, [
462
+ "data",
463
+ "api",
464
+ "show-summary",
465
+ "selection-width",
466
+ "selection",
467
+ "onSelectionChange"
468
+ ]);
469
+ }
470
+ var V = /* @__PURE__ */ i(I, [["render", B]]);
471
+ //#endregion
472
+ export { V as default };
@@ -0,0 +1 @@
1
+ .sub-table.pageable-table.auto-height .el-table{min-height:0}.sub-table .el-form-item{width:100%;margin-bottom:0}.sub-table .el-col{width:100%}.sub-table .table-header{background-color:#f3f5fb;border:1px solid #dfe6ec;border-bottom:none;padding:2px 10px}.sub-table .table-header-button:hover,.sub-table .table-header-button:focus{color:#595959}.sub-table .table-header-button i+span{margin-left:0}.sub-table .table-header-button i{font-size:15px}.sub-table .table-header-button.add i{color:#4886ec}.sub-table .table-header-button.remove i{color:#e34e55}.sub-table .table-header-button.refresh i{color:#1eb91e}.sub-table .table-button-add{color:#5add7a;opacity:.8}.sub-table .table-button-add:hover{opacity:1}.sub-table .table-button-remove{color:#ddd}.sub-table .table-button-remove:hover{color:#ef6666}.sub-table .el-table__header-wrapper .el-table__header th{background-color:#f3f5fb;padding:5px 0}.sub-table .el-table{border-top-color:#dde1e5}.sub-table .el-table td{border-color:#dfe6ec}.sub-table .el-col{padding:0!important}.sub-table .row-indicator{border:6px solid #0000;border-bottom-color:#f5690c;width:0;height:0;display:inline-block;position:absolute;top:-6px;right:-6px;transform:rotate(45deg)}.sub-table .sub-table-handle-button{cursor:pointer;font-size:20px}.sub-table .sub-table-handle-button+.sub-table-handle-button{margin-left:5px}.sub-table .el-table .el-table__header th{line-height:inherit;padding:5px 0;background:#f3f5fb!important}