@siemens/ix-aggrid 1.4.0-beta.3 → 1.5.0-beta.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 (68) hide show
  1. package/dist/cjs/ag-grid-community.auto.esm-9ea84b71.js +2 -0
  2. package/dist/cjs/ag-grid-community.auto.esm-9ea84b71.js.map +1 -0
  3. package/dist/cjs/{index-713ffc51.js → index-5fdf8083.js} +99 -2
  4. package/dist/cjs/index-5fdf8083.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/index.cjs.js.map +1 -0
  7. package/dist/cjs/ix-ag-grid.cjs.entry.js +3 -1
  8. package/dist/cjs/ix-ag-grid.cjs.entry.js.map +1 -0
  9. package/dist/cjs/ix-aggrid.cjs.js +11 -2
  10. package/dist/cjs/ix-aggrid.cjs.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +5 -2
  12. package/dist/cjs/loader.cjs.js.map +1 -0
  13. package/dist/cjs/my-component.cjs.entry.js +3 -1
  14. package/dist/cjs/my-component.cjs.entry.js.map +1 -0
  15. package/dist/collection/collection-manifest.json +2 -2
  16. package/dist/collection/components/ix-ag-grid/ix-ag-grid.js +1 -0
  17. package/dist/collection/components/ix-ag-grid/ix-ag-grid.js.map +1 -0
  18. package/dist/collection/components/my-component/my-component.js +1 -0
  19. package/dist/collection/components/my-component/my-component.js.map +1 -0
  20. package/dist/collection/components/tests/utils/test/index.js +1 -0
  21. package/dist/collection/components/tests/utils/test/index.js.map +1 -0
  22. package/dist/collection/components/tests/utils/test/page.js +1 -0
  23. package/dist/collection/components/tests/utils/test/page.js.map +1 -0
  24. package/dist/collection/index.js +1 -0
  25. package/dist/collection/index.js.map +1 -0
  26. package/dist/components/ag-grid-community.auto.esm.js +50822 -0
  27. package/dist/components/ag-grid-community.auto.esm.js.map +1 -0
  28. package/dist/components/index.d.ts +9 -5
  29. package/dist/components/index.js +4 -3
  30. package/dist/components/index.js.map +1 -0
  31. package/dist/components/ix-ag-grid.js +5 -50821
  32. package/dist/components/ix-ag-grid.js.map +1 -0
  33. package/dist/components/my-component.js +2 -0
  34. package/dist/components/my-component.js.map +1 -0
  35. package/dist/esm/ag-grid-community.auto.esm-c5d0b4c8.js +2 -0
  36. package/dist/esm/ag-grid-community.auto.esm-c5d0b4c8.js.map +1 -0
  37. package/dist/esm/{index-c5cf50e5.js → index-2dc15cee.js} +99 -3
  38. package/dist/esm/index-2dc15cee.js.map +1 -0
  39. package/dist/esm/index.js +2 -0
  40. package/dist/esm/index.js.map +1 -0
  41. package/dist/esm/ix-ag-grid.entry.js +3 -1
  42. package/dist/esm/ix-ag-grid.entry.js.map +1 -0
  43. package/dist/esm/ix-aggrid.js +8 -2
  44. package/dist/esm/ix-aggrid.js.map +1 -0
  45. package/dist/esm/loader.js +5 -2
  46. package/dist/esm/loader.js.map +1 -0
  47. package/dist/esm/my-component.entry.js +3 -1
  48. package/dist/esm/my-component.entry.js.map +1 -0
  49. package/dist/esm/polyfills/css-shim.js +1 -1
  50. package/dist/ix-aggrid/index.esm.js +2 -1
  51. package/dist/ix-aggrid/index.esm.js.map +1 -0
  52. package/dist/ix-aggrid/ix-aggrid.esm.js +2 -1
  53. package/dist/ix-aggrid/ix-aggrid.esm.js.map +1 -0
  54. package/dist/ix-aggrid/p-344d1d93.entry.js +2 -0
  55. package/dist/ix-aggrid/p-344d1d93.entry.js.map +1 -0
  56. package/dist/ix-aggrid/p-38388e1b.js +1198 -60
  57. package/dist/ix-aggrid/p-38388e1b.js.map +1 -0
  58. package/dist/ix-aggrid/p-bc67a04a.entry.js +2 -0
  59. package/dist/ix-aggrid/p-bc67a04a.entry.js.map +1 -0
  60. package/dist/ix-aggrid/p-c5dadb3f.js +3 -0
  61. package/dist/ix-aggrid/p-c5dadb3f.js.map +1 -0
  62. package/dist/types/components.d.ts +1 -0
  63. package/dist/types/stencil-public-runtime.d.ts +71 -15
  64. package/loader/index.d.ts +9 -0
  65. package/package.json +9 -9
  66. package/dist/ix-aggrid/p-55389b3b.js +0 -2
  67. package/dist/ix-aggrid/p-55ee162e.entry.js +0 -1
  68. package/dist/ix-aggrid/p-cfe2ad1a.entry.js +0 -1
