@headless-adminapp/fluent 0.0.17-alpha.52 → 0.0.17-alpha.55

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 (106) hide show
  1. package/App/AppHeaderContianer.js +13 -11
  2. package/App/AppLogo.js +1 -2
  3. package/App/LayoutProvider.js +3 -15
  4. package/App/NavigationContainer.js +2 -6
  5. package/App/QuickActionItem.js +1 -1
  6. package/App/utils.d.ts +1 -1
  7. package/App/utils.js +3 -4
  8. package/CommandBar/MenuItem.js +1 -1
  9. package/CommandBar/MenuItems.js +1 -4
  10. package/CommandBar/MenuList.js +1 -1
  11. package/DataGrid/CustomizeColumns/AddColumns.js +33 -34
  12. package/DataGrid/CustomizeColumns/ColumnItem.js +5 -5
  13. package/DataGrid/CustomizeColumns/CustomizeColumns.js +2 -3
  14. package/DataGrid/FormSubgridViewSelector.js +1 -5
  15. package/DataGrid/GridColumnHeader/ConditionValueControl.js +19 -25
  16. package/DataGrid/GridColumnHeader/FilterForm.js +6 -9
  17. package/DataGrid/GridColumnHeader/OperatorSelect.js +1 -1
  18. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +4 -4
  19. package/DataGrid/GridHeaderDesktop.js +1 -5
  20. package/DataGrid/GridHeaderMobile.js +1 -4
  21. package/DataGrid/GridListContainer.js +9 -7
  22. package/DataGrid/GridPaginationContainer.js +1 -2
  23. package/DataGrid/GridTableContainer.js +25 -20
  24. package/DataGrid/TableCell/TableCellBase.js +6 -1
  25. package/DataGrid/TableCell/TableCellCheckbox.js +2 -2
  26. package/DataGrid/TableCell/TableCellChoice.js +1 -2
  27. package/DataGrid/TableCell/TableCellLink.d.ts +1 -1
  28. package/DataGrid/TableCell/TableCellLink.js +5 -1
  29. package/DataGrid/useTableColumns.js +85 -41
  30. package/DialogContainer/AlertDialog.js +3 -6
  31. package/DialogContainer/ConfirmDialog.js +5 -9
  32. package/DialogContainer/DialogContainer.js +2 -13
  33. package/DialogContainer/ErrorDialog.js +3 -6
  34. package/DialogContainer/PromptDialog.js +22 -31
  35. package/Insights/CommandBarContainer.js +4 -1
  36. package/Insights/FilterBarContainer.js +12 -20
  37. package/Insights/WidgetDataGridContainer.js +11 -2
  38. package/Insights/WidgetTableContainer.js +2 -3
  39. package/Insights/WidgetTitleBar.js +1 -2
  40. package/Insights/charts/ComposedChart.js +1 -2
  41. package/Insights/charts/CustomTooltipContent.js +1 -1
  42. package/Insights/charts/OhlcChart.js +8 -7
  43. package/Insights/charts/PieChart.js +4 -8
  44. package/Insights/charts/RadarChart.js +2 -3
  45. package/Insights/charts/ScatterChart.js +4 -9
  46. package/Insights/charts/formatters.js +4 -6
  47. package/Insights/charts/renderers.js +1 -2
  48. package/Insights/hooks/useQueriesData.js +3 -12
  49. package/Insights/hooks/useWidgetDetail.js +9 -3
  50. package/OverflowCommandBar/OverflowMenu.js +4 -16
  51. package/OverflowCommandBar/render.js +3 -4
  52. package/OverflowCommandBar/utils.js +2 -3
  53. package/PageBoard/BoardColumnCard.d.ts +1 -1
  54. package/PageBoard/BoardColumnCard.js +3 -2
  55. package/PageBoard/BoardColumnUI.js +12 -17
  56. package/PageBoard/Header.js +3 -12
  57. package/PageBoard/PageBoard.d.ts +1 -1
  58. package/PageBoard/PageBoard.js +2 -3
  59. package/PageEntityForm/PageEntityFormDesktopContainer.js +8 -5
  60. package/PageEntityForm/RecordCard.js +8 -4
  61. package/PageEntityForm/RecordCardLoading.js +1 -2
  62. package/PageEntityForm/RecordSetNavigatorContainer.js +1 -2
  63. package/PageEntityForm/RelatedViewSelector.js +5 -10
  64. package/PageEntityForm/SectionContainer.js +7 -6
  65. package/PageEntityForm/StandardControl.d.ts +3 -3
  66. package/PageEntityForm/StandardControl.js +33 -32
  67. package/PageEntityForm/SubgridControl.js +2 -3
  68. package/ToastNotificationContainer/index.js +1 -2
  69. package/components/DndProvider.d.ts +12 -0
  70. package/components/DndProvider.js +68 -0
  71. package/components/LoginForm.js +5 -21
  72. package/form/FormControl.js +17 -28
  73. package/form/controls/AttachmentControl.js +13 -22
  74. package/form/controls/AttachmentsControl.js +8 -18
  75. package/form/controls/CurrencyControl.js +4 -4
  76. package/form/controls/DateControl.js +2 -2
  77. package/form/controls/DateRangeControl.js +4 -6
  78. package/form/controls/DateTimeControl.js +7 -7
  79. package/form/controls/DecimalControl.js +4 -4
  80. package/form/controls/DurationControl.js +3 -3
  81. package/form/controls/EmailControl.js +4 -4
  82. package/form/controls/IntegerControl.js +5 -5
  83. package/form/controls/LookupControl.d.ts +1 -0
  84. package/form/controls/LookupControl.js +50 -11
  85. package/form/controls/MultiSelectControl.js +3 -3
  86. package/form/controls/MultiSelectLookupControl.js +16 -17
  87. package/form/controls/PasswordControl.js +1 -1
  88. package/form/controls/RichTextControl.js +1 -1
  89. package/form/controls/SelectControl.js +4 -5
  90. package/form/controls/SwitchControl.js +1 -1
  91. package/form/controls/TelephoneControl.js +1 -1
  92. package/form/controls/TextAreaControl.js +4 -4
  93. package/form/controls/TextControl.js +4 -4
  94. package/form/controls/UrlControl.js +1 -1
  95. package/form/controls/useLookupData.js +26 -41
  96. package/form/layout/FormSection/FormSection.js +10 -3
  97. package/form/layout/FormTab/FormTab.js +2 -2
  98. package/package.json +4 -11
  99. package/utils/avatar.d.ts +2 -0
  100. package/utils/avatar.js +45 -0
  101. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
  102. package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
  103. package/form/controls/NumberControl.d.ts +0 -4
  104. package/form/controls/NumberControl.js +0 -16
  105. package/form/controls/utils.d.ts +0 -4
  106. package/form/controls/utils.js +0 -42
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DndProvider = void 0;
27
+ exports.useDndContext = useDndContext;
28
+ const jsx_runtime_1 = require("react/jsx-runtime");
29
+ const react_1 = require("react");
30
+ const DndProviderIntenral = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('react-dnd'))).then((mod) => ({ default: mod.DndProvider })));
31
+ let ReactDndPromise = null;
32
+ let HTML5BackendPromise = null;
33
+ const DndContext = (0, react_1.createContext)(null);
34
+ const DndProvider = ({ children }) => {
35
+ const [context, setContext] = (0, react_1.useState)(null);
36
+ (0, react_1.useEffect)(() => {
37
+ if (!HTML5BackendPromise) {
38
+ HTML5BackendPromise = Promise.resolve().then(() => __importStar(require('react-dnd-html5-backend'))).then((mod) => mod.HTML5Backend);
39
+ }
40
+ if (!ReactDndPromise) {
41
+ ReactDndPromise = Promise.resolve().then(() => __importStar(require('react-dnd')));
42
+ }
43
+ Promise.all([HTML5BackendPromise, ReactDndPromise])
44
+ .then(([backend, mod]) => {
45
+ setContext({
46
+ DndProvider: mod.DndProvider,
47
+ backend: backend,
48
+ useDrag: mod.useDrag,
49
+ useDrop: mod.useDrop,
50
+ });
51
+ })
52
+ .catch((err) => {
53
+ console.error(err);
54
+ });
55
+ }, []);
56
+ if (!context) {
57
+ return null;
58
+ }
59
+ return ((0, jsx_runtime_1.jsx)(DndContext.Provider, { value: context, children: (0, jsx_runtime_1.jsx)(DndProviderIntenral, { backend: context.backend, children: children }) }));
60
+ };
61
+ exports.DndProvider = DndProvider;
62
+ function useDndContext() {
63
+ const context = (0, react_1.useContext)(DndContext);
64
+ if (!context) {
65
+ throw new Error('useDndContext must be used within DndProvider');
66
+ }
67
+ return context;
68
+ }
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  Object.defineProperty(exports, "__esModule", { value: true });
35
26
  exports.LoginForm = LoginForm;
