@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.
Files changed (46) hide show
  1. package/dist/components/ui/datetime-picker.cjs +19 -3
  2. package/dist/components/ui/datetime-picker.d.ts +2 -0
  3. package/dist/components/ui/datetime-picker.js +19 -3
  4. package/dist/components/ui/field-actions/insert-variable-action.cjs +1 -1
  5. package/dist/components/ui/field-actions/insert-variable-action.d.ts +5 -2
  6. package/dist/components/ui/field-actions/insert-variable-action.js +1 -1
  7. package/dist/components/ui/field-addons/field-menu.cjs +2 -2
  8. package/dist/components/ui/field-addons/field-menu.d.ts +4 -2
  9. package/dist/components/ui/field-addons/field-menu.js +2 -2
  10. package/dist/components/ui/index.cjs +295 -217
  11. package/dist/components/ui/index.d.ts +3 -2
  12. package/dist/components/ui/index.js +3 -2
  13. package/dist/components/ui/lockable-value-field/index.cjs +5 -5
  14. package/dist/components/ui/lockable-value-field/index.d.ts +18 -3
  15. package/dist/components/ui/lockable-value-field/index.js +2 -2
  16. package/dist/components/ui/quick-form-field/components/field-header.cjs +265 -0
  17. package/dist/components/ui/quick-form-field/components/field-header.d.ts +23 -0
  18. package/dist/components/ui/quick-form-field/components/field-header.js +231 -0
  19. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.cjs +3 -3
  20. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.d.ts +4 -1
  21. package/dist/components/ui/{lockable-value-field → quick-form-field}/components/lock-toggle-button.js +3 -3
  22. package/dist/components/ui/quick-form-field/index.cjs +46 -0
  23. package/dist/components/ui/quick-form-field/index.d.ts +3 -0
  24. package/dist/components/ui/quick-form-field/index.js +3 -0
  25. package/dist/components/ui/{lockable-value-field/lockable-value-field.cjs → quick-form-field/quick-form-field.cjs} +190 -119
  26. package/dist/components/ui/quick-form-field/quick-form-field.d.ts +26 -0
  27. package/dist/components/ui/{lockable-value-field/lockable-value-field.js → quick-form-field/quick-form-field.js} +194 -123
  28. package/dist/components/ui/{lockable-value-field → quick-form-field}/types.cjs +70 -0
  29. package/dist/components/ui/quick-form-field/types.d.ts +245 -0
  30. package/dist/components/ui/quick-form-field/types.js +137 -0
  31. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.cjs +21 -3
  32. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.d.ts +8 -3
  33. package/dist/components/ui/{lockable-value-field → quick-form-field}/utils.js +19 -4
  34. package/dist/components/ui/tree-view.cjs +6 -2
  35. package/dist/components/ui/tree-view.d.ts +35 -21
  36. package/dist/components/ui/tree-view.js +4 -3
  37. package/dist/index.cjs +14 -4
  38. package/dist/index.d.ts +6 -4
  39. package/dist/index.js +4 -3
  40. package/package.json +1 -1
  41. package/dist/components/ui/lockable-value-field/components/field-header.cjs +0 -242
  42. package/dist/components/ui/lockable-value-field/components/field-header.d.ts +0 -19
  43. package/dist/components/ui/lockable-value-field/components/field-header.js +0 -208
  44. package/dist/components/ui/lockable-value-field/lockable-value-field.d.ts +0 -14
  45. package/dist/components/ui/lockable-value-field/types.d.ts +0 -109
  46. package/dist/components/ui/lockable-value-field/types.js +0 -70
@@ -39,12 +39,28 @@ const external_popover_cjs_namespaceObject = require("./popover.cjs");
39
39
  const index_cjs_namespaceObject = require("../../lib/index.cjs");
40
40
  const external_form_field_cjs_namespaceObject = require("./form-field.cjs");
41
41
  const external_input_group_context_cjs_namespaceObject = require("./input-group-context.cjs");
