Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrimeVue Forms #6632

Merged
merged 124 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
9870b30
Create `@primevue/form` package and add `form` component
mertsincan Oct 18, 2024
3ec43ed
Add new base structures to core
mertsincan Oct 18, 2024
ae93054
Add form support to `InputText`
mertsincan Oct 18, 2024
61208c4
Add form support to `AutoComplete`
mertsincan Oct 18, 2024
a7a1cc3
Add form support to `CascadeSelect`
mertsincan Oct 18, 2024
96e2325
Add form support to `Checkbox`
mertsincan Oct 18, 2024
79f5143
Add form support to `DatePicker`
mertsincan Oct 18, 2024
044a900
Add form support to `InputOtp`
mertsincan Oct 18, 2024
1802fcd
Add form support to `Listbox`
mertsincan Oct 18, 2024
c806a8c
Add form support to `MultiSelect`
mertsincan Oct 18, 2024
2a63b3f
Add form support to `RadioButton`
mertsincan Oct 18, 2024
97e27ad
Add form support to `Rating`
mertsincan Oct 18, 2024
a193c1e
Add form support to `Select`
mertsincan Oct 18, 2024
2785def
Add form support to `SelectButton`
mertsincan Oct 18, 2024
cff6d40
Add form support to `Textarea`
mertsincan Oct 18, 2024
044eace
Add form support to `ToggleButton`
mertsincan Oct 18, 2024
c7f6e25
Add form support to `ToggleSwitch`
mertsincan Oct 18, 2024
8f49edb
Add form support to `TreeSelect`
mertsincan Oct 18, 2024
5b1d3f8
Refactor on Base* structure
mertsincan Oct 18, 2024
de8ee98
New Component: `CheckboxGroup`
mertsincan Oct 20, 2024
2458008
New Component: `RadioButtonGroup`
mertsincan Oct 20, 2024
59d01c2
Update `CheckboxGroup` types
mertsincan Oct 20, 2024
ab65220
New Component: `RadioButtonGroup`
mertsincan Oct 20, 2024
739f43c
Form d.ts update
mertsincan Oct 21, 2024
243eaf3
Update primeuix/form version
mertsincan Oct 21, 2024
ca12435
Update d.ts files
mertsincan Oct 21, 2024
0a1c3cc
Update autoimport for form
mertsincan Oct 21, 2024
49ad1d6
Change sass* version for warnings
mertsincan Oct 21, 2024
8ee1951
remove joi
mertsincan Oct 21, 2024
b262611
InputText validation demo added
tugcekucukoglu Oct 21, 2024
2f92dbf
Update FormDoc.vue
tugcekucukoglu Oct 21, 2024
fcac401
Update `SelectButton`
mertsincan Oct 21, 2024
15cc6d9
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
mertsincan Oct 21, 2024
a48f155
Add form support to `ColorPicker`
mertsincan Oct 21, 2024
112d3ec
Add form support to `Editor`
mertsincan Oct 21, 2024
387f86d
Add form support to `Knob`
mertsincan Oct 21, 2024
138d4cd
Update form package
mertsincan Oct 21, 2024
ff3f03a
AutoComplete validation demo
tugcekucukoglu Oct 21, 2024
b0f0e1c
Update FormDoc.vue
tugcekucukoglu Oct 21, 2024
451a7c8
Checkbox and Select validation
tugcekucukoglu Oct 21, 2024
5bf013c
Fixed useform issue
mertsincan Oct 21, 2024
22f5f8e
AutoComplete Form doc
tugcekucukoglu Oct 22, 2024
9aa09d1
Cascade Form doc
tugcekucukoglu Oct 22, 2024
ed4b7f8
Refactor
tugcekucukoglu Oct 22, 2024
7916df8
MultiSelect form
tugcekucukoglu Oct 22, 2024
66dcba0
Password form
tugcekucukoglu Oct 22, 2024
c1db521
Update validation sample
cagataycivici Oct 22, 2024
6fded55
Update MultiSelect Form doc
mertsincan Oct 22, 2024
f1a584f
Add form support to `Password`
mertsincan Oct 22, 2024
293962a
Update ColorPickerStyle.js
tugcekucukoglu Oct 22, 2024
bc06964
Rename `defaultValues` with `initialValues` in Form
mertsincan Oct 22, 2024
06f9b5f
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
mertsincan Oct 22, 2024
827b8d1
Fixed Checkbox state in MultiSelect
mertsincan Oct 22, 2024
f8e55a2
Knob form demo
tugcekucukoglu Oct 22, 2024
fbb0131
Fixed initial value issue in form components
mertsincan Oct 22, 2024
4523417
Fixed knob issue
mertsincan Oct 22, 2024
b9c477c
AutoComplete form demo
tugcekucukoglu Oct 22, 2024
2823b37
CascadeSelect from demo
tugcekucukoglu Oct 22, 2024
0e3ba84
Checkbox form
tugcekucukoglu Oct 22, 2024
b76a9cb
Knob form
tugcekucukoglu Oct 22, 2024
c71ea19
MultiSelect form
tugcekucukoglu Oct 22, 2024
9f8003a
Add onInput method to form API
mertsincan Oct 22, 2024
4929f97
Add `forms` demo page
mertsincan Oct 23, 2024
ed34390
Fixed controlled mode issue
mertsincan Oct 23, 2024
4699766
Refactor
mertsincan Oct 23, 2024
20d733c
AutoComplete form updates
tugcekucukoglu Oct 23, 2024
d4283a7
Listbox form
tugcekucukoglu Oct 23, 2024
2031423
MultiSelect form updates
tugcekucukoglu Oct 23, 2024
48b4442
Select form updates
tugcekucukoglu Oct 23, 2024
ff4c663
ColorPicker forms added
tugcekucukoglu Oct 23, 2024
794db5c
DatePicker forms added
tugcekucukoglu Oct 23, 2024
be76f85
Editor forms added
tugcekucukoglu Oct 23, 2024
7b2e4c7
Refactor
tugcekucukoglu Oct 23, 2024
ff8de14
Update templates.js
tugcekucukoglu Oct 23, 2024
ac099a2
Forms documentation updates
tugcekucukoglu Oct 23, 2024
268c516
Update FormStyle.d.ts
mertsincan Oct 23, 2024
8c68ce7
InputOtp forms added
tugcekucukoglu Oct 23, 2024
58c05c6
InputText updates
tugcekucukoglu Oct 23, 2024
120e2c5
Password updates
tugcekucukoglu Oct 23, 2024
47f243f
RadioButton forms added
tugcekucukoglu Oct 23, 2024
5bbc7a5
Refactor
mertsincan Oct 23, 2024
fbea2a6
Rating forms added
tugcekucukoglu Oct 23, 2024
6c8b8ee
SelectButton forms added
tugcekucukoglu Oct 23, 2024
9f5a51f
Textarea forms added
tugcekucukoglu Oct 23, 2024
1de6cb2
ToggleButton forms added
tugcekucukoglu Oct 23, 2024
17d638f
ToggleSwitch forms added
tugcekucukoglu Oct 23, 2024
30204b5
TreeSelect forms added
tugcekucukoglu Oct 23, 2024
f0fd14c
InputMask forms added
tugcekucukoglu Oct 23, 2024
b721c3f
InputNumber forms added
tugcekucukoglu Oct 23, 2024
6c47a92
Slider forms added
tugcekucukoglu Oct 23, 2024
b73e446
Add `validateOn` form page
mertsincan Oct 23, 2024
a76f125
Update d.ts files and form state
mertsincan Oct 23, 2024
85f8be6
Update SubmitDoc.vue
mertsincan Oct 23, 2024
960927b
Update form demo codes
mertsincan Oct 23, 2024
437e90a
Update FormDoc.vue
mertsincan Oct 23, 2024
755edbf
Update FormDoc.vue
mertsincan Oct 23, 2024
ce0a410
From doc updates
tugcekucukoglu Oct 23, 2024
9d6c643
Update RegisterDoc.vue
mertsincan Oct 23, 2024
f414474
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
mertsincan Oct 23, 2024
0fad871
Update ColorPicker.vue
tugcekucukoglu Oct 23, 2024
3f2510e
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
tugcekucukoglu Oct 23, 2024
90c7b0d
Forms doc updates
tugcekucukoglu Oct 23, 2024
b67ed2d
Add form support to `Slider`
mertsincan Oct 23, 2024
85133c9
Update Select.vue
mertsincan Oct 23, 2024
304c26b
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
mertsincan Oct 23, 2024
95e619a
Update Slider form demo
mertsincan Oct 23, 2024
fbb15c8
Form renaming
tugcekucukoglu Oct 23, 2024
debb54c
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
tugcekucukoglu Oct 23, 2024
eeacc7c
Update SubmitDoc.vue
tugcekucukoglu Oct 23, 2024
9a68b37
Add form support to `InputMask`
mertsincan Oct 23, 2024
a60230f
Update InputMask.d.ts
mertsincan Oct 23, 2024
4561acf
Rename `updateValue` with `writeValue` in BaseEditableHolder
mertsincan Oct 23, 2024
25b49e2
Update FormsDoc.vue
tugcekucukoglu Oct 23, 2024
e83dfff
Add form support to `InputNumber`
mertsincan Oct 23, 2024
6b491f3
Merge branch 'v4.2.0-form' of https://github.com/primefaces/primevue …
mertsincan Oct 23, 2024
bb043ac
Update forms page
mertsincan Oct 23, 2024
d01c40c
Update index.json
mertsincan Oct 23, 2024
9484543
Refactor
mertsincan Oct 23, 2024
eaa03d8
Refactor on validateOn demo
mertsincan Oct 23, 2024
d2b191e
Convert to composition API
mertsincan Oct 23, 2024
a740599
Update ResolversDoc.vue
mertsincan Oct 23, 2024
81a2d41
Update form package build
mertsincan Oct 23, 2024
7956a1b
Fixed build errors
mertsincan Oct 23, 2024
593523b
Update StatesDoc.vue
mertsincan Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/showcase/assets/menu/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@
}
]
},
{
"name": "Forms",
"icon": "pi pi-check-circle",
"to": "/forms",
"badge": "NEW"
},
{
"name": "Pass Through",
"icon": "pi pi-directions",
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/components/doc/DocApiSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default {
interfaces = this.findOtherInterfaces(values, docName);
}

const types = APIDocs[moduleName]['types'];
const types = APIDocs[moduleName]?.['types'];

const services = modelValues; // (TerminalService && ConfirmationService && ToastService)

Expand Down
1 change: 1 addition & 0 deletions apps/showcase/components/doc/codeeditor/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const core_dependencies = {
primevue: pkg.version || PrimeVue.version || 'latest',
'@primevue/themes': pkg.version || PrimeVue.version || 'latest',
'@primevue/auto-import-resolver': pkg.version || PrimeVue.version || 'latest',
'@primevue/form': pkg.version || PrimeVue.version || 'latest',
primeicons: app_dependencies['primeicons'] || 'latest',
tailwindcss: app_dependencies['tailwindcss'] || 'latest',
autoprefixer: app_dependencies['autoprefixer'] || 'latest',
Expand Down
1 change: 0 additions & 1 deletion apps/showcase/components/landing/samples/CustomersApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ export default {
selectedRows: []
};
},

methods: {
displayPopover(event) {
this.hidePopover();
Expand Down
202 changes: 202 additions & 0 deletions apps/showcase/doc/autocomplete/FormsDoc.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
<template>
<DocSectionText v-bind="$attrs">
<p>AutoComplete can be used with the <NuxtLink to="/forms">PrimeVue Forms</NuxtLink> library.</p>
</DocSectionText>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4 w-full md:w-56">
<div class="flex flex-col gap-2">
<AutoComplete name="country" optionLabel="name" :suggestions="filteredCountries" @complete="search" fluid />
<Message v-if="$form.country?.invalid" severity="error">{{ $form.country.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
</div>
<DocSectionCode :code="code" :dependencies="{ zod: '3.23.8' }" />
</template>

<script>
import { CountryService } from '@/service/CountryService';
import { zodResolver } from '@primevue/form/resolvers';
import { z } from 'zod';

export default {
data() {
return {
initialValues: {
country: { name: '' }
},
countries: null,
filteredCountries: null,
resolver: zodResolver(
z.object({
country: z.union([
z.object({
name: z.string().min(1, 'Country required.')
}),
z.any().refine((val) => false, { message: 'Country required.' })
])
})
),
code: {
basic: `
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4 w-full md:w-56">
<div class="flex flex-col gap-2">
<AutoComplete name="country" optionLabel="name" :suggestions="filteredCountries" @complete="search" />
<Message v-if="$form.country?.invalid" severity="error">{{ $form.country.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
`,
options: `
<template>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4 w-full md:w-56">
<div class="flex flex-col gap-2">
<AutoComplete name="country" optionLabel="name" :suggestions="filteredCountries" @complete="search" />
<Message v-if="$form.country?.invalid" severity="error">{{ $form.country.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
<Toast />
</div>
</template>

<script>
import { CountryService } from '@/service/CountryService';
import { zodResolver } from '@primevue/form/resolvers';
import { z } from 'zod';

export default {
data() {
return {
initialValues: {
country: { name: '' }
},
countries: null,
filteredCountries: null,
resolver: zodResolver(
z.object({
country: z.union([
z.object({
name: z.string().min(1, 'Country required.')
}),
z.any().refine((val) => false, { message: 'Country required.' })
])
})
)
}
},
mounted() {
CountryService.getCountries().then((data) => (this.countries = data));
},
methods: {
search(event) {
setTimeout(() => {
if (!event.query.trim().length) {
this.filteredCountries = [...this.countries];
} else {
this.filteredCountries = this.countries.filter((country) => {
return country.name.toLowerCase().startsWith(event.query.toLowerCase());
});
}
}, 250);
},
onFormSubmit({ valid }) {
if (valid) {
this.$toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
}
}
}
}
<\/script>

`,
composition: `
<template>
<div class="card flex justify-center">
<Form v-slot="$form" :resolver="resolver" :initialValues="initialValues" @submit="onFormSubmit" class="flex justify-center flex-col gap-4 w-full md:w-56">
<div class="flex flex-col gap-2">
<AutoComplete name="country" optionLabel="name" :suggestions="filteredCountries" @complete="search" />
<Message v-if="$form.country?.invalid" severity="error">{{ $form.country.error?.message }}</Message>
</div>
<Button type="submit" severity="secondary" label="Submit" />
</Form>
<Toast />
</div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { zodResolver } from '@primevue/form/resolvers';
import { useToast } from "primevue/usetoast";
import { z } from 'zod';
import { CountryService } from "@/service/CountryService";

onMounted(() => {
CountryService.getCountries().then((data) => (countries.value = data));
});

const initialValues = ref({
country: { name: '' }
});
const resolver = ref(
zodResolver(
z.object({
country: z.union([
z.object({
name: z.string().min(1, 'Country required.')
}),
z.any().refine((val) => false, { message: 'Country required.' })
])
})
));
const countries = ref();
const selectedCountry = ref();
const filteredCountries = ref();
const toast = useToast();

const search = (event) => {
setTimeout(() => {
if (!event.query.trim().length) {
filteredCountries.value = [...countries.value];
} else {
filteredCountries.value = countries.value.filter((country) => {
return country.name.toLowerCase().startsWith(event.query.toLowerCase());
});
}
}, 250);
};

const onFormSubmit = ({ valid }) => {
if (valid) {
toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
}
};
<\/script>
`
}
};
},
mounted() {
CountryService.getCountries().then((data) => (this.countries = data));
},
methods: {
search(event) {
setTimeout(() => {
if (!event.query.trim().length) {
this.filteredCountries = [...this.countries];
} else {
this.filteredCountries = this.countries.filter((country) => {
return country.name.toLowerCase().startsWith(event.query.toLowerCase());
});
}
}, 250);
},
onFormSubmit({ valid }) {
if (valid) {
this.$toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 });
}
}
}
};
</script>
Loading
Loading