smoothly 1.0.0-alpha.63 → 1.0.0-alpha.65

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 (129) hide show
  1. package/dist/cjs/{index-8adc5c1b.js → index-43af753b.js} +55 -2
  2. package/dist/cjs/index-43af753b.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{redirect-27d21fcc.js → redirect-aecfeda0.js} +2 -2
  6. package/dist/cjs/{redirect-27d21fcc.js.map → redirect-aecfeda0.js.map} +1 -1
  7. package/dist/cjs/{smoothly-accordion_64.cjs.entry.js → smoothly-accordion_66.cjs.entry.js} +402 -195
  8. package/dist/cjs/smoothly-accordion_66.cjs.entry.js.map +1 -0
  9. package/dist/cjs/smoothly-address-display.cjs.entry.js +1 -1
  10. package/dist/cjs/smoothly-address.cjs.entry.js +1 -1
  11. package/dist/cjs/smoothly-addresses.cjs.entry.js +1 -1
  12. package/dist/cjs/smoothly-color.cjs.entry.js +1 -1
  13. package/dist/cjs/smoothly-country.cjs.entry.js +1 -1
  14. package/dist/cjs/smoothly-display-date-time.cjs.entry.js +1 -1
  15. package/dist/cjs/smoothly-google-font.cjs.entry.js +1 -1
  16. package/dist/cjs/smoothly-radio-group.cjs.entry.js +1 -1
  17. package/dist/cjs/smoothly-reorder.cjs.entry.js +1 -1
  18. package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +1 -1
  19. package/dist/cjs/smoothly-trigger-source.cjs.entry.js +1 -1
  20. package/dist/cjs/smoothly.cjs.js +2 -2
  21. package/dist/collection/collection-manifest.json +4 -2
  22. package/dist/collection/components/display-demo/index.js +1 -1
  23. package/dist/collection/components/display-demo/index.js.map +1 -1
  24. package/dist/collection/components/form/index.js +1 -1
  25. package/dist/collection/components/form/index.js.map +1 -1
  26. package/dist/collection/components/icon/index.js +6 -10
  27. package/dist/collection/components/icon/index.js.map +1 -1
  28. package/dist/collection/components/input/date/range/index.js +0 -1
  29. package/dist/collection/components/input/date/range/index.js.map +1 -1
  30. package/dist/collection/components/input/demo/index.js +1 -3
  31. package/dist/collection/components/input/demo/index.js.map +1 -1
  32. package/dist/collection/components/picker/demo/index.js +78 -0
  33. package/dist/collection/components/picker/demo/index.js.map +1 -0
  34. package/dist/collection/components/picker/demo/style.css +7 -0
  35. package/dist/collection/components/picker/index.js +64 -73
  36. package/dist/collection/components/picker/index.js.map +1 -1
  37. package/dist/collection/components/picker/menu/index.js +149 -58
  38. package/dist/collection/components/picker/menu/index.js.map +1 -1
  39. package/dist/collection/components/picker/menu/style.css +12 -31
  40. package/dist/collection/components/picker/option/index.js +67 -68
  41. package/dist/collection/components/picker/option/index.js.map +1 -1
  42. package/dist/collection/components/picker/option/style.css +13 -14
  43. package/dist/collection/components/picker/slot-elements/index.js +109 -0
  44. package/dist/collection/components/picker/slot-elements/index.js.map +1 -0
  45. package/dist/collection/components/picker/slot-elements/style.css +3 -0
  46. package/dist/collection/components/picker/slotted-elements/index.js +84 -0
  47. package/dist/collection/components/picker/slotted-elements/index.js.map +1 -0
  48. package/dist/collection/components/picker/slotted-elements/style.css +3 -0
  49. package/dist/collection/components/picker/style.css +6 -20
  50. package/dist/collection/model/Notice.js +1 -1
  51. package/dist/collection/model/Notice.js.map +1 -1
  52. package/dist/collection/model/Option.js.map +1 -1
  53. package/dist/custom-elements/index.d.ts +18 -6
  54. package/dist/custom-elements/index.js +425 -213
  55. package/dist/custom-elements/index.js.map +1 -1
  56. package/dist/esm/{index-6ac4212d.js → index-258984d3.js} +55 -2
  57. package/dist/esm/index-258984d3.js.map +1 -0
  58. package/dist/esm/index.js +1 -1
  59. package/dist/esm/loader.js +3 -3
  60. package/dist/esm/{redirect-ef0be9e9.js → redirect-1e0be743.js} +2 -2
  61. package/dist/esm/{redirect-ef0be9e9.js.map → redirect-1e0be743.js.map} +1 -1
  62. package/dist/esm/{smoothly-accordion_64.entry.js → smoothly-accordion_66.entry.js} +400 -195
  63. package/dist/esm/smoothly-accordion_66.entry.js.map +1 -0
  64. package/dist/esm/smoothly-address-display.entry.js +1 -1
  65. package/dist/esm/smoothly-address.entry.js +1 -1
  66. package/dist/esm/smoothly-addresses.entry.js +1 -1
  67. package/dist/esm/smoothly-color.entry.js +1 -1
  68. package/dist/esm/smoothly-country.entry.js +1 -1
  69. package/dist/esm/smoothly-display-date-time.entry.js +1 -1
  70. package/dist/esm/smoothly-google-font.entry.js +1 -1
  71. package/dist/esm/smoothly-radio-group.entry.js +1 -1
  72. package/dist/esm/smoothly-reorder.entry.js +1 -1
  73. package/dist/esm/smoothly-trigger-sink.entry.js +1 -1
  74. package/dist/esm/smoothly-trigger-source.entry.js +1 -1
  75. package/dist/esm/smoothly.js +3 -3
  76. package/dist/smoothly/index.esm.js +1 -1
  77. package/dist/smoothly/{p-04fb45e1.entry.js → p-12182a73.entry.js} +2 -2
  78. package/dist/smoothly/{p-ae33d7e1.entry.js → p-1244744c.entry.js} +2 -2
  79. package/dist/smoothly/{p-49ce4ef4.entry.js → p-1bae4997.entry.js} +2 -2
  80. package/dist/smoothly/p-1bae4997.entry.js.map +1 -0
  81. package/dist/smoothly/p-47151a53.entry.js +2 -0
  82. package/dist/smoothly/{p-8b08019e.js → p-4eff8c31.js} +2 -2
  83. package/dist/smoothly/{p-8b08019e.js.map → p-4eff8c31.js.map} +1 -1
  84. package/dist/smoothly/p-5e387578.js +3 -0
  85. package/dist/smoothly/p-5e387578.js.map +1 -0
  86. package/dist/smoothly/{p-16cba662.entry.js → p-66e9a8b1.entry.js} +2 -2
  87. package/dist/smoothly/{p-0fec28cc.entry.js → p-6aebb818.entry.js} +2 -2
  88. package/dist/smoothly/{p-15898b2f.entry.js → p-70dede91.entry.js} +2 -2
  89. package/dist/smoothly/{p-ae467192.entry.js → p-7bf147bf.entry.js} +2 -2
  90. package/dist/smoothly/{p-49221a9d.entry.js → p-863ff3c6.entry.js} +2 -2
  91. package/dist/smoothly/{p-b3eef141.entry.js → p-b3eac6af.entry.js} +2 -2
  92. package/dist/smoothly/{p-3a6873ed.entry.js → p-cb493516.entry.js} +2 -2
  93. package/dist/smoothly/{p-3e485d3a.entry.js → p-eef1c80b.entry.js} +2 -2
  94. package/dist/smoothly/smoothly.esm.js +1 -1
  95. package/dist/smoothly/smoothly.esm.js.map +1 -1
  96. package/dist/types/components/icon/index.d.ts +1 -4
  97. package/dist/types/components/picker/demo/index.d.ts +17 -0
  98. package/dist/types/components/picker/index.d.ts +10 -7
  99. package/dist/types/components/picker/menu/index.d.ts +23 -10
  100. package/dist/types/components/picker/option/index.d.ts +7 -6
  101. package/dist/types/components/picker/slot-elements/index.d.ts +15 -0
  102. package/dist/types/components/picker/slotted-elements/index.d.ts +8 -0
  103. package/dist/types/components.d.ts +64 -27
  104. package/dist/types/model/Notice.d.ts +1 -1
  105. package/dist/types/model/Option.d.ts +14 -2
  106. package/package.json +1 -1
  107. package/dist/cjs/index-8adc5c1b.js.map +0 -1
  108. package/dist/cjs/smoothly-accordion_64.cjs.entry.js.map +0 -1
  109. package/dist/collection/components/picker/testing/index.js +0 -30
  110. package/dist/collection/components/picker/testing/index.js.map +0 -1
  111. package/dist/collection/components/picker/testing/style.css +0 -0
  112. package/dist/esm/index-6ac4212d.js.map +0 -1
  113. package/dist/esm/smoothly-accordion_64.entry.js.map +0 -1
  114. package/dist/smoothly/p-49ce4ef4.entry.js.map +0 -1
  115. package/dist/smoothly/p-b98cd447.js +0 -3
  116. package/dist/smoothly/p-b98cd447.js.map +0 -1
  117. package/dist/smoothly/p-f29cc9ff.entry.js +0 -2
  118. package/dist/types/components/picker/testing/index.d.ts +0 -7
  119. /package/dist/smoothly/{p-04fb45e1.entry.js.map → p-12182a73.entry.js.map} +0 -0
  120. /package/dist/smoothly/{p-ae33d7e1.entry.js.map → p-1244744c.entry.js.map} +0 -0
  121. /package/dist/smoothly/{p-f29cc9ff.entry.js.map → p-47151a53.entry.js.map} +0 -0
  122. /package/dist/smoothly/{p-16cba662.entry.js.map → p-66e9a8b1.entry.js.map} +0 -0
  123. /package/dist/smoothly/{p-0fec28cc.entry.js.map → p-6aebb818.entry.js.map} +0 -0
  124. /package/dist/smoothly/{p-15898b2f.entry.js.map → p-70dede91.entry.js.map} +0 -0
  125. /package/dist/smoothly/{p-ae467192.entry.js.map → p-7bf147bf.entry.js.map} +0 -0
  126. /package/dist/smoothly/{p-49221a9d.entry.js.map → p-863ff3c6.entry.js.map} +0 -0
  127. /package/dist/smoothly/{p-b3eef141.entry.js.map → p-b3eac6af.entry.js.map} +0 -0
  128. /package/dist/smoothly/{p-3a6873ed.entry.js.map → p-cb493516.entry.js.map} +0 -0
  129. /package/dist/smoothly/{p-3e485d3a.entry.js.map → p-eef1c80b.entry.js.map} +0 -0