36
27
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -56,19 +47,18 @@ function LoginForm(props) {
56
47
  defaultValues: initialValues,
57
48
  resolver: (0, yup_1.yupResolver)(validationSchema),
58
49
  });
59
- const handleOnSubmit = (values) => __awaiter(this, void 0, void 0, function* () {
60
- var _a, _b;
50
+ const handleOnSubmit = async (values) => {
61
51
  form.clearErrors();
62
52
  try {
63
- yield props.onLogin((_a = values.username) === null || _a === void 0 ? void 0 : _a.toLowerCase().trim(), values.password);
53
+ await props.onLogin(values.username?.toLowerCase().trim(), values.password);
64
54
  }
65
55
  catch (error) {
66
56
  form.setError('root', {
67
57
  type: 'manual',
68
- message: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : 'An error occurred',
58
+ message: error?.message ?? 'An error occurred',
69
59
  });
70
60
  }
71
- });
61
+ };
72
62
  return ((0, jsx_runtime_1.jsx)("form", { onSubmit: form.handleSubmit(handleOnSubmit), children: (0, jsx_runtime_1.jsxs)("div", { style: {
73
63
  display: 'flex',
74
64
  flexDirection: 'column',
@@ -88,13 +78,7 @@ function LoginForm(props) {
88
78
  alignItems: 'stretch',
89
79
  justifyContent: 'flex-start',
90
80
  gap: 16,
91
- }, children: [(0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "username", render: ({ field, fieldState, formState }) => {
92
- var _a, _b, _c;
93
- return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Username", labelPosition: "top", required: true, isError: !!((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) && formState.isSubmitted, errorMessage: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, children: (0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { placeholder: "Username", appearance: "outline", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, autoCapitalize: "none", autoCorrect: "off", error: !!((_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) && formState.isSubmitted }) }));
94
- } }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "password", render: ({ field, fieldState, formState }) => {
95
- var _a, _b, _c;
96
- return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Password", labelPosition: "top", required: true, isError: !!((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) && formState.isSubmitted, errorMessage: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, children: (0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, { placeholder: "Password", name: field.name, appearance: "outline", error: !!((_c = fieldState.error) === null || _c === void 0 ? void 0 : _c.message) && formState.isSubmitted, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) }));
97
- } }), !!form.formState.errors.root && ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: "error", children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: form.formState.errors.root.message }) })), (0, jsx_runtime_1.jsxs)(react_components_1.Button, { appearance: "primary", type: "submit", style: {
81
+ }, children: [(0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "username", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Username", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { placeholder: "Username", appearance: "outline", name: field.name, value: field.value, onChange: field.onChange, onBlur: field.onBlur, autoCapitalize: "none", autoCorrect: "off", error: !!fieldState.error?.message && formState.isSubmitted }) })) }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: form.control, name: "password", render: ({ field, fieldState, formState }) => ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: "Password", labelPosition: "top", required: true, isError: !!fieldState.error?.message && formState.isSubmitted, errorMessage: fieldState.error?.message, children: (0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, { placeholder: "Password", name: field.name, appearance: "outline", error: !!fieldState.error?.message && formState.isSubmitted, value: field.value, onChange: field.onChange, onBlur: field.onBlur }) })) }), !!form.formState.errors.root && ((0, jsx_runtime_1.jsx)(react_components_1.MessageBar, { intent: "error", children: (0, jsx_runtime_1.jsx)(react_components_1.MessageBarBody, { children: form.formState.errors.root.message }) })), (0, jsx_runtime_1.jsxs)(react_components_1.Button, { appearance: "primary", type: "submit", style: {
98
82
  marginTop: 8,
99
83
  pointerEvents: form.formState.isSubmitting ? 'none' : 'auto',
100
84
  }, children: [form.formState.isSubmitting && ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny", appearance: "inverted", style: { marginRight: 4 } })), "Login"] })] }), (0, jsx_runtime_1.jsx)("div", { style: { height: 80 } })] }) }));
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
@@ -34,7 +23,7 @@ const TextAreaControl_1 = require("./controls/TextAreaControl");
34
23
  const TextControl_1 = require("./controls/TextControl");
35
24
  const FormControlLoading_1 = require("./FormControlLoading");
36
25
  function Control(props) {
37
- const { type, label: _label, value, onChange } = props, rest = __rest(props, ["type", "label", "value", "onChange"]);
26
+ const { type, label: _label, value, onChange, ...rest } = props;
38
27
  switch (type) {
39
28
  case 'custom':
40
29
  return props.renderControl({
@@ -43,42 +32,42 @@ function Control(props) {
43
32
  disabled: props.disabled,
44
33
  });
45
34
  case 'text':
46
- return ((0, jsx_runtime_1.jsx)(TextControl_1.TextControl, Object.assign({ value: value, onChange: onChange }, rest)));
35
+ return ((0, jsx_runtime_1.jsx)(TextControl_1.TextControl, { value: value, onChange: onChange, ...rest }));
47
36
  case 'textarea':
48
- return ((0, jsx_runtime_1.jsx)(TextAreaControl_1.TextAreaControl, Object.assign({ value: value, onChange: onChange }, rest)));
37
+ return ((0, jsx_runtime_1.jsx)(TextAreaControl_1.TextAreaControl, { value: value, onChange: onChange, ...rest }));
49
38
  case 'telephone':
50
- return ((0, jsx_runtime_1.jsx)(TelephoneControl_1.TelephoneControl, Object.assign({ value: value, onChange: onChange }, rest)));
39
+ return ((0, jsx_runtime_1.jsx)(TelephoneControl_1.TelephoneControl, { value: value, onChange: onChange, ...rest }));
51
40
  case 'email':
52
- return ((0, jsx_runtime_1.jsx)(EmailControl_1.EmailControl, Object.assign({ value: value, onChange: onChange }, rest)));
41
+ return ((0, jsx_runtime_1.jsx)(EmailControl_1.EmailControl, { value: value, onChange: onChange, ...rest }));
53
42
  case 'password':
54
- return ((0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, Object.assign({ value: value, onChange: onChange }, rest)));
43
+ return ((0, jsx_runtime_1.jsx)(PasswordControl_1.PasswordControl, { value: value, onChange: onChange, ...rest }));
55
44
  case 'number':
56
- return ((0, jsx_runtime_1.jsx)(DecimalControl_1.DecimalControl, Object.assign({ value: value, onChange: onChange }, rest)));
45
+ return ((0, jsx_runtime_1.jsx)(DecimalControl_1.DecimalControl, { value: value, onChange: onChange, ...rest }));
57
46
  case 'currency':
58
- return ((0, jsx_runtime_1.jsx)(CurrencyControl_1.CurrencyControl, Object.assign({ value: value, onChange: onChange }, rest)));
47
+ return ((0, jsx_runtime_1.jsx)(CurrencyControl_1.CurrencyControl, { value: value, onChange: onChange, ...rest }));
59
48
  case 'date':
60
- return ((0, jsx_runtime_1.jsx)(DateControl_1.DateControl, Object.assign({ value: value, onChange: onChange }, rest)));
49
+ return ((0, jsx_runtime_1.jsx)(DateControl_1.DateControl, { value: value, onChange: onChange, ...rest }));
61
50
  case 'datetime':
62
- return ((0, jsx_runtime_1.jsx)(DateTimeControl_1.DateTimeControl, Object.assign({ value: value, onChange: onChange }, rest)));
51
+ return ((0, jsx_runtime_1.jsx)(DateTimeControl_1.DateTimeControl, { value: value, onChange: onChange, ...rest }));
63
52
  case 'select':
64
- return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, Object.assign({ value: value, onChange: onChange }, rest)));
53
+ return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, { value: value, onChange: onChange, ...rest }));
65
54
  case 'multi-select':
66
- return ((0, jsx_runtime_1.jsx)(MultiSelectControl_1.default, Object.assign({ value: value, onChange: onChange }, rest)));
55
+ return ((0, jsx_runtime_1.jsx)(MultiSelectControl_1.default, { value: value, onChange: onChange, ...rest }));
67
56
  case 'lookup':
68
- return ((0, jsx_runtime_1.jsx)(LookupControl_1.LookupControl, Object.assign({ value: value, onChange: onChange }, rest)));
57
+ return ((0, jsx_runtime_1.jsx)(LookupControl_1.LookupControl, { value: value, onChange: onChange, ...rest }));
69
58
  case 'lookups':
70
- return ((0, jsx_runtime_1.jsx)(MultiSelectLookupControl_1.MultiSelectLookupControl, Object.assign({ value: value, onChange: onChange }, rest)));
59
+ return ((0, jsx_runtime_1.jsx)(MultiSelectLookupControl_1.MultiSelectLookupControl, { value: value, onChange: onChange, ...rest }));
71
60
  case 'switch':
72
- return ((0, jsx_runtime_1.jsx)(SwitchControl_1.SwitchControl, Object.assign({ value: value, onChange: onChange }, rest)));
61
+ return ((0, jsx_runtime_1.jsx)(SwitchControl_1.SwitchControl, { value: value, onChange: onChange, ...rest }));
73
62
  default:
74
63
  return (0, jsx_runtime_1.jsx)("div", {});
75
64
  }
76
65
  }
77
66
  function FormControl(props) {
78
67
  const { label, id, onChange } = props;
79
- const _id = (0, react_1.useMemo)(() => id !== null && id !== void 0 ? id : (0, uuid_1.v4)(), [id]);
68
+ const _id = (0, react_1.useMemo)(() => id ?? (0, uuid_1.v4)(), [id]);
80
69
  const noop = (0, react_1.useCallback)(() => { }, []);
81
- return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Label, { style: { width: 160, marginTop: 4 }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(Control, Object.assign({ id: _id, onChange: onChange || noop }, props)) })] }));
70
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Label, { style: { width: 160, marginTop: 4 }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(Control, { id: _id, onChange: onChange || noop, ...props }) })] }));
82
71
  }
