@delon/abc 19.1.0 → 20.0.0-beta.0

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 (246) hide show
  1. package/auto-focus/index.d.ts +19 -2
  2. package/cell/index.d.ts +316 -6
  3. package/cell/style/index.less +1 -1
  4. package/count-down/index.d.ts +26 -5
  5. package/date-picker/index.d.ts +51 -5
  6. package/down-file/index.d.ts +34 -5
  7. package/ellipsis/index.d.ts +55 -5
  8. package/error-collect/index.d.ts +35 -5
  9. package/exception/index.d.ts +45 -5
  10. package/fesm2022/auto-focus.mjs +7 -7
  11. package/fesm2022/cell.mjs +14 -15
  12. package/fesm2022/cell.mjs.map +1 -1
  13. package/fesm2022/chart-observer-size.mjs +11 -11
  14. package/fesm2022/count-down.mjs +8 -9
  15. package/fesm2022/count-down.mjs.map +1 -1
  16. package/fesm2022/date-picker.mjs +16 -15
  17. package/fesm2022/date-picker.mjs.map +1 -1
  18. package/fesm2022/down-file.mjs +8 -8
  19. package/fesm2022/ellipsis.mjs +9 -9
  20. package/fesm2022/ellipsis.mjs.map +1 -1
  21. package/fesm2022/error-collect.mjs +15 -15
  22. package/fesm2022/error-collect.mjs.map +1 -1
  23. package/fesm2022/exception.mjs +94 -78
  24. package/fesm2022/exception.mjs.map +1 -1
  25. package/fesm2022/footer-toolbar.mjs +44 -22
  26. package/fesm2022/footer-toolbar.mjs.map +1 -1
  27. package/fesm2022/full-content.mjs +25 -38
  28. package/fesm2022/full-content.mjs.map +1 -1
  29. package/fesm2022/global-footer.mjs +79 -60
  30. package/fesm2022/global-footer.mjs.map +1 -1
  31. package/fesm2022/hotkey.mjs +8 -8
  32. package/fesm2022/loading.mjs +12 -12
  33. package/fesm2022/loading.mjs.map +1 -1
  34. package/fesm2022/lodop.mjs +12 -11
  35. package/fesm2022/lodop.mjs.map +1 -1
  36. package/fesm2022/media.mjs +12 -13
  37. package/fesm2022/media.mjs.map +1 -1
  38. package/fesm2022/notice-icon.mjs +19 -29
  39. package/fesm2022/notice-icon.mjs.map +1 -1
  40. package/fesm2022/onboarding.mjs +14 -14
  41. package/fesm2022/onboarding.mjs.map +1 -1
  42. package/fesm2022/page-header.mjs +22 -27
  43. package/fesm2022/page-header.mjs.map +1 -1
  44. package/fesm2022/pdf.mjs +13 -13
  45. package/fesm2022/pdf.mjs.map +1 -1
  46. package/fesm2022/quick-menu.mjs +9 -9
  47. package/fesm2022/quick-menu.mjs.map +1 -1
  48. package/fesm2022/reuse-tab.mjs +32 -38
  49. package/fesm2022/reuse-tab.mjs.map +1 -1
  50. package/fesm2022/se.mjs +20 -21
  51. package/fesm2022/se.mjs.map +1 -1
  52. package/fesm2022/sg.mjs +17 -18
  53. package/fesm2022/sg.mjs.map +1 -1
  54. package/fesm2022/st.mjs +84 -87
  55. package/fesm2022/st.mjs.map +1 -1
  56. package/fesm2022/sv.mjs +23 -25
  57. package/fesm2022/sv.mjs.map +1 -1
  58. package/fesm2022/tag-select.mjs +13 -29
  59. package/fesm2022/tag-select.mjs.map +1 -1
  60. package/fesm2022/xlsx.mjs +16 -15
  61. package/fesm2022/xlsx.mjs.map +1 -1
  62. package/fesm2022/zip.mjs +8 -7
  63. package/fesm2022/zip.mjs.map +1 -1
  64. package/footer-toolbar/index.d.ts +23 -5
  65. package/footer-toolbar/style/index.less +1 -1
  66. package/full-content/index.d.ts +55 -5
  67. package/global-footer/index.d.ts +44 -5
  68. package/hotkey/index.d.ts +25 -5
  69. package/index.d.ts +2 -5
  70. package/index.less +0 -2
  71. package/loading/index.d.ts +93 -5
  72. package/lodop/index.d.ts +277 -5
  73. package/media/index.d.ts +61 -5
  74. package/notice-icon/index.d.ts +90 -5
  75. package/notice-icon/style/index.less +2 -2
  76. package/observers/index.d.ts +34 -5
  77. package/onboarding/index.d.ts +212 -5
  78. package/package.json +5 -13
  79. package/page-header/index.d.ts +83 -5
  80. package/page-header/style/index.less +1 -1
  81. package/pdf/index.d.ts +142 -5
  82. package/quick-menu/index.d.ts +38 -5
  83. package/quick-menu/style/index.less +2 -2
  84. package/reuse-tab/index.d.ts +512 -3
  85. package/se/index.d.ts +129 -5
  86. package/sg/index.d.ts +44 -5
  87. package/st/index.d.ts +1708 -3
  88. package/st/style/index.less +1 -1
  89. package/sv/index.d.ts +96 -5
  90. package/sv/style/index.less +1 -1
  91. package/tag-select/index.d.ts +27 -5
  92. package/theme-dark.less +0 -4
  93. package/theme-default.less +0 -8
  94. package/xlsx/index.d.ts +71 -5
  95. package/zip/index.d.ts +65 -5
  96. package/auto-focus/auto-focus.directive.d.ts +0 -10
  97. package/auto-focus/auto-focus.module.d.ts +0 -7
  98. package/avatar-list/avatar-list-item.component.d.ts +0 -9
  99. package/avatar-list/avatar-list.component.d.ts +0 -29
  100. package/avatar-list/avatar-list.module.d.ts +0 -14
  101. package/avatar-list/index.d.ts +0 -5
  102. package/avatar-list/public_api.d.ts +0 -3
  103. package/avatar-list/style/index.less +0 -53
  104. package/avatar-list/style/rtl.less +0 -3
  105. package/cell/cell-host.directive.d.ts +0 -10
  106. package/cell/cell.component.d.ts +0 -30
  107. package/cell/cell.module.d.ts +0 -17
  108. package/cell/cell.service.d.ts +0 -19
  109. package/cell/cell.types.d.ts +0 -234
  110. package/cell/provide.d.ts +0 -10
  111. package/count-down/count-down.component.d.ts +0 -15
  112. package/count-down/count-down.module.d.ts +0 -9
  113. package/count-down/public_api.d.ts +0 -2
  114. package/date-picker/date-picker.module.d.ts +0 -11
  115. package/date-picker/public_api.d.ts +0 -3
  116. package/date-picker/range-shortcut.component.d.ts +0 -10
  117. package/date-picker/range.directive.d.ts +0 -30
  118. package/down-file/down-file.directive.d.ts +0 -23
  119. package/down-file/down-file.module.d.ts +0 -9
  120. package/down-file/public_api.d.ts +0 -2
  121. package/ellipsis/ellipsis.component.d.ts +0 -43
  122. package/ellipsis/ellipsis.module.d.ts +0 -10
  123. package/ellipsis/public_api.d.ts +0 -2
  124. package/error-collect/error-collect.component.d.ts +0 -23
  125. package/error-collect/error-collect.module.d.ts +0 -9
  126. package/error-collect/public_api.d.ts +0 -2
  127. package/exception/exception.component.d.ts +0 -36
  128. package/exception/exception.module.d.ts +0 -12
  129. package/exception/public_api.d.ts +0 -2
  130. package/fesm2022/avatar-list.mjs +0 -132
  131. package/fesm2022/avatar-list.mjs.map +0 -1
  132. package/fesm2022/result.mjs +0 -84
  133. package/fesm2022/result.mjs.map +0 -1
  134. package/footer-toolbar/footer-toolbar.component.d.ts +0 -14
  135. package/footer-toolbar/footer-toolbar.module.d.ts +0 -10
  136. package/footer-toolbar/public_api.d.ts +0 -2
  137. package/full-content/full-content-toggle.directive.d.ts +0 -7
  138. package/full-content/full-content.component.d.ts +0 -32
  139. package/full-content/full-content.module.d.ts +0 -9
  140. package/full-content/full-content.service.d.ts +0 -10
  141. package/full-content/public_api.d.ts +0 -4
  142. package/global-footer/global-footer-item.component.d.ts +0 -10
  143. package/global-footer/global-footer.component.d.ts +0 -22
  144. package/global-footer/global-footer.module.d.ts +0 -10
  145. package/global-footer/global-footer.types.d.ts +0 -7
  146. package/global-footer/public_api.d.ts +0 -4
  147. package/hotkey/hotkey.directive.d.ts +0 -16
  148. package/hotkey/hotkey.module.d.ts +0 -7
  149. package/hotkey/public_api.d.ts +0 -2
  150. package/loading/loading.component.d.ts +0 -11
  151. package/loading/loading.module.d.ts +0 -12
  152. package/loading/loading.service.d.ts +0 -34
  153. package/loading/loading.types.d.ts +0 -35
  154. package/loading/public_api.d.ts +0 -4
  155. package/lodop/lodop.module.d.ts +0 -6
  156. package/lodop/lodop.service.d.ts +0 -74
  157. package/lodop/lodop.types.d.ts +0 -193
  158. package/lodop/public_api.d.ts +0 -3
  159. package/media/media.component.d.ts +0 -33
  160. package/media/media.module.d.ts +0 -8
  161. package/media/media.service.d.ts +0 -17
  162. package/media/public_api.d.ts +0 -3
  163. package/notice-icon/notice-icon-tab.component.d.ts +0 -13
  164. package/notice-icon/notice-icon.component.d.ts +0 -25
  165. package/notice-icon/notice-icon.module.d.ts +0 -18
  166. package/notice-icon/notice-icon.types.d.ts +0 -36
  167. package/notice-icon/public_api.d.ts +0 -4
  168. package/observers/observer-size.d.ts +0 -31
  169. package/observers/public-api.d.ts +0 -1
  170. package/onboarding/onboarding.component.d.ts +0 -35
  171. package/onboarding/onboarding.module.d.ts +0 -13
  172. package/onboarding/onboarding.service.d.ts +0 -58
  173. package/onboarding/onboarding.storage.d.ts +0 -11
  174. package/onboarding/onboarding.types.d.ts +0 -95
  175. package/onboarding/public_api.d.ts +0 -5
  176. package/page-header/page-header.component.d.ts +0 -70
  177. package/page-header/page-header.module.d.ts +0 -14
  178. package/page-header/public_api.d.ts +0 -2
  179. package/pdf/pdf.component.d.ts +0 -101
  180. package/pdf/pdf.config.d.ts +0 -2
  181. package/pdf/pdf.module.d.ts +0 -9
  182. package/pdf/pdf.types.d.ts +0 -29
  183. package/pdf/public_api.d.ts +0 -4
  184. package/public_api.d.ts +0 -2
  185. package/quick-menu/public_api.d.ts +0 -2
  186. package/quick-menu/quick-menu.component.d.ts +0 -26
  187. package/quick-menu/quick-menu.module.d.ts +0 -10
  188. package/result/index.d.ts +0 -5
  189. package/result/public_api.d.ts +0 -2
  190. package/result/result.component.d.ts +0 -21
  191. package/result/result.module.d.ts +0 -13
  192. package/result/style/index.less +0 -66
  193. package/result/style/rtl.less +0 -3
  194. package/reuse-tab/lifecycle_hooks.d.ts +0 -16
  195. package/reuse-tab/provide.d.ts +0 -28
  196. package/reuse-tab/public_api.d.ts +0 -14
  197. package/reuse-tab/reuse-tab-context-menu.component.d.ts +0 -21
  198. package/reuse-tab/reuse-tab-context.component.d.ts +0 -11
  199. package/reuse-tab/reuse-tab-context.directive.d.ts +0 -10
  200. package/reuse-tab/reuse-tab-context.service.d.ts +0 -14
  201. package/reuse-tab/reuse-tab.cache.d.ts +0 -16
  202. package/reuse-tab/reuse-tab.component.d.ts +0 -79
  203. package/reuse-tab/reuse-tab.interfaces.d.ts +0 -110
  204. package/reuse-tab/reuse-tab.module.d.ts +0 -17
  205. package/reuse-tab/reuse-tab.service.d.ts +0 -192
  206. package/reuse-tab/reuse-tab.state.d.ts +0 -14
  207. package/reuse-tab/reuse-tab.strategy.d.ts +0 -10
  208. package/se/public_api.d.ts +0 -4
  209. package/se/se-container.component.d.ts +0 -49
  210. package/se/se.component.d.ts +0 -60
  211. package/se/se.module.d.ts +0 -12
  212. package/se/se.types.d.ts +0 -9
  213. package/sg/public_api.d.ts +0 -3
  214. package/sg/sg-container.component.d.ts +0 -15
  215. package/sg/sg.component.d.ts +0 -19
  216. package/sg/sg.module.d.ts +0 -9
  217. package/st/provide.d.ts +0 -10
  218. package/st/public_api.d.ts +0 -12
  219. package/st/st-column-source.d.ts +0 -47
  220. package/st/st-data-source.d.ts +0 -77
  221. package/st/st-export.d.ts +0 -11
  222. package/st/st-filter.component.d.ts +0 -23
  223. package/st/st-row.directive.d.ts +0 -20
  224. package/st/st-widget-host.directive.d.ts +0 -12
  225. package/st/st-widget.d.ts +0 -11
  226. package/st/st.component.d.ts +0 -295
  227. package/st/st.config.d.ts +0 -2
  228. package/st/st.interfaces.d.ts +0 -1193
  229. package/st/st.module.d.ts +0 -9
  230. package/st/st.types.d.ts +0 -77
  231. package/sv/public_api.d.ts +0 -4
  232. package/sv/sv-container.component.d.ts +0 -39
  233. package/sv/sv-value.component.d.ts +0 -10
  234. package/sv/sv.component.d.ts +0 -34
  235. package/sv/sv.module.d.ts +0 -14
  236. package/tag-select/public_api.d.ts +0 -2
  237. package/tag-select/tag-select.component.d.ts +0 -21
  238. package/tag-select/tag-select.module.d.ts +0 -10
  239. package/xlsx/public_api.d.ts +0 -4
  240. package/xlsx/xlsx.directive.d.ts +0 -9
  241. package/xlsx/xlsx.module.d.ts +0 -7
  242. package/xlsx/xlsx.service.d.ts +0 -27
  243. package/xlsx/xlsx.types.d.ts +0 -27
  244. package/zip/public_api.d.ts +0 -2
  245. package/zip/zip.service.d.ts +0 -34
  246. package/zip/zip.types.d.ts +0 -28
