@maggioli-design-system/mds-table-row 4.7.1 → 4.8.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.
Files changed (72) hide show
  1. package/dist/cjs/{index-6df370d5.js → index-6ff13374.js} +31 -4
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mds-table-row.cjs.entry.js +17 -3
  4. package/dist/cjs/mds-table-row.cjs.js +2 -2
  5. package/dist/collection/common/aria.js +17 -1
  6. package/dist/collection/common/device.js +6 -0
  7. package/dist/collection/common/keyboard-manager.js +2 -2
  8. package/dist/collection/components/mds-table-row/mds-table-row.css +59 -0
  9. package/dist/collection/components/mds-table-row/mds-table-row.js +26 -1
  10. package/dist/collection/dictionary/file-extensions.js +114 -56
  11. package/dist/collection/dictionary/text.js +60 -1
  12. package/dist/components/mds-table-row.js +18 -3
  13. package/dist/documentation.json +22 -1
  14. package/dist/esm/{index-6aef85b9.js → index-0a14d3b4.js} +31 -5
  15. package/dist/esm/loader.js +3 -3
  16. package/dist/esm/mds-table-row.entry.js +17 -3
  17. package/dist/esm/mds-table-row.js +3 -3
  18. package/dist/esm-es5/index-0a14d3b4.js +1 -0
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/mds-table-row.entry.js +1 -1
  21. package/dist/esm-es5/mds-table-row.js +1 -1
  22. package/dist/mds-table-row/mds-table-row.esm.js +1 -1
  23. package/dist/mds-table-row/mds-table-row.js +1 -1
  24. package/dist/mds-table-row/p-25a5e94e.system.js +1 -0
  25. package/dist/mds-table-row/p-33796315.entry.js +1 -0
  26. package/dist/mds-table-row/p-580bb30b.system.js +2 -0
  27. package/dist/mds-table-row/p-60aa058b.js +2 -0
  28. package/dist/mds-table-row/p-cca5599e.system.entry.js +1 -0
  29. package/dist/stats.json +83 -40
  30. package/dist/types/common/aria.d.ts +3 -1
  31. package/dist/types/common/device.d.ts +2 -0
  32. package/dist/types/components/mds-table-row/mds-table-row.d.ts +4 -0
  33. package/dist/types/components.d.ts +2 -0
  34. package/dist/types/dictionary/text.d.ts +3 -1
  35. package/dist/types/type/text.d.ts +2 -0
  36. package/documentation.json +30 -4
  37. package/package.json +2 -2
  38. package/readme.md +4 -3
  39. package/src/common/aria.ts +22 -2
  40. package/src/common/device.ts +9 -0
  41. package/src/common/keyboard-manager.ts +2 -2
  42. package/src/components/mds-table-row/mds-table-row.css +60 -0
  43. package/src/components/mds-table-row/mds-table-row.tsx +19 -1
  44. package/src/components/mds-table-row/readme.md +4 -3
  45. package/src/components.d.ts +2 -0
  46. package/src/dictionary/file-extensions.ts +115 -56
  47. package/src/dictionary/text.ts +64 -0
  48. package/src/fixtures/icons.json +8 -0
  49. package/src/fixtures/iconsauce.json +5 -0
  50. package/src/meta/file-format/locale.el.json +39 -0
  51. package/src/meta/file-format/locale.en.json +39 -0
  52. package/src/meta/file-format/locale.es.json +39 -0
  53. package/src/meta/file-format/locale.it.json +39 -0
  54. package/src/type/text.ts +59 -0
  55. package/www/build/mds-table-row.esm.js +1 -1
  56. package/www/build/mds-table-row.js +1 -1
  57. package/www/build/p-25a5e94e.system.js +1 -0
  58. package/www/build/p-33796315.entry.js +1 -0
  59. package/www/build/p-580bb30b.system.js +2 -0
  60. package/www/build/p-60aa058b.js +2 -0
  61. package/www/build/p-cca5599e.system.entry.js +1 -0
  62. package/dist/esm-es5/index-6aef85b9.js +0 -1
  63. package/dist/mds-table-row/p-6fd17720.js +0 -2
  64. package/dist/mds-table-row/p-81af01a5.entry.js +0 -1
  65. package/dist/mds-table-row/p-93ae789e.system.js +0 -2
  66. package/dist/mds-table-row/p-a349d802.system.js +0 -1
  67. package/dist/mds-table-row/p-fa157b43.system.entry.js +0 -1
  68. package/www/build/p-6fd17720.js +0 -2
  69. package/www/build/p-81af01a5.entry.js +0 -1
  70. package/www/build/p-93ae789e.system.js +0 -2
  71. package/www/build/p-a349d802.system.js +0 -1
  72. package/www/build/p-fa157b43.system.entry.js +0 -1
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-11-25T16:22:40",
2
+ "timestamp": "2024-12-04T16:25:26",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "22.11.0"
@@ -9,14 +9,15 @@
9
9
  "fsNamespace": "mds-table-row",
