@swisspost/design-system-components 1.3.10 → 1.5.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 (176) hide show
  1. package/dist/cjs/check-non-empty-35b4d0b5.js +14 -0
  2. package/dist/cjs/check-non-empty-35b4d0b5.js.map +1 -0
  3. package/dist/cjs/check-one-of-4c2e8b2e.js +10 -0
  4. package/dist/cjs/check-one-of-4c2e8b2e.js.map +1 -0
  5. package/dist/cjs/{package-f6bb523d.js → check-type-508a21a5.js} +1 -10
  6. package/dist/cjs/check-type-508a21a5.js.map +1 -0
  7. package/dist/cjs/fade-8c6d4fa7.js +12 -0
  8. package/dist/cjs/fade-8c6d4fa7.js.map +1 -0
  9. package/dist/cjs/{index-272283b3.js → index-12cc37c9.js} +121 -5
  10. package/dist/{post-components/p-0096c140.js.map → cjs/index-12cc37c9.js.map} +1 -1
  11. package/dist/cjs/index-f8f6f146.js +28 -0
  12. package/dist/cjs/index-f8f6f146.js.map +1 -0
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/package-67091813.js +7 -0
  15. package/dist/cjs/package-67091813.js.map +1 -0
  16. package/dist/cjs/post-alert.cjs.entry.js +106 -0
  17. package/dist/cjs/post-alert.cjs.entry.js.map +1 -0
  18. package/dist/cjs/post-collapsible.cjs.entry.js +6 -4
  19. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  20. package/dist/cjs/post-components.cjs.js +2 -2
  21. package/dist/cjs/post-icon.cjs.entry.js +14 -29
  22. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  23. package/dist/cjs/post-tab-header.cjs.entry.js +35 -0
  24. package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -0
  25. package/dist/cjs/post-tab-panel.cjs.entry.js +29 -0
  26. package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -0
  27. package/dist/cjs/post-tabs.cjs.entry.js +136 -0
  28. package/dist/cjs/post-tabs.cjs.entry.js.map +1 -0
  29. package/dist/cjs/post-tooltip.cjs.entry.js +5097 -0
  30. package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -0
  31. package/dist/collection/animations/fade.js +6 -0
  32. package/dist/collection/animations/fade.js.map +1 -0
  33. package/dist/collection/animations/index.js +2 -0
  34. package/dist/collection/animations/index.js.map +1 -0
  35. package/dist/collection/collection-manifest.json +6 -1
  36. package/dist/collection/components/post-alert/alert-types.js +2 -0
  37. package/dist/collection/components/post-alert/alert-types.js.map +1 -0
  38. package/dist/collection/components/post-alert/post-alert.css +563 -0
  39. package/dist/collection/components/post-alert/post-alert.js +256 -0
  40. package/dist/collection/components/post-alert/post-alert.js.map +1 -0
  41. package/dist/collection/components/post-collapsible/post-collapsible.css +7 -0
  42. package/dist/collection/components/post-tab-header/post-tab-header.css +337 -0
  43. package/dist/collection/components/post-tab-header/post-tab-header.js +68 -0
  44. package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -0
  45. package/dist/collection/components/post-tab-panel/post-tab-panel.css +3 -0
  46. package/dist/collection/components/post-tab-panel/post-tab-panel.js +55 -0
  47. package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -0
  48. package/dist/collection/components/post-tabs/post-tabs.css +148 -0
  49. package/dist/collection/components/post-tabs/post-tabs.js +208 -0
  50. package/dist/collection/components/post-tabs/post-tabs.js.map +1 -0
  51. package/dist/collection/components/post-tooltip/post-tooltip.css +194 -0
  52. package/dist/collection/components/post-tooltip/post-tooltip.js +338 -0
  53. package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -0
  54. package/dist/collection/components/post-tooltip/types.js +2 -0
  55. package/dist/collection/components/post-tooltip/types.js.map +1 -0
  56. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
  57. package/dist/collection/utils/property-checkers/check-pattern.js +5 -0
  58. package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -0
  59. package/dist/collection/utils/property-checkers/index.js +3 -0
  60. package/dist/collection/utils/property-checkers/index.js.map +1 -1
  61. package/dist/components/check-non-empty.js +11 -0
  62. package/dist/components/check-non-empty.js.map +1 -0
  63. package/dist/components/check-one-of.js +8 -0
  64. package/dist/components/check-one-of.js.map +1 -0
  65. package/dist/{esm/package-bcf00737.js → components/check-type.js} +2 -9
  66. package/dist/components/check-type.js.map +1 -0
  67. package/dist/components/fade.js +9 -0
  68. package/dist/components/fade.js.map +1 -0
  69. package/dist/components/package.js +2 -20
  70. package/dist/components/package.js.map +1 -1
  71. package/dist/components/post-alert.d.ts +11 -0
  72. package/dist/components/post-alert.js +136 -0
  73. package/dist/components/post-alert.js.map +1 -0
  74. package/dist/components/post-collapsible.js +3 -1
  75. package/dist/components/post-collapsible.js.map +1 -1
  76. package/dist/components/post-icon.js +1 -141
  77. package/dist/components/post-icon.js.map +1 -1
  78. package/dist/components/post-icon2.js +146 -0
  79. package/dist/components/post-icon2.js.map +1 -0
  80. package/dist/components/post-tab-header.d.ts +11 -0
  81. package/dist/components/post-tab-header.js +52 -0
  82. package/dist/components/post-tab-header.js.map +1 -0
  83. package/dist/components/post-tab-panel.d.ts +11 -0
  84. package/dist/components/post-tab-panel.js +46 -0
  85. package/dist/components/post-tab-panel.js.map +1 -0
  86. package/dist/components/post-tabs.d.ts +11 -0
  87. package/dist/components/post-tabs.js +153 -0
  88. package/dist/components/post-tabs.js.map +1 -0
  89. package/dist/components/post-tooltip.d.ts +11 -0
  90. package/dist/components/post-tooltip.js +5118 -0
  91. package/dist/components/post-tooltip.js.map +1 -0
  92. package/dist/docs.json +441 -1
  93. package/dist/esm/check-non-empty-554bdf88.js +11 -0
  94. package/dist/esm/check-non-empty-554bdf88.js.map +1 -0
  95. package/dist/esm/check-one-of-ded5e15e.js +8 -0
  96. package/dist/esm/check-one-of-ded5e15e.js.map +1 -0
  97. package/dist/esm/check-type-18ebb4e7.js +16 -0
  98. package/dist/esm/check-type-18ebb4e7.js.map +1 -0
  99. package/dist/esm/fade-671f1489.js +9 -0
  100. package/dist/esm/fade-671f1489.js.map +1 -0
  101. package/dist/esm/{index-60a84798.js → index-5611074b.js} +121 -6
  102. package/dist/esm/index-5611074b.js.map +1 -0
  103. package/dist/esm/index-7f723686.js +24 -0
  104. package/dist/esm/index-7f723686.js.map +1 -0
  105. package/dist/esm/loader.js +3 -3
  106. package/dist/esm/package-f5cb3167.js +5 -0
  107. package/dist/esm/package-f5cb3167.js.map +1 -0
  108. package/dist/esm/post-alert.entry.js +102 -0
  109. package/dist/esm/post-alert.entry.js.map +1 -0
  110. package/dist/esm/post-collapsible.entry.js +4 -2
  111. package/dist/esm/post-collapsible.entry.js.map +1 -1
  112. package/dist/esm/post-components.js +3 -3
  113. package/dist/esm/post-icon.entry.js +6 -21
  114. package/dist/esm/post-icon.entry.js.map +1 -1
  115. package/dist/esm/post-tab-header.entry.js +31 -0
  116. package/dist/esm/post-tab-header.entry.js.map +1 -0
  117. package/dist/esm/post-tab-panel.entry.js +25 -0
  118. package/dist/esm/post-tab-panel.entry.js.map +1 -0
  119. package/dist/esm/post-tabs.entry.js +132 -0
  120. package/dist/esm/post-tabs.entry.js.map +1 -0
  121. package/dist/esm/post-tooltip.entry.js +5093 -0
  122. package/dist/esm/post-tooltip.entry.js.map +1 -0
  123. package/dist/post-components/p-12046db8.entry.js +2 -0
  124. package/dist/post-components/{p-99ccf0cf.entry.js.map → p-12046db8.entry.js.map} +1 -1
  125. package/dist/post-components/p-15fc087f.js +2 -0
  126. package/dist/post-components/p-15fc087f.js.map +1 -0
  127. package/dist/post-components/p-24b07f64.js +2 -0
  128. package/dist/post-components/p-24b07f64.js.map +1 -0
  129. package/dist/post-components/p-29535fea.entry.js +2 -0
  130. package/dist/post-components/p-29535fea.entry.js.map +1 -0
  131. package/dist/post-components/p-296af738.entry.js +2 -0
  132. package/dist/post-components/p-296af738.entry.js.map +1 -0
  133. package/dist/post-components/p-2b6ab354.entry.js +9 -0
  134. package/dist/post-components/p-2b6ab354.entry.js.map +1 -0
  135. package/dist/post-components/p-75a7b352.js +2 -0
  136. package/dist/post-components/p-75a7b352.js.map +1 -0
  137. package/dist/post-components/p-a14ec7bb.entry.js +2 -0
  138. package/dist/post-components/p-a14ec7bb.entry.js.map +1 -0
  139. package/dist/post-components/p-bcc705f1.js +2 -0
  140. package/dist/post-components/p-bcc705f1.js.map +1 -0
  141. package/dist/post-components/p-c7497ecb.entry.js +2 -0
  142. package/dist/post-components/p-c7497ecb.entry.js.map +1 -0
  143. package/dist/post-components/p-c8efe0ae.js +2 -0
  144. package/dist/post-components/p-c8efe0ae.js.map +1 -0
  145. package/dist/post-components/p-cc6e4eb8.entry.js +2 -0
  146. package/dist/post-components/p-cc6e4eb8.entry.js.map +1 -0
  147. package/dist/post-components/p-d94db268.js +3 -0
  148. package/dist/post-components/p-d94db268.js.map +1 -0
  149. package/dist/post-components/p-e5306504.js +2 -0
  150. package/dist/post-components/p-e5306504.js.map +1 -0
  151. package/dist/post-components/post-components.esm.js +1 -1
  152. package/dist/post-components/post-components.esm.js.map +1 -1
  153. package/dist/types/animations/fade.d.ts +2 -0
  154. package/dist/types/animations/index.d.ts +1 -0
  155. package/dist/types/components/post-alert/alert-types.d.ts +2 -0
  156. package/dist/types/components/post-alert/post-alert.d.ts +49 -0
  157. package/dist/types/components/post-tab-header/post-tab-header.d.ts +11 -0
  158. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +10 -0
  159. package/dist/types/components/post-tabs/post-tabs.d.ts +34 -0
  160. package/dist/types/components/post-tooltip/post-tooltip.d.ts +66 -0
  161. package/dist/types/components/post-tooltip/types.d.ts +2 -0
  162. package/dist/types/components.d.ts +190 -0
  163. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
  164. package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -0
  165. package/dist/types/utils/property-checkers/index.d.ts +3 -1
  166. package/package.json +13 -9
  167. package/dist/cjs/index-272283b3.js.map +0 -1
  168. package/dist/cjs/package-f6bb523d.js.map +0 -1
  169. package/dist/esm/index-60a84798.js.map +0 -1
  170. package/dist/esm/package-bcf00737.js.map +0 -1
  171. package/dist/post-components/p-0096c140.js +0 -3
  172. package/dist/post-components/p-4a3ff4c0.js +0 -2
  173. package/dist/post-components/p-4a3ff4c0.js.map +0 -1
  174. package/dist/post-components/p-99ccf0cf.entry.js +0 -2
  175. package/dist/post-components/p-cafa0281.entry.js +0 -2
  176. package/dist/post-components/p-cafa0281.entry.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const EMPTY_VALUES = [undefined, null, ''];
