@headless-adminapp/fluent 0.0.17-alpha.8 → 1.0.1

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 (270) hide show
  1. package/App/App.d.ts +0 -1
  2. package/App/App.js +2 -4
  3. package/App/AppHeaderContianer.d.ts +5 -1
  4. package/App/AppHeaderContianer.js +43 -26
  5. package/App/AppLogo.js +15 -4
  6. package/App/AppUI.js +9 -1
  7. package/App/LayoutProvider.d.ts +7 -0
  8. package/App/LayoutProvider.js +17 -0
  9. package/App/NavigationContainer.d.ts +10 -1
  10. package/App/NavigationContainer.js +27 -22
  11. package/App/QuickActionItem.js +2 -2
  12. package/App/utils.js +3 -4
  13. package/CommandBar/Button.d.ts +2 -1
  14. package/CommandBar/Button.js +2 -2
  15. package/CommandBar/Divider.d.ts +2 -1
  16. package/CommandBar/Divider.js +2 -2
  17. package/CommandBar/IconButton.d.ts +2 -1
  18. package/CommandBar/IconButton.js +2 -2
  19. package/CommandBar/Label.d.ts +2 -1
  20. package/CommandBar/Label.js +2 -2
  21. package/CommandBar/MenuButton.d.ts +2 -1
  22. package/CommandBar/MenuButton.js +3 -3
  23. package/CommandBar/MenuItem.js +5 -4
  24. package/CommandBar/MenuItems.js +4 -4
  25. package/CommandBar/MenuList.js +5 -4
  26. package/CommandBar/Wrapper.d.ts +2 -2
  27. package/CommandBar/Wrapper.js +2 -2
  28. package/CommandBar/index.d.ts +6 -6
  29. package/DataGrid/ActionCell.d.ts +1 -1
  30. package/DataGrid/ActionCell.js +8 -4
  31. package/DataGrid/CustomizeColumns/AddColumns.js +33 -35
  32. package/DataGrid/CustomizeColumns/ColumnItem.js +8 -6
  33. package/DataGrid/CustomizeColumns/CustomizeColumns.d.ts +2 -2
  34. package/DataGrid/CustomizeColumns/CustomizeColumns.js +3 -6
  35. package/DataGrid/FormSubgridViewSelector.js +1 -5
  36. package/DataGrid/GridColumnHeader/ConditionValueControl.js +19 -25
  37. package/DataGrid/GridColumnHeader/FilterForm.js +9 -10
  38. package/DataGrid/GridColumnHeader/OperatorSelect.js +10 -3
  39. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +22 -13
  40. package/DataGrid/GridColumnHeader/utils.js +10 -7
  41. package/DataGrid/GridHeaderDesktop.js +4 -5
  42. package/DataGrid/GridHeaderMobile.d.ts +5 -0
  43. package/DataGrid/GridHeaderMobile.js +29 -0
  44. package/DataGrid/GridListContainer.d.ts +12 -0
  45. package/DataGrid/GridListContainer.js +93 -0
  46. package/DataGrid/GridPaginationContainer.js +1 -2
  47. package/DataGrid/GridTableContainer.js +113 -77
  48. package/DataGrid/TableCell/TableCellBase.d.ts +2 -2
  49. package/DataGrid/TableCell/TableCellBase.js +6 -1
  50. package/DataGrid/TableCell/TableCellCheckbox.js +6 -5
  51. package/DataGrid/TableCell/TableCellChoice.d.ts +15 -0
  52. package/DataGrid/TableCell/TableCellChoice.js +34 -0
  53. package/DataGrid/TableCell/TableCellLink.d.ts +2 -1
  54. package/DataGrid/TableCell/TableCellLink.js +13 -5
  55. package/DataGrid/TableCell/TableCellText.js +9 -4
  56. package/DataGrid/types.d.ts +5 -0
  57. package/DataGrid/types.js +2 -0
  58. package/DataGrid/useTableColumns.d.ts +2 -3
  59. package/DataGrid/useTableColumns.js +297 -155
  60. package/DialogContainer/AlertDialog.js +3 -6
  61. package/DialogContainer/ConfirmDialog.js +5 -9
  62. package/DialogContainer/DialogContainer.js +2 -13
  63. package/DialogContainer/ErrorDialog.js +3 -6
  64. package/DialogContainer/PromptDialog.d.ts +13 -2
  65. package/DialogContainer/PromptDialog.js +44 -39
  66. package/Insights/CommandBarContainer.d.ts +1 -0
  67. package/Insights/CommandBarContainer.js +18 -0
  68. package/Insights/FilterBarContainer.d.ts +1 -0
  69. package/Insights/FilterBarContainer.js +99 -0
  70. package/Insights/Grid.d.ts +6 -0
  71. package/Insights/Grid.js +26 -0
  72. package/Insights/InsightsContainer.d.ts +1 -0
  73. package/Insights/InsightsContainer.js +35 -0
  74. package/Insights/WidgetChartContainer.d.ts +7 -0
  75. package/Insights/WidgetChartContainer.js +56 -0
  76. package/Insights/WidgetDataGridContainer.d.ts +4 -0
  77. package/Insights/WidgetDataGridContainer.js +80 -0
  78. package/Insights/WidgetTableContainer.d.ts +7 -0
  79. package/Insights/WidgetTableContainer.js +57 -0
  80. package/Insights/WidgetTileContainer.d.ts +7 -0
  81. package/Insights/WidgetTileContainer.js +24 -0
  82. package/Insights/WidgetTitleBar.d.ts +7 -0
  83. package/Insights/WidgetTitleBar.js +21 -0
  84. package/Insights/Widgets.d.ts +4 -0
  85. package/Insights/Widgets.js +57 -0
  86. package/Insights/charts/AreaChart.d.ts +5 -0
  87. package/Insights/charts/AreaChart.js +20 -0
  88. package/Insights/charts/BarChart.d.ts +5 -0
  89. package/Insights/charts/BarChart.js +20 -0
  90. package/Insights/charts/ComposedChart.d.ts +5 -0
  91. package/Insights/charts/ComposedChart.js +19 -0
  92. package/Insights/charts/CustomTooltipContent.d.ts +7 -0
  93. package/Insights/charts/CustomTooltipContent.js +25 -0
  94. package/Insights/charts/GaugeChart.d.ts +5 -0
  95. package/Insights/charts/GaugeChart.js +8 -0
  96. package/Insights/charts/LineChart.d.ts +5 -0
  97. package/Insights/charts/LineChart.js +21 -0
  98. package/Insights/charts/OhlcChart.d.ts +6 -0
  99. package/Insights/charts/OhlcChart.js +119 -0
  100. package/Insights/charts/PieChart.d.ts +5 -0
  101. package/Insights/charts/PieChart.js +54 -0
  102. package/Insights/charts/RadarChart.d.ts +5 -0
  103. package/Insights/charts/RadarChart.js +38 -0
  104. package/Insights/charts/ScatterChart.d.ts +5 -0
  105. package/Insights/charts/ScatterChart.js +81 -0
  106. package/Insights/charts/constants.d.ts +1 -0
  107. package/Insights/charts/constants.js +25 -0
  108. package/Insights/charts/formatters.d.ts +14 -0
  109. package/Insights/charts/formatters.js +186 -0
  110. package/Insights/charts/index.d.ts +4 -0
  111. package/Insights/charts/index.js +13 -0
  112. package/Insights/charts/renderers.d.ts +10 -0
  113. package/Insights/charts/renderers.js +64 -0
  114. package/Insights/hooks/useQueriesData.d.ts +7 -0
  115. package/Insights/hooks/useQueriesData.js +90 -0
  116. package/Insights/hooks/useWidgetDetail.d.ts +10 -0
  117. package/Insights/hooks/useWidgetDetail.js +39 -0
  118. package/OverflowCommandBar/OverflowCommandBar.js +1 -4
  119. package/OverflowCommandBar/OverflowMenu.js +5 -17
  120. package/OverflowCommandBar/render.js +3 -4
  121. package/OverflowCommandBar/utils.js +2 -3
  122. package/PageBoard/BoardColumn.d.ts +5 -0
  123. package/PageBoard/BoardColumn.js +9 -0
  124. package/PageBoard/BoardColumnCard.d.ts +12 -0
  125. package/PageBoard/BoardColumnCard.js +29 -0
  126. package/PageBoard/BoardColumnUI.d.ts +2 -0
  127. package/PageBoard/BoardColumnUI.js +76 -0
  128. package/PageBoard/BoardingColumnCardLoading.d.ts +1 -0
  129. package/PageBoard/BoardingColumnCardLoading.js +21 -0
  130. package/PageBoard/Header.d.ts +7 -0
  131. package/PageBoard/Header.js +31 -0
  132. package/PageBoard/PageBoard.d.ts +7 -0
  133. package/PageBoard/PageBoard.js +46 -0
  134. package/PageBoard/index.d.ts +1 -0
  135. package/PageBoard/index.js +5 -0
  136. package/PageCalendar/CalendarSection.d.ts +20 -0
  137. package/PageCalendar/CalendarSection.js +108 -0
  138. package/PageCalendar/EventDialog/AttributeController.d.ts +10 -0
  139. package/PageCalendar/EventDialog/AttributeController.js +17 -0
  140. package/PageCalendar/EventDialog/EventDialog.d.ts +25 -0
  141. package/PageCalendar/EventDialog/EventDialog.js +21 -0
  142. package/PageCalendar/EventDialog/EventFormBody.d.ts +18 -0
  143. package/PageCalendar/EventDialog/EventFormBody.js +69 -0
  144. package/PageCalendar/EventDialog/EventFormContent.d.ts +10 -0
  145. package/PageCalendar/EventDialog/EventFormContent.js +27 -0
  146. package/PageCalendar/EventDialog/types.d.ts +3 -0
  147. package/PageCalendar/EventDialog/types.js +2 -0
  148. package/PageCalendar/EventDialog/utils.d.ts +23 -0
  149. package/PageCalendar/EventDialog/utils.js +57 -0
  150. package/PageCalendar/Header.d.ts +8 -0
  151. package/PageCalendar/Header.js +35 -0
  152. package/PageCalendar/PageCalendar.d.ts +7 -0
  153. package/PageCalendar/PageCalendar.js +231 -0
  154. package/PageCalendar/TitleSelector.d.ts +10 -0
  155. package/PageCalendar/TitleSelector.js +73 -0
  156. package/PageCalendar/ViewSelector.d.ts +8 -0
  157. package/PageCalendar/ViewSelector.js +52 -0
  158. package/PageCalendar/baseEventAttributes.d.ts +35 -0
  159. package/PageCalendar/baseEventAttributes.js +38 -0
  160. package/PageCalendar/context.d.ts +20 -0
  161. package/PageCalendar/context.js +5 -0
  162. package/PageCalendar/hooks/index.d.ts +1 -0
  163. package/PageCalendar/hooks/index.js +17 -0
  164. package/PageCalendar/hooks/useConfig.d.ts +3 -0
  165. package/PageCalendar/hooks/useConfig.js +8 -0
  166. package/PageCalendar/index.d.ts +1 -0
  167. package/PageCalendar/index.js +5 -0
  168. package/PageCalendar/renderEventContent.d.ts +2 -0
  169. package/PageCalendar/renderEventContent.js +22 -0
  170. package/PageCalendar/types.d.ts +5 -0
  171. package/PageCalendar/types.js +9 -0
  172. package/PageCalendar/utils.d.ts +3 -0
  173. package/PageCalendar/utils.js +17 -0
  174. package/PageEntityForm/CommandContainer.js +9 -5
  175. package/PageEntityForm/PageCustomEntityForm.d.ts +15 -0
  176. package/PageEntityForm/PageCustomEntityForm.js +17 -0
  177. package/PageEntityForm/PageEntityFormDesktopContainer.js +39 -19
  178. package/PageEntityForm/ProcessFlow.d.ts +10 -0
  179. package/PageEntityForm/ProcessFlow.js +84 -0
  180. package/PageEntityForm/RecordAvatar.d.ts +2 -0
  181. package/PageEntityForm/RecordAvatar.js +83 -0
  182. package/PageEntityForm/RecordCard.d.ts +1 -1
  183. package/PageEntityForm/RecordCard.js +60 -53
  184. package/PageEntityForm/RecordCardLoading.d.ts +8 -0
  185. package/PageEntityForm/RecordCardLoading.js +24 -0
  186. package/PageEntityForm/RecordSetNavigatorContainer.js +1 -2
  187. package/PageEntityForm/RelatedViewSelector.d.ts +0 -2
  188. package/PageEntityForm/RelatedViewSelector.js +37 -11
  189. package/PageEntityForm/SectionContainer.d.ts +2 -2
  190. package/PageEntityForm/SectionContainer.js +77 -13
  191. package/PageEntityForm/StandardControl.d.ts +1 -22
  192. package/PageEntityForm/StandardControl.js +103 -117
  193. package/PageEntityForm/SubgridControl.d.ts +1 -0
  194. package/PageEntityForm/SubgridControl.js +4 -2
  195. package/PageEntityForm/UploadImageDialog.d.ts +12 -0
  196. package/PageEntityForm/UploadImageDialog.js +114 -0
  197. package/PageEntityView/FormSubgridContainer.js +5 -2
  198. package/PageEntityView/FormSubgridNotAvailableContainer.d.ts +2 -0
  199. package/PageEntityView/FormSubgridNotAvailableContainer.js +48 -0
  200. package/PageEntityView/PageEntityView.js +4 -1
  201. package/PageEntityView/PageEntityViewDesktopFrame.js +1 -0
  202. package/PageEntityView/PageEntityViewMobileContainer.d.ts +2 -0
  203. package/PageEntityView/PageEntityViewMobileContainer.js +14 -0
  204. package/PageEntityView/PageEntityViewStringContext.d.ts +2 -0
  205. package/PageEntityView/PageEntityViewStringContext.js +2 -0
  206. package/PageInsights/PageInsights.d.ts +9 -0
  207. package/PageInsights/PageInsights.js +25 -0
  208. package/PageInsights/index.d.ts +1 -0
  209. package/PageInsights/index.js +6 -0
  210. package/ToastNotificationContainer/index.js +1 -2
  211. package/componentStore.d.ts +2 -0
  212. package/componentStore.js +5 -0
  213. package/components/BodyLoading.d.ts +1 -1
  214. package/components/BodyLoading.js +13 -8
  215. package/components/DndProvider.d.ts +12 -0
  216. package/components/DndProvider.js +68 -0
  217. package/components/LoginForm.js +5 -21
  218. package/form/FormControl.js +19 -41
  219. package/form/controls/AttachmentControl.d.ts +27 -0
  220. package/form/controls/AttachmentControl.js +220 -0
  221. package/form/controls/AttachmentsControl.d.ts +6 -0
  222. package/form/controls/AttachmentsControl.js +35 -0
  223. package/form/controls/CurrencyControl.js +38 -6
  224. package/form/controls/DateControl.d.ts +1 -1
  225. package/form/controls/DateControl.js +18 -7
  226. package/form/controls/DateRangeControl.js +4 -6
  227. package/form/controls/DateTimeControl.d.ts +1 -1
  228. package/form/controls/DateTimeControl.js +108 -12
  229. package/form/controls/DecimalControl.d.ts +5 -0
  230. package/form/controls/DecimalControl.js +52 -0
  231. package/form/controls/DurationControl.d.ts +4 -0
  232. package/form/controls/DurationControl.js +209 -0
  233. package/form/controls/EmailControl.d.ts +1 -1
  234. package/form/controls/EmailControl.js +5 -5
  235. package/form/controls/IntegerControl.d.ts +4 -0
  236. package/form/controls/IntegerControl.js +25 -0
  237. package/form/controls/LookupControl.d.ts +1 -0
  238. package/form/controls/LookupControl.js +57 -13
  239. package/form/controls/MultiSelectControl.js +3 -3
  240. package/form/controls/MultiSelectLookupControl.js +16 -17
  241. package/form/controls/PasswordControl.js +1 -1
  242. package/form/controls/RichTextControl.d.ts +5 -0
  243. package/form/controls/RichTextControl.js +33 -0
  244. package/form/controls/SelectControl.js +4 -5
  245. package/form/controls/SwitchControl.d.ts +1 -1
  246. package/form/controls/SwitchControl.js +4 -2
  247. package/form/controls/TelephoneControl.d.ts +1 -1
  248. package/form/controls/TelephoneControl.js +26 -4
  249. package/form/controls/TextAreaControl.d.ts +1 -1
  250. package/form/controls/TextAreaControl.js +6 -6
  251. package/form/controls/TextControl.js +4 -4
  252. package/form/controls/UrlControl.d.ts +4 -0
  253. package/form/controls/UrlControl.js +16 -0
  254. package/form/controls/useLookupData.js +26 -41
  255. package/form/layout/FormSection/FormSection.js +10 -3
  256. package/form/layout/FormTab/FormTab.js +4 -4
  257. package/form/types.d.ts +2 -2
  258. package/package.json +17 -12
  259. package/styles.css +149 -0
  260. package/types/index.d.ts +18 -0
  261. package/utils/avatar.d.ts +2 -0
  262. package/utils/avatar.js +45 -0
  263. package/App/AppProvider.d.ts +0 -9
  264. package/App/AppProvider.js +0 -50
  265. package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
  266. package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
  267. package/DataGrid/getAttributeFormattedValue.d.ts +0 -16
  268. package/DataGrid/getAttributeFormattedValue.js +0 -92
  269. package/form/controls/NumberControl.d.ts +0 -4
  270. package/form/controls/NumberControl.js +0 -16
