Refactor
parent
855be4bfa1
commit
5250943440
|
@ -7,7 +7,7 @@
|
||||||
* @module autocomplete
|
* @module autocomplete
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
import { TransitionProps, VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -412,10 +412,6 @@ export interface AutoCompleteProps {
|
||||||
* Style class of the input field.
|
* Style class of the input field.
|
||||||
*/
|
*/
|
||||||
inputClass?: string | object | undefined;
|
inputClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
||||||
*/
|
|
||||||
inputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Inline style of the overlay panel.
|
* Inline style of the overlay panel.
|
||||||
*/
|
*/
|
||||||
|
@ -424,10 +420,6 @@ export interface AutoCompleteProps {
|
||||||
* Style class of the overlay panel.
|
* Style class of the overlay panel.
|
||||||
*/
|
*/
|
||||||
panelClass?: string | object | undefined;
|
panelClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
|
||||||
*/
|
|
||||||
panelProps?: HTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Icon to display in the dropdown.
|
* Icon to display in the dropdown.
|
||||||
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
|
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :class="cx('root')" :style="sx('root')" @click="onContainerClick" v-bind="ptmi('root')">
|
<div ref="container" :class="cx('root')" :style="sx('root')" @click="onContainerClick" v-bind="ptmi('root')">
|
||||||
<ACInputText
|
<InputText
|
||||||
v-if="!multiple"
|
v-if="!multiple"
|
||||||
ref="focusInput"
|
ref="focusInput"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
@ -28,7 +28,6 @@
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
v-bind="inputProps"
|
|
||||||
:pt="ptm('input')"
|
:pt="ptm('input')"
|
||||||
/>
|
/>
|
||||||
<ul
|
<ul
|
||||||
|
@ -64,7 +63,7 @@
|
||||||
</slot>
|
</slot>
|
||||||
</li>
|
</li>
|
||||||
<li :class="cx('inputToken')" role="option" v-bind="ptm('inputToken')">
|
<li :class="cx('inputToken')" role="option" v-bind="ptm('inputToken')">
|
||||||
<ACInputText
|
<InputText
|
||||||
ref="focusInput"
|
ref="focusInput"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
:style="inputStyle"
|
:style="inputStyle"
|
||||||
|
@ -90,7 +89,6 @@
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
v-bind="inputProps"
|
|
||||||
:pt="ptm('input')"
|
:pt="ptm('input')"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
|
@ -118,7 +116,7 @@
|
||||||
:style="{ ...panelStyle, 'max-height': virtualScrollerDisabled ? scrollHeight : '' }"
|
:style="{ ...panelStyle, 'max-height': virtualScrollerDisabled ? scrollHeight : '' }"
|
||||||
@click="onOverlayClick"
|
@click="onOverlayClick"
|
||||||
@keydown="onOverlayKeyDown"
|
@keydown="onOverlayKeyDown"
|
||||||
v-bind="{ ...panelProps, ...ptm('panel') }"
|
v-bind="ptm('panel')"
|
||||||
>
|
>
|
||||||
<slot name="header" :value="modelValue" :suggestions="visibleOptions"></slot>
|
<slot name="header" :value="modelValue" :suggestions="visibleOptions"></slot>
|
||||||
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :style="{ height: scrollHeight }" :items="visibleOptions" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="ptm('virtualScroller')">
|
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :style="{ height: scrollHeight }" :items="visibleOptions" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="ptm('virtualScroller')">
|
||||||
|
@ -943,12 +941,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
ACInputText: InputText,
|
InputText,
|
||||||
VirtualScroller: VirtualScroller,
|
VirtualScroller,
|
||||||
Portal: Portal,
|
Portal,
|
||||||
ChevronDownIcon: ChevronDownIcon,
|
ChevronDownIcon,
|
||||||
SpinnerIcon: SpinnerIcon,
|
SpinnerIcon,
|
||||||
TimesCircleIcon: TimesCircleIcon
|
TimesCircleIcon
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
|
|
|
@ -97,10 +97,6 @@ export default {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
inputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
panelStyle: {
|
panelStyle: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
|
@ -109,10 +105,6 @@ export default {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
panelProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
dropdownIcon: {
|
dropdownIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: undefined
|
default: undefined
|
||||||
|
|
|
@ -212,10 +212,6 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
inputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
panelClass: {
|
panelClass: {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: null
|
default: null
|
||||||
|
@ -224,10 +220,6 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
panelProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
ariaLabelledby: {
|
ariaLabelledby: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @module calendar
|
* @module calendar
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
import { TransitionProps, VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -752,10 +752,6 @@ export interface CalendarProps {
|
||||||
* Style class of the input field.
|
* Style class of the input field.
|
||||||
*/
|
*/
|
||||||
inputClass?: string | object | undefined;
|
inputClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
||||||
*/
|
|
||||||
inputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Inline style of the overlay panel.
|
* Inline style of the overlay panel.
|
||||||
*/
|
*/
|
||||||
|
@ -764,10 +760,6 @@ export interface CalendarProps {
|
||||||
* Style class of the overlay panel.
|
* Style class of the overlay panel.
|
||||||
*/
|
*/
|
||||||
panelClass?: string | object | undefined;
|
panelClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
|
||||||
*/
|
|
||||||
panelProps?: HTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<span ref="container" :id="d_id" :class="cx('root')" :style="sx('root')" v-bind="ptmi('root')">
|
<span ref="container" :id="d_id" :class="cx('root')" :style="sx('root')" v-bind="ptmi('root')">
|
||||||
<CInputText
|
<InputText
|
||||||
v-if="!inline"
|
v-if="!inline"
|
||||||
:ref="inputRef"
|
:ref="inputRef"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
@ -28,7 +28,6 @@
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
v-bind="inputProps"
|
|
||||||
:pt="ptm('input')"
|
:pt="ptm('input')"
|
||||||
/>
|
/>
|
||||||
<slot v-if="showIcon && iconDisplay === 'button'" name="dropdownbutton">
|
<slot v-if="showIcon && iconDisplay === 'button'" name="dropdownbutton">
|
||||||
|
@ -67,7 +66,7 @@
|
||||||
@click="onOverlayClick"
|
@click="onOverlayClick"
|
||||||
@keydown="onOverlayKeyDown"
|
@keydown="onOverlayKeyDown"
|
||||||
@mouseup="onOverlayMouseUp"
|
@mouseup="onOverlayMouseUp"
|
||||||
v-bind="{ ...panelProps, ...ptm('panel') }"
|
v-bind="ptm('panel')"
|
||||||
>
|
>
|
||||||
<template v-if="!timeOnly">
|
<template v-if="!timeOnly">
|
||||||
<div :class="cx('groupContainer')" v-bind="ptm('groupContainer')">
|
<div :class="cx('groupContainer')" v-bind="ptm('groupContainer')">
|
||||||
|
@ -3001,13 +3000,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
CInputText: InputText,
|
InputText,
|
||||||
Portal: Portal,
|
Portal,
|
||||||
CalendarIcon: CalendarIcon,
|
CalendarIcon,
|
||||||
ChevronLeftIcon: ChevronLeftIcon,
|
ChevronLeftIcon,
|
||||||
ChevronRightIcon: ChevronRightIcon,
|
ChevronRightIcon,
|
||||||
ChevronUpIcon: ChevronUpIcon,
|
ChevronUpIcon,
|
||||||
ChevronDownIcon: ChevronDownIcon
|
ChevronDownIcon
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
|
|
|
@ -62,10 +62,6 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
inputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
panelClass: {
|
panelClass: {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: null
|
default: null
|
||||||
|
@ -74,18 +70,6 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
panelProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
filterInputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
clearIconProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
appendTo: {
|
appendTo: {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: 'body'
|
default: 'body'
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @module dropdown
|
* @module dropdown
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
import { TransitionProps, VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -372,10 +372,6 @@ export interface DropdownProps {
|
||||||
* Style class of the input field.
|
* Style class of the input field.
|
||||||
*/
|
*/
|
||||||
inputClass?: string | object | undefined;
|
inputClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement/HTMLSpanElement to the focusable input element inside the component.
|
|
||||||
*/
|
|
||||||
inputProps?: InputHTMLAttributes | HTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Inline style of the overlay panel.
|
* Inline style of the overlay panel.
|
||||||
*/
|
*/
|
||||||
|
@ -384,19 +380,6 @@ export interface DropdownProps {
|
||||||
* Style class of the overlay panel.
|
* Style class of the overlay panel.
|
||||||
*/
|
*/
|
||||||
panelClass?: string | object | undefined;
|
panelClass?: string | object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLDivElement to the overlay panel inside the component.
|
|
||||||
*/
|
|
||||||
panelProps?: HTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the filter input inside the component.
|
|
||||||
*/
|
|
||||||
filterInputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLElement to the clear icon inside the component.
|
|
||||||
* @deprecated since v3.26.0. Use 'pt' peroperty.
|
|
||||||
*/
|
|
||||||
clearIconProps?: HTMLAttributes | 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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="container" :id="id" :class="cx('root')" @click="onContainerClick" v-bind="ptmi('root')">
|
<div ref="container" :id="id" :class="cx('root')" @click="onContainerClick" v-bind="ptmi('root')">
|
||||||
<DInputText
|
<InputText
|
||||||
v-if="editable"
|
v-if="editable"
|
||||||
ref="focusInput"
|
ref="focusInput"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
@ -26,7 +26,6 @@
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
@input="onEditableInput"
|
@input="onEditableInput"
|
||||||
v-bind="inputProps"
|
|
||||||
:pt="ptm('input')"
|
:pt="ptm('input')"
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
|
@ -47,12 +46,12 @@
|
||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@keydown="onKeyDown"
|
@keydown="onKeyDown"
|
||||||
v-bind="{ ...inputProps, ...ptm('input') }"
|
v-bind="ptm('input')"
|
||||||
>
|
>
|
||||||
<slot name="value" :value="modelValue" :placeholder="placeholder">{{ label === 'p-emptylabel' ? ' ' : label || 'empty' }}</slot>
|
<slot name="value" :value="modelValue" :placeholder="placeholder">{{ label === 'p-emptylabel' ? ' ' : label || 'empty' }}</slot>
|
||||||
</span>
|
</span>
|
||||||
<slot v-if="showClear && modelValue != null" name="clearicon" :class="cx('clearIcon')" :onClick="onClearClick" :clearCallback="onClearClick">
|
<slot v-if="showClear && modelValue != null" name="clearicon" :class="cx('clearIcon')" :onClick="onClearClick" :clearCallback="onClearClick">
|
||||||
<component :is="clearIcon ? 'i' : 'TimesIcon'" ref="clearIcon" :class="[cx('clearIcon'), clearIcon]" @click="onClearClick" v-bind="{ ...clearIconProps, ...ptm('clearIcon') }" data-pc-section="clearicon" />
|
<component :is="clearIcon ? 'i' : 'TimesIcon'" ref="clearIcon" :class="[cx('clearIcon'), clearIcon]" @click="onClearClick" v-bind="ptm('clearIcon')" data-pc-section="clearicon" />
|
||||||
</slot>
|
</slot>
|
||||||
<div :class="cx('trigger')" v-bind="ptm('trigger')">
|
<div :class="cx('trigger')" v-bind="ptm('trigger')">
|
||||||
<slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')">
|
<slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')">
|
||||||
|
@ -65,7 +64,7 @@
|
||||||
</div>
|
</div>
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="overlayVisible" :ref="overlayRef" :class="[cx('panel'), panelClass]" :style="panelStyle" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="{ ...panelProps, ...ptm('panel') }">
|
<div v-if="overlayVisible" :ref="overlayRef" :class="[cx('panel'), panelClass]" :style="panelStyle" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="ptm('panel')">
|
||||||
<span
|
<span
|
||||||
ref="firstHiddenFocusableElementOnOverlay"
|
ref="firstHiddenFocusableElementOnOverlay"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
|
@ -80,7 +79,7 @@
|
||||||
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
|
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
|
||||||
<div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
|
<div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
|
||||||
<div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
<div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
||||||
<DInputText
|
<InputText
|
||||||
ref="filterInput"
|
ref="filterInput"
|
||||||
type="text"
|
type="text"
|
||||||
:value="filterValue"
|
:value="filterValue"
|
||||||
|
@ -98,7 +97,6 @@
|
||||||
@keydown="onFilterKeyDown"
|
@keydown="onFilterKeyDown"
|
||||||
@blur="onFilterBlur"
|
@blur="onFilterBlur"
|
||||||
@input="onFilterChange"
|
@input="onFilterChange"
|
||||||
v-bind="filterInputProps"
|
|
||||||
:pt="ptm('filterInput')"
|
:pt="ptm('filterInput')"
|
||||||
/>
|
/>
|
||||||
<slot name="filtericon" :class="cx('filterIcon')">
|
<slot name="filtericon" :class="cx('filterIcon')">
|
||||||
|
@ -984,7 +982,7 @@ export default {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
DInputText: InputText,
|
InputText,
|
||||||
VirtualScroller,
|
VirtualScroller,
|
||||||
Portal,
|
Portal,
|
||||||
TimesIcon,
|
TimesIcon,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<IMInputText
|
<InputText
|
||||||
:value="modelValue"
|
:value="modelValue"
|
||||||
:class="cx('root')"
|
:class="cx('root')"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
|
@ -525,7 +525,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
IMInputText: InputText
|
InputText
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -137,18 +137,6 @@ export default {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
inputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
incrementButtonProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
decrementButtonProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
ariaLabelledby: {
|
ariaLabelledby: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @module inputnumber
|
* @module inputnumber
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { ButtonHTMLAttributes, InputHTMLAttributes, VNode } from 'vue';
|
import { VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -142,6 +142,37 @@ export interface InputNumberState {
|
||||||
focused: boolean;
|
focused: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines valid listeners in InputNumber component.
|
||||||
|
*/
|
||||||
|
export interface InputNumberButtonListeners {
|
||||||
|
/**
|
||||||
|
* Mouse down event of increment button.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
onMousedown: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Mouse up event of increment button.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
onMouseup: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Mouse leave event of increment button.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
onMouseleave: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Key down event of increment button.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
onKeydown: (event: Event) => void;
|
||||||
|
/**
|
||||||
|
* Key up event of increment button.
|
||||||
|
* @param {Event} event - Browser event
|
||||||
|
*/
|
||||||
|
onKeyup: (event: Event) => void;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines valid properties in InputNumber component.
|
* Defines valid properties in InputNumber component.
|
||||||
*/
|
*/
|
||||||
|
@ -295,18 +326,6 @@ export interface InputNumberProps {
|
||||||
* Inline style of the input field.
|
* Inline style of the input field.
|
||||||
*/
|
*/
|
||||||
inputStyle?: object | undefined;
|
inputStyle?: object | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
||||||
*/
|
|
||||||
inputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLButtonElement to increment button inside the component.
|
|
||||||
*/
|
|
||||||
incrementButtonProps?: ButtonHTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLButtonElement to decrement button inside the component.
|
|
||||||
*/
|
|
||||||
decrementButtonProps?: ButtonHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
||||||
*/
|
*/
|
||||||
|
@ -341,60 +360,18 @@ export interface InputNumberSlots {
|
||||||
*/
|
*/
|
||||||
incrementbutton(scope: {
|
incrementbutton(scope: {
|
||||||
/**
|
/**
|
||||||
* Mouse down event of increment button.
|
* InputNumber listeners
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
*/
|
||||||
onMousedown: (event: Event) => void;
|
listeners: InputNumberButtonListeners;
|
||||||
/**
|
|
||||||
* Mouse up event of increment button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onMouseup: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Mouse leave event of increment button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onMouseleave: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Key down event of increment button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onKeydown: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Key up event of increment button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onKeyup: (event: Event) => void;
|
|
||||||
}): VNode[];
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom decrement button template.
|
* Custom decrement button template.
|
||||||
*/
|
*/
|
||||||
decrementbutton(scope: {
|
decrementbutton(scope: {
|
||||||
/**
|
/**
|
||||||
* Mouse down event of decrement button.
|
* InputNumber listeners
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
*/
|
||||||
onMousedown: (event: Event) => void;
|
listeners: InputNumberButtonListeners;
|
||||||
/**
|
|
||||||
* Mouse up event of decrement button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onMouseup: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Mouse leave event of decrement button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onMouseleave: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Key down event of decrement button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onKeydown: (event: Event) => void;
|
|
||||||
/**
|
|
||||||
* Key up event of decrement button.
|
|
||||||
* @param {Event} event - Browser event
|
|
||||||
*/
|
|
||||||
onKeyup: (event: Event) => void;
|
|
||||||
}): VNode[];
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Custom increment button icon template.
|
* Custom increment button icon template.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<span :class="cx('root')" v-bind="ptmi('root')">
|
<span :class="cx('root')" v-bind="ptmi('root')">
|
||||||
<INInputText
|
<InputText
|
||||||
ref="input"
|
ref="input"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
role="spinbutton"
|
role="spinbutton"
|
||||||
|
@ -23,51 +23,34 @@
|
||||||
@click="onInputClick"
|
@click="onInputClick"
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
@blur="onInputBlur"
|
@blur="onInputBlur"
|
||||||
v-bind="inputProps"
|
|
||||||
:pt="ptm('input')"
|
:pt="ptm('input')"
|
||||||
:unstyled="unstyled"
|
:unstyled="unstyled"
|
||||||
/>
|
/>
|
||||||
<span v-if="showButtons && buttonLayout === 'stacked'" :class="cx('buttonGroup')" v-bind="ptm('buttonGroup')">
|
<span v-if="showButtons && buttonLayout === 'stacked'" :class="cx('buttonGroup')" v-bind="ptm('buttonGroup')">
|
||||||
<slot name="incrementbutton" v-on="upButtonListeners">
|
<slot name="incrementbutton" :listeners="upButtonListeners">
|
||||||
<button :class="[cx('incrementButton'), incrementButtonClass]" v-on="upButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="{ ...incrementButtonProps, ...ptm('incrementButton') }">
|
<button :class="[cx('incrementButton'), incrementButtonClass]" v-on="upButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="ptm('incrementButton')">
|
||||||
<slot name="incrementbuttonicon">
|
<slot name="incrementbuttonicon">
|
||||||
<component :is="incrementButtonIcon ? 'span' : 'AngleUpIcon'" :class="incrementButtonIcon" v-bind="ptm('incrementButtonIcon')" data-pc-section="incrementbuttonicon" />
|
<component :is="incrementButtonIcon ? 'span' : 'AngleUpIcon'" :class="incrementButtonIcon" v-bind="ptm('incrementButtonIcon')" data-pc-section="incrementbuttonicon" />
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="decrementbutton" v-on="downButtonListeners">
|
<slot name="decrementbutton" :listeners="downButtonListeners">
|
||||||
<button :class="[cx('decrementButton'), decrementButtonClass]" v-on="downButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="{ ...decrementButtonProps, ...ptm('decrementButton') }">
|
<button :class="[cx('decrementButton'), decrementButtonClass]" v-on="downButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="ptm('decrementButton')">
|
||||||
<slot name="decrementbuttonicon">
|
<slot name="decrementbuttonicon">
|
||||||
<component :is="decrementButtonIcon ? 'span' : 'AngleDownIcon'" :class="decrementButtonIcon" v-bind="ptm('decrementButtonIcon')" data-pc-section="decrementbuttonicon" />
|
<component :is="decrementButtonIcon ? 'span' : 'AngleDownIcon'" :class="decrementButtonIcon" v-bind="ptm('decrementButtonIcon')" data-pc-section="decrementbuttonicon" />
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
</span>
|
</span>
|
||||||
<slot name="incrementbutton" v-on="upButtonListeners">
|
<slot name="incrementbutton" :listeners="upButtonListeners">
|
||||||
<button
|
<button v-if="showButtons && buttonLayout !== 'stacked'" :class="[cx('incrementButton'), incrementButtonClass]" v-on="upButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="ptm('incrementButton')">
|
||||||
v-if="showButtons && buttonLayout !== 'stacked'"
|
|
||||||
:class="[cx('incrementButton'), incrementButtonClass]"
|
|
||||||
v-on="upButtonListeners"
|
|
||||||
:disabled="disabled"
|
|
||||||
:tabindex="-1"
|
|
||||||
aria-hidden="true"
|
|
||||||
v-bind="{ ...incrementButtonProps, ...ptm('incrementButton') }"
|
|
||||||
>
|
|
||||||
<slot name="incrementbuttonicon">
|
<slot name="incrementbuttonicon">
|
||||||
<component :is="incrementButtonIcon ? 'span' : 'AngleUpIcon'" :class="incrementButtonIcon" v-bind="ptm('incrementButtonIcon')" data-pc-section="incrementbuttonicon" />
|
<component :is="incrementButtonIcon ? 'span' : 'AngleUpIcon'" :class="incrementButtonIcon" v-bind="ptm('incrementButtonIcon')" data-pc-section="incrementbuttonicon" />
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="decrementbutton" v-on="downButtonListeners">
|
<slot name="decrementbutton" :listeners="downButtonListeners">
|
||||||
<button
|
<button v-if="showButtons && buttonLayout !== 'stacked'" :class="[cx('decrementButton'), decrementButtonClass]" v-on="downButtonListeners" :disabled="disabled" :tabindex="-1" aria-hidden="true" v-bind="ptm('decrementButton')">
|
||||||
v-if="showButtons && buttonLayout !== 'stacked'"
|
|
||||||
:class="[cx('decrementButton'), decrementButtonClass]"
|
|
||||||
v-on="downButtonListeners"
|
|
||||||
:disabled="disabled"
|
|
||||||
:tabindex="-1"
|
|
||||||
aria-hidden="true"
|
|
||||||
v-bind="{ ...decrementButtonProps, ...ptm('decrementButton') }"
|
|
||||||
>
|
|
||||||
<slot name="decrementbuttonicon">
|
<slot name="decrementbuttonicon">
|
||||||
<component :is="decrementButtonIcon ? 'span' : 'AngleDownIcon'" :class="decrementButtonIcon" v-bind="ptm('decrementButtonIcon')" data-pc-section="decrementbuttonicon" />
|
<component :is="decrementButtonIcon ? 'span' : 'AngleDownIcon'" :class="decrementButtonIcon" v-bind="ptm('decrementButtonIcon')" data-pc-section="decrementbuttonicon" />
|
||||||
</slot>
|
</slot>
|
||||||
|
@ -983,9 +966,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
INInputText: InputText,
|
InputText,
|
||||||
AngleUpIcon: AngleUpIcon,
|
AngleUpIcon,
|
||||||
AngleDownIcon: AngleDownIcon
|
AngleDownIcon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -42,7 +42,6 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
filterInputProps: null,
|
|
||||||
virtualScrollerOptions: {
|
virtualScrollerOptions: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @module listbox
|
* @module listbox
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { InputHTMLAttributes, VNode } from 'vue';
|
import { VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -303,10 +303,6 @@ export interface ListboxProps {
|
||||||
* Fields used when filtering the options, defaults to optionLabel.
|
* Fields used when filtering the options, defaults to optionLabel.
|
||||||
*/
|
*/
|
||||||
filterFields?: string[] | undefined;
|
filterFields?: string[] | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the filter input inside the component.
|
|
||||||
*/
|
|
||||||
filterInputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
|
* Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it.
|
||||||
* @type {VirtualScrollerProps}
|
* @type {VirtualScrollerProps}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
|
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
|
||||||
<div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
|
<div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
|
||||||
<div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
<div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
||||||
<LInputText
|
<InputText
|
||||||
v-model="filterValue"
|
v-model="filterValue"
|
||||||
type="text"
|
type="text"
|
||||||
:class="cx('filterInput')"
|
:class="cx('filterInput')"
|
||||||
|
@ -30,7 +30,6 @@
|
||||||
@input="onFilterChange"
|
@input="onFilterChange"
|
||||||
@blur="onFilterBlur"
|
@blur="onFilterBlur"
|
||||||
@keydown="onFilterKeyDown"
|
@keydown="onFilterKeyDown"
|
||||||
v-bind="filterInputProps"
|
|
||||||
:pt="ptm('filterInput')"
|
:pt="ptm('filterInput')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -737,9 +736,9 @@ export default {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
LInputText: InputText,
|
InputText,
|
||||||
VirtualScroller: VirtualScroller,
|
VirtualScroller,
|
||||||
SearchIcon: SearchIcon
|
SearchIcon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -31,10 +31,6 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
inputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
panelClass: {
|
panelClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null
|
default: null
|
||||||
|
@ -43,18 +39,6 @@ export default {
|
||||||
type: null,
|
type: null,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
panelProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
filterInputProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
closeButtonProps: {
|
|
||||||
type: null,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
dataKey: null,
|
dataKey: null,
|
||||||
filter: Boolean,
|
filter: Boolean,
|
||||||
filterPlaceholder: String,
|
filterPlaceholder: String,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* @module multiselect
|
* @module multiselect
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
|
import { TransitionProps, VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { InputTextPassThroughOptions } from '../inputtext';
|
import { InputTextPassThroughOptions } from '../inputtext';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
|
@ -358,10 +358,6 @@ export interface MultiSelectProps {
|
||||||
* Identifier of the underlying input element.
|
* Identifier of the underlying input element.
|
||||||
*/
|
*/
|
||||||
inputId?: string | undefined;
|
inputId?: string | undefined;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the focusable input element inside the component.
|
|
||||||
*/
|
|
||||||
inputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* Inline style of the overlay panel.
|
* Inline style of the overlay panel.
|
||||||
*/
|
*/
|
||||||
|
@ -370,18 +366,6 @@ export interface MultiSelectProps {
|
||||||
* Style class of the overlay panel.
|
* Style class of the overlay panel.
|
||||||
*/
|
*/
|
||||||
panelClass?: any;
|
panelClass?: any;
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLDivElement to the overlay panel.
|
|
||||||
*/
|
|
||||||
panelProps?: HTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLInputElement to the filter input inside the overlay panel.
|
|
||||||
*/
|
|
||||||
filterInputProps?: InputHTMLAttributes | undefined;
|
|
||||||
/**
|
|
||||||
* Used to pass all properties of the HTMLButtonElement to the clear button inside the overlay panel.
|
|
||||||
*/
|
|
||||||
closeButtonProps?: ButtonHTMLAttributes | undefined;
|
|
||||||
/**
|
/**
|
||||||
* A property to uniquely identify an option.
|
* A property to uniquely identify an option.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
</div>
|
</div>
|
||||||
<Portal :appendTo="appendTo">
|
<Portal :appendTo="appendTo">
|
||||||
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
|
<transition name="p-connected-overlay" @enter="onOverlayEnter" @after-enter="onOverlayAfterEnter" @leave="onOverlayLeave" @after-leave="onOverlayAfterLeave" v-bind="ptm('transition')">
|
||||||
<div v-if="overlayVisible" :ref="overlayRef" :style="panelStyle" :class="[cx('panel'), panelClass]" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="{ ...panelProps, ...ptm('panel') }">
|
<div v-if="overlayVisible" :ref="overlayRef" :style="panelStyle" :class="[cx('panel'), panelClass]" @click="onOverlayClick" @keydown="onOverlayKeyDown" v-bind="ptm('panel')">
|
||||||
<span
|
<span
|
||||||
ref="firstHiddenFocusableElementOnOverlay"
|
ref="firstHiddenFocusableElementOnOverlay"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
</template>
|
</template>
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<div v-if="filter" :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
<div v-if="filter" :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
|
||||||
<MSInputText
|
<InputText
|
||||||
ref="filterInput"
|
ref="filterInput"
|
||||||
:value="filterValue"
|
:value="filterValue"
|
||||||
@vue:mounted="onFilterUpdated"
|
@vue:mounted="onFilterUpdated"
|
||||||
|
@ -104,7 +104,6 @@
|
||||||
@keydown="onFilterKeyDown"
|
@keydown="onFilterKeyDown"
|
||||||
@blur="onFilterBlur"
|
@blur="onFilterBlur"
|
||||||
@input="onFilterChange"
|
@input="onFilterChange"
|
||||||
v-bind="filterInputProps"
|
|
||||||
:pt="ptm('filterInput')"
|
:pt="ptm('filterInput')"
|
||||||
/>
|
/>
|
||||||
<slot name="filtericon" :class="cx('filterIcon')">
|
<slot name="filtericon" :class="cx('filterIcon')">
|
||||||
|
@ -1090,7 +1089,7 @@ export default {
|
||||||
ripple: Ripple
|
ripple: Ripple
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MSInputText: InputText,
|
InputText,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
VirtualScroller,
|
VirtualScroller,
|
||||||
Portal,
|
Portal,
|
||||||
|
|
Loading…
Reference in New Issue