@maggioli-design-system/mds-table-row 4.4.1 → 4.4.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.
Files changed (60) hide show
  1. package/dist/cjs/{index-6d791eac.js → index-7b6fb148.js} +46 -31
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mds-table-row.cjs.entry.js +11 -11
  4. package/dist/cjs/mds-table-row.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/aria.js +18 -18
  7. package/dist/collection/common/keyboard-manager.js +38 -38
  8. package/dist/collection/common/unit.js +7 -7
  9. package/dist/collection/components/mds-table-row/mds-table-row.js +51 -51
  10. package/dist/collection/dictionary/autocomplete.js +56 -56
  11. package/dist/collection/dictionary/button.js +19 -19
  12. package/dist/collection/dictionary/color.js +14 -14
  13. package/dist/collection/dictionary/floating-ui.js +14 -14
  14. package/dist/collection/dictionary/input.js +31 -15
  15. package/dist/collection/dictionary/loading.js +2 -2
  16. package/dist/collection/dictionary/typography.js +46 -46
  17. package/dist/collection/dictionary/variant.js +54 -54
  18. package/dist/collection/fixtures/cities.js +107 -107
  19. package/dist/components/mds-table-row.d.ts +2 -2
  20. package/dist/components/mds-table-row.js +26 -26
  21. package/dist/documentation.d.ts +1 -21
  22. package/dist/documentation.json +2 -2
  23. package/dist/esm/{index-04035e77.js → index-9f40909f.js} +46 -31
  24. package/dist/esm/loader.js +2 -2
  25. package/dist/esm/mds-table-row.entry.js +11 -11
  26. package/dist/esm/mds-table-row.js +3 -3
  27. package/dist/esm-es5/index-9f40909f.js +1 -0
  28. package/dist/esm-es5/loader.js +1 -1
  29. package/dist/esm-es5/mds-table-row.entry.js +1 -1
  30. package/dist/esm-es5/mds-table-row.js +1 -1
  31. package/dist/mds-table-row/mds-table-row.esm.js +1 -1
  32. package/dist/mds-table-row/mds-table-row.js +15 -15
  33. package/dist/mds-table-row/{p-abb0ef2f.entry.js → p-0f958c61.entry.js} +1 -1
  34. package/dist/mds-table-row/p-24e0f761.system.js +2 -0
  35. package/dist/mds-table-row/p-4e5a0559.js +2 -0
  36. package/dist/mds-table-row/{p-43afa545.system.entry.js → p-8da35bc4.system.entry.js} +1 -1
  37. package/{www/build/p-35ae09e1.system.js → dist/mds-table-row/p-fe4b1f1b.system.js} +1 -1
  38. package/dist/stats.json +37 -34
  39. package/dist/types/common/keyboard-manager.d.ts +9 -9
  40. package/dist/types/components/mds-table-row/mds-table-row.d.ts +3 -3
  41. package/dist/types/dictionary/input.d.ts +2 -1
  42. package/dist/types/interface/input-value.d.ts +1 -1
  43. package/dist/types/stencil-public-runtime.d.ts +8 -0
  44. package/documentation.json +14 -4
  45. package/package.json +4 -4
  46. package/src/dictionary/input.ts +18 -0
  47. package/src/fixtures/icons.json +3 -0
  48. package/src/fixtures/iconsauce.json +3 -0
  49. package/www/build/mds-table-row.esm.js +1 -1
  50. package/www/build/mds-table-row.js +15 -15
  51. package/www/build/{p-abb0ef2f.entry.js → p-0f958c61.entry.js} +1 -1
  52. package/www/build/p-24e0f761.system.js +2 -0
  53. package/www/build/p-4e5a0559.js +2 -0
  54. package/www/build/{p-43afa545.system.entry.js → p-8da35bc4.system.entry.js} +1 -1
  55. package/{dist/mds-table-row/p-35ae09e1.system.js → www/build/p-fe4b1f1b.system.js} +1 -1
  56. package/dist/esm-es5/index-04035e77.js +0 -1
  57. package/dist/mds-table-row/p-88b806ec.js +0 -2
  58. package/dist/mds-table-row/p-8f394fbb.system.js +0 -2
  59. package/www/build/p-88b806ec.js +0 -2
  60. package/www/build/p-8f394fbb.system.js +0 -2