@@ -13,7 +13,7 @@ const RecordCard_1 = require("../../PageEntityForm/RecordCard");
13
13
  const useLookupData_1 = require("./useLookupData");
14
14
  function MultiSelectLookupControl(props) {
15
15
  const Control = LookupControlMd;
16
- return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, props));
16
+ return (0, jsx_runtime_1.jsx)(Control, { ...props });
17
17
  }
18
18
  const useStyles = (0, react_components_1.makeStyles)({
19
19
  option: {
@@ -44,7 +44,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
44
44
  const { isLoading: isViewLoading, view } = (0, useLookupData_1.useGetLookupView)(schema.logicalName, viewId);
45
45
  const { data, isLoading } = (0, useLookupData_1.useLookupData)({
46
46
  schema,
47
- view: view === null || view === void 0 ? void 0 : view.experience,
47
+ view: view?.experience,
48
48
  searchText: debouncedSearchText,
49
49
  dataService,
50
50
  enabled: lookupEnabled && !isViewLoading && !readOnly && !disabled,
@@ -54,19 +54,18 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
54
54
  const [containerHeight, setContainerHeight] = (0, react_1.useState)(32);
55
55
  (0, react_1.useEffect)(() => {
56
56
  const timer = setInterval(() => {
57
- var _a, _b, _c;
58
57
  if (!tagGroupContainerRef.current) {
59
58
  return;
60
59
  }
61
- const lastElementChild = (_b = (_a = tagGroupContainerRef.current) === null || _a === void 0 ? void 0 : _a.lastElementChild) === null || _b === void 0 ? void 0 : _b.querySelector('.fui-Tag:last-of-type');
60
+ const lastElementChild = tagGroupContainerRef.current?.lastElementChild?.querySelector('.fui-Tag:last-of-type');
62
61
  if (!lastElementChild) {
63
62
  setContainerHeight(32);
64
63
  setInputLeft(0);
65
64
  return;
66
65
  }
67
66
  const containerBoundingRect = tagGroupContainerRef.current.getBoundingClientRect();
68
- const lastElementBoundingRect = lastElementChild === null || lastElementChild === void 0 ? void 0 : lastElementChild.getBoundingClientRect();
69
- const remainingWidth = containerBoundingRect.right - ((_c = lastElementBoundingRect === null || lastElementBoundingRect === void 0 ? void 0 : lastElementBoundingRect.right) !== null && _c !== void 0 ? _c : 0);
67
+ const lastElementBoundingRect = lastElementChild?.getBoundingClientRect();
68
+ const remainingWidth = containerBoundingRect.right - (lastElementBoundingRect?.right ?? 0);
70
69
  let newHeight = containerBoundingRect.height + 8;
71
70
  if (remainingWidth > 100) {
72
71
  setInputLeft(containerBoundingRect.width - remainingWidth);
@@ -91,7 +90,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
91
90
  const handleAdd = (selectedValue) => {
92
91
  setSearchText('');
93
92
  if (!value) {
94
- return onChange === null || onChange === void 0 ? void 0 : onChange([
93
+ return onChange?.([
95
94
  {
96
95
  id: selectedValue[schema.idAttribute],
97
96
  name: selectedValue[schema.primaryAttribute],
@@ -103,7 +102,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
103
102
  if (value.find((x) => x.id === selectedValue[schema.idAttribute])) {
104
103
  return;
105
104
  }
106
- return onChange === null || onChange === void 0 ? void 0 : onChange([
105
+ return onChange?.([
107
106
  ...value,
108
107
  {
109
108
  id: selectedValue[schema.idAttribute],
@@ -114,12 +113,12 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
114
113
  }
115
114
  };
116
115
  const handleRemove = (id) => {
117
- const newValue = value === null || value === void 0 ? void 0 : value.filter((x) => x.id !== id);
118
- if (!(newValue === null || newValue === void 0 ? void 0 : newValue.length)) {
119
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
116
+ const newValue = value?.filter((x) => x.id !== id);
117
+ if (!newValue?.length) {
118
+ onChange?.(null);
120
119
  }
121
120
  else {
122
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
121
+ onChange?.(newValue);
123
122
  }
124
123
  };
125
124
  return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%', height: containerHeight }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: (0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', right: 4, bottom: 8 }, children: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })) }), input: {
@@ -135,11 +134,11 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
135
134
  }, onChange: (e) => {
136
135
  setSearchText(e.target.value);
137
136
  }, onOptionSelect: (e, item) => {
138
- const _item = data === null || data === void 0 ? void 0 : data.records.find((x) => String(x[schema.idAttribute]) === item.optionValue);
137
+ const _item = data?.records.find((x) => String(x[schema.idAttribute]) === String(item.optionValue));
139
138
  if (!_item)
140
139
  return;
141
140
  handleAdd(_item);
142
- }, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data === null || data === void 0 ? void 0 : data.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view === null || view === void 0 ? void 0 : view.experience.card, record: item, schema: schema }) }, item[schema.idAttribute]))), !isLoading && !(data === null || data === void 0 ? void 0 : data.records.length) && ((0, jsx_runtime_1.jsx)("div", { style: {
141
+ }, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view?.experience.card, record: item, schema: schema }) }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
143
142
  paddingInline: react_components_1.tokens.spacingHorizontalL,
144
143
  paddingBlock: react_components_1.tokens.spacingVerticalS,
145
144
  }, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: loockupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(react_components_1.ToolbarButton, { style: { fontWeight: 'normal' }, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), children: loockupStrings.newRecord }) })] }))] }), (0, jsx_runtime_1.jsx)("div", { ref: tagGroupContainerRef, style: {
@@ -151,7 +150,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
151
150
  paddingInline: 4,
152
151
  display: 'flex',
153
152
  pointerEvents: 'none',
154
- }, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", style: { flexWrap: 'wrap', rowGap: 8 }, children: value === null || value === void 0 ? void 0 : value.map((item, index) => ((0, jsx_runtime_1.jsx)(TagItem, { disabled: disabled, readOnly: readOnly, value: item, onRemove: handleRemove, allowNavigation: allowNavigation }, `${item.id}-${index}`))) }) })] }));
153
+ }, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", style: { flexWrap: 'wrap', rowGap: 8 }, children: value?.map((item, index) => ((0, jsx_runtime_1.jsx)(TagItem, { disabled: disabled, readOnly: readOnly, value: item, onRemove: handleRemove, allowNavigation: allowNavigation }, `${item.id}-${index}`))) }) })] }));
155
154
  };
