Fixed #7173 - Eslint 9 version update changes

pull/7007/merge
tugcekucukoglu 2025-01-31 12:53:30 +03:00
parent 0f58abbec9
commit 2a2c07ddb2
38 changed files with 9318 additions and 3042 deletions

View File

@ -1,99 +0,0 @@
module.exports = {
root: true,
env: {
node: true,
jest: true
},
extends: ['plugin:nuxt/recommended', 'plugin:vue/vue3-essential', 'prettier'],
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
babelOptions: {
parserOpts: {
plugins: ['typescript']
}
}
},
plugins: ['prettier'],
ignorePatterns: ['**/public/**', '**/dist/**'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-fallthrough': 'off',
'vue/this-in-template': ['error', 'never'],
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
'vue/component-tags-order': [
'error',
{
order: ['template', 'script', 'style']
}
],
'vue/require-explicit-emits': [
'error',
{
allowProps: false
}
],
'vue/attributes-order': [
'error',
{
order: ['CONDITIONALS', 'LIST_RENDERING', 'DEFINITION', ['UNIQUE', 'SLOT'], 'RENDER_MODIFIERS', 'GLOBAL', 'TWO_WAY_BINDING', 'OTHER_DIRECTIVES', ['OTHER_ATTR', 'EVENTS'], 'CONTENT'],
alphabetical: false
}
],
'vue/order-in-components': [
'error',
{
order: [
'el',
'name',
'key',
'parent',
'functional',
'extends',
'mixins',
['delimiters', 'comments'],
'ROUTER_GUARDS',
'layout',
'middleware',
'validate',
'scrollToTop',
'transition',
'loading',
'inheritAttrs',
'model',
'emits',
'setup',
'fetch',
'head',
['props', 'propsData'],
['provide', 'inject'],
'asyncData',
'data',
'watch',
'watchQuery',
'LIFECYCLE_HOOKS',
'methods',
'computed',
['components', 'directives', 'filters'],
['template', 'render'],
'renderError'
]
}
],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'any', prev: ['case', 'default'], next: 'break' },
{ blankLine: 'any', prev: 'case', next: 'case' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: ['import'], next: ['const', 'let', 'var'] }
]
}
};

View File