10
10
  "components": 1,
11
11
  "entries": 1,
12
- "bundles": 90,
12
+ "bundles": 91,
13
13
  "outputs": [
14
14
  {
15
15
  "name": "dist-collection",
16
- "files": 42,
16
+ "files": 43,
17
17
  "generatedFiles": [
18
18
  "./dist/collection/common/aria.js",
19
19
  "./dist/collection/common/date.js",
20
+ "./dist/collection/common/device.js",
20
21
  "./dist/collection/common/file.js",
21
22
  "./dist/collection/common/icon.js",
22
23
  "./dist/collection/common/keyboard-manager.js",
@@ -74,19 +75,19 @@
74
75
  "files": 42,
75
76
  "generatedFiles": [
76
77
  "./dist/cjs/app-globals-3a1e7e63.js",
77
- "./dist/cjs/index-6df370d5.js",
78
+ "./dist/cjs/index-6ff13374.js",
78
79
  "./dist/cjs/index.cjs.js",
79
80
  "./dist/cjs/loader.cjs.js",
80
81
  "./dist/cjs/mds-table-row.cjs.entry.js",
81
82
  "./dist/cjs/mds-table-row.cjs.js",
82
83
  "./dist/esm-es5/app-globals-0f993ce5.js",
83
- "./dist/esm-es5/index-6aef85b9.js",
84
+ "./dist/esm-es5/index-0a14d3b4.js",
84
85
  "./dist/esm-es5/index.js",
85
86
  "./dist/esm-es5/loader.js",
86
87
  "./dist/esm-es5/mds-table-row.entry.js",
87
88
  "./dist/esm-es5/mds-table-row.js",
88
89
  "./dist/esm/app-globals-0f993ce5.js",
89
- "./dist/esm/index-6aef85b9.js",
90
+ "./dist/esm/index-0a14d3b4.js",
90
91
  "./dist/esm/index.js",
91
92
  "./dist/esm/loader.js",
92
93
  "./dist/esm/mds-table-row.entry.js",
@@ -96,25 +97,25 @@
96
97
  "./dist/mds-table-row/index.esm.js",
97
98
  "./dist/mds-table-row/mds-table-row.esm.js",
98
99
  "./dist/mds-table-row/mds-table-row.js",
100
+ "./dist/mds-table-row/p-25a5e94e.system.js",
101
+ "./dist/mds-table-row/p-33796315.entry.js",
99
102
  "./dist/mds-table-row/p-50ea2036.system.js",
100
103
  "./dist/mds-table-row/p-56ba5cbf.system.js",
101
- "./dist/mds-table-row/p-6fd17720.js",
102
- "./dist/mds-table-row/p-81af01a5.entry.js",
103
- "./dist/mds-table-row/p-93ae789e.system.js",
104
- "./dist/mds-table-row/p-a349d802.system.js",
104
+ "./dist/mds-table-row/p-580bb30b.system.js",
105
+ "./dist/mds-table-row/p-60aa058b.js",
106
+ "./dist/mds-table-row/p-cca5599e.system.entry.js",
105
107
  "./dist/mds-table-row/p-e1255160.js",
106
- "./dist/mds-table-row/p-fa157b43.system.entry.js",
107
108
  "./www/build/index.esm.js",
108
109
  "./www/build/mds-table-row.esm.js",
109
110
  "./www/build/mds-table-row.js",
111
+ "./www/build/p-25a5e94e.system.js",
112
+ "./www/build/p-33796315.entry.js",
110
113
  "./www/build/p-50ea2036.system.js",
111
114
  "./www/build/p-56ba5cbf.system.js",
112
- "./www/build/p-6fd17720.js",
113
- "./www/build/p-81af01a5.entry.js",
114
- "./www/build/p-93ae789e.system.js",
115
- "./www/build/p-a349d802.system.js",
116
- "./www/build/p-e1255160.js",
117
- "./www/build/p-fa157b43.system.entry.js"
115
+ "./www/build/p-580bb30b.system.js",
116
+ "./www/build/p-60aa058b.js",
117
+ "./www/build/p-cca5599e.system.entry.js",
118
+ "./www/build/p-e1255160.js"
118
119
  ]
119
120
  },
120
121
  {
@@ -147,12 +148,12 @@
147
148
  "components": [
148
149
  "mds-table-row"
149
150
  ],
150
- "bundleId": "p-81af01a5",
151
- "fileName": "p-81af01a5.entry.js",
151
+ "bundleId": "p-33796315",
152
+ "fileName": "p-33796315.entry.js",
152
153
  "imports": [
153
- "p-6fd17720.js"
154
+ "p-60aa058b.js"
154
155
  ],
155
- "originalByteSize": 2399
156
+ "originalByteSize": 5883
156
157
  }
157
158
  ],
158
159
  "esm": [
@@ -164,9 +165,9 @@
164
165
  "bundleId": "mds-table-row",
165
166
  "fileName": "mds-table-row.entry.js",
166
167
  "imports": [
167
- "index-6aef85b9.js"
168
+ "index-0a14d3b4.js"
168
169
  ],
169
- "originalByteSize": 2403
170
+ "originalByteSize": 5887
170
171
  }
171
172
  ],
