@siemens/ix-aggrid 1.2.1 → 1.3.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 (33) hide show
  1. package/dist/cjs/{index-bbfdf33e.js → index-713ffc51.js} +5 -42
  2. package/dist/cjs/ix-ag-grid.cjs.entry.js +41 -0
  3. package/dist/cjs/ix-aggrid.cjs.js +2 -2
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/my-component.cjs.entry.js +19 -0
  6. package/dist/collection/components/my-component/my-component.js +1 -26
  7. package/dist/collection/{utils → components/tests/utils}/test/index.js +1 -0
  8. package/dist/collection/{utils → components/tests/utils}/test/page.js +1 -1
  9. package/dist/collection/{utils → components/tests/utils}/test/theme-switcher.js +0 -0
  10. package/dist/components/index.js +0 -1
  11. package/dist/components/ix-ag-grid.js +52651 -1
  12. package/dist/components/my-component.js +2 -46
  13. package/dist/esm/{index-1ae27f1f.js → index-c5cf50e5.js} +5 -42
  14. package/dist/esm/ix-ag-grid.entry.js +37 -0
  15. package/dist/esm/ix-aggrid.js +2 -2
  16. package/dist/esm/loader.js +2 -2
  17. package/dist/esm/my-component.entry.js +15 -0
  18. package/dist/ix-aggrid/ix-aggrid.css +1 -1
  19. package/dist/ix-aggrid/ix-aggrid.esm.js +1 -1
  20. package/dist/ix-aggrid/p-531b1c8d.entry.js +1 -0
  21. package/dist/ix-aggrid/p-55389b3b.js +2 -0
  22. package/dist/ix-aggrid/p-cfe2ad1a.entry.js +1 -0
  23. package/dist/types/components/my-component/my-component.d.ts +0 -3
  24. package/dist/types/components/tests/utils/test/index.d.ts +2 -0
  25. package/dist/types/{utils → components/tests/utils}/test/page.d.ts +0 -0
  26. package/package.json +8 -6
  27. package/dist/cjs/ix-ag-grid_2.cjs.entry.js +0 -92
  28. package/dist/components/ix-ag-grid2.js +0 -52653
  29. package/dist/esm/ix-ag-grid_2.entry.js +0 -87
  30. package/dist/ix-aggrid/p-5c9652cd.js +0 -2
  31. package/dist/ix-aggrid/p-d43d39f0.entry.js +0 -1
  32. package/dist/types/utils/test/index.d.ts +0 -1
  33. package/dist/types/utils/test/theme-switcher.d.ts +0 -1
@@ -1,53 +1,14 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './ix-ag-grid2.js';
3
-
4
- /*
5
- * SPDX-FileCopyrightText: 2022 Siemens AG
6
- *
7
- * SPDX-License-Identifier: MIT
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- const themeSwitcher = () => {
13
- const searchParams = new URLSearchParams(location.search);
14
- if (searchParams.has('theme')) {
15
- const theme = searchParams.get('theme');
16
- document.body.className = theme;
17
- }
18
- };
19
2
 
20
3
  const myComponentCss = ".sc-my-component-h{display:block}";
21
4
 
22
- const columnDefs = [
23
- { field: 'make', resizable: true, checkboxSelection: true },
24
- { field: 'model', resizable: true, sortable: true, filter: true },
25
- { field: 'price', resizable: true },
26
- ];
27
- const rowData = [
28
- { make: 'Toyota', model: 'Celica', price: 35000, checked: false },
29
- { make: 'Ford', model: 'Mondeo', price: 32000, checked: true },
30
- { make: 'Porsche', model: 'Boxster', price: 72000, checked: false },
31
- ];
32
5
  const MyComponent$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
33
6
  constructor() {
34
7
  super();
35
8
  this.__registerHost();
36
- this.gridOptions = {
37
- columnDefs: columnDefs,
38
- rowData: rowData,
39
- rowSelection: 'multiple',
40
- suppressCellFocus: true,
41
- };
42
- }
43
- componentDidLoad() {
44
- themeSwitcher();
45
9
  }
46
10
  render() {
47
- return (h(Host, { style: {
48
- height: '100%',
49
- width: '100%',
50
- } }, h("ix-ag-grid", { gridOptions: this.gridOptions })));
11
+ return h(Host, null);
51
12
  }
52
13
  static get style() { return myComponentCss; }
53
14
  }, [2, "my-component"]);
@@ -55,18 +16,13 @@ function defineCustomElement$1() {
55
16
  if (typeof customElements === "undefined") {
56
17
  return;
57
18
  }
58
- const components = ["my-component", "ix-ag-grid"];
19
+ const components = ["my-component"];
59
20
  components.forEach(tagName => { switch (tagName) {
60
21
  case "my-component":
61
22
  if (!customElements.get(tagName)) {
62
23
  customElements.define(tagName, MyComponent$1);
63
24
  }
64
25
  break;
65
- case "ix-ag-grid":
66
- if (!customElements.get(tagName)) {
67
- defineCustomElement$2();
68
- }
69
- break;
70
26
  } });
71
27
  }
72
28
 
@@ -9,7 +9,6 @@ const NAMESPACE = 'ix-aggrid';
9
9
  * Modified for Stencil's renderer and slot projection
10
10
  */