83
72
  FormControl.Loading = FormControlLoading_1.FormControlLoading;
84
73
  exports.default = FormControl;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.AttachmentControl = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -20,19 +11,19 @@ const react_1 = require("react");
20
11
  function useAttachmentSelector({ fileService, fileServiceContext, location, onChange, }) {
21
12
  const openErrorDialog = (0, hooks_1.useOpenErrorDialog)();
22
13
  const { isPending, mutate: handleFile } = (0, react_query_1.useMutation)({
23
- mutationFn: (file) => __awaiter(this, void 0, void 0, function* () {
14
+ mutationFn: async (file) => {
24
15
  if (location === 'local') {
25
16
  return (0, utils_1.fileToObject)(file);
26
17
  }
27
18
  else {
28
- const url = yield fileService.uploadFile(file, {
19
+ const url = await fileService.uploadFile(file, {
29
20
  context: fileServiceContext,
30
21
  });
31
22
  return (0, utils_1.urlToFileObject)(url);
32
23
  }
33
- }),
24
+ },
34
25
  onSuccess: (fileObject) => {
35
- onChange === null || onChange === void 0 ? void 0 : onChange(fileObject);
26
+ onChange?.(fileObject);
36
27
  },
37
28
  onError: (error) => {
38
29
  console.error(error);
@@ -48,14 +39,14 @@ function useAttachmentSelector({ fileService, fileServiceContext, location, onCh
48
39
  if (accept) {
49
40
  input.accept = accept;
50
41
  }
51
- input.onchange = (event) => __awaiter(this, void 0, void 0, function* () {
42
+ input.onchange = async (event) => {
52
43
  const files = event.target.files;
53
- if (!(files === null || files === void 0 ? void 0 : files.length)) {
44
+ if (!files?.length) {
54
45
  return;
55
46
  }
56
47
  const file = files[0];
57
48
  handleFile(file);
58
- });
49
+ };
59
50
  input.click();
60
51
  };
61
52
  return {
@@ -209,17 +200,17 @@ const ActionMenu = ({ format, value, disabled, readOnly, onChange, onChangeClick
209
200
  }, children: OpenText }), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Copy, {}), onClick: () => {
210
201
  navigator.clipboard.writeText(value.url).catch(() => { });
211
202
  }, children: "Copy Url" }), !(disabled || readOnly) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Edit, {}), onClick: () => {
212
- onChangeClick === null || onChangeClick === void 0 ? void 0 : onChangeClick();
213
- }, children: "Change" }), (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, {}), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, {}), onClick: () => __awaiter(void 0, void 0, void 0, function* () {
214
- const result = yield openConfirmDialog({
203
+ onChangeClick?.();
204
+ }, children: "Change" }), (0, jsx_runtime_1.jsx)(react_components_1.MenuDivider, {}), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, {}), onClick: async () => {
205
+ const result = await openConfirmDialog({
215
206
  title: 'Remove file',
216
207
  text: 'Are you sure you want to remove this file?',
217
208
  confirmButtonLabel: 'Remove',
218
209
  cancelButtonLabel: 'Cancel',
219
210
  });
220
- if (!(result === null || result === void 0 ? void 0 : result.confirmed)) {
211
+ if (!result?.confirmed) {
221
212
  return;
222
213
  }
223
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
224
- }), children: "Remove" })] }))] }) })] }));
214
+ onChange?.(null);
215
+ }, children: "Remove" })] }))] }) })] }));
225
216
  };
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.AttachmentsControl = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -21,25 +12,24 @@ const AttachmentsControl = ({ onChange, id, onBlur, onFocus, disabled, readOnly,
21
12
  flexWrap: 'wrap',
22
13
  columnGap: react_components_1.tokens.spacingHorizontalXS,
23
14
  gap: react_components_1.tokens.spacingHorizontalXS,
24
- }, children: [value === null || value === void 0 ? void 0 : value.map((file, index) => ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { as: "span", appearance: "brand", size: "small", shape: "rounded", dismissible: !disabled && !readOnly, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
15
+ }, children: [value?.map((file, index) => ((0, jsx_runtime_1.jsx)(react_components_1.Tag, { as: "span", appearance: "brand", size: "small", shape: "rounded", dismissible: !disabled && !readOnly, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
25
16
  if (disabled || readOnly)
26
17
  return;
27
- onChange === null || onChange === void 0 ? void 0 : onChange(value === null || value === void 0 ? void 0 : value.filter((_, i) => i !== index));
18
+ onChange?.(value?.filter((_, i) => i !== index));
28
19
  }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, { size: 16 }) }), children: (0, jsx_runtime_1.jsx)(react_components_1.Link, { href: file.url, target: "_blank", onClick: (event) => {
29
20
  event.preventDefault();
30
21
  event.stopPropagation();
31
22
  window.open(file.url, '_blank');
32
23
  }, children: (0, jsx_runtime_1.jsx)(react_components_1.Caption1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: file.name }) }) }, index))), !readOnly && !disabled && ((0, jsx_runtime_1.jsx)(react_components_1.Button, { size: "small", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, { size: 16 }), appearance: "outline", onClick: () => {
33
- var _a;
34
24
  if (readOnly)
35
25
  return;
36
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
37
- }, children: "Add" }))] }) }), (0, jsx_runtime_1.jsx)(react_components_1.TagPickerList, {})] }), (0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", multiple: true, style: { display: 'none' }, onChange: (event) => __awaiter(void 0, void 0, void 0, function* () {
26
+ inputRef.current?.click();
27
+ }, children: "Add" }))] }) }), (0, jsx_runtime_1.jsx)(react_components_1.TagPickerList, {})] }), (0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "file", multiple: true, style: { display: 'none' }, onChange: async (event) => {
38
28
  const files = event.target.files;
39
- if (files === null || files === void 0 ? void 0 : files.length) {
40
- const fileObjects = yield Promise.all(Array.from(files).map((file) => (0, utils_1.fileToObject)(file)));
41
- onChange === null || onChange === void 0 ? void 0 : onChange([...(value !== null && value !== void 0 ? value : []), ...fileObjects]);
29
+ if (files?.length) {
30
+ const fileObjects = await Promise.all(Array.from(files).map((file) => (0, utils_1.fileToObject)(file)));
31
+ onChange?.([...(value ?? []), ...fileObjects]);
42
32
  }
43
- }) })] }));
33
+ } })] }));
44
34
  };
