@angular-generic-table/core 5.0.0-rc.10 → 5.0.0-rc.13

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 (39) hide show
  1. package/esm2020/lib/core.component.mjs +98 -30
  2. package/esm2020/lib/core.module.mjs +24 -7
  3. package/esm2020/lib/core.service.mjs +5 -5
  4. package/esm2020/lib/enums/order.enum.mjs +1 -1
  5. package/esm2020/lib/gt-delta/gt-delta.component.mjs +104 -0
  6. package/esm2020/lib/models/gt-pagination.mjs +2 -0
  7. package/esm2020/lib/models/table-column.interface.mjs +1 -1
  8. package/esm2020/lib/models/table-config.interface.mjs +1 -1
  9. package/esm2020/lib/models/table-events.interface.mjs +2 -0
  10. package/esm2020/lib/pagination/pagination.component.mjs +47 -12
  11. package/esm2020/lib/pagination/pagination.module.mjs +5 -5
  12. package/esm2020/lib/pipes/capital-case.pipe.mjs +3 -3
  13. package/esm2020/lib/pipes/dash-case.pipe.mjs +5 -5
  14. package/esm2020/lib/pipes/dynamic.pipe.mjs +3 -3
  15. package/esm2020/lib/pipes/highlight.pipe.mjs +6 -6
  16. package/esm2020/lib/pipes/sort-class.pipe.mjs +12 -6
  17. package/esm2020/lib/utilities/utilities.mjs +20 -6
  18. package/esm2020/public-api.mjs +3 -1
  19. package/fesm2015/angular-generic-table-core.mjs +331 -88
  20. package/fesm2015/angular-generic-table-core.mjs.map +1 -1
  21. package/fesm2020/angular-generic-table-core.mjs +328 -88
  22. package/fesm2020/angular-generic-table-core.mjs.map +1 -1
  23. package/{angular-generic-table-core.d.ts → index.d.ts} +0 -0
  24. package/lib/core.component.d.ts +18 -6
  25. package/lib/core.module.d.ts +3 -2
  26. package/lib/gt-delta/gt-delta.component.d.ts +20 -0
  27. package/lib/models/gt-pagination.d.ts +10 -0
  28. package/lib/models/table-column.interface.d.ts +4 -0
  29. package/lib/models/table-config.interface.d.ts +6 -0
  30. package/lib/models/table-events.interface.d.ts +11 -0
  31. package/lib/pagination/pagination.component.d.ts +11 -1
  32. package/lib/pipes/capital-case.pipe.d.ts +1 -1
  33. package/lib/pipes/dash-case.pipe.d.ts +1 -1
  34. package/lib/pipes/dynamic.pipe.d.ts +1 -1
  35. package/lib/pipes/highlight.pipe.d.ts +1 -1
  36. package/lib/pipes/sort-class.pipe.d.ts +2 -2
  37. package/package.json +5 -5
  38. package/public-api.d.ts +2 -0
  39. package/scss/index.scss +170 -13
package/scss/index.scss CHANGED
@@ -1,32 +1,127 @@
1
1
  $highlight-background-color: #ffdd00 !default;
2
- $mobile-style-selector: 'table.table-mobile' !default;
2
+ $style-selector: '.table' !default;
3
+ $mobile-style-selector: 'table.table-mobile:not(.table-horizontal)' !default;
3
4
  $mobile-style-max-width: 576px !default;
4
5
  $mobile-style-header-font-weight: 500 !default;
