ngx-tethys 20.0.2 → 20.0.3

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,174 @@
1
+ @use '../../styles/bootstrap/variables' as bootstrap-variables;
2
+ @use '../../styles/mixins/utilities';
3
+ @use '../../styles/variables';
4
+ @use '../../styles/mixins/tables';
5
+
6
+ .thy-native-table {
7
+ width: 100%;
8
+ max-width: 100%;
9
+ color: variables.$table-color;
10
+ background-color: variables.$table-bg;
11
+
12
+ th,
13
+ td {
14
+ padding: variables.$table-default-header-cell-padding;
15
+ vertical-align: middle;
16
+ border-bottom: variables.$table-border-width solid variables.$table-border-color;
17
+ }
18
+
19
+ tbody tr {
20
+ &.clear-hover {
21
+ cursor: default !important;
22
+ box-shadow: initial !important;
23
+ background-color: transparent !important;
24
+
25
+ td {
26
+ border-bottom: 0;
27
+ }
28
+ }
29
+ }
30
+
31
+ @include tables.table-size(
32
+ variables.$table-cell-height,
33
+ variables.$table-cell-height,
34
+ variables.$table-header-padding,
35
+ variables.$table-cell-padding
36
+ );
37
+
38
+ .thy-native-table {
39
+ background-color: bootstrap-variables.$body-bg;
40
+ }
41
+ .thy-native-table-content {
42
+ width: 100%;
43
+ }
44
+ .thy-table-pagination {
45
+ padding: 0 20px;
46
+ margin-top: 1.25rem;
47
+ }
48
+ }
49
+
50
+ .native-table-default {
51
+ @include tables.table-set-header(
52
+ left,
53
+ bottom,
54
+ 400,
55
+ variables.$table-border-width,
56
+ transparent,
57
+ variables.$table-border-color,
58
+ variables.$table-default-header-color,
59
+ variables.$table-default-header-padding
60
+ );
61
+ }
62
+
63
+ .native-table-bordered {
64
+ border: variables.$table-border-width solid variables.$table-border-color;
65
+
66
+ th,
67
+ td {
68
+ border: variables.$table-border-width solid variables.$table-border-color;
69
+ }
70
+
71
+ &:has(+ .thy-table-skeleton) > thead {
72
+ // 有骨架屏去掉 thead 的 border-bottom,否则会和 table 的边框重叠加粗
73
+ tr th {
74
+ border-bottom: 0;
75
+ }
76
+ }
77
+
78
+ @include tables.table-set-header(
79
+ center,
80
+ middle,
81
+ 400,
82
+ variables.$table-border-width,
83
+ variables.$table-bordered-bg,
84
+ variables.$table-border-color,
85
+ variables.$table-bordered-header-color,
86
+ 0
87
+ );
88
+ }
89
+
90
+ .native-table-boxed {
91
+ border: variables.$table-border-width solid variables.$table-border-color;
92
+
93
+ tbody {
94
+ // 最后一行去掉 border-bottom,否则会和 table 的边框重叠加粗
95
+ tr:last-child {
96
+ td {
97
+ border-bottom: 0px;
98
+ }
99
+ }
100
+ }
101
+
102
+ &:has(+ .thy-table-skeleton) {
103
+ // 有骨架屏 给table只设置上左边框的border-radius
104
+ border-radius: 0 !important;
105
+ border-top-left-radius: variables.$border-radius !important;
106
+ }
107
+
108
+ &:has(+ .thy-table-skeleton) > thead {
109
+ // 有骨架屏去掉 thead 的 border-bottom,否则会和 table 的边框重叠加粗
110
+ tr th {
111
+ border-bottom: 0;
112
+ }
113
+ }
114
+
115
+ @include tables.table-set-header(
116
+ left,
117
+ middle,
118
+ 400,
119
+ variables.$table-border-width,
120
+ variables.$table-bordered-bg,
121
+ variables.$table-border-color,
122
+ variables.$table-bordered-header-color,
123
+ 0
124
+ );
125
+ }
126
+
127
+ .native-table-xlg {
128
+ @include tables.table-size(
129
+ variables.$table-cell-height-xlg,
130
+ variables.$table-cell-height-xlg,
131
+ variables.$table-header-padding-xlg,
132
+ variables.$table-cell-padding-xlg
133
+ );
134
+ }
135
+
136
+ .native-table-lg {
137
+ @include tables.table-size(
138
+ variables.$table-cell-height-lg,
139
+ variables.$table-cell-height-lg,
140
+ variables.$table-header-padding-lg,
141
+ variables.$table-cell-padding-lg
142
+ );
143
+ }
144
+
145
+ .native-table-md {
146
+ @include tables.table-size(
147
+ variables.$table-cell-height,
148
+ variables.$table-cell-height,
149
+ variables.$table-header-padding,
150
+ variables.$table-cell-padding
151
+ );
152
+ }
153
+
154
+ .native-table-sm {
155
+ @include tables.table-size(
156
+ variables.$table-cell-height-sm,
157
+ variables.$table-cell-height-sm,
158
+ variables.$table-header-padding-sm,
159
+ variables.$table-cell-padding-sm
160
+ );
161
+ }
162
+
163
+ .native-table-xs {
164
+ @include tables.table-size(
165
+ variables.$table-cell-height-xs,
166
+ variables.$table-cell-height-xs,
167
+ variables.$table-header-padding-xs,
168
+ variables.$table-cell-padding-xs
169
+ );
170
+ }
171
+
172
+ .table-fixed {
173
+ table-layout: fixed;
174
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-tethys",
3
- "version": "20.0.2",
3
+ "version": "20.0.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/atinc/ngx-tethys.git"
@@ -206,6 +206,10 @@
206
206
  "types": "./message/index.d.ts",
207
207
  "default": "./fesm2022/ngx-tethys-message.mjs"
208
208
  },
