Refactor #3965 - Update for unstyled prop

pull/4030/head
Tuğçe Küçükoğlu 2023-06-05 11:10:25 +03:00
parent bb3a383b97
commit a5ec0a6b9f
14 changed files with 39 additions and 15 deletions

View File

@ -100,6 +100,7 @@
:disabled="disabled" :disabled="disabled"
aria-hidden="true" aria-hidden="true"
@click="onDropdownClick" @click="onDropdownClick"
:unstyled="unstyled"
:pt="ptm('dropdownButton')" :pt="ptm('dropdownButton')"
data-pc-section="dropdownbutton" data-pc-section="dropdownbutton"
> >

View File

@ -30,7 +30,7 @@
/> />
<component v-else-if="column.children && column.children.body && !column.children.editor && d_editing" :is="column.children.body" :data="editingRowData" :column="column" :field="field" :index="rowIndex" :frozenRow="frozenRow" /> <component v-else-if="column.children && column.children.body && !column.children.editor && d_editing" :is="column.children.body" :data="editingRowData" :column="column" :field="field" :index="rowIndex" :frozenRow="frozenRow" />
<template v-else-if="columnProp('selectionMode')"> <template v-else-if="columnProp('selectionMode')">
<DTRadioButton v-if="columnProp('selectionMode') === 'single'" :value="rowData" :name="name" :checked="selected" @change="toggleRowWithRadio($event, rowIndex)" :column="column" :pt="pt" /> <DTRadioButton v-if="columnProp('selectionMode') === 'single'" :value="rowData" :name="name" :checked="selected" @change="toggleRowWithRadio($event, rowIndex)" :column="column" :unstyled="unstyled" :pt="pt" />
<DTCheckbox <DTCheckbox
v-else-if="columnProp('selectionMode') === 'multiple'" v-else-if="columnProp('selectionMode') === 'multiple'"
:value="rowData" :value="rowData"
@ -39,6 +39,7 @@
:aria-selected="selected ? true : undefined" :aria-selected="selected ? true : undefined"
@change="toggleRowWithCheckbox($event, rowIndex)" @change="toggleRowWithCheckbox($event, rowIndex)"
:column="column" :column="column"
:unstyled="unstyled"
:pt="pt" :pt="pt"
/> />
</template> </template>

View File

