@siemens/ix-aggrid 1.2.0-beta.0 → 1.2.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.
@@ -38,6 +38,22 @@ const IxAgGrid = class {
38
38
  }; }
39
39
  };
40
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
+
41
57
  const myComponentCss = ".sc-my-component-h{display:block}";
42
58
 
43
59
  const columnDefs = [
@@ -60,6 +76,9 @@ const MyComponent = class {
60
76
  suppressCellFocus: true,
61
77
  };
62
78
  }
79
+ componentDidLoad() {
80
+ themeSwitcher();
81
+ }
63
82
  render() {
64
83
  return (index.h(index.Host, { style: {
65
84
  height: '100%',
@@ -7,6 +7,7 @@
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
9
  import { h, Host } from '@stencil/core';
10
+ import { themeSwitcher } from '@utils/test/theme-switcher';
10
11
  const columnDefs = [
11
12
  { field: 'make', resizable: true, checkboxSelection: true },
12
13
  { field: 'model', resizable: true, sortable: true, filter: true },
@@ -26,6 +27,9 @@ export class MyComponent {
26
27
  suppressCellFocus: true,
27
28
  };
28
29
  }
30
+ componentDidLoad() {
31
+ themeSwitcher();
32
+ }
29
33
  render() {
30
34
  return (h(Host, { style: {
31
35
  height: '100%',
@@ -6,6 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- export function format(first, middle, last) {
10
- return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
11
- }
9
+ export * from './page';
@@ -0,0 +1,29 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2022 Siemens AG
3
+ *
4
+ * SPDX-License-Identifier: MIT
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { test as base } from '@playwright/test';
10
+ async function extendPageFixture(page, testInfo) {
11
+ const originalGoto = page.goto.bind(page);
12
+ const theme = testInfo.project.metadata.theme;
13
+ testInfo.annotations.push({
14
+ type: theme,
15
+ });
16
+ page.goto = async (url, options) => {
17
+ const response = await originalGoto(`http://127.0.0.1:3333${url}?theme=${theme}`, options);
18
+ // Inital timeout for webKit to render Web Components
19
+ await page.waitForTimeout(1000);
20
+ return response;
21
+ };
22
+ return page;
23
+ }
24
+ export const regressionTest = base.extend({
25
+ page: async ({ page }, use, testInfo) => {
26
+ page = await extendPageFixture(page, testInfo);
27
+ await use(page);
28
+ },
29
+ });
@@ -0,0 +1,15 @@
1
+ /*
2
+ * SPDX-FileCopyrightText: 2022 Siemens AG
3
+ *
4
+ * SPDX-License-Identifier: MIT
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ export const themeSwitcher = () => {
10
+ const searchParams = new URLSearchParams(location.search);
11
+ if (searchParams.has('theme')) {
12
+ const theme = searchParams.get('theme');
13
+ document.body.className = theme;
14
+ }
15
+ };
@@ -1,6 +1,22 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './ix-ag-grid2.js';
3
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
+
4
20
  const myComponentCss = ".sc-my-component-h{display:block}";
5
21
 
6
22
  const columnDefs = [
@@ -24,6 +40,9 @@ const MyComponent$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
24
40
  suppressCellFocus: true,
25
41
  };
26
42
  }
43
+ componentDidLoad() {
44
+ themeSwitcher();
45
+ }
27
46
  render() {
28
47
  return (h(Host, { style: {
29
48
  height: '100%',
@@ -34,6 +34,22 @@ const IxAgGrid = class {
34
34
  }; }
35
35
  };
36
36
 
37
+ /*
38
+ * SPDX-FileCopyrightText: 2022 Siemens AG
39
+ *
40
+ * SPDX-License-Identifier: MIT
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */
45
+ const themeSwitcher = () => {
46
+ const searchParams = new URLSearchParams(location.search);
47
+ if (searchParams.has('theme')) {
48
+ const theme = searchParams.get('theme');
49
+ document.body.className = theme;
50
+ }
51
+ };
52
+
37
53
  const myComponentCss = ".sc-my-component-h{display:block}";
38
54
 
39
55
  const columnDefs = [
@@ -56,6 +72,9 @@ const MyComponent = class {
56
72
  suppressCellFocus: true,
57
73
  };
58
74
  }
75
+ componentDidLoad() {
76
+ themeSwitcher();
77
+ }
59
78
  render() {
60
79
  return (h(Host, { style: {
61
80
  height: '100%',
@@ -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-checkbox-checked-color:var(--theme-color-input--focus)}[class*=ag-theme-ix] .ag-root-wrapper{border:none}[class*=ag-theme-ix] .ag-filter{background-color:var(--ag-control-panel-background-color)}[class*=ag-theme-ix] .ag-select-list{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-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 +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-98f781bb",[[2,"my-component"],[2,"ix-ag-grid",{gridOptions:[16]}]]]],o)));
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 +1 @@
1
- import{r as e,h as i,H as t,g as s}from"./p-5c9652cd.js";import{G as r}from"./p-ea1225ae.js";const o=class{constructor(i){e(this,i),this.gridOptions=void 0}componentDidLoad(){this.initializeGrid()}initializeGrid(){if(this.gridOptions&&!this.grid){const e=this.host.querySelector("div.ag-theme-ix");this.grid=new r(e,this.gridOptions)}}disconnectedCallback(){var e;null===(e=this.grid)||void 0===e||e.destroy()}render(){return i(t,null,i("div",{style:{height:"100%",width:"100%"},class:"ag-theme-alpine-dark ag-theme-ix"}))}get host(){return s(this)}static get watchers(){return{gridOptions:["initializeGrid"]}}},a=[{field:"make",resizable:!0,checkboxSelection:!0},{field:"model",resizable:!0,sortable:!0,filter:!0},{field:"price",resizable:!0}],c=[{make:"Toyota",model:"Celica",price:35e3,checked:!1},{make:"Ford",model:"Mondeo",price:32e3,checked:!0},{make:"Porsche",model:"Boxster",price:72e3,checked:!1}],l=class{constructor(i){e(this,i),this.gridOptions={columnDefs:a,rowData:c,rowSelection:"multiple",suppressCellFocus:!0}}render(){return i(t,{style:{height:"100%",width:"100%"}},i("ix-ag-grid",{gridOptions:this.gridOptions}))}};l.style=".sc-my-component-h{display:block}";export{o as ix_ag_grid,l as my_component}
1
+ import{r as e,h as i,H as t,g as s}from"./p-5c9652cd.js";import{G as o}from"./p-ea1225ae.js";const r=class{constructor(i){e(this,i),this.gridOptions=void 0}componentDidLoad(){this.initializeGrid()}initializeGrid(){if(this.gridOptions&&!this.grid){const e=this.host.querySelector("div.ag-theme-ix");this.grid=new o(e,this.gridOptions)}}disconnectedCallback(){var e;null===(e=this.grid)||void 0===e||e.destroy()}render(){return i(t,null,i("div",{style:{height:"100%",width:"100%"},class:"ag-theme-alpine-dark ag-theme-ix"}))}get host(){return s(this)}static get watchers(){return{gridOptions:["initializeGrid"]}}},c=[{field:"make",resizable:!0,checkboxSelection:!0},{field:"model",resizable:!0,sortable:!0,filter:!0},{field:"price",resizable:!0}],a=[{make:"Toyota",model:"Celica",price:35e3,checked:!1},{make:"Ford",model:"Mondeo",price:32e3,checked:!0},{make:"Porsche",model:"Boxster",price:72e3,checked:!1}],l=class{constructor(i){e(this,i),this.gridOptions={columnDefs:c,rowData:a,rowSelection:"multiple",suppressCellFocus:!0}}componentDidLoad(){(()=>{const e=new URLSearchParams(location.search);if(e.has("theme")){const i=e.get("theme");document.body.className=i}})()}render(){return i(t,{style:{height:"100%",width:"100%"}},i("ix-ag-grid",{gridOptions:this.gridOptions}))}};l.style=".sc-my-component-h{display:block}";export{r as ix_ag_grid,l as my_component}
@@ -1,5 +1,6 @@
1
1
  import { GridOptions } from 'ag-grid-community';
2
2
  export declare class MyComponent {
3
3
  gridOptions: GridOptions;
4
+ componentDidLoad(): void;
4
5
  render(): any;
5
6
  }
@@ -0,0 +1 @@
1
+ export * from './page';
@@ -0,0 +1,3 @@
1
+ export declare const regressionTest: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
2
+ [key: string]: any;
3
+ }, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
@@ -0,0 +1 @@
1
+ export declare const themeSwitcher: () => void;
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.0-beta.0",
11
+ "version": "1.2.1",
12
12
  "main": "dist/index.cjs.js",
13
13
  "module": "dist/index.js",
14
14
  "es2015": "dist/esm/index.mjs",
@@ -26,7 +26,8 @@
26
26
  "scripts": {
27
27
  "build": "stencil build --docs",
28
28
  "start": "stencil build --dev --watch --serve",
29
- "generate": "stencil generate"
29
+ "generate": "stencil generate",
30
+ "test:e2e": "playwright test --reporter html"
30
31
  },
31
32
  "dependencies": {
32
33
  "@stencil/core": "~2.19.2"
@@ -37,11 +38,12 @@
37
38
  "jest-cli": "^27.4.5",
38
39
  "puppeteer": "^10.0.0",
39
40
  "ag-grid-community": "^28.0.2",
40
- "@siemens/ix": "~1.2.0-beta.0",
41
- "@stencil/sass": "~2.0.0"
41
+ "@siemens/ix": "~1.2.1",
42
+ "@stencil/sass": "~2.0.0",
43
+ "@playwright/test": "^1.24.1"
42
44
  },
43
45
  "peerDependencies": {
44
46
  "ag-grid-community": "^28.0.2",
45
- "@siemens/ix": "~1.2.0-beta.0"
47
+ "@siemens/ix": "~1.2.1"
46
48
  }
47
49
  }
@@ -1 +0,0 @@
1
- export declare function format(first: string, middle: string, last: string): string;