@@ -337,7 +337,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
337
337
  elm[memberName] = newValue;
338
338
  }
339
339
  }
340
- catch (e) { }
340
+ catch (e) {
341
+ /**
342
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
343
+ */
344
+ }
341
345
  }
342
346
  if (newValue == null || newValue === false) {
343
347
  if (newValue !== false || elm.getAttribute(memberName) === '') {
@@ -417,6 +421,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
417
421
  }
418
422
  }
419
423
  }
424
+ // This needs to always happen so we can hide nodes that are projected
425
+ // to another component but don't end up in a slot
426
+ elm['s-hn'] = hostTagName;
420
427
  return elm;
421
428
  };
422
429
  /**
@@ -540,8 +547,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
540
547
  * @param oldCh the old children of the parent node
541
548
  * @param newVNode the new VNode which will replace the parent
542
549
  * @param newCh the new children of the parent node
550
+ * @param isInitialRender whether or not this is the first render of the vdom
543
551
  */
544
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
552
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
545
553
  let oldStartIdx = 0;
546
554
  let newStartIdx = 0;
547
555
  let oldEndIdx = oldCh.length - 1;
@@ -565,25 +573,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
565
573
  else if (newEndVnode == null) {
566
574
  newEndVnode = newCh[--newEndIdx];
567
575
  }
568
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
576
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
569
577
  // if the start nodes are the same then we should patch the new VNode
570
578
  // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
571
579
  // indices to reflect that. We don't need to move any DOM Nodes around
572
580
  // since things are matched up in order.
573
- patch(oldStartVnode, newStartVnode);
581
+ patch(oldStartVnode, newStartVnode, isInitialRender);
574
582
  oldStartVnode = oldCh[++oldStartIdx];
575
583
  newStartVnode = newCh[++newStartIdx];
576
584
  }
577
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
585
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
578
586
  // likewise, if the end nodes are the same we patch new onto old and
579
587
  // decrement our end indices, and also likewise in this case we don't
580
588
  // need to move any DOM Nodes.
581
- patch(oldEndVnode, newEndVnode);
589
+ patch(oldEndVnode, newEndVnode, isInitialRender);
582
590
  oldEndVnode = oldCh[--oldEndIdx];
583
591
  newEndVnode = newCh[--newEndIdx];
584
592
  }
585
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
586
- patch(oldStartVnode, newEndVnode);
593
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
594
+ patch(oldStartVnode, newEndVnode, isInitialRender);
587
595
  // We need to move the element for `oldStartVnode` into a position which
588
596
  // will be appropriate for `newEndVnode`. For this we can use
589
597
  // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
@@ -605,8 +613,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
605
613
  oldStartVnode = oldCh[++oldStartIdx];
606
614
  newEndVnode = newCh[--newEndIdx];
607
615
  }
608
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
609
- patch(oldEndVnode, newStartVnode);
616
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
617
+ patch(oldEndVnode, newStartVnode, isInitialRender);
610
618
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
611
619
  // the same node, so since we're here we know that they are not. Thus we
612
620
  // can move the element for `oldEndVnode` _before_ the element for
@@ -660,9 +668,10 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
660
668
  *
661
669
  * @param leftVNode the first VNode to check
662
670
  * @param rightVNode the second VNode to check
671
+ * @param isInitialRender whether or not this is the first render of the vdom
663
672
  * @returns whether they're equal or not
664
673
  */