@ -67,6 +67,7 @@
optionLabel="label" optionLabel="label"
optionValue="value" optionValue="value"
@update:modelValue="onOperatorChange($event)" @update:modelValue="onOperatorChange($event)"
:unstyled="unstyled"
:pt="getColumnPTOptions('filterOperatorDropdown')" :pt="getColumnPTOptions('filterOperatorDropdown')"
data-pc-section="filteroperatordropdown" data-pc-section="filteroperatordropdown"
></CFDropdown> ></CFDropdown>
@ -82,6 +83,7 @@
optionValue="value" optionValue="value"
:aria-label="filterConstraintAriaLabel" :aria-label="filterConstraintAriaLabel"
@update:modelValue="onMenuMatchModeChange($event, i)" @update:modelValue="onMenuMatchModeChange($event, i)"
:unstyled="unstyled"
:pt="getColumnPTOptions('filterMatchModeDropdown')" :pt="getColumnPTOptions('filterMatchModeDropdown')"
data-pc-section="filtermatchmodedropdown" data-pc-section="filtermatchmodedropdown"
></CFDropdown> ></CFDropdown>
@ -93,6 +95,7 @@
:class="cx('filterRemoveButton')" :class="cx('filterRemoveButton')"
@click="removeConstraint(i)" @click="removeConstraint(i)"
:label="removeRuleButtonLabel" :label="removeRuleButtonLabel"
:unstyled="unstyled"
:pt="getColumnPTOptions('filterRemoveButton')" :pt="getColumnPTOptions('filterRemoveButton')"
data-pc-section="filterremovebutton" data-pc-section="filterremovebutton"
> >
@ -104,7 +107,16 @@
</div> </div>
</div> </div>
<div v-if="isShowAddConstraint" :class="cx('filterAddRule')" v-bind="getColumnPTOptions('filterAddRule')"> <div v-if="isShowAddConstraint" :class="cx('filterAddRule')" v-bind="getColumnPTOptions('filterAddRule')">
<CFButton type="button" :label="addRuleButtonLabel" iconPos="left" :class="cx('filterAddRuleButton')" @click="addConstraint()" :pt="getColumnPTOptions('filterAddRuleButton')" data-pc-section="filteraddrulebutton"> <CFButton
type="button"
:label="addRuleButtonLabel"
iconPos="left"
:class="cx('filterAddRuleButton')"
@click="addConstraint()"
:unstyled="unstyled"
:pt="getColumnPTOptions('filterAddRuleButton')"
data-pc-section="filteraddrulebutton"
>
<template #icon="iconProps"> <template #icon="iconProps">
<component :is="filterAddIconTemplate || 'PlusIcon'" :class="iconProps.class" v-bind="getColumnPTOptions('filterAddRuleButton')['icon']" /> <component :is="filterAddIconTemplate || 'PlusIcon'" :class="iconProps.class" v-bind="getColumnPTOptions('filterAddRuleButton')['icon']" />
</template> </template>
@ -117,6 +129,7 @@
:class="cx('filterClearButton')" :class="cx('filterClearButton')"
:label="clearButtonLabel" :label="clearButtonLabel"
@click="clearFilter" @click="clearFilter"
:unstyled="unstyled"
:pt="getColumnPTOptions('filterClearButton')" :pt="getColumnPTOptions('filterClearButton')"
data-pc-section="filterclearbutton" data-pc-section="filterclearbutton"
></CFButton> ></CFButton>
@ -128,7 +141,8 @@
:class="cx('filterApplyButton')" :class="cx('filterApplyButton')"
:label="applyButtonLabel" :label="applyButtonLabel"
@click="applyFilter()" @click="applyFilter()"
v-bind="getColumnPTOptions('filterApplyButton')" :unstyled="unstyled"
:pt="getColumnPTOptions('filterApplyButton')"
data-pc-section="filterapplybutton" data-pc-section="filterapplybutton"
></CFButton> ></CFButton>
<component v-else :is="filterApplyTemplate" :field="field" :filterModel="filters[field]" :filterCallback="applyFilter" /> <component v-else :is="filterApplyTemplate" :field="field" :filterModel="filters[field]" :filterCallback="applyFilter" />

View File

@ -24,6 +24,7 @@
:class="cx('paginator')" :class="cx('paginator')"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled"
:pt="ptm('paginator')" :pt="ptm('paginator')"
data-pc-section="paginator" data-pc-section="paginator"
> >
@ -232,6 +233,7 @@
:class="cx('paginator')" :class="cx('paginator')"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled"
:pt="ptm('paginator')" :pt="ptm('paginator')"
data-pc-section="paginator" data-pc-section="paginator"
> >

View File

@ -4,10 +4,10 @@
<div :class="cx('details')" v-bind="ptm('details')"> <div :class="cx('details')" v-bind="ptm('details')">
<div :class="cx('fileName')" v-bind="ptm('fileName')">{{ file.name }}</div> <div :class="cx('fileName')" v-bind="ptm('fileName')">{{ file.name }}</div>
<span :class="cx('fileSize')" v-bind="ptm('fileSize')">{{ formatSize(file.size) }}</span> <span :class="cx('fileSize')" v-bind="ptm('fileSize')">{{ formatSize(file.size) }}</span>
<FileUploadBadge :value="badgeValue" :class="cx('badge')" :severity="badgeSeverity" :pt="ptm('badge')" /> <FileUploadBadge :value="badgeValue" :class="cx('badge')" :severity="badgeSeverity" :unstyled="unstyled" :pt="ptm('badge')" />
</div> </div>
<div :class="cx('actions')" v-bind="ptm('actions')"> <div :class="cx('actions')" v-bind="ptm('actions')">
<FileUploadButton @click="$emit('remove', index)" text rounded severity="danger" :class="cx('removeButton')" :pt="ptm('removeButton')"> <FileUploadButton @click="$emit('remove', index)" text rounded severity="danger" :class="cx('removeButton')" :unstyled="unstyled" :pt="ptm('removeButton')">
<template #icon="iconProps"> <template #icon="iconProps">
<component v-if="templates.fileremoveicon" :is="templates.fileremoveicon" :class="iconProps.class" :file="file" :index="index" /> <component v-if="templates.fileremoveicon" :is="templates.fileremoveicon" :class="iconProps.class" :file="file" :index="index" />
<TimesIcon v-else :class="iconProps.class" aria-hidden="true" v-bind="ptm('removeButton')['icon']" /> <TimesIcon v-else :class="iconProps.class" aria-hidden="true" v-bind="ptm('removeButton')['icon']" />

