@mgdis/mg-components 5.20.0 → 5.21.1

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 (96) hide show
  1. package/dist/cjs/{index-8532b5e9.js → index-b4c6ee30.js} +25 -17
  2. package/dist/cjs/index-b4c6ee30.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/mg-action-more_34.cjs.entry.js +268 -219
  5. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  6. package/dist/cjs/mg-components.cjs.js +3 -3
  7. package/dist/cjs/mg-components.cjs.js.map +1 -1
  8. package/dist/cjs/mg-item-more.cjs.entry.js +31 -16
  9. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  10. package/dist/collection/assets/icons/index.js +189 -189
  11. package/dist/collection/assets/icons/index.js.map +1 -1
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +25 -8
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +12 -12
  16. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +6 -10
  18. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -10
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -10
  22. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +6 -10
  24. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +6 -10
  26. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +6 -10
  28. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +6 -10
  30. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +6 -10
  32. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  33. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
  34. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  35. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  36. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  37. package/dist/collection/components/molecules/mg-form/mg-form.conf.js +9 -0
  38. package/dist/collection/components/molecules/mg-form/mg-form.conf.js.map +1 -0
  39. package/dist/collection/components/molecules/mg-form/mg-form.js +81 -8
  40. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  41. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +30 -15
  42. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  43. package/dist/collection/components/molecules/mg-popover/mg-popover.js +27 -10
  44. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  45. package/dist/collection/utils/behaviors.utils.spec.js +5 -1
  46. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  47. package/dist/collection/utils/components.utils.spec.js +1 -1
  48. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  49. package/dist/components/mg-action-more.js.map +1 -1
  50. package/dist/components/mg-form.js +40 -8
  51. package/dist/components/mg-form.js.map +1 -1
  52. package/dist/components/mg-icon2.js +189 -189
  53. package/dist/components/mg-icon2.js.map +1 -1
  54. package/dist/components/mg-input-checkbox-paginated2.js +8 -8
  55. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  56. package/dist/components/mg-input-checkbox.js +7 -3
  57. package/dist/components/mg-input-checkbox.js.map +1 -1
  58. package/dist/components/mg-item-more.js +30 -15
  59. package/dist/components/mg-item-more.js.map +1 -1
  60. package/dist/components/mg-menu-item2.js +2 -2
  61. package/dist/components/mg-menu-item2.js.map +1 -1
  62. package/dist/components/mg-popover2.js +27 -10
  63. package/dist/components/mg-popover2.js.map +1 -1
  64. package/dist/esm/{index-f34a3a2c.js → index-61c7cfb5.js} +25 -17
  65. package/dist/esm/index-61c7cfb5.js.map +1 -0
  66. package/dist/esm/loader.js +3 -3
  67. package/dist/esm/mg-action-more_34.entry.js +268 -219
  68. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  69. package/dist/esm/mg-components.js +4 -4
  70. package/dist/esm/mg-components.js.map +1 -1
  71. package/dist/esm/mg-item-more.entry.js +31 -16
  72. package/dist/esm/mg-item-more.entry.js.map +1 -1
  73. package/dist/mg-components/mg-components.esm.js +1 -1
  74. package/dist/mg-components/mg-components.esm.js.map +1 -1
  75. package/dist/mg-components/p-1c17516a.entry.js +2 -0
  76. package/dist/mg-components/p-1c17516a.entry.js.map +1 -0
  77. package/dist/mg-components/p-5b4eb029.entry.js +2 -0
  78. package/dist/mg-components/p-5b4eb029.entry.js.map +1 -0
  79. package/dist/mg-components/p-6e7aebeb.js +3 -0
  80. package/dist/mg-components/p-6e7aebeb.js.map +1 -0
  81. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +4 -4
  82. package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +1 -1
  83. package/dist/types/components/molecules/mg-form/mg-form.conf.d.ts +16 -0
  84. package/dist/types/components/molecules/mg-form/mg-form.d.ts +18 -1
  85. package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +13 -7
  86. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +10 -0
  87. package/dist/types/components.d.ts +28 -2
  88. package/package.json +7 -7
  89. package/dist/cjs/index-8532b5e9.js.map +0 -1
  90. package/dist/esm/index-f34a3a2c.js.map +0 -1
  91. package/dist/mg-components/p-629454f7.entry.js +0 -2
  92. package/dist/mg-components/p-629454f7.entry.js.map +0 -1
  93. package/dist/mg-components/p-7444ff40.js +0 -3
  94. package/dist/mg-components/p-7444ff40.js.map +0 -1
  95. package/dist/mg-components/p-e0fb0f3c.entry.js +0 -2
  96. package/dist/mg-components/p-e0fb0f3c.entry.js.map +0 -1
@@ -880,8 +880,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
880
880
  * @param oldCh the old children of the parent node
881
881
  * @param newVNode the new VNode which will replace the parent
882
882
  * @param newCh the new children of the parent node
883
+ * @param isInitialRender whether or not this is the first render of the vdom
883
884
  */
884
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
885
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
885
886
  let oldStartIdx = 0;
886
887
  let newStartIdx = 0;
887
888
  let idxInOld = 0;
@@ -908,24 +909,24 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
908
909
  else if (newEndVnode == null) {
909
910
  newEndVnode = newCh[--newEndIdx];
910
911
  }
911
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
912
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
912
913
  // if the start nodes are the same then we should patch the new VNode
913
914
  // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
914
915
  // indices to reflect that. We don't need to move any DOM Nodes around
915
916
  // since things are matched up in order.