209
+ "./native-table": {
210
+ "types": "./native-table/index.d.ts",
211
+ "default": "./fesm2022/ngx-tethys-native-table.mjs"
212
+ },
209
213
  "./nav": {
210
214
  "types": "./nav/index.d.ts",
211
215
  "default": "./fesm2022/ngx-tethys-nav.mjs"
@@ -1 +1 @@
1
- export declare const VERSION = "20.0.2";
1
+ export declare const VERSION = "20.0.3";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '20.0.2';
4
+ exports.VERSION = '20.0.3';
package/select/index.d.ts CHANGED
@@ -249,6 +249,11 @@ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implem
249
249
  * 是否隐藏选择框边框
250
250
  */
251
251
  readonly thyBorderless: _angular_core.InputSignalWithTransform<boolean, unknown>;
252
+ readonly panel: Signal<ElementRef<HTMLElement> | undefined>;
253
+ /**
254
+ * 是否启用虚拟滚动,默认值为 false
255
+ */
256
+ readonly thyVirtualScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
252
257
  private scrolledIndex;
253
258
  readonly cdkVirtualScrollViewport: Signal<CdkVirtualScrollViewport | undefined>;
254
259
  private shouldActivateOption;
@@ -301,7 +306,8 @@ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implem
301
306
  private allGroupsAndOptionsByTemplate;
302
307
  private buildFilteredGroupsAndOptions;
303
308
  private updateSelectedOptions;
304
- optionsScrolled(index: number): void;
309
+ optionsVirtualScrolled(index: number): void;
310
+ optionsScrolled(elementRef: ElementRef): void;
305
311
  search(keywords: string): void;
306
312
  onBlur(event?: FocusEvent): void;
307
313
  onFocus(event?: FocusEvent): void;
@@ -333,7 +339,7 @@ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implem
333
339
  trackByFn(index: number, item: ThySelectFlattedItem): SafeAny;
334
340
  ngOnDestroy(): void;
335
341
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThySelect, never>;
336
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelect, "thy-select,thy-custom-select", ["thySelect"], { "thyDropdownWidthMode": { "alias": "thyDropdownWidthMode"; "required": false; "isSignal": true; }; "thyItemSize": { "alias": "thyItemSize"; "required": false; "isSignal": true; }; "thyShowSearch": { "alias": "thyShowSearch"; "required": false; "isSignal": true; }; "thyPlaceHolder": { "alias": "thyPlaceHolder"; "required": false; "isSignal": true; }; "thyServerSearch": { "alias": "thyServerSearch"; "required": false; "isSignal": true; }; "thyLoadState": { "alias": "thyLoadState"; "required": false; "isSignal": true; }; "thyAutoActiveFirstItem": { "alias": "thyAutoActiveFirstItem"; "required": false; "isSignal": true; }; "thyMode": { "alias": "thyMode"; "required": false; "isSignal": true; }; "thySize": { "alias": "thySize"; "required": false; "isSignal": true; }; "thyEmptyStateText": { "alias": "thyEmptyStateText"; "required": false; "isSignal": true; }; "thyEmptySearchMessageText": { "alias": "thyEmptySearchMessageText"; "required": false; "isSignal": true; }; "thyEnableScrollLoad": { "alias": "thyEnableScrollLoad"; "required": false; "isSignal": true; }; "thyAllowClear": { "alias": "thyAllowClear"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; }; "thySortComparator": { "alias": "thySortComparator"; "required": false; "isSignal": true; }; "thyFooterTemplate": { "alias": "thyFooterTemplate"; "required": false; "isSignal": true; }; "thyPlacement": { "alias": "thyPlacement"; "required": false; "isSignal": true; }; "thyOrigin": { "alias": "thyOrigin"; "required": false; "isSignal": true; }; "thyFooterClass": { "alias": "thyFooterClass"; "required": false; "isSignal": true; }; "thyAutoExpand": { "alias": "thyAutoExpand"; "required": false; "isSignal": true; }; "thyHasBackdrop": { "alias": "thyHasBackdrop"; "required": false; "isSignal": true; }; "thyMaxTagCount": { "alias": "thyMaxTagCount"; "required": false; "isSignal": true; }; "thyBorderless": { "alias": "thyBorderless"; "required": false; "isSignal": true; }; "thyOptions": { "alias": "thyOptions"; "required": false; "isSignal": true; }; "thyPreset": { "alias": "thyPreset"; "required": false; "isSignal": true; }; }, { "thyOnSearch": "thyOnSearch"; "thyOnScrollToBottom": "thyOnScrollToBottom"; "thyOnExpandStatusChange": "thyOnExpandStatusChange"; }, ["selectedValueDisplayRef", "options", "groups"], ["*"], true, never>;
342
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelect, "thy-select,thy-custom-select", ["thySelect"], { "thyDropdownWidthMode": { "alias": "thyDropdownWidthMode"; "required": false; "isSignal": true; }; "thyItemSize": { "alias": "thyItemSize"; "required": false; "isSignal": true; }; "thyShowSearch": { "alias": "thyShowSearch"; "required": false; "isSignal": true; }; "thyPlaceHolder": { "alias": "thyPlaceHolder"; "required": false; "isSignal": true; }; "thyServerSearch": { "alias": "thyServerSearch"; "required": false; "isSignal": true; }; "thyLoadState": { "alias": "thyLoadState"; "required": false; "isSignal": true; }; "thyAutoActiveFirstItem": { "alias": "thyAutoActiveFirstItem"; "required": false; "isSignal": true; }; "thyMode": { "alias": "thyMode"; "required": false; "isSignal": true; }; "thySize": { "alias": "thySize"; "required": false; "isSignal": true; }; "thyEmptyStateText": { "alias": "thyEmptyStateText"; "required": false; "isSignal": true; }; "thyEmptySearchMessageText": { "alias": "thyEmptySearchMessageText"; "required": false; "isSignal": true; }; "thyEnableScrollLoad": { "alias": "thyEnableScrollLoad"; "required": false; "isSignal": true; }; "thyAllowClear": { "alias": "thyAllowClear"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; }; "thySortComparator": { "alias": "thySortComparator"; "required": false; "isSignal": true; }; "thyFooterTemplate": { "alias": "thyFooterTemplate"; "required": false; "isSignal": true; }; "thyPlacement": { "alias": "thyPlacement"; "required": false; "isSignal": true; }; "thyOrigin": { "alias": "thyOrigin"; "required": false; "isSignal": true; }; "thyFooterClass": { "alias": "thyFooterClass"; "required": false; "isSignal": true; }; "thyAutoExpand": { "alias": "thyAutoExpand"; "required": false; "isSignal": true; }; "thyHasBackdrop": { "alias": "thyHasBackdrop"; "required": false; "isSignal": true; }; "thyMaxTagCount": { "alias": "thyMaxTagCount"; "required": false; "isSignal": true; }; "thyBorderless": { "alias": "thyBorderless"; "required": false; "isSignal": true; }; "thyVirtualScroll": { "alias": "thyVirtualScroll"; "required": false; "isSignal": true; }; "thyOptions": { "alias": "thyOptions"; "required": false; "isSignal": true; }; "thyPreset": { "alias": "thyPreset"; "required": false; "isSignal": true; }; }, { "thyOnSearch": "thyOnSearch"; "thyOnScrollToBottom": "thyOnScrollToBottom"; "thyOnExpandStatusChange": "thyOnExpandStatusChange"; }, ["selectedValueDisplayRef", "options", "groups"], ["*", "*"], true, never>;
337
343
  static ngAcceptInputType_thyDisabled: i1.ThyBooleanInput;
338
344
  }
