diff --git a/apps/showcase/doc/common/apidoc/index.json b/apps/showcase/doc/common/apidoc/index.json index ed1837acc..2d0ec4bf0 100644 --- a/apps/showcase/doc/common/apidoc/index.json +++ b/apps/showcase/doc/common/apidoc/index.json @@ -92312,40 +92312,40 @@ "ProgressSpinnerDesignTokens": { "props": [ { - "name": "root.color.1", - "token": "progressspinner.color.1", + "name": "root.colorOne", + "token": "progressspinner.color.one", "optional": true, "readonly": false, "type": "string", "default": "", - "description": "Color.1 of root" + "description": "Color one of root" }, { - "name": "root.color.2", - "token": "progressspinner.color.2", + "name": "root.colorTwo", + "token": "progressspinner.color.two", "optional": true, "readonly": false, "type": "string", "default": "", - "description": "Color.2 of root" + "description": "Color two of root" }, { - "name": "root.color.3", - "token": "progressspinner.color.3", + "name": "root.colorThree", + "token": "progressspinner.color.three", "optional": true, "readonly": false, "type": "string", "default": "", - "description": "Color.3 of root" + "description": "Color three of root" }, { - "name": "root.color.4", - "token": "progressspinner.color.4", + "name": "root.colorFour", + "token": "progressspinner.color.four", "optional": true, "readonly": false, "type": "string", "default": "", - "description": "Color.4 of root" + "description": "Color four of root" } ] } diff --git a/packages/core/src/utils/UniqueComponentId.js b/packages/core/src/utils/UniqueComponentId.js index 4e9c242ff..f7786b140 100755 --- a/packages/core/src/utils/UniqueComponentId.js +++ b/packages/core/src/utils/UniqueComponentId.js @@ -1,5 +1,10 @@ import { uuid } from '@primeuix/utils/uuid'; +/** + * @deprecated since v4.3.0. Use `uuid` from @primeuix/utils instead. + * @param {string} prefix + * @return {string} + */ export default function (prefix = 'pv_id_') { return uuid(prefix); } diff --git a/packages/core/src/utils/Utils.d.ts b/packages/core/src/utils/Utils.d.ts index 9128afc45..6b6bc5ded 100644 --- a/packages/core/src/utils/Utils.d.ts +++ b/packages/core/src/utils/Utils.d.ts @@ -16,4 +16,9 @@ export declare class HelperSet { get(parentInstance?: any, slots?: any): any[] | null | undefined; } +/** + * @deprecated since v4.3.0. Use `uuid` from @primeuix/utils instead. + * @param {string} prefix + * @return {string} + */ export declare function UniqueComponentId(prefix?: string): string; diff --git a/packages/primevue/src/badgedirective/BadgeDirective.js b/packages/primevue/src/badgedirective/BadgeDirective.js index b8788f63e..9aee48505 100644 --- a/packages/primevue/src/badgedirective/BadgeDirective.js +++ b/packages/primevue/src/badgedirective/BadgeDirective.js @@ -1,11 +1,11 @@ import { addClass, createElement, hasClass, removeClass } from '@primeuix/utils/dom'; -import { UniqueComponentId } from '@primevue/core/utils'; +import { uuid } from '@primeuix/utils/uuid'; import BaseBadgeDirective from './BaseBadgeDirective'; const BadgeDirective = BaseBadgeDirective.extend('badge', { mounted(el, binding) { console.warn('Deprecated since v4. Use OverlayBadge component instead.'); - const id = UniqueComponentId() + '_badge'; + const id = uuid('pv_id') + '_badge'; const badge = createElement('span', { id, diff --git a/packages/primevue/src/progressspinner/style/ProgressSpinnerStyle.js b/packages/primevue/src/progressspinner/style/ProgressSpinnerStyle.js index 9e26450c8..d1ee160ed 100644 --- a/packages/primevue/src/progressspinner/style/ProgressSpinnerStyle.js +++ b/packages/primevue/src/progressspinner/style/ProgressSpinnerStyle.js @@ -31,7 +31,7 @@ const theme = ({ dt }) => ` .p-progressspinner-circle { stroke-dasharray: 89, 200; stroke-dashoffset: 0; - stroke: ${dt('progressspinner.color.1')}; + stroke: ${dt('progressspinner.colorOne')}; animation: p-progressspinner-dash 1.5s ease-in-out infinite, p-progressspinner-color 6s ease-in-out infinite; stroke-linecap: round; } @@ -58,17 +58,17 @@ const theme = ({ dt }) => ` @keyframes p-progressspinner-color { 100%, 0% { - stroke: ${dt('progressspinner.color.1')}; + stroke: ${dt('progressspinner.colorOne')}; } 40% { - stroke: ${dt('progressspinner.color.2')}; + stroke: ${dt('progressspinner.colorTwo')}; } 66% { - stroke: ${dt('progressspinner.color.3')}; + stroke: ${dt('progressspinner.colorThree')}; } 80%, 90% { - stroke: ${dt('progressspinner.color.4')}; + stroke: ${dt('progressspinner.colorFour')}; } } `; diff --git a/packages/primevue/src/tooltip/Tooltip.js b/packages/primevue/src/tooltip/Tooltip.js index faa3554e0..4fbc3d0f7 100755 --- a/packages/primevue/src/tooltip/Tooltip.js +++ b/packages/primevue/src/tooltip/Tooltip.js @@ -1,7 +1,8 @@ import { addClass, createElement, fadeIn, findSingle, getAttribute, getOuterHeight, getOuterWidth, getViewport, getWindowScrollLeft, getWindowScrollTop, hasClass, isExist, isTouchDevice, removeClass } from '@primeuix/utils/dom'; import { isEmpty } from '@primeuix/utils/object'; +import { uuid } from '@primeuix/utils/uuid'; import { ZIndex } from '@primeuix/utils/zindex'; -import { ConnectedOverlayScrollHandler, UniqueComponentId } from '@primevue/core/utils'; +import { ConnectedOverlayScrollHandler } from '@primevue/core/utils'; import BaseTooltip from './BaseTooltip'; const Tooltip = BaseTooltip.extend('tooltip', { @@ -17,7 +18,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { target.$_ptooltipEscape = true; target.$_ptooltipClass = null; target.$_ptooltipFitContent = true; - target.$_ptooltipIdAttr = UniqueComponentId() + '_tooltip'; + target.$_ptooltipIdAttr = uuid('pv_id') + '_tooltip'; target.$_ptooltipShowDelay = 0; target.$_ptooltipHideDelay = 0; target.$_ptooltipAutoHide = true; @@ -29,7 +30,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : true; target.$_ptooltipClass = options.value.class || ''; target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true; - target.$_ptooltipIdAttr = options.value.id || UniqueComponentId() + '_tooltip'; + target.$_ptooltipIdAttr = options.value.id || uuid('pv_id') + '_tooltip'; target.$_ptooltipShowDelay = options.value.showDelay || 0; target.$_ptooltipHideDelay = options.value.hideDelay || 0; target.$_ptooltipAutoHide = !!options.value.autoHide === options.value.autoHide ? options.value.autoHide : true; @@ -57,7 +58,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { target.$_ptooltipDisabled = false; target.$_ptooltipEscape = true; target.$_ptooltipClass = null; - target.$_ptooltipIdAttr = target.$_ptooltipIdAttr || UniqueComponentId() + '_tooltip'; + target.$_ptooltipIdAttr = target.$_ptooltipIdAttr || uuid('pv_id') + '_tooltip'; target.$_ptooltipShowDelay = 0; target.$_ptooltipHideDelay = 0; target.$_ptooltipAutoHide = true; @@ -74,7 +75,7 @@ const Tooltip = BaseTooltip.extend('tooltip', { target.$_ptooltipEscape = !!options.value.escape === options.value.escape ? options.value.escape : true; target.$_ptooltipClass = options.value.class || ''; target.$_ptooltipFitContent = !!options.value.fitContent === options.value.fitContent ? options.value.fitContent : true; - target.$_ptooltipIdAttr = options.value.id || target.$_ptooltipIdAttr || UniqueComponentId() + '_tooltip'; + target.$_ptooltipIdAttr = options.value.id || target.$_ptooltipIdAttr || uuid('pv_id') + '_tooltip'; target.$_ptooltipShowDelay = options.value.showDelay || 0; target.$_ptooltipHideDelay = options.value.hideDelay || 0; target.$_ptooltipAutoHide = !!options.value.autoHide === options.value.autoHide ? options.value.autoHide : true; diff --git a/packages/themes/src/presets/aura/progressspinner/index.js b/packages/themes/src/presets/aura/progressspinner/index.js index 30c1c4175..4bdc9eb51 100644 --- a/packages/themes/src/presets/aura/progressspinner/index.js +++ b/packages/themes/src/presets/aura/progressspinner/index.js @@ -2,18 +2,18 @@ export default { colorScheme: { light: { root: { - 'color.1': '{red.500}', - 'color.2': '{blue.500}', - 'color.3': '{green.500}', - 'color.4': '{yellow.500}' + colorOne: '{red.500}', + colorTwo: '{blue.500}', + colorThree: '{green.500}', + colorFour: '{yellow.500}' } }, dark: { root: { - 'color.1': '{red.400}', - 'color.2': '{blue.400}', - 'color.3': '{green.400}', - 'color.4': '{yellow.400}' + colorOne: '{red.400}', + colorTwo: '{blue.400}', + colorThree: '{green.400}', + colorFour: '{yellow.400}' } } } diff --git a/packages/themes/src/presets/lara/progressspinner/index.js b/packages/themes/src/presets/lara/progressspinner/index.js index 4620074b4..219c48bd4 100644 --- a/packages/themes/src/presets/lara/progressspinner/index.js +++ b/packages/themes/src/presets/lara/progressspinner/index.js @@ -2,18 +2,18 @@ export default { colorScheme: { light: { root: { - 'color.1': '{pink.500}', - 'color.2': '{sky.500}', - 'color.3': '{emerald.500}', - 'color.4': '{amber.500}' + colorOne: '{pink.500}', + colorTwo: '{sky.500}', + colorThree: '{emerald.500}', + colorFour: '{amber.500}' } }, dark: { root: { - 'color.1': '{pink.400}', - 'color.2': '{sky.400}', - 'color.3': '{emerald.400}', - 'color.4': '{amber.400}' + colorOne: '{pink.400}', + colorTwo: '{sky.400}', + colorThree: '{emerald.400}', + colorFour: '{amber.400}' } } } diff --git a/packages/themes/src/presets/material/progressspinner/index.js b/packages/themes/src/presets/material/progressspinner/index.js index 30c1c4175..4bdc9eb51 100644 --- a/packages/themes/src/presets/material/progressspinner/index.js +++ b/packages/themes/src/presets/material/progressspinner/index.js @@ -2,18 +2,18 @@ export default { colorScheme: { light: { root: { - 'color.1': '{red.500}', - 'color.2': '{blue.500}', - 'color.3': '{green.500}', - 'color.4': '{yellow.500}' + colorOne: '{red.500}', + colorTwo: '{blue.500}', + colorThree: '{green.500}', + colorFour: '{yellow.500}' } }, dark: { root: { - 'color.1': '{red.400}', - 'color.2': '{blue.400}', - 'color.3': '{green.400}', - 'color.4': '{yellow.400}' + colorOne: '{red.400}', + colorTwo: '{blue.400}', + colorThree: '{green.400}', + colorFour: '{yellow.400}' } } } diff --git a/packages/themes/src/presets/nora/progressspinner/index.js b/packages/themes/src/presets/nora/progressspinner/index.js index 30c1c4175..4bdc9eb51 100644 --- a/packages/themes/src/presets/nora/progressspinner/index.js +++ b/packages/themes/src/presets/nora/progressspinner/index.js @@ -2,18 +2,18 @@ export default { colorScheme: { light: { root: { - 'color.1': '{red.500}', - 'color.2': '{blue.500}', - 'color.3': '{green.500}', - 'color.4': '{yellow.500}' + colorOne: '{red.500}', + colorTwo: '{blue.500}', + colorThree: '{green.500}', + colorFour: '{yellow.500}' } }, dark: { root: { - 'color.1': '{red.400}', - 'color.2': '{blue.400}', - 'color.3': '{green.400}', - 'color.4': '{yellow.400}' + colorOne: '{red.400}', + colorTwo: '{blue.400}', + colorThree: '{green.400}', + colorFour: '{yellow.400}' } } } diff --git a/packages/themes/types/progressspinner/index.d.ts b/packages/themes/types/progressspinner/index.d.ts index 02185e3da..947e16450 100644 --- a/packages/themes/types/progressspinner/index.d.ts +++ b/packages/themes/types/progressspinner/index.d.ts @@ -16,28 +16,28 @@ export interface ProgressSpinnerDesignTokens extends ColorSchemeDesignToken