665
- const isSameVnode = (leftVNode, rightVNode) => {
674
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
666
675
  // compare if two vnode to see if they're "technically" the same
667
676
  // need to have the same element tag, and same key to be the same
668
677
  if (leftVNode.$tag$ === rightVNode.$tag$) {
@@ -677,8 +686,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
677
686
  *
678
687
  * @param oldVNode an old VNode whose DOM element and children we want to update
679
688
  * @param newVNode a new VNode representing an updated version of the old one
689
+ * @param isInitialRender whether or not this is the first render of the vdom
680
690
  */
681
- const patch = (oldVNode, newVNode) => {
691
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
682
692
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
683
693
  const oldChildren = oldVNode.$children$;
684
694
  const newChildren = newVNode.$children$;
@@ -697,7 +707,7 @@ const patch = (oldVNode, newVNode) => {
697
707
  if (oldChildren !== null && newChildren !== null) {
698
708
  // looks like there's child vnodes for both the old and new vnodes
699
709
  // so we need to call `updateChildren` to reconcile them
700
- updateChildren(elm, oldChildren, newVNode, newChildren);
710
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
701
711
  }
702
712
  else if (newChildren !== null) {
703
713
  // add the new vnode children
@@ -766,7 +776,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
766
776
  scopeId = hostElm['s-sc'];
767
777
  }
768
778
  // synchronous patch
769
- patch(oldVNode, rootVnode);
779
+ patch(oldVNode, rootVnode, isInitialLoad);
770
780
  };
771
781
  const attachToAncestor = (hostRef, ancestorComponent) => {
772
782
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
@@ -1048,10 +1058,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1048
1058
  */
1049
1059
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1050
1060
  var _a;
1061
+ const prototype = Cstr.prototype;
1051
1062
  if (cmpMeta.$members$) {
1052
1063
  // It's better to have a const than two Object.entries()
1053
1064
  const members = Object.entries(cmpMeta.$members$);
1054
- const prototype = Cstr.prototype;
1055
1065
  members.map(([memberName, [memberFlags]]) => {
1056
1066
  if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1057
1067
  ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
@@ -1074,6 +1084,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1074
1084
  const attrNameToPropName = new Map();
1075
1085
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1076
1086
  plt.jmp(() => {
1087
+ var _a;
1077
1088
  const propName = attrNameToPropName.get(attrName);
1078
1089
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1079
1090
  // in the case where an attribute was set inline.
@@ -1129,11 +1140,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1129
1140
  // 1. The instance is ready
1130
1141
  // 2. The watchers are ready
1131
1142
  // 3. The value has changed
1132
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1143
+ if (flags &&
1144
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1133
1145
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1134
1146
  newValue !== oldValue) {
1135
1147
  const instance = hostRef.$lazyInstance$ ;
1136
- const entry = cmpMeta.$watchers$[attrName];
1148
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1137
1149
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1138
1150
  if (instance[callbackName] != null) {
1139
1151
  instance[callbackName].call(instance, newValue, oldValue, attrName);
@@ -1155,10 +1167,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1155
1167
  ...members
1156
1168
  .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1157
1169
  .map(([propName, m]) => {
1170
+ var _a;
1158
1171
  const attrName = m[1] || propName;
1159
1172
  attrNameToPropName.set(attrName, propName);
1160
1173
  if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1161
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1174
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1162
1175
  }
1163
1176
  return attrName;
1164
1177
  }),
@@ -1413,12 +1426,14 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1413
1426
  // If we have styles, add them to the DOM
1414
1427
  if (dataStyles.innerHTML.length) {
1415
1428
  dataStyles.setAttribute('data-styles', '');
1416
- head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1417
1429
  // Apply CSP nonce to the style tag if it exists
1418
1430
  const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1419
1431
  if (nonce != null) {
1420
1432
  dataStyles.setAttribute('nonce', nonce);
1421
1433
  }
1434
+ // Insert the styles into the document head
1435
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1436
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1422
1437
  }
1423
1438
  // Process deferred connectedCallbacks now all components have been registered
1424
1439
  isBootstrapping = false;
@@ -1531,19 +1546,19 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1531
1546
  return module[exportName];
1532
1547
  }
1533
1548
 
1534
- if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1535
- const processMod = importedModule => {
1536
- cmpModules.set(bundleId, importedModule);
1537
- return importedModule[exportName];
1538
- }
1539
- switch(bundleId) {
1540
-
1541
- case 'mds-table-row.cjs':
1542
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1543
- /* webpackMode: "lazy" */
1544
- './mds-table-row.cjs.entry.js')); }).then(processMod, consoleError);
1549
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1550
+ const processMod = importedModule => {
1551
+ cmpModules.set(bundleId, importedModule);
1552
+ return importedModule[exportName];
1553
+ }
1554
+ switch(bundleId) {
1555
+
1556
+ case 'mds-table-row.cjs':
1557
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1558
+ /* webpackMode: "lazy" */
1559
+ './mds-table-row.cjs.entry.js')); }).then(processMod, consoleError);
1560
+ }
1545
1561
  }
1546
- }
1547
1562
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1548
1563
  /* @vite-ignore */
