Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Mar 19, 2024
1 parent 855be4b commit 5250943
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 247 deletions.
10 changes: 1 addition & 9 deletions components/lib/autocomplete/AutoComplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @module autocomplete
*
*/
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
import { TransitionProps, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent';
import { InputTextPassThroughOptions } from '../inputtext';
import { PassThroughOptions } from '../passthrough';
Expand Down Expand Up @@ -412,10 +412,6 @@ export interface AutoCompleteProps {
* Style class of the input field.
*/
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.
*/
Expand All @@ -424,10 +420,6 @@ export interface AutoCompleteProps {
* Style class of the overlay panel.
*/
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.
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
Expand Down
20 changes: 9 additions & 11 deletions components/lib/autocomplete/AutoComplete.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div ref="container" :class="cx('root')" :style="sx('root')" @click="onContainerClick" v-bind="ptmi('root')">
<ACInputText
<InputText
v-if="!multiple"
ref="focusInput"
:id="inputId"
Expand Down Expand Up @@ -28,7 +28,6 @@
@input="onInput"
@change="onChange"
:unstyled="unstyled"
v-bind="inputProps"
:pt="ptm('input')"
/>
<ul
Expand Down Expand Up @@ -64,7 +63,7 @@
</slot>
</li>
<li :class="cx('inputToken')" role="option" v-bind="ptm('inputToken')">
<ACInputText
<InputText
ref="focusInput"
:id="inputId"
:style="inputStyle"
Expand All @@ -90,7 +89,6 @@
@keydown="onKeyDown"
@input="onInput"
@change="onChange"
v-bind="inputProps"
:pt="ptm('input')"
/>
</li>
Expand Down Expand Up @@ -118,7 +116,7 @@
:style="{ ...panelStyle, 'max-height': virtualScrollerDisabled ? scrollHeight : '' }"
@click="onOverlayClick"
@keydown="onOverlayKeyDown"
v-bind="{ ...panelProps, ...ptm('panel') }"
v-bind="ptm('panel')"
>
<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')">
Expand Down Expand Up @@ -943,12 +941,12 @@ export default {
}
},
components: {
ACInputText: InputText,
VirtualScroller: VirtualScroller,
Portal: Portal,
ChevronDownIcon: ChevronDownIcon,
SpinnerIcon: SpinnerIcon,
TimesCircleIcon: TimesCircleIcon
InputText,
VirtualScroller,
Portal,
ChevronDownIcon,
SpinnerIcon,
TimesCircleIcon
},
directives: {
ripple: Ripple
Expand Down
8 changes: 0 additions & 8 deletions components/lib/autocomplete/BaseAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ export default {
type: [String, Object],
default: null
},
inputProps: {
type: null,
default: null
},
panelStyle: {
type: Object,
default: null
Expand All @@ -109,10 +105,6 @@ export default {
type: [String, Object],
default: null
},
panelProps: {
type: null,
default: null
},
dropdownIcon: {
type: String,
default: undefined
Expand Down
8 changes: 0 additions & 8 deletions components/lib/calendar/BaseCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ export default {
type: Object,
default: null
},
inputProps: {
type: null,
default: null
},
panelClass: {
type: [String, Object],
default: null
Expand All @@ -224,10 +220,6 @@ export default {
type: Object,
default: null
},
panelProps: {
type: null,
default: null
},
ariaLabelledby: {
type: String,
default: null
Expand Down
10 changes: 1 addition & 9 deletions components/lib/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @module calendar
*
*/
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
import { TransitionProps, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent';
import { InputTextPassThroughOptions } from '../inputtext';
import { PassThroughOptions } from '../passthrough';
Expand Down Expand Up @@ -752,10 +752,6 @@ export interface CalendarProps {
* Style class of the input field.
*/
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.
*/
Expand All @@ -764,10 +760,6 @@ export interface CalendarProps {
* Style class of the overlay panel.
*/
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.
*/
Expand Down
19 changes: 9 additions & 10 deletions components/lib/calendar/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span ref="container" :id="d_id" :class="cx('root')" :style="sx('root')" v-bind="ptmi('root')">
<CInputText
<InputText
v-if="!inline"
:ref="inputRef"
:id="inputId"
Expand Down Expand Up @@ -28,7 +28,6 @@
@focus="onFocus"
@blur="onBlur"
@keydown="onKeyDown"
v-bind="inputProps"
:pt="ptm('input')"
/>
<slot v-if="showIcon && iconDisplay === 'button'" name="dropdownbutton">
Expand Down Expand Up @@ -67,7 +66,7 @@
@click="onOverlayClick"
@keydown="onOverlayKeyDown"
@mouseup="onOverlayMouseUp"
v-bind="{ ...panelProps, ...ptm('panel') }"
v-bind="ptm('panel')"
>
<template v-if="!timeOnly">
<div :class="cx('groupContainer')" v-bind="ptm('groupContainer')">
Expand Down Expand Up @@ -3001,13 +3000,13 @@ export default {
}
},
components: {
CInputText: InputText,
Portal: Portal,
CalendarIcon: CalendarIcon,
ChevronLeftIcon: ChevronLeftIcon,
ChevronRightIcon: ChevronRightIcon,
ChevronUpIcon: ChevronUpIcon,
ChevronDownIcon: ChevronDownIcon
InputText,
Portal,
CalendarIcon,
ChevronLeftIcon,
ChevronRightIcon,
ChevronUpIcon,
ChevronDownIcon
},
directives: {
ripple: Ripple
Expand Down
16 changes: 0 additions & 16 deletions components/lib/dropdown/BaseDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ export default {
type: Object,
default: null
},
inputProps: {
type: null,
default: null
},
panelClass: {
type: [String, Object],
default: null
Expand All @@ -74,18 +70,6 @@ export default {
type: Object,
default: null
},
panelProps: {
type: null,
default: null
},
filterInputProps: {
type: null,
default: null
},
clearIconProps: {
type: null,
default: null
},
appendTo: {
type: [String, Object],
default: 'body'
Expand Down
19 changes: 1 addition & 18 deletions components/lib/dropdown/Dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @module dropdown
*
*/
import { HTMLAttributes, InputHTMLAttributes, TransitionProps, VNode } from 'vue';
import { TransitionProps, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent';
import { InputTextPassThroughOptions } from '../inputtext';
import { PassThroughOptions } from '../passthrough';
Expand Down Expand Up @@ -372,10 +372,6 @@ export interface DropdownProps {
* Style class of the input field.
*/
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.
*/
Expand All @@ -384,19 +380,6 @@ export interface DropdownProps {
* Style class of the overlay panel.
*/
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.
* @defaultValue body
Expand Down
14 changes: 6 additions & 8 deletions components/lib/dropdown/Dropdown.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div ref="container" :id="id" :class="cx('root')" @click="onContainerClick" v-bind="ptmi('root')">
<DInputText
<InputText
v-if="editable"
ref="focusInput"
:id="inputId"
Expand All @@ -26,7 +26,6 @@
@blur="onBlur"
@keydown="onKeyDown"
@input="onEditableInput"
v-bind="inputProps"
:pt="ptm('input')"
/>
<span
Expand All @@ -47,12 +46,12 @@
@focus="onFocus"
@blur="onBlur"
@keydown="onKeyDown"
v-bind="{ ...inputProps, ...ptm('input') }"
v-bind="ptm('input')"
>
<slot name="value" :value="modelValue" :placeholder="placeholder">{{ label === 'p-emptylabel' ? '&nbsp;' : label || 'empty' }}</slot>
</span>
<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>
<div :class="cx('trigger')" v-bind="ptm('trigger')">
<slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')">
Expand All @@ -65,7 +64,7 @@
</div>
<Portal :appendTo="appendTo">
<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
ref="firstHiddenFocusableElementOnOverlay"
role="presentation"
Expand All @@ -80,7 +79,7 @@
<slot name="header" :value="modelValue" :options="visibleOptions"></slot>
<div v-if="filter" :class="cx('header')" v-bind="ptm('header')">
<div :class="cx('filterContainer')" v-bind="ptm('filterContainer')">
<DInputText
<InputText
ref="filterInput"
type="text"
:value="filterValue"
Expand All @@ -98,7 +97,6 @@
@keydown="onFilterKeyDown"
@blur="onFilterBlur"
@input="onFilterChange"
v-bind="filterInputProps"
:pt="ptm('filterInput')"
/>
<slot name="filtericon" :class="cx('filterIcon')">
Expand Down Expand Up @@ -984,7 +982,7 @@ export default {
ripple: Ripple
},
components: {
DInputText: InputText,
InputText,
VirtualScroller,
Portal,
TimesIcon,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/inputmask/InputMask.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<IMInputText
<InputText
:value="modelValue"
:class="cx('root')"
:readonly="readonly"
Expand Down Expand Up @@ -525,7 +525,7 @@ export default {
}
},
components: {
IMInputText: InputText
InputText
}
};
</script>
12 changes: 0 additions & 12 deletions components/lib/inputnumber/BaseInputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,6 @@ export default {
type: Object,
default: null
},
inputProps: {
type: null,
default: null
},
incrementButtonProps: {
type: null,
default: null
},
decrementButtonProps: {
type: null,
default: null
},
ariaLabelledby: {
type: String,
default: null
Expand Down
Loading

0 comments on commit 5250943

Please sign in to comment.