@dso-toolkit/core 28.0.2 → 29.0.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 (112) hide show
  1. package/dist/cjs/dso-alert.cjs.entry.js +2 -2
  2. package/dist/cjs/dso-attachments-counter.cjs.entry.js +2 -2
  3. package/dist/cjs/dso-autosuggest.cjs.entry.js +3 -3
  4. package/dist/cjs/dso-badge.cjs.entry.js +2 -2
  5. package/dist/cjs/dso-banner.cjs.entry.js +2 -2
  6. package/dist/cjs/dso-date-picker.cjs.entry.js +2 -2
  7. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +47 -7
  8. package/dist/cjs/dso-highlight-box.cjs.entry.js +2 -2
  9. package/dist/cjs/dso-icon.cjs.entry.js +9 -3
  10. package/dist/cjs/dso-info_3.cjs.entry.js +4 -4
  11. package/dist/cjs/dso-label.cjs.entry.js +2 -2
  12. package/dist/cjs/dso-map-base-layers.cjs.entry.js +2 -2
  13. package/dist/cjs/dso-map-controls.cjs.entry.js +2 -2
  14. package/dist/cjs/dso-map-overlays.cjs.entry.js +2 -2
  15. package/dist/cjs/dso-ozon-content.cjs.entry.js +325 -4
  16. package/dist/cjs/dso-progress-bar.cjs.entry.js +2 -2
  17. package/dist/cjs/dso-progress-indicator.cjs.entry.js +2 -2
  18. package/dist/cjs/dso-toolkit.cjs.js +2 -2
  19. package/dist/cjs/dso-tooltip.cjs.entry.js +55 -23
  20. package/dist/cjs/{index-be0edad4.js → index-fcdfdd38.js} +94 -34
  21. package/dist/cjs/loader.cjs.js +2 -2
  22. package/dist/cjs/{v4-14140ff3.js → v4-8e8d6fbc.js} +0 -0
  23. package/dist/collection/collection-manifest.json +1 -1
  24. package/dist/collection/components/icon/icon.css +1 -0
  25. package/dist/collection/components/icon/icon.js +2 -0
  26. package/dist/collection/components/ozon-content/ozon-content.transformer.js +11 -2
  27. package/dist/collection/icon/dso-icon-sass-function.js +2 -2
  28. package/dist/custom-elements/index.js +447 -48
  29. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  30. package/dist/dso-toolkit/p-08427682.entry.js +1 -0
  31. package/dist/dso-toolkit/p-0a7cb861.entry.js +1 -0
  32. package/dist/dso-toolkit/p-12f7e7d7.entry.js +5 -0
  33. package/dist/dso-toolkit/{p-ad90fe4d.js → p-19b890a3.js} +0 -0
  34. package/dist/dso-toolkit/p-262858dd.entry.js +1 -0
  35. package/dist/dso-toolkit/p-2c6e9460.entry.js +1 -0
  36. package/dist/dso-toolkit/p-2e7d535c.entry.js +1 -0
  37. package/dist/dso-toolkit/p-94500196.entry.js +1 -0
  38. package/dist/dso-toolkit/p-968d9e1d.entry.js +1 -0
  39. package/dist/dso-toolkit/p-a2357726.entry.js +1 -0
  40. package/dist/dso-toolkit/p-a40eeb32.js +1 -0
  41. package/dist/dso-toolkit/p-ae6209c6.entry.js +1 -0
  42. package/dist/dso-toolkit/p-b5b946de.entry.js +1 -0
  43. package/dist/dso-toolkit/p-c5acf7e2.entry.js +1 -0
  44. package/dist/dso-toolkit/p-c9c1bc8f.entry.js +1 -0
  45. package/dist/dso-toolkit/p-d748df48.entry.js +1 -0
  46. package/dist/dso-toolkit/p-dff52fb0.entry.js +1 -0
  47. package/dist/dso-toolkit/p-e4269e02.entry.js +1 -0
  48. package/dist/dso-toolkit/p-e7700d9e.entry.js +1 -0
  49. package/dist/dso-toolkit/p-eadba8c3.entry.js +1 -0
  50. package/dist/esm/dso-alert.entry.js +2 -2
  51. package/dist/esm/dso-attachments-counter.entry.js +2 -2
  52. package/dist/esm/dso-autosuggest.entry.js +3 -3
  53. package/dist/esm/dso-badge.entry.js +2 -2
  54. package/dist/esm/dso-banner.entry.js +2 -2
  55. package/dist/esm/dso-date-picker.entry.js +2 -2
  56. package/dist/esm/dso-dropdown-menu.entry.js +47 -7
  57. package/dist/esm/dso-highlight-box.entry.js +2 -2
  58. package/dist/esm/dso-icon.entry.js +9 -3
  59. package/dist/esm/dso-info_3.entry.js +4 -4
  60. package/dist/esm/dso-label.entry.js +2 -2
  61. package/dist/esm/dso-map-base-layers.entry.js +2 -2
  62. package/dist/esm/dso-map-controls.entry.js +2 -2
  63. package/dist/esm/dso-map-overlays.entry.js +2 -2
  64. package/dist/esm/dso-ozon-content.entry.js +325 -4
  65. package/dist/esm/dso-progress-bar.entry.js +2 -2
  66. package/dist/esm/dso-progress-indicator.entry.js +2 -2
  67. package/dist/esm/dso-toolkit.js +2 -2
  68. package/dist/esm/dso-tooltip.entry.js +55 -23
  69. package/dist/esm/{index-dd97a66d.js → index-61410be2.js} +94 -34
  70. package/dist/esm/loader.js +2 -2
  71. package/dist/esm/{v4-929670b7.js → v4-fa4bb814.js} +0 -0
  72. package/dist/types/components/alert/alert.template.d.ts +2 -2
  73. package/dist/types/components/attachments-counter/attachments-counter.template.d.ts +1 -1
  74. package/dist/types/components/autosuggest/autosuggest.template.d.ts +1 -1
  75. package/dist/types/components/badge/badge.template.d.ts +1 -1
  76. package/dist/types/components/banner/banner.template.d.ts +1 -1
  77. package/dist/types/components/date-picker/date-picker.template.d.ts +3 -3
  78. package/dist/types/components/dropdown-menu/dropdown-menu.template.d.ts +1 -1
  79. package/dist/types/components/highlight-box/highlight-box.template.d.ts +1 -1
  80. package/dist/types/components/icon/icon.template.d.ts +1 -1
  81. package/dist/types/components/info/info.template.d.ts +1 -1
  82. package/dist/types/components/info-button/info-button.template.d.ts +1 -1
  83. package/dist/types/components/label/label.template.d.ts +1 -1
  84. package/dist/types/components/map-controls/map-controls.template.d.ts +1 -1
  85. package/dist/types/components/ozon-content/ozon-content.template.d.ts +1 -1
  86. package/dist/types/components/ozon-content/ozon-content.transformer.d.ts +1 -0
  87. package/dist/types/components/progress-bar/progress-bar.template.d.ts +1 -1
  88. package/dist/types/components/progress-indicator/progress-indicator.template.d.ts +1 -1
  89. package/dist/types/components/selectable/selectable.template.d.ts +1 -1
  90. package/dist/types/components/tooltip/tooltip.template.d.ts +1 -1
  91. package/dist/types/stencil-public-runtime.d.ts +190 -182
  92. package/loader/index.d.ts +0 -1
  93. package/package.json +34 -32
  94. package/dist/dso-toolkit/p-060ce2e1.entry.js +0 -1
  95. package/dist/dso-toolkit/p-15d08205.entry.js +0 -1
  96. package/dist/dso-toolkit/p-20493f89.entry.js +0 -1
  97. package/dist/dso-toolkit/p-215b881c.entry.js +0 -1
  98. package/dist/dso-toolkit/p-4403a2b4.entry.js +0 -1
  99. package/dist/dso-toolkit/p-5a0a919b.entry.js +0 -1
  100. package/dist/dso-toolkit/p-636dd53f.entry.js +0 -1
  101. package/dist/dso-toolkit/p-6499f8f7.entry.js +0 -1
  102. package/dist/dso-toolkit/p-8f381afb.entry.js +0 -1
  103. package/dist/dso-toolkit/p-939f358e.entry.js +0 -1
  104. package/dist/dso-toolkit/p-9721d73f.entry.js +0 -1
  105. package/dist/dso-toolkit/p-97fb0d06.entry.js +0 -1
  106. package/dist/dso-toolkit/p-a17d1e9c.entry.js +0 -1
  107. package/dist/dso-toolkit/p-a7ca7cc4.entry.js +0 -1
  108. package/dist/dso-toolkit/p-aae83ed4.entry.js +0 -1
  109. package/dist/dso-toolkit/p-acf8e697.js +0 -1
  110. package/dist/dso-toolkit/p-f0aba566.entry.js +0 -1
  111. package/dist/dso-toolkit/p-f451295c.entry.js +0 -5
  112. package/dist/dso-toolkit/p-f7d6fd8a.entry.js +0 -1