View File

@ -9,14 +9,14 @@
</slot> </slot>
<span :class="cx('chooseButtonLabel')" v-bind="ptm('chooseButtonLabel')">{{ chooseButtonLabel }}</span> <span :class="cx('chooseButtonLabel')" v-bind="ptm('chooseButtonLabel')">{{ chooseButtonLabel }}</span>
</span> </span>
<FileUploadButton v-if="showUploadButton" :label="uploadButtonLabel" @click="upload" :disabled="uploadDisabled" :pt="ptm('uploadButton')"> <FileUploadButton v-if="showUploadButton" :label="uploadButtonLabel" @click="upload" :disabled="uploadDisabled" :unstyled="unstyled" :pt="ptm('uploadButton')">
<template #icon="iconProps"> <template #icon="iconProps">
<slot name="uploadicon"> <slot name="uploadicon">
<component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[iconProps.class, uploadIcon]" aria-hidden="true" v-bind="ptm('uploadButton')['icon']" /> <component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[iconProps.class, uploadIcon]" aria-hidden="true" v-bind="ptm('uploadButton')['icon']" />
</slot> </slot>
</template> </template>
</FileUploadButton> </FileUploadButton>
<FileUploadButton v-if="showCancelButton" :label="cancelButtonLabel" @click="clear" :disabled="cancelDisabled" :pt="ptm('cancelButton')"> <FileUploadButton v-if="showCancelButton" :label="cancelButtonLabel" @click="clear" :disabled="cancelDisabled" :unstyled="unstyled" :pt="ptm('cancelButton')">
<template #icon="iconProps"> <template #icon="iconProps">
<slot name="cancelicon"> <slot name="cancelicon">
<component :is="cancelIcon ? 'span' : 'TimesIcon'" :class="[iconProps.class, cancelIcon]" aria-hidden="true" v-bind="ptm('cancelButton')['icon']" /> <component :is="cancelIcon ? 'span' : 'TimesIcon'" :class="[iconProps.class, cancelIcon]" aria-hidden="true" v-bind="ptm('cancelButton')['icon']" />
@ -27,8 +27,8 @@
</div> </div>
<div ref="content" :class="cx('content')" @dragenter="onDragEnter" @dragover="onDragOver" @dragleave="onDragLeave" @drop="onDrop" v-bind="ptm('content')" :data-p-highlight="false"> <div ref="content" :class="cx('content')" @dragenter="onDragEnter" @dragover="onDragOver" @dragleave="onDragLeave" @drop="onDrop" v-bind="ptm('content')" :data-p-highlight="false">
<slot name="content" :files="files" :uploadedFiles="uploadedFiles" :removeUploadedFileCallback="removeUploadedFile" :removeFileCallback="remove" :progress="progress" :messages="messages"> <slot name="content" :files="files" :uploadedFiles="uploadedFiles" :removeUploadedFileCallback="removeUploadedFile" :removeFileCallback="remove" :progress="progress" :messages="messages">
<FileUploadProgressBar v-if="hasFiles" :value="progress" :showValue="false" :pt="ptm('progressbar')" /> <FileUploadProgressBar v-if="hasFiles" :value="progress" :showValue="false" :unstyled="unstyled" :pt="ptm('progressbar')" />
<FileUploadMessage v-for="msg of messages" :key="msg" severity="error" @close="onMessageClose" :pt="ptm('message')">{{ msg }}</FileUploadMessage> <FileUploadMessage v-for="msg of messages" :key="msg" severity="error" @close="onMessageClose" :unstyled="unstyled" :pt="ptm('message')">{{ msg }}</FileUploadMessage>
<FileContent v-if="hasFiles" :files="files" @remove="remove" :badgeValue="pendingLabel" :previewWidth="previewWidth" :templates="$slots" :pt="pt" /> <FileContent v-if="hasFiles" :files="files" @remove="remove" :badgeValue="pendingLabel" :previewWidth="previewWidth" :templates="$slots" :pt="pt" />
<FileContent :files="uploadedFiles" @remove="removeUploadedFile" :badgeValue="completedLabel" badgeSeverity="success" :previewWidth="previewWidth" :templates="$slots" :pt="pt" /> <FileContent :files="uploadedFiles" @remove="removeUploadedFile" :badgeValue="completedLabel" badgeSeverity="success" :previewWidth="previewWidth" :templates="$slots" :pt="pt" />
</slot> </slot>
@ -38,7 +38,7 @@
</div> </div>
</div> </div>
<div v-else-if="isBasic" :class="cx('root')" v-bind="ptm('root')" data-pc-name="fileupload"> <div v-else-if="isBasic" :class="cx('root')" v-bind="ptm('root')" data-pc-name="fileupload">
<FileUploadMessage v-for="msg of messages" :key="msg" severity="error" @close="onMessageClose" :pt="ptm('messages')">{{ msg }}</FileUploadMessage> <FileUploadMessage v-for="msg of messages" :key="msg" severity="error" @close="onMessageClose" :unstyled="unstyled" :pt="ptm('messages')">{{ msg }}</FileUploadMessage>
<span v-ripple :class="chooseButtonClass" :style="style" @mouseup="onBasicUploaderClick" @keydown.enter="choose" @focus="onFocus" @blur="onBlur" tabindex="0" v-bind="ptm('chooseButton')"> <span v-ripple :class="chooseButtonClass" :style="style" @mouseup="onBasicUploaderClick" @keydown.enter="choose" @focus="onFocus" @blur="onBlur" tabindex="0" v-bind="ptm('chooseButton')">
<slot v-if="!hasFiles || auto" name="uploadicon" :class="cx('uploadIcon')"> <slot v-if="!hasFiles || auto" name="uploadicon" :class="cx('uploadIcon')">
<component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[cx('uploadIcon'), uploadIcon]" aria-hidden="true" v-bind="ptm('uploadIcon')" /> <component :is="uploadIcon ? 'span' : 'UploadIcon'" :class="[cx('uploadIcon'), uploadIcon]" aria-hidden="true" v-bind="ptm('uploadIcon')" />