156
155
  function TagItem({ disabled, readOnly, value, onRemove, allowNavigation, }) {
157
156
  const routeResolver = (0, hooks_2.useRouteResolver)();
@@ -181,6 +180,6 @@ function TagItem({ disabled, readOnly, value, onRemove, allowNavigation, }) {
181
180
  paddingRight: !disabled && !readOnly ? 0 : 5,
182
181
  pointerEvents: 'auto',
183
182
  }, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
184
- onRemove === null || onRemove === void 0 ? void 0 : onRemove(value.id);
185
- }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, { size: 16 }) }), children: allowNavigation && !!path ? ((0, jsx_runtime_1.jsx)(react_components_1.Link, { onClick: handleOpenRecord, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: value === null || value === void 0 ? void 0 : value.name }) })) : ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: value === null || value === void 0 ? void 0 : value.name })) }));
183
+ onRemove?.(value.id);
184
+ }, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, { size: 16 }) }), children: allowNavigation && !!path ? ((0, jsx_runtime_1.jsx)(react_components_1.Link, { onClick: handleOpenRecord, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: value?.name }) })) : ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { overflow: 'hidden', textOverflow: 'ellipsis' }, children: value?.name })) }));
186
185
  }
@@ -7,7 +7,7 @@ const icons_1 = require("@headless-adminapp/icons");
7
7
  const react_1 = require("react");
