@webilix/ngx-table-m3 0.0.1 → 0.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.
@@ -36,9 +36,7 @@ export declare abstract class ColumnMethods<C /** COLUMN **/, V /** VALUE **/> {
36
36
  }
37
37
  export interface IColumnConfig {
38
38
  readonly isEN: boolean;
39
- readonly enClass: string;
40
39
  readonly isDeactive: boolean;
41
- readonly deactiveClass: string;
42
40
  }
43
41
  export declare const COLUMN_TYPE: InjectionToken<any>;
44
42
  export declare const COLUMN_CONFIG: InjectionToken<IColumnConfig>;
@@ -3,6 +3,7 @@ import { IViewConfig } from '../views';
3
3
  import { IFilter } from './filter.interface';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class FilterComponent implements OnInit {
6
+ private className;
6
7
  data: {
7
8
  filter: IFilter;
8
9
  viewConfig: IViewConfig;
@@ -2,12 +2,14 @@ import { IViewConfig } from '../../views';
2
2
  import { IFilterMultiSelect } from './filter-multi-select.interface';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FilterMultiSelectComponent {
5
+ private className;
5
6
  data: {
6
7
  filter: IFilterMultiSelect;
7
8
  viewConfig: IViewConfig;
8
9
  };
9
10
  value?: string[];
10
11
  onChange: (value?: string[]) => void;
12
+ searchQuery: string;
11
13
  updateValue(id: string, checked: boolean): void;
12
14
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterMultiSelectComponent, never>;
13
15
  static ɵcmp: i0.ɵɵComponentDeclaration<FilterMultiSelectComponent, "ng-component", never, {}, {}, never, never, true, never>;
@@ -3,6 +3,7 @@ import { IViewConfig } from '../../views';
3
3
  import { IFilterSearch, IFilterSearchValue } from './filter-search.interface';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class FilterSearchComponent implements AfterViewInit {
6
+ private className;
6
7
  private searchInput?;
7
8
  data: {
8
9
  filter: IFilterSearch;
@@ -2,12 +2,15 @@ import { IViewConfig } from '../../views';
2
2
  import { IFilterSelect } from './filter-select.interface';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class FilterSelectComponent {
5
+ private className;
5
6
  data: {
6
7
  filter: IFilterSelect;
7
8
  viewConfig: IViewConfig;
8
9
  };
9
10
  value?: string;
10
11
  onChange: (value?: string) => void;
12
+ searchQuery: string;
13
+ updateValue(id: string): void;
11
14
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterSelectComponent, never>;
12
15
  static ɵcmp: i0.ɵɵComponentDeclaration<FilterSelectComponent, "ng-component", never, {}, {}, never, never, true, never>;
13
16
  }
@@ -18,8 +18,6 @@ export declare class NgxTableComponent<T> implements OnInit, OnChanges {
18
18
  pagination?: INgxTablePagination | null;
19
19
  filterChanged: EventEmitter<INgxTableFilter>;
20
20
  isMobile: boolean;
21
- loaderClass: string;
22
- emptyClass: string;
23
21
  viewConfig: IViewConfig;
24
22
  private filter;
25
23
  hasFilter: boolean;
@@ -3,39 +3,13 @@ export interface INgxTableConfig {
3
3
  readonly mobileWidth: number;
4
4
  readonly alternateRows: boolean;
5
5
  readonly iconSize: number;
6
- readonly cssClasses: {
7
- readonly loader?: string;
8
- readonly empty?: string;
9
- readonly en?: string;
10
- readonly deactive?: string;
11
- };
12
- readonly colors: {
13
- readonly border?: string;
14
- readonly background?: string;
15
- readonly headerText?: string;
16
- readonly headerBackground?: string;
17
- readonly oddRowsBackground?: string;
18
- readonly evenRowsBackground?: string;
19
- readonly cardBackground?: string;
20
- readonly paginationBackground?: string;
21
- readonly highlightText?: string;
22
- readonly highlightBackground?: string;
23
- readonly inputText?: string;
24
- readonly inputBackground?: string;
25
- };
26
- readonly action: {
27
- readonly buttonSize?: string;
28
- readonly buttonColor?: string;
29
- readonly menuColor?: string;
30
- readonly warnColor?: string;
31
- readonly menuTitle?: string;
32
- };
6
+ readonly actionMenuTitle?: string;
33
7
  readonly stickyView: {
34
- readonly headerTop?: string | {
8
+ readonly top?: string | {
35
9
  readonly desktopView: string;
36
10
  readonly mobileView: string;
37
11
  };
38
- readonly paginationBottom?: string | {
12
+ readonly bottom?: string | {
39
13
  readonly desktopView: string;
40
14
  readonly mobileView: string;
41
15
  };
@@ -7,11 +7,12 @@ interface Action<T> {
7
7
  readonly title: string;
8
8
  readonly icon: string;
9
9
  readonly action: (data: T) => string[] | void;
10
- readonly color: string;
10
+ readonly color?: string;
11
11
  readonly isDisabled: boolean;
12
12
  }
13
13
  export declare class ViewActionComponent<T> implements OnChanges {
14
14
  private readonly router;
15
+ private className;
15
16
  actions: NgxTableAction<T>[];
16
17
  item: T;
17
18
  viewConfig: IViewConfig;
@@ -4,6 +4,7 @@ import { IViewConfig, IViewOrder } from '../../view.interface';
4
4
  import { Orders } from '../../view.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ViewCardToolbarComponent implements OnChanges {
7
+ private className;
7
8
  orders: Orders;
8
9
  filters: Filters;
9
10
  viewConfig: IViewConfig;
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  export declare class ViewCardComponent<T> implements OnChanges {
8
8
  private readonly filterService;
9
9
  private readonly viewService;
10
- private toolbarHeight;
10
+ private className;
11
11
  ngxTable: INgxTable<T>;
12
12
  data: T[];
13
13
  viewConfig: IViewConfig;
@@ -28,7 +28,7 @@ export declare class ViewCardComponent<T> implements OnChanges {
28
28
  orders: Orders;
29
29
  filters: Filters;
30
30
  hasToolbar: boolean;
31
- headerTop: string;
31
+ top: string;
32
32
  hasContent: boolean;
33
33
  constructor(filterService: FilterService, viewService: ViewService);
34
34
  ngOnChanges(changes: SimpleChanges): void;
@@ -4,6 +4,7 @@ import { IViewConfig } from '..';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ViewPaginationComponent implements OnInit, OnChanges {
6
6
  private readonly elementRef;
7
+ private className;
7
8
  private stylePosition;
8
9
  private styleBottom;
9
10
  type: string;
@@ -7,6 +7,7 @@ import * as i0 from "@angular/core";
7
7
  export declare class ViewTableComponent<T> implements OnChanges {
8
8
  private readonly viewService;
9
9
  private readonly filterService;
10
+ private className;
10
11
  ngxTable: INgxTable<T>;
11
12
  data: T[];
12
13
  viewConfig: IViewConfig;
@@ -5,6 +5,7 @@ import { IViewConfig } from '../view.interface';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ViewValueComponent<T> implements OnChanges {
7
7
  private readonly router;
8
+ private className;
8
9
  private textAlign;
9
10
  column: NgxTableColumn<T>;
10
11
  item: T;
@@ -1,31 +1,13 @@
1
1
  export interface IViewConfig {
2
2
  readonly alternateRows: boolean;
3
3
  readonly iconSize: string;
4
- readonly enClass: string;
5
- readonly deactiveClass: string;
6
- readonly borderColor: string;
7
- readonly backgroundColor: string;
8
- readonly headerTextColor: string;
9
- readonly headerBackgroundColor: string;
10
- readonly oddRowsBackgroundColor: string;
11
- readonly evenRowsBackgroundColor: string;
12
- readonly cardBackgroundColor: string;
13
- readonly paginationBackgroundColor: string;
14
- readonly highlightText: string;
15
- readonly highlightBackground: string;
16
- readonly inputText: string;
17
- readonly inputBackground: string;
18
- readonly actionButtonSize: string;
19
- readonly actionButtonColor: string;
20
- readonly actionMenuColor: string;
21
- readonly actionWarnColor: string;
22
4
  readonly actionMenuTitle: string;
23
5
  readonly stickyView?: {
24
- readonly headerTop?: {
6
+ readonly top?: {
25
7
  readonly desktopView: string;
26
8
  readonly mobileView: string;
27
9
  };
28
- readonly paginationBottom?: {
10
+ readonly bottom?: {
29
11
  readonly desktopView: string;
30
12
  readonly mobileView: string;
31
13
  };
@@ -0,0 +1,470 @@
1
+ /* GLOBAL VALUES */
2
+ :root {
3
+ --ngx-table-m3-toolbar-height: 32px;
4
+ }
5
+
6
+ /* DATA LOADER */
7
+ .ngx-table-m3-loader {
8
+ display: flex;
9
+ justify-content: center;
10
+
11
+ padding: 5rem 0;
12
+ }
13
+
14
+ /* EMPTY DATA SET */
15
+ .ngx-table-m3-empty {
16
+ direction: rtl;
17
+ padding: 3rem 0;
18
+ text-align: center;
19
+ font-size: 18px;
20
+ font-weight: 500;
21
+ color: var(--error);
22
+ }
23
+
24
+ /* ENGLISH VALUES */
25
+ .ngx-table-m3-en {
26
+ font-size: 13px;
27
+ direction: ltr;
28
+ font-family: Roboto, 'Helvetica Neue', sans-serif !important;
29
+ }
30
+
31
+ /* DEACTIVE DATA VIEW */
32
+ .ngx-table-m3-deactive {
33
+ opacity: 0.6;
34
+ text-decoration: line-through;
35
+ }
36
+
37
+ /* DATA VALUES */
38
+ .ngx-table-m3-value {
39
+ .container {
40
+ display: block;
41
+
42
+ .value {
43
+ display: inline-flex;
44
+ align-items: center;
45
+
46
+ mat-icon {
47
+ font-size: 100%;
48
+ padding: 0 0.5rem;
49
+ }
50
+ }
51
+
52
+ .sub-value {
53
+ font-size: 85%;
54
+ font-weight: normal;
55
+ opacity: 0.5;
56
+ }
57
+ }
58
+
59
+ .card-title {
60
+ font-weight: 500;
61
+ }
62
+
63
+ .card-sub-title {
64
+ font-size: 85%;
65
+ }
66
+ }
67
+
68
+ /* PAGINATION */
69
+ .ngx-table-m3-pagination {
70
+ display: block;
71
+ margin-top: 1rem;
72
+ z-index: 1;
73
+
74
+ content {
75
+ display: flex;
76
+ align-items: center;
77
+
78
+ margin: 0 auto;
79
+ padding: 0.5rem 0;
80
+ background-color: var(--background);
81
+ border-radius: 8px;
82
+ border: 1px solid var(--surface-container-highest);
83
+
84
+ .counts {
85
+ display: block;
86
+ padding-right: 0.75rem;
87
+
88
+ .title {
89
+ font-weight: 500;
90
+ line-height: 1;
91
+ }
92
+
93
+ .total {
94
+ font-size: 80%;
95
+ opacity: 0.75;
96
+ line-height: 1;
97
+ margin-top: 0.25rem;
98
+ }
99
+ }
100
+ }
101
+
102
+ .desktop-view {
103
+ column-gap: 0.5rem;
104
+ width: fit-content;
105
+
106
+ .counts {
107
+ min-width: 250px;
108
+ }
109
+ }
110
+
111
+ .mobile-view {
112
+ .counts {
113
+ flex: 1;
114
+ }
115
+ }
116
+
117
+ .has-shadow {
118
+ border: 1px solid var(--outline-variant);
119
+ box-shadow: 0 0 10px 0 var(--outline-variant);
120
+ }
121
+ }
122
+
123
+ /* ROW ACTIONS */
124
+ .ngx-table-m3-action {
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: flex-end;
128
+
129
+ button {
130
+ font-size: 90%;
131
+ color: var(--primary);
132
+ }
133
+
134
+ button.desktop-view {
135
+ border-radius: 0;
136
+ z-index: 0;
137
+ }
138
+
139
+ mat-icon {
140
+ color: var(--primary);
141
+ }
142
+
143
+ mat-icon.disabled {
144
+ color: unset;
145
+ }
146
+
147
+ .ngx-table-action-menu-item {
148
+ background-color: red !important;
149
+ }
150
+ }
151
+
152
+ /* FILTER VIEWS */
153
+ .ngx-table-m3-filter {
154
+ display: block;
155
+ position: relative;
156
+
157
+ input {
158
+ padding: 0.75rem 0.5rem;
159
+ border-radius: 8px;
160
+ border-width: 0;
161
+ border-bottom: 1px solid var(--outline-variant);
162
+ outline: none;
163
+ width: 100%;
164
+
165
+ box-sizing: border-box;
166
+ color: var(--on-surface);
167
+ background-color: var(--surface-container-highest);
168
+ }
169
+
170
+ input::placeholder {
171
+ font-family: Yekan;
172
+ text-align: right;
173
+ direction: rtl;
174
+ }
175
+
176
+ .search {
177
+ margin: 1rem 1rem 0 1rem;
178
+ }
179
+
180
+ .items {
181
+ padding: 0.5rem;
182
+
183
+ mat-checkbox {
184
+ display: block;
185
+
186
+ .title {
187
+ cursor: pointer;
188
+ }
189
+ }
190
+
191
+ mat-radio-group {
192
+ display: flex;
193
+ flex-direction: column;
194
+
195
+ mat-radio-button {
196
+ .title {
197
+ cursor: pointer;
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ .filter-items {
204
+ position: sticky;
205
+ top: 0;
206
+ z-index: 1;
207
+
208
+ input {
209
+ border-radius: 0;
210
+ }
211
+ }
212
+
213
+ footer {
214
+ display: flex;
215
+ justify-content: flex-end;
216
+ padding: 1rem;
217
+ column-gap: 0.5rem;
218
+
219
+ button.confirm {
220
+ flex: 1;
221
+ }
222
+ }
223
+ }
224
+
225
+ /* TABLE VIEW */
226
+ .ngx-table-m3 .ngx-table-m3-table-view {
227
+ table {
228
+ thead {
229
+ z-index: 1;
230
+ background-color: var(--surface-container-highest);
231
+
232
+ th {
233
+ padding: 1.25rem 1rem;
234
+
235
+ .column {
236
+ display: flex;
237
+ align-items: center;
238
+ column-gap: 0.5rem;
239
+
240
+ mat-icon {
241
+ font-size: 100%;
242
+ }
243
+ }
244
+ }
245
+
246
+ th.active-filters {
247
+ padding: 0;
248
+ text-align: right;
249
+ border-bottom: 1px solid var(--outline-variant);
250
+
251
+ .toolbar {
252
+ display: flex;
253
+ align-items: center;
254
+ flex-wrap: wrap;
255
+ row-gap: 0.5rem;
256
+ column-gap: 0.5rem;
257
+
258
+ overflow: hidden;
259
+ padding: 0.75rem;
260
+
261
+ .item {
262
+ display: flex;
263
+ align-items: center;
264
+
265
+ font-size: 85%;
266
+ border-radius: 16px;
267
+ border: 1px solid var(--outline);
268
+ white-space: nowrap;
269
+
270
+ .title {
271
+ cursor: pointer;
272
+ padding: 0 0.75rem 0 0.5rem;
273
+ }
274
+
275
+ .value {
276
+ cursor: pointer;
277
+ padding-left: 0.5rem;
278
+ font-weight: normal;
279
+ max-width: 150px;
280
+ overflow: hidden;
281
+ text-overflow: ellipsis;
282
+ }
283
+
284
+ .icon {
285
+ display: flex;
286
+ align-items: center;
287
+ justify-content: center;
288
+
289
+ cursor: pointer;
290
+ padding: 0.25rem 0.5rem;
291
+
292
+ mat-icon {
293
+ font-size: 100%;
294
+ }
295
+ }
296
+ }
297
+
298
+ .clear {
299
+ color: var(--secondary);
300
+ border-color: var(--secondary);
301
+ }
302
+ }
303
+ }
304
+ }
305
+
306
+ tbody {
307
+ tr {
308
+ td {
309
+ padding: 0.75rem 1rem;
310
+ vertical-align: top;
311
+ border-top: 1px solid var(--outline-variant);
312
+ }
313
+
314
+ td.icon {
315
+ padding-left: 0;
316
+ }
317
+
318
+ td.action {
319
+ padding: 0.25rem 0 0 0;
320
+ }
321
+
322
+ td.description {
323
+ padding-top: 0;
324
+ font-size: 85%;
325
+ line-height: 1.5;
326
+ text-align: justify;
327
+ }
328
+ }
329
+
330
+ tr.odd-row {
331
+ background-color: var(--surface-container);
332
+
333
+ td {
334
+ border-top-width: 0;
335
+ }
336
+ }
337
+
338
+ tr.even-row {
339
+ background-color: var(--background);
340
+
341
+ td {
342
+ border-top-width: 0;
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
348
+
349
+ /* CARD VIEW */
350
+ .ngx-table-m3 .ngx-table-m3-card-view {
351
+ .data {
352
+ display: flex;
353
+ flex-direction: column;
354
+ row-gap: 1rem;
355
+
356
+ .card {
357
+ border-bottom: 1px solid var(--outline-variant);
358
+
359
+ header {
360
+ display: flex;
361
+ align-items: flex-start;
362
+ column-gap: 0.75rem;
363
+ z-index: 1;
364
+
365
+ padding: 0.25rem 0.75rem 0.25rem 0;
366
+ border: 1px solid var(--outline-variant);
367
+ background-color: var(--surface-container-highest);
368
+ border-bottom-width: 0;
369
+
370
+ .icon {
371
+ padding: 0.5rem 0;
372
+ }
373
+
374
+ .title {
375
+ flex: 1;
376
+ padding: 0.5rem 0;
377
+ }
378
+ }
379
+
380
+ content {
381
+ display: block;
382
+ padding: 1rem 0 0.5rem 0;
383
+ border: 1px solid var(--outline-variant);
384
+ border-top-width: 0;
385
+ border-bottom-width: 0;
386
+ background-color: var(--surface-container-low);
387
+
388
+ .item {
389
+ display: flex;
390
+ align-items: flex-start;
391
+ column-gap: 1rem;
392
+
393
+ padding: 0 1rem 0.5rem 1rem;
394
+
395
+ .title {
396
+ width: 25%;
397
+ font-size: 85%;
398
+ font-weight: 500;
399
+ }
400
+
401
+ .value {
402
+ flex: 1;
403
+ }
404
+ }
405
+
406
+ .description {
407
+ text-align: justify;
408
+ font-size: 85%;
409
+ line-height: 1.5;
410
+ margin-top: 0.5rem;
411
+ padding: 0.75rem 1rem 0 1rem;
412
+ border-top: 1px solid var(--outline-variant);
413
+ }
414
+ }
415
+ }
416
+ }
417
+ }
418
+
419
+ .ngx-table-m3 .ngx-table-m3-card-view-toolbar {
420
+ .toolbar {
421
+ z-index: 2;
422
+ height: calc(var(--ngx-table-m3-toolbar-height) + 2px);
423
+ background-color: var(--background);
424
+ overflow-x: hidden;
425
+
426
+ .toolbar-items {
427
+ display: inline-flex;
428
+ align-items: center;
429
+ column-gap: 0.5rem;
430
+
431
+ position: relative;
432
+ left: 0;
433
+
434
+ .item {
435
+ display: flex;
436
+ align-items: center;
437
+ column-gap: 0.25rem;
438
+
439
+ padding: 0 0.5rem;
440
+ border-radius: 8px;
441
+ border: 1px solid var(--outline);
442
+ height: var(--ngx-table-m3-toolbar-height);
443
+
444
+ mat-icon {
445
+ font-size: 100%;
446
+ }
447
+
448
+ span {
449
+ font-size: 80%;
450
+ white-space: nowrap;
451
+ }
452
+ }
453
+
454
+ .active {
455
+ color: var(--secondary);
456
+ }
457
+
458
+ .clear {
459
+ color: var(--secondary);
460
+ border-color: var(--secondary);
461
+ }
462
+ }
463
+ }
464
+
465
+ .seperator {
466
+ z-index: 2;
467
+ height: 1rem;
468
+ background-color: var(--background);
469
+ }
470
+ }