@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.
- package/App/App.d.ts +0 -1
- package/App/App.js +2 -4
- package/App/AppHeaderContianer.d.ts +5 -1
- package/App/AppHeaderContianer.js +43 -26
- package/App/AppLogo.js +15 -4
- package/App/AppUI.js +9 -1
- package/App/LayoutProvider.d.ts +7 -0
- package/App/LayoutProvider.js +17 -0
- package/App/NavigationContainer.d.ts +10 -1
- package/App/NavigationContainer.js +27 -22
- package/App/QuickActionItem.js +2 -2
- package/App/utils.js +3 -4
- package/CommandBar/Button.d.ts +2 -1
- package/CommandBar/Button.js +2 -2
- package/CommandBar/Divider.d.ts +2 -1
- package/CommandBar/Divider.js +2 -2
- package/CommandBar/IconButton.d.ts +2 -1
- package/CommandBar/IconButton.js +2 -2
- package/CommandBar/Label.d.ts +2 -1
- package/CommandBar/Label.js +2 -2
- package/CommandBar/MenuButton.d.ts +2 -1
- package/CommandBar/MenuButton.js +3 -3
- package/CommandBar/MenuItem.js +5 -4
- package/CommandBar/MenuItems.js +4 -4
- package/CommandBar/MenuList.js +5 -4
- package/CommandBar/Wrapper.d.ts +2 -2
- package/CommandBar/Wrapper.js +2 -2
- package/CommandBar/index.d.ts +6 -6
- package/DataGrid/ActionCell.d.ts +1 -1
- package/DataGrid/ActionCell.js +8 -4
- package/DataGrid/CustomizeColumns/AddColumns.js +33 -35
- package/DataGrid/CustomizeColumns/ColumnItem.js +8 -6
- package/DataGrid/CustomizeColumns/CustomizeColumns.d.ts +2 -2
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +3 -6
- package/DataGrid/FormSubgridViewSelector.js +1 -5
- package/DataGrid/GridColumnHeader/ConditionValueControl.js +19 -25
- package/DataGrid/GridColumnHeader/FilterForm.js +9 -10
- package/DataGrid/GridColumnHeader/OperatorSelect.js +10 -3
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +22 -13
- package/DataGrid/GridColumnHeader/utils.js +10 -7
- package/DataGrid/GridHeaderDesktop.js +4 -5
- package/DataGrid/GridHeaderMobile.d.ts +5 -0
- package/DataGrid/GridHeaderMobile.js +29 -0
- package/DataGrid/GridListContainer.d.ts +12 -0
- package/DataGrid/GridListContainer.js +93 -0
- package/DataGrid/GridPaginationContainer.js +1 -2
- package/DataGrid/GridTableContainer.js +113 -77
- package/DataGrid/TableCell/TableCellBase.d.ts +2 -2
- package/DataGrid/TableCell/TableCellBase.js +6 -1
- package/DataGrid/TableCell/TableCellCheckbox.js +6 -5
- package/DataGrid/TableCell/TableCellChoice.d.ts +15 -0
- package/DataGrid/TableCell/TableCellChoice.js +34 -0
- package/DataGrid/TableCell/TableCellLink.d.ts +2 -1
- package/DataGrid/TableCell/TableCellLink.js +13 -5
- package/DataGrid/TableCell/TableCellText.js +9 -4
- package/DataGrid/types.d.ts +5 -0
- package/DataGrid/types.js +2 -0
- package/DataGrid/useTableColumns.d.ts +2 -3
- package/DataGrid/useTableColumns.js +297 -155
- package/DialogContainer/AlertDialog.js +3 -6
- package/DialogContainer/ConfirmDialog.js +5 -9
- package/DialogContainer/DialogContainer.js +2 -13
- package/DialogContainer/ErrorDialog.js +3 -6
- package/DialogContainer/PromptDialog.d.ts +13 -2
- package/DialogContainer/PromptDialog.js +44 -39
- package/Insights/CommandBarContainer.d.ts +1 -0
- package/Insights/CommandBarContainer.js +18 -0
- package/Insights/FilterBarContainer.d.ts +1 -0
- package/Insights/FilterBarContainer.js +99 -0
- package/Insights/Grid.d.ts +6 -0
- package/Insights/Grid.js +26 -0
- package/Insights/InsightsContainer.d.ts +1 -0
- package/Insights/InsightsContainer.js +35 -0
- package/Insights/WidgetChartContainer.d.ts +7 -0
- package/Insights/WidgetChartContainer.js +56 -0
- package/Insights/WidgetDataGridContainer.d.ts +4 -0
- package/Insights/WidgetDataGridContainer.js +80 -0
- package/Insights/WidgetTableContainer.d.ts +7 -0
- package/Insights/WidgetTableContainer.js +57 -0
- package/Insights/WidgetTileContainer.d.ts +7 -0
- package/Insights/WidgetTileContainer.js +24 -0
- package/Insights/WidgetTitleBar.d.ts +7 -0
- package/Insights/WidgetTitleBar.js +21 -0
- package/Insights/Widgets.d.ts +4 -0
- package/Insights/Widgets.js +57 -0
- package/Insights/charts/AreaChart.d.ts +5 -0
- package/Insights/charts/AreaChart.js +20 -0
- package/Insights/charts/BarChart.d.ts +5 -0
- package/Insights/charts/BarChart.js +20 -0
- package/Insights/charts/ComposedChart.d.ts +5 -0
- package/Insights/charts/ComposedChart.js +19 -0
- package/Insights/charts/CustomTooltipContent.d.ts +7 -0
- package/Insights/charts/CustomTooltipContent.js +25 -0
- package/Insights/charts/GaugeChart.d.ts +5 -0
- package/Insights/charts/GaugeChart.js +8 -0
- package/Insights/charts/LineChart.d.ts +5 -0
- package/Insights/charts/LineChart.js +21 -0
- package/Insights/charts/OhlcChart.d.ts +6 -0
- package/Insights/charts/OhlcChart.js +119 -0
- package/Insights/charts/PieChart.d.ts +5 -0
- package/Insights/charts/PieChart.js +54 -0
- package/Insights/charts/RadarChart.d.ts +5 -0
- package/Insights/charts/RadarChart.js +38 -0
- package/Insights/charts/ScatterChart.d.ts +5 -0
- package/Insights/charts/ScatterChart.js +81 -0
- package/Insights/charts/constants.d.ts +1 -0
- package/Insights/charts/constants.js +25 -0
- package/Insights/charts/formatters.d.ts +14 -0
- package/Insights/charts/formatters.js +186 -0
- package/Insights/charts/index.d.ts +4 -0
- package/Insights/charts/index.js +13 -0
- package/Insights/charts/renderers.d.ts +10 -0
- package/Insights/charts/renderers.js +64 -0
- package/Insights/hooks/useQueriesData.d.ts +7 -0
- package/Insights/hooks/useQueriesData.js +90 -0
- package/Insights/hooks/useWidgetDetail.d.ts +10 -0
- package/Insights/hooks/useWidgetDetail.js +39 -0
- package/OverflowCommandBar/OverflowCommandBar.js +1 -4
- package/OverflowCommandBar/OverflowMenu.js +5 -17
- package/OverflowCommandBar/render.js +3 -4
- package/OverflowCommandBar/utils.js +2 -3
- package/PageBoard/BoardColumn.d.ts +5 -0
- package/PageBoard/BoardColumn.js +9 -0
- package/PageBoard/BoardColumnCard.d.ts +12 -0
- package/PageBoard/BoardColumnCard.js +29 -0
- package/PageBoard/BoardColumnUI.d.ts +2 -0
- package/PageBoard/BoardColumnUI.js +76 -0
- package/PageBoard/BoardingColumnCardLoading.d.ts +1 -0
- package/PageBoard/BoardingColumnCardLoading.js +21 -0
- package/PageBoard/Header.d.ts +7 -0
- package/PageBoard/Header.js +31 -0
- package/PageBoard/PageBoard.d.ts +7 -0
- package/PageBoard/PageBoard.js +46 -0
- package/PageBoard/index.d.ts +1 -0
- package/PageBoard/index.js +5 -0
- package/PageCalendar/CalendarSection.d.ts +20 -0
- package/PageCalendar/CalendarSection.js +108 -0
- package/PageCalendar/EventDialog/AttributeController.d.ts +10 -0
- package/PageCalendar/EventDialog/AttributeController.js +17 -0
- package/PageCalendar/EventDialog/EventDialog.d.ts +25 -0
- package/PageCalendar/EventDialog/EventDialog.js +21 -0
- package/PageCalendar/EventDialog/EventFormBody.d.ts +18 -0
- package/PageCalendar/EventDialog/EventFormBody.js +69 -0
- package/PageCalendar/EventDialog/EventFormContent.d.ts +10 -0
- package/PageCalendar/EventDialog/EventFormContent.js +27 -0
- package/PageCalendar/EventDialog/types.d.ts +3 -0
- package/PageCalendar/EventDialog/types.js +2 -0
- package/PageCalendar/EventDialog/utils.d.ts +23 -0
- package/PageCalendar/EventDialog/utils.js +57 -0
- package/PageCalendar/Header.d.ts +8 -0
- package/PageCalendar/Header.js +35 -0
- package/PageCalendar/PageCalendar.d.ts +7 -0
- package/PageCalendar/PageCalendar.js +231 -0
- package/PageCalendar/TitleSelector.d.ts +10 -0
- package/PageCalendar/TitleSelector.js +73 -0
- package/PageCalendar/ViewSelector.d.ts +8 -0
- package/PageCalendar/ViewSelector.js +52 -0
- package/PageCalendar/baseEventAttributes.d.ts +35 -0
- package/PageCalendar/baseEventAttributes.js +38 -0
- package/PageCalendar/context.d.ts +20 -0
- package/PageCalendar/context.js +5 -0
- package/PageCalendar/hooks/index.d.ts +1 -0
- package/PageCalendar/hooks/index.js +17 -0
- package/PageCalendar/hooks/useConfig.d.ts +3 -0
- package/PageCalendar/hooks/useConfig.js +8 -0
- package/PageCalendar/index.d.ts +1 -0
- package/PageCalendar/index.js +5 -0
- package/PageCalendar/renderEventContent.d.ts +2 -0
- package/PageCalendar/renderEventContent.js +22 -0
- package/PageCalendar/types.d.ts +5 -0
- package/PageCalendar/types.js +9 -0
- package/PageCalendar/utils.d.ts +3 -0
- package/PageCalendar/utils.js +17 -0
- package/PageEntityForm/CommandContainer.js +9 -5
- package/PageEntityForm/PageCustomEntityForm.d.ts +15 -0
- package/PageEntityForm/PageCustomEntityForm.js +17 -0
- package/PageEntityForm/PageEntityFormDesktopContainer.js +39 -19
- package/PageEntityForm/ProcessFlow.d.ts +10 -0
- package/PageEntityForm/ProcessFlow.js +84 -0
- package/PageEntityForm/RecordAvatar.d.ts +2 -0
- package/PageEntityForm/RecordAvatar.js +83 -0
- package/PageEntityForm/RecordCard.d.ts +1 -1
- package/PageEntityForm/RecordCard.js +60 -53
- package/PageEntityForm/RecordCardLoading.d.ts +8 -0
- package/PageEntityForm/RecordCardLoading.js +24 -0
- package/PageEntityForm/RecordSetNavigatorContainer.js +1 -2
- package/PageEntityForm/RelatedViewSelector.d.ts +0 -2
- package/PageEntityForm/RelatedViewSelector.js +37 -11
- package/PageEntityForm/SectionContainer.d.ts +2 -2
- package/PageEntityForm/SectionContainer.js +77 -13
- package/PageEntityForm/StandardControl.d.ts +1 -22
- package/PageEntityForm/StandardControl.js +103 -117
- package/PageEntityForm/SubgridControl.d.ts +1 -0
- package/PageEntityForm/SubgridControl.js +4 -2
- package/PageEntityForm/UploadImageDialog.d.ts +12 -0
- package/PageEntityForm/UploadImageDialog.js +114 -0
- package/PageEntityView/FormSubgridContainer.js +5 -2
- package/PageEntityView/FormSubgridNotAvailableContainer.d.ts +2 -0
- package/PageEntityView/FormSubgridNotAvailableContainer.js +48 -0
- package/PageEntityView/PageEntityView.js +4 -1
- package/PageEntityView/PageEntityViewDesktopFrame.js +1 -0
- package/PageEntityView/PageEntityViewMobileContainer.d.ts +2 -0
- package/PageEntityView/PageEntityViewMobileContainer.js +14 -0
- package/PageEntityView/PageEntityViewStringContext.d.ts +2 -0
- package/PageEntityView/PageEntityViewStringContext.js +2 -0
- package/PageInsights/PageInsights.d.ts +9 -0
- package/PageInsights/PageInsights.js +25 -0
- package/PageInsights/index.d.ts +1 -0
- package/PageInsights/index.js +6 -0
- package/ToastNotificationContainer/index.js +1 -2
- package/componentStore.d.ts +2 -0
- package/componentStore.js +5 -0
- package/components/BodyLoading.d.ts +1 -1
- package/components/BodyLoading.js +13 -8
- package/components/DndProvider.d.ts +12 -0
- package/components/DndProvider.js +68 -0
- package/components/LoginForm.js +5 -21
- package/form/FormControl.js +19 -41
- package/form/controls/AttachmentControl.d.ts +27 -0
- package/form/controls/AttachmentControl.js +220 -0
- package/form/controls/AttachmentsControl.d.ts +6 -0
- package/form/controls/AttachmentsControl.js +35 -0
- package/form/controls/CurrencyControl.js +38 -6
- package/form/controls/DateControl.d.ts +1 -1
- package/form/controls/DateControl.js +18 -7
- package/form/controls/DateRangeControl.js +4 -6
- package/form/controls/DateTimeControl.d.ts +1 -1
- package/form/controls/DateTimeControl.js +108 -12
- package/form/controls/DecimalControl.d.ts +5 -0
- package/form/controls/DecimalControl.js +52 -0
- package/form/controls/DurationControl.d.ts +4 -0
- package/form/controls/DurationControl.js +209 -0
- package/form/controls/EmailControl.d.ts +1 -1
- package/form/controls/EmailControl.js +5 -5
- package/form/controls/IntegerControl.d.ts +4 -0
- package/form/controls/IntegerControl.js +25 -0
- package/form/controls/LookupControl.d.ts +1 -0
- package/form/controls/LookupControl.js +57 -13
- package/form/controls/MultiSelectControl.js +3 -3
- package/form/controls/MultiSelectLookupControl.js +16 -17
- package/form/controls/PasswordControl.js +1 -1
- package/form/controls/RichTextControl.d.ts +5 -0
- package/form/controls/RichTextControl.js +33 -0
- package/form/controls/SelectControl.js +4 -5
- package/form/controls/SwitchControl.d.ts +1 -1
- package/form/controls/SwitchControl.js +4 -2
- package/form/controls/TelephoneControl.d.ts +1 -1
- package/form/controls/TelephoneControl.js +26 -4
- package/form/controls/TextAreaControl.d.ts +1 -1
- package/form/controls/TextAreaControl.js +6 -6
- package/form/controls/TextControl.js +4 -4
- package/form/controls/UrlControl.d.ts +4 -0
- package/form/controls/UrlControl.js +16 -0
- package/form/controls/useLookupData.js +26 -41
- package/form/layout/FormSection/FormSection.js +10 -3
- package/form/layout/FormTab/FormTab.js +4 -4
- package/form/types.d.ts +2 -2
- package/package.json +17 -12
- package/styles.css +149 -0
- package/types/index.d.ts +18 -0
- package/utils/avatar.d.ts +2 -0
- package/utils/avatar.js +45 -0
- package/App/AppProvider.d.ts +0 -9
- package/App/AppProvider.js +0 -50
- package/DataGrid/ScrollbarWithMoreDataRequest.d.ts +0 -9
- package/DataGrid/ScrollbarWithMoreDataRequest.js +0 -33
- package/DataGrid/getAttributeFormattedValue.d.ts +0 -16
- package/DataGrid/getAttributeFormattedValue.js +0 -92
- package/form/controls/NumberControl.d.ts +0 -4
- 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,
|
|
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
|
|
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 =
|
|
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
|
|
69
|
-
const remainingWidth = containerBoundingRect.right - (
|
|
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
|
|
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
|
|
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
|
|
118
|
-
if (!
|
|
119
|
-
onChange
|
|
116
|
+
const newValue = value?.filter((x) => x.id !== id);
|
|
117
|
+
if (!newValue?.length) {
|
|
118
|
+
onChange?.(null);
|
|
120
119
|
}
|
|
121
120
|
else {
|
|
122
|
-
onChange
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,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
|
|
12
|
+
onChange?.(option.value);
|
|
14
13
|
}
|
|
15
14
|
else {
|
|
16
|
-
onChange
|
|
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:
|
|
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
|
|
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):
|
|
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
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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: !!
|
|
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
|
|
9
|
+
? onChange?.(e.target.value.toUpperCase())
|
|
10
10
|
: textTransform === 'lowercase'
|
|
11
|
-
? onChange
|
|
12
|
-
: onChange
|
|
13
|
-
}, onBlur: () => onBlur
|
|
11
|
+
? onChange?.(e.target.value.toLowerCase())
|
|
12
|
+
: onChange?.(e.target.value);
|
|
13
|
+
}, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
14
14
|
// error={error}
|
|
15
|
-
|
|
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
|
|
14
|
+
? onChange?.(e.target.value.toUpperCase())
|
|
15
15
|
: textTransform === 'lowercase'
|
|
16
|
-
? onChange
|
|
17
|
-
: onChange
|
|
18
|
-
}, onBlur: () => onBlur
|
|
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
|
-
|
|
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
|
-
...(
|
|
18
|
+
...(view.card.secondaryColumns ?? [])
|
|
30
19
|
.filter((x) => !x.expandedKey)
|
|
31
20
|
.map((x) => x.name),
|
|
32
21
|
])).filter(Boolean);
|
|
33
|
-
}, [schema.primaryAttribute, view
|
|
34
|
-
const expand = (0, react_1.useMemo)(() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
54
|
-
view
|
|
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
|
|
63
|
-
view
|
|
48
|
+
view?.filter,
|
|
49
|
+
view?.defaultSorting,
|
|
64
50
|
]);
|
|
65
51
|
const { data, isFetching } = (0, react_query_1.useQuery)({
|
|
66
52
|
queryKey: queryKey,
|
|
67
|
-
queryFn: () =>
|
|
68
|
-
|
|
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:
|
|
59
|
+
filter: view?.filter ?? null,
|
|
75
60
|
skip: 0,
|
|
76
61
|
limit: 5,
|
|
77
|
-
sort: view
|
|
62
|
+
sort: view?.defaultSorting,
|
|
78
63
|
});
|
|
79
64
|
return result;
|
|
80
|
-
}
|
|
65
|
+
},
|
|
81
66
|
placeholderData: react_query_1.keepPreviousData,
|
|
82
|
-
enabled: enabled
|
|
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: () =>
|
|
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
|
|
42
|
-
gap * ((columnCount
|
|
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:
|
|
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,
|
|
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
|
|
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 &
|
|
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": "
|
|
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": "
|
|
32
|
-
"@fluentui/react-nav-preview": "
|
|
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": "
|
|
47
|
-
}
|
|
51
|
+
"gitHead": "61978f1e2f0eac79069afa52511a5c8dde8b8ebc"
|
|
52
|
+
}
|