@@ -1,1193 +0,0 @@
1
- import type { CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent } from '@angular/cdk/drag-drop';
2
- import type { HttpHeaders, HttpParams } from '@angular/common/http';
3
- import type { ElementRef, TemplateRef } from '@angular/core';
4
- import type { Observable } from 'rxjs';
5
- import type { ThemeType } from '@ant-design/icons-angular';
6
- import type { CellOptions } from '@delon/abc/cell';
7
- import type { ACLCanType } from '@delon/acl';
8
- import type { DrawerHelperOptions, ModalHelperOptions, YNMode } from '@delon/theme';
9
- import type { CurrencyFormatOptions } from '@delon/util/format';
10
- import type { NgClassType, NgStyleInterface } from 'ng-zorro-antd/core/types';
11
- import type { DisabledTimeFn } from 'ng-zorro-antd/date-picker';
12
- import type { NzDrawerOptions } from 'ng-zorro-antd/drawer';
13
- import type { ModalOptions } from 'ng-zorro-antd/modal';
14
- import type { PaginationItemRenderContext } from 'ng-zorro-antd/pagination';
15
- import type { NzTablePaginationType } from 'ng-zorro-antd/table';
16
- import type { STComponent } from './st.component';
17
- export type STColumnSafeType = 'text' | 'html' | 'safeHtml';
18
- export interface STWidthMode {
19
- /**
20
- * 宽度类型
21
- * - `default` 默认行为
22
- * - `strict` 严格模式,即强制按 `width` 指定的宽度呈现,并根据 `strictBehavior` 类型处理
23
- */
24
- type?: 'strict' | 'default';
25
- /**
26
- * 严格模式的处理行为
27
- * - `wrap` 强制换行
28
- * - `truncate` 截短
29
- */
30
- strictBehavior?: 'wrap' | 'truncate';
31
- }
32
- export interface STResetColumnsOption {
33
- pi?: number;
34
- ps?: number;
35
- columns?: STColumn[];
36
- /**
37
- * Whether to pre-clear data, Default: `false`
38
- */
39
- preClearData?: boolean;
40
- /**
41
- * Whether to trigger a data load, Default: `true`
42
- */
43
- emitReload?: boolean;
44
- }
45
- export interface STReq {
46
- /**
47
- * 分页类型,默认:`page`
48
- * - `page` 使用 `pi`,`ps` 组合
49
- * - `skip` 使用 `skip`,`limit` 组合
50
- */
51
- type?: 'page' | 'skip';
52
- /**
53
- * 额外请求参数,默认自动附加 `pi`、`ps` 至URL
54
- * - `{ status: 'new' }` => `url?pi=1&ps=10&status=new`
55
- */
56
- params?: any;
57
- /**
58
- * Whether to ignore `null` or `unfind` values in parameters
59
- *
60
- * 是否忽略参数中 `null` 或 `undefind` 值
61
- */
62
- ignoreParamNull?: boolean;
63
- /** 请求方法,默认:`GET` */
64
- method?: string;
65
- /** 请求体 `body` */
66
- body?: any;
67
- /** 请求体 `Header` */
68
- headers?: any;
69
- /**
70
- * 重命名参数 `pi`、`ps`,默认:`{ pi: 'pi', ps: 'ps' }`
71
- * - `{ pi: 'Page' }` => `pi` 会被替换成 Page
72
- */
73
- reName?: STReqReNameType;
74
- /**
75
- * 是否将请求所有参数数据都放入 `body` 当中(`url` 地址本身参数除外),仅当 `method: 'POST'` 时有效,默认:`false`
76
- */
77
- allInBody?: boolean;
78
- /**
79
- * 是否延迟加载数据,即渲染结束后不会主动发起请求,在适当的时机调用 `resetColumns` 来渲染,默认:`false`
80
- */
81
- lazyLoad?: boolean;
82
- /**
83
- * 请求前数据处理
84
- */
85
- process?: (requestOptions: STRequestOptions) => STRequestOptions;
86
- }
87
- export interface STRequestOptions {
88
- body?: any;
89
- headers?: HttpHeaders | Record<string, string | string[]>;
90
- params?: HttpParams | Record<string, string | string[]>;
91
- observe?: 'body' | 'events' | 'response';
92
- reportProgress?: boolean;
93
- responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
94
- withCredentials?: boolean;
95
- }
96
- export interface STLoadOptions {
97
- /** 是否合并,默认:`false` */
98
- merge?: boolean;
99
- /** 是否跳转至顶部,若不指定由 `page.toTop` 来决定 */
100
- toTop?: boolean;
101
- }
102
- export interface STRes<T extends STData = any> {
103
- /**
104
- * 重命名返回参数 `total`、`list`
105
- * - `{ total: 'Total' }` => Total 会被当作 `total`
106
- */
107
- reName?: STResReNameType | ((result: any, options: {
108
- pi: number;
109
- ps: number;
110
- total: number;
111
- }) => {
112
- total: number;
113
- list: T[];
114
- });
115
- /**
116
- * 数据预处理
117
- */
118
- process?: (data: T[], rawData?: any) => T[];
119
- }
120
- export interface STPage {
121
- /**
122
- * 前端分页,当 `data` 为`any[]` 或 `Observable<any[]>` 有效,默认:`true`
123
- * - `true` 由 `st` 根据 `data` 长度受控分页,包括:排序、过滤等
124
- * - `false` 由用户通过 `total` 和 `data` 参数受控分页,并维护 `(change)` 当分页变更时重新加载数据
125
- */
126
- front?: boolean;
127
- /**
128
- * 后端分页是否采用`0`基索引,只在`data`类型为`string`时有效,默认:`false`
129
- */
130
- zeroIndexed?: boolean;
131
- /**
132
- * 指定分页显示的位置,默认:`bottom`
133
- */
134
- position?: 'top' | 'bottom' | 'both';
135
- /**
136
- * 指定分页显示的尺寸,默认:`default`
137
- */
138
- type?: NzTablePaginationType;
139
- /**
140
- * 指定分页分页方向,默认:`right`
141
- */
142
- placement?: 'left' | 'center' | 'right';
143
- /**
144
- * 是否显示分页器,默认:`true`
145
- */
146
- show?: boolean;
147
- /**
148
- * 是否显示分页器中改变页数,默认:`false`
149
- */
150
- showSize?: boolean;
151
- /**
152
- * 分页器中每页显示条目数下拉框值,默认:`[10, 20, 30, 40, 50]`
153
- */
154
- pageSizes?: number[];
155
- /**
156
- * 是否显示分页器中快速跳转,默认:`false`
157
- */
158
- showQuickJumper?: boolean;
159
- /**
160
- * 用于自定义页码的结构,用法参照 Pagination 组件
161
- */
162
- itemRender?: TemplateRef<PaginationItemRenderContext> | null;
163
- /**
164
- * 当添加该属性时,显示为简单分页,默认:`false`
165
- */
166
- simple?: boolean;
167
- /**
168
- * 是否显示总数据量
169
- * - `boolean` 类型显示与否,默认模板:`共 {{total}} 条`
170
- * - `string` 自定义模板,模板变量:
171
- * - `{{total}}` 表示数据总量
172
- * - `{{range[0]}}` 表示当前页开始数量值
173
- * - `{{range[1]}}` 表示当前页结束数量值
174
- */
175
- total?: string | boolean;
176
- /**
177
- * 切换分页时返回顶部,默认:`true`
178
- */
179
- toTop?: boolean;
180
- /**
181
- * 返回顶部偏移值,默认:`100`
182
- */
183
- toTopOffset?: number;
184
- }
185
- /**
186
- * 数据源
187
- */
188
- export interface STData {
189
- /**
190
- * Select or radio button `checked` status value
191
- *
192
- * 选择框或单选框状态值
193
- */
194
- checked?: boolean;
195
- /**
196
- * Select or radio button `disabled` status value
197
- *
198
- * 选择框或单选框 `disabled` 值
199
- */
200
- disabled?: boolean;
201
- /**
202
- * Whether to expand the status value
203
- *
204
- * 是否展开状态
205
- */
206
- expand?: boolean;
207
- /**
208
- * Whether show expand icon
209
- *
210
- * 是否显示展开按钮
211
- */
212
- showExpand?: boolean;
213
- /**
214
- * Class name of the row
215
- *
216
- * 行样式
217
- */
218
- className?: string;
219
- [key: string]: any;
220
- }
221
- /**
222
- * 列描述
223
- */
224
- export interface STColumn<T extends STData = any> {
225
- /**
226
- * 用于定义数据源主键,例如:`statistical`
227
- */
228
- key?: string;
229
- /**
230
- * 列标题
231
- */
232
- title?: string | STColumnTitle;
233
- /**
234
- * 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法,例如:
235
- * - `id` (需要指定类型才能智能提示)
236
- * - `price.market`
237
- * - `[ 'price', 'market' ]`
238
- */
239
- index?: keyof T | (string & {
240
- _?: never;
241
- }) | string[] | null;
242
- /**
243
- * 类型
244
- * - `no` 行号,计算规则:`index + noIndex`
245
- * - `checkbox` 多选
246
- * - `radio` 单选
247
- * - `link` 链接,务必指定 `click`
248
- * - `badge` [徽标](https://ng.ant.design/components/badge/zh),务必指定 `badge` 参数配置徽标对应值
249
- * - `tag` [标签](https://ng.ant.design/components/tag/zh),务必指定 `tag` 参数配置标签对应值
250
- * - `enum` 枚举转换,务必指定 `enum` 参数配置标签对应值
251
- * - `img` 图片且居中(若 `className` 存在则优先)
252
- * - `number` 数字且居右(若 `className` 存在则优先)
253
- * - `currency` 货币且居右(若 `className` 存在则优先)
254
- * - `date` 日期格式且居中(若 `className` 存在则优先),使用 `dateFormat` 自定义格式
255
- * - `yn` 将`boolean`类型徽章化 [document](https://ng-alain.com/docs/data-render#yn)
256
- * - `cell` 可指定 `click`,使用 `cell` 组件渲染 [document](https://ng-alain.com/components/cell)
257
- * - `widget` 使用自定义小部件动态创建
258
- */
259
- type?: '' | 'checkbox' | 'link' | 'badge' | 'tag' | 'enum' | 'radio' | 'img' | 'currency' | 'number' | 'date' | 'yn' | 'no' | 'cell' | 'widget';
260
- /**
261
- * `cell` component options
262
- *
263
- * `cell` 组件配置项
264
- */
265
- cell?: CellOptions | ((record: T, column: STColumn) => CellOptions);
266
- /**
267
- * 链接回调,若返回一个字符串表示导航URL会自动触发 `router.navigateByUrl`
268
- */
269
- click?: (record: T, instance?: STComponent) => any;
270
- /**
271
- * 按钮组
272
- */
273
- buttons?: Array<STColumnButton<T>>;
274
- /**
275
- * Max button option can be showed, and the extra part are auto generated under `more`
276
- *
277
- * 配置最多显示多少个按钮,多余部分自动生成至 `更多` 下面
278
- *
279
- * > 注意:若在 `buttons` 下配置过按钮组会导致其失效
280
- */
281
- maxMultipleButton?: STColumnMaxMultipleButton | number;
282
- /**
283
- * 自定义渲染ID
284
- *
285
- * @example
286
- * <ng-template st-row="custom" let-item let-index="index" let-column="column">
287
- * {{ c.title }}
288
- * </ng-template>
289
- */
290
- render?: string | TemplateRef<void> | TemplateRef<{
291
- $implicit: T;
292
- index: number;
293
- }>;
294
- /**
295
- * 标题自定义渲染ID
296
- *
297
- * @example
298
- * <ng-template st-row="custom" type="title" let-c>
299
- * {{ item | json }}
300
- * </ng-template>
301
- */
302
- renderTitle?: string | TemplateRef<void> | TemplateRef<{
303
- $implicit: STColumn;
304
- index: number;
305
- }>;
306
- /**
307
- * 列宽(数字型表示 `px` 值),例如:`100`、`10%`、`100px`
308
- *
309
- * **注意:** 若固定列必须是数字
310
- */
311
- width?: string | number;
312
- /**
313
- * 排序配置项,远程数据配置**优先**规则:
314
- * - `true` 表示允许排序,且若数据源为本地时自动生成 `compare: (a, b) => a[index] - b[index]` 方法
315
- * - `string` 表示远程数据排序相对应 `key` 值
316
- */
317
- sort?: true | string | STColumnSort<T>;
318
- /**
319
- * 过滤配置项
320
- */
321
- filter?: STColumnFilter<T>;
322
- /**
323
- * 格式化列值
324
- */
325
- format?: (item: T, col: STColumn, index: number) => string;
326
- /**
327
- * Safe rendering type, default: `safeHtml`, Support [global config](https://ng-alain.com/docs/global-config)
328
- *
329
- * 安全渲染方式,默认:`safeHtml`,支持[全局配置](https://ng-alain.com/docs/global-config/zh)
330
- */
331
- safeType?: STColumnSafeType;
332
- /**
333
- * 自定义全/反选选择项
334
- */
335
- selections?: Array<STColumnSelection<T>>;
336
- /**
337
- * 列 `class` 属性值(注:无须 `.` 点)多个用空格隔开,例如:
338
- * - `text-center` 居中
339
- * - `text-right` 居右
340
- * - `text-success` 成功色
341
- * - `text-error` 异常色
342
- */
343
- className?: NgClassType;
344
- /**
345
- * Table cell supports `colSpan` and `rowSpan`. When each of them is set to 0, the cell will not be rendered.
346
- *
347
- * 表格支持行/列合并,若返回的 `colSpan` 或者 `rowSpan` 设值为 0 时表示不会渲染
348
- */
349
- onCell?: (item: T, index: number) => STOnCellResult;
350
- /**
351
- * 数字格式,`type=number` 有效
352
- */
353
- numberDigits?: string;
354
- /**
355
- * 日期格式,`type=date` 有效,(默认:`yyyy-MM-dd HH:mm`)
356
- */
357
- dateFormat?: string;
358
- /**
359
- * Currency format option, `type=currency` is valid, pls refer of [CurrencyService.commas](https://ng-alain.com/util/format/#commas).
360
- *
361
- * 货币格式选项,`type=currency` 有效。
362
- */
363
- currency?: STcolumnCurrency;
364
- /**
365
- * 当 `type=yn` 有效
366
- */
367
- yn?: STColumnYn;
368
- /**
369
- * 是否允许导出,默认 `true`
370
- */
371
- exported?: boolean;
372
- /**
373
- * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
374
- */
375
- acl?: ACLCanType;
376
- /** 当不存在数据时以默认值替代 */
377
- default?: string;
378
- /**
379
- * 固定前后列,当指定时务必指定 `width` 否则视为无效,有若干 **注意:** 项:
380
- *
381
- * - 若列头与内容不对齐或出现列重复,请指定列的宽度 `width`
382
- * - 建议指定 `scroll.x` 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 `scroll.x`
383
- */
384
- fixed?: 'left' | 'right';
385
- /**
386
- * 徽标配置项
387
- */
388
- badge?: STColumnBadge | null;
389
- /**
390
- * 标签配置项
391
- */
392
- tag?: STColumnTag | null;
393
- /**
394
- * 行号索引,默认:`1`
395
- * - 计算规则为:`index + noIndex`
396
- * - 支持自定义方法
397
- */
398
- noIndex?: number | ((item: T, col: STColumn, idx: number) => number);
399
- /**
400
- * 条件表达式
401
- * - 仅赋值 `columns` 时执行一次
402
- * - 可调用 `resetColumns()` 再一次触发
403
- */
404
- iif?: (item: STColumn<T>) => boolean;
405
- /**
406
- * 统计列数据
407
- * - 若使用自定义统计函数可无须指定 `index`
408
- * - 可以根据 `key` 来定义生成后需要的键名,如果未指定 `key` 则使用 `index` 来表示键名
409
- * - 当无法找到有效键名时,使用下标(从 `0` 开始)来代替
410
- */
411
- statistical?: STStatisticalType | STStatistical<T>;
412
- widget?: STWidgetColumn<T>;
413
- enum?: {
414
- [key: string]: string;
415
- [key: number]: string;
416
- };
417
- /**
418
- * 分组表头
419
- */
420
- children?: Array<STColumn<T>>;
421
- colSpan?: number;
422
- rowSpan?: number;
423
- /**
424
- * 调整表头配置
425
- * - 注意:**不要忘记**在 `src/styles` 下增加 `nz-resizable` Less 样式文件:`@import 'ng-zorro-antd/resizable/style/entry.less';`
426
- * - **不支持多表头**
427
- */
428
- resizable?: STResizable | boolean;
429
- }
430
- export interface STWidgetColumn<T extends STData = any> {
431
- type: string;
432
- params?: (options: {
433
- record: T;
434
- column: STColumn;
435
- }) => Record<string, unknown>;
436
- }
437
- export interface STColumnTitle {
438
- [key: string]: any;
439
- /**
440
- * Text of header, can be choose one of `text` or `i18n`
441
- */
442
- text?: string;
443
- /**
444
- * I18n key of header, can be choose one of `text` or `i18n`
445
- */
446
- i18n?: string;
447
- /**
448
- * Optional information of header
449
- */
450
- optional?: string;
451
- /**
452
- * Optional help of header
453
- */
454
- optionalHelp?: string;
455
- }
456
- export type STStatisticalType = 'count' | 'distinctCount' | 'sum' | 'average' | 'max' | 'min';
457
- export type STStatisticalFn<T extends STData = any> = (values: number[], col: STColumn, list: T[], rawData?: any) => STStatisticalResult;
458
- export interface STStatistical<T extends STData = any> {
459
- type: STStatisticalType | STStatisticalFn<T>;
460
- /**
461
- * 保留小数位数,默认:`2`
462
- */
463
- digits?: number;
464
- /**
465
- * 是否需要货币格式化,默认以下情况为 `true`
466
- * - `type` 为 `STStatisticalFn`、 `sum`、`average`、`max`、`min`
467
- */
468
- currency?: boolean;
469
- }
470
- export interface STStatisticalResults {
471
- [key: string]: STStatisticalResult;
472
- [index: number]: STStatisticalResult;
473
- }
474
- export interface STStatisticalResult {
475
- value: number;
476
- text?: string;
477
- }
478
- export interface STColumnSort<T extends STData = any> {
479
- /**
480
- * 排序的默认受控属性
481
- */
482
- default?: 'ascend' | 'descend' | null;
483
- /**
484
- * 本地数据的排序函数,使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction)
485
- * - `null` 忽略本地排序,但保持排序功能
486
- * - 若数据源为本地时自动生成 `(a, b) => a[index] - b[index]` 方法
487
- */
488
- compare?: ((a: T, b: T) => number) | null;
489
- /**
490
- * 远程数据的排序时后端相对应的KEY,默认使用 `index` 属性
491
- * - 若 `multiSort: false` 时:`key: 'name' => ?name=1&pi=1`
492
- * - 若 `multiSort: true` 允许多个排序 key 存在,或使用 `STMultiSort` 指定多列排序key合并规则
493
- */
494
- key?: string | null;
495
- /**
496
- * 远程数据的排序时后端相对应的VALUE
497
- * - `{ ascend: '0', descend: '1' }` 结果 `?name=1&pi=1`
498
- * - `{ ascend: 'asc', descend: 'desc' }` 结果 `?name=desc&pi=1`
499
- */
500
- reName?: {
501
- ascend?: string;
502
- descend?: string;
503
- };
504
- }
505
- export interface STSortMap<T extends STData = any> extends STColumnSort<T> {
506
- [key: string]: any;
507
- /** 是否启用排序 */
508
- enabled?: boolean;
509
- }
510
- export interface STColumnFilter<T extends STData = any> {
511
- /**
512
- * 搜索方式
513
- * - `defualt` 默认形式
514
- * - `keyword` 文本框形式
515
- * - `number` 数字框形式
516
- * - `date` 日期形式
517
- * - `custom` 自定义模式,需设置 [custom] 参数
518
- */
519
- type?: 'default' | 'keyword' | 'number' | 'date' | 'custom';
520
- /**
521
- * 表头的筛选菜单项,至少一项才会生效
522
- * - 当 `type` 为 `keyword` `custom` 时可为空
523
- */
524
- menus?: STColumnFilterMenu[];
525
- /**
526
- * 本地数据的筛选函数
527
- */
528
- fn?: ((filter: STColumnFilterMenu, record: T) => boolean) | null;
529
- /**
530
- * 标识数据是否已过滤,筛选图标会高亮
531
- */
532
- default?: boolean;
533
- /**
534
- * 自定义 filter 图标
535
- * - 当 `type='default'` 默认 `filter`
536
- * - 当 `type='keyword'` 默认 `search`
537
- */
538
- icon?: string | STIcon;
539
- /**
540
- * 确认按钮文本,默认 `确认`
541
- */
542
- confirmText?: string;
543
- /**
544
- * 清除按钮文本,默认 `重置`
545
- */
546
- clearText?: string;
547
- /**
548
- * 是否多选,默认 `true`
549
- */
550
- multiple?: boolean;
551
- /**
552
- * 远程数据的过滤时后端相对应的KEY,默认使用 `index` 属性
553
- * `key: 'name'` 结果 `?name=1&pi=1`
554
- */
555
- key?: string | null;
556
- /**
557
- * 远程数据的过滤时后端相对应的VALUE
558
- * - 默认当 `multiple: true` 时以英文逗号拼接的字符串
559
- *
560
- * @return 返回为 Object 对象
561
- */
562
- reName?: (list: STColumnFilterMenu[], col: STColumn) => Record<string, unknown>;
563
- /**
564
- * 自定义过滤器,请参考 [Custom Data](https://ng-alain.com/components/st/en?#components-st-custom-data) 示例。
565
- */
566
- custom?: TemplateRef<{
567
- $implicit: STColumnFilter;
568
- col: STColumn;
569
- handle: STColumnFilterHandle;
570
- }>;
571
- /**
572
- * Whether to display the operation area, default: `true`
573
- *
574
- * 是否显示操作区域,默认:`true`
575
- */
576
- showOPArea?: boolean;
577
- /**
578
- * 在文字框中显示提示讯息
579
- */
580
- placeholder?: string;
581
- number?: {
582
- precision?: number;
583
- min?: number;
584
- max?: number;
585
- step?: number;
586
- };
587
- date?: {
588
- range?: boolean;
589
- mode?: 'year' | 'month' | 'week' | 'date';
590
- showToday?: boolean;
591
- showNow?: boolean;
592
- disabledDate?: (d: Date) => boolean;
593
- disabledTime?: DisabledTimeFn;
594
- };
595
- }
596
- export interface STColumnFilterHandle {
597
- /**
598
- * Close pannel, if `result` is set, it will trigger confirm or reset action
599
- *
600
- * 关闭面板,当指定 `result` 时会触发确认或重置动作
601
- */
602
- close: (result?: boolean) => void;
603
- /**
604
- * Trigger confirm (You can call `close` to close the panel)
605
- *
606
- * 触发确认(可以调用 `close` 来关闭面板)
607
- */
608
- confirm: () => STColumnFilterHandle;
609
- /**
610
- * Trigger reset (You can call `close` to close the panel)
611
- *
612
- * 触发重置(可以调用 `close` 来关闭面板)
613
- */
614
- reset: () => STColumnFilterHandle;
615
- }
616
- export interface STColumnFilterMenu {
617
- /**
618
- * 文本
619
- * - 当 `type: 'keyword'` 时表示 `placeholder`
620
- */
621
- text?: string;
622
- /**
623
- * 值
624
- */
625
- value?: any;
626
- /**
627
- * 是否选中
628
- */
629
- checked?: boolean;
630
- /**
631
- * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
632
- */
633
- acl?: ACLCanType;
634
- [key: string]: any;
635
- }
636
- export interface STColumnSelection<T extends STData = any> {
637
- /**
638
- * 选择项显示的文字
639
- */
640
- text: string;
641
- /**
642
- * 选择项点击回调,允许对参数 `data.checked` 进行操作
643
- */
644
- select: (data: T[]) => void;
645
- /** 权限,等同 `can()` 参数值 */
646
- acl?: ACLCanType;
647
- }
648
- export interface STcolumnCurrency {
649
- /**
650
- * See [CurrencyService.commas](https://ng-alain.com/util/format/en#format)
651
- */
652
- format?: CurrencyFormatOptions;
653
- }
654
- /** 当 `type=yn` 有效 */
655
- export interface STColumnYn {
656
- /**
657
- * 真值条件,(默认:`true`)
658
- */
659
- truth?: any;
660
- /**
661
- * 徽章 `true` 时文本,(默认:`是`)
662
- */
663
- yes?: string;
664
- /**
665
- * 徽章 `false` 时文本,(默认:`否`)
666
- */
667
- no?: string;
668
- /**
669
- * 徽章显示风格
670
- * - `full` 图标和文本
671
- * - `icon` 图标
672
- * - `text` 文本
673
- */
674
- mode?: YNMode;
675
- }
676
- export interface STIcon {
677
- /** 图标类型 */
678
- type: string;
679
- /** 图标主题风格,默认:`outline` */
680
- theme?: ThemeType;
681
- /** 是否有旋转动画,默认:`false` */
682
- spin?: boolean;
683
- /** 仅适用双色图标,设置双色图标的主要颜色,仅对当前 icon 生效 */
684
- twoToneColor?: string;
685
- /** 指定来自 IconFont 的图标类型 */
686
- iconfont?: string;
687
- }
688
- /**
689
- * 按钮配置
690
- */
691
- export interface STColumnButton<T extends STData = any> {
692
- /**
693
- * 文本
694
- */
695
- text?: string | ((record: T, btn: STColumnButton<T>) => string);
696
- /**
697
- * 文本 i18n
698
- */
699
- i18n?: string;
700
- /**
701
- * 图标
702
- */
703
- icon?: string | STIcon | ((record: T, btn: STColumnButton<T>) => STIcon | null | undefined);
704
- /**
705
- * 按钮类型
706
- * - `none` 无任何互动
707
- * - `del` 删除,默认开启 `pop: true`
708
- * - `modal` 对话框,需要指定 `component` 才会生效
709
- * - `static` 静态对话框,需要指定 `component` 才会生效
710
- * - `drawer` 抽屉,需要指定 `component` 才会生效
711
- * - `link` 链接,当 `click` 返回字符串时自动调用 `navigateByUrl` 导航
712
- * - `divider` 分割线
713
- */
714
- type?: 'none' | 'del' | 'modal' | 'static' | 'drawer' | 'link' | 'divider';
715
- /**
716
- * 点击回调
717
- * - Function
718
- * - `type=modal` 只会在当有传回值时才会触发回调
719
- * - reload:重新刷新当前页
720
- * - load:重新加载数据,并重置页码为:`1`
721
- *
722
- * @todo Bad parameter design
723
- */
724
- click?: 'reload' | 'load' | ((record: T, modal?: any, instance?: STComponent) => any);
725
- /**
726
- * 气泡确认框参数,若 `string` 类型表示标题
727
- */
728
- pop?: boolean | string | STColumnButtonPop;
729
- /**
730
- * 对话框参数
731
- */
732
- modal?: STColumnButtonModal;
733
- /**
734
- * 抽屉参数
735
- */
736
- drawer?: STColumnButtonDrawer;
737
- /**
738
- * 下拉菜单,当存在时以 `dropdown` 形式渲染
739
- * - 只支持一级
740
- */
741
- children?: Array<STColumnButton<T>>;
742
- /**
743
- * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
744
- */
745
- acl?: ACLCanType;
746
- /**
747
- * Conditional expression
748
- *
749
- * @todo Bad parameter design
750
- */
751
- iif?: (item: T, btn: STColumnButton<T>, column: STColumn) => boolean;
752
- /**
753
- * Conditional expression rendering behavior, can be set to `hide` (default) or `disabled`
754
- */
755
- iifBehavior?: IifBehaviorType;
756
- tooltip?: string;
757
- /**
758
- * 按钮 `class` 属性值(注:无须 `.` 点)多个用空格隔开,例如:
759
- * - `text-success` 成功色
760
- * - `text-error` 错误色
761
- */
762
- className?: NgClassType | ((record: T, btn: STColumnButton<T>) => NgClassType | null | undefined);
763
- [key: string]: any;
764
- }
765
- export interface STColumnMaxMultipleButton {
766
- /**
767
- * 更多按钮文本,默认:`更多`
768
- */
769
- text?: string;
770
- /**
771
- * 超出数量自动合并,默认:`2`
772
- */
773
- count?: number;
774
- }
775
- export type IifBehaviorType = 'hide' | 'disabled';
776
- export interface STColumnButtonModal<T extends STData = any> extends ModalHelperOptions {
777
- /**
778
- * 对话框组件对象
779
- */
780
- component?: any;
781
- /**
782
- * 对话框参数
783
- */
784
- params?: (record: T) => Record<string, unknown>;
785
- /**
786
- * 对话框目标组件的接收参数名,默认:`record`
787
- */
788
- paramsName?: string;
789
- }
790
- export interface STColumnButtonModalConfig {
791
- /**
792
- * 指定模态框目标组件的接收参数名,默认:`record`
793
- */
794
- paramsName?: string;
795
- /** 大小;例如:lg、600,默认:`lg` */
796
- size?: 'sm' | 'md' | 'lg' | 'xl' | '' | number;
797
- /** 对话框 [ModalOptions](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/modal/modal-types.ts) 参数 */
798
- modalOptions?: ModalOptions;
799
- /** 是否精准(默认:`true`),若返回值非空值(`null`或`undefined`)视为成功,否则视为错误 */
800
- exact?: boolean;
801
- }
802
- export interface STColumnButtonDrawer<T extends STData = any> extends DrawerHelperOptions {
803
- /**
804
- * 标题
805
- */
806
- title?: string;
807
- /**
808
- * 抽屉组件对象
809
- */
810
- component?: any;
811
- /**
812
- * 抽屉参数
813
- */
814
- params?: (record: T) => Record<string, unknown>;
815
- /**
816
- * 抽屉目标组件的接收参数名,默认:`record`
817
- */
818
- paramsName?: string;
819
- }
820
- export interface STColumnButtonDrawerConfig {
821
- /**
822
- * 抽屉目标组件的接收参数名,默认:`record`
823
- */
824
- paramsName?: string;
825
- /**
826
- * 大小;例如:lg、600,默认:`md`
827
- *
828
- * | 类型 | 默认大小 |
829
- * | --- | ------ |
830
- * | `sm` | `300` |
831
- * | `md` | `600` |
832
- * | `lg` | `900` |
833
- * | `xl` | `1200` |
834
- *
835
- * > 以上值,可通过覆盖相应的LESS参数自行调整
836
- */
837
- size?: 'sm' | 'md' | 'lg' | 'xl' | number;
838
- /**
839
- * 是否包含底部工具条,默认:`true`
840
- */
841
- footer?: boolean;
842
- /**
843
- * 底部工具条高度,默认:`55`
844
- */
845
- footerHeight?: number;
846
- /** 抽屉 [NzDrawerOptions](https://ng.ant.design/components/drawer/zh#nzdraweroptions) 参数 */
847
- drawerOptions?: NzDrawerOptions;
848
- }
849
- export interface STColumnButtonPop<T extends STData = any> {
850
- /**
851
- * Title of the popover, default: `确认删除吗?`
852
- */
853
- title?: string;
854
- titleI18n?: string;
855
- /**
856
- * Popover trigger mode, default: `click`
857
- */
858
- trigger?: 'click' | 'focus' | 'hover';
859
- /**
860
- * The position of the popover relative to the target, default: `top`
861
- */
862
- placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
863
- /**
864
- * Class name of the popover card
865
- */
866
- overlayClassName?: string;
867
- /**
868
- * Style of the popover card
869
- */
870
- overlayStyle?: NgStyleInterface;
871
- /**
872
- * Text of the Cancel button
873
- */
874
- cancelText?: string;
875
- cancelTextI18n?: string;
876
- /**
877
- * Text of the Confirm button
878
- */
879
- okText?: string;
880
- okTextI18n?: string;
881
- /**
882
- * Button `type` of the Confirm button
883
- */
884
- okType?: 'primary' | 'ghost' | 'dashed' | 'danger' | 'default';
885
- /**
886
- * Customize icon of confirmation
887
- */
888
- icon?: string;
889
- /**
890
- * Whether to directly emit `onConfirm` without showing Popconfirm, default: `() => false`
891
- */
892
- condition?: (item: T) => boolean;
893
- }
894
- export interface STReqReNameType {
895
- pi?: string;
896
- ps?: string;
897
- skip?: string;
898
- limit?: string;
899
- }
900
- export interface STResReNameType {
901
- total?: string | string[];
902
- list?: string | string[];
903
- }
904
- export interface STExportOptions<T extends STData = any> {
905
- /**
906
- * Specify the currently exported data, default the current table data
907
- */
908
- data?: T[];
909
- /**
910
- * Specify the currently exported column configuration, default the current table data
911
- */
912
- columens?: STColumn[];
913
- /** 工作溥名 */
914
- sheetname?: string;
915
- /** 文件名 */
916
- filename?: string;
917
- /** triggers when saveas */
918
- callback?: (wb: any) => void;
919
- }
920
- /**
921
- * 单排序规则
922
- * - 若不指定,则返回:`columnName=ascend|descend`
923
- * - 若指定,则返回:`sort=columnName.(ascend|descend)`
924
- */
925
- export interface STSingleSort {
926
- /** 请求参数名,默认:`sort` */
927
- key?: string;
928
- /** 列名与状态间分隔符,默认:`.` */
929
- nameSeparator?: string;
930
- }
931
- /**
932
- * 多排序相同排序 key 时合并规则
933
- */
934
- export interface STMultiSort {
935
- /** 请求参数名,默认:`sort` */
936
- key?: string;
937
- /** 不同属性间分隔符,默认:`-` */
938
- separator?: string;
939
- /** 列名与状态间分隔符,默认:`.` */
940
- nameSeparator?: string;
941
- /**
942
- * 是否以数组的形式传递参数,默认:`false`
943
- * - `true` 表示使用 `url?sort=name.asc&sort=age.desc` 形式
944
- * - `false` 表示使用 `url?sort=name.asc-age.desc` 形式
945
- */
946
- arrayParam?: boolean;
947
- /**
948
- * 是否保持空值的键名,默认:`true`
949
- * - `true` 表示不管是否有排序都会发送 `key` 键名
950
- * - `false` 表示无排序动作时不会发送 `key` 键名
951
- */
952
- keepEmptyKey?: boolean;
953
- /**
954
- * ## 仅限全局配置项有效
955
- *
956
- * 是否全局多排序模式,默认:`true`
957
- * - `true` 表示所有 `st` 默认为多排序
958
- * - `false` 表示需要为每个 `st` 添加 `multiSort` 才会视为多排序模式
959
- */
960
- global?: boolean;
961
- }
962
- export type STMultiSortResultType = Record<string, string | string[]>;
963
- /**
964
- * 徽标信息
965
- */
966
- export interface STColumnBadge {
967
- [key: number]: STColumnBadgeValue;
968
- [key: string]: STColumnBadgeValue;
969
- }
970
- export interface STColumnBadgeValue {
971
- /**
972
- * 文本
973
- */
974
- text?: string;
975
- /**
976
- * 徽标颜色值
977
- */
978
- color?: 'success' | 'processing' | 'default' | 'error' | 'warning';
979
- /**
980
- * Text popup tip
981
- *
982
- * 文字提示
983
- */
984
- tooltip?: string;
985
- }
986
- /**
987
- * 标签信息
988
- */
989
- export interface STColumnTag {
990
- [key: number]: STColumnTagValue;
991
- [key: string]: STColumnTagValue;
992
- }
993
- export interface STColumnTagValue {
994
- /**
995
- * 文本
996
- */
997
- text?: string;
998
- /**
999
- * 颜色值,支持预设和色值
1000
- * - 预设:geekblue,blue,purple,success,red,volcano,orange,gold,lime,green,cyan
1001
- * - 色值:#f50,#ff0
1002
- */
1003
- color?: 'geekblue' | 'blue' | 'purple' | 'success' | 'red' | 'volcano' | 'orange' | 'gold' | 'lime' | 'green' | 'cyan' | string;
1004
- /**
1005
- * Text popup tip
1006
- *
1007
- * 文字提示
1008
- */
1009
- tooltip?: string;
1010
- }
1011
- export type STChangeType = 'loaded' | 'pi' | 'ps' | 'checkbox' | 'radio' | 'sort' | 'filter' | 'filterChange' | 'click' | 'dblClick' | 'expand' | 'resize';
1012
- /**
1013
- * 回调数据
1014
- */
1015
- export interface STChange<T extends STData = any> {
1016
- /**
1017
- * 回调类型
1018
- */
1019
- type: STChangeType;
1020
- /**
1021
- * 当前页码
1022
- */
1023
- pi: number;
1024
- /**
1025
- * 每页数量
1026
- */
1027
- ps: number;
1028
- /**
1029
- * 数据总量
1030
- */
1031
- total: number;
1032
- /**
1033
- * `loaded` 参数
1034
- */
1035
- loaded?: T[];
1036
- /**
1037
- * `checkbox` 参数
1038
- */
1039
- checkbox?: T[];
1040
- /**
1041
- * `radio` 参数
1042
- */
1043
- radio?: T;
1044
- /**
1045
- * 排序参数
1046
- */
1047
- sort?: STChangeSort;
1048
- /**
1049
- * 过滤参数
1050
- */
1051
- filter?: STColumn;
1052
- /**
1053
- * 行点击参数
1054
- */
1055
- click?: STChangeRowClick<T>;
1056
- /**
1057
- * 行双击参数
1058
- */
1059
- dblClick?: STChangeRowClick<T>;
1060
- /**
1061
- * `expand` 参数
1062
- */
1063
- expand?: T;
1064
- /**
1065
- * `resize` 参数
1066
- */
1067
- resize?: STColumn;
1068
- /**
1069
- * `filterChange` 参数,支持 `keyword`、`radio`、`checkbox` 三种类型的数据
1070
- */
1071
- filterChange?: unknown;
1072
- }
1073
- /** 行单击参数 */
1074
- export interface STChangeSort {
1075
- value?: 'ascend' | 'descend';
1076
- map?: Record<string, string>;
1077
- column?: STColumn;
1078
- }
1079
- /** 行单击参数 */
1080
- export interface STChangeRowClick<T extends STData = any> {
1081
- e?: Event;
1082
- item?: T;
1083
- index?: number;
1084
- }
1085
- export interface STError {
1086
- type?: 'req';
1087
- error?: any;
1088
- }
1089
- export type STRowClassName<T extends STData = any> = (record: T, index: number) => string;
1090
- export type STClickRowClassName<T extends STData = any> = string | STClickRowClassNameType<T>;
1091
- export interface STClickRowClassNameType<T extends STData = any> {
1092
- fn: (record: T, index: number) => string;
1093
- /**
1094
- * Whether mutually exclusive, default: `false`
1095
- *
1096
- * 是否互斥,默认:`false`
1097
- */
1098
- exclusive?: boolean;
1099
- }
1100
- export interface STColumnGroupType {
1101
- column: STColumn;
1102
- colStart: number;
1103
- colEnd?: number;
1104
- colSpan?: number;
1105
- rowSpan?: number;
1106
- hasSubColumns?: boolean;
1107
- }
1108
- export interface STResizable {
1109
- /**
1110
- * Disable resize, Default: `true`
1111
- */
1112
- disabled?: boolean;
1113
- /**
1114
- * Specifies resize boundaries, Default: `window`
1115
- */
1116
- bounds?: 'window' | 'parent' | ElementRef<HTMLElement>;
1117
- /**
1118
- * Maximum width of resizable elemen, Default: `60`
1119
- */
1120
- maxWidth?: number;
1121
- /**
1122
- * Minimum width of resizable element, Default: `360`
1123
- */
1124
- minWidth?: number;
1125
- /**
1126
- * Enable preview when resizing, Default: `true`
1127
- */
1128
- preview?: boolean;
1129
- }
1130
- export type STContextmenuFn<T extends STData = any> = (options: STContextmenuOptions<T>) => Observable<STContextmenuItem[]> | STContextmenuItem[];
1131
- export interface STContextmenuOptions<T extends STData = any> {
1132
- event: MouseEvent;
1133
- /**
1134
- * Contextmenu position
1135
- */
1136
- type: 'head' | 'body';
1137
- column: STColumn;
1138
- data: T | null;
1139
- /**
1140
- * Row index, when `type === 'body'` valid
1141
- *
1142
- * 所在行下标,当 `type === 'body'` 时有效
1143
- */
1144
- rowIndex: number | null;
1145
- /**
1146
- * Column index
1147
- *
1148
- * 所在列下标
1149
- */
1150
- colIndex: number;
1151
- }
1152
- export interface STContextmenuItem {
1153
- key?: string;
1154
- /**
1155
- * Text of the context menu item
1156
- */
1157
- text: string;
1158
- fn?: (item: STContextmenuItem) => void;
1159
- /**
1160
- * Only supports one level
1161
- *
1162
- * 只支持一级
1163
- */
1164
- children?: STContextmenuItem[];
1165
- [key: string]: any;
1166
- }
1167
- export interface STCustomRequestOptions {
1168
- method: string;
1169
- url: string;
1170
- options: STRequestOptions;
1171
- }
1172
- export interface STOnCellResult {
1173
- rowSpan?: number | null;
1174
- colSpan?: number | null;
1175
- }
1176
- export interface STDragOptions {
1177
- /**
1178
- * Emits when the user drops an item inside the container, default: `moveItemInArray()`
1179
- */
1180
- dropped?: (e: CdkDragDrop<any, any, any>) => void;
1181
- /**
1182
- * Emits when the user has moved a new drag item into this container.
1183
- */
1184
- entered?: (e: CdkDragEnter<any>) => void;
1185
- /**
1186
- * Emits when the user removes an item from the container by dragging it into another container.
1187
- */
1188
- exited?: (e: CdkDragExit<any>) => void;
1189
- /**
1190
- * Emits as the user is swapping items while actively dragging.
1191
- */
1192
- sorted?: (e: CdkDragSortEvent<any>) => void;
1193
- }