@headless-adminapp/fluent 1.0.3 → 1.1.0
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/AppHeaderContianer.js +5 -1
- package/App/AppUI.js +7 -2
- package/App/Navigation/NavCategoryItemComponent.d.ts +8 -0
- package/App/Navigation/NavCategoryItemComponent.js +20 -0
- package/App/Navigation/NavItemComponent.d.ts +8 -0
- package/App/Navigation/NavItemComponent.js +19 -0
- package/App/Navigation/NavSubItemComponent.d.ts +8 -0
- package/App/Navigation/NavSubItemComponent.js +17 -0
- package/App/Navigation/NavigationContainer.d.ts +9 -0
- package/App/Navigation/NavigationContainer.js +85 -0
- package/App/Navigation/index.d.ts +1 -0
- package/App/Navigation/index.js +5 -0
- package/App/Navigation/types.d.ts +39 -0
- package/App/Navigation/types.js +2 -0
- package/App/Navigation/utils.d.ts +18 -0
- package/App/Navigation/utils.js +82 -0
- package/App/QuickActionItem.d.ts +3 -0
- package/App/QuickActionItem.js +12 -3
- package/CommandBar/Button.d.ts +1 -0
- package/CommandBar/Button.js +22 -2
- package/CommandBar/IconButton.d.ts +1 -0
- package/CommandBar/MenuButton.d.ts +1 -0
- package/CommandBar/MenuItem.d.ts +1 -0
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +3 -1
- package/DataGrid/GridHeaderContainer.d.ts +1 -0
- package/DataGrid/GridHeaderContainer.js +6 -1
- package/DataGrid/GridHeaderDesktopV2.d.ts +6 -0
- package/DataGrid/GridHeaderDesktopV2.js +54 -0
- package/DataGrid/GridListContainer.js +9 -5
- package/DataGrid/GridTableContainer.d.ts +2 -0
- package/DataGrid/GridTableContainer.js +37 -13
- package/DataGrid/TableCell/TableCellAction.js +2 -1
- package/DataGrid/TableCell/TableCellBase.js +1 -0
- package/DataGrid/TableCell/TableCellLink.js +1 -0
- package/DataGrid/constants.d.ts +2 -0
- package/DataGrid/constants.js +5 -0
- package/DataGrid/useTableColumns.js +23 -6
- package/Insights/CommandBarContainer.js +1 -1
- package/Insights/FilterBarContainer.js +8 -8
- package/Insights/Grid.d.ts +7 -1
- package/Insights/Grid.js +24 -8
- package/Insights/Header.d.ts +6 -0
- package/Insights/Header.js +50 -0
- package/Insights/InsightsContainer.js +19 -14
- package/Insights/WidgetChartContainer.d.ts +13 -3
- package/Insights/WidgetChartContainer.js +62 -38
- package/Insights/WidgetDataGridContainer.d.ts +11 -4
- package/Insights/WidgetDataGridContainer.js +7 -28
- package/Insights/WidgetSection.d.ts +2 -0
- package/Insights/WidgetSection.js +16 -0
- package/Insights/WidgetTableContainer.d.ts +9 -2
- package/Insights/WidgetTableContainer.js +7 -18
- package/Insights/WidgetTileContainer.d.ts +0 -2
- package/Insights/WidgetTileContainer.js +8 -11
- package/Insights/WidgetTitleBar.d.ts +1 -1
- package/Insights/WidgetTitleBar.js +1 -1
- package/Insights/Widgets.d.ts +2 -2
- package/Insights/Widgets.js +15 -48
- package/Insights/charts/AreaChart.d.ts +1 -0
- package/Insights/charts/AreaChart.js +4 -1
- package/Insights/charts/BarChart.d.ts +1 -0
- package/Insights/charts/BarChart.js +3 -2
- package/Insights/charts/ComposedChart.d.ts +1 -0
- package/Insights/charts/ComposedChart.js +4 -1
- package/Insights/charts/FunnelChart.d.ts +6 -0
- package/Insights/charts/FunnelChart.js +50 -0
- package/Insights/charts/FunnelCustomTooltipContent.d.ts +5 -0
- package/Insights/charts/FunnelCustomTooltipContent.js +27 -0
- package/Insights/charts/GaugeChart.d.ts +1 -0
- package/Insights/charts/GaugeChart.js +1 -0
- package/Insights/charts/LineChart.d.ts +1 -0
- package/Insights/charts/LineChart.js +2 -2
- package/Insights/charts/OhlcChart.d.ts +1 -0
- package/Insights/charts/OhlcChart.js +1 -1
- package/Insights/charts/PieChart.d.ts +1 -0
- package/Insights/charts/PieChart.js +2 -1
- package/Insights/charts/RadarChart.d.ts +1 -0
- package/Insights/charts/RadarChart.js +1 -0
- package/Insights/charts/ScatterChart.d.ts +1 -0
- package/Insights/charts/ScatterChart.js +2 -1
- package/Insights/charts/renderers.d.ts +6 -5
- package/Insights/charts/renderers.js +16 -13
- package/Insights/constants.d.ts +4 -0
- package/Insights/constants.js +7 -0
- package/Insights/hooks/useQueriesData.d.ts +2 -2
- package/Insights/hooks/useQueriesData.js +0 -1
- package/OverflowCommandBar/render.js +3 -3
- package/PageBoard/BoardColumnUI.js +36 -7
- package/PageBoard/Header.js +5 -3
- package/PageBoard/PageBoard.js +7 -1
- package/PageCalendar/CalendarSection.js +37 -8
- package/PageCalendar/EventDialog/AttributeController.d.ts +2 -1
- package/PageCalendar/EventDialog/AttributeController.js +2 -2
- package/PageCalendar/EventDialog/EventFormBody.js +17 -2
- package/PageCalendar/EventDialog/EventFormContent.d.ts +4 -1
- package/PageCalendar/EventDialog/EventFormContent.js +7 -7
- package/PageCalendar/Header.js +1 -1
- package/PageCalendar/PageCalendar.js +6 -1
- package/PageCalendar/TitleSelector.js +8 -4
- package/PageEntityForm/PageEntityFormDesktopContainer.js +4 -0
- package/PageEntityForm/RecordAvatar.js +1 -2
- package/PageEntityForm/RecordCard.js +17 -28
- package/PageEntityForm/RelatedViewSelector.js +1 -0
- package/PageEntityForm/SectionContainer.js +7 -1
- package/PageEntityView/PageEntityView.d.ts +1 -0
- package/PageEntityView/PageEntityView.js +12 -2
- package/PageEntityView/PageEntityViewDesktopContainer.d.ts +1 -0
- package/PageEntityView/PageEntityViewDesktopContainer.js +7 -3
- package/PageEntityView/PageEntityViewDesktopFrame.js +1 -1
- package/PageEntityView/PageEntityViewDesktopFrameV2.d.ts +8 -0
- package/PageEntityView/PageEntityViewDesktopFrameV2.js +48 -0
- package/PageEntityView/PageEntityViewMobileContainer.js +2 -3
- package/PageEntityView/PageEntityViewMobileFrame.d.ts +8 -0
- package/PageEntityView/PageEntityViewMobileFrame.js +38 -0
- package/PageInsight/PageInsight.d.ts +7 -0
- package/PageInsight/PageInsight.js +31 -0
- package/PageInsight/index.d.ts +1 -0
- package/PageInsight/index.js +5 -0
- package/PageInsights/PageInsights.d.ts +5 -7
- package/PageInsights/PageInsights.js +24 -18
- package/PageInsights/index.d.ts +1 -1
- package/PageInsights/index.js +1 -2
- package/components/ComponentBroken.d.ts +7 -0
- package/components/ComponentBroken.js +16 -0
- package/components/ComponentErrorBoundary.d.ts +15 -0
- package/components/ComponentErrorBoundary.js +26 -0
- package/form/controls/DateTimeControl.js +17 -3
- package/form/controls/DurationControl.js +0 -2
- package/form/controls/LookupControl.js +6 -3
- package/package.json +3 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentErrorBoundary = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_1 = require("@headless-adminapp/icons");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const ComponentBroken_1 = require("./ComponentBroken");
|
|
8
|
+
class ComponentErrorBoundary extends react_1.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = { hasError: false };
|
|
12
|
+
}
|
|
13
|
+
static getDerivedStateFromError() {
|
|
14
|
+
return { hasError: true };
|
|
15
|
+
}
|
|
16
|
+
componentDidCatch(error, errorInfo) {
|
|
17
|
+
console.error(error, errorInfo);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
if (this.state.hasError) {
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(ComponentBroken_1.ComponentBroken, { Icon: icons_1.Icons.Block, message: "Component render failed" }));
|
|
22
|
+
}
|
|
23
|
+
return this.props.children;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.ComponentErrorBoundary = ComponentErrorBoundary;
|
|
@@ -31,11 +31,21 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
31
31
|
setInternalTimeValue(updatedValue);
|
|
32
32
|
}
|
|
33
33
|
}, [value, timezone, timeFormat]);
|
|
34
|
+
const isReadonly = readOnly || disabled;
|
|
35
|
+
const [isDatePickerOpen, setIsDatePickerOpen] = (0, react_1.useState)(false);
|
|
34
36
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
35
37
|
display: 'flex',
|
|
36
38
|
alignItems: 'center',
|
|
37
39
|
gap: react_components_1.tokens.spacingHorizontalS,
|
|
38
|
-
}, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name,
|
|
40
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, open: isDatePickerOpen, onOpenChange: (isOpen) => {
|
|
41
|
+
if (isOpen && isReadonly) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setIsDatePickerOpen(isOpen);
|
|
45
|
+
if (!isOpen) {
|
|
46
|
+
onBlur?.();
|
|
47
|
+
}
|
|
48
|
+
}, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker", formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormat) : '', readOnly: isReadonly, value: value ? new Date(value) : null, onSelectDate: (date) => {
|
|
39
49
|
if (!date) {
|
|
40
50
|
onChange?.(null);
|
|
41
51
|
}
|
|
@@ -62,9 +72,13 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
62
72
|
color: react_components_1.tokens.colorNeutralForeground2,
|
|
63
73
|
}, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Calendar, { size: 20 }) }), style: { flex: 1 }, input: {
|
|
64
74
|
style: { minWidth: 0, width: '100%' },
|
|
65
|
-
} }), (0, jsx_runtime_1.jsx)(react_timepicker_compat_1.TimePicker, { appearance: "filled-darker", style: {
|
|
75
|
+
} }), (0, jsx_runtime_1.jsx)(react_timepicker_compat_1.TimePicker, { appearance: "filled-darker", style: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
minWidth: 0,
|
|
78
|
+
pointerEvents: isReadonly ? 'none' : 'auto',
|
|
79
|
+
}, input: {
|
|
66
80
|
style: { minWidth: 0 },
|
|
67
|
-
}, readOnly:
|
|
81
|
+
}, readOnly: isReadonly || !value,
|
|
68
82
|
// selectedTime={value ? new Date(value) : null}
|
|
69
83
|
selectedTime: value
|
|
70
84
|
? (0, dayjs_1.default)((0, dayjs_1.default)(value).tz(timezone).format('YYYY-MM-DD HH:mm:ss')).toDate()
|
|
@@ -122,7 +122,6 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
if (newValue !== null) {
|
|
125
|
-
console.log('onBlur', newValue);
|
|
126
125
|
onChange?.(newValue);
|
|
127
126
|
}
|
|
128
127
|
setSearchText(getDisplayValue(newValue));
|
|
@@ -132,7 +131,6 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
132
131
|
setFilterEnabled(true);
|
|
133
132
|
setSearchText(e.target.value);
|
|
134
133
|
}, onOptionSelect: (e, item) => {
|
|
135
|
-
console.log('onOptionSelect', e, item);
|
|
136
134
|
if (!item.optionValue) {
|
|
137
135
|
return;
|
|
138
136
|
}
|
|
@@ -120,7 +120,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
120
120
|
}, onOptionSelect: (e, item) => {
|
|
121
121
|
const _item = data?.records.find((x) => String(x[schema.idAttribute]) === String(item.optionValue));
|
|
122
122
|
handleChange(_item ?? null);
|
|
123
|
-
}, 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
|
|
123
|
+
}, 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: view?.experience.card ? ((0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.experience.card, record: item, schema: schema })) : item[schema.primaryAttribute] }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
124
124
|
paddingInline: react_components_1.tokens.spacingHorizontalL,
|
|
125
125
|
paddingBlock: react_components_1.tokens.spacingVerticalS,
|
|
126
126
|
}, 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, {}), onClick: () => {
|
|
@@ -134,7 +134,10 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
134
134
|
alignItems: 'center',
|
|
135
135
|
paddingInline: 4,
|
|
136
136
|
display: 'flex',
|
|
137
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(react_components_1.Tag, { as: "span", appearance: "brand", size: "small", dismissible: !disabled && !readOnly, value: value.id, style: {
|
|
137
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(react_components_1.Tag, { as: "span", appearance: "brand", size: "small", dismissible: !disabled && !readOnly, value: value.id, style: {
|
|
138
|
+
paddingRight: !disabled && !readOnly ? 0 : 5,
|
|
139
|
+
background: react_components_1.tokens.colorNeutralBackground6,
|
|
140
|
+
}, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
|
|
138
141
|
onChange?.(null);
|
|
139
142
|
}, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Close, { size: 16 }) }), primaryText: {
|
|
140
143
|
style: {
|
|
@@ -154,7 +157,7 @@ const LookupAvatar = ({ logicalName, schema, value, }) => {
|
|
|
154
157
|
const { schemaMetadataDic } = (0, app_1.useAppContext)();
|
|
155
158
|
if (!schema.avatarAttribute) {
|
|
156
159
|
const experienceSchema = schemaMetadataDic[logicalName];
|
|
157
|
-
const Icon = experienceSchema.
|
|
160
|
+
const Icon = experienceSchema.Icon ?? icons_1.Icons.Entity ?? icons_1.IconPlaceholder;
|
|
158
161
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Avatar, { style: {
|
|
159
162
|
width: 20,
|
|
160
163
|
height: 20,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@fluentui/react-calendar-compat": "^0.1.20",
|
|
25
25
|
"@fluentui/react-components": "^9.54.4",
|
|
26
26
|
"@fluentui/react-datepicker-compat": "^0.4.43",
|
|
27
|
-
"@fluentui/react-nav-preview": "^0.
|
|
27
|
+
"@fluentui/react-nav-preview": "^0.13.0",
|
|
28
28
|
"@fluentui/react-timepicker-compat": "^0.2.46",
|
|
29
29
|
"@tanstack/react-query": "^5.51.1"
|
|
30
30
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"uuid": "11.0.3",
|
|
51
51
|
"yup": "^1.4.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "a244ac890d3abda779c8f41c3cd51031381c062c"
|
|
54
54
|
}
|