Skip to content
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
17 changes: 11 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vue/dynamicforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"issues": "https://github.com/velis74/DynamicForms/issues",
"peerDependencies": {
"@dynamicforms/vue-forms": "^0.4.6",
"@dynamicforms/vuetify-inputs": "^0.5.8",
"@kyvg/vue3-notification": "^3.2.1",
"axios": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion vue/dynamicforms/src/components/form/field-group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let formPayload = ref<FormPayload>();
const columnClasses = computed(
() => { const classes = props.field.widthClasses; return classes ? ` ${classes} ` : ''; },
);
const subErrors = computed(() => props.errors && props.errors[props.field.name]);
const subErrors = computed(() => (props.field.name ? props.errors && props.errors[props.field.name] : props.errors));

if (props.field.name == null) {
use.value = true;
Expand Down
15 changes: 15 additions & 0 deletions vue/dynamicforms/src/components/form/inputs/base.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Form, { Field, ValidationErrorRenderContent } from '@dynamicforms/vue-forms';
import { computed } from 'vue';

import FilteredActions from '../../actions/filtered-actions';
Expand Down Expand Up @@ -50,14 +51,28 @@ export function useInputBase(props: BaseProps, emit: BaseEmits) {
hint?: any;
'persistent-hint': any;
'hide-details'?: boolean | 'auto';
control?: Form.IField;
};
const control = computed(() => Field.create({
value: value.value,
touched: true,
visibility: Form.DisplayMode.FULL,
errors: (errorsList.value || []).map(
(error: any) => (error instanceof ValidationErrorRenderContent ? error : new ValidationErrorRenderContent(error)),
),
enabled: true,
}));

control.value.validate();

const baseBinds = computed((): BaseBinds => ({
label: label.value,
'error-messages': errorsList.value,
'error-count': errorsDisplayCount.value + 10, // +10 so that it can show "rules" error messages
hint: helpText.value,
'persistent-hint': true,
'hide-details': 'auto',
control: control.value,
}));

return {
Expand Down
2 changes: 1 addition & 1 deletion vue/dynamicforms/src/components/form/inputs/date-time.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<df-date-time
v-model="value"

:label="baseBinds.label"
:errors="baseBinds['error-messages']"
:hint="baseBinds.hint"
:persistent-hint="baseBinds['persistent-hint']"
:clearable="true"
:input-type="inputType"
:display-format-date="displayFormatDate"
:display-format-time="displayFormatTime"
v-bind="baseBinds"
/>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<df-rtf-editor
v-model="value"

:label="baseBinds.label"
:errors="baseBinds['error-messages']"
:hint="baseBinds.hint"
:persistent-hint="baseBinds['persistent-hint']"
:hide-details="baseBinds['hide-details']"
v-bind="baseBinds"
/>
</template>

Expand Down
2 changes: 1 addition & 1 deletion vue/dynamicforms/src/components/form/inputs/df-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
:comms="fileComms"
:class="field.renderParams.fieldCSSClass"
:name="field.name"
:label="baseBinds.label"
:errors="baseBinds['error-messages']"
:enabled="!field.readOnly"
:hint="baseBinds.hint"
v-bind="baseBinds"
/>
</template>

Expand Down
Loading