@@ -35,8 +35,8 @@ const doc = win.document || { head: {} };
35
35
  const plt = {
36
36
  $flags$: 0,
37
37
  $resourcesUrl$: '',
38
- jmp: h => h(),
39
- raf: h => requestAnimationFrame(h),
38
+ jmp: (h) => h(),
39
+ raf: (h) => requestAnimationFrame(h),
40
40
  ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
41
41
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
42
42
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
@@ -46,7 +46,7 @@ const promiseResolve = (v) => Promise.resolve(v);
46
46
  const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
47
47
  try {
48
48
  new CSSStyleSheet();
49
- return typeof (new CSSStyleSheet()).replace === 'function';
49
+ return typeof new CSSStyleSheet().replace === 'function';
50
50
  }
51
51
  catch (e) { }
52
52
  return false;
@@ -135,7 +135,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
135
135
  rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
136
136
  }
137
137
  if (!appliedStyles.has(scopeId)) {
138
- if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
138
+ if (styleContainerNode.host &&
139
+ (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
139
140
  // This is only happening on native shadow-dom, do not needs CSS var shim
140
141
  styleElm.innerHTML = style;
141
142
  }
@@ -256,7 +257,7 @@ const h = (nodeName, vnodeData, ...children) => {
256
257
  typeof classData !== 'object'
257
258
  ? classData
258
259
  : Object.keys(classData)
259
- .filter(k => classData[k])
260
+ .filter((k) => classData[k])
260
261
  .join(' ');
261
262
  }
262
263
  }
@@ -345,8 +346,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
345
346
  const classList = elm.classList;
346
347
  const oldClasses = parseClassList(oldValue);
347
348
  const newClasses = parseClassList(newValue);
348
- classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c)));
349
- classList.add(...newClasses.filter(c => c && !oldClasses.includes(c)));
349
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
350
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
350
351
  }