339
345
 
package/shared/index.d.ts CHANGED
@@ -470,10 +470,11 @@ declare class ThyOption {
470
470
  * 模板
471
471
  */
472
472
  readonly template: _angular_core.Signal<TemplateRef<any> | undefined>;
473
+ readonly suffixTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
473
474
  private readonly optionGroupComponent;
474
475
  get groupLabel(): string;
475
476
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOption, never>;
476
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOption, "thy-option", never, { "thyValue": { "alias": "thyValue"; "required": false; "isSignal": true; }; "thyRawValue": { "alias": "thyRawValue"; "required": false; "isSignal": true; }; "thyLabelText": { "alias": "thyLabelText"; "required": false; "isSignal": true; }; "thyShowOptionCustom": { "alias": "thyShowOptionCustom"; "required": false; "isSignal": true; }; "thySearchKey": { "alias": "thySearchKey"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, never, ["*"], true, never>;
477
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOption, "thy-option", never, { "thyValue": { "alias": "thyValue"; "required": false; "isSignal": true; }; "thyRawValue": { "alias": "thyRawValue"; "required": false; "isSignal": true; }; "thyLabelText": { "alias": "thyLabelText"; "required": false; "isSignal": true; }; "thyShowOptionCustom": { "alias": "thyShowOptionCustom"; "required": false; "isSignal": true; }; "thySearchKey": { "alias": "thySearchKey"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, ["suffixTemplate"], ["*"], true, never>;
477
478
  }
478
479
 
479
480
  /**
@@ -10,6 +10,11 @@ $optionsSize: 'sm', 'default', 'md', 'lg';
10
10
  overflow-y: hidden;
11
11
  .cdk-virtual-scroll-content-wrapper {
12
12
  width: 100%;
13
+
14
+ .thy-option-group-render {
15
+ height: 40px;
16
+ padding: 5px 0;
17
+ }
13
18
  }
14
19
  }
15
20
 
@@ -28,8 +33,6 @@ $optionsSize: 'sm', 'default', 'md', 'lg';
28
33
 
29
34
  .thy-option-group-render {
30
35
  flex-direction: column;
31
- height: 40px;
32
- padding: 5px 0;
33
36
 
34
37
  .group-name {
35
38
  width: 100%;
package/styles/index.scss CHANGED
@@ -88,3 +88,4 @@
88
88
  @forward '../checkbox/styles/checkbox.scss';
89
89
  @forward '../color-picker/styles/color-picker.scss';
90
90
  @forward '../comment/styles/comment.scss';
91
+ @forward '../native-table/styles/native-table.scss';