11
11
  let scopeId;
12
- let isSvgMode = false;
13
12
  let queuePending = false;
14
13
  const createTime = (fnName, tagName = '') => {
15
14
  {
@@ -243,7 +242,6 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
243
242
  */
244
243
  const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
245
244
  if (oldValue !== newValue) {
246
- let isProp = isMemberInElement(elm, memberName);
247
245
  memberName.toLowerCase();
248
246
  if (memberName === 'class') {
249
247
  const classList = elm.classList;
@@ -277,41 +275,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
277
275
  }
278
276
  }
279
277
  }
280
- else {
281
- // Set property if it exists and it's not a SVG
282
- const isComplex = isComplexType(newValue);
283
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
284
- try {
285
- if (!elm.tagName.includes('-')) {
286
- const n = newValue == null ? '' : newValue;
287
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
288
- if (memberName === 'list') {
289
- isProp = false;
290
- }
291
- else if (oldValue == null || elm[memberName] != n) {
292
- elm[memberName] = n;
293
- }
294
- }
295
- else {
296
- elm[memberName] = newValue;
297
- }
298
- }
299
- catch (e) { }
300
- }
301
- if (newValue == null || newValue === false) {
302
- if (newValue !== false || elm.getAttribute(memberName) === '') {
303
- {
304
- elm.removeAttribute(memberName);
305
- }
306
- }
307
- }
308
- else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
309
- newValue = newValue === true ? '' : newValue;
310
- {
311
- elm.setAttribute(memberName, newValue);
312
- }
313
- }
314
- }
278
+ else ;
315
279
  }
316
280
  };
317
281
  const parseClassListRegex = /\s/;
@@ -329,13 +293,13 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
329
293
  // remove attributes no longer present on the vnode by setting them to undefined
330
294
  for (memberName in oldVnodeAttrs) {
331
295
  if (!(memberName in newVnodeAttrs)) {
332
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
296
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined);
333
297
  }
334
298
  }
335
299
  }
336
300
  // add new & update changed attributes
337
301
  for (memberName in newVnodeAttrs) {
338
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
302
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName]);
339
303
  }
340
304
  };
341
305
  /**
@@ -359,7 +323,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
359
323
  elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
360
324
  // add css classes, attrs, props, listeners, etc.
361
325
  {
362
- updateElement(null, newVNode, isSvgMode);
326
+ updateElement(null, newVNode);
363
327
  }
364
328
  if (isDef(scopeId) && elm['s-si'] !== scopeId) {
365
329
  // if there is a scopeId and this is the initial render
@@ -616,7 +580,7 @@ const patch = (oldVNode, newVNode) => {
616
580
  // either this is the first render of an element OR it's an update
617
581
  // AND we already know it's possible it could have changed
618
582
  // this updates the element's css classes, attrs, props, listeners, etc.
619
- updateElement(oldVNode, newVNode, isSvgMode);
583
+ updateElement(oldVNode, newVNode);
620
584
  }
621
585
  }
622
586
  if (oldChildren !== null && newChildren !== null) {
@@ -1109,7 +1073,6 @@ const registerHost = (elm, cmpMeta) => {
1109
1073
  }
1110
1074
  return hostRefs.set(elm, hostRef);
1111
1075
  };
1112
- const isMemberInElement = (elm, memberName) => memberName in elm;
1113
1076
  const consoleError = (e, el) => (0, console.error)(e, el);
1114
1077
  const cmpModules = /*@__PURE__*/ new Map();