351
352
  else if (memberName === 'style') {
352
353
  // update style attribute, css properties and values
@@ -381,7 +382,9 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
381
382
  newValue(elm);
382
383
  }
383
384
  }
384
- else if ((!isProp ) && memberName[0] === 'o' && memberName[1] === 'n') {
385
+ else if ((!isProp ) &&
386
+ memberName[0] === 'o' &&
387
+ memberName[1] === 'n') {
385
388
  // Event Handlers
386
389
  // so if the member name starts with "on" and the 3rd characters is
387
390
  // a capital letter, and it's not already a member on the element,
@@ -462,7 +465,9 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
462
465
  // if the element passed in is a shadow root, which is a document fragment
463
466
  // then we want to be adding attrs/props to the shadow root's "host" element
464
467
  // if it's not a shadow root, then we add attrs/props to the same element
465
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
468
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
469
+ ? newVnode.$elm$.host
470
+ : newVnode.$elm$;
466
471
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
467
472
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
468
473
  {
@@ -506,14 +511,17 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
506
511
  }
507
512
  else if (newVNode.$flags$ & 1 /* isSlotReference */) {
508
513
  // create a slot reference node
509
- elm = newVNode.$elm$ = doc.createTextNode('');
514
+ elm = newVNode.$elm$ =
515
+ doc.createTextNode('');
510
516
  }
511
517
  else {
512
518
  if (!isSvgMode) {
513
519
  isSvgMode = newVNode.$tag$ === 'svg';
514
520
  }
515
521
  // create element
516
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$)
522
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */
523
+ ? 'slot-fb'
524
+ : newVNode.$tag$)
517
525
  );
518
526
  if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