8
8
  function PasswordControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, appearance = 'filled-darker', }) {
9
9
  const [showPassword, setShowPassword] = (0, react_1.useState)(false);
10
- return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, name: name, appearance: appearance, type: showPassword ? 'text' : 'password', autoFocus: autoFocus, value: value || '', onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
10
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, name: name, appearance: appearance, type: showPassword ? 'text' : 'password', autoFocus: autoFocus, value: value || '', onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
11
11
  // invalid={error}
12
12
  disabled: disabled, contentAfter: (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", size: "small", onClick: () => setShowPassword(!showPassword), icon: showPassword ? (0, jsx_runtime_1.jsx)(icons_1.Icons.EyeOff, { size: 18 }) : (0, jsx_runtime_1.jsx)(icons_1.Icons.Eye, { size: 18 }) }) }));
13
13
  }
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ControlProps } from './types';
3
+ export interface RichTextControlProps extends ControlProps<string> {
4
+ }
5
+ export declare const RichTextControl: FC<RichTextControlProps>;
@@ -0,0 +1,33 @@
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.RichTextControl = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = require("react");
29
+ const ReactQuill = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('react-quill'))));
30
+ const RichTextControl = ({ value, onChange, id, onBlur, onFocus, disabled, readOnly, }) => {
31
+ return ((0, jsx_runtime_1.jsx)(ReactQuill, { value: value ?? '', onChange: onChange, className: "hdlapp_rte", readOnly: disabled || readOnly, style: { maxHeight: '400px', minHeight: '200px' }, onFocus: onFocus, onBlur: onBlur, id: id }));
32
+ };
33
+ exports.RichTextControl = RichTextControl;
@@ -5,25 +5,24 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const react_1 = require("react");
7
7
  function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }) {
8
- var _a;
9
8
  const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
10
9
  const handleChange = (value) => {
11
10
  const option = options.find((x) => String(x.value) === value);
12
11
  if (option) {
13
- onChange === null || onChange === void 0 ? void 0 : onChange(option.value);
12
+ onChange?.(option.value);
14
13
  }
15
14
  else {
16
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
15
+ onChange?.(null);
17
16
  }
18
17
  };
19
18
  const selectedOption = (0, react_1.useMemo)(() => options.find((x) => x.value === value), [options, value]);
20
19
  return ((0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { placeholder: placeholder, id: id, name: name, appearance: "filled-darker",
21
20
  // data={transformedOptions}
22
- value: (_a = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _a !== void 0 ? _a : '',
21
+ value: selectedOption?.label ?? '',
23
22
  // onChange={(e, v) => handleChange(v as string)}
24
23
  selectedOptions: value ? [String(value)] : [], onOptionSelect: (event, data) => {
25
24
  handleChange(data.optionValue);
26
- }, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
25
+ }, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
27
26
  // error={error}
28
27
  disabled: disabled, children: transformedOptions.map((x) => ((0, jsx_runtime_1.jsx)(react_components_1.Option, { value: x.value, children: x.label }, x.value))) }));
29
28
  }
