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

Refactor and update demo before code for form components #452

Merged
merged 6 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion apps/demo/src/assets/css/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ section:has(h3) {

.demo .section-content {
display: grid;
gap: 1.5em;
gap: 0.25em;
margin-top: 1em;
}

Expand Down
1 change: 1 addition & 0 deletions apps/demo/src/locales/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"input": "Input",
"inputWithType": "With type prop",
"inputWithValidation": "With validation",
"inputWithValidationOptions": "With validation options",
"invalid": "Show invalid state",
"joinedDate": "Joined date",
"labelInput": "With label",
Expand Down
1 change: 1 addition & 0 deletions apps/demo/src/locales/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"input": "Input[fr]",
"inputWithType": "With type prop[fr]",
"inputWithValidation": "With validation[fr]",
"inputWithValidationOptions": "With validation options",
"invalid": "Show invalid state[fr]",
"joinedDate": "Joined date[fr]",
"labelInput": "With label[fr]",
Expand Down
64 changes: 32 additions & 32 deletions apps/demo/src/views/Form/checkboxInput/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
<h2>{{ $t("form.label.basicInput") }}</h2>

<div class="section-content">
<CheckboxInput
v-model:checked="formData.noLabelInput"
:input-label="$t('form.label.accept')"
name="basic"
/>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
Expand All @@ -28,19 +34,20 @@
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->

<CheckboxInput
v-model:checked="formData.noLabelInput"
:input-label="$t('form.label.accept')"
name="basic"
/>
</div>
</section>

<section>
<h2>{{ $t("form.label.multiCheckbox") }}</h2>

<div class="section-content">
<CheckboxInput
v-model="formData.multiCheckbox"
:label="$t('form.label.vehicle')"
:options="vehicleOptions"
name="multi-checkbox"
/>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
Expand Down Expand Up @@ -74,20 +81,22 @@
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->

<CheckboxInput
v-model="formData.multiCheckbox"
:label="$t('form.label.vehicle')"
:options="vehicleOptions"
name="multi-checkbox"
/>
</div>
</section>

<section>
<h2>{{ $t("form.label.disabled") }}</h2>

<div class="section-content">
<CheckboxInput
v-model="formData.disabled"
:label="$t('form.label.vehicle')"
:options="vehicleOptions"
direction="horizontal"
disabled
name="disabled-checkbox"
/>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
Expand Down Expand Up @@ -123,22 +132,23 @@
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->

<CheckboxInput
v-model="formData.disabled"
:label="$t('form.label.vehicle')"
:options="vehicleOptions"
direction="horizontal"
disabled
name="disabled-checkbox"
/>
</div>
</section>

<section>
<h2>{{ $t("form.label.inputWithValidation") }}</h2>

<div class="section-content">
<Form>
<CheckboxInput
v-model="formData.inputWithValidation"
:label="$t('form.label.dailySynchro')"
:options="dailySynchroOptions"
:schema="inputSchema"
name="daily-synchro"
/>
</Form>

<!-- eslint-disable -->
<SshPre language="html-vue">
&lt;template&gt;
Expand Down Expand Up @@ -211,16 +221,6 @@
&lt;/script&gt;
</SshPre>
<!-- eslint-enable -->

<Form>
<CheckboxInput
v-model="formData.inputWithValidation"
:label="$t('form.label.dailySynchro')"
:options="dailySynchroOptions"
:schema="inputSchema"
name="daily-synchro"
/>
</Form>
</div>
</section>
</FormPage>
Expand Down
Loading
Loading