@chelone/vue 0.2.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.
- package/dist/array/use-array-input.d.ts +4 -3
- package/dist/choices/use-choices.d.ts +19 -12
- package/dist/choices/use-choices.js +8 -11
- package/dist/components/admin/auth/auth-error.vue.d.ts +1 -1
- package/dist/components/admin/buttons/dual-approval-button.vue.d.ts +19 -15
- package/dist/components/admin/buttons/dual-approval-button.vue.js +3 -1
- package/dist/components/admin/buttons/save-button.vue.d.ts +1 -1
- package/dist/components/admin/buttons/sort-button.vue.d.ts +2 -1
- package/dist/components/admin/buttons/status-transition-button.vue.d.ts +19 -14
- package/dist/components/admin/buttons/status-transition-button.vue.js +3 -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/file-field.vue.js +3 -3
- 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/image-field.vue.js +3 -3
- 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 +2 -2
- 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 +1 -1
- package/dist/components/admin/inputs/choice-input-props.d.ts +7 -7
- 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/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 +1 -1
- 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 +13 -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/data-table-col.vue.d.ts +2 -2
- package/dist/components/admin/list/data-table-number-col.vue.d.ts +2 -1
- package/dist/components/admin/list/filter-form.vue.js +2 -10
- 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 +7 -6
- package/dist/components/admin/list/tree-list.vue.js +3 -9
- 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/controllers/use-controller-for-id.d.ts +6 -2
- package/dist/controllers/use-controller-for-id.js +2 -1
- package/dist/create-resource-components.d.ts +743 -0
- package/dist/create-resource-components.js +171 -0
- package/dist/data/create-chelone-hooks.d.ts +28 -8
- package/dist/data/mutations.d.ts +28 -8
- package/dist/form/use-input.d.ts +9 -6
- package/dist/form/use-input.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +248 -243
- package/dist/label/use-get-record-representation.d.ts +2 -1
- package/dist/label/use-get-record-representation.js +1 -13
- package/dist/record/use-field-value.d.ts +22 -11
- package/dist/record/use-field-value.js +3 -20
- package/package.json +4 -4
- package/dist/components/admin/fields/get-path.d.ts +0 -7
- package/dist/components/admin/fields/get-path.js +0 -14
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, SourceKey, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link RatingField}. */
|
|
3
|
-
export interface RatingFieldProps {
|
|
4
|
-
source:
|
|
5
|
-
record
|
|
3
|
+
export interface RatingFieldProps<RecordType extends LooseRecord = LooseRecord> {
|
|
4
|
+
source: SourceProp;
|
|
5
|
+
/** The record to render. Defaults to the ambient `RecordContext` value. */
|
|
6
|
+
record?: RecordType;
|
|
6
7
|
defaultValue?: unknown;
|
|
7
8
|
empty?: string;
|
|
8
9
|
/** Total stars rendered (filled + outlined). Default 5. */
|
|
9
10
|
max?: number;
|
|
10
11
|
/** Allow half-star granularity when the value falls between integers. */
|
|
11
12
|
allowHalf?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Sibling record field rendered in parentheses (e.g. a review count). A
|
|
15
|
+
* top-level key, not a path: the read is `record[countSource]`.
|
|
16
|
+
*/
|
|
17
|
+
countSource?: SourceKey<RecordType>;
|
|
14
18
|
class?: string;
|
|
15
19
|
}
|
|
16
|
-
declare const _default:
|
|
20
|
+
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<{
|
|
21
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & RatingFieldProps<RecordType> & Partial<{}>> & import("vue").PublicProps;
|
|
22
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
23
|
+
attrs: any;
|
|
24
|
+
slots: {};
|
|
25
|
+
emit: {};
|
|
26
|
+
}>) => import("vue").VNode & {
|
|
27
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
28
|
+
};
|
|
17
29
|
export default _default;
|
|
30
|
+
type __VLS_PrettifyLocal<T> = {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} & {};
|
|
@@ -30,7 +30,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
defaultValue: props.defaultValue
|
|
31
31
|
});
|
|
32
32
|
const injectedRecord = inject(RecordContextKey, null);
|
|
33
|
-
const ctxRecord = computed(
|
|
33
|
+
const ctxRecord = computed(
|
|
34
|
+
() => props.record ?? injectedRecord?.value
|
|
35
|
+
);
|
|
34
36
|
const translate = useTranslate();
|
|
35
37
|
const count = computed(() => {
|
|
36
38
|
const rec = ctxRecord.value;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Component } from "vue";
|
|
2
|
-
import type { LooseRecord } from "@chelone/core";
|
|
2
|
+
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
3
3
|
/** Props for {@link RecordField}. */
|
|
4
|
-
export interface RecordFieldProps<RecordType = LooseRecord> {
|
|
5
|
-
source?:
|
|
4
|
+
export interface RecordFieldProps<RecordType extends LooseRecord = LooseRecord> {
|
|
5
|
+
source?: SourceProp<RecordType>;
|
|
6
6
|
/** Explicit label, or `false`/`""` to hide it. Absent → humanized `source`. */
|
|
7
7
|
label?: string | false;
|
|
8
8
|
/** Override the ambient resource (reserved for label i18n; inert in V1). */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { FilterPayload, LooseRecord, SortPayload } from "@chelone/core";
|
|
1
|
+
import type { FilterPayload, LooseRecord, SortPayload, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link ReferenceArrayField}. */
|
|
3
3
|
export interface ReferenceArrayFieldProps {
|
|
4
4
|
/** The FK-array field on the current record (e.g. `"tag_ids"`). */
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
/** The referenced resource the ids point at (e.g. `"tags"`). */
|
|
7
7
|
reference: string;
|
|
8
8
|
/** The record to read the FK array off. Defaults to the ambient record. */
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
* `<DataTable>` row click does not also fire.
|
|
20
20
|
*/
|
|
21
21
|
import type { LooseRecord } from "@chelone/core";
|
|
22
|
+
import type { SourceProp } from "@chelone/core";
|
|
22
23
|
import type { LinkToType } from "../../../router/index.js";
|
|
23
24
|
/** Props for {@link ReferenceField}. */
|
|
24
25
|
export interface ReferenceFieldProps {
|
|
25
|
-
source:
|
|
26
|
+
source: SourceProp;
|
|
26
27
|
reference: string;
|
|
27
28
|
record?: LooseRecord;
|
|
28
29
|
empty?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FilterPayload, LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { FilterPayload, LooseRecord, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link ReferenceManyCount}. */
|
|
3
3
|
export interface ReferenceManyCountProps {
|
|
4
4
|
/** The referenced resource holding the reverse FK (e.g. `"books"`). */
|
|
@@ -6,7 +6,7 @@ export interface ReferenceManyCountProps {
|
|
|
6
6
|
/** The FK field on the reference pointing back at this record (e.g. `"author_id"`). */
|
|
7
7
|
target: string;
|
|
8
8
|
/** The field on the current record the `target` matches. Default `"id"`. */
|
|
9
|
-
source?:
|
|
9
|
+
source?: SourceProp;
|
|
10
10
|
/** The record whose id is matched. Defaults to the ambient record. */
|
|
11
11
|
record?: LooseRecord;
|
|
12
12
|
/** Permanent filter merged into the lookup, so only matching rows are counted. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FilterPayload, LooseRecord, SortPayload } from "@chelone/core";
|
|
1
|
+
import type { FilterPayload, LooseRecord, SortPayload, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link ReferenceManyField}. */
|
|
3
3
|
export interface ReferenceManyFieldProps {
|
|
4
4
|
/** The referenced resource holding the reverse FK (e.g. `"books"`). */
|
|
@@ -6,7 +6,7 @@ export interface ReferenceManyFieldProps {
|
|
|
6
6
|
/** The FK field on the reference pointing back at this record (e.g. `"author_id"`). */
|
|
7
7
|
target: string;
|
|
8
8
|
/** The field on the current record the `target` matches. Default `"id"`. */
|
|
9
|
-
source?:
|
|
9
|
+
source?: SourceProp;
|
|
10
10
|
/** The record whose id is matched. Defaults to the ambient record. */
|
|
11
11
|
record?: LooseRecord;
|
|
12
12
|
/** Initial sort of the related list. Default id ascending. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FilterPayload, LooseRecord, SortPayload } from "@chelone/core";
|
|
1
|
+
import type { FilterPayload, LooseRecord, SortPayload, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link ReferenceOneField}. */
|
|
3
3
|
export interface ReferenceOneFieldProps {
|
|
4
4
|
/** The referenced resource holding the one-to-one record (e.g. `"bios"`). */
|
|
@@ -6,7 +6,7 @@ export interface ReferenceOneFieldProps {
|
|
|
6
6
|
/** The FK field on the reference pointing back at this record (e.g. `"author_id"`). */
|
|
7
7
|
target: string;
|
|
8
8
|
/** The field on the current record the `target` matches. Default `"id"`. */
|
|
9
|
-
source?:
|
|
9
|
+
source?: SourceProp;
|
|
10
10
|
/** The record whose id is matched. Defaults to the ambient record. */
|
|
11
11
|
record?: LooseRecord;
|
|
12
12
|
/** Sort applied to the reference lookup (the first match is used). Read when the record id changes; remount with a `key` to change it otherwise. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
2
|
import type { ChoiceRecord, OptionText } from "../../../choices/use-choices.js";
|
|
3
3
|
/** Props for {@link SelectField}. */
|
|
4
4
|
export interface SelectFieldProps {
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
record?: LooseRecord;
|
|
7
7
|
defaultValue?: unknown;
|
|
8
8
|
empty?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
2
|
import type { SubscriptionPlan } from "../inputs/subscription-plan-picker.vue.js";
|
|
3
3
|
export type { SubscriptionPlan };
|
|
4
4
|
/** Props for {@link SubscriptionPlanField}. */
|
|
5
5
|
export interface SubscriptionPlanFieldProps {
|
|
6
|
-
source:
|
|
6
|
+
source: SourceProp;
|
|
7
7
|
record?: LooseRecord;
|
|
8
8
|
defaultValue?: unknown;
|
|
9
9
|
empty?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { LooseRecord } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
2
|
import type { BadgeVariant } from "../../ui/badge.js";
|
|
3
3
|
/** Props for {@link TextArrayField}. */
|
|
4
4
|
export interface TextArrayFieldProps {
|
|
5
|
-
source:
|
|
5
|
+
source: SourceProp;
|
|
6
6
|
record?: LooseRecord;
|
|
7
7
|
defaultValue?: unknown;
|
|
8
8
|
empty?: string;
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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[];
|
|
@@ -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 { 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
|
-
source?:
|
|
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[];
|
|
@@ -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;
|