@uipath/apollo-wind 2.58.0 → 2.60.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/ui/datetime-picker.cjs +19 -3
- package/dist/components/ui/datetime-picker.d.ts +2 -0
- package/dist/components/ui/datetime-picker.js +19 -3
- package/dist/components/ui/field-actions/insert-variable-action.cjs +1 -1
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +5 -2
- package/dist/components/ui/field-actions/insert-variable-action.js +1 -1
- package/dist/components/ui/field-addons/field-menu.cjs +2 -2
- package/dist/components/ui/field-addons/field-menu.d.ts +4 -2
- package/dist/components/ui/field-addons/field-menu.js +2 -2
- package/dist/components/ui/index.cjs +295 -217
- package/dist/components/ui/index.d.ts +3 -2
- package/dist/components/ui/index.js +3 -2
- package/dist/components/ui/lockable-value-field/index.cjs +5 -5
- package/dist/components/ui/lockable-value-field/index.d.ts +18 -3
- package/dist/components/ui/lockable-value-field/index.js +2 -2
- package/dist/components/ui/quick-form-field/components/field-header.cjs +265 -0
- package/dist/components/ui/quick-form-field/components/field-header.d.ts +23 -0
- package/dist/components/ui/quick-form-field/components/field-header.js +231 -0
- package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.cjs +3 -3
- package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.d.ts +4 -1
- package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.js +3 -3
- package/dist/components/ui/quick-form-field/index.cjs +46 -0
- package/dist/components/ui/quick-form-field/index.d.ts +3 -0
- package/dist/components/ui/quick-form-field/index.js +3 -0
- package/dist/components/ui/{lockable-value-field/lockable-value-field.cjs → quick-form-field/quick-form-field.cjs} +190 -119
- package/dist/components/ui/quick-form-field/quick-form-field.d.ts +26 -0
- package/dist/components/ui/{lockable-value-field/lockable-value-field.js → quick-form-field/quick-form-field.js} +194 -123
- package/dist/components/ui/{lockable-value-field → quick-form-field}/types.cjs +70 -0
- package/dist/components/ui/quick-form-field/types.d.ts +245 -0
- package/dist/components/ui/quick-form-field/types.js +137 -0
- package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.cjs +21 -3
- package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.d.ts +8 -3
- package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.js +19 -4
- package/dist/components/ui/tree-view.cjs +6 -2
- package/dist/components/ui/tree-view.d.ts +35 -21
- package/dist/components/ui/tree-view.js +4 -3
- package/dist/index.cjs +14 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +4 -3
- package/package.json +1 -1
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +0 -242
- package/dist/components/ui/lockable-value-field/components/field-header.d.ts +0 -19
- package/dist/components/ui/lockable-value-field/components/field-header.js +0 -208
- package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +0 -14
- package/dist/components/ui/lockable-value-field/types.d.ts +0 -109
- package/dist/components/ui/lockable-value-field/types.js +0 -70
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
import type { AriaAttributes, ReactNode } from 'react';
|
|
3
|
+
import type { ValueMode } from '../field-addons/value-mode-strings';
|
|
4
|
+
export type QuickFormFieldMode = ValueMode;
|
|
5
|
+
export type QuickFieldType = 'string' | 'integer' | 'double' | 'date' | 'datetime' | 'boolean' | 'single-select' | 'multi-select' | 'array' | 'file' | 'object';
|
|
6
|
+
interface FieldTypeMeta {
|
|
7
|
+
label: string;
|
|
8
|
+
icon: LucideIcon;
|
|
9
|
+
supportsExpression: boolean;
|
|
10
|
+
fixedLabel: string;
|
|
11
|
+
fixedDescription: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const FIELD_TYPE_META: Record<QuickFieldType, FieldTypeMeta>;
|
|
14
|
+
export declare const FIELD_TYPE_ORDER: QuickFieldType[];
|
|
15
|
+
/**
|
|
16
|
+
* Every piece of user-visible text the component renders. The component owns no
|
|
17
|
+
* translation catalog, so a localized consumer supplies its own words; the
|
|
18
|
+
* defaults are English.
|
|
19
|
+
*
|
|
20
|
+
* Type labels live here rather than in FIELD_TYPE_META: the meta table defines
|
|
21
|
+
* the vocabulary, these are display strings.
|
|
22
|
+
*/
|
|
23
|
+
export interface QuickFormFieldStrings {
|
|
24
|
+
fieldTypeTooltip: string;
|
|
25
|
+
fieldTypeAriaLabel: string;
|
|
26
|
+
typeLabels: Partial<Record<QuickFieldType, string>>;
|
|
27
|
+
/** The literal mode item's label per type; falls back to FIELD_TYPE_META's `fixedLabel`. */
|
|
28
|
+
literalLabels: Partial<Record<QuickFieldType, string>>;
|
|
29
|
+
/** The literal mode item's description per type; falls back to FIELD_TYPE_META's `fixedDescription`. */
|
|
30
|
+
literalDescriptions: Partial<Record<QuickFieldType, string>>;
|
|
31
|
+
/** The computed field name in literal mode, from the (localized) type label. */
|
|
32
|
+
valueFieldLabel: (typeLabel: string) => string;
|
|
33
|
+
/** The computed field name in expression mode, from the (localized) type label. */
|
|
34
|
+
expressionFieldLabel: (typeLabel: string) => string;
|
|
35
|
+
/** A locked boolean's displayed text. */
|
|
36
|
+
trueLabel: string;
|
|
37
|
+
falseLabel: string;
|
|
38
|
+
requiredTooltip: string;
|
|
39
|
+
requiredAriaLabel: string;
|
|
40
|
+
optionalAriaLabel: string;
|
|
41
|
+
insertLabel: string;
|
|
42
|
+
insertAriaLabel: string;
|
|
43
|
+
/** The variable picker's search box. */
|
|
44
|
+
insertSearchPlaceholder: string;
|
|
45
|
+
/** The variable picker with nothing to show. */
|
|
46
|
+
insertEmpty: string;
|
|
47
|
+
valueModeAriaLabel: string;
|
|
48
|
+
expressionLabel: string;
|
|
49
|
+
expressionDescription: string;
|
|
50
|
+
pickDate: string;
|
|
51
|
+
selectOption: string;
|
|
52
|
+
selectOptions: string;
|
|
53
|
+
moreActionsAriaLabel: string;
|
|
54
|
+
clearValue: string;
|
|
55
|
+
forceRefresh: string;
|
|
56
|
+
aiAssistAriaLabel: string;
|
|
57
|
+
aiAssistTooltip: string;
|
|
58
|
+
aiPromptLabel: string;
|
|
59
|
+
aiPromptPlaceholder: string;
|
|
60
|
+
aiGenerate: string;
|
|
61
|
+
/** Replaces `aiGenerate` while a returned promise is pending. */
|
|
62
|
+
aiGenerating: string;
|
|
63
|
+
/** Shown when a returned promise rejects. */
|
|
64
|
+
aiError: string;
|
|
65
|
+
/** What the AI produces for the field, from the (localized) type label. */
|
|
66
|
+
aiOutputLabel: (typeLabel: string, isExpression: boolean) => string;
|
|
67
|
+
aiOutputHint: (output: string) => string;
|
|
68
|
+
lockedLabel: string;
|
|
69
|
+
unlockedLabel: string;
|
|
70
|
+
lockedHint: string;
|
|
71
|
+
unlockedHint: string;
|
|
72
|
+
}
|
|
73
|
+
export declare const DEFAULT_QUICK_FORM_FIELD_STRINGS: QuickFormFieldStrings;
|
|
74
|
+
export interface QuickFormFieldOption {
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
/**
|
|
78
|
+
* Nested entries for the Insert-variable tree, rendered as supplied. Only the
|
|
79
|
+
* consumer knows whether the path a grouping implies is real, so the tree
|
|
80
|
+
* invents neither a root nor a type.
|
|
81
|
+
*/
|
|
82
|
+
children?: QuickFormFieldOption[];
|
|
83
|
+
/** Type badge shown against the entry. */
|
|
84
|
+
type?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface QuickFormFieldMoreActions {
|
|
87
|
+
onClear?: () => void;
|
|
88
|
+
onRefresh?: () => void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Where the caret was when a variable was chosen, so the consumer can splice
|
|
92
|
+
* rather than append. The component tracks it because it owns the input;
|
|
93
|
+
* `caret` is null when the author has not placed one, which means "append".
|
|
94
|
+
*/
|
|
95
|
+
export interface VariableInsertContext {
|
|
96
|
+
value: string;
|
|
97
|
+
caret: {
|
|
98
|
+
start: number;
|
|
99
|
+
end: number;
|
|
100
|
+
} | null;
|
|
101
|
+
}
|
|
102
|
+
export interface QuickFormFieldProps {
|
|
103
|
+
/** Current field value. Encoding depends on fieldType (e.g. multi-select is a JSON array string). */
|
|
104
|
+
value?: string;
|
|
105
|
+
/** Called when the user edits the value (only fires while unlocked). */
|
|
106
|
+
onValueChange?: (value: string) => void;
|
|
107
|
+
/** Called when the active value control loses focus. */
|
|
108
|
+
onValueBlur?: () => void;
|
|
109
|
+
/** Whether the field is read-only. Defaults to true. */
|
|
110
|
+
locked?: boolean;
|
|
111
|
+
/** Called when the user toggles the lock. */
|
|
112
|
+
onLockedChange?: (locked: boolean) => void;
|
|
113
|
+
/** Whether the built-in lock control renders. Defaults to true. */
|
|
114
|
+
showLock?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Replaces the leading lock toggle with a semantic prefix such as `=`.
|
|
117
|
+
* Pass `null` to suppress the built-in toggle; omitting the prop preserves it.
|
|
118
|
+
*/
|
|
119
|
+
leadingAddon?: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* Replaces the trailing fixed/expression menu with a consumer-provided action
|
|
122
|
+
* for expression-capable field types. Pass `null` to suppress the built-in
|
|
123
|
+
* menu; omitting the prop preserves it.
|
|
124
|
+
*/
|
|
125
|
+
trailingAddon?: ReactNode;
|
|
126
|
+
/** Adds a field-level overflow menu beside the value control. */
|
|
127
|
+
more?: QuickFormFieldMoreActions;
|
|
128
|
+
/** How the value is expressed. Defaults to 'literal'; `expression` falls back to `literal` for types that cannot hold one. */
|
|
129
|
+
mode?: QuickFormFieldMode;
|
|
130
|
+
/** Called when the user switches modes. */
|
|
131
|
+
onModeChange?: (mode: QuickFormFieldMode) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Optional expression editor used in place of the built-in monospace input.
|
|
134
|
+
* Consumers can use this to supply a syntax-aware editor such as Monaco.
|
|
135
|
+
*
|
|
136
|
+
* Superseded by `renderModeControl`, which covers every mode. Kept for
|
|
137
|
+
* existing callers; `renderModeControl` wins when both are supplied and it
|
|
138
|
+
* returns something for `expression`.
|
|
139
|
+
*/
|
|
140
|
+
renderExpressionEditor?: (props: {
|
|
141
|
+
id: string;
|
|
142
|
+
value: string;
|
|
143
|
+
onValueChange?: (value: string) => void;
|
|
144
|
+
onBlur?: () => void;
|
|
145
|
+
readOnly: boolean;
|
|
146
|
+
placeholder: string;
|
|
147
|
+
fieldType: QuickFieldType;
|
|
148
|
+
'aria-invalid'?: AriaAttributes['aria-invalid'];
|
|
149
|
+
'aria-describedby'?: string;
|
|
150
|
+
'aria-errormessage'?: string;
|
|
151
|
+
'data-slot'?: string;
|
|
152
|
+
}) => ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* Renders the value control for a given mode, replacing the built-in one.
|
|
155
|
+
* `variable` and `prompt` have no built-in editor, and a surface that authors
|
|
156
|
+
* its own choices can replace the `literal` control too.
|
|
157
|
+
*
|
|
158
|
+
* Returning nothing (or omitting this) falls back to the built-in control
|
|
159
|
+
* for the field's type, so an unhandled mode degrades to the literal editor
|
|
160
|
+
* rather than rendering an empty row.
|
|
161
|
+
*/
|
|
162
|
+
renderModeControl?: (mode: QuickFormFieldMode, props: {
|
|
163
|
+
id: string;
|
|
164
|
+
value: string;
|
|
165
|
+
onValueChange?: (value: string) => void;
|
|
166
|
+
onBlur?: () => void;
|
|
167
|
+
readOnly: boolean;
|
|
168
|
+
placeholder: string;
|
|
169
|
+
fieldType: QuickFieldType;
|
|
170
|
+
'aria-invalid'?: AriaAttributes['aria-invalid'];
|
|
171
|
+
'aria-describedby'?: string;
|
|
172
|
+
'aria-errormessage'?: string;
|
|
173
|
+
'data-slot'?: string;
|
|
174
|
+
}) => ReactNode;
|
|
175
|
+
/**
|
|
176
|
+
* Takes over what choosing a variable does to the value. The component owns
|
|
177
|
+
* the picker and hands back the chosen entry exactly as supplied in
|
|
178
|
+
* `variables`, with the caret.
|
|
179
|
+
*
|
|
180
|
+
* A value that is one reference must be replaced rather than appended, and a
|
|
181
|
+
* variable may carry its type onto the field, so the consumer decides. Omit
|
|
182
|
+
* to splice at the caret, or append when no caret has been placed.
|
|
183
|
+
*/
|
|
184
|
+
onInsertVariable?: (variable: QuickFormFieldOption,
|
|
185
|
+
/**
|
|
186
|
+
* Where the caret was, so the consumer can splice rather than append.
|
|
187
|
+
* The component tracks this because it owns the input; `caret` is null
|
|
188
|
+
* when the author has not placed one, which means "append".
|
|
189
|
+
*/
|
|
190
|
+
context: VariableInsertContext) => void;
|
|
191
|
+
/** The field's data type. Defaults to 'string'. Determines which control renders the value. */
|
|
192
|
+
fieldType?: QuickFieldType;
|
|
193
|
+
/**
|
|
194
|
+
* Which types the picker offers, in display order. Defaults to
|
|
195
|
+
* `FIELD_TYPE_ORDER`, every type the component can render; a surface with a
|
|
196
|
+
* narrower vocabulary of its own offers fewer.
|
|
197
|
+
*/
|
|
198
|
+
fieldTypes?: readonly QuickFieldType[];
|
|
199
|
+
/** Called when the user switches the field type. */
|
|
200
|
+
onFieldTypeChange?: (fieldType: QuickFieldType) => void;
|
|
201
|
+
/** Shows a required-field asterisk next to the default label. Ignored when `label` is provided. */
|
|
202
|
+
required?: boolean;
|
|
203
|
+
/** Called when the user toggles required/optional. Renders the Required switch when provided. */
|
|
204
|
+
onRequiredChange?: (required: boolean) => void;
|
|
205
|
+
/** Overrides the default mode-based label (e.g. a field name instead of "String value"). */
|
|
206
|
+
label?: ReactNode;
|
|
207
|
+
/**
|
|
208
|
+
* Overrides the placeholder on the value control. The computed default names
|
|
209
|
+
* only the type; the accessible label still falls back to it.
|
|
210
|
+
*/
|
|
211
|
+
placeholder?: string;
|
|
212
|
+
/** Overrides for any subset of the user-visible text; see QuickFormFieldStrings. */
|
|
213
|
+
strings?: Partial<QuickFormFieldStrings>;
|
|
214
|
+
/** Field-specific validation feedback rendered immediately below the active control. */
|
|
215
|
+
error?: ReactNode;
|
|
216
|
+
/** Optional id for the inline validation message. */
|
|
217
|
+
errorId?: string;
|
|
218
|
+
/** Content rendered below the value control, such as a related checkbox or help text. */
|
|
219
|
+
belowValue?: ReactNode;
|
|
220
|
+
/** Accessible name for the file-upload dropzone. Defaults to a string `label`, then the computed field label. */
|
|
221
|
+
fileUploadAriaLabel?: string;
|
|
222
|
+
/** Extra content rendered after the built-in AI assist / Insert variable buttons (e.g. a delete button). */
|
|
223
|
+
headerActions?: ReactNode;
|
|
224
|
+
/** Forces the header row into its narrow-container icon-only layout, regardless of actual width. For demos/comparisons. */
|
|
225
|
+
compact?: boolean;
|
|
226
|
+
/** Whether the AI-assist and Insert-variable actions render at all. Set to false for read-only reviewer contexts where field configuration isn't editable. Defaults to true. */
|
|
227
|
+
showFieldActions?: boolean;
|
|
228
|
+
/** Options for 'single-select' / 'multi-select' field types. Defaults to a small set of demo options. */
|
|
229
|
+
options?: QuickFormFieldOption[];
|
|
230
|
+
/**
|
|
231
|
+
* Called with the entered prompt when the user clicks Generate.
|
|
232
|
+
*
|
|
233
|
+
* Its presence also decides whether the AI-assist button renders: without a
|
|
234
|
+
* handler the button would have nothing to do.
|
|
235
|
+
*/
|
|
236
|
+
onGenerateWithAi?: (prompt: string) => void;
|
|
237
|
+
/**
|
|
238
|
+
* Variables offered by the "Insert variable" popover; clicking one appends its value to the
|
|
239
|
+
* current value. The button is disabled when this is empty (the default).
|
|
240
|
+
*/
|
|
241
|
+
variables?: QuickFormFieldOption[];
|
|
242
|
+
id?: string;
|
|
243
|
+
className?: string;
|
|
244
|
+
}
|
|
245
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ALargeSmall, Braces, Brackets, Calendar, CalendarClock, File, Hash, List, ListChecks, Sigma, ToggleLeft } from "lucide-react";
|
|
2
|
+
const FIELD_TYPE_META = {
|
|
3
|
+
string: {
|
|
4
|
+
label: 'String',
|
|
5
|
+
icon: ALargeSmall,
|
|
6
|
+
supportsExpression: true,
|
|
7
|
+
fixedLabel: 'Fixed value',
|
|
8
|
+
fixedDescription: 'Use a literal string value'
|
|
9
|
+
},
|
|
10
|
+
integer: {
|
|
11
|
+
label: 'Integer',
|
|
12
|
+
icon: Hash,
|
|
13
|
+
supportsExpression: true,
|
|
14
|
+
fixedLabel: 'Fixed value',
|
|
15
|
+
fixedDescription: 'Use a literal number value'
|
|
16
|
+
},
|
|
17
|
+
double: {
|
|
18
|
+
label: 'Decimal number',
|
|
19
|
+
icon: Sigma,
|
|
20
|
+
supportsExpression: true,
|
|
21
|
+
fixedLabel: 'Fixed value',
|
|
22
|
+
fixedDescription: 'Use a literal decimal value'
|
|
23
|
+
},
|
|
24
|
+
date: {
|
|
25
|
+
label: 'Date',
|
|
26
|
+
icon: Calendar,
|
|
27
|
+
supportsExpression: true,
|
|
28
|
+
fixedLabel: 'Fixed date',
|
|
29
|
+
fixedDescription: 'Use a literal date value'
|
|
30
|
+
},
|
|
31
|
+
datetime: {
|
|
32
|
+
label: 'Date and time',
|
|
33
|
+
icon: CalendarClock,
|
|
34
|
+
supportsExpression: true,
|
|
35
|
+
fixedLabel: 'Fixed date and time',
|
|
36
|
+
fixedDescription: 'Use a literal date and time value'
|
|
37
|
+
},
|
|
38
|
+
boolean: {
|
|
39
|
+
label: 'Boolean',
|
|
40
|
+
icon: ToggleLeft,
|
|
41
|
+
supportsExpression: true,
|
|
42
|
+
fixedLabel: 'Fixed value',
|
|
43
|
+
fixedDescription: 'Use a literal true or false value'
|
|
44
|
+
},
|
|
45
|
+
'single-select': {
|
|
46
|
+
label: 'Single select',
|
|
47
|
+
icon: List,
|
|
48
|
+
supportsExpression: false,
|
|
49
|
+
fixedLabel: 'Fixed value',
|
|
50
|
+
fixedDescription: 'Choose one option'
|
|
51
|
+
},
|
|
52
|
+
'multi-select': {
|
|
53
|
+
label: 'Multi select',
|
|
54
|
+
icon: ListChecks,
|
|
55
|
+
supportsExpression: false,
|
|
56
|
+
fixedLabel: 'Fixed value',
|
|
57
|
+
fixedDescription: 'Choose one or more options'
|
|
58
|
+
},
|
|
59
|
+
array: {
|
|
60
|
+
label: 'Array',
|
|
61
|
+
icon: Brackets,
|
|
62
|
+
supportsExpression: true,
|
|
63
|
+
fixedLabel: 'Fixed value',
|
|
64
|
+
fixedDescription: 'Use a literal JSON array'
|
|
65
|
+
},
|
|
66
|
+
file: {
|
|
67
|
+
label: 'File',
|
|
68
|
+
icon: File,
|
|
69
|
+
supportsExpression: true,
|
|
70
|
+
fixedLabel: 'Fixed value',
|
|
71
|
+
fixedDescription: 'Upload a file'
|
|
72
|
+
},
|
|
73
|
+
object: {
|
|
74
|
+
label: 'Object',
|
|
75
|
+
icon: Braces,
|
|
76
|
+
supportsExpression: true,
|
|
77
|
+
fixedLabel: 'Fixed value',
|
|
78
|
+
fixedDescription: 'Use a literal object value'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const FIELD_TYPE_ORDER = [
|
|
82
|
+
'string',
|
|
83
|
+
'integer',
|
|
84
|
+
'double',
|
|
85
|
+
'date',
|
|
86
|
+
'datetime',
|
|
87
|
+
'boolean',
|
|
88
|
+
'single-select',
|
|
89
|
+
'multi-select',
|
|
90
|
+
'array',
|
|
91
|
+
'file',
|
|
92
|
+
'object'
|
|
93
|
+
];
|
|
94
|
+
const DEFAULT_QUICK_FORM_FIELD_STRINGS = {
|
|
95
|
+
fieldTypeTooltip: 'Type',
|
|
96
|
+
fieldTypeAriaLabel: 'Field type',
|
|
97
|
+
typeLabels: {},
|
|
98
|
+
literalLabels: {},
|
|
99
|
+
literalDescriptions: {},
|
|
100
|
+
valueFieldLabel: (typeLabel)=>`${typeLabel} value`,
|
|
101
|
+
expressionFieldLabel: (typeLabel)=>{
|
|
102
|
+
const type = typeLabel.toLowerCase();
|
|
103
|
+
return `Write ${/^[aeiou]/.test(type) ? 'an' : 'a'} ${type} expression`;
|
|
104
|
+
},
|
|
105
|
+
trueLabel: 'True',
|
|
106
|
+
falseLabel: 'False',
|
|
107
|
+
requiredTooltip: 'Required',
|
|
108
|
+
requiredAriaLabel: 'Required field',
|
|
109
|
+
optionalAriaLabel: 'Optional field',
|
|
110
|
+
insertLabel: 'Insert',
|
|
111
|
+
insertAriaLabel: 'Insert variable',
|
|
112
|
+
insertSearchPlaceholder: 'Search variables...',
|
|
113
|
+
insertEmpty: 'No variables found.',
|
|
114
|
+
valueModeAriaLabel: 'Choose value mode',
|
|
115
|
+
expressionLabel: 'Expression',
|
|
116
|
+
expressionDescription: 'Use a JS expression',
|
|
117
|
+
pickDate: 'Pick a date',
|
|
118
|
+
selectOption: 'Select an option',
|
|
119
|
+
selectOptions: 'Select options...',
|
|
120
|
+
moreActionsAriaLabel: 'More value actions',
|
|
121
|
+
clearValue: 'Clear value',
|
|
122
|
+
forceRefresh: 'Force refresh',
|
|
123
|
+
aiAssistAriaLabel: 'AI assist',
|
|
124
|
+
aiAssistTooltip: 'Generate with AI',
|
|
125
|
+
aiPromptLabel: 'Describe what you want',
|
|
126
|
+
aiPromptPlaceholder: 'Display a value from the previous step',
|
|
127
|
+
aiGenerate: 'Generate',
|
|
128
|
+
aiGenerating: 'Generating',
|
|
129
|
+
aiError: 'Could not generate a value. Try again.',
|
|
130
|
+
aiOutputLabel: (typeLabel, isExpression)=>`${typeLabel} ${isExpression ? 'expression' : 'value'}`,
|
|
131
|
+
aiOutputHint: (output)=>`Output: ${output}`,
|
|
132
|
+
lockedLabel: 'Read-only',
|
|
133
|
+
unlockedLabel: 'Editable',
|
|
134
|
+
lockedHint: 'Read-only. Click to make editable.',
|
|
135
|
+
unlockedHint: 'Editable. Click to make read-only.'
|
|
136
|
+
};
|
|
137
|
+
export { DEFAULT_QUICK_FORM_FIELD_STRINGS, FIELD_TYPE_META, FIELD_TYPE_ORDER };
|
|
@@ -25,6 +25,7 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
DEFAULT_SELECT_OPTIONS: ()=>DEFAULT_SELECT_OPTIONS,
|
|
28
|
+
formatDateTimeValue: ()=>formatDateTimeValue,
|
|
28
29
|
formatDateValue: ()=>formatDateValue,
|
|
29
30
|
getLockedDisplayValue: ()=>getLockedDisplayValue,
|
|
30
31
|
parseDateValue: ()=>parseDateValue,
|
|
@@ -78,14 +79,29 @@ function formatDateValue(value) {
|
|
|
78
79
|
day: 'numeric'
|
|
79
80
|
}) : value;
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function formatDateTimeValue(value) {
|
|
83
|
+
const date = parseDateValue(value);
|
|
84
|
+
return date ? date.toLocaleString(void 0, {
|
|
85
|
+
year: 'numeric',
|
|
86
|
+
month: 'long',
|
|
87
|
+
day: 'numeric',
|
|
88
|
+
hour: 'numeric',
|
|
89
|
+
minute: '2-digit'
|
|
90
|
+
}) : value;
|
|
91
|
+
}
|
|
92
|
+
function getLockedDisplayValue(fieldType, value, options, booleanLabels = {
|
|
93
|
+
trueLabel: 'True',
|
|
94
|
+
falseLabel: 'False'
|
|
95
|
+
}) {
|
|
82
96
|
switch(fieldType){
|
|
83
97
|
case 'boolean':
|
|
84
|
-
if ('true' === value) return
|
|
85
|
-
if ('false' === value) return
|
|
98
|
+
if ('true' === value) return booleanLabels.trueLabel;
|
|
99
|
+
if ('false' === value) return booleanLabels.falseLabel;
|
|
86
100
|
return '';
|
|
87
101
|
case 'date':
|
|
88
102
|
return value ? formatDateValue(value) : '';
|
|
103
|
+
case 'datetime':
|
|
104
|
+
return value ? formatDateTimeValue(value) : '';
|
|
89
105
|
case 'single-select':
|
|
90
106
|
return options.find((option)=>option.value === value)?.label ?? value;
|
|
91
107
|
case 'multi-select':
|
|
@@ -99,6 +115,7 @@ function getLockedDisplayValue(fieldType, value, options) {
|
|
|
99
115
|
}
|
|
100
116
|
}
|
|
101
117
|
exports.DEFAULT_SELECT_OPTIONS = __webpack_exports__.DEFAULT_SELECT_OPTIONS;
|
|
118
|
+
exports.formatDateTimeValue = __webpack_exports__.formatDateTimeValue;
|
|
102
119
|
exports.formatDateValue = __webpack_exports__.formatDateValue;
|
|
103
120
|
exports.getLockedDisplayValue = __webpack_exports__.getLockedDisplayValue;
|
|
104
121
|
exports.parseDateValue = __webpack_exports__.parseDateValue;
|
|
@@ -106,6 +123,7 @@ exports.parseListValue = __webpack_exports__.parseListValue;
|
|
|
106
123
|
exports.toDateOnlyString = __webpack_exports__.toDateOnlyString;
|
|
107
124
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
108
125
|
"DEFAULT_SELECT_OPTIONS",
|
|
126
|
+
"formatDateTimeValue",
|
|
109
127
|
"formatDateValue",
|
|
110
128
|
"getLockedDisplayValue",
|
|
111
129
|
"parseDateValue",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const DEFAULT_SELECT_OPTIONS:
|
|
1
|
+
import type { QuickFieldType, QuickFormFieldOption } from './types';
|
|
2
|
+
export declare const DEFAULT_SELECT_OPTIONS: QuickFormFieldOption[];
|
|
3
3
|
export declare function parseListValue(value: string): string[];
|
|
4
4
|
/**
|
|
5
5
|
* Parses a date field's stored value, returning undefined for empty or invalid input.
|
|
@@ -15,10 +15,15 @@ export declare function parseDateValue(value: string): Date | undefined;
|
|
|
15
15
|
export declare function toDateOnlyString(date: Date): string;
|
|
16
16
|
/** Formats a date field's value for display, falling back to the raw value if it isn't a valid date. */
|
|
17
17
|
export declare function formatDateValue(value: string): string;
|
|
18
|
+
/** Formats a datetime field's value, falling back to the raw value when unparseable. */
|
|
19
|
+
export declare function formatDateTimeValue(value: string): string;
|
|
18
20
|
/**
|
|
19
21
|
* Computes the plain-text shown in place of the real control once a field is locked.
|
|
20
22
|
* Boolean/single-select/multi-select resolve their stored value to a display label;
|
|
21
23
|
* everything else (including an invalid date, so the component never throws on
|
|
22
24
|
* external input) falls back to the raw value.
|
|
23
25
|
*/
|
|
24
|
-
export declare function getLockedDisplayValue(fieldType:
|
|
26
|
+
export declare function getLockedDisplayValue(fieldType: QuickFieldType, value: string, options: QuickFormFieldOption[], booleanLabels?: {
|
|
27
|
+
trueLabel: string;
|
|
28
|
+
falseLabel: string;
|
|
29
|
+
}): string;
|
|
@@ -45,14 +45,29 @@ function formatDateValue(value) {
|
|
|
45
45
|
day: 'numeric'
|
|
46
46
|
}) : value;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function formatDateTimeValue(value) {
|
|
49
|
+
const date = parseDateValue(value);
|
|
50
|
+
return date ? date.toLocaleString(void 0, {
|
|
51
|
+
year: 'numeric',
|
|
52
|
+
month: 'long',
|
|
53
|
+
day: 'numeric',
|
|
54
|
+
hour: 'numeric',
|
|
55
|
+
minute: '2-digit'
|
|
56
|
+
}) : value;
|
|
57
|
+
}
|
|
58
|
+
function getLockedDisplayValue(fieldType, value, options, booleanLabels = {
|
|
59
|
+
trueLabel: 'True',
|
|
60
|
+
falseLabel: 'False'
|
|
61
|
+
}) {
|
|
49
62
|
switch(fieldType){
|
|
50
63
|
case 'boolean':
|
|
51
|
-
if ('true' === value) return
|
|
52
|
-
if ('false' === value) return
|
|
64
|
+
if ('true' === value) return booleanLabels.trueLabel;
|
|
65
|
+
if ('false' === value) return booleanLabels.falseLabel;
|
|
53
66
|
return '';
|
|
54
67
|
case 'date':
|
|
55
68
|
return value ? formatDateValue(value) : '';
|
|
69
|
+
case 'datetime':
|
|
70
|
+
return value ? formatDateTimeValue(value) : '';
|
|
56
71
|
case 'single-select':
|
|
57
72
|
return options.find((option)=>option.value === value)?.label ?? value;
|
|
58
73
|
case 'multi-select':
|
|
@@ -65,4 +80,4 @@ function getLockedDisplayValue(fieldType, value, options) {
|
|
|
65
80
|
return value;
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
|
-
export { DEFAULT_SELECT_OPTIONS, formatDateValue, getLockedDisplayValue, parseDateValue, parseListValue, toDateOnlyString };
|
|
83
|
+
export { DEFAULT_SELECT_OPTIONS, formatDateTimeValue, formatDateValue, getLockedDisplayValue, parseDateValue, parseListValue, toDateOnlyString };
|
|
@@ -25,6 +25,7 @@ var __webpack_require__ = {};
|
|
|
25
25
|
var __webpack_exports__ = {};
|
|
26
26
|
__webpack_require__.r(__webpack_exports__);
|
|
27
27
|
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
TreeView: ()=>TreeView,
|
|
28
29
|
default: ()=>tree_view
|
|
29
30
|
});
|
|
30
31
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
@@ -758,7 +759,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
|
|
|
758
759
|
]
|
|
759
760
|
});
|
|
760
761
|
}
|
|
761
|
-
const
|
|
762
|
+
const tree_view_FileTreeView = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ className, containerClassName, checkboxLabels = {
|
|
762
763
|
check: 'Check',
|
|
763
764
|
uncheck: 'Uncheck'
|
|
764
765
|
}, data, iconMap, searchPlaceholder = 'Search...', selectionText = 'selected', showExpandAll = true, showCheckboxes = false, showSelectionCheckboxes = false, selectionMode = 'multiple', title, getIcon, onSelectionChange, onAction, onCheckChange, menuItems }, ref) {
|
|
@@ -1115,9 +1116,12 @@ const tree_view_TreeView = /*#__PURE__*/ external_react_namespaceObject.forwardR
|
|
|
1115
1116
|
})
|
|
1116
1117
|
});
|
|
1117
1118
|
});
|
|
1118
|
-
const tree_view =
|
|
1119
|
+
const tree_view = tree_view_FileTreeView;
|
|
1120
|
+
const TreeView = tree_view_FileTreeView;
|
|
1121
|
+
exports.TreeView = __webpack_exports__.TreeView;
|
|
1119
1122
|
exports["default"] = __webpack_exports__["default"];
|
|
1120
1123
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
1124
|
+
"TreeView",
|
|
1121
1125
|
"default"
|
|
1122
1126
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
1123
1127
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
* Action shown in the item's dropdown menu (Edit, Delete, etc.).
|
|
4
4
|
* Actions appear as a single "more" icon that opens a dropdown to avoid horizontal overflow.
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface FileTreeViewItemAction {
|
|
7
7
|
/** Unique action identifier */
|
|
8
8
|
id: string;
|
|
9
9
|
/** Icon to display in the dropdown menu item */
|
|
@@ -11,12 +11,12 @@ export interface TreeViewItemAction {
|
|
|
11
11
|
/** Accessible label for the action */
|
|
12
12
|
label?: string;
|
|
13
13
|
/** Called when the action is clicked */
|
|
14
|
-
onClick: (item:
|
|
14
|
+
onClick: (item: FileTreeViewItem) => void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A single item in the tree. Supports hierarchical structure, selection, and rich metadata.
|
|
18
18
|
*/
|
|
19
|
-
export interface
|
|
19
|
+
export interface FileTreeViewItem {
|
|
20
20
|
/** Unique identifier (must be unique across the entire tree) */
|
|
21
21
|
id: string;
|
|
22
22
|
/** Display name */
|
|
@@ -24,7 +24,7 @@ export interface TreeViewItem {
|
|
|
24
24
|
/** Type used for icon lookup in iconMap */
|
|
25
25
|
type: string;
|
|
26
26
|
/** Child items for expandable folders */
|
|
27
|
-
children?:
|
|
27
|
+
children?: FileTreeViewItem[];
|
|
28
28
|
/** Checked state when using access-rights checkboxes (showCheckboxes) */
|
|
29
29
|
checked?: boolean;
|
|
30
30
|
/** When true, item is greyed out and cannot be selected */
|
|
@@ -34,16 +34,16 @@ export interface TreeViewItem {
|
|
|
34
34
|
/** Secondary metadata shown after the badge (e.g. "Production", "2 workflows") */
|
|
35
35
|
meta?: string | React.ReactNode;
|
|
36
36
|
/** Actions shown in a dropdown menu (Edit, Delete, etc.). Uses a single "more" icon to prevent horizontal scroll. */
|
|
37
|
-
actions?:
|
|
37
|
+
actions?: FileTreeViewItemAction[];
|
|
38
38
|
}
|
|
39
|
-
export interface
|
|
39
|
+
export interface FileTreeViewIconMap {
|
|
40
40
|
[key: string]: React.ReactNode | undefined;
|
|
41
41
|
}
|
|
42
|
-
export interface
|
|
42
|
+
export interface FileTreeViewMenuItem {
|
|
43
43
|
id: string;
|
|
44
44
|
label: string;
|
|
45
45
|
icon?: React.ReactNode;
|
|
46
|
-
action: (items:
|
|
46
|
+
action: (items: FileTreeViewItem[]) => void;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Controls how items can be selected.
|
|
@@ -51,18 +51,18 @@ export interface TreeViewMenuItem {
|
|
|
51
51
|
* - `"single"`: Only one item can be selected at a time
|
|
52
52
|
* - `"none"`: No selection; expand/collapse only
|
|
53
53
|
*/
|
|
54
|
-
export type
|
|
55
|
-
export interface
|
|
54
|
+
export type FileTreeViewSelectionMode = 'single' | 'multiple' | 'none';
|
|
55
|
+
export interface FileTreeViewProps {
|
|
56
56
|
className?: string;
|
|
57
57
|
containerClassName?: string;
|
|
58
|
-
data:
|
|
58
|
+
data: FileTreeViewItem[];
|
|
59
59
|
title?: string;
|
|
60
60
|
showExpandAll?: boolean;
|
|
61
61
|
showCheckboxes?: boolean;
|
|
62
62
|
/** Show selection checkboxes on leaf items only (folders do not get checkboxes) */
|
|
63
63
|
showSelectionCheckboxes?: boolean;
|
|
64
64
|
/** Selection behavior: "multiple" (default), "single", or "none" */
|
|
65
|
-
selectionMode?:
|
|
65
|
+
selectionMode?: FileTreeViewSelectionMode;
|
|
66
66
|
checkboxPosition?: 'left' | 'right';
|
|
67
67
|
searchPlaceholder?: string;
|
|
68
68
|
selectionText?: string;
|
|
@@ -70,15 +70,15 @@ export interface TreeViewProps {
|
|
|
70
70
|
check: string;
|
|
71
71
|
uncheck: string;
|
|
72
72
|
};
|
|
73
|
-
getIcon?: (item:
|
|
74
|
-
onSelectionChange?: (selectedItems:
|
|
75
|
-
onAction?: (action: string, items:
|
|
76
|
-
onCheckChange?: (item:
|
|
77
|
-
iconMap?:
|
|
78
|
-
menuItems?:
|
|
73
|
+
getIcon?: (item: FileTreeViewItem, depth: number) => React.ReactNode;
|
|
74
|
+
onSelectionChange?: (selectedItems: FileTreeViewItem[]) => void;
|
|
75
|
+
onAction?: (action: string, items: FileTreeViewItem[]) => void;
|
|
76
|
+
onCheckChange?: (item: FileTreeViewItem, checked: boolean) => void;
|
|
77
|
+
iconMap?: FileTreeViewIconMap;
|
|
78
|
+
menuItems?: FileTreeViewMenuItem[];
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* FileTreeView displays hierarchical data with expand/collapse, search, selection, and optional actions.
|
|
82
82
|
*
|
|
83
83
|
* **Features:**
|
|
84
84
|
* - **Search**: Filters items by name and auto-expands matching branches
|
|
@@ -92,5 +92,19 @@ export interface TreeViewProps {
|
|
|
92
92
|
*
|
|
93
93
|
* **Layout**: Title → Search bar → Expand/Collapse + Selected count + Clear → Tree. No horizontal scroll.
|
|
94
94
|
*/
|
|
95
|
-
declare const
|
|
96
|
-
export default
|
|
95
|
+
declare const FileTreeView: React.ForwardRefExoticComponent<FileTreeViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
96
|
+
export default FileTreeView;
|
|
97
|
+
/** @deprecated Use `FileTreeView`. */
|
|
98
|
+
export declare const TreeView: React.ForwardRefExoticComponent<FileTreeViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
99
|
+
/** @deprecated Use `FileTreeViewItemAction`. */
|
|
100
|
+
export type TreeViewItemAction = FileTreeViewItemAction;
|
|
101
|
+
/** @deprecated Use `FileTreeViewItem`. */
|
|
102
|
+
export type TreeViewItem = FileTreeViewItem;
|
|
103
|
+
/** @deprecated Use `FileTreeViewIconMap`. */
|
|
104
|
+
export type TreeViewIconMap = FileTreeViewIconMap;
|
|
105
|
+
/** @deprecated Use `FileTreeViewMenuItem`. */
|
|
106
|
+
export type TreeViewMenuItem = FileTreeViewMenuItem;
|
|
107
|
+
/** @deprecated Use `FileTreeViewSelectionMode`. */
|
|
108
|
+
export type TreeViewSelectionMode = FileTreeViewSelectionMode;
|
|
109
|
+
/** @deprecated Use `FileTreeViewProps`. */
|
|
110
|
+
export type TreeViewProps = FileTreeViewProps;
|
|
@@ -730,7 +730,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
|
|
|
730
730
|
]
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
const
|
|
733
|
+
const tree_view_FileTreeView = /*#__PURE__*/ forwardRef(function({ className, containerClassName, checkboxLabels = {
|
|
734
734
|
check: 'Check',
|
|
735
735
|
uncheck: 'Uncheck'
|
|
736
736
|
}, data, iconMap, searchPlaceholder = 'Search...', selectionText = 'selected', showExpandAll = true, showCheckboxes = false, showSelectionCheckboxes = false, selectionMode = 'multiple', title, getIcon, onSelectionChange, onAction, onCheckChange, menuItems }, ref) {
|
|
@@ -1087,5 +1087,6 @@ const tree_view_TreeView = /*#__PURE__*/ forwardRef(function({ className, contai
|
|
|
1087
1087
|
})
|
|
1088
1088
|
});
|
|
1089
1089
|
});
|
|
1090
|
-
const tree_view =
|
|
1091
|
-
|
|
1090
|
+
const tree_view = tree_view_FileTreeView;
|
|
1091
|
+
const TreeView = tree_view_FileTreeView;
|
|
1092
|
+
export { TreeView, tree_view as default };
|