@docyrus/ui-pro-ai-assistant 0.4.3 → 0.4.5
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/components/field-form-layout.d.ts +9 -0
- package/dist/components/field-value-layout.d.ts +7 -0
- package/dist/components/form-fields/approval-status-form-field.d.ts +2 -0
- package/dist/components/form-fields/checkbox-form-field.d.ts +2 -0
- package/dist/components/form-fields/color-form-field.d.ts +2 -0
- package/dist/components/form-fields/currency-code-form-field.d.ts +2 -0
- package/dist/components/form-fields/date-form-field.d.ts +2 -0
- package/dist/components/form-fields/date-range-form-field.d.ts +2 -0
- package/dist/components/form-fields/datetime-form-field.d.ts +2 -0
- package/dist/components/form-fields/duration-form-field.d.ts +2 -0
- package/dist/components/form-fields/dynamic-form-field.d.ts +8 -0
- package/dist/components/form-fields/email-form-field.d.ts +2 -0
- package/dist/components/form-fields/enum-form-field.d.ts +2 -0
- package/dist/components/form-fields/file-form-field.d.ts +2 -0
- package/dist/components/form-fields/icon-form-field.d.ts +2 -0
- package/dist/components/form-fields/index.d.ts +35 -0
- package/dist/components/form-fields/lib/utils.d.ts +138 -0
- package/dist/components/form-fields/location-select-form-field.d.ts +2 -0
- package/dist/components/form-fields/money-form-field.d.ts +2 -0
- package/dist/components/form-fields/multi-select-form-field.d.ts +5 -0
- package/dist/components/form-fields/number-form-field.d.ts +11 -0
- package/dist/components/form-fields/percent-form-field.d.ts +2 -0
- package/dist/components/form-fields/phone-form-field.d.ts +2 -0
- package/dist/components/form-fields/radio-group-form-field.d.ts +2 -0
- package/dist/components/form-fields/rating-form-field.d.ts +2 -0
- package/dist/components/form-fields/relation-form-field.d.ts +5 -0
- package/dist/components/form-fields/select-form-field.d.ts +2 -0
- package/dist/components/form-fields/status-form-field.d.ts +2 -0
- package/dist/components/form-fields/switch-form-field.d.ts +2 -0
- package/dist/components/form-fields/tag-select-form-field.d.ts +2 -0
- package/dist/components/form-fields/task-list-form-field.d.ts +2 -0
- package/dist/components/form-fields/text-form-field.d.ts +2 -0
- package/dist/components/form-fields/textarea-form-field.d.ts +2 -0
- package/dist/components/form-fields/time-form-field.d.ts +2 -0
- package/dist/components/form-fields/types/index.d.ts +97 -0
- package/dist/components/form-fields/url-form-field.d.ts +2 -0
- package/dist/components/form-fields/user-multi-select-form-field.d.ts +2 -0
- package/dist/components/form-fields/user-select-form-field.d.ts +2 -0
- package/dist/components/value-renderers/approval-status-value.d.ts +2 -0
- package/dist/components/value-renderers/avatar-value.d.ts +2 -0
- package/dist/components/value-renderers/button-value.d.ts +2 -0
- package/dist/components/value-renderers/checkbox-value.d.ts +2 -0
- package/dist/components/value-renderers/code-value.d.ts +2 -0
- package/dist/components/value-renderers/color-value.d.ts +2 -0
- package/dist/components/value-renderers/conversation-channel-value.d.ts +2 -0
- package/dist/components/value-renderers/currency-code-value.d.ts +2 -0
- package/dist/components/value-renderers/date-range-value.d.ts +2 -0
- package/dist/components/value-renderers/date-value.d.ts +2 -0
- package/dist/components/value-renderers/datetime-value.d.ts +2 -0
- package/dist/components/value-renderers/doc-editor-value.d.ts +2 -0
- package/dist/components/value-renderers/duration-value.d.ts +2 -0
- package/dist/components/value-renderers/dynamic-value.d.ts +6 -0
- package/dist/components/value-renderers/email-value.d.ts +2 -0
- package/dist/components/value-renderers/file-storage-folder-value.d.ts +2 -0
- package/dist/components/value-renderers/file-value.d.ts +2 -0
- package/dist/components/value-renderers/formula-value.d.ts +2 -0
- package/dist/components/value-renderers/icon-value.d.ts +2 -0
- package/dist/components/value-renderers/identity-value.d.ts +2 -0
- package/dist/components/value-renderers/image-value.d.ts +2 -0
- package/dist/components/value-renderers/index.d.ts +45 -0
- package/dist/components/value-renderers/inline-data-value.d.ts +2 -0
- package/dist/components/value-renderers/json-value.d.ts +2 -0
- package/dist/components/value-renderers/list-value.d.ts +2 -0
- package/dist/components/value-renderers/location-value.d.ts +2 -0
- package/dist/components/value-renderers/money-value.d.ts +2 -0
- package/dist/components/value-renderers/multi-select-value.d.ts +2 -0
- package/dist/components/value-renderers/number-value.d.ts +2 -0
- package/dist/components/value-renderers/percent-value.d.ts +2 -0
- package/dist/components/value-renderers/phone-value.d.ts +2 -0
- package/dist/components/value-renderers/rating-value.d.ts +2 -0
- package/dist/components/value-renderers/related-field-value.d.ts +2 -0
- package/dist/components/value-renderers/relation-value.d.ts +2 -0
- package/dist/components/value-renderers/rich-text-value.d.ts +2 -0
- package/dist/components/value-renderers/select-value.d.ts +2 -0
- package/dist/components/value-renderers/status-value.d.ts +2 -0
- package/dist/components/value-renderers/switch-value.d.ts +2 -0
- package/dist/components/value-renderers/task-list-value.d.ts +2 -0
- package/dist/components/value-renderers/text-value.d.ts +2 -0
- package/dist/components/value-renderers/time-value.d.ts +2 -0
- package/dist/components/value-renderers/todo-value.d.ts +2 -0
- package/dist/components/value-renderers/types.d.ts +61 -0
- package/dist/components/value-renderers/url-value.d.ts +2 -0
- package/dist/components/value-renderers/user-multi-value.d.ts +2 -0
- package/dist/components/value-renderers/user-value.d.ts +2 -0
- package/dist/components/value-renderers/utils.d.ts +12 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-resolved-record-fields.d.ts +23 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6083 -509
- package/dist/index.js.map +1 -1
- package/dist/internal/plate-editor/plate-ui/dialog.d.ts +1 -1
- package/dist/lib/assistant-config.d.ts +7 -0
- package/dist/styles.css +589 -0
- package/dist/tools/update-record.d.ts +13 -0
- package/dist/tools/view-record.d.ts +11 -0
- package/package.json +4 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type DataSourceField } from '../lib/assistant-config';
|
|
2
|
+
interface FieldFormLayoutProps {
|
|
3
|
+
fields: DataSourceField[];
|
|
4
|
+
/** TanStack Form instance from the parent — required so parent can read edited values on submit. */
|
|
5
|
+
form: any;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function FieldFormLayout({ fields, form, disabled }: FieldFormLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DataSourceField } from '../lib/assistant-config';
|
|
2
|
+
interface FieldValueLayoutProps {
|
|
3
|
+
fields: DataSourceField[];
|
|
4
|
+
record: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export declare function FieldValueLayout({ fields, record }: FieldValueLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type DocyrusFormFieldProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamic form field dispatcher for AI assistant tools.
|
|
4
|
+
* Renders the correct editable form field based on the field's type.
|
|
5
|
+
* Accepts both prefixed ("field-select") and raw ("select") types.
|
|
6
|
+
* Falls back to TextFormField for unsupported types.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DynamicFormField(props: DocyrusFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export { TextFormField } from './text-form-field';
|
|
2
|
+
export { TextareaFormField } from './textarea-form-field';
|
|
3
|
+
export { NumberFormField } from './number-form-field';
|
|
4
|
+
export { EmailFormField } from './email-form-field';
|
|
5
|
+
export { UrlFormField } from './url-form-field';
|
|
6
|
+
export { CheckboxFormField } from './checkbox-form-field';
|
|
7
|
+
export { SwitchFormField } from './switch-form-field';
|
|
8
|
+
export { SelectFormField } from './select-form-field';
|
|
9
|
+
export { MultiSelectFormField } from './multi-select-form-field';
|
|
10
|
+
export { TagSelectFormField } from './tag-select-form-field';
|
|
11
|
+
export { RadioGroupFormField } from './radio-group-form-field';
|
|
12
|
+
export { EnumFormField } from './enum-form-field';
|
|
13
|
+
export { StatusFormField } from './status-form-field';
|
|
14
|
+
export { UserSelectFormField } from './user-select-form-field';
|
|
15
|
+
export { UserMultiSelectFormField } from './user-multi-select-form-field';
|
|
16
|
+
export { RelationFormField, relationCardGridVariants } from './relation-form-field';
|
|
17
|
+
export { DateFormField } from './date-form-field';
|
|
18
|
+
export { DateTimeFormField } from './datetime-form-field';
|
|
19
|
+
export { TimeFormField } from './time-form-field';
|
|
20
|
+
export { DateRangeFormField } from './date-range-form-field';
|
|
21
|
+
export { MoneyFormField } from './money-form-field';
|
|
22
|
+
export { PercentFormField } from './percent-form-field';
|
|
23
|
+
export { RatingFormField } from './rating-form-field';
|
|
24
|
+
export { DurationFormField } from './duration-form-field';
|
|
25
|
+
export { PhoneFormField } from './phone-form-field';
|
|
26
|
+
export { ColorFormField } from './color-form-field';
|
|
27
|
+
export { IconFormField } from './icon-form-field';
|
|
28
|
+
export { CurrencyCodeFormField } from './currency-code-form-field';
|
|
29
|
+
export { FileFormField } from './file-form-field';
|
|
30
|
+
export { TaskListFormField } from './task-list-form-field';
|
|
31
|
+
export { LocationSelectFormField } from './location-select-form-field';
|
|
32
|
+
export { ApprovalStatusFormField } from './approval-status-form-field';
|
|
33
|
+
export { DynamicFormField } from './dynamic-form-field';
|
|
34
|
+
export type { IFieldType, IField, EnumOption, DocyrusFormFieldProps, DocyrusValueProps } from './types';
|
|
35
|
+
export { flattenNestedOptions, getCompanionFieldSlug, getCompanionValue, COMMON_CURRENCIES, parseDateRange, formatDateRange, formatDuration, parseDuration, formatMoney, getCurrencySymbol, formatTime, formatPhoneDisplay, isSelectField, isMultiSelectField, isVirtualField, isCompositeField, isReadOnlyField } from './lib/utils';
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import { type IFieldType, type EnumOption } from '../types';
|
|
3
|
+
/** Flatten nested options into an ordered list with depth info for tree rendering. */
|
|
4
|
+
export declare function flattenNestedOptions(options: EnumOption[], nestedByProp: string): Array<{
|
|
5
|
+
option: EnumOption;
|
|
6
|
+
depth: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function formatDuration(seconds: number | null | undefined): string;
|
|
9
|
+
export declare function parseDuration(display: string): number;
|
|
10
|
+
export declare function getCurrencySymbol(code: string): string;
|
|
11
|
+
export declare function formatMoney(amount: number | null | undefined, currency?: string): string;
|
|
12
|
+
export declare function getCompanionFieldSlug(fieldSlug: string, suffix: string): string;
|
|
13
|
+
export declare function getCompanionValue(record: Record<string, unknown> | undefined, fieldSlug: string, suffix: string): unknown;
|
|
14
|
+
export declare function parseDateRange(value: string | null | undefined): {
|
|
15
|
+
start: Date;
|
|
16
|
+
end: Date;
|
|
17
|
+
} | null;
|
|
18
|
+
export declare function formatDateRange(start: Date, end: Date): string;
|
|
19
|
+
export declare function formatTime(value: string | null | undefined): string;
|
|
20
|
+
export declare function formatPhoneDisplay(phone: string | null | undefined, countryCode: string | null | undefined): string;
|
|
21
|
+
export declare function isSelectField(type: IFieldType): boolean;
|
|
22
|
+
export declare function isMultiSelectField(type: IFieldType): boolean;
|
|
23
|
+
export declare function isVirtualField(type: IFieldType): boolean;
|
|
24
|
+
export declare function isCompositeField(type: IFieldType): boolean;
|
|
25
|
+
export declare function isReadOnlyField(type: IFieldType): boolean;
|
|
26
|
+
export interface EnumColorResult {
|
|
27
|
+
className?: string;
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build badge-style colors from an enum option color string.
|
|
32
|
+
*
|
|
33
|
+
* Supports:
|
|
34
|
+
* - Tailwind color names: `"blue"`, `"red-500"`, `"emerald-300"`
|
|
35
|
+
* - Hex: `"#3b82f6"`, `"#f00"`
|
|
36
|
+
* - RGB: `"rgb(59, 130, 246)"`, `"rgba(59, 130, 246, 1)"`
|
|
37
|
+
* - OKLCH: `"oklch(0.7 0.15 250)"`
|
|
38
|
+
*
|
|
39
|
+
* For Tailwind colors, returns `className` with Tailwind utility classes.
|
|
40
|
+
* For other formats, returns `style` with computed bg (12% opacity) and
|
|
41
|
+
* contrasting text color.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getEnumBadgeColors(color: string | undefined): EnumColorResult;
|
|
44
|
+
/**
|
|
45
|
+
* Build inline style for a small color dot/swatch from an enum option color.
|
|
46
|
+
* Returns a `backgroundColor` style for hex/rgb/oklch values, or empty for
|
|
47
|
+
* Tailwind colors (which should use className-based rendering).
|
|
48
|
+
*/
|
|
49
|
+
export declare function getEnumDotStyle(color: string | undefined): CSSProperties | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Build Tailwind className for a small color dot based on Tailwind color name.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getEnumDotClassName(color: string | undefined): string;
|
|
54
|
+
/**
|
|
55
|
+
* Returns Tailwind className + inline style to color an icon or text
|
|
56
|
+
* based on an enum option color. Uses `text-{color}-500` for Tailwind
|
|
57
|
+
* names and inline `color` for hex/rgb/oklch.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getEnumIconColor(color: string | undefined): {
|
|
60
|
+
className?: string;
|
|
61
|
+
style?: CSSProperties;
|
|
62
|
+
};
|
|
63
|
+
export declare const COMMON_CURRENCIES: readonly [{
|
|
64
|
+
readonly code: "USD";
|
|
65
|
+
readonly name: "US Dollar";
|
|
66
|
+
}, {
|
|
67
|
+
readonly code: "EUR";
|
|
68
|
+
readonly name: "Euro";
|
|
69
|
+
}, {
|
|
70
|
+
readonly code: "GBP";
|
|
71
|
+
readonly name: "British Pound";
|
|
72
|
+
}, {
|
|
73
|
+
readonly code: "TRY";
|
|
74
|
+
readonly name: "Turkish Lira";
|
|
75
|
+
}, {
|
|
76
|
+
readonly code: "JPY";
|
|
77
|
+
readonly name: "Japanese Yen";
|
|
78
|
+
}, {
|
|
79
|
+
readonly code: "CNY";
|
|
80
|
+
readonly name: "Chinese Yuan";
|
|
81
|
+
}, {
|
|
82
|
+
readonly code: "CHF";
|
|
83
|
+
readonly name: "Swiss Franc";
|
|
84
|
+
}, {
|
|
85
|
+
readonly code: "CAD";
|
|
86
|
+
readonly name: "Canadian Dollar";
|
|
87
|
+
}, {
|
|
88
|
+
readonly code: "AUD";
|
|
89
|
+
readonly name: "Australian Dollar";
|
|
90
|
+
}, {
|
|
91
|
+
readonly code: "INR";
|
|
92
|
+
readonly name: "Indian Rupee";
|
|
93
|
+
}, {
|
|
94
|
+
readonly code: "BRL";
|
|
95
|
+
readonly name: "Brazilian Real";
|
|
96
|
+
}, {
|
|
97
|
+
readonly code: "KRW";
|
|
98
|
+
readonly name: "South Korean Won";
|
|
99
|
+
}, {
|
|
100
|
+
readonly code: "MXN";
|
|
101
|
+
readonly name: "Mexican Peso";
|
|
102
|
+
}, {
|
|
103
|
+
readonly code: "SGD";
|
|
104
|
+
readonly name: "Singapore Dollar";
|
|
105
|
+
}, {
|
|
106
|
+
readonly code: "HKD";
|
|
107
|
+
readonly name: "Hong Kong Dollar";
|
|
108
|
+
}, {
|
|
109
|
+
readonly code: "NOK";
|
|
110
|
+
readonly name: "Norwegian Krone";
|
|
111
|
+
}, {
|
|
112
|
+
readonly code: "SEK";
|
|
113
|
+
readonly name: "Swedish Krona";
|
|
114
|
+
}, {
|
|
115
|
+
readonly code: "DKK";
|
|
116
|
+
readonly name: "Danish Krone";
|
|
117
|
+
}, {
|
|
118
|
+
readonly code: "PLN";
|
|
119
|
+
readonly name: "Polish Zloty";
|
|
120
|
+
}, {
|
|
121
|
+
readonly code: "ZAR";
|
|
122
|
+
readonly name: "South African Rand";
|
|
123
|
+
}, {
|
|
124
|
+
readonly code: "AED";
|
|
125
|
+
readonly name: "UAE Dirham";
|
|
126
|
+
}, {
|
|
127
|
+
readonly code: "SAR";
|
|
128
|
+
readonly name: "Saudi Riyal";
|
|
129
|
+
}, {
|
|
130
|
+
readonly code: "RUB";
|
|
131
|
+
readonly name: "Russian Ruble";
|
|
132
|
+
}, {
|
|
133
|
+
readonly code: "ILS";
|
|
134
|
+
readonly name: "Israeli Shekel";
|
|
135
|
+
}, {
|
|
136
|
+
readonly code: "THB";
|
|
137
|
+
readonly name: "Thai Baht";
|
|
138
|
+
}];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type UiI18nLocale } from '@docyrus/ui-pro-shared/lib/ui-i18n';
|
|
2
|
+
import { type DocyrusFormFieldProps } from './types';
|
|
3
|
+
export declare function MultiSelectFormField({ field: fieldConfig, form, disabled, className, enumOptions, locale }: DocyrusFormFieldProps & {
|
|
4
|
+
locale?: UiI18nLocale;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DocyrusFormFieldProps } from './types';
|
|
2
|
+
interface NumberFormFieldProps extends DocyrusFormFieldProps {
|
|
3
|
+
/** Allow decimal input */
|
|
4
|
+
decimal?: boolean;
|
|
5
|
+
/** Thousands grouping separator. Defaults to ".". Set to null or undefined to disable grouping. */
|
|
6
|
+
thousandsSeparator?: string | null;
|
|
7
|
+
/** Decimal separator. Defaults to ",". */
|
|
8
|
+
decimalsSeparator?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function NumberFormField({ field: fieldConfig, form, disabled, className, decimal, thousandsSeparator, decimalsSeparator }: NumberFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type DocyrusFormFieldProps } from './types';
|
|
2
|
+
export declare const relationCardGridVariants: (props?: ({
|
|
3
|
+
columnCount?: 1 | 3 | 4 | 2 | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare function RelationFormField(props: DocyrusFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type IFieldType = 'field-text' | 'field-textarea' | 'field-email' | 'field-phone' | 'field-url' | 'field-color' | 'field-icon' | 'field-currency' | 'field-display' | 'field-htmlEditor' | 'field-emailEditor' | 'field-codeEditor' | 'field-formula' | 'field-relatedField' | 'field-enum' | 'field-code' | 'field-button' | 'field-number' | 'field-money' | 'field-percent' | 'field-duration' | 'field-rating' | 'field-identity' | 'field-autonumber' | 'field-checkbox' | 'field-switch' | 'field-date' | 'field-dateTime' | 'field-time' | 'field-dateRange' | 'field-select' | 'field-radioGroup' | 'field-status' | 'field-relation' | 'field-userSelect' | 'field-multiSelect' | 'field-tagSelect' | 'field-userMultiSelect' | 'field-json' | 'field-file' | 'field-image' | 'field-avatar' | 'field-docEditor' | 'field-inlineData' | 'field-inlineForm' | 'field-taskList' | 'field-approvalStatus' | 'field-locationSelect' | 'field-list' | 'field-todo' | 'field-conversationChannel' | 'field-queryBuilder' | 'field-dynamic' | 'field-schema' | 'field-schemaRepeater' | 'field-fileStorageFolder' | 'field-systemEnum' | 'field-systemBuffer' | 'field-systemVector' | 'field-systemTextArray' | 'field-systemUuidArray';
|
|
3
|
+
export interface IField {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
type: IFieldType;
|
|
8
|
+
defaultValue?: string | null;
|
|
9
|
+
validations?: Array<string> | null;
|
|
10
|
+
readOnly?: boolean | null;
|
|
11
|
+
options?: Record<string, unknown> | null;
|
|
12
|
+
relationDataSourceId?: string | null;
|
|
13
|
+
avatarMapping?: {
|
|
14
|
+
iconField?: string | null;
|
|
15
|
+
colorField?: string | null;
|
|
16
|
+
imageField?: string | null;
|
|
17
|
+
} | null;
|
|
18
|
+
/** Whether enum options should be displayed as a nested tree */
|
|
19
|
+
nested?: boolean | null;
|
|
20
|
+
/** The property on EnumOption used for parent reference (defaults to 'parent') */
|
|
21
|
+
nestedByProp?: string | null;
|
|
22
|
+
/** Mapping for custom item rendering in relation/select fields */
|
|
23
|
+
itemMapping?: {
|
|
24
|
+
iconField?: string | null;
|
|
25
|
+
colorField?: string | null;
|
|
26
|
+
imageField?: string | null;
|
|
27
|
+
descriptionField?: string | null;
|
|
28
|
+
} | null;
|
|
29
|
+
}
|
|
30
|
+
export interface EnumOption {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
color?: string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
parent?: string;
|
|
36
|
+
slug?: string;
|
|
37
|
+
sort_order?: number;
|
|
38
|
+
active?: boolean;
|
|
39
|
+
is_final_option?: boolean;
|
|
40
|
+
force_description?: boolean;
|
|
41
|
+
force_followup_date?: boolean;
|
|
42
|
+
description?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Common props for all TanStack Form field components */
|
|
45
|
+
export interface DocyrusFormFieldProps {
|
|
46
|
+
/** Field configuration from the data source */
|
|
47
|
+
field: IField;
|
|
48
|
+
/** TanStack Form instance — the result of useForm() */
|
|
49
|
+
form: any;
|
|
50
|
+
/** Whether the field is disabled */
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/** Additional CSS class */
|
|
53
|
+
className?: string;
|
|
54
|
+
/** Enum options for select-based fields */
|
|
55
|
+
enumOptions?: Array<EnumOption>;
|
|
56
|
+
/** App slug for dynamic enum loading */
|
|
57
|
+
appSlug?: string;
|
|
58
|
+
/** Data source slug for dynamic enum loading */
|
|
59
|
+
dataSourceSlug?: string;
|
|
60
|
+
/** Tailwind color tones for field-color (e.g. [200, 500]) */
|
|
61
|
+
tones?: number[];
|
|
62
|
+
/** Callback for loading more options (pagination) */
|
|
63
|
+
onLoadMore?: () => void;
|
|
64
|
+
/** Whether more options are available to load */
|
|
65
|
+
hasMore?: boolean;
|
|
66
|
+
/** Callback for creating a new record inline (simple mode) */
|
|
67
|
+
onCreateRecord?: (name: string) => Promise<EnumOption>;
|
|
68
|
+
/** Render prop for a custom inline record creation form */
|
|
69
|
+
renderCreateForm?: (props: {
|
|
70
|
+
onCreated: (option: EnumOption) => void;
|
|
71
|
+
}) => ReactNode;
|
|
72
|
+
/** Custom render function for option items */
|
|
73
|
+
itemTemplate?: (option: EnumOption) => ReactNode;
|
|
74
|
+
/** Display mode: 'dropdown' (default popover) or 'card' (inline card grid) */
|
|
75
|
+
variant?: 'dropdown' | 'card';
|
|
76
|
+
/** Number of grid columns for card variant (1–4, responsive breakpoints) */
|
|
77
|
+
columnCount?: 1 | 2 | 3 | 4;
|
|
78
|
+
/** Remote search callback — consumer updates enumOptions server-side */
|
|
79
|
+
onSearch?: (query: string) => void;
|
|
80
|
+
/** Whether remote search is in progress (shows spinner) */
|
|
81
|
+
searching?: boolean;
|
|
82
|
+
/** Max height for the scrollable card container (default: '360px') */
|
|
83
|
+
maxHeight?: string;
|
|
84
|
+
}
|
|
85
|
+
/** Common props for all value renderer components */
|
|
86
|
+
export interface DocyrusValueProps {
|
|
87
|
+
/** Field configuration from the data source */
|
|
88
|
+
field: IField;
|
|
89
|
+
/** The field value to display */
|
|
90
|
+
value: unknown;
|
|
91
|
+
/** Full record for accessing companion columns */
|
|
92
|
+
record?: Record<string, unknown>;
|
|
93
|
+
/** Enum options for select-based fields */
|
|
94
|
+
enumOptions?: Array<EnumOption>;
|
|
95
|
+
/** Additional CSS class */
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type DocyrusValueProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Dynamic value renderer dispatcher.
|
|
4
|
+
* Renders the correct read-only display component based on the field's type.
|
|
5
|
+
*/
|
|
6
|
+
export declare function DynamicValue(props: DocyrusValueProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { ApprovalStatusValue } from './approval-status-value';
|
|
2
|
+
export { AvatarValue } from './avatar-value';
|
|
3
|
+
export { ButtonValue } from './button-value';
|
|
4
|
+
export { CheckboxValue } from './checkbox-value';
|
|
5
|
+
export { CodeValue } from './code-value';
|
|
6
|
+
export { ColorValue } from './color-value';
|
|
7
|
+
export { CurrencyCodeValue } from './currency-code-value';
|
|
8
|
+
export { DateRangeValue } from './date-range-value';
|
|
9
|
+
export { DateValue } from './date-value';
|
|
10
|
+
export { DateTimeValue } from './datetime-value';
|
|
11
|
+
export { DocEditorValue } from './doc-editor-value';
|
|
12
|
+
export { DurationValue } from './duration-value';
|
|
13
|
+
export { EmailValue } from './email-value';
|
|
14
|
+
export { FileValue } from './file-value';
|
|
15
|
+
export { FormulaValue } from './formula-value';
|
|
16
|
+
export { IconValue } from './icon-value';
|
|
17
|
+
export { IdentityValue } from './identity-value';
|
|
18
|
+
export { ImageValue } from './image-value';
|
|
19
|
+
export { InlineDataValue } from './inline-data-value';
|
|
20
|
+
export { JsonValue } from './json-value';
|
|
21
|
+
export { LocationValue } from './location-value';
|
|
22
|
+
export { MoneyValue } from './money-value';
|
|
23
|
+
export { MultiSelectValue } from './multi-select-value';
|
|
24
|
+
export { NumberValue } from './number-value';
|
|
25
|
+
export { PercentValue } from './percent-value';
|
|
26
|
+
export { PhoneValue } from './phone-value';
|
|
27
|
+
export { RatingValue } from './rating-value';
|
|
28
|
+
export { RelatedFieldValue } from './related-field-value';
|
|
29
|
+
export { RelationValue } from './relation-value';
|
|
30
|
+
export { RichTextValue } from './rich-text-value';
|
|
31
|
+
export { SelectValue } from './select-value';
|
|
32
|
+
export { StatusValue } from './status-value';
|
|
33
|
+
export { SwitchValue } from './switch-value';
|
|
34
|
+
export { TaskListValue } from './task-list-value';
|
|
35
|
+
export { TextValue } from './text-value';
|
|
36
|
+
export { TimeValue } from './time-value';
|
|
37
|
+
export { TodoValue } from './todo-value';
|
|
38
|
+
export { UrlValue } from './url-value';
|
|
39
|
+
export { UserMultiValue } from './user-multi-value';
|
|
40
|
+
export { UserValue } from './user-value';
|
|
41
|
+
export { ConversationChannelValue } from './conversation-channel-value';
|
|
42
|
+
export { FileStorageFolderValue } from './file-storage-folder-value';
|
|
43
|
+
export { ListValue } from './list-value';
|
|
44
|
+
export { DynamicValue } from './dynamic-value';
|
|
45
|
+
export type { DocyrusValueProps, IField, IFieldType, EnumOption } from './types';
|