FloatLabel page added

pull/5206/head
tugcekucukoglu 2024-02-02 15:40:35 +03:00
parent 43cdab506d
commit 88a679feaf
8 changed files with 185 additions and 3 deletions

View File

@ -93,6 +93,11 @@
"name": "Editor", "name": "Editor",
"to": "/editor" "to": "/editor"
}, },
{
"name": "FloatLabel",
"to": "/floatlabel",
"badge": "NEW"
},
{ {
"name": "InputGroup", "name": "InputGroup",
"to": "/inputgroup" "to": "/inputgroup"

View File

@ -1,13 +1,13 @@
/** /**
* *
* FloatLabel is a grouping component with the optional content toggle feature. * FloatLabel appears on top of the input field when focused.
* *
* [Live Demo](https://www.primevue.org/inputtext/) * [Live Demo](https://www.primevue.org/inputtext/)
* *
* @module floatlabel * @module floatlabel
* *
*/ */
import { AnchorHTMLAttributes, TransitionProps, VNode } from 'vue'; import { TransitionProps, VNode } from 'vue';
import { ComponentHooks } from '../basecomponent'; import { ComponentHooks } from '../basecomponent';
import { PassThroughOptions } from '../passthrough'; import { PassThroughOptions } from '../passthrough';
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers'; import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
@ -108,7 +108,7 @@ export interface FloatLabelEmits {}
/** /**
* **PrimeVue - FloatLabel** * **PrimeVue - FloatLabel**
* *
* _FloatLabel is a grouping component with the optional content toggle feature._ * _FloatLabel appears on top of the input field when focused._
* *
* [Live Demo](https://www.primevue.org/inputtext/) * [Live Demo](https://www.primevue.org/inputtext/)
* --- --- * --- ---

View File

@ -0,0 +1,9 @@
<template>
<DocSectionText id="accessibility" label="Accessibility" v-bind="$attrs">
<h3>Screen Reader</h3>
<p>FloatLabel does not require any roles and attributes.</p>
<h3>Keyboard Support</h3>
<p>Component does not include any interactive elements.</p>
</DocSectionText>
</template>

View File

@ -0,0 +1,67 @@
<template>
<DocSectionText v-bind="$attrs">
<p>FloatLabel is used by wrapping the input and its label.</p>
</DocSectionText>
<div class="card flex justify-content-center">
<FloatLabel>
<InputText id="username" v-model="value" />
<label for="username">Username</label>
</FloatLabel>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: null,
code: {
basic: `
<FloatLabel>
<InputText id="username" v-model="value" />
<label for="username">Username</label>
</FloatLabel>
`,
options: `
<template>
<div class="card flex justify-content-center">
<FloatLabel>
<InputText id="username" v-model="value" />
<label for="username">Username</label>
</FloatLabel>
</div>
</template>
<script setup>
export default {
data() {
return {
value: null
}
}
}
<\/script>
`,
composition: `
<template>
<div class="card flex justify-content-center">
<FloatLabel>
<InputText id="username" v-model="value" />
<label for="username">Username</label>
</FloatLabel>
</div>
</template>
<script setup>
import { ref } from 'vue';
const value = ref(null);
<\/script>
`
}
};
}
};
</script>

View File

@ -0,0 +1,18 @@
<template>
<DocSectionText v-bind="$attrs" />
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
import FloatLabel from 'primevue/floatlabel';
`
}
};
}
};
</script>

View File

@ -0,0 +1,21 @@
<template>
<DocSectionText v-bind="$attrs">
<p>List of class names used in the styled mode.</p>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Element</th>
</tr>
</thead>
<tbody>
<tr>
<td>p-float-label</td>
<td>Float label element.</td>
</tr>
</tbody>
</table>
</div>
</DocSectionText>
</template>

View File

@ -0,0 +1,27 @@
<template>
<div class="doc-main">
<div class="doc-intro">
<h1>FloatLabel Theming</h1>
</div>
<DocSections :docs="docs" />
</div>
<DocSectionNav :docs="docs" />
</template>
<script>
import StyledDoc from './StyledDoc.vue';
export default {
data() {
return {
docs: [
{
id: 'theming.styled',
label: 'Styled',
component: StyledDoc
}
]
};
}
};
</script>

View File

@ -0,0 +1,35 @@
<template>
<DocComponent title="Vue Float Label" header="Float Label" description="FloatLabel appears on top of the input field when focused." :componentDocs="docs" :apiDocs="['FloatLabel']" :themingDocs="themingDoc" />
</template>
<script>
import AccessibilityDoc from '@/doc/floatlabel/AccessibilityDoc.vue';
import BasicDoc from '@/doc/floatlabel/BasicDoc.vue';
import ImportDoc from '@/doc/floatlabel/ImportDoc.vue';
import ThemingDoc from '@/doc/floatlabel/theming/index.vue';
export default {
data() {
return {
docs: [
{
id: 'import',
label: 'Import',
component: ImportDoc
},
{
id: 'basic',
label: 'Basic',
component: BasicDoc
},
{
id: 'accessibility',
label: 'Accessibility',
component: AccessibilityDoc
}
],
themingDoc: ThemingDoc
};
}
};
</script>