@@ -56,11 +56,30 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
56
56
  */
57
57
  const EMPTY_OBJ = {};
58
58
  const isDef = (v) => v != null;
59
+ /**
60
+ * Check whether a value is a 'complex type', defined here as an object or a
61
+ * function.
62
+ *
63
+ * @param o the value to check
64
+ * @returns whether it's a complex type or not
65
+ */
59
66
  const isComplexType = (o) => {
60
67
  // https://jsperf.com/typeof-fn-object/5
61
68
  o = typeof o;
62
69
  return o === 'object' || o === 'function';
63
70
  };
71
+ /**
72
+ * Helper method for querying a `meta` tag that contains a nonce value
73
+ * out of a DOM's head.
74
+ *
75
+ * @param doc The DOM containing the `head` to query against
76
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
77
+ * exists or the tag has no content.
78
+ */
79
+ function queryNonceMetaTagContent(doc) {
80
+ var _a, _b, _c;
81
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
82
+ }
64
83
  /**
65
84
  * Production h() function based on Preact by
66
85
  * Jason Miller (@developit)
@@ -69,7 +88,6 @@ const isComplexType = (o) => {
69
88
  *
70
89
  * Modified for Stencil's compiler and vdom
71
90
  */
72
- // const stack: any[] = [];
73
91
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
74
92
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
75
93
  const h = (nodeName, vnodeData, ...children) => {
@@ -120,6 +138,14 @@ const h = (nodeName, vnodeData, ...children) => {
120
138
  }
121
139
  return vnode;
122
140
  };
141
+ /**
142
+ * A utility function for creating a virtual DOM node from a tag and some
143
+ * possible text content.
144
+ *
145
+ * @param tag the tag for this element
146
+ * @param text possible text content for the node
147
+ * @returns a newly-minted virtual DOM node
148
+ */
123
149
  const newVNode = (tag, text) => {
124
150
  const vnode = {
125
151
  $flags$: 0,
@@ -134,6 +160,12 @@ const newVNode = (tag, text) => {
134
160
  return vnode;
135
161
  };
136
162
  const Host = {};
163
+ /**
164
+ * Check whether a given node is a Host node or not
165
+ *
166
+ * @param node the virtual DOM node to check
167
+ * @returns whether it's a Host node or not
168
+ */
137
169
  const isHost = (node) => node && node.$tag$ === Host;
138
170
  /**
139
171
  * Parse a new property value for a given property type.
@@ -199,6 +231,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
199
231
  styles.set(scopeId, style);
200
232
  };
201
233
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
234
+ var _a;
202
235
  let scopeId = getScopeId(cmpMeta);
203
236
  const style = styles.get(scopeId);
204
237
  // if an element is NOT connected then getRootNode() will return the wrong root node
@@ -214,10 +247,16 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
214
247
  }
215
248
  if (!appliedStyles.has(scopeId)) {
216
249
  {
250
+ // TODO(STENCIL-659): Remove code implementing the CSS variable shim
217
251
  {
218
252
  styleElm = doc.createElement('style');
219
253
  styleElm.innerHTML = style;
220
254
  }
255
+ // Apply CSP nonce to the style tag if it exists
256
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
257
+ if (nonce != null) {
258
+ styleElm.setAttribute('nonce', nonce);
259
+ }
221
260
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
222
261
  }
223
262
  if (appliedStyles) {
@@ -237,6 +276,7 @@ const attachStyles = (hostRef) => {
237
276
  const flags = cmpMeta.$flags$;
238
277
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
239
278
  const scopeId = addStyle(elm.getRootNode(), cmpMeta);
279
+ // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
240
280
  if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
241
281
  // only required when we're NOT using native shadow dom (slot)
242
282
  // or this browser doesn't support native shadow dom
@@ -366,6 +406,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
366
406
  }
367
407
  return elm;
368
408
  };
409
+ /**
410
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
411
+ * add them to the DOM in the appropriate place.
412
+ *
413
+ * @param parentElm the DOM node which should be used as a parent for the new
414
+ * DOM nodes
415
+ * @param before a child of the `parentElm` which the new children should be
416
+ * inserted before (optional)
417
+ * @param parentVNode the parent virtual DOM node
418
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
419
+ * @param startIdx the index in the child virtual DOM nodes at which to start
420
+ * creating DOM nodes (inclusive)
421
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
422
+ * creating DOM nodes (inclusive)
423
+ */
369
424
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
370
425
  let containerElm = (parentElm);
371
426
  let childNode;
@@ -379,6 +434,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
379
434
  }
380
435
  }
