@progressio_resources/gravity-design-system 2.0.12 → 2.1.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.
- package/esm2022/lib/components/gravity-table/gravity-table.component.mjs +185 -0
- package/esm2022/lib/gravity-design-system.module.mjs +12 -7
- package/esm2022/lib/services/gravity-dialog-manager.service.mjs +5 -1
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/progressio_resources-gravity-design-system.mjs +198 -8
- package/fesm2022/progressio_resources-gravity-design-system.mjs.map +1 -1
- package/lib/components/gravity-table/gravity-table.component.d.ts +23 -0
- package/lib/gravity-design-system.module.d.ts +11 -10
- package/lib/services/gravity-dialog-manager.service.d.ts +3 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/lib/styles/components/_tables.scss +271 -0
- package/src/lib/styles/gravity-design-system.scss +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class GravityTableComponent implements AfterViewInit {
|
|
4
|
+
private readonly renderer;
|
|
5
|
+
type: 'standard' | 'compressed';
|
|
6
|
+
readonly tableContainer: ElementRef;
|
|
7
|
+
private firstTime;
|
|
8
|
+
private tableElement;
|
|
9
|
+
tableId: string;
|
|
10
|
+
tableSize: string;
|
|
11
|
+
constructor(renderer: Renderer2);
|
|
12
|
+
ngAfterViewInit(): void;
|
|
13
|
+
private getTableHeaders;
|
|
14
|
+
private initializeTable;
|
|
15
|
+
private adjustTableType;
|
|
16
|
+
private adjustButtonsSize;
|
|
17
|
+
private onResize;
|
|
18
|
+
private adjustTableSize;
|
|
19
|
+
private adjustTable;
|
|
20
|
+
private appendNodesList;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GravityTableComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GravityTableComponent, "gravity-table", never, { "type": { "alias": "type"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
23
|
+
}
|
|
@@ -11,17 +11,18 @@ import * as i9 from "./components/gravity-notification/gravity-notification.comp
|
|
|
11
11
|
import * as i10 from "./components/gravity-notification-instant/gravity-notification-instant-container.component";
|
|
12
12
|
import * as i11 from "./components/gravity-radio-button/gravity-radio-button.component";
|
|
13
13
|
import * as i12 from "./components/gravity-switch/gravity-switch.component";
|
|
14
|
-
import * as i13 from "./components/gravity-
|
|
15
|
-
import * as i14 from "
|
|
16
|
-
import * as i15 from "angular-svg-icon
|
|
17
|
-
import * as i16 from "
|
|
18
|
-
import * as i17 from "@angular/
|
|
19
|
-
import * as i18 from "
|
|
20
|
-
import * as i19 from "
|
|
21
|
-
import * as i20 from "@ng-
|
|
22
|
-
import * as i21 from "
|
|
14
|
+
import * as i13 from "./components/gravity-table/gravity-table.component";
|
|
15
|
+
import * as i14 from "./components/gravity-text-field/gravity-text-field.component";
|
|
16
|
+
import * as i15 from "angular-svg-icon";
|
|
17
|
+
import * as i16 from "angular-svg-icon-preloader";
|
|
18
|
+
import * as i17 from "@angular/common";
|
|
19
|
+
import * as i18 from "@angular/forms";
|
|
20
|
+
import * as i19 from "./vendor/gravity-tooltip/gravity-tooltip.module";
|
|
21
|
+
import * as i20 from "@ng-bootstrap/ng-bootstrap";
|
|
22
|
+
import * as i21 from "@ng-select/ng-select";
|
|
23
|
+
import * as i22 from "ngx-pretty-checkbox";
|
|
23
24
|
export declare class GravityDesignSystemModule {
|
|
24
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<GravityDesignSystemModule, never>;
|
|
25
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<GravityDesignSystemModule, [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i8.GravityMonthPickerComponent, typeof i9.GravityNotificationComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTextFieldComponent], [typeof
|
|
26
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<GravityDesignSystemModule, [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i8.GravityMonthPickerComponent, typeof i9.GravityNotificationComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTableComponent, typeof i14.GravityTextFieldComponent], [typeof i15.AngularSvgIconModule, typeof i16.AngularSvgIconPreloaderModule, typeof i17.CommonModule, typeof i18.FormsModule, typeof i19.GravityTooltipModule, typeof i20.NgbDatepickerModule, typeof i20.NgbProgressbarModule, typeof i20.NgbToastModule, typeof i21.NgSelectModule, typeof i22.NgxPrettyCheckboxModule, typeof i18.ReactiveFormsModule], [typeof i1.GravityAttachFileComponent, typeof i2.GravityButtonComponent, typeof i3.GravityCalendarComponent, typeof i4.GravityCheckboxComponent, typeof i5.GravityDialogComponent, typeof i6.GravityDropdownListComponent, typeof i7.GravityIconComponent, typeof i10.GravityNotificationInstantContainerComponent, typeof i11.GravityRadioButtonComponent, typeof i12.GravitySwitchComponent, typeof i13.GravityTableComponent, typeof i14.GravityTextFieldComponent, typeof i19.GravityTooltipModule]>;
|
|
26
27
|
static ɵinj: i0.ɵɵInjectorDeclaration<GravityDesignSystemModule>;
|
|
27
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
|
1
|
+
import { NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap";
|
|
2
2
|
import { GravityDialogContentInterface } from "../components/gravity-dialog/gravity-dialog.component";
|
|
3
3
|
import { GravityInstantNotificationsService } from "./gravity-instant-notifications.service";
|
|
4
4
|
import { GravityNotificationContent } from "../components/gravity-notification/gravity-notification-content.interface";
|
|
@@ -7,9 +7,10 @@ export declare class GravityDialogManagerService {
|
|
|
7
7
|
private readonly ngbModal;
|
|
8
8
|
private readonly gravityInstantNotificationsService;
|
|
9
9
|
constructor(ngbModal: NgbModal, gravityInstantNotificationsService: GravityInstantNotificationsService);
|
|
10
|
-
openModal(gravityDialogContentInterface: GravityDialogContentInterface, scrollableDialog?: boolean, modalSize?: 'sm' | 'md' | 'lg' | 'xl'):
|
|
10
|
+
openModal(gravityDialogContentInterface: GravityDialogContentInterface, scrollableDialog?: boolean, modalSize?: 'sm' | 'md' | 'lg' | 'xl'): NgbModalRef;
|
|
11
11
|
throwInformativeNotification(notificationContent: GravityNotificationContent): void;
|
|
12
12
|
throwInstantNotification(notificationContent: GravityNotificationContent): void;
|
|
13
|
+
closeModal(modalToClose: NgbModalRef, returnValue?: any): any;
|
|
13
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<GravityDialogManagerService, never>;
|
|
14
15
|
static ɵprov: i0.ɵɵInjectableDeclaration<GravityDialogManagerService>;
|
|
15
16
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './lib/components/gravity-icon/gravity-icon.component';
|
|
|
9
9
|
export * from './lib/components/gravity-notification-instant/gravity-notification-instant-container.component';
|
|
10
10
|
export * from './lib/components/gravity-radio-button/gravity-radio-button.component';
|
|
11
11
|
export * from './lib/components/gravity-switch/gravity-switch.component';
|
|
12
|
+
export * from './lib/components/gravity-table/gravity-table.component';
|
|
12
13
|
export * from './lib/components/gravity-text-field/gravity-text-field.component';
|
|
13
14
|
export * from './lib/services/gravity-dialog-manager.service';
|
|
14
15
|
export * from './lib/vendor/gravity-tooltip';
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
@import "./link";
|
|
2
|
+
@import "../foundations/border-radius/hero.border-radius";
|
|
3
|
+
@import "../foundations/breakpoints/breakpoints";
|
|
4
|
+
@import "../foundations/typography/hero.typography";
|
|
5
|
+
|
|
6
|
+
.table-container.xl, .table-container.lg {
|
|
7
|
+
table {
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
text-align: left;
|
|
10
|
+
width: 100%;
|
|
11
|
+
|
|
12
|
+
thead tr {
|
|
13
|
+
@extend .hr-title, .sm-bold;
|
|
14
|
+
|
|
15
|
+
background-color: var(--surface-primary);
|
|
16
|
+
color: var(--text-primary);
|
|
17
|
+
|
|
18
|
+
th:first-of-type {
|
|
19
|
+
border-top-left-radius: $border-radius-sm;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
th:last-of-type {
|
|
23
|
+
border-top-right-radius: $border-radius-sm;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
tbody {
|
|
28
|
+
tr {
|
|
29
|
+
background-color: var(--surface-secondary);
|
|
30
|
+
border-bottom: 1px solid var(--surface-primary);
|
|
31
|
+
color: var(--text-primary);
|
|
32
|
+
|
|
33
|
+
&:has(td.actions-column) {
|
|
34
|
+
@for $dataColumnsCount from 3 through 9 {
|
|
35
|
+
/* N data columns (between 3 and 9) and 1 actions column */
|
|
36
|
+
/* We need to fill the table space with all N columns, and the actions column is fixed width */
|
|
37
|
+
&:has(> :nth-last-child(2):nth-child(#{$dataColumnsCount})) > :not(:last-child) {
|
|
38
|
+
width: calc(100% / #{$dataColumnsCount});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:not(:has(td.actions-column)) {
|
|
44
|
+
@for $dataColumnsCount from 3 through 9 {
|
|
45
|
+
/* N data columns (between 3 and 9) */
|
|
46
|
+
/* We need to fill the table space with all N columns */
|
|
47
|
+
&:has(> :last-child:nth-child(#{$dataColumnsCount})) > * {
|
|
48
|
+
width: calc(100% / #{$dataColumnsCount});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: var(--surface-primary);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.mobile-menu-trigger {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a {
|
|
63
|
+
@extend .gravity-link;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.xl-table {
|
|
68
|
+
&.standard-table {
|
|
69
|
+
tr th, tr td {
|
|
70
|
+
padding: 1.5rem; //24px
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.compressed-table {
|
|
75
|
+
tr th, tr td {
|
|
76
|
+
padding: 1rem; //16px
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
tbody tr {
|
|
81
|
+
@extend .hr-body-text, .md-regular;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.lg-table {
|
|
86
|
+
&.standard-table {
|
|
87
|
+
tr th, tr td {
|
|
88
|
+
padding: 1.5rem 1rem; //24px 16px
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.compressed-table {
|
|
93
|
+
tr th, tr td {
|
|
94
|
+
padding: 1rem; //16px
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
tbody tr {
|
|
99
|
+
@extend .hr-body-text, .sm-regular;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
td.actions-column {
|
|
104
|
+
display: flex;
|
|
105
|
+
|
|
106
|
+
table.xl-table.standard-table & {
|
|
107
|
+
padding: 0.9375rem 1.5rem !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
table.xl-table.compressed-table & {
|
|
111
|
+
padding: 0.4375rem 1rem !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
table.lg-table.standard-table & {
|
|
115
|
+
padding: 0.875rem 1rem !important;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
table.lg-table.compressed-table & {
|
|
119
|
+
padding: 0.375rem 1rem !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
gravity-button:not(:last-of-type) {
|
|
123
|
+
margin-right: 0.5rem;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.table-container.md, .table-container.sm {
|
|
130
|
+
table {
|
|
131
|
+
/* Force table to not be like tables anymore */
|
|
132
|
+
&, thead, tbody, th, td, tr {
|
|
133
|
+
display: block;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Hide table headers (but not display: none;, for accessibility) */
|
|
137
|
+
thead tr {
|
|
138
|
+
left: -9999px;
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: -9999px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
tr {
|
|
144
|
+
background-color: var(--surface-secondary);
|
|
145
|
+
border-radius: $border-radius-sm;
|
|
146
|
+
margin-bottom: 0.625rem;
|
|
147
|
+
padding: 0.75rem 1rem; //12px 16px
|
|
148
|
+
|
|
149
|
+
&:has(.actions-column) td:not(:nth-last-of-type(2)):not(.mobile-menu-trigger), &:not(:has(.actions-column)) td:not(:last-of-type):not(.mobile-menu-trigger) {
|
|
150
|
+
border-bottom: 1px solid var(--surface-primary);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Behave like a "row" */
|
|
155
|
+
td {
|
|
156
|
+
@extend .hr-body-text, .sm-regular;
|
|
157
|
+
|
|
158
|
+
border: none;
|
|
159
|
+
padding-block: 1rem; //16px -> spacing-sm
|
|
160
|
+
position: relative;
|
|
161
|
+
text-align: right;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
td:before {
|
|
165
|
+
@extend .hr-body-text, .sm-bold;
|
|
166
|
+
|
|
167
|
+
content: attr(header-name);
|
|
168
|
+
font-weight: bold;
|
|
169
|
+
left: 0;
|
|
170
|
+
position: absolute;
|
|
171
|
+
text-align: left;
|
|
172
|
+
width: 20%;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.actions-column {
|
|
177
|
+
display: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.mobile-menu-trigger {
|
|
182
|
+
margin-left: auto;
|
|
183
|
+
padding-block: 1rem;
|
|
184
|
+
position: relative;
|
|
185
|
+
width: fit-content;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.menu-toggle {
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
margin-left: auto;
|
|
191
|
+
width: fit-content;
|
|
192
|
+
|
|
193
|
+
span {
|
|
194
|
+
background-color: var(--text-primary);
|
|
195
|
+
display: block;
|
|
196
|
+
height: 0.16875rem; //2.7px
|
|
197
|
+
margin-bottom: 0.175rem;
|
|
198
|
+
transform-origin: 0.25rem; //4px
|
|
199
|
+
-webkit-transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), opacity 0.55s ease;
|
|
200
|
+
transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0), opacity 0.55s ease;
|
|
201
|
+
width: 1.16875rem; // 27px
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&.open {
|
|
205
|
+
span {
|
|
206
|
+
width: 1.6rem;
|
|
207
|
+
|
|
208
|
+
&:first-child {
|
|
209
|
+
transform: rotate(45deg) translate(-2px, -1px);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&:nth-child(2) {
|
|
213
|
+
opacity: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&:last-child {
|
|
217
|
+
transform: rotate(-45deg) translate(0, -1px);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.panel {
|
|
224
|
+
background-color: var(--surface-secondary);
|
|
225
|
+
border: 0.5px solid var(--divider-primary);
|
|
226
|
+
border-radius: $border-radius-sm;
|
|
227
|
+
padding: 0.25rem 1rem;
|
|
228
|
+
position: absolute;
|
|
229
|
+
right: 0;
|
|
230
|
+
top: 3rem;
|
|
231
|
+
width: 12rem;
|
|
232
|
+
z-index: 1;
|
|
233
|
+
|
|
234
|
+
&:not(.open) {
|
|
235
|
+
display: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
gravity-button {
|
|
239
|
+
width: 100%;
|
|
240
|
+
|
|
241
|
+
&:not(:last-of-type) {
|
|
242
|
+
border-bottom: 0.2px solid var(--text-primary);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
button {
|
|
246
|
+
--button-background-color: transparent;
|
|
247
|
+
--button-border-color: transparent;
|
|
248
|
+
border-radius: 0;
|
|
249
|
+
--button-text-color: var(--text-primary);
|
|
250
|
+
justify-content: space-between;
|
|
251
|
+
padding: 1.5rem 0.5rem !important;
|
|
252
|
+
|
|
253
|
+
&:hover {
|
|
254
|
+
--button-background-color: transparent !important;
|
|
255
|
+
--button-border-color: transparent !important;
|
|
256
|
+
--button-text-color: var(--text-primary) !important;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
gravity-icon {
|
|
260
|
+
--icon-height: 1rem !important;
|
|
261
|
+
--icon-width: 1rem !important;
|
|
262
|
+
order: 1;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
gravity-button[id-reference="close-button"]:not([cloned-button="true"]) {
|
|
270
|
+
display: none;
|
|
271
|
+
}
|