@chelone/vue 0.3.0 → 0.4.0

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.
Files changed (135) hide show
  1. package/dist/admin/admin-shell.vue.js +1 -1
  2. package/dist/choices/use-choices.d.ts +11 -10
  3. package/dist/choices/use-choices.js +5 -4
  4. package/dist/components/admin/auth/auth-callback.vue.js +1 -1
  5. package/dist/components/admin/auth/auth-error.vue.d.ts +1 -1
  6. package/dist/components/admin/auth/login-form.vue.js +1 -1
  7. package/dist/components/admin/auth/login-with-email.vue.js +1 -1
  8. package/dist/components/admin/buttons/save-button.vue.d.ts +1 -1
  9. package/dist/components/admin/buttons/update-button.vue.d.ts +3 -3
  10. package/dist/components/admin/feedback/linear-progress.vue.d.ts +1 -1
  11. package/dist/components/admin/feedback/loading-indicator.vue.js +1 -1
  12. package/dist/components/admin/feedback/spinner.vue.js +1 -1
  13. package/dist/components/admin/fields/api-key-field.vue.d.ts +27 -9
  14. package/dist/components/admin/fields/api-key-field.vue.js +3 -1
  15. package/dist/components/admin/fields/array-field.vue.d.ts +2 -2
  16. package/dist/components/admin/fields/badge-field.vue.d.ts +2 -2
  17. package/dist/components/admin/fields/boolean-field.vue.d.ts +2 -2
  18. package/dist/components/admin/fields/chip-field.vue.d.ts +2 -2
  19. package/dist/components/admin/fields/color-field.vue.d.ts +2 -2
  20. package/dist/components/admin/fields/cron-field.vue.d.ts +2 -2
  21. package/dist/components/admin/fields/currency-field.vue.d.ts +2 -2
  22. package/dist/components/admin/fields/date-field.vue.d.ts +2 -2
  23. package/dist/components/admin/fields/duration-field.vue.d.ts +2 -2
  24. package/dist/components/admin/fields/email-field.vue.d.ts +2 -2
  25. package/dist/components/admin/fields/file-field.vue.d.ts +2 -2
  26. package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
  27. package/dist/components/admin/fields/image-field.vue.d.ts +2 -2
  28. package/dist/components/admin/fields/json-field.vue.d.ts +2 -2
  29. package/dist/components/admin/fields/number-field.vue.d.ts +2 -2
  30. package/dist/components/admin/fields/phone-field.vue.d.ts +2 -2
  31. package/dist/components/admin/fields/rating-field.vue.d.ts +22 -7
  32. package/dist/components/admin/fields/rating-field.vue.js +3 -1
  33. package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
  34. package/dist/components/admin/fields/reference-array-field.vue.d.ts +2 -2
  35. package/dist/components/admin/fields/reference-field.vue.d.ts +2 -1
  36. package/dist/components/admin/fields/reference-many-count.vue.d.ts +2 -2
  37. package/dist/components/admin/fields/reference-many-field.vue.d.ts +2 -2
  38. package/dist/components/admin/fields/reference-one-field.vue.d.ts +2 -2
  39. package/dist/components/admin/fields/select-field.vue.d.ts +2 -2
  40. package/dist/components/admin/fields/select-field.vue.js +1 -1
  41. package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +2 -2
  42. package/dist/components/admin/fields/text-array-field.vue.d.ts +2 -2
  43. package/dist/components/admin/fields/text-field.vue.d.ts +2 -8
  44. package/dist/components/admin/fields/url-field.vue.d.ts +2 -2
  45. package/dist/components/admin/fields/usage-meter-field.vue.d.ts +22 -7
  46. package/dist/components/admin/fields/usage-meter-field.vue.js +3 -1
  47. package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +2 -2
  48. package/dist/components/admin/fields/wrapper-field.vue.d.ts +3 -3
  49. package/dist/components/admin/fields/wrapper-field.vue.js +6 -0
  50. package/dist/components/admin/inputs/api-key-input.vue.d.ts +2 -2
  51. package/dist/components/admin/inputs/array-input.vue.d.ts +2 -2
  52. package/dist/components/admin/inputs/autocomplete-array-input.vue.d.ts +14 -6
  53. package/dist/components/admin/inputs/autocomplete-array-input.vue.js +2 -3
  54. package/dist/components/admin/inputs/autocomplete-input.vue.d.ts +14 -6
  55. package/dist/components/admin/inputs/autocomplete-input.vue.js +2 -3
  56. package/dist/components/admin/inputs/boolean-input.vue.d.ts +2 -2
  57. package/dist/components/admin/inputs/checkbox-group-input.vue.d.ts +1 -1
  58. package/dist/components/admin/inputs/choice-input-props.d.ts +6 -6
  59. package/dist/components/admin/inputs/color-input.vue.d.ts +2 -2
  60. package/dist/components/admin/inputs/cron-input.vue.d.ts +2 -2
  61. package/dist/components/admin/inputs/currency-input.vue.d.ts +2 -2
  62. package/dist/components/admin/inputs/date-input.vue.d.ts +2 -2
  63. package/dist/components/admin/inputs/date-time-input.vue.d.ts +2 -2
  64. package/dist/components/admin/inputs/duration-input.vue.d.ts +2 -2
  65. package/dist/components/admin/inputs/file-input.vue.d.ts +2 -2
  66. package/dist/components/admin/inputs/nullable-boolean-input.vue.d.ts +2 -2
  67. package/dist/components/admin/inputs/number-input.vue.d.ts +2 -2
  68. package/dist/components/admin/inputs/password-input.vue.d.ts +2 -2
  69. package/dist/components/admin/inputs/phone-input.vue.d.ts +2 -2
  70. package/dist/components/admin/inputs/radio-button-group-input.vue.d.ts +1 -1
  71. package/dist/components/admin/inputs/rating-input.vue.d.ts +2 -2
  72. package/dist/components/admin/inputs/reference-array-input.vue.d.ts +2 -2
  73. package/dist/components/admin/inputs/reference-input.vue.d.ts +2 -2
  74. package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +2 -1
  75. package/dist/components/admin/inputs/search-input.vue.d.ts +3 -3
  76. package/dist/components/admin/inputs/select-array-input.vue.d.ts +14 -5
  77. package/dist/components/admin/inputs/select-array-input.vue.js +1 -1
  78. package/dist/components/admin/inputs/select-input.vue.d.ts +14 -7
  79. package/dist/components/admin/inputs/select-input.vue.js +1 -1
  80. package/dist/components/admin/inputs/subscription-plan-picker.vue.d.ts +2 -2
  81. package/dist/components/admin/inputs/text-array-input.vue.d.ts +2 -2
  82. package/dist/components/admin/inputs/text-input.vue.d.ts +2 -1
  83. package/dist/components/admin/inputs/time-input.vue.d.ts +2 -1
  84. package/dist/components/admin/inputs/use-choice-input.d.ts +12 -19
  85. package/dist/components/admin/inputs/use-choice-input.js +4 -1
  86. package/dist/components/admin/inputs/webhook-endpoint-input.vue.d.ts +2 -2
  87. package/dist/components/admin/list/calendar-list.vue.d.ts +8 -8
  88. package/dist/components/admin/list/count-spinner.vue.js +1 -1
  89. package/dist/components/admin/list/filter-live-search.vue.d.ts +1 -1
  90. package/dist/components/admin/list/kanban-board.vue.d.ts +41 -0
  91. package/dist/components/admin/list/kanban-board.vue.js +275 -0
  92. package/dist/components/admin/list/kanban-board2.vue.js +4 -0
  93. package/dist/components/admin/list/list-icons.d.ts +2 -0
  94. package/dist/components/admin/list/list-icons.js +7 -0
  95. package/dist/components/admin/list/tree-list.vue.d.ts +6 -5
  96. package/dist/components/admin/supabase/forgot-password-form.vue.js +1 -1
  97. package/dist/components/admin/supabase/set-password-form.vue.js +1 -1
  98. package/dist/components/admin/view/labeled.vue.d.ts +6 -5
  99. package/dist/components/admin/view/labeled.vue.js +4 -1
  100. package/dist/components/admin/view/tabbed-show-layout-tab.vue.d.ts +2 -2
  101. package/dist/components/index.d.ts +2 -0
  102. package/dist/components/maps/geo-json-field.vue.d.ts +2 -1
  103. package/dist/components/maps/lat-lng-field.vue.d.ts +3 -3
  104. package/dist/components/maps/lat-lng-input.vue.d.ts +4 -4
  105. package/dist/components/maps-draw/shape-input.vue.d.ts +4 -4
  106. package/dist/components/maps-draw/simplify-input.vue.d.ts +2 -2
  107. package/dist/components/maps-osm/geocoding-input.vue.d.ts +6 -6
  108. package/dist/components/maps-osm/map-with-search.vue.d.ts +4 -4
  109. package/dist/components/maps-osm/osm-feature-operator.vue.d.ts +3 -3
  110. package/dist/components/maps-osm/osm-feature-operator.vue.js +1 -1
  111. package/dist/components/maps-osm/reverse-geocode-field.vue.d.ts +3 -3
  112. package/dist/components/mdx-editor/mdx-field.vue.d.ts +2 -2
  113. package/dist/components/mdx-editor/mdx-input.vue.d.ts +2 -2
  114. package/dist/components/monaco/monaco-json-field.vue.d.ts +2 -2
  115. package/dist/components/monaco/monaco-json-input.vue.d.ts +2 -2
  116. package/dist/components/ui/alert.d.ts +1 -1
  117. package/dist/components/ui/badge.d.ts +1 -1
  118. package/dist/components/ui/button.vue.d.ts +1 -1
  119. package/dist/components/ui/command/command-dialog.vue.d.ts +1 -1
  120. package/dist/components/ui/dropdown-menu/dropdown-menu-item.vue.js +9 -3
  121. package/dist/components/ui/input.vue.d.ts +2 -2
  122. package/dist/components/ui/sidebar/sidebar-menu-button.vue.d.ts +1 -1
  123. package/dist/components/ui/spinner.vue.js +29 -1
  124. package/dist/components/ui/spinner2.vue.js +1 -29
  125. package/dist/components/ui/textarea.vue.d.ts +2 -2
  126. package/dist/create-resource-components.d.ts +743 -0
  127. package/dist/create-resource-components.js +171 -0
  128. package/dist/data/create-chelone-hooks.d.ts +8 -8
  129. package/dist/data/mutations.d.ts +8 -8
  130. package/dist/form/use-input.d.ts +9 -7
  131. package/dist/form/use-input.js +2 -1
  132. package/dist/index.d.ts +2 -0
  133. package/dist/index.js +248 -243
  134. package/dist/record/use-field-value.d.ts +16 -6
  135. package/package.json +4 -4