@@ -1,4 +1,4 @@
1
1
  import { ControlProps } from './types';
2
2
  export interface SwitchControlProps extends ControlProps<boolean> {
3
3
  }
4
- export declare function SwitchControl({}: SwitchControlProps): null;
4
+ export declare function SwitchControl({ value, onChange, id, name, disabled, readOnly, onBlur, onFocus, }: SwitchControlProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwitchControl = SwitchControl;
4
- function SwitchControl({}) {
5
- return null;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ function SwitchControl({ value, onChange, id, name, disabled, readOnly, onBlur, onFocus, }) {
7
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Switch, { checked: value ?? false, onChange: (e) => onChange?.(e.currentTarget.checked), id: id, name: name, disabled: disabled, readOnly: readOnly, onBlur: onBlur, onFocus: onFocus }));
6
8
  }
@@ -2,4 +2,4 @@ import { ControlProps } from './types';
2
2
  export interface TelephoneControlProps extends ControlProps<string> {
3
3
  autoComplete?: string;
4
4
  }
5
- export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, }: TelephoneControlProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, }: Readonly<TelephoneControlProps>): import("react/jsx-runtime").JSX.Element;
@@ -3,14 +3,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TelephoneControl = TelephoneControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
+ const locale_1 = require("@headless-adminapp/app/locale");
7
+ const phone_1 = require("@headless-adminapp/app/utils/phone");
6
8
  const icons_1 = require("@headless-adminapp/icons");
