@headless-adminapp/fluent 0.0.17-alpha.53 → 0.0.17-alpha.56

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 (178) hide show
  1. package/App/App.js +11 -7
  2. package/App/AppHeaderContianer.js +50 -44
  3. package/App/AppLogo.js +12 -9
  4. package/App/AppStringContext.js +13 -9
  5. package/App/AppUI.js +15 -11
  6. package/App/LayoutProvider.js +16 -24
  7. package/App/NavigationContainer.js +28 -28
  8. package/App/QuickActionItem.js +10 -6
  9. package/App/index.js +5 -1
  10. package/App/utils.js +7 -5
  11. package/CommandBar/Button.js +17 -14
  12. package/CommandBar/Divider.js +9 -6
  13. package/CommandBar/IconButton.js +16 -13
  14. package/CommandBar/Label.js +11 -8
  15. package/CommandBar/MenuButton.js +20 -17
  16. package/CommandBar/MenuItem.js +19 -16
  17. package/CommandBar/MenuItems.js +10 -10
  18. package/CommandBar/MenuList.js +12 -9
  19. package/CommandBar/Wrapper.js +10 -7
  20. package/CommandBar/index.js +15 -13
  21. package/DataForm/SectionControl.js +7 -4
  22. package/DataGrid/ActionCell.js +14 -11
  23. package/DataGrid/CommandContainer.js +10 -6
  24. package/DataGrid/CustomizeColumns/AddColumns.js +61 -59
  25. package/DataGrid/CustomizeColumns/ColumnItem.js +23 -19
  26. package/DataGrid/CustomizeColumns/CustomizeColumns.js +41 -36
  27. package/DataGrid/CustomizeColumns/index.js +5 -1
  28. package/DataGrid/FormSubgridCommandContainer.js +17 -13
  29. package/DataGrid/FormSubgridViewSelector.js +21 -21
  30. package/DataGrid/GridColumnHeader/ConditionValueControl.js +33 -33
  31. package/DataGrid/GridColumnHeader/FilterForm.js +28 -27
  32. package/DataGrid/GridColumnHeader/OperatorSelect.js +19 -13
  33. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +35 -31
  34. package/DataGrid/GridColumnHeader/index.js +5 -1
  35. package/DataGrid/GridColumnHeader/utils.js +6 -2
  36. package/DataGrid/GridHeaderContainer.js +8 -4
  37. package/DataGrid/GridHeaderDesktop.js +28 -28
  38. package/DataGrid/GridHeaderMobile.js +20 -19
  39. package/DataGrid/GridListContainer.js +50 -44
  40. package/DataGrid/GridPaginationContainer.js +16 -13
  41. package/DataGrid/GridTableContainer.js +98 -89
  42. package/DataGrid/TableCell/TableCellAction.js +15 -11
  43. package/DataGrid/TableCell/TableCellBase.js +13 -4
  44. package/DataGrid/TableCell/TableCellCheckbox.js +11 -8
  45. package/DataGrid/TableCell/TableCellChoice.js +15 -13
  46. package/DataGrid/TableCell/TableCellLink.js +14 -11
  47. package/DataGrid/TableCell/TableCellText.js +10 -7
  48. package/DataGrid/TableCell/index.js +20 -4
  49. package/DataGrid/index.js +11 -4
  50. package/DataGrid/types.js +2 -1
  51. package/DataGrid/useTableColumns.js +98 -103
  52. package/DataGrid/utils.js +5 -1
  53. package/DialogContainer/AlertDialog.js +11 -11
  54. package/DialogContainer/ConfirmDialog.js +13 -14
  55. package/DialogContainer/DialogContainer.js +19 -26
  56. package/DialogContainer/ErrorDialog.js +15 -15
  57. package/DialogContainer/PromptDialog.js +76 -58
  58. package/DialogContainer/index.js +5 -1
  59. package/Insights/CommandBarContainer.js +17 -11
  60. package/Insights/FilterBarContainer.js +32 -37
  61. package/Insights/Grid.js +13 -9
  62. package/Insights/InsightsContainer.js +22 -19
  63. package/Insights/WidgetChartContainer.js +34 -30
  64. package/Insights/WidgetDataGridContainer.js +45 -33
  65. package/Insights/WidgetTableContainer.js +29 -26
  66. package/Insights/WidgetTileContainer.js +16 -12
  67. package/Insights/WidgetTitleBar.js +15 -10
  68. package/Insights/Widgets.js +28 -25
  69. package/Insights/charts/AreaChart.js +15 -12
  70. package/Insights/charts/BarChart.js +15 -12
  71. package/Insights/charts/ComposedChart.js +15 -13
  72. package/Insights/charts/CustomTooltipContent.js +13 -9
  73. package/Insights/charts/GaugeChart.js +6 -3
  74. package/Insights/charts/LineChart.js +15 -12
  75. package/Insights/charts/OhlcChart.js +46 -40
  76. package/Insights/charts/PieChart.js +25 -26
  77. package/Insights/charts/RadarChart.js +19 -17
  78. package/Insights/charts/ScatterChart.js +26 -28
  79. package/Insights/charts/constants.js +4 -1
  80. package/Insights/charts/formatters.js +33 -23
  81. package/Insights/charts/index.js +2 -1
  82. package/Insights/charts/renderers.js +36 -26
  83. package/Insights/hooks/useQueriesData.js +27 -30
  84. package/Insights/hooks/useWidgetDetail.js +24 -15
  85. package/OverflowCommandBar/OverflowCommandBar.js +19 -12
  86. package/OverflowCommandBar/OverflowMenu.js +22 -30
  87. package/OverflowCommandBar/OverflowMenuDivider.js +10 -6
  88. package/OverflowCommandBar/index.js +9 -3
  89. package/OverflowCommandBar/render.js +15 -10
  90. package/OverflowCommandBar/utils.js +6 -4
  91. package/PageBoard/BoardColumn.js +8 -5
  92. package/PageBoard/BoardColumnCard.d.ts +1 -1
  93. package/PageBoard/BoardColumnCard.js +15 -11
  94. package/PageBoard/BoardColumnUI.js +45 -46
  95. package/PageBoard/BoardingColumnCardLoading.js +13 -10
  96. package/PageBoard/Header.js +23 -28
  97. package/PageBoard/PageBoard.js +28 -26
  98. package/PageBoard/index.js +5 -1
  99. package/PageEntityForm/CommandContainer.js +25 -21
  100. package/PageEntityForm/FormTabRelated.js +20 -17
  101. package/PageEntityForm/PageEntityForm.js +20 -16
  102. package/PageEntityForm/PageEntityFormDesktopContainer.js +77 -70
  103. package/PageEntityForm/PageEntityFormStringContext.js +9 -5
  104. package/PageEntityForm/ProcessFlow.js +24 -21
  105. package/PageEntityForm/RecordCard.js +31 -24
  106. package/PageEntityForm/RecordCardLoading.js +13 -11
  107. package/PageEntityForm/RecordSetNavigatorContainer.js +34 -31
  108. package/PageEntityForm/RelatedViewSelector.js +34 -36
  109. package/PageEntityForm/SectionContainer.js +35 -31
  110. package/PageEntityForm/StandardControl.js +84 -76
  111. package/PageEntityForm/SubgridControl.js +23 -21
  112. package/PageEntityForm/index.js +5 -1
  113. package/PageEntityView/FormSubgridContainer.js +26 -22
  114. package/PageEntityView/PageEntityView.js +19 -15
  115. package/PageEntityView/PageEntityViewDesktopContainer.js +13 -9
  116. package/PageEntityView/PageEntityViewDesktopFrame.js +21 -17
  117. package/PageEntityView/PageEntityViewMobileContainer.js +13 -9
  118. package/PageEntityView/PageEntityViewStringContext.js +9 -5
  119. package/PageEntityView/index.js +5 -1
  120. package/PageInsights/PageInsights.js +13 -9
  121. package/PageInsights/index.js +6 -1
  122. package/ProgressIndicatorContainer/index.js +14 -10
  123. package/ToastNotificationContainer/index.js +18 -15
  124. package/componentStore.js +5 -2
  125. package/components/BodyLoading.js +11 -7
  126. package/components/DialogLogin.js +8 -5
  127. package/components/DndProvider.d.ts +12 -0
  128. package/components/DndProvider.js +68 -0
  129. package/components/LoginForm.js +46 -36
  130. package/components/PageBroken.js +8 -5
  131. package/components/PageLoading.js +8 -5
  132. package/components/PageLogin.js +17 -14
  133. package/form/FormControl.js +44 -50
  134. package/form/FormControlLoading.js +8 -4
  135. package/form/controls/AttachmentControl.js +72 -77
  136. package/form/controls/AttachmentsControl.js +24 -30
  137. package/form/controls/CurrencyControl.js +16 -13
  138. package/form/controls/DateControl.js +24 -18
  139. package/form/controls/DateRangeControl.js +22 -18
  140. package/form/controls/DateTimeControl.js +49 -43
  141. package/form/controls/DecimalControl.js +14 -11
  142. package/form/controls/DurationControl.js +18 -14
  143. package/form/controls/EmailControl.js +14 -11
  144. package/form/controls/IntegerControl.js +11 -8
  145. package/form/controls/LookupControl.js +58 -56
  146. package/form/controls/MultiSelectControl.js +12 -9
  147. package/form/controls/MultiSelectLookupControl.js +55 -53
  148. package/form/controls/PasswordControl.js +11 -8
  149. package/form/controls/RichTextControl.js +32 -5
  150. package/form/controls/SelectControl.js +15 -13
  151. package/form/controls/SwitchControl.js +7 -4
  152. package/form/controls/TelephoneControl.js +10 -7
  153. package/form/controls/TextAreaControl.js +11 -8
  154. package/form/controls/TextControl.js +12 -9
  155. package/form/controls/UrlControl.js +10 -7
  156. package/form/controls/types.js +2 -1
  157. package/form/controls/useLookupData.js +43 -54
  158. package/form/layout/FormBody/FormBody.js +10 -6
  159. package/form/layout/FormBody/index.js +17 -1
  160. package/form/layout/FormSection/FormSection.js +31 -20
  161. package/form/layout/FormSection/FormSectionColumn.js +7 -3
  162. package/form/layout/FormSection/FormSectionLoading.js +5 -1
  163. package/form/layout/FormSection/index.js +5 -1
  164. package/form/layout/FormTab/FormTab.js +21 -17
  165. package/form/layout/FormTab/FormTabColumn.js +9 -5
  166. package/form/layout/FormTab/index.js +5 -1
  167. package/form/layout/TabContext.js +5 -2
  168. package/form/layout/index.js +9 -3
  169. package/form/types.js +2 -1
  170. package/package.json +4 -12
  171. package/types/index.js +2 -1
  172. package/utils/avatar.js +4 -1
  173. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
  174. package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
  175. package/form/controls/NumberControl.d.ts +0 -4
  176. package/form/controls/NumberControl.js +0 -16
  177. package/form/controls/utils.d.ts +0 -4
  178. package/form/controls/utils.js +0 -42