519
527
  isSvgMode = false;
@@ -880,7 +888,7 @@ const relocateSlotContent = (elm) => {
880
888
  // that is suppose to always represent the original content location
881
889
  if (isNodeLocatedInSlot(node, slotNameAttr)) {
882
890
  // it's possible we've already decided to relocate this node
883
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
891
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
884
892
  // made some changes to slots
885
893
  // let's make sure we also double check
886
894
  // fallbacks are correctly hidden or shown
@@ -899,9 +907,9 @@ const relocateSlotContent = (elm) => {
899
907
  });
900
908
  }
901
909
  if (node['s-sr']) {
902
- relocateNodes.map(relocateNode => {
910
+ relocateNodes.map((relocateNode) => {
903
911
  if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
904
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
912
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
905
913
  if (relocateNodeData && !relocateNode.$slotRefNode$) {
906
914
  relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
907
915
  }
@@ -909,7 +917,7 @@ const relocateSlotContent = (elm) => {
909
917
  });
910
918
  }
911
919
  }
912
- else if (!relocateNodes.some(r => r.$nodeToRelocate$ === node)) {
920
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
913
921
  // so far this element does not have a slot home, not setting slotRefNode on purpose
914
922
  // if we never find a home for this element then we'll need to hide it
915
923
  relocateNodes.push({
@@ -989,7 +997,8 @@ const renderVdom = (hostRef, renderFnResults) => {
989
997
  if (!nodeToRelocate['s-ol']) {
990
998
  // add a reference node marking this node's original location
991
999
  // keep a reference to this node for later lookups
992
- orgLocationNode = doc.createTextNode('');
1000
+ orgLocationNode =
1001
+ doc.createTextNode('');
993
1002
  orgLocationNode['s-nr'] = nodeToRelocate;
994
1003
  nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
995
1004
  }
@@ -1013,7 +1022,8 @@ const renderVdom = (hostRef, renderFnResults) => {
1013
1022
  }
1014
1023
  }
1015
1024
  }
1016
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) || nodeToRelocate.nextSibling !== insertBeforeNode) {
1025
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1026
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1017
1027
  // we've checked that it's worth while to relocate
1018
1028
  // since that the node to relocate
1019
1029
  // has a different next sibling or parent relocated
@@ -1059,6 +1069,13 @@ const createEvent = (ref, name, flags) => {
1059
1069
  },
1060
1070
  };
1061
1071
  };
1072
+ /**
1073
+ * Helper function to create & dispatch a custom Event on a provided target
1074
+ * @param elm the target of the Event
1075
+ * @param name the name to give the custom Event
1076
+ * @param opts options for configuring a custom Event
1077
+ * @returns the custom Event
1078
+ */
1062
1079
  const emitEvent = (elm, name, opts) => {
1063
1080
  const ev = plt.ce(name, opts);
1064
1081
  elm.dispatchEvent(ev);
@@ -1066,7 +1083,7 @@ const emitEvent = (elm, name, opts) => {
1066
1083
  };
1067
1084
  const attachToAncestor = (hostRef, ancestorComponent) => {
1068
1085
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1069
- ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r)));
1086
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1070
1087
  }
1071
1088
  };
1072
1089
  const scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -1123,7 +1140,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1123
1140
  // ok, so turns out there are some child host elements
1124
1141
  // waiting on this parent element to load
1125
1142
  // let's fire off all update callbacks waiting
1126
- rc.map(cb => cb());
1143
+ rc.map((cb) => cb());
1127
1144
  elm['s-rc'] = undefined;
1128
1145
  }
1129
1146
  endRender();
