@yibozhang/pro-table 0.1.2 → 0.1.4

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pro-table.component.less.shim.ngstyle.d.ts","sourceRoot":"D:/projects/vps-front/Front/DasPMSWeb/lib/pro-table/src/","sources":["lib/pro-table.component.less.shim.ngstyle.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=modal-width-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-width-detector.d.ts","sourceRoot":"D:/projects/vps-front/Front/DasPMSWeb/lib/pro-table/src/","sources":["lib/utils/modal-width-detector.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yibozhang/pro-table",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "基于 Angular 和 ng-zorro-antd 的高级表格组件库",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/public-api.d.ts CHANGED
@@ -12,4 +12,5 @@ export { AntdFormService } from "./lib/page-public/antd-form";
12
12
  export type { FieldErrorMessage, FieldErrorMessages, FieldConfig, FormModifyType, FormConfig, WatchOptions, AddFieldsConfigOptions, AddFieldsConfigResult, RemoveFieldsConfigOptions, RemoveFieldsConfigResult, } from "./lib/page-public/antd-form";
13
13
  export { ArrayFormService } from "./lib/page-public/array-form";
14
14
  export type { ValidationResult, FieldValidator, FieldConfig as ArrayFieldConfig, ArrayFormRow, ArrayFormConfig, ArrayFormStoreItem, ArrayFormStore, } from "./lib/page-public/array-form";
15
+ import "./lib/utils/modal-width-detector";
15
16
  //# sourceMappingURL=public-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"D:/projects/vps-front/Front/DasPMSWeb/lib/pro-table/src/","sources":["public-api.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oCAAoC,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,IAAI,gBAAgB,EAC/B,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"D:/projects/vps-front/Front/DasPMSWeb/lib/pro-table/src/","sources":["public-api.ts"],"names":[],"mappings":"AAIA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oCAAoC,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,IAAI,gBAAgB,EAC/B,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,kCAAkC,CAAC"}
@@ -4,11 +4,19 @@
4
4
  &.ant-btn-primary:not([disabled]):hover,
5
5
  &.ant-btn-primary:not([disabled]):focus {
6
6
  background: @primary-color !important;
7
+ }
8
+ &.ant-btn:not([disabled]):hover,
9
+ &.ant-btn:not([disabled]):focus {
7
10
  border-color: @primary-color !important;
8
11
  }
12
+ &.ant-btn-primary[disabled] {
13
+ background: @custom-primary-disabled-bg !important;
14
+ color: @custom-primary-disabled-color !important;
15
+ border-color: transparent !important;
16
+ }
9
17
  }
10
18
 
