@uipath/apollo-wind 2.69.0 → 2.71.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/components/custom/demo-composer.cjs +80 -0
- package/dist/components/custom/demo-composer.d.ts +11 -0
- package/dist/components/custom/demo-composer.js +46 -0
- package/dist/components/custom/panel-flow.cjs +2 -2
- package/dist/components/custom/panel-flow.js +2 -2
- package/dist/components/forms/field-control.cjs +3 -2
- package/dist/components/forms/field-control.js +3 -2
- package/dist/components/forms/validation-converter.cjs +14 -5
- package/dist/components/forms/validation-converter.js +14 -5
- package/dist/components/ui/chat-composer.cjs +429 -0
- package/dist/components/ui/chat-composer.d.ts +157 -0
- package/dist/components/ui/chat-composer.js +359 -0
- package/dist/components/ui/chat-hero.cjs +244 -0
- package/dist/components/ui/chat-hero.d.ts +51 -0
- package/dist/components/ui/chat-hero.js +189 -0
- package/dist/components/ui/citation.cjs +188 -0
- package/dist/components/ui/citation.d.ts +42 -0
- package/dist/components/ui/citation.js +148 -0
- package/dist/components/ui/date-picker.cjs +6 -5
- package/dist/components/ui/date-picker.js +7 -6
- package/dist/components/ui/datetime-picker.cjs +7 -10
- package/dist/components/ui/datetime-picker.js +8 -11
- package/dist/components/ui/dropzone-overlay.cjs +142 -0
- package/dist/components/ui/dropzone-overlay.d.ts +27 -0
- package/dist/components/ui/dropzone-overlay.js +105 -0
- package/dist/components/ui/file-upload.cjs +5 -29
- package/dist/components/ui/file-upload.js +2 -26
- package/dist/components/ui/file-validation.cjs +91 -0
- package/dist/components/ui/file-validation.d.ts +24 -0
- package/dist/components/ui/file-validation.js +51 -0
- package/dist/components/ui/hover-card.cjs +15 -8
- package/dist/components/ui/hover-card.d.ts +4 -1
- package/dist/components/ui/hover-card.js +16 -9
- package/dist/components/ui/index.cjs +304 -216
- package/dist/components/ui/index.d.ts +8 -0
- package/dist/components/ui/index.js +8 -0
- package/dist/components/ui/input-group.cjs +1 -1
- package/dist/components/ui/input-group.d.ts +2 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/message-actions.cjs +302 -0
- package/dist/components/ui/message-actions.d.ts +102 -0
- package/dist/components/ui/message-actions.js +241 -0
- package/dist/components/ui/message.cjs +1 -1
- package/dist/components/ui/message.d.ts +2 -0
- package/dist/components/ui/message.js +1 -1
- package/dist/components/ui/prompt-suggestions.cjs +133 -0
- package/dist/components/ui/prompt-suggestions.d.ts +52 -0
- package/dist/components/ui/prompt-suggestions.js +90 -0
- package/dist/components/ui/quick-form-field/components/field-header.cjs +9 -4
- package/dist/components/ui/quick-form-field/components/field-header.d.ts +4 -1
- package/dist/components/ui/quick-form-field/components/field-header.js +9 -4
- package/dist/components/ui/quick-form-field/components/lock-toggle-button.cjs +2 -2
- package/dist/components/ui/quick-form-field/components/lock-toggle-button.d.ts +5 -4
- package/dist/components/ui/quick-form-field/components/lock-toggle-button.js +2 -2
- package/dist/components/ui/quick-form-field/index.d.ts +1 -1
- package/dist/components/ui/quick-form-field/quick-form-field.cjs +158 -222
- package/dist/components/ui/quick-form-field/quick-form-field.d.ts +6 -4
- package/dist/components/ui/quick-form-field/quick-form-field.js +159 -223
- package/dist/components/ui/quick-form-field/types.cjs +2 -2
- package/dist/components/ui/quick-form-field/types.d.ts +39 -32
- package/dist/components/ui/quick-form-field/types.js +2 -2
- package/dist/components/ui/quick-form-field/utils.cjs +5 -59
- package/dist/components/ui/quick-form-field/utils.d.ts +2 -24
- package/dist/components/ui/quick-form-field/utils.js +3 -48
- package/dist/components/ui/sources.cjs +175 -0
- package/dist/components/ui/sources.d.ts +44 -0
- package/dist/components/ui/sources.js +132 -0
- package/dist/index.cjs +156 -7
- package/dist/index.d.ts +17 -1
- package/dist/index.js +9 -1
- package/dist/lib/date-value.cjs +46 -0
- package/dist/lib/date-value.d.ts +8 -0
- package/dist/lib/date-value.js +12 -0
- package/dist/lib/index.cjs +8 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +2 -1
- package/dist/lib/url.cjs +54 -0
- package/dist/lib/url.d.ts +8 -0
- package/dist/lib/url.js +17 -0
- package/dist/styles.css +239 -78
- package/dist/tailwind.utilities.css +15 -0
- package/package.json +1 -1
- package/dist/components/custom/chat-composer.cjs +0 -134
- package/dist/components/custom/chat-composer.d.ts +0 -14
- package/dist/components/custom/chat-composer.js +0 -100
- package/dist/components/custom/chat-first-experience.cjs +0 -87
- package/dist/components/custom/chat-first-experience.d.ts +0 -24
- package/dist/components/custom/chat-first-experience.js +0 -53
- package/dist/components/custom/chat-prompt-suggestions.cjs +0 -49
- package/dist/components/custom/chat-prompt-suggestions.d.ts +0 -18
- package/dist/components/custom/chat-prompt-suggestions.js +0 -15
|
@@ -11,7 +11,7 @@ import { AiAssistAction } from "../../field-actions/ai-assist-action.js";
|
|
|
11
11
|
import { COLLAPSED_HIDDEN, COLLAPSED_ICON_PADDING, COLLAPSED_ONLY } from "../../field-actions/collapse.js";
|
|
12
12
|
import { InsertVariableAction } from "../../field-actions/insert-variable-action.js";
|
|
13
13
|
import { FIELD_TYPE_META, FIELD_TYPE_ORDER } from "../types.js";
|
|
14
|
-
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTypes = FIELD_TYPE_ORDER, onFieldTypeChange, onRequiredChange, compact, showFieldActions, onValueChange, variables, onGenerateWithAi, onInsertVariable, strings, headerActions }) {
|
|
14
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTypes = FIELD_TYPE_ORDER, onFieldTypeChange, onRequiredChange, compact, disabled, isExpression, showFieldActions, onValueChange, variables, onGenerateWithAi, onInsertVariable, strings, headerActions }) {
|
|
15
15
|
const [pickerItems, optionsBySelectionId] = useMemo(()=>{
|
|
16
16
|
const byId = new Map();
|
|
17
17
|
const toItem = (v, id)=>{
|
|
@@ -69,7 +69,8 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTyp
|
|
|
69
69
|
children: /*#__PURE__*/ jsxs("button", {
|
|
70
70
|
type: "button",
|
|
71
71
|
"aria-label": strings.fieldTypeAriaLabel,
|
|
72
|
-
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
className: cn('flex h-7 items-center gap-1 rounded-lg px-2 text-[11px] text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground disabled:pointer-events-none disabled:opacity-50', collapsedPaddingClass),
|
|
73
74
|
children: [
|
|
74
75
|
/*#__PURE__*/ jsx(typeMeta.icon, {
|
|
75
76
|
size: 12
|
|
@@ -127,6 +128,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTyp
|
|
|
127
128
|
size: "sm",
|
|
128
129
|
checked: !!required,
|
|
129
130
|
onCheckedChange: onRequiredChange,
|
|
131
|
+
disabled: disabled,
|
|
130
132
|
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
131
133
|
"aria-label": required ? strings.requiredAriaLabel : strings.optionalAriaLabel
|
|
132
134
|
})
|
|
@@ -151,7 +153,8 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTyp
|
|
|
151
153
|
children: /*#__PURE__*/ jsx("button", {
|
|
152
154
|
type: "button",
|
|
153
155
|
"aria-label": required ? strings.requiredAriaLabel : strings.optionalAriaLabel,
|
|
154
|
-
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
className: "grid size-7 place-items-center rounded-lg text-foreground-subtle transition hover:bg-surface-overlay hover:text-foreground disabled:pointer-events-none disabled:opacity-50",
|
|
155
158
|
children: /*#__PURE__*/ jsx(Asterisk, {
|
|
156
159
|
size: 12
|
|
157
160
|
})
|
|
@@ -177,6 +180,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTyp
|
|
|
177
180
|
size: "sm",
|
|
178
181
|
checked: !!required,
|
|
179
182
|
onCheckedChange: onRequiredChange,
|
|
183
|
+
disabled: disabled,
|
|
180
184
|
className: "data-[state=checked]:bg-brand data-[state=unchecked]:bg-foreground-subtle",
|
|
181
185
|
"aria-label": required ? strings.requiredAriaLabel : strings.optionalAriaLabel
|
|
182
186
|
})
|
|
@@ -192,7 +196,8 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, fieldTyp
|
|
|
192
196
|
children: [
|
|
193
197
|
onGenerateWithAi && /*#__PURE__*/ jsx(AiAssistAction, {
|
|
194
198
|
onGenerate: onGenerateWithAi,
|
|
195
|
-
|
|
199
|
+
disabled: disabled,
|
|
200
|
+
hint: strings.aiOutputHint(strings.aiOutputLabel(typeLabel, isExpression)),
|
|
196
201
|
strings: {
|
|
197
202
|
trigger: strings.aiAssistAriaLabel,
|
|
198
203
|
tooltip: strings.aiAssistTooltip,
|
|
@@ -30,8 +30,8 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
31
|
const external_input_group_cjs_namespaceObject = require("../../input-group.cjs");
|
|
32
32
|
const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
33
|
-
function LockToggleButton({ locked, onLockedChange, strings }) {
|
|
34
|
-
const interactive = !!onLockedChange;
|
|
33
|
+
function LockToggleButton({ locked, onLockedChange, disabled, strings }) {
|
|
34
|
+
const interactive = !!onLockedChange && !disabled;
|
|
35
35
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipProvider, {
|
|
36
36
|
delayDuration: 300,
|
|
37
37
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_tooltip_cjs_namespaceObject.Tooltip, {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { QuickFormFieldStrings } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* The lock/unlock toggle
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The lock/unlock toggle in the field's leading addon. Disabled (and its label
|
|
4
|
+
* adjusted) with the field, or when onLockedChange isn't provided, since
|
|
5
|
+
* clicking it wouldn't do anything otherwise.
|
|
6
6
|
*/
|
|
7
|
-
export declare function LockToggleButton({ locked, onLockedChange, strings, }: {
|
|
7
|
+
export declare function LockToggleButton({ locked, onLockedChange, disabled, strings, }: {
|
|
8
8
|
locked: boolean;
|
|
9
9
|
onLockedChange?: (locked: boolean) => void;
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
/** See QuickFormFieldStrings. */
|
|
11
12
|
strings: QuickFormFieldStrings;
|
|
12
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { LockKeyhole, LockKeyholeOpen } from "lucide-react";
|
|
3
3
|
import { InputGroupButton } from "../../input-group.js";
|
|
4
4
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip.js";
|
|
5
|
-
function LockToggleButton({ locked, onLockedChange, strings }) {
|
|
6
|
-
const interactive = !!onLockedChange;
|
|
5
|
+
function LockToggleButton({ locked, onLockedChange, disabled, strings }) {
|
|
6
|
+
const interactive = !!onLockedChange && !disabled;
|
|
7
7
|
return /*#__PURE__*/ jsx(TooltipProvider, {
|
|
8
8
|
delayDuration: 300,
|
|
9
9
|
children: /*#__PURE__*/ jsxs(Tooltip, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { QuickFormField } from './quick-form-field';
|
|
2
|
-
export type { QuickFieldType, QuickFormFieldMode, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
2
|
+
export type { QuickFieldType, QuickFormFieldControlProps, QuickFormFieldMode, QuickFormFieldMoreActions, QuickFormFieldOption, QuickFormFieldProps, QuickFormFieldStrings, VariableInsertContext, } from './types';
|
|
3
3
|
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER } from './types';
|
|
@@ -38,12 +38,13 @@ const external_popover_cjs_namespaceObject = require("../popover.cjs");
|
|
|
38
38
|
const external_select_cjs_namespaceObject = require("../select.cjs");
|
|
39
39
|
const external_switch_cjs_namespaceObject = require("../switch.cjs");
|
|
40
40
|
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
41
|
+
const date_value_cjs_namespaceObject = require("../../../lib/date-value.cjs");
|
|
41
42
|
const field_menu_cjs_namespaceObject = require("../field-addons/field-menu.cjs");
|
|
42
43
|
const field_header_cjs_namespaceObject = require("./components/field-header.cjs");
|
|
43
44
|
const lock_toggle_button_cjs_namespaceObject = require("./components/lock-toggle-button.cjs");
|
|
44
45
|
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
45
46
|
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
46
|
-
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
47
|
+
function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, showLock = true, disabled = false, leadingAddon, trailingAddon, more, mode = 'literal', onModeChange, renderExpressionEditor, renderModeControl, fieldType = 'string', fieldTypes, onFieldTypeChange, required, onRequiredChange, label, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, onInsertVariable, variables = [], id, className }) {
|
|
47
48
|
const strings = (0, external_react_namespaceObject.useMemo)(()=>({
|
|
48
49
|
...external_types_cjs_namespaceObject.DEFAULT_QUICK_FORM_FIELD_STRINGS,
|
|
49
50
|
...stringOverrides
|
|
@@ -59,13 +60,12 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
59
60
|
const fieldId = id ?? generatedId;
|
|
60
61
|
const validationId = errorId ?? `${fieldId}-error`;
|
|
61
62
|
const typeMeta = external_types_cjs_namespaceObject.FIELD_TYPE_META[fieldType];
|
|
62
|
-
const
|
|
63
|
-
const editableOnValueChange = locked ? void 0 : onValueChange;
|
|
63
|
+
const editableOnValueChange = disabled ? void 0 : onValueChange;
|
|
64
64
|
const typeLabel = strings.typeLabels[fieldType] ?? typeMeta.label;
|
|
65
|
-
const fieldLabel = 'expression' ===
|
|
65
|
+
const fieldLabel = 'expression' === mode ? strings.expressionFieldLabel(typeLabel) : strings.valueFieldLabel(typeLabel);
|
|
66
66
|
const valuePlaceholder = placeholder ?? fieldLabel;
|
|
67
67
|
const menuActions = [
|
|
68
|
-
...more?.onClear
|
|
68
|
+
...more?.onClear ? [
|
|
69
69
|
{
|
|
70
70
|
id: 'clear',
|
|
71
71
|
label: strings.clearValue,
|
|
@@ -82,13 +82,11 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
82
82
|
}
|
|
83
83
|
] : []
|
|
84
84
|
];
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const builtInMenu = showsMenu ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(field_menu_cjs_namespaceObject.FieldMenu, {
|
|
88
|
-
mode: effectiveMode,
|
|
85
|
+
const builtInMenu = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(field_menu_cjs_namespaceObject.FieldMenu, {
|
|
86
|
+
mode: mode,
|
|
89
87
|
onSelect: (next)=>onModeChange?.(next),
|
|
90
|
-
modesDisabled: !
|
|
91
|
-
disabled: !
|
|
88
|
+
modesDisabled: !onModeChange && menuActions.length > 0,
|
|
89
|
+
disabled: disabled || !onModeChange && 0 === menuActions.length,
|
|
92
90
|
actions: menuActions,
|
|
93
91
|
triggerLabel: strings.valueModeAriaLabel,
|
|
94
92
|
literalDescription: strings.literalDescriptions[fieldType] ?? typeMeta.fixedDescription,
|
|
@@ -98,20 +96,22 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
98
96
|
expressionDescription: strings.expressionDescription,
|
|
99
97
|
fieldActions: strings.moreActionsAriaLabel
|
|
100
98
|
}
|
|
101
|
-
})
|
|
102
|
-
const
|
|
99
|
+
});
|
|
100
|
+
const controlProps = {
|
|
103
101
|
id: fieldId,
|
|
104
102
|
value,
|
|
105
103
|
onValueChange: editableOnValueChange,
|
|
106
104
|
onBlur: onValueBlur,
|
|
107
105
|
readOnly: !editableOnValueChange,
|
|
106
|
+
disabled,
|
|
108
107
|
placeholder: valuePlaceholder,
|
|
109
108
|
fieldType,
|
|
110
109
|
'aria-invalid': error ? true : void 0,
|
|
111
110
|
'aria-describedby': error ? validationId : void 0,
|
|
112
111
|
'aria-errormessage': error ? validationId : void 0,
|
|
113
112
|
'data-slot': 'input-group-control'
|
|
114
|
-
}
|
|
113
|
+
};
|
|
114
|
+
const modeControl = renderModeControl?.(mode, controlProps) ?? null;
|
|
115
115
|
const modeOnMount = (0, external_react_namespaceObject.useRef)(mode);
|
|
116
116
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
117
117
|
if (modeOnMount.current === mode) return;
|
|
@@ -127,7 +127,7 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
127
127
|
}
|
|
128
128
|
if ('Escape' === e.key) {
|
|
129
129
|
e.preventDefault();
|
|
130
|
-
|
|
130
|
+
editableOnValueChange?.(committedRef.current);
|
|
131
131
|
e.currentTarget.blur();
|
|
132
132
|
}
|
|
133
133
|
};
|
|
@@ -149,7 +149,139 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
149
149
|
input.setSelectionRange(next_caret, next_caret);
|
|
150
150
|
});
|
|
151
151
|
};
|
|
152
|
-
const
|
|
152
|
+
const textInputProps = {
|
|
153
|
+
id: fieldId,
|
|
154
|
+
ref: valueInputRef,
|
|
155
|
+
readOnly: !editableOnValueChange,
|
|
156
|
+
disabled,
|
|
157
|
+
value,
|
|
158
|
+
onChange: (e)=>editableOnValueChange?.(e.target.value),
|
|
159
|
+
onFocus: (e)=>{
|
|
160
|
+
committedRef.current = value;
|
|
161
|
+
caretRef.current = {
|
|
162
|
+
start: e.currentTarget.selectionStart ?? value.length,
|
|
163
|
+
end: e.currentTarget.selectionEnd ?? value.length
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
onSelect: (e)=>{
|
|
167
|
+
const el = e.currentTarget;
|
|
168
|
+
caretRef.current = {
|
|
169
|
+
start: el.selectionStart ?? 0,
|
|
170
|
+
end: el.selectionEnd ?? el.selectionStart ?? 0
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
onKeyDown: handleValueKeyDown,
|
|
174
|
+
onBlur: (e)=>{
|
|
175
|
+
caretRef.current = {
|
|
176
|
+
start: e.currentTarget.selectionStart ?? value.length,
|
|
177
|
+
end: e.currentTarget.selectionEnd ?? value.length
|
|
178
|
+
};
|
|
179
|
+
onValueBlur?.();
|
|
180
|
+
},
|
|
181
|
+
placeholder: valuePlaceholder
|
|
182
|
+
};
|
|
183
|
+
const literalControl = 'boolean' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
184
|
+
className: "flex h-full flex-1 items-center px-3",
|
|
185
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_switch_cjs_namespaceObject.Switch, {
|
|
186
|
+
id: fieldId,
|
|
187
|
+
"aria-invalid": controlProps['aria-invalid'],
|
|
188
|
+
"aria-describedby": controlProps['aria-describedby'],
|
|
189
|
+
"aria-errormessage": controlProps['aria-errormessage'],
|
|
190
|
+
checked: 'true' === value,
|
|
191
|
+
onCheckedChange: (checked)=>editableOnValueChange?.(String(checked)),
|
|
192
|
+
onBlur: onValueBlur,
|
|
193
|
+
disabled: !editableOnValueChange
|
|
194
|
+
})
|
|
195
|
+
}) : 'date' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
196
|
+
open: datePopoverOpen,
|
|
197
|
+
onOpenChange: (open)=>{
|
|
198
|
+
setDatePopoverOpen(open);
|
|
199
|
+
if (!open) onValueBlur?.();
|
|
200
|
+
},
|
|
201
|
+
children: [
|
|
202
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
203
|
+
asChild: true,
|
|
204
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
205
|
+
type: "button",
|
|
206
|
+
id: fieldId,
|
|
207
|
+
"data-slot": "input-group-control",
|
|
208
|
+
"aria-invalid": controlProps['aria-invalid'],
|
|
209
|
+
"aria-describedby": controlProps['aria-describedby'],
|
|
210
|
+
"aria-errormessage": controlProps['aria-errormessage'],
|
|
211
|
+
disabled: !editableOnValueChange,
|
|
212
|
+
className: "flex h-full flex-1 items-center text-left text-sm text-foreground outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
213
|
+
children: value ? (0, external_utils_cjs_namespaceObject.formatDateValue)(value) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
214
|
+
className: "text-muted-foreground",
|
|
215
|
+
children: strings.pickDate
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
220
|
+
align: "start",
|
|
221
|
+
className: "w-auto p-0",
|
|
222
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_calendar_cjs_namespaceObject.Calendar, {
|
|
223
|
+
mode: "single",
|
|
224
|
+
selected: (0, date_value_cjs_namespaceObject.toDateValue)(value),
|
|
225
|
+
onSelect: (date)=>editableOnValueChange?.(date ? (0, external_utils_cjs_namespaceObject.toDateOnlyString)(date) : ''),
|
|
226
|
+
initialFocus: true
|
|
227
|
+
})
|
|
228
|
+
})
|
|
229
|
+
]
|
|
230
|
+
}) : 'datetime' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_datetime_picker_cjs_namespaceObject.DateTimePicker, {
|
|
231
|
+
id: fieldId,
|
|
232
|
+
value: (0, date_value_cjs_namespaceObject.toDateValue)(value),
|
|
233
|
+
onValueChange: (date)=>editableOnValueChange?.(date ? date.toISOString() : ''),
|
|
234
|
+
onOpenChange: (open)=>{
|
|
235
|
+
if (!open) onValueBlur?.();
|
|
236
|
+
},
|
|
237
|
+
disabled: !editableOnValueChange,
|
|
238
|
+
placeholder: valuePlaceholder
|
|
239
|
+
}) : 'file' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_file_upload_cjs_namespaceObject.FileUpload, {
|
|
240
|
+
id: fieldId,
|
|
241
|
+
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
242
|
+
className: "flex-1",
|
|
243
|
+
onFilesChange: (files)=>editableOnValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
244
|
+
disabled: !editableOnValueChange,
|
|
245
|
+
onBlur: onValueBlur,
|
|
246
|
+
"aria-invalid": controlProps['aria-invalid'],
|
|
247
|
+
"aria-describedby": controlProps['aria-describedby'],
|
|
248
|
+
"aria-errormessage": controlProps['aria-errormessage']
|
|
249
|
+
}) : 'single-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
|
|
250
|
+
open: selectOpen,
|
|
251
|
+
onOpenChange: (open)=>{
|
|
252
|
+
setSelectOpen(open);
|
|
253
|
+
if (!open && selectOpen) onValueBlur?.();
|
|
254
|
+
},
|
|
255
|
+
value: value || void 0,
|
|
256
|
+
onValueChange: editableOnValueChange,
|
|
257
|
+
disabled: !editableOnValueChange,
|
|
258
|
+
children: [
|
|
259
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
|
|
260
|
+
id: fieldId,
|
|
261
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectValue, {
|
|
262
|
+
placeholder: strings.selectOption
|
|
263
|
+
})
|
|
264
|
+
}),
|
|
265
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectContent, {
|
|
266
|
+
children: options.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
|
|
267
|
+
value: option.value,
|
|
268
|
+
children: option.label
|
|
269
|
+
}, option.value))
|
|
270
|
+
})
|
|
271
|
+
]
|
|
272
|
+
}) : 'multi-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_multi_select_cjs_namespaceObject.MultiSelect, {
|
|
273
|
+
id: fieldId,
|
|
274
|
+
options: options,
|
|
275
|
+
selected: (0, external_utils_cjs_namespaceObject.parseListValue)(value),
|
|
276
|
+
onChange: (selected)=>editableOnValueChange?.(JSON.stringify(selected)),
|
|
277
|
+
placeholder: strings.selectOptions,
|
|
278
|
+
disabled: !editableOnValueChange,
|
|
279
|
+
onBlur: onValueBlur
|
|
280
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
281
|
+
...textInputProps,
|
|
282
|
+
type: 'integer' === fieldType || 'double' === fieldType ? 'number' : 'text',
|
|
283
|
+
step: 'double' === fieldType ? 'any' : void 0
|
|
284
|
+
});
|
|
153
285
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
154
286
|
className: (0, index_cjs_namespaceObject.cn)('@container group flex flex-col gap-1.5 [&>[data-slot=form-field-error]]:mt-0', className),
|
|
155
287
|
children: [
|
|
@@ -163,6 +295,8 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
163
295
|
onFieldTypeChange: onFieldTypeChange,
|
|
164
296
|
onRequiredChange: onRequiredChange,
|
|
165
297
|
compact: compact,
|
|
298
|
+
disabled: disabled,
|
|
299
|
+
isExpression: 'expression' === mode,
|
|
166
300
|
showFieldActions: showFieldActions,
|
|
167
301
|
onValueChange: editableOnValueChange,
|
|
168
302
|
variables: variables,
|
|
@@ -174,224 +308,26 @@ function QuickFormField({ value = '', onValueChange, onValueBlur, locked = true,
|
|
|
174
308
|
headerActions: headerActions,
|
|
175
309
|
strings: strings
|
|
176
310
|
}),
|
|
177
|
-
|
|
311
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
178
312
|
error: error,
|
|
179
313
|
errorId: validationId,
|
|
180
|
-
|
|
314
|
+
disabled: disabled,
|
|
315
|
+
layout: 'literal' === mode && ('file' === fieldType || 'multi-select' === fieldType) ? 'grow' : 'row',
|
|
181
316
|
children: [
|
|
182
317
|
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
183
318
|
align: "inline-start",
|
|
184
319
|
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
185
320
|
locked: locked,
|
|
186
321
|
onLockedChange: onLockedChange,
|
|
322
|
+
disabled: disabled,
|
|
187
323
|
strings: strings
|
|
188
324
|
})
|
|
189
325
|
}),
|
|
190
|
-
modeControl ?? ('expression' ===
|
|
191
|
-
|
|
192
|
-
value,
|
|
193
|
-
onValueChange: editableOnValueChange,
|
|
194
|
-
onBlur: onValueBlur,
|
|
195
|
-
readOnly: !editableOnValueChange,
|
|
196
|
-
placeholder: valuePlaceholder,
|
|
197
|
-
fieldType,
|
|
198
|
-
'aria-invalid': error ? true : void 0,
|
|
199
|
-
'aria-describedby': error ? validationId : void 0,
|
|
200
|
-
'aria-errormessage': error ? validationId : void 0,
|
|
201
|
-
'data-slot': 'input-group-control'
|
|
202
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
203
|
-
id: fieldId,
|
|
204
|
-
ref: valueInputRef,
|
|
205
|
-
readOnly: !editableOnValueChange,
|
|
206
|
-
value: value,
|
|
207
|
-
onChange: (e)=>editableOnValueChange?.(e.target.value),
|
|
208
|
-
onFocus: (e)=>{
|
|
209
|
-
committedRef.current = value;
|
|
210
|
-
caretRef.current = {
|
|
211
|
-
start: e.currentTarget.selectionStart ?? value.length,
|
|
212
|
-
end: e.currentTarget.selectionEnd ?? value.length
|
|
213
|
-
};
|
|
214
|
-
},
|
|
215
|
-
onSelect: (e)=>{
|
|
216
|
-
const el = e.currentTarget;
|
|
217
|
-
caretRef.current = {
|
|
218
|
-
start: el.selectionStart ?? 0,
|
|
219
|
-
end: el.selectionEnd ?? el.selectionStart ?? 0
|
|
220
|
-
};
|
|
221
|
-
},
|
|
222
|
-
onKeyDown: handleValueKeyDown,
|
|
223
|
-
onBlur: (e)=>{
|
|
224
|
-
caretRef.current = {
|
|
225
|
-
start: e.currentTarget.selectionStart ?? value.length,
|
|
226
|
-
end: e.currentTarget.selectionEnd ?? value.length
|
|
227
|
-
};
|
|
228
|
-
onValueBlur?.();
|
|
229
|
-
},
|
|
230
|
-
placeholder: valuePlaceholder,
|
|
326
|
+
modeControl ?? ('expression' === mode ? renderExpressionEditor ? renderExpressionEditor(controlProps) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
327
|
+
...textInputProps,
|
|
231
328
|
className: "font-mono"
|
|
232
|
-
}) :
|
|
233
|
-
|
|
234
|
-
readOnly: true,
|
|
235
|
-
value: lockedDisplayValue,
|
|
236
|
-
placeholder: valuePlaceholder,
|
|
237
|
-
onBlur: onValueBlur
|
|
238
|
-
}) : 'boolean' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
239
|
-
className: "flex h-full flex-1 items-center px-3",
|
|
240
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_switch_cjs_namespaceObject.Switch, {
|
|
241
|
-
id: fieldId,
|
|
242
|
-
"aria-invalid": error ? true : void 0,
|
|
243
|
-
"aria-describedby": error ? validationId : void 0,
|
|
244
|
-
"aria-errormessage": error ? validationId : void 0,
|
|
245
|
-
checked: 'true' === value,
|
|
246
|
-
onCheckedChange: (checked)=>onValueChange?.(String(checked)),
|
|
247
|
-
onBlur: onValueBlur,
|
|
248
|
-
disabled: !onValueChange
|
|
249
|
-
})
|
|
250
|
-
}) : 'date' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_popover_cjs_namespaceObject.Popover, {
|
|
251
|
-
open: datePopoverOpen,
|
|
252
|
-
onOpenChange: (open)=>{
|
|
253
|
-
setDatePopoverOpen(open);
|
|
254
|
-
if (!open) onValueBlur?.();
|
|
255
|
-
},
|
|
256
|
-
children: [
|
|
257
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverTrigger, {
|
|
258
|
-
asChild: true,
|
|
259
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
260
|
-
type: "button",
|
|
261
|
-
id: fieldId,
|
|
262
|
-
"data-slot": "input-group-control",
|
|
263
|
-
"aria-invalid": error ? true : void 0,
|
|
264
|
-
"aria-describedby": error ? validationId : void 0,
|
|
265
|
-
"aria-errormessage": error ? validationId : void 0,
|
|
266
|
-
disabled: !onValueChange,
|
|
267
|
-
className: "flex h-full flex-1 items-center text-left text-sm text-foreground outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
268
|
-
children: value ? (0, external_utils_cjs_namespaceObject.formatDateValue)(value) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
269
|
-
className: "text-muted-foreground",
|
|
270
|
-
children: strings.pickDate
|
|
271
|
-
})
|
|
272
|
-
})
|
|
273
|
-
}),
|
|
274
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_popover_cjs_namespaceObject.PopoverContent, {
|
|
275
|
-
align: "start",
|
|
276
|
-
className: "w-auto p-0",
|
|
277
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_calendar_cjs_namespaceObject.Calendar, {
|
|
278
|
-
mode: "single",
|
|
279
|
-
selected: (0, external_utils_cjs_namespaceObject.parseDateValue)(value),
|
|
280
|
-
onSelect: (date)=>onValueChange?.(date ? (0, external_utils_cjs_namespaceObject.toDateOnlyString)(date) : ''),
|
|
281
|
-
initialFocus: true
|
|
282
|
-
})
|
|
283
|
-
})
|
|
284
|
-
]
|
|
285
|
-
}) : 'datetime' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_datetime_picker_cjs_namespaceObject.DateTimePicker, {
|
|
286
|
-
id: fieldId,
|
|
287
|
-
value: (0, external_utils_cjs_namespaceObject.parseDateValue)(value),
|
|
288
|
-
onValueChange: (date)=>onValueChange?.(date ? date.toISOString() : ''),
|
|
289
|
-
onOpenChange: (open)=>{
|
|
290
|
-
if (!open) onValueBlur?.();
|
|
291
|
-
},
|
|
292
|
-
disabled: !onValueChange,
|
|
293
|
-
placeholder: valuePlaceholder
|
|
294
|
-
}) : 'file' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_file_upload_cjs_namespaceObject.FileUpload, {
|
|
295
|
-
id: fieldId,
|
|
296
|
-
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
297
|
-
className: "flex-1",
|
|
298
|
-
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
299
|
-
disabled: !onValueChange,
|
|
300
|
-
onBlur: onValueBlur,
|
|
301
|
-
"aria-invalid": error ? true : void 0,
|
|
302
|
-
"aria-describedby": error ? validationId : void 0,
|
|
303
|
-
"aria-errormessage": error ? validationId : void 0
|
|
304
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
305
|
-
id: fieldId,
|
|
306
|
-
ref: valueInputRef,
|
|
307
|
-
type: 'integer' === fieldType || 'double' === fieldType ? 'number' : 'text',
|
|
308
|
-
step: 'double' === fieldType ? 'any' : void 0,
|
|
309
|
-
readOnly: !onValueChange,
|
|
310
|
-
value: value,
|
|
311
|
-
onChange: (e)=>onValueChange?.(e.target.value),
|
|
312
|
-
onFocus: (e)=>{
|
|
313
|
-
committedRef.current = value;
|
|
314
|
-
caretRef.current = {
|
|
315
|
-
start: e.currentTarget.selectionStart ?? value.length,
|
|
316
|
-
end: e.currentTarget.selectionEnd ?? value.length
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
onSelect: (e)=>{
|
|
320
|
-
const el = e.currentTarget;
|
|
321
|
-
caretRef.current = {
|
|
322
|
-
start: el.selectionStart ?? 0,
|
|
323
|
-
end: el.selectionEnd ?? el.selectionStart ?? 0
|
|
324
|
-
};
|
|
325
|
-
},
|
|
326
|
-
onKeyDown: handleValueKeyDown,
|
|
327
|
-
onBlur: (e)=>{
|
|
328
|
-
caretRef.current = {
|
|
329
|
-
start: e.currentTarget.selectionStart ?? value.length,
|
|
330
|
-
end: e.currentTarget.selectionEnd ?? value.length
|
|
331
|
-
};
|
|
332
|
-
onValueBlur?.();
|
|
333
|
-
},
|
|
334
|
-
placeholder: valuePlaceholder
|
|
335
|
-
})),
|
|
336
|
-
null !== trailingAddon && (void 0 !== trailingAddon || builtInMenu) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
337
|
-
align: "inline-end",
|
|
338
|
-
className: "cursor-default",
|
|
339
|
-
children: void 0 !== trailingAddon ? trailingAddon : builtInMenu
|
|
340
|
-
})
|
|
341
|
-
]
|
|
342
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
343
|
-
error: error,
|
|
344
|
-
errorId: validationId,
|
|
345
|
-
layout: 'multi-select' !== fieldType || locked ? 'row' : 'grow',
|
|
346
|
-
children: [
|
|
347
|
-
(showLock || void 0 !== leadingAddon) && null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
348
|
-
align: "inline-start",
|
|
349
|
-
children: void 0 !== leadingAddon ? leadingAddon : showLock && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
350
|
-
locked: locked,
|
|
351
|
-
onLockedChange: onLockedChange,
|
|
352
|
-
strings: strings
|
|
353
|
-
})
|
|
354
|
-
}),
|
|
355
|
-
modeControl ?? (locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
356
|
-
id: fieldId,
|
|
357
|
-
readOnly: true,
|
|
358
|
-
value: lockedDisplayValue,
|
|
359
|
-
placeholder: valuePlaceholder,
|
|
360
|
-
className: "min-w-0",
|
|
361
|
-
onBlur: onValueBlur
|
|
362
|
-
}) : 'single-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
|
|
363
|
-
open: selectOpen,
|
|
364
|
-
onOpenChange: (open)=>{
|
|
365
|
-
setSelectOpen(open);
|
|
366
|
-
if (!open && selectOpen) onValueBlur?.();
|
|
367
|
-
},
|
|
368
|
-
value: value || void 0,
|
|
369
|
-
onValueChange: onValueChange,
|
|
370
|
-
disabled: !onValueChange,
|
|
371
|
-
children: [
|
|
372
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
|
|
373
|
-
id: fieldId,
|
|
374
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectValue, {
|
|
375
|
-
placeholder: strings.selectOption
|
|
376
|
-
})
|
|
377
|
-
}),
|
|
378
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectContent, {
|
|
379
|
-
children: options.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
|
|
380
|
-
value: option.value,
|
|
381
|
-
children: option.label
|
|
382
|
-
}, option.value))
|
|
383
|
-
})
|
|
384
|
-
]
|
|
385
|
-
}) : 'multi-select' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_multi_select_cjs_namespaceObject.MultiSelect, {
|
|
386
|
-
id: fieldId,
|
|
387
|
-
options: options,
|
|
388
|
-
selected: (0, external_utils_cjs_namespaceObject.parseListValue)(value),
|
|
389
|
-
onChange: (selected)=>onValueChange?.(JSON.stringify(selected)),
|
|
390
|
-
placeholder: strings.selectOptions,
|
|
391
|
-
disabled: !onValueChange,
|
|
392
|
-
onBlur: onValueBlur
|
|
393
|
-
}) : null),
|
|
394
|
-
null !== trailingAddon && (void 0 !== trailingAddon || builtInMenu) && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
329
|
+
}) : literalControl),
|
|
330
|
+
null !== trailingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
395
331
|
align: "inline-end",
|
|
396
332
|
className: "cursor-default",
|
|
397
333
|
children: void 0 !== trailingAddon ? trailingAddon : builtInMenu
|
|
@@ -2,9 +2,9 @@ import type { QuickFormFieldProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* A Quick Form is assembled by end users, like a form builder. QuickFormField is
|
|
4
4
|
* the control for an individual field within it, and carries its own
|
|
5
|
-
* configuration controls: a lock that
|
|
6
|
-
* that swaps the control, a Required toggle, and
|
|
7
|
-
* `literal`, `expression`, `variable` and `prompt`.
|
|
5
|
+
* configuration controls: a lock that marks it read-only for the person filling
|
|
6
|
+
* in the form, a data-type switch that swaps the control, a Required toggle, and
|
|
7
|
+
* a value-mode switch across `literal`, `expression`, `variable` and `prompt`.
|
|
8
8
|
*
|
|
9
9
|
* Only use it within a quick form builder. For standard forms, compose the
|
|
10
10
|
* form-field anatomy (`FormField`, `FormFieldLabel`, `InputGroup`, …) or
|
|
@@ -12,6 +12,8 @@ import type { QuickFormFieldProps } from './types';
|
|
|
12
12
|
*
|
|
13
13
|
* - Literal and expression have built-in controls; `renderModeControl`
|
|
14
14
|
* supplies the control for any mode, and `variable` / `prompt` need it.
|
|
15
|
+
* - `locked` is configuration the author sets, so the value stays editable;
|
|
16
|
+
* `disabled` is what stops the author editing the field.
|
|
15
17
|
* - `fieldTypes` chooses which types the picker offers.
|
|
16
18
|
* - Insert variable renders `variables` as supplied and splices at the caret;
|
|
17
19
|
* `onInsertVariable` takes over what inserting means.
|
|
@@ -23,4 +25,4 @@ import type { QuickFormFieldProps } from './types';
|
|
|
23
25
|
* AI-assist button renders only with `onGenerateWithAi`, and file uploads
|
|
24
26
|
* aren't persisted anywhere.
|
|
25
27
|
*/
|
|
26
|
-
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, leadingAddon, trailingAddon, more, mode, onModeChange, renderExpressionEditor, renderModeControl, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function QuickFormField({ value, onValueChange, onValueBlur, locked, onLockedChange, showLock, disabled, leadingAddon, trailingAddon, more, mode, onModeChange, renderExpressionEditor, renderModeControl, fieldType, fieldTypes, onFieldTypeChange, required, onRequiredChange, label, strings: stringOverrides, placeholder, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, showFieldActions, options, onGenerateWithAi, onInsertVariable, variables, id, className, }: QuickFormFieldProps): import("react/jsx-runtime").JSX.Element;
|