@@ -1,35 +1,29 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { Body1, Button, Menu, MenuDivider, MenuItem, MenuList, MenuPopover, MenuTrigger, Spinner, tokens, } from '@fluentui/react-components';
12
- import { useOpenConfirmDialog, useOpenErrorDialog, } from '@headless-adminapp/app/dialog/hooks';
13
- import { fileToObject, urlToFileObject } from '@headless-adminapp/core/utils';
14
- import { Icons } from '@headless-adminapp/icons';
15
- import { useMutation } from '@tanstack/react-query';
16
- import { useMemo } from 'react';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentControl = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const hooks_1 = require("@headless-adminapp/app/dialog/hooks");
7
+ const utils_1 = require("@headless-adminapp/core/utils");
8
+ const icons_1 = require("@headless-adminapp/icons");
9
+ const react_query_1 = require("@tanstack/react-query");
10
+ const react_1 = require("react");
17
11
  function useAttachmentSelector({ fileService, fileServiceContext, location, onChange, }) {
18
- const openErrorDialog = useOpenErrorDialog();
19
- const { isPending, mutate: handleFile } = useMutation({
20
- mutationFn: (file) => __awaiter(this, void 0, void 0, function* () {
12
+ const openErrorDialog = (0, hooks_1.useOpenErrorDialog)();
13
+ const { isPending, mutate: handleFile } = (0, react_query_1.useMutation)({
14
+ mutationFn: async (file) => {
21
15
  if (location === 'local') {
22
- return fileToObject(file);
16
+ return (0, utils_1.fileToObject)(file);
23
17
  }
24
18
  else {
25
- const url = yield fileService.uploadFile(file, {
19
+ const url = await fileService.uploadFile(file, {
26
20
  context: fileServiceContext,
27
21
  });
28
- return urlToFileObject(url);
22
+ return (0, utils_1.urlToFileObject)(url);
29
23
  }
30
- }),
24
+ },
31
25
  onSuccess: (fileObject) => {
32
- onChange === null || onChange === void 0 ? void 0 : onChange(fileObject);
26
+ onChange?.(fileObject);
33
27
  },
34
28
  onError: (error) => {
35
29
  console.error(error);
@@ -45,14 +39,14 @@ function useAttachmentSelector({ fileService, fileServiceContext, location, onCh
45
39
  if (accept) {
46
40
  input.accept = accept;
47
41
  }
48
- input.onchange = (event) => __awaiter(this, void 0, void 0, function* () {
42
+ input.onchange = async (event) => {
49
43
  const files = event.target.files;
50
- if (!(files === null || files === void 0 ? void 0 : files.length)) {
44
+ if (!files?.length) {
51
45
  return;
52
46
  }
53
47
  const file = files[0];
54
48
  handleFile(file);
55
- });
49
+ };
56
50
  input.click();
57
51
  };
58
52
  return {
@@ -68,49 +62,49 @@ const AttachmentImageControl = ({ value, disabled, readOnly, onChange, fileServi
68
62
  onChange,
69
63
  });
70
64
  if (!value) {
71
- return (_jsx("div", { style: { position: 'relative', display: 'flex' }, children: _jsx("div", { style: {
65
+ return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
72
66
  width: 100,
73
67
  height: 100,
74
- backgroundColor: tokens.colorNeutralBackground2,
75
- borderRadius: tokens.borderRadiusMedium,
68
+ backgroundColor: react_components_1.tokens.colorNeutralBackground2,
69
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
76
70
  display: 'flex',
77
71
  justifyContent: 'center',
78
72
  alignItems: 'center',
79
- color: tokens.colorNeutralForeground4,
73
+ color: react_components_1.tokens.colorNeutralForeground4,
80
74
  cursor: 'pointer',
81
75
  pointerEvents: disabled || readOnly || isProcessing ? 'none' : 'auto',
82
- }, onClick: () => selectFile('image/*'), children: isProcessing ? _jsx(Spinner, { size: "small" }) : _jsx(Icons.Image, {}) }) }));
76
+ }, onClick: () => selectFile('image/*'), children: isProcessing ? (0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "small" }) : (0, jsx_runtime_1.jsx)(icons_1.Icons.Image, {}) }) }));
83
77
  }
84
- return (_jsx("div", { style: { position: 'relative', display: 'flex' }, children: _jsxs("div", { style: {
78
+ return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', display: 'flex' }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
85
79
  maxWidth: '100%',
86
80
  height: 100,
87
81
  position: 'relative',
88
- }, children: [_jsx("img", { src: value.url, style: {
82
+ }, children: [(0, jsx_runtime_1.jsx)("img", { src: value.url, style: {
89
83
  maxHeight: '100%',
90
84
  maxWidth: '100%',
91
85
  objectFit: 'contain',
92
- borderRadius: tokens.borderRadiusMedium,
93
- } }), _jsx("div", { style: { position: 'absolute', top: 0, right: 0 }, children: _jsx(ActionMenu, { format: 'image', value: value, disabled: disabled, readOnly: readOnly, onChange: onChange, onChangeClick: () => selectFile('image/*') }) }), isProcessing && (_jsxs(_Fragment, { children: [_jsx("div", { style: {
86
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
87
+ } }), (0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', top: 0, right: 0 }, children: (0, jsx_runtime_1.jsx)(ActionMenu, { format: 'image', value: value, disabled: disabled, readOnly: readOnly, onChange: onChange, onChangeClick: () => selectFile('image/*') }) }), isProcessing && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: {
94
88
  position: 'absolute',
95
89
  inset: 0,
96
- backgroundColor: tokens.colorNeutralBackground1,
90
+ backgroundColor: react_components_1.tokens.colorNeutralBackground1,
97
91
  opacity: 0.7,
98
- } }), _jsx("div", { style: {
92
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
99
93
  position: 'absolute',
100
94
  inset: 0,
101
95
  display: 'flex',
102
96
  alignItems: 'center',
103
97
  justifyContent: 'center',
104
- }, children: _jsx(Spinner, { size: "small" }) })] }))] }) }));
98
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "small" }) })] }))] }) }));
105
99
  };
106
- export const AttachmentControl = ({ value, disabled, readOnly, id, name, onBlur, onChange, placeholder, fileService, fileServiceContext, location, format, }) => {
100
+ const AttachmentControl = ({ value, disabled, readOnly, id, name, onBlur, onChange, placeholder, fileService, fileServiceContext, location, format, }) => {
107
101
  const { isProcessing, selectFile } = useAttachmentSelector({
108
102
  fileService,
109
103
  fileServiceContext,
110
104
  location,
111
105
  onChange,
112
106
  });
113
- const accept = useMemo(() => {
107
+ const accept = (0, react_1.useMemo)(() => {
114
108
  switch (format) {
115
109
  case 'image':
116
110
  return 'image/*';
@@ -124,73 +118,74 @@ export const AttachmentControl = ({ value, disabled, readOnly, id, name, onBlur,
124
118
  return '';
125
119
  }
126
120
  }, [format]);
127
- const FormatIcon = useMemo(() => {
121
+ const FormatIcon = (0, react_1.useMemo)(() => {
128
122
  switch (format) {
129
123
  case 'video':
130
- return Icons.Video;
124
+ return icons_1.Icons.Video;
131
125
  case 'audio':
132
- return Icons.Audio;
126
+ return icons_1.Icons.Audio;
133
127
  default:
134
- return Icons.Document;
128
+ return icons_1.Icons.Document;
135
129
  }
136
130
  }, [format]);
137
131
  if (format === 'image') {
138
- return (_jsx(AttachmentImageControl, { value: value, disabled: disabled, readOnly: readOnly, id: id, name: name, onBlur: onBlur, onChange: onChange, placeholder: placeholder, fileService: fileService, fileServiceContext: fileServiceContext, location: location }));
132
+ return ((0, jsx_runtime_1.jsx)(AttachmentImageControl, { value: value, disabled: disabled, readOnly: readOnly, id: id, name: name, onBlur: onBlur, onChange: onChange, placeholder: placeholder, fileService: fileService, fileServiceContext: fileServiceContext, location: location }));
139
133
  }
140
134
  if (!value) {
141
- return (_jsx("div", { style: { position: 'relative', overflow: 'hidden' }, children: _jsx("div", { style: {
135
+ return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', overflow: 'hidden' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
142
136
  width: '100%',
143
- }, children: _jsxs("div", { style: {
137
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
144
138
  width: '100%',
145
139
  height: 30,
146
- borderRadius: tokens.borderRadiusMedium,
147
- backgroundColor: tokens.colorNeutralBackground2,
140
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
141
+ backgroundColor: react_components_1.tokens.colorNeutralBackground2,
148
142
  display: 'flex',
149
- paddingLeft: tokens.spacingHorizontalS,
150
- gap: tokens.spacingHorizontalS,
143
+ paddingLeft: react_components_1.tokens.spacingHorizontalS,
144
+ gap: react_components_1.tokens.spacingHorizontalS,
151
145
  alignItems: 'center',
152
146
  overflow: 'hidden',
153
- color: tokens.colorNeutralForeground4,
147
+ color: react_components_1.tokens.colorNeutralForeground4,
154
148
  cursor: 'pointer',
155
149
  pointerEvents: disabled || readOnly || isProcessing ? 'none' : 'auto',
156
- }, onClick: () => selectFile(accept), children: [_jsx(FormatIcon, { size: 16 }), _jsx(Body1, { style: {
150
+ }, onClick: () => selectFile(accept), children: [(0, jsx_runtime_1.jsx)(FormatIcon, { size: 16 }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: {
157
151
  overflow: 'hidden',
158
152
  textOverflow: 'ellipsis',
159
153
  whiteSpace: 'nowrap',
160
154
  flex: 1,
161
- }, children: placeholder || 'Select a file' }), isProcessing && (_jsx("div", { style: { paddingRight: tokens.spacingHorizontalS }, children: _jsx(Spinner, { size: "extra-tiny" }) }))] }) }) }));
155
+ }, children: placeholder || 'Select a file' }), isProcessing && ((0, jsx_runtime_1.jsx)("div", { style: { paddingRight: react_components_1.tokens.spacingHorizontalS }, children: (0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" }) }))] }) }) }));
162
156
  }
163
- return (_jsx("div", { style: { position: 'relative', overflow: 'hidden' }, children: _jsx("div", { style: {
157
+ return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', overflow: 'hidden' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
164
158
  width: '100%',
165
- }, children: _jsxs("div", { style: {
159
+ }, children: (0, jsx_runtime_1.jsxs)("div", { style: {
166
160
  width: '100%',
167
161
  height: 30,
168
- borderRadius: tokens.borderRadiusMedium,
169
- backgroundColor: tokens.colorNeutralBackground2,
162
+ borderRadius: react_components_1.tokens.borderRadiusMedium,
163
+ backgroundColor: react_components_1.tokens.colorNeutralBackground2,
170
164
  display: 'flex',
171
- paddingLeft: tokens.spacingHorizontalS,
172
- gap: tokens.spacingHorizontalS,
165
+ paddingLeft: react_components_1.tokens.spacingHorizontalS,
166
+ gap: react_components_1.tokens.spacingHorizontalS,
173
167
  alignItems: 'center',
174
168
  overflow: 'hidden',
175
- }, children: [_jsx(FormatIcon, { size: 16 }), _jsx(Body1, { style: {
169
+ }, children: [(0, jsx_runtime_1.jsx)(FormatIcon, { size: 16 }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: {
176
170
  overflow: 'hidden',
177
171
  textOverflow: 'ellipsis',
178
172
  whiteSpace: 'nowrap',
179
173
  flex: 1,
180
- }, children: value.name || value.url }), isProcessing && (_jsx("div", { style: { paddingRight: tokens.spacingHorizontalS }, children: _jsx(Spinner, { size: "extra-tiny" }) })), !isProcessing && (_jsx(ActionMenu, { format: format, value: value, disabled: disabled, readOnly: readOnly, onChange: onChange, onChangeClick: () => selectFile(accept) }))] }) }) }));
174
+ }, children: value.name || value.url }), isProcessing && ((0, jsx_runtime_1.jsx)("div", { style: { paddingRight: react_components_1.tokens.spacingHorizontalS }, children: (0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" }) })), !isProcessing && ((0, jsx_runtime_1.jsx)(ActionMenu, { format: format, value: value, disabled: disabled, readOnly: readOnly, onChange: onChange, onChangeClick: () => selectFile(accept) }))] }) }) }));
181
175
  };
176
+ exports.AttachmentControl = AttachmentControl;
182
177
  const ActionMenu = ({ format, value, disabled, readOnly, onChange, onChangeClick, }) => {
183
- const openConfirmDialog = useOpenConfirmDialog();
184
- const FileOpenIcon = useMemo(() => {
178
+ const openConfirmDialog = (0, hooks_1.useOpenConfirmDialog)();
179
+ const FileOpenIcon = (0, react_1.useMemo)(() => {
185
180
  switch (format) {
186
181
  case 'video':
187
182
  case 'audio':
188
- return Icons.Play;
183
+ return icons_1.Icons.Play;
189
184
  default:
190
- return Icons.OpenInNew;
185
+ return icons_1.Icons.OpenInNew;
191
186
  }
192
187
  }, [format]);
193
- const OpenText = useMemo(() => {
188
+ const OpenText = (0, react_1.useMemo)(() => {
194
189
  switch (format) {
195
190
  case 'video':
196
191
  return 'Play';
@@ -200,22 +195,22 @@ const ActionMenu = ({ format, value, disabled, readOnly, onChange, onChangeClick
200
195
  return 'Open';
201
196
  }
202
197
  }, [format]);
203
- return (_jsxs(Menu, { positioning: "before-top", hasIcons: true, children: [_jsx(MenuTrigger, { children: _jsx(Button, { appearance: "transparent", icon: _jsx(Icons.MoreVertical, {}) }) }), _jsx(MenuPopover, { children: _jsxs(MenuList, { children: [_jsx(MenuItem, { icon: _jsx(FileOpenIcon, {}), onClick: () => {
198
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: "before-top", hasIcons: true, children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.MoreVertical, {}) }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(FileOpenIcon, {}), onClick: () => {
204
199
  window.open(value.url, '_blank');
205
- }, children: OpenText }), _jsx(MenuItem, { icon: _jsx(Icons.Copy, {}), onClick: () => {
200
+ }, children: OpenText }), (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Copy, {}), onClick: () => {
206
201
  navigator.clipboard.writeText(value.url).catch(() => { });
207
- }, children: "Copy Url" }), !(disabled || readOnly) && (_jsxs(_Fragment, { children: [_jsx(MenuItem, { icon: _jsx(Icons.Edit, {}), onClick: () => {
208
- onChangeClick === null || onChangeClick === void 0 ? void 0 : onChangeClick();
209
- }, children: "Change" }), _jsx(MenuDivider, {}), _jsx(MenuItem, { icon: _jsx(Icons.Delete, {}), onClick: () => __awaiter(void 0, void 0, void 0, function* () {
210
- const result = yield openConfirmDialog({
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: () => {
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({
211
206
  title: 'Remove file',
212
207
  text: 'Are you sure you want to remove this file?',
213
208
  confirmButtonLabel: 'Remove',
214
209
  cancelButtonLabel: 'Cancel',
215
210
  });
216
- if (!(result === null || result === void 0 ? void 0 : result.confirmed)) {
211
+ if (!result?.confirmed) {
217
212
  return;
218
213
  }
219
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
220
- }), children: "Remove" })] }))] }) })] }));
214
+ onChange?.(null);
215
+ }, children: "Remove" })] }))] }) })] }));
221
216
  };
@@ -1,41 +1,35 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- import { Button, Caption1, Link, Tag, TagGroup, TagPicker, TagPickerControl, TagPickerList, tokens, } from '@fluentui/react-components';
12
- import { fileToObject } from '@headless-adminapp/core/utils';
13
- import { Icons } from '@headless-adminapp/icons';
14
- import { useRef } from 'react';
15
- export const AttachmentsControl = ({ onChange, id, onBlur, onFocus, disabled, readOnly, value, }) => {
16
- const inputRef = useRef(null);
17
- return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsxs(TagPicker, { appearance: "filled-darker", disabled: disabled, open: false, children: [_jsx(TagPickerControl, { onFocus: onFocus, onBlur: onBlur, id: id, style: { paddingBlock: tokens.spacingVerticalXXS }, expandIcon: null, children: _jsxs(TagGroup, { style: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentsControl = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const utils_1 = require("@headless-adminapp/core/utils");
7
+ const icons_1 = require("@headless-adminapp/icons");
8
+ const react_1 = require("react");
9
+ const AttachmentsControl = ({ onChange, id, onBlur, onFocus, disabled, readOnly, value, }) => {
10
+ const inputRef = (0, react_1.useRef)(null);
11
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TagPicker, { appearance: "filled-darker", disabled: disabled, open: false, children: [(0, jsx_runtime_1.jsx)(react_components_1.TagPickerControl, { onFocus: onFocus, onBlur: onBlur, id: id, style: { paddingBlock: react_components_1.tokens.spacingVerticalXXS }, expandIcon: null, children: (0, jsx_runtime_1.jsxs)(react_components_1.TagGroup, { style: {
18
12
  flexWrap: 'wrap',
19
- columnGap: tokens.spacingHorizontalXS,
20
- gap: tokens.spacingHorizontalXS,
21
- }, children: [value === null || value === void 0 ? void 0 : value.map((file, index) => (_jsx(Tag, { as: "span", appearance: "brand", size: "small", shape: "rounded", dismissible: !disabled && !readOnly, dismissIcon: _jsx("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
13
+ columnGap: react_components_1.tokens.spacingHorizontalXS,
14
+ gap: react_components_1.tokens.spacingHorizontalXS,
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: () => {
22
16
  if (disabled || readOnly)
23
17
  return;
24
- onChange === null || onChange === void 0 ? void 0 : onChange(value === null || value === void 0 ? void 0 : value.filter((_, i) => i !== index));
25
- }, children: _jsx(Icons.Close, { size: 16 }) }), children: _jsx(Link, { href: file.url, target: "_blank", onClick: (event) => {
18
+ onChange?.(value?.filter((_, i) => i !== index));
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) => {
26
20
  event.preventDefault();
27
21
  event.stopPropagation();
28
22
  window.open(file.url, '_blank');
29
- }, children: _jsx(Caption1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: file.name }) }) }, index))), !readOnly && !disabled && (_jsx(Button, { size: "small", icon: _jsx(Icons.Add, { size: 16 }), appearance: "outline", onClick: () => {
30
- var _a;
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: () => {
31
24
  if (readOnly)
32
25
  return;
33
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
34
- }, children: "Add" }))] }) }), _jsx(TagPickerList, {})] }), _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) => {
35
28
  const files = event.target.files;
36
- if (files === null || files === void 0 ? void 0 : files.length) {
37
- const fileObjects = yield Promise.all(Array.from(files).map((file) => fileToObject(file)));
38
- 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]);
39
32
  }
40
- }) })] }));
33
+ } })] }));
41
34
  };
35
+ exports.AttachmentsControl = AttachmentsControl;
@@ -1,17 +1,20 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Input } from '@fluentui/react-components';
3
- import { useCurrencySymbol } from '@headless-adminapp/app/locale';
4
- import { useEffect, useRef, useState } from 'react';
5
- export function CurrencyControl({ value, onChange, id, name, onBlur, onFocus,
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CurrencyControl = CurrencyControl;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const locale_1 = require("@headless-adminapp/app/locale");
7
+ const react_1 = require("react");
8
+ function CurrencyControl({ value, onChange, id, name, onBlur, onFocus,
6
9
  // error,
7
10
  disabled, placeholder, autoFocus,
8
11
  // borderOnFocusOnly,
9
12
  readOnly, }) {
10
- const symbol = useCurrencySymbol();
11
- const [internalValue, setInternalValue] = useState(value ? value.toString() : '');
12
- const internalValueRef = useRef(internalValue);
13
+ const symbol = (0, locale_1.useCurrencySymbol)();
14
+ const [internalValue, setInternalValue] = (0, react_1.useState)(value ? value.toString() : '');
15
+ const internalValueRef = (0, react_1.useRef)(internalValue);
13
16
  internalValueRef.current = internalValue;
14
- useEffect(() => {
17
+ (0, react_1.useEffect)(() => {
15
18
  let _value = '';
16
19
  if (typeof value === 'number') {
17
20
  _value = value.toString();
@@ -27,22 +30,22 @@ readOnly, }) {
27
30
  let value = e.target.value;
28
31
  if (!value) {
29
32
  setInternalValue('');
30
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
33
+ onChange?.(null);
31
34
  return;
32
35
  }
33
36
  value = value.replace(',', '');
34
37
  if (value === '-') {
35
38
  setInternalValue('-');
36
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
39
+ onChange?.(null);
37
40
  return;
38
41
  }
39
42
  if (isNaN(Number(value))) {
40
43
  return;
41
44
  }
42
45
  setInternalValue(value);
43
- onChange === null || onChange === void 0 ? void 0 : onChange(Number(value));
46
+ onChange?.(Number(value));
44
47
  };
45
- return (_jsx(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: _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: {
46
49
  width: '100%',
47
50
  } }));
48
51
  }
@@ -1,27 +1,33 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { tokens } from '@fluentui/react-components';
3
- import { DatePicker } from '@fluentui/react-datepicker-compat';
4
- import { useLocale } from '@headless-adminapp/app/locale';
5
- import { Icons } from '@headless-adminapp/icons';
6
- import dayjs from 'dayjs';
7
- import timezone from 'dayjs/plugin/timezone';
8
- import utc from 'dayjs/plugin/utc';
9
- import { useAppStrings } from '../../App/AppStringContext';
10
- dayjs.extend(utc);
11
- dayjs.extend(timezone);
12
- export function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
13
- const { dateFormats, timezone } = useLocale();
14
- const { datePickerStrings } = useAppStrings();
15
- return (_jsx(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",
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DateControl = DateControl;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_components_1 = require("@fluentui/react-components");
9
+ const react_datepicker_compat_1 = require("@fluentui/react-datepicker-compat");
10
+ const locale_1 = require("@headless-adminapp/app/locale");
11
+ const icons_1 = require("@headless-adminapp/icons");
12
+ const dayjs_1 = __importDefault(require("dayjs"));
13
+ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
14
+ const utc_1 = __importDefault(require("dayjs/plugin/utc"));
15
+ const AppStringContext_1 = require("../../App/AppStringContext");
16
+ dayjs_1.default.extend(utc_1.default);
17
+ dayjs_1.default.extend(timezone_1.default);
18
+ function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
19
+ const { dateFormats, timezone } = (0, locale_1.useLocale)();
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?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker",
16
22
  // size="sm"
17
23
  // error={error}
18
24
  // maxDate={maxDate}
19
25
  // minDate={minDate}
20
- disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? dayjs(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => onChange === null || onChange === void 0 ? void 0 : onChange(date ? dayjs(date).tz(timezone).startOf('day').toISOString() : null), strings: datePickerStrings, contentAfter: _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: {
21
27
  display: 'flex',
22
28
  alignItems: 'center',
23
29
  justifyContent: 'center',
24
30
  marginRight: -4,
25
- color: tokens.colorNeutralForeground2,
26
- }, children: _jsx(Icons.Calendar, { size: 20 }) }) }));
31
+ color: react_components_1.tokens.colorNeutralForeground2,
32
+ }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Calendar, { size: 20 }) }) }));
27
33
  }
@@ -1,15 +1,21 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { DatePicker } from '@fluentui/react-datepicker-compat';
3
- import { useLocale } from '@headless-adminapp/app/locale';
4
- import dayjs from 'dayjs';
5
- import { useEffect, useState } from 'react';
6
- import { useAppStrings } from '../../App/AppStringContext';
7
- export function DateRangeControl({ value, onChange, id, name, onBlur, onFocus, disabled, maxDate, minDate, readOnly, }) {
8
- const [from, setFrom] = useState(value ? value[0] : null);
9
- const [to, setTo] = useState(value ? value[1] : null);
10
- const { datePickerStrings } = useAppStrings();
11
- const { dateFormats } = useLocale();
12
- useEffect(() => {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DateRangeControl = DateRangeControl;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_datepicker_compat_1 = require("@fluentui/react-datepicker-compat");
9
+ const locale_1 = require("@headless-adminapp/app/locale");
10
+ const dayjs_1 = __importDefault(require("dayjs"));
11
+ const react_1 = require("react");
12
+ const AppStringContext_1 = require("../../App/AppStringContext");
13
+ function DateRangeControl({ value, onChange, id, name, onBlur, onFocus, disabled, maxDate, minDate, readOnly, }) {
14
+ const [from, setFrom] = (0, react_1.useState)(value ? value[0] : null);
15
+ const [to, setTo] = (0, react_1.useState)(value ? value[1] : null);
16
+ const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
17
+ const { dateFormats } = (0, locale_1.useLocale)();
18
+ (0, react_1.useEffect)(() => {
13
19
  if (value) {
14
20
  setFrom(value[0]);
15
21
  setTo(value[1]);
@@ -22,22 +28,20 @@ export function DateRangeControl({ value, onChange, id, name, onBlur, onFocus, d
22
28
  : undefined;
23
29
  const _maxDate = maxDate ? new Date(maxDate) : to ? new Date(to) : undefined;
24
30
  const handleChangeFrom = (date) => {
25
- var _a;
26
31
  setFrom(date ? date.toISOString() : null);
27
32
  // if (date && to) {
28
- 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]);
29
34
  // }
30
35
  };
31
36
  const handleChangeTo = (date) => {
32
- var _a;
33
37
  setTo(date ? date.toISOString() : null);
34
38
  // if (date && from) {
35
- 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]);
36
40
  // }
37
41
  };
38
- return (_jsxs("div", { style: { display: 'flex', gap: 8 }, children: [_jsx(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 ? dayjs(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: {
39
43
  style: { width: '100%' },
40
- } }), _jsx(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 ? dayjs(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: {
41
45
  style: { width: '100%' },
42
46
  } })] }));
43
47
  }