@swimlane/ngx-datatable 21.0.0-alpha.0 → 21.0.0-alpha.1

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,521 @@
1
+ /*
2
+ This stylesheet uses scss valiables for most of the colors / background-colors of the table
3
+ to enable the customization of the displayed table without cloning the stylesheet into the
4
+ own application.
5
+
6
+ To modify table colors, add the following lines to the scss file of your application
7
+ (this example modifies the color of the selected row - selectionType = single, multi or multiClick):
8
+
9
+ $ngx-datatable-selected-active-background: yellow;
10
+ $ngx-datatable-selected-active-background-hover: rgba(yellow, 0.2);
11
+
12
+ @import '~@swimlane/ngx-datatable/index.css';
13
+ @import '~@swimlane/ngx-datatable/themes/material.scss';
14
+ @import '~@swimlane/ngx-datatable/assets/icons.css';
15
+
16
+ That's all.
17
+ */
18
+
19
+ // common datatable colors
20
+ $ngx-datatable-background: #fff !default;
21
+ $ngx-datatable-box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14),
22
+ 0 3px 14px 2px rgba(0, 0, 0, 0.12) !default;
23
+ $ngx-datatable-row-odd-background: #eee !default;
24
+
25
+ // default row and cell background colors
26
+ $ngx-datatable-default-background: #fff !default;
27
+ $ngx-datatable-default-background-hover: #eee !default;
28
+ $ngx-datatable-default-background-focus: #ddd !default;
29
+
30
+ // default background colors for cell selection style
31
+ $ngx-datatable-cellselection-background-hover: #eee !default;
32
+ $ngx-datatable-cellselection-background-focus: #ddd !default;
33
+
34
+ // background and text colors for selected cell / row
35
+ $ngx-datatable-selected-active-background: #304ffe !default;
36
+ $ngx-datatable-selected-active-color: #fff !default;
37
+ $ngx-datatable-selected-active-background-hover: #193ae4 !default;
38
+ $ngx-datatable-selected-active-color-hover: #fff !default;
39
+ $ngx-datatable-selected-active-background-focus: #2041ef !default;
40
+ $ngx-datatable-selected-active-color-focus: #fff !default;
41
+
42
+ // colors for header elements
43
+ $datatable-header-cell-background: #fff !default;
44
+ $datatable-header-cell-color: rgba(0, 0, 0, 0.54) !default;
45
+ $datatable-header-border-bottom-color: rgba(0, 0, 0, 0.12) !default;
46
+ $datatable-header-resize-handle-color: #eee !default;
47
+
48
+ // colors for table body elements
49
+ $datatable-row-detail-background: #f5f5f5 !default;
50
+ $datatable-body-cell-color: rgba(0, 0, 0, 0.87) !default;
51
+ $datatable-group-header-background: #f5f5f5 !default;
52
+ $datatable-group-header-border-top-color: #d9d8d9 !default;
53
+ $datatable-group-header-border-bottom-color: #d9d8d9 !default;
54
+ $datatable-body-row-border-bottom-color: #d9d8d9 !default;
55
+
56
+ // colors for footer elements
57
+ $datatable-footer-cell-color: rgba(0, 0, 0, 0.54) !default;
58
+ $datatable-footer-border-top-color: rgba(0, 0, 0, 0.12) !default;
59
+ $datatable-pager-color: rgba(0, 0, 0, 0.54) !default;
60
+ $datatable-pager-color-hover: rgba(0, 0, 0, 0.75) !default;
61
+ $datatable-pager-background-hover: rgba(158, 158, 158, 0.2) !default;
62
+ $datatable-pager-disabled-color: rgba(0, 0, 0, 0.26) !default;
63
+ $datatable-pager-disabled-background: transparent !default;
64
+ $datatable-pager-active-background: rgba(158, 158, 158, 0.2) !default;
65
+
66
+ // colors for summary row elements
67
+ $datatable-summary-row-background: #ddd !default;
68
+ $datatable-summary-row-background-hover: #ddd !default;
69
+
70
+ $datatable-ghost-cell-container-background: $ngx-datatable-background !default;
71
+ $datatable-ghost-cell-strip-background: #d9d8d9 !default;
72
+ $datatable-ghost-cell-strip-background-image: linear-gradient(
73
+ to right,
74
+ $datatable-ghost-cell-strip-background 0%,
75
+ $datatable-ghost-cell-strip-background 10%,
76
+ $ngx-datatable-background,
77
+ transparent
78
+ ) !default;
79
+ $datatable-ghost-cell-strip-radius: 0 !default;
80
+ $datatble-ghost-cell-animation-duration: 10s;
81
+
82
+ @import './ghost';
83
+ @import './rows';
84
+
85
+ .ngx-datatable.material {
86
+ background: $ngx-datatable-background;
87
+ box-shadow: $ngx-datatable-box-shadow;
88
+
89
+ &.striped {
90
+ .datatable-row-odd {
91
+ background: $ngx-datatable-row-odd-background;
92
+ }
93
+ }
94
+
95
+ &.single-selection,
96
+ &.multi-selection,
97
+ &.multi-click-selection {
98
+ .datatable-body-row {
99
+ &.active,
100
+ &.active .datatable-row-group {
101
+ background-color: $ngx-datatable-selected-active-background;
102
+ color: $ngx-datatable-selected-active-color;
103
+ }
104
+
105
+ &.active:hover,
106
+ &.active:hover .datatable-row-group {
107
+ background-color: $ngx-datatable-selected-active-background-hover;
108
+ color: $ngx-datatable-selected-active-color-hover;
109
+ }
110
+
111
+ &.active:focus,
112
+ &.active:focus .datatable-row-group {
113
+ background-color: $ngx-datatable-selected-active-background-focus;
114
+ color: $ngx-datatable-selected-active-color-focus;
115
+ }
116
+ }
117
+ }
118
+
119
+ &:not(.cell-selection) {
120
+ .datatable-body-row {
121
+ &:hover,
122
+ &:hover .datatable-row-group {
123
+ background-color: $ngx-datatable-default-background-hover;
124
+ transition-property: background;
125
+ transition-duration: 0.3s;
126
+ transition-timing-function: linear;
127
+ }
128
+
129
+ &:focus,
130
+ &:focus .datatable-row-group {
131
+ background-color: $ngx-datatable-default-background-focus;
132
+ }
133
+ }
134
+ }
135
+
136
+ &.cell-selection {
137
+ .datatable-body-cell {
138
+ &:hover:not(.row-disabled),
139
+ &:hover:not(.row-disabled) .datatable-row-group {
140
+ background-color: $ngx-datatable-cellselection-background-hover;
141
+ transition-property: background;
142
+ transition-duration: 0.3s;
143
+ transition-timing-function: linear;
144
+ }
145
+
146
+ &:focus:not(.row-disabled),
147
+ &:focus:not(.row-disabled) .datatable-row-group {
148
+ background-color: $ngx-datatable-cellselection-background-focus;
149
+ }
150
+
151
+ &.active:not(.row-disabled),
152
+ &.active:not(.row-disabled) .datatable-row-group {
153
+ background-color: $ngx-datatable-selected-active-background;
154
+ color: $ngx-datatable-selected-active-color;
155
+ }
156
+
157
+ &.active:hover:not(.row-disabled),
158
+ &.active:hover:not(.row-disabled) .datatable-row-group {
159
+ background-color: $ngx-datatable-selected-active-background-hover;
160
+ color: $ngx-datatable-selected-active-color-hover;
161
+ }
162
+
163
+ &.active:focus:not(.row-disabled),
164
+ &.active:focus:not(.row-disabled) .datatable-row-group {
165
+ background-color: $ngx-datatable-selected-active-background-focus;
166
+ color: $ngx-datatable-selected-active-color-focus;
167
+ }
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Shared Styles
173
+ */
174
+ .empty-row {
175
+ height: 50px;
176
+ text-align: left;
177
+ padding: 0.5rem 1.2rem;
178
+ vertical-align: top;
179
+ border-top: 0;
180
+ }
181
+
182
+ .loading-row {
183
+ text-align: left;
184
+ padding: 0.5rem 1.2rem;
185
+ vertical-align: top;
186
+ border-top: 0;
187
+ }
188
+
189
+ /**
190
+ * Global Row Styles
191
+ */
192
+ .datatable-header,
193
+ .datatable-body {
194
+ .datatable-row-left {
195
+ background-color: $ngx-datatable-background;
196
+ background-position: 100% 0;
197
+ background-repeat: repeat-y;
198
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQIHWPSkNeSBmJhTQVtbiDNCgASagIIuJX8OgAAAABJRU5ErkJggg==);
199
+ }
200
+
201
+ .datatable-row-right {
202
+ background-position: 0 0;
203
+ background-color: $ngx-datatable-background;
204
+ background-repeat: repeat-y;
205
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAYAAAD5PA/NAAAAFklEQVQI12PQkNdi1VTQ5gbSwkAsDQARLAIGtOSFUAAAAABJRU5ErkJggg==);
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Header Styles
211
+ */
212
+ .datatable-header {
213
+ border-bottom: 1px solid $datatable-header-border-bottom-color;
214
+
215
+ .datatable-header-cell {
216
+ flex-shrink: 0;
217
+ text-align: left;
218
+ padding: 0.9rem 1.2rem;
219
+ font-weight: 400;
220
+ background-color: $datatable-header-cell-background;
221
+ color: $datatable-header-cell-color;
222
+ vertical-align: bottom;
223
+ font-size: 12px;
224
+ font-weight: 500;
225
+
226
+ .datatable-header-cell-wrapper {
227
+ position: relative;
228
+ }
229
+
230
+ &.longpress {
231
+ .draggable::after {
232
+ transition: transform 400ms ease, opacity 400ms ease;
233
+ opacity: 0.5;
234
+ transform: scale(1);
235
+ }
236
+ }
237
+
238
+ .draggable::after {
239
+ content: ' ';
240
+ position: absolute;
241
+ top: 50%;
242
+ left: 50%;
243
+ margin: -30px 0 0 -30px;
244
+ height: 60px;
245
+ width: 60px;
246
+ background: #eee;
247
+ border-radius: 100%;
248
+ opacity: 1;
249
+ filter: none;
250
+ transform: scale(0);
251
+ z-index: 9999;
252
+ pointer-events: none;
253
+ }
254
+
255
+ &.dragging {
256
+ .resize-handle {
257
+ border-right: none;
258
+ }
259
+ }
260
+ }
261
+
262
+ .resize-handle {
263
+ border-right: solid 1px $datatable-header-resize-handle-color;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Body Styles
269
+ */
270
+ .datatable-body {
271
+ position: relative;
272
+
273
+ .datatable-row-detail {
274
+ background: $datatable-row-detail-background;
275
+ padding: 10px;
276
+ }
277
+
278
+ .datatable-group-header {
279
+ background: $datatable-group-header-background;
280
+ border-bottom: solid 1px $datatable-group-header-border-bottom-color;
281
+ border-top: solid 1px $datatable-group-header-border-top-color;
282
+
283
+ .datatable-group-cell {
284
+ padding-inline-start: 1.2rem;
285
+ display: flex;
286
+ }
287
+ }
288
+
289
+ datatable-row-def {
290
+ background-color: $ngx-datatable-background;
291
+ }
292
+
293
+ .datatable-body-row {
294
+ border-bottom: 1px solid $datatable-body-row-border-bottom-color;
295
+
296
+ .datatable-body-cell {
297
+ flex-shrink: 0;
298
+ text-align: left;
299
+ padding: 0.9rem 1.2rem;
300
+ vertical-align: top;
301
+ border-top: 0;
302
+ color: $datatable-body-cell-color;
303
+ transition: width 0.3s ease;
304
+ font-size: 14px;
305
+ font-weight: 400;
306
+
307
+ // cell active class
308
+ // &.active {
309
+ // background: #0829e0
310
+ // }
311
+ }
312
+ .datatable-body-group-cell {
313
+ text-align: left;
314
+ padding: 0.9rem 1.2rem;
315
+ vertical-align: top;
316
+ border-top: 0;
317
+ color: $datatable-body-cell-color;
318
+ transition: width 0.3s ease;
319
+ font-size: 14px;
320
+ font-weight: 400;
321
+ }
322
+ }
323
+
324
+ .progress-linear {
325
+ display: block;
326
+ position: sticky;
327
+ width: 100%;
328
+ height: 0;
329
+ z-index: 999;
330
+ padding: 0;
331
+ margin: 0;
332
+ top: 0;
333
+
334
+ .container {
335
+ display: block;
336
+ position: relative;
337
+ overflow: hidden;
338
+ width: 100%;
339
+ height: 5px;
340
+ -webkit-transform: translate(0, 0) scale(1, 1);
341
+ transform: translate(0, 0) scale(1, 1);
342
+ background-color: rgb(170, 209, 249);
343
+
344
+ .bar {
345
+ transition: all 0.2s linear;
346
+ -webkit-animation: query 0.8s infinite cubic-bezier(0.39, 0.575, 0.565, 1);
347
+ animation: query 0.8s infinite cubic-bezier(0.39, 0.575, 0.565, 1);
348
+
349
+ transition: -webkit-transform 0.2s linear;
350
+ transition: transform 0.2s linear;
351
+ background-color: rgb(16, 108, 200);
352
+
353
+ position: absolute;
354
+ left: 0;
355
+ top: 0;
356
+ bottom: 0;
357
+ width: 100%;
358
+ height: 5px;
359
+ }
360
+ }
361
+ }
362
+
363
+ .custom-loading-indicator-wrapper {
364
+ position: sticky;
365
+ top: 0;
366
+ height: 0;
367
+ z-index: 999;
368
+ .custom-loading-content {
369
+ width: 100%;
370
+ background-color: $ngx-datatable-default-background;
371
+ }
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Footer Styles
377
+ */
378
+ .datatable-footer {
379
+ border-top: 1px solid $datatable-footer-border-top-color;
380
+ font-size: 12px;
381
+ font-weight: 400;
382
+ color: $datatable-footer-cell-color;
383
+
384
+ .page-count {
385
+ line-height: 50px;
386
+ height: 50px;
387
+ padding: 0 1.2rem;
388
+ }
389
+
390
+ .datatable-pager {
391
+ margin: 0 10px;
392
+
393
+ li {
394
+ vertical-align: middle;
395
+
396
+ &.disabled a {
397
+ color: $datatable-pager-disabled-color !important;
398
+ background-color: $datatable-pager-disabled-background !important;
399
+ }
400
+
401
+ &.active a {
402
+ background-color: $datatable-pager-active-background;
403
+ font-weight: bold;
404
+ }
405
+ }
406
+
407
+ a {
408
+ height: 22px;
409
+ min-width: 24px;
410
+ line-height: 22px;
411
+ padding: 0 6px;
412
+ border-radius: 3px;
413
+ margin: 6px 3px;
414
+ text-align: center;
415
+ vertical-align: top;
416
+ color: $datatable-pager-color;
417
+ text-decoration: none;
418
+ vertical-align: bottom;
419
+
420
+ &:hover {
421
+ color: $datatable-pager-color-hover;
422
+ background-color: $datatable-pager-background-hover;
423
+ }
424
+ }
425
+
426
+ .datatable-icon-left,
427
+ .datatable-icon-skip,
428
+ .datatable-icon-right,
429
+ .datatable-icon-prev {
430
+ font-size: 20px;
431
+ line-height: 20px;
432
+ padding: 0 3px;
433
+ }
434
+ }
435
+ }
436
+
437
+ // Summary row styles
438
+ .datatable-summary-row {
439
+ .datatable-body-row {
440
+ background-color: $datatable-summary-row-background;
441
+
442
+ &:hover {
443
+ background-color: $datatable-summary-row-background-hover;
444
+ }
445
+
446
+ .datatable-body-cell {
447
+ font-weight: bold;
448
+ }
449
+ }
450
+ }
451
+ }
452
+
453
+ /**
454
+ * Checkboxes
455
+ **/
456
+ .datatable-checkbox {
457
+ position: relative;
458
+ margin: 0;
459
+ cursor: pointer;
460
+ vertical-align: middle;
461
+ display: inline-block;
462
+ box-sizing: border-box;
463
+ padding: 0;
464
+
465
+ input[type='checkbox'] {
466
+ position: relative;
467
+ margin: 0 1rem 0 0;
468
+ cursor: pointer;
469
+ outline: none;
470
+
471
+ &:before {
472
+ -webkit-transition: all 0.3s ease-in-out;
473
+ -moz-transition: all 0.3s ease-in-out;
474
+ transition: all 0.3s ease-in-out;
475
+ content: '';
476
+ position: absolute;
477
+ left: 0;
478
+ z-index: 1;
479
+ width: 1rem;
480
+ height: 1rem;
481
+ border: 2px solid #f2f2f2;
482
+ }
483
+
484
+ &:checked:before {
485
+ -webkit-transform: rotate(-45deg);
486
+ -moz-transform: rotate(-45deg);
487
+ -ms-transform: rotate(-45deg);
488
+ transform: rotate(-45deg);
489
+ height: 0.5rem;
490
+ border-color: #009688;
491
+ border-top-style: none;
492
+ border-right-style: none;
493
+ }
494
+
495
+ &:after {
496
+ content: '';
497
+ position: absolute;
498
+ top: 0;
499
+ left: 0;
500
+ width: 1rem;
501
+ height: 1rem;
502
+ background: #fff;
503
+ cursor: pointer;
504
+ }
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Progress bar animations
510
+ */
511
+ @keyframes query {
512
+ 0% {
513
+ opacity: 1;
514
+ transform: translateX(35%) scale(0.3, 1);
515
+ }
516
+
517
+ 100% {
518
+ opacity: 0;
519
+ transform: translateX(-50%) scale(0, 1);
520
+ }
521
+ }