@xleddyl/443-components-vue 0.16.63 → 0.16.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CATALOG.md +1 -1
- package/README.md +1 -1
- package/dist/components/core/Form.vue +1 -1
- package/dist/internal/forms/disabled.mjs +1 -1
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -152,7 +152,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
152
152
|
| `FormField` | Label, description, hint, error and required marker around one control. It links ids and ARIA for the control inside. | Props: `label`, `name` (reads error and warning from the surrounding `Form`), `description`, `hint`, `error`, `warning`, `required`, `optional`, `disabled`, `icon`. Slots: default, `label`, `label-actions`, `description`, `hint`. | `core/form-field.vue` |
|
|
153
153
|
| `FieldMessage` | One error, warning or hint line outside a `FormField`. | Props: `message`, `tone` (danger, warning, neutral), `icon`. Slot: default. | `core/field-message.vue` |
|
|
154
154
|
| `FieldBoundary` | Cut the field context for controls inside a `FormField` that are not the main control (a search box above a `Tree`). | Prop: `auxiliary` (keeps own id, follows only `disabled`). Without it the context is fully cut. | `core/form-field.vue` |
|
|
155
|
-
| `Form` | Connects a `useForm` result to a `<form>`. Provides errors to `FormField`, handles submit, reset, focus on first error. | Props: `form` (required), `as` (form or div; use `div` for a form nested in a modal), `focusOnError`, `alerts` (start, end, false), `disabled` (every `FormField` and control inside is disabled; nested
|
|
155
|
+
| `Form` | Connects a `useForm` result to a `<form>`. Provides errors to `FormField`, handles submit, reset, focus on first error. | Props: `form` (required), `as` (form or div; use `div` for a form nested in a modal), `focusOnError`, `alerts` (start, end, false), `disabled` (every `FormField` and control inside is disabled; a nested form inherits it unless it sets its own). Slot: default, `alerts`. Events: `submitted`, `invalid`, `reset`. | `core/form.vue` |
|
|
156
156
|
| `FormAlerts` | Render root errors and warnings as alerts. `Form` already does it. Use it only for a custom placement. | Props: `errors`, `warnings`. | `core/form.vue` |
|
|
157
157
|
| `Kbd` | Show a keyboard key or shortcut. | Props: `value` (for example `mod+k`, shown per platform), `size`. Slot: default. | `core/kbd.vue` |
|
|
158
158
|
| `VisuallyHidden` | Text for screen readers only. | Props: `as`, `focusable`. | `core/visually-hidden.vue` |
|
package/README.md
CHANGED
|
@@ -411,7 +411,7 @@ Nested forms. Overlays stay in the DOM, so a `Form` inside a Modal opened from a
|
|
|
411
411
|
</KForm>
|
|
412
412
|
```
|
|
413
413
|
|
|
414
|
-
Read only forms. `<KForm :form="form" disabled>` disables every `FormField` and every control inside (also the controls built on `useFieldControl` and the ones outside a `FormField`), as if each had `disabled`. A field is disabled when its own `disabled` is set or the form is disabled
|
|
414
|
+
Read only forms. `<KForm :form="form" disabled>` disables every `FormField` and every control inside (also the controls built on `useFieldControl` and the ones outside a `FormField`), as if each had `disabled`. A field is disabled when its own `disabled` is set or the form is disabled. A nested `Form` without `disabled` inherits the state; `:disabled="false"` or `true` on it overrides the parent, for example a modal form that opens from a read only drawer but follows its own permission. `FormDrawer` with `readonly` does the same for its body, also for a `Form` you render yourself in the default slot.
|
|
415
415
|
|
|
416
416
|
```vue
|
|
417
417
|
<KForm :form="form" :disabled="!canWrite">
|
|
@@ -69,7 +69,7 @@ const props = defineProps({
|
|
|
69
69
|
as: { type: String, required: false, default: "form" },
|
|
70
70
|
focusOnError: { type: Boolean, required: false, default: true },
|
|
71
71
|
alerts: { type: [String, Boolean], required: false, default: "start" },
|
|
72
|
-
disabled: { type: Boolean, required: false }
|
|
72
|
+
disabled: { type: Boolean, required: false, default: void 0 }
|
|
73
73
|
});
|
|
74
74
|
const emit = defineEmits(["submitted", "invalid", "reset"]);
|
|
75
75
|
const formRef = useTemplateRef("formRef");
|
|
@@ -5,7 +5,7 @@ export function useFormDisabled() {
|
|
|
5
5
|
}
|
|
6
6
|
export function provideFormDisabled(disabled) {
|
|
7
7
|
const parent = useFormDisabled();
|
|
8
|
-
const value = computed(() =>
|
|
8
|
+
const value = computed(() => toValue(disabled) ?? Boolean(parent?.value));
|
|
9
9
|
provide(FORM_DISABLED_KEY, value);
|
|
10
10
|
return value;
|
|
11
11
|
}
|
package/package.json
CHANGED