@uipath/apollo-wind 2.37.1 → 2.39.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 +20 -20
- package/dist/components/ui/lockable-value-field/components/field-header.cjs +3 -3
- package/dist/components/ui/lockable-value-field/components/field-header.d.ts +1 -2
- package/dist/components/ui/lockable-value-field/components/field-header.js +3 -3
- package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +21 -19
- 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 -19
- package/dist/components/ui/lockable-value-field/types.cjs +10 -2
- package/dist/components/ui/lockable-value-field/types.d.ts +15 -2
- package/dist/components/ui/lockable-value-field/types.js +11 -3
- package/dist/styles.css +10 -17
- package/package.json +1 -1
|
@@ -27,10 +27,10 @@ var __webpack_modules__ = {
|
|
|
27
27
|
"@/components/ui/button" (module) {
|
|
28
28
|
module.exports = require("./button.cjs");
|
|
29
29
|
},
|
|
30
|
-
"
|
|
30
|
+
"@/components/ui/calendar" (module) {
|
|
31
31
|
module.exports = require("./calendar.cjs");
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"./card" (module) {
|
|
34
34
|
module.exports = require("./card.cjs");
|
|
35
35
|
},
|
|
36
36
|
"./chart" (module) {
|
|
@@ -39,7 +39,7 @@ var __webpack_modules__ = {
|
|
|
39
39
|
"@/components/ui/checkbox" (module) {
|
|
40
40
|
module.exports = require("./checkbox.cjs");
|
|
41
41
|
},
|
|
42
|
-
"
|
|
42
|
+
"./collapsible" (module) {
|
|
43
43
|
module.exports = require("./collapsible.cjs");
|
|
44
44
|
},
|
|
45
45
|
"./combobox" (module) {
|
|
@@ -48,7 +48,7 @@ var __webpack_modules__ = {
|
|
|
48
48
|
"@/components/ui/command" (module) {
|
|
49
49
|
module.exports = require("./command.cjs");
|
|
50
50
|
},
|
|
51
|
-
"
|
|
51
|
+
"./context-menu" (module) {
|
|
52
52
|
module.exports = require("./context-menu.cjs");
|
|
53
53
|
},
|
|
54
54
|
"./data-table" (module) {
|
|
@@ -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,10 +78,10 @@ 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
|
"@/components/ui/input" (module) {
|
|
@@ -156,13 +156,13 @@ var __webpack_modules__ = {
|
|
|
156
156
|
"./switch" (module) {
|
|
157
157
|
module.exports = require("./switch.cjs");
|
|
158
158
|
},
|
|
159
|
-
"
|
|
159
|
+
"@/components/ui/table" (module) {
|
|
160
160
|
module.exports = require("./table.cjs");
|
|
161
161
|
},
|
|
162
162
|
"./tabs" (module) {
|
|
163
163
|
module.exports = require("./tabs.cjs");
|
|
164
164
|
},
|
|
165
|
-
"
|
|
165
|
+
"./textarea" (module) {
|
|
166
166
|
module.exports = require("./textarea.cjs");
|
|
167
167
|
},
|
|
168
168
|
"./toggle-group" (module) {
|
|
@@ -290,14 +290,14 @@ var __webpack_exports__ = {};
|
|
|
290
290
|
"default"
|
|
291
291
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_button_group__rspack_import_8[__rspack_import_key];
|
|
292
292
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
293
|
-
var _calendar__rspack_import_9 = __webpack_require__("
|
|
293
|
+
var _calendar__rspack_import_9 = __webpack_require__("@/components/ui/calendar");
|
|
294
294
|
var __rspack_reexport = {};
|
|
295
295
|
for(const __rspack_import_key in _calendar__rspack_import_9)if ([
|
|
296
296
|
"TreeView",
|
|
297
297
|
"default"
|
|
298
298
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_calendar__rspack_import_9[__rspack_import_key];
|
|
299
299
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
300
|
-
var _card__rspack_import_10 = __webpack_require__("
|
|
300
|
+
var _card__rspack_import_10 = __webpack_require__("./card");
|
|
301
301
|
var __rspack_reexport = {};
|
|
302
302
|
for(const __rspack_import_key in _card__rspack_import_10)if ([
|
|
303
303
|
"TreeView",
|
|
@@ -318,7 +318,7 @@ var __webpack_exports__ = {};
|
|
|
318
318
|
"default"
|
|
319
319
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_checkbox__rspack_import_12[__rspack_import_key];
|
|
320
320
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
321
|
-
var _collapsible__rspack_import_13 = __webpack_require__("
|
|
321
|
+
var _collapsible__rspack_import_13 = __webpack_require__("./collapsible");
|
|
322
322
|
var __rspack_reexport = {};
|
|
323
323
|
for(const __rspack_import_key in _collapsible__rspack_import_13)if ([
|
|
324
324
|
"TreeView",
|
|
@@ -339,7 +339,7 @@ var __webpack_exports__ = {};
|
|
|
339
339
|
"default"
|
|
340
340
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_command__rspack_import_15[__rspack_import_key];
|
|
341
341
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
342
|
-
var _context_menu__rspack_import_16 = __webpack_require__("
|
|
342
|
+
var _context_menu__rspack_import_16 = __webpack_require__("./context-menu");
|
|
343
343
|
var __rspack_reexport = {};
|
|
344
344
|
for(const __rspack_import_key in _context_menu__rspack_import_16)if ([
|
|
345
345
|
"TreeView",
|
|
@@ -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,7 +409,7 @@ 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",
|
|
@@ -423,7 +423,7 @@ var __webpack_exports__ = {};
|
|
|
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",
|
|
@@ -591,7 +591,7 @@ var __webpack_exports__ = {};
|
|
|
591
591
|
"default"
|
|
592
592
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_51[__rspack_import_key];
|
|
593
593
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
594
|
-
var _table__rspack_import_52 = __webpack_require__("
|
|
594
|
+
var _table__rspack_import_52 = __webpack_require__("@/components/ui/table");
|
|
595
595
|
var __rspack_reexport = {};
|
|
596
596
|
for(const __rspack_import_key in _table__rspack_import_52)if ([
|
|
597
597
|
"TreeView",
|
|
@@ -605,7 +605,7 @@ var __webpack_exports__ = {};
|
|
|
605
605
|
"default"
|
|
606
606
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tabs__rspack_import_53[__rspack_import_key];
|
|
607
607
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
608
|
-
var _textarea__rspack_import_54 = __webpack_require__("
|
|
608
|
+
var _textarea__rspack_import_54 = __webpack_require__("./textarea");
|
|
609
609
|
var __rspack_reexport = {};
|
|
610
610
|
for(const __rspack_import_key in _textarea__rspack_import_54)if ([
|
|
611
611
|
"TreeView",
|
|
@@ -39,7 +39,7 @@ const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
|
39
39
|
const index_cjs_namespaceObject = require("../../variable-picker/index.cjs");
|
|
40
40
|
const external_lib_index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
41
41
|
const external_types_cjs_namespaceObject = require("../types.cjs");
|
|
42
|
-
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange,
|
|
42
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
43
43
|
const promptId = (0, external_react_namespaceObject.useId)();
|
|
44
44
|
const [aiPrompt, setAiPrompt] = (0, external_react_namespaceObject.useState)('');
|
|
45
45
|
const typeMeta = external_types_cjs_namespaceObject.FIELD_TYPE_META[fieldType];
|
|
@@ -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, {})
|
|
@@ -63,7 +63,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
63
63
|
className: "ml-auto flex items-center gap-0.5",
|
|
64
64
|
children: [
|
|
65
65
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
66
|
-
className:
|
|
66
|
+
className: "flex items-center gap-0.5",
|
|
67
67
|
children: [
|
|
68
68
|
onFieldTypeChange && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
69
69
|
children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { LockableFieldType, LockableValueFieldOption } from '../types';
|
|
3
|
-
export declare function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange,
|
|
3
|
+
export declare function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions, }: {
|
|
4
4
|
label?: ReactNode;
|
|
5
5
|
fieldId: string;
|
|
6
6
|
fieldLabel: string;
|
|
@@ -8,7 +8,6 @@ export declare function FieldHeader({ label, fieldId, fieldLabel, required, fiel
|
|
|
8
8
|
fieldType: LockableFieldType;
|
|
9
9
|
onFieldTypeChange?: (fieldType: LockableFieldType) => void;
|
|
10
10
|
onRequiredChange?: (required: boolean) => void;
|
|
11
|
-
controlsVisibility: 'visible' | 'hover';
|
|
12
11
|
compact?: boolean;
|
|
13
12
|
showFieldActions: boolean;
|
|
14
13
|
value: string;
|
|
@@ -11,7 +11,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../
|
|
|
11
11
|
import { VariablePicker } from "../../variable-picker/index.js";
|
|
12
12
|
import { cn } from "../../../../lib/index.js";
|
|
13
13
|
import { FIELD_TYPE_META, FIELD_TYPE_ORDER } from "../types.js";
|
|
14
|
-
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange,
|
|
14
|
+
function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldTypeChange, onRequiredChange, compact, showFieldActions, value, onValueChange, variables, onGenerateWithAi, headerActions }) {
|
|
15
15
|
const promptId = useId();
|
|
16
16
|
const [aiPrompt, setAiPrompt] = useState('');
|
|
17
17
|
const typeMeta = FIELD_TYPE_META[fieldType];
|
|
@@ -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, {})
|
|
@@ -35,7 +35,7 @@ function FieldHeader({ label, fieldId, fieldLabel, required, fieldType, onFieldT
|
|
|
35
35
|
className: "ml-auto flex items-center gap-0.5",
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ jsxs("div", {
|
|
38
|
-
className:
|
|
38
|
+
className: "flex items-center gap-0.5",
|
|
39
39
|
children: [
|
|
40
40
|
onFieldTypeChange && /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
41
41
|
children: [
|
|
@@ -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,
|
|
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, 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);
|
|
@@ -68,7 +68,6 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
68
68
|
fieldType: fieldType,
|
|
69
69
|
onFieldTypeChange: onFieldTypeChange,
|
|
70
70
|
onRequiredChange: onRequiredChange,
|
|
71
|
-
controlsVisibility: controlsVisibility,
|
|
72
71
|
compact: compact,
|
|
73
72
|
showFieldActions: showFieldActions,
|
|
74
73
|
value: value,
|
|
@@ -80,10 +79,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
80
79
|
typeMeta.supportsExpression ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
|
|
81
80
|
error: error,
|
|
82
81
|
errorId: validationId,
|
|
82
|
+
className: (0, index_cjs_namespaceObject.cn)('bg-surface-overlay', 'file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
83
83
|
children: [
|
|
84
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
84
|
+
null !== leadingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
85
85
|
align: "inline-start",
|
|
86
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
86
|
+
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
87
87
|
locked: locked,
|
|
88
88
|
onLockedChange: onLockedChange
|
|
89
89
|
})
|
|
@@ -161,6 +161,16 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
161
161
|
})
|
|
162
162
|
})
|
|
163
163
|
]
|
|
164
|
+
}) : 'file' === fieldType ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_file_upload_cjs_namespaceObject.FileUpload, {
|
|
165
|
+
id: fieldId,
|
|
166
|
+
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
167
|
+
className: "flex-1",
|
|
168
|
+
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
169
|
+
disabled: !onValueChange,
|
|
170
|
+
onBlur: onValueBlur,
|
|
171
|
+
"aria-invalid": error ? true : void 0,
|
|
172
|
+
"aria-describedby": error ? validationId : void 0,
|
|
173
|
+
"aria-errormessage": error ? validationId : void 0
|
|
164
174
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
|
|
165
175
|
id: fieldId,
|
|
166
176
|
type: 'integer' === fieldType ? 'number' : 'text',
|
|
@@ -170,9 +180,10 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
170
180
|
onBlur: onValueBlur,
|
|
171
181
|
placeholder: fieldLabel
|
|
172
182
|
}),
|
|
173
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
183
|
+
null !== trailingAddon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
|
|
174
184
|
align: "inline-end",
|
|
175
|
-
|
|
185
|
+
className: null != trailingAddon ? 'cursor-default' : void 0,
|
|
186
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
|
|
176
187
|
children: [
|
|
177
188
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
|
|
178
189
|
asChild: true,
|
|
@@ -211,7 +222,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
211
222
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
212
223
|
className: "flex items-center gap-2",
|
|
213
224
|
children: [
|
|
214
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
225
|
+
void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(lock_toggle_button_cjs_namespaceObject.LockToggleButton, {
|
|
215
226
|
locked: locked,
|
|
216
227
|
onLockedChange: onLockedChange
|
|
217
228
|
}),
|
|
@@ -264,17 +275,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
264
275
|
"aria-invalid": error ? true : void 0,
|
|
265
276
|
"aria-describedby": error ? validationId : void 0,
|
|
266
277
|
"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
|
-
})
|
|
278
|
+
}) : null
|
|
278
279
|
]
|
|
279
280
|
}),
|
|
280
281
|
error && !typeMeta.supportsExpression && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
@@ -284,7 +285,8 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
284
285
|
"aria-atomic": "true",
|
|
285
286
|
className: "mt-1 text-xs leading-4 text-error",
|
|
286
287
|
children: error
|
|
287
|
-
})
|
|
288
|
+
}),
|
|
289
|
+
belowValue
|
|
288
290
|
]
|
|
289
291
|
});
|
|
290
292
|
}
|
|
@@ -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,
|
|
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, 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,
|
|
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, 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);
|
|
@@ -40,7 +40,6 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
40
40
|
fieldType: fieldType,
|
|
41
41
|
onFieldTypeChange: onFieldTypeChange,
|
|
42
42
|
onRequiredChange: onRequiredChange,
|
|
43
|
-
controlsVisibility: controlsVisibility,
|
|
44
43
|
compact: compact,
|
|
45
44
|
showFieldActions: showFieldActions,
|
|
46
45
|
value: value,
|
|
@@ -52,10 +51,11 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
52
51
|
typeMeta.supportsExpression ? /*#__PURE__*/ jsxs(InputGroup, {
|
|
53
52
|
error: error,
|
|
54
53
|
errorId: validationId,
|
|
54
|
+
className: cn('bg-surface-overlay', 'file' === fieldType && !locked && 'fixed' === effectiveMode && 'h-auto items-stretch'),
|
|
55
55
|
children: [
|
|
56
|
-
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
56
|
+
null !== leadingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
57
57
|
align: "inline-start",
|
|
58
|
-
children: /*#__PURE__*/ jsx(LockToggleButton, {
|
|
58
|
+
children: void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ jsx(LockToggleButton, {
|
|
59
59
|
locked: locked,
|
|
60
60
|
onLockedChange: onLockedChange
|
|
61
61
|
})
|
|
@@ -133,6 +133,16 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
133
133
|
})
|
|
134
134
|
})
|
|
135
135
|
]
|
|
136
|
+
}) : 'file' === fieldType ? /*#__PURE__*/ jsx(FileUpload, {
|
|
137
|
+
id: fieldId,
|
|
138
|
+
ariaLabel: fileUploadAriaLabel ?? ('string' == typeof label ? label : fieldLabel),
|
|
139
|
+
className: "flex-1",
|
|
140
|
+
onFilesChange: (files)=>onValueChange?.(files.map((f)=>f.name).join(', ')),
|
|
141
|
+
disabled: !onValueChange,
|
|
142
|
+
onBlur: onValueBlur,
|
|
143
|
+
"aria-invalid": error ? true : void 0,
|
|
144
|
+
"aria-describedby": error ? validationId : void 0,
|
|
145
|
+
"aria-errormessage": error ? validationId : void 0
|
|
136
146
|
}) : /*#__PURE__*/ jsx(InputGroupInput, {
|
|
137
147
|
id: fieldId,
|
|
138
148
|
type: 'integer' === fieldType ? 'number' : 'text',
|
|
@@ -142,9 +152,10 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
142
152
|
onBlur: onValueBlur,
|
|
143
153
|
placeholder: fieldLabel
|
|
144
154
|
}),
|
|
145
|
-
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
155
|
+
null !== trailingAddon && /*#__PURE__*/ jsx(InputGroupAddon, {
|
|
146
156
|
align: "inline-end",
|
|
147
|
-
|
|
157
|
+
className: null != trailingAddon ? 'cursor-default' : void 0,
|
|
158
|
+
children: void 0 !== trailingAddon ? trailingAddon : /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
148
159
|
children: [
|
|
149
160
|
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
150
161
|
asChild: true,
|
|
@@ -183,7 +194,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
183
194
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
184
195
|
className: "flex items-center gap-2",
|
|
185
196
|
children: [
|
|
186
|
-
/*#__PURE__*/ jsx(LockToggleButton, {
|
|
197
|
+
void 0 !== leadingAddon ? leadingAddon : /*#__PURE__*/ jsx(LockToggleButton, {
|
|
187
198
|
locked: locked,
|
|
188
199
|
onLockedChange: onLockedChange
|
|
189
200
|
}),
|
|
@@ -236,17 +247,7 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
236
247
|
"aria-invalid": error ? true : void 0,
|
|
237
248
|
"aria-describedby": error ? validationId : void 0,
|
|
238
249
|
"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
|
-
})
|
|
250
|
+
}) : null
|
|
250
251
|
]
|
|
251
252
|
}),
|
|
252
253
|
error && !typeMeta.supportsExpression && /*#__PURE__*/ jsx("p", {
|
|
@@ -256,7 +257,8 @@ function LockableValueField({ value = '', onValueChange, onValueBlur, locked = t
|
|
|
256
257
|
"aria-atomic": "true",
|
|
257
258
|
className: "mt-1 text-xs leading-4 text-error",
|
|
258
259
|
children: error
|
|
259
|
-
})
|
|
260
|
+
}),
|
|
261
|
+
belowValue
|
|
260
262
|
]
|
|
261
263
|
});
|
|
262
264
|
}
|
|
@@ -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,13 +72,15 @@ 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). */
|
|
67
80
|
headerActions?: ReactNode;
|
|
68
81
|
/** Forces the header row into its narrow-container icon-only layout, regardless of actual width. For demos/comparisons. */
|
|
69
82
|
compact?: boolean;
|
|
70
|
-
/**
|
|
83
|
+
/** @deprecated Controls are always visible. Retained as a no-op for backwards compatibility. */
|
|
71
84
|
controlsVisibility?: 'visible' | 'hover';
|
|
72
85
|
/** 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. */
|
|
73
86
|
showFieldActions?: boolean;
|
|
@@ -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
|
}
|
|
@@ -3616,9 +3619,6 @@
|
|
|
3616
3619
|
.\!px-1\.5 {
|
|
3617
3620
|
padding-inline: calc(var(--spacing) * 1.5) !important;
|
|
3618
3621
|
}
|
|
3619
|
-
.\!px-2\.5 {
|
|
3620
|
-
padding-inline: calc(var(--spacing) * 2.5) !important;
|
|
3621
|
-
}
|
|
3622
3622
|
.\[padding-inline\:var\(--mf-content-inset\,0px\)\] {
|
|
3623
3623
|
padding-inline: var(--mf-content-inset,0px);
|
|
3624
3624
|
}
|
|
@@ -3853,10 +3853,6 @@
|
|
|
3853
3853
|
.font-sans {
|
|
3854
3854
|
font-family: var(--font-sans);
|
|
3855
3855
|
}
|
|
3856
|
-
.\!text-xs {
|
|
3857
|
-
font-size: var(--text-xs) !important;
|
|
3858
|
-
line-height: var(--tw-leading, var(--text-xs--line-height)) !important;
|
|
3859
|
-
}
|
|
3860
3856
|
.text-2xl {
|
|
3861
3857
|
font-size: var(--text-2xl);
|
|
3862
3858
|
line-height: var(--tw-leading, var(--text-2xl--line-height));
|
|
@@ -3916,6 +3912,10 @@
|
|
|
3916
3912
|
.text-\[40px\] {
|
|
3917
3913
|
font-size: 40px;
|
|
3918
3914
|
}
|
|
3915
|
+
.leading-3 {
|
|
3916
|
+
--tw-leading: calc(var(--spacing) * 3);
|
|
3917
|
+
line-height: calc(var(--spacing) * 3);
|
|
3918
|
+
}
|
|
3919
3919
|
.leading-4 {
|
|
3920
3920
|
--tw-leading: calc(var(--spacing) * 4);
|
|
3921
3921
|
line-height: calc(var(--spacing) * 4);
|
|
@@ -4287,6 +4287,9 @@
|
|
|
4287
4287
|
.underline-offset-4 {
|
|
4288
4288
|
text-underline-offset: 4px;
|
|
4289
4289
|
}
|
|
4290
|
+
.accent-brand {
|
|
4291
|
+
accent-color: var(--brand);
|
|
4292
|
+
}
|
|
4290
4293
|
.accent-primary {
|
|
4291
4294
|
accent-color: var(--primary);
|
|
4292
4295
|
}
|
|
@@ -4522,11 +4525,6 @@
|
|
|
4522
4525
|
rotate: 90deg;
|
|
4523
4526
|
}
|
|
4524
4527
|
}
|
|
4525
|
-
.group-focus-within\:opacity-100 {
|
|
4526
|
-
&:is(:where(.group):focus-within *) {
|
|
4527
|
-
opacity: 100%;
|
|
4528
|
-
}
|
|
4529
|
-
}
|
|
4530
4528
|
.group-focus-within\/input\:bg-foreground-accent {
|
|
4531
4529
|
&:is(:where(.group\/input):focus-within *) {
|
|
4532
4530
|
background-color: var(--foreground-accent);
|
|
@@ -5604,11 +5602,6 @@
|
|
|
5604
5602
|
}
|
|
5605
5603
|
}
|
|
5606
5604
|
}
|
|
5607
|
-
.has-\[\[aria-expanded\=true\]\]\:opacity-100 {
|
|
5608
|
-
&:has(*:is([aria-expanded=true])) {
|
|
5609
|
-
opacity: 100%;
|
|
5610
|
-
}
|
|
5611
|
-
}
|
|
5612
5605
|
.has-\[\[data-slot\=input-group-control\]\:disabled\]\:cursor-not-allowed {
|
|
5613
5606
|
&:has(*:is([data-slot=input-group-control]:disabled)) {
|
|
5614
5607
|
cursor: not-allowed;
|