11
- // 输入框相关设置
19
+ // 选择框相关设置
12
20
  .ant-select {
13
21
  &.ant-select-disabled .ant-select-selection-item {
14
22
  color: @form-item-disabled-color;
@@ -18,17 +26,17 @@
18
26
  // 表格相关设置
19
27
  .ant-table {
20
28
  .ant-table-thead th {
21
- font-weight: bold;
29
+ font-weight: 700;
22
30
  }
23
31
 
24
32
  .ant-table-row {
25
- height: 38px !important;
33
+ height: 36px !important;
26
34
  }
27
35
  .ant-table-tbody > .ant-table-custom-row-even {
28
- background-color: #fff;
36
+ background-color: @custom-table-row-even-bg;
29
37
  }
30
38
  .ant-table-tbody > .ant-table-custom-row-odd {
31
- background-color: #fafafa;
39
+ background-color: @custom-table-row-odd-bg;
32
40
  }
33
41
  .ant-table-tbody > .ant-table-custom-row-selected {
34
42
  background-color: @table-row-hover-bg;
@@ -37,7 +45,7 @@
37
45
  .ant-table-tbody > .ant-table-row:nth-child(even) {
38
46
  .ant-table-cell-fix-left,
39
47
  .ant-table-cell-fix-right {
40
- background-color: #fafafa;
48
+ background-color: @custom-table-row-odd-bg;
41
49
  }
42
50
  }
43
51
  // 偶数行 hover 时同步覆盖固定列背景色,保持与行 hover 一致
@@ -48,9 +56,9 @@
48
56
  }
49
57
  }
50
58
  .ant-table-tbody > tr > td:not([class*="nz-disable-td"]) {
51
- padding: 0 12px !important;
59
+ padding: @custom-table-padding-vertical @custom-table-padding-horizontal !important;
52
60
  }
53
- .ant-table-tbody > tr > td.nz-disable-td{
61
+ .ant-table-tbody > tr > td.nz-disable-td {
54
62
  padding-left: 0 !important;
55
63
  padding-right: 0 !important;
56
64
  }
@@ -60,6 +68,9 @@
60
68
  .ant-table-pagination,
61
69
  .ant-pagination {
62
70
  position: relative;
71
+ margin: @custom-table-pagination-margin-vertical
72
+ @custom-table-pagination-margin-horizontal !important;
73
+
63
74
  .ant-pagination-item-active > a {
64
75
  color: @pagination-item-color-active;
65
76
  }
@@ -79,18 +90,49 @@
79
90
  .ant-pagination-prev {
80
91
  margin-right: 8px !important;
81
92
  }
82
- .ant-pagination-next {
83
- margin-left: 8px !important;
84
- }
85
93
  .ant-pagination-total-text {
86
94
  position: absolute;
87
95
  left: 0;
88
96
  color: #7c7c7c;
89
97
  }
98
+ .ant-pagination-disabled {
99
+ background-color: @custom-pagination-disabled-bg !important;
100
+ border: 1px solid @custom-pagination-disabled-border-color !important;
101
+ .ant-pagination-item-link > .anticon {
102
+ color: @custom-pagination-disabled-border-color !important;
103
+ }
104
+ }
105
+ .ant-pagination-options {
106
+ margin-left: 8px !important;
107
+ }
108
+ .ant-pagination-item {
109
+ margin: 0 8px 0 0 !important;
110
+ &:not(.ant-pagination-item-active) {
111
+ background: #fff !important;
112
+ border: 1px solid @border-color-base !important;
113
+ a {
114
+ color: @custom-label-color !important;
115
+ }
116
+ }
117
+ &:not(.ant-pagination-item-active):hover {
118
+ background-color: @disabled-bg !important;
119
+ }
120
+ &:not(.ant-pagination-item-active):active {
121
+ background-color: @custom-pagination-active-bg !important;
122
+ }
123
+ }
124
+ a {
125
+ text-decoration: none;
126
+ }
90
127
  }
91
128
 
129
+ // InputNumber相关设置
92
130
  .ant-input-number {
93
131
  width: 100%;
132
+ .ant-input-number-input {
133
+ padding-left: @custom-input-number-padding-horizontal-base;
134
+ padding-right: @custom-input-number-padding-horizontal-base;
135
+ }
94
136
  }
95
137
 
96
138
  .ant-dropdown-menu {
@@ -110,6 +152,114 @@
110
152
  }
111
153
  }
112
154
 
155
+ // Switch相关设置
156
+ .ant-switch {
157
+ background-color: @primary-color;
158
+ &.ant-switch-checked {
159
+ background-color: #bfbfbf;
160
+ }
161
+ }
162
+
163
+ // Radio相关设置
164
+ .ant-radio-group {
165
+ & > label > span:last-child {
166
+ padding-left: @custom-radio-padding-horizontal;
167
+ padding-right: @custom-radio-padding-horizontal;
168
+ }
169
+ & > label:not([class*="ant-radio-wrapper-disabled"]) > span:last-child {
170
+ color: @custom-text-color2;
171
+ }
172
+ & > label[class*="ant-radio-wrapper-disabled"] > span:last-child {
173
+ color: @custom-text-color5;
174
+ }
175
+ }
176
+
177
+ // Form相关设置
178
+ [nz-form] {
179
+ .ant-form-item-explain-error {
180
+ font-size: @custom-form-item-error-font-size;
181
+ color: @label-required-color;
182
+ height: 23px;
183
+ line-height: 23px;
184
+ }
185
+ }
186
+
187
+ // Checkbox相关设置
188
+ [nz-checkbox] {
189
+ & > span:last-child {
190
+ padding-left: @custom-checkbox-padding-horizontal;
191
+ padding-right: @custom-checkbox-padding-horizontal;
192
+ }
193
+ }
194
+
195
+ // Modal相关设置
196
+ .ant-modal:not([class*="ant-modal-confirm"]) {
197
+ .ant-modal-body {
198
+ padding: 16px 32px 24px 32px;
199
+
200
+ // 当宽度小于 500px 时应用特殊 padding
201
+ &.narrow-width {
202
+ padding: 16px 0px 24px 0px;
203
+ }
204
+ }
205
+ }
206
+
207
+ // Modal Confirm相关设置
208
+ .ant-modal:has([class*="ant-modal-confirm"]) {
209
+ .ant-modal-confirm-body {
210
+ .anticon {
211
+ font-size: @custom-modal-confirm-icon-size;
212
+ margin-right: 8px;
213
+ }
214
+ .ant-modal-confirm-title {
215
+ color: @custom-modal-confirm-title-color;
216
+ font-weight: bold;
217
+ font-size: @custom-modal-confirm-title-font-size;
218
+ }
219
+ }
220
+ .ant-modal-confirm-btns {
221
+ margin: @custom-modal-confirm-btns-margin;
222
+ }
223
+ }
224
+
225
+ // Message相关设置
226
+ .ant-message {
227
+ .ant-message-notice-content {
228
+ color: @custom-text-color2;
229
+ i {
230
+ font-size: @custom-modal-confirm-icon-size;
231
+ margin-right: 8px;
232
+ }
233
+ span {
234
+ position: relative;
235
+ top: -2px;
236
+ }
237
+ }
238
+ }
239
+
240
+ // Step相关设置
241
+ .ant-steps {
242
+ .ant-steps-item-active {
243
+ .ant-steps-item-title,
244
+ .ant-steps-item-description {
245
+ color: @custom-step-color !important;
246
+ }
247
+ }
248
+ .ant-steps-item-wait {
249
+ .ant-steps-item-icon {
250
+ border: none;
251
+ background: @custom-step-wait-icon-background;
252
+ }
253
+ .ant-steps-item-title,
254
+ .ant-steps-item-description {
255
+ color: @custom-step-wait-color !important;
256
+ }
257
+ }
258
+ .ant-steps-icon {
259
+ top: 0 !important;
260
+ }
261
+ }
262
+
113
263
  /* 使用 CSS 变量,避免 JS 动态修改样式 */
114
264
  [class^="ant-form-custom"] .ant-form-item-label:not([custom-width]) {
115
265
  width: var(--label-width, 120px) !important;
@@ -126,4 +276,4 @@
126
276
 
127
277
  [class^="ant-form-custom"] .ant-form-item-label[custom-align] {
128
278
  text-align: attr(custom-align) !important;
129
- }
279
+ }
@@ -1,45 +1,106 @@
1
1
  // 注意:此文件只包含变量定义和样式覆盖
2
2
  // 使用者项目需要先导入 ng-zorro-antd 的样式,然后再导入此文件
3
3
  // 例如:@import "~ng-zorro-antd/ng-zorro-antd.less"; @import "~@yibozhang/pro-table/src/lib/styles/theme.less";
4
+ // 自定义变量
5
+ @custom-table-pagination-margin-vertical: 8px;
6
+ @custom-table-pagination-margin-horizontal: 0px;
7
+ @custom-table-padding-horizontal: 8px;
8
+ @custom-table-padding-vertical: 0px;
9
+ @custom-table-row-even-bg: #fff;
10
+ @custom-table-row-odd-bg: #fafafa;
11
+ @custom-scrollbar-thumb-bg: rgba(0, 0, 0, 0.45);
12
+ @custom-scrollbar-width: 5px;
13
+ @custom-scrollbar-height: 5px;
14
+ @custom-scrollbar-border-radius: 2.5px;
15
+ @custom-label-color: @custom-text-color3;
16
+ @custom-primary-disabled-bg: rgba(9, 109, 217, 0.5);
17
+ @custom-primary-disabled-color: rgba(255, 255, 255, 0.5);
18
+ @custom-pagination-disabled-bg: #fff;
19
+ @custom-pagination-disabled-border-color: @border-color-base;
20
+ @custom-pagination-active-bg: rgba(9, 109, 217, 0.1);
21
+ @custom-aside-subnav-bg: #fafafa;
22
+ @custom-aside-subnav-active-bg: rgba(9, 109, 217, 0.1);
23
+ @custom-text-color1: #fff;
24
+ @custom-text-color2: #1d1d1d;
25
+ @custom-text-color3: #5a5a5a;
26
+ @custom-text-color4: #7c7c7c;
27
+ @custom-text-color5: #9d9d9d;
28
+ @custom-text-color6: @primary-color;
29
+ @custom-form-item-error-font-size: 12px;
30
+ @custom-input-number-padding-horizontal-base: 8px;
31
+ @custom-checkbox-padding-horizontal: 4px;
32
+ @custom-radio-padding-horizontal: 4px;
33
+ @custom-modal-confirm-title-color: @custom-text-color2;
34
+ @custom-modal-confirm-header-margin: 0px 0px 16px 0px;
35
+ @custom-modal-confirm-title-font-size: 14px;
36
+ @custom-modal-confirm-icon-size: 20px;
37
+ @custom-modal-confirm-btns-margin: 16px 0px 0px 0px;
38
+ @custom-step-color: @custom-text-color2;
39
+ @custom-step-wait-color: #A3A3A3;
40
+ @custom-step-wait-icon-background: @border-color-base;
4
41
 
5
42
  @primary-color: #096dd9;
6
43
  @primary-5: @primary-color;
7
44
  @font-family: "Microsoft Yahei", "Helvetica Neue", Helvetica Neue, Helvetica,
8
45
  Arial, Lantinghei SC, Hiragino Sans GB, sans-serif;
9
- @disabled-color: #8d8d8d;
46
+ @disabled-color: @custom-text-color4;
10
47
  @disabled-bg: #f5f5f5;
11
48
  @border-radius-base: 4px;
12
49
  @border-color-base: #d9d9d9;
13
50
  @form-item-disabled-color: #484848;
14
51
  @border-color-split: #e8e8e8;
15
52
 
16
-
17
53
  // Input
18
- @input-placeholder-color: #c0c0c0;
54
+ @input-placeholder-color: @custom-text-color5;
19
55
  @input-padding-horizontal-base: 8px;
20
- @input-disabled-bg: #0000000a;
21
- @input-disabled-color: @form-item-disabled-color;
56
+ @input-disabled-bg: @disabled-bg;
57
+ @input-disabled-color: @custom-text-color4;
58
+ @input-color: @custom-text-color2;
22
59
 
23
60
  // Select
24
- @select-item-selected-bg: @primary-color;
25
- @select-item-active-bg: #eaeaea;
26
- @select-item-selected-color: #fff;
27
-
28
- // Radio
29
- @radio-dot-disabled-color: #00000040;
61
+ @select-item-selected-bg: rgba(9, 109, 217, 0.1);
62
+ @select-item-active-bg: #f5f5f5;
63
+ @select-item-selected-color: @custom-text-color2;
30
64
 
31
65
  // Form
32
- @form-item-margin-bottom: 24px;
33
- @label-required-color: #f4222d;
66
+ @form-item-margin-bottom: 16px;
67
+ @label-required-color: #f25d5d;
68
+ @label-color: @custom-text-color3;
34
69
 
35
70
  // Table
36
71
  @table-header-bg: #f0f0f0;
37
- @table-header-color:#5A5A5A;
38
- @table-row-hover-bg: #e1ebf5;
39
- @table-padding-horizontal-sm:12px;
72
+ @table-header-color: #5a5a5a;
73
+ @table-row-hover-bg: rgba(9, 109, 217, 0.1);
74
+ @table-padding-horizontal-sm: 8px;
40
75
  @table-border-color: @border-color-split;
41
76
 
42
77
  // Pagination
43
- @pagination-item-bg-active:@primary-color;
44
- @pagination-item-color-active:#fff;
78
+ @pagination-item-bg-active: @primary-color;
79
+ @pagination-item-color-active: #fff;
80
+
81
+ // Button
82
+ @btn-padding-horizontal-base: 16px;
83
+ @btn-padding-horizontal-lg: 16px;
84
+ @btn-padding-horizontal-sm: 8px;
85
+
86
+ // Tabs
87
+ @tabs-horizontal-padding: 14px 0;
88
+ @tabs-horizontal-margin: 0 24px 0 0;
89
+
90
+ // Checkbox
91
+ @checkbox-size: 14px;
92
+
93
+ //Modal
94
+ @modal-header-padding-vertical: 0px;
95
+ @modal-header-title-line-height: 40px;
96
+ @modal-header-close-size: 40px;
97
+ @modal-confirm-body-padding: 16px 24px 16px 24px;
98
+
99
+ // Message
100
+ @message-notice-content-padding: 8px 32px 8px 16px;
101
+
102
+ // Step
103
+ @steps-icon-font-size: 14px;
45
104
 
105
+ // DropDown
106
+ @dropdown-selected-color: rgba(9, 109, 217, 0.1);