172
173
  "es5": [
@@ -178,9 +179,9 @@
178
179
  "bundleId": "mds-table-row",
179
180
  "fileName": "mds-table-row.entry.js",
180
181
  "imports": [
181
- "index-6aef85b9.js"
182
+ "index-0a14d3b4.js"
182
183
  ],
183
- "originalByteSize": 2403
184
+ "originalByteSize": 5887
184
185
  }
185
186
  ],
186
187
  "system": [
@@ -189,12 +190,12 @@
189
190
  "components": [
190
191
  "mds-table-row"
191
192
  ],
192
- "bundleId": "p-fa157b43.system",
193
- "fileName": "p-fa157b43.system.entry.js",
193
+ "bundleId": "p-cca5599e.system",
194
+ "fileName": "p-cca5599e.system.entry.js",
194
195
  "imports": [
195
- "p-93ae789e.system.js"
196
+ "p-580bb30b.system.js"
196
197
  ],
197
- "originalByteSize": 2690
198
+ "originalByteSize": 6480
198
199
  }
199
200
  ],
200
201
  "commonjs": [
@@ -206,9 +207,9 @@
206
207
  "bundleId": "mds-table-row.cjs",
207
208
  "fileName": "mds-table-row.cjs.entry.js",
208
209
  "imports": [
209
- "index-6df370d5.js"
210
+ "index-6ff13374.js"
210
211
  ],
211
- "originalByteSize": 2473
212
+ "originalByteSize": 5964
212
213
  }
213
214
  ]
214
215
  },
@@ -217,7 +218,7 @@
217
218
  "tag": "mds-table-row",
218
219
  "path": "./src/components/mds-table-row/mds-table-row.js",
219
220
  "source": "./src/components/mds-table-row/mds-table-row.tsx",
220
- "elementRef": null,
221
+ "elementRef": "host",
221
222
  "componentClassName": "MdsTableRow",
222
223
  "assetsDirs": [],
223
224
  "dependencies": [],
@@ -267,6 +268,25 @@
267
268
  "text": ""
268
269
  },
269
270
  "internal": false
