claude-web/node_modules/@primevue/core/basedirective/index.mjs.map

1 line
45 KiB
Plaintext
Raw Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/basedirective/BaseDirective.js"],"sourcesContent":["import { Theme, ThemeService } from '@primeuix/styled';\nimport { getKeyValue, isArray, isEmpty, isFunction, isObject, isString, resolve, toCapitalCase, toFlatCase } from '@primeuix/utils/object';\nimport { uuid } from '@primeuix/utils/uuid';\nimport Base from '@primevue/core/base';\nimport BaseStyle from '@primevue/core/base/style';\nimport PrimeVueService from '@primevue/core/service';\nimport { mergeProps } from 'vue';\n\nconst BaseDirective = {\n _getMeta: (...args) => [isObject(args[0]) ? undefined : args[0], resolve(isObject(args[0]) ? args[0] : args[1])],\n _getConfig: (binding, vnode) => (binding?.instance?.$primevue || vnode?.ctx?.appContext?.config?.globalProperties?.$primevue)?.config,\n _getOptionValue: getKeyValue,\n _getPTValue: (instance = {}, obj = {}, key = '', params = {}, searchInDefaultPT = true) => {\n const getValue = (...args) => {\n const value = BaseDirective._getOptionValue(...args);\n\n return isString(value) || isArray(value) ? { class: value } : value;\n };\n\n const { mergeSections = true, mergeProps: useMergeProps = false } = instance.binding?.value?.ptOptions || instance.$primevueConfig?.ptOptions || {};\n const global = searchInDefaultPT ? BaseDirective._useDefaultPT(instance, instance.defaultPT(), getValue, key, params) : undefined;\n const self = BaseDirective._usePT(instance, BaseDirective._getPT(obj, instance.$name), getValue, key, { ...params, global: global || {} });\n const datasets = BaseDirective._getPTDatasets(instance, key);\n\n return mergeSections || (!mergeSections && self) ? (useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, global, self, datasets) : { ...global, ...self, ...datasets }) : { ...self, ...datasets };\n },\n _getPTDatasets(instance = {}, key = '') {\n const datasetPrefix = 'data-pc-';\n\n return {\n ...(key === 'root' && { [`${datasetPrefix}name`]: toFlatCase(instance.$name) }),\n [`${datasetPrefix}section`]: toFlatCase(key)\n };\n },\n _getPT: (pt, key = '', callback) => {\n const getValue = (value) => {\n const computedValue = callback ? callback(value) : value;\n const _key = toFlatCase(key);\n\n return computedValue?.[_key] ?? computedValue;\n };\n\n return pt && Object.hasOwn(pt, '_usept')\n ? {\n _usept: pt['_usept'],\n originalValue: getValue(pt.originalValue),\n value: getValue(pt.value)\n }\n : getValue(pt);\n },\n _usePT: (instance = {}, pt, callback, key, params) => {\n const fn = (value) => callback(value, key, params);\n\n if (pt && Object.hasOwn(pt, '_usept')) {\n const { mergeSections = true, mergeProps: useMergeProps = false } = pt['_usept'] || instance.$primevueConfig?.ptOptions || {};\n const originalValue = fn(pt.originalValue);\n const value = fn(pt.value);\n\n if (originalValue === undefined && value === undefined) return undefined;\n else if (isString(value)) return value;\n else if (isString(originalValue)) return originalValue;\n\n return mergeSections || (!mergeSections && value) ? (useMergeProps ? BaseDirective._mergeProps(instance, useMergeProps, originalValue, value) : { ...originalValue, ...value }) : value;\n }\n\n return fn(pt);\n },\n _useDefaultPT: (instance = {}, defaultPT = {}, callback, key, params) => {\n return BaseDirective._usePT(instance, defaultPT, callback, key, params);\n },\n _loadStyles: (instance = {}, binding, vnode) => {\n const config = BaseDirective._getConfig(binding, vnode);\n const useStyleOptions = { nonce: config?.csp?.nonce };\n\n BaseDirective._loadCoreStyles(instance, useStyleOptions);\n BaseDirective._loadThemeStyles(instance, useStyleOptions);\n