45
35
  exports.AttachmentsControl = AttachmentsControl;
@@ -30,22 +30,22 @@ readOnly, }) {
30
30
  let value = e.target.value;
31
31
  if (!value) {
32
32
  setInternalValue('');
33
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
33
+ onChange?.(null);
34
34
  return;
35
35
  }
36
36
  value = value.replace(',', '');
37
37
  if (value === '-') {
38
38
  setInternalValue('-');
39
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
39
+ onChange?.(null);
40
40
  return;
41
41
  }
42
42
  if (isNaN(Number(value))) {
43
43
  return;
44
44
  }
45
45
  setInternalValue(value);
46
- onChange === null || onChange === void 0 ? void 0 : onChange(Number(value));
46
+ onChange?.(Number(value));
47
47
  };
48
- return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, autoFocus: autoFocus, name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), appearance: "filled-darker", onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), contentBefore: (0, jsx_runtime_1.jsx)("div", { children: symbol }), disabled: disabled, readOnly: readOnly, style: {
48
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, autoFocus: autoFocus, name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), appearance: "filled-darker", onFocus: () => onFocus?.(), contentBefore: (0, jsx_runtime_1.jsx)("div", { children: symbol }), disabled: disabled, readOnly: readOnly, style: {
49
49
  width: '100%',
50
50
  } }));