5
- $mobile-style-header-background-color: #fff !default;
6
+ $mobile-style-header-background-color: var(--bs-body-bg, #fff) !default;
6
7
  $mobile-style-button-selector: '.btn-sm' !default;
7
- $mobile-style-border-bottom: solid 1px #dedede !default;
8
+ $mobile-style-border-bottom: var(--bs-border-style, solid) var(--bs-border-width, 1px) var(--bs-border-color, #dedede) !default;
8
9
  $mobile-style-button-font-size: 1rem !default;
9
- $mobile-style-button-padding: 0.5625rem 1rem !default;
10
+ $mobile-style-button-padding: 0.375rem 0.75rem !default;
10
11
  $pagination-ellipsis-content: '...' !default;
11
- $pagination-active-color: #000 !default;
12
+ $pagination-active-color: var(--bs-light, #000) !default;
12
13
  $pagination-justify-content: center !default;
14
+ $cell-padding-y: 0.5rem !default;
15
+ $cell-padding-x: 0.5rem !default;
16
+ $sort-selector: '.gt-sort' !default;
17
+
18
+ $table-column-header-bg: var(--bs-body-bg);
19
+ $table-row-header-bg: var(--bs-body-bg);
20
+
21
+ $delta-positive-prefix: '+' !default;
22
+
23
+ $sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 448 644'%3E%3Cpath transform='translate(0 240)' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z'/%3E%3Cpath transform='translate(0 -100)' d='M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z'/%3E%3C/svg%3E") !default;
24
+ //$sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='icon icon-tabler icon-tabler-arrows-sort' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='currentColor' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M3 9l4 -4l4 4m-4 -4v14'%3E%3C/path%3E%3Cpath d='M21 15l-4 4l-4 -4m4 4v-14'%3E%3C/path%3E%3C/svg%3E") !default;
25
+ $sort-icon-size: 1rem;
26
+ $sort-icon-color: rgba(var(--bs-secondary-rgb, #000),0.25) !default;
27
+ $sort-icon-color-active: var(--bs-primary, #000) !default;
28
+ $ascending-sort-gradient: linear-gradient(1turn,
29
+ $sort-icon-color 50%,
30
+ $sort-icon-color-active 50%
31
+ ) !default;
32
+ $descending-sort-gradient: linear-gradient(
33
+ $sort-icon-color 50%,
34
+ $sort-icon-color-active 50%
35
+ ) !default;
36
+ /*$ascending-sort-gradient: linear-gradient(0.25turn,
37
+ $sort-icon-color 50%,
38
+ $sort-icon-color-active 50%
39
+ ) !default;
40
+ $descending-sort-gradient: linear-gradient(0.75turn,
41
+ $sort-icon-color 50%,
42
+ $sort-icon-color-active 50%
43
+ ) !default;
44
+ */
45
+
46
+ $skeleton-loader-highlight-color: var(--bs-gray-300, rgb(200,200,200)) !default;
47
+ $skeleton-loader-background-color: var(--bs-gray-200, rgb(240,240,240)) !default;
48
+ $skeleton-loader-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='768' height='159'%3E%3Cpath fill-rule='evenodd' fill='%23FFF' d='M0 124.999v-1h768v1H0ZM660 114V90h73.999v24H660Zm-144.001 0V90h120v24h-120ZM402 114V90h80v24h-80Zm-134 0V90h100v24H268Zm-154.001 0V90h130v24h-130ZM0 78.999h768v1H0v-1ZM660 69V45h63.999v24H660Zm-144.001 0V45h110v24h-110ZM402 69V45h69.999v24H402Zm-134 0V45h80v24h-80Zm-154.001 0V45h120v24h-120ZM0 33.999h768V35H0v-1.001ZM660 0h83.999v24H660V0ZM515.999 0h90v24h-90V0ZM402 0h90v24h-90V0ZM268 0h100v24H268V0ZM113.999 0h100v24h-100V0ZM0 0h90v24H0V0Zm70 69H0V45h70v24Zm10 45H0V90h80v24Zm10 45H0v-24h90v24Zm134 0H113.999v-24H224v24Zm154 0H268v-24h110v24Zm114 0h-90v-24h90v24Zm124 0H515.999v-24H616v24Zm127.999 0H660v-24h83.999v24Z'/%3E%3C/svg%3E") !default;
13
49
 
14
50
  @mixin styles() {
51
+ @include default-style;
15
52
  @include search-style;
16
53
  @include mobile-style;
17
54
  @include pagination-style;
55
+ @include delta-style;
56
+ @include sticky-style;
57
+ @include skeleton-loader-styles;
58
+ }
59
+
60
+ @mixin default-style {
61
+ #{$style-selector} {
62
+ thead tr th {
63
+ // sort button
64
+ &[aria-sort],
65
+ &.gt-sortable {
66
+ > #{$sort-selector} {
67
+ appearance: none;
68
+ font: inherit;
69
+ margin: 0;
70
+ padding: $cell-padding-y $cell-padding-x;
71
+ margin: -#{$cell-padding-y} -#{$cell-padding-x};
72
+ border: none;
73
+ background: none;
74
+ color: inherit;
75
+ width: 100%;
76
+ text-align: left;
77
+ display: flex;
78
+ align-items: center;
79
+ transition: box-shadow 0.25s ease-in-out;
80
+ &::after {
81
+ content: '';
82
+ background: $sort-icon-color;
83
+ width: $sort-icon-size;
84
+ height: $sort-icon-size;
85
+ margin-left: 0.25rem;
86
+ mask-image: $sort-icon;
87
+ mask-repeat: no-repeat;
88
+ mask-size: cover;
89
+ mask-position: right;
90
+ display: block;
91
+ flex-shrink: 0;
92
+ }
93
+ &:focus-visible {
94
+ box-shadow: inset rgba(var(--bs-primary-rgb, (0,0,0)),0.35) 0 0 0 4px;
95
+ outline: none;
96
+ border-radius: 4px;
97
+ }
98
+ }
99
+ }
100
+ &[aria-sort='ascending'] {
101
+ #{$sort-selector}::after {
102
+ background: $ascending-sort-gradient;
103
+ }
104
+ }
105
+ &[aria-sort='descending'] {
106
+ #{$sort-selector}::after {
107
+ background: $descending-sort-gradient;
108
+ }
109
+ }
110
+ }
111
+ tr {
112
+ th, td {
113
+ padding: $cell-padding-y $cell-padding-x;
114
+ }
115
+ }
116
+ }
18
117
  }
118
+
19
119
  @mixin search-style {
20
120
  .gt-highlight-search {
21
121
  background: $highlight-background-color;
22
122
  }
23
123
  }
24
124
  @mixin mobile-style($selector: $mobile-style-selector) {
25
- #{$selector} {
26
- .mobile-header {
27
- display: none;
28
- }
29
- }
30
125
  @media (max-width: $mobile-style-max-width) {
31
126
  #{$selector} {
32
127
  table-layout: fixed;
@@ -63,10 +158,12 @@ $pagination-justify-content: center !default;
63
158
  justify-content: space-between;
64
159
  align-items: center;
65
160
  border-top: none !important;
66
- & > .mobile-header {
67
- font-weight: $mobile-style-header-font-weight;
161
+ &::before {
162
+ content: attr(data-label);
68
163
  display: block;
164
+ font-weight: $mobile-style-header-font-weight;
69
165
  }
166
+
70
167
  #{$mobile-style-button-selector} {
71
168
  width: 100%;
72
169
  font-size: $mobile-style-button-font-size;
@@ -87,7 +184,7 @@ $pagination-justify-content: center !default;
87
184
  margin: 0;
88
185
  padding: 0;
89
186
  li {
90
- &.ellipsis::after {
187
+ &.gt-ellipsis > button::after {
91
188
  content: $pagination-ellipsis-content;
92
189
  display: inline-flex;
93
190
  }
@@ -99,4 +196,64 @@ $pagination-justify-content: center !default;
99
196
  }
100
197
  }
101
198
 
199
+ @mixin delta-style() {
200
+ .gt-delta {
201
+ display: flex;
202
+ &.gt-delta-positive::before {
203
+ display: block;
204
+ content: $delta-positive-prefix;
205
+ }
206
+ }
207
+ }
208
+ @mixin sticky-style() {
209
+ .gt-sticky-column-header thead tr th {
210
+ position: sticky;
211
+ top: 0;
212
+ background: $table-column-header-bg;
213
+ z-index: 2;
214
+ white-space: nowrap;
215
+ }
216
+
217
+ .gt-sticky-row-header {
218
+ tbody tr th.row-header, thead tr th:first-child {
219
+ position: sticky;
220
+ left: 0;
221
+ background: $table-row-header-bg;
222
+ z-index: 1;
223
+ white-space: nowrap;
224
+ }
225
+ thead tr th:first-child {
226
+ z-index: 3;
227
+ }
228
+ }
229
+ }
230
+
231
+ @mixin skeleton-loader-styles() {
232
+ .gt-skeleton-loader {
233
+ margin: 0.625rem 0;
234
+ --gt-skeleton-loader-mask: #{$skeleton-loader-mask};
235
+ --gt-skeleton-loader-highlight-color: #{$skeleton-loader-highlight-color};
236
+ --gt-skeleton-loader-bg-color: #{$skeleton-loader-background-color};
237
+ @keyframes skeleton-loader {
238
+ 0% {
239
+ background-position: 0 0;
240
+ }
241
+ 25%,
242
+ 100% {
243
+ background-position: 200vw 0;
244
+ }
245
+ }
246
+ height: 158px;
247
+ mask-image: var(--gt-skeleton-loader-mask);
248
+ background: linear-gradient(
249
+ 280deg,
250
+ $skeleton-loader-background-color 12.5%,
251
+ $skeleton-loader-highlight-color 17.5%,
252
+ $skeleton-loader-background-color 37.5%
253
+ );
254
+ background-size: 200vw 100vw;
255
+ background-position: 0 0;
256
+ animation: skeleton-loader 3000ms linear infinite;
257
+ }
258
+ }
102
259