@chelone/vue 0.3.0 → 0.5.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.
- package/dist/choices/use-choices.d.ts +11 -10
- package/dist/choices/use-choices.js +5 -4
- package/dist/components/admin/auth/auth-error.vue.d.ts +1 -1
- package/dist/components/admin/buttons/save-button.vue.d.ts +1 -1
- package/dist/components/admin/buttons/update-button.vue.d.ts +3 -3
- package/dist/components/admin/feedback/linear-progress.vue.d.ts +1 -1
- package/dist/components/admin/fields/api-key-field.vue.d.ts +27 -9
- package/dist/components/admin/fields/api-key-field.vue.js +3 -1
- package/dist/components/admin/fields/array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/badge-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/boolean-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/chip-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/color-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/cron-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/currency-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/date-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/duration-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/email-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/image-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/json-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/number-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/phone-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/rating-field.vue.d.ts +22 -7
- package/dist/components/admin/fields/rating-field.vue.js +3 -1
- package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/reference-array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-field.vue.d.ts +2 -1
- package/dist/components/admin/fields/reference-many-count.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-many-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/reference-one-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/select-field.vue.d.ts +18 -7
- package/dist/components/admin/fields/select-field.vue.js +1 -1
- package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/text-array-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/text-field.vue.d.ts +2 -8
- package/dist/components/admin/fields/url-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/usage-meter-field.vue.d.ts +22 -7
- package/dist/components/admin/fields/usage-meter-field.vue.js +3 -1
- package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +2 -2
- package/dist/components/admin/fields/wrapper-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/wrapper-field.vue.js +6 -0
- package/dist/components/admin/inputs/api-key-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/autocomplete-array-input.vue.d.ts +14 -6
- package/dist/components/admin/inputs/autocomplete-array-input.vue.js +2 -3
- package/dist/components/admin/inputs/autocomplete-input.vue.d.ts +14 -6
- package/dist/components/admin/inputs/autocomplete-input.vue.js +2 -3
- package/dist/components/admin/inputs/boolean-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/checkbox-group-input.vue.d.ts +14 -7
- package/dist/components/admin/inputs/checkbox-group-input.vue.js +2 -2
- package/dist/components/admin/inputs/choice-input-props.d.ts +6 -6
- package/dist/components/admin/inputs/color-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/cron-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/currency-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/datagrid-input.vue.d.ts +20 -5
- package/dist/components/admin/inputs/datagrid-input.vue.js +7 -3
- package/dist/components/admin/inputs/date-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/date-time-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/duration-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/file-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/nullable-boolean-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/number-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/password-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/phone-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/radio-button-group-input.vue.d.ts +14 -7
- package/dist/components/admin/inputs/radio-button-group-input.vue.js +2 -2
- package/dist/components/admin/inputs/rating-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/reference-array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/reference-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/search-input.vue.d.ts +3 -3
- package/dist/components/admin/inputs/select-array-input.vue.d.ts +14 -5
- package/dist/components/admin/inputs/select-array-input.vue.js +1 -1
- package/dist/components/admin/inputs/select-input.vue.d.ts +14 -7
- package/dist/components/admin/inputs/select-input.vue.js +1 -1
- package/dist/components/admin/inputs/subscription-plan-picker.vue.d.ts +2 -2
- package/dist/components/admin/inputs/text-array-input.vue.d.ts +2 -2
- package/dist/components/admin/inputs/text-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/time-input.vue.d.ts +2 -1
- package/dist/components/admin/inputs/use-choice-input.d.ts +12 -19
- package/dist/components/admin/inputs/use-choice-input.js +4 -1
- package/dist/components/admin/inputs/webhook-endpoint-input.vue.d.ts +2 -2
- package/dist/components/admin/list/calendar-list.vue.d.ts +8 -8
- package/dist/components/admin/list/filter-live-search.vue.d.ts +1 -1
- package/dist/components/admin/list/kanban-board.vue.d.ts +41 -0
- package/dist/components/admin/list/kanban-board.vue.js +275 -0
- package/dist/components/admin/list/kanban-board2.vue.js +4 -0
- package/dist/components/admin/list/list-icons.d.ts +2 -0
- package/dist/components/admin/list/list-icons.js +7 -0
- package/dist/components/admin/list/tree-list.vue.d.ts +6 -5
- package/dist/components/admin/view/labeled.vue.d.ts +6 -5
- package/dist/components/admin/view/labeled.vue.js +4 -1
- package/dist/components/admin/view/tabbed-show-layout-tab.vue.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/maps/geo-json-field.vue.d.ts +2 -1
- package/dist/components/maps/lat-lng-field.vue.d.ts +3 -3
- package/dist/components/maps/lat-lng-input.vue.d.ts +4 -4
- package/dist/components/maps-draw/shape-input.vue.d.ts +4 -4
- package/dist/components/maps-draw/simplify-input.vue.d.ts +2 -2
- package/dist/components/maps-osm/geocoding-input.vue.d.ts +6 -6
- package/dist/components/maps-osm/map-with-search.vue.d.ts +4 -4
- package/dist/components/maps-osm/osm-feature-operator.vue.d.ts +3 -3
- package/dist/components/maps-osm/reverse-geocode-field.vue.d.ts +3 -3
- package/dist/components/mdx-editor/mdx-field.vue.d.ts +2 -2
- package/dist/components/mdx-editor/mdx-input.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-field.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-input.vue.d.ts +2 -2
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.vue.d.ts +1 -1
- package/dist/components/ui/command/command-dialog.vue.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.vue.js +9 -3
- package/dist/components/ui/input.vue.d.ts +2 -2
- package/dist/components/ui/sidebar/sidebar-menu-button.vue.d.ts +1 -1
- package/dist/components/ui/textarea.vue.d.ts +2 -2
- package/dist/create-resource-components.d.ts +867 -0
- package/dist/create-resource-components.js +171 -0
- package/dist/data/create-chelone-hooks.d.ts +8 -8
- package/dist/data/mutations.d.ts +8 -8
- package/dist/form/use-input.d.ts +9 -7
- package/dist/form/use-input.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +248 -243
- package/dist/record/use-field-value.d.ts +16 -6
- package/package.json +4 -4
|
@@ -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:
|
|
10
|
-
record
|
|
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
|
-
/**
|
|
13
|
-
|
|
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:
|
|
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(
|
|
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:
|
|
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?:
|
|
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<
|
|
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:
|
|
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:
|
|
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:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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: {
|
|
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:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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: {
|
|
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:
|
|
10
|
+
source: SourceProp;
|
|
11
11
|
label?: string | false;
|
|
12
12
|
defaultValue?: boolean;
|
|
13
13
|
validate?: Validator | readonly Validator[];
|
|
@@ -1,13 +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 CheckboxGroupInput}. */
|
|
3
|
-
export interface CheckboxGroupInputProps extends ChoiceInputBaseProps {
|
|
4
|
+
export interface CheckboxGroupInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
|
|
4
5
|
/** Lay the checkboxes out horizontally instead of stacked. */
|
|
5
6
|
row?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const _default:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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> & CheckboxGroupInputProps<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
|
+
};
|
|
13
17
|
export default _default;
|
|
18
|
+
type __VLS_PrettifyLocal<T> = {
|
|
19
|
+
[K in keyof T]: T[K];
|
|
20
|
+
} & {};
|
|
@@ -19,8 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
source: {},
|
|
20
20
|
choices: {},
|
|
21
21
|
optionText: {},
|
|
22
|
-
optionValue: {
|
|
23
|
-
disableValue: {
|
|
22
|
+
optionValue: {},
|
|
23
|
+
disableValue: {},
|
|
24
24
|
translateChoice: { type: Boolean },
|
|
25
25
|
label: { type: [String, Boolean], default: void 0 },
|
|
26
26
|
helperText: {},
|
|
@@ -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 |
|
|
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?:
|
|
20
|
+
optionValue?: SourcePath<TChoice>;
|
|
21
21
|
/** The disabled-flag path. Default `disabled`. */
|
|
22
|
-
disableValue?:
|
|
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:
|
|
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:
|
|
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:
|
|
12
|
+
source: SourceProp;
|
|
13
13
|
label?: string | false;
|
|
14
14
|
defaultValue?: unknown;
|
|
15
15
|
validate?: Validator | readonly Validator[];
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import type { ChoiceRecord } from "../../../choices/use-choices.js";
|
|
1
2
|
import type { ChoiceInputBaseProps } from "./choice-input-props.js";
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link DatagridInput}.
|
|
5
|
+
*
|
|
6
|
+
* `disableValue` comes in through the shared base and is unused: a datagrid row
|
|
7
|
+
* is never disabled. The React twin has no `disableValue` prop at all.
|
|
8
|
+
*/
|
|
9
|
+
export interface DatagridInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
|
|
4
10
|
/** Column header for the choice column. Default empty. */
|
|
5
11
|
optionLabel?: string;
|
|
6
12
|
}
|
|
7
|
-
declare const _default:
|
|
8
|
-
|
|
9
|
-
|
|
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> & DatagridInputProps<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
|
+
};
|
|
10
22
|
export default _default;
|
|
23
|
+
type __VLS_PrettifyLocal<T> = {
|
|
24
|
+
[K in keyof T]: T[K];
|
|
25
|
+
} & {};
|
|
@@ -12,14 +12,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
optionLabel: {},
|
|
13
13
|
source: {},
|
|
14
14
|
choices: {},
|
|
15
|
-
optionText: {},
|
|
16
|
-
optionValue: {
|
|
15
|
+
optionText: { type: Function },
|
|
16
|
+
optionValue: {},
|
|
17
17
|
disableValue: {},
|
|
18
18
|
translateChoice: { type: Boolean },
|
|
19
19
|
label: { type: [String, Boolean] },
|
|
20
20
|
helperText: {},
|
|
21
21
|
defaultValue: {},
|
|
22
|
-
validate: {},
|
|
22
|
+
validate: { type: [Function, Array] },
|
|
23
23
|
disabled: { type: Boolean },
|
|
24
24
|
readonly: { type: Boolean },
|
|
25
25
|
class: {}
|
|
@@ -32,6 +32,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
32
32
|
componentName: "DatagridInput",
|
|
33
33
|
choices: props.choices,
|
|
34
34
|
source: props.source,
|
|
35
|
+
// The React twin defaults `optionText` to `"name"` in its own destructuring,
|
|
36
|
+
// so a `<DatagridInput>` under a reference wrapper labels the `name` field
|
|
37
|
+
// rather than the record representation. The literal has to be cast: a
|
|
38
|
+
// `SourcePath<TChoice>` is deferred while `TChoice` is open.
|
|
35
39
|
optionText: props.optionText ?? "name",
|
|
36
40
|
optionValue: props.optionValue,
|
|
37
41
|
disableValue: props.disableValue,
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
12
|
+
source: SourceProp;
|
|
13
13
|
label?: string | false;
|
|
14
14
|
defaultValue?: unknown;
|
|
15
15
|
validate?: Validator | readonly Validator[];
|
|
@@ -1,13 +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 RadioButtonGroupInput}. */
|
|
3
|
-
export interface RadioButtonGroupInputProps extends ChoiceInputBaseProps {
|
|
4
|
+
export interface RadioButtonGroupInputProps<TChoice extends ChoiceRecord = ChoiceRecord> extends ChoiceInputBaseProps<TChoice> {
|
|
4
5
|
/** Lay the radios out horizontally instead of stacked. */
|
|
5
6
|
row?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const _default:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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> & RadioButtonGroupInputProps<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
|
+
};
|
|
13
17
|
export default _default;
|
|
18
|
+
type __VLS_PrettifyLocal<T> = {
|
|
19
|
+
[K in keyof T]: T[K];
|
|
20
|
+
} & {};
|
|
@@ -19,8 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
source: {},
|
|
20
20
|
choices: {},
|
|
21
21
|
optionText: {},
|
|
22
|
-
optionValue: {
|
|
23
|
-
disableValue: {
|
|
22
|
+
optionValue: {},
|
|
23
|
+
disableValue: {},
|
|
24
24
|
translateChoice: { type: Boolean },
|
|
25
25
|
label: { type: [String, Boolean], default: void 0 },
|
|
26
26
|
helperText: {},
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
13
|
+
source: SourceProp;
|
|
14
14
|
reference: string;
|
|
15
15
|
label?: string | false;
|
|
16
16
|
perPage?: number;
|