@ -11,7 +11,7 @@ PrimeVue is a rich set of open source UI Components for Vue. See [PrimeVue homep
## Packages ## Packages
| Name | Version | | Name | Version |
| --- | --- | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [primevue](https://github.com/primefaces/primevue/tree/master/packages/primevue) | [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) | | [primevue](https://github.com/primefaces/primevue/tree/master/packages/primevue) | [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue) |
| [@primevue/core](https://github.com/primefaces/primevue/tree/master/packages/core) | [![npm version](https://badge.fury.io/js/@primevue%2Fcore.svg)](https://badge.fury.io/js/@primevue%2Fcore) | | [@primevue/core](https://github.com/primefaces/primevue/tree/master/packages/core) | [![npm version](https://badge.fury.io/js/@primevue%2Fcore.svg)](https://badge.fury.io/js/@primevue%2Fcore) |
| [@primevue/icons](https://github.com/primefaces/primevue/tree/master/packages/icons) | [![npm version](https://badge.fury.io/js/@primevue%2Ficons.svg)](https://badge.fury.io/js/@primevue%2Ficons) | | [@primevue/icons](https://github.com/primefaces/primevue/tree/master/packages/icons) | [![npm version](https://badge.fury.io/js/@primevue%2Ficons.svg)](https://badge.fury.io/js/@primevue%2Ficons) |

View File

@ -28,7 +28,7 @@ const core_dependencies = {
// create-vue -> https://github.com/vuejs/create-vue // create-vue -> https://github.com/vuejs/create-vue
const getVueApp = (props = {}, sourceType) => { const getVueApp = (props = {}, sourceType) => {
const path = 'src/'; const path = 'src/';
const { code: sources, title = 'primevue_demo', description = '', service, extPages, dependencies: deps, component, extFiles } = props; const { code: sources, title = 'primevue_demo', description = '', service, dependencies: deps, component, extFiles } = props;
const dependencies = { ...core_dependencies, ...deps }; const dependencies = { ...core_dependencies, ...deps };
const fileExtension = '.vue'; const fileExtension = '.vue';
@ -827,7 +827,7 @@ export default {
} }
} }
}; };
<\/script> </script>
` `
}, },
[`${path}plugins/appState.js`]: { [`${path}plugins/appState.js`]: {

View File

@ -40,7 +40,9 @@ export const getPTOptions = (name) => {
}; };
export const getStyleOptions = (name) => { export const getStyleOptions = (name) => {
const { members = [] } = APIDocs[name.toLowerCase() + 'style']?.enumerations?.values?.[`${name}Classes`]; const styleDoc = APIDocs[name.toLowerCase() + 'style'];
const enumValues = styleDoc && styleDoc.enumerations && styleDoc.enumerations.values;
const { members = [] } = enumValues ? enumValues[`${name}Classes`] || {} : {};
let data = []; let data = [];
for (const member of members) { for (const member of members) {
@ -59,8 +61,11 @@ export const getTokenOptions = (name) => {
const values = APIDocs[`themes/${name.toLowerCase()}`]?.tokens?.values; const values = APIDocs[`themes/${name.toLowerCase()}`]?.tokens?.values;
let data = []; let data = [];
for (const [key, value] of Object.entries(values || {})) { if (values) {
for (const tokens of value?.props) { /* eslint-disable-next-line no-unused-vars */
for (const [key, value] of Object.entries(values)) {
if (value && value.props) {
for (const tokens of value.props) {
const { token, description } = tokens; const { token, description } = tokens;
const designToken = $dt(token); const designToken = $dt(token);
@ -71,6 +76,8 @@ export const getTokenOptions = (name) => {
}); });
} }
} }
}
}
return data; return data;
}; };

View File

@ -3,7 +3,7 @@ import PrimeVue from 'primevue/config';
import { reactive } from 'vue'; import { reactive } from 'vue';
const $appState = { const $appState = {
install: (Vue, options) => { install: (Vue) => {
Vue.config.globalProperties.$appState = reactive({ Vue.config.globalProperties.$appState = reactive({
preset: 'Aura', preset: 'Aura',
primary: 'noir', primary: 'noir',

View File

@ -103,10 +103,10 @@ const getTypeDoc = (typeDocOptions) => {
description: '', description: '',
values: [] values: []
}; };
const emit = { // const emit = {
description: staticMessages['emit'], // description: staticMessages['emit'],
values: [] // values: []
}; // };
if (component_props) { if (component_props) {
props.description = component_props.comment ? component_props.comment.summary.map((s) => parseText(s.text || '')).join(' ') : ''; props.description = component_props.comment ? component_props.comment.summary.map((s) => parseText(s.text || '')).join(' ') : '';
@ -615,18 +615,16 @@ const getTypeDoc = (typeDocOptions) => {
module_interfaces_group && module_interfaces_group &&
module_interfaces_group.children.forEach((event) => { module_interfaces_group.children.forEach((event) => {
const event_props_description = event.comment && event.comment.summary.map((s) => s.text || '').join(' '); const event_props_description = event.comment && event.comment.summary.map((s) => s.text || '').join(' ');
let component_prop = ''; // let component_prop = '';
// if (event.comment && event.comment.getTag('@see')) {
if (event.comment && event.comment.getTag('@see')) { // const tag = event.comment.getTag('@see');
const tag = event.comment.getTag('@see'); // const content = tag.content[0];
const content = tag.content[0]; // if (content.text.includes("['")) {
// component_prop = `${content.target.name}${content.text}`;
if (content.text.includes("['")) { // } else {
component_prop = `${content.target.name}${content.text}`; // component_prop = `${content.text === content.target?.name ? content.target.parent.name : content.target?.name}.${content.text}`;
} else { // }
component_prop = `${content.text === content.target?.name ? content.target.parent.name : content.target?.name}.${content.text}`; // }
}
}
!doc[name]['tokens'] && !doc[name]['tokens'] &&
(doc[name]['tokens'] = { (doc[name]['tokens'] = {

View File

@ -1,4 +1,4 @@
export default defineEventHandler((event) => { export default defineEventHandler(() => {
return { return {
headers: { 'Access-Control-Allow-Origin': '*' }, headers: { 'Access-Control-Allow-Origin': '*' },
statusCode: 200, statusCode: 200,

View File

@ -15,10 +15,6 @@
"jsx": "preserve", "jsx": "preserve",
"incremental": true "incremental": true
}, },
"include": [ "include": ["../../packages/primevue/src/**/*.d.ts", "../../packages/forms/src/**/*.d.ts", "../../node_modules/@primeuix/themes/types/**/*.d.ts"],
"../../packages/primevue/src/**/*.d.ts",
"../../packages/forms/src/**/*.d.ts",
"../../node_modules/@primeuix/themes/types/**/*.d.ts"
],
"exclude": ["node_modules", "**/node_modules", "**/dist"] "exclude": ["node_modules", "**/node_modules", "**/dist"]
} }

130
eslint.config.mjs Normal file
View File

@ -0,0 +1,130 @@
import eslint from '@eslint/js';
import eslintPluginVue from 'eslint-plugin-vue';
import globals from 'globals';
export default [
eslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
vi: 'readonly',
defineNuxtConfig: 'readonly',
defineNuxtPlugin: 'readonly',
defineNuxtLink: 'readonly',
defineNuxtRouteMiddleware: 'readonly',
defineEventHandler: 'readonly',
useRuntimeConfig: 'readonly',
useNuxtApp: 'readonly'
}
},
rules: {
'no-empty': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-fallthrough': 'off',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'any', prev: ['case', 'default'], next: 'break' },
{ blankLine: 'any', prev: 'case', next: 'case' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: ['import'], next: ['const', 'let', 'var'] }
]
}
},
{
files: ['vue'],
plugins: {
vue: eslintPluginVue
},
rules: {
'vue/valid-template-root': 'error',
'vue/no-multiple-template-root': 'off',
'vue/this-in-template': ['error', 'never'],
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
'vue/component-tags-order': [
'error',
{
order: ['template', 'script', 'style']
}
],
'vue/require-explicit-emits': [
'error',
{
allowProps: false
}
],
'vue/attributes-order': [
'error',
{
order: ['CONDITIONALS', 'LIST_RENDERING', 'DEFINITION', ['UNIQUE', 'SLOT'], 'RENDER_MODIFIERS', 'GLOBAL', 'TWO_WAY_BINDING', 'OTHER_DIRECTIVES', ['OTHER_ATTR', 'EVENTS'], 'CONTENT'],
alphabetical: false
}
],
'vue/order-in-components': [
'error',
{
order: [
'el',
'name',
'key',
'parent',
'functional',
'extends',
'mixins',
['delimiters', 'comments'],
'ROUTER_GUARDS',
'layout',
'middleware',
'validate',
'scrollToTop',
'transition',
'loading',
'inheritAttrs',
'model',
'emits',
'setup',
'fetch',
'head',
['props', 'propsData'],
['provide', 'inject'],
'asyncData',
'data',
'watch',
'watchQuery',
'LIFECYCLE_HOOKS',
'methods',
'computed',
['components', 'directives', 'filters'],
['template', 'render'],
'renderError'
]
}
]
}
},
{
files: ['**/*.{js,mjs,cjs,ts'],
plugins: {
vue: eslintPluginVue
},
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
}
}
},
{
ignores: ['**/dist/**', '**/node_modules/**', '**/.nuxt/**', 'build/**', '**/prism.js']
}
];

6210
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -37,29 +37,28 @@
"hot:dev": "DEV_ENV=hot pnpm --filter showcase dev", "hot:dev": "DEV_ENV=hot pnpm --filter showcase dev",
"module:dev": "pnpm --filter @primevue/nuxt-module dev", "module:dev": "pnpm --filter @primevue/nuxt-module dev",
"security:check": "pnpm audit --prod --audit-level high", "security:check": "pnpm audit --prod --audit-level high",
"format": "prettier --write \"**/*.{vue,js,mjs,ts,d.ts}\" --cache", "lint": "eslint .",
"format:check": "prettier --check \"**/*.{vue,js,mjs,ts,d.ts}\"", "lint:fix": "eslint . --fix",
"lint": "eslint --ext \".vue,.js,.mjs,.ts\" --ignore-path .gitignore . --cache", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"lint:fix": "eslint --fix --ext \".vue,.js,.mjs,.ts\" --ignore-path .gitignore .", "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md}\"",
"test:unit": "pnpm --filter primevue test:unit" "test:unit": "pnpm --filter primevue test:unit"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.18.9",
"@babel/preset-env": "^7.21.5", "@babel/preset-env": "^7.21.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-terser": "^0.4.4",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0",
"pnpm": "^9.6.0",
"prettier": "3.4.2",
"rollup-plugin-postcss": "^4.0.0", "rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-vue": "^6.0.0-beta.9", "rollup-plugin-vue": "^6.0.0-beta.9",
"eslint": "^8.30.0", "typescript": "^4.9.4"
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-nuxt": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.4.0",
"typescript": "^4.9.4",
"prettier": "2.7.1",
"pnpm": "^9.6.0"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -203,7 +203,6 @@ function addStyle() {
try { try {
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => { fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => {
if (/\.js$/.test(file)) { if (/\.js$/.test(file)) {
const name = file.split(/(.js)$/)[0].toLowerCase();
const input = process.env.INPUT_DIR + folderName + '/style/' + file; const input = process.env.INPUT_DIR + folderName + '/style/' + file;
const output = process.env.OUTPUT_DIR + folderName + '/style/index'; const output = process.env.OUTPUT_DIR + folderName + '/style/index';

View File

@ -40,7 +40,7 @@ const BaseDirective = {
return computedValue?.[_key] ?? computedValue; return computedValue?.[_key] ?? computedValue;
}; };
return pt?.hasOwnProperty('_usept') return Object.hasOwn(pt, '_usept')
? { ? {
_usept: pt['_usept'], _usept: pt['_usept'],
originalValue: getValue(pt.originalValue), originalValue: getValue(pt.originalValue),
@ -51,7 +51,7 @@ const BaseDirective = {
_usePT: (instance = {}, pt, callback, key, params) => { _usePT: (instance = {}, pt, callback, key, params) => {
const fn = (value) => callback(value, key, params); const fn = (value) => callback(value, key, params);
if (pt?.hasOwnProperty('_usept')) { if (Object.hasOwn(pt, '_usept')) {
const { mergeSections = true, mergeProps: useMergeProps = false } = pt['_usept'] || instance.$primevueConfig?.ptOptions || {}; const { mergeSections = true, mergeProps: useMergeProps = false } = pt['_usept'] || instance.$primevueConfig?.ptOptions || {};
const originalValue = fn(pt.originalValue); const originalValue = fn(pt.originalValue);
const value = fn(pt.value); const value = fn(pt.value);
@ -152,6 +152,7 @@ const BaseDirective = {
selfHook?.(instance, options); selfHook?.(instance, options);
defaultHook?.(instance, options); defaultHook?.(instance, options);
}, },
/* eslint-disable-next-line no-unused-vars */
_mergeProps(instance = {}, fn, ...args) { _mergeProps(instance = {}, fn, ...args) {
return isFunction(fn) ? fn(...args) : mergeProps(...args); return isFunction(fn) ? fn(...args) : mergeProps(...args);
}, },

View File

@ -4,7 +4,8 @@ declare type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomP
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
export declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> export declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> =
Options extends Array<infer V>
? (e: V, ...args: any[]) => void ? (e: V, ...args: any[]) => void
: {} extends Options : {} extends Options
? (e: string, ...args: any[]) => void ? (e: string, ...args: any[]) => void

View File

@ -198,7 +198,6 @@ function addStyle() {
try { try {
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => { fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => {
if (/\.js$/.test(file)) { if (/\.js$/.test(file)) {
const name = file.split(/(.js)$/)[0].toLowerCase();
const input = process.env.INPUT_DIR + folderName + '/style/' + file; const input = process.env.INPUT_DIR + folderName + '/style/' + file;
const output = process.env.OUTPUT_DIR + folderName + '/style/index'; const output = process.env.OUTPUT_DIR + folderName + '/style/index';

View File

@ -33,6 +33,7 @@ function watchPausable(source, callback, options) {
// @todo: move to utils // @todo: move to utils
function groupKeys(obj) { function groupKeys(obj) {
return Object.entries(obj).reduce((result, [key, value]) => { return Object.entries(obj).reduce((result, [key, value]) => {
/* eslint-disable-next-line no-useless-escape */
key.split(/[\.\[\]]+/) key.split(/[\.\[\]]+/)
.filter(Boolean) .filter(Boolean)
.reduce((acc, curr, idx, arr) => (acc[curr] ??= isNaN(arr[idx + 1]) ? (idx === arr.length - 1 ? value : {}) : []), result); .reduce((acc, curr, idx, arr) => (acc[curr] ??= isNaN(arr[idx + 1]) ? (idx === arr.length - 1 ? value : {}) : []), result);
@ -55,6 +56,7 @@ function getValueByPath(obj, path) {
// do nothing and continue to other methods to resolve path data // do nothing and continue to other methods to resolve path data
} }
/* eslint-disable-next-line no-useless-escape */
const keys = path.split(/[\.\[\]]+/).filter(Boolean); const keys = path.split(/[\.\[\]]+/).filter(Boolean);
return keys.reduce((acc, key) => (acc && acc[key] !== undefined ? acc[key] : undefined), obj); return keys.reduce((acc, key) => (acc && acc[key] !== undefined ? acc[key] : undefined), obj);
@ -118,10 +120,10 @@ export const useForm = (options = {}) => {
validateFieldOn(field, fieldOptions, 'validateOnBlur'); validateFieldOn(field, fieldOptions, 'validateOnBlur');
}, },
onInput: (event) => { onInput: (event) => {
_states[field].value = event.hasOwnProperty('value') ? event.value : event.target.value; _states[field].value = Object.hasOwn(event, 'value') ? event.value : event.target.value;
}, },
onChange: (event) => { onChange: (event) => {
_states[field].value = event.hasOwnProperty('value') ? event.value : event.target.type === 'checkbox' || event.target.type === 'radio' ? event.target.checked : event.target.value; _states[field].value = Object.hasOwn(event, 'value') ? event.value : event.target.type === 'checkbox' || event.target.type === 'radio' ? event.target.checked : event.target.value;
}, },
onInvalid: (errors) => { onInvalid: (errors) => {
_states[field].invalid = true; _states[field].invalid = true;

View File

@ -201,7 +201,6 @@ function addStyle() {
try { try {
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => { fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => {
if (/\.js$/.test(file)) { if (/\.js$/.test(file)) {
const name = file.split(/(.js)$/)[0].toLowerCase();
const input = process.env.INPUT_DIR + folderName + '/style/' + file; const input = process.env.INPUT_DIR + folderName + '/style/' + file;
const output = process.env.OUTPUT_DIR + folderName + '/style/index'; const output = process.env.OUTPUT_DIR + folderName + '/style/index';

View File

@ -22,22 +22,18 @@ npx nuxi@latest module add primevue
```js ```js
{ {
modules: [ modules: ['@primevue/nuxt-module'];
'@primevue/nuxt-module'
]
} }
``` ```
That's it! You can now use `@primevue/nuxt-module` in your Nuxt app ✨ That's it! You can now use `@primevue/nuxt-module` in your Nuxt app ✨
<!-- Badges --> <!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/@primevue/nuxt-module/latest.svg?color [npm-version-src]: https://img.shields.io/npm/v/@primevue/nuxt-module/latest.svg?color
[npm-version-href]: https://npmjs.com/package/@primevue/nuxt-module [npm-version-href]: https://npmjs.com/package/@primevue/nuxt-module
[npm-downloads-src]: https://img.shields.io/npm/dm/@primevue/nuxt-module [npm-downloads-src]: https://img.shields.io/npm/dm/@primevue/nuxt-module
[npm-downloads-href]: https://npmjs.com/package/@primevue/nuxt-module [npm-downloads-href]: https://npmjs.com/package/@primevue/nuxt-module
[discord-src]: https://img.shields.io/discord/557940238991753223.svg?colorB=7289da&label=chat&logo=discord [discord-src]: https://img.shields.io/discord/557940238991753223.svg?colorB=7289da&label=chat&logo=discord
[license-src]: https://img.shields.io/npm/l/@primevue/nuxt-module.svg?style=flat&colorB=yellow [license-src]: https://img.shields.io/npm/l/@primevue/nuxt-module.svg?style=flat&colorB=yellow
[license-href]: https://npmjs.com/package/@primevue/nuxt-module [license-href]: https://npmjs.com/package/@primevue/nuxt-module

View File

@ -215,7 +215,6 @@ function addStyle() {
try { try {
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => { fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => {
if (/\.js$/.test(file)) { if (/\.js$/.test(file)) {
const name = file.split(/(.js)$/)[0].toLowerCase();
const input = process.env.INPUT_DIR + folderName + '/style/' + file; const input = process.env.INPUT_DIR + folderName + '/style/' + file;
const output = process.env.OUTPUT_DIR + folderName + '/style/index'; const output = process.env.OUTPUT_DIR + folderName + '/style/index';

View File

@ -20,7 +20,7 @@ const classes = {
} }
], ],
pcInputText: 'p-autocomplete-input', pcInputText: 'p-autocomplete-input',
inputMultiple: ({ props, instance }) => [ inputMultiple: ({ instance }) => [
'p-autocomplete-input-multiple', 'p-autocomplete-input-multiple',
{ {
'p-variant-filled': instance.$variant === 'filled' 'p-variant-filled': instance.$variant === 'filled'

View File

@ -1,4 +1,4 @@
import { addClass, removeClass } from '@primeuix/utils/dom'; import { addClass } from '@primeuix/utils/dom';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import PrimeVue from 'primevue/config'; import PrimeVue from 'primevue/config';
import { describe, expect, it, vi } from 'vitest'; import { describe, expect, it, vi } from 'vitest';

View File

@ -2,7 +2,7 @@ import { style } from '@primeuix/styles/floatlabel';
import BaseStyle from '@primevue/core/base/style'; import BaseStyle from '@primevue/core/base/style';
const classes = { const classes = {
root: ({ instance, props }) => [ root: ({ props }) => [
'p-floatlabel', 'p-floatlabel',
{ {
'p-floatlabel-over': props.variant === 'over', 'p-floatlabel-over': props.variant === 'over',

View File

@ -9,7 +9,7 @@ const KeyFilter = BaseKeyFilter.extend('keyfilter', {
target.$_pkeyfilterModifier = this.getModifiers(options); target.$_pkeyfilterModifier = this.getModifiers(options);
if (typeof options.value) { if (options.value !== undefined) {
target.$_pkeyfilterPattern = options.value?.pattern || options.value; target.$_pkeyfilterPattern = options.value?.pattern || options.value;
target.$_pkeyfilterValidateOnly = options.value?.validateOnly || false; target.$_pkeyfilterValidateOnly = options.value?.validateOnly || false;
} }
@ -26,7 +26,7 @@ const KeyFilter = BaseKeyFilter.extend('keyfilter', {
target.$_pkeyfilterModifier = this.getModifiers(options); target.$_pkeyfilterModifier = this.getModifiers(options);
this.unbindEvents(el, options); this.unbindEvents(el, options);
if (typeof options.value) { if (options.value !== undefined) {
target.$_pkeyfilterPattern = options.value?.pattern || options.value; target.$_pkeyfilterPattern = options.value?.pattern || options.value;
target.$_pkeyfilterValidateOnly = options.value?.validateOnly || false; target.$_pkeyfilterValidateOnly = options.value?.validateOnly || false;
} }
@ -38,14 +38,14 @@ const KeyFilter = BaseKeyFilter.extend('keyfilter', {
}, },
DEFAULT_PATTERNS: { DEFAULT_PATTERNS: {
pint: /[\d]/, pint: /[\d]/,
int: /[\d\-]/, int: /[\d-]/,
pnum: /[\d\.]/, pnum: /[\d.]/,
money: /[\d\.\s,]/, money: /[\d.\s,]/,
num: /[\d\-\.]/, num: /[\d-.]/,
hex: /[0-9a-f]/i, hex: /[0-9a-f]/i,
email: /[a-z0-9_\.\-@]/i, email: /[a-z0-9_.-@]/i,
alpha: /[a-z_]/i, alpha: /[a-z_]/i,
alphanum: /[a-z0-9_]/i alphanum: /[a-z0-9_]/
}, },
methods: { methods: {
getTarget(el) { getTarget(el) {

View File

@ -503,7 +503,7 @@ const Tooltip = BaseTooltip.extend('tooltip', {
return targetLeft + width > viewport.width || targetLeft < 0 || targetTop < 0 || targetTop + height > viewport.height; return targetLeft + width > viewport.width || targetLeft < 0 || targetTop < 0 || targetTop + height > viewport.height;
}, },
getTarget(el) { getTarget(el) {
return hasClass(el, 'p-inputwrapper') ? findSingle(el, 'input') ?? el : el; return hasClass(el, 'p-inputwrapper') ? (findSingle(el, 'input') ?? el) : el;
}, },
getModifiers(options) { getModifiers(options) {
// modifiers // modifiers

File diff suppressed because it is too large Load Diff