271
+ },
272
+ {
273
+ "name": "overlayActions",
274
+ "type": "boolean",
275
+ "attribute": "overlay-actions",
276
+ "reflect": true,
277
+ "mutable": true,
278
+ "required": false,
279
+ "optional": false,
280
+ "complexType": {
281
+ "original": "boolean",
282
+ "resolved": "boolean",
283
+ "references": {}
284
+ },
285
+ "docs": {
286
+ "tags": [],
287
+ "text": ""
288
+ },
289
+ "internal": false
270
290
  }
271
291
  ],
272
292
  "shadowDelegatesFocus": false,
@@ -283,7 +303,7 @@
283
303
  "excludeFromCollection": false,
284
304
  "isCollectionDependency": false,
285
305
  "componentClassName": "MdsTableRow",
286
- "elementRef": null,
306
+ "elementRef": "host",
287
307
  "encapsulation": "shadow",
288
308
  "shadowDelegatesFocus": false,
289
309
  "properties": [
@@ -305,6 +325,25 @@
305
325
  "text": ""
306
326
  },
307
327
  "internal": false
328
+ },
329
+ {
330
+ "name": "overlayActions",
331
+ "type": "boolean",
332
+ "attribute": "overlay-actions",
333
+ "reflect": true,
334
+ "mutable": true,
335
+ "required": false,
336
+ "optional": false,
337
+ "complexType": {
338
+ "original": "boolean",
339
+ "resolved": "boolean",
340
+ "references": {}
341
+ },
342
+ "docs": {
343
+ "tags": [],
344
+ "text": ""
345
+ },
346
+ "internal": false
308
347
  }
309
348
  ],
310
349
  "virtualProperties": [],
@@ -352,7 +391,7 @@
352
391
  "sourceFilePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/magma/design-system/projects/stencil/.build/mds-table-row/src/components/mds-table-row/mds-table-row.tsx",
353
392
  "sourceMapPath": null,
354
393
  "hasAttributeChangedCallbackFn": false,
355
- "hasComponentWillLoadFn": false,
394
+ "hasComponentWillLoadFn": true,
356
395
  "hasComponentDidLoadFn": false,
357
396
  "hasComponentShouldUpdateFn": false,
358
397
  "hasComponentWillUpdateFn": false,
@@ -364,7 +403,7 @@
364
403
  "hasDisconnectedCallbackFn": false,
365
404
  "hasElement": false,
366
405
  "hasEvent": false,
367
- "hasLifecycle": false,
406
+ "hasLifecycle": true,
368
407
  "hasListener": true,
369
408
  "hasListenerTarget": true,
370
409
  "hasListenerTargetWindow": false,
@@ -386,7 +425,7 @@
386
425
  "hasStyle": true,
387
426
  "hasVdomAttribute": true,
388
427
  "hasVdomXlink": false,
389
- "hasVdomClass": false,
428
+ "hasVdomClass": true,
390
429
  "hasVdomFunctional": false,
391
430
  "hasVdomKey": true,
392
431
  "hasVdomListener": false,
@@ -394,15 +433,18 @@
394
433
  "hasVdomRef": false,
395
434
  "hasVdomRender": true,
396
435
  "hasVdomStyle": false,
397
- "hasVdomText": false,
436
+ "hasVdomText": true,
398
437
  "hasWatchCallback": false,
399
438
  "isPlain": false,
400
439
  "htmlAttrNames": [
401
440
  "key",
402
- "role"
441
+ "role",
442
+ "class",
443
+ "name"
403
444
  ],
404
445
  "htmlTagNames": [
405
- "slot"
446
+ "slot",
447
+ "div"
406
448
  ],
407
449
  "htmlParts": [],
408
450
  "isUpdateable": true,
@@ -418,12 +460,13 @@
418
460
  ],
419
461
  "componentGraph": {
420
462
  "sc-mds-table-row": [
421
- "p-6fd17720.js"
463
+ "p-60aa058b.js"
422
464
  ]
423
465
  },
