Skip to content

Commit

Permalink
Fixed #5547 - Remove styled from speed
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Apr 8, 2024
1 parent 704f6de commit af56b7c
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 80 deletions.
2 changes: 1 addition & 1 deletion components/landing/ThemeSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<template #header>
<div class="flex flex-column sm:flex-row sm:justify-content-between sm:align-items-center">
<h5 class="m-0">Customers</h5>
<IconField iconPosition="left" class="mt-3 sm:mt-0 w-full sm:w-auto">
<IconField class="mt-3 sm:mt-0 w-full sm:w-auto">
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
6 changes: 0 additions & 6 deletions components/lib/iconfield/BaseIconField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import IconFieldStyle from 'primevue/iconfield/style';
export default {
name: 'BaseIconField',
extends: BaseComponent,
props: {
iconPosition: {
type: String,
default: 'right'
}
},
style: IconFieldStyle,
provide() {
return {
Expand Down
5 changes: 0 additions & 5 deletions components/lib/iconfield/IconField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ export interface IconFieldPassThroughAttributes {
* Defines valid properties in IconField component.
*/
export interface IconFieldProps {
/**
* Position of the icon
* @defaultValue right
*/
iconPosition?: 'left' | 'right' | undefined;
/**
* It generates scoped CSS variables using design tokens for the component.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/iconfield/style/IconFieldStyle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BaseStyle from 'primevue/base/style';

const classes = {
root: 'p-icon-field'
root: 'p-iconfield'
};

export default BaseStyle.extend({
Expand Down
2 changes: 1 addition & 1 deletion components/lib/inputicon/style/InputIconStyle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BaseStyle from 'primevue/base/style';

const classes = {
root: 'p-input-icon'
root: 'p-inputicon'
};

export default BaseStyle.extend({
Expand Down
12 changes: 6 additions & 6 deletions components/lib/themes/primeone/base/iconfield/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
export default {
css: ({ dt }) => `
.p-icon-field {
.p-iconfield {
position: relative;
}
.p-input-icon {
.p-inputicon {
position: absolute;
top: 50%;
margin-top: -.5rem;
color: ${dt('iconfield.color')};
}
.p-icon-field .p-input-icon:first-child {
.p-iconfield .p-inputicon:first-child {
left: 0.75rem;
}
.p-icon-field .p-input-icon:last-child {
.p-iconfield .p-inputicon:last-child {
right: 0.75rem;
}
.p-icon-field .p-inputtext:last-child {
.p-iconfield .p-inputtext:last-child {
padding-left: 2.5rem;
}
.p-icon-field .p-inputtext:first-child {
.p-iconfield .p-inputtext:first-child {
padding-right: 2.5rem;
}
`
Expand Down
10 changes: 0 additions & 10 deletions components/lib/themes/primeone/base/inputtext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ export default {
color: ${dt('inputtext.disabled.color')};
}
.p-input-icon-right > svg:last-of-type,
.p-input-icon-right > i:last-of-type {
right: 0.75rem;
color: #94a3b8;
}
.p-input-icon-right > .p-inputtext {
padding-right: 2.5rem;
}
.p-inputtext::placeholder {
color: ${dt('inputtext.placeholder.color')};
}
Expand Down
10 changes: 1 addition & 9 deletions doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -28874,14 +28874,6 @@
"description": "Defines valid properties in IconField component.",
"relatedProp": "",
"props": [
{
"name": "iconPosition",
"optional": true,
"readonly": false,
"type": "\"left\" | \"right\"",
"default": "right",
"description": "Position of the icon"
},
{
"name": "dt",
"optional": true,
Expand Down Expand Up @@ -61552,4 +61544,4 @@
}
}
}
}
}
8 changes: 4 additions & 4 deletions doc/datatable/StatefulDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
tableStyle="min-width: 50rem"
>
<template #header>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -112,7 +112,7 @@ export default {
stateStorage="session" stateKey="dt-state-demo-session" paginator :rows="5" filterDisplay="menu"
selectionMode="single" dataKey="id" :globalFilterFields="['name', 'country.name', 'representative.name', 'status']" tableStyle="min-width: 50rem">
<template #header>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -175,7 +175,7 @@ export default {
stateStorage="session" stateKey="dt-state-demo-session" paginator :rows="5" filterDisplay="menu"
selectionMode="single" dataKey="id" :globalFilterFields="['name', 'country.name', 'representative.name', 'status']" tableStyle="min-width: 50rem">
<template #header>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -303,7 +303,7 @@ export default {
stateStorage="session" stateKey="dt-state-demo-session" paginator :rows="5" filterDisplay="menu"
selectionMode="single" dataKey="id" :globalFilterFields="['name', 'country.name', 'representative.name', 'status']" tableStyle="min-width: 50rem">
<template #header>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
8 changes: 4 additions & 4 deletions doc/datatable/filter/AdvancedFilterDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -149,7 +149,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -264,7 +264,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -471,7 +471,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
8 changes: 4 additions & 4 deletions doc/datatable/filter/BasicFilterDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<DataTable v-model:filters="filters" :value="customers" paginator :rows="10" dataKey="id" filterDisplay="row" :loading="loading" :globalFilterFields="['name', 'country.name', 'representative.name', 'status']">
<template #header>
<div class="flex justify-content-end">
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -120,7 +120,7 @@ export default {
:globalFilterFields="['name', 'country.name', 'representative.name', 'status']">
<template #header>
<div class="flex justify-content-end">
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -196,7 +196,7 @@ export default {
:globalFilterFields="['name', 'country.name', 'representative.name', 'status']">
<template #header>
<div class="flex justify-content-end">
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -352,7 +352,7 @@ export default {
:globalFilterFields="['name', 'country.name', 'representative.name', 'status']">
<template #header>
<div class="flex justify-content-end">
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
8 changes: 4 additions & 4 deletions doc/datatable/samples/CustomersDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -145,7 +145,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -247,7 +247,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -440,7 +440,7 @@ export default {
<template #header>
<div class="flex justify-content-between">
<Button type="button" icon="pi pi-filter-slash" label="Clear" outlined @click="clearFilter()" />
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
8 changes: 4 additions & 4 deletions doc/datatable/samples/ProductsDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<template #header>
<div class="flex flex-wrap gap-2 align-items-center justify-content-between">
<h4 class="m-0">Manage Products</h4>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -208,7 +208,7 @@ export default {
<template #header>
<div class="flex flex-wrap gap-2 align-items-center justify-content-between">
<h4 class="m-0">Manage Products</h4>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -271,7 +271,7 @@ export default {
<template #header>
<div class="flex flex-wrap gap-2 align-items-center justify-content-between">
<h4 class="m-0">Manage Products</h4>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down Expand Up @@ -562,7 +562,7 @@ export default {
<template #header>
<div class="flex flex-wrap gap-2 align-items-center justify-content-between">
<h4 class="m-0">Manage Products</h4>
<IconField iconPosition="left">
<IconField>
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
Expand Down
22 changes: 9 additions & 13 deletions doc/iconfield/BasicDoc.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<template>
<DocSectionText v-bind="$attrs">
<p>
A group is created by wrapping the input and icon with the <i>IconField</i> component. Each icon is defined as a child of <i>InputIcon</i> component. In addition, position of the icon can be changed using <i>iconPosition</i> property that
the default value is <i>right</i> and also <i>left</i> option is available.
</p>
<p><i>IconField</i> wraps the <i>InputIcon</i> and the input field component.</p>
</DocSectionText>
<div class="card flex flex-wrap justify-content-center gap-3">
<IconField>
<InputIcon class="pi pi-search"> </InputIcon>
<InputIcon class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</IconField>

<IconField>
<InputText v-model="value2" />
<InputIcon class="pi pi-spin pi-spinner"> </InputIcon>
<InputIcon class="pi pi-spin pi-spinner" />
</IconField>
</div>
<DocSectionCode :code="code" />
Expand All @@ -28,27 +25,26 @@ export default {
code: {
basic: `
<IconField>
<InputIcon class="pi pi-search"> </InputIcon>
<InputIcon class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</IconField>
<IconField>
<InputIcon class="pi pi-spin pi-spinner"> </InputIcon>
<InputText v-model="value2" />
<InputIcon class="pi pi-spin pi-spinner" />
</IconField>
`,
options: `
<template>
<div class="card flex flex-wrap justify-content-center gap-3">
<IconField>
<IconField>
<InputIcon class="pi pi-search"> </InputIcon>
<InputIcon class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</IconField>
<IconField>
<InputIcon class="pi pi-spin pi-spinner"> </InputIcon>
<InputText v-model="value2" />
<InputIcon class="pi pi-spin pi-spinner" />
</IconField>
</div>
</template>
Expand All @@ -68,13 +64,13 @@ export default {
<template>
<div class="card flex flex-wrap justify-content-center gap-3">
<IconField>
<InputIcon class="pi pi-search"> </InputIcon>
<InputIcon class="pi pi-search" />
<InputText v-model="value1" placeholder="Search" />
</IconField>
<IconField>
<InputIcon class="pi pi-spin pi-spinner"> </InputIcon>
<InputText v-model="value2" />
<InputIcon class="pi pi-spin pi-spinner" />
</IconField>
</div>
</template>
Expand Down
Loading

0 comments on commit af56b7c

Please sign in to comment.