@@ -1218,7 +1235,8 @@ const forceUpdate = (ref) => {
1218
1235
  {
1219
1236
  const hostRef = getHostRef(ref);
1220
1237
  const isConnected = hostRef.$hostElement$.isConnected;
1221
- if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1238
+ if (isConnected &&
1239
+ (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1222
1240
  scheduleUpdate(hostRef, false);
1223
1241
  }
1224
1242
  // Returns "true" when the forced update was successfully scheduled
@@ -1247,7 +1265,8 @@ const safeCall = (instance, method, arg) => {
1247
1265
  const then = (promise, thenFn) => {
1248
1266
  return promise && promise.then ? promise.then(thenFn) : thenFn();
1249
1267
  };
1250
- const addHydratedFlag = (elm) => (elm.classList.add('hydrated') );
1268
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1269
+ ;
1251
1270
  const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1252
1271
  const endHydrate = createTime('hydrateClient', tagName);
1253
1272
  const shadowRoot = hostElm.shadowRoot;
@@ -1261,7 +1280,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1261
1280
  hostElm[HYDRATE_ID] = hostId;
1262
1281
  hostElm.removeAttribute(HYDRATE_ID);
1263
1282
  clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
1264
- childRenderNodes.map(c => {
1283
+ childRenderNodes.map((c) => {
1265
1284
  const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
1266
1285
  const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1267
1286
  const node = c.$elm$;
@@ -1278,7 +1297,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1278
1297
  plt.$orgLocNodes$.delete(orgLocationId);
1279
1298
  });
1280
1299
  if (shadowRoot) {
1281
- shadowRootNodes.map(shadowRootNode => {
1300
+ shadowRootNodes.map((shadowRootNode) => {
1282
1301
  if (shadowRootNode) {
1283
1302
  shadowRoot.appendChild(shadowRootNode);
1284
1303
  }
@@ -1496,7 +1515,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1496
1515
  const watchMethods = cmpMeta.$watchers$[propName];
1497
1516
  if (watchMethods) {
1498
1517
  // this instance is watching for when this property changed
1499
- watchMethods.map(watchMethodName => {
1518
+ watchMethods.map((watchMethodName) => {
1500
1519
  try {
1501
1520
  // fire off each of the watch methods that are watching this property
1502
1521
  instance[watchMethodName](newVal, oldVal, propName);
@@ -1526,7 +1545,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1526
1545
  const members = Object.entries(cmpMeta.$members$);
1527
1546
  const prototype = Cstr.prototype;
1528
1547
  members.map(([memberName, [memberFlags]]) => {
1529
- if ((memberFlags & 31 /* Prop */ || ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1548
+ if ((memberFlags & 31 /* Prop */ ||
1549
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1530
1550
  // proxyComponent - prop
1531
1551
  Object.defineProperty(prototype, memberName, {
1532
1552
  get() {
@@ -1541,7 +1561,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1541
1561
  enumerable: true,
1542
1562
  });
1543
1563
  }
1544
- else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1564
+ else if (flags & 1 /* isElementConstructor */ &&
1565
+ memberFlags & 64 /* Method */) {
1545
1566
  // proxyComponent - method
1546
1567
  Object.defineProperty(prototype, memberName, {
1547
1568
  value(...args) {
@@ -1556,6 +1577,43 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1556
1577
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1557
1578
  plt.jmp(() => {
1558
1579
  const propName = attrNameToPropName.get(attrName);
1580
+ // In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
1581
+ // in the case where an attribute was set inline.
1582
+ // ```html
1583
+ // <my-component some-attribute="some-value"></my-component>
1584
+ // ```
1585
+ //
1586
+ // There is an edge case where a developer sets the attribute inline on a custom element and then programatically
1587
+ // changes it before it has been upgraded as shown below:
1588
+ //
1589
+ // ```html
1590
+ // <!-- this component has _not_ been upgraded yet -->
1591
+ // <my-component id="test" some-attribute="some-value"></my-component>
1592
+ // <script>
1593
+ // // grab non-upgraded component
1594
+ // el = document.querySelector("#test");
1595
+ // el.someAttribute = "another-value";
1596
+ // // upgrade component
1597
+ // cutsomElements.define('my-component', MyComponent);
1598
+ // </script>
1599
+ // ```
1600
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1601
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1602
+ // to the value that was set inline i.e. "some-value" from above example. When
1603
+ // the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
1604
+ //
1605
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1606
+ // by connectedCallback as this attributeChangedCallback will not fire.
1607
+ //
1608
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1609
+ //
1610
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1611
+ // properties here given that this goes against best practices outlined here
1612
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1613
+ if (this.hasOwnProperty(propName)) {
1614
+ newValue = this[propName];
1615
+ delete this[propName];
1616
+ }
1559
1617
  this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1560
1618
  });
1561
1619
  };
@@ -1592,7 +1650,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1592
1650
  endLoad();
1593
1651
  }
1594
1652
  if (!Cstr.isProxied) {
1595
- // we'eve never proxied this Constructor before
1653
+ // we've never proxied this Constructor before
1596
1654
  // let's add the getters/setters to its prototype before
1597
1655
  // the first time we create an instance of the implementation
1598
1656
  {
@@ -1694,7 +1752,9 @@ const connectedCallback = (elm) => {
1694
1752
  while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1695
1753
  // climb up the ancestors looking for the first
1696
1754
  // component that hasn't finished its lifecycle update yet
1697
- if ((ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute('s-id') && ancestorComponent['s-p']) ||
1755
+ if ((ancestorComponent.nodeType === 1 /* ElementNode */ &&
1756
+ ancestorComponent.hasAttribute('s-id') &&
1757
+ ancestorComponent['s-p']) ||
1698
1758
  ancestorComponent['s-p']) {
1699
1759
  // we found this components first ancestor component
1700
1760
  // keep a reference to this component's ancestor component
@@ -1746,7 +1806,7 @@ const disconnectedCallback = (elm) => {
1746
1806
  const instance = hostRef.$lazyInstance$ ;
1747
1807
  {
1748
1808
  if (hostRef.$rmListeners$) {
1749
- hostRef.$rmListeners$.map(rmListener => rmListener());
1809
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1750
1810
  hostRef.$rmListeners$ = undefined;
1751
1811
  }
1752
1812
  }
@@ -1780,7 +1840,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1780
1840
  registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
1781
1841
  }
1782
1842
  }
1783
- lazyBundles.map(lazyBundle => lazyBundle[1].map(compactMeta => {
1843
+ lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
1784
1844
  const cmpMeta = {
1785
1845
  $flags$: compactMeta[0],
1786
1846
  $tagName$: compactMeta[1],
@@ -1853,7 +1913,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1853
1913
  // Process deferred connectedCallbacks now all components have been registered
1854
1914
  isBootstrapping = false;
1855
1915
  if (deferredConnectedCallbacks.length) {
1856
- deferredConnectedCallbacks.map(host => host.connectedCallback());
1916
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1857
1917
  }
1858
1918
  else {
1859
1919
  {
@@ -1875,10 +1935,10 @@ const registerHost = (elm, cmpMeta) => {
1875
1935
  $instanceValues$: new Map(),
1876
1936
  };
1877
1937
  {
1878
- hostRef.$onInstancePromise$ = new Promise(r => (hostRef.$onInstanceResolve$ = r));
1938
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
1879
1939
  }
1880
1940
  {
1881
- hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r));
1941
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1882
1942
  elm['s-p'] = [];
1883
1943
  elm['s-rc'] = [];
1884
1944
  }
@@ -1900,7 +1960,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1900
1960
  /* webpackInclude: /\.entry\.js$/ */
1901
1961
  /* webpackExclude: /\.system\.entry\.js$/ */
1902
1962
  /* webpackMode: "lazy" */
1903
- `./${bundleId}.entry.js${''}`)); }).then(importedModule => {
1963
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
1904
1964
  {
1905
1965
  cmpModules.set(bundleId, importedModule);
1906
1966
  }
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-be0edad4.js');
5
+ const index = require('./index-fcdfdd38.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.5.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
File without changes
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "compiler": {
25
25
  "name": "@stencil/core",
26
- "version": "2.5.2",
26
+ "version": "2.9.0",
27
27
  "typescriptVersion": "4.2.3"
28
28
  },
29
29
  "collections": [],
@@ -2,6 +2,7 @@
2
2
  /* stylelint-disable string-no-newline */
3
3
  /* stylelint-enable */
4
4
  :host {
5
+ /* stylelint-disable-next-line no-invalid-position-at-import-rule */
5
6
  display: inline-block;
6
7
  height: 1.5em;
7
8
  vertical-align: top;
@@ -43,6 +43,7 @@ import landscape from '@dso-toolkit/sources/src/icons/landscape.svg';
43
43
  import layers from '@dso-toolkit/sources/src/icons/layers.svg';
44
44
  import location from '@dso-toolkit/sources/src/icons/location.svg';
45
45
  import locationOutline from '@dso-toolkit/sources/src/icons/location-outline.svg';
46
+ import locationSearch from '@dso-toolkit/sources/src/icons/location-search.svg';
46
47
  import lock from '@dso-toolkit/sources/src/icons/lock.svg';
47
48
  import magnet from '@dso-toolkit/sources/src/icons/magnet.svg';
48
49
  import mapLocation from '@dso-toolkit/sources/src/icons/map-location.svg';
@@ -131,6 +132,7 @@ const icons = [
131
132
  { alias: 'layers', svg: layers },
132
133
  { alias: 'location', svg: location },
133
134
  { alias: 'location-outline', svg: locationOutline },
135
+ { alias: 'location-search', svg: locationSearch },
134
136
  { alias: 'lock', svg: lock },
135
137
  { alias: 'magnet', svg: magnet },
136
138
  { alias: 'map-location', svg: mapLocation },
@@ -1,3 +1,4 @@
1
+ import isURL from 'validator/es/lib/isURL';
1
2
  function transformDescriptionNote(body) {
2
3
  body.querySelectorAll('a.noot > div.noot_popup').forEach((e, index) => {
3
4
  const contentElement = e.querySelector('.od-Al');
@@ -12,7 +13,7 @@ function transformDescriptionNote(body) {
12
13
  const [termId, contentId] = [`dso-ozon-term-${id}`, `dso-ozon-content-${id}`];
13
14
  anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.setAttribute('id', termId);
14
15
  anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.setAttribute('aria-controls', contentId);
15
- anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.setAttribute('aria-open', 'false');
16
+ anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.setAttribute('aria-expanded', 'false');
16
17
  contentElement === null || contentElement === void 0 ? void 0 : contentElement.setAttribute('id', contentId);
17
18
  });
18
19
  return body;
@@ -31,7 +32,7 @@ export class OzonContentTransformer {
31
32
  constructor(anchorClick) {
32
33
  this.anchorClick = anchorClick;
33
34
  this.domParser = new DOMParser();
34
- this.eventHandlers = [this.handleDescriptionNoteClick, this.handleContentAnchor];
35
+ this.eventHandlers = [this.handleValidUrls, this.handleDescriptionNoteClick, this.handleContentAnchor];
35
36
  }
36
37
  setContent(content) {
37
38
  this.content = transformers.reduce((c, t) => t(c), this.domParser.parseFromString(content, 'text/html').body).children;
@@ -76,6 +77,14 @@ export class OzonContentTransformer {
76
77
  }
77
78
  return false;
78
79
  }
80
+ handleValidUrls(composedPath) {
81
+ var _a;
82
+ const containerIndex = composedPath.findIndex(this.isHostElement);
83
+ if (containerIndex === -1) {
84
+ return false;
85
+ }
86
+ return (_a = composedPath.slice(0, containerIndex)) === null || _a === void 0 ? void 0 : _a.some(e => e instanceof HTMLAnchorElement && isURL(e.href));
87
+ }
79
88
  isHostElement(value) {
80
89
  return value instanceof HTMLElement && value.tagName === 'DSO-OZON-CONTENT';
81
90
  }
@@ -13,7 +13,7 @@ export const dsoIcon = {
13
13
  }
14
14
  const iconAlias = sassIconAlias.getValue();
15
15
  const iconPath = resolve(iconsPath, `${iconAlias}.svg`);
16
- const icon = readFileSync(iconPath).toString('UTF-8');
16
+ const icon = readFileSync(iconPath).toString('utf-8');
17
17
  const style = getStyle(iconAlias, sassVariant instanceof sass.types.String ? sassVariant.getValue() : null);
18
18
  const svg = style ? bundleSvgStyle(icon, style) : icon;
19
19
  const dataUri = svgToDataUri(svg);
@@ -29,7 +29,7 @@ function getStyle(icon, variant) {
29
29
  const css = sass
30
30
  .renderSync({ file: stylesheetPath })
31
31
  .css
32
- .toString('UTF-8');
32
+ .toString('utf-8');
33
33
  const selector = `${icon}${variant ? `:${variant}` : ''}`;
34
34
  const regex = styleRegex(selector);
35
35
  return (_b = (_a = css.match(regex)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : null;