diff --git a/apps/demo/src/locales/en/form.json b/apps/demo/src/locales/en/form.json index e9116ac91..3d7467dea 100644 --- a/apps/demo/src/locales/en/form.json +++ b/apps/demo/src/locales/en/form.json @@ -3,6 +3,9 @@ "submit": "Submit" }, "errors": { + "checkbox": { + "min": "Please select at least {min} options" + }, "daysInput": { "invalid": "Please provide number of days within a year" }, @@ -40,25 +43,31 @@ } }, "label": { + "accept": "Accept the terms and conditions to proceed", "appointmentDate": "Appointment date", "appointmentTime": "Appointment time", "arrivalDate": "Arrival date", + "assumptions": "Assumptions", "availableDatetime": "Available datetime", "basicInput": "Basic", "bike": "Bike", "car": "Car", + "checkbox": "Checkbox input", + "consequences": "Consequences", "contentElement": "Content element", "customColsRowsInput": "With cols and rows props", "customErrorMessageInput": "With custom error message", "customFormat": "Custom format", "customValidationInput": "With custom validation", "customStyleInput": "Custom style", + "dailySynchro": "Select the sections that should be in the daily synchro", "dateOfBirth": "Date of birth", "datePicker": "Date picker", "dateRange": "Date range", "dateTimePicker": "Datetime picker", "daysInput": "Days input", "debouncedTypeahead": "With debounce time prop", + "deliverableList": "A list of your daily deliverables", "disabled": "Disabled", "disableWeekDays": "Disable week days", "disabledMultiSelect": "Disabled multiselect", @@ -67,6 +76,7 @@ "expiresAfter": "Expires after", "female": "Female", "gender": "Gender", + "generalQuestions": "General questions", "iconSlot": "Icon slot", "input": "Input", "inputWithType": "With type prop", @@ -80,9 +90,12 @@ "monthAndYearPicker": "Month and year picker", "monthPicker": "Month picker", "multiCalendars": "Multicalendar", + "multiCheckbox": "Multiple checkbox input", "multiSelect": "Multiselect", + "next": "Next", "number": "Number", "one": "One", + "other": "Other", "password": "Password", "pickupDate": "Pickup date", "presentationDate": "Presentation date", @@ -90,7 +103,9 @@ "reportDate": "Report date", "size": "Size", "select": "Select", + "solutions": "Solutions", "submit": "Submit", + "summary": "Summary", "switch": "Switch", "textarea": "Textarea", "textInput": "Text input", @@ -104,6 +119,7 @@ "valid": "Show valid state", "vehicle": "Vehicle", "withI18n": "With i18n", + "workInProgress": "Work in progress", "year": "Year", "yearPicker": "Year picker" }, diff --git a/apps/demo/src/locales/fr/form.json b/apps/demo/src/locales/fr/form.json index 050118431..c2ce2ce3b 100644 --- a/apps/demo/src/locales/fr/form.json +++ b/apps/demo/src/locales/fr/form.json @@ -40,25 +40,31 @@ } }, "label": { + "accept": "Accept the terms and conditions to proceed", "appointmentDate": "Appointment date[fr]", "appointmentTime": "Appointment time[fr]", "arrivalDate": "Arrival date[fr]", + "assumptions": "Assumptions", "availableDatetime": "Available datetime[fr]", "basicInput": "Basic[fr]", "bike": "Bike", "car": "Car", + "checkbox": "Checkbox input", + "consequences": "Consequences", "contentElement": "Content element", "customColsRowsInput": "With cols and rows props[fr]", "customErrorMessageInput": "With custom error message[fr]", "customFormat": "Custom format[fr]", "customValidationInput": "With custom validation[fr]", "customStyleInput": "Custom style[fr]", + "dailySynchro": "Select the sections that should be in the daily synchro", "dateOfBirth": "Date of birth[fr]", "datePicker": "Date picker[fr]", "dateRange": "Date range[fr]", "dateTimePicker": "Datetime picker[fr]", "daysInput": "Days input", "debouncedTypeahead": "With debounce time prop", + "deliverableList": "A list of your daily deliverables", "disabledMultiSelect": "Disabled multiselect[fr]", "disabled": "Disabled[fr]", "disableWeekDays": "Disable week days[fr]", @@ -67,6 +73,7 @@ "expiresAfter": "Expires after", "female": "Female", "gender": "Gender", + "generalQuestions": "General questions", "iconSlot": "Icon slot", "input": "Input[fr]", "inputWithType": "With type prop[fr]", @@ -80,9 +87,12 @@ "monthAndYearPicker": "Month and year picker[fr]", "monthPicker": "Month picker[fr]", "multiCalendars": "Multicalendar[fr]", + "multiCheckbox": "Multiple checkbox input", "multiSelect": "Multiselect[fr]", + "next": "Next", "number": "Number[fr]", "one": "One", + "other": "Other", "password": "Password[fr]", "pickupDate": "Pickup date[fr]", "presentationDate": "Presentation date[fr]", @@ -90,7 +100,9 @@ "reportDate": "Report date[fr]", "size": "Size", "select": "Select[fr]", + "solutions": "Solutions", "submit": "Submit", + "summary": "Summary", "switch": "Switch[fr]", "textarea": "Textarea[fr]", "textInput": "Text input[fr]", @@ -104,6 +116,7 @@ "valid": "Show valid state[fr]", "vehicle": "Vehicle", "withI18n": "With i18n[fr]", + "workInProgress": "Work in progress", "year": "Year[fr]", "yearPicker": "Year picke[fr]" }, diff --git a/apps/demo/src/router/form.ts b/apps/demo/src/router/form.ts index 10c625313..fc878c90b 100644 --- a/apps/demo/src/router/form.ts +++ b/apps/demo/src/router/form.ts @@ -1,3 +1,4 @@ +const CheckboxInput = () => import("@/views/Form/checkboxInput/Index.vue"); const DatePicker = () => import("@/views/Form/datePicker/Index.vue"); const DaysInput = () => import("@/views/Form/daysInput/Index.vue"); const EditableContent = () => import("@/views/Form/editableContent/Index.vue"); @@ -17,6 +18,11 @@ const routes = [ { path: "/form", children: [ + { + component: CheckboxInput, + name: "checkboxInput", + path: "checkbox-input", + }, { component: DatePicker, name: "datePicker", diff --git a/apps/demo/src/views/Form/FormPage.vue b/apps/demo/src/views/Form/FormPage.vue index 057a0ae08..1ee9bd811 100644 --- a/apps/demo/src/views/Form/FormPage.vue +++ b/apps/demo/src/views/Form/FormPage.vue @@ -41,6 +41,10 @@ const menu = [ name: "Get started", routeName: "", }, + { + name: "Checkbox input", + routeName: "checkboxInput", + }, { name: "Date picker", routeName: "datePicker", diff --git a/apps/demo/src/views/Form/checkboxInput/Index.vue b/apps/demo/src/views/Form/checkboxInput/Index.vue new file mode 100644 index 000000000..2286e0315 --- /dev/null +++ b/apps/demo/src/views/Form/checkboxInput/Index.vue @@ -0,0 +1,314 @@ + + + + + diff --git a/packages/vue-form/src/assets/css/input.css b/packages/vue-form/src/assets/css/input.css index f657ce1ba..9f7f94dfb 100644 --- a/packages/vue-form/src/assets/css/input.css +++ b/packages/vue-form/src/assets/css/input.css @@ -24,6 +24,10 @@ width: 100%; } +.field input:disabled { + cursor: default; +} + .field input[type="radio"] { height: fit-content; } @@ -42,3 +46,11 @@ .field textarea:disabled { resize: none; } + +.field.checkbox input[type=checkbox] { + height: fit-content; + margin-right: .5em; + width: auto; + cursor: pointer; + accent-color: #007aff; +} diff --git a/packages/vue-form/src/components/Checkbox.vue b/packages/vue-form/src/components/Checkbox.vue new file mode 100644 index 000000000..5c6dd1968 --- /dev/null +++ b/packages/vue-form/src/components/Checkbox.vue @@ -0,0 +1,74 @@ + + + + + + + diff --git a/packages/vue-form/src/components/CheckboxInput.vue b/packages/vue-form/src/components/CheckboxInput.vue new file mode 100644 index 000000000..3ba4f26ae --- /dev/null +++ b/packages/vue-form/src/components/CheckboxInput.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/packages/vue-form/src/components/index.ts b/packages/vue-form/src/components/index.ts index ded91afa4..d06d87194 100644 --- a/packages/vue-form/src/components/index.ts +++ b/packages/vue-form/src/components/index.ts @@ -1,6 +1,8 @@ -export { default as EditableContent } from "./EditableContent.vue"; +export { default as Checkbox } from "./Checkbox.vue"; +export { default as CheckboxInput } from "./CheckboxInput.vue"; export { default as DatePicker } from "./DatePicker.vue"; export { default as DaysInput } from "./DaysInput.vue"; +export { default as EditableContent } from "./EditableContent.vue"; export { default as Email } from "./Email.vue"; export { default as Form } from "./Form.vue"; export { default as FormActions } from "./FormActions.vue";