@cayuse-test/react 1.0.5 → 1.0.7

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.
@@ -20,7 +20,6 @@ import {
20
20
  isNonEmptyString,
21
21
  isNumber,
22
22
  isObject,
23
- isObjectWithKey,
24
23
  isUrl,
25
24
  loginWithRedirect,
26
25
  request
@@ -38,7 +37,7 @@ import {
38
37
  } from "./chunk-M2L7SQBQ.js";
39
38
 
40
39
  // packages/components/attachments-form/attachments-form.tsx
41
- import React11, { useState as useState2, useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef } from "react";
40
+ import React10, { useState as useState2, useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef } from "react";
42
41
  import { merge as merge2 } from "lodash-es";
43
42
 
44
43
  // packages/components/banner-notification/banner-notification.tsx
@@ -196,7 +195,6 @@ var LoginButton = ({ tenantId, label, ...rest }) => {
196
195
  }
197
196
  );
198
197
  };
199
- var login_button_default = LoginButton;
200
198
 
201
199
  // packages/components/banner-notification/utils.tsx
202
200
  import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -229,7 +227,7 @@ var getNotificationTypeOptions = (type) => {
229
227
  defaultMessage: /* @__PURE__ */ jsxs2(Fragment, { children: [
230
228
  /* @__PURE__ */ jsx4("span", { children: defaultMessageConst.sessionExpired }),
231
229
  /* @__PURE__ */ jsx4(
232
- login_button_default,
230
+ LoginButton,
233
231
  {
234
232
  tenantId: global.__CAYUSE__.tenantId,
235
233
  label: defaultMessageConst.loginButtonLabel
@@ -316,7 +314,7 @@ function BannerNotifications({
316
314
  }
317
315
 
318
316
  // packages/components/form/file-upload/file-upload.tsx
319
- import React4 from "react";
317
+ import React3 from "react";
320
318
  import { useDropzone } from "react-dropzone";
321
319
 
322
320
  // packages/components/loading-indicator/loading-indicator.tsx
@@ -409,7 +407,7 @@ var defaultDictionary = {
409
407
  buttonText: "Upload File",
410
408
  uploadingText: "Uploading attachment..."
411
409
  };
412
- var FileUpload = React4.forwardRef(
410
+ var FileUpload = React3.forwardRef(
413
411
  function FileUpload2(props, ref) {
414
412
  const {
415
413
  className = "",
@@ -431,7 +429,7 @@ var FileUpload = React4.forwardRef(
431
429
  ...dropzoneOptions
432
430
  });
433
431
  const dictionary = { ...defaultDictionary, ...dctnr };
434
- React4.useEffect(() => {
432
+ React3.useEffect(() => {
435
433
  const fileUpload = document.querySelector(".file-upload");
436
434
  if (fileUpload) {
437
435
  fileUpload.removeAttribute("role");
@@ -459,7 +457,7 @@ var FileUpload = React4.forwardRef(
459
457
  }
460
458
  )
461
459
  ] }),
462
- React4.isValidElement(children) ? React4.cloneElement(children, {
460
+ React3.isValidElement(children) ? React3.cloneElement(children, {
463
461
  disabled
464
462
  }) : children
465
463
  ] });
@@ -467,14 +465,14 @@ var FileUpload = React4.forwardRef(
467
465
  );
468
466
 
469
467
  // packages/components/modal-dialog/alert-dialog.tsx
470
- import React5 from "react";
468
+ import React4 from "react";
471
469
  import { createPortal } from "react-dom";
472
470
  import FocusTrap from "focus-trap-react";
473
471
  import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
474
472
  var focusTrapOptions = {
475
473
  fallbackFocus: ".alert-dialog__modal__title"
476
474
  };
477
- var AlertDialog = React5.forwardRef(
475
+ var AlertDialog = React4.forwardRef(
478
476
  function AlertDialog2(props, ref) {
479
477
  const {
480
478
  isOpen = false,
@@ -486,7 +484,7 @@ var AlertDialog = React5.forwardRef(
486
484
  confirmText = "Confirm",
487
485
  hideCancel
488
486
  } = props;
489
- React5.useEffect(() => {
487
+ React4.useEffect(() => {
490
488
  if (isOpen) {
491
489
  document.addEventListener("keydown", handleKeyDown);
492
490
  }
@@ -645,11 +643,11 @@ import { useCallback } from "react";
645
643
  import { prettierBytes } from "@transloadit/prettier-bytes";
646
644
 
647
645
  // packages/components/formatted/formatted-date/formatted-date.tsx
648
- import React7 from "react";
646
+ import React6 from "react";
649
647
  import { format as formatter, parseISO, isValid } from "date-fns";
650
648
  import { utcToZonedTime, format as formatWithTz } from "date-fns-tz";
651
649
  import { jsx as jsx11 } from "react/jsx-runtime";
652
- var FormattedDate = React7.memo(function FormattedDate2(props) {
650
+ var FormattedDate = React6.memo(function FormattedDate2(props) {
653
651
  const {
654
652
  date,
655
653
  format: incomingFormat,
@@ -717,12 +715,12 @@ var FormattedDatetime = ({
717
715
  var formatted_datetime_default = FormattedDatetime;
718
716
 
719
717
  // packages/components/attachments-form/components/table-file-list/table-row-actions.tsx
720
- import React8 from "react";
718
+ import React7 from "react";
721
719
  import { jsx as jsx13 } from "react/jsx-runtime";
722
720
  var TableRowActions = (props) => {
723
721
  const { removeFile, file, disabled, dictionary, allowToRemoveByRoles } = props;
724
722
  const ctx = useTenantContext();
725
- const allowedToRemove = React8.useMemo(() => {
723
+ const allowedToRemove = React7.useMemo(() => {
726
724
  let allowToRemove = false;
727
725
  if (file.uploadedBy === ctx.data.user.id) {
728
726
  allowToRemove = true;
@@ -1042,7 +1040,7 @@ function RejectionsMessage({ rejections }) {
1042
1040
  ] }, k)) })
1043
1041
  ] });
1044
1042
  }
1045
- var AttachmentsForm = React11.forwardRef(function AttachmentsForm2({
1043
+ var AttachmentsForm = React10.forwardRef(function AttachmentsForm2({
1046
1044
  disabled = false,
1047
1045
  files: baseFiles,
1048
1046
  setFiles,
@@ -1139,7 +1137,7 @@ var AttachmentsForm = React11.forwardRef(function AttachmentsForm2({
1139
1137
  });
1140
1138
 
1141
1139
  // packages/components/attachments-form/accordion-attachments-form.tsx
1142
- import React12 from "react";
1140
+ import React11 from "react";
1143
1141
  import { merge as merge3 } from "lodash-es";
1144
1142
  import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1145
1143
  var defaultDictionary3 = {
@@ -1163,7 +1161,7 @@ var defaultDictionary3 = {
1163
1161
  exceedsSize: "The uploaded file exceeds the %{size} limit"
1164
1162
  }
1165
1163
  };
1166
- var AccordionAttachmentsForm = React12.forwardRef(
1164
+ var AccordionAttachmentsForm = React11.forwardRef(
1167
1165
  ({
1168
1166
  files,
1169
1167
  setFiles,
@@ -1177,8 +1175,8 @@ var AccordionAttachmentsForm = React12.forwardRef(
1177
1175
  dictionary: dctnr
1178
1176
  }, ref) => {
1179
1177
  const dictionary = merge3({}, defaultDictionary3, dctnr);
1180
- const [open, setOpen] = React12.useState(defaultOpen);
1181
- const { buttonId, panelId } = React12.useMemo(() => {
1178
+ const [open, setOpen] = React11.useState(defaultOpen);
1179
+ const { buttonId, panelId } = React11.useMemo(() => {
1182
1180
  return {
1183
1181
  buttonId: generateId("accordion-file-input-button"),
1184
1182
  panelId: generateId("accordion-file-input-panel")
@@ -1239,13 +1237,13 @@ var AccordionAttachmentsForm = React12.forwardRef(
1239
1237
  AccordionAttachmentsForm.displayName = "AccordionAttachmentsForm";
1240
1238
 
1241
1239
  // packages/components/attachments-form/accordion-form-wrapper.tsx
1242
- import React13 from "react";
1240
+ import React12 from "react";
1243
1241
  import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1244
- var AccordionFormWrapper = React13.forwardRef(function AccordionFormWrapper2(props, ref) {
1242
+ var AccordionFormWrapper = React12.forwardRef(function AccordionFormWrapper2(props, ref) {
1245
1243
  const { children, label, defaultOpen = false, disabled } = props;
1246
- const [open, setOpen] = React13.useState(defaultOpen);
1247
- const buttonId = React13.useId();
1248
- const panelId = React13.useId();
1244
+ const [open, setOpen] = React12.useState(defaultOpen);
1245
+ const buttonId = React12.useId();
1246
+ const panelId = React12.useId();
1249
1247
  return /* @__PURE__ */ jsxs12(
1250
1248
  "div",
1251
1249
  {
@@ -1321,10 +1319,10 @@ function BasePadding({
1321
1319
  }
1322
1320
 
1323
1321
  // packages/components/breadcrumbs/breadcrumbs.tsx
1324
- import React14 from "react";
1322
+ import React13 from "react";
1325
1323
  import { Link } from "react-router-dom";
1326
1324
  import { jsx as jsx20 } from "react/jsx-runtime";
1327
- var Breadcrumbs = React14.forwardRef(
1325
+ var Breadcrumbs = React13.forwardRef(
1328
1326
  function Breadcrumbs2({ isLoading, breadcrumbs }, ref) {
1329
1327
  if (!isNonEmptyArray(breadcrumbs)) {
1330
1328
  return null;
@@ -1506,10 +1504,10 @@ function ConfirmationModal({
1506
1504
  }
1507
1505
 
1508
1506
  // packages/components/covert-button/covert-button.tsx
1509
- import React16 from "react";
1507
+ import React15 from "react";
1510
1508
  import cn9 from "classnames";
1511
1509
  import { jsx as jsx24 } from "react/jsx-runtime";
1512
- var CovertButton = React16.forwardRef(function CovertButton2({ children, className, ...rest }, ref) {
1510
+ var CovertButton = React15.forwardRef(function CovertButton2({ children, className, ...rest }, ref) {
1513
1511
  return /* @__PURE__ */ jsx24(
1514
1512
  "button",
1515
1513
  {
@@ -1845,13 +1843,13 @@ var CustomDropdown = memo(function CustomDropdown2({
1845
1843
  });
1846
1844
 
1847
1845
  // packages/components/date-selector/date-selector.tsx
1848
- import React18 from "react";
1846
+ import React17 from "react";
1849
1847
  import cn11 from "classnames";
1850
1848
  import { useObjectRef as useObjectRef2 } from "react-aria";
1851
1849
  import DatePicker from "react-datepicker";
1852
1850
  import "react-datepicker/dist/react-datepicker.css";
1853
1851
  import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
1854
- var DateSelector = React18.forwardRef(function DateSelector2({
1852
+ var DateSelector = React17.forwardRef(function DateSelector2({
1855
1853
  customInputClass: className,
1856
1854
  customWrapperClass,
1857
1855
  onChange,
@@ -1866,7 +1864,7 @@ var DateSelector = React18.forwardRef(function DateSelector2({
1866
1864
  id,
1867
1865
  ...rest
1868
1866
  }, ref) {
1869
- const internalId = React18.useId();
1867
+ const internalId = React17.useId();
1870
1868
  const innerRef = useObjectRef2(ref);
1871
1869
  const invalid = required && !selectedDate;
1872
1870
  const dateTimeFormat = getDatetimeFormat();
@@ -2155,6 +2153,7 @@ var Checkbox = memo3(
2155
2153
  // packages/components/dynamic-table/components/checkbox-header-cell.tsx
2156
2154
  import { jsx as jsx31 } from "react/jsx-runtime";
2157
2155
  function CheckboxHeaderCell({
2156
+ disabled,
2158
2157
  onRowSelectionChange,
2159
2158
  isMultiSelect,
2160
2159
  rows
@@ -2176,6 +2175,7 @@ function CheckboxHeaderCell({
2176
2175
  return /* @__PURE__ */ jsx31("th", { "data-col": "select", children: /* @__PURE__ */ jsx31(
2177
2176
  Checkbox,
2178
2177
  {
2178
+ disabled,
2179
2179
  "aria-label": "select all",
2180
2180
  checked: isSelectedAll,
2181
2181
  onChange: toggleSelectAll,
@@ -2219,7 +2219,7 @@ function ExpandRowButton({
2219
2219
  }
2220
2220
 
2221
2221
  // packages/components/dynamic-table/components/table-body-content.tsx
2222
- import React22 from "react";
2222
+ import React21 from "react";
2223
2223
  import { isEmpty } from "lodash-es";
2224
2224
 
2225
2225
  // packages/components/dynamic-table/utils.ts
@@ -2236,11 +2236,11 @@ function renderCell({ value }) {
2236
2236
  }
2237
2237
 
2238
2238
  // packages/components/form/radio/radio.tsx
2239
- import React21 from "react";
2239
+ import React20 from "react";
2240
2240
  import cn13 from "classnames";
2241
2241
  import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
2242
- var Radio = React21.memo(
2243
- React21.forwardRef(function Radio2(props, ref) {
2242
+ var Radio = React20.memo(
2243
+ React20.forwardRef(function Radio2(props, ref) {
2244
2244
  const {
2245
2245
  label,
2246
2246
  name,
@@ -2259,7 +2259,7 @@ var Radio = React21.memo(
2259
2259
  inputProps = {},
2260
2260
  containerProps = {}
2261
2261
  } = props;
2262
- const helpTextAttrs = React21.useMemo(() => {
2262
+ const helpTextAttrs = React20.useMemo(() => {
2263
2263
  if (!helpText) {
2264
2264
  return {
2265
2265
  input: {},
@@ -2276,7 +2276,7 @@ var Radio = React21.memo(
2276
2276
  }
2277
2277
  };
2278
2278
  }, [helpText]);
2279
- const handleChange = React21.useCallback(
2279
+ const handleChange = React20.useCallback(
2280
2280
  (event) => {
2281
2281
  if (isFunction(onChange)) {
2282
2282
  onChange(event.target.value, optionData ?? {}, event);
@@ -2484,7 +2484,7 @@ function TableBodyContent(props) {
2484
2484
  return /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36("td", { colSpan: numColumns, children: /* @__PURE__ */ jsx36("span", { className: "dynamic-table__empty-data-message", children: noResultsLabel || "No results to display." }) }) });
2485
2485
  }
2486
2486
  return /* @__PURE__ */ jsx36(Fragment4, { children: rows.map((row, rowIndex) => {
2487
- return /* @__PURE__ */ jsxs22(React22.Fragment, { children: [
2487
+ return /* @__PURE__ */ jsxs22(React21.Fragment, { children: [
2488
2488
  /* @__PURE__ */ jsx36(
2489
2489
  RowContent,
2490
2490
  {
@@ -2725,6 +2725,7 @@ var DynamicTable = forwardRef4(
2725
2725
  isExpandable && /* @__PURE__ */ jsx38("th", { "data-col": "expand", scope: "col", children: /* @__PURE__ */ jsx38(
2726
2726
  ExpandRowButton,
2727
2727
  {
2728
+ disabled: isLoading || isRefresh,
2728
2729
  isExpanded: isExpandable,
2729
2730
  onClick: () => {
2730
2731
  if (expandedRows.length === 0) {
@@ -2745,6 +2746,7 @@ var DynamicTable = forwardRef4(
2745
2746
  isSelectable && /* @__PURE__ */ jsx38(
2746
2747
  CheckboxHeaderCell,
2747
2748
  {
2749
+ disabled: isLoading || isRefresh,
2748
2750
  isMultiSelect,
2749
2751
  rows: tableRows,
2750
2752
  onRowSelectionChange: handleRowSelectionChange
@@ -2771,7 +2773,6 @@ var DynamicTable = forwardRef4(
2771
2773
  children: /* @__PURE__ */ jsx38(
2772
2774
  TableBodyContent,
2773
2775
  {
2774
- children,
2775
2776
  rows: tableRows,
2776
2777
  headers: tableHeaders,
2777
2778
  isLoading,
@@ -2786,7 +2787,8 @@ var DynamicTable = forwardRef4(
2786
2787
  handleRowClick,
2787
2788
  noResultsLabel,
2788
2789
  expandedRows,
2789
- toggleExpandableRow
2790
+ toggleExpandableRow,
2791
+ children
2790
2792
  }
2791
2793
  )
2792
2794
  }
@@ -2903,11 +2905,11 @@ function Number2({ integer, ...rest }) {
2903
2905
  }
2904
2906
 
2905
2907
  // packages/components/form/radio-group/radio-group.tsx
2906
- import React25 from "react";
2908
+ import React24 from "react";
2907
2909
  import cn15 from "classnames";
2908
2910
  import { jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
2909
- var RadioGroup = React25.memo(
2910
- React25.forwardRef(function RadioGroup2(props, ref) {
2911
+ var RadioGroup = React24.memo(
2912
+ React24.forwardRef(function RadioGroup2(props, ref) {
2911
2913
  const {
2912
2914
  name,
2913
2915
  value,
@@ -2925,8 +2927,8 @@ var RadioGroup = React25.memo(
2925
2927
  inputProps = {},
2926
2928
  containerProps = {}
2927
2929
  } = props;
2928
- const groupName = React25.useId();
2929
- const errorUid = React25.useId();
2930
+ const groupName = React24.useId();
2931
+ const errorUid = React24.useId();
2930
2932
  return /* @__PURE__ */ jsxs26(
2931
2933
  "fieldset",
2932
2934
  {
@@ -2969,11 +2971,11 @@ var RadioGroup = React25.memo(
2969
2971
  );
2970
2972
 
2971
2973
  // packages/components/form/toggle/toggle.tsx
2972
- import React26 from "react";
2974
+ import React25 from "react";
2973
2975
  import cn16 from "classnames";
2974
2976
  import { jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
2975
- var Toggle = React26.memo(
2976
- React26.forwardRef(function Toggle2(props, ref) {
2977
+ var Toggle = React25.memo(
2978
+ React25.forwardRef(function Toggle2(props, ref) {
2977
2979
  const {
2978
2980
  label,
2979
2981
  id,
@@ -2989,7 +2991,7 @@ var Toggle = React26.memo(
2989
2991
  inputProps = {},
2990
2992
  withLoading = false
2991
2993
  } = props;
2992
- const [isLoading, setIsLoading] = React26.useState(false);
2994
+ const [isLoading, setIsLoading] = React25.useState(false);
2993
2995
  const handleChange = async (event) => {
2994
2996
  if (!isFunction(onChange)) {
2995
2997
  return;
@@ -3081,13 +3083,13 @@ var Toggle = React26.memo(
3081
3083
  );
3082
3084
 
3083
3085
  // packages/components/form/combobox/combobox.tsx
3084
- import React29 from "react";
3086
+ import React28 from "react";
3085
3087
  import cn17 from "classnames";
3086
3088
  import ReactSelect from "react-select";
3087
3089
  import AsyncReactSelect from "react-select/async";
3088
3090
 
3089
3091
  // packages/components/form/combobox/utils.tsx
3090
- import React27 from "react";
3092
+ import React26 from "react";
3091
3093
  import { has, omit, isNil } from "lodash-es";
3092
3094
  var SELECT_SUB_TYPES = {
3093
3095
  GROUP: "group",
@@ -3159,7 +3161,7 @@ var isAsyncComponent = (props) => {
3159
3161
  };
3160
3162
 
3161
3163
  // packages/components/form/combobox/components.tsx
3162
- import React28 from "react";
3164
+ import React27 from "react";
3163
3165
  import { components } from "react-select";
3164
3166
  import { jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
3165
3167
  var baseClearIcon = /* @__PURE__ */ jsx43(
@@ -3211,7 +3213,7 @@ var ClearIndicator = (props) => {
3211
3213
  },
3212
3214
  className: "combobox__clear-indicator",
3213
3215
  "data-action": "clear",
3214
- children: typeof ClearIcon === "function" ? ClearIcon(props) : React28.isValidElement(ClearIcon) ? ClearIcon : baseClearIcon
3216
+ children: typeof ClearIcon === "function" ? ClearIcon(props) : React27.isValidElement(ClearIcon) ? ClearIcon : baseClearIcon
3215
3217
  }
3216
3218
  );
3217
3219
  };
@@ -3220,17 +3222,17 @@ var StartIndicator = (props) => {
3220
3222
  return null;
3221
3223
  }
3222
3224
  const { StartIcon } = props.selectProps.components;
3223
- return /* @__PURE__ */ jsx43("div", { className: "combobox__start-icon", children: typeof StartIcon === "function" ? StartIcon(props) : React28.isValidElement(StartIcon) ? StartIcon : baseSearchIcon });
3225
+ return /* @__PURE__ */ jsx43("div", { className: "combobox__start-icon", children: typeof StartIcon === "function" ? StartIcon(props) : React27.isValidElement(StartIcon) ? StartIcon : baseSearchIcon });
3224
3226
  };
3225
3227
  var DropdownIndicator = (props) => {
3226
3228
  const { DropdownIcon } = props.selectProps.components;
3227
- return /* @__PURE__ */ jsx43(components.DropdownIndicator, { ...props, children: typeof DropdownIcon === "function" ? DropdownIcon(props) : React28.isValidElement(DropdownIcon) ? DropdownIcon : baseDropdownIcon });
3229
+ return /* @__PURE__ */ jsx43(components.DropdownIndicator, { ...props, children: typeof DropdownIcon === "function" ? DropdownIcon(props) : React27.isValidElement(DropdownIcon) ? DropdownIcon : baseDropdownIcon });
3228
3230
  };
3229
3231
  var MenuList = (props) => {
3230
- React28.useEffect(() => {
3232
+ React27.useEffect(() => {
3231
3233
  props.selectProps.updateFocusedOption();
3232
3234
  }, [props.options.length]);
3233
- React28.useEffect(() => {
3235
+ React27.useEffect(() => {
3234
3236
  props.selectProps.updateFocusedOption();
3235
3237
  }, [props.getValue()]);
3236
3238
  return /* @__PURE__ */ jsx43(components.MenuList, { ...props, children: props.children });
@@ -3275,7 +3277,7 @@ var Control = (props) => {
3275
3277
  };
3276
3278
  var MultiValueRemove = (props) => {
3277
3279
  const { ClearIcon } = props.selectProps.components;
3278
- return /* @__PURE__ */ jsx43(components.MultiValueRemove, { ...props, children: typeof ClearIcon === "function" ? ClearIcon(props) : React28.isValidElement(ClearIcon) ? ClearIcon : baseClearIcon });
3280
+ return /* @__PURE__ */ jsx43(components.MultiValueRemove, { ...props, children: typeof ClearIcon === "function" ? ClearIcon(props) : React27.isValidElement(ClearIcon) ? ClearIcon : baseClearIcon });
3279
3281
  };
3280
3282
  var Input3 = (props) => {
3281
3283
  const { describedById } = props.selectProps;
@@ -3290,7 +3292,7 @@ var Input3 = (props) => {
3290
3292
 
3291
3293
  // packages/components/form/combobox/combobox.tsx
3292
3294
  import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
3293
- var Combobox = React29.forwardRef(
3295
+ var Combobox = React28.forwardRef(
3294
3296
  function Combobox2(props, ref) {
3295
3297
  const {
3296
3298
  id,
@@ -3316,13 +3318,13 @@ var Combobox = React29.forwardRef(
3316
3318
  onKeyDown,
3317
3319
  ...rest
3318
3320
  } = props;
3319
- const internalId = React29.useId();
3320
- const describedById = React29.useId();
3321
- const selectRef = React29.useRef(null);
3321
+ const internalId = React28.useId();
3322
+ const describedById = React28.useId();
3323
+ const selectRef = React28.useRef(null);
3322
3324
  const isAsync = isAsyncComponent(props);
3323
3325
  const loadOptionsWithHiddenOptionsCount = (inputValue, ...args) => {
3324
3326
  return loadOptions(inputValue, ...args).then((result) => {
3325
- if (isObjectWithKey(result, "options")) {
3327
+ if ("options" in result) {
3326
3328
  return buildOptions(result.options, {
3327
3329
  inputValue,
3328
3330
  showNarrowCriteriaHint,
@@ -3331,6 +3333,9 @@ var Combobox = React29.forwardRef(
3331
3333
  });
3332
3334
  }
3333
3335
  return buildOptions(result, { inputValue });
3336
+ }).catch((error) => {
3337
+ console.error("Error loading options:", error);
3338
+ return { options: [] };
3334
3339
  });
3335
3340
  };
3336
3341
  const selectedValueFocusOption = () => {
@@ -3370,17 +3375,57 @@ var Combobox = React29.forwardRef(
3370
3375
  });
3371
3376
  }
3372
3377
  };
3378
+ const focusOption = (direction) => {
3379
+ const pageSize = selectRef.current.props.pageSize;
3380
+ const focusedOption = selectRef.current.state.focusedOption;
3381
+ const options = selectRef.current.getFocusableOptions();
3382
+ if (!options.length) return;
3383
+ let nextFocus = 0;
3384
+ let focusedIndex = options.indexOf(focusedOption);
3385
+ if (!focusedOption) {
3386
+ focusedIndex = -1;
3387
+ }
3388
+ while (true) {
3389
+ if (direction === "up") {
3390
+ nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
3391
+ focusedIndex--;
3392
+ } else if (direction === "down") {
3393
+ nextFocus = (focusedIndex + 1) % options.length;
3394
+ focusedIndex++;
3395
+ } else if (direction === "pageup") {
3396
+ nextFocus = focusedIndex - pageSize;
3397
+ if (nextFocus < 0) nextFocus = 0;
3398
+ } else if (direction === "pagedown") {
3399
+ nextFocus = focusedIndex + pageSize;
3400
+ if (nextFocus > options.length - 1) nextFocus = options.length - 1;
3401
+ } else if (direction === "last") {
3402
+ nextFocus = options.length - 1;
3403
+ focusedIndex--;
3404
+ }
3405
+ if (!options[nextFocus]?.subType) {
3406
+ break;
3407
+ }
3408
+ }
3409
+ selectRef.current.scrollToFocusedOptionOnUpdate = true;
3410
+ selectRef.current.setState({
3411
+ focusedOption: options[nextFocus],
3412
+ focusedValue: null,
3413
+ focusedOptionId: selectRef.current.getFocusedOptionId(options[nextFocus])
3414
+ });
3415
+ };
3373
3416
  const asyncProps = isAsync ? {
3374
3417
  cacheOptions: rest.cacheOptions ?? false,
3375
3418
  defaultOptions: rest.defaultOptions ?? false,
3376
3419
  loadOptions: loadOptions ? loadOptionsWithHiddenOptionsCount : void 0
3377
3420
  } : {};
3378
3421
  const selectProps = {
3422
+ "aria-label": label,
3379
3423
  ...rest,
3380
3424
  ...asyncProps,
3381
3425
  ref: (instance) => {
3382
3426
  if (instance) {
3383
3427
  selectRef.current = instance;
3428
+ selectRef.current.focusOption = focusOption;
3384
3429
  }
3385
3430
  },
3386
3431
  selectedValueFocusOption,
@@ -3410,8 +3455,7 @@ var Combobox = React29.forwardRef(
3410
3455
  },
3411
3456
  noOptionsMessage: noOptionsMessage ? typeof noOptionsMessage === "function" ? noOptionsMessage : () => noOptionsMessage : void 0,
3412
3457
  loadingMessage: loadingMessage ? typeof loadingMessage === "function" ? loadingMessage : () => loadingMessage : void 0,
3413
- unstyled: true,
3414
- "aria-label": label
3458
+ unstyled: true
3415
3459
  };
3416
3460
  return /* @__PURE__ */ jsxs29(
3417
3461
  "fieldset",
@@ -3426,7 +3470,7 @@ var Combobox = React29.forwardRef(
3426
3470
  required && /* @__PURE__ */ jsx44("span", { className: "combobox-fieldset__required", children: "*" }),
3427
3471
  label
3428
3472
  ] }),
3429
- React29.createElement(
3473
+ React28.createElement(
3430
3474
  isAsync ? AsyncReactSelect : ReactSelect,
3431
3475
  // @ts-expect-error type mismatch
3432
3476
  selectProps
@@ -3716,14 +3760,21 @@ function UserComboboxOption(props) {
3716
3760
  }
3717
3761
  )
3718
3762
  ] });
3719
- return /* @__PURE__ */ jsx48(components2.Option, { ...props, innerProps, children: /* @__PURE__ */ jsxs31("div", { className: "combobox__option-container", children: [
3720
- optionLabel,
3721
- !isExpandAll && isExpanded && /* @__PURE__ */ jsxs31("div", { className: "combobox__option--expanded", children: [
3722
- /* @__PURE__ */ jsx48("div", { children: data.user.email }),
3723
- /* @__PURE__ */ jsx48("div", { children: data.user.unitName }),
3724
- /* @__PURE__ */ jsx48("div", { children: data.user.profileTypes })
3725
- ] })
3726
- ] }) });
3763
+ return /* @__PURE__ */ jsx48(components2.Option, { ...props, innerProps, children: /* @__PURE__ */ jsxs31(
3764
+ "div",
3765
+ {
3766
+ className: "combobox__option-container",
3767
+ children: [
3768
+ optionLabel,
3769
+ !isExpandAll && isExpanded && /* @__PURE__ */ jsxs31("div", { className: "combobox__option--expanded", children: [
3770
+ /* @__PURE__ */ jsx48("div", { children: data.user.email }),
3771
+ /* @__PURE__ */ jsx48("div", { children: data.user.unitName }),
3772
+ /* @__PURE__ */ jsx48("div", { children: data.user.profileTypes })
3773
+ ] })
3774
+ ]
3775
+ },
3776
+ isExpandAll ? "expand-all" : data.value
3777
+ ) });
3727
3778
  }
3728
3779
 
3729
3780
  // packages/components/form/user-select/user-select.tsx
@@ -3748,17 +3799,14 @@ function UserSelect(props) {
3748
3799
  searchText: inputValue
3749
3800
  });
3750
3801
  const personOptions = items.map((it) => normalizeUserToOption(it));
3751
- const options = personOptions.length > 0 ? (
3752
- // @ts-ignore
3753
- [
3754
- {
3755
- label: "Expand All",
3756
- value: "expand-all",
3757
- isExpandAll: true
3758
- }
3759
- // @ts-ignore
3760
- ].concat(personOptions)
3761
- ) : personOptions;
3802
+ const options = personOptions.length > 0 ? [
3803
+ {
3804
+ label: "Expand All",
3805
+ value: "expand-all",
3806
+ isExpandAll: true
3807
+ }
3808
+ // @ts-expect-error expected
3809
+ ].concat(personOptions) : personOptions;
3762
3810
  return {
3763
3811
  options,
3764
3812
  hiddenOptionsCount: totalPages > 1 && totalElements - items.length
@@ -3793,7 +3841,7 @@ function UserSelect(props) {
3793
3841
  }
3794
3842
 
3795
3843
  // packages/components/form-note-attachments-view/form-note-attachments-view.tsx
3796
- import React35, { useState as useState10, useEffect as useEffect14 } from "react";
3844
+ import React34, { useState as useState10, useEffect as useEffect14 } from "react";
3797
3845
  import { merge as merge4 } from "lodash-es";
3798
3846
 
3799
3847
  // packages/components/prevent-leave-page-dialog/prevent-leave-page-dialog.tsx
@@ -3820,7 +3868,7 @@ var PreventLeaveDialog = memo5(function PreventLeaveDialog2({
3820
3868
  });
3821
3869
 
3822
3870
  // packages/components/formatted/formatted-rich-text/formatted-rich-text.tsx
3823
- import React32, { useRef as useRef6, useEffect as useEffect12, useState as useState7 } from "react";
3871
+ import React31, { useRef as useRef6, useEffect as useEffect12, useState as useState7 } from "react";
3824
3872
  import cn20 from "classnames";
3825
3873
  import Quill2 from "quill";
3826
3874
  import Linkify from "linkify-react";
@@ -3830,7 +3878,7 @@ var linkifyOptions = {
3830
3878
  target: "_blank",
3831
3879
  rel: "noopener noreferrer"
3832
3880
  };
3833
- var FormattedRichText = React32.memo(function FormattedRichText2({
3881
+ var FormattedRichText = React31.memo(function FormattedRichText2({
3834
3882
  className: incomingClassName,
3835
3883
  maxLength,
3836
3884
  singleLine,
@@ -4502,7 +4550,7 @@ function FormNoteAttachmentsView({
4502
4550
  const handleDrop = (acceptedFiles) => {
4503
4551
  setAttachments(attachments.concat(validateAttachments(acceptedFiles)));
4504
4552
  };
4505
- const hasInvalidNote = React35.useMemo(() => {
4553
+ const hasInvalidNote = React34.useMemo(() => {
4506
4554
  const plainText = convertToPlainText(newNoteMessage);
4507
4555
  return plainText.length > MAX_NOTE_LENGTH;
4508
4556
  }, [newNoteMessage]);
@@ -4732,9 +4780,9 @@ function FormNoteAttachmentsView({
4732
4780
  }
4733
4781
 
4734
4782
  // packages/components/formatted/formatted-value/formatted-value.tsx
4735
- import React36 from "react";
4783
+ import React35 from "react";
4736
4784
  import { jsx as jsx57 } from "react/jsx-runtime";
4737
- var FormattedValue = React36.memo(function FormattedValue2({
4785
+ var FormattedValue = React35.memo(function FormattedValue2({
4738
4786
  type,
4739
4787
  value,
4740
4788
  fallback,
@@ -5229,14 +5277,14 @@ import { useEffect as useEffect16, useRef as useRef7, forwardRef as forwardRef7
5229
5277
  import cn24 from "classnames";
5230
5278
 
5231
5279
  // packages/components/sub-header/sub-header.tsx
5232
- import React38 from "react";
5280
+ import React37 from "react";
5233
5281
  import cn23 from "classnames";
5234
5282
  function SubHeader({
5235
5283
  children,
5236
5284
  className,
5237
5285
  headingType = "h1"
5238
5286
  }) {
5239
- return React38.createElement(headingType, {
5287
+ return React37.createElement(headingType, {
5240
5288
  className: cn23("subHeader", className),
5241
5289
  children
5242
5290
  });
@@ -5665,10 +5713,10 @@ import cn25 from "classnames";
5665
5713
  import { useLocation, useHistory } from "react-router-dom";
5666
5714
 
5667
5715
  // packages/components/tabs/tab/tab.tsx
5668
- import React42 from "react";
5716
+ import React41 from "react";
5669
5717
  import { jsx as jsx65 } from "react/jsx-runtime";
5670
- var Tab = React42.memo(
5671
- React42.forwardRef(
5718
+ var Tab = React41.memo(
5719
+ React41.forwardRef(
5672
5720
  ({
5673
5721
  id,
5674
5722
  title,
@@ -5784,7 +5832,7 @@ function Tabs({ className, panes, disabled = false }) {
5784
5832
  }
5785
5833
 
5786
5834
  // packages/components/task-form/task-form.tsx
5787
- import React68, {
5835
+ import React66, {
5788
5836
  forwardRef as forwardRef9,
5789
5837
  memo as memo22,
5790
5838
  useCallback as useCallback13,
@@ -6424,7 +6472,7 @@ function UserComboboxOption2(props) {
6424
6472
  Icon,
6425
6473
  {
6426
6474
  color: "grey",
6427
- name: `chevron ${isExpandAll ? allExpanded ? "down" : "right" : isExpanded ? "down" : "right"}`
6475
+ name: `chevron-${isExpandAll ? allExpanded ? "down" : "right" : isExpanded ? "down" : "right"}`
6428
6476
  }
6429
6477
  ) }),
6430
6478
  /* @__PURE__ */ jsx67(
@@ -7772,7 +7820,7 @@ var milestoneDictionary = {
7772
7820
  import { memo as memo18, useRef as useRef11, useState as useState25 } from "react";
7773
7821
 
7774
7822
  // packages/components/task-form/linked-tasks/table-linked-tasks-list.tsx
7775
- import React59 from "react";
7823
+ import React57 from "react";
7776
7824
 
7777
7825
  // packages/components/task-form/linked-tasks/vo/task-categories.vo.ts
7778
7826
  var TASK_CATEGORIES = {
@@ -8027,7 +8075,7 @@ var tableColumns3 = [
8027
8075
  ];
8028
8076
  function TableLinkedTasksList({ disabled }) {
8029
8077
  const { values, onInputChange, refreshLinkedTasks } = useFormContext();
8030
- const rows = React59.useMemo(() => {
8078
+ const rows = React57.useMemo(() => {
8031
8079
  return [...values.tasksToLink, ...values.linkedTasks].filter(
8032
8080
  (task2) => !values.tasksIdsToRemove?.includes(task2.id)
8033
8081
  );
@@ -8679,14 +8727,14 @@ import { useState as useState28 } from "react";
8679
8727
  import { merge as merge7 } from "lodash-es";
8680
8728
 
8681
8729
  // packages/components/task-form/comments/table-row.tsx
8682
- import React63 from "react";
8730
+ import React61 from "react";
8683
8731
  import cn29 from "classnames";
8684
8732
  import { isNil as isNil4 } from "lodash-es";
8685
8733
  import { Fragment as Fragment9, jsx as jsx89, jsxs as jsxs61 } from "react/jsx-runtime";
8686
8734
  var TableRow2 = (props) => {
8687
- const [commentToRemove, setCommentToRemove] = React63.useState(null);
8688
- const [editingComment, setEditingComment] = React63.useState(false);
8689
- const [showCancelCommentEditingModal, setShowCancelCommentEditingModal] = React63.useState(false);
8735
+ const [commentToRemove, setCommentToRemove] = React61.useState(null);
8736
+ const [editingComment, setEditingComment] = React61.useState(false);
8737
+ const [showCancelCommentEditingModal, setShowCancelCommentEditingModal] = React61.useState(false);
8690
8738
  const { values, onInputChange } = useFormContext();
8691
8739
  const tenantCtx = useTenantContext();
8692
8740
  const { allowToRemoveByRoles, comment, disabled, dictionary } = props;
@@ -9784,7 +9832,7 @@ function hasUnsavedChanges2({
9784
9832
  )?.toDateString();
9785
9833
  return isBaseFieldsChanged(values, initialValues) || isAttachmentsChanged({ attachments }, initialValues) || isRemindersChanged(values, initialValues) || isCommentsChanged(values) || dueDateChanged || internalDateChanged;
9786
9834
  }
9787
- var TaskFormComponent = React68.forwardRef(function TaskFormComponent2(props, ref) {
9835
+ var TaskFormComponent = React66.forwardRef(function TaskFormComponent2(props, ref) {
9788
9836
  const {
9789
9837
  allowToRemoveAttachmentsByRoles,
9790
9838
  allowToRemoveCommentsByRoles,
@@ -10304,6 +10352,8 @@ export {
10304
10352
  MultiFileUpload,
10305
10353
  RichText,
10306
10354
  TextArea,
10355
+ normalizeUserToOption,
10356
+ UserComboboxOption,
10307
10357
  UserSelect,
10308
10358
  PreventLeaveDialog,
10309
10359
  FormattedRichText,
@@ -10332,4 +10382,4 @@ export {
10332
10382
  MilestoneProgress2 as MilestoneProgress,
10333
10383
  TaskFormHeader
10334
10384
  };
10335
- //# sourceMappingURL=chunk-JKHZBLRB.js.map
10385
+ //# sourceMappingURL=chunk-MLVINKXL.js.map