@ctrliq/quantic-components 1.62.1 → 1.62.2
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/index.js.map +1 -1
- package/dist/meta/index.js.map +1 -1
- package/dist/quantic-components.js +8 -7
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +2 -2
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/shared/shared.utils.d.ts +0 -7
- package/dist/shared/shared.utils.js +7 -4
- package/dist/tooltip/tooltip.js +2 -3
- package/dist/types/shared/shared.utils.d.ts +0 -7
- package/package.json +1 -1
|
@@ -5,13 +5,6 @@ export declare function clamp(value: number, min: number, max: number): number;
|
|
|
5
5
|
* Pass a function that returns the CSS declarations for each color token.
|
|
6
6
|
*/
|
|
7
7
|
export declare function generateColorStyles(declarations: (color: ComponentColor) => string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Generates a unique ID with an optional prefix.
|
|
10
|
-
* Uses crypto.randomUUID() when available, falls back to Math.random().
|
|
11
|
-
*
|
|
12
|
-
* @param prefix Optional prefix for the generated ID
|
|
13
|
-
* @returns A unique ID string
|
|
14
|
-
*/
|
|
15
8
|
export declare function generateId(prefix?: string): string;
|
|
16
9
|
/**
|
|
17
10
|
* Removes null, undefined and empty string values from an array.
|
|
@@ -13,15 +13,18 @@ export function generateColorStyles(declarations) {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Generates a unique ID with an optional prefix.
|
|
16
|
-
* Uses crypto.randomUUID() when available, falls back to Math.random().
|
|
17
16
|
*
|
|
18
17
|
* @param prefix Optional prefix for the generated ID
|
|
19
18
|
* @returns A unique ID string
|
|
20
19
|
*/
|
|
20
|
+
function randomUUID() {
|
|
21
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
22
|
+
const r = (Math.random() * 16) | 0;
|
|
23
|
+
return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
21
26
|
export function generateId(prefix) {
|
|
22
|
-
const id =
|
|
23
|
-
? crypto.randomUUID()
|
|
24
|
-
: Math.random().toString(36).substring(2);
|
|
27
|
+
const id = randomUUID();
|
|
25
28
|
return prefix ? `${prefix}-${id}` : id;
|
|
26
29
|
}
|
|
27
30
|
/**
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -11,6 +11,7 @@ import { computePosition, flip, shift, offset, arrow, autoUpdate, } from '@float
|
|
|
11
11
|
import { TooltipPlacement, TooltipSize } from './index.constants';
|
|
12
12
|
import { TooltipPopup } from './tooltip-popup';
|
|
13
13
|
import { prop } from '../shared/component-meta.decorators';
|
|
14
|
+
import { generateId } from '../shared/shared.utils';
|
|
14
15
|
TooltipPopup.ensureDefined();
|
|
15
16
|
export { TooltipPlacement, TooltipSize } from './index.constants';
|
|
16
17
|
let Tooltip = class Tooltip extends QuanticElement {
|
|
@@ -23,9 +24,7 @@ let Tooltip = class Tooltip extends QuanticElement {
|
|
|
23
24
|
this.disabled = false;
|
|
24
25
|
this.offset = 8;
|
|
25
26
|
this.open = false;
|
|
26
|
-
this.tooltipId =
|
|
27
|
-
? crypto.randomUUID()
|
|
28
|
-
: Math.random().toString(36)}`;
|
|
27
|
+
this.tooltipId = generateId('tooltip');
|
|
29
28
|
this.contentElements = [];
|
|
30
29
|
this.handleMouseEnter = () => {
|
|
31
30
|
if (this.disabled || this.open)
|
|
@@ -5,13 +5,6 @@ export declare function clamp(value: number, min: number, max: number): number;
|
|
|
5
5
|
* Pass a function that returns the CSS declarations for each color token.
|
|
6
6
|
*/
|
|
7
7
|
export declare function generateColorStyles(declarations: (color: ComponentColor) => string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Generates a unique ID with an optional prefix.
|
|
10
|
-
* Uses crypto.randomUUID() when available, falls back to Math.random().
|
|
11
|
-
*
|
|
12
|
-
* @param prefix Optional prefix for the generated ID
|
|
13
|
-
* @returns A unique ID string
|
|
14
|
-
*/
|
|
15
8
|
export declare function generateId(prefix?: string): string;
|
|
16
9
|
/**
|
|
17
10
|
* Removes null, undefined and empty string values from an array.
|