floatLabel
This commit is contained in:
@ -3,35 +3,36 @@ import type { FormKitInputs } from '@formkit/inputs';
|
||||
import { casts, createSection, label, outer } from '@formkit/inputs';
|
||||
import SchemaComponent from 'primevue/inputtext';
|
||||
import { markRaw } from 'vue';
|
||||
import { floatLabel } from '../sections/floatLabel';
|
||||
import { messages } from '../sections/messages';
|
||||
|
||||
const cmpName = `SchemaComponent${SchemaComponent.name}`;
|
||||
const input = createSection('input', () => ({
|
||||
$cmp: markRaw(SchemaComponent) as never,
|
||||
bind: '$attrs',
|
||||
props: {
|
||||
invalid: '$state.invalid',
|
||||
type: '$type',
|
||||
disabled: '$disabled',
|
||||
name: '$node.name',
|
||||
onInput: '$handlers.DOMInput',
|
||||
onBlur: '$handlers.blur',
|
||||
modelValue: '$_value',
|
||||
id: '$id',
|
||||
fluid: true,
|
||||
},
|
||||
}));
|
||||
|
||||
export const PInputText: FormKitTypeDefinition = {
|
||||
type: 'input',
|
||||
schema: outer(
|
||||
label('$label'),
|
||||
createSection('input', () => ({
|
||||
$cmp: cmpName,
|
||||
bind: '$attrs',
|
||||
props: {
|
||||
invalid: '$state.invalid',
|
||||
type: '$type',
|
||||
disabled: '$disabled',
|
||||
name: '$node.name',
|
||||
onInput: '$handlers.DOMInput',
|
||||
onBlur: '$handlers.blur',
|
||||
modelValue: '$_value',
|
||||
id: '$id',
|
||||
},
|
||||
}))(),
|
||||
floatLabel(
|
||||
input(), //
|
||||
label('$label'),
|
||||
),
|
||||
messages(),
|
||||
),
|
||||
library: {
|
||||
[cmpName]: markRaw(SchemaComponent),
|
||||
},
|
||||
features: [casts],
|
||||
// schemaMemoKey: 'g2f31c24kjh',
|
||||
// schemaMemoKey: 'g2f31c24kjh', // Math.random().toString(36).substring(2, 15)
|
||||
};
|
||||
|
||||
declare module '@formkit/inputs' {
|
||||
|
Reference in New Issue
Block a user