@e1011/es-kit 1.0.171 → 1.0.174
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.
- package/dist/hooks/_virtual/{shared.js → shared-store.js} +1 -1
- package/dist/hooks/_virtual/shared-store.js.map +1 -0
- package/dist/{lib/esm/_virtual/shared.js → hooks/esm/_virtual/shared-store.js} +1 -1
- package/dist/hooks/esm/_virtual/shared-store.js.map +1 -0
- package/dist/hooks/esm/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/hooks/esm/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/hooks/esm/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/hooks/esm/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/hooks/esm/node_modules/core-js/internals/shared.js +1 -1
- package/dist/hooks/esm/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/hooks/esm/src/core/hooks/useThemePreference.js +1 -1
- package/dist/hooks/esm/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/inspect-source.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/inspect-source.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/internal-state.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/internal-state.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared-key.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared-key.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/hooks/node_modules/core-js/internals/well-known-symbol.js +1 -1
- package/dist/hooks/node_modules/core-js/internals/well-known-symbol.js.map +1 -1
- package/dist/hooks/src/core/hooks/useThemePreference.js +1 -1
- package/dist/hooks/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/cjs/_virtual/{shared.js → shared-store.js} +1 -1
- package/dist/lib/cjs/_virtual/shared-store.js.map +1 -0
- package/dist/lib/cjs/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/inspect-source.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/inspect-source.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/internal-state.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/internal-state.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/regexp-exec.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/regexp-exec.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared-key.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared-key.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/well-known-symbol.js +1 -1
- package/dist/lib/cjs/node_modules/core-js/internals/well-known-symbol.js.map +1 -1
- package/dist/lib/cjs/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/cjs/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/cjs/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/cjs/src/index.js +1 -1
- package/dist/{ui/esm/_virtual/shared.js → lib/esm/_virtual/shared-store.js} +1 -1
- package/dist/lib/esm/_virtual/shared-store.js.map +1 -0
- package/dist/lib/esm/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/lib/esm/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/lib/esm/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/lib/esm/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/lib/esm/node_modules/core-js/internals/shared.js +1 -1
- package/dist/lib/esm/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/lib/esm/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/esm/src/core/hooks/useThemePreference.js.map +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/lib/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/esm/src/index.js +1 -1
- package/dist/lib/src/core/hooks/useThemePreference.js +1 -1
- package/dist/lib/src/core/ui/components/icon/IconWC.js +8 -8
- package/dist/lib/src/core/utils/appState/store/store.vanillajs.js +8 -1
- package/dist/lib/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/ui/components/icon/IconWC.d.ts +3 -3
- package/dist/types/src/core/utils/appState/store/store.vanillajs.d.ts +2 -1
- package/dist/types/src/core/utils/appState/store/store.vanillajs.d.ts.map +1 -1
- package/dist/ui/_virtual/{shared.js → shared-store.js} +1 -1
- package/dist/ui/_virtual/shared-store.js.map +1 -0
- package/dist/{hooks/esm/_virtual/shared.js → ui/esm/_virtual/shared-store.js} +1 -1
- package/dist/ui/esm/_virtual/shared-store.js.map +1 -0
- package/dist/ui/esm/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/ui/esm/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/ui/esm/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/ui/esm/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/ui/esm/node_modules/core-js/internals/shared.js +1 -1
- package/dist/ui/esm/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/esm/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/esm/src/core/ui/index.js +1 -1
- package/dist/ui/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/ui/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/inspect-source.js +1 -1
- package/dist/ui/node_modules/core-js/internals/inspect-source.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/internal-state.js +1 -1
- package/dist/ui/node_modules/core-js/internals/internal-state.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/regexp-exec.js +1 -1
- package/dist/ui/node_modules/core-js/internals/regexp-exec.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/shared-key.js +1 -1
- package/dist/ui/node_modules/core-js/internals/shared-key.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/ui/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/shared.js +1 -1
- package/dist/ui/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/ui/node_modules/core-js/internals/well-known-symbol.js +1 -1
- package/dist/ui/node_modules/core-js/internals/well-known-symbol.js.map +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js +1 -1
- package/dist/ui/src/core/ui/components/icon/IconWC.js.map +1 -1
- package/dist/ui/src/core/ui/index.js +1 -1
- package/dist/utils/_virtual/{shared.js → shared-store.js} +1 -1
- package/dist/utils/_virtual/shared-store.js.map +1 -0
- package/dist/utils/esm/_virtual/{shared.js → shared-store.js} +1 -1
- package/dist/utils/esm/_virtual/shared-store.js.map +1 -0
- package/dist/utils/esm/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/utils/esm/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/utils/esm/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/utils/esm/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/utils/esm/node_modules/core-js/internals/shared.js +1 -1
- package/dist/utils/esm/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/array-includes.js +1 -1
- package/dist/utils/node_modules/core-js/internals/array-includes.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/inspect-source.js +1 -1
- package/dist/utils/node_modules/core-js/internals/inspect-source.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/internal-state.js +1 -1
- package/dist/utils/node_modules/core-js/internals/internal-state.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/regexp-exec.js +1 -1
- package/dist/utils/node_modules/core-js/internals/regexp-exec.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/shared-key.js +1 -1
- package/dist/utils/node_modules/core-js/internals/shared-key.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/shared-store.js +1 -1
- package/dist/utils/node_modules/core-js/internals/shared-store.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/shared.js +1 -1
- package/dist/utils/node_modules/core-js/internals/shared.js.map +1 -1
- package/dist/utils/node_modules/core-js/internals/well-known-symbol.js +1 -1
- package/dist/utils/node_modules/core-js/internals/well-known-symbol.js.map +1 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/package.json +1 -1
- package/dist/hooks/_virtual/shared.js.map +0 -1
- package/dist/hooks/esm/_virtual/shared.js.map +0 -1
- package/dist/lib/cjs/_virtual/shared.js.map +0 -1
- package/dist/lib/esm/_virtual/shared.js.map +0 -1
- package/dist/ui/_virtual/shared.js.map +0 -1
- package/dist/ui/esm/_virtual/shared.js.map +0 -1
- package/dist/utils/_virtual/shared.js.map +0 -1
- package/dist/utils/esm/_virtual/shared.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\n const oldClass = isDark ? baseThemes.light : baseThemes.dark\n const newClass = isDark ? baseThemes.dark : baseThemes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\n const oldClass = isDark ? baseThemes.light : baseThemes.dark\n const newClass = isDark ? baseThemes.dark : baseThemes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('esmf-wrapper').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n\n const firstChild: HTMLElement = element.shadowRoot?.childNodes[0] as HTMLElement\n\n if (firstChild) {\n firstChild.classList.add(newClass)\n firstChild.classList.remove(oldClass)\n }\n })\n }\n }\n}\n\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(baseThemes.dark)\n }\n switchColorTheme(resolvedIsDark, htmlElement || document.body)\n}\n"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains","useEffect"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t,i=require("../../../utils/webComponents/webComponent.utils.js"),e=require("./icon.module.scss.js");const s=document.createElement("template");s.innerHTML='<span class="icon-base"></span>';let n=i.ced("icon-base")(t=class t extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e.default["icon-base-parent"]),this.mainElement.classList.add(e.default["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=s.innerHTML,i.resolveAttributes(this,t.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||t;const o={
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");var t,i=require("../../../utils/webComponents/webComponent.utils.js"),e=require("./icon.module.scss.js");const s=document.createElement("template");s.innerHTML='<span class="icon-base"></span>';let n=i.ced("icon-base")(t=class t extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e.default["icon-base-parent"]),this.mainElement.classList.add(e.default["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=s.innerHTML,i.resolveAttributes(this,t.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||t;const o={ESIconBase:n};exports.ESIcon=n,exports.ESIconBase=o;
|
|
2
2
|
//# sourceMappingURL=IconWC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class
|
|
1
|
+
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes() {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback() {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null) {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = () => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","styles","concat","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"oQAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAAA,IAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAAA,QAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAO,QAAC,cAEvC,MAAMC,EAAS,CACb,cAAehB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,MAC5DT,KAAKG,QAAU,CAAE,aAAYc,OAAAA,OAASjB,KAAKG,QAAO,MAAQ,MAC1DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYgB,aAAa,QAASC,OAAOC,QAAQJ,GAAQK,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAA,GAAAL,OAAQM,EAAGN,MAAAA,OAAKO,EAAK,IAAA,IAAKC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM3B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK4B,aAAa,YAGrE5B,KAAKT,UAAYH,EAASG,UAE1BsC,EAAAA,kBAAkB7B,KAAMR,EAAOkC,oBAE/B1B,KAAKW,QACP,CAEAmB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACTjC,KAAKa,UAAUqB,OAAOD,GACtBjC,KAAKa,UAAUC,IAAImB,IAGlBjC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK+B,GAAaE,GAAqB,GACvCjC,KAAKW,QACP,KAwBDhB,EAWM,MAAMwC,EAAa,CACxBA,WAAY3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");exports.createStore=(r,t,o)=>{var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js");exports.createStore=(r,t,o)=>{var s;let l=r;const n=new Set,u=()=>l,c=function(){var r=e.asyncToGenerator((function*(e){l=e;for(const e of n){const r=null==e?void 0:e.selector,t=r?r(l):l;void 0!==e.previousValue&&e.previousValue===t||(e.previousValue=t,yield e(t))}return l}));return function(e){return r.apply(this,arguments)}}(),i={getState:u,setState:c,subscribe:(e,r)=>{if(r&&e.selector&&e.selector!==r)throw new Error("Error, mismatchm selector, listener.selector !== selector.");return r&&!e.selector&&(e.selector=r),n.add(e),()=>n.delete(e)},unsubscribe:e=>{n.delete(e)}},a=t?null===(s=Object.entries(t))||void 0===s?void 0:s.reduce(((r,t)=>{let[s,l]=t;return{...r,[s]:e.asyncToGenerator((function*(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];const n=yield l(u,c,...r);return o&&c(o(u(),s,...r)),n}))}}),{}):null,d={...i,...a?{actions:{...a}}:{}};return d};
|
|
2
2
|
//# sourceMappingURL=store.vanillajs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Record<string, ActionHandler<T>>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = () => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Record<string, ActionHandlerCaller<T>> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async(...rest: unknown[]) => {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n return resultOfAction\n },\n }),\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","_len","length","rest","Array","_key","resultOfAction","storeCombinedWithActions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @param selector - Optional selector function to transform the store state.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Record<string, ActionHandler<T>>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = () => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => {\n if (selector && listener.selector && listener.selector !== selector) {\n throw new Error('Error, mismatchm selector, listener.selector !== selector.')\n }\n if (selector && !listener.selector) {\n // eslint-disable-next-line no-param-reassign\n listener.selector = selector\n }\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Record<string, ActionHandlerCaller<T>> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async(...rest: unknown[]) => {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n return resultOfAction\n },\n }),\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","Error","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","_len","length","rest","Array","_key","resultOfAction","storeCombinedWithActions"],"mappings":"qPA2F2BA,CACzBC,EACAC,EACAC,KACmC,IAAAC,EACnC,IAAIC,EAA2BJ,EAC/B,MAAMK,EAAY,IAAIC,IAMhBC,EAAWA,IAAMH,EAQjBI,EAAQ,WAAA,IAAAC,EAAAC,oBAAG,UAAOC,GACtBP,EAAeO,EAGf,IAAK,MAAMC,KAAYP,EAAW,CAEhC,MAAMQ,EAAoCD,aAAAA,EAAAA,EAAUC,SAM9CC,EAAiCD,EAAWA,EAAST,GAAgBA,OAG5CW,IAA3BH,EAASI,eAA+BJ,EAASI,gBAAkBF,IACrEF,EAASI,cAAgBF,QAEnBF,EAASE,GAEnB,CACA,OAAOV,KACR,OAtBKI,SAAQS,GAAA,OAAAR,EAAAS,MAAAC,KAAAC,UAAA,EAAA,GA2BRC,EAA2B,CAK/Bd,WAMAC,WAMAc,UAAWA,CAACV,EAAuBC,KACjC,GAAIA,GAAYD,EAASC,UAAYD,EAASC,WAAaA,EACzD,MAAM,IAAIU,MAAM,8DAOlB,OALIV,IAAaD,EAASC,WAExBD,EAASC,SAAWA,GAEtBR,EAAUmB,IAAIZ,GACP,IAAMP,EAAUoB,OAAOb,EAAS,EAMzCc,YAAcd,IACZP,EAAUoB,OAAOb,EAAS,GAOxBe,EACF1B,EAAiCE,QAA1BA,EAAGyB,OAAOC,QAAQ5B,cAAQE,SAAvBA,EAAyB2B,QACnC,CACEC,EAAkDC,KAAA,IACjDC,EAAYC,GAA0CF,EAAA,MACnD,IACDD,EACHE,CAACA,GAAUvB,EAAAA,kBAAG,YAA6B,IAAA,IAAAyB,EAAAf,UAAAgB,OAApBC,EAAIC,IAAAA,MAAAH,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,GAAAnB,UAAAmB,GACzB,MAAMC,QAAuBN,EAAc3B,EAAUC,KAAa6B,GAKlE,OAHInC,GACFM,EAASN,EAAQK,IAAY0B,KAAeI,IAEvCG,KAEV,GACD,CAAA,GACE,KAKAC,EAA2B,IAC5BpB,KACCM,EAAkB,CAAE1B,QAAS,IAAK0B,IAAsB,IAG9D,OACIc,CACoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core/hooks/useApi.js"),r=require("./core/hooks/useToggle.js"),t=require("./core/hooks/useTranslations.js"),o=require("./core/hooks/useOutsideClick.js"),s=require("./core/hooks/useResize.js"),i=require("./core/hooks/useClassNames.js"),a=require("./core/hooks/useParseProps.js"),l=require("./core/hooks/useThemePreference.js"),p=require("./core/utils/helpers/birthnumber.validator.js"),n=require("./core/utils/helpers/birthnumberCZSKvalidator.js"),c=require("./core/utils/helpers/fileValidator.js"),u=require("./core/utils/helpers/date.js"),x=require("./core/utils/helpers/deviceInfo.js"),m=require("./core/utils/helpers/emailMatcher.js"),d=require("./core/utils/helpers/file.js"),h=require("./core/utils/helpers/objectOperations.js"),T=require("./core/utils/helpers/other.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core/hooks/useApi.js"),r=require("./core/hooks/useToggle.js"),t=require("./core/hooks/useTranslations.js"),o=require("./core/hooks/useOutsideClick.js"),s=require("./core/hooks/useResize.js"),i=require("./core/hooks/useClassNames.js"),a=require("./core/hooks/useParseProps.js"),l=require("./core/hooks/useThemePreference.js"),p=require("./core/utils/helpers/birthnumber.validator.js"),n=require("./core/utils/helpers/birthnumberCZSKvalidator.js"),c=require("./core/utils/helpers/fileValidator.js"),u=require("./core/utils/helpers/date.js"),x=require("./core/utils/helpers/deviceInfo.js"),m=require("./core/utils/helpers/emailMatcher.js"),d=require("./core/utils/helpers/file.js"),h=require("./core/utils/helpers/objectOperations.js"),T=require("./core/utils/helpers/other.js"),j=require("./core/utils/helpers/textValueOperations.js"),C=require("./core/utils/helpers/valueOperations.js"),S=require("./core/utils/helpers/cancelableDelayedFunction.js"),v=require("./core/utils/helpers/ui.js"),b=require("./core/utils/keyExtractor.js"),g=require("./core/utils/date.js"),F=require("./core/utils/webComponents/webComponent.utils.js"),q=require("./core/utils/appState/store/store.vanillajs.js"),f=require("./core/utils/appState/store/store.vanillajs.templates.js"),y=require("./core/utils/appState/store/useStore.react.js"),D=require("./core/constants/ui.constants.js"),I=require("./core/ui/utils/style.js"),z=require("./core/ui/components/container/LayoutBox.js"),O=require("./core/ui/components/container/layoutBox.types.js"),P=require("./core/ui/components/container/Flex.js"),V=require("./core/ui/components/container/Placeholder.js"),N=require("./core/ui/components/container/CollapsibleContainer.js"),k=require("./core/ui/components/container/ResizableContainer.js"),R=require("./core/ui/components/field/Field.js"),E=require("./core/ui/components/dividers/DividerLine.js"),L=require("./core/ui/components/icon/IconBase.js"),A=require("./core/ui/components/icon/Icon.js"),B=require("./core/ui/components/icon/IconWC.js");exports.useApi=e.useApi,exports.useToggle=r.useToggle,exports.createSafeT=t.createSafeT,exports.setUseTranslation=t.setUseTranslation,exports.useTranslations=t.useTranslations,exports.outsideClickHandler=o.outsideClickHandler,exports.useOutsideClick=o.useOutsideClick,exports.useResize=s.useResize,exports.useClassNames=i.useClassNames,exports.useParseProps=a.useParseProps,exports.baseThemes=l.baseThemes,exports.observeThemePreference=l.observeThemePreference,exports.switchColorTheme=l.switchColorTheme,exports.updateColorTheme=l.updateColorTheme,exports.useThemePreference=l.useThemePreference,exports.isBirthNumberValid=p.isBirthNumberValid,exports.getMatch=n.getMatch,exports.isValidFormat=n.isValidFormat,exports.isValidModulo11=n.isValidModulo11,exports.parse=n.parse,exports.regex=n.regex,exports.parseCSVdata=c.parseCSVdata,exports.validateCSVFile=c.validateCSVFile,exports.validateCSVlines=c.validateCSVlines,exports.validateJSONFile=c.validateJSONFile,exports.validateLineCellTrimmed=c.validateLineCellTrimmed,exports.validateLineNumColumns=c.validateLineNumColumns,exports.validateSDFFile=c.validateSDFFile,exports.DATE_FORMAT=u.DATE_FORMAT,exports.formatDateToTimestamp=u.formatDateToTimestamp,exports.getDate=u.getDate,exports.getDeviceId=x.getDeviceId,exports.emailMatch=m.emailMatch,exports.emailMatcher=m.emailMatcher,exports.regexBuilder=m.regexBuilder,exports.cleanCsvLines=d.cleanCsvLines,exports.formatFilePath=d.formatFilePath,exports.arrayToObjectTree=h.arrayToObjectTree,exports.chunkArray=h.chunkArray,exports.duplicatesInArray=h.duplicatesInArray,exports.formatJsonString=h.formatJsonString,exports.formatObj=h.formatObj,exports.formatObj2=h.formatObj2,exports.debounce=T.debounce,exports.delay=T.delay,exports.memoize=T.memoize,exports.memoizeComplex=T.memoizeComplex,exports.memoizer=T.memoizer,exports.nestedTernary=T.nestedTernary,exports.escapeRegExp=j.escapeRegExp,exports.fileNameExt=j.fileNameExt,exports.findStringInText=j.findStringInText,exports.normalizeString=j.normalizeString,exports.removeWhitespaces=j.removeWhitespaces,exports.sanitizeId=j.sanitizeId,exports.sanitizePathId=j.sanitizePathId,exports.toLowerCase=j.toLowerCase,exports.toUpperCase=j.toUpperCase,exports.truncateText=j.truncateText,exports.Operation=C.Operation,exports.decrementValue=C.decrementValue,exports.incerementValue=C.incerementValue,exports.numberDefined=C.numberDefined,exports.numberOperation=C.numberOperation,exports.restrictNumberInLimits=C.restrictNumberInLimits,exports.setValue=C.setValue,exports.cancelableSetInterval=S.cancelableSetInterval,exports.cancelableSetTimeout=S.cancelableSetTimeout,exports.classNames=v.classNames,exports.mapSerReplacer=v.mapSerReplacer,exports.noop=v.noop,exports.parseProps=v.parseProps,exports.keyExtractor=b.keyExtractor,exports.keyExtractorFunction=b.keyExtractorFunction,exports.dateRangeFormat=g.dateRangeFormat,exports.getDateTime=g.getDateTime,exports.getTimeFromNow=g.getTimeFromNow,exports.getTimeFromNowOriginal=g.getTimeFromNowOriginal,exports.getTimeTo=g.getTimeTo,exports.ced=F.ced,exports.createResolveAttribute=F.createResolveAttribute,exports.customElementDefine=F.customElementDefine,exports.resolveAttributes=F.resolveAttributes,exports.createStore=q.createStore,exports.createDataStore=f.createDataStore,exports.useStore=y.useStore,exports.useStoreApi=y.useStoreApi,exports.EventName=D.EventName,exports.calculateColors=I.calculateColors,exports.calculatePercColor=I.calculatePercColor,exports.convertHex=I.convertHex,exports.convertRGB=I.convertRGB,Object.defineProperty(exports,"defaultFontSize",{enumerable:!0,get:function(){return I.defaultFontSize}}),exports.pxToRem=I.pxToRem,exports.resolveStyleValue=I.resolveStyleValue,exports.setDefaultFontSize=I.setDefaultFontSize,exports.toHex=I.toHex,exports.LayoutBox=z.LayoutBox,exports.LayoutDirection=O.LayoutDirection,exports.Flex=P.Flex,exports.FlexTight=P.FlexTight,exports.FlexTightStyled=P.FlexTightStyled,exports.FlexWrapper=P.FlexWrapper,exports.Placeholder=V.Placeholder,exports.CollapsibleContainer=N.CollapsibleContainer,exports.ResizableContainer=k.ResizableContainer,exports.Field=R.Field,exports.FieldWrapper=R.FieldWrapper,exports.Select=R.Select,exports.setIconColor=R.setIconColor,exports.setIconComponent=R.setIconComponent,exports.DividerHorizontal=E.DividerHorizontal,exports.DividerLine=E.DividerLine,exports.DividerVertical=E.DividerVertical,exports.IconBase=L.IconBase,exports.Icon=A.Icon,exports.ESIcon=B.ESIcon,exports.ESIconBase=B.ESIconBase;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e={exports:{}};export{e as __module};
|
|
2
|
-
//# sourceMappingURL=shared.js.map
|
|
2
|
+
//# sourceMappingURL=shared-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-store.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as r}from"./to-indexed-object.js";import{t}from"./to-absolute-index.js";import{l as e}from"./length-of-array-like.js";var o=r,i=t,n=e,f=function(r){return function(t,e,f){var a
|
|
1
|
+
import{t as r}from"./to-indexed-object.js";import{t}from"./to-absolute-index.js";import{l as e}from"./length-of-array-like.js";var o=r,i=t,n=e,f=function(r){return function(t,e,f){var a=o(t),s=n(a);if(0===s)return!r&&-1;var u,l=i(f,s);if(r&&e!=e){for(;s>l;)if((u=a[l++])!=u)return!0}else for(;s>l;l++)if((r||l in a)&&a[l]===e)return r||l||0;return!r&&-1}},a={includes:f(!0),indexOf:f(!1)};export{a};
|
|
2
2
|
//# sourceMappingURL=array-includes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-includes.js","sources":["../../../../../../node_modules/core-js/internals/array-includes.js"],"sourcesContent":["'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n"],"names":["toIndexedObject","require$$0","toAbsoluteIndex","require$$1","lengthOfArrayLike","require$$2","createMethod","IS_INCLUDES","$this","el","fromIndex","
|
|
1
|
+
{"version":3,"file":"array-includes.js","sources":["../../../../../../node_modules/core-js/internals/array-includes.js"],"sourcesContent":["'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n if (length === 0) return !IS_INCLUDES && -1;\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n"],"names":["toIndexedObject","require$$0","toAbsoluteIndex","require$$1","lengthOfArrayLike","require$$2","createMethod","IS_INCLUDES","$this","el","fromIndex","O","length","value","index","arrayIncludes","includes","indexOf"],"mappings":"+HACA,IAAIA,EAAkBC,EAClBC,EAAkBC,EAClBC,EAAoBC,EAGpBC,EAAe,SAAUC,GAC3B,OAAO,SAAUC,EAAOC,EAAIC,GAC1B,IAAIC,EAAIX,EAAgBQ,GACpBI,EAASR,EAAkBO,GAC/B,GAAe,IAAXC,EAAc,OAAQL,IAAgB,EAC1C,IACIM,EADAC,EAAQZ,EAAgBQ,EAAWE,GAIvC,GAAIL,GAAeE,GAAOA,GAAI,KAAOG,EAASE,GAG5C,IAFAD,EAAQF,EAAEG,OAEID,EAAO,OAAO,OAEvB,KAAMD,EAASE,EAAOA,IAC3B,IAAKP,GAAeO,KAASH,IAAMA,EAAEG,KAAWL,EAAI,OAAOF,GAAeO,GAAS,EACnF,OAAQP,IAAgB,CAC9B,CACA,EAEAQ,EAAiB,CAGfC,SAAUV,GAAa,GAGvBW,QAASX,GAAa"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as r}from"./global.js";import{d as
|
|
1
|
+
import{__module as o}from"../../../_virtual/shared-store.js";import{g as r}from"./global.js";import{d as s}from"./define-global-property.js";var e=r,i=s,t="__core-js_shared__",a=o.exports=e[t]||i(t,{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"});var l=o.exports;export{l as s};
|
|
2
2
|
//# sourceMappingURL=shared-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-store.js","sources":["../../../../../../node_modules/core-js/internals/shared-store.js"],"sourcesContent":["'use strict';\nvar
|
|
1
|
+
{"version":3,"file":"shared-store.js","sources":["../../../../../../node_modules/core-js/internals/shared-store.js"],"sourcesContent":["'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar globalThis = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});\n\n(store.versions || (store.versions = [])).push({\n version: '3.36.0',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n"],"names":["globalThis","require$$1","defineGlobalProperty","require$$2","SHARED","store","sharedStoreModule","exports","versions","push","version","mode","copyright","license","source"],"mappings":"6IAEA,IAAIA,EAAaC,EACbC,EAAuBC,EAEvBC,EAAS,qBACTC,EAAQC,EAAcC,QAAGP,EAAWI,IAAWF,EAAqBE,EAAQ,CAAA,IAE/EC,EAAMG,WAAaH,EAAMG,SAAW,KAAKC,KAAK,CAC7CC,QAAS,SACTC,KAAyB,SACzBC,UAAW,4CACXC,QAAS,2DACTC,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as r}from"./shared-store.js";var s=r,o=function(r,o){return s[r]||(s[r]=o||{})};export{o as s};
|
|
2
2
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sources":["../../../../../../node_modules/core-js/internals/shared.js"],"sourcesContent":["'use strict';\nvar
|
|
1
|
+
{"version":3,"file":"shared.js","sources":["../../../../../../node_modules/core-js/internals/shared.js"],"sourcesContent":["'use strict';\nvar store = require('../internals/shared-store');\n\nmodule.exports = function (key, value) {\n return store[key] || (store[key] = value || {});\n};\n"],"names":["store","require$$0","shared","key","value"],"mappings":"sCACA,IAAIA,EAAQC,EAEZC,EAAiB,SAAUC,EAAKC,GAC9B,OAAOJ,EAAMG,KAASH,EAAMG,GAAOC,GAAS,CAAA,EAC9C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("
|
|
1
|
+
import{useEffect as e}from"react";const o="change",t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;const c=o=>{const c=e();null==r||r(o,c),null==t||t(o)},d=e=>{c(e.matches)},l=e=>{c(!e.matches)},s=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}catch(e){}return c(null==s?void 0:s.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").addEventListener(o,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(o,d),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(o,l)}},c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>document.body,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;e((()=>t(o,c)),[o,c])},d={dark:"theme-dark",light:"theme-light"},r=function(e,o){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const c=e?d.light:d.dark,r=e?d.dark:d.light;o&&(o.classList.remove(c),o.classList.remove(r),o.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(c)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(c))})),t&&(document.querySelectorAll(".shadow-div").forEach((e=>{var o,t;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var o,t,d;null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(c)))||void 0===o||o.classList.add(r),null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(c)))||void 0===t||t.classList.remove(c);const l=null===(d=e.shadowRoot)||void 0===d?void 0:d.childNodes[0];l&&(l.classList.add(r),l.classList.remove(c))}))))},l=(e,o)=>{let t=e||!1;"undefined"!=typeof document&&void 0===e&&(t=document.body.classList.contains(d.dark)),r(t,o||document.body)};export{d as baseThemes,t as observeThemePreference,r as switchColorTheme,l as updateColorTheme,c as useThemePreference};
|
|
2
2
|
//# sourceMappingURL=useThemePreference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\n const oldClass = isDark ? baseThemes.light : baseThemes.dark\n const newClass = isDark ? baseThemes.dark : baseThemes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('
|
|
1
|
+
{"version":3,"file":"useThemePreference.js","sources":["../../../../../../src/core/hooks/useThemePreference.ts"],"sourcesContent":["import { useEffect } from 'react'\n\n\nconst windowMatchMediaChangeEventType = 'change'\n\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n const switchColorThemeHandler = (isDark: boolean) => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent) => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n\nexport const useThemePreference = (\n getHtmlElement: () => HTMLElement = () => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean) => isDark,\n) => {\n useEffect(() => observeThemePreference(getHtmlElement, switchCallback), [getHtmlElement, switchCallback])\n}\n\n\nexport const baseThemes: {\n dark: string\n light: string\n} = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\nexport const switchColorTheme = (isDark: boolean, htmlElement?: HTMLElement, findShadows = true) => {\n const oldClass = isDark ? baseThemes.light : baseThemes.dark\n const newClass = isDark ? baseThemes.dark : baseThemes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('esmf-wrapper').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n\n const firstChild: HTMLElement = element.shadowRoot?.childNodes[0] as HTMLElement\n\n if (firstChild) {\n firstChild.classList.add(newClass)\n firstChild.classList.remove(oldClass)\n }\n })\n }\n }\n}\n\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement) => {\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(baseThemes.dark)\n }\n switchColorTheme(resolvedIsDark, htmlElement || document.body)\n}\n"],"names":["windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","arguments","length","undefined","document","body","switchCallback","isDark","switchColorThemeHandler","htmlElement","switchColorTheme","changeDarkColorThemeHandler","event","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener","useThemePreference","useEffect","baseThemes","dark","light","findShadows","oldClass","newClass","classList","remove","add","querySelectorAll","concat","forEach","element","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","resolvedIsDark","contains"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import{resolveAttributes as t,ced as i}from"../../../utils/webComponents/webComponent.utils.js";import e from"./icon.module.scss.js";var s;const n=document.createElement("template");n.innerHTML='<span class="icon-base"></span>';let o=i("icon-base")(s=class i extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e["icon-base-parent"]),this.mainElement.classList.add(e["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=n.innerHTML,t(this,i.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||s;const h={
|
|
1
|
+
import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import{resolveAttributes as t,ced as i}from"../../../utils/webComponents/webComponent.utils.js";import e from"./icon.module.scss.js";var s;const n=document.createElement("template");n.innerHTML='<span class="icon-base"></span>';let o=i("icon-base")(s=class i extends HTMLElement{constructor(){super(...arguments),this.content=void 0,this.mainElement=void 0,this.iconUrl=void 0,this.minWidth=void 0,this.minHeight=void 0,this.width=void 0,this.height=void 0,this.size=void 0,this.fontSize=void 0,this.color=void 0,this.render=()=>{if(this.mainElement=this.mainElement||this.querySelector(".icon-base"),!this.mainElement)return;this.classList.add(e["icon-base-parent"]),this.mainElement.classList.add(e["icon-base"]);const t={"--min-width":this.minWidth||this.size||this.width||"auto","--min-height":this.minHeight||this.size||this.height||"auto","--width":this.size||this.width||"1rem","--height":this.size||this.height||"1rem",...this.fontSize?{"font-size":this.fontSize||"unset"}:{},...this.iconUrl?{"--icon-url":"url(".concat(this.iconUrl,")")}:{},...this.iconUrl?{"--icon-color":this.color}:{"--icon-content-color":this.color}};this.mainElement.innerHTML=this.iconUrl?"":this.content||"",this.mainElement.setAttribute("style",Object.entries(t).map((t=>{let[i,e]=t;return"".concat(i,": ").concat(e,";")})).join(" "))}}static get observedAttributes(){return["iconUrl","minWidth","minHeight","width","height","size","fontSize","color","className"]}connectedCallback(){(this.content||this.innerHTML)&&(this.content=this.content||this.innerHTML||this.getAttribute("content")),this.innerHTML=n.innerHTML,t(this,i.observedAttributes),this.render()}attributeChangedCallback(t,i,e){"className"!==t&&"classname"!==t&&"class"!==t||"string"==typeof e&&(this.classList.remove(e),this.classList.add(e)),this.color||(this.color="currentColor"),this[t]=e||"",this.render()}})||s;const h={ESIconBase:o};export{o as ESIcon,h as ESIconBase};
|
|
2
2
|
//# sourceMappingURL=IconWC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class
|
|
1
|
+
{"version":3,"file":"IconWC.js","sources":["../../../../../../../../src/core/ui/components/icon/IconWC.ts"],"sourcesContent":["import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils'\n\nimport classes from './icon.module.scss'\n\n\nconst template = document.createElement('template')\n\ntemplate.innerHTML = '<span class=\"icon-base\"></span>'\n\nexport type IconBaseWCType = {\n iconUrl?: string\n minWidth?: string\n minHeight?: string\n width?: string\n height?: string\n size?: string\n fontSize?: string\n color?: string\n className?: string\n}\n\n@ced('icon-base')\nexport class ESIcon extends HTMLElement {\n content: string | null\n\n mainElement: HTMLElement\n\n iconUrl?: string | null\n\n minWidth?: string | null\n\n minHeight?: string | null\n\n width?: string | null\n\n height?: string | null\n\n size?: string | null\n\n fontSize?: string | null\n\n color?: string | null\n\n static get observedAttributes() {\n return ['iconUrl', 'minWidth', 'minHeight', 'width', 'height', 'size', 'fontSize', 'color', 'className']\n }\n\n connectedCallback() {\n if (this.content || this.innerHTML) {\n this.content = this.content || this.innerHTML || this.getAttribute('content')\n }\n\n this.innerHTML = template.innerHTML\n\n resolveAttributes(this, ESIcon.observedAttributes)\n\n this.render()\n }\n\n attributeChangedCallback(attrName: string, oldVal: string | number | null, newVal: string | number | null) {\n if (attrName === 'className' || attrName === 'classname' || attrName === 'class') {\n if (typeof newVal === 'string') {\n this.classList.remove(newVal as string)\n this.classList.add(newVal as string)\n }\n }\n if (!this.color) {\n this.color = 'currentColor'\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[attrName] = (newVal as string) || ''\n this.render()\n }\n\n render = () => {\n this.mainElement = this.mainElement || this.querySelector('.icon-base') as HTMLElement\n if (!this.mainElement) {\n return\n }\n this.classList.add(classes['icon-base-parent'])\n this.mainElement.classList.add(classes['icon-base'])\n\n const styles = {\n '--min-width': this.minWidth || this.size || this.width || 'auto',\n '--min-height': this.minHeight || this.size || this.height || 'auto',\n '--width': this.size || this.width || '1rem',\n '--height': this.size || this.height || '1rem',\n ...(this.fontSize ? { 'font-size': this.fontSize || 'unset' } : {}),\n ...(this.iconUrl ? { '--icon-url': `url(${this.iconUrl})` } : {}),\n ...(this.iconUrl ? { '--icon-color': this.color } : { '--icon-content-color': this.color }),\n }\n\n this.mainElement.innerHTML = this.iconUrl ? '' : (this.content || '')\n\n this.mainElement.setAttribute('style', Object.entries(styles).map(([key, value]) => `${key}: ${value};`).join(' '))\n }\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'icon-base': any\n }\n }\n}\n\nexport const ESIconBase = {\n ESIconBase: ESIcon,\n}\n"],"names":["template","document","createElement","innerHTML","ESIcon","ced","_dec","_class","HTMLElement","constructor","super","arguments","this","content","mainElement","iconUrl","minWidth","minHeight","width","height","size","fontSize","color","render","querySelector","classList","add","classes","styles","concat","setAttribute","Object","entries","map","_ref","key","value","join","observedAttributes","connectedCallback","getAttribute","resolveAttributes","attributeChangedCallback","attrName","oldVal","newVal","remove","ESIconBase"],"mappings":"+NAKA,MAAMA,EAAWC,SAASC,cAAc,YAExCF,EAASG,UAAY,kCAcrB,IACaC,EADZC,EAAI,YAAYC,CAAAC,EAAjB,MACaH,UAAeI,YAAYC,WAAAA,GAAAC,SAAAC,WAAAC,KACtCC,aAAO,EAAAD,KAEPE,iBAAW,EAAAF,KAEXG,aAAO,EAAAH,KAEPI,cAAQ,EAAAJ,KAERK,eAAS,EAAAL,KAETM,WAAK,EAAAN,KAELO,YAAM,EAAAP,KAENQ,UAAI,EAAAR,KAEJS,cAAQ,EAAAT,KAERU,WAAK,EAAAV,KAkCLW,OAAS,KAEP,GADAX,KAAKE,YAAcF,KAAKE,aAAeF,KAAKY,cAAc,eACrDZ,KAAKE,YACR,OAEFF,KAAKa,UAAUC,IAAIC,EAAQ,qBAC3Bf,KAAKE,YAAYW,UAAUC,IAAIC,EAAQ,cAEvC,MAAMC,EAAS,CACb,cAAehB,KAAKI,UAAYJ,KAAKQ,MAAQR,KAAKM,OAAS,OAC3D,eAAgBN,KAAKK,WAAaL,KAAKQ,MAAQR,KAAKO,QAAU,OAC9D,UAAWP,KAAKQ,MAAQR,KAAKM,OAAS,OACtC,WAAYN,KAAKQ,MAAQR,KAAKO,QAAU,UACpCP,KAAKS,SAAW,CAAE,YAAaT,KAAKS,UAAY,SAAY,MAC5DT,KAAKG,QAAU,CAAE,aAAYc,OAAAA,OAASjB,KAAKG,QAAO,MAAQ,MAC1DH,KAAKG,QAAU,CAAE,eAAgBH,KAAKU,OAAU,CAAE,uBAAwBV,KAAKU,QAGrFV,KAAKE,YAAYX,UAAYS,KAAKG,QAAU,GAAMH,KAAKC,SAAW,GAElED,KAAKE,YAAYgB,aAAa,QAASC,OAAOC,QAAQJ,GAAQK,KAAIC,IAAA,IAAEC,EAAKC,GAAMF,EAAA,MAAA,GAAAL,OAAQM,EAAGN,MAAAA,OAAKO,EAAK,IAAA,IAAKC,KAAK,KAAK,CACpH,CArDD,6BAAWC,GACT,MAAO,CAAC,UAAW,WAAY,YAAa,QAAS,SAAU,OAAQ,WAAY,QAAS,YAC9F,CAEAC,iBAAAA,IACM3B,KAAKC,SAAWD,KAAKT,aACvBS,KAAKC,QAAUD,KAAKC,SAAWD,KAAKT,WAAaS,KAAK4B,aAAa,YAGrE5B,KAAKT,UAAYH,EAASG,UAE1BsC,EAAkB7B,KAAMR,EAAOkC,oBAE/B1B,KAAKW,QACP,CAEAmB,wBAAAA,CAAyBC,EAAkBC,EAAgCC,GACxD,cAAbF,GAAyC,cAAbA,GAAyC,UAAbA,GACpC,iBAAXE,IACTjC,KAAKa,UAAUqB,OAAOD,GACtBjC,KAAKa,UAAUC,IAAImB,IAGlBjC,KAAKU,QACRV,KAAKU,MAAQ,gBAIfV,KAAK+B,GAAaE,GAAqB,GACvCjC,KAAKW,QACP,KAwBDhB,EAWM,MAAMwC,EAAa,CACxBA,WAAY3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asyncToGenerator as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";const
|
|
1
|
+
import{asyncToGenerator as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";const r=(r,t,o)=>{var l;let n=r;const s=new Set,u=()=>n,c=function(){var r=e((function*(e){n=e;for(const e of s){const r=null==e?void 0:e.selector,t=r?r(n):n;void 0!==e.previousValue&&e.previousValue===t||(e.previousValue=t,yield e(t))}return n}));return function(e){return r.apply(this,arguments)}}(),i={getState:u,setState:c,subscribe:(e,r)=>{if(r&&e.selector&&e.selector!==r)throw new Error("Error, mismatchm selector, listener.selector !== selector.");return r&&!e.selector&&(e.selector=r),s.add(e),()=>s.delete(e)},unsubscribe:e=>{s.delete(e)}},a=t?null===(l=Object.entries(t))||void 0===l?void 0:l.reduce(((r,t)=>{let[l,n]=t;return{...r,[l]:e((function*(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];const s=yield n(u,c,...r);return o&&c(o(u(),l,...r)),s}))}}),{}):null,d={...i,...a?{actions:{...a}}:{}};return d};export{r as createStore};
|
|
2
2
|
//# sourceMappingURL=store.vanillajs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Record<string, ActionHandler<T>>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = () => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Record<string, ActionHandlerCaller<T>> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async(...rest: unknown[]) => {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n return resultOfAction\n },\n }),\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","_len","length","rest","Array","_key","resultOfAction","storeCombinedWithActions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\n\n/**\n * Represents the callback function for a store listener.\n */\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\n/**\n * Represents a selector function that transforms the store state.\n */\n// export type Selector<T> = (state: Partial<T>) => Partial<T>;\nexport type SelectedValueType<T> = Partial<T> | Partial<keyof T>\n| string | number | boolean | undefined | string[] | number[] | boolean[] | undefined[];\nexport type Selector<T> = (state: Partial<T>) => SelectedValueType<T>;\n\n\n/**\n * Represents a listener for the store.\n */\nexport type Listener<T> = {\n selector?: Selector<T>\n previousValue?: SelectedValueType<T>\n} & ListenerCallBack<T>\n\n/**\n * Represents a store.\n */\nexport type Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState: () => Partial<T>\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState: (state: Partial<T>) => Promise<Partial<T>>\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @param selector - Optional selector function to transform the store state.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => () => void\n /**\n * Unubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => void\n}\n// & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n/**\n * Represents a store with additional actions.\n */\nexport type StoreWithActions<T> = Store<T> & { actions: { [actionName: string]: ActionHandlerCaller<T> } }\n\n/**\n * Represents an action handler function.\n */\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'], // Function to get the current state of the store\n setState: Store<T>['setState'], // Function to set the state of the store\n ...rest: unknown[]\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n/**\n * Represents an reducer function.\n */\nexport type Reducer<T> = (\n state: Partial<T>,\n action: string,\n ...rest: unknown[]\n) => Partial<T>\n\n\n/**\n * Represents a function that calls an action handler.\n */\nexport type ActionHandlerCaller<T> = (...args: unknown[]) => void | Partial<T> | Promise<void | Partial<T>>\n\n\n/**\n * Creates a new store.\n * @param initialState - The initial state of the store.\n * @param actions - Optional actions for the store.\n * @returns The created store.\n */\nexport const createStore = <T>(\n initialState: Partial<T>,\n actions?: Record<string, ActionHandler<T>>,\n reducer?: Reducer<T>,\n): Store<T> | StoreWithActions<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n /**\n * Gets the current state of the store.\n * @returns The current state of the store.\n */\n const getState = () => currentState\n\n // TODO debounce, batch? what is the meaningful time between setState ofr UI to be rendered and registerd by User?\n /**\n * Sets the state of the store.\n * @param newState - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n const newValue: SelectedValueType<T> = selector ? selector(currentState) : currentState\n\n // TODO plugin equality\n if (listener.previousValue === undefined || listener.previousValue !== newValue) {\n listener.previousValue = newValue\n // eslint-disable-next-line no-await-in-loop\n await listener(newValue as Partial<T>)\n }\n }\n return currentState\n }\n\n /**\n * Represents the basic API of the store.\n */\n const storeBaseicApi: Store<T> = {\n /**\n * Get the current state of the store.\n * @returns The current state of the store.\n */\n getState,\n /**\n * Set the state of the store.\n * @param state - The new state to set.\n * @returns A promise that resolves to the new state.\n */\n setState,\n /**\n * Subscribe a listener to the store.\n * @param listener - The listener function to be subscribed.\n * @returns A function to unsubscribe the listener.\n */\n subscribe: (listener: Listener<T>, selector?: Selector<T>) => {\n if (selector && listener.selector && listener.selector !== selector) {\n throw new Error('Error, mismatchm selector, listener.selector !== selector.')\n }\n if (selector && !listener.selector) {\n // eslint-disable-next-line no-param-reassign\n listener.selector = selector\n }\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n /**\n * Unsubscribe a listener from the store.\n * @param listener - The listener function to be unsubscribed.\n */\n unsubscribe: (listener: Listener<T>) => {\n listeners.delete(listener)\n },\n }\n\n /**\n * Resolves the actions and creates action handlers.\n */\n const resolvedActions: Record<string, ActionHandlerCaller<T>> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller<T>>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async(...rest: unknown[]) => {\n const resultOfAction = await actionHandler(getState, setState, ...rest)\n\n if (reducer) {\n setState(reducer(getState(), actionName, ...rest))\n }\n return resultOfAction\n },\n }),\n {},\n ) : null\n\n /**\n * Represents the store combined with actions.\n */\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return resolvedActions\n ? storeCombinedWithActions as StoreWithActions<T>\n : storeCombinedWithActions as Store<T>\n}\n"],"names":["createStore","initialState","actions","reducer","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","newState","listener","selector","newValue","undefined","previousValue","_x","apply","this","arguments","storeBaseicApi","subscribe","Error","add","delete","unsubscribe","resolvedActions","Object","entries","reduce","aggregator","_ref2","actionName","actionHandler","_len","length","rest","Array","_key","resultOfAction","storeCombinedWithActions"],"mappings":"4KA2FO,MAAMA,EAAcA,CACzBC,EACAC,EACAC,KACmC,IAAAC,EACnC,IAAIC,EAA2BJ,EAC/B,MAAMK,EAAY,IAAIC,IAMhBC,EAAWA,IAAMH,EAQjBI,EAAQ,WAAA,IAAAC,EAAAC,GAAG,UAAOC,GACtBP,EAAeO,EAGf,IAAK,MAAMC,KAAYP,EAAW,CAEhC,MAAMQ,EAAoCD,aAAAA,EAAAA,EAAUC,SAM9CC,EAAiCD,EAAWA,EAAST,GAAgBA,OAG5CW,IAA3BH,EAASI,eAA+BJ,EAASI,gBAAkBF,IACrEF,EAASI,cAAgBF,QAEnBF,EAASE,GAEnB,CACA,OAAOV,KACR,OAtBKI,SAAQS,GAAA,OAAAR,EAAAS,MAAAC,KAAAC,UAAA,EAAA,GA2BRC,EAA2B,CAK/Bd,WAMAC,WAMAc,UAAWA,CAACV,EAAuBC,KACjC,GAAIA,GAAYD,EAASC,UAAYD,EAASC,WAAaA,EACzD,MAAM,IAAIU,MAAM,8DAOlB,OALIV,IAAaD,EAASC,WAExBD,EAASC,SAAWA,GAEtBR,EAAUmB,IAAIZ,GACP,IAAMP,EAAUoB,OAAOb,EAAS,EAMzCc,YAAcd,IACZP,EAAUoB,OAAOb,EAAS,GAOxBe,EACF1B,EAAiCE,QAA1BA,EAAGyB,OAAOC,QAAQ5B,cAAQE,SAAvBA,EAAyB2B,QACnC,CACEC,EAAkDC,KAAA,IACjDC,EAAYC,GAA0CF,EAAA,MACnD,IACDD,EACHE,CAACA,GAAUvB,GAAG,YAA6B,IAAA,IAAAyB,EAAAf,UAAAgB,OAApBC,EAAIC,IAAAA,MAAAH,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,GAAAnB,UAAAmB,GACzB,MAAMC,QAAuBN,EAAc3B,EAAUC,KAAa6B,GAKlE,OAHInC,GACFM,EAASN,EAAQK,IAAY0B,KAAeI,IAEvCG,KAEV,GACD,CAAA,GACE,KAKAC,EAA2B,IAC5BpB,KACCM,EAAkB,CAAE1B,QAAS,IAAK0B,IAAsB,IAG9D,OACIc,CACoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{useApi}from"./core/hooks/useApi.js";export{useToggle}from"./core/hooks/useToggle.js";export{createSafeT,setUseTranslation,useTranslations}from"./core/hooks/useTranslations.js";export{outsideClickHandler,useOutsideClick}from"./core/hooks/useOutsideClick.js";export{useResize}from"./core/hooks/useResize.js";export{useClassNames}from"./core/hooks/useClassNames.js";export{useParseProps}from"./core/hooks/useParseProps.js";export{baseThemes,observeThemePreference,switchColorTheme,updateColorTheme,useThemePreference}from"./core/hooks/useThemePreference.js";export{isBirthNumberValid}from"./core/utils/helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./core/utils/helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./core/utils/helpers/fileValidator.js";export{DATE_FORMAT,formatDateToTimestamp,getDate}from"./core/utils/helpers/date.js";export{getDeviceId}from"./core/utils/helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./core/utils/helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./core/utils/helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./core/utils/helpers/objectOperations.js";export{debounce,delay,memoize,memoizeComplex,memoizer,nestedTernary}from"./core/utils/helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./core/utils/helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./core/utils/helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./core/utils/helpers/cancelableDelayedFunction.js";export{classNames,mapSerReplacer,noop,parseProps}from"./core/utils/helpers/ui.js";export{keyExtractor,keyExtractorFunction}from"./core/utils/keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./core/utils/date.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./core/utils/webComponents/webComponent.utils.js";export{createStore}from"./core/utils/appState/store/store.vanillajs.js";export{createDataStore}from"./core/utils/appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./core/utils/appState/store/useStore.react.js";export{EventName}from"./core/constants/ui.constants.js";export{calculateColors,calculatePercColor,convertHex,convertRGB,defaultFontSize,pxToRem,resolveStyleValue,setDefaultFontSize,toHex}from"./core/ui/utils/style.js";export{LayoutBox}from"./core/ui/components/container/LayoutBox.js";export{LayoutDirection}from"./core/ui/components/container/layoutBox.types.js";export{Flex,FlexTight,FlexTightStyled,FlexWrapper}from"./core/ui/components/container/Flex.js";export{Placeholder}from"./core/ui/components/container/Placeholder.js";export{CollapsibleContainer}from"./core/ui/components/container/CollapsibleContainer.js";export{ResizableContainer}from"./core/ui/components/container/ResizableContainer.js";export{Field,FieldWrapper,Select,setIconColor,setIconComponent}from"./core/ui/components/field/Field.js";export{DividerHorizontal,DividerLine,DividerVertical}from"./core/ui/components/dividers/DividerLine.js";export{IconBase}from"./core/ui/components/icon/IconBase.js";export{Icon}from"./core/ui/components/icon/Icon.js";export{
|
|
1
|
+
export{useApi}from"./core/hooks/useApi.js";export{useToggle}from"./core/hooks/useToggle.js";export{createSafeT,setUseTranslation,useTranslations}from"./core/hooks/useTranslations.js";export{outsideClickHandler,useOutsideClick}from"./core/hooks/useOutsideClick.js";export{useResize}from"./core/hooks/useResize.js";export{useClassNames}from"./core/hooks/useClassNames.js";export{useParseProps}from"./core/hooks/useParseProps.js";export{baseThemes,observeThemePreference,switchColorTheme,updateColorTheme,useThemePreference}from"./core/hooks/useThemePreference.js";export{isBirthNumberValid}from"./core/utils/helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./core/utils/helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./core/utils/helpers/fileValidator.js";export{DATE_FORMAT,formatDateToTimestamp,getDate}from"./core/utils/helpers/date.js";export{getDeviceId}from"./core/utils/helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./core/utils/helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./core/utils/helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./core/utils/helpers/objectOperations.js";export{debounce,delay,memoize,memoizeComplex,memoizer,nestedTernary}from"./core/utils/helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./core/utils/helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./core/utils/helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./core/utils/helpers/cancelableDelayedFunction.js";export{classNames,mapSerReplacer,noop,parseProps}from"./core/utils/helpers/ui.js";export{keyExtractor,keyExtractorFunction}from"./core/utils/keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./core/utils/date.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./core/utils/webComponents/webComponent.utils.js";export{createStore}from"./core/utils/appState/store/store.vanillajs.js";export{createDataStore}from"./core/utils/appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./core/utils/appState/store/useStore.react.js";export{EventName}from"./core/constants/ui.constants.js";export{calculateColors,calculatePercColor,convertHex,convertRGB,defaultFontSize,pxToRem,resolveStyleValue,setDefaultFontSize,toHex}from"./core/ui/utils/style.js";export{LayoutBox}from"./core/ui/components/container/LayoutBox.js";export{LayoutDirection}from"./core/ui/components/container/layoutBox.types.js";export{Flex,FlexTight,FlexTightStyled,FlexWrapper}from"./core/ui/components/container/Flex.js";export{Placeholder}from"./core/ui/components/container/Placeholder.js";export{CollapsibleContainer}from"./core/ui/components/container/CollapsibleContainer.js";export{ResizableContainer}from"./core/ui/components/container/ResizableContainer.js";export{Field,FieldWrapper,Select,setIconColor,setIconComponent}from"./core/ui/components/field/Field.js";export{DividerHorizontal,DividerLine,DividerVertical}from"./core/ui/components/dividers/DividerLine.js";export{IconBase}from"./core/ui/components/icon/IconBase.js";export{Icon}from"./core/ui/components/icon/Icon.js";export{ESIcon,ESIconBase}from"./core/ui/components/icon/IconWC.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -53,7 +53,7 @@ export const switchColorTheme = (isDark, htmlElement, findShadows = true) => {
|
|
|
53
53
|
element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass);
|
|
54
54
|
element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass);
|
|
55
55
|
});
|
|
56
|
-
document.querySelectorAll('
|
|
56
|
+
document.querySelectorAll('esmf-wrapper').forEach((element) => {
|
|
57
57
|
element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass);
|
|
58
58
|
element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass);
|
|
59
59
|
const firstChild = element.shadowRoot?.childNodes[0];
|
|
@@ -4,12 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var ESIcon_1;
|
|
8
8
|
import { ced, resolveAttributes } from '../../../utils/webComponents/webComponent.utils';
|
|
9
9
|
import classes from './icon.module.scss';
|
|
10
10
|
const template = document.createElement('template');
|
|
11
11
|
template.innerHTML = '<span class="icon-base"></span>';
|
|
12
|
-
let
|
|
12
|
+
let ESIcon = ESIcon_1 = class ESIcon extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.render = () => {
|
|
@@ -40,7 +40,7 @@ let VCIcon = VCIcon_1 = class VCIcon extends HTMLElement {
|
|
|
40
40
|
this.content = this.content || this.innerHTML || this.getAttribute('content');
|
|
41
41
|
}
|
|
42
42
|
this.innerHTML = template.innerHTML;
|
|
43
|
-
resolveAttributes(this,
|
|
43
|
+
resolveAttributes(this, ESIcon_1.observedAttributes);
|
|
44
44
|
this.render();
|
|
45
45
|
}
|
|
46
46
|
attributeChangedCallback(attrName, oldVal, newVal) {
|
|
@@ -59,11 +59,11 @@ let VCIcon = VCIcon_1 = class VCIcon extends HTMLElement {
|
|
|
59
59
|
this.render();
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
ESIcon = ESIcon_1 = __decorate([
|
|
63
63
|
ced('icon-base')
|
|
64
|
-
],
|
|
65
|
-
export {
|
|
66
|
-
export const
|
|
67
|
-
|
|
64
|
+
], ESIcon);
|
|
65
|
+
export { ESIcon };
|
|
66
|
+
export const ESIconBase = {
|
|
67
|
+
ESIconBase: ESIcon,
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=IconWC.js.map
|
|
@@ -59,7 +59,14 @@ export const createStore = (initialState, actions, reducer) => {
|
|
|
59
59
|
* @param listener - The listener function to be subscribed.
|
|
60
60
|
* @returns A function to unsubscribe the listener.
|
|
61
61
|
*/
|
|
62
|
-
subscribe: (listener) => {
|
|
62
|
+
subscribe: (listener, selector) => {
|
|
63
|
+
if (selector && listener.selector && listener.selector !== selector) {
|
|
64
|
+
throw new Error('Error, mismatchm selector, listener.selector !== selector.');
|
|
65
|
+
}
|
|
66
|
+
if (selector && !listener.selector) {
|
|
67
|
+
// eslint-disable-next-line no-param-reassign
|
|
68
|
+
listener.selector = selector;
|
|
69
|
+
}
|
|
63
70
|
listeners.add(listener);
|
|
64
71
|
return () => listeners.delete(listener);
|
|
65
72
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"names":[],"mappings":"AACA,+FAA+F;
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"names":[],"mappings":"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"}
|