424
466
  "sourceGraph": {
425
467
  "./src/common/aria.ts": [],
426
468
  "./src/common/date.ts": [],
469
+ "./src/common/device.ts": [],
427
470
  "./src/common/file.ts": [],
428
471
  "./src/common/icon.ts": [],
429
472
  "./src/common/keyboard-manager.ts": [],
@@ -1,5 +1,7 @@
1
1
  declare const unslugName: (name: string) => string;
2
2
  declare const setAttributeIfEmpty: (element: HTMLElement, attribute: string, value: string) => string;
3
+ declare const removeAttributesIf: (element: HTMLElement, attribute: string, valueCheck: string | undefined, cleanAttributes: string | string[]) => boolean;
4
+ declare const ifAttribute: (element: HTMLElement, attribute: string, valueCheck?: string) => boolean;
3
5
  declare const hashValue: (value: string) => string;
4
6
  declare const hashRandomValue: (value?: string) => string;
5
- export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
7
+ export { hashRandomValue, hashValue, removeAttributesIf, setAttributeIfEmpty, ifAttribute, unslugName, };
@@ -0,0 +1,2 @@
1
+ declare const isMobileDevice: () => boolean;
2
+ export { isMobileDevice, };
@@ -2,7 +2,11 @@
2
2
  * @slot default - Put `mds-table-cell` element/s.
3
3
  */
4
4
  export declare class MdsTableRow {
5
+ host: HTMLMdsTableRowElement;
6
+ private actions;
5
7
  interactive: boolean;
8
+ overlayActions: boolean;
6
9
  tableInteractiveHandler(event: CustomEvent<boolean>): void;
10
+ componentWillLoad(): void;
7
11
  render(): any;
8
12
  }
@@ -8,6 +8,7 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  export namespace Components {
9
9
  interface MdsTableRow {
10
10
  "interactive": boolean;
11
+ "overlayActions": boolean;
11
12
  }
12
13
  }
13
14
  declare global {
@@ -24,6 +25,7 @@ declare global {
24
25
  declare namespace LocalJSX {
25
26
  interface MdsTableRow {
26
27
  "interactive"?: boolean;
28
+ "overlayActions"?: boolean;
27
29
  }
28
30
  interface IntrinsicElements {
29
31
  "mds-table-row": MdsTableRow;
@@ -1,2 +1,4 @@
1
+ declare const typographyTagDictionary: string[];
2
+ declare const typographyHeadingTagDictionary: string[];
1
3
  declare const truncateDictionary: string[];
2
- export { truncateDictionary, };
4
+ export { truncateDictionary, typographyHeadingTagDictionary, typographyTagDictionary, };
@@ -1 +1,3 @@
1
+ export type TypographyTagType = 'abbr' | 'address' | 'article' | 'b' | 'bdo' | 'blockquote' | 'cite' | 'code' | 'dd' | 'del' | 'details' | 'dfn' | 'div' | 'dl' | 'dt' | 'em' | 'figcaption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'i' | 'ins' | 'kbd' | 'label' | 'legend' | 'li' | 'mark' | 'ol' | 'p' | 'pre' | 'q' | 'rb' | 'rt' | 'ruby' | 's' | 'samp' | 'small' | 'span' | 'strong' | 'sub' | 'summary' | 'sup' | 'time' | 'u' | 'ul' | 'var';
2
+ export type TypographyHeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
1
3
  export type TypographyTruncateType = 'all' | 'none' | 'word';
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-11-25T16:00:58",
2
+ "timestamp": "2024-12-04T15:30:05",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.22.2",
@@ -40,6 +40,27 @@
40
40
  ],
41
41
  "optional": false,
42
42
  "required": false
43
+ },
44
+ {
45
+ "name": "overlayActions",
46
+ "type": "boolean",
47
+ "complexType": {
48
+ "original": "boolean",
49
+ "resolved": "boolean",
50
+ "references": {}
51
+ },
52
+ "mutable": true,
53
+ "attr": "overlay-actions",
54
+ "reflectToAttr": true,
55
+ "docs": "",
56
+ "docsTags": [],
57
+ "values": [
58
+ {
59
+ "type": "boolean"
60
+ }
61
+ ],
62
+ "optional": false,
63
+ "required": false
43
64
  }
44
65
  ],
45
66
  "methods": [],
@@ -476,6 +497,11 @@
476
497
  "docstring": "",
477
498
  "path": "src/components/mds-push-notification/meta/event-detail.ts"
478
499
  },
500
+ "src/type/text.ts::TypographyHeadingTagType": {
501
+ "declaration": "export type TypographyHeadingTagType =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'",
502
+ "docstring": "",
503
+ "path": "src/type/text.ts"
504
+ },
479
505
  "src/components/mds-stepper-bar/meta/event-detail.ts::MdsStepperBarEventDetail": {
480
506
  "declaration": "export interface MdsStepperBarEventDetail {\n step: number\n value: string\n}",
481
507
  "docstring": "",
@@ -507,7 +533,7 @@
507
533
  "path": "src/components/mds-tab-item/meta/event-detail.ts"
508
534
  },
509
535
  "src/components/mds-table-header-cell/meta/types.ts::SortDirectionType": {
510
- "declaration": "export type SortDirectionType =\n | 'asc'\n | 'desc'\n | 'none'",
536
+ "declaration": "export type SortDirectionType =\n | 'ascending'\n | 'descending'\n | 'none'",
511
537
  "docstring": "",
512
538
  "path": "src/components/mds-table-header-cell/meta/types.ts"
513
539
  },
@@ -516,10 +542,10 @@
516
542
  "docstring": "",
517
543
  "path": "src/components/mds-text/meta/types.ts"
518
544
  },