1115
1078
  const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
@@ -0,0 +1,37 @@
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-c5cf50e5.js';
2
+ import { G as Grid } from './ag-grid-community.auto.esm-db7de02b.js';
3
+
4
+ const IxAgGrid = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ this.gridOptions = undefined;
8
+ }
9
+ componentDidLoad() {
10
+ this.initializeGrid();
11
+ }
12
+ initializeGrid() {
13
+ if (!this.gridOptions) {
14
+ return;
15
+ }
16
+ if (!this.grid) {
17
+ const gridDiv = this.host.querySelector('div.ag-theme-ix');
18
+ this.grid = new Grid(gridDiv, this.gridOptions);
19
+ }
20
+ }
21
+ disconnectedCallback() {
22
+ var _a;
23
+ (_a = this.grid) === null || _a === void 0 ? void 0 : _a.destroy();
24
+ }
25
+ render() {
26
+ return (h(Host, null, h("div", { style: {
27
+ height: '100%',
28
+ width: '100%',
29
+ }, class: "ag-theme-alpine-dark ag-theme-ix" })));
30
+ }
31
+ get host() { return getElement(this); }
32
+ static get watchers() { return {
33
+ "gridOptions": ["initializeGrid"]
34
+ }; }
35
+ };
36
+
37
+ export { IxAgGrid as ix_ag_grid };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-1ae27f1f.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c5cf50e5.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["ix-ag-grid_2",[[2,"my-component"],[2,"ix-ag-grid",{"gridOptions":[16]}]]]], options);
16
+ return bootstrapLazy([["ix-ag-grid",[[2,"ix-ag-grid",{"gridOptions":[16]}]]],["my-component",[[2,"my-component"]]]], options);
17
17
  });
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-1ae27f1f.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c5cf50e5.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["ix-ag-grid_2",[[2,"my-component"],[2,"ix-ag-grid",{"gridOptions":[16]}]]]], options);
13
+ return bootstrapLazy([["ix-ag-grid",[[2,"ix-ag-grid",{"gridOptions":[16]}]]],["my-component",[[2,"my-component"]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -0,0 +1,15 @@
1
+ import { r as registerInstance, h, H as Host } from './index-c5cf50e5.js';
2
+
3
+ const myComponentCss = ".sc-my-component-h{display:block}";
4
+
5
+ const MyComponent = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ }
9
+ render() {
10
+ return h(Host, null);
11
+ }
12
+ };
13
+ MyComponent.style = myComponentCss;
14
+
15
+ export { MyComponent as my_component };
@@ -1 +1 @@
1
- [class*=ag-theme-ix]{--ag-background-color:transparent;--ag-header-background-color:transparent;--ag-odd-row-background-color:transparent;--ag-row-hover-color:var(--theme-table-data-row--background--hover);--ag-selected-row-background-color:var(--theme-table-data-row--background--selected);--ag-range-selection-background-color:var(--theme-table-data-row--background--selected);--ag-range-selection-border-color:var(--theme-color-input--focus);--ag-header-column-resize-handle-color:var(--theme-table-header-splitter--background);--ag-header-column-resize-handle-height:100%;--ag-header-column-resize-handle-width:1px;--ag-input-focus-box-shadow:none;--ag-input-focus-border-color:var(--theme-color-input--focus);--ag-checkbox-checked-color:var(--theme-color-input--focus);--ag-control-panel-background-color:var(--theme-color-1)}[class*=ag-theme-ix] .ag-checkbox-input{clip:inherit !important;clip-path:inherit !important;height:inherit !important;width:inherit !important;overflow:inherit !important;position:inherit !important;white-space:inherit !important}[class*=ag-theme-ix] .ag-root-wrapper{border:none}[class*=ag-theme-ix] .ag-filter{color:var(--theme-color-std-text);background-color:var(--ag-control-panel-background-color)}[class*=ag-theme-ix] .ag-select-list{color:var(--theme-color-std-text);background-color:var(--ag-control-panel-background-color);font-family:Siemens Sans;font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}[class*=ag-theme-ix] .ag-header-cell .ag-header-cell-resize::after{background-color:transparent}[class*=ag-theme-ix] .ag-header-active .ag-header-cell-resize::after{background-color:var(--ag-header-column-resize-handle-color)}[class*=ag-theme-ix] .ag-icon{color:var(--theme-table-header-sort--color)}[class*=ag-theme-ix] .ag-header-cell-resize::after{transition:background-color 250ms linear}[class*=ag-theme-ix] .ag-header-cell-resize:hover::after{background-color:var(--theme-table-header-splitter--background--hover)}[class*=ag-theme-ix] .ag-row-focus::before{border:1px solid var(--theme-color-input--focus)}[class*=ag-theme-ix] .ag-row-hover:active{background-color:var(--theme-table-data-row--background--active)}[class*=ag-theme-ix] .ag-row-hover.ag-row-selected{background-color:var(--theme-table-data-row--background--selected-hover)}[class*=ag-theme-ix] .ag-row-hover.ag-row-selected:active{background-color:var(--theme-table-data-row--background--selected-active)}[class*=ag-theme-ix] .ag-header-cell{font-family:Siemens Sans;font-size:14px;font-weight:bold;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal;color:var(--theme-table-header-cell--color)}[class*=ag-theme-ix] .ag-cell{font-family:Siemens Sans;font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;letter-spacing:normal;color:var(--theme-table-data-cell--color)}[class*=ag-theme-ix] .ag-filter-wrapper{background-color:var(--theme-color-1)}[class*=ag-theme-ix] .ag-filter-wrapper .ag-checkbox .ag-input-wrapper,[class*=ag-theme-ix] .ag-filter-wrapper .ag-radio-button .ag-input-wrapper{color:var(--theme-color-primary)}
1
+ [class*=ag-theme-ix]{--ag-background-color:transparent;--ag-foreground-color:var(--theme-color-std-text);--ag-secondary-foreground-color:var(--theme-color-std-text);--ag-header-background-color:transparent;--ag-odd-row-background-color:transparent;--ag-row-hover-color:var(--theme-table-data-row--background--hover);--ag-selected-row-background-color:var(--theme-table-data-row--background--selected);--ag-range-selection-background-color:var(--theme-table-data-row--background--selected);--ag-range-selection-border-color:var(--theme-color-input--focus);--ag-header-column-resize-handle-color:var(--theme-table-header-splitter--background);--ag-header-column-resize-handle-height:100%;--ag-header-column-resize-handle-width:1px;--ag-input-focus-box-shadow:none;--ag-input-focus-border-color:var(--theme-color-input--focus);--ag-checkbox-checked-color:var(--theme-color-input--focus);--ag-control-panel-background-color:var(--theme-color-1)}[class*=ag-theme-ix] .ag-input-wrapper input{clip:unset !important;clip-path:unset !important;height:inherit !important;width:inherit !important;overflow:inherit !important;position:inherit !important;white-space:inherit !important}[class*=ag-theme-ix] .ag-root-wrapper{border:none}[class*=ag-theme-ix] .ag-filter{color:var(--theme-color-std-text);background-color:var(--ag-control-panel-background-color)}[class*=ag-theme-ix] .ag-select-list{color:var(--theme-color-std-text);background-color:var(--ag-control-panel-background-color);font-family:Siemens Sans;font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal}[class*=ag-theme-ix] .ag-header-cell .ag-header-cell-resize::after{background-color:transparent}[class*=ag-theme-ix] .ag-header-active .ag-header-cell-resize::after{background-color:var(--ag-header-column-resize-handle-color)}[class*=ag-theme-ix] .ag-icon{color:var(--theme-table-header-sort--color)}[class*=ag-theme-ix] .ag-paging-button{color:var(--theme-btn-invisible-primary--color)}[class*=ag-theme-ix] .ag-paging-button.ag-disabled{color:var(--theme-btn-invisible-primary--color--disabled)}[class*=ag-theme-ix] .ag-paging-button.ag-disabled .ag-icon{color:inherit}[class*=ag-theme-ix] .ag-header-cell-resize::after{transition:background-color 250ms linear}[class*=ag-theme-ix] .ag-header-cell-resize:hover::after{background-color:var(--theme-table-header-splitter--background--hover)}[class*=ag-theme-ix] .ag-row-focus::before{border:1px solid var(--theme-color-input--focus)}[class*=ag-theme-ix] .ag-row-hover:active{background-color:var(--theme-table-data-row--background--active)}[class*=ag-theme-ix] .ag-row-hover.ag-row-selected{background-color:var(--theme-table-data-row--background--selected-hover)}[class*=ag-theme-ix] .ag-row-hover.ag-row-selected:active{background-color:var(--theme-table-data-row--background--selected-active)}[class*=ag-theme-ix] .ag-header-cell{font-family:Siemens Sans;font-size:14px;font-weight:bold;font-stretch:normal;font-style:normal;line-height:1.43;letter-spacing:normal;color:var(--theme-table-header-cell--color)}[class*=ag-theme-ix] .ag-cell{font-family:Siemens Sans;font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;letter-spacing:normal;color:var(--theme-table-data-cell--color)}[class*=ag-theme-ix] .ag-filter-wrapper{background-color:var(--theme-color-1)}[class*=ag-theme-ix] .ag-filter-wrapper .ag-checkbox .ag-input-wrapper,[class*=ag-theme-ix] .ag-filter-wrapper .ag-radio-button .ag-input-wrapper{color:var(--theme-color-primary)}
@@ -1 +1 @@
1
- import{p as o,b as p}from"./p-5c9652cd.js";(()=>{const p=import.meta.url,r={};return""!==p&&(r.resourcesUrl=new URL(".",p).href),o(r)})().then((o=>p([["p-d43d39f0",[[2,"my-component"],[2,"ix-ag-grid",{gridOptions:[16]}]]]],o)));
1
+ import{p,b as o}from"./p-55389b3b.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),p(r)})().then((p=>o([["p-531b1c8d",[[2,"ix-ag-grid",{gridOptions:[16]}]]],["p-cfe2ad1a",[[2,"my-component"]]]],p)));
@@ -0,0 +1 @@
1
+ import{r as i,h as t,H as s,g as e}from"./p-55389b3b.js";import{G as a}from"./p-ea1225ae.js";const r=class{constructor(t){i(this,t),this.gridOptions=void 0}componentDidLoad(){this.initializeGrid()}initializeGrid(){if(this.gridOptions&&!this.grid){const i=this.host.querySelector("div.ag-theme-ix");this.grid=new a(i,this.gridOptions)}}disconnectedCallback(){var i;null===(i=this.grid)||void 0===i||i.destroy()}render(){return t(s,null,t("div",{style:{height:"100%",width:"100%"},class:"ag-theme-alpine-dark ag-theme-ix"}))}get host(){return e(this)}static get watchers(){return{gridOptions:["initializeGrid"]}}};export{r as ix_ag_grid}
@@ -0,0 +1,2 @@
1
+ let t,e=!1;const n={},l=t=>"object"==(t=typeof t)||"function"===t,s=(t,e,...n)=>{let s=null,r=!1,c=!1;const i=[],a=e=>{for(let n=0;n<e.length;n++)s=e[n],Array.isArray(s)?a(s):null!=s&&"boolean"!=typeof s&&((r="function"!=typeof t&&!l(s))&&(s+=""),r&&c?i[i.length-1].t+=s:i.push(r?o(null,s):s),c=r)};if(a(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const u=o(t,null);return u.l=e,i.length>0&&(u.o=i),u},o=(t,e)=>({i:0,u:t,t:e,$:null,o:null,l:null}),r={},c=t=>N(t).m,i=new WeakMap,a=t=>"sc-"+t.h,u=(t,e,n,l)=>{if(n!==l)if(e.toLowerCase(),"class"===e){const e=t.classList,s=$(n),o=$(l);e.remove(...s.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}},f=/\s/,$=t=>t?t.split(f):[],d=(t,e,l,s)=>{const o=11===e.$.nodeType&&e.$.host?e.$.host:e.$,r=t&&t.l||n,c=e.l||n;for(s in r)s in c||u(o,s,r[s],void 0);for(s in c)u(o,s,r[s],c[s])},y=(e,n,l)=>{const s=n.o[l];let o,r,c=0;if(o=s.$=D.createElement(s.u),d(null,s),null!=t&&o["s-si"]!==t&&o.classList.add(o["s-si"]=t),s.o)for(c=0;c<s.o.length;++c)r=y(e,s,c),r&&o.appendChild(r);return o},m=(t,e,n,l,s,o)=>{let r,c=t;for(;s<=o;++s)l[s]&&(r=y(null,n,s),r&&(l[s].$=r,c.insertBefore(r,e)))},h=(t,e,n,l)=>{for(;e<=n;++e)(l=t[e])&&l.$.remove()},p=(t,e)=>t.u===e.u,b=(t,e)=>{const n=e.$=t.$,l=t.o,s=e.o;d(t,e),null!==l&&null!==s?((t,e,n,l)=>{let s,o=0,r=0,c=e.length-1,i=e[0],a=e[c],u=l.length-1,f=l[0],$=l[u];for(;o<=c&&r<=u;)null==i?i=e[++o]:null==a?a=e[--c]:null==f?f=l[++r]:null==$?$=l[--u]:p(i,f)?(b(i,f),i=e[++o],f=l[++r]):p(a,$)?(b(a,$),a=e[--c],$=l[--u]):p(i,$)?(b(i,$),t.insertBefore(i.$,a.$.nextSibling),i=e[++o],$=l[--u]):p(a,f)?(b(a,f),t.insertBefore(a.$,i.$),a=e[--c],f=l[++r]):(s=y(e&&e[r],n,r),f=l[++r],s&&i.$.parentNode.insertBefore(s,i.$));o>c?m(t,null==l[u+1]?null:l[u+1].$,n,l,r,u):r>u&&h(e,o,c)})(n,l,e,s):null!==s?m(n,null,e,s,0,s.length-1):null!==l&&h(l,0,l.length-1)},w=(t,e)=>{e&&!t.p&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.p=e)))},g=(t,e)=>{if(t.i|=16,!(4&t.i))return w(t,t.g),Q((()=>S(t,e)));t.i|=512},S=(t,e)=>{const n=t.S;return O(void 0,(()=>j(t,n,e)))},j=async(t,e,n)=>{const l=t.m,s=l["s-rc"];n&&(t=>{const e=t.j,n=t.m,l=e.i,s=((t,e)=>{let n=a(e);const l=W.get(n);if(t=11===t.nodeType?t:D,l)if("string"==typeof l){let e,s=i.get(t=t.head||t);s||i.set(t,s=new Set),s.has(n)||(e=D.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),s&&s.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(n.getRootNode(),e);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"),2&l&&n.classList.add(s+"-s"))})(t);v(t,e),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>k(t);0===e.length?n():(Promise.all(e).then(n),t.i|=4,e.length=0)}},v=(e,n)=>{try{n=n.render(),e.i&=-17,e.i|=2,((e,n)=>{const l=e.m,c=e.v||o(null,null),i=(t=>t&&t.u===r)(n)?n:s(null,null,n);i.u=null,i.i|=4,e.v=i,i.$=c.$=l,t=l["s-sc"],b(c,i)})(e,n)}catch(t){H(t,e.m)}return null},k=t=>{const e=t.m,n=t.S,l=t.g;64&t.i||(t.i|=64,x(e),M(n,"componentDidLoad"),t.k(e),l||C()),t.p&&(t.p(),t.p=void 0),512&t.i&&K((()=>g(t,!1))),t.i&=-517},C=()=>{x(D.documentElement),K((()=>(t=>{const e=F.ce("appload",{detail:{namespace:"ix-aggrid"}});return t.dispatchEvent(e),e})(q)))},M=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){H(t)}},O=(t,e)=>t&&t.then?t.then(e):e(),x=t=>t.classList.add("hydrated"),P=(t,e,n)=>{if(e.C){t.watchers&&(e.M=t.watchers);const s=Object.entries(e.C),o=t.prototype;s.map((([t,[s]])=>{(31&s||2&n&&32&s)&&Object.defineProperty(o,t,{get(){return((t,e)=>N(this).O.get(e))(0,t)},set(n){((t,e,n,s)=>{const o=N(t),r=o.m,c=o.O.get(e),i=o.i,a=o.S;if(n=(t=>(null==t||l(t),t))(n),(!(8&i)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(o.O.set(e,n),a)){if(s.M&&128&i){const t=s.M[e];t&&t.map((t=>{try{a[t](n,c,e)}catch(t){H(t,r)}}))}2==(18&i)&&g(o,!1)}})(this,t,n,e)},configurable:!0,enumerable:!0})}))}return t},E=(t,e={})=>{const n=[],l=e.exclude||[],s=q.customElements,o=D.head,r=o.querySelector("meta[charset]"),c=D.createElement("style"),i=[];let u,f=!0;Object.assign(F,e),F.P=new URL(e.resourcesUrl||"./",D.baseURI).href,t.map((t=>{t[1].map((e=>{const o={i:e[0],h:e[1],C:e[2],L:e[3]};o.C=e[2],o.M={};const r=o.h,c=class extends HTMLElement{constructor(t){super(t),A(t=this,o)}connectedCallback(){u&&(clearTimeout(u),u=null),f?i.push(this):F.jmp((()=>(t=>{if(0==(1&F.i)){const e=N(t),n=e.j,l=()=>{};if(!(1&e.i)){e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){w(e,e.g=n);break}}n.C&&Object.entries(n.C).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,s)=>{if(0==(32&e.i)){{if(e.i|=32,(s=U(n)).then){const t=()=>{};s=await s,t()}s.isProxied||(n.M=s.watchers,P(s,n,2),s.isProxied=!0);const t=()=>{};e.i|=8;try{new s(e)}catch(t){H(t)}e.i&=-9,e.i|=128,t()}if(s.style){let t=s.style;const e=a(n);if(!W.has(e)){const l=()=>{};((t,e,n)=>{let l=W.get(t);_&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,W.set(t,l)})(e,t,!!(1&n.i)),l()}}}const o=e.g,r=()=>g(e,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,e,n)}l()}})(this)))}disconnectedCallback(){F.jmp((()=>(()=>{0==(1&F.i)&&M(N(this).S,"disconnectedCallback")})()))}componentOnReady(){return N(this).N}};o.T=t[0],l.includes(r)||s.get(r)||(n.push(r),s.define(r,P(c,o,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),o.insertBefore(c,r?r.nextSibling:o.firstChild),f=!1,i.length?i.map((t=>t.connectedCallback())):F.jmp((()=>u=setTimeout(C,30)))},L=new WeakMap,N=t=>L.get(t),T=(t,e)=>L.set(e.S=t,e),A=(t,e)=>{const n={i:0,m:t,j:e,O:new Map};return n.N=new Promise((t=>n.k=t)),t["s-p"]=[],t["s-rc"]=[],L.set(t,n)},H=(t,e)=>(0,console.error)(t,e),R=new Map,U=t=>{const e=t.h.replace(/-/g,"_"),n=t.T,l=R.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(R.set(n,t),t[e])),H)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},W=new Map,q="undefined"!=typeof window?window:{},D=q.document||{head:{}},F={i:0,P:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},V=t=>Promise.resolve(t),_=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),z=[],B=[],G=(t,n)=>l=>{t.push(l),e||(e=!0,n&&4&F.i?K(J):F.raf(J))},I=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){H(t)}t.length=0},J=()=>{I(z),I(B),(e=z.length>0)&&F.raf(J)},K=t=>V().then(t),Q=G(B,!0);export{r as H,E as b,c as g,s as h,V as p,T as r}
@@ -0,0 +1 @@
1
+ import{r as o,h as s,H as r}from"./p-55389b3b.js";const n=class{constructor(s){o(this,s)}render(){return s(r,null)}};n.style=".sc-my-component-h{display:block}";export{n as my_component}
@@ -1,6 +1,3 @@
1
- import { GridOptions } from 'ag-grid-community';
2
1
  export declare class MyComponent {
3
- gridOptions: GridOptions;
4
- componentDidLoad(): void;
5
2
  render(): any;
6
3
  }
@@ -0,0 +1,2 @@
1
+ export * from './page';
2
+ export { themeSwitcher } from './theme-switcher';
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "directory": "packages/aggrid"
9
9
  },
10
10
  "description": "AG Grid theme based on ix theme variables",
11
- "version": "1.2.1",
11
+ "version": "1.3.0-beta.0",
12
12
  "main": "dist/index.cjs.js",
13
13
  "module": "dist/index.js",
14
14
  "es2015": "dist/esm/index.mjs",
@@ -24,10 +24,11 @@
24
24
  "loader/"
25
25
  ],
26
26
  "scripts": {
27
- "build": "stencil build --docs",
27
+ "build": "stencil build",
28
28
  "start": "stencil build --dev --watch --serve",
29
29
  "generate": "stencil generate",
30
- "test:e2e": "playwright test --reporter html"
30
+ "test:e2e": "playwright test --reporter html",
31
+ "host-root": "http-server -a 127.0.0.1"
31
32
  },
32
33
  "dependencies": {
33
34
  "@stencil/core": "~2.19.2"
@@ -38,12 +39,13 @@
38
39
  "jest-cli": "^27.4.5",
39
40
  "puppeteer": "^10.0.0",
40
41
  "ag-grid-community": "^28.0.2",
41
- "@siemens/ix": "~1.2.1",
42
+ "@siemens/ix": "~1.3.0-beta.0",
42
43
  "@stencil/sass": "~2.0.0",
43
- "@playwright/test": "^1.24.1"
44
+ "@playwright/test": "^1.24.1",
45
+ "http-server": "^14.1.1"
44
46
  },
45
47
  "peerDependencies": {
46
48
  "ag-grid-community": "^28.0.2",
47
- "@siemens/ix": "~1.2.1"
49
+ "@siemens/ix": "~1.3.0-beta.0"
48
50
  }
49
51
  }
@@ -1,92 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-bbfdf33e.js');
6
- const agGridCommunity_auto_esm = require('./ag-grid-community.auto.esm-42c6bc63.js');
7
-
8
- const IxAgGrid = class {
9
- constructor(hostRef) {
10
- index.registerInstance(this, hostRef);
11
- this.gridOptions = undefined;
12
- }
13
- componentDidLoad() {
14
- this.initializeGrid();
15
- }
16
- initializeGrid() {
17
- if (!this.gridOptions) {
18
- return;
19
- }
20
- if (!this.grid) {
21
- const gridDiv = this.host.querySelector('div.ag-theme-ix');
22
- this.grid = new agGridCommunity_auto_esm.Grid(gridDiv, this.gridOptions);
23
- }
24
- }
25
- disconnectedCallback() {
26
- var _a;
27
- (_a = this.grid) === null || _a === void 0 ? void 0 : _a.destroy();
28
- }
29
- render() {
30
- return (index.h(index.Host, null, index.h("div", { style: {
31
- height: '100%',
32
- width: '100%',
33
- }, class: "ag-theme-alpine-dark ag-theme-ix" })));
34
- }
35
- get host() { return index.getElement(this); }
36
- static get watchers() { return {
37
- "gridOptions": ["initializeGrid"]
38
- }; }
39
- };
40
-
41
- /*
42
- * SPDX-FileCopyrightText: 2022 Siemens AG
43
- *
44
- * SPDX-License-Identifier: MIT
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */
49
- const themeSwitcher = () => {
50
- const searchParams = new URLSearchParams(location.search);
51
- if (searchParams.has('theme')) {
52
- const theme = searchParams.get('theme');
53
- document.body.className = theme;
54
- }
55
- };
56
-
57
- const myComponentCss = ".sc-my-component-h{display:block}";
58
-
59
- const columnDefs = [
60
- { field: 'make', resizable: true, checkboxSelection: true },
61
- { field: 'model', resizable: true, sortable: true, filter: true },
62
- { field: 'price', resizable: true },
63
- ];
64
- const rowData = [
65
- { make: 'Toyota', model: 'Celica', price: 35000, checked: false },
66
- { make: 'Ford', model: 'Mondeo', price: 32000, checked: true },
67
- { make: 'Porsche', model: 'Boxster', price: 72000, checked: false },
68
- ];
69
- const MyComponent = class {
70
- constructor(hostRef) {
71
- index.registerInstance(this, hostRef);
72
- this.gridOptions = {
73
- columnDefs: columnDefs,
74
- rowData: rowData,
75
- rowSelection: 'multiple',
76
- suppressCellFocus: true,
77
- };
78
- }
79
- componentDidLoad() {
80
- themeSwitcher();
81
- }
82
- render() {
83
- return (index.h(index.Host, { style: {
84
- height: '100%',
85
- width: '100%',
86
- } }, index.h("ix-ag-grid", { gridOptions: this.gridOptions })));
87
- }
88
- };
89
- MyComponent.style = myComponentCss;
90
-
91
- exports.ix_ag_grid = IxAgGrid;
92
- exports.my_component = MyComponent;