7
- function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, }) {
8
- return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "tel", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
9
+ const react_1 = require("react");
10
+ function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, }) {
11
+ const [internalValue, setInternalValue] = (0, react_1.useState)('');
12
+ const { region } = (0, locale_1.useLocale)();
13
+ const number = (0, react_1.useMemo)(() => {
14
+ if (!value) {
15
+ return null;
16
+ }
17
+ return (0, phone_1.parsePhoneNumber)(value, region);
18
+ }, [value, region]);
19
+ (0, react_1.useEffect)(() => {
20
+ setInternalValue(number?.formattedInternationalValue ?? '');
21
+ }, [number]);
22
+ const handleChange = () => {
23
+ const parsedPhoneNumber = (0, phone_1.parsePhoneNumber)(internalValue, region);
24
+ setInternalValue(parsedPhoneNumber.formattedInternationalValue);
25
+ onChange?.(parsedPhoneNumber.rawValue);
26
+ };
27
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "tel", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: (e) => setInternalValue?.(e.target.value), onBlur: () => {
28
+ handleChange();
29
+ onBlur?.();
30
+ }, onFocus: () => onFocus?.(),
9
31
  // invalid={error}
10
- disabled: disabled, autoComplete: autoComplete, style: {
32
+ readOnly: disabled || readOnly, autoComplete: autoComplete, style: {
11
33
  width: '100%',
12
34
  paddingRight: react_components_1.tokens.spacingHorizontalXS,
13
35
  },
14
36
  // size="sm"
15
- contentAfter: !!value ? ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", size: "small", onClick: () => window.open(`tel:${value}`, '_blank'), icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Phone, {}) })) : undefined }));
37
+ contentAfter: !!number?.uri ? ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", size: "small", onClick: () => window.open(number.uri, '_blank'), title: number.uri, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Phone, {}) })) : undefined }));
16
38
  }
@@ -3,4 +3,4 @@ export interface TextAreaControlProps extends ControlProps<string> {
3
3
  rows?: number;
4
4
  textTransform?: 'capitalize' | 'uppercase' | 'lowercase' | 'none';
5
5
  }
6
- export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, rows, textTransform, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows, textTransform, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextAreaControl = TextAreaControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
- function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, rows = 5, textTransform, }) {
6
+ function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows = 5, textTransform, }) {
7
7
  return ((0, jsx_runtime_1.jsx)(react_components_1.Textarea, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => {
8
8
  textTransform === 'uppercase'
9
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toUpperCase())
9
+ ? onChange?.(e.target.value.toUpperCase())
10
10
  : textTransform === 'lowercase'
11
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toLowerCase())
12
- : onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
13
- }, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
11
+ ? onChange?.(e.target.value.toLowerCase())
12
+ : onChange?.(e.target.value);
13
+ }, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
14
14
  // error={error}
15
- disabled: disabled, rows: rows }));
15
+ readOnly: disabled || readOnly, rows: rows }));
16
16
  }
@@ -11,11 +11,11 @@ readOnly, appearance = 'filled-darker', }) {
11
11
  const readonly = disabled || readOnly;
12
12
  return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, name: name, autoFocus: autoFocus, appearance: appearance, value: value || '', onChange: (e) => {
13
13
  textTransform === 'uppercase'
14
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toUpperCase())
14
+ ? onChange?.(e.target.value.toUpperCase())
15
15
  : textTransform === 'lowercase'
16
- ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toLowerCase())
17
- : onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
18
- }, onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
16
+ ? onChange?.(e.target.value.toLowerCase())
17
+ : onChange?.(e.target.value);
18
+ }, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
19
19
  // invalid={error}
20
20
  // readOnly={readOnly || disabled}
21
21
  readOnly: readonly, autoComplete: autoComplete, autoCorrect: autoCorrect, autoCapitalize: autoCapitalize, className: (0, react_components_1.mergeClasses)(readonly && 'TextControl_readonly'), style: {
@@ -0,0 +1,4 @@
1
+ import { ControlProps } from './types';
2
+ export interface UrlControlProps extends ControlProps<string> {
3
+ }
4
+ export declare function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }: UrlControlProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UrlControl = UrlControl;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_components_1 = require("@fluentui/react-components");
6
+ const icons_1 = require("@headless-adminapp/icons");
7
+ function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
8
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "url", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
9
+ // invalid={error}
10
+ readOnly: disabled || readOnly, autoComplete: "off", style: {
11
+ width: '100%',
12
+ paddingRight: react_components_1.tokens.spacingHorizontalXS,
13
+ },
14
+ // size="sm"
15
+ contentAfter: !!value ? ((0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "transparent", size: "small", onClick: () => window.open(value, '_blank'), icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.OpenInNew, {}) })) : undefined }));
16
+ }
@@ -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.useLookupData = useLookupData;
13
4
  exports.useGetLookupView = useGetLookupView;
@@ -16,42 +7,37 @@ const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
16
7
  const react_query_1 = require("@tanstack/react-query");
17
8
  const react_1 = require("react");