1549
1564
  /* webpackInclude: /\.entry\.js$/ */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6d791eac.js');
5
+ const index = require('./index-7b6fb148.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
@@ -2,21 +2,21 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6d791eac.js');
5
+ const index = require('./index-7b6fb148.js');
6
6
 
7
7
  const mdsTableRowCss = ".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{display:table-row}:host([interactive]:hover){--mds-table-cell-background:var(--mds-table-cell-background-hover, rgb(var(--tone-neutral)))}";
8
8
 
9
9
  const MdsTableRow = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.interactive = undefined;
13
- }
14
- tableInteractiveHandler(event) {
15
- this.interactive = event.detail;
16
- }
17
- render() {
18
- return (index.h(index.Host, { role: "row" }, index.h("slot", null)));
19
- }
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.interactive = undefined;
13
+ }
14
+ tableInteractiveHandler(event) {
15
+ this.interactive = event.detail;
16
+ }
17
+ render() {
18
+ return (index.h(index.Host, { role: "row" }, index.h("slot", null)));
19
+ }
20
20
  };
21
21
  MdsTableRow.style = mdsTableRowCss;
22
22
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-6d791eac.js');
5
+ const index = require('./index-7b6fb148.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.9.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-table-row.cjs.js', document.baseURI).href));
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.7.2",
7
+ "version": "4.9.1",
8
8
  "typescriptVersion": "5.2.2"
9
9
  },
10
10
  "collections": [],
@@ -1,29 +1,29 @@
1
1
  const hash = (s) => {
2
- let i, h;
3
- for (i = 0, h = 0; i < s.length; i++) {
4
- h = Math.imul(31, h) + s.charCodeAt(i) | 0;
5
- }
6
- return h.toString();
2
+ let i, h;
3
+ for (i = 0, h = 0; i < s.length; i++) {
4
+ h = Math.imul(31, h) + s.charCodeAt(i) | 0;
5
+ }
6
+ return h.toString();
7
7
  };
8
8
  const randomInt = (max) => Math.floor(Math.random() * max);
9
9
  const unslugName = (name) => {
10
- var _a, _b, _c;
11
- return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
10
+ var _a, _b, _c;
11
+ return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
12
12
  };
13
13
  const setAttributeIfEmpty = (element, attribute, value) => {
14
- var _a;
15
- if (element.hasAttribute(attribute)) {
16
- return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
17
- }
18
- element.setAttribute(attribute, value);
19
- return value;
14
+ var _a;
15
+ if (element.hasAttribute(attribute)) {
16
+ return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
17
+ }
18
+ element.setAttribute(attribute, value);
19
+ return value;
20
20
  };
21
21
  const hashValue = (value) => `${value}-${hash(value)}`;
22
22
  const hashRandomValue = (value) => {
23
- const randomValue = randomInt(1000000);
24
- if (value) {
25
- return `${value}-${hash(randomValue.toString())}`;
26
- }
27
- return hash(randomValue.toString());
23
+ const randomValue = randomInt(1000000);
24
+ if (value) {
25
+ return `${value}-${hash(randomValue.toString())}`;
26
+ }
27
+ return hash(randomValue.toString());
28
28
  };
29
29
  export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