@@ -96,6 +96,7 @@ function queryNonceMetaTagContent(doc) {
96
96
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
97
97
  const h = (nodeName, vnodeData, ...children) => {
98
98
  let child = null;
99
+ let key = null;
99
100
  let slotName = null;
100
101
  let simple = false;
101
102
  let lastSimple = false;
@@ -124,6 +125,10 @@ const h = (nodeName, vnodeData, ...children) => {
124
125
  };
125
126
  walk(children);
126
127
  if (vnodeData) {
128
+ // normalize class / classname attributes
129
+ if (vnodeData.key) {
130
+ key = vnodeData.key;
131
+ }
127
132
  if (vnodeData.name) {
128
133
  slotName = vnodeData.name;
129
134
  }
@@ -148,6 +153,9 @@ const h = (nodeName, vnodeData, ...children) => {
148
153
  if (vNodeChildren.length > 0) {
149
154
  vnode.$children$ = vNodeChildren;
150
155
  }
156
+ {
157
+ vnode.$key$ = key;
158
+ }
151
159
  {
152
160
  vnode.$name$ = slotName;
153
161
  }
@@ -172,6 +180,9 @@ const newVNode = (tag, text) => {
172
180
  {
173
181
  vnode.$attrs$ = null;
174
182
  }
183
+ {
184
+ vnode.$key$ = null;
185
+ }
175
186
  {
176
187
  vnode.$name$ = null;
177
188
  }
@@ -434,6 +445,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
434
445
  }
435
446
  }
436
447
  }
448
+ else if (memberName === 'key')
449
+ ;
437
450
  else if (memberName === 'ref') {
438
451
  // minifier will clean this up
439
452
  if (newValue) {
@@ -807,6 +820,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
807
820
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
808
821
  let oldStartIdx = 0;
809
822
  let newStartIdx = 0;
823
+ let idxInOld = 0;
824
+ let i = 0;
810
825
  let oldEndIdx = oldCh.length - 1;
811
826
  let oldStartVnode = oldCh[0];
812
827
  let oldEndVnode = oldCh[oldEndIdx];
@@ -814,6 +829,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
814
829
  let newStartVnode = newCh[0];
815
830
  let newEndVnode = newCh[newEndIdx];
816
831
  let node;
832
+ let elmToMove;
817
833
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
818
834
  if (oldStartVnode == null) {
819
835
  // VNode might have been moved left
@@ -915,7 +931,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
915
931
  newStartVnode = newCh[++newStartIdx];
916
932
  }
917
933
  else {
934
+ // Here we do some checks to match up old and new nodes based on the
935
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
936
+ // in the JSX for a DOM element in the implementation of a Stencil
937
+ // component.
938
+ //
939
+ // First we check to see if there are any nodes in the array of old
940
+ // children which have the same key as the first node in the new
941
+ // children.
942
+ idxInOld = -1;
918
943
  {
944
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
945
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
946
+ idxInOld = i;
947
+ break;
948
+ }
949
+ }
950
+ }
951
+ if (idxInOld >= 0) {
952
+ // We found a node in the old children which matches up with the first
953
+ // node in the new children! So let's deal with that
954
+ elmToMove = oldCh[idxInOld];
955
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
956
+ // the tag doesn't match so we'll need a new DOM element
957
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
958
+ }
959
+ else {
960
+ patch(elmToMove, newStartVnode);
961
+ // invalidate the matching old node so that we won't try to update it
962
+ // again later on
963
+ oldCh[idxInOld] = undefined;
964
+ node = elmToMove.$elm$;
965
+ }
966
+ newStartVnode = newCh[++newStartIdx];
967
+ }
968
+ else {
919
969
  // We either didn't find an element in the old children that matches
920
970
  // the key of the first new child OR the build is not using `key`
921
971
  // attributes at all. In either case we need to create a new element
@@ -967,7 +1017,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
967
1017
  if (leftVNode.$tag$ === 'slot') {
968
1018
  return leftVNode.$name$ === rightVNode.$name$;
969
1019
  }
970
- return true;
1020
+ // this will be set if components in the build have `key` attrs set on them
1021
+ {
1022
+ return leftVNode.$key$ === rightVNode.$key$;
1023
+ }
971
1024
  }
972
1025
  return false;
973
1026
  };
@@ -2046,4 +2099,4 @@ exports.promiseResolve = promiseResolve;
2046
2099
  exports.registerInstance = registerInstance;
2047
2100
  exports.setNonce = setNonce;
2048
2101
 
2049
- //# sourceMappingURL=index-8adc5c1b.js.map
2102
+ //# sourceMappingURL=index-43af753b.js.map