18
9
  function useLookupData({ schema, view, searchText, dataService, enabled, }) {
19
- var _a;
20
10
  const [search] = (0, hooks_1.useDebouncedValue)(searchText, 500);
21
11
  const columns = (0, react_1.useMemo)(() => {
22
- var _a;
23
- if (!(view === null || view === void 0 ? void 0 : view.card)) {
12
+ if (!view?.card) {
24
13
  return [schema.primaryAttribute];
25
14
  }
26
15
  return Array.from(new Set([
27
16
  view.card.primaryColumn,
28
17
  view.card.avatarColumn,
29
- ...((_a = view.card.secondaryColumns) !== null && _a !== void 0 ? _a : [])
18
+ ...(view.card.secondaryColumns ?? [])
30
19
  .filter((x) => !x.expandedKey)
31
20
  .map((x) => x.name),
32
21
  ])).filter(Boolean);
33
- }, [schema.primaryAttribute, view === null || view === void 0 ? void 0 : view.card]);
34
- const expand = (0, react_1.useMemo)(() => {
35
- var _a;
36
- return (((_a = view === null || view === void 0 ? void 0 : view.card) === null || _a === void 0 ? void 0 : _a.secondaryColumns) || [])
37
- .filter((x) => x.expandedKey)
38
- .reduce((acc, x) => {
39
- if (!acc[x.name]) {
40
- acc[x.name] = [];
41
- }
42
- if (!acc[x.name].includes(x.expandedKey)) {
43
- acc[x.name].push(x.expandedKey);
44
- }
45
- return acc;
46
- }, {});
47
- }, [(_a = view === null || view === void 0 ? void 0 : view.card) === null || _a === void 0 ? void 0 : _a.secondaryColumns]);
22
+ }, [schema.primaryAttribute, view?.card]);
23
+ const expand = (0, react_1.useMemo)(() => (view?.card?.secondaryColumns || [])
24
+ .filter((x) => x.expandedKey)
25
+ .reduce((acc, x) => {
26
+ if (!acc[x.name]) {
27
+ acc[x.name] = [];
28
+ }
29
+ if (!acc[x.name].includes(x.expandedKey)) {
30
+ acc[x.name].push(x.expandedKey);
31
+ }
32
+ return acc;
33
+ }, {}), [view?.card?.secondaryColumns]);
48
34
  const queryKey = (0, react_1.useMemo)(() => [
49
35
  'data',
50
36
  'retriveLookupRecords',
51
37
  schema.logicalName,
52
38
  search,
53
- view === null || view === void 0 ? void 0 : view.filter,
54
- view === null || view === void 0 ? void 0 : view.defaultSorting,
39
+ view?.filter,
40
+ view?.defaultSorting,
55
41
  columns,
56
42
  expand,
57
43
  ], [
@@ -59,27 +45,26 @@ function useLookupData({ schema, view, searchText, dataService, enabled, }) {
59
45
  expand,
60
46
  schema.logicalName,
61
47
  search,
62
- view === null || view === void 0 ? void 0 : view.filter,
63
- view === null || view === void 0 ? void 0 : view.defaultSorting,
48
+ view?.filter,
49
+ view?.defaultSorting,
64
50
  ]);
65
51
  const { data, isFetching } = (0, react_query_1.useQuery)({
66
52
  queryKey: queryKey,
67
- queryFn: () => __awaiter(this, void 0, void 0, function* () {
68
- var _a;
69
- const result = yield dataService.retriveRecords({
53
+ queryFn: async () => {
54
+ const result = await dataService.retriveRecords({
70
55
  logicalName: schema.logicalName,
71
56
  search,
72
57
  columns: columns,
73
58
  expand,
74
- filter: (_a = view === null || view === void 0 ? void 0 : view.filter) !== null && _a !== void 0 ? _a : null,
59
+ filter: view?.filter ?? null,
75
60
  skip: 0,
76
61
  limit: 5,
77
- sort: view === null || view === void 0 ? void 0 : view.defaultSorting,
62
+ sort: view?.defaultSorting,
78
63
  });
79
64
  return result;
80
- }),
65
+ },
81
66
  placeholderData: react_query_1.keepPreviousData,
82
- enabled: enabled !== null && enabled !== void 0 ? enabled : false,
67
+ enabled: enabled ?? false,
83
68
  });
84
69
  return {
85
70
  data,
@@ -90,9 +75,9 @@ function useGetLookupView(logicalName, viewId) {
90
75
  const { experienceStore } = (0, hooks_2.useMetadata)();
91
76
  const { isPending, data, error } = (0, react_query_1.useQuery)({
92
77
  queryKey: ['data', 'getLookupView', logicalName, viewId],
93
- queryFn: () => __awaiter(this, void 0, void 0, function* () {
78
+ queryFn: async () => {
94
79
  return experienceStore.getViewLookupV2(logicalName, viewId);
95
- }),
80
+ },
96
81
  });
97
82
  if (error) {
98
83
  console.error(error);
@@ -38,8 +38,8 @@ const FormSection = ({ title, children, columnCount, labelPosition, noPadding, h
38
38
  .map(() => '1fr')
39
39
  .join(' ');
40
40
  const template2 = '';
41
- const minWidthRequired = minControlWidth * (columnCount !== null && columnCount !== void 0 ? columnCount : 1) +
42
- gap * ((columnCount !== null && columnCount !== void 0 ? columnCount : 1) - 1) +
41
+ const minWidthRequired = minControlWidth * (columnCount ?? 1) +
42
+ gap * ((columnCount ?? 1) - 1) +
43
43
  padding * 2;
44
44
  const template = divSize.width >= minWidthRequired ? template1 : template2;
45
45
  const spanTemplates = {
@@ -75,7 +75,14 @@ const FormSection = ({ title, children, columnCount, labelPosition, noPadding, h
75
75
  display: 'flex',
76
76
  flexDirection: 'column',
77
77
  padding,
78
- }, children: (0, jsx_runtime_1.jsx)("div", { style: Object.assign({ flex: 1, display: 'grid', gridTemplateColumns: template, rowGap: gap, columnGap: gap }, spanTemplates), children: children }) })] }) }));
78
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
79
+ flex: 1,
80
+ display: 'grid',
81
+ gridTemplateColumns: template,
82
+ rowGap: gap,
83
+ columnGap: gap,
84
+ ...spanTemplates,
85
+ }, children: children }) })] }) }));
79
86
  };
