globuswebcomponents 1.7.9 → 1.8.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.
@@ -1548,45 +1548,17 @@ const GbThemeTab = class {
1548
1548
  index.registerInstance(this, hostRef);
1549
1549
  this.themetabClicked = index.createEvent(this, "themetabClicked");
1550
1550
  this.currentActiveTab = 'system';
1551
- this.handleSystemThemeChange = (e) => {
1552
- if (this.theme === 'system') {
1553
- this.setTheme(e.matches ? 'dark' : 'light');
1554
- }
1555
- };
1556
- }
1557
- componentWillLoad() {
1558
- const savedTheme = localStorage.getItem('preferred-theme');
1559
- this.theme = savedTheme || 'system';
1560
- this.applyTheme(this.theme);
1561
- if (this.theme === 'system') {
1562
- const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
1563
- mediaQuery.addEventListener('change', this.handleSystemThemeChange);
1564
- }
1565
1551
  }
1566
1552
  tabClicked(mode) {
1567
1553
  this.currentActiveTab = mode;
1568
- // this.themetabClicked.emit(mode);
1569
- }
1570
- applyTheme(theme) {
1571
- let finalTheme = theme;
1572
- if (theme === 'system') {
1573
- finalTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
1574
- }
1575
- document.documentElement.setAttribute('data-theme', finalTheme);
1576
- }
1577
- setTheme(theme) {
1578
- this.currentActiveTab = theme;
1579
- this.theme = theme;
1580
- localStorage.setItem('preferred-theme', theme);
1581
- }
1582
- getSystemTheme() {
1583
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
1554
+ this.themetabClicked.emit(mode);
1555
+ // console.log(mode)
1584
1556
  }
1585
1557
  render() {
1586
1558
  const systemIconSrc = index.getAssetPath(`assets/laptop.svg`);
1587
1559
  const sunSrc = index.getAssetPath(`assets/sun-02.svg`);
1588
1560
  const moonSrc = index.getAssetPath(`assets/moon-02.svg`);
1589
- return (index.h("div", { key: '8187c214ddd6b3b90ae5627d1cbd068c9e001e24', class: `theme_tab_div` }, index.h("div", { key: 'a350b02ccc20fa3f618db3695529f6120c8a9846', class: "tab" }, index.h("gb-icon-button-base", { key: '3da749b2493f3aa2482703f266860b733205b831', current: this.currentActiveTab === 'system' ? true : false, icon: systemIconSrc, label: "System", onClick: () => this.setTheme('system') })), index.h("div", { key: '1c13963cce724a824ae7ff4c59d62dd2b717771e', class: "tab" }, index.h("gb-icon-button-base", { key: '493fb5143905efc7c440a2fac25a57de942bfd6f', current: this.currentActiveTab === 'light' ? true : false, icon: sunSrc, label: "Light", onClick: () => this.setTheme('light') })), index.h("div", { key: 'ae7fd2f339f10db6808668c2544666f9fa8d1c03', class: "tab" }, index.h("gb-icon-button-base", { key: 'cd7641bb38e2a151650edadf9d69ede0488abc10', current: this.currentActiveTab === 'dark' ? true : false, icon: moonSrc, label: "Dark", onClick: () => this.setTheme('dark') }))));
1561
+ return (index.h("div", { key: '381ac3c841cd63864825756866810277cfc248ab', class: `theme_tab_div` }, index.h("div", { key: '185ed74c9e3940fcc9415b9c32b4e59925a5ad71', class: "tab" }, index.h("gb-icon-button-base", { key: '64bdfb15a16f9f50ac47ef98ba155c519d89d511', current: this.currentActiveTab === 'system' ? true : false, icon: systemIconSrc, label: "System", onClick: () => this.tabClicked('system') })), index.h("div", { key: 'ee0ad1a7ea29d52b91d8dc5f92d9d6ae85cd69b0', class: "tab" }, index.h("gb-icon-button-base", { key: 'bbc8a048fa489f8f7b6380300979ec03b70192d3', current: this.currentActiveTab === 'light' ? true : false, icon: sunSrc, label: "Light", onClick: () => this.tabClicked('light') })), index.h("div", { key: '9506f0f59c8ef83a635a8dc207efa78836dbcba2', class: "tab" }, index.h("gb-icon-button-base", { key: '2c3048fb3c857406fa8e8f677bcf6d6c0251356f', current: this.currentActiveTab === 'dark' ? true : false, icon: moonSrc, label: "Dark", onClick: () => this.tabClicked('dark') }))));
1590
1562
  }
1591
1563
  };
1592
1564
  GbThemeTab.style = gbThemeTabCss;