View File

@ -5,7 +5,7 @@
</div> </div>
<div v-else :class="cx('content')" v-bind="ptm('content')"> <div v-else :class="cx('content')" v-bind="ptm('content')">
<slot name="content"></slot> <slot name="content"></slot>
<IPButton v-if="closable" :aria-label="closeAriaLabel" @click="close" :pt="ptm('closeButton')" v-bind="closeButtonProps"> <IPButton v-if="closable" :aria-label="closeAriaLabel" @click="close" :unstyled="unstyled" :pt="ptm('closeButton')" v-bind="closeButtonProps">
<template #icon> <template #icon>
<slot name="closeicon"> <slot name="closeicon">
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="closeIcon" v-bind="ptm('closeButton')['icon']"></component> <component :is="closeIcon ? 'span' : 'TimesIcon'" :class="closeIcon" v-bind="ptm('closeButton')['icon']"></component>

View File

@ -7,6 +7,7 @@
@update:modelValue="onChange($event)" @update:modelValue="onChange($event)"
:class="cx('JTPDropdown')" :class="cx('JTPDropdown')"
:disabled="disabled" :disabled="disabled"
:unstyled="unstyled"
:pt="ptm('JTPDropdown')" :pt="ptm('JTPDropdown')"
data-pc-section="jtpdropdown" data-pc-section="jtpdropdown"
></JTPDropdown> ></JTPDropdown>

View File