@@ -1,40 +1,40 @@
1
1
  export class KeyboardManager {
2
- constructor() {
3
- this.elements = [];
4
- this.handleClickBehaviorDispatchEvent = (event) => {
5
- if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
6
- event.target.click();
7
- }
8
- };
9
- this.handleEscapeBehaviorDispatchEvent = (event) => {
10
- if (event.code === 'Escape' && this.escapeCallback) {
11
- this.escapeCallback();
12
- }
13
- };
14
- this.addElement = (el, name = 'element') => {
15
- this.elements[name] = el;
16
- };
17
- this.attachClickBehavior = (name = 'element') => {
18
- if (this.elements[name]) {
19
- this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
20
- }
21
- };
22
- this.detachClickBehavior = (name = 'element') => {
23
- if (this.elements[name]) {
24
- this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
25
- }
26
- };
27
- this.attachEscapeBehavior = (callBack) => {
28
- this.escapeCallback = callBack;
29
- if (window !== undefined) {
30
- window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
31
- }
32
- };
33
- this.detachEscapeBehavior = () => {
34
- this.escapeCallback = () => { return; };
35
- if (window !== undefined) {
36
- window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
- }
38
- };
39
- }
2
+ constructor() {
3
+ this.elements = [];
4
+ this.handleClickBehaviorDispatchEvent = (event) => {
5
+ if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
6
+ event.target.click();
7
+ }
8
+ };
9
+ this.handleEscapeBehaviorDispatchEvent = (event) => {
10
+ if (event.code === 'Escape' && this.escapeCallback) {
11
+ this.escapeCallback();
12
+ }
13
+ };
14
+ this.addElement = (el, name = 'element') => {
15
+ this.elements[name] = el;
16
+ };
17
+ this.attachClickBehavior = (name = 'element') => {
18
+ if (this.elements[name]) {
19
+ this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
20
+ }
21
+ };
22
+ this.detachClickBehavior = (name = 'element') => {
23
+ if (this.elements[name]) {
24
+ this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
25
+ }
26
+ };
27
+ this.attachEscapeBehavior = (callBack) => {
28
+ this.escapeCallback = callBack;
29
+ if (window !== undefined) {
30
+ window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
31
+ }
32
+ };
33
+ this.detachEscapeBehavior = () => {
34
+ this.escapeCallback = () => { return; };
35
+ if (window !== undefined) {
36
+ window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
+ }
38
+ };
39
+ }
40
40
  }
@@ -1,10 +1,10 @@
1
1
  const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
2
- if (duration.includes('s')) {
3
- return Number(duration.replace('s', '')) * 1000;
4
- }
5
- if (duration.includes('ms')) {
6
- return Number(duration.replace('s', ''));
7
- }
8
- return defaultValue;
2
+ if (duration.includes('s')) {
3
+ return Number(duration.replace('s', '')) * 1000;
4
+ }
5
+ if (duration.includes('ms')) {
6
+ return Number(duration.replace('s', ''));
7
+ }
8
+ return defaultValue;
9
9
  };
10
10
  export { cssDurationToMilliseconds, };
@@ -3,55 +3,55 @@ import { Host, h } from "@stencil/core";
3
3
  * @slot default - Put `mds-table-cell` element/s.
4
4
  */
5
5
  export class MdsTableRow {
6
- constructor() {
7
- this.interactive = undefined;
8
- }
9
- tableInteractiveHandler(event) {
10
- this.interactive = event.detail;
11
- }
12
- render() {
13
- return (h(Host, { role: "row" }, h("slot", null)));
14
- }
15
- static get is() { return "mds-table-row"; }
16
- static get encapsulation() { return "shadow"; }
17
- static get originalStyleUrls() {
18
- return {
19
- "$": ["mds-table-row.css"]
20
- };
21
- }
22
- static get styleUrls() {
23
- return {
24
- "$": ["mds-table-row.css"]
25
- };
26
- }
27
- static get properties() {
28
- return {
29
- "interactive": {
30
- "type": "boolean",
31
- "mutable": true,
32
- "complexType": {
33
- "original": "boolean",
34
- "resolved": "boolean",
35
- "references": {}
36
- },
37
- "required": false,
38
- "optional": false,
39
- "docs": {
40
- "tags": [],
41
- "text": ""
42
- },
43
- "attribute": "interactive",
44
- "reflect": true
45
- }
46
- };
47
- }
48
- static get listeners() {
49
- return [{
50
- "name": "mdsTableInteractiveChange",
51
- "method": "tableInteractiveHandler",
52
- "target": "document",
53
- "capture": false,
54
- "passive": false
55
- }];
56
- }
6
+ constructor() {
7
+ this.interactive = undefined;
8
+ }
9
+ tableInteractiveHandler(event) {
10
+ this.interactive = event.detail;
11
+ }
12
+ render() {
13
+ return (h(Host, { role: "row" }, h("slot", null)));
14
+ }
15
+ static get is() { return "mds-table-row"; }
16
+ static get encapsulation() { return "shadow"; }
17
+ static get originalStyleUrls() {
18
+ return {
19
+ "$": ["mds-table-row.css"]
20
+ };
21
+ }
22
+ static get styleUrls() {
23
+ return {
24
+ "$": ["mds-table-row.css"]
25
+ };
26
+ }
27
+ static get properties() {
28
+ return {
29
+ "interactive": {
30
+ "type": "boolean",
31
+ "mutable": true,
32
+ "complexType": {
33
+ "original": "boolean",
34
+ "resolved": "boolean",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": ""
42
+ },
43
+ "attribute": "interactive",
44
+ "reflect": true
45
+ }
46
+ };
47
+ }
48
+ static get listeners() {
49
+ return [{
50
+ "name": "mdsTableInteractiveChange",
51
+ "method": "tableInteractiveHandler",
52
+ "target": "document",
53
+ "capture": false,
54
+ "passive": false
55
+ }];
56
+ }
57
57
  }
