@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
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'mds-table-row';
24
- const BUILD = /* mds-table-row */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: false, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: false, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: false, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: false, vdomXlink: false, watchCallback: false };
24
+ const BUILD = /* mds-table-row */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: true, hydratedClass: false, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: false, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: false, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: false, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
25
25
 
26
26
  /*
27
27
  Stencil Client Platform v4.22.2 | MIT Licensed | https://stenciljs.com
@@ -274,6 +274,12 @@ var h = (nodeName, vnodeData, ...children) => {
274
274
  if (vnodeData.key) {
275
275
  key = vnodeData.key;
276
276
  }
277
+ {
278
+ const classData = vnodeData.className || vnodeData.class;
279
+ if (classData) {
280
+ vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
281
+ }
282
+ }
277
283
  }
278
284
  const vnode = newVNode(nodeName, null);
279
285
  vnode.$attrs$ = vnodeData;
@@ -312,6 +318,7 @@ var parsePropertyValue = (propValue, propType) => {
312
318
  }
313
319
  return propValue;
314
320
  };
321
+ var getElement = (ref) => getHostRef(ref).$hostElement$ ;
315
322
  var emitEvent = (elm, name, opts) => {
316
323
  const ev = plt.ce(name, opts);
317
324
  elm.dispatchEvent(ev);
@@ -411,7 +418,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
411
418
  if (oldValue !== newValue) {
412
419
  let isProp = isMemberInElement(elm, memberName);
413
420
  memberName.toLowerCase();
414
- if (memberName === "key") ; else {
421
+ if (memberName === "class") {
422
+ const classList = elm.classList;
423
+ const oldClasses = parseClassList(oldValue);
424
+ const newClasses = parseClassList(newValue);
425
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
426
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
427
+ } else if (memberName === "key") ; else {
415
428
  const isComplex = isComplexType(newValue);
416
429
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
417
430
  try {
@@ -447,6 +460,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
447
460
  }
448
461
  }
449
462
  };
463
+ var parseClassListRegex = /\s/;
464
+ var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
450
465
 
451
466
  // src/runtime/vdom/update-element.ts
452
467
  var updateElement = (oldVnode, newVnode, isSvgMode2) => {
@@ -484,7 +499,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
484
499
  let i2 = 0;
485
500
  let elm;
486
501
  let childNode;
487
- {
502
+ if (newVNode2.$text$ !== null) {
503
+ elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
504
+ } else {
488
505
  elm = newVNode2.$elm$ = doc.createElement(
489
506
  !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
490
507
  );
@@ -633,7 +650,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
633
650
  const oldChildren = oldVNode.$children$;
634
651
  const newChildren = newVNode2.$children$;
635
652
  const tag = newVNode2.$tag$;
636
- {
653
+ const text = newVNode2.$text$;
654
+ if (text === null) {
637
655
  {
638
656
  if (tag === "slot" && !useNativeShadowDom) ; else {
639
657
  updateElement(oldVNode, newVNode2, isSvgMode);
@@ -642,6 +660,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
642
660
  if (oldChildren !== null && newChildren !== null) {
643
661
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
644
662
  } else if (newChildren !== null) {
663
+ if (oldVNode.$text$ !== null) {
664
+ elm.textContent = "";
665
+ }
645
666
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
646
667
  } else if (
647
668
  // don't do this on initial render as it can cause non-hydrated content to be removed
@@ -649,6 +670,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
649
670
  ) {
650
671
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
651
672
  }
673
+ } else if (oldVNode.$text$ !== text) {
674
+ elm.data = text;
652
675
  }
653
676
  };
654
677
  var insertBefore = (parent, newNode, reference) => {
@@ -721,6 +744,9 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
721
744
  hostRef.$queuedListeners$ = void 0;
722
745
  }
723
746
  }
747
+ {
748
+ maybePromise = safeCall(instance, "componentWillLoad");
749
+ }
724
750
  }
725
751
  endSchedule();
726
752
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
@@ -1203,6 +1229,7 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
1203
1229
 
1204
1230
  exports.Host = Host;
1205
1231
  exports.bootstrapLazy = bootstrapLazy;
1232
+ exports.getElement = getElement;
1206
1233
  exports.h = h;
1207
1234
  exports.promiseResolve = promiseResolve;
1208
1235
  exports.registerInstance = registerInstance;
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6df370d5.js');
5
+ const index = require('./index-6ff13374.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
11
+ return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540],"overlayActions":[1540,"overlay-actions"]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -2,22 +2,36 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6df370d5.js');
5
+ const index = require('./index-6ff13374.js');
6
6
 
7
- const mdsTableRowCss = "@tailwind utilities;\n\n:host {\n\n --mds-table-row-color-hover: var(--mds-table-color-hover, rgb(var(--tone-neutral-02)));\n --mds-table-row-color: var(--mds-table-color, rgb(var(--tone-neutral-03)));\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n\n color: var(--mds-table-row-color);\n display: table-row;\n -webkit-transition-property: color;\n transition-property: color;\n\n}\n\n:host([sorted][interactive]:not([interactive=\"false\"])) ::slotted(mds-table-cell[sorted]) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n}\n\n:host([sorted][interactive]:not([interactive=\"false\"])) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-body-background-hover);\n}\n\n:host([interactive]:not([interactive=\"false\"]):hover) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n --mds-table-row-color: var(--mds-table-row-color-hover);\n}\n\n\n:host([sorted][interactive]:not([interactive=\"false\"]):hover) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n}\n\n:host([sorted]:not([interactive])) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-body-background-hover);\n}\n\n@container style(--magma-pref-animation: reduce) {\n :host {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n";
7
+ const isMobileDevice = () => {
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ const userAgent = navigator.userAgent || navigator.vendor || window.opera;
10
+ return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
11
+ };
12
+
13
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
14
+
15
+ const mdsTableRowCss = "@tailwind utilities;\n\n:host {\n\n --mds-table-row-color-hover: var(--mds-table-color-hover, rgb(var(--tone-neutral-02)));\n --mds-table-row-color: var(--mds-table-color, rgb(var(--tone-neutral-03)));\n --mds-table-row-actions-gap: var(--mds-table-actions-gap, 1rem);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0, 0, 0.2, 1);\n\n color: var(--mds-table-row-color);\n display: table-row;\n position: relative;\n -webkit-transition-property: color;\n transition-property: color;\n\n}\n\n.actions-wrapper {\n inset: 0;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-pack: end;\n justify-content: end;\n pointer-events: none;\n position: absolute;\n}\n\n.actions {\n -ms-flex-align: center;\n align-items: center;\n background-color: var(--mds-table-cell-background);\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: var(--mds-table-border-width);\n border-top-color: var(--mds-table-border-color);\n border-top-style: solid;\n border-top-width: var(--mds-table-border-width);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n gap: var(--mds-table-row-actions-gap);\n height: 100%;\n margin-top: calc(var(--mds-table-border-width) * -1);\n padding: var(--mds-table-cell-padding);\n pointer-events: auto;\n position: -webkit-sticky;\n position: sticky;\n right: 0;\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n -webkit-transition-duration: 500ms;\n transition-duration: 500ms;\n -webkit-transition-property: background-color, -webkit-transform;\n transition-property: background-color, -webkit-transform;\n transition-property: transform, background-color;\n transition-property: transform, background-color, -webkit-transform;\n -webkit-transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);\n}\n\n.actions-wrapper--mobile {\n position: relative;\n}\n\n.actions-wrapper--mobile .actions {\n position: static;\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host(:hover) .actions {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host([overlay-actions]:not([overlay-actions=\"false\"])) .actions-wrapper:not(.actions-wrapper--mobile) .actions {\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n}\n\n:host([interactive]:not([interactive=\"false\"])) .actions {\n --mds-table-cell-background: var(--mds-table-body-background);\n}\n\n:host([interactive]:not([interactive=\"false\"]):hover) .actions {\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n}\n\n:host([sorted][interactive]:not([interactive=\"false\"])) ::slotted(mds-table-cell[sorted]) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n}\n\n:host([sorted][interactive]:not([interactive=\"false\"])) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-body-background-hover);\n}\n\n:host([interactive]:not([interactive=\"false\"]):hover) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n --mds-table-row-color: var(--mds-table-row-color-hover);\n}\n\n\n:host([sorted][interactive]:not([interactive=\"false\"]):hover) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-cell-background-hover);\n}\n\n:host([sorted]:not([interactive])) ::slotted(mds-table-cell:not([sorted])) {\n\n --mds-table-cell-background: var(--mds-table-body-background-hover);\n}\n\n@container style(--magma-pref-animation: reduce) {\n :host {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n";
8
16
  const MdsTableRowStyle0 = mdsTableRowCss;
9
17
 
10
18
  const MdsTableRow = class {
11
19
  constructor(hostRef) {
12
20
  index.registerInstance(this, hostRef);
13
21
  this.interactive = undefined;
22
+ this.overlayActions = undefined;
14
23
  }
15
24
  tableInteractiveHandler(event) {
16
25
  this.interactive = event.detail;
17
26
  }
27
+ componentWillLoad() {
28
+ this.actions = this.host.querySelector('[slot="action"]') !== null;
29
+ }
18
30
  render() {
19
- return (index.h(index.Host, { key: 'f787fed43a18242c2d9ddfa0fbd383e88b436dc5', role: "row" }, index.h("slot", { key: 'b78bf7f2a6b59a044c041a441ce8b7709b09cd39' })));
31
+ return (index.h(index.Host, { key: '7402ca1cfdaf3e7846dbf29fad4771617c4f0aee', role: "row" }, index.h("slot", { key: '6671fe1e06369e2486157747c41921266553636c' }), this.actions
32
+ && index.h("div", { key: 'e58f247b2f1f6c4263c85615209356f212fa727a', class: clsx('actions-wrapper', isMobileDevice() && 'actions-wrapper--mobile'), role: "cell" }, index.h("div", { key: '1f952cd70074ee64cbef3b96c562cf4d76efd8e7', class: "actions" }, index.h("slot", { key: '7d9eaf9364cd8626a300bddba7c6c9bd449ae773', name: "action" })))));
20
33
  }
34
+ get host() { return index.getElement(this); }
21
35
  };
22
36
  MdsTableRow.style = MdsTableRowStyle0;
23
37
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6df370d5.js');
5
+ const index = require('./index-6ff13374.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
22
+ return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540],"overlayActions":[1540,"overlay-actions"]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -18,6 +18,22 @@ const setAttributeIfEmpty = (element, attribute, value) => {
18
18
  element.setAttribute(attribute, value);
19
19
  return value;
20
20
  };
21
+ const removeAttributesIf = (element, attribute, valueCheck = 'true', cleanAttributes) => {
22
+ if (ifAttribute(element, attribute, valueCheck)) {
23
+ const attributesList = Array.isArray(cleanAttributes) ? cleanAttributes : [cleanAttributes];
24
+ attributesList.forEach(attributeToRemove => {
25
+ element.removeAttribute(attributeToRemove);
26
+ });
27
+ return true;
28
+ }
29
+ return false;
30
+ };
31
+ const ifAttribute = (element, attribute, valueCheck = 'true') => {
32
+ if (element.hasAttribute(attribute) && element.getAttribute(attribute) === valueCheck) {
33
+ return true;
34
+ }
35
+ return false;
36
+ };
21
37
  const hashValue = (value) => `${value}-${hash(value)}`;
22
38
  const hashRandomValue = (value) => {
23
39
  const randomValue = randomInt(1000000);
@@ -26,4 +42,4 @@ const hashRandomValue = (value) => {
26
42
  }
27
43
  return hash(randomValue.toString());
28
44
  };
29
- export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
45
+ export { hashRandomValue, hashValue, removeAttributesIf, setAttributeIfEmpty, ifAttribute, unslugName, };
@@ -0,0 +1,6 @@
1
+ const isMobileDevice = () => {
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
+ const userAgent = navigator.userAgent || navigator.vendor || window.opera;
4
+ return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
5
+ };
6
+ export { isMobileDevice, };
@@ -31,13 +31,13 @@ export class KeyboardManager {
31
31
  };
32
32
  this.attachEscapeBehavior = (callback) => {
33
33
  this.escapeCallback = callback;
34
- if (window !== undefined) {
34
+ if (typeof window !== 'undefined') {
35
35
  window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
36
36
  }
37
37
  };
38
38
  this.detachEscapeBehavior = () => {
39
39
  this.escapeCallback = () => { return; };
40
- if (window !== undefined) {
40
+ if (typeof window !== 'undefined') {
41
41
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
42
42
  }
43
43
  };
@@ -4,15 +4,74 @@
4
4
 
5
5
  --mds-table-row-color-hover: var(--mds-table-color-hover, rgb(var(--tone-neutral-02)));
6
6
  --mds-table-row-color: var(--mds-table-color, rgb(var(--tone-neutral-03)));
7
+ --mds-table-row-actions-gap: var(--mds-table-actions-gap, 1rem);
7
8
  transition-duration: 200ms;
8
9
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
9
10
 
10
11
  color: var(--mds-table-row-color);
11
12
  display: table-row;
13
+ position: relative;
12
14
  transition-property: color;
13
15
 
14
16
  }
15
17
 
18
+ .actions-wrapper {
19
+ inset: 0;
20
+ display: flex;
21
+ justify-content: end;
22
+ pointer-events: none;
23
+ position: absolute;
24
+ }
25
+
26
+ .actions {
27
+ align-items: center;
28
+ background-color: var(--mds-table-cell-background);
29
+ border-bottom-color: transparent;
30
+ border-bottom-style: solid;
31
+ border-bottom-width: var(--mds-table-border-width);
32
+ border-top-color: var(--mds-table-border-color);
33
+ border-top-style: solid;
34
+ border-top-width: var(--mds-table-border-width);
35
+ box-sizing: border-box;
36
+ display: inline-flex;
37
+ gap: var(--mds-table-row-actions-gap);
38
+ height: 100%;
39
+ margin-top: calc(var(--mds-table-border-width) * -1);
40
+ padding: var(--mds-table-cell-padding);
41
+ pointer-events: auto;
42
+ position: sticky;
43
+ right: 0;
44
+ transform: translateX(100%);
45
+ transition-duration: 500ms;
46
+ transition-property: transform, background-color;
47
+ transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
48
+ }
49
+
50
+ .actions-wrapper--mobile {
51
+ position: relative;
52
+ }
53
+
54
+ .actions-wrapper--mobile .actions {
55
+ position: static;
56
+ transform: translateX(0);
57
+ }
58
+
59
+ :host(:hover) .actions {
60
+ transform: translateX(0);
61
+ }
62
+
63
+ :host([overlay-actions]:not([overlay-actions="false"])) .actions-wrapper:not(.actions-wrapper--mobile) .actions {
64
+ transform: translateX(100%);
65
+ }
66
+
67
+ :host([interactive]:not([interactive="false"])) .actions {
68
+ --mds-table-cell-background: var(--mds-table-body-background);
69
+ }
70
+
71
+ :host([interactive]:not([interactive="false"]):hover) .actions {
72
+ --mds-table-cell-background: var(--mds-table-cell-background-hover);
73
+ }
74
+
16
75
  :host([sorted][interactive]:not([interactive="false"])) ::slotted(mds-table-cell[sorted]) {
17
76
 
18
77
  --mds-table-cell-background: var(--mds-table-cell-background-hover);
@@ -1,16 +1,23 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { isMobileDevice } from "../../common/device";
3
+ import clsx from "clsx";
2
4
  /**
3
5
  * @slot default - Put `mds-table-cell` element/s.
4
6
  */
