@e1011/es-kit 1.1.86 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/esm/index.css +151 -151
- package/dist/hooks/esm/src/core/hooks/index.js +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/esm/src/core/utils/helpers/ui.js +1 -1
- package/dist/hooks/esm/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/hooks/index.css +151 -151
- package/dist/hooks/src/core/hooks/index.js +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/hooks/src/core/utils/helpers/ui.js +1 -1
- package/dist/hooks/src/core/utils/helpers/ui.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/utils/helpers/ui.js +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/lib/cjs/src/index.js +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/utils/helpers/ui.js +1 -1
- package/dist/lib/esm/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/lib/esm/src/index.js +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/hooks/useThemePreference.d.ts +0 -41
- package/dist/types/src/core/hooks/useThemePreference.d.ts.map +1 -1
- package/dist/types/src/core/utils/helpers/ui.d.ts +45 -0
- package/dist/types/src/core/utils/helpers/ui.d.ts.map +1 -1
- package/dist/ui/esm/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/ui/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/utils/esm/index.css +151 -151
- package/dist/utils/esm/src/core/utils/helpers/ui.js +1 -1
- package/dist/utils/esm/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/utils/esm/src/core/utils/index.js +1 -1
- package/dist/utils/index.css +151 -151
- package/dist/utils/src/core/utils/helpers/ui.js +1 -1
- package/dist/utils/src/core/utils/helpers/ui.js.map +1 -1
- package/dist/utils/src/core/utils/index.js +1 -1
- package/package.json +4 -3
|
@@ -1,48 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observes the user's theme preference and applies the appropriate theme.
|
|
3
|
-
* @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
|
|
4
|
-
* @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
|
|
5
|
-
* @returns {() => void} Function to stop observing the theme preference.
|
|
6
|
-
*/
|
|
7
|
-
export declare const observeThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => () => void;
|
|
8
1
|
/**
|
|
9
2
|
* Custom hook to use theme preference in a React component.
|
|
10
3
|
* @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
|
|
11
4
|
* @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
|
|
12
5
|
*/
|
|
13
6
|
export declare const useThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Type definition for theme map.
|
|
16
|
-
* @typedef {Object} ThemeMap
|
|
17
|
-
* @property {string} dark - CSS class for the dark theme.
|
|
18
|
-
* @property {string} light - CSS class for the light theme.
|
|
19
|
-
*/
|
|
20
|
-
type ThemeMap = {
|
|
21
|
-
dark: string;
|
|
22
|
-
light: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Gets the base themes.
|
|
26
|
-
* @returns {ThemeMap} The current base themes.
|
|
27
|
-
*/
|
|
28
|
-
export declare const getBaseThemes: () => ThemeMap;
|
|
29
|
-
/**
|
|
30
|
-
* Sets the base theme class names.
|
|
31
|
-
* @param {ThemeMap} themes - Object containing the CSS classes for dark and light themes.
|
|
32
|
-
*/
|
|
33
|
-
export declare const setThemeClassNames: (themes: ThemeMap) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Switches the color theme of the document.
|
|
36
|
-
* @param {boolean} isDark - Flag to determine if the dark theme should be applied.
|
|
37
|
-
* @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
|
|
38
|
-
* @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.
|
|
39
|
-
*/
|
|
40
|
-
export declare const switchColorTheme: (isDark: boolean, htmlElement?: HTMLElement, findShadows?: boolean) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Updates the color theme of the document.
|
|
43
|
-
* @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.
|
|
44
|
-
* @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
|
|
45
|
-
*/
|
|
46
|
-
export declare const updateColorTheme: (isDark?: boolean, htmlElement?: HTMLElement) => void;
|
|
47
|
-
export {};
|
|
48
7
|
//# sourceMappingURL=useThemePreference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemePreference.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useThemePreference.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useThemePreference.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,oBACb,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,IAKF,CAAA"}
|
|
@@ -24,5 +24,50 @@ export type NoopEvent = {
|
|
|
24
24
|
stopImmediatePropagation?: () => void;
|
|
25
25
|
} | Event;
|
|
26
26
|
export declare const noop: (event?: NoopEvent) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Type definition for theme map.
|
|
29
|
+
* @typedef {Object} ThemeMap
|
|
30
|
+
* @property {string} dark - CSS class for the dark theme.
|
|
31
|
+
* @property {string} light - CSS class for the light theme.
|
|
32
|
+
*/
|
|
33
|
+
export type ThemeMap = {
|
|
34
|
+
dark: string;
|
|
35
|
+
light: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Reads the theme config stored on the given element.
|
|
39
|
+
* Falls back to defaultThemes when no config has been set.
|
|
40
|
+
* Scoping to the element means different microfrontends (different roots) are isolated,
|
|
41
|
+
* while all bundles targeting the same element share one config.
|
|
42
|
+
* @param {HTMLElement} [element] - The element to read from. Defaults to document.body.
|
|
43
|
+
* @returns {ThemeMap} The current base themes for the element.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getBaseThemes: (element?: HTMLElement) => ThemeMap;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the base theme class names on the given element.
|
|
48
|
+
* @param {ThemeMap} themes - CSS classes for dark and light themes.
|
|
49
|
+
* @param {HTMLElement} [element] - The element to store config on. Defaults to document.body.
|
|
50
|
+
*/
|
|
51
|
+
export declare const setThemeClassNames: (themes: ThemeMap, element?: HTMLElement) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Switches the color theme of the document.
|
|
54
|
+
* @param {boolean} isDark - Flag to determine if the dark theme should be applied.
|
|
55
|
+
* @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
|
|
56
|
+
* @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.
|
|
57
|
+
*/
|
|
58
|
+
export declare const switchColorTheme: (isDark: boolean, htmlElement?: HTMLElement, findShadows?: boolean) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Updates the color theme of the document.
|
|
61
|
+
* @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.
|
|
62
|
+
* @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.
|
|
63
|
+
*/
|
|
64
|
+
export declare const updateColorTheme: (isDark?: boolean, htmlElement?: HTMLElement) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Observes the user's theme preference and applies the appropriate theme.
|
|
67
|
+
* @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.
|
|
68
|
+
* @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.
|
|
69
|
+
* @returns {() => void} Function to stop observing the theme preference.
|
|
70
|
+
*/
|
|
71
|
+
export declare const observeThemePreference: (getHtmlElement?: () => HTMLElement, switchCallback?: (isDark: boolean) => void) => () => void;
|
|
27
72
|
export {};
|
|
28
73
|
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../../../../src/core/utils/helpers/ui.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACnB,MAAM,SAAS,OAAO,KAAG,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;CAQnF,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AAC5D,eAAO,MAAM,UAAU,eAAgB,UAAU,EAAE,KAAG,MAE1B,CAAA;AAG5B,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAE,mBAY1D,CAAA;AAID,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAA;AAC3G,KAAK,UAAU,GAAG;IAAE,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;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,YAAa,OAAO,gBAAgB,WAAW,KAAG,IAQ9E,CAAA;AAID;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,oBACjB,MAAM,WAAW,mBACjB,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,KACxC,MAAM,IA6CR,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n"],"names":["classNames","_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr","noop","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation"],"mappings":"iFAYaA,MAAAA,EAAa,WAAA,IAAA,IAAAC,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,EAQfC,EAAcC,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW,EAoEpBQ,EAAQC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC"}
|
|
1
|
+
{"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n\n/**\n * Type definition for theme map.\n * @typedef {Object} ThemeMap\n * @property {string} dark - CSS class for the dark theme.\n * @property {string} light - CSS class for the light theme.\n */\nexport type ThemeMap = {\n dark: string\n light: string\n}\n\nconst THEME_PROP = '__eskit_themes__'\n\nconst defaultThemes: ThemeMap = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\n/**\n * Reads the theme config stored on the given element.\n * Falls back to defaultThemes when no config has been set.\n * Scoping to the element means different microfrontends (different roots) are isolated,\n * while all bundles targeting the same element share one config.\n * @param {HTMLElement} [element] - The element to read from. Defaults to document.body.\n * @returns {ThemeMap} The current base themes for the element.\n */\nexport const getBaseThemes = (element?: HTMLElement): ThemeMap => {\n const el = element ?? document.body\n\n return (el as unknown as Record<string, unknown>)[THEME_PROP] as ThemeMap ?? defaultThemes\n}\n\n/**\n * Sets the base theme class names on the given element.\n * @param {ThemeMap} themes - CSS classes for dark and light themes.\n * @param {HTMLElement} [element] - The element to store config on. Defaults to document.body.\n */\nexport const setThemeClassNames = (themes: ThemeMap, element?: HTMLElement): void => {\n const el = element ?? document.body\n const store = el as unknown as Record<string, unknown>\n\n store[THEME_PROP] = themes\n}\n\n/**\n * Switches the color theme of the document.\n * @param {boolean} isDark - Flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.\n */\nexport const switchColorTheme = (\n isDark: boolean, htmlElement?: HTMLElement, findShadows = true,\n): void => {\n const themes = getBaseThemes(htmlElement)\n const oldClass = isDark ? themes.light : themes.dark\n const newClass = isDark ? themes.dark : themes.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\n/**\n * Updates the color theme of the document.\n * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n */\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement): void => {\n const el = htmlElement || document.body\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(getBaseThemes(el).dark)\n }\n switchColorTheme(resolvedIsDark, el)\n}\n\nconst windowMatchMediaChangeEventType = 'change'\n\n/**\n * Observes the user's theme preference and applies the appropriate theme.\n * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.\n * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.\n * @returns {() => void} Function to stop observing the theme preference.\n */\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = (): HTMLElement => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean): boolean => isDark,\n): () => void => {\n const switchColorThemeHandler = (isDark: boolean): void => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent): void => {\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"],"names":["classNames","_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr","noop","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation"],"mappings":"iFAYaA,MAAAA,EAAa,WAAA,IAAA,IAAAC,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,EAQfC,EAAcC,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW,EAoEpBQ,EAAQC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n"],"names":["_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr"],"mappings":"oHAY0B,WAAA,IAAA,IAAAA,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,eAuFPC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC,qBAlFVQ,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW"}
|
|
1
|
+
{"version":3,"file":"ui.js","sources":["../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n\n/**\n * Type definition for theme map.\n * @typedef {Object} ThemeMap\n * @property {string} dark - CSS class for the dark theme.\n * @property {string} light - CSS class for the light theme.\n */\nexport type ThemeMap = {\n dark: string\n light: string\n}\n\nconst THEME_PROP = '__eskit_themes__'\n\nconst defaultThemes: ThemeMap = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\n/**\n * Reads the theme config stored on the given element.\n * Falls back to defaultThemes when no config has been set.\n * Scoping to the element means different microfrontends (different roots) are isolated,\n * while all bundles targeting the same element share one config.\n * @param {HTMLElement} [element] - The element to read from. Defaults to document.body.\n * @returns {ThemeMap} The current base themes for the element.\n */\nexport const getBaseThemes = (element?: HTMLElement): ThemeMap => {\n const el = element ?? document.body\n\n return (el as unknown as Record<string, unknown>)[THEME_PROP] as ThemeMap ?? defaultThemes\n}\n\n/**\n * Sets the base theme class names on the given element.\n * @param {ThemeMap} themes - CSS classes for dark and light themes.\n * @param {HTMLElement} [element] - The element to store config on. Defaults to document.body.\n */\nexport const setThemeClassNames = (themes: ThemeMap, element?: HTMLElement): void => {\n const el = element ?? document.body\n const store = el as unknown as Record<string, unknown>\n\n store[THEME_PROP] = themes\n}\n\n/**\n * Switches the color theme of the document.\n * @param {boolean} isDark - Flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.\n */\nexport const switchColorTheme = (\n isDark: boolean, htmlElement?: HTMLElement, findShadows = true,\n): void => {\n const themes = getBaseThemes(htmlElement)\n const oldClass = isDark ? themes.light : themes.dark\n const newClass = isDark ? themes.dark : themes.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\n/**\n * Updates the color theme of the document.\n * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n */\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement): void => {\n const el = htmlElement || document.body\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(getBaseThemes(el).dark)\n }\n switchColorTheme(resolvedIsDark, el)\n}\n\nconst windowMatchMediaChangeEventType = 'change'\n\n/**\n * Observes the user's theme preference and applies the appropriate theme.\n * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.\n * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.\n * @returns {() => void} Function to stop observing the theme preference.\n */\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = (): HTMLElement => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean): boolean => isDark,\n): () => void => {\n const switchColorThemeHandler = (isDark: boolean): void => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent): void => {\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"],"names":["_len","arguments","length","classes","Array","_key","filter","className","Boolean","join","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation","props","dataProps","restProps","Object","entries","forEach","_ref","key","value","substr"],"mappings":"oHAY0B,WAAA,IAAA,IAAAA,EAAAC,UAAAC,OAAIC,EAAOC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAPF,EAAOE,GAAAJ,UAAAI,GAAA,OAA2BF,EAC7DG,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,eAuFPC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC,qBAlFVQ,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOC,QAAQJ,GAAOK,SAAQC,IAAkB,IAAhBC,EAAKC,GAAMF,EAChB,UAArBC,EAAIE,OAAO,EAAG,IAAuC,SAArBF,EAAIE,OAAO,EAAG,GAChDR,EAAUM,GAAOC,EAEjBN,EAAUK,GAAOC,CACnB,IAEK,CAAEP,YAAWC,YAAW"}
|
package/dist/utils/esm/index.css
CHANGED
|
@@ -37,6 +37,25 @@
|
|
|
37
37
|
.errorBoundary-module_StyledIcon__IYHiU {
|
|
38
38
|
margin-right: 10px;
|
|
39
39
|
}
|
|
40
|
+
.divider-module_divider-line__6CesR {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: block;
|
|
43
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
44
|
+
background-color: var(--color);
|
|
45
|
+
opacity: var(--opacity);
|
|
46
|
+
}
|
|
47
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
48
|
+
height: var(--length);
|
|
49
|
+
left: var(--left);
|
|
50
|
+
width: var(--width);
|
|
51
|
+
margin: var(--margin);
|
|
52
|
+
}
|
|
53
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
54
|
+
width: var(--length);
|
|
55
|
+
left: var(--left);
|
|
56
|
+
height: var(--height);
|
|
57
|
+
margin: var(--margin);
|
|
58
|
+
}
|
|
40
59
|
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
41
60
|
transform-origin: 0% 0%;
|
|
42
61
|
opacity: 0;
|
|
@@ -144,25 +163,6 @@
|
|
|
144
163
|
.field-module_field__UfKm3 label {
|
|
145
164
|
text-align: left;
|
|
146
165
|
}
|
|
147
|
-
.divider-module_divider-line__6CesR {
|
|
148
|
-
position: relative;
|
|
149
|
-
display: block;
|
|
150
|
-
transition: opacity, width, height 250ms ease-in-out;
|
|
151
|
-
background-color: var(--color);
|
|
152
|
-
opacity: var(--opacity);
|
|
153
|
-
}
|
|
154
|
-
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
155
|
-
height: var(--length);
|
|
156
|
-
left: var(--left);
|
|
157
|
-
width: var(--width);
|
|
158
|
-
margin: var(--margin);
|
|
159
|
-
}
|
|
160
|
-
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
161
|
-
width: var(--length);
|
|
162
|
-
left: var(--left);
|
|
163
|
-
height: var(--height);
|
|
164
|
-
margin: var(--margin);
|
|
165
|
-
}
|
|
166
166
|
.layoutBox-module_layout-box__ZIID8 {
|
|
167
167
|
display: flex;
|
|
168
168
|
position: relative;
|
|
@@ -230,101 +230,18 @@
|
|
|
230
230
|
stroke-dashoffset: -124;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.popup-module_overflow-hidden__uimg4, .popup-module_text-truncate__y-5c1 {
|
|
238
|
-
overflow: hidden !important;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.popup-module_text-nowrap__eDCv3, .popup-module_text-truncate__y-5c1 {
|
|
242
|
-
white-space: nowrap !important;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.popup-module_text-ellipsis__yu8nx, .popup-module_text-truncate__y-5c1 {
|
|
246
|
-
text-overflow: ellipsis !important;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.popup-module_popup-container__PJ0oQ {
|
|
250
|
-
--popup-width: 60vw;
|
|
251
|
-
--popup-height: 50vh;
|
|
252
|
-
position: fixed;
|
|
253
|
-
width: var(--popup-width);
|
|
254
|
-
height: var(--popup-height);
|
|
255
|
-
--slideXFrom: 0;
|
|
256
|
-
--slideYFrom: 0;
|
|
257
|
-
will-change: opacity;
|
|
258
|
-
transition: opacity 300ms ease-in-out;
|
|
259
|
-
opacity: 0;
|
|
260
|
-
visibility: hidden;
|
|
261
|
-
pointer-events: none;
|
|
233
|
+
.flowLayout-module_flowLayout__VHpnY {
|
|
234
|
+
overflow: auto;
|
|
262
235
|
}
|
|
263
|
-
.
|
|
264
|
-
|
|
265
|
-
flex-direction: column;
|
|
266
|
-
align-items: start;
|
|
236
|
+
.flowLayout-module_flowLayout__VHpnY .flowLayout-module_beforeContent__rY-mW {
|
|
237
|
+
display: flex;
|
|
267
238
|
width: 100%;
|
|
268
|
-
|
|
269
|
-
overflow-x: clip;
|
|
270
|
-
background-color: #090A0A;
|
|
271
|
-
border-radius: 4px;
|
|
272
|
-
box-shadow: 0px 10px 20px 4px rgba(0, 0, 0, 0.15);
|
|
273
|
-
transition: transform 350ms ease-out;
|
|
274
|
-
will-change: transform;
|
|
275
|
-
transform: translateX(var(--slideXFrom)) translateY(var(--slideYFrom));
|
|
276
|
-
}
|
|
277
|
-
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz button {
|
|
278
|
-
margin-bottom: 0;
|
|
279
|
-
}
|
|
280
|
-
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx {
|
|
281
|
-
cursor: pointer;
|
|
282
|
-
line-height: 1px;
|
|
283
|
-
background-color: rgba(255, 255, 255, 0);
|
|
284
|
-
}
|
|
285
|
-
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx .icon-base {
|
|
286
|
-
background-color: #FDDA0D;
|
|
287
|
-
width: 9px !important;
|
|
288
|
-
height: 9px !important;
|
|
289
|
-
line-height: 1px !important;
|
|
290
|
-
}
|
|
291
|
-
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx:hover .icon-base {
|
|
292
|
-
background-color: #FFEA00;
|
|
239
|
+
min-width: 0;
|
|
293
240
|
}
|
|
294
|
-
.
|
|
295
|
-
width: 100%;
|
|
296
|
-
height: 100%;
|
|
297
|
-
padding: 24px;
|
|
298
|
-
overflow-y: auto;
|
|
241
|
+
.flowLayout-module_flowLayout__VHpnY .flowLayout-module_afterContent__Hlh8v {
|
|
299
242
|
display: flex;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
overflow-y: auto;
|
|
303
|
-
}
|
|
304
|
-
.popup-module_popup-container__PJ0oQ[data-show] {
|
|
305
|
-
opacity: 1;
|
|
306
|
-
visibility: visible;
|
|
307
|
-
pointer-events: all;
|
|
308
|
-
}
|
|
309
|
-
.popup-module_popup-container__PJ0oQ[data-show] .popup-module_popup-container-inner__n83Cz {
|
|
310
|
-
transform: translateX(0) translateY(0);
|
|
311
|
-
}
|
|
312
|
-
.popup-module_popup-container__PJ0oQ[data-show=false] {
|
|
313
|
-
opacity: 0;
|
|
314
|
-
visibility: hidden;
|
|
315
|
-
pointer-events: none;
|
|
316
|
-
}
|
|
317
|
-
.popup-module_popup-container__PJ0oQ[data-show=false] .popup-module_popup-container-inner__n83Cz {
|
|
318
|
-
transform: translateX(var(--slideXFrom)) translateY(var(--slideYFrom));
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.cui-theme-dark .popup-module_popup-container-inner__n83Cz {
|
|
322
|
-
background-color: #090A0A;
|
|
323
|
-
color: #F4F4F4;
|
|
324
|
-
}
|
|
325
|
-
.cui-theme-light .popup-module_popup-container-inner__n83Cz {
|
|
326
|
-
background-color: #090A0A;
|
|
327
|
-
color: #F4F4F4;
|
|
243
|
+
width: 100%;
|
|
244
|
+
min-width: 0;
|
|
328
245
|
}
|
|
329
246
|
:root {
|
|
330
247
|
--divider-line: #4a4b4b;
|
|
@@ -444,6 +361,130 @@
|
|
|
444
361
|
--divider-line: #4a4b4b;
|
|
445
362
|
}
|
|
446
363
|
|
|
364
|
+
.popup-module_overflow-hidden__uimg4, .popup-module_text-truncate__y-5c1 {
|
|
365
|
+
overflow: hidden !important;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.popup-module_text-nowrap__eDCv3, .popup-module_text-truncate__y-5c1 {
|
|
369
|
+
white-space: nowrap !important;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.popup-module_text-ellipsis__yu8nx, .popup-module_text-truncate__y-5c1 {
|
|
373
|
+
text-overflow: ellipsis !important;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.popup-module_popup-container__PJ0oQ {
|
|
377
|
+
--popup-width: 60vw;
|
|
378
|
+
--popup-height: 50vh;
|
|
379
|
+
position: fixed;
|
|
380
|
+
width: var(--popup-width);
|
|
381
|
+
height: var(--popup-height);
|
|
382
|
+
--slideXFrom: 0;
|
|
383
|
+
--slideYFrom: 0;
|
|
384
|
+
will-change: opacity;
|
|
385
|
+
transition: opacity 300ms ease-in-out;
|
|
386
|
+
opacity: 0;
|
|
387
|
+
visibility: hidden;
|
|
388
|
+
pointer-events: none;
|
|
389
|
+
}
|
|
390
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz {
|
|
391
|
+
position: relative;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
align-items: start;
|
|
394
|
+
width: 100%;
|
|
395
|
+
height: 100%;
|
|
396
|
+
overflow-x: clip;
|
|
397
|
+
background-color: #090A0A;
|
|
398
|
+
border-radius: 4px;
|
|
399
|
+
box-shadow: 0px 10px 20px 4px rgba(0, 0, 0, 0.15);
|
|
400
|
+
transition: transform 350ms ease-out;
|
|
401
|
+
will-change: transform;
|
|
402
|
+
transform: translateX(var(--slideXFrom)) translateY(var(--slideYFrom));
|
|
403
|
+
}
|
|
404
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz button {
|
|
405
|
+
margin-bottom: 0;
|
|
406
|
+
}
|
|
407
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx {
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
line-height: 1px;
|
|
410
|
+
background-color: rgba(255, 255, 255, 0);
|
|
411
|
+
}
|
|
412
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx .icon-base {
|
|
413
|
+
background-color: #FDDA0D;
|
|
414
|
+
width: 9px !important;
|
|
415
|
+
height: 9px !important;
|
|
416
|
+
line-height: 1px !important;
|
|
417
|
+
}
|
|
418
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_close-button__-8sZx:hover .icon-base {
|
|
419
|
+
background-color: #FFEA00;
|
|
420
|
+
}
|
|
421
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_popup-container-inner-div__sDNBm {
|
|
422
|
+
width: 100%;
|
|
423
|
+
height: 100%;
|
|
424
|
+
padding: 24px;
|
|
425
|
+
overflow-y: auto;
|
|
426
|
+
display: flex;
|
|
427
|
+
}
|
|
428
|
+
.popup-module_popup-container__PJ0oQ .popup-module_popup-container-inner__n83Cz .popup-module_popup-container-inner-div__sDNBm > * {
|
|
429
|
+
overflow-y: auto;
|
|
430
|
+
}
|
|
431
|
+
.popup-module_popup-container__PJ0oQ[data-show] {
|
|
432
|
+
opacity: 1;
|
|
433
|
+
visibility: visible;
|
|
434
|
+
pointer-events: all;
|
|
435
|
+
}
|
|
436
|
+
.popup-module_popup-container__PJ0oQ[data-show] .popup-module_popup-container-inner__n83Cz {
|
|
437
|
+
transform: translateX(0) translateY(0);
|
|
438
|
+
}
|
|
439
|
+
.popup-module_popup-container__PJ0oQ[data-show=false] {
|
|
440
|
+
opacity: 0;
|
|
441
|
+
visibility: hidden;
|
|
442
|
+
pointer-events: none;
|
|
443
|
+
}
|
|
444
|
+
.popup-module_popup-container__PJ0oQ[data-show=false] .popup-module_popup-container-inner__n83Cz {
|
|
445
|
+
transform: translateX(var(--slideXFrom)) translateY(var(--slideYFrom));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.cui-theme-dark .popup-module_popup-container-inner__n83Cz {
|
|
449
|
+
background-color: #090A0A;
|
|
450
|
+
color: #F4F4F4;
|
|
451
|
+
}
|
|
452
|
+
.cui-theme-light .popup-module_popup-container-inner__n83Cz {
|
|
453
|
+
background-color: #090A0A;
|
|
454
|
+
color: #F4F4F4;
|
|
455
|
+
}
|
|
456
|
+
.textAndContent-module_textAndContent__X5P1n {
|
|
457
|
+
align-items: baseline;
|
|
458
|
+
flex-shrink: 1;
|
|
459
|
+
gap: 8px;
|
|
460
|
+
}
|
|
461
|
+
.popup-overlay-module_popup-modal-overlay__dlJqM {
|
|
462
|
+
z-index: 1;
|
|
463
|
+
position: fixed;
|
|
464
|
+
width: 100%;
|
|
465
|
+
height: 100%;
|
|
466
|
+
top: 0;
|
|
467
|
+
left: 0;
|
|
468
|
+
background: rgba(40, 80, 120, 0.8) !important;
|
|
469
|
+
pointer-events: all;
|
|
470
|
+
user-select: none;
|
|
471
|
+
will-change: opacity;
|
|
472
|
+
transition: opacity 450ms ease-in-out;
|
|
473
|
+
opacity: 0;
|
|
474
|
+
visibility: hidden;
|
|
475
|
+
}
|
|
476
|
+
.popup-overlay-module_popup-modal-overlay__dlJqM[data-show] {
|
|
477
|
+
opacity: 1;
|
|
478
|
+
visibility: visible;
|
|
479
|
+
}
|
|
480
|
+
.popup-overlay-module_popup-modal-overlay__dlJqM[data-show=false] {
|
|
481
|
+
opacity: 0;
|
|
482
|
+
visibility: hidden;
|
|
483
|
+
}
|
|
484
|
+
:root {
|
|
485
|
+
--divider-line: #4a4b4b;
|
|
486
|
+
}
|
|
487
|
+
|
|
447
488
|
.button-module_overflow-hidden__Vc5AU, .button-module_text-truncate__a89Bp {
|
|
448
489
|
overflow: hidden !important;
|
|
449
490
|
}
|
|
@@ -570,42 +611,6 @@
|
|
|
570
611
|
.cui-theme-light .button-module_button__NDMQS {
|
|
571
612
|
color: #090A0A;
|
|
572
613
|
}
|
|
573
|
-
.flowLayout-module_flowLayout__VHpnY {
|
|
574
|
-
overflow: auto;
|
|
575
|
-
}
|
|
576
|
-
.flowLayout-module_flowLayout__VHpnY .flowLayout-module_beforeContent__rY-mW {
|
|
577
|
-
display: flex;
|
|
578
|
-
width: 100%;
|
|
579
|
-
min-width: 0;
|
|
580
|
-
}
|
|
581
|
-
.flowLayout-module_flowLayout__VHpnY .flowLayout-module_afterContent__Hlh8v {
|
|
582
|
-
display: flex;
|
|
583
|
-
width: 100%;
|
|
584
|
-
min-width: 0;
|
|
585
|
-
}
|
|
586
|
-
.popup-overlay-module_popup-modal-overlay__dlJqM {
|
|
587
|
-
z-index: 1;
|
|
588
|
-
position: fixed;
|
|
589
|
-
width: 100%;
|
|
590
|
-
height: 100%;
|
|
591
|
-
top: 0;
|
|
592
|
-
left: 0;
|
|
593
|
-
background: rgba(40, 80, 120, 0.8) !important;
|
|
594
|
-
pointer-events: all;
|
|
595
|
-
user-select: none;
|
|
596
|
-
will-change: opacity;
|
|
597
|
-
transition: opacity 450ms ease-in-out;
|
|
598
|
-
opacity: 0;
|
|
599
|
-
visibility: hidden;
|
|
600
|
-
}
|
|
601
|
-
.popup-overlay-module_popup-modal-overlay__dlJqM[data-show] {
|
|
602
|
-
opacity: 1;
|
|
603
|
-
visibility: visible;
|
|
604
|
-
}
|
|
605
|
-
.popup-overlay-module_popup-modal-overlay__dlJqM[data-show=false] {
|
|
606
|
-
opacity: 0;
|
|
607
|
-
visibility: hidden;
|
|
608
|
-
}
|
|
609
614
|
:root {
|
|
610
615
|
--divider-line: #4a4b4b;
|
|
611
616
|
}
|
|
@@ -770,11 +775,6 @@
|
|
|
770
775
|
border-color: #FD8F3E;
|
|
771
776
|
color: #632E03;
|
|
772
777
|
}
|
|
773
|
-
.textAndContent-module_textAndContent__X5P1n {
|
|
774
|
-
align-items: baseline;
|
|
775
|
-
flex-shrink: 1;
|
|
776
|
-
gap: 8px;
|
|
777
|
-
}
|
|
778
778
|
:root {
|
|
779
779
|
--divider-line: #4a4b4b;
|
|
780
780
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";const
|
|
1
|
+
import"../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";const e=(e,t)=>t instanceof Map?{dataType:"Map",value:Array.from(t.entries())}:t,t=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.filter((e=>"string"==typeof e&&null!=e)).filter(Boolean).join(" ")},o=e=>{const t={},o={};return Object.entries(e).forEach((e=>{let[n,l]=e;"data-"===n.substr(0,5)||"data"===n.substr(0,4)?t[n]=l:o[n]=l})),{dataProps:t,restProps:o}},n=function(e){var t;let o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;var r;if(n.tokens=n.tokens||{},null!=l)return n.tokens[e]=l,"".concat(e).concat(null==n||null===(r=n.tokens)||void 0===r?void 0:r[e]);const a=void 0===(null==n?void 0:n.tokens[e])||null===(null==n?void 0:n.tokens[e]);return n.tokens[e]=n.tokens[e]||0,a?"".concat(e,0):o?(n.tokens[e]+=1,"".concat(e).concat(null==n||null===(c=n.tokens)||void 0===c?void 0:c[e])):"".concat(e).concat(null==n||null===(t=n.tokens)||void 0===t?void 0:t[e]);var c},l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_top",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];l.aElement=l.aElement||document.createElement("a");const{aElement:n}=l;return n.setAttribute("href",e),n.setAttribute("target",t),n.dataset.date="".concat(Date.now()),n.click(),o&&(n.remove(),l.aElement=null),n},r=e=>{var t,o,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(o=e.stopPropagation)||void 0===o||o.call(e),null==e||null===(n=e.stopImmediatePropagation)||void 0===n||n.call(e)},a="__eskit_themes__",c={dark:"theme-dark",light:"theme-light"},s=e=>{var t;return null!==(t=(null!=e?e:document.body)[a])&&void 0!==t?t:c},d=(e,t)=>{(null!=t?t:document.body)[a]=e},i=function(e,t){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=s(t),l=e?n.light:n.dark,r=e?n.dark:n.light;t&&(t.classList.remove(l),t.classList.remove(r),t.classList.add(r)),"undefined"!=typeof document&&(document.querySelectorAll(".".concat(l)).forEach((e=>{e.classList.add(".".concat(r)),e.classList.remove(".".concat(l))})),o&&(document.querySelectorAll(".shadow-div").forEach((e=>{var t,o;null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(l)))||void 0===t||t.classList.add(r),null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(l)))||void 0===o||o.classList.remove(l)})),document.querySelectorAll("esmf-wrapper").forEach((e=>{var t,o,n;null===(t=e.shadowRoot)||void 0===t||null===(t=t.querySelector(".".concat(l)))||void 0===t||t.classList.add(r),null===(o=e.shadowRoot)||void 0===o||null===(o=o.querySelector(".".concat(l)))||void 0===o||o.classList.remove(l);const a=null===(n=e.shadowRoot)||void 0===n?void 0:n.childNodes[0];a&&(a.classList.add(r),a.classList.remove(l))}))))},u=(e,t)=>{const o=t||document.body;let n=e||!1;"undefined"!=typeof document&&void 0===e&&(n=document.body.classList.contains(s(o).dark)),i(n,o)},v="change",m=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 o=o=>{const n=e();null==i||i(o,n),null==t||t(o)},n=e=>{o(e.matches)},l=e=>{o(!e.matches)},r=window.matchMedia("(prefers-color-scheme: dark)");try{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(v,n),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(v,l)}catch(e){}return o(null==r?void 0:r.matches),window.matchMedia("(prefers-color-scheme: dark)").addEventListener(v,n),window.matchMedia("(prefers-color-scheme: light)").addEventListener(v,l),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener(v,n),window.matchMedia("(prefers-color-scheme: light)").removeEventListener(v,l)}};export{l as anchorClick,t as classNames,n as generateId,s as getBaseThemes,e as mapSerReplacer,r as noop,m as observeThemePreference,o as parseProps,d as setThemeClassNames,i as switchColorTheme,u as updateColorTheme};
|
|
2
2
|
//# sourceMappingURL=ui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n"],"names":["mapSerReplacer","key","value","Map","dataType","Array","from","entries","classNames","_len","arguments","length","classes","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","forEach","_ref","substr","generateId","token","_generateId$tokens3","increment","undefined","forcedValue","_generateId$tokens","tokens","concat","noValue","_generateId$tokens2","anchorClick","href","target","remove","aElement","document","createElement","setAttribute","dataset","date","Date","now","click","noop","event","_event$preventDefault","_event$stop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nDQ,EACF,GAAAD,OAAUP,EAAQ,GAGhBE,GAGFH,EAAWO,OAAON,IAAU,EAE5BO,GAAAA,OAAUP,GAAKO,OAAGR,SAAkB,QAARU,EAAVV,EAAYO,cAAZG,IAAkBA,OAAlBA,EAAAA,EAAqBT,KAGzCO,GAAAA,OAAUP,GAAKO,OAAGR,SAAkB,QAARE,EAAVF,EAAYO,cAAZL,IAAkBA,OAAlBA,EAAAA,EAAqBD,IARxB,IAAAS,CASjB,EAKaC,EAA4B,SAACC,GAA4E,IAA9DC,EAAM7B,UAAAC,OAAA,QAAAmB,IAAApB,UAAA,GAAAA,UAAA,GAAG,OAAQ8B,EAAM9B,UAAAC,OAAA,QAAAmB,IAAApB,UAAA,IAAAA,UAAA,GAC7E2B,EAAYI,SAAWJ,EAAYI,UAAYC,SAASC,cAAc,KAEtE,MAAMF,SAAEA,GAAaJ,EAYrB,OAVAI,EAASG,aAAa,OAAQN,GAC9BG,EAASG,aAAa,SAAUL,GAEhCE,EAASI,QAAQC,KAAIZ,GAAAA,OAAMa,KAAKC,OAChCP,EAASQ,QACLT,IACFC,EAASD,SACTH,EAAYI,SAAW,MAGlBA,CACT,EAUaS,EAAQC,IAA4B,IAAAC,EAAAC,EAAAC,EAC/CH,SAAqBC,QAAhBA,EAALD,EAAOI,0BAAcH,GAArBA,EAAAI,KAAAL,GACAA,SAAsBE,QAAjBA,EAALF,EAAOM,2BAAeJ,GAAtBA,EAAAG,KAAAL,GACAA,SAA+BG,QAA1BA,EAALH,EAAOO,oCAAwBJ,GAA/BA,EAAAE,KAAAL,EAAmC"}
|
|
1
|
+
{"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n\n/**\n * Type definition for theme map.\n * @typedef {Object} ThemeMap\n * @property {string} dark - CSS class for the dark theme.\n * @property {string} light - CSS class for the light theme.\n */\nexport type ThemeMap = {\n dark: string\n light: string\n}\n\nconst THEME_PROP = '__eskit_themes__'\n\nconst defaultThemes: ThemeMap = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\n/**\n * Reads the theme config stored on the given element.\n * Falls back to defaultThemes when no config has been set.\n * Scoping to the element means different microfrontends (different roots) are isolated,\n * while all bundles targeting the same element share one config.\n * @param {HTMLElement} [element] - The element to read from. Defaults to document.body.\n * @returns {ThemeMap} The current base themes for the element.\n */\nexport const getBaseThemes = (element?: HTMLElement): ThemeMap => {\n const el = element ?? document.body\n\n return (el as unknown as Record<string, unknown>)[THEME_PROP] as ThemeMap ?? defaultThemes\n}\n\n/**\n * Sets the base theme class names on the given element.\n * @param {ThemeMap} themes - CSS classes for dark and light themes.\n * @param {HTMLElement} [element] - The element to store config on. Defaults to document.body.\n */\nexport const setThemeClassNames = (themes: ThemeMap, element?: HTMLElement): void => {\n const el = element ?? document.body\n const store = el as unknown as Record<string, unknown>\n\n store[THEME_PROP] = themes\n}\n\n/**\n * Switches the color theme of the document.\n * @param {boolean} isDark - Flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.\n */\nexport const switchColorTheme = (\n isDark: boolean, htmlElement?: HTMLElement, findShadows = true,\n): void => {\n const themes = getBaseThemes(htmlElement)\n const oldClass = isDark ? themes.light : themes.dark\n const newClass = isDark ? themes.dark : themes.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\n/**\n * Updates the color theme of the document.\n * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n */\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement): void => {\n const el = htmlElement || document.body\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(getBaseThemes(el).dark)\n }\n switchColorTheme(resolvedIsDark, el)\n}\n\nconst windowMatchMediaChangeEventType = 'change'\n\n/**\n * Observes the user's theme preference and applies the appropriate theme.\n * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.\n * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.\n * @returns {() => void} Function to stop observing the theme preference.\n */\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = (): HTMLElement => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean): boolean => isDark,\n): () => void => {\n const switchColorThemeHandler = (isDark: boolean): void => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent): void => {\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"],"names":["mapSerReplacer","key","value","Map","dataType","Array","from","entries","classNames","_len","arguments","length","classes","_key","filter","className","Boolean","join","parseProps","props","dataProps","restProps","Object","forEach","_ref","substr","generateId","token","_generateId$tokens3","increment","undefined","forcedValue","_generateId$tokens","tokens","concat","noValue","_generateId$tokens2","anchorClick","href","target","remove","aElement","document","createElement","setAttribute","dataset","date","Date","now","click","noop","event","_event$preventDefault","_event$stopPropagatio","_event$stopImmediateP","preventDefault","call","stopPropagation","stopImmediatePropagation","THEME_PROP","defaultThemes","dark","light","getBaseThemes","element","_ref2","body","setThemeClassNames","themes","switchColorTheme","isDark","htmlElement","findShadows","oldClass","newClass","classList","add","querySelectorAll","_element$shadowRoot","_element$shadowRoot2","shadowRoot","querySelector","_element$shadowRoot3","_element$shadowRoot4","_element$shadowRoot5","firstChild","childNodes","updateColorTheme","el","resolvedIsDark","contains","windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","switchCallback","switchColorThemeHandler","changeDarkColorThemeHandler","matches","changeLightColorThemeHandler","window","matchMedia","removeEventListener","error","addEventListener"],"mappings":"uFAAaA,EACXA,CAACC,EAAaC,IACVA,aAAiBC,IACZ,CACLC,SAAU,MACVF,MAAOG,MAAMC,KAAKJ,EAAMK,YAGrBL,EAIIM,EAAa,WAAA,IAAA,IAAAC,EAAAC,UAAAC,OAAIC,EAAOP,IAAAA,MAAAI,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAPD,EAAOC,GAAAH,UAAAG,GAAA,OAA2BD,EAC7DE,QAAQC,GAAgD,iBAAdA,GAAP,MAAiCA,IACpED,OAAOE,SAASC,KAAK,IAAI,EAQfC,EAAcC,IACzB,MAAMC,EAAqC,CAAE,EACvCC,EAAqC,CAAE,EAS7C,OAPAC,OAAOf,QAAQY,GAAOI,SAAQC,IAAkB,IAAhBvB,EAAKC,GAAMsB,EAChB,UAArBvB,EAAIwB,OAAO,EAAG,IAAuC,SAArBxB,EAAIwB,OAAO,EAAG,GAChDL,EAAUnB,GAAOC,EAEjBmB,EAAUpB,GAAOC,CACnB,IAEK,CAAEkB,YAAWC,YAAW,EAQpBK,EAAyB,SACpCC,GAGG,IAAAC,EAAA,IAFHC,IAASnB,UAAAC,OAAA,QAAAmB,IAAApB,UAAA,KAAAA,UAAA,GACTqB,EAA+BrB,UAAAC,OAAA,QAAAmB,IAAApB,UAAA,GAAAA,UAAA,QAAGoB,EAIqB,IAAAE,EAAvD,GAFAN,EAAWO,OAASP,EAAWO,QAAU,CAAE,EAEvCF,QAEF,OADAL,EAAWO,OAAON,GAASI,EAC3BG,GAAAA,OAAUP,GAAKO,OAAGR,SAAkB,QAARM,EAAVN,EAAYO,cAAZD,IAAkBA,OAAlBA,EAAAA,EAAqBL,IA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OAAOC,WAAW,iCAAiCG,iBACjDZ,EAAiCO,GAG5B,KACLC,OAAOC,WAAW,gCAAgCC,oBAChDV,EAAiCK,GAEnCG,OAAOC,WAAW,iCAAiCC,oBACjDV,EAAiCO,EAClC,CAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{keyExtractor,keyExtractorFunction}from"./keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./date.js";export{peregrineMQInstance}from"./appState/peregrineMQ/index.js";export{ArrayFirst,ArrayLast}from"./array.js";export{isBirthNumberValid}from"./helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./helpers/fileValidator.js";export{DATE_FORMAT,DATE_TIME_FORMAT,formatDate,formatDateTime,formatDateToTimestamp,getDate}from"./helpers/date.js";export{getDeviceId}from"./helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./helpers/objectOperations.js";export{AsyncFunctionTemplate,debounce,delay,isFunctionAsync,memoize,memoizeComplex,memoizer,nestedTernary}from"./helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./helpers/cancelableDelayedFunction.js";export{anchorClick,classNames,generateId,mapSerReplacer,noop,parseProps}from"./helpers/ui.js";export{composeId,defaultSanitizeConfig,sanitizeHtml}from"./helpers/text.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./webComponents/webComponent.utils.js";export{canSetStateMerge,createStore,getSetStateMerge}from"./appState/store/store.vanillajs.js";export{createDataStore}from"./appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./appState/store/useStore.react.js";export{PeregrineMQ,PeregrineMQClearError}from"./appState/peregrineMQ/peregrineMQ.js";export{NON_EXISTENT_CHANNEL}from"./appState/peregrineMQ/peregrineMQ.types.js";export{usePeregrineMQ}from"./appState/peregrineMQ/usePeregrineMQ.react.js";export{TinyStateMachine,TinyStateMachineEvent,TinyStateMachineEventType,TinyStateMachineState,createStates,stateIterator}from"./appState/stateMachine/tiny-state-machine.base.js";
|
|
1
|
+
export{keyExtractor,keyExtractorFunction}from"./keyExtractor.js";export{dateRangeFormat,getDateTime,getTimeFromNow,getTimeFromNowOriginal,getTimeTo}from"./date.js";export{peregrineMQInstance}from"./appState/peregrineMQ/index.js";export{ArrayFirst,ArrayLast}from"./array.js";export{isBirthNumberValid}from"./helpers/birthnumber.validator.js";export{getMatch,isValidFormat,isValidModulo11,parse,regex}from"./helpers/birthnumberCZSKvalidator.js";export{parseCSVdata,validateCSVFile,validateCSVlines,validateJSONFile,validateLineCellTrimmed,validateLineNumColumns,validateSDFFile}from"./helpers/fileValidator.js";export{DATE_FORMAT,DATE_TIME_FORMAT,formatDate,formatDateTime,formatDateToTimestamp,getDate}from"./helpers/date.js";export{getDeviceId}from"./helpers/deviceInfo.js";export{emailMatch,emailMatcher,regexBuilder}from"./helpers/emailMatcher.js";export{cleanCsvLines,formatFilePath}from"./helpers/file.js";export{arrayToObjectTree,chunkArray,duplicatesInArray,formatJsonString,formatObj,formatObj2}from"./helpers/objectOperations.js";export{AsyncFunctionTemplate,debounce,delay,isFunctionAsync,memoize,memoizeComplex,memoizer,nestedTernary}from"./helpers/other.js";export{escapeRegExp,fileNameExt,findStringInText,normalizeString,removeWhitespaces,sanitizeId,sanitizePathId,toLowerCase,toUpperCase,truncateText}from"./helpers/textValueOperations.js";export{Operation,decrementValue,incerementValue,numberDefined,numberOperation,restrictNumberInLimits,setValue}from"./helpers/valueOperations.js";export{cancelableSetInterval,cancelableSetTimeout}from"./helpers/cancelableDelayedFunction.js";export{anchorClick,classNames,generateId,getBaseThemes,mapSerReplacer,noop,observeThemePreference,parseProps,setThemeClassNames,switchColorTheme,updateColorTheme}from"./helpers/ui.js";export{composeId,defaultSanitizeConfig,sanitizeHtml}from"./helpers/text.js";export{ced,createResolveAttribute,customElementDefine,resolveAttributes}from"./webComponents/webComponent.utils.js";export{canSetStateMerge,createStore,getSetStateMerge}from"./appState/store/store.vanillajs.js";export{createDataStore}from"./appState/store/store.vanillajs.templates.js";export{useStore,useStoreApi}from"./appState/store/useStore.react.js";export{PeregrineMQ,PeregrineMQClearError}from"./appState/peregrineMQ/peregrineMQ.js";export{NON_EXISTENT_CHANNEL}from"./appState/peregrineMQ/peregrineMQ.types.js";export{usePeregrineMQ}from"./appState/peregrineMQ/usePeregrineMQ.react.js";export{TinyStateMachine,TinyStateMachineEvent,TinyStateMachineEventType,TinyStateMachineState,createStates,stateIterator}from"./appState/stateMachine/tiny-state-machine.base.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|