@@ -1,59 +1,59 @@
1
1
  const autoCompleteDictionary = [
2
- 'additional-name',
3
- 'address',
4
- 'address-level1',
5
- 'address-level2',
6
- 'address-level3',
7
- 'address-level4',
8
- 'address-line1',
9
- 'address-line2',
10
- 'address-line3',
11
- 'bday',
12
- 'bday-day',
13
- 'bday-month',
14
- 'bday-year',
15
- 'cc-additional-name',
16
- 'cc-csc',
17
- 'cc-exp',
18
- 'cc-exp-month',
19
- 'cc-exp-year',
20
- 'cc-family-name',
21
- 'cc-family-name',
22
- 'cc-given-name',
23
- 'cc-name',
24
- 'cc-number',
25
- 'cc-type',
26
- 'country',
27
- 'country-name',
28
- 'current-password',
29
- 'email',
30
- 'family-name',
31
- 'given-name',
32
- 'honorific-prefix',
33
- 'honorific-suffix',
34
- 'impp',
35
- 'language',
36
- 'name',
37
- 'new-password',
38
- 'nickname',
39
- 'off',
40
- 'on',
41
- 'one-time-code',
42
- 'organization',
43
- 'organization-title',
44
- 'photo',
45
- 'postal-code',
46
- 'sex',
47
- 'street-address',
48
- 'tel',
49
- 'tel-area-code',
50
- 'tel-country-code',
51
- 'tel-extension',
52
- 'tel-local',
53
- 'tel-national',
54
- 'transaction-amount',
55
- 'transaction-currency',
56
- 'url',
57
- 'username',
2
+ 'additional-name',
3
+ 'address',
4
+ 'address-level1',
5
+ 'address-level2',
6
+ 'address-level3',
7
+ 'address-level4',
8
+ 'address-line1',
9
+ 'address-line2',
10
+ 'address-line3',
11
+ 'bday',
12
+ 'bday-day',
13
+ 'bday-month',
14
+ 'bday-year',
15
+ 'cc-additional-name',
16
+ 'cc-csc',
17
+ 'cc-exp',
18
+ 'cc-exp-month',
19
+ 'cc-exp-year',
20
+ 'cc-family-name',
21
+ 'cc-family-name',
22
+ 'cc-given-name',
23
+ 'cc-name',
24
+ 'cc-number',
25
+ 'cc-type',
26
+ 'country',
27
+ 'country-name',
28
+ 'current-password',
29
+ 'email',
30
+ 'family-name',
31
+ 'given-name',
32
+ 'honorific-prefix',
33
+ 'honorific-suffix',
34
+ 'impp',
35
+ 'language',
36
+ 'name',
37
+ 'new-password',
38
+ 'nickname',
39
+ 'off',
40
+ 'on',
41
+ 'one-time-code',
42
+ 'organization',
43
+ 'organization-title',
44
+ 'photo',
45
+ 'postal-code',
46
+ 'sex',
47
+ 'street-address',
48
+ 'tel',
49
+ 'tel-area-code',
50
+ 'tel-country-code',
51
+ 'tel-extension',
52
+ 'tel-local',
53
+ 'tel-national',
54
+ 'transaction-amount',
55
+ 'transaction-currency',
56
+ 'url',
57
+ 'username',
58
58
  ];
59
59
  export { autoCompleteDictionary, };