@yelon/util 12.0.13 → 12.0.17

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 (231) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/array/array-type.service.d.ts +68 -68
  4. package/array/array.service.d.ts +75 -75
  5. package/array/index.d.ts +2 -2
  6. package/array/yelon-util-array.d.ts +4 -4
  7. package/array/yelon-util-array.metadata.json +1 -1
  8. package/browser/browser.d.ts +4 -4
  9. package/browser/cookie.service.d.ts +64 -64
  10. package/browser/copy.d.ts +6 -6
  11. package/browser/index.d.ts +5 -5
  12. package/browser/is-empty.d.ts +6 -6
  13. package/browser/scroll.service.d.ts +34 -34
  14. package/browser/style.d.ts +21 -21
  15. package/bundles/browser.umd.js +275 -275
  16. package/bundles/yelon-util-array.umd.js +606 -606
  17. package/bundles/yelon-util-array.umd.js.map +1 -1
  18. package/bundles/yelon-util-config.umd.js +366 -366
  19. package/bundles/yelon-util-date-time.umd.js +216 -216
  20. package/bundles/yelon-util-decorator.umd.js +437 -437
  21. package/bundles/yelon-util-form.umd.js +116 -116
  22. package/bundles/yelon-util-format.umd.js +726 -726
  23. package/bundles/yelon-util-math.umd.js +83 -83
  24. package/bundles/yelon-util-other.umd.js +652 -656
  25. package/bundles/yelon-util-other.umd.js.map +1 -1
  26. package/bundles/yelon-util-pipes-currency.umd.js +83 -83
  27. package/bundles/yelon-util-pipes-filter.umd.js +353 -353
  28. package/bundles/yelon-util-pipes-format.umd.js +47 -47
  29. package/bundles/yelon-util-pipes.umd.js +7 -7
  30. package/bundles/yelon-util-token.umd.js +30 -30
  31. package/bundles/yelon-util.umd.js +7 -7
  32. package/config/abc/date-picker.type.d.ts +52 -52
  33. package/config/abc/error-collect.type.d.ts +10 -10
  34. package/config/abc/image.type.d.ts +15 -15
  35. package/config/abc/index.d.ts +16 -16
  36. package/config/abc/loading.type.d.ts +31 -31
  37. package/config/abc/lodop.type.d.ts +33 -33
  38. package/config/abc/media.type.d.ts +11 -11
  39. package/config/abc/onboarding.type.d.ts +4 -4
  40. package/config/abc/page-header.type.d.ts +39 -39
  41. package/config/abc/pdf.type.d.ts +35 -35
  42. package/config/abc/qr.type.d.ts +25 -25
  43. package/config/abc/se.type.d.ts +32 -32
  44. package/config/abc/sg.type.d.ts +10 -10
  45. package/config/abc/st.type.d.ts +427 -431
  46. package/config/abc/sv.type.d.ts +14 -14
  47. package/config/abc/xlsx.type.d.ts +12 -12
  48. package/config/abc/zip.type.d.ts +10 -10
  49. package/config/acl/acl.type.d.ts +32 -32
  50. package/config/auth/auth.type.d.ts +55 -55
  51. package/config/bis/bis.type.d.ts +7 -7
  52. package/config/cache/cache.type.d.ts +40 -40
  53. package/config/chart/chart.type.d.ts +33 -33
  54. package/config/config.service.d.ts +10 -10
  55. package/config/config.types.d.ts +49 -49
  56. package/config/index.d.ts +14 -14
  57. package/config/mock/mock.type.d.ts +18 -18
  58. package/config/sf/sf.type.d.ts +127 -127
  59. package/config/stomp/stomp.type.d.ts +2 -2
  60. package/config/theme/http.type.d.ts +14 -14
  61. package/config/theme/i18n.type.d.ts +8 -8
  62. package/config/theme/index.d.ts +3 -3
  63. package/config/theme/responsive.type.d.ts +12 -12
  64. package/config/util/array.type.d.ts +22 -22
  65. package/config/util/currency.type.d.ts +39 -39
  66. package/config/yelon-util-config.d.ts +4 -4
  67. package/date-time/index.d.ts +2 -2
  68. package/date-time/picker.d.ts +68 -68
  69. package/date-time/time.d.ts +26 -26
  70. package/date-time/yelon-util-date-time.d.ts +4 -4
  71. package/decorator/convert.d.ts +24 -24
  72. package/decorator/index.d.ts +2 -2
  73. package/decorator/yelon-util-decorator.d.ts +4 -4
  74. package/decorator/zone-outside.d.ts +35 -35
  75. package/esm2015/array/array-type.service.js +1 -1
  76. package/esm2015/array/array.service.js +250 -250
  77. package/esm2015/array/index.js +2 -2
  78. package/esm2015/array/yelon-util-array.js +4 -4
  79. package/esm2015/browser/browser.js +4 -4
  80. package/esm2015/browser/cookie.service.js +103 -103
  81. package/esm2015/browser/copy.js +26 -26
  82. package/esm2015/browser/index.js +5 -5
  83. package/esm2015/browser/is-empty.js +18 -18
  84. package/esm2015/browser/scroll.service.js +88 -88
  85. package/esm2015/browser/style.js +37 -37
  86. package/esm2015/config/abc/date-picker.type.js +1 -1
  87. package/esm2015/config/abc/error-collect.type.js +1 -1
  88. package/esm2015/config/abc/image.type.js +1 -1
  89. package/esm2015/config/abc/index.js +16 -16
  90. package/esm2015/config/abc/loading.type.js +1 -1
  91. package/esm2015/config/abc/lodop.type.js +1 -1
  92. package/esm2015/config/abc/media.type.js +1 -1
  93. package/esm2015/config/abc/onboarding.type.js +1 -1
  94. package/esm2015/config/abc/page-header.type.js +1 -1
  95. package/esm2015/config/abc/pdf.type.js +1 -1
  96. package/esm2015/config/abc/qr.type.js +1 -1
  97. package/esm2015/config/abc/se.type.js +1 -1
  98. package/esm2015/config/abc/sg.type.js +1 -1
  99. package/esm2015/config/abc/st.type.js +2 -2
  100. package/esm2015/config/abc/sv.type.js +2 -2
  101. package/esm2015/config/abc/xlsx.type.js +1 -1
  102. package/esm2015/config/abc/zip.type.js +1 -1
  103. package/esm2015/config/acl/acl.type.js +1 -1
  104. package/esm2015/config/auth/auth.type.js +1 -1
  105. package/esm2015/config/bis/bis.type.js +1 -1
  106. package/esm2015/config/cache/cache.type.js +1 -1
  107. package/esm2015/config/chart/chart.type.js +1 -1
  108. package/esm2015/config/config.service.js +33 -33
  109. package/esm2015/config/config.types.js +8 -8
  110. package/esm2015/config/index.js +14 -14
  111. package/esm2015/config/mock/mock.type.js +1 -1
  112. package/esm2015/config/sf/sf.type.js +1 -1
  113. package/esm2015/config/stomp/stomp.type.js +1 -1
  114. package/esm2015/config/theme/http.type.js +1 -1
  115. package/esm2015/config/theme/i18n.type.js +1 -1
  116. package/esm2015/config/theme/index.js +3 -3
  117. package/esm2015/config/theme/responsive.type.js +1 -1
  118. package/esm2015/config/util/array.type.js +1 -1
  119. package/esm2015/config/util/currency.type.js +1 -1
  120. package/esm2015/config/yelon-util-config.js +4 -4
  121. package/esm2015/date-time/index.js +2 -2
  122. package/esm2015/date-time/picker.js +115 -115
  123. package/esm2015/date-time/time.js +83 -83
  124. package/esm2015/date-time/yelon-util-date-time.js +4 -4
  125. package/esm2015/decorator/convert.js +55 -55
  126. package/esm2015/decorator/index.js +2 -2
  127. package/esm2015/decorator/yelon-util-decorator.js +4 -4
  128. package/esm2015/decorator/zone-outside.js +54 -54
  129. package/esm2015/form/index.js +2 -2
  130. package/esm2015/form/match-control.js +29 -29
  131. package/esm2015/form/validators.js +80 -80
  132. package/esm2015/form/yelon-util-form.js +4 -4
  133. package/esm2015/format/currency.service.js +224 -224
  134. package/esm2015/format/currency.types.js +7 -7
  135. package/esm2015/format/index.js +4 -4
  136. package/esm2015/format/string.js +75 -75
  137. package/esm2015/format/validate.js +93 -93
  138. package/esm2015/format/yelon-util-format.js +4 -4
  139. package/esm2015/index.js +11 -11
  140. package/esm2015/math/in-range.js +24 -24
  141. package/esm2015/math/index.js +2 -2
  142. package/esm2015/math/round.js +52 -52
  143. package/esm2015/math/yelon-util-math.js +4 -4
  144. package/esm2015/other/assert.js +66 -66
  145. package/esm2015/other/deep.js +76 -76
  146. package/esm2015/other/index.js +4 -4
  147. package/esm2015/other/lazy.service.js +118 -118
  148. package/esm2015/other/logger.js +33 -36
  149. package/esm2015/other/yelon-util-other.js +4 -4
  150. package/esm2015/pipes/currency/cny.pipe.js +21 -21
  151. package/esm2015/pipes/currency/index.js +3 -3
  152. package/esm2015/pipes/currency/mega.pipe.js +25 -25
  153. package/esm2015/pipes/currency/module.js +13 -13
  154. package/esm2015/pipes/currency/price.pipe.js +25 -25
  155. package/esm2015/pipes/currency/yelon-util-pipes-currency.js +5 -5
  156. package/esm2015/pipes/filter/filter.pipe.js +14 -14
  157. package/esm2015/pipes/filter/index.js +2 -2
  158. package/esm2015/pipes/filter/module.js +11 -11
  159. package/esm2015/pipes/filter/yelon-util-pipes-filter.js +4 -4
  160. package/esm2015/pipes/format/index.js +2 -2
  161. package/esm2015/pipes/format/mask.pipe.js +29 -29
  162. package/esm2015/pipes/format/module.js +11 -11
  163. package/esm2015/pipes/format/yelon-util-pipes-format.js +4 -4
  164. package/esm2015/pipes/index.js +3 -3
  165. package/esm2015/pipes/yelon-util-pipes.js +4 -4
  166. package/esm2015/token/index.js +2 -2
  167. package/esm2015/token/page-visibility.js +15 -15
  168. package/esm2015/token/window.js +16 -16
  169. package/esm2015/token/yelon-util-token.js +4 -4
  170. package/esm2015/yelon-util.js +4 -4
  171. package/fesm2015/browser.js +257 -257
  172. package/fesm2015/yelon-util-array.js +246 -246
  173. package/fesm2015/yelon-util-array.js.map +1 -1
  174. package/fesm2015/yelon-util-config.js +36 -36
  175. package/fesm2015/yelon-util-date-time.js +196 -196
  176. package/fesm2015/yelon-util-decorator.js +107 -107
  177. package/fesm2015/yelon-util-form.js +108 -108
  178. package/fesm2015/yelon-util-format.js +390 -390
  179. package/fesm2015/yelon-util-math.js +75 -75
  180. package/fesm2015/yelon-util-other.js +281 -284
  181. package/fesm2015/yelon-util-other.js.map +1 -1
  182. package/fesm2015/yelon-util-pipes-currency.js +72 -72
  183. package/fesm2015/yelon-util-pipes-filter.js +22 -22
  184. package/fesm2015/yelon-util-pipes-format.js +36 -36
  185. package/fesm2015/yelon-util-pipes.js +2 -2
  186. package/fesm2015/yelon-util-token.js +25 -25
  187. package/fesm2015/yelon-util.js +2 -2
  188. package/form/index.d.ts +2 -2
  189. package/form/match-control.d.ts +15 -15
  190. package/form/validators.d.ts +62 -62
  191. package/form/yelon-util-form.d.ts +4 -4
  192. package/format/currency.service.d.ts +34 -34
  193. package/format/currency.types.d.ts +77 -77
  194. package/format/index.d.ts +4 -4
  195. package/format/string.d.ts +44 -44
  196. package/format/validate.d.ts +72 -72
  197. package/format/yelon-util-format.d.ts +4 -4
  198. package/index.d.ts +11 -11
  199. package/math/in-range.d.ts +14 -14
  200. package/math/index.d.ts +2 -2
  201. package/math/round.d.ts +33 -33
  202. package/math/yelon-util-math.d.ts +4 -4
  203. package/other/assert.d.ts +36 -36
  204. package/other/deep.d.ts +33 -33
  205. package/other/index.d.ts +4 -4
  206. package/other/lazy.service.d.ts +22 -22
  207. package/other/logger.d.ts +5 -6
  208. package/other/yelon-util-other.d.ts +4 -4
  209. package/other/yelon-util-other.metadata.json +1 -1
  210. package/package.json +1 -1
  211. package/pipes/currency/cny.pipe.d.ts +12 -12
  212. package/pipes/currency/index.d.ts +3 -3
  213. package/pipes/currency/mega.pipe.d.ts +13 -13
  214. package/pipes/currency/module.d.ts +2 -2
  215. package/pipes/currency/price.pipe.d.ts +16 -16
  216. package/pipes/currency/yelon-util-pipes-currency.d.ts +5 -5
  217. package/pipes/filter/filter.pipe.d.ts +10 -10
  218. package/pipes/filter/index.d.ts +2 -2
  219. package/pipes/filter/module.d.ts +2 -2
  220. package/pipes/filter/yelon-util-pipes-filter.d.ts +4 -4
  221. package/pipes/format/index.d.ts +2 -2
  222. package/pipes/format/mask.pipe.d.ts +24 -24
  223. package/pipes/format/module.d.ts +2 -2
  224. package/pipes/format/yelon-util-pipes-format.d.ts +4 -4
  225. package/pipes/index.d.ts +3 -3
  226. package/pipes/yelon-util-pipes.d.ts +4 -4
  227. package/token/index.d.ts +2 -2
  228. package/token/page-visibility.d.ts +8 -8
  229. package/token/window.d.ts +7 -7
  230. package/token/yelon-util-token.d.ts +4 -4
  231. package/yelon-util.d.ts +4 -4