@ -1,5 +1,5 @@
<template> <template>
<JTPInput ref="jtpInput" :modelValue="d_page" :class="cx('JTPInput')" :aria-label="inputArialabel" :disabled="disabled" @update:modelValue="onChange" :pt="ptm('JTPInput')" data-pc-section="jtpinput"></JTPInput> <JTPInput ref="jtpInput" :modelValue="d_page" :class="cx('JTPInput')" :aria-label="inputArialabel" :disabled="disabled" @update:modelValue="onChange" :unstyled="unstyled" :pt="ptm('JTPInput')" data-pc-section="jtpinput"></JTPInput>
</template> </template>
<script> <script>

View File

@ -7,6 +7,7 @@
@update:modelValue="onChange($event)" @update:modelValue="onChange($event)"
:class="cx('RPPDropdown')" :class="cx('RPPDropdown')"
:disabled="disabled" :disabled="disabled"
:unstyled="unstyled"
:pt="ptm('RPPDropdown')" :pt="ptm('RPPDropdown')"
data-pc-section="rppdropdown" data-pc-section="rppdropdown"
></RPPDropdown> ></RPPDropdown>

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="containerClass" :style="style" v-bind="ptm('root')" data-pc-name="splitbutton" :data-pc-severity="severity"> <div :class="containerClass" :style="style" v-bind="ptm('root')" data-pc-name="splitbutton" :data-pc-severity="severity">
<slot> <slot>
<PVSButton type="button" :class="cx('button')" :label="label" :disabled="disabled" :aria-label="label" @click="onDefaultButtonClick" :pt="ptm('button')" v-bind="buttonProps"> <PVSButton type="button" :class="cx('button')" :label="label" :disabled="disabled" :aria-label="label" @click="onDefaultButtonClick" :unstyled="unstyled" :pt="ptm('button')" v-bind="buttonProps">
<template #icon="slotProps"> <template #icon="slotProps">
<slot name="icon"> <slot name="icon">
<span :class="[icon, slotProps.class]" v-bind="ptm('button')['icon']" /> <span :class="[icon, slotProps.class]" v-bind="ptm('button')['icon']" />
@ -19,6 +19,7 @@
:aria-controls="ariaId + '_overlay'" :aria-controls="ariaId + '_overlay'"
@click="onDropdownButtonClick" @click="onDropdownButtonClick"
@keydown="onDropdownKeydown" @keydown="onDropdownKeydown"
:unstyled="unstyled"
:pt="ptm('menuButton')" :pt="ptm('menuButton')"
v-bind="menuButtonProps" v-bind="menuButtonProps"
> >
@ -28,7 +29,7 @@
</slot> </slot>
</template> </template>
</PVSButton> </PVSButton>
<PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :pt="ptm('menu')" /> <PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :unstyled="unstyled" :pt="ptm('menu')" />
</div> </div>
</template> </template>

View File

@ -62,6 +62,7 @@
@node-select="onNodeSelect" @node-select="onNodeSelect"
@node-unselect="onNodeUnselect" @node-unselect="onNodeUnselect"
:level="0" :level="0"
:unstyled="unstyled"
:pt="ptm('tree')" :pt="ptm('tree')"
data-pc-section="tree" data-pc-section="tree"
> >

View File

@ -22,6 +22,7 @@
:class="cx('paginator')" :class="cx('paginator')"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled"
:pt="ptm('paginator')" :pt="ptm('paginator')"
data-pc-section="paginator" data-pc-section="paginator"
> >
@ -120,6 +121,7 @@
:class="cx('paginator')" :class="cx('paginator')"
@page="onPage($event)" @page="onPage($event)"
:alwaysShow="alwaysShowPaginator" :alwaysShow="alwaysShowPaginator"
:unstyled="unstyled"
:pt="pt" :pt="pt"
data-pc-section="paginator" data-pc-section="paginator"
> >

View File

@ -6,7 +6,7 @@
</p> </p>
</DocSectionText> </DocSectionText>
<div class="card flex justify-content-center"> <div class="card flex justify-content-center">
<AutoComplete v-model="value" dropdown :suggestions="items" @complete="search" /> <AutoComplete v-model="value" dropdown :suggestions="items" @complete="search" unstyled />
</div> </div>
<DocSectionCode :code="code" /> <DocSectionCode :code="code" />
</template> </template>