@@ -1,13 +1,7 @@
1
- /**
2
- * `<TextField>` — displays a text value from a record field, the Vue analog of
3
- * `@chelone/react`'s `fields/text-field.tsx`. Reads the value at `source` off
4
- * the ambient (or overridden) record via `useFieldValue` and renders it in a
5
- * `<span>`. A nullish value renders the `empty` fallback (or nothing).
6
- */
7
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
8
2
  /** Props for {@link TextField}. */
9
3
  export interface TextFieldProps {
10
- source: string;
4
+ source: SourceProp;
11
5
  record?: LooseRecord;
12
6
  defaultValue?: unknown;
13
7
  empty?: string;
@@ -1,7 +1,7 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
2
2
  /** Props for {@link UrlField}. */
3
3
  export interface UrlFieldProps {
4
- source: string;
4
+ source: SourceProp;
5
5
  record?: LooseRecord;
6
6
  defaultValue?: unknown;
7
7
  empty?: string;
@@ -1,21 +1,36 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceKey, SourceProp } from "@chelone/core";
2
2
  /** Ratio thresholds toggling the warning / critical bar color. */
3
3
  export interface UsageMeterThresholds {
4
4
  warning: number;
5
5
  critical: number;
6
6
  }
7
7
  /** Props for {@link UsageMeterField}. */
8
- export interface UsageMeterFieldProps {
9
- source: string;
10
- record?: LooseRecord;
8
+ export interface UsageMeterFieldProps<RecordType extends LooseRecord = LooseRecord> {
9
+ source: SourceProp;
10
+ /** The record to render. Defaults to the ambient `RecordContext` value. */
11
+ record?: RecordType;
11
12
  defaultValue?: unknown;
12
- /** Sibling record field holding the limit/quota. Bar is only shown when set. */
13
- limitSource?: string;
13
+ /**
14
+ * Sibling record field holding the limit/quota; the bar is only shown when
15
+ * set. A top-level key, not a path: the read is `record[limitSource]`.
16
+ */
17
+ limitSource?: SourceKey<RecordType>;
14
18
  /** Optional unit suffix (e.g. "GB", "requests"). */
15
19
  unit?: string;
16
20
  /** Ratio thresholds. Defaults `{ warning: 0.8, critical: 1.0 }`. */
17
21
  thresholds?: UsageMeterThresholds;
18
22
  class?: string;
19
23
  }
20
- declare const _default: import("vue").DefineComponent<UsageMeterFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UsageMeterFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: <RecordType extends LooseRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
25
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & UsageMeterFieldProps<RecordType> & Partial<{}>> & import("vue").PublicProps;
26
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
27
+ attrs: any;
28
+ slots: {};
29
+ emit: {};
30
+ }>) => import("vue").VNode & {
31
+ __ctx?: Awaited<typeof __VLS_setup>;
32
+ };
21
33
  export default _default;
