Ports from v3

pull/5880/head
tugcekucukoglu 2024-06-12 17:55:24 +03:00
parent 895532cfe7
commit 411d002834
14 changed files with 28 additions and 13 deletions

View File

@ -55,7 +55,7 @@
:aria-posinset="i + 1" :aria-posinset="i + 1"
v-bind="ptm('chipItem')" v-bind="ptm('chipItem')"
> >
<slot name="chip" :class="cx('pcChip')" :value="option" :index="i" :removeCallback="(event) => removeOption(event, i)"> <slot name="chip" :class="cx('pcChip')" :value="option" :index="i" :removeCallback="(event) => removeOption(event, i)" v-bind="ptm('pcChip')">
<!-- TODO: removetokenicon and removeTokenIcon deprecated since v4.0. Use chipicon slot and chipIcon prop--> <!-- TODO: removetokenicon and removeTokenIcon deprecated since v4.0. Use chipicon slot and chipIcon prop-->
<Chip :class="cx('pcChip')" :label="getOptionLabel(option)" :removeIcon="chipIcon || removeTokenIcon" removable :unstyled="unstyled" @remove="removeOption($event, i)" :pt="ptm('pcChip')"> <Chip :class="cx('pcChip')" :label="getOptionLabel(option)" :removeIcon="chipIcon || removeTokenIcon" removable :unstyled="unstyled" @remove="removeOption($event, i)" :pt="ptm('pcChip')">
<template #removeicon> <template #removeicon>

View File

@ -129,7 +129,7 @@ export interface DataTableSortMeta {
/** /**
* Column field * Column field
*/ */
field: string; field: string | ((item: any) => string) | undefined;
/** /**
* Column sort order * Column sort order
*/ */

View File

@ -180,6 +180,10 @@ export default {
type: String, type: String,
default: null default: null
}, },
name: {
type: String,
default: null
},
id: { id: {
type: String, type: String,
default: null default: null

View File

@ -731,6 +731,10 @@ export interface DatePickerProps {
* Placeholder text for the input. * Placeholder text for the input.
*/ */
placeholder?: string | undefined; placeholder?: string | undefined;
/**
* Name of the element.
*/
name?: string | undefined;
/** /**
* A valid query selector or an HTMLElement to specify where the overlay gets attached. * A valid query selector or an HTMLElement to specify where the overlay gets attached.
* @defaultValue body * @defaultValue body

View File

@ -9,6 +9,7 @@
:style="inputStyle" :style="inputStyle"
:value="inputFieldValue" :value="inputFieldValue"
:placeholder="placeholder" :placeholder="placeholder"
:name="name"
:invalid="invalid" :invalid="invalid"
:variant="variant" :variant="variant"
:unstyled="unstyled" :unstyled="unstyled"

View File

@ -129,6 +129,10 @@ export default {
this.$emit('blur', event); this.$emit('blur', event);
}, },
onKeyDown(event) { onKeyDown(event) {
if (event.ctrlKey || event.metaKey) {
return;
}
switch (event.code) { switch (event.code) {
case 'ArrowLeft': case 'ArrowLeft':
this.moveToPrev(event); this.moveToPrev(event);

View File

@ -391,7 +391,7 @@ export interface ListboxProps {
emptyFilterMessage?: string | undefined; emptyFilterMessage?: string | undefined;
/** /**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. * Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* @defaultValue No results found * @defaultValue No available options
*/ */
emptyMessage?: string | undefined; emptyMessage?: string | undefined;
/** /**

View File

@ -526,7 +526,7 @@ export interface MultiSelectProps {
emptyFilterMessage?: string | undefined; emptyFilterMessage?: string | undefined;
/** /**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. * Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* @defaultValue No results found' * @defaultValue No available options'
*/ */
emptyMessage?: string | undefined; emptyMessage?: string | undefined;
/** /**

View File

@ -12,11 +12,11 @@ export default {
default: null default: null
}, },
mediumRegex: { mediumRegex: {
type: String, type: [String, RegExp],
default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line
}, },
strongRegex: { strongRegex: {
type: String, type: [String, RegExp],
default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line
}, },
weakLabel: { weakLabel: {

View File

@ -11,7 +11,7 @@ import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor,
import type { ComponentHooks } from '@primevue/core/basecomponent'; import type { ComponentHooks } from '@primevue/core/basecomponent';
import type { InputTextPassThroughOptions } from 'primevue/inputtext'; import type { InputTextPassThroughOptions } from 'primevue/inputtext';
import type { PassThroughOptions } from 'primevue/passthrough'; import type { PassThroughOptions } from 'primevue/passthrough';
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue'; import { InputHTMLAttributes, TransitionProps, VNode } from 'vue';
export declare type PasswordPassThroughOptionType = PasswordPassThroughAttributes | ((options: PasswordPassThroughMethodOptions) => PasswordPassThroughAttributes | string) | string | null | undefined; export declare type PasswordPassThroughOptionType = PasswordPassThroughAttributes | ((options: PasswordPassThroughMethodOptions) => PasswordPassThroughAttributes | string) | string | null | undefined;
@ -182,12 +182,12 @@ export interface PasswordProps extends InputHTMLAttributes {
* Regex for a medium level password. * Regex for a medium level password.
* @defaultValue ^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,}) * @defaultValue ^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})
*/ */
mediumRegex?: string | undefined; mediumRegex?: string | RegExp | undefined;
/** /**
* Regex for a strong level password. * Regex for a strong level password.
* @defaultValue ^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,}) * @defaultValue ^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})
*/ */
strongRegex?: string | undefined; strongRegex?: string | RegExp | undefined;
/** /**
* Text for a weak password. Defaults to PrimeVue Locale configuration. * Text for a weak password. Defaults to PrimeVue Locale configuration.
*/ */

View File

@ -512,7 +512,7 @@ export interface SelectProps {
emptyFilterMessage?: string | undefined; emptyFilterMessage?: string | undefined;
/** /**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. * Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* @defaultValue No results found * @defaultValue No available options
*/ */
emptyMessage?: string | undefined; emptyMessage?: string | undefined;
/** /**

View File

@ -7,6 +7,7 @@
:disabled="disabled" :disabled="disabled"
:severity="severity" :severity="severity"
:text="text" :text="text"
:icon="icon"
:outlined="outlined" :outlined="outlined"
:size="size" :size="size"
:aria-label="label" :aria-label="label"

View File

@ -383,11 +383,12 @@ export default {
this.onEnterKey(event); this.onEnterKey(event);
}, },
onEscapeKey(event) { onEscapeKey(event) {
if (this.focusedItemInfo.level !== 0) { if (this.popup || this.focusedItemInfo.level !== 0) {
const _focusedItemInfo = this.focusedItemInfo; const _focusedItemInfo = this.focusedItemInfo;
this.hide(event, false); this.hide(event, false);
!this.popup && (this.focusedItemInfo = { index: Number(_focusedItemInfo.parentKey.split('_')[0]), level: 0, parentKey: '' }); this.focusedItemInfo = { index: Number(_focusedItemInfo.parentKey.split('_')[0]), level: 0, parentKey: '' };
this.popup && DomHandler.focus(this.target);
} }
event.preventDefault(); event.preventDefault();

View File

@ -215,7 +215,7 @@ export interface TreeSelectProps {
appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement; appendTo?: HintedString<'body' | 'self'> | undefined | HTMLElement;
/** /**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. * Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* @defaultValue No results found * @defaultValue No available options
*/ */
emptyMessage?: string | undefined; emptyMessage?: string | undefined;
/** /**