@uipath/apollo-wind 2.37.1 → 2.38.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/index.cjs +14 -14
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +1 -1
- package/dist/components/ui/lockable-value-field/components/field-header.js +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +21 -18
- package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +1 -1
- package/dist/components/ui/lockable-value-field/lockable-value-field.js +21 -18
- package/dist/components/ui/lockable-value-field/types.cjs +10 -2
- package/dist/components/ui/lockable-value-field/types.d.ts +14 -1
- package/dist/components/ui/lockable-value-field/types.js +11 -3
- package/dist/styles.css +10 -0
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"./datetime-picker" (module) {
|
|
61
61
|
module.exports = require("./datetime-picker.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"./dialog" (module) {
|
|
64
64
|
module.exports = require("./dialog.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./drawer" (module) {
|
|
@@ -69,7 +69,7 @@ var __webpack_modules__ = {
|
|
|
69
69
|
"@/components/ui/dropdown-menu" (module) {
|
|
70
70
|
module.exports = require("./dropdown-menu.cjs");
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"@/components/ui/editable-cell" (module) {
|
|
73
73
|
module.exports = require("./editable-cell.cjs");
|
|
74
74
|
},
|
|
75
75
|
"./empty-state" (module) {
|
|
@@ -78,13 +78,13 @@ var __webpack_modules__ = {
|
|
|
78
78
|
"./file-upload" (module) {
|
|
79
79
|
module.exports = require("./file-upload.cjs");
|
|
80
80
|
},
|
|
81
|
-
"
|
|
81
|
+
"./hover-card" (module) {
|
|
82
82
|
module.exports = require("./hover-card.cjs");
|
|
83
83
|
},
|
|
84
|
-
"
|
|
84
|
+
"@/components/ui/input-group" (module) {
|
|
85
85
|
module.exports = require("./input-group.cjs");
|
|
86
86
|
},
|
|
87
|
-
"
|
|
87
|
+
"./input" (module) {
|
|
88
88
|
module.exports = require("./input.cjs");
|
|
89
89
|
},
|
|
90
90
|
"./label" (module) {
|
|
@@ -105,7 +105,7 @@ var __webpack_modules__ = {
|
|
|
105
105
|
"@/components/ui/popover" (module) {
|
|
106
106
|
module.exports = require("./popover.cjs");
|
|
107
107
|
},
|
|
108
|
-
"
|
|
108
|
+
"./portal-container" (module) {
|
|
109
109
|
module.exports = require("./portal-container.cjs");
|
|
110
110
|
},
|
|
111
111
|
"./progress" (module) {
|
|
@@ -168,7 +168,7 @@ var __webpack_modules__ = {
|
|
|
168
168
|
"./toggle-group" (module) {
|
|
169
169
|
module.exports = require("./toggle-group.cjs");
|
|
170
170
|
},
|
|
171
|
-
"
|
|
171
|
+
"./toggle" (module) {
|
|
172
172
|
module.exports = require("./toggle.cjs");
|
|
173
173
|
},
|
|
174
174
|
"./tooltip" (module) {
|
|
@@ -367,7 +367,7 @@ var __webpack_exports__ = {};
|
|
|
367
367
|
"default"
|
|
368
368
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_19[__rspack_import_key];
|
|
369
369
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
370
|
-
var _dialog__rspack_import_20 = __webpack_require__("
|
|
370
|
+
var _dialog__rspack_import_20 = __webpack_require__("./dialog");
|
|
371
371
|
var __rspack_reexport = {};
|
|
372
372
|
for(const __rspack_import_key in _dialog__rspack_import_20)if ([
|
|
373
373
|
"TreeView",
|
|
@@ -388,7 +388,7 @@ var __webpack_exports__ = {};
|
|
|
388
388
|
"default"
|
|
389
389
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_dropdown_menu__rspack_import_22[__rspack_import_key];
|
|
390
390
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
391
|
-
var _editable_cell__rspack_import_23 = __webpack_require__("
|
|
391
|
+
var _editable_cell__rspack_import_23 = __webpack_require__("@/components/ui/editable-cell");
|
|
392
392
|
var __rspack_reexport = {};
|
|
393
393
|
for(const __rspack_import_key in _editable_cell__rspack_import_23)if ([
|
|
394
394
|
"TreeView",
|
|
@@ -409,21 +409,21 @@ var __webpack_exports__ = {};
|
|
|
409
409
|
"default"
|
|
410
410
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_file_upload__rspack_import_25[__rspack_import_key];
|
|
411
411
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
412
|
-
var _hover_card__rspack_import_26 = __webpack_require__("
|
|
412
|
+
var _hover_card__rspack_import_26 = __webpack_require__("./hover-card");
|
|
413
413
|
var __rspack_reexport = {};
|
|
414
414
|
for(const __rspack_import_key in _hover_card__rspack_import_26)if ([
|
|
415
415
|
"TreeView",
|
|
416
416
|
"default"
|
|
417
417
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_hover_card__rspack_import_26[__rspack_import_key];
|
|
418
418
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
419
|
-
var _input__rspack_import_27 = __webpack_require__("
|
|
419
|
+
var _input__rspack_import_27 = __webpack_require__("./input");
|
|
420
420
|
var __rspack_reexport = {};
|
|
421
421
|
for(const __rspack_import_key in _input__rspack_import_27)if ([
|
|
422
422
|
"TreeView",
|
|
423
423
|
"default"
|
|
424
424
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_input__rspack_import_27[__rspack_import_key];
|
|
425
425
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
426
|
-
var _input_group__rspack_import_28 = __webpack_require__("
|
|
426
|
+
var _input_group__rspack_import_28 = __webpack_require__("@/components/ui/input-group");
|
|
427
427
|
var __rspack_reexport = {};
|
|
428
428
|
for(const __rspack_import_key in _input_group__rspack_import_28)if ([
|
|
429
429
|
"TreeView",
|
|
@@ -472,7 +472,7 @@ var __webpack_exports__ = {};
|
|
|
472
472
|
"default"
|
|
473
473
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_popover__rspack_import_34[__rspack_import_key];
|
|
474
474
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
475
|
-
var _portal_container__rspack_import_35 = __webpack_require__("
|
|
475
|
+
var _portal_container__rspack_import_35 = __webpack_require__("./portal-container");
|
|
476
476
|
var __rspack_reexport = {};
|
|
477
477
|
for(const __rspack_import_key in _portal_container__rspack_import_35)if ([
|
|
478
478
|
"TreeView",
|
|
@@ -612,7 +612,7 @@ var __webpack_exports__ = {};
|
|
|
612
612
|
"default"
|
|
613
613
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_textarea__rspack_import_54[__rspack_import_key];
|
|
614
614
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
615
|
-
var _toggle__rspack_import_55 = __webpack_require__("
|
|
615
|
+
var _toggle__rspack_import_55 = __webpack_require__("./toggle");
|
|
616
616
|
var __rspack_reexport = {};
|
|
617
617
|
for(const __rspack_import_key in _toggle__rspack_import_55)if ([
|
|
618
618
|
"TreeView",
|
|
@@ -51,7 +51,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
51
51
|
children: [
|
|
52
52
|
label ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_label_cjs_namespaceObject.Label, {
|
|
53
53
|
htmlFor: fieldId,
|
|
54
|
-
className: "text-xs font-medium text-foreground
|
|
54
|
+
className: "text-xs font-medium text-foreground",
|
|
55
55
|
children: [
|
|
56
56
|
fieldLabel,
|
|
57
57
|
required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.RequiredIndicator, {})
|
|
@@ -23,7 +23,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
23
23
|
children: [
|
|
24
24
|
label ?? /*#__PURE__*/ jsxs(Label, {
|
|
25
25
|
htmlFor: fieldId,
|
|
26
|
-
className: "text-xs font-medium text-foreground
|
|
26
|
+
className: "text-xs font-medium text-foreground",
|
|
27
27
|
children: [
|
|
28
28
|
fieldLabel,
|
|
29
29
|
required && /*#__PURE__*/ jsx(RequiredIndicator, {})
|
|
@@ -44,7 +44,7 @@ const lock_toggle_button_cjs_namespaceObject = require("./components/lock-toggle
|
|
|
44
44
|
const mode_menu_item_cjs_namespaceObject = require("./components/mode-menu-item.cjs");
|
|
45
45
|
const external_types_cjs_namespaceObject = require("./types.cjs");
|
|
46
46
|
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
47
|
-
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, fileUploadAriaLabel, headerActions, compact, controlsVisibility = 'visible', showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
47
|
+
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, leadingAddon, trailingAddon, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, controlsVisibility = 'visible', showFieldActions = true, options = external_utils_cjs_namespaceObject.DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
48
48
|
const generatedId = (0, external_react_namespaceObject.useId)().replace(/:/g, '');
|
|
49
49
|
const [datePopoverOpen, setDatePopoverOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
50
50
|
const [selectOpen, setSelectOpen] = (0, external_react_namespaceObject.useState)(false);
|
|
@@ -80,10 +80,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
80
80
|
typeMeta.supportsExpression ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
81
81
|
error: error,
|
|
82
82
|
errorId: validationId,
|
|
83
|
+
className: (0, index_cjs_namespaceObject.cn)('bg-surface-overlay', 'file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
83
84
|
children: [
|
|
84
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
85
|
+
null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
85
86
|
align: "inline-start",
|
|
86
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
87
|
+
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
87
88
|
locked: locked,
|
|
88
89
|
onLockedChange: onLockedChange
|
|
89
90
|
})
|
|
@@ -161,6 +162,16 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
161
162
|
})
|
|
162
163
|
})
|
|
163
164
|
]
|
|
165
|
+
}) : 'file' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_file_upload_cjs_namespaceObject.FileUpload, {
|
|
166
|
+
id: fieldId,
|
|
167
|
+
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
168
|
+
className: "flex-1",
|
|
169
|
+
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
170
|
+
disabled: !onValueChange,
|
|
171
|
+
onBlur: onValueBlur,
|
|
172
|
+
"aria-invalid": error ? true : void 0,
|
|
173
|
+
"aria-describedby": error ? validationId : void 0,
|
|
174
|
+
"aria-errormessage": error ? validationId : void 0
|
|
164
175
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
165
176
|
id: fieldId,
|
|
166
177
|
type: 'integer' === fieldType ? 'number' : 'text',
|
|
@@ -170,9 +181,10 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
170
181
|
onBlur: onValueBlur,
|
|
171
182
|
placeholder: fieldLabel
|
|
172
183
|
}),
|
|
173
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
184
|
+
null !== trailingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
174
185
|
align: "inline-end",
|
|
175
|
-
|
|
186
|
+
className: null != trailingAddon ? 'cursor-default' : void 0,
|
|
187
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
176
188
|
children: [
|
|
177
189
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
178
190
|
asChild: true,
|
|
@@ -211,7 +223,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
211
223
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
212
224
|
className: "flex items-center gap-2",
|
|
213
225
|
children: [
|
|
214
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
226
|
+
void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
215
227
|
locked: locked,
|
|
216
228
|
onLockedChange: onLockedChange
|
|
217
229
|
}),
|
|
@@ -264,17 +276,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
264
276
|
"aria-invalid": error ? true : void 0,
|
|
265
277
|
"aria-describedby": error ? validationId : void 0,
|
|
266
278
|
"aria-errormessage": error ? validationId : void 0
|
|
267
|
-
}) :
|
|
268
|
-
id: fieldId,
|
|
269
|
-
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
270
|
-
className: "flex-1",
|
|
271
|
-
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
272
|
-
disabled: !onValueChange,
|
|
273
|
-
onBlur: onValueBlur,
|
|
274
|
-
"aria-invalid": error ? true : void 0,
|
|
275
|
-
"aria-describedby": error ? validationId : void 0,
|
|
276
|
-
"aria-errormessage": error ? validationId : void 0
|
|
277
|
-
})
|
|
279
|
+
}) : null
|
|
278
280
|
]
|
|
279
281
|
}),
|
|
280
282
|
error && !typeMeta.supportsExpression && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
@@ -284,7 +286,8 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
284
286
|
"aria-atomic": "true",
|
|
285
287
|
className: "mt-1 text-xs leading-4 text-error",
|
|
286
288
|
children: error
|
|
287
|
-
})
|
|
289
|
+
}),
|
|
290
|
+
belowValue
|
|
288
291
|
]
|
|
289
292
|
});
|
|
290
293
|
}
|
|
@@ -11,4 +11,4 @@ import type { LockableValueFieldProps } from './types';
|
|
|
11
11
|
* Insert-variable menu is empty (and disabled) unless `variables` is
|
|
12
12
|
* provided; file uploads aren't persisted anywhere.
|
|
13
13
|
*/
|
|
14
|
-
export declare function LockableValueField({ value, onValueChange, onValueBlur, locked, onLockedChange, mode, onModeChange, renderExpressionEditor, fieldType, onFieldTypeChange, required, onRequiredChange, label, error, errorId, fileUploadAriaLabel, headerActions, compact, controlsVisibility, showFieldActions, options, onGenerateWithAi, variables, id, className, }: LockableValueFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function LockableValueField({ value, onValueChange, onValueBlur, locked, onLockedChange, leadingAddon, trailingAddon, mode, onModeChange, renderExpressionEditor, fieldType, onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, controlsVisibility, showFieldActions, options, onGenerateWithAi, variables, id, className, }: LockableValueFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import { LockToggleButton } from "./components/lock-toggle-button.js";
|
|
|
16
16
|
import { ModeMenuItem } from "./components/mode-menu-item.js";
|
|
17
17
|
import { FIELD_TYPE_META } from "./types.js";
|
|
18
18
|
import { DEFAULT_SELECT_OPTIONS, formatDateValue, getLockedDisplayValue, parseDateValue, parseListValue, toDateOnlyString } from "./utils.js";
|
|
19
|
-
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, fileUploadAriaLabel, headerActions, compact, controlsVisibility = 'visible', showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
19
|
+
function LockableValueField({ value = '', onValueChange, onValueBlur, locked = true, onLockedChange, leadingAddon, trailingAddon, mode = 'fixed', onModeChange, renderExpressionEditor, fieldType = 'string', onFieldTypeChange, required, onRequiredChange, label, error, errorId, belowValue, fileUploadAriaLabel, headerActions, compact, controlsVisibility = 'visible', showFieldActions = true, options = DEFAULT_SELECT_OPTIONS, onGenerateWithAi, variables = [], id, className }) {
|
|
20
20
|
const generatedId = useId().replace(/:/g, '');
|
|
21
21
|
const [datePopoverOpen, setDatePopoverOpen] = useState(false);
|
|
22
22
|
const [selectOpen, setSelectOpen] = useState(false);
|
|
@@ -52,10 +52,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
52
52
|
typeMeta.supportsExpression ? /*#__PURE__*/ jsxs(InputGroup, {
|
|
53
53
|
error: error,
|
|
54
54
|
errorId: validationId,
|
|
55
|
+
className: cn('bg-surface-overlay', 'file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
55
56
|
children: [
|
|
56
|
-
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
57
|
+
null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
57
58
|
align: "inline-start",
|
|
58
|
-
children: /*#__PURE__*/ jsx(LockToggleButton, {
|
|
59
|
+
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ jsx(LockToggleButton, {
|
|
59
60
|
locked: locked,
|
|
60
61
|
onLockedChange: onLockedChange
|
|
61
62
|
})
|
|
@@ -133,6 +134,16 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
133
134
|
})
|
|
134
135
|
})
|
|
135
136
|
]
|
|
137
|
+
}) : 'file' === fieldType ? /*#__PURE__*/ jsx(FileUpload, {
|
|
138
|
+
id: fieldId,
|
|
139
|
+
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
140
|
+
className: "flex-1",
|
|
141
|
+
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
142
|
+
disabled: !onValueChange,
|
|
143
|
+
onBlur: onValueBlur,
|
|
144
|
+
"aria-invalid": error ? true : void 0,
|
|
145
|
+
"aria-describedby": error ? validationId : void 0,
|
|
146
|
+
"aria-errormessage": error ? validationId : void 0
|
|
136
147
|
}) : /*#__PURE__*/ jsx(InputGroupInput, {
|
|
137
148
|
id: fieldId,
|
|
138
149
|
type: 'integer' === fieldType ? 'number' : 'text',
|
|
@@ -142,9 +153,10 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
142
153
|
onBlur: onValueBlur,
|
|
143
154
|
placeholder: fieldLabel
|
|
144
155
|
}),
|
|
145
|
-
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
156
|
+
null !== trailingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
146
157
|
align: "inline-end",
|
|
147
|
-
|
|
158
|
+
className: null != trailingAddon ? 'cursor-default' : void 0,
|
|
159
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
148
160
|
children: [
|
|
149
161
|
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
150
162
|
asChild: true,
|
|
@@ -183,7 +195,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
183
195
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
184
196
|
className: "flex items-center gap-2",
|
|
185
197
|
children: [
|
|
186
|
-
/*#__PURE__*/ jsx(LockToggleButton, {
|
|
198
|
+
void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ jsx(LockToggleButton, {
|
|
187
199
|
locked: locked,
|
|
188
200
|
onLockedChange: onLockedChange
|
|
189
201
|
}),
|
|
@@ -236,17 +248,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
236
248
|
"aria-invalid": error ? true : void 0,
|
|
237
249
|
"aria-describedby": error ? validationId : void 0,
|
|
238
250
|
"aria-errormessage": error ? validationId : void 0
|
|
239
|
-
}) :
|
|
240
|
-
id: fieldId,
|
|
241
|
-
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
242
|
-
className: "flex-1",
|
|
243
|
-
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
244
|
-
disabled: !onValueChange,
|
|
245
|
-
onBlur: onValueBlur,
|
|
246
|
-
"aria-invalid": error ? true : void 0,
|
|
247
|
-
"aria-describedby": error ? validationId : void 0,
|
|
248
|
-
"aria-errormessage": error ? validationId : void 0
|
|
249
|
-
})
|
|
251
|
+
}) : null
|
|
250
252
|
]
|
|
251
253
|
}),
|
|
252
254
|
error && !typeMeta.supportsExpression && /*#__PURE__*/ jsx("p", {
|
|
@@ -256,7 +258,8 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
256
258
|
"aria-atomic": "true",
|
|
257
259
|
className: "mt-1 text-xs leading-4 text-error",
|
|
258
260
|
children: error
|
|
259
|
-
})
|
|
261
|
+
}),
|
|
262
|
+
belowValue
|
|
260
263
|
]
|
|
261
264
|
});
|
|
262
265
|
}
|
|
@@ -74,9 +74,16 @@ const FIELD_TYPE_META = {
|
|
|
74
74
|
file: {
|
|
75
75
|
label: 'File',
|
|
76
76
|
icon: external_lucide_react_namespaceObject.File,
|
|
77
|
-
supportsExpression:
|
|
77
|
+
supportsExpression: true,
|
|
78
78
|
fixedLabel: 'Fixed value',
|
|
79
79
|
fixedDescription: 'Upload a file'
|
|
80
|
+
},
|
|
81
|
+
object: {
|
|
82
|
+
label: 'Object',
|
|
83
|
+
icon: external_lucide_react_namespaceObject.Braces,
|
|
84
|
+
supportsExpression: true,
|
|
85
|
+
fixedLabel: 'Fixed value',
|
|
86
|
+
fixedDescription: 'Use a literal object value'
|
|
80
87
|
}
|
|
81
88
|
};
|
|
82
89
|
const FIELD_TYPE_ORDER = [
|
|
@@ -86,7 +93,8 @@ const FIELD_TYPE_ORDER = [
|
|
|
86
93
|
'boolean',
|
|
87
94
|
'single-select',
|
|
88
95
|
'multi-select',
|
|
89
|
-
'file'
|
|
96
|
+
'file',
|
|
97
|
+
'object'
|
|
90
98
|
];
|
|
91
99
|
exports.FIELD_TYPE_META = __webpack_exports__.FIELD_TYPE_META;
|
|
92
100
|
exports.FIELD_TYPE_ORDER = __webpack_exports__.FIELD_TYPE_ORDER;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LucideIcon } from 'lucide-react';
|
|
2
2
|
import type { AriaAttributes, ReactNode } from 'react';
|
|
3
3
|
export type LockableValueFieldMode = 'fixed' | 'expression';
|
|
4
|
-
export type LockableFieldType = 'string' | 'integer' | 'date' | 'boolean' | 'single-select' | 'multi-select' | 'file';
|
|
4
|
+
export type LockableFieldType = 'string' | 'integer' | 'date' | 'boolean' | 'single-select' | 'multi-select' | 'file' | 'object';
|
|
5
5
|
interface FieldTypeMeta {
|
|
6
6
|
label: string;
|
|
7
7
|
icon: LucideIcon;
|
|
@@ -26,6 +26,17 @@ export interface LockableValueFieldProps {
|
|
|
26
26
|
locked?: boolean;
|
|
27
27
|
/** Called when the user toggles the lock. */
|
|
28
28
|
onLockedChange?: (locked: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Replaces the leading lock toggle with a semantic prefix such as `=`.
|
|
31
|
+
* Pass `null` to suppress the built-in toggle; omitting the prop preserves it.
|
|
32
|
+
*/
|
|
33
|
+
leadingAddon?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Replaces the trailing fixed/expression menu with a consumer-provided action
|
|
36
|
+
* for expression-capable field types. Pass `null` to suppress the built-in
|
|
37
|
+
* menu; omitting the prop preserves it.
|
|
38
|
+
*/
|
|
39
|
+
trailingAddon?: ReactNode;
|
|
29
40
|
/** Fixed value vs. JS expression. Defaults to 'fixed'. Ignored for types that don't support expressions. */
|
|
30
41
|
mode?: LockableValueFieldMode;
|
|
31
42
|
/** Called when the user switches modes. */
|
|
@@ -61,6 +72,8 @@ export interface LockableValueFieldProps {
|
|
|
61
72
|
error?: ReactNode;
|
|
62
73
|
/** Optional id for the inline validation message. */
|
|
63
74
|
errorId?: string;
|
|
75
|
+
/** Content rendered below the value control, such as a related checkbox or help text. */
|
|
76
|
+
belowValue?: ReactNode;
|
|
64
77
|
/** Accessible name for the file-upload dropzone. Defaults to a string `label`, then the computed field label. */
|
|
65
78
|
fileUploadAriaLabel?: string;
|
|
66
79
|
/** Extra content rendered after the built-in AI assist / Insert variable buttons (e.g. a delete button). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ALargeSmall, Calendar, File, Hash, List, ListChecks, ToggleLeft } from "lucide-react";
|
|
1
|
+
import { ALargeSmall, Braces, Calendar, File, Hash, List, ListChecks, ToggleLeft } from "lucide-react";
|
|
2
2
|
const FIELD_TYPE_META = {
|
|
3
3
|
string: {
|
|
4
4
|
label: 'String',
|
|
@@ -45,9 +45,16 @@ const FIELD_TYPE_META = {
|
|
|
45
45
|
file: {
|
|
46
46
|
label: 'File',
|
|
47
47
|
icon: File,
|
|
48
|
-
supportsExpression:
|
|
48
|
+
supportsExpression: true,
|
|
49
49
|
fixedLabel: 'Fixed value',
|
|
50
50
|
fixedDescription: 'Upload a file'
|
|
51
|
+
},
|
|
52
|
+
object: {
|
|
53
|
+
label: 'Object',
|
|
54
|
+
icon: Braces,
|
|
55
|
+
supportsExpression: true,
|
|
56
|
+
fixedLabel: 'Fixed value',
|
|
57
|
+
fixedDescription: 'Use a literal object value'
|
|
51
58
|
}
|
|
52
59
|
};
|
|
53
60
|
const FIELD_TYPE_ORDER = [
|
|
@@ -57,6 +64,7 @@ const FIELD_TYPE_ORDER = [
|
|
|
57
64
|
'boolean',
|
|
58
65
|
'single-select',
|
|
59
66
|
'multi-select',
|
|
60
|
-
'file'
|
|
67
|
+
'file',
|
|
68
|
+
'object'
|
|
61
69
|
];
|
|
62
70
|
export { FIELD_TYPE_META, FIELD_TYPE_ORDER };
|
package/dist/styles.css
CHANGED
|
@@ -1472,6 +1472,9 @@
|
|
|
1472
1472
|
.w-\[600px\] {
|
|
1473
1473
|
width: 600px;
|
|
1474
1474
|
}
|
|
1475
|
+
.w-\[620px\] {
|
|
1476
|
+
width: 620px;
|
|
1477
|
+
}
|
|
1475
1478
|
.w-\[700px\] {
|
|
1476
1479
|
width: 700px;
|
|
1477
1480
|
}
|
|
@@ -3916,6 +3919,10 @@
|
|
|
3916
3919
|
.text-\[40px\] {
|
|
3917
3920
|
font-size: 40px;
|
|
3918
3921
|
}
|
|
3922
|
+
.leading-3 {
|
|
3923
|
+
--tw-leading: calc(var(--spacing) * 3);
|
|
3924
|
+
line-height: calc(var(--spacing) * 3);
|
|
3925
|
+
}
|
|
3919
3926
|
.leading-4 {
|
|
3920
3927
|
--tw-leading: calc(var(--spacing) * 4);
|
|
3921
3928
|
line-height: calc(var(--spacing) * 4);
|
|
@@ -4287,6 +4294,9 @@
|
|
|
4287
4294
|
.underline-offset-4 {
|
|
4288
4295
|
text-underline-offset: 4px;
|
|
4289
4296
|
}
|
|
4297
|
+
.accent-brand {
|
|
4298
|
+
accent-color: var(--brand);
|
|
4299
|
+
}
|
|
4290
4300
|
.accent-primary {
|
|
4291
4301
|
accent-color: var(--primary);
|
|
4292
4302
|
}
|