34
+ type __VLS_PrettifyLocal<T> = {
35
+ [K in keyof T]: T[K];
36
+ } & {};
@@ -28,7 +28,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  () => typeof value.value === "number" ? value.value : value.value
29
29
  );
30
30
  const injectedRecord = inject(RecordContextKey, null);
31
- const ctxRecord = computed(() => props.record ?? injectedRecord?.value);
31
+ const ctxRecord = computed(
32
+ () => props.record ?? injectedRecord?.value
33
+ );
32
34
  const limit = computed(() => {
33
35
  const rec = ctxRecord.value;
34
36
  if (!props.limitSource || !rec) return void 0;
@@ -1,4 +1,4 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
2
2
  /** A webhook delivery outcome. */
3
3
  export type DeliveryStatus = "ok" | "failed" | "pending";
4
4
  /** The shape `<WebhookEndpointField>` reads from a record source. */
@@ -13,7 +13,7 @@ export interface WebhookEndpoint {
13
13
  }
14
14
  /** Props for {@link WebhookEndpointField}. */
15
15
  export interface WebhookEndpointFieldProps {
16
- source: string;
16
+ source: SourceProp;
17
17
  record?: LooseRecord;
18
18
  defaultValue?: unknown;
19
19
  class?: string;
@@ -1,16 +1,16 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
2
2
  /** Props for {@link WrapperField}. */
3
3
  export interface WrapperFieldProps {
4
4
  /**
5
5
  * A pseudo field path exposed to a parent layout (e.g. a sortable
6
6
  * `DataTable` header). Not read by the field itself — it only groups children.
7
7
  */
8
- source?: string;
8
+ source?: SourceProp;
9
9
  label?: string | false;
10
10
  record?: LooseRecord;
11
11
  class?: string;
12
12
  }
13
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
13
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WrapperFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WrapperFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
14
14
  /** The wrapped fields, rendered as-is. */
15
15
  default(): unknown;
16
16
  }>;
@@ -1,6 +1,12 @@
1
1
  import { defineComponent, renderSlot } from "vue";
2
2
  const _sfc_main = /* @__PURE__ */ defineComponent({
3
3
  __name: "wrapper-field",
4
+ props: {
5
+ source: {},
6
+ label: { type: [String, Boolean] },
7
+ record: {},
8
+ class: {}
9
+ },
4
10
  setup(__props) {
5
11
  return (_ctx, _cache) => {
6
12
  return renderSlot(_ctx.$slots, "default");
@@ -1,8 +1,8 @@
1
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp } from "@chelone/core";
2
2
  /** Props for {@link ApiKeyInput}. */
3
3
  export interface ApiKeyInputProps {
4
4
  /** Record field holding the API key. */
5
- source: string;
5
+ source: SourceProp;
6
6
  /** Override resource. */
7
7
  resource?: string;
8
8
  /** Async side-effect on rotate. When provided, replaces the default update mutation. */
@@ -1,8 +1,8 @@
1
- import type { Validator } from "@chelone/core";
1
+ import type { SourceProp, Validator } from "@chelone/core";
2
2
  /** Props for {@link ArrayInput}. */
3
3
  export interface ArrayInputProps {
4
4
  /** The array field path RELATIVE to the ambient source scope. */
5
- source: string;
5
+ source: SourceProp;
6
6
  /** Explicit label, or `false` to hide it. Absent → humanized `source`. */
7
7
  label?: string | false;
8
8
  /** Override the ambient resource (label-key resolution). */
@@ -1,7 +1,8 @@
1
+ import type { ChoiceRecord } from "../../../choices/use-choices.js";
1
2
  import type { FilterPayload } from "@chelone/core";
2
3
  import type { ChoiceInputBaseProps } from "./choice-input-props.js";
3
4
  /** Props for {@link AutocompleteArrayInput}. */
4
- export interface AutocompleteArrayInputProps extends ChoiceInputBaseProps {
5
+ export interface AutocompleteArrayInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
5
6
  /** Placeholder shown in the search input. */
6
7
  placeholder?: string;
7
8
  /** Maps the typed filter text into a reference-list filter payload. Default `{ q }`. */
@@ -9,9 +10,16 @@ export interface AutocompleteArrayInputProps extends ChoiceInputBaseProps {
9
10
  /** Content shown when no choice matches the filter. */
10
11
  noOptionsText?: string;
11
12
  }
12
- declare const _default: import("vue").DefineComponent<AutocompleteArrayInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AutocompleteArrayInputProps> & Readonly<{}>, {
13
- label: string | false;
14
- optionValue: string;
15
- filterToQuery: (searchText: string) => FilterPayload;
16
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: <TChoice extends ChoiceRecord = ChoiceRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
14
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & AutocompleteArrayInputProps<TChoice> & Partial<{}>> & import("vue").PublicProps;
15
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
16
+ attrs: any;
17
+ slots: {};
18
+ emit: {};
19
+ }>) => import("vue").VNode & {
20
+ __ctx?: Awaited<typeof __VLS_setup>;
21
+ };
17
22
  export default _default;
23
+ type __VLS_PrettifyLocal<T> = {
24
+ [K in keyof T]: T[K];
25
+ } & {};
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  source: {},
32
32
  choices: {},
33
33
  optionText: {},
34
- optionValue: { default: "id" },
34
+ optionValue: {},
35
35
  disableValue: {},
36
36
  translateChoice: { type: Boolean },
37
37
  label: { type: [String, Boolean], default: void 0 },
@@ -61,8 +61,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
61
  optionText: props.optionText,
62
62
  optionValue: props.optionValue,
63
63
  disableValue: props.disableValue,
64
- translateChoice: props.translateChoice,
65
- defaultOptionText: "name"
64
+ translateChoice: props.translateChoice
66
65
  });
67
66
  const { id, value, setValue, blur, error, touched, isRequired } = useInput({
68
67
  source,
@@ -1,7 +1,8 @@
1
+ import type { ChoiceRecord } from "../../../choices/use-choices.js";
1
2
  import type { FilterPayload } from "@chelone/core";
2
3
  import type { ChoiceInputBaseProps } from "./choice-input-props.js";
3
4
  /** Props for {@link AutocompleteInput}. */
4
- export interface AutocompleteInputProps extends ChoiceInputBaseProps {
5
+ export interface AutocompleteInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
5
6
  /** Placeholder shown in the search input. */
6
7
  placeholder?: string;
7
8
  /** Maps the typed filter text into a reference-list filter payload. Default `{ q }`. */
@@ -9,9 +10,16 @@ export interface AutocompleteInputProps extends ChoiceInputBaseProps {
9
10
  /** Content shown when no choice matches the filter. */
10
11
  noOptionsText?: string;
11
12
  }
12
- declare const _default: import("vue").DefineComponent<AutocompleteInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AutocompleteInputProps> & Readonly<{}>, {
13
- label: string | false;
14
- optionValue: string;
15
- filterToQuery: (searchText: string) => FilterPayload;
16
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: <TChoice extends ChoiceRecord = ChoiceRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
14
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & AutocompleteInputProps<TChoice> & Partial<{}>> & import("vue").PublicProps;
15
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
16
+ attrs: any;
17
+ slots: {};
18
+ emit: {};
19
+ }>) => import("vue").VNode & {
20
+ __ctx?: Awaited<typeof __VLS_setup>;
21
+ };
17
22
  export default _default;
23
+ type __VLS_PrettifyLocal<T> = {
24
+ [K in keyof T]: T[K];
25
+ } & {};
@@ -28,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  source: {},
29
29
  choices: {},
30
30
  optionText: {},
31
- optionValue: { default: "id" },
31
+ optionValue: {},
32
32
  disableValue: {},
33
33
  translateChoice: { type: Boolean },
34
34
  label: { type: [String, Boolean], default: void 0 },
@@ -57,8 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
57
  optionText: props.optionText,
58
58
  optionValue: props.optionValue,
59
59
  disableValue: props.disableValue,
60
- translateChoice: props.translateChoice,
61
- defaultOptionText: "name"
60
+ translateChoice: props.translateChoice
62
61
  });
63
62
  const { id, value, setValue, blur, error, touched, isRequired } = useInput({
64
63
  source,
@@ -4,10 +4,10 @@
4
4
  * renders the shadcn `Switch`. Writes a plain boolean; marks the field blurred
5
5
  * on change so validation surfaces on interaction.
6
6
  */
7
- import type { Validator } from "@chelone/core";
7
+ import type { SourceProp, Validator } from "@chelone/core";
8
8
  /** Props for {@link BooleanInput}. */
9
9
  export interface BooleanInputProps {
10
- source: string;
10
+ source: SourceProp;
11
11
  label?: string | false;
12
12
  defaultValue?: boolean;
13
13
  validate?: Validator | readonly Validator[];
@@ -6,8 +6,8 @@ export interface CheckboxGroupInputProps extends ChoiceInputBaseProps {
6
6
  }
7
7
  declare const _default: import("vue").DefineComponent<CheckboxGroupInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CheckboxGroupInputProps> & Readonly<{}>, {
8
8
  label: string | false;
9
- row: boolean;
10
9
  optionValue: string;
10
+ row: boolean;
11
11
  disableValue: string;
12
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  export default _default;
@@ -6,20 +6,20 @@
6
6
  * input nested under a reference wrapper inherits `source` from the ambient
7
7
  * choices context; standalone, it must be provided (each input throws otherwise).
8
8
  */
9
- import type { SourceProp, Validator } from "@chelone/core";
9
+ import type { SourcePath, SourceProp, Validator } from "@chelone/core";
10
10
  import type { ChoiceRecord, OptionText } from "../../../choices/use-choices.js";
11
11
  /** The choice-accessor + form-binding props every choice input accepts. */
12
- export interface ChoiceInputBaseProps {
12
+ export interface ChoiceInputBaseProps<TChoice extends ChoiceRecord = ChoiceRecord> {
13
13
  /** The FK/field path. Optional under a reference wrapper (inherited from context). */
14
14
  source?: SourceProp | undefined;
15
15
  /** Inline choices (`{ id, name }[]` or `string[]`). Omitted under a reference wrapper. */
16
- choices?: readonly (string | ChoiceRecord)[];
16
+ choices?: readonly (string | TChoice)[];
17
17
  /** The display path (dotted) or a formatter over the whole choice. Default `name`. */
18
- optionText?: OptionText;
18
+ optionText?: OptionText<TChoice>;
19
19
  /** The value path. Default `id`. */
20
- optionValue?: string;
20
+ optionValue?: SourcePath<TChoice>;
21
21
  /** The disabled-flag path. Default `disabled`. */
22
- disableValue?: string;
22
+ disableValue?: SourcePath<TChoice>;
23
23
  /** Translate a string-path label through the catalog. Default `!isFromReference`. */
24
24
  translateChoice?: boolean;
25
25
  /** Explicit label, or `false` to hide it. Absent → humanized `source`. */
@@ -7,10 +7,10 @@
7
7
  * NATIVE `<input type="color">` — the same value contract (a hex string) — plus
8
8
  * the optional quick-set `swatches` row. Binds via `useInput` + `<ValidationError>`.
9
9
  */
10
- import type { Validator } from "@chelone/core";
10
+ import type { SourceProp, Validator } from "@chelone/core";
11
11
  /** Props for {@link ColorInput}. */
12
12
  export interface ColorInputProps {
13
- source: string;
13
+ source: SourceProp;
14
14
  label?: string | false;
15
15
  defaultValue?: unknown;
16
16
  validate?: Validator | readonly Validator[];
@@ -1,7 +1,7 @@
1
- import type { Validator } from "@chelone/core";
1
+ import type { SourceProp, Validator } from "@chelone/core";
2
2
  /** Props for {@link CronInput}. */
3
3
  export interface CronInputProps {
4
- source: string;
4
+ source: SourceProp;
5
5
  label?: string | false;
6
6
  defaultValue?: unknown;
7
7
  validate?: Validator | readonly Validator[];
@@ -6,10 +6,10 @@
6
6
  * `displayLocale`, falling back to the ambient i18n locale. A focused-buffer
7
7
  * keeps the display string stable while typing.
8
8
  */
9
- import type { Validator } from "@chelone/core";
9
+ import type { SourceProp, Validator } from "@chelone/core";
10
10
  /** Props for {@link CurrencyInput}. */
11
11
  export interface CurrencyInputProps {
12
- source: string;
12
+ source: SourceProp;
13
13
  label?: string | false;
14
14
  defaultValue?: unknown;
15
15
  validate?: Validator | readonly Validator[];
@@ -8,10 +8,10 @@
8
8
  * clobbered while typing — the twin's uncontrolled `defaultValue` + `key`-remount
9
9
  * dance (born of RHF's `field.ref`) maps to a focused-buffer + external re-sync.
10
10
  */
11
- import type { Validator } from "@chelone/core";
11
+ import type { SourceProp, Validator } from "@chelone/core";
12
12
  /** Props for {@link DateInput}. */
13
13
  export interface DateInputProps {
14
- source: string;
14
+ source: SourceProp;
15
15
  label?: string | false;
16
16
  defaultValue?: unknown;
17
17
  validate?: Validator | readonly Validator[];
@@ -6,10 +6,10 @@
6
6
  * → `null`, so a required validator fires. Same focused-buffer pattern as
7
7
  * `<DateInput>`.
8
8
  */
9
- import type { Validator } from "@chelone/core";
9
+ import type { SourceProp, Validator } from "@chelone/core";
10
10
  /** Props for {@link DateTimeInput}. */
11
11
  export interface DateTimeInputProps {
12
- source: string;
12
+ source: SourceProp;
13
13
  label?: string | false;
14
14
  defaultValue?: unknown;
15
15
  validate?: Validator | readonly Validator[];
@@ -4,11 +4,11 @@
4
4
  * `inputs/duration-input.tsx`. Reads the stored string into day/hour/minute/
5
5
  * second boxes and writes the recomposed ISO string back (all-empty → `null`).
6
6
  */
7
- import type { Validator } from "@chelone/core";
7
+ import type { SourceProp, Validator } from "@chelone/core";
8
8
  type Unit = "d" | "h" | "m" | "s";
9
9
  /** Props for {@link DurationInput}. */
10
10
  export interface DurationInputProps {
11
- source: string;
11
+ source: SourceProp;
12
12
  label?: string | false;
13
13
  defaultValue?: unknown;
14
14
  validate?: Validator | readonly Validator[];
@@ -1,4 +1,4 @@
1
- import type { LooseRecord, Validator } from "@chelone/core";
1
+ import type { LooseRecord, SourceProp, Validator } from "@chelone/core";
2
2
  /** A dropped file transformed into a preview record. */
3
3
  export interface TransformedFile {
4
4
  rawFile: File & {
@@ -10,7 +10,7 @@ export interface TransformedFile {
10
10
  /** Props for {@link FileInput}. */
11
11
  export interface FileInputProps {
12
12
  /** The file field path. */
13
- source: string;
13
+ source: SourceProp;
14
14
  /** Explicit label, or `false` to hide it. Absent → humanized `source`. */
15
15
  label?: string | false;
16
16
  /** Override the ambient resource (label-key resolution). */
@@ -10,10 +10,10 @@
10
10
  * `<select>`, which accepts `""` directly — so the empty option IS the null
11
11
  * value, no sentinel round-trip.
12
12
  */
13
- import type { Validator } from "@chelone/core";
13
+ import type { SourceProp, Validator } from "@chelone/core";
14
14
  /** Props for {@link NullableBooleanInput}. */
15
15
  export interface NullableBooleanInputProps {
16
- source: string;
16
+ source: SourceProp;
17
17
  label?: string | false;
18
18
  nullLabel?: string;
19
19
  trueLabel?: string;
@@ -4,10 +4,10 @@
4
4
  * incomplete number (`-`, `0.`) before it is parsed, and writes `null` (not `0`)
5
5
  * on empty so required validation still triggers. Binds through `useInput`.
6
6
  */
7
- import type { Validator } from "@chelone/core";
7
+ import type { SourceProp, Validator } from "@chelone/core";
8
8
  /** Props for {@link NumberInput}. */
9
9
  export interface NumberInputProps {
10
- source: string;
10
+ source: SourceProp;
11
11
  label?: string | false;
12
12
  defaultValue?: unknown;
13
13
  validate?: Validator | readonly Validator[];
@@ -7,10 +7,10 @@
7
7
  * Icon note: the Vue slice is dependency-free (no `lucide-vue-next`), so the
8
8
  * eye / eye-off glyphs are inlined SVGs mirroring lucide's paths.
9
9
  */
10
- import type { Validator } from "@chelone/core";
10
+ import type { SourceProp, Validator } from "@chelone/core";
11
11
  /** Props for {@link PasswordInput}. */
12
12
  export interface PasswordInputProps {
13
- source: string;
13
+ source: SourceProp;
14
14
  label?: string | false;
15
15
  initiallyVisible?: boolean;
16
16
  defaultValue?: unknown;
@@ -5,11 +5,11 @@
5
5
  * `libphonenumber-js` (the same dep the twin uses); `AsYouType` formats while
6
6
  * typing and `parsePhoneNumber(...).number` normalizes on write-back.
7
7
  */
8
- import type { Validator } from "@chelone/core";
8
+ import type { SourceProp, Validator } from "@chelone/core";
9
9
  import { type CountryCode } from "libphonenumber-js";
10
10
  /** Props for {@link PhoneInput}. */
11
11
  export interface PhoneInputProps {
12
- source: string;
12
+ source: SourceProp;
13
13
  label?: string | false;
14
14
  defaultValue?: unknown;
15
15
  validate?: Validator | readonly Validator[];
@@ -6,8 +6,8 @@ export interface RadioButtonGroupInputProps extends ChoiceInputBaseProps {
6
6
  }
7
7
  declare const _default: import("vue").DefineComponent<RadioButtonGroupInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RadioButtonGroupInputProps> & Readonly<{}>, {
8
8
  label: string | false;
9
- row: boolean;
10
9
  optionValue: string;
10
+ row: boolean;
11
11
  disableValue: string;
12
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  export default _default;
@@ -1,7 +1,7 @@
1
- import type { Validator } from "@chelone/core";
1
+ import type { SourceProp, Validator } from "@chelone/core";
2
2
  /** Props for {@link RatingInput}. */
3
3
  export interface RatingInputProps {
4
- source: string;
4
+ source: SourceProp;
5
5
  label?: string | false;
6
6
  defaultValue?: unknown;
7
7
  validate?: Validator | readonly Validator[];
@@ -1,8 +1,8 @@
1
- import type { FilterPayload, SortPayload } from "@chelone/core";
1
+ import type { FilterPayload, SortPayload, SourceProp } from "@chelone/core";
2
2
  /** Props for {@link ReferenceArrayInput}. */
3
3
  export interface ReferenceArrayInputProps {
4
4
  /** The FK-array field on the current record (e.g. `"tag_ids"`). */
5
- source: string;
5
+ source: SourceProp;
6
6
  /** The referenced resource choices are fetched from (e.g. `"tags"`). */
7
7
  reference: string;
8
8
  /**
@@ -7,10 +7,10 @@
7
7
  * native `<select>` (the reka-ui combobox autocomplete is a later wave — spec
8
8
  * Risk 1). Choice labels use the reference's record representation.
9
9
  */
10
- import type { Validator } from "@chelone/core";
10
+ import type { SourceProp, Validator } from "@chelone/core";
11
11
  /** Props for {@link ReferenceInput}. */
12
12
  export interface ReferenceInputProps {
13
- source: string;
13
+ source: SourceProp;
14
14
  reference: string;
15
15
  label?: string | false;
16
16
  perPage?: number;
@@ -12,9 +12,10 @@
12
12
  * registration) and clear via the same `form.setFieldValue(wrappedSource, "")`.
13
13
  */
14
14
  import type { Validator } from "@chelone/core";
15
+ import type { SourceProp } from "@chelone/core";
15
16
  /** Props for {@link ResettableTextInput}. */
16
17
  export interface ResettableTextInputProps {
17
- source: string;
18
+ source: SourceProp;
18
19
  label?: string | false;
19
20
  resettable?: boolean;
20
21
  clearAlwaysVisible?: boolean;
@@ -5,10 +5,10 @@
5
5
  * form store and clears via `form.setFieldValue`. It throws if given a `label`
6
6
  * (use `<TextInput>` when a label is needed) — mirroring the React twin.
7
7
  */
8
- import type { Validator } from "@chelone/core";
8
+ import type { SourceProp, Validator } from "@chelone/core";
9
9
  /** Props for {@link SearchInput}. */
10
10
  export interface SearchInputProps {
11
- source?: string;
11
+ source?: SourceProp;
12
12
  label?: string | false;
13
13
  disableClearable?: boolean;
14
14
  defaultValue?: unknown;
@@ -18,7 +18,7 @@ export interface SearchInputProps {
18
18
  class?: string;
19
19
  }
20
20
  declare const _default: import("vue").DefineComponent<SearchInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SearchInputProps> & Readonly<{}>, {
21
- source: string;
21
+ source: SourceProp;
22
22
  disableClearable: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  export default _default;
@@ -1,11 +1,20 @@
1
+ import type { ChoiceRecord } from "../../../choices/use-choices.js";
1
2
  import type { ChoiceInputBaseProps } from "./choice-input-props.js";
2
3
  /** Props for {@link SelectArrayInput}. */
3
- export interface SelectArrayInputProps extends ChoiceInputBaseProps {
4
+ export interface SelectArrayInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
4
5
  /** Placeholder shown in the trigger when nothing is selected. */
5
6
  placeholder?: string;
6
7
  }
7
- declare const _default: import("vue").DefineComponent<SelectArrayInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectArrayInputProps> & Readonly<{}>, {
8
- label: string | false;
9
- disableValue: string;
10
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: <TChoice extends ChoiceRecord = ChoiceRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
9
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & SelectArrayInputProps<TChoice> & Partial<{}>> & import("vue").PublicProps;
10
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: {};
13
+ emit: {};
14
+ }>) => import("vue").VNode & {
15
+ __ctx?: Awaited<typeof __VLS_setup>;
16
+ };
11
17
  export default _default;
18
+ type __VLS_PrettifyLocal<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  choices: {},
37
37
  optionText: {},
38
38
  optionValue: {},
39
- disableValue: { default: "disabled" },
39
+ disableValue: {},
40
40
  translateChoice: { type: Boolean },
41
41
  label: { type: [String, Boolean], default: void 0 },
42
42
  helperText: {},