51
51
  }
@@ -18,12 +18,12 @@ dayjs_1.default.extend(timezone_1.default);
18
18
  function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
19
19
  const { dateFormats, timezone } = (0, locale_1.useLocale)();
20
20
  const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
21
- return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: placeholder, appearance: "filled-darker",
21
+ return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker",
22
22
  // size="sm"
23
23
  // error={error}
24
24
  // maxDate={maxDate}
25
25
  // minDate={minDate}
26
- disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => onChange === null || onChange === void 0 ? void 0 : onChange(date ? (0, dayjs_1.default)(date).tz(timezone).startOf('day').toISOString() : null), strings: datePickerStrings, contentAfter: (0, jsx_runtime_1.jsx)("div", { style: {
26
+ disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => onChange?.(date ? (0, dayjs_1.default)(date).tz(timezone).startOf('day').toISOString() : null), strings: datePickerStrings, contentAfter: (0, jsx_runtime_1.jsx)("div", { style: {
27
27
  display: 'flex',
28
28
  alignItems: 'center',
29
29
  justifyContent: 'center',
@@ -28,22 +28,20 @@ function DateRangeControl({ value, onChange, id, name, onBlur, onFocus, disabled
28
28
  : undefined;
29
29
  const _maxDate = maxDate ? new Date(maxDate) : to ? new Date(to) : undefined;
30
30
  const handleChangeFrom = (date) => {
31
- var _a;
32
31
  setFrom(date ? date.toISOString() : null);
33
32
  // if (date && to) {
34
- onChange === null || onChange === void 0 ? void 0 : onChange([(_a = date === null || date === void 0 ? void 0 : date.toISOString()) !== null && _a !== void 0 ? _a : null, to]);
33
+ onChange?.([date?.toISOString() ?? null, to]);
35
34
  // }
36
35
  };
37
36
  const handleChangeTo = (date) => {
38
- var _a;
39
37
  setTo(date ? date.toISOString() : null);
40
38
  // if (date && from) {
41
- onChange === null || onChange === void 0 ? void 0 : onChange([from, (_a = date === null || date === void 0 ? void 0 : date.toISOString()) !== null && _a !== void 0 ? _a : null]);
39
+ onChange?.([from, date?.toISOString() ?? null]);
42
40
  // }
43
41
  };
44
- return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: 8 }, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: "From", appearance: "filled-darker", disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).format(dateFormats.short) : '', value: from ? new Date(from) : null, onSelectDate: (date) => handleChangeFrom(date), strings: datePickerStrings, minDate: minDate, maxDate: _maxDate, style: { flex: 1 }, input: {
42
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', gap: 8 }, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: "From", appearance: "filled-darker", disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).format(dateFormats.short) : '', value: from ? new Date(from) : null, onSelectDate: (date) => handleChangeFrom(date), strings: datePickerStrings, minDate: minDate, maxDate: _maxDate, style: { flex: 1 }, input: {
45
43
  style: { width: '100%' },
46
- } }), (0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: "To", appearance: "filled-darker", disabled: disabled, readOnly: readOnly, formatDate: (date) => (date ? (0, dayjs_1.default)(date).format('YYYY-MM-DD') : ''), value: to ? new Date(to) : null, onSelectDate: (date) => handleChangeTo(date), strings: datePickerStrings, minDate: _minDate, maxDate: maxDate, style: { flex: 1 }, input: {
44
+ } }), (0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: "To", appearance: "filled-darker", disabled: disabled, readOnly: readOnly, formatDate: (date) => (date ? (0, dayjs_1.default)(date).format('YYYY-MM-DD') : ''), value: to ? new Date(to) : null, onSelectDate: (date) => handleChangeTo(date), strings: datePickerStrings, minDate: _minDate, maxDate: maxDate, style: { flex: 1 }, input: {
47
45
  style: { width: '100%' },
48
46
  } })] }));