4
+
5
+ function checkNonEmpty(value, error) {
6
+ if (EMPTY_VALUES.some(v => v === value)) {
7
+ throw new Error(error);
8
+ }
9
+ }
10
+
11
+ exports.EMPTY_VALUES = EMPTY_VALUES;
12
+ exports.checkNonEmpty = checkNonEmpty;
13
+
14
+ //# sourceMappingURL=check-non-empty-35b4d0b5.js.map
@@ -0,0 +1 @@
1
+ {"file":"check-non-empty-35b4d0b5.js","mappings":";;MAAa,YAAY,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE;;SCEhC,aAAa,CAAC,KAAc,EAAE,KAAa;EACzD,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE;IACvC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GACxB;AACH;;;;;","names":[],"sources":["./src/utils/property-checkers/constants.ts","./src/utils/property-checkers/check-non-empty.ts"],"sourcesContent":["export const EMPTY_VALUES = [undefined, null, ''];\n","import { EMPTY_VALUES } from './constants';\n\nexport function checkNonEmpty(value: unknown, error: string) {\n if (EMPTY_VALUES.some(v => v === value)) {\n throw new Error(error);\n }\n}\n"],"version":3}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ function checkOneOf(value, possibleValues, error) {
4
+ if (!possibleValues.includes(value))
5
+ throw new Error(error);
6
+ }
7
+
8
+ exports.checkOneOf = checkOneOf;
9
+
10
+ //# sourceMappingURL=check-one-of-4c2e8b2e.js.map
@@ -0,0 +1 @@
1
+ {"file":"check-one-of-4c2e8b2e.js","mappings":";;SAAgB,UAAU,CAAI,KAAQ,EAAE,cAA4B,EAAE,KAAa;EACjF,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;IAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9D;;;;","names":[],"sources":["./src/utils/property-checkers/check-one-of.ts"],"sourcesContent":["export function checkOneOf<T>(value: T, possibleValues: readonly T[], error: string) {\n if (!possibleValues.includes(value)) throw new Error(error);\n}\n"],"version":3}
@@ -1,10 +1,5 @@
1
1
  'use strict';
