nuxt-ui-tools 1.16.6 → 1.16.7

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/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "configKey": "nuxtUiTools",
6
6
  "docs": "https://ui.nuxt.com/docs/getting-started/installation/nuxt",
7
7
  "name": "nuxt-ui-tools",
8
- "version": "1.16.6",
8
+ "version": "1.16.7",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.3",
11
11
  "unbuild": "unknown"
@@ -61,7 +61,7 @@ function isOptionValue(value) {
61
61
  description-key="description"
62
62
  :orientation="fieldProps.orientation"
63
63
  :ui="groupUi"
64
- :variant="fieldProps.variant === 'table' ? 'list' : fieldProps.variant ?? 'list'"
64
+ :variant="fieldProps.variant ?? 'list'"
65
65
  :indicator="fieldProps.indicator"
66
66
  :disabled="disabled"
67
67
  @blur="handleBlur"
@@ -2,6 +2,10 @@ import type { FormStatefulFieldBase } from '../../types/field-base.js';
2
2
  import type { FieldOptionValue, NullableValue } from '../../types/field-output-utils.js';
3
3
  import type { FormOptionConfig, FormOptionItem, FormOptionValue, FormOptionsSource } from '../../types/options.js';
4
4
  export interface FormCheckboxGroupProps {
5
+ /**
6
+ * `list` (the default) lines up bare checkboxes, `card` frames each option on its own, and
7
+ * `table` joins the options into one framed list with a divider between rows.
8
+ */
5
9
  variant?: 'table' | 'list' | 'card';
6
10
  orientation?: 'horizontal' | 'vertical';
7
11
  indicator?: 'start' | 'end' | 'hidden';
@@ -6,17 +6,28 @@ const props = defineProps({
6
6
  field: { type: Object, required: true },
7
7
  path: { type: Array, required: true }
8
8
  });
9
- const { params } = useFieldControl(
9
+ const { disabled, fieldProps, form, handleBlur, params } = useFieldControl(
10
10
  () => props.field,
11
11
  () => props.path
12
12
  );
13
+ const model = computed({
14
+ get: () => form.getValue(props.path),
15
+ set: (value) => form.setValue(props.path, value)
16
+ });
13
17
  const rendered = computed(() => props.field.render?.(params.value));
14
18
  const Rendered = () => rendered.value;
15
19
  </script>
16
20
 
17
21
  <template>
18
22
  <FormFieldShell :field="field" :path="path">
19
- <component :is="field.component" v-if="field.component" />
23
+ <component
24
+ :is="field.component"
25
+ v-if="field.component"
26
+ v-bind="fieldProps"
27
+ v-model="model"
28
+ :disabled="disabled"
29
+ @blur="handleBlur"
30
+ />
20
31
  <Rendered v-else-if="rendered" />
21
32
  </FormFieldShell>
22
33
  </template>
@@ -5,7 +5,12 @@ import type { FormStatefulFieldBase } from '../../types/field-base.js';
5
5
  import type { FieldDefaultValue, FallbackNever } from '../../types/field-output-utils.js';
6
6
  import type { FormRenderable } from '../../types/utils.js';
7
7
  export interface FormCustomComponentField<TContext = NonNullable<unknown>, TDeps = NonNullable<unknown>> extends FormStatefulFieldBase<'custom-component', FormValue, TContext, TDeps> {
8
+ /**
9
+ * Renders the field as a control: the component receives the field value as `modelValue`, its
10
+ * resolved `props`, and `disabled`, and sets the value by emitting `update:modelValue`.
11
+ */
8
12
  component?: Component;
13
+ /** Renders free content from the field callback params, `{ ctx, deps, api }`. */
9
14
  render?: FormFieldCallback<FormRenderable, TContext, TDeps>;
10
15
  }
11
16
  export type CustomComponentFieldOutput<TField> = FallbackNever<FieldDefaultValue<TField>, FormValue>;
@@ -44,7 +44,7 @@ const groupUi = computed(() => ({
44
44
  description-key="description"
45
45
  :items="items"
46
46
  :ui="groupUi"
47
- :variant="fieldProps.variant === 'table' ? 'list' : fieldProps.variant ?? 'list'"
47
+ :variant="fieldProps.variant ?? 'list'"
48
48
  :orientation="fieldProps.orientation"
49
49
  :indicator="fieldProps.indicator"
50
50
  :disabled="disabled"
@@ -2,6 +2,11 @@ import type { FormStatefulFieldBase } from '../../types/field-base.js';
2
2
  import type { FieldOptionValue, NullableValue } from '../../types/field-output-utils.js';
3
3
  import type { FormOptionItem, FormOptionValue, FormOptionsSource } from '../../types/options.js';
4
4
  export interface FormRadioProps {
5
+ /**
6
+ * `list` (the default) lines up bare radios, `card` frames each option on its own, and `table`
7
+ * joins the options into one framed list with a divider between rows and the selected row
8
+ * tinted, a good fit for a choice of roles with a description each.
9
+ */
5
10
  variant?: 'list' | 'card' | 'table';
6
11
  orientation?: 'horizontal' | 'vertical';
7
12
  indicator?: 'start' | 'end' | 'hidden';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ui-tools",
3
- "version": "1.16.6",
3
+ "version": "1.16.7",
4
4
  "description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
5
5
  "homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
6
6
  "bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",