519
- "src/components/mds-text/meta/types.ts::TypographyTagType": {
545
+ "src/type/text.ts::TypographyTagType": {
520
546
  "declaration": "export type TypographyTagType =\n | 'abbr'\n | 'address'\n | 'article'\n | 'b'\n | 'bdo'\n | 'blockquote'\n | 'cite'\n | 'code'\n | 'dd'\n | 'del'\n | 'details'\n | 'dfn'\n | 'div'\n | 'dl'\n | 'dt'\n | 'em'\n | 'figcaption'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'i'\n | 'ins'\n | 'kbd'\n | 'label'\n | 'legend'\n | 'li'\n | 'mark'\n | 'ol'\n | 'p'\n | 'pre'\n | 'q'\n | 'rb'\n | 'rt'\n | 'ruby'\n | 's'\n | 'samp'\n | 'small'\n | 'span'\n | 'strong'\n | 'sub'\n | 'summary'\n | 'sup'\n | 'time'\n | 'u'\n | 'ul'\n | 'var'",
521
547
  "docstring": "",
522
- "path": "src/components/mds-text/meta/types.ts"
548
+ "path": "src/type/text.ts"
523
549
  },
524
550
  "src/type/variant.ts::ThemeLuminanceVariantType": {
525
551
  "declaration": "export type ThemeLuminanceVariantType =\n | 'dark'\n | 'light'",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-table-row",
3
- "version": "4.7.1",
3
+ "version": "4.8.0",
4
4
  "description": "mds-table-row is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "prepublishOnly": "npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@maggioli-design-system/mds-table-cell": "4.7.1",
26
+ "@maggioli-design-system/mds-table-cell": "4.7.2",
27
27
  "@maggioli-design-system/styles": "15.5.0",
28
28
  "@stencil/core": "4.22.2"
29
29
  },
package/readme.md CHANGED
@@ -9,9 +9,10 @@ This is a web-component from Maggioli Design System [Magma](https://magma.maggio
9
9
 
10
10
  ## Properties
11
11
 
12
- | Property | Attribute | Description | Type | Default |
13
- | ------------- | ------------- | ----------- | --------- | ----------- |
14
- | `interactive` | `interactive` | | `boolean` | `undefined` |
12
+ | Property | Attribute | Description | Type | Default |
13
+ | ---------------- | ----------------- | ----------- | --------- | ----------- |
14
+ | `interactive` | `interactive` | | `boolean` | `undefined` |
15
+ | `overlayActions` | `overlay-actions` | | `boolean` | `undefined` |
15
16
 
16
17
 
17
18
  ## Slots
@@ -20,6 +20,24 @@ const setAttributeIfEmpty = (element: HTMLElement, attribute: string, value: str
20
20
  return value
21
21
  }
22
22
 
23
+ const removeAttributesIf = (element: HTMLElement, attribute: string, valueCheck: string = 'true', cleanAttributes: string | string[]): boolean => {
24
+ if (ifAttribute(element, attribute, valueCheck)) {
25
+ const attributesList = Array.isArray(cleanAttributes) ? cleanAttributes : [cleanAttributes]
26
+ attributesList.forEach(attributeToRemove => {
27
+ element.removeAttribute(attributeToRemove)
28
+ })
29
+ return true
30
+ }
31
+ return false
32
+ }
33
+
34
+ const ifAttribute = (element: HTMLElement, attribute: string, valueCheck: string = 'true'): boolean => {
35
+ if (element.hasAttribute(attribute) && element.getAttribute(attribute) === valueCheck) {
36
+ return true
37
+ }
38
+ return false
39
+ }
40
+
23
41
  const hashValue = (value: string): string => `${value}-${hash(value)}`
24
42
 
25
43
  const hashRandomValue = (value?: string): string => {
@@ -32,8 +50,10 @@ const hashRandomValue = (value?: string): string => {
32
50
  }
33
51
 
34
52
  export {
35
- unslugName,
36
- setAttributeIfEmpty,
37
53
  hashRandomValue,
38
54
  hashValue,
55
+ removeAttributesIf,
56
+ setAttributeIfEmpty,
57
+ ifAttribute,
58
+ unslugName,
39
59
  }
@@ -0,0 +1,9 @@
1
+ const isMobileDevice = (): boolean => {
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
+ const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera
4
+ return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent)
5
+ }
6
+
7
+ export {
8
+ isMobileDevice,
9
+ }
@@ -36,14 +36,14 @@ export class KeyboardManager {
36
36
 
37
37
  attachEscapeBehavior = (callback: () => void): void => {
38
38
  this.escapeCallback = callback
39
- if (window !== undefined) {
39
+ if (typeof window !== 'undefined') {
40
40
  window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
41
41
  }
42
42
  }
43
43
 
44
44
  detachEscapeBehavior = (): void => {
45
45
  this.escapeCallback = () => { return }
46
- if (window !== undefined) {
46
+ if (typeof window !== 'undefined') {
47
47
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
48
48
  }
49
49
  }
@@ -4,6 +4,8 @@
4
4
 
5
5
  --mds-table-row-color-hover: var(--mds-table-color-hover, theme('colors.tone-neutral-02'));
6
6
  --mds-table-row-color: var(--mds-table-color, theme('colors.tone-neutral-03'));
7
+ --mds-table-row-actions-gap: var(--mds-table-actions-gap, theme('spacing.400'));
8
+
7
9
 
8
10
  @apply
9
11
  duration-200
@@ -11,10 +13,68 @@
11
13
 
12
14
  color: var(--mds-table-row-color);
13
15
  display: table-row;
16
+ position: relative;
14
17
  transition-property: color;
15
18
 
16
19
  }
17
20
 
21
+ .actions-wrapper {
22
+ inset: 0;
23
+ display: flex;
24
+ justify-content: end;
25
+ pointer-events: none;
26
+ position: absolute;
27
+ }
28
+
29
+ .actions {
30
+ align-items: center;
31
+ background-color: var(--mds-table-cell-background);
32
+ border-bottom-color: transparent;
33
+ border-bottom-style: solid;
34
+ border-bottom-width: var(--mds-table-border-width);
35
+ border-top-color: var(--mds-table-border-color);
36
+ border-top-style: solid;
37
+ border-top-width: var(--mds-table-border-width);
38
+ box-sizing: border-box;
39
+ display: inline-flex;
40
+ gap: var(--mds-table-row-actions-gap);
41
+ height: 100%;
42
+ margin-top: calc(var(--mds-table-border-width) * -1);
43
+ padding: var(--mds-table-cell-padding);
44
+ pointer-events: auto;
45
+ position: sticky;
46
+ right: 0;
47
+ transform: translateX(100%);
48
+ transition-duration: theme('transitionDuration.500');
49
+ transition-property: transform, background-color;
50
+ transition-timing-function: theme('transitionTimingFunction.out-expo');
51
+ }
52
+
53
+ .actions-wrapper--mobile {
54
+ position: relative;
55
+ }
56
+
57
+ .actions-wrapper--mobile .actions {
58
+ position: static;
59
+ transform: translateX(0);
60
+ }
61
+
62
+ :host(:hover) .actions {
63
+ transform: translateX(0);
64
+ }
65
+
66
+ :host([overlay-actions]:not([overlay-actions="false"])) .actions-wrapper:not(.actions-wrapper--mobile) .actions {
67
+ transform: translateX(100%);
68
+ }
69
+
70
+ :host([interactive]:not([interactive="false"])) .actions {
71
+ --mds-table-cell-background: var(--mds-table-body-background);
72
+ }
73
+
74
+ :host([interactive]:not([interactive="false"]):hover) .actions {
75
+ --mds-table-cell-background: var(--mds-table-cell-background-hover);
76
+ }
77
+
18
78
  :host([sorted][interactive]:not([interactive="false"])) ::slotted(mds-table-cell[sorted]) {
19
79
 
20
80
  --mds-table-cell-background: var(--mds-table-cell-background-hover);
@@ -1,4 +1,6 @@
1
- import { Component, Host, h, Listen, Prop } from '@stencil/core'
1
+ import { Component, Host, h, Listen, Prop, Element } from '@stencil/core'
2
+ import { isMobileDevice } from '@common/device'
3
+ import clsx from 'clsx'
2
4
 
3
5
  /**
4
6
  * @slot default - Put `mds-table-cell` element/s.
@@ -11,17 +13,33 @@ import { Component, Host, h, Listen, Prop } from '@stencil/core'
11
13
  })
12
14
  export class MdsTableRow {
13
15
 
16
+ @Element() host: HTMLMdsTableRowElement
17
+ private actions: boolean
18
+
14
19
  @Prop({ mutable: true, reflect: true }) interactive: boolean
15
20
 
21
+ @Prop({ mutable: true, reflect: true }) overlayActions: boolean
22
+
16
23
  @Listen('mdsTableInteractiveChange', { target: 'document' })
17
24
  tableInteractiveHandler (event: CustomEvent<boolean>): void {
18
25
  this.interactive = event.detail
19
26
  }
20
27
 
28
+ componentWillLoad (): void {
29
+ this.actions = this.host.querySelector('[slot="action"]') !== null
30
+ }
31
+
21
32
  render () {
22
33
  return (
23
34
  <Host role="row">
24
35
  <slot/>
36
+ { this.actions
37
+ && <div class={clsx('actions-wrapper', isMobileDevice() && 'actions-wrapper--mobile')} role="cell">
38
+ <div class="actions">
39
+ <slot name="action"></slot>
40
+ </div>
41
+ </div>
42
+ }
25
43
  </Host>
26
44
  )
27
45
  }
@@ -7,9 +7,10 @@
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Description | Type | Default |
11
- | ------------- | ------------- | ----------- | --------- | ----------- |
12
- | `interactive` | `interactive` | | `boolean` | `undefined` |
10
+ | Property | Attribute | Description | Type | Default |
11
+ | ---------------- | ----------------- | ----------- | --------- | ----------- |
12
+ | `interactive` | `interactive` | | `boolean` | `undefined` |
13
+ | `overlayActions` | `overlay-actions` | | `boolean` | `undefined` |
13
14
 
14
15
 
15
16
  ## Slots
@@ -8,6 +8,7 @@ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
8
8
  export namespace Components {
9
9
  interface MdsTableRow {
10
10
  "interactive": boolean;
11
+ "overlayActions": boolean;
11
12
  }
12
13
  }
13
14
  declare global {
@@ -24,6 +25,7 @@ declare global {
24
25
  declare namespace LocalJSX {
25
26
  interface MdsTableRow {
26
27
  "interactive"?: boolean;
28
+ "overlayActions"?: boolean;
27
29
  }
28
30
  interface IntrinsicElements {
29
31
  "mds-table-row": MdsTableRow;