80
87
  exports.FormSection = FormSection;
81
88
  exports.FormSection.Column = FormSectionColumn_1.FormSectionColumn;
@@ -21,13 +21,13 @@ const FormTab = (props) => {
21
21
  if (props.noWrapper) {
22
22
  return props.children;
23
23
  }
24
- return (0, jsx_runtime_1.jsx)(FormTabInternal, Object.assign({}, props));
24
+ return (0, jsx_runtime_1.jsx)(FormTabInternal, { ...props });
25
25
  };
26
26
  exports.FormTab = FormTab;
27
27
  /** @todo: unfinished component */
28
28
  const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidths, }) => {
29
29
  const divRef = (0, react_1.useRef)(null);
30
- const divSize = (0, hooks_1.useElementSize)(divRef);
30
+ const divSize = (0, hooks_1.useElementSize)(divRef, 100);
31
31
  const padding = 0;
32
32
  // const columnCount = 2;
33
33
  const minSectionWidth = 392;
@@ -38,7 +38,7 @@ const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidth
38
38
  // gap,
39
39
  // padding
40
40
  // );
41
- columnCount = columnCount !== null && columnCount !== void 0 ? columnCount : 1;
41
+ columnCount = columnCount ?? 1;
42
42
  // if (itemCount > columnCount) {
43
43
  // itemCount = columnCount;
44
44
  // }
@@ -66,7 +66,7 @@ const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidth
66
66
  flexDirection: 'column',
67
67
  flex: 1,
68
68
  // marginTop: 12,
69
- padding: 12,
69
+ // padding: 12,
70
70
  }, children: (0, jsx_runtime_1.jsx)("div", { style: {
71
71
  // display: 'flex',
72
72
  // flexWrap: 'wrap',
package/form/types.d.ts CHANGED
@@ -2,11 +2,11 @@ import { JSX } from 'react';
2
2
  import { CurrencyControlProps } from './controls/CurrencyControl';
3
3
  import { DateControlProps } from './controls/DateControl';
4
4
  import { DateTimeControlProps } from './controls/DateTimeControl';
5
+ import { DecimalControlProps } from './controls/DecimalControl';
5
6
  import { EmailControlProps } from './controls/EmailControl';
6
7
  import { LookupControlProps } from './controls/LookupControl';
7
8
  import { MultiSelectControlProps } from './controls/MultiSelectControl';
8
9
  import { MultiSelectLookupControlProps } from './controls/MultiSelectLookupControl';
9
- import { NumberControlProps } from './controls/NumberControl';
10
10
  import { PasswordControlProps } from './controls/PasswordControl';
11
11
  import { SelectControlProps } from './controls/SelectControl';
12
12
  import { SwitchControlProps } from './controls/SwitchControl';
@@ -32,7 +32,7 @@ export type EmailFormControlProps = BaseFormControlProps & EmailControlProps & {
32
32
  export type PasswordFormControlProps = BaseFormControlProps & PasswordControlProps & {
33
33
  type: 'password';
34
34
  };
35
- export type NumberFormControlProps = BaseFormControlProps & NumberControlProps & {
35
+ export type NumberFormControlProps = BaseFormControlProps & DecimalControlProps & {
36
36
  type: 'number';
37
37
  };
38
38
  export type CurrencyFormControlProps = BaseFormControlProps & CurrencyControlProps & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.8",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -16,20 +16,21 @@
16
16
  "bugs": {
17
17
  "url": "https://github.com/headless-adminapp/adminapp/issues"
18
18
  },
19
- "scripts": {
20
- "build": "tsc",
21
- "ts-check": "tsc --noEmit",
22
- "copy-files": "cp package.json dist",
23
- "prepublishOnly": "pnpm run build && pnpm run copy-files",
24
- "test": "echo \"Error: no test specified\" && exit 1"
25
- },
19
+ "scripts": {},
26
20
  "keywords": [],
27
21
  "author": "",
28
22
  "license": "ISC",
29
23
  "dependencies": {
24
+ "@fluentui/react-calendar-compat": "0.1.20",
30
25
  "@fluentui/react-components": "9.54.4",
31
- "@fluentui/react-datepicker-compat": "^0.4.43",
32
- "@fluentui/react-nav-preview": "^0.5.1",
26
+ "@fluentui/react-datepicker-compat": "0.4.43",
27
+ "@fluentui/react-nav-preview": "0.5.1",
28
+ "@fluentui/react-timepicker-compat": "0.2.46",
29
+ "@fullcalendar/core": "6.1.15",
30
+ "@fullcalendar/daygrid": "6.1.15",
31
+ "@fullcalendar/interaction": "6.1.15",
32
+ "@fullcalendar/react": "6.1.15",
33
+ "@fullcalendar/timegrid": "6.1.15",
33
34
  "@hookform/resolvers": "^3.9.0",
34
35
  "@tanstack/react-query": "5.51.1",
35
36
  "@tanstack/react-table": "^8.20.1",
@@ -41,7 +42,11 @@
41
42
  "react-dnd": "^16.0.1",
42
43
  "react-dnd-html5-backend": "^16.0.1",
43
44
  "react-hook-form": "7.52.2",
45
+ "react-quill": "^2.0.0",
46
+ "recharts": "^2.13.3",
47
+ "sass": "1.81.0",
48
+ "uuid": "11.0.3",
44
49
  "yup": "^1.4.0"
45
50
  },
46
- "gitHead": "0c369830a0ba4aa5744cc307f8947ae9660980c4"
47
- }
51
+ "gitHead": "61978f1e2f0eac79069afa52511a5c8dde8b8ebc"
52
+ }