381
436
  };
437
+ /**
438
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
439
+ * This can be used to, for instance, clean up after a list of children which
440
+ * should no longer be shown.
441
+ *
442
+ * This function also handles some of Stencil's slot relocation logic.
443
+ *
444
+ * @param vnodes a list of virtual DOM nodes to remove
445
+ * @param startIdx the index at which to start removing nodes (inclusive)
446
+ * @param endIdx the index at which to stop removing nodes (inclusive)
447
+ * @param vnode a VNode
448
+ * @param elm an element
449
+ */
382
450
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
383
451
  for (; startIdx <= endIdx; ++startIdx) {
384
452
  if ((vnode = vnodes[startIdx])) {
@@ -570,7 +638,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
570
638
  *
571
639
  * So, in other words, if `key` attrs are not set on VNodes which may be
572
640
  * changing order within a `children` array or something along those lines then
573
- * we could obtain a false positive and then have to do needless re-rendering.
641
+ * we could obtain a false negative and then have to do needless re-rendering
642
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
574
643
  *
575
644
  * @param leftVNode the first VNode to check
576
645
  * @param rightVNode the second VNode to check
@@ -620,6 +689,18 @@ const patch = (oldVNode, newVNode) => {
620
689
  }
621
690
  }
622
691
  };
692
+ /**
693
+ * The main entry point for Stencil's virtual DOM-based rendering engine
694
+ *
695
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
696
+ * function will handle creating a virtual DOM tree with a single root, patching
697
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
698
+ * relocation, and reflecting attributes.
699
+ *
700
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
701
+ * the DOM node into which it should be rendered.
702
+ * @param renderFnResults the virtual DOM nodes to be rendered
703
+ */
623
704
  const renderVdom = (hostRef, renderFnResults) => {
624
705
  const hostElm = hostRef.$hostElement$;
625
706
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -998,6 +1079,7 @@ const disconnectedCallback = (elm) => {
998
1079
  }
999
1080
  };
1000
1081
  const bootstrapLazy = (lazyBundles, options = {}) => {
1082
+ var _a;
1001
1083
  const endBootstrap = createTime();
1002
1084
  const cmpTags = [];
1003
1085
  const exclude = options.exclude || [];
@@ -1063,6 +1145,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1063
1145
  {
1064
1146
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1065
1147
  visibilityStyle.setAttribute('data-styles', '');
1148
+ // Apply CSP nonce to the style tag if it exists
1149
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1150
+ if (nonce != null) {
1151
+ visibilityStyle.setAttribute('nonce', nonce);
1152
+ }
1066
1153
  head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1067
1154
  }
1068
1155
  // Process deferred connectedCallbacks now all components have been registered
@@ -1078,6 +1165,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1078
1165
  // Fallback appLoad event
1079
1166
  endBootstrap();
1080
1167
  };
1168
+ /**
1169
+ * Assigns the given value to the nonce property on the runtime platform object.
1170
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1171
+ * @param nonce The value to be assigned to the platform nonce property.
1172
+ * @returns void
1173
+ */
1174
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1081
1175
  const hostRefs = /*@__PURE__*/ new WeakMap();
1082
1176
  const getHostRef = (ref) => hostRefs.get(ref);
1083
1177
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
@@ -1189,3 +1283,6 @@ exports.getElement = getElement;
1189
1283
  exports.h = h;
1190
1284
  exports.promiseResolve = promiseResolve;
1191
1285
  exports.registerInstance = registerInstance;
1286
+ exports.setNonce = setNonce;
1287
+
1288
+ //# sourceMappingURL=index-5fdf8083.js.map