@headless-adminapp/fluent 0.0.17-alpha.52 → 0.0.17-alpha.53
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.js +7 -11
- package/App/AppHeaderContianer.js +38 -42
- package/App/AppLogo.js +8 -12
- package/App/AppStringContext.js +9 -13
- package/App/AppUI.js +11 -15
- package/App/LayoutProvider.js +11 -15
- package/App/NavigationContainer.js +25 -29
- package/App/QuickActionItem.js +5 -9
- package/App/index.js +1 -5
- package/App/utils.js +1 -4
- package/CommandBar/Button.js +14 -17
- package/CommandBar/Divider.js +6 -9
- package/CommandBar/IconButton.js +13 -16
- package/CommandBar/Label.js +8 -11
- package/CommandBar/MenuButton.js +17 -20
- package/CommandBar/MenuItem.js +15 -18
- package/CommandBar/MenuItems.js +8 -11
- package/CommandBar/MenuList.js +9 -12
- package/CommandBar/Wrapper.js +7 -10
- package/CommandBar/index.js +13 -15
- package/DataForm/SectionControl.js +4 -7
- package/DataGrid/ActionCell.js +11 -14
- package/DataGrid/CommandContainer.js +6 -10
- package/DataGrid/CustomizeColumns/AddColumns.js +34 -37
- package/DataGrid/CustomizeColumns/ColumnItem.js +19 -23
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +36 -42
- package/DataGrid/CustomizeColumns/index.js +1 -5
- package/DataGrid/FormSubgridCommandContainer.js +13 -17
- package/DataGrid/FormSubgridViewSelector.js +18 -22
- package/DataGrid/GridColumnHeader/ConditionValueControl.js +14 -20
- package/DataGrid/GridColumnHeader/FilterForm.js +23 -27
- package/DataGrid/GridColumnHeader/OperatorSelect.js +13 -19
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +28 -32
- package/DataGrid/GridColumnHeader/index.js +1 -5
- package/DataGrid/GridColumnHeader/utils.js +2 -6
- package/DataGrid/GridHeaderContainer.js +4 -8
- package/DataGrid/GridHeaderDesktop.js +26 -30
- package/DataGrid/GridHeaderMobile.js +17 -21
- package/DataGrid/GridListContainer.js +39 -43
- package/DataGrid/GridPaginationContainer.js +12 -16
- package/DataGrid/GridTableContainer.js +74 -78
- package/DataGrid/TableCell/TableCellAction.js +11 -15
- package/DataGrid/TableCell/TableCellBase.js +4 -8
- package/DataGrid/TableCell/TableCellCheckbox.js +7 -10
- package/DataGrid/TableCell/TableCellChoice.js +11 -14
- package/DataGrid/TableCell/TableCellLink.d.ts +1 -1
- package/DataGrid/TableCell/TableCellLink.js +13 -12
- package/DataGrid/TableCell/TableCellText.js +7 -10
- package/DataGrid/TableCell/index.js +4 -20
- package/DataGrid/index.js +4 -11
- package/DataGrid/types.js +1 -2
- package/DataGrid/useTableColumns.js +139 -90
- package/DataGrid/utils.js +1 -5
- package/DialogContainer/AlertDialog.js +5 -8
- package/DialogContainer/ConfirmDialog.js +6 -9
- package/DialogContainer/DialogContainer.js +14 -18
- package/DialogContainer/ErrorDialog.js +9 -12
- package/DialogContainer/PromptDialog.js +30 -57
- package/DialogContainer/index.js +1 -5
- package/Insights/CommandBarContainer.js +11 -14
- package/Insights/FilterBarContainer.js +17 -20
- package/Insights/Grid.js +9 -13
- package/Insights/InsightsContainer.js +19 -22
- package/Insights/WidgetChartContainer.js +30 -34
- package/Insights/WidgetDataGridContainer.js +32 -35
- package/Insights/WidgetTableContainer.js +24 -28
- package/Insights/WidgetTileContainer.js +12 -16
- package/Insights/WidgetTitleBar.js +9 -15
- package/Insights/Widgets.js +25 -28
- package/Insights/charts/AreaChart.js +12 -15
- package/Insights/charts/BarChart.js +12 -15
- package/Insights/charts/ComposedChart.js +12 -15
- package/Insights/charts/CustomTooltipContent.js +8 -12
- package/Insights/charts/GaugeChart.js +3 -6
- package/Insights/charts/LineChart.js +12 -15
- package/Insights/charts/OhlcChart.js +36 -41
- package/Insights/charts/PieChart.js +23 -26
- package/Insights/charts/RadarChart.js +16 -19
- package/Insights/charts/ScatterChart.js +23 -26
- package/Insights/charts/constants.js +1 -4
- package/Insights/charts/formatters.js +17 -29
- package/Insights/charts/index.js +1 -2
- package/Insights/charts/renderers.js +25 -36
- package/Insights/hooks/useQueriesData.js +19 -25
- package/Insights/hooks/useWidgetDetail.js +13 -16
- package/OverflowCommandBar/OverflowCommandBar.js +12 -19
- package/OverflowCommandBar/OverflowMenu.js +16 -20
- package/OverflowCommandBar/OverflowMenuDivider.js +6 -10
- package/OverflowCommandBar/index.js +3 -9
- package/OverflowCommandBar/render.js +9 -15
- package/OverflowCommandBar/utils.js +1 -4
- package/PageBoard/BoardColumn.js +5 -8
- package/PageBoard/BoardColumnCard.js +12 -15
- package/PageBoard/BoardColumnUI.js +34 -38
- package/PageBoard/BoardingColumnCardLoading.js +10 -13
- package/PageBoard/Header.js +16 -20
- package/PageBoard/PageBoard.d.ts +1 -1
- package/PageBoard/PageBoard.js +26 -29
- package/PageBoard/index.js +1 -5
- package/PageEntityForm/CommandContainer.js +21 -25
- package/PageEntityForm/FormTabRelated.js +17 -20
- package/PageEntityForm/PageEntityForm.js +16 -20
- package/PageEntityForm/PageEntityFormDesktopContainer.js +68 -72
- package/PageEntityForm/PageEntityFormStringContext.js +5 -9
- package/PageEntityForm/ProcessFlow.js +21 -24
- package/PageEntityForm/RecordCard.js +21 -24
- package/PageEntityForm/RecordCardLoading.js +10 -13
- package/PageEntityForm/RecordSetNavigatorContainer.js +30 -34
- package/PageEntityForm/RelatedViewSelector.js +28 -31
- package/PageEntityForm/SectionContainer.js +25 -28
- package/PageEntityForm/StandardControl.d.ts +3 -3
- package/PageEntityForm/StandardControl.js +74 -81
- package/PageEntityForm/SubgridControl.js +20 -23
- package/PageEntityForm/index.js +1 -5
- package/PageEntityView/FormSubgridContainer.js +22 -26
- package/PageEntityView/PageEntityView.js +15 -19
- package/PageEntityView/PageEntityViewDesktopContainer.js +9 -13
- package/PageEntityView/PageEntityViewDesktopFrame.js +17 -21
- package/PageEntityView/PageEntityViewMobileContainer.js +9 -13
- package/PageEntityView/PageEntityViewStringContext.js +5 -9
- package/PageEntityView/index.js +1 -5
- package/PageInsights/PageInsights.js +9 -13
- package/PageInsights/index.js +1 -6
- package/ProgressIndicatorContainer/index.js +10 -14
- package/ToastNotificationContainer/index.js +14 -18
- package/componentStore.js +2 -5
- package/components/BodyLoading.js +7 -11
- package/components/DialogLogin.js +5 -8
- package/components/LoginForm.js +21 -47
- package/components/PageBroken.js +5 -8
- package/components/PageLoading.js +5 -8
- package/components/PageLogin.js +14 -17
- package/form/FormControl.js +39 -44
- package/form/FormControlLoading.js +4 -8
- package/form/controls/AttachmentControl.js +56 -60
- package/form/controls/AttachmentsControl.js +15 -19
- package/form/controls/CurrencyControl.js +10 -13
- package/form/controls/DateControl.js +18 -24
- package/form/controls/DateRangeControl.js +14 -20
- package/form/controls/DateTimeControl.js +39 -45
- package/form/controls/DecimalControl.js +8 -11
- package/form/controls/DurationControl.js +11 -15
- package/form/controls/EmailControl.js +7 -10
- package/form/controls/IntegerControl.js +4 -7
- package/form/controls/LookupControl.d.ts +1 -0
- package/form/controls/LookupControl.js +75 -38
- package/form/controls/MultiSelectControl.js +8 -11
- package/form/controls/MultiSelectLookupControl.js +40 -43
- package/form/controls/PasswordControl.js +8 -11
- package/form/controls/RichTextControl.js +5 -32
- package/form/controls/SelectControl.js +8 -11
- package/form/controls/SwitchControl.js +4 -7
- package/form/controls/TelephoneControl.js +7 -10
- package/form/controls/TextAreaControl.js +4 -7
- package/form/controls/TextControl.js +5 -8
- package/form/controls/UrlControl.js +7 -10
- package/form/controls/types.js +1 -2
- package/form/controls/useLookupData.js +14 -18
- package/form/layout/FormBody/FormBody.js +6 -10
- package/form/layout/FormBody/index.js +1 -17
- package/form/layout/FormSection/FormSection.js +18 -22
- package/form/layout/FormSection/FormSectionColumn.js +3 -7
- package/form/layout/FormSection/FormSectionLoading.js +1 -5
- package/form/layout/FormSection/index.js +1 -5
- package/form/layout/FormTab/FormTab.js +16 -20
- package/form/layout/FormTab/FormTabColumn.js +5 -9
- package/form/layout/FormTab/index.js +1 -5
- package/form/layout/TabContext.js +2 -5
- package/form/layout/index.js +3 -9
- package/form/types.js +1 -2
- package/package.json +3 -2
- package/types/index.js +1 -2
- package/utils/avatar.d.ts +2 -0
- package/utils/avatar.js +42 -0
|
@@ -1,40 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const columns = (0, hooks_1.useGridColumns)();
|
|
22
|
-
const setContextValue = (0, mutable_1.useContextSetValue)(datagrid_1.GridContext);
|
|
23
|
-
const [showAddColumns, setShowAddColumns] = (0, react_1.useState)(false);
|
|
24
|
-
const [items, setItems] = (0, react_1.useState)(columns);
|
|
25
|
-
const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
|
|
26
|
-
const isDirty = (0, react_1.useMemo)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Divider, Drawer, DrawerBody, DrawerHeader, DrawerHeaderTitle, tokens, } from '@fluentui/react-components';
|
|
3
|
+
import { GridContext, } from '@headless-adminapp/app/datagrid';
|
|
4
|
+
import { useGridColumns } from '@headless-adminapp/app/datagrid/hooks';
|
|
5
|
+
import { useContextSetValue } from '@headless-adminapp/app/mutable';
|
|
6
|
+
import { Icons } from '@headless-adminapp/icons';
|
|
7
|
+
import update from 'immutability-helper';
|
|
8
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
9
|
+
import { DndProvider } from 'react-dnd';
|
|
10
|
+
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
11
|
+
import { usePageEntityViewStrings } from '../../PageEntityView/PageEntityViewStringContext';
|
|
12
|
+
import { AddColumns } from './AddColumns';
|
|
13
|
+
import { ColumnItem } from './ColumnItem';
|
|
14
|
+
export function CustomizeColumns({ onClose, opened }) {
|
|
15
|
+
const columns = useGridColumns();
|
|
16
|
+
const setContextValue = useContextSetValue(GridContext);
|
|
17
|
+
const [showAddColumns, setShowAddColumns] = useState(false);
|
|
18
|
+
const [items, setItems] = useState(columns);
|
|
19
|
+
const strings = usePageEntityViewStrings();
|
|
20
|
+
const isDirty = useMemo(() => {
|
|
27
21
|
return JSON.stringify(items) !== JSON.stringify(columns);
|
|
28
22
|
}, [columns, items]);
|
|
29
|
-
const moveItem =
|
|
30
|
-
setItems((prevCards) => (
|
|
23
|
+
const moveItem = useCallback((dragIndex, hoverIndex) => {
|
|
24
|
+
setItems((prevCards) => update(prevCards, {
|
|
31
25
|
$splice: [
|
|
32
26
|
[dragIndex, 1],
|
|
33
27
|
[hoverIndex, 0, prevCards[dragIndex]],
|
|
34
28
|
],
|
|
35
29
|
}));
|
|
36
30
|
}, []);
|
|
37
|
-
const onColumnAdd =
|
|
31
|
+
const onColumnAdd = useCallback((column) => {
|
|
38
32
|
setItems((prev) => {
|
|
39
33
|
if (prev.some((x) => x.id === column.id)) {
|
|
40
34
|
return prev;
|
|
@@ -42,37 +36,37 @@ function CustomizeColumns({ onClose, opened }) {
|
|
|
42
36
|
return [...prev, column];
|
|
43
37
|
});
|
|
44
38
|
}, []);
|
|
45
|
-
const onColumnRemove =
|
|
39
|
+
const onColumnRemove = useCallback((column) => {
|
|
46
40
|
setItems((prev) => prev.filter((x) => x.id !== column.id));
|
|
47
41
|
}, []);
|
|
48
|
-
return ((
|
|
42
|
+
return (_jsxs(Drawer, { separator: true, open: opened, position: "end", size: "small", children: [_jsx(DrawerHeader, { children: _jsx(DrawerHeaderTitle, { action: _jsx(Button, { appearance: "subtle", "aria-label": "Close", icon: _jsx(Icons.Close, {}), onClick: onClose }), children: strings.editColumns }) }), _jsxs("div", { style: { width: '100%', display: 'flex', flexDirection: 'column' }, children: [_jsxs("div", { style: {
|
|
49
43
|
display: 'flex',
|
|
50
44
|
gap: 8,
|
|
51
|
-
marginBottom:
|
|
52
|
-
paddingInline:
|
|
53
|
-
}, children: [(
|
|
54
|
-
fontWeight:
|
|
45
|
+
marginBottom: tokens.spacingVerticalXS,
|
|
46
|
+
paddingInline: tokens.spacingHorizontalS,
|
|
47
|
+
}, children: [_jsx(Button, { appearance: "subtle", icon: _jsx(Icons.Add, {}), style: {
|
|
48
|
+
fontWeight: tokens.fontSizeBase400,
|
|
55
49
|
minWidth: 'unset',
|
|
56
|
-
}, onClick: () => setShowAddColumns(true), children: strings.add }), (
|
|
50
|
+
}, onClick: () => setShowAddColumns(true), children: strings.add }), _jsx(Button, { appearance: "subtle", icon: _jsx(Icons.Edit, {}), style: { fontWeight: tokens.fontSizeBase400, minWidth: 'unset' }, disabled: !isDirty, onClick: () => {
|
|
57
51
|
setItems(columns);
|
|
58
|
-
}, children: strings.reset })] }), (
|
|
52
|
+
}, children: strings.reset })] }), _jsx(AddColumns, { onColumnAdd: onColumnAdd, onColumnRemove: onColumnRemove, columns: items, opened: showAddColumns, onClose: () => setShowAddColumns(false) }), _jsx(Divider, {})] }), _jsx(DrawerBody, { style: { paddingInline: tokens.spacingHorizontalS }, children: _jsx(DndProvider, { backend: HTML5Backend, children: _jsx("div", { style: {
|
|
59
53
|
display: 'flex',
|
|
60
54
|
flexDirection: 'column',
|
|
61
55
|
width: '100%',
|
|
62
|
-
gap:
|
|
56
|
+
gap: tokens.spacingVerticalS,
|
|
63
57
|
// padding: tokens.spacingHorizontalS,
|
|
64
|
-
paddingBlock:
|
|
65
|
-
}, children: items.map((item, index) => ((
|
|
58
|
+
paddingBlock: tokens.spacingVerticalS,
|
|
59
|
+
}, children: items.map((item, index) => (_jsx(ColumnItem, { index: index, item: item, moveItem: moveItem, isFirst: index === 0, isLast: index === items.length - 1, onRemove: () => onColumnRemove(item), stringSet: strings }, item.id))) }) }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', width: '100%' }, children: [_jsx(Divider, {}), _jsxs("div", { style: {
|
|
66
60
|
display: 'flex',
|
|
67
61
|
padding: 8,
|
|
68
62
|
gap: 8,
|
|
69
63
|
justifyContent: 'flex-end',
|
|
70
|
-
}, children: [(
|
|
64
|
+
}, children: [_jsx(Button, { onClick: () => {
|
|
71
65
|
setContextValue({
|
|
72
66
|
columns: items,
|
|
73
67
|
});
|
|
74
68
|
onClose();
|
|
75
|
-
}, appearance: "primary", children: strings.apply }), (
|
|
69
|
+
}, appearance: "primary", children: strings.apply }), _jsx(Button, { onClick: () => {
|
|
76
70
|
onClose();
|
|
77
71
|
}, children: strings.cancel })] })] })] }));
|
|
78
72
|
}
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomizeColumns = void 0;
|
|
4
|
-
var CustomizeColumns_1 = require("./CustomizeColumns");
|
|
5
|
-
Object.defineProperty(exports, "CustomizeColumns", { enumerable: true, get: function () { return CustomizeColumns_1.CustomizeColumns; } });
|
|
1
|
+
export { CustomizeColumns } from './CustomizeColumns';
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const OverflowCommandBar_1 = require("../OverflowCommandBar");
|
|
9
|
-
const FormSubgridCommandContainer = () => {
|
|
10
|
-
const isSubgrid = (0, mutable_1.useContextSelector)(datagrid_1.GridContext, (state) => state.isSubGrid);
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GridContext } from '@headless-adminapp/app/datagrid';
|
|
3
|
+
import { useMainGridCommands, useSubGridCommands, } from '@headless-adminapp/app/datagrid/hooks';
|
|
4
|
+
import { useContextSelector } from '@headless-adminapp/app/mutable';
|
|
5
|
+
import { OverflowCommandBar } from '../OverflowCommandBar';
|
|
6
|
+
export const FormSubgridCommandContainer = () => {
|
|
7
|
+
const isSubgrid = useContextSelector(GridContext, (state) => state.isSubGrid);
|
|
11
8
|
if (isSubgrid) {
|
|
12
|
-
return (
|
|
9
|
+
return _jsx(InternalSubGridCommandContainer, {});
|
|
13
10
|
}
|
|
14
|
-
return (
|
|
11
|
+
return _jsx(InternalMainGridCommandContainer, {});
|
|
15
12
|
};
|
|
16
|
-
exports.FormSubgridCommandContainer = FormSubgridCommandContainer;
|
|
17
13
|
const InternalMainGridCommandContainer = () => {
|
|
18
|
-
const gridCommands =
|
|
19
|
-
return (
|
|
14
|
+
const gridCommands = useMainGridCommands();
|
|
15
|
+
return _jsx(OverflowCommandBar, { commands: gridCommands });
|
|
20
16
|
};
|
|
21
17
|
const InternalSubGridCommandContainer = () => {
|
|
22
|
-
const gridCommands =
|
|
23
|
-
return (
|
|
18
|
+
const gridCommands = useSubGridCommands();
|
|
19
|
+
return _jsx(OverflowCommandBar, { commands: gridCommands });
|
|
24
20
|
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
10
|
-
const icons_1 = require("@headless-adminapp/icons");
|
|
11
|
-
const FormSubgridViewSelector = () => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Menu, MenuItem, MenuList, MenuPopover, MenuTrigger, } from '@fluentui/react-components';
|
|
3
|
+
import { GridContext } from '@headless-adminapp/app/datagrid';
|
|
4
|
+
import { useChangeView, useGridViewLookupData, useSelectedView, } from '@headless-adminapp/app/datagrid/hooks';
|
|
5
|
+
import { useLocale } from '@headless-adminapp/app/locale';
|
|
6
|
+
import { useContextSelector } from '@headless-adminapp/app/mutable';
|
|
7
|
+
import { Icons } from '@headless-adminapp/icons';
|
|
8
|
+
export const FormSubgridViewSelector = () => {
|
|
12
9
|
var _a, _b;
|
|
13
|
-
const viewLookup =
|
|
14
|
-
const selectedView =
|
|
15
|
-
const changeView =
|
|
16
|
-
const { language } =
|
|
17
|
-
const allowViewSelection =
|
|
18
|
-
return ((
|
|
10
|
+
const viewLookup = useGridViewLookupData();
|
|
11
|
+
const selectedView = useSelectedView();
|
|
12
|
+
const changeView = useChangeView();
|
|
13
|
+
const { language } = useLocale();
|
|
14
|
+
const allowViewSelection = useContextSelector(GridContext, (state) => state.allowViewSelection);
|
|
15
|
+
return (_jsx("div", { style: {
|
|
19
16
|
alignItems: 'center',
|
|
20
17
|
paddingBlock: 4,
|
|
21
18
|
paddingInline: 4,
|
|
@@ -23,19 +20,18 @@ const FormSubgridViewSelector = () => {
|
|
|
23
20
|
width: '100%',
|
|
24
21
|
display: 'flex',
|
|
25
22
|
height: 40,
|
|
26
|
-
}, children: (
|
|
23
|
+
}, children: _jsx("div", { style: {
|
|
27
24
|
flex: 1,
|
|
28
25
|
alignItems: 'center',
|
|
29
26
|
gap: 16,
|
|
30
27
|
justifyContent: 'space-between',
|
|
31
28
|
display: 'flex',
|
|
32
|
-
}, children: (
|
|
29
|
+
}, children: _jsxs(Menu, { children: [_jsx(MenuTrigger, { children: _jsx(Button, { appearance: "subtle", icon: allowViewSelection ? _jsx(Icons.ChevronDown, {}) : null, iconPosition: "after", style: {
|
|
33
30
|
paddingInline: 8,
|
|
34
31
|
paddingBlock: 4,
|
|
35
32
|
pointerEvents: allowViewSelection ? 'auto' : 'none',
|
|
36
|
-
}, children: (_b = (_a = selectedView.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : selectedView.name }) }), (
|
|
33
|
+
}, children: (_b = (_a = selectedView.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : selectedView.name }) }), _jsx(MenuPopover, { children: _jsx(MenuList, { children: viewLookup.map((view) => {
|
|
37
34
|
var _a, _b;
|
|
38
|
-
return ((
|
|
35
|
+
return (_jsx(MenuItem, { onClick: () => changeView(view.id), children: (_b = (_a = view.localizedNames) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : view.name }, view.id));
|
|
39
36
|
}) }) })] }) }) }));
|
|
40
37
|
};
|
|
41
|
-
exports.FormSubgridViewSelector = FormSubgridViewSelector;
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.ConditionValueControl = ConditionValueControl;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const hooks_1 = require("@headless-adminapp/app/metadata/hooks");
|
|
9
|
-
const transport_1 = require("@headless-adminapp/app/transport");
|
|
10
|
-
const FormControl_1 = __importDefault(require("../../form/FormControl"));
|
|
11
|
-
function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMetadata } from '@headless-adminapp/app/metadata/hooks';
|
|
3
|
+
import { useDataService } from '@headless-adminapp/app/transport';
|
|
4
|
+
import FormControl from '../../form/FormControl';
|
|
5
|
+
export function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
12
6
|
var _a, _b, _c, _d;
|
|
13
|
-
const dataService =
|
|
14
|
-
const { schemaStore, experienceStore } =
|
|
7
|
+
const dataService = useDataService();
|
|
8
|
+
const { schemaStore, experienceStore } = useMetadata();
|
|
15
9
|
switch (type) {
|
|
16
10
|
case 'string':
|
|
17
|
-
return ((
|
|
11
|
+
return (_jsx(FormControl, { type: "text", value: value !== null && value !== void 0 ? value : null, onChange: (value) => {
|
|
18
12
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
19
13
|
} }));
|
|
20
14
|
case 'number':
|
|
21
|
-
return ((
|
|
15
|
+
return (_jsx(FormControl, { type: "number", value: value !== null && value !== void 0 ? value : null, onChange: (value) => {
|
|
22
16
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
23
17
|
} }));
|
|
24
18
|
case 'money':
|
|
25
|
-
return ((
|
|
19
|
+
return (_jsx(FormControl, { type: "currency", value: value !== null && value !== void 0 ? value : null, onChange: (value) => {
|
|
26
20
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
27
21
|
} }));
|
|
28
22
|
case 'lookup':
|
|
29
23
|
if (attribute.type !== 'lookup') {
|
|
30
24
|
return null;
|
|
31
25
|
}
|
|
32
|
-
return ((
|
|
26
|
+
return (_jsx(FormControl, { type: "lookups", async: true, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, value: value !== null && value !== void 0 ? value : null, onChange: (value) => {
|
|
33
27
|
onChange === null || onChange === void 0 ? void 0 : onChange(value !== null && value !== void 0 ? value : []);
|
|
34
28
|
} }));
|
|
35
29
|
// return (
|
|
@@ -46,14 +40,14 @@ function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
|
46
40
|
// />
|
|
47
41
|
// );
|
|
48
42
|
case 'date':
|
|
49
|
-
return ((
|
|
43
|
+
return (_jsx(FormControl, { type: "date", value: value !== null && value !== void 0 ? value : null, onChange: (value) => {
|
|
50
44
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
51
45
|
} }));
|
|
52
46
|
case 'boolean':
|
|
53
47
|
if (attribute.type !== 'boolean') {
|
|
54
48
|
return null;
|
|
55
49
|
}
|
|
56
|
-
return ((
|
|
50
|
+
return (_jsx(FormControl, { type: "multi-select", options: [
|
|
57
51
|
{
|
|
58
52
|
label: (_a = attribute.trueLabel) !== null && _a !== void 0 ? _a : 'Yes',
|
|
59
53
|
value: 'true',
|
|
@@ -73,7 +67,7 @@ function ConditionValueControl({ attribute, type, value, onChange, }) {
|
|
|
73
67
|
}
|
|
74
68
|
const isNumeric = 'number' in attribute && attribute.number === true;
|
|
75
69
|
// const isString = 'string' in attribute && attribute.string === true;
|
|
76
|
-
return ((
|
|
70
|
+
return (_jsx(FormControl, { type: "multi-select", options: attribute.options.map((x) => {
|
|
77
71
|
var _a;
|
|
78
72
|
return ({
|
|
79
73
|
label: x.label,
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const { operatorStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
17
|
-
const operatorOptions = (0, react_1.useMemo)(() => {
|
|
18
|
-
return (0, column_filter_1.getLocalizedOperatorOptions)(operatorStrings);
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, DialogActions, DialogContent, DialogTrigger, tokens, } from '@fluentui/react-components';
|
|
3
|
+
import { getLocalizedOperatorOptions } from '@headless-adminapp/app/datagrid/column-filter';
|
|
4
|
+
import { Fragment, useMemo, useState } from 'react';
|
|
5
|
+
import { useAppStrings } from '../../App/AppStringContext';
|
|
6
|
+
import { usePageEntityViewStrings } from '../../PageEntityView/PageEntityViewStringContext';
|
|
7
|
+
import { ConditionValueControl } from './ConditionValueControl';
|
|
8
|
+
import { OperatorSelect } from './OperatorSelect';
|
|
9
|
+
import { getDefaultOperator, getDefaultValues } from './utils';
|
|
10
|
+
export const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
11
|
+
const [operator, setOperator] = useState(getDefaultOperator(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.operator, attribute.type));
|
|
12
|
+
const strings = usePageEntityViewStrings();
|
|
13
|
+
const { operatorStrings } = useAppStrings();
|
|
14
|
+
const operatorOptions = useMemo(() => {
|
|
15
|
+
return getLocalizedOperatorOptions(operatorStrings);
|
|
19
16
|
}, [operatorStrings]);
|
|
20
|
-
const selectedOption =
|
|
17
|
+
const selectedOption = useMemo(() => {
|
|
21
18
|
return operatorOptions[attribute.type].find((option) => option.value === operator);
|
|
22
19
|
}, [operator, attribute.type, operatorOptions]);
|
|
23
|
-
const [values, setValues] =
|
|
20
|
+
const [values, setValues] = useState(getDefaultValues(selectedOption, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value, attribute.type));
|
|
24
21
|
const handleChangeOperator = (operator) => {
|
|
25
22
|
setOperator(operator);
|
|
26
23
|
setValues([]);
|
|
@@ -32,26 +29,25 @@ const FilterForm = ({ defaultValue, attribute, onApply, onCancel, }) => {
|
|
|
32
29
|
return next;
|
|
33
30
|
});
|
|
34
31
|
};
|
|
35
|
-
const isValid =
|
|
32
|
+
const isValid = useMemo(() => {
|
|
36
33
|
return (!!selectedOption &&
|
|
37
34
|
values.filter((value) => {
|
|
38
35
|
return value !== null && value !== undefined;
|
|
39
36
|
}).length === selectedOption.controls.length);
|
|
40
37
|
}, [selectedOption, values]);
|
|
41
|
-
return ((
|
|
38
|
+
return (_jsxs(Fragment, { children: [_jsx(DialogContent, { style: { paddingBlock: 8 }, children: _jsxs("div", { style: {
|
|
42
39
|
display: 'flex',
|
|
43
40
|
flexDirection: 'column',
|
|
44
|
-
gap:
|
|
45
|
-
}, children: [(
|
|
41
|
+
gap: tokens.spacingVerticalS,
|
|
42
|
+
}, children: [_jsx(OperatorSelect, { attribute: attribute, onChange: (value) => handleChangeOperator(value), value: operator }), selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.controls.map((x, i) => {
|
|
46
43
|
var _a;
|
|
47
|
-
return ((
|
|
44
|
+
return (_jsx(ConditionValueControl, { type: x, attribute: attribute, value: (_a = values[i]) !== null && _a !== void 0 ? _a : null, onChange: (value) => {
|
|
48
45
|
handleChangeValue(value, i);
|
|
49
46
|
} }, x + String(i)));
|
|
50
|
-
})] }) }), (
|
|
47
|
+
})] }) }), _jsxs(DialogActions, { children: [_jsx(DialogTrigger, { disableButtonEnhancement: true, children: _jsx(Button, { appearance: "secondary", onClick: onCancel, children: strings.cancel }) }), _jsx(Button, { type: "submit", appearance: "primary", disabled: !isValid, onClick: () => {
|
|
51
48
|
onApply === null || onApply === void 0 ? void 0 : onApply({
|
|
52
49
|
operator,
|
|
53
50
|
value: values,
|
|
54
51
|
});
|
|
55
52
|
}, children: strings.apply })] })] }));
|
|
56
53
|
};
|
|
57
|
-
exports.FilterForm = FilterForm;
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const SelectControl_1 = __importDefault(require("../../form/controls/SelectControl"));
|
|
13
|
-
function OperatorSelect({ attribute, value, onChange, }) {
|
|
14
|
-
const { operatorStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
15
|
-
const dataService = (0, transport_1.useDataService)();
|
|
16
|
-
const operatorOptions = (0, react_1.useMemo)(() => {
|
|
17
|
-
return (0, column_filter_1.getLocalizedOperatorOptions)(operatorStrings);
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getLocalizedOperatorOptions } from '@headless-adminapp/app/datagrid/column-filter';
|
|
3
|
+
import { useDataService } from '@headless-adminapp/app/transport';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { useAppStrings } from '../../App/AppStringContext';
|
|
6
|
+
import SelectControl from '../../form/controls/SelectControl';
|
|
7
|
+
export function OperatorSelect({ attribute, value, onChange, }) {
|
|
8
|
+
const { operatorStrings } = useAppStrings();
|
|
9
|
+
const dataService = useDataService();
|
|
10
|
+
const operatorOptions = useMemo(() => {
|
|
11
|
+
return getLocalizedOperatorOptions(operatorStrings);
|
|
18
12
|
}, [operatorStrings]);
|
|
19
|
-
const options =
|
|
13
|
+
const options = useMemo(() => {
|
|
20
14
|
const supportedOperators = dataService.supportedOperators;
|
|
21
15
|
let operators = operatorOptions[attribute.type];
|
|
22
16
|
if (supportedOperators) {
|
|
@@ -24,5 +18,5 @@ function OperatorSelect({ attribute, value, onChange, }) {
|
|
|
24
18
|
}
|
|
25
19
|
return operators;
|
|
26
20
|
}, [attribute.type, operatorOptions, dataService]);
|
|
27
|
-
return ((
|
|
21
|
+
return (_jsx(SelectControl, { options: options, onChange: (value) => onChange === null || onChange === void 0 ? void 0 : onChange(value), value: value }));
|
|
28
22
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const PageEntityViewStringContext_1 = require("../../PageEntityView/PageEntityViewStringContext");
|
|
11
|
-
const FilterForm_1 = require("./FilterForm");
|
|
12
|
-
const useStyles = (0, react_components_1.makeStyles)({
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog, DialogBody, DialogSurface, DialogTitle, makeStyles, Menu, MenuDivider, MenuItem, MenuList, MenuPopover, MenuTrigger, mergeClasses, TableHeaderCell, tokens, } from '@fluentui/react-components';
|
|
3
|
+
import { useDataGridSchema, useGridColumnFilter, } from '@headless-adminapp/app/datagrid/hooks';
|
|
4
|
+
import { useMetadata } from '@headless-adminapp/app/metadata/hooks';
|
|
5
|
+
import { Icons } from '@headless-adminapp/icons';
|
|
6
|
+
import { Fragment, useMemo, useRef, useState, } from 'react';
|
|
7
|
+
import { usePageEntityViewStrings } from '../../PageEntityView/PageEntityViewStringContext';
|
|
8
|
+
import { FilterForm } from './FilterForm';
|
|
9
|
+
const useStyles = makeStyles({
|
|
13
10
|
root: {
|
|
14
11
|
cursor: 'pointer',
|
|
15
12
|
userSelect: 'none',
|
|
16
13
|
'&:active': {
|
|
17
|
-
backgroundColor:
|
|
14
|
+
backgroundColor: tokens.colorSubtleBackgroundPressed,
|
|
18
15
|
},
|
|
19
16
|
'&:hover [data-id="resize-handle"]': {
|
|
20
17
|
opacity: 0.5,
|
|
@@ -41,7 +38,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
41
38
|
},
|
|
42
39
|
resizeHandleInner: {
|
|
43
40
|
width: '2px',
|
|
44
|
-
background:
|
|
41
|
+
background: tokens.colorNeutralForeground1,
|
|
45
42
|
// borderLeft: `1px solid ${tokens.colorNeutralForeground1}`,
|
|
46
43
|
// borderRight: `1px solid ${tokens.colorNeutralForeground1}`,
|
|
47
44
|
},
|
|
@@ -51,7 +48,7 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
51
48
|
},
|
|
52
49
|
},
|
|
53
50
|
});
|
|
54
|
-
const TableHeaderFilterCell = ({ children, sortDirection,
|
|
51
|
+
export const TableHeaderFilterCell = ({ children, sortDirection,
|
|
55
52
|
// onChangeFilterCondition,
|
|
56
53
|
onChangeSortDirection,
|
|
57
54
|
// attribute,
|
|
@@ -59,11 +56,11 @@ onChangeSortDirection,
|
|
|
59
56
|
minWidth,
|
|
60
57
|
// onChangeWidth,
|
|
61
58
|
column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) => {
|
|
62
|
-
const [visible, setVisible] =
|
|
63
|
-
const schema =
|
|
64
|
-
const { schemaStore } =
|
|
65
|
-
const strings =
|
|
66
|
-
const attribute =
|
|
59
|
+
const [visible, setVisible] = useState(false);
|
|
60
|
+
const schema = useDataGridSchema();
|
|
61
|
+
const { schemaStore } = useMetadata();
|
|
62
|
+
const strings = usePageEntityViewStrings();
|
|
63
|
+
const attribute = useMemo(() => {
|
|
67
64
|
const _attribute = schema.attributes[column.name];
|
|
68
65
|
if (!column.expandedKey) {
|
|
69
66
|
return _attribute;
|
|
@@ -74,7 +71,7 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
74
71
|
const lookupSchema = schemaStore.getSchema(_attribute.entity);
|
|
75
72
|
return lookupSchema.attributes[column.expandedKey];
|
|
76
73
|
}, [column.expandedKey, column.name, schemaStore, schema.attributes]);
|
|
77
|
-
const align =
|
|
74
|
+
const align = useMemo(() => {
|
|
78
75
|
switch (attribute.type) {
|
|
79
76
|
case 'money':
|
|
80
77
|
case 'number':
|
|
@@ -84,14 +81,14 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
84
81
|
}
|
|
85
82
|
}, [attribute.type]);
|
|
86
83
|
const styles = useStyles();
|
|
87
|
-
const isResizingRef =
|
|
88
|
-
const [columnFilters, setColumnFilters] =
|
|
84
|
+
const isResizingRef = useRef(false);
|
|
85
|
+
const [columnFilters, setColumnFilters] = useGridColumnFilter();
|
|
89
86
|
const filterCondition = columnFilters[column.id];
|
|
90
87
|
const onChangeFilterCondition = (condition) => {
|
|
91
88
|
setColumnFilters(column.id, condition);
|
|
92
89
|
};
|
|
93
|
-
const sortMenuItems = ((
|
|
94
|
-
const filterMenuItems = ((
|
|
90
|
+
const sortMenuItems = (_jsxs(_Fragment, { children: [_jsx(MenuItem, { icon: _jsx(Icons.ArrowUp, { size: 16 }), onClick: () => onChangeSortDirection === null || onChangeSortDirection === void 0 ? void 0 : onChangeSortDirection('asc'), children: strings.sortByAscending }), _jsx(MenuItem, { icon: _jsx(Icons.ArrowDown, { size: 16 }), onClick: () => onChangeSortDirection === null || onChangeSortDirection === void 0 ? void 0 : onChangeSortDirection('desc'), children: strings.sortByDescending })] }));
|
|
91
|
+
const filterMenuItems = (_jsxs(_Fragment, { children: [_jsx(MenuItem, { icon: _jsx(Icons.Filter, { size: 16 }), onClick: () => setVisible(!visible), children: strings.filter }), !!filterCondition && (_jsx(MenuItem, { icon: _jsx(Icons.FilterDismiss, { size: 16 }), onClick: () => {
|
|
95
92
|
onChangeFilterCondition(undefined);
|
|
96
93
|
}, children: strings.clearFilter }))] }));
|
|
97
94
|
const menuItems = [];
|
|
@@ -101,18 +98,18 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
101
98
|
if (!disableFilter) {
|
|
102
99
|
menuItems.push(filterMenuItems);
|
|
103
100
|
}
|
|
104
|
-
const headerCell = ((
|
|
101
|
+
const headerCell = (_jsxs(TableHeaderCell, { as: "div", className: mergeClasses(styles.root, align === 'right' && styles.right), style: {
|
|
105
102
|
textAlign: align,
|
|
106
103
|
width: minWidth,
|
|
107
104
|
minWidth: minWidth,
|
|
108
105
|
maxWidth: minWidth,
|
|
109
106
|
display: 'flex',
|
|
110
107
|
alignItems: 'center',
|
|
111
|
-
fontWeight:
|
|
108
|
+
fontWeight: tokens.fontWeightMedium,
|
|
112
109
|
// pointerEvents: disableFilter && disableSort ? 'none' : 'auto',
|
|
113
110
|
}, onClick: (event) => {
|
|
114
111
|
event.preventDefault();
|
|
115
|
-
}, aside: resizable ? ((
|
|
112
|
+
}, aside: resizable ? (_jsx("div", { className: mergeClasses(styles.resizeHandle), "data-id": "resize-handle", onClick: (event) => {
|
|
116
113
|
event.stopPropagation();
|
|
117
114
|
event.preventDefault();
|
|
118
115
|
}, onDoubleClick: (event) => {
|
|
@@ -130,7 +127,7 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
130
127
|
event.stopPropagation();
|
|
131
128
|
event.preventDefault();
|
|
132
129
|
resizeHandler === null || resizeHandler === void 0 ? void 0 : resizeHandler(event);
|
|
133
|
-
}, children: (
|
|
130
|
+
}, children: _jsx("div", { className: mergeClasses(styles.resizeHandleInner) }) })) : null, onMouseUp: (event) => {
|
|
134
131
|
event.preventDefault();
|
|
135
132
|
if (isResizingRef.current) {
|
|
136
133
|
return;
|
|
@@ -138,16 +135,15 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
|
|
|
138
135
|
isResizingRef.current = false;
|
|
139
136
|
}, sortable: !disableSort,
|
|
140
137
|
// sortDirection="ascending"
|
|
141
|
-
sortDirection: getSortDirection(sortDirection), children: [children, !!filterCondition && ((
|
|
138
|
+
sortDirection: getSortDirection(sortDirection), children: [children, !!filterCondition && (_jsx("div", { style: { marginTop: 2, color: tokens.colorNeutralForeground1 }, children: _jsx(Icons.Filter, { size: 16 }) }))] }));
|
|
142
139
|
if (disableFilter && disableSort) {
|
|
143
140
|
return headerCell;
|
|
144
141
|
}
|
|
145
|
-
return ((
|
|
142
|
+
return (_jsxs("th", { children: [_jsxs(Menu, { positioning: "below-start", children: [_jsx(MenuTrigger, { children: headerCell }), _jsx(MenuPopover, { children: _jsx(MenuList, { children: menuItems.map((x, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(MenuDivider, {}), x] }, i))) }) })] }), _jsx(Dialog, { open: visible, onOpenChange: () => setVisible(false), children: _jsx(DialogSurface, { style: { maxWidth: 400 }, children: _jsxs(DialogBody, { children: [_jsx(DialogTitle, { children: strings.filterBy }), _jsx(FilterForm, { attribute: attribute, defaultValue: filterCondition, onApply: (condition) => {
|
|
146
143
|
onChangeFilterCondition(condition);
|
|
147
144
|
setVisible(false);
|
|
148
145
|
}, onCancel: () => setVisible(false) })] }) }) })] }));
|
|
149
146
|
};
|
|
150
|
-
exports.TableHeaderFilterCell = TableHeaderFilterCell;
|
|
151
147
|
const getSortDirection = (direction) => {
|
|
152
148
|
if (direction === 'asc') {
|
|
153
149
|
return 'ascending';
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableHeaderFilterCell = void 0;
|
|
4
|
-
var TableHeaderFilterCell_1 = require("./TableHeaderFilterCell");
|
|
5
|
-
Object.defineProperty(exports, "TableHeaderFilterCell", { enumerable: true, get: function () { return TableHeaderFilterCell_1.TableHeaderFilterCell; } });
|
|
1
|
+
export { TableHeaderFilterCell } from './TableHeaderFilterCell';
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultOperator = getDefaultOperator;
|
|
4
|
-
exports.getDefaultValues = getDefaultValues;
|
|
5
|
-
function getDefaultOperator(operator, attributeType) {
|
|
1
|
+
export function getDefaultOperator(operator, attributeType) {
|
|
6
2
|
if (operator) {
|
|
7
3
|
return operator;
|
|
8
4
|
}
|
|
@@ -14,7 +10,7 @@ function getDefaultOperator(operator, attributeType) {
|
|
|
14
10
|
}
|
|
15
11
|
return 'eq';
|
|
16
12
|
}
|
|
17
|
-
function getDefaultValues(operator, value, _attributeType) {
|
|
13
|
+
export function getDefaultValues(operator, value, _attributeType) {
|
|
18
14
|
if (!value)
|
|
19
15
|
return [];
|
|
20
16
|
return Array.isArray(value) ? value : [value];
|