49
47
  }
@@ -35,15 +35,15 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
35
35
  display: 'flex',
36
36
  alignItems: 'center',
37
37
  gap: react_components_1.tokens.spacingHorizontalS,
38
- }, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: placeholder, appearance: "filled-darker", formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormat) : '', disabled: disabled, readOnly: readOnly, value: value ? new Date(value) : null, onSelectDate: (date) => {
38
+ }, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker", formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormat) : '', disabled: disabled, readOnly: readOnly, value: value ? new Date(value) : null, onSelectDate: (date) => {
39
39
  if (!date) {
40
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
40
+ onChange?.(null);
41
41
  }
42
42
  else if (!value) {
43
- onChange === null || onChange === void 0 ? void 0 : onChange((0, dayjs_1.default)(date).tz(timezone, true).toISOString());
43
+ onChange?.((0, dayjs_1.default)(date).tz(timezone, true).toISOString());
44
44
  }
45
45
  else {
46
- onChange === null || onChange === void 0 ? void 0 : onChange((0, dayjs_1.default)(date)
46
+ onChange?.((0, dayjs_1.default)(date)
47
47
  .tz(timezone, true)
48
48
  .set('hour', (0, dayjs_1.default)(value).tz(timezone).hour())
49
49
  .set('minute', (0, dayjs_1.default)(value).tz(timezone).minute())
@@ -66,7 +66,7 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
66
66
  ? (0, dayjs_1.default)(value).tz(timezone)
67
67
  : (0, dayjs_1.default)().tz(timezone);
68
68
  if (data.selectedTime) {
69
- onChange === null || onChange === void 0 ? void 0 : onChange(dateValue
69
+ onChange?.(dateValue
70
70
  .set('hour', data.selectedTime.getHours())
71
71
  .set('minute', data.selectedTime.getMinutes())
72
72
  .toISOString());
@@ -82,14 +82,14 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
82
82
  .set('minute', resolvedTime.getMinutes())
83
83
  .toISOString();
84
84
  if (newValue !== value) {
85
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
85
+ onChange?.(newValue);
86
86
  }
87
87
  setInternalTimeValue(newValue ? (0, dayjs_1.default)(newValue).tz(timezone).format(timeFormat) : '');
88
88
  }
89
89
  }, onInput: (e) => {
90
90
  setInternalTimeValue(e.currentTarget.value);
91
91
  }, onBlur: () => {
92
- onBlur === null || onBlur === void 0 ? void 0 : onBlur();
92
+ onBlur?.();
93
93
  }, expandIcon: (0, jsx_runtime_1.jsx)("div", { style: {
94
94
  display: 'flex',
95
95
  alignItems: 'center',
@@ -25,13 +25,13 @@ function DecimalControl({ value, onChange, id, name, onBlur, onFocus, error, dis
25
25
  let value = e.target.value;
26
26
  if (!value) {
27
27
  setInternalValue('');
28
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
28
+ onChange?.(null);
29
29
  return;
30
30
  }
31
31
  value = value.replace(',', '');
32
32
  if (value === '-') {
33
33
  setInternalValue('-');
34
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
34
+ onChange?.(null);
35
35
  return;
36
36
  }
37
37
  if (isNaN(Number(value))) {
@@ -44,9 +44,9 @@ function DecimalControl({ value, onChange, id, name, onBlur, onFocus, error, dis
44
44
  }
45
45
  }
46
46
  setInternalValue(value);
47
- onChange === null || onChange === void 0 ? void 0 : onChange(Number(value));
47
+ onChange?.(Number(value));
48
48
  };
49
- return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), disabled: disabled, readOnly: readOnly, style: {
49
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), disabled: disabled, readOnly: readOnly, style: {
50
50
  width: '100%',
51
51
  } }));
52
52
  }
@@ -123,11 +123,11 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
123
123
  }
124
124
  if (newValue !== null) {
125
125
  console.log('onBlur', newValue);
126
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
126
+ onChange?.(newValue);
127
127
  }
128
128
  setSearchText(getDisplayValue(newValue));
129
129
  setFilterEnabled(false);
130
- onBlur === null || onBlur === void 0 ? void 0 : onBlur();
130
+ onBlur?.();
131
131
  }, onFocus: onFocus, id: id, autoFocus: autoFocus, onChange: (e) => {
132
132
  setFilterEnabled(true);
133
133
  setSearchText(e.target.value);
@@ -137,7 +137,7 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
137
137
  return;
138
138
  }
139
139
  else {
140
- onChange === null || onChange === void 0 ? void 0 : onChange(Number(item.optionValue));
140
+ onChange?.(Number(item.optionValue));
141
141
  }
142
142
  setSearchText('');
143
143
  }, children: filteredItems.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item.value, children: item.text }, item.value))) }) }));