@@ -1,431 +1,427 @@
1
- import { HttpHeaders, HttpParams } from '@angular/common/http';
2
- import { TemplateRef, TrackByFunction } from '@angular/core';
3
- import { Observable } from 'rxjs';
4
- import type { NzSafeAny } from 'ng-zorro-antd/core/types';
5
- import { NzDrawerOptions } from 'ng-zorro-antd/drawer';
6
- import { ModalOptions } from 'ng-zorro-antd/modal';
7
- import { PaginationItemRenderContext } from 'ng-zorro-antd/pagination';
8
- export interface YunzaiSTConfig {
9
- /**
10
- * 起始页码,默认为:`1`
11
- */
12
- pi?: number;
13
- /**
14
- * 每页数量,默认:`10`
15
- */
16
- ps?: number;
17
- /**
18
- * 是否显示边框,默认:`false`
19
- */
20
- bordered?: boolean;
21
- /**
22
- * table大小,默认:`default`
23
- */
24
- size?: 'small' | 'middle' | 'default';
25
- /**
26
- * 是否开启响应式,默认:`true`
27
- */
28
- responsive?: boolean;
29
- /**
30
- * 是否在小屏幕下才显示顶部与底部,默认:`false`
31
- */
32
- responsiveHideHeaderFooter?: boolean;
33
- /** 请求体配置 */
34
- req?: {
35
- /**
36
- * 分页类型,默认:`page`
37
- * - `page` 使用 `pi`,`ps` 组合
38
- * - `skip` 使用 `skip`,`limit` 组合
39
- */
40
- type?: 'page' | 'skip';
41
- /** 请求方法,默认:`GET` */
42
- method?: string;
43
- /** 请求体 `Header` */
44
- headers?: NzSafeAny;
45
- /**
46
- * 重命名参数 `pi`、`ps`,默认:`{ pi: 'pi', ps: 'ps', skip: 'skip', limit: 'limit' }`
47
- * - `{ pi: 'Page' }` => `pi` 会被替换成 Page
48
- */
49
- reName?: {
50
- pi?: string;
51
- ps?: string;
52
- skip?: string;
53
- limit?: string;
54
- };
55
- /**
56
- * 是否将请求所有参数数据都放入 `body` 当中(`url` 地址本身参数除外),仅当 `method: 'POST'` 时有效,默认:`false`
57
- */
58
- allInBody?: boolean;
59
- /**
60
- * 是否延迟加载数据,即渲染结束后不会主动发起请求,默认:`false`
61
- */
62
- lazyLoad?: boolean;
63
- /**
64
- * 请求前数据处理
65
- */
66
- process?: (requestOptions: NzSafeAny) => NzSafeAny;
67
- };
68
- /** 返回体配置 */
69
- res?: {
70
- /**
71
- * 重命名返回参数 `total`、`list`,默认:`{ list: ['list'], total: ['total'] }`
72
- * - `{ total: 'Total' }` => Total 会被当作 `total`
73
- */
74
- reName?: {
75
- total?: string | string[];
76
- list?: string | string[];
77
- };
78
- /**
79
- * 数据预处理
80
- */
81
- process?: (data: NzSafeAny[], rawData?: NzSafeAny) => NzSafeAny[];
82
- };
83
- /** 返回体配置 */
84
- page?: {
85
- /**
86
- * 前端分页,当 `data` 为`any[]` 或 `Observable<any[]>` 有效,默认:`true`
87
- * - `true` 由 `st` 根据 `data` 长度受控分页,包括:排序、过滤等
88
- * - `false` 由用户通过 `total` 和 `data` 参数受控分页,并维护 `(change)` 当分页变更时重新加载数据
89
- */
90
- front?: boolean;
91
- /**
92
- * 后端分页是否采用`0`基索引,只在`data`类型为`string`时有效,默认:`false`
93
- */
94
- zeroIndexed?: boolean;
95
- /**
96
- * 指定分页显示的位置,默认:`bottom`
97
- */
98
- position?: 'top' | 'bottom' | 'both';
99
- /**
100
- * 指定分页分页方向,默认:`right`
101
- */
102
- placement?: 'left' | 'center' | 'right';
103
- /**
104
- * 是否显示分页器,默认:`true`
105
- */
106
- show?: boolean;
107
- /**
108
- * 是否显示分页器中改变页数,默认:`false`
109
- */
110
- showSize?: boolean;
111
- /**
112
- * 分页器中每页显示条目数下拉框值,默认:`[10, 20, 30, 40, 50]`
113
- */
114
- pageSizes?: number[];
115
- /**
116
- * 是否显示分页器中快速跳转,默认:`false`
117
- */
118
- showQuickJumper?: boolean;
119
- /**
120
- * 是否显示总数据量,默认:`true`
121
- * - `boolean` 类型显示与否,默认模板:`共 {{total}} 条`
122
- * - `string` 自定义模板,模板变量:
123
- * - `{{total}}` 表示数据总量
124
- * - `{{range[0]}}` 表示当前页开始数量值
125
- * - `{{range[1]}}` 表示当前页结束数量值
126
- */
127
- total?: string | boolean;
128
- /**
129
- * 用于自定义页码的结构,用法参照 Pagination 组件
130
- */
131
- itemRender?: TemplateRef<PaginationItemRenderContext> | null;
132
- /**
133
- * 当添加该属性时,显示为简单分页,默认:`false`
134
- */
135
- simple?: boolean;
136
- /**
137
- * 切换分页时返回顶部,默认:`true`
138
- */
139
- toTop?: boolean;
140
- /**
141
- * 返回顶部偏移值,默认:`100`
142
- */
143
- toTopOffset?: number;
144
- };
145
- /**
146
- * 重命名排序值,`columns` 的重命名高于属性
147
- */
148
- sortReName?: {
149
- ascend?: string;
150
- descend?: string;
151
- };
152
- /**
153
- * 单排序规则
154
- * - 若不指定,则返回:`columnName=ascend|descend`
155
- * - 若指定,则返回:`sort=columnName.(ascend|descend)`
156
- */
157
- singleSort?: {
158
- /** 请求参数名,默认:`sort` */
159
- key?: string;
160
- /** 列名与状态间分隔符,默认:`.` */
161
- nameSeparator?: string;
162
- };
163
- /**
164
- * 是否多排序,当 `sort` 多个相同值时自动合并,建议后端支持时使用
165
- */
166
- multiSort?: {
167
- /** 请求参数名,默认:`sort` */
168
- key?: string;
169
- /** 不同属性间分隔符,默认:`-` */
170
- separator?: string;
171
- /** 列名与状态间分隔符,默认:`.` */
172
- nameSeparator?: string;
173
- /**
174
- * 是否以数组的形式传递参数
175
- * - `true` 表示使用 `url?sort=name.asc&sort=age.desc` 形式
176
- * - `false` 表示使用 `url?sort=name.asc-age.desc` 形式
177
- */
178
- arrayParam?: boolean;
179
- /**
180
- * 是否全局多排序模式,默认:`true`
181
- * - `true` 表示所有 `st` 默认为多排序
182
- * - `false` 表示需要为每个 `st` 添加 `multiSort` 才会视为多排序模式
183
- */
184
- global?: boolean;
185
- /**
186
- * 是否保持空值的键名,默认:`true`
187
- * - `true` 表示不管是否有排序都会发送 `key` 键名
188
- * - `false` 表示无排序动作时不会发送 `key` 键名
189
- */
190
- keepEmptyKey?: boolean;
191
- };
192
- /**
193
- * 按钮模态框配置
194
- */
195
- modal?: {
196
- /**
197
- * 指定模态框目标组件的接收参数名,默认:`record`
198
- */
199
- paramsName?: string;
200
- /** 大小;例如:lg、600,默认:`lg` */
201
- size?: 'sm' | 'md' | 'lg' | 'xl' | '' | number;
202
- /** 对话框 [ModalOptions](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/modal/modal-types.ts) 参数 */
203
- modalOptions?: ModalOptions;
204
- /** 是否精准(默认:`true`),若返回值非空值(`null`或`undefined`)视为成功,否则视为错误 */
205
- exact?: boolean;
206
- };
207
- /**
208
- * 按钮抽屉配置
209
- */
210
- drawer?: {
211
- /**
212
- * 抽屉目标组件的接收参数名,默认:`record`
213
- */
214
- paramsName?: string;
215
- /**
216
- * 大小;例如:lg、600,默认:`md`
217
- *
218
- * | 类型 | 默认大小 |
219
- * | --- | ------ |
220
- * | `sm` | `300` |
221
- * | `md` | `600` |
222
- * | `lg` | `900` |
223
- * | `xl` | `1200` |
224
- *
225
- * > 以上值,可通过覆盖相应的LESS参数自行调整
226
- */
227
- size?: 'sm' | 'md' | 'lg' | 'xl' | number;
228
- /**
229
- * 是否包含底部工具条,默认:`true`
230
- */
231
- footer?: boolean;
232
- /**
233
- * 底部工具条高度,默认:`55`
234
- */
235
- footerHeight?: number;
236
- /** 抽屉 [NzDrawerOptions](https://ng.ant.design/components/drawer/zh#nzdraweroptions) 参数 */
237
- drawerOptions?: NzDrawerOptions;
238
- };
239
- /**
240
- * 气泡参数
241
- */
242
- pop?: {
243
- /**
244
- * Title of the popover, default: `确认删除吗?`
245
- */
246
- title?: string;
247
- /**
248
- * Popover trigger mode, default: `click`
249
- */
250
- trigger?: 'click' | 'focus' | 'hover';
251
- /**
252
- * The position of the popover relative to the target, default: `top`
253
- */
254
- placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
255
- /**
256
- * Class name of the popover card
257
- */
258
- overlayClassName?: string;
259
- /**
260
- * Style of the popover card
261
- */
262
- overlayStyle?: {
263
- [key: string]: string;
264
- };
265
- /**
266
- * Text of the Cancel button
267
- */
268
- cancelText?: string;
269
- /**
270
- * Text of the Confirm button
271
- */
272
- okText?: string;
273
- /**
274
- * Button `type` of the Confirm button
275
- */
276
- okType?: 'primary' | 'ghost' | 'dashed' | 'danger' | 'default';
277
- /**
278
- * Customize icon of confirmation
279
- */
280
- icon?: string;
281
- };
282
- /**
283
- * 行单击多少时长之类为双击(单位:毫秒),默认:`200`
284
- */
285
- rowClickTime?: number;
286
- /**
287
- * 过滤按钮确认文本
288
- */
289
- filterConfirmText?: string;
290
- /**
291
- * 过滤按钮重置文本
292
- */
293
- filterClearText?: string;
294
- /**
295
- * 按钮图标
296
- */
297
- btnIcon?: {
298
- /** 图标主题风格,默认:`outline` */
299
- theme?: 'outline' | 'twotone' | 'fill';
300
- /** 是否有旋转动画,默认:`false` */
301
- spin?: boolean;
302
- /** 仅适用双色图标,设置双色图标的主要颜色,仅对当前 icon 生效 */
303
- twoToneColor?: string;
304
- /** 指定来自 IconFont 的图标类型 */
305
- iconfont?: string;
306
- };
307
- /**
308
- * 行号索引,默认:`1`
309
- * - 计算规则为:`index + noIndex`
310
- */
311
- noIndex?: number;
312
- /**
313
- * 表格行的类名
314
- */
315
- rowClassName?: (record: NzSafeAny, index: number) => string;
316
- /**
317
- * 通过点击行来展开子行,Default: `false`
318
- */
319
- expandRowByClick?: boolean;
320
- /**
321
- * 手风琴模式,Default: `false`
322
- */
323
- expandAccordion?: boolean;
324
- /**
325
- * 指定 `width` 模式
326
- */
327
- widthMode?: {
328
- /**
329
- * 宽度类型,默认:`default`
330
- * - `default` 默认行为
331
- * - `strict` 严格模式,即强制按 `width` 指定的宽度呈现,并根据 `strictBehavior` 类型处理
332
- */
333
- type?: 'strict' | 'default';
334
- /**
335
- * 严格模式的处理行为,默认:`truncate`
336
- * - `wrap` 强制换行
337
- * - `truncate` 截短
338
- */
339
- strictBehavior?: 'wrap' | 'truncate';
340
- };
341
- /**
342
- * Default: `54`
343
- */
344
- virtualItemSize?: number;
345
- /**
346
- * Default: `200`
347
- */
348
- virtualMaxBufferPx?: number;
349
- /**
350
- * Default: `100`
351
- */
352
- virtualMinBufferPx?: number;
353
- /**
354
- * The TrackByFunction to use for tracking changes
355
- */
356
- virtualForTrackBy?: TrackByFunction<unknown>;
357
- /**
358
- * Conditional expression rendering behavior, can be set to `hide` (default) or `disabled`, Default: `hide`
359
- */
360
- iifBehavior?: 'hide' | 'disabled';
361
- /**
362
- * The spinning indicator
363
- */
364
- loadingIndicator?: TemplateRef<void>;
365
- /**
366
- * Specifies a delay in milliseconds for loading state (prevent flush)
367
- */
368
- loadingDelay?: number;
369
- /**
370
- * Custom no result content
371
- */
372
- noResult?: string | TemplateRef<void>;
373
- /**
374
- * Safe rendering type, default: `safeHtml`
375
- *
376
- * 安全渲染方式,默认:`safeHtml`
377
- */
378
- safeType?: 'text' | 'html' | 'safeHtml';
379
- /**
380
- * Override the default request behavior, you can customize your own request implementation, for example: Graphql
381
- *
382
- * 覆盖默认的请求行为,可以自定义自己的请求实现,例如:Graphql
383
- */
384
- customRequest?: (options: {
385
- method: string;
386
- url: string;
387
- options: {
388
- body?: unknown;
389
- headers?: HttpHeaders | {
390
- [header: string]: string | string[];
391
- };
392
- params?: HttpParams | {
393
- [param: string]: string | string[];
394
- };
395
- };
396
- }) => Observable<NzSafeAny>;
397
- /**
398
- * Date format
399
- *
400
- * 日期格式化
401
- */
402
- date?: {
403
- /**
404
- * Format string, default: `yyyy-MM-dd HH:mm`
405
- *
406
- * 格式化字符串,默认:`yyyy-MM-dd HH:mm`
407
- */
408
- format: string;
409
- };
410
- yn?: {
411
- /**
412
- * 真值条件,(默认:`true`)
413
- */
414
- truth?: unknown;
415
- /**
416
- * 徽章 `true` 时文本,(默认:`是`)
417
- */
418
- yes?: string;
419
- /**
420
- * 徽章 `false` 时文本,(默认:`否`)
421
- */
422
- no?: string;
423
- /**
424
- * 徽章显示风格,默认:`icon`
425
- * - `full` 图标和文本
426
- * - `icon` 图标
427
- * - `text` 文本
428
- */
429
- mode?: 'full' | 'icon' | 'text';
430
- };
431
- }
1
+ import { HttpHeaders, HttpParams } from '@angular/common/http';
2
+ import { TemplateRef, TrackByFunction } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import type { NzSafeAny } from 'ng-zorro-antd/core/types';
5
+ import { NzDrawerOptions } from 'ng-zorro-antd/drawer';
6
+ import { ModalOptions } from 'ng-zorro-antd/modal';
7
+ import { PaginationItemRenderContext } from 'ng-zorro-antd/pagination';
8
+ export interface YunzaiSTConfig {
9
+ /**
10
+ * 起始页码,默认为:`1`
11
+ */
12
+ pi?: number;
13
+ /**
14
+ * 每页数量,默认:`10`
15
+ */
16
+ ps?: number;
17
+ /**
18
+ * 是否显示边框,默认:`false`
19
+ */
20
+ bordered?: boolean;
21
+ /**
22
+ * table大小,默认:`default`
23
+ */
24
+ size?: 'small' | 'middle' | 'default';
25
+ /**
26
+ * 是否开启响应式,默认:`true`
27
+ */
28
+ responsive?: boolean;
29
+ /**
30
+ * 是否在小屏幕下才显示顶部与底部,默认:`false`
31
+ */
32
+ responsiveHideHeaderFooter?: boolean;
33
+ /** 请求体配置 */
34
+ req?: {
35
+ /**
36
+ * 分页类型,默认:`page`
37
+ * - `page` 使用 `pi`,`ps` 组合
38
+ * - `skip` 使用 `skip`,`limit` 组合
39
+ */
40
+ type?: 'page' | 'skip';
41
+ /** 请求方法,默认:`GET` */
42
+ method?: string;
43
+ /** 请求体 `Header` */
44
+ headers?: NzSafeAny;
45
+ /**
46
+ * 重命名参数 `pi`、`ps`,默认:`{ pi: 'pi', ps: 'ps', skip: 'skip', limit: 'limit' }`
47
+ * - `{ pi: 'Page' }` => `pi` 会被替换成 Page
48
+ */
49
+ reName?: {
50
+ pi?: string;
51
+ ps?: string;
52
+ skip?: string;
53
+ limit?: string;
54
+ };
55
+ /**
56
+ * 是否将请求所有参数数据都放入 `body` 当中(`url` 地址本身参数除外),仅当 `method: 'POST'` 时有效,默认:`false`
57
+ */
58
+ allInBody?: boolean;
59
+ /**
60
+ * 是否延迟加载数据,即渲染结束后不会主动发起请求,默认:`false`
61
+ */
62
+ lazyLoad?: boolean;
63
+ /**
64
+ * 请求前数据处理
65
+ */
66
+ process?: (requestOptions: NzSafeAny) => NzSafeAny;
67
+ };
68
+ /** 返回体配置 */
69
+ res?: {
70
+ /**
71
+ * 重命名返回参数 `total`、`list`,默认:`{ list: ['list'], total: ['total'] }`
72
+ * - `{ total: 'Total' }` => Total 会被当作 `total`
73
+ */
74
+ reName?: {
75
+ total?: string | string[];
76
+ list?: string | string[];
77
+ };
78
+ /**
79
+ * 数据预处理
80
+ */
81
+ process?: (data: NzSafeAny[], rawData?: NzSafeAny) => NzSafeAny[];
82
+ };
83
+ /** 返回体配置 */
84
+ page?: {
85
+ /**
86
+ * 前端分页,当 `data` 为`any[]` 或 `Observable<any[]>` 有效,默认:`true`
87
+ * - `true` 由 `st` 根据 `data` 长度受控分页,包括:排序、过滤等
88
+ * - `false` 由用户通过 `total` 和 `data` 参数受控分页,并维护 `(change)` 当分页变更时重新加载数据
89
+ */
90
+ front?: boolean;
91
+ /**
92
+ * 后端分页是否采用`0`基索引,只在`data`类型为`string`时有效,默认:`false`
93
+ */
94
+ zeroIndexed?: boolean;
95
+ /**
96
+ * 指定分页显示的位置,默认:`bottom`
97
+ */
98
+ position?: 'top' | 'bottom' | 'both';
99
+ /**
100
+ * 指定分页分页方向,默认:`right`
101
+ */
102
+ placement?: 'left' | 'center' | 'right';
103
+ /**
104
+ * 是否显示分页器,默认:`true`
105
+ */
106
+ show?: boolean;
107
+ /**
108
+ * 是否显示分页器中改变页数,默认:`false`
109
+ */
110
+ showSize?: boolean;
111
+ /**
112
+ * 分页器中每页显示条目数下拉框值,默认:`[10, 20, 30, 40, 50]`
113
+ */
114
+ pageSizes?: number[];
115
+ /**
116
+ * 是否显示分页器中快速跳转,默认:`false`
117
+ */
118
+ showQuickJumper?: boolean;
119
+ /**
120
+ * 是否显示总数据量,默认:`true`
121
+ * - `boolean` 类型显示与否,默认模板:`共 {{total}} 条`
122
+ * - `string` 自定义模板,模板变量:
123
+ * - `{{total}}` 表示数据总量
124
+ * - `{{range[0]}}` 表示当前页开始数量值
125
+ * - `{{range[1]}}` 表示当前页结束数量值
126
+ */
127
+ total?: string | boolean;
128
+ /**
129
+ * 用于自定义页码的结构,用法参照 Pagination 组件
130
+ */
131
+ itemRender?: TemplateRef<PaginationItemRenderContext> | null;
132
+ /**
133
+ * 当添加该属性时,显示为简单分页,默认:`false`
134
+ */
135
+ simple?: boolean;
136
+ /**
137
+ * 切换分页时返回顶部,默认:`true`
138
+ */
139
+ toTop?: boolean;
140
+ /**
141
+ * 返回顶部偏移值,默认:`100`
142
+ */
143
+ toTopOffset?: number;
144
+ };
145
+ /**
146
+ * 重命名排序值,`columns` 的重命名高于属性
147
+ */
148
+ sortReName?: {
149
+ ascend?: string;
150
+ descend?: string;
151
+ };
152
+ /**
153
+ * 单排序规则
154
+ * - 若不指定,则返回:`columnName=ascend|descend`
155
+ * - 若指定,则返回:`sort=columnName.(ascend|descend)`
156
+ */
157
+ singleSort?: {
158
+ /** 请求参数名,默认:`sort` */
159
+ key?: string;
160
+ /** 列名与状态间分隔符,默认:`.` */
161
+ nameSeparator?: string;
162
+ };
163
+ /**
164
+ * 是否多排序,当 `sort` 多个相同值时自动合并,建议后端支持时使用
165
+ */
166
+ multiSort?: {
167
+ /** 请求参数名,默认:`sort` */
168
+ key?: string;
169
+ /** 不同属性间分隔符,默认:`-` */
170
+ separator?: string;
171
+ /** 列名与状态间分隔符,默认:`.` */
172
+ nameSeparator?: string;
173
+ /**
174
+ * 是否以数组的形式传递参数
175
+ * - `true` 表示使用 `url?sort=name.asc&sort=age.desc` 形式
176
+ * - `false` 表示使用 `url?sort=name.asc-age.desc` 形式
177
+ */
178
+ arrayParam?: boolean;
179
+ /**
180
+ * 是否全局多排序模式,默认:`true`
181
+ * - `true` 表示所有 `st` 默认为多排序
182
+ * - `false` 表示需要为每个 `st` 添加 `multiSort` 才会视为多排序模式
183
+ */
184
+ global?: boolean;
185
+ /**
186
+ * 是否保持空值的键名,默认:`true`
187
+ * - `true` 表示不管是否有排序都会发送 `key` 键名
188
+ * - `false` 表示无排序动作时不会发送 `key` 键名
189
+ */
190
+ keepEmptyKey?: boolean;
191
+ };
192
+ /**
193
+ * 按钮模态框配置
194
+ */
195
+ modal?: {
196
+ /**
197
+ * 指定模态框目标组件的接收参数名,默认:`record`
198
+ */
199
+ paramsName?: string;
200
+ /** 大小;例如:lg、600,默认:`lg` */
201
+ size?: 'sm' | 'md' | 'lg' | 'xl' | '' | number;
202
+ /** 对话框 [ModalOptions](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/modal/modal-types.ts) 参数 */
203
+ modalOptions?: ModalOptions;
204
+ /** 是否精准(默认:`true`),若返回值非空值(`null`或`undefined`)视为成功,否则视为错误 */
205
+ exact?: boolean;
206
+ };
207
+ /**
208
+ * 按钮抽屉配置
209
+ */
210
+ drawer?: {
211
+ /**
212
+ * 抽屉目标组件的接收参数名,默认:`record`
213
+ */
214
+ paramsName?: string;
215
+ /**
216
+ * 大小;例如:lg、600,默认:`md`
217
+ *
218
+ * | 类型 | 默认大小 |
219
+ * | --- | ------ |
220
+ * | `sm` | `300` |
221
+ * | `md` | `600` |
222
+ * | `lg` | `900` |
223
+ * | `xl` | `1200` |
224
+ *
225
+ * > 以上值,可通过覆盖相应的LESS参数自行调整
226
+ */
227
+ size?: 'sm' | 'md' | 'lg' | 'xl' | number;
228
+ /**
229
+ * 是否包含底部工具条,默认:`true`
230
+ */
231
+ footer?: boolean;
232
+ /**
233
+ * 底部工具条高度,默认:`55`
234
+ */
235
+ footerHeight?: number;
236
+ /** 抽屉 [NzDrawerOptions](https://ng.ant.design/components/drawer/zh#nzdraweroptions) 参数 */
237
+ drawerOptions?: NzDrawerOptions;
238
+ };
239
+ /**
240
+ * 气泡参数
241
+ */
242
+ pop?: {
243
+ /**
244
+ * Title of the popover, default: `确认删除吗?`
245
+ */
246
+ title?: string;
247
+ /**
248
+ * Popover trigger mode, default: `click`
249
+ */
250
+ trigger?: 'click' | 'focus' | 'hover';
251
+ /**
252
+ * The position of the popover relative to the target, default: `top`
253
+ */
254
+ placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
255
+ /**
256
+ * Class name of the popover card
257
+ */
258
+ overlayClassName?: string;
259
+ /**
260
+ * Style of the popover card
261
+ */
262
+ overlayStyle?: {
263
+ [key: string]: string;
264
+ };
265
+ /**
266
+ * Text of the Cancel button
267
+ */
268
+ cancelText?: string;
269
+ /**
270
+ * Text of the Confirm button
271
+ */
272
+ okText?: string;
273
+ /**
274
+ * Button `type` of the Confirm button
275
+ */
276
+ okType?: 'primary' | 'ghost' | 'dashed' | 'danger' | 'default';
277
+ /**
278
+ * Customize icon of confirmation
279
+ */
280
+ icon?: string;
281
+ };
282
+ /**
283
+ * 过滤按钮确认文本
284
+ */
285
+ filterConfirmText?: string;
286
+ /**
287
+ * 过滤按钮重置文本
288
+ */
289
+ filterClearText?: string;
290
+ /**
291
+ * 按钮图标
292
+ */
293
+ btnIcon?: {
294
+ /** 图标主题风格,默认:`outline` */
295
+ theme?: 'outline' | 'twotone' | 'fill';
296
+ /** 是否有旋转动画,默认:`false` */
297
+ spin?: boolean;
298
+ /** 仅适用双色图标,设置双色图标的主要颜色,仅对当前 icon 生效 */
299
+ twoToneColor?: string;
300
+ /** 指定来自 IconFont 的图标类型 */
301
+ iconfont?: string;
302
+ };
303
+ /**
304
+ * 行号索引,默认:`1`
305
+ * - 计算规则为:`index + noIndex`
306
+ */
307
+ noIndex?: number;
308
+ /**
309
+ * 表格行的类名
310
+ */
311
+ rowClassName?: (record: NzSafeAny, index: number) => string;
312
+ /**
313
+ * 通过点击行来展开子行,Default: `false`
314
+ */
315
+ expandRowByClick?: boolean;
316
+ /**
317
+ * 手风琴模式,Default: `false`
318
+ */
319
+ expandAccordion?: boolean;
320
+ /**
321
+ * 指定 `width` 模式
322
+ */
323
+ widthMode?: {
324
+ /**
325
+ * 宽度类型,默认:`default`
326
+ * - `default` 默认行为
327
+ * - `strict` 严格模式,即强制按 `width` 指定的宽度呈现,并根据 `strictBehavior` 类型处理
328
+ */
329
+ type?: 'strict' | 'default';
330
+ /**
331
+ * 严格模式的处理行为,默认:`truncate`
332
+ * - `wrap` 强制换行
333
+ * - `truncate` 截短
334
+ */
335
+ strictBehavior?: 'wrap' | 'truncate';
336
+ };
337
+ /**
338
+ * Default: `54`
339
+ */
340
+ virtualItemSize?: number;
341
+ /**
342
+ * Default: `200`
343
+ */
344
+ virtualMaxBufferPx?: number;
345
+ /**
346
+ * Default: `100`
347
+ */
348
+ virtualMinBufferPx?: number;
349
+ /**
350
+ * The TrackByFunction to use for tracking changes
351
+ */
352
+ virtualForTrackBy?: TrackByFunction<unknown>;
353
+ /**
354
+ * Conditional expression rendering behavior, can be set to `hide` (default) or `disabled`, Default: `hide`
355
+ */
356
+ iifBehavior?: 'hide' | 'disabled';
357
+ /**
358
+ * The spinning indicator
359
+ */
360
+ loadingIndicator?: TemplateRef<void>;
361
+ /**
362
+ * Specifies a delay in milliseconds for loading state (prevent flush)
363
+ */
364
+ loadingDelay?: number;
365
+ /**
366
+ * Custom no result content
367
+ */
368
+ noResult?: string | TemplateRef<void>;
369
+ /**
370
+ * Safe rendering type, default: `safeHtml`
371
+ *
372
+ * 安全渲染方式,默认:`safeHtml`
373
+ */
374
+ safeType?: 'text' | 'html' | 'safeHtml';
375
+ /**
376
+ * Override the default request behavior, you can customize your own request implementation, for example: Graphql
377
+ *
378
+ * 覆盖默认的请求行为,可以自定义自己的请求实现,例如:Graphql
379
+ */
380
+ customRequest?: (options: {
381
+ method: string;
382
+ url: string;
383
+ options: {
384
+ body?: unknown;
385
+ headers?: HttpHeaders | {
386
+ [header: string]: string | string[];
387
+ };
388
+ params?: HttpParams | {
389
+ [param: string]: string | string[];
390
+ };
391
+ };
392
+ }) => Observable<NzSafeAny>;
393
+ /**
394
+ * Date format
395
+ *
396
+ * 日期格式化
397
+ */
398
+ date?: {
399
+ /**
400
+ * Format string, default: `yyyy-MM-dd HH:mm`
401
+ *
402
+ * 格式化字符串,默认:`yyyy-MM-dd HH:mm`
403
+ */
404
+ format: string;
405
+ };
406
+ yn?: {
407
+ /**
408
+ * 真值条件,(默认:`true`)
409
+ */
410
+ truth?: unknown;
411
+ /**
412
+ * 徽章 `true` 时文本,(默认:`是`)
413
+ */
414
+ yes?: string;
415
+ /**
416
+ * 徽章 `false` 时文本,(默认:`否`)
417
+ */
418
+ no?: string;
419
+ /**
420
+ * 徽章显示风格,默认:`icon`
421
+ * - `full` 图标和文本
422
+ * - `icon` 图标
423
+ * - `text` 文本
424
+ */
425
+ mode?: 'full' | 'icon' | 'text';
426
+ };
427
+ }