42
- const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
43
- const [open, setOpen] = external_react_namespaceObject.useState(false);
42
+ const datetime_picker_DateTimePicker = /*#__PURE__*/ external_react_namespaceObject.forwardRef(function({ value, onValueChange, onOpenChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
43
+ const [open, setOpenState] = external_react_namespaceObject.useState(false);
44
+ const setOpen = (next)=>{
45
+ setOpenState(next);
46
+ onOpenChange?.(next);
47
+ };
44
48
  const generatedId = external_react_namespaceObject.useId();
45
49
  const validationId = errorId ?? `${id ?? `datetime-picker-${generatedId.replace(/:/g, '')}`}-error`;
46
50
  const [selectedDate, setSelectedDate] = external_react_namespaceObject.useState(value);
47
- const [timeValue, setTimeValue] = external_react_namespaceObject.useState(value ? (0, external_date_fns_namespaceObject.format)(value, use12Hour ? 'hh:mm a' : 'HH:mm') : '');
51
+ const [timeValue, setTimeValue] = external_react_namespaceObject.useState(value ? (0, external_date_fns_namespaceObject.format)(value, 'HH:mm') : '');
52
+ const valueTime = value?.getTime();
53
+ const [seededTime, setSeededTime] = external_react_namespaceObject.useState(valueTime);
54
+ if (!Object.is(valueTime, seededTime)) {
55
+ setSeededTime(valueTime);
56
+ if (void 0 === value) {
57
+ setSelectedDate(void 0);
58
+ setTimeValue('');
59
+ } else if (!Number.isNaN(valueTime)) {
60
+ setSelectedDate(value);
61
+ setTimeValue((0, external_date_fns_namespaceObject.format)(value, 'HH:mm'));
62
+ }
63
+ }
48
64
  const handleDateSelect = (date)=>{
49
65
  if (!date) return;
50
66
  if (selectedDate) {
@@ -4,6 +4,8 @@ export interface DateTimePickerProps {
4
4
  id?: string;
5
5
  value?: Date;
6
6
  onValueChange?: (date: Date | undefined) => void;
7
+ /** Called when the picker opens or closes, e.g. to commit the value on close. */
8
+ onOpenChange?: (open: boolean) => void;
7
9
  disabled?: boolean;
8
10
  placeholder?: string;
9
11
  className?: string;
@@ -11,12 +11,28 @@ import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
11
11
  import { cn } from "../../lib/index.js";
12
12
  import { FormFieldError } from "./form-field.js";
13
13
  import { useControlValidation, useInputGroup } from "./input-group-context.js";
14
- const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value, onValueChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
15
- const [open, setOpen] = useState(false);
14
+ const datetime_picker_DateTimePicker = /*#__PURE__*/ forwardRef(function({ value, onValueChange, onOpenChange, disabled, placeholder = 'Pick a date and time', className, use12Hour = false, id, error, errorId, 'aria-labelledby': ariaLabelledBy, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-errormessage': ariaErrorMessage }, ref) {
15
+ const [open, setOpenState] = useState(false);
16
+ const setOpen = (next)=>{
17
+ setOpenState(next);
18
+ onOpenChange?.(next);
19
+ };
16
20
  const generatedId = useId();
17
21
  const validationId = errorId ?? `${id ?? `datetime-picker-${generatedId.replace(/:/g, '')}`}-error`;
18
22
  const [selectedDate, setSelectedDate] = useState(value);
19
- const [timeValue, setTimeValue] = useState(value ? format(value, use12Hour ? 'hh:mm a' : 'HH:mm') : '');
23
+ const [timeValue, setTimeValue] = useState(value ? format(value, 'HH:mm') : '');
24
+ const valueTime = value?.getTime();
25
+ const [seededTime, setSeededTime] = useState(valueTime);
26
+ if (!Object.is(valueTime, seededTime)) {
27
+ setSeededTime(valueTime);
28
+ if (void 0 === value) {
29
+ setSelectedDate(void 0);
30
+ setTimeValue('');
31
+ } else if (!Number.isNaN(valueTime)) {
32
+ setSelectedDate(value);
33
+ setTimeValue(format(value, 'HH:mm'));
34
+ }
35
+ }
20
36
  const handleDateSelect = (date)=>{
21
37
  if (!date) return;
22
38
  if (selectedDate) {
@@ -60,7 +60,7 @@ function InsertVariableAction({ variables, onInsert, disabled, compact, strings
60
60
  if (open && lazy) setOpenedItems(variables());
61
61
  },
62
62
  onSelect: (variable)=>{
63
- if (variable.value) onInsert?.(variable.value);
63
+ if (variable.value) onInsert?.(variable.value, variable);
64
64
  },
65
65
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
66
66
  type: "button",
@@ -21,8 +21,11 @@ export interface InsertVariableActionProps {
21
21
  * source without re-rendering the field whenever it changes.
22
22
  */
23
23
  variables: VariablePickerItem[] | (() => VariablePickerItem[]);
24
- /** Called with the picked variable's value. Omitted, the action is disabled. */
25
- onInsert?: (value: string) => void;
24
+ /**
25
+ * Called with the picked variable's value, and the picked entry itself so a host can recover
26
+ * whatever it attached to it. Omitted, the action is disabled.
27
+ */
28
+ onInsert?: (value: string, item: VariablePickerItem) => void;
26
29
  disabled?: boolean;
27
30
  /** Icon only. Below a 260px `@container` the action also collapses to its icon by itself. */
28
31
  compact?: boolean;
@@ -31,7 +31,7 @@ function InsertVariableAction({ variables, onInsert, disabled, compact, strings
31
31
  if (open && lazy) setOpenedItems(variables());
32
32
  },
33
33
  onSelect: (variable)=>{
34
- if (variable.value) onInsert?.(variable.value);
34
+ if (variable.value) onInsert?.(variable.value, variable);
35
35
  },
36
36
  children: /*#__PURE__*/ jsxs("button", {
37
37
  type: "button",
@@ -67,7 +67,7 @@ function ValueModeMenuItem({ icon: Icon, label, description, active, disabled, o
67
67
  ]
68
68
  });
69
69
  }
70
- function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, strings }) {
70
+ function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, triggerLabel: triggerLabelOverride, strings }) {
71
71
  const text = {
72
72
  ...external_value_mode_strings_cjs_namespaceObject.DEFAULT_VALUE_MODE_STRINGS,
73
73
  ...strings
@@ -85,7 +85,7 @@ function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesD
85
85
  ] : baseModes;
86
86
  const activeMode = resolvedModes.find((item)=>item.id === mode);
87
87
  const TriggerIcon = modesDisabled ? external_lucide_react_namespaceObject.MoreHorizontal : activeMode?.icon ?? external_lucide_react_namespaceObject.Type;
88
- const triggerLabel = modesDisabled ? text.fieldActions : activeMode?.title ?? text.literalTitle;
88
+ const triggerLabel = modesDisabled ? text.fieldActions : triggerLabelOverride ?? activeMode?.title ?? text.literalTitle;
89
89
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
90
90
  children: [
91
91
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
@@ -29,6 +29,8 @@ interface FieldMenuBaseProps<Id extends string> {
29
29
  expectedType?: string;
30
30
  /** Overrides the built-in Fixed value description. */
31
31
  literalDescription?: string;
32
+ /** Names the trigger while it offers modes. Defaults to the active mode's title. */
33
+ triggerLabel?: string;
32
34
  /** Overrides for any subset of the English strings. */
33
35
  strings?: Partial<ValueModeStrings>;
34
36
  }
@@ -49,7 +51,7 @@ type OwnModes<Id extends string> = {
49
51
  };
50
52
  /**
51
53
  * One selectable mode in a value-mode dropdown: icon and label, with an optional description.
52
- * Shared with LockableValueField's mode dropdown, and not exported from the package.
54
+ * Shared with QuickFormField's mode dropdown, and not exported from the package.
53
55
  */
54
56
  export declare function ValueModeMenuItem({ icon: Icon, label, description, active, disabled, onClick, }: {
55
57
  icon: LucideIcon;
@@ -64,5 +66,5 @@ export declare function ValueModeMenuItem({ icon: Icon, label, description, acti
64
66
  * shows the current mode's icon and is named by its title; with the modes hidden it is the field's
65
67
  * overflow menu.
66
68
  */
67
- export declare function FieldMenu<Id extends string = ValueMode>({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, strings, }: FieldMenuProps<Id>): import("react/jsx-runtime").JSX.Element;
69
+ export declare function FieldMenu<Id extends string = ValueMode>({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, triggerLabel: triggerLabelOverride, strings, }: FieldMenuProps<Id>): import("react/jsx-runtime").JSX.Element;
68
70
  export {};
@@ -38,7 +38,7 @@ function ValueModeMenuItem({ icon: Icon, label, description, active, disabled, o
38
38
  ]
39
39
  });
40
40
  }
41
- function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, strings }) {
41
+ function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesDisabled, disabled, expectedType, literalDescription, triggerLabel: triggerLabelOverride, strings }) {
42
42
  const text = {
43
43
  ...DEFAULT_VALUE_MODE_STRINGS,
44
44
  ...strings
@@ -56,7 +56,7 @@ function FieldMenu({ mode, onSelect, modes, extraModes, actions, checked, modesD
56
56
  ] : baseModes;
57
57
  const activeMode = resolvedModes.find((item)=>item.id === mode);
58
58
  const TriggerIcon = modesDisabled ? MoreHorizontal : activeMode?.icon ?? Type;
59
- const triggerLabel = modesDisabled ? text.fieldActions : activeMode?.title ?? text.literalTitle;
59
+ const triggerLabel = modesDisabled ? text.fieldActions : triggerLabelOverride ?? activeMode?.title ?? text.literalTitle;
60
60
  return /*#__PURE__*/ jsxs(DropdownMenu, {
61
61
  children: [
62
62
  /*#__PURE__*/ jsx(DropdownMenuTrigger, {