@@ -9,11 +9,11 @@ function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder,
9
9
  // size="sm"
10
10
  value: value || '', onChange: (e) => {
11
11
  textTransform === 'uppercase'
12
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toUpperCase())
12
+ ? onChange?.(e.target.value.toUpperCase())
13
13
  : textTransform === 'lowercase'
14
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toLowerCase())
15
- : onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
16
- }, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
14
+ ? onChange?.(e.target.value.toLowerCase())
15
+ : onChange?.(e.target.value);
16
+ }, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
17
17
  // invalid={error}
18
18
  disabled: disabled, readOnly: readOnly, autoComplete: autoComplete, style: {
19
19
  flex: 1,
@@ -5,21 +5,21 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  /* eslint-disable unused-imports/no-unused-vars */
6
6
  const react_components_1 = require("@fluentui/react-components");
7
7
  function IntegerControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, borderOnFocusOnly, readOnly, }) {
8
- return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { appearance: "filled-darker", placeholder: placeholder, id: id, name: name, value: value !== null && value !== void 0 ? value : null, onChange: (e, data) => {
8
+ return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { appearance: "filled-darker", placeholder: placeholder, id: id, name: name, value: value ?? null, onChange: (e, data) => {
9
9
  if (data.value !== undefined) {
10
- onChange === null || onChange === void 0 ? void 0 : onChange(data.value);
10
+ onChange?.(data.value);
11
11
  }
12
12
  else if (!data.displayValue) {
13
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
13
+ onChange?.(null);
14
14
  }
15
15
  else if (data.displayValue !== undefined) {
16
16
  const newValue = parseFloat(data.displayValue);
17
17
  if (!Number.isNaN(newValue)) {
18
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
18
+ onChange?.(newValue);
19
19
  }
20
20
  }
21
21
  else {
22
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
22
+ onChange?.(null);
23
23
  }
24
24
  } }));
25
25
  }
@@ -11,6 +11,7 @@ export type DataLookup = {
11
11
  id: string;
12
12
  name: string;
13
13
  logicalName: string;
14
+ avatar?: string;
14
15
  };
15
16
  export type LookupControlProps = ControlProps<DataLookup> & {
16
17
  async?: boolean;