916
- patch(oldStartVnode, newStartVnode);
917
+ patch(oldStartVnode, newStartVnode, isInitialRender);
917
918
  oldStartVnode = oldCh[++oldStartIdx];
918
919
  newStartVnode = newCh[++newStartIdx];
919
920
  }
920
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
921
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
921
922
  // likewise, if the end nodes are the same we patch new onto old and
922
923
  // decrement our end indices, and also likewise in this case we don't
923
924
  // need to move any DOM Nodes.
924
- patch(oldEndVnode, newEndVnode);
925
+ patch(oldEndVnode, newEndVnode, isInitialRender);
925
926
  oldEndVnode = oldCh[--oldEndIdx];
926
927
  newEndVnode = newCh[--newEndIdx];
927
928
  }
928
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
929
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
929
930
  // case: "Vnode moved right"
930
931
  //
931
932
  // We've found that the last node in our window on the new children is
@@ -943,7 +944,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
943
944
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
944
945
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
945
946
  }
946
- patch(oldStartVnode, newEndVnode);
947
+ patch(oldStartVnode, newEndVnode, isInitialRender);
947
948
  // We need to move the element for `oldStartVnode` into a position which
948
949
  // will be appropriate for `newEndVnode`. For this we can use
949
950
  // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
@@ -965,7 +966,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
965
966
  oldStartVnode = oldCh[++oldStartIdx];
966
967
  newEndVnode = newCh[--newEndIdx];
967
968
  }
968
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
969
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
969
970
  // case: "Vnode moved left"
970
971
  //
971
972
  // We've found that the first node in our window on the new children is
@@ -984,7 +985,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
984
985
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
985
986
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
986
987
  }
987
- patch(oldEndVnode, newStartVnode);
988
+ patch(oldEndVnode, newStartVnode, isInitialRender);
988
989
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
989
990
  // the same node, so since we're here we know that they are not. Thus we
990
991
  // can move the element for `oldEndVnode` _before_ the element for
@@ -1021,7 +1022,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
1021
1022
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1022
1023
  }
1023
1024
  else {
1024
- patch(elmToMove, newStartVnode);
1025
+ patch(elmToMove, newStartVnode, isInitialRender);
1025
1026
  // invalidate the matching old node so that we won't try to update it
1026
1027
  // again later on
1027
1028
  oldCh[idxInOld] = undefined;
@@ -1072,19 +1073,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
1072
1073
  *
1073
1074
  * @param leftVNode the first VNode to check
1074
1075
  * @param rightVNode the second VNode to check
1076
+ * @param isInitialRender whether or not this is the first render of the vdom
1075
1077
  * @returns whether they're equal or not
1076
1078
  */
1077
- const isSameVnode = (leftVNode, rightVNode) => {
1079
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1078
1080
  // compare if two vnode to see if they're "technically" the same
1079
1081
  // need to have the same element tag, and same key to be the same
1080
1082
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1081
1083
  if (leftVNode.$tag$ === 'slot') {
1082
1084
  return leftVNode.$name$ === rightVNode.$name$;
1083
1085
  }
1084
- // this will be set if components in the build have `key` attrs set on them
1085
- {
1086
+ // this will be set if JSX tags in the build have `key` attrs set on them
1087
+ // we only want to check this if we're not on the first render since on
1088
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
1089
+ // astray and, for instance, accidentally delete a DOM node that we want to
1090
+ // keep around.
1091
+ if (!isInitialRender) {
1086
1092
  return leftVNode.$key$ === rightVNode.$key$;
1087
1093
  }
1094
+ return true;
1088
1095
  }
1089
1096
  return false;
1090
1097
  };
@@ -1103,8 +1110,9 @@ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).paren
1103
1110
  *
1104
1111
  * @param oldVNode an old VNode whose DOM element and children we want to update
1105
1112
  * @param newVNode a new VNode representing an updated version of the old one
1113
+ * @param isInitialRender whether or not this is the first render of the vdom
1106
1114
  */
1107
- const patch = (oldVNode, newVNode) => {
1115
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
1108
1116
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
1109
1117
  const oldChildren = oldVNode.$children$;
1110
1118
  const newChildren = newVNode.$children$;
@@ -1125,7 +1133,7 @@ const patch = (oldVNode, newVNode) => {
1125
1133
  if (oldChildren !== null && newChildren !== null) {
1126
1134
  // looks like there's child vnodes for both the old and new vnodes
1127
1135
  // so we need to call `updateChildren` to reconcile them
1128
- updateChildren(elm, oldChildren, newVNode, newChildren);
1136
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1129
1137
  }
1130
1138
  else if (newChildren !== null) {
1131
1139
  // no old child vnodes, but there are new child vnodes to add
@@ -1405,7 +1413,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1405
1413
  checkSlotFallbackVisibility = false;
1406
1414
  }
1407
1415
  // synchronous patch
1408
- patch(oldVNode, rootVnode);
1416
+ patch(oldVNode, rootVnode, isInitialLoad);
1409
1417
  {
1410
1418
  // while we're moving nodes around existing nodes, temporarily disable
1411
1419
  // the disconnectCallback from working
@@ -2478,4 +2486,4 @@ exports.promiseResolve = promiseResolve;
2478
2486
  exports.registerInstance = registerInstance;
2479
2487
  exports.setNonce = setNonce;
2480
2488
 
2481
- //# sourceMappingURL=index-8532b5e9.js.map
2489
+ //# sourceMappingURL=index-b4c6ee30.js.map