@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
package/st/index.d.ts CHANGED
@@ -1,5 +1,1710 @@
1
+ import { CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent } from '@angular/cdk/drag-drop';
2
+ import { HttpHeaders, HttpParams } from '@angular/common/http';
3
+ import * as i0 from '@angular/core';
4
+ import { TemplateRef, AfterViewInit, OnChanges, EventEmitter, TrackByFunction, SimpleChange, SimpleChanges, ElementRef, OnInit, EnvironmentProviders } from '@angular/core';
5
+ import { Observable } from 'rxjs';
6
+ import { ThemeType } from '@ant-design/icons-angular';
7
+ import { CellOptions } from '@delon/abc/cell';
8
+ import { ACLCanType } from '@delon/acl';
9
+ import * as _delon_theme from '@delon/theme';
10
+ import { ModalHelperOptions, DrawerHelperOptions, YNMode, _HttpClient, DatePipe, YNPipe } from '@delon/theme';
11
+ import { CurrencyFormatOptions, CurrencyService } from '@delon/util/format';
12
+ import { NgClassType, NzSafeAny, NgStyleInterface } from 'ng-zorro-antd/core/types';
13
+ import { DisabledTimeFn } from 'ng-zorro-antd/date-picker';
14
+ import { NzDrawerOptions } from 'ng-zorro-antd/drawer';
15
+ import { ModalOptions } from 'ng-zorro-antd/modal';
16
+ import { PaginationItemRenderContext } from 'ng-zorro-antd/pagination';
17
+ import { NzTableComponent, NzTableSortOrder, NzTablePaginationType } from 'ng-zorro-antd/table';
18
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
19
+ import { AlainSTConfig } from '@delon/util/config';
20
+ import { NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
21
+ import { NzResizeEvent } from 'ng-zorro-antd/resizable';
22
+ import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
23
+ import { DecimalPipe } from '@angular/common';
24
+ import { XlsxExportResult } from '@delon/abc/xlsx';
25
+
1
26
  /**
2
- * Generated bundle index. Do not edit.
27
+ * @inner
3
28
  */
4
- /// <amd-module name="@delon/abc/st" />
5
- export * from './public_api';
29
+ type _STTdNotifyType = 'checkbox' | 'radio';
30
+ /**
31
+ * @inner
32
+ */
33
+ interface _STTdNotify {
34
+ type: _STTdNotifyType;
35
+ item: STData;
36
+ col: _STColumn;
37
+ }
38
+ /**
39
+ * @inner
40
+ */
41
+ interface _STColumn extends STColumn {
42
+ children?: _STColumn[];
43
+ indexKey?: string;
44
+ /**
45
+ * 是否需要截短行为
46
+ * - `type: 'img'` 强制非必要
47
+ */
48
+ _isTruncate?: boolean;
49
+ /**
50
+ * 校验需要未自定义 `className` 时应检查 `_isTruncate` 是否需要截短行为
51
+ */
52
+ _className?: string | string[] | Set<string> | Record<string, any> | null;
53
+ _sort: STSortMap;
54
+ _width?: number;
55
+ _left: string | boolean;
56
+ _right: string | boolean;
57
+ __renderTitle?: TemplateRef<any>;
58
+ __render?: TemplateRef<any>;
59
+ }
60
+ /**
61
+ * @inner
62
+ */
63
+ interface _STHeader {
64
+ /**
65
+ * 是否有子列
66
+ */
67
+ hasSubColumns: boolean;
68
+ colSpan: number;
69
+ rowSpan: number;
70
+ column: _STColumn;
71
+ }
72
+ /**
73
+ * @inner
74
+ */
75
+ interface _STColumnButton<T extends STData = any> extends STColumnButton<T> {
76
+ _text?: string;
77
+ _className?: NgClassType | null;
78
+ /**
79
+ * 图标
80
+ */
81
+ _icon?: STIcon | null;
82
+ children?: Array<_STColumnButton<T>>;
83
+ }
84
+ /**
85
+ * @inner
86
+ */
87
+ interface _STDataValue {
88
+ text: string;
89
+ _text: SafeHtml;
90
+ org?: any;
91
+ color?: string;
92
+ tooltip?: string;
93
+ safeType: STColumnSafeType;
94
+ buttons?: _STColumnButton[];
95
+ props?: STOnCellResult | null;
96
+ cell?: CellOptions;
97
+ }
98
+
99
+ declare class STComponent implements AfterViewInit, OnChanges {
100
+ private readonly i18nSrv;
101
+ private readonly el;
102
+ private readonly cdr;
103
+ private readonly doc;
104
+ private readonly exportSrv;
105
+ private readonly columnSource;
106
+ private readonly dataSource;
107
+ private readonly cms;
108
+ private readonly destroy$;
109
+ private readonly cogSrv;
110
+ private totalTpl;
111
+ private inied;
112
+ cog: AlainSTConfig;
113
+ private _req;
114
+ private _res;
115
+ private _page;
116
+ private _widthMode;
117
+ private customWidthConfig;
118
+ _widthConfig: string[];
119
+ locale: i0.Signal<_delon_theme.STLocaleData>;
120
+ _loading: boolean;
121
+ _data: STData[];
122
+ _statistical: STStatisticalResults;
123
+ _isPagination: boolean;
124
+ _allChecked: boolean;
125
+ _allCheckedDisabled: boolean;
126
+ _indeterminate: boolean;
127
+ _headers: _STHeader[][];
128
+ _columns: _STColumn[];
129
+ contextmenuList: STContextmenuItem[];
130
+ readonly orgTable: NzTableComponent<STData>;
131
+ readonly contextmenuTpl: NzDropdownMenuComponent;
132
+ get req(): STReq;
133
+ set req(value: STReq);
134
+ /** 返回体配置 */
135
+ get res(): STRes;
136
+ set res(value: STRes);
137
+ get page(): STPage;
138
+ set page(value: STPage);
139
+ data?: string | STData[] | Observable<STData[]>;
140
+ delay?: boolean;
141
+ columns?: STColumn[] | null;
142
+ contextmenu?: STContextmenuFn | null;
143
+ ps: number;
144
+ pi: number;
145
+ total: number;
146
+ loading: boolean | null;
147
+ loadingDelay: number;
148
+ loadingIndicator: TemplateRef<void> | null;
149
+ bordered: boolean;
150
+ size: 'small' | 'middle' | 'default';
151
+ scroll: {
152
+ x?: string | null;
153
+ y?: string | null;
154
+ };
155
+ drag: i0.InputSignalWithTransform<STDragOptions | null, unknown>;
156
+ singleSort?: STSingleSort | null;
157
+ private _multiSort?;
158
+ get multiSort(): NzSafeAny;
159
+ set multiSort(value: NzSafeAny);
160
+ rowClassName?: STRowClassName | null;
161
+ clickRowClassName?: STClickRowClassName | null;
162
+ set widthMode(value: STWidthMode);
163
+ get widthMode(): STWidthMode;
164
+ set widthConfig(val: string[]);
165
+ private _resizable?;
166
+ set resizable(val: STResizable | boolean | string);
167
+ header?: string | TemplateRef<void> | null;
168
+ showHeader: boolean;
169
+ footer?: string | TemplateRef<void> | null;
170
+ bodyHeader?: TemplateRef<{
171
+ $implicit: STStatisticalResults;
172
+ }> | null;
173
+ body?: TemplateRef<{
174
+ $implicit: STStatisticalResults;
175
+ }> | null;
176
+ expandRowByClick: boolean;
177
+ expandAccordion: boolean;
178
+ expand: TemplateRef<{
179
+ $implicit: STData;
180
+ index: number;
181
+ }> | null;
182
+ expandIcon: TemplateRef<{
183
+ $implicit: STData;
184
+ index: number;
185
+ }> | null;
186
+ noResult?: string | TemplateRef<void> | null;
187
+ responsive: boolean;
188
+ responsiveHideHeaderFooter?: boolean;
189
+ readonly error: EventEmitter<STError>;
190
+ readonly change: EventEmitter<STChange<any>>;
191
+ virtualScroll: boolean;
192
+ virtualItemSize: number;
193
+ virtualMaxBufferPx: number;
194
+ virtualMinBufferPx: number;
195
+ customRequest?: (options: STCustomRequestOptions) => Observable<NzSafeAny>;
196
+ virtualForTrackBy: TrackByFunction<STData>;
197
+ trackBy: TrackByFunction<STData>;
198
+ /**
199
+ * Get the number of the current page
200
+ */
201
+ get count(): number;
202
+ /**
203
+ * Get the data of the current page
204
+ */
205
+ get list(): STData[];
206
+ get noColumns(): boolean;
207
+ constructor();
208
+ private setCog;
209
+ cd(): this;
210
+ private refreshData;
211
+ renderTotal(total: string, range: string[]): string;
212
+ private changeEmit;
213
+ /**
214
+ * 获取过滤后所有数据
215
+ * - 本地数据:包含排序、过滤后不分页数据
216
+ * - 远程数据:不传递 `pi`、`ps` 两个参数
217
+ */
218
+ get filteredData(): Observable<STData[]>;
219
+ private updateTotalTpl;
220
+ private setLoading;
221
+ private loadData;
222
+ private loadPageData;
223
+ /** 清空所有数据 */
224
+ clear(cleanStatus?: boolean): this;
225
+ /** 清空所有状态 */
226
+ clearStatus(): this;
227
+ /**
228
+ * 根据页码重新加载数据
229
+ *
230
+ * @param pi 指定当前页码,默认:`1`
231
+ * @param extraParams 重新指定 `extraParams` 值
232
+ * @param options 选项
233
+ */
234
+ load(pi?: number, extraParams?: NzSafeAny, options?: STLoadOptions): this;
235
+ /**
236
+ * 重新刷新当前页
237
+ *
238
+ * @param extraParams 重新指定 `extraParams` 值
239
+ */
240
+ reload(extraParams?: NzSafeAny, options?: STLoadOptions): this;
241
+ /**
242
+ * 重置且重新设置 `pi` 为 `1`,包含以下值:
243
+ * - `check` 数据
244
+ * - `radio` 数据
245
+ * - `sort` 数据
246
+ * - `fileter` 数据
247
+ *
248
+ * @param extraParams 重新指定 `extraParams` 值
249
+ */
250
+ reset(extraParams?: NzSafeAny, options?: STLoadOptions): this;
251
+ private _toTop;
252
+ _change(type: 'pi' | 'ps', options?: STLoadOptions): void;
253
+ private closeOtherExpand;
254
+ _rowClick(e: Event, item: STData, index: number, dbl: boolean): void;
255
+ private _clickRowClassName;
256
+ _expandChange(item: STData, expand: boolean): void;
257
+ _stopPropagation(ev: Event): void;
258
+ private _refColAndData;
259
+ /**
260
+ * Add a rows in the table, like this:
261
+ *
262
+ * ```
263
+ * this.st.addRow(stDataItem)
264
+ * ```
265
+ *
266
+ * **TIPS:** Don't change the `total` value, it is recommended to use the `reload` method if needed
267
+ */
268
+ addRow(data: STData | STData[], options?: {
269
+ index?: number;
270
+ }): this;
271
+ /**
272
+ * Remove a row in the table, like this:
273
+ *
274
+ * ```
275
+ * this.st.removeRow(0)
276
+ * this.st.removeRow(stDataItem)
277
+ * ```
278
+ *
279
+ * **TIPS:** Don't change the `total` value, it is recommended to use the `reload` method if needed
280
+ */
281
+ removeRow(data: STData | STData[] | number): this;
282
+ /**
283
+ * Sets the row value for the `index` in the table, like this:
284
+ *
285
+ * - `optinos.refreshSchema` Whether to refresh of st schemas
286
+ * - `optinos.emitReload` Whether to trigger a reload http request when data is url
287
+ *
288
+ * ```
289
+ * this.st.setRow(0, { price: 100 })
290
+ * this.st.setRow(0, { price: 100, name: 'asdf' })
291
+ * this.st.setRow(item, { price: 100 })
292
+ * ```
293
+ */
294
+ setRow(index: number | STData, item: STData, options?: {
295
+ refreshSchema?: boolean;
296
+ emitReload?: boolean;
297
+ /**
298
+ *
299
+ * @param arrayProcessMethod 数组处理方式
300
+ * - `true` 表示替换新值,不管新值为哪种类型
301
+ * - `false` 表示会合并整个数组(将旧数据与新数据合并成新数组)
302
+ */
303
+ arrayProcessMethod?: boolean;
304
+ }): this;
305
+ sort(col: _STColumn, value: NzSafeAny): void;
306
+ clearSort(): this;
307
+ _handleFilter(col: _STColumn, confirm: boolean): void;
308
+ handleFilterNotify(value?: unknown): void;
309
+ clearFilter(): this;
310
+ /** 清除所有 `checkbox` */
311
+ clearCheck(): this;
312
+ private _refCheck;
313
+ checkAll(checked?: boolean): this;
314
+ _rowSelection(row: STColumnSelection): this;
315
+ _checkNotify(): this;
316
+ /** 清除所有 `radio` */
317
+ clearRadio(): this;
318
+ _handleTd(ev: _STTdNotify): void;
319
+ /**
320
+ * 导出当前页,确保已经注册 `XlsxModule`
321
+ *
322
+ * @param newData 重新指定数据;若为 `true` 表示使用 `filteredData` 数据
323
+ * @param opt 额外参数
324
+ */
325
+ export(newData?: STData[] | true, opt?: STExportOptions): void;
326
+ colResize({ width }: NzResizeEvent, column: _STColumn): void;
327
+ onContextmenu(event: MouseEvent): void;
328
+ get cdkVirtualScrollViewport(): CdkVirtualScrollViewport | undefined;
329
+ private _resetColumns;
330
+ resetColumns(options?: STResetColumnsOption): Promise<this>;
331
+ private refreshColumns;
332
+ private optimizeData;
333
+ /**
334
+ * Return pure data, `st` internally maintains a set of data for caching, this part of data may affect the backend
335
+ *
336
+ * 返回纯净数据,`st` 内部会维护一组用于缓存的数据,这部分数据可能会影响后端
337
+ */
338
+ pureItem(itemOrIndex: STData | number): STData | null;
339
+ ngAfterViewInit(): void;
340
+ ngOnChanges(changes: {
341
+ [P in keyof this]?: SimpleChange;
342
+ } & SimpleChanges): void;
343
+ static ɵfac: i0.ɵɵFactoryDeclaration<STComponent, never>;
344
+ static ɵcmp: i0.ɵɵComponentDeclaration<STComponent, "st", ["st"], { "req": { "alias": "req"; "required": false; }; "res": { "alias": "res"; "required": false; }; "page": { "alias": "page"; "required": false; }; "data": { "alias": "data"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "contextmenu": { "alias": "contextmenu"; "required": false; }; "ps": { "alias": "ps"; "required": false; }; "pi": { "alias": "pi"; "required": false; }; "total": { "alias": "total"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingDelay": { "alias": "loadingDelay"; "required": false; }; "loadingIndicator": { "alias": "loadingIndicator"; "required": false; }; "bordered": { "alias": "bordered"; "required": false; }; "size": { "alias": "size"; "required": false; }; "scroll": { "alias": "scroll"; "required": false; }; "drag": { "alias": "drag"; "required": false; "isSignal": true; }; "singleSort": { "alias": "singleSort"; "required": false; }; "multiSort": { "alias": "multiSort"; "required": false; }; "rowClassName": { "alias": "rowClassName"; "required": false; }; "clickRowClassName": { "alias": "clickRowClassName"; "required": false; }; "widthMode": { "alias": "widthMode"; "required": false; }; "widthConfig": { "alias": "widthConfig"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "header": { "alias": "header"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "footer": { "alias": "footer"; "required": false; }; "bodyHeader": { "alias": "bodyHeader"; "required": false; }; "body": { "alias": "body"; "required": false; }; "expandRowByClick": { "alias": "expandRowByClick"; "required": false; }; "expandAccordion": { "alias": "expandAccordion"; "required": false; }; "expand": { "alias": "expand"; "required": false; }; "expandIcon": { "alias": "expandIcon"; "required": false; }; "noResult": { "alias": "noResult"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "responsiveHideHeaderFooter": { "alias": "responsiveHideHeaderFooter"; "required": false; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; }; "virtualItemSize": { "alias": "virtualItemSize"; "required": false; }; "virtualMaxBufferPx": { "alias": "virtualMaxBufferPx"; "required": false; }; "virtualMinBufferPx": { "alias": "virtualMinBufferPx"; "required": false; }; "customRequest": { "alias": "customRequest"; "required": false; }; "virtualForTrackBy": { "alias": "virtualForTrackBy"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, { "error": "error"; "change": "change"; }, never, never, true, never>;
345
+ static ngAcceptInputType_ps: unknown;
346
+ static ngAcceptInputType_pi: unknown;
347
+ static ngAcceptInputType_total: unknown;
348
+ static ngAcceptInputType_loadingDelay: unknown;
349
+ static ngAcceptInputType_bordered: unknown;
350
+ static ngAcceptInputType_showHeader: unknown;
351
+ static ngAcceptInputType_expandRowByClick: unknown;
352
+ static ngAcceptInputType_expandAccordion: unknown;
353
+ static ngAcceptInputType_responsive: unknown;
354
+ static ngAcceptInputType_responsiveHideHeaderFooter: unknown;
355
+ static ngAcceptInputType_virtualScroll: unknown;
356
+ static ngAcceptInputType_virtualItemSize: unknown;
357
+ static ngAcceptInputType_virtualMaxBufferPx: unknown;
358
+ static ngAcceptInputType_virtualMinBufferPx: unknown;
359
+ }
360
+
361
+ type STColumnSafeType = 'text' | 'html' | 'safeHtml';
362
+ interface STWidthMode {
363
+ /**
364
+ * 宽度类型
365
+ * - `default` 默认行为
366
+ * - `strict` 严格模式,即强制按 `width` 指定的宽度呈现,并根据 `strictBehavior` 类型处理
367
+ */
368
+ type?: 'strict' | 'default';
369
+ /**
370
+ * 严格模式的处理行为
371
+ * - `wrap` 强制换行
372
+ * - `truncate` 截短
373
+ */
374
+ strictBehavior?: 'wrap' | 'truncate';
375
+ }
376
+ interface STResetColumnsOption {
377
+ pi?: number;
378
+ ps?: number;
379
+ columns?: STColumn[];
380
+ /**
381
+ * Whether to pre-clear data, Default: `false`
382
+ */
383
+ preClearData?: boolean;
384
+ /**
385
+ * Whether to trigger a data load, Default: `true`
386
+ */
387
+ emitReload?: boolean;
388
+ }
389
+ interface STReq {
390
+ /**
391
+ * 分页类型,默认:`page`
392
+ * - `page` 使用 `pi`,`ps` 组合
393
+ * - `skip` 使用 `skip`,`limit` 组合
394
+ */
395
+ type?: 'page' | 'skip';
396
+ /**
397
+ * 额外请求参数,默认自动附加 `pi`、`ps` 至URL
398
+ * - `{ status: 'new' }` => `url?pi=1&ps=10&status=new`
399
+ */
400
+ params?: any;
401
+ /**
402
+ * Whether to ignore `null` or `unfind` values in parameters
403
+ *
404
+ * 是否忽略参数中 `null` 或 `undefind` 值
405
+ */
406
+ ignoreParamNull?: boolean;
407
+ /** 请求方法,默认:`GET` */
408
+ method?: string;
409
+ /** 请求体 `body` */
410
+ body?: any;
411
+ /** 请求体 `Header` */
412
+ headers?: any;
413
+ /**
414
+ * 重命名参数 `pi`、`ps`,默认:`{ pi: 'pi', ps: 'ps' }`
415
+ * - `{ pi: 'Page' }` => `pi` 会被替换成 Page
416
+ */
417
+ reName?: STReqReNameType;
418
+ /**
419
+ * 是否将请求所有参数数据都放入 `body` 当中(`url` 地址本身参数除外),仅当 `method: 'POST'` 时有效,默认:`false`
420
+ */
421
+ allInBody?: boolean;
422
+ /**
423
+ * 是否延迟加载数据,即渲染结束后不会主动发起请求,在适当的时机调用 `resetColumns` 来渲染,默认:`false`
424
+ */
425
+ lazyLoad?: boolean;
426
+ /**
427
+ * 请求前数据处理
428
+ */
429
+ process?: (requestOptions: STRequestOptions) => STRequestOptions;
430
+ }
431
+ interface STRequestOptions {
432
+ body?: any;
433
+ headers?: HttpHeaders | Record<string, string | string[]>;
434
+ params?: HttpParams | Record<string, string | string[]>;
435
+ observe?: 'body' | 'events' | 'response';
436
+ reportProgress?: boolean;
437
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
438
+ withCredentials?: boolean;
439
+ }
440
+ interface STLoadOptions {
441
+ /** 是否合并,默认:`false` */
442
+ merge?: boolean;
443
+ /** 是否跳转至顶部,若不指定由 `page.toTop` 来决定 */
444
+ toTop?: boolean;
445
+ }
446
+ interface STRes<T extends STData = any> {
447
+ /**
448
+ * 重命名返回参数 `total`、`list`
449
+ * - `{ total: 'Total' }` => Total 会被当作 `total`
450
+ */
451
+ reName?: STResReNameType | ((result: any, options: {
452
+ pi: number;
453
+ ps: number;
454
+ total: number;
455
+ }) => {
456
+ total: number;
457
+ list: T[];
458
+ });
459
+ /**
460
+ * 数据预处理
461
+ */
462
+ process?: (data: T[], rawData?: any) => T[];
463
+ }
464
+ interface STPage {
465
+ /**
466
+ * 前端分页,当 `data` 为`any[]` 或 `Observable<any[]>` 有效,默认:`true`
467
+ * - `true` 由 `st` 根据 `data` 长度受控分页,包括:排序、过滤等
468
+ * - `false` 由用户通过 `total` 和 `data` 参数受控分页,并维护 `(change)` 当分页变更时重新加载数据
469
+ */
470
+ front?: boolean;
471
+ /**
472
+ * 后端分页是否采用`0`基索引,只在`data`类型为`string`时有效,默认:`false`
473
+ */
474
+ zeroIndexed?: boolean;
475
+ /**
476
+ * 指定分页显示的位置,默认:`bottom`
477
+ */
478
+ position?: 'top' | 'bottom' | 'both';
479
+ /**
480
+ * 指定分页显示的尺寸,默认:`default`
481
+ */
482
+ type?: NzTablePaginationType;
483
+ /**
484
+ * 指定分页分页方向,默认:`right`
485
+ */
486
+ placement?: 'left' | 'center' | 'right';
487
+ /**
488
+ * 是否显示分页器,默认:`true`
489
+ */
490
+ show?: boolean;
491
+ /**
492
+ * 是否显示分页器中改变页数,默认:`false`
493
+ */
494
+ showSize?: boolean;
495
+ /**
496
+ * 分页器中每页显示条目数下拉框值,默认:`[10, 20, 30, 40, 50]`
497
+ */
498
+ pageSizes?: number[];
499
+ /**
500
+ * 是否显示分页器中快速跳转,默认:`false`
501
+ */
502
+ showQuickJumper?: boolean;
503
+ /**
504
+ * 用于自定义页码的结构,用法参照 Pagination 组件
505
+ */
506
+ itemRender?: TemplateRef<PaginationItemRenderContext> | null;
507
+ /**
508
+ * 当添加该属性时,显示为简单分页,默认:`false`
509
+ */
510
+ simple?: boolean;
511
+ /**
512
+ * 是否显示总数据量
513
+ * - `boolean` 类型显示与否,默认模板:`共 {{total}} 条`
514
+ * - `string` 自定义模板,模板变量:
515
+ * - `{{total}}` 表示数据总量
516
+ * - `{{range[0]}}` 表示当前页开始数量值
517
+ * - `{{range[1]}}` 表示当前页结束数量值
518
+ */
519
+ total?: string | boolean;
520
+ /**
521
+ * 切换分页时返回顶部,默认:`true`
522
+ */
523
+ toTop?: boolean;
524
+ /**
525
+ * 返回顶部偏移值,默认:`100`
526
+ */
527
+ toTopOffset?: number;
528
+ }
529
+ /**
530
+ * 数据源
531
+ */
532
+ interface STData {
533
+ /**
534
+ * Select or radio button `checked` status value
535
+ *
536
+ * 选择框或单选框状态值
537
+ */
538
+ checked?: boolean;
539
+ /**
540
+ * Select or radio button `disabled` status value
541
+ *
542
+ * 选择框或单选框 `disabled` 值
543
+ */
544
+ disabled?: boolean;
545
+ /**
546
+ * Whether to expand the status value
547
+ *
548
+ * 是否展开状态
549
+ */
550
+ expand?: boolean;
551
+ /**
552
+ * Whether show expand icon
553
+ *
554
+ * 是否显示展开按钮
555
+ */
556
+ showExpand?: boolean;
557
+ /**
558
+ * Class name of the row
559
+ *
560
+ * 行样式
561
+ */
562
+ className?: string;
563
+ [key: string]: any;
564
+ }
565
+ /**
566
+ * 列描述
567
+ */
568
+ interface STColumn<T extends STData = any> {
569
+ /**
570
+ * 用于定义数据源主键,例如:`statistical`
571
+ */
572
+ key?: string;
573
+ /**
574
+ * 列标题
575
+ */
576
+ title?: string | STColumnTitle;
577
+ /**
578
+ * 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法,例如:
579
+ * - `id` (需要指定类型才能智能提示)
580
+ * - `price.market`
581
+ * - `[ 'price', 'market' ]`
582
+ */
583
+ index?: keyof T | (string & {
584
+ _?: never;
585
+ }) | string[] | null;
586
+ /**
587
+ * 类型
588
+ * - `no` 行号,计算规则:`index + noIndex`
589
+ * - `checkbox` 多选
590
+ * - `radio` 单选
591
+ * - `link` 链接,务必指定 `click`
592
+ * - `badge` [徽标](https://ng.ant.design/components/badge/zh),务必指定 `badge` 参数配置徽标对应值
593
+ * - `tag` [标签](https://ng.ant.design/components/tag/zh),务必指定 `tag` 参数配置标签对应值
594
+ * - `enum` 枚举转换,务必指定 `enum` 参数配置标签对应值
595
+ * - `img` 图片且居中(若 `className` 存在则优先)
596
+ * - `number` 数字且居右(若 `className` 存在则优先)
597
+ * - `currency` 货币且居右(若 `className` 存在则优先)
598
+ * - `date` 日期格式且居中(若 `className` 存在则优先),使用 `dateFormat` 自定义格式
599
+ * - `yn` 将`boolean`类型徽章化 [document](https://ng-alain.com/docs/data-render#yn)
600
+ * - `cell` 可指定 `click`,使用 `cell` 组件渲染 [document](https://ng-alain.com/components/cell)
601
+ * - `widget` 使用自定义小部件动态创建
602
+ */
603
+ type?: '' | 'checkbox' | 'link' | 'badge' | 'tag' | 'enum' | 'radio' | 'img' | 'currency' | 'number' | 'date' | 'yn' | 'no' | 'cell' | 'widget';
604
+ /**
605
+ * `cell` component options
606
+ *
607
+ * `cell` 组件配置项
608
+ */
609
+ cell?: CellOptions | ((record: T, column: STColumn) => CellOptions);
610
+ /**
611
+ * 链接回调,若返回一个字符串表示导航URL会自动触发 `router.navigateByUrl`
612
+ */
613
+ click?: (record: T, instance?: STComponent) => any;
614
+ /**
615
+ * 按钮组
616
+ */
617
+ buttons?: Array<STColumnButton<T>>;
618
+ /**
619
+ * Max button option can be showed, and the extra part are auto generated under `more`
620
+ *
621
+ * 配置最多显示多少个按钮,多余部分自动生成至 `更多` 下面
622
+ *
623
+ * > 注意:若在 `buttons` 下配置过按钮组会导致其失效
624
+ */
625
+ maxMultipleButton?: STColumnMaxMultipleButton | number;
626
+ /**
627
+ * 自定义渲染ID
628
+ *
629
+ * @example
630
+ * <ng-template st-row="custom" let-item let-index="index" let-column="column">
631
+ * {{ c.title }}
632
+ * </ng-template>
633
+ */
634
+ render?: string | TemplateRef<void> | TemplateRef<{
635
+ $implicit: T;
636
+ index: number;
637
+ }>;
638
+ /**
639
+ * 标题自定义渲染ID
640
+ *
641
+ * @example
642
+ * <ng-template st-row="custom" type="title" let-c>
643
+ * {{ item | json }}
644
+ * </ng-template>
645
+ */
646
+ renderTitle?: string | TemplateRef<void> | TemplateRef<{
647
+ $implicit: STColumn;
648
+ index: number;
649
+ }>;
650
+ /**
651
+ * 列宽(数字型表示 `px` 值),例如:`100`、`10%`、`100px`
652
+ *
653
+ * **注意:** 若固定列必须是数字
654
+ */
655
+ width?: string | number;
656
+ /**
657
+ * 排序配置项,远程数据配置**优先**规则:
658
+ * - `true` 表示允许排序,且若数据源为本地时自动生成 `compare: (a, b) => a[index] - b[index]` 方法
659
+ * - `ascend` 表示升序
660
+ * - `descend` 表示降序
661
+ * - `string` 表示远程数据排序相对应 `key` 值
662
+ */
663
+ sort?: true | STColumnSort<T> | 'ascend' | 'descend' | string;
664
+ /**
665
+ * 过滤配置项
666
+ */
667
+ filter?: STColumnFilter<T>;
668
+ /**
669
+ * 格式化列值
670
+ */
671
+ format?: (item: T, col: STColumn, index: number) => string;
672
+ /**
673
+ * Safe rendering type, default: `safeHtml`, Support [global config](https://ng-alain.com/docs/global-config)
674
+ *
675
+ * 安全渲染方式,默认:`safeHtml`,支持[全局配置](https://ng-alain.com/docs/global-config/zh)
676
+ */
677
+ safeType?: STColumnSafeType;
678
+ /**
679
+ * 自定义全/反选选择项
680
+ */
681
+ selections?: Array<STColumnSelection<T>>;
682
+ /**
683
+ * 列 `class` 属性值(注:无须 `.` 点)多个用空格隔开,例如:
684
+ * - `text-center` 居中
685
+ * - `text-right` 居右
686
+ * - `text-success` 成功色
687
+ * - `text-error` 异常色
688
+ */
689
+ className?: NgClassType;
690
+ /**
691
+ * Table cell supports `colSpan` and `rowSpan`. When each of them is set to 0, the cell will not be rendered.
692
+ *
693
+ * 表格支持行/列合并,若返回的 `colSpan` 或者 `rowSpan` 设值为 0 时表示不会渲染
694
+ */
695
+ onCell?: (item: T, index: number) => STOnCellResult;
696
+ /**
697
+ * 数字格式,`type=number` 有效
698
+ */
699
+ numberDigits?: string;
700
+ /**
701
+ * 日期格式,`type=date` 有效,(默认:`yyyy-MM-dd HH:mm`)
702
+ */
703
+ dateFormat?: string;
704
+ /**
705
+ * Currency format option, `type=currency` is valid, pls refer of [CurrencyService.commas](https://ng-alain.com/util/format/#commas).
706
+ *
707
+ * 货币格式选项,`type=currency` 有效。
708
+ */
709
+ currency?: STcolumnCurrency;
710
+ /**
711
+ * 当 `type=yn` 有效
712
+ */
713
+ yn?: STColumnYn;
714
+ /**
715
+ * 是否允许导出,默认 `true`
716
+ */
717
+ exported?: boolean;
718
+ /**
719
+ * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
720
+ */
721
+ acl?: ACLCanType;
722
+ /** 当不存在数据时以默认值替代 */
723
+ default?: string;
724
+ /**
725
+ * 固定前后列,当指定时务必指定 `width` 否则视为无效,有若干 **注意:** 项:
726
+ *
727
+ * - 若列头与内容不对齐或出现列重复,请指定列的宽度 `width`
728
+ * - 建议指定 `scroll.x` 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 `scroll.x`
729
+ */
730
+ fixed?: 'left' | 'right';
731
+ /**
732
+ * 徽标配置项
733
+ */
734
+ badge?: STColumnBadge | null;
735
+ /**
736
+ * 标签配置项
737
+ */
738
+ tag?: STColumnTag | null;
739
+ /**
740
+ * 行号索引,默认:`1`
741
+ * - 计算规则为:`index + noIndex`
742
+ * - 支持自定义方法
743
+ */
744
+ noIndex?: number | ((item: T, col: STColumn, idx: number) => number);
745
+ /**
746
+ * 条件表达式
747
+ * - 仅赋值 `columns` 时执行一次
748
+ * - 可调用 `resetColumns()` 再一次触发
749
+ */
750
+ iif?: (item: STColumn<T>) => boolean;
751
+ /**
752
+ * 统计列数据
753
+ * - 若使用自定义统计函数可无须指定 `index`
754
+ * - 可以根据 `key` 来定义生成后需要的键名,如果未指定 `key` 则使用 `index` 来表示键名
755
+ * - 当无法找到有效键名时,使用下标(从 `0` 开始)来代替
756
+ */
757
+ statistical?: STStatisticalType | STStatistical<T>;
758
+ widget?: STWidgetColumn<T>;
759
+ enum?: {
760
+ [key: string]: string;
761
+ [key: number]: string;
762
+ };
763
+ /**
764
+ * 分组表头
765
+ */
766
+ children?: Array<STColumn<T>>;
767
+ colSpan?: number;
768
+ rowSpan?: number;
769
+ /**
770
+ * 调整表头配置
771
+ * - 注意:**不要忘记**在 `src/styles` 下增加 `nz-resizable` Less 样式文件:`@import 'ng-zorro-antd/resizable/style/entry.less';`
772
+ * - **不支持多表头**
773
+ */
774
+ resizable?: STResizable | boolean;
775
+ }
776
+ interface STWidgetColumn<T extends STData = any> {
777
+ type: string;
778
+ params?: (options: {
779
+ record: T;
780
+ column: STColumn;
781
+ }) => Record<string, unknown>;
782
+ }
783
+ interface STColumnTitle {
784
+ [key: string]: any;
785
+ /**
786
+ * Text of header, can be choose one of `text` or `i18n`
787
+ */
788
+ text?: string;
789
+ /**
790
+ * I18n key of header, can be choose one of `text` or `i18n`
791
+ */
792
+ i18n?: string;
793
+ /**
794
+ * Optional information of header
795
+ */
796
+ optional?: string;
797
+ /**
798
+ * Optional help of header
799
+ */
800
+ optionalHelp?: string;
801
+ }
802
+ type STStatisticalType = 'count' | 'distinctCount' | 'sum' | 'average' | 'max' | 'min';
803
+ type STStatisticalFn<T extends STData = any> = (values: number[], col: STColumn, list: T[], rawData?: any) => STStatisticalResult;
804
+ interface STStatistical<T extends STData = any> {
805
+ type: STStatisticalType | STStatisticalFn<T>;
806
+ /**
807
+ * 保留小数位数,默认:`2`
808
+ */
809
+ digits?: number;
810
+ /**
811
+ * 是否需要货币格式化,默认以下情况为 `true`
812
+ * - `type` 为 `STStatisticalFn`、 `sum`、`average`、`max`、`min`
813
+ */
814
+ currency?: boolean;
815
+ }
816
+ interface STStatisticalResults {
817
+ [key: string]: STStatisticalResult;
818
+ [index: number]: STStatisticalResult;
819
+ }
820
+ interface STStatisticalResult {
821
+ value: number;
822
+ text?: string;
823
+ }
824
+ interface STColumnSort<T extends STData = any> {
825
+ /**
826
+ * 排序的默认受控属性
827
+ */
828
+ default?: 'ascend' | 'descend' | null;
829
+ /**
830
+ * 本地数据的排序函数,使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction)
831
+ * - `null` 忽略本地排序,但保持排序功能
832
+ * - 若数据源为本地时自动生成 `(a, b) => a[index] - b[index]` 方法
833
+ */
834
+ compare?: ((a: T, b: T) => number) | null;
835
+ /**
836
+ * 远程数据的排序时后端相对应的KEY,默认使用 `index` 属性
837
+ * - 若 `multiSort: false` 时:`key: 'name' => ?name=1&pi=1`
838
+ * - 若 `multiSort: true` 允许多个排序 key 存在,或使用 `STMultiSort` 指定多列排序key合并规则
839
+ */
840
+ key?: string | null;
841
+ /**
842
+ * 远程数据的排序时后端相对应的VALUE
843
+ * - `{ ascend: '0', descend: '1' }` 结果 `?name=1&pi=1`
844
+ * - `{ ascend: 'asc', descend: 'desc' }` 结果 `?name=desc&pi=1`
845
+ */
846
+ reName?: {
847
+ ascend?: string;
848
+ descend?: string;
849
+ };
850
+ /**
851
+ * 支持的排序方式
852
+ *
853
+ * Supported sort order
854
+ */
855
+ directions?: NzTableSortOrder[];
856
+ }
857
+ interface STSortMap<T extends STData = any> extends STColumnSort<T> {
858
+ [key: string]: any;
859
+ /** 是否启用排序 */
860
+ enabled?: boolean;
861
+ }
862
+ interface STColumnFilter<T extends STData = any> {
863
+ /**
864
+ * 搜索方式
865
+ * - `defualt` 默认形式
866
+ * - `keyword` 文本框形式
867
+ * - `number` 数字框形式
868
+ * - `date` 日期形式
869
+ * - `custom` 自定义模式,需设置 [custom] 参数
870
+ */
871
+ type?: 'default' | 'keyword' | 'number' | 'date' | 'custom';
872
+ /**
873
+ * 表头的筛选菜单项,至少一项才会生效
874
+ * - 当 `type` 为 `keyword` `custom` 时可为空
875
+ */
876
+ menus?: STColumnFilterMenu[];
877
+ /**
878
+ * 本地数据的筛选函数
879
+ */
880
+ fn?: ((filter: STColumnFilterMenu, record: T) => boolean) | null;
881
+ /**
882
+ * 标识数据是否已过滤,筛选图标会高亮
883
+ */
884
+ default?: boolean;
885
+ /**
886
+ * 自定义 filter 图标
887
+ * - 当 `type='default'` 默认 `filter`
888
+ * - 当 `type='keyword'` 默认 `search`
889
+ */
890
+ icon?: string | STIcon;
891
+ /**
892
+ * 确认按钮文本,默认 `确认`
893
+ */
894
+ confirmText?: string;
895
+ /**
896
+ * 清除按钮文本,默认 `重置`
897
+ */
898
+ clearText?: string;
899
+ /**
900
+ * 是否多选,默认 `true`
901
+ */
902
+ multiple?: boolean;
903
+ /**
904
+ * 远程数据的过滤时后端相对应的KEY,默认使用 `index` 属性
905
+ * `key: 'name'` 结果 `?name=1&pi=1`
906
+ */
907
+ key?: string | null;
908
+ /**
909
+ * 远程数据的过滤时后端相对应的VALUE
910
+ * - 默认当 `multiple: true` 时以英文逗号拼接的字符串
911
+ *
912
+ * @return 返回为 Object 对象
913
+ */
914
+ reName?: (list: STColumnFilterMenu[], col: STColumn) => Record<string, unknown>;
915
+ /**
916
+ * 自定义过滤器,请参考 [Custom Data](https://ng-alain.com/components/st/en?#components-st-custom-data) 示例。
917
+ */
918
+ custom?: TemplateRef<{
919
+ $implicit: STColumnFilter;
920
+ col: STColumn;
921
+ handle: STColumnFilterHandle;
922
+ }>;
923
+ /**
924
+ * Whether to display the operation area, default: `true`
925
+ *
926
+ * 是否显示操作区域,默认:`true`
927
+ */
928
+ showOPArea?: boolean;
929
+ /**
930
+ * 在文字框中显示提示讯息
931
+ */
932
+ placeholder?: string;
933
+ number?: {
934
+ precision?: number;
935
+ min?: number;
936
+ max?: number;
937
+ step?: number;
938
+ };
939
+ date?: {
940
+ range?: boolean;
941
+ mode?: 'year' | 'month' | 'week' | 'date';
942
+ showToday?: boolean;
943
+ showNow?: boolean;
944
+ disabledDate?: (d: Date) => boolean;
945
+ disabledTime?: DisabledTimeFn;
946
+ };
947
+ }
948
+ interface STColumnFilterHandle {
949
+ /**
950
+ * Close pannel, if `result` is set, it will trigger confirm or reset action
951
+ *
952
+ * 关闭面板,当指定 `result` 时会触发确认或重置动作
953
+ */
954
+ close: (result?: boolean) => void;
955
+ /**
956
+ * Trigger confirm (You can call `close` to close the panel)
957
+ *
958
+ * 触发确认(可以调用 `close` 来关闭面板)
959
+ */
960
+ confirm: () => STColumnFilterHandle;
961
+ /**
962
+ * Trigger reset (You can call `close` to close the panel)
963
+ *
964
+ * 触发重置(可以调用 `close` 来关闭面板)
965
+ */
966
+ reset: () => STColumnFilterHandle;
967
+ }
968
+ interface STColumnFilterMenu {
969
+ /**
970
+ * 文本
971
+ * - 当 `type: 'keyword'` 时表示 `placeholder`
972
+ */
973
+ text?: string;
974
+ /**
975
+ * 值
976
+ */
977
+ value?: any;
978
+ /**
979
+ * 是否选中
980
+ */
981
+ checked?: boolean;
982
+ /**
983
+ * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
984
+ */
985
+ acl?: ACLCanType;
986
+ [key: string]: any;
987
+ }
988
+ interface STColumnSelection<T extends STData = any> {
989
+ /**
990
+ * 选择项显示的文字
991
+ */
992
+ text: string;
993
+ /**
994
+ * 选择项点击回调,允许对参数 `data.checked` 进行操作
995
+ */
996
+ select: (data: T[]) => void;
997
+ /** 权限,等同 `can()` 参数值 */
998
+ acl?: ACLCanType;
999
+ }
1000
+ interface STcolumnCurrency {
1001
+ /**
1002
+ * See [CurrencyService.commas](https://ng-alain.com/util/format/en#format)
1003
+ */
1004
+ format?: CurrencyFormatOptions;
1005
+ }
1006
+ /** 当 `type=yn` 有效 */
1007
+ interface STColumnYn {
1008
+ /**
1009
+ * 真值条件,(默认:`true`)
1010
+ */
1011
+ truth?: any;
1012
+ /**
1013
+ * 徽章 `true` 时文本,(默认:`是`)
1014
+ */
1015
+ yes?: string;
1016
+ /**
1017
+ * 徽章 `false` 时文本,(默认:`否`)
1018
+ */
1019
+ no?: string;
1020
+ /**
1021
+ * 徽章显示风格
1022
+ * - `full` 图标和文本
1023
+ * - `icon` 图标
1024
+ * - `text` 文本
1025
+ */
1026
+ mode?: YNMode;
1027
+ }
1028
+ interface STIcon {
1029
+ /** 图标类型 */
1030
+ type: string;
1031
+ /** 图标主题风格,默认:`outline` */
1032
+ theme?: ThemeType;
1033
+ /** 是否有旋转动画,默认:`false` */
1034
+ spin?: boolean;
1035
+ /** 仅适用双色图标,设置双色图标的主要颜色,仅对当前 icon 生效 */
1036
+ twoToneColor?: string;
1037
+ /** 指定来自 IconFont 的图标类型 */
1038
+ iconfont?: string;
1039
+ }
1040
+ /**
1041
+ * 按钮配置
1042
+ */
1043
+ interface STColumnButton<T extends STData = any> {
1044
+ /**
1045
+ * 文本
1046
+ */
1047
+ text?: string | ((record: T, btn: STColumnButton<T>) => string);
1048
+ /**
1049
+ * 文本 i18n
1050
+ */
1051
+ i18n?: string;
1052
+ /**
1053
+ * 图标
1054
+ */
1055
+ icon?: string | STIcon | ((record: T, btn: STColumnButton<T>) => STIcon | null | undefined);
1056
+ /**
1057
+ * 按钮类型
1058
+ * - `none` 无任何互动
1059
+ * - `del` 删除,默认开启 `pop: true`
1060
+ * - `modal` 对话框,需要指定 `component` 才会生效
1061
+ * - `static` 静态对话框,需要指定 `component` 才会生效
1062
+ * - `drawer` 抽屉,需要指定 `component` 才会生效
1063
+ * - `link` 链接,当 `click` 返回字符串时自动调用 `navigateByUrl` 导航
1064
+ * - `divider` 分割线
1065
+ */
1066
+ type?: 'none' | 'del' | 'modal' | 'static' | 'drawer' | 'link' | 'divider';
1067
+ /**
1068
+ * 点击回调
1069
+ * - Function
1070
+ * - `type=modal` 只会在当有传回值时才会触发回调
1071
+ * - reload:重新刷新当前页
1072
+ * - load:重新加载数据,并重置页码为:`1`
1073
+ *
1074
+ * @todo Bad parameter design
1075
+ */
1076
+ click?: 'reload' | 'load' | ((record: T, modal?: any, instance?: STComponent) => any);
1077
+ /**
1078
+ * 气泡确认框参数,若 `string` 类型表示标题
1079
+ */
1080
+ pop?: boolean | string | STColumnButtonPop;
1081
+ /**
1082
+ * 对话框参数
1083
+ */
1084
+ modal?: STColumnButtonModal;
1085
+ /**
1086
+ * 抽屉参数
1087
+ */
1088
+ drawer?: STColumnButtonDrawer;
1089
+ /**
1090
+ * 下拉菜单,当存在时以 `dropdown` 形式渲染
1091
+ * - 只支持一级
1092
+ */
1093
+ children?: Array<STColumnButton<T>>;
1094
+ /**
1095
+ * 权限,等同 [ACLCanType](https://ng-alain.com/acl/getting-started/#ACLCanType) 参数值
1096
+ */
1097
+ acl?: ACLCanType;
1098
+ /**
1099
+ * Conditional expression
1100
+ *
1101
+ * @todo Bad parameter design
1102
+ */
1103
+ iif?: (item: T, btn: STColumnButton<T>, column: STColumn) => boolean;
1104
+ /**
1105
+ * Conditional expression rendering behavior, can be set to `hide` (default) or `disabled`
1106
+ */
1107
+ iifBehavior?: IifBehaviorType;
1108
+ tooltip?: string;
1109
+ /**
1110
+ * 按钮 `class` 属性值(注:无须 `.` 点)多个用空格隔开,例如:
1111
+ * - `text-success` 成功色
1112
+ * - `text-error` 错误色
1113
+ */
1114
+ className?: NgClassType | ((record: T, btn: STColumnButton<T>) => NgClassType | null | undefined);
1115
+ [key: string]: any;
1116
+ }
1117
+ interface STColumnMaxMultipleButton {
1118
+ /**
1119
+ * 更多按钮文本,默认:`更多`
1120
+ */
1121
+ text?: string;
1122
+ /**
1123
+ * 超出数量自动合并,默认:`2`
1124
+ */
1125
+ count?: number;
1126
+ }
1127
+ type IifBehaviorType = 'hide' | 'disabled';
1128
+ interface STColumnButtonModal<T extends STData = any> extends ModalHelperOptions {
1129
+ /**
1130
+ * 对话框组件对象
1131
+ */
1132
+ component?: any;
1133
+ /**
1134
+ * 对话框参数
1135
+ */
1136
+ params?: (record: T) => Record<string, unknown>;
1137
+ /**
1138
+ * 对话框目标组件的接收参数名,默认:`record`
1139
+ */
1140
+ paramsName?: string;
1141
+ }
1142
+ interface STColumnButtonModalConfig {
1143
+ /**
1144
+ * 指定模态框目标组件的接收参数名,默认:`record`
1145
+ */
1146
+ paramsName?: string;
1147
+ /** 大小;例如:lg、600,默认:`lg` */
1148
+ size?: 'sm' | 'md' | 'lg' | 'xl' | '' | number;
1149
+ /** 对话框 [ModalOptions](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/modal/modal-types.ts) 参数 */
1150
+ modalOptions?: ModalOptions;
1151
+ /** 是否精准(默认:`true`),若返回值非空值(`null`或`undefined`)视为成功,否则视为错误 */
1152
+ exact?: boolean;
1153
+ }
1154
+ interface STColumnButtonDrawer<T extends STData = any> extends DrawerHelperOptions {
1155
+ /**
1156
+ * 标题
1157
+ */
1158
+ title?: string;
1159
+ /**
1160
+ * 抽屉组件对象
1161
+ */
1162
+ component?: any;
1163
+ /**
1164
+ * 抽屉参数
1165
+ */
1166
+ params?: (record: T) => Record<string, unknown>;
1167
+ /**
1168
+ * 抽屉目标组件的接收参数名,默认:`record`
1169
+ */
1170
+ paramsName?: string;
1171
+ }
1172
+ interface STColumnButtonDrawerConfig {
1173
+ /**
1174
+ * 抽屉目标组件的接收参数名,默认:`record`
1175
+ */
1176
+ paramsName?: string;
1177
+ /**
1178
+ * 大小;例如:lg、600,默认:`md`
1179
+ *
1180
+ * | 类型 | 默认大小 |
1181
+ * | --- | ------ |
1182
+ * | `sm` | `300` |
1183
+ * | `md` | `600` |
1184
+ * | `lg` | `900` |
1185
+ * | `xl` | `1200` |
1186
+ *
1187
+ * > 以上值,可通过覆盖相应的LESS参数自行调整
1188
+ */
1189
+ size?: 'sm' | 'md' | 'lg' | 'xl' | number;
1190
+ /**
1191
+ * 是否包含底部工具条,默认:`true`
1192
+ */
1193
+ footer?: boolean;
1194
+ /**
1195
+ * 底部工具条高度,默认:`55`
1196
+ */
1197
+ footerHeight?: number;
1198
+ /** 抽屉 [NzDrawerOptions](https://ng.ant.design/components/drawer/zh#nzdraweroptions) 参数 */
1199
+ drawerOptions?: NzDrawerOptions;
1200
+ }
1201
+ interface STColumnButtonPop<T extends STData = any> {
1202
+ /**
1203
+ * Title of the popover, default: `确认删除吗?`
1204
+ */
1205
+ title?: string;
1206
+ titleI18n?: string;
1207
+ /**
1208
+ * Popover trigger mode, default: `click`
1209
+ */
1210
+ trigger?: 'click' | 'focus' | 'hover';
1211
+ /**
1212
+ * The position of the popover relative to the target, default: `top`
1213
+ */
1214
+ placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
1215
+ /**
1216
+ * Class name of the popover card
1217
+ */
1218
+ overlayClassName?: string;
1219
+ /**
1220
+ * Style of the popover card
1221
+ */
1222
+ overlayStyle?: NgStyleInterface;
1223
+ /**
1224
+ * Text of the Cancel button
1225
+ */
1226
+ cancelText?: string;
1227
+ cancelTextI18n?: string;
1228
+ /**
1229
+ * Text of the Confirm button
1230
+ */
1231
+ okText?: string;
1232
+ okTextI18n?: string;
1233
+ /**
1234
+ * Button `type` of the Confirm button
1235
+ */
1236
+ okType?: 'primary' | 'ghost' | 'dashed' | 'danger' | 'default';
1237
+ /**
1238
+ * Customize icon of confirmation
1239
+ */
1240
+ icon?: string;
1241
+ /**
1242
+ * Whether to directly emit `onConfirm` without showing Popconfirm, default: `() => false`
1243
+ */
1244
+ condition?: (item: T) => boolean;
1245
+ }
1246
+ interface STReqReNameType {
1247
+ pi?: string;
1248
+ ps?: string;
1249
+ skip?: string;
1250
+ limit?: string;
1251
+ }
1252
+ interface STResReNameType {
1253
+ total?: string | string[];
1254
+ list?: string | string[];
1255
+ }
1256
+ interface STExportOptions<T extends STData = any> {
1257
+ /**
1258
+ * Specify the currently exported data, default the current table data
1259
+ */
1260
+ data?: T[];
1261
+ /**
1262
+ * Specify the currently exported column configuration, default the current table data
1263
+ */
1264
+ columens?: STColumn[];
1265
+ /** 工作溥名 */
1266
+ sheetname?: string;
1267
+ /** 文件名 */
1268
+ filename?: string;
1269
+ /** triggers when saveas */
1270
+ callback?: (wb: any) => void;
1271
+ }
1272
+ /**
1273
+ * 单排序规则
1274
+ * - 若不指定,则返回:`columnName=ascend|descend`
1275
+ * - 若指定,则返回:`sort=columnName.(ascend|descend)`
1276
+ */
1277
+ interface STSingleSort {
1278
+ /** 请求参数名,默认:`sort` */
1279
+ key?: string;
1280
+ /** 列名与状态间分隔符,默认:`.` */
1281
+ nameSeparator?: string;
1282
+ }
1283
+ /**
1284
+ * 多排序相同排序 key 时合并规则
1285
+ */
1286
+ interface STMultiSort {
1287
+ /** 请求参数名,默认:`sort` */
1288
+ key?: string;
1289
+ /** 不同属性间分隔符,默认:`-` */
1290
+ separator?: string;
1291
+ /** 列名与状态间分隔符,默认:`.` */
1292
+ nameSeparator?: string;
1293
+ /**
1294
+ * 是否以数组的形式传递参数,默认:`false`
1295
+ * - `true` 表示使用 `url?sort=name.asc&sort=age.desc` 形式
1296
+ * - `false` 表示使用 `url?sort=name.asc-age.desc` 形式
1297
+ */
1298
+ arrayParam?: boolean;
1299
+ /**
1300
+ * 是否保持空值的键名,默认:`true`
1301
+ * - `true` 表示不管是否有排序都会发送 `key` 键名
1302
+ * - `false` 表示无排序动作时不会发送 `key` 键名
1303
+ */
1304
+ keepEmptyKey?: boolean;
1305
+ /**
1306
+ * ## 仅限全局配置项有效
1307
+ *
1308
+ * 是否全局多排序模式,默认:`true`
1309
+ * - `true` 表示所有 `st` 默认为多排序
1310
+ * - `false` 表示需要为每个 `st` 添加 `multiSort` 才会视为多排序模式
1311
+ */
1312
+ global?: boolean;
1313
+ }
1314
+ type STMultiSortResultType = Record<string, string | string[]>;
1315
+ /**
1316
+ * 徽标信息
1317
+ */
1318
+ interface STColumnBadge {
1319
+ [key: number]: STColumnBadgeValue;
1320
+ [key: string]: STColumnBadgeValue;
1321
+ }
1322
+ interface STColumnBadgeValue {
1323
+ /**
1324
+ * 文本
1325
+ */
1326
+ text?: string;
1327
+ /**
1328
+ * 徽标颜色值
1329
+ */
1330
+ color?: 'success' | 'processing' | 'default' | 'error' | 'warning';
1331
+ /**
1332
+ * Text popup tip
1333
+ *
1334
+ * 文字提示
1335
+ */
1336
+ tooltip?: string;
1337
+ }
1338
+ /**
1339
+ * 标签信息
1340
+ */
1341
+ interface STColumnTag {
1342
+ [key: number]: STColumnTagValue;
1343
+ [key: string]: STColumnTagValue;
1344
+ }
1345
+ interface STColumnTagValue {
1346
+ /**
1347
+ * 文本
1348
+ */
1349
+ text?: string;
1350
+ /**
1351
+ * 颜色值,支持预设和色值
1352
+ * - 预设:geekblue,blue,purple,success,red,volcano,orange,gold,lime,green,cyan
1353
+ * - 色值:#f50,#ff0
1354
+ */
1355
+ color?: 'geekblue' | 'blue' | 'purple' | 'success' | 'red' | 'volcano' | 'orange' | 'gold' | 'lime' | 'green' | 'cyan' | string;
1356
+ /**
1357
+ * Text popup tip
1358
+ *
1359
+ * 文字提示
1360
+ */
1361
+ tooltip?: string;
1362
+ }
1363
+ type STChangeType = 'loaded' | 'pi' | 'ps' | 'checkbox' | 'radio' | 'sort' | 'filter' | 'filterChange' | 'click' | 'dblClick' | 'expand' | 'resize';
1364
+ /**
1365
+ * 回调数据
1366
+ */
1367
+ interface STChange<T extends STData = any> {
1368
+ /**
1369
+ * 回调类型
1370
+ */
1371
+ type: STChangeType;
1372
+ /**
1373
+ * 当前页码
1374
+ */
1375
+ pi: number;
1376
+ /**
1377
+ * 每页数量
1378
+ */
1379
+ ps: number;
1380
+ /**
1381
+ * 数据总量
1382
+ */
1383
+ total: number;
1384
+ /**
1385
+ * `loaded` 参数
1386
+ */
1387
+ loaded?: T[];
1388
+ /**
1389
+ * `checkbox` 参数
1390
+ */
1391
+ checkbox?: T[];
1392
+ /**
1393
+ * `radio` 参数
1394
+ */
1395
+ radio?: T;
1396
+ /**
1397
+ * 排序参数
1398
+ */
1399
+ sort?: STChangeSort;
1400
+ /**
1401
+ * 过滤参数
1402
+ */
1403
+ filter?: STColumn;
1404
+ /**
1405
+ * 行点击参数
1406
+ */
1407
+ click?: STChangeRowClick<T>;
1408
+ /**
1409
+ * 行双击参数
1410
+ */
1411
+ dblClick?: STChangeRowClick<T>;
1412
+ /**
1413
+ * `expand` 参数
1414
+ */
1415
+ expand?: T;
1416
+ /**
1417
+ * `resize` 参数
1418
+ */
1419
+ resize?: STColumn;
1420
+ /**
1421
+ * `filterChange` 参数,支持 `keyword`、`radio`、`checkbox` 三种类型的数据
1422
+ */
1423
+ filterChange?: unknown;
1424
+ }
1425
+ /** 行单击参数 */
1426
+ interface STChangeSort {
1427
+ value?: 'ascend' | 'descend';
1428
+ map?: Record<string, string>;
1429
+ column?: STColumn;
1430
+ }
1431
+ /** 行单击参数 */
1432
+ interface STChangeRowClick<T extends STData = any> {
1433
+ e?: Event;
1434
+ item?: T;
1435
+ index?: number;
1436
+ }
1437
+ interface STError {
1438
+ type?: 'req';
1439
+ error?: any;
1440
+ }
1441
+ type STRowClassName<T extends STData = any> = (record: T, index: number) => string;
1442
+ type STClickRowClassName<T extends STData = any> = string | STClickRowClassNameType<T>;
1443
+ interface STClickRowClassNameType<T extends STData = any> {
1444
+ fn: (record: T, index: number) => string;
1445
+ /**
1446
+ * Whether mutually exclusive, default: `false`
1447
+ *
1448
+ * 是否互斥,默认:`false`
1449
+ */
1450
+ exclusive?: boolean;
1451
+ }
1452
+ interface STColumnGroupType {
1453
+ column: STColumn;
1454
+ colStart: number;
1455
+ colEnd?: number;
1456
+ colSpan?: number;
1457
+ rowSpan?: number;
1458
+ hasSubColumns?: boolean;
1459
+ }
1460
+ interface STResizable {
1461
+ /**
1462
+ * Disable resize, Default: `true`
1463
+ */
1464
+ disabled?: boolean;
1465
+ /**
1466
+ * Specifies resize boundaries, Default: `window`
1467
+ */
1468
+ bounds?: 'window' | 'parent' | ElementRef<HTMLElement>;
1469
+ /**
1470
+ * Maximum width of resizable elemen, Default: `60`
1471
+ */
1472
+ maxWidth?: number;
1473
+ /**
1474
+ * Minimum width of resizable element, Default: `360`
1475
+ */
1476
+ minWidth?: number;
1477
+ /**
1478
+ * Enable preview when resizing, Default: `true`
1479
+ */
1480
+ preview?: boolean;
1481
+ }
1482
+ type STContextmenuFn<T extends STData = any> = (options: STContextmenuOptions<T>) => Observable<STContextmenuItem[]> | STContextmenuItem[];
1483
+ interface STContextmenuOptions<T extends STData = any> {
1484
+ event: MouseEvent;
1485
+ /**
1486
+ * Contextmenu position
1487
+ */
1488
+ type: 'head' | 'body';
1489
+ column: STColumn;
1490
+ data: T | null;
1491
+ /**
1492
+ * Row index, when `type === 'body'` valid
1493
+ *
1494
+ * 所在行下标,当 `type === 'body'` 时有效
1495
+ */
1496
+ rowIndex: number | null;
1497
+ /**
1498
+ * Column index
1499
+ *
1500
+ * 所在列下标
1501
+ */
1502
+ colIndex: number;
1503
+ }
1504
+ interface STContextmenuItem {
1505
+ key?: string;
1506
+ /**
1507
+ * Text of the context menu item
1508
+ */
1509
+ text: string;
1510
+ fn?: (item: STContextmenuItem) => void;
1511
+ /**
1512
+ * Only supports one level
1513
+ *
1514
+ * 只支持一级
1515
+ */
1516
+ children?: STContextmenuItem[];
1517
+ [key: string]: any;
1518
+ }
1519
+ interface STCustomRequestOptions {
1520
+ method: string;
1521
+ url: string;
1522
+ options: STRequestOptions;
1523
+ }
1524
+ interface STOnCellResult {
1525
+ rowSpan?: number | null;
1526
+ colSpan?: number | null;
1527
+ }
1528
+ interface STDragOptions {
1529
+ /**
1530
+ * Emits when the user drops an item inside the container, default: `moveItemInArray()`
1531
+ */
1532
+ dropped?: (e: CdkDragDrop<any, any, any>) => void;
1533
+ /**
1534
+ * Emits when the user has moved a new drag item into this container.
1535
+ */
1536
+ entered?: (e: CdkDragEnter<any>) => void;
1537
+ /**
1538
+ * Emits when the user removes an item from the container by dragging it into another container.
1539
+ */
1540
+ exited?: (e: CdkDragExit<any>) => void;
1541
+ /**
1542
+ * Emits as the user is swapping items while actively dragging.
1543
+ */
1544
+ sorted?: (e: CdkDragSortEvent<any>) => void;
1545
+ }
1546
+
1547
+ interface STColumnSourceProcessOptions {
1548
+ widthMode: STWidthMode;
1549
+ resizable?: STResizable;
1550
+ safeType: STColumnSafeType;
1551
+ expand: boolean;
1552
+ }
1553
+ declare class STColumnSource {
1554
+ private readonly dom;
1555
+ private readonly rowSource;
1556
+ private readonly acl;
1557
+ private readonly i18nSrv;
1558
+ private readonly stWidgetRegistry;
1559
+ private cog;
1560
+ setCog(val: AlainSTConfig): void;
1561
+ private fixPop;
1562
+ private btnCoerce;
1563
+ private btnCoerceIf;
1564
+ private fixedCoerce;
1565
+ private sortCoerce;
1566
+ private fixSortCoerce;
1567
+ private filterCoerce;
1568
+ private restoreRender;
1569
+ private widgetCoerce;
1570
+ private genHeaders;
1571
+ private cleanCond;
1572
+ private mergeClass;
1573
+ process(list: STColumn[], options: STColumnSourceProcessOptions): {
1574
+ columns: _STColumn[];
1575
+ headers: _STHeader[][];
1576
+ headerWidths: string[] | null;
1577
+ };
1578
+ restoreAllRender(columns: _STColumn[]): void;
1579
+ updateDefault(filter: STColumnFilter): this;
1580
+ cleanFilter(col: _STColumn): this;
1581
+ static ɵfac: i0.ɵɵFactoryDeclaration<STColumnSource, never>;
1582
+ static ɵprov: i0.ɵɵInjectableDeclaration<STColumnSource>;
1583
+ }
1584
+
1585
+ interface STDataSourceOptions {
1586
+ pi: number;
1587
+ ps: number;
1588
+ paginator: boolean;
1589
+ data?: string | STData[] | Observable<STData[]>;
1590
+ total: number;
1591
+ req: STReq;
1592
+ res: STRes;
1593
+ page: STPage;
1594
+ columns: _STColumn[];
1595
+ headers: _STHeader[][];
1596
+ singleSort?: STSingleSort | null;
1597
+ multiSort?: STMultiSort;
1598
+ rowClassName?: STRowClassName | null;
1599
+ customRequest?: (options: STCustomRequestOptions) => Observable<NzSafeAny>;
1600
+ }
1601
+ interface STDataSourceResult {
1602
+ /** 是否需要显示分页器 */
1603
+ pageShow: boolean;
1604
+ /** 新 `pi`,若返回 `undefined` 表示用户受控 */
1605
+ pi: number;
1606
+ /** 新 `ps`,若返回 `undefined` 表示用户受控 */
1607
+ ps: number;
1608
+ /** 新 `total`,若返回 `undefined` 表示用户受控 */
1609
+ total: number;
1610
+ /** 数据 */
1611
+ list: STData[];
1612
+ /** 统计数据 */
1613
+ statistical: STStatisticalResults;
1614
+ }
1615
+ declare class STDataSource {
1616
+ private http;
1617
+ private datePipe;
1618
+ private ynPipe;
1619
+ private numberPipe;
1620
+ private currencySrv;
1621
+ private dom;
1622
+ private cog;
1623
+ private sortTick;
1624
+ constructor(http: _HttpClient, datePipe: DatePipe, ynPipe: YNPipe, numberPipe: DecimalPipe, currencySrv: CurrencyService, dom: DomSanitizer);
1625
+ setCog(val: AlainSTConfig): void;
1626
+ process(options: STDataSourceOptions): Observable<STDataSourceResult>;
1627
+ private get;
1628
+ private getByRemote;
1629
+ getCell(c: STColumn, item: STData, idx: number): STOnCellResult;
1630
+ optimizeData(options: {
1631
+ columns: _STColumn[];
1632
+ result: STData[];
1633
+ rowClassName?: STRowClassName | null;
1634
+ }): STData[];
1635
+ getNoIndex(item: STData, col: _STColumn, idx: number): number;
1636
+ private genButtons;
1637
+ private fixMaxMultiple;
1638
+ private getValidSort;
1639
+ private getSorterFn;
1640
+ get nextSortTick(): number;
1641
+ getReqSortMap(singleSort: STSingleSort | undefined | null, multiSort: STMultiSort | undefined, headers: _STHeader[][]): STMultiSortResultType;
1642
+ private getFilteredData;
1643
+ private getReqFilterMap;
1644
+ private genStatistical;
1645
+ private getStatistical;
1646
+ private toFixed;
1647
+ private getValues;
1648
+ private getSum;
1649
+ static ɵfac: i0.ɵɵFactoryDeclaration<STDataSource, [null, { host: true; }, { host: true; }, { host: true; }, null, null]>;
1650
+ static ɵprov: i0.ɵɵInjectableDeclaration<STDataSource>;
1651
+ }
1652
+
1653
+ declare class STExport {
1654
+ private readonly xlsxSrv;
1655
+ private _stGet;
1656
+ private genSheet;
1657
+ export(opt: STExportOptions): Promise<XlsxExportResult>;
1658
+ static ɵfac: i0.ɵɵFactoryDeclaration<STExport, never>;
1659
+ static ɵprov: i0.ɵɵInjectableDeclaration<STExport>;
1660
+ }
1661
+
1662
+ declare class STWidgetRegistry {
1663
+ private _widgets;
1664
+ get widgets(): NzSafeAny;
1665
+ register(type: string, widget: NzSafeAny): void;
1666
+ has(type: string): boolean;
1667
+ get(type: string): NzSafeAny;
1668
+ static ɵfac: i0.ɵɵFactoryDeclaration<STWidgetRegistry, never>;
1669
+ static ɵprov: i0.ɵɵInjectableDeclaration<STWidgetRegistry>;
1670
+ }
1671
+
1672
+ declare class STWidgetHostDirective implements OnInit {
1673
+ private readonly stWidgetRegistry;
1674
+ private readonly viewContainerRef;
1675
+ record: STData;
1676
+ column: STColumn;
1677
+ ngOnInit(): void;
1678
+ static ɵfac: i0.ɵɵFactoryDeclaration<STWidgetHostDirective, never>;
1679
+ static ɵdir: i0.ɵɵDirectiveDeclaration<STWidgetHostDirective, "[st-widget-host]", never, { "record": { "alias": "record"; "required": false; }; "column": { "alias": "column"; "required": false; }; }, {}, never, never, true, never>;
1680
+ }
1681
+
1682
+ declare class STRowDirective implements OnInit {
1683
+ private readonly source;
1684
+ private readonly ref;
1685
+ id: string;
1686
+ type?: 'title';
1687
+ ngOnInit(): void;
1688
+ static ɵfac: i0.ɵɵFactoryDeclaration<STRowDirective, never>;
1689
+ static ɵdir: i0.ɵɵDirectiveDeclaration<STRowDirective, "[st-row]", never, { "id": { "alias": "st-row"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, {}, never, never, true, never>;
1690
+ }
1691
+
1692
+ declare const ST_DEFAULT_CONFIG: AlainSTConfig;
1693
+
1694
+ declare class STModule {
1695
+ static ɵfac: i0.ɵɵFactoryDeclaration<STModule, never>;
1696
+ static ɵmod: i0.ɵɵNgModuleDeclaration<STModule, never, [typeof STComponent, typeof STRowDirective, typeof STWidgetHostDirective], [typeof STComponent, typeof STRowDirective, typeof STWidgetHostDirective]>;
1697
+ static ɵinj: i0.ɵɵInjectorDeclaration<STModule>;
1698
+ }
1699
+
1700
+ interface STWidgetProvideConfig {
1701
+ KEY: string;
1702
+ type: NzSafeAny;
1703
+ }
1704
+ /**
1705
+ * Just only using Standalone widgets
1706
+ */
1707
+ declare function provideSTWidgets(...widgets: STWidgetProvideConfig[]): EnvironmentProviders;
1708
+
1709
+ export { STColumnSource, STComponent, STDataSource, STExport, STModule, STRowDirective, STWidgetHostDirective, STWidgetRegistry, ST_DEFAULT_CONFIG, provideSTWidgets };
1710
+ export type { IifBehaviorType, STChange, STChangeRowClick, STChangeSort, STChangeType, STClickRowClassName, STClickRowClassNameType, STColumn, STColumnBadge, STColumnBadgeValue, STColumnButton, STColumnButtonDrawer, STColumnButtonDrawerConfig, STColumnButtonModal, STColumnButtonModalConfig, STColumnButtonPop, STColumnFilter, STColumnFilterHandle, STColumnFilterMenu, STColumnGroupType, STColumnMaxMultipleButton, STColumnSafeType, STColumnSelection, STColumnSort, STColumnSourceProcessOptions, STColumnTag, STColumnTagValue, STColumnTitle, STColumnYn, STContextmenuFn, STContextmenuItem, STContextmenuOptions, STCustomRequestOptions, STData, STDataSourceOptions, STDataSourceResult, STDragOptions, STError, STExportOptions, STIcon, STLoadOptions, STMultiSort, STMultiSortResultType, STOnCellResult, STPage, STReq, STReqReNameType, STRequestOptions, STRes, STResReNameType, STResetColumnsOption, STResizable, STRowClassName, STSingleSort, STSortMap, STStatistical, STStatisticalFn, STStatisticalResult, STStatisticalResults, STStatisticalType, STWidgetColumn, STWidgetProvideConfig, STWidthMode, STcolumnCurrency, _STColumn, _STColumnButton, _STDataValue, _STHeader, _STTdNotify, _STTdNotifyType };