2
2
 
3
- function checkOneOf(value, possibleValues, error) {
4
- if (!possibleValues.includes(value))
5
- throw new Error(error);
6
- }
7
-
8
3
  function checkType(value, type, error) {
9
4
  const typeIsArray = type === 'array';
10
5
  const valueIsArray = Array.isArray(value);
@@ -18,10 +13,6 @@ function checkType(value, type, error) {
18
13
  }
19
14
  }
20
15
 
21
- const version = "1.3.10";
22
-
23
- exports.checkOneOf = checkOneOf;
24
16
  exports.checkType = checkType;
25
- exports.version = version;
26
17
 
27
- //# sourceMappingURL=package-f6bb523d.js.map
18
+ //# sourceMappingURL=check-type-508a21a5.js.map
@@ -0,0 +1 @@
1
+ {"file":"check-type-508a21a5.js","mappings":";;SAQgB,SAAS,CAAC,KAAc,EAAE,IAAkB,EAAE,KAAa;EACzE,MAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC;EACrC,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;EAE1C,IAAI,WAAW,IAAI,YAAY,EAAE;IAC/B,IAAI,YAAY,KAAK,WAAW;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GAC1D;OAAM;IACL,IAAI,OAAO,KAAK,KAAK,IAAI;MAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;GACnD;AACH;;;;","names":[],"sources":["./src/utils/property-checkers/check-type.ts"],"sourcesContent":["export type PropertyType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'array'\n | 'object'\n | 'function';\n\nexport function checkType(value: unknown, type: PropertyType, error: string) {\n const typeIsArray = type === 'array';\n const valueIsArray = Array.isArray(value);\n\n if (typeIsArray || valueIsArray) {\n if (valueIsArray !== typeIsArray) throw new Error(error);\n } else {\n if (typeof value !== type) throw new Error(error);\n }\n}\n"],"version":3}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const fadeDuration = 200;
4
+ const fadedOutKeyFrame = { opacity: '0' };
5
+ const fadedInKeyFrame = { opacity: '1' };
6
+ const fadeIn = (el) => el.animate([fadedOutKeyFrame, fadedInKeyFrame], { duration: fadeDuration });
7
+ const fadeOut = (el) => el.animate([fadedInKeyFrame, fadedOutKeyFrame], { duration: fadeDuration });
8
+
9
+ exports.fadeIn = fadeIn;
10
+ exports.fadeOut = fadeOut;
11
+
12
+ //# sourceMappingURL=fade-8c6d4fa7.js.map
@@ -0,0 +1 @@
1
+ {"file":"fade-8c6d4fa7.js","mappings":";;AAAA,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,gBAAgB,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AACxC,MAAM,eAAe,GAAG,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;MAE1B,MAAM,GAAG,CAAC,EAAW,KAAgB,EAAE,CAAC,OAAO,CAC1D,CAAE,gBAAgB,EAAE,eAAe,CAAE,EACrC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAC1B;MAEW,OAAO,GAAG,CAAC,EAAW,KAAgB,EAAE,CAAC,OAAO,CAC3D,CAAE,eAAe,EAAE,gBAAgB,CAAE,EACrC,EAAE,QAAQ,EAAE,YAAY,EAAE;;;;;","names":[],"sources":["./src/animations/fade.ts"],"sourcesContent":["const fadeDuration = 200;\nconst fadedOutKeyFrame = {opacity: '0'};\nconst fadedInKeyFrame = {opacity: '1'};\n\nexport const fadeIn = (el: Element): Animation => el.animate(\n [ fadedOutKeyFrame, fadedInKeyFrame ],\n { duration: fadeDuration }\n);\n\nexport const fadeOut = (el: Element): Animation => el.animate(\n [ fadedInKeyFrame, fadedOutKeyFrame ],\n { duration: fadeDuration }\n);\n"],"version":3}
@@ -99,6 +99,7 @@ function queryNonceMetaTagContent(doc) {
99
99
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
100
100
  const h = (nodeName, vnodeData, ...children) => {
101
101
  let child = null;
102
+ let key = null;
102
103
  let simple = false;
103
104
  let lastSimple = false;
104
105
  const vNodeChildren = [];
@@ -126,6 +127,10 @@ const h = (nodeName, vnodeData, ...children) => {
126
127
  };
127
128
  walk(children);
128
129
  if (vnodeData) {
130
+ // normalize class / classname attributes
131
+ if (vnodeData.key) {
132
+ key = vnodeData.key;
133
+ }
129
134
  {
130
135
  const classData = vnodeData.className || vnodeData.class;
131
136
  if (classData) {
@@ -147,6 +152,9 @@ const h = (nodeName, vnodeData, ...children) => {
147
152
  if (vNodeChildren.length > 0) {
148
153
  vnode.$children$ = vNodeChildren;
149
154
  }
155
+ {
156
+ vnode.$key$ = key;
157
+ }
150
158
  return vnode;
151
159
  };
152
160
  /**
@@ -168,6 +176,9 @@ const newVNode = (tag, text) => {
168
176
  {
169
177
  vnode.$attrs$ = null;
170
178
  }
179
+ {
180
+ vnode.$key$ = null;
181
+ }
171
182
  return vnode;
172
183
  };
173
184
  const Host = {};
@@ -279,6 +290,19 @@ const parsePropertyValue = (propValue, propType) => {
279
290
  return propValue;
280
291
  };
281
292
  const getElement = (ref) => (getHostRef(ref).$hostElement$ );
293
+ const createEvent = (ref, name, flags) => {
294
+ const elm = getElement(ref);
295
+ return {
296
+ emit: (detail) => {
297
+ return emitEvent(elm, name, {
298
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
299
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
300
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
301
+ detail,
302
+ });
303
+ },
304
+ };
305
+ };
282
306
  /**
283
307
  * Helper function to create & dispatch a custom Event on a provided target
284
308
  * @param elm the target of the Event
@@ -413,6 +437,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
413
437
  }
414
438
  }
415
439
  }
440
+ else if (memberName === 'key')
441
+ ;
442
+ else if (memberName === 'ref') {
443
+ // minifier will clean this up
444
+ if (newValue) {
445
+ newValue(elm);
446
+ }
447
+ }
416
448
  else if ((!isProp ) &&
417
449
  memberName[0] === 'o' &&
418
450
  memberName[1] === 'n') {
@@ -529,7 +561,11 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
529
561
  let i = 0;
530
562
  let elm;
531
563
  let childNode;
532
- {
564
+ if (newVNode.$text$ !== null) {
565
+ // create text node
566
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
567
+ }
568
+ else {
533
569
  if (!isSvgMode) {
534
570
  isSvgMode = newVNode.$tag$ === 'svg';
535
571
  }
@@ -619,6 +655,7 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
619
655
  const vnode = vnodes[index];
620
656
  if (vnode) {
621
657
  const elm = vnode.$elm$;
658
+ nullifyVNodeRefs(vnode);
622
659
  if (elm) {
623
660
  // remove the vnode's element from the dom
624
661
  elm.remove();
@@ -697,6 +734,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
697
734
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
698
735
  let oldStartIdx = 0;
699
736
  let newStartIdx = 0;
737
+ let idxInOld = 0;
738
+ let i = 0;
700
739
  let oldEndIdx = oldCh.length - 1;
701
740
  let oldStartVnode = oldCh[0];
702
741
  let oldEndVnode = oldCh[oldEndIdx];
@@ -704,6 +743,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
704
743
  let newStartVnode = newCh[0];
705
744
  let newEndVnode = newCh[newEndIdx];
706
745
  let node;
746
+ let elmToMove;
707
747
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
708
748
  if (oldStartVnode == null) {
709
749
  // VNode might have been moved left
@@ -770,7 +810,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
770
810
  newStartVnode = newCh[++newStartIdx];
771
811
  }
772
812
  else {
813
+ // Here we do some checks to match up old and new nodes based on the
814
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
815
+ // in the JSX for a DOM element in the implementation of a Stencil
816
+ // component.
817
+ //
818
+ // First we check to see if there are any nodes in the array of old
819
+ // children which have the same key as the first node in the new
820
+ // children.
821
+ idxInOld = -1;
773
822
  {
823
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
824
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
825
+ idxInOld = i;
826
+ break;
827
+ }
828
+ }
829
+ }
830
+ if (idxInOld >= 0) {
831
+ // We found a node in the old children which matches up with the first
832
+ // node in the new children! So let's deal with that
833
+ elmToMove = oldCh[idxInOld];
834
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
835
+ // the tag doesn't match so we'll need a new DOM element
836
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
837
+ }
838
+ else {
839
+ patch(elmToMove, newStartVnode);
840
+ // invalidate the matching old node so that we won't try to update it
841
+ // again later on
842
+ oldCh[idxInOld] = undefined;
843
+ node = elmToMove.$elm$;
844
+ }
845
+ newStartVnode = newCh[++newStartIdx];
846
+ }
847
+ else {
774
848
  // We either didn't find an element in the old children that matches
775
849
  // the key of the first new child OR the build is not using `key`
776
850
  // attributes at all. In either case we need to create a new element
@@ -819,7 +893,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
819
893
  // compare if two vnode to see if they're "technically" the same
820
894
  // need to have the same element tag, and same key to be the same
821
895
  if (leftVNode.$tag$ === rightVNode.$tag$) {
822
- return true;
896
+ // this will be set if components in the build have `key` attrs set on them
897
+ {
898
+ return leftVNode.$key$ === rightVNode.$key$;
899
+ }
823
900
  }
824
901
  return false;
825
902
  };
@@ -836,7 +913,8 @@ const patch = (oldVNode, newVNode) => {
836
913
  const oldChildren = oldVNode.$children$;
837
914
  const newChildren = newVNode.$children$;
838
915
  const tag = newVNode.$tag$;
839
- {
916
+ const text = newVNode.$text$;
917
+ if (text === null) {
840
918
  {
841
919
  // test if we're rendering an svg element, or still rendering nodes inside of one
842
920
  // only add this to the when the compiler sees we're using an svg somewhere
@@ -858,6 +936,11 @@ const patch = (oldVNode, newVNode) => {
858
936
  updateChildren(elm, oldChildren, newVNode, newChildren);
859
937
  }
860
938
  else if (newChildren !== null) {
939
+ // no old child vnodes, but there are new child vnodes to add
940
+ if (oldVNode.$text$ !== null) {
941
+ // the old vnode was text, so be sure to clear it out
942
+ elm.textContent = '';
943
+ }
861
944
  // add the new vnode children
862
945
  addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
863
946
  }
@@ -869,6 +952,24 @@ const patch = (oldVNode, newVNode) => {
869
952
  isSvgMode = false;
870
953
  }
871
954
  }
955
+ else if (oldVNode.$text$ !== text) {
956
+ // update the text content for the text only vnode
957
+ // and also only if the text is different than before
958
+ elm.data = text;
959
+ }
960
+ };
961
+ /**
962
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
963
+ * calling them with `null`. This signals that the DOM element corresponding to
964
+ * the VDom node has been removed from the DOM.
965
+ *
966
+ * @param vNode a virtual DOM node
967
+ */
968
+ const nullifyVNodeRefs = (vNode) => {
969
+ {
970
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
971
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
972
+ }
872
973
  };
873
974
  /**
874
975
  * The main entry point for Stencil's virtual DOM-based rendering engine
@@ -1319,6 +1420,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1319
1420
  hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1320
1421
  }
1321
1422
  endNewInstance();
1423
+ fireConnectedCallback(hostRef.$lazyInstance$);
1322
1424
  }
1323
1425
  if (Cstr.style) {
1324
1426
  // this component has styles but we haven't registered them yet
@@ -1347,6 +1449,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1347
1449
  schedule();
1348
1450
  }
1349
1451
  };
1452
+ const fireConnectedCallback = (instance) => {
1453
+ {
1454
+ safeCall(instance, 'connectedCallback');
1455
+ }
1456
+ };
1350
1457
  const connectedCallback = (elm) => {
1351
1458
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1352
1459
  const hostRef = getHostRef(elm);
@@ -1385,12 +1492,20 @@ const connectedCallback = (elm) => {
1385
1492
  initializeComponent(elm, hostRef, cmpMeta);
1386
1493
  }
1387
1494
  }
1495
+ else {
1496
+ // fire off connectedCallback() on component instance
1497
+ fireConnectedCallback(hostRef.$lazyInstance$);
1498
+ }
1388
1499
  endConnected();
1389
1500
  }
1390
1501
  };
1391
1502
  const disconnectedCallback = (elm) => {
1392
1503
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1393
- getHostRef(elm);
1504
+ const hostRef = getHostRef(elm);
1505
+ const instance = hostRef.$lazyInstance$ ;
1506
+ {
1507
+ safeCall(instance, 'disconnectedCallback');
1508
+ }
1394
1509
  }
1395
1510
  };
1396
1511
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1609,10 +1724,11 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1609
1724
 
1610
1725
  exports.Host = Host;
1611
1726
  exports.bootstrapLazy = bootstrapLazy;
1727
+ exports.createEvent = createEvent;
1612
1728
  exports.getElement = getElement;
1613
1729
  exports.h = h;
1614
1730
  exports.promiseResolve = promiseResolve;
1615
1731
  exports.registerInstance = registerInstance;
1616
1732
  exports.setNonce = setNonce;
1617
1733
 
1618
- //# sourceMappingURL=index-272283b3.js.map
1734
+ //# sourceMappingURL=index-12cc37c9.js.map