5
7
  export class MdsTableRow {
6
8
  constructor() {
7
9
  this.interactive = undefined;
10
+ this.overlayActions = undefined;
8
11
  }
9
12
  tableInteractiveHandler(event) {
10
13
  this.interactive = event.detail;
11
14
  }
15
+ componentWillLoad() {
16
+ this.actions = this.host.querySelector('[slot="action"]') !== null;
17
+ }
12
18
  render() {
13
- return (h(Host, { key: 'f787fed43a18242c2d9ddfa0fbd383e88b436dc5', role: "row" }, h("slot", { key: 'b78bf7f2a6b59a044c041a441ce8b7709b09cd39' })));
19
+ return (h(Host, { key: '7402ca1cfdaf3e7846dbf29fad4771617c4f0aee', role: "row" }, h("slot", { key: '6671fe1e06369e2486157747c41921266553636c' }), this.actions
20
+ && h("div", { key: 'e58f247b2f1f6c4263c85615209356f212fa727a', class: clsx('actions-wrapper', isMobileDevice() && 'actions-wrapper--mobile'), role: "cell" }, h("div", { key: '1f952cd70074ee64cbef3b96c562cf4d76efd8e7', class: "actions" }, h("slot", { key: '7d9eaf9364cd8626a300bddba7c6c9bd449ae773', name: "action" })))));
14
21
  }
15
22
  static get is() { return "mds-table-row"; }
16
23
  static get encapsulation() { return "shadow"; }
@@ -42,9 +49,27 @@ export class MdsTableRow {
42
49
  },
43
50
  "attribute": "interactive",
44
51
  "reflect": true
52
+ },
53
+ "overlayActions": {
54
+ "type": "boolean",
55
+ "mutable": true,
56
+ "complexType": {
57
+ "original": "boolean",
58
+ "resolved": "boolean",
59
+ "references": {}
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": ""
66
+ },
67
+ "attribute": "overlay-actions",
68
+ "reflect": true
45
69
  }
46
70
  };
47
71
  }
72
+ static get elementRef() { return "host"; }
48
73
  static get listeners() {
49
74
  return [{
50
75
  "name": "mdsTableInteractiveChange",
@@ -1,61 +1,119 @@
1
1
  const fileExtensionsDictionary = {
2
- '7z': { format: 'archive', description: 'Archivio compresso' },
3
- ace: { format: 'archive', description: 'Archivio compresso' },
4
- ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
5
- dart: { format: 'code', description: 'Dart' },
6
- db: { format: 'data', description: 'File di database' },
7
- default: { format: 'attachment', description: 'Formato sconosciuto' },
8
- dmg: { format: 'executable', description: 'Apple Disk Image' },
9
- doc: { format: 'text', description: 'Documento Microsoft Word' },
10
- docm: { format: 'text', description: 'Documento Microsoft Word' },
11
- docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
12
- eml: { format: 'email', description: 'E-mail di posta elettronica' },
13
- eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
14
- exe: { format: 'executable', description: 'File eseguibile Windows' },
15
- flac: { format: 'audio', description: 'Audio non compresso' },
16
- gif: { format: 'image', description: 'Immagine compressa', preview: true },
17
- htm: { format: 'markup', description: 'Pagina web' },
18
- heic: { format: 'image', description: 'High Efficiency Image File Format' },
19
- html: { format: 'markup', description: 'Pagina web' },
20
- jpe: { format: 'image', description: 'Immagine compressa', preview: true },
21
- jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
22
- jpg: { format: 'image', description: 'Immagine compressa', preview: true },
23
- js: { format: 'code', description: 'JavaScript' },
24
- json: { format: 'data', description: 'JavaScript Object Notation' },
25
- jsx: { format: 'code', description: 'JavaScript' },
26
- m2v: { format: 'video', description: 'Filmato SD' },
27
- mp2: { format: 'audio', description: 'Audio compresso' },
28
- mp3: { format: 'audio', description: 'Audio compresso' },
29
- mp4: { format: 'video', description: 'Filmato HD' },
30
- mp4v: { format: 'video', description: 'Filmato HD' },
31
- mpeg: { format: 'video', description: 'Filmato SD' },
32
- mpg4: { format: 'video', description: 'Filmato SD' },
33
- mpg: { format: 'video', description: 'Filmato SD' },
34
- mpga: { format: 'audio', description: 'Audio compresso' },
35
- odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
36
- ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
37
- odt: { format: 'text', description: 'File di testo LibreOffice' },
38
- pdf: { format: 'document', description: 'Documento Adobe' },
39
- php: { format: 'code', description: 'Hypertext Preprocessor' },
40
- png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
41
- ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
42
- rar: { format: 'archive', description: 'Archivio compresso' },
43
- rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
44
- sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
45
- shtml: { format: 'markup', description: 'Pagina web' },
46
- svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
47
- tar: { format: 'archive', description: 'Archivio non compresso' },
48
- tiff: { format: 'image', description: 'Tag Image File Format' },
49
- ts: { format: 'code', description: 'TypeScript' },
50
- tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
51
- txt: { format: 'text', description: 'Documento di testo non formattato' },
52
- wav: { format: 'audio', description: 'Audio non compresso' },
53
- webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
54
- xar: { format: 'archive', description: 'Archivio compresso' },
55
- xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
56
- xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
57
- zip: { format: 'archive', description: 'Archivio compresso' },
2
+ '7z': { format: 'archive', description: 'compressedArchive' },
3
+ ace: { format: 'archive', description: 'compressedArchive' },
4
+ ai: { format: 'vector', description: 'fileAI' },
5
+ dart: { format: 'code', description: 'dart' },
6
+ db: { format: 'data', description: 'fileDB' },
7
+ default: { format: 'attachment', description: 'unknown' },
8
+ dmg: { format: 'executable', description: 'appleDiskImage' },
9
+ doc: { format: 'text', description: 'documentMS' },
10
+ docm: { format: 'text', description: 'documentMS' },
11
+ docx: { format: 'text', description: 'compressedDocumentMS' },
12
+ eml: { format: 'email', description: 'email' },
13
+ eps: { format: 'vector', description: 'fileEPS' },
14
+ exe: { format: 'executable', description: 'fileEXE' },
15
+ flac: { format: 'audio', description: 'uncompressedAudio' },
16
+ gif: { format: 'image', description: 'compressedImage', preview: true },
17
+ htm: { format: 'markup', description: 'documentWeb' },
18
+ heic: { format: 'image', description: 'imageHEFF' },
19
+ html: { format: 'markup', description: 'documentWeb' },
20
+ jpe: { format: 'image', description: 'compressedImage', preview: true },
21
+ jpeg: { format: 'image', description: 'compressedImage', preview: true },
22
+ jpg: { format: 'image', description: 'compressedImage', preview: true },
23
+ js: { format: 'code', description: 'fileJS' },
24
+ json: { format: 'data', description: 'fileJSON' },
25
+ jsx: { format: 'code', description: 'fileJS' },
26
+ m2v: { format: 'video', description: 'videoSD' },
27
+ mp2: { format: 'audio', description: 'compressedAudio' },
28
+ mp3: { format: 'audio', description: 'compressedAudio' },
29
+ mp4: { format: 'video', description: 'videoHD' },
30
+ mp4v: { format: 'video', description: 'videoHD' },
31
+ mpeg: { format: 'video', description: 'videoSD' },
32
+ mpg4: { format: 'video', description: 'videoSD' },
33
+ mpg: { format: 'video', description: 'videoSD' },
34
+ mpga: { format: 'audio', description: 'compressedAudio' },
35
+ odp: { format: 'slide', description: 'slideLO' },
36
+ ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
37
+ odt: { format: 'text', description: 'documentLO' },
38
+ pdf: { format: 'document', description: 'documentAdobe' },
39
+ php: { format: 'code', description: 'filePHP' },
40
+ png: { format: 'image', description: 'imagePNG', preview: true },
41
+ ppt: { format: 'slide', description: 'slidePowerPoint' },
42
+ rar: { format: 'archive', description: 'compressedArchive' },
43
+ rtf: { format: 'text', description: 'documentRTF' },
44
+ sass: { format: 'code', description: 'fileSASS' },
45
+ shtml: { format: 'markup', description: 'documentWeb' },
46
+ svg: { format: 'vector', description: 'imageSVG', preview: true },
47
+ tar: { format: 'archive', description: 'uncompressedArchive' },
48
+ tiff: { format: 'image', description: 'imageTIFF' },
49
+ ts: { format: 'code', description: 'fileTS' },
50
+ tsx: { format: 'code', description: 'fileTSX' },
51
+ txt: { format: 'text', description: 'documentTXT' },
52
+ wav: { format: 'audio', description: 'uncompressedAudio' },
53
+ webp: { format: 'image', description: 'imageWEBP', preview: true },
54
+ xar: { format: 'archive', description: 'compressedArchive' },
55
+ xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
56
+ xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
57
+ zip: { format: 'archive', description: 'compressedArchive' },
58
58
  };
59
+ // const fileExtensionsDictionary: FileExtenstion = {
60
+ // '7z': { format: 'archive', description: 'Archivio compresso' },
61
+ // ace: { format: 'archive', description: 'Archivio compresso' },
62
+ // ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
63
+ // dart: { format: 'code', description: 'Dart' },
64
+ // db: { format: 'data', description: 'File di database' },
65
+ // default: { format: 'attachment', description: 'Formato sconosciuto' },
66
+ // dmg: { format: 'executable', description: 'Apple Disk Image' },
67
+ // doc: { format: 'text', description: 'Documento Microsoft Word' },
68
+ // docm: { format: 'text', description: 'Documento Microsoft Word' },
69
+ // docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
70
+ // eml: { format: 'email', description: 'E-mail di posta elettronica' },
71
+ // eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
72
+ // exe: { format: 'executable', description: 'File eseguibile Windows' },
73
+ // flac: { format: 'audio', description: 'Audio non compresso' },
74
+ // gif: { format: 'image', description: 'Immagine compressa', preview: true },
75
+ // htm: { format: 'markup', description: 'Pagina web' },
76
+ // heic: { format: 'image', description: 'High Efficiency Image File Format' },
77
+ // html: { format: 'markup', description: 'Pagina web' },
78
+ // jpe: { format: 'image', description: 'Immagine compressa', preview: true },
79
+ // jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
80
+ // jpg: { format: 'image', description: 'Immagine compressa', preview: true },
81
+ // js: { format: 'code', description: 'JavaScript' },
82
+ // json: { format: 'data', description: 'JavaScript Object Notation' },
83
+ // jsx: { format: 'code', description: 'JavaScript' },
84
+ // m2v: { format: 'video', description: 'Filmato SD' },
85
+ // mp2: { format: 'audio', description: 'Audio compresso' },
86
+ // mp3: { format: 'audio', description: 'Audio compresso' },
87
+ // mp4: { format: 'video', description: 'Filmato HD' },
88
+ // mp4v: { format: 'video', description: 'Filmato HD' },
89
+ // mpeg: { format: 'video', description: 'Filmato SD' },
90
+ // mpg4: { format: 'video', description: 'Filmato SD' },
91
+ // mpg: { format: 'video', description: 'Filmato SD' },
92
+ // mpga: { format: 'audio', description: 'Audio compresso' },
93
+ // odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
94
+ // ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
95
+ // odt: { format: 'text', description: 'File di testo LibreOffice' },
96
+ // pdf: { format: 'document', description: 'Documento Adobe' },
97
+ // php: { format: 'code', description: 'Hypertext Preprocessor' },
98
+ // png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
99
+ // ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
100
+ // rar: { format: 'archive', description: 'Archivio compresso' },
101
+ // rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
102
+ // sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
103
+ // shtml: { format: 'markup', description: 'Pagina web' },
104
+ // svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
105
+ // tar: { format: 'archive', description: 'Archivio non compresso' },
106
+ // tiff: { format: 'image', description: 'Tag Image File Format' },
107
+ // ts: { format: 'code', description: 'TypeScript' },
108
+ // tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
109
+ // txt: { format: 'text', description: 'Documento di testo non formattato' },
110
+ // wav: { format: 'audio', description: 'Audio non compresso' },
111
+ // webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
112
+ // xar: { format: 'archive', description: 'Archivio compresso' },
113
+ // xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
114
+ // xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
115
+ // zip: { format: 'archive', description: 'Archivio compresso' },
116
+ // }
59
117
  const genericMimeToExt = new Map([
60
118
  ['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
61
119
  ['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
@@ -1,6 +1,65 @@
1
+ const typographyTagDictionary = [
2
+ 'abbr',
3
+ 'address',
4
+ 'article',
5
+ 'b',
6
+ 'bdo',
7
+ 'blockquote',
8
+ 'cite',
9
+ 'code',
10
+ 'dd',
11
+ 'del',
12
+ 'details',
13
+ 'dfn',
14
+ 'div',
15
+ 'dl',
16
+ 'dt',
17
+ 'em',
18
+ 'figcaption',
19
+ 'h1',
20
+ 'h2',
21
+ 'h3',
22
+ 'h4',
23
+ 'h5',
24
+ 'h6',
25
+ 'i',
26
+ 'ins',
27
+ 'kbd',
28
+ 'label',
29
+ 'legend',
30
+ 'li',
31
+ 'mark',
32
+ 'ol',
33
+ 'p',
34
+ 'pre',
35
+ 'q',
36
+ 'rb',
37
+ 'rt',
38
+ 'ruby',
39
+ 's',
40
+ 'samp',
41
+ 'small',
42
+ 'span',
43
+ 'strong',
44
+ 'sub',
45
+ 'summary',
46
+ 'sup',
47
+ 'time',
48
+ 'u',
49
+ 'ul',
50
+ 'var',
51
+ ];
52
+ const typographyHeadingTagDictionary = [
53
+ 'h1',
54
+ 'h2',
55
+ 'h3',
56
+ 'h4',
57
+ 'h5',
58
+ 'h6',
59
+ ];
1
60
  const truncateDictionary = [
2
61
  'all',
3
62
  'none',
4
63
  'word',
5
64
  ];
6
- export { truncateDictionary, };
65
+ export { truncateDictionary, typographyHeadingTagDictionary, typographyTagDictionary, };