@talxis/base-controls 1.2502.1 → 1.2503.2
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/dist/components/DatasetControl/DatasetControl.js +21 -34
- package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
- package/dist/components/DatasetControl/ErrorBoundary.js +33 -0
- package/dist/components/DatasetControl/ErrorBoundary.js.map +1 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.d.ts +10 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.js +38 -0
- package/dist/components/DatasetControl/QuickFind/QuickFind.js.map +1 -0
- package/dist/components/DatasetControl/styles.d.ts +3 -1
- package/dist/components/DatasetControl/styles.js +2 -2
- package/dist/components/DatasetControl/styles.js.map +1 -1
- package/dist/components/DatasetControl/translations.d.ts +8 -0
- package/dist/components/DatasetControl/translations.js +3 -1
- package/dist/components/DatasetControl/translations.js.map +1 -1
- package/dist/components/DateTime/DateTime.js +2 -1
- package/dist/components/DateTime/DateTime.js.map +1 -1
- package/dist/components/DateTime/components/Calendar.d.ts +2 -1
- package/dist/components/DateTime/components/Calendar.js +4 -4
- package/dist/components/DateTime/components/Calendar.js.map +1 -1
- package/dist/components/DateTime/hooks/useDateTime.js +18 -17
- package/dist/components/DateTime/hooks/useDateTime.js.map +1 -1
- package/dist/components/Decimal/Decimal.js +5 -1
- package/dist/components/Decimal/Decimal.js.map +1 -1
- package/dist/components/Duration/Duration.js +49 -26
- package/dist/components/Duration/Duration.js.map +1 -1
- package/dist/components/Grid/Grid.js +1 -1
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js +78 -174
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/context.d.ts +3 -0
- package/dist/components/Grid/core/components/AgGrid/context.js +6 -0
- package/dist/components/Grid/core/components/AgGrid/context.js.map +1 -0
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.d.ts +40 -5
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +235 -49
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.d.ts +9 -0
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.js +86 -0
- package/dist/components/Grid/core/components/AgGrid/model/Comparator.js.map +1 -0
- package/dist/components/Grid/core/components/AgGrid/styles.d.ts +28 -32
- package/dist/components/Grid/core/components/AgGrid/styles.js +31 -35
- package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Cell.d.ts +13 -0
- package/dist/components/Grid/core/components/Cell/Cell.js +145 -0
- package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.d.ts +3 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js +212 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.d.ts +33 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.js +39 -0
- package/dist/components/Grid/core/components/Cell/CellContent/styles.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/Commands/Commands.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.d.ts +12 -0
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js +112 -0
- package/dist/components/Grid/core/components/Cell/Notifications/Notifications.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.d.ts +39 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.js +46 -0
- package/dist/components/Grid/core/components/Cell/Notifications/styles.js.map +1 -0
- package/dist/components/Grid/core/components/Cell/styles.d.ts +40 -0
- package/dist/components/Grid/core/components/Cell/styles.js +59 -0
- package/dist/components/Grid/core/components/Cell/styles.js.map +1 -0
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +3 -2
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js +31 -13
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/GlobalCheckbox.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.d.ts +3 -2
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js +5 -4
- package/dist/components/Grid/core/components/ColumnHeader/components/GlobalCheckbox/styles.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/styles.d.ts +3 -1
- package/dist/components/Grid/core/components/ColumnHeader/styles.js +4 -2
- package/dist/components/Grid/core/components/ColumnHeader/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Save/Save.js +5 -6
- package/dist/components/Grid/core/components/Save/Save.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js +10 -7
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/ChangeEditor.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.d.ts +1 -0
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +26 -7
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
- package/dist/components/Grid/core/controllers/useGridController.js +8 -2
- package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
- package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +2 -0
- package/dist/components/Grid/core/model/Grid.d.ts +16 -7
- package/dist/components/Grid/core/model/Grid.js +230 -45
- package/dist/components/Grid/core/model/Grid.js.map +1 -1
- package/dist/components/Grid/core/model/Metadata.d.ts +2 -1
- package/dist/components/Grid/core/services/KeyListener.d.ts +2 -0
- package/dist/components/Grid/core/services/KeyListener.js +6 -3
- package/dist/components/Grid/core/services/KeyListener.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js +3 -3
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/ConditionValue.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +19 -7
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/Component.js +9 -9
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/Component.js.map +1 -0
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/controller/useComponentController.js +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/controller/useComponentController.js.map +1 -0
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.d.ts +2 -2
- package/dist/components/Grid/{core/components/Component → filtering/components/FilterCallout/components/LegacyControlRendering}/model/Component.js +15 -19
- package/dist/components/Grid/filtering/components/FilterCallout/components/LegacyControlRendering/model/Component.js.map +1 -0
- package/dist/components/Grid/filtering/model/Condition.js +1 -1
- package/dist/components/Grid/filtering/model/Condition.js.map +1 -1
- package/dist/components/Grid/selection/model/Selection.d.ts +3 -4
- package/dist/components/Grid/selection/model/Selection.js +8 -26
- package/dist/components/Grid/selection/model/Selection.js.map +1 -1
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +1 -1
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.d.ts +2 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js +11 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/DefaultContentRenderer.js.map +1 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js +2 -0
- package/dist/components/GridCellRenderer/DefaultContentRenderer/index.js.map +1 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.d.ts +3 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.js +252 -0
- package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.d.ts +5 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.js +69 -0
- package/dist/components/GridCellRenderer/OptionSet/OptionSet.js.map +1 -0
- package/dist/components/GridCellRenderer/OptionSet/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/OptionSet/index.js +2 -0
- package/dist/components/GridCellRenderer/OptionSet/index.js.map +1 -0
- package/dist/components/{Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet → GridCellRenderer/OptionSet}/styles.d.ts +10 -12
- package/dist/components/GridCellRenderer/OptionSet/styles.js +29 -0
- package/dist/components/GridCellRenderer/OptionSet/styles.js.map +1 -0
- package/dist/components/GridCellRenderer/index.d.ts +1 -0
- package/dist/components/GridCellRenderer/index.js +2 -0
- package/dist/components/GridCellRenderer/index.js.map +1 -0
- package/dist/components/GridCellRenderer/interfaces.d.ts +53 -0
- package/dist/components/GridCellRenderer/styles.d.ts +72 -0
- package/dist/components/GridCellRenderer/styles.js +105 -0
- package/dist/components/GridCellRenderer/styles.js.map +1 -0
- package/dist/components/GridCellRenderer/translations.d.ts +6 -0
- package/dist/components/GridCellRenderer/translations.js +11 -0
- package/dist/components/GridCellRenderer/translations.js.map +1 -0
- package/dist/components/GridCellRenderer/useComponentProps.d.ts +6 -0
- package/dist/components/GridCellRenderer/useComponentProps.js +10 -0
- package/dist/components/GridCellRenderer/useComponentProps.js.map +1 -0
- package/dist/components/Lookup/Lookup.js +8 -3
- package/dist/components/Lookup/Lookup.js.map +1 -1
- package/dist/components/Lookup/styles.d.ts +19 -7
- package/dist/components/Lookup/styles.js +22 -8
- package/dist/components/Lookup/styles.js.map +1 -1
- package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js +51 -28
- package/dist/components/MultiSelectOptionSet/MultiSelectOptionSet.js.map +1 -1
- package/dist/components/NestedControlRenderer/NestedControl.d.ts +86 -0
- package/dist/components/NestedControlRenderer/NestedControl.js +456 -0
- package/dist/components/NestedControlRenderer/NestedControl.js.map +1 -0
- package/dist/components/NestedControlRenderer/NestedControlError.d.ts +4 -0
- package/dist/components/NestedControlRenderer/NestedControlError.js +13 -0
- package/dist/components/NestedControlRenderer/NestedControlError.js.map +1 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.d.ts +3 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.js +194 -0
- package/dist/components/NestedControlRenderer/NestedControlRenderer.js.map +1 -0
- package/dist/components/NestedControlRenderer/index.d.ts +1 -0
- package/dist/components/NestedControlRenderer/index.js +2 -0
- package/dist/components/NestedControlRenderer/index.js.map +1 -0
- package/dist/components/NestedControlRenderer/interfaces.d.ts +122 -0
- package/dist/components/NestedControlRenderer/manifest/Control.d.ts +16 -0
- package/dist/components/NestedControlRenderer/manifest/Control.js +40 -0
- package/dist/components/NestedControlRenderer/manifest/Control.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.d.ts +5 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.js +12 -0
- package/dist/components/NestedControlRenderer/manifest/Manifest.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.d.ts +6 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.js +13 -0
- package/dist/components/NestedControlRenderer/manifest/TypeGroup.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/index.d.ts +1 -0
- package/dist/components/NestedControlRenderer/manifest/index.js +2 -0
- package/dist/components/NestedControlRenderer/manifest/index.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.d.ts +16 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.js +34 -0
- package/dist/components/NestedControlRenderer/manifest/property/Property.js.map +1 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.d.ts +8 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.js +12 -0
- package/dist/components/NestedControlRenderer/manifest/property/Value.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.js +20 -0
- package/dist/components/NestedControlRenderer/properties/DateProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.js +14 -0
- package/dist/components/NestedControlRenderer/properties/FileProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.d.ts +6 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.js +35 -0
- package/dist/components/NestedControlRenderer/properties/LookupProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.js +15 -0
- package/dist/components/NestedControlRenderer/properties/NumberProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js +22 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/Property.d.ts +17 -0
- package/dist/components/NestedControlRenderer/properties/Property.js +46 -0
- package/dist/components/NestedControlRenderer/properties/Property.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.d.ts +5 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.js +15 -0
- package/dist/components/NestedControlRenderer/properties/TextProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/styles.d.ts +14 -0
- package/dist/components/NestedControlRenderer/styles.js +21 -0
- package/dist/components/NestedControlRenderer/styles.js.map +1 -0
- package/dist/components/NestedControlRenderer/translations.d.ts +14 -0
- package/dist/components/NestedControlRenderer/translations.js +19 -0
- package/dist/components/NestedControlRenderer/translations.js.map +1 -0
- package/dist/components/OptionSet/OptionSet.js +3 -3
- package/dist/components/OptionSet/OptionSet.js.map +1 -1
- package/dist/components/OptionSet/useComboBoxTheme.js +17 -17
- package/dist/components/OptionSet/useComboBoxTheme.js.map +1 -1
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TextField/interfaces.d.ts +2 -2
- package/dist/components/TwoOptions/TwoOptions.js +2 -1
- package/dist/components/TwoOptions/TwoOptions.js.map +1 -1
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.js +15 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useControl.d.ts +1 -7
- package/dist/hooks/useControl.js +12 -40
- package/dist/hooks/useControl.js.map +1 -1
- package/dist/hooks/useControlLabels.d.ts +14 -0
- package/dist/hooks/useControlLabels.js +47 -0
- package/dist/hooks/useControlLabels.js.map +1 -0
- package/dist/hooks/useInputBasedControl.d.ts +2 -1
- package/dist/hooks/useInputBasedControl.js +3 -5
- package/dist/hooks/useInputBasedControl.js.map +1 -1
- package/dist/hooks/usePrevious.d.ts +1 -0
- package/dist/index.d.ts +456 -140
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/context.d.ts +2 -1
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/property.d.ts +5 -0
- package/dist/utils/BaseControls.d.ts +16 -0
- package/dist/utils/BaseControls.js +82 -0
- package/dist/utils/BaseControls.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/theme/ControlTheme.d.ts +1 -1
- package/dist/utils/theme/ControlTheme.js +1 -1
- package/dist/utils/theme/ControlTheme.js.map +1 -1
- package/dist/utils/theme/components/ThemeWrapper.d.ts +9 -0
- package/dist/utils/theme/components/ThemeWrapper.js +11 -0
- package/dist/utils/theme/components/ThemeWrapper.js.map +1 -0
- package/dist/utils/theme/components/index.d.ts +1 -0
- package/dist/utils/theme/components/index.js +2 -0
- package/dist/utils/theme/components/index.js.map +1 -0
- package/dist/utils/theme/hooks/useControlTheme.d.ts +1 -1
- package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
- package/dist/utils/theme/index.d.ts +1 -0
- package/dist/utils/theme/index.js +1 -0
- package/dist/utils/theme/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +0 -82
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +0 -93
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +0 -36
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +0 -42
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +0 -221
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +0 -49
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js +0 -27
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +0 -99
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +0 -123
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Component/Component.js.map +0 -1
- package/dist/components/Grid/core/components/Component/controller/useComponentController.js.map +0 -1
- package/dist/components/Grid/core/components/Component/model/Component.js.map +0 -1
- package/dist/components/Grid/core/model/Metadata.js +0 -26
- package/dist/components/Grid/core/model/Metadata.js.map +0 -1
- package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +0 -11
- package/dist/components/Grid/selection/controllers/useSelectionController.js +0 -21
- package/dist/components/Grid/selection/controllers/useSelectionController.js.map +0 -1
- package/dist/hooks/useRerender.d.ts +0 -1
- package/dist/hooks/useRerender.js +0 -9
- package/dist/hooks/useRerender.js.map +0 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useGridInstance } from '../../../hooks/useGridInstance.js';
|
|
4
|
+
import { getCellContentStyles } from './styles.js';
|
|
5
|
+
import { NestedControlRenderer } from '../../../../../NestedControlRenderer/NestedControlRenderer.js';
|
|
6
|
+
import { useTheme, merge } from '@fluentui/react';
|
|
7
|
+
import { useRerender } from '@talxis/react-components';
|
|
8
|
+
import { getJustifyContent } from '../styles.js';
|
|
9
|
+
import { useDebouncedCallback } from 'use-debounce';
|
|
10
|
+
import { Client } from '@talxis/client-libraries';
|
|
11
|
+
import { AgGridContext } from '../../AgGrid/context.js';
|
|
12
|
+
import { ControlTheme } from '../../../../../../utils/theme/ControlTheme.js';
|
|
13
|
+
|
|
14
|
+
const client = new Client();
|
|
15
|
+
const CellContent = (props) => {
|
|
16
|
+
const columnRef = React.useRef(props.baseColumn);
|
|
17
|
+
const mountedRef = React.useRef(false);
|
|
18
|
+
const valueRef = React.useRef(props.value);
|
|
19
|
+
columnRef.current = props.baseColumn;
|
|
20
|
+
valueRef.current = props.value;
|
|
21
|
+
const rerender = useRerender();
|
|
22
|
+
const grid = useGridInstance();
|
|
23
|
+
const agGrid = React.useContext(AgGridContext);
|
|
24
|
+
const record = props.data;
|
|
25
|
+
const node = props.node;
|
|
26
|
+
const themeRef = React.useRef(useTheme());
|
|
27
|
+
themeRef.current = useTheme();
|
|
28
|
+
const styles = React.useMemo(() => getCellContentStyles(valueRef.current.columnAlignment), [valueRef.current.columnAlignment]);
|
|
29
|
+
//defer loading of the nested control to solve edge case where the changed values from onNotifyOutputChanged triggered by unmount would not be available straight away
|
|
30
|
+
const [shouldRenderNestedControl, setShouldRenderNestedControl] = React.useState(false);
|
|
31
|
+
const getColumn = () => {
|
|
32
|
+
return columnRef.current;
|
|
33
|
+
};
|
|
34
|
+
const getFluentDesignLanguage = (fluentDesignLanguage) => {
|
|
35
|
+
//@ts-ignore
|
|
36
|
+
const formatting = agGrid.getCellFormatting(props);
|
|
37
|
+
const mergedOverrides = merge({}, fluentDesignLanguage?.v8FluentOverrides ?? {}, formatting.themeOverride);
|
|
38
|
+
const columnAlignment = valueRef.current.columnAlignment;
|
|
39
|
+
const result = ControlTheme.GenerateFluentDesignLanguage(formatting.primaryColor, formatting.backgroundColor, formatting.textColor, {
|
|
40
|
+
v8FluentOverrides: merge({}, {
|
|
41
|
+
semanticColors: {
|
|
42
|
+
inputBorder: 'transparent',
|
|
43
|
+
inputBorderHovered: 'transparent',
|
|
44
|
+
inputBackground: formatting.backgroundColor,
|
|
45
|
+
focusBorder: 'transparent',
|
|
46
|
+
disabledBorder: 'transparent',
|
|
47
|
+
inputFocusBorderAlt: 'transparent',
|
|
48
|
+
errorText: 'transparent'
|
|
49
|
+
},
|
|
50
|
+
effects: {
|
|
51
|
+
underlined: false
|
|
52
|
+
},
|
|
53
|
+
components: {
|
|
54
|
+
'TextField': {
|
|
55
|
+
styles: {
|
|
56
|
+
field: {
|
|
57
|
+
textAlign: columnAlignment
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'ComboBox': {
|
|
62
|
+
styles: {
|
|
63
|
+
input: {
|
|
64
|
+
textAlign: columnAlignment === 'right' ? 'right' : undefined,
|
|
65
|
+
paddingRight: columnAlignment === 'right' ? 8 : undefined,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
'DatePicker': {
|
|
70
|
+
styles: {
|
|
71
|
+
root: {
|
|
72
|
+
'.ms-TextField-field': {
|
|
73
|
+
paddingRight: columnAlignment === 'right' ? 8 : undefined,
|
|
74
|
+
textAlign: columnAlignment === 'right' ? 'right' : 'left'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
'Toggle': {
|
|
80
|
+
styles: {
|
|
81
|
+
root: {
|
|
82
|
+
justifyContent: getJustifyContent(columnAlignment)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, mergedOverrides),
|
|
88
|
+
applicationTheme: fluentDesignLanguage?.applicationTheme
|
|
89
|
+
});
|
|
90
|
+
return result;
|
|
91
|
+
};
|
|
92
|
+
const onNotifyOutputChanged = (outputs) => {
|
|
93
|
+
let isEditing = props.isCellEditor;
|
|
94
|
+
//if we are not mounted, set editing to true so requestRender gets run
|
|
95
|
+
//if this is not present, a PCF editor might trigger this too late and we would not see the current value in renderer until next
|
|
96
|
+
if (!mountedRef.current) {
|
|
97
|
+
isEditing = false;
|
|
98
|
+
}
|
|
99
|
+
grid.onNotifyOutputChanged(record, columnRef.current, isEditing, outputs.value, () => rerender());
|
|
100
|
+
};
|
|
101
|
+
const debouncedNotifyOutputChanged = useDebouncedCallback((outputs) => onNotifyOutputChanged(outputs), 100);
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
mountedRef.current = true;
|
|
104
|
+
setShouldRenderNestedControl(true);
|
|
105
|
+
return () => {
|
|
106
|
+
mountedRef.current = false;
|
|
107
|
+
};
|
|
108
|
+
}, []);
|
|
109
|
+
if (!shouldRenderNestedControl) {
|
|
110
|
+
return jsx(Fragment, {});
|
|
111
|
+
}
|
|
112
|
+
return jsx(NestedControlRenderer, { context: grid.pcfContext, parameters: {
|
|
113
|
+
ControlName: valueRef.current.customControl.name,
|
|
114
|
+
LoadingType: 'shimmer',
|
|
115
|
+
Bindings: grid.getBindings(record, getColumn(), valueRef.current.customControl),
|
|
116
|
+
ControlStates: {
|
|
117
|
+
isControlDisabled: !valueRef.current.editing
|
|
118
|
+
},
|
|
119
|
+
}, onNotifyOutputChanged: (outputs) => {
|
|
120
|
+
//talxis portal does not have debounce for notifyoutput
|
|
121
|
+
//Power Apps does a debounce of 100ms
|
|
122
|
+
if (getColumn().oneClickEdit && client.isTalxisPortal()) {
|
|
123
|
+
debouncedNotifyOutputChanged(outputs);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
onNotifyOutputChanged(outputs);
|
|
127
|
+
}
|
|
128
|
+
}, onOverrideComponentProps: (componentProps) => {
|
|
129
|
+
return {
|
|
130
|
+
...componentProps,
|
|
131
|
+
rootContainerProps: {
|
|
132
|
+
...componentProps.rootContainerProps,
|
|
133
|
+
className: styles.controlRoot
|
|
134
|
+
},
|
|
135
|
+
controlContainerProps: {
|
|
136
|
+
className: styles.controlContainer
|
|
137
|
+
},
|
|
138
|
+
overridenControlContainerProps: {
|
|
139
|
+
className: styles.overridenControlContainer
|
|
140
|
+
},
|
|
141
|
+
messageBarProps: {
|
|
142
|
+
...componentProps.messageBarProps,
|
|
143
|
+
styles: {
|
|
144
|
+
root: styles.errorMessageRoot,
|
|
145
|
+
content: styles.errorMessageContent
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
loadingProps: {
|
|
149
|
+
...componentProps.loadingProps,
|
|
150
|
+
shimmerProps: {
|
|
151
|
+
...componentProps.loadingProps.shimmerProps,
|
|
152
|
+
styles: {
|
|
153
|
+
...componentProps.loadingProps?.shimmerProps?.styles,
|
|
154
|
+
shimmerWrapper: styles.shimmerWrapper
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
containerProps: {
|
|
158
|
+
...componentProps.loadingProps?.containerProps,
|
|
159
|
+
className: styles.loadingWrapper
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
onOverrideRender: (control, isCustomPcfComponent, defaultRender) => {
|
|
163
|
+
if (isCustomPcfComponent) {
|
|
164
|
+
grid.setUsesNestedPcfs();
|
|
165
|
+
}
|
|
166
|
+
if (valueRef.current.customComponent) {
|
|
167
|
+
return valueRef.current.customComponent.onRender(control.getProps(), themeRef.current, control.getContainer());
|
|
168
|
+
}
|
|
169
|
+
return defaultRender();
|
|
170
|
+
},
|
|
171
|
+
onOverrideUnmount: (control, defaultUnmount) => {
|
|
172
|
+
if (valueRef.current.customComponent) {
|
|
173
|
+
return valueRef.current.customComponent.onUnmount(control.getContainer());
|
|
174
|
+
}
|
|
175
|
+
//@ts-ignore - internal types
|
|
176
|
+
//skip the unmounting for custom PCF's in Power Apps
|
|
177
|
+
// PCF unmount in Power Apps causes other nested PCF's to reinitialize which causes flickering
|
|
178
|
+
//umounting of nested PCF's happens on grid destroy to prevent memory leaks (currently done by refreshing the page as no better method was found)
|
|
179
|
+
if (control.isMountedPcfComponent() && !grid.getClient().isTalxisPortal()) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
return defaultUnmount();
|
|
183
|
+
},
|
|
184
|
+
onOverrideControlProps: (controlProps) => {
|
|
185
|
+
//here we always need to fetch the latest parameters
|
|
186
|
+
//we still might have old one's cached in valueRef
|
|
187
|
+
const columnInfo = record.getColumnInfo(getColumn().name);
|
|
188
|
+
const parameters = columnInfo.ui.getControlParameters({
|
|
189
|
+
...controlProps.parameters,
|
|
190
|
+
...grid.getParameters(record, getColumn(), props.isCellEditor)
|
|
191
|
+
});
|
|
192
|
+
return {
|
|
193
|
+
...controlProps,
|
|
194
|
+
context: {
|
|
195
|
+
...controlProps.context,
|
|
196
|
+
mode: Object.create(controlProps.context.mode, {
|
|
197
|
+
allocatedHeight: {
|
|
198
|
+
value: node.rowHeight - 1
|
|
199
|
+
},
|
|
200
|
+
}),
|
|
201
|
+
parameters: parameters,
|
|
202
|
+
fluentDesignLanguage: getFluentDesignLanguage(controlProps.context.fluentDesignLanguage)
|
|
203
|
+
},
|
|
204
|
+
parameters: parameters
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
} });
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export { CellContent };
|
|
212
|
+
//# sourceMappingURL=CellContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellContent.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/CellContent/CellContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGridInstance } from '../../../hooks/useGridInstance';\nimport { ICellProps } from '../Cell';\nimport { getCellContentStyles } from './styles';\nimport { NestedControlRenderer } from '../../../../../NestedControlRenderer/NestedControlRenderer';\nimport { ControlTheme, IFluentDesignState } from '../../../../../../utils';\nimport { IComboBoxStyles, IDatePickerStyles, ITextFieldStyles, IToggleStyles, merge, useTheme } from '@fluentui/react';\nimport { useRerender } from '@talxis/react-components';\nimport { getJustifyContent } from '../styles';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { Client } from '@talxis/client-libraries';\nimport { AgGridContext } from '../../AgGrid/context';\n\nconst client = new Client();\n\nexport const CellContent = (props: ICellProps) => {\n const columnRef = React.useRef(props.baseColumn);\n const mountedRef = React.useRef(false);\n const valueRef = React.useRef(props.value);\n columnRef.current = props.baseColumn;\n valueRef.current = props.value;\n const rerender = useRerender();\n const grid = useGridInstance();\n const agGrid = React.useContext(AgGridContext);\n const record = props.data;\n const node = props.node;\n const themeRef = React.useRef(useTheme());\n themeRef.current = useTheme();\n const styles = React.useMemo(() => getCellContentStyles(valueRef.current.columnAlignment), [valueRef.current.columnAlignment]);\n //defer loading of the nested control to solve edge case where the changed values from onNotifyOutputChanged triggered by unmount would not be available straight away\n const [shouldRenderNestedControl, setShouldRenderNestedControl] = React.useState(false);\n const getColumn = () => {\n return columnRef.current;\n }\n\n const getFluentDesignLanguage = (fluentDesignLanguage?: IFluentDesignState) => {\n //@ts-ignore\n const formatting = agGrid.getCellFormatting(props);\n const mergedOverrides: any = merge({}, fluentDesignLanguage?.v8FluentOverrides ?? {}, formatting.themeOverride);\n const columnAlignment = valueRef.current.columnAlignment;\n const result = ControlTheme.GenerateFluentDesignLanguage(formatting.primaryColor, formatting.backgroundColor, formatting.textColor, {\n v8FluentOverrides: merge({},\n {\n semanticColors: {\n inputBorder: 'transparent',\n inputBorderHovered: 'transparent',\n inputBackground: formatting.backgroundColor,\n focusBorder: 'transparent',\n disabledBorder: 'transparent',\n inputFocusBorderAlt: 'transparent',\n errorText: 'transparent'\n\n },\n effects: {\n underlined: false\n },\n\n components: {\n 'TextField': {\n styles: {\n field: {\n textAlign: columnAlignment\n }\n \n } as ITextFieldStyles\n },\n 'ComboBox': {\n styles: {\n input: {\n textAlign: columnAlignment === 'right' ? 'right' : undefined,\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n }\n } as IComboBoxStyles\n },\n 'DatePicker': {\n styles: {\n root: {\n '.ms-TextField-field': {\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n textAlign: columnAlignment === 'right' ? 'right' : 'left'\n }\n } as any\n } as IDatePickerStyles\n },\n 'Toggle': {\n styles: {\n root: {\n justifyContent: getJustifyContent(columnAlignment)\n }\n } as IToggleStyles\n }\n }\n },\n mergedOverrides\n ),\n applicationTheme: fluentDesignLanguage?.applicationTheme\n })\n return result;\n }\n\n const onNotifyOutputChanged = (outputs: any) => {\n let isEditing = props.isCellEditor;\n //if we are not mounted, set editing to true so requestRender gets run\n //if this is not present, a PCF editor might trigger this too late and we would not see the current value in renderer until next\n if(!mountedRef.current) {\n isEditing = false;\n }\n grid.onNotifyOutputChanged(record, columnRef.current, isEditing, outputs.value, () => rerender())\n }\n const debouncedNotifyOutputChanged = useDebouncedCallback((outputs) => onNotifyOutputChanged(outputs), 100);\n\n React.useEffect(() => {\n mountedRef.current = true;\n setShouldRenderNestedControl(true);\n return () => {\n mountedRef.current = false;\n }\n }, []);\n if(!shouldRenderNestedControl) {\n return <></>\n }\n\n return <NestedControlRenderer\n context={grid.pcfContext}\n parameters={{\n ControlName: valueRef.current.customControl.name,\n LoadingType: 'shimmer',\n Bindings: grid.getBindings(record, getColumn(), valueRef.current.customControl),\n ControlStates: {\n isControlDisabled: !valueRef.current.editing\n },\n }}\n onNotifyOutputChanged={(outputs) => {\n //talxis portal does not have debounce for notifyoutput\n //Power Apps does a debounce of 100ms\n if(getColumn().oneClickEdit && client.isTalxisPortal()) {\n debouncedNotifyOutputChanged(outputs);\n }\n else {\n onNotifyOutputChanged(outputs);\n }\n }}\n onOverrideComponentProps={(componentProps) => {\n return {\n ...componentProps,\n rootContainerProps: {\n ...componentProps.rootContainerProps,\n className: styles.controlRoot\n },\n controlContainerProps: {\n className: styles.controlContainer\n },\n overridenControlContainerProps: {\n className: styles.overridenControlContainer\n },\n messageBarProps: {\n ...componentProps.messageBarProps,\n styles: {\n root: styles.errorMessageRoot,\n content: styles.errorMessageContent\n }\n },\n loadingProps: {\n ...componentProps.loadingProps,\n shimmerProps: {\n ...componentProps.loadingProps.shimmerProps,\n styles: {\n ...componentProps.loadingProps?.shimmerProps?.styles,\n shimmerWrapper: styles.shimmerWrapper\n }\n },\n containerProps: {\n ...componentProps.loadingProps?.containerProps,\n className: styles.loadingWrapper\n }\n },\n onOverrideRender: (control, isCustomPcfComponent, defaultRender) => {\n if(isCustomPcfComponent) {\n grid.setUsesNestedPcfs();\n }\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onRender(control.getProps(), themeRef.current, control.getContainer())\n }\n return defaultRender();\n },\n onOverrideUnmount: (control, defaultUnmount) => {\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onUnmount(control.getContainer());\n }\n //@ts-ignore - internal types\n //skip the unmounting for custom PCF's in Power Apps\n // PCF unmount in Power Apps causes other nested PCF's to reinitialize which causes flickering\n //umounting of nested PCF's happens on grid destroy to prevent memory leaks (currently done by refreshing the page as no better method was found)\n if(control.isMountedPcfComponent() && !grid.getClient().isTalxisPortal()) {\n return;\n }\n return defaultUnmount();\n },\n onOverrideControlProps: (controlProps) => {\n //here we always need to fetch the latest parameters\n //we still might have old one's cached in valueRef\n const columnInfo = record.getColumnInfo(getColumn().name);\n const parameters = columnInfo.ui.getControlParameters({\n ...controlProps.parameters,\n ...grid.getParameters(record, getColumn(), props.isCellEditor)\n })\n return { \n ...controlProps,\n context: {\n ...controlProps.context,\n mode: Object.create(controlProps.context.mode, {\n allocatedHeight: {\n value: node.rowHeight! - 1\n },\n\n }),\n parameters: parameters,\n fluentDesignLanguage: getFluentDesignLanguage(controlProps.context.fluentDesignLanguage)\n },\n parameters: parameters\n }\n }\n }\n }}\n />\n}\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEf,MAAA,WAAW,GAAG,CAAC,KAAiB,KAAI;IAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3C,IAAA,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,C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CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,YAAY,CAAC;AACjE,qBAAA,CAAC,CAAA;oBACF,OAAO;AACH,wBAAA,GAAG,YAAY;AACf,wBAAA,OAAO,EAAE;4BACL,GAAG,YAAY,CAAC,OAAO;4BACvB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;AAC3C,gCAAA,eAAe,EAAE;AACb,oCAAA,KAAK,EAAE,IAAI,CAAC,SAAU,GAAG,CAAC;AAC7B,iCAAA;6BAEJ,CAAC;AACF,4BAAA,UAAU,EAAE,UAAU;4BACtB,oBAAoB,EAAE,uBAAuB,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC;AAC3F,yBAAA;AACD,wBAAA,UAAU,EAAE,UAAU;qBACzB,CAAA;iBACJ;aACJ,CAAA;AACL,SAAC,GACH,CAAA;AACN;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IColumn } from "@talxis/client-libraries";
|
|
2
|
+
export declare const getCellContentStyles: (columnAlignment: IColumn['alignment']) => import("@fluentui/react").IProcessedStyleSet<{
|
|
3
|
+
controlRoot: {
|
|
4
|
+
height: string;
|
|
5
|
+
order: number | undefined;
|
|
6
|
+
minWidth: number;
|
|
7
|
+
overflow: string;
|
|
8
|
+
flexGrow: number;
|
|
9
|
+
border: string;
|
|
10
|
+
};
|
|
11
|
+
controlContainer: {
|
|
12
|
+
height: string;
|
|
13
|
+
};
|
|
14
|
+
loadingWrapper: {
|
|
15
|
+
height: string;
|
|
16
|
+
display: string;
|
|
17
|
+
alignItems: string;
|
|
18
|
+
paddingLeft: number;
|
|
19
|
+
paddingRight: number;
|
|
20
|
+
};
|
|
21
|
+
overridenControlContainer: {
|
|
22
|
+
height: string;
|
|
23
|
+
};
|
|
24
|
+
shimmerWrapper: {
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
errorMessageRoot: {
|
|
28
|
+
height: string;
|
|
29
|
+
};
|
|
30
|
+
errorMessageContent: {
|
|
31
|
+
alignItems: string;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
+
|
|
3
|
+
const getCellContentStyles = (columnAlignment) => {
|
|
4
|
+
return mergeStyleSets({
|
|
5
|
+
controlRoot: {
|
|
6
|
+
height: '100%',
|
|
7
|
+
order: columnAlignment === 'right' ? 2 : undefined,
|
|
8
|
+
minWidth: 0,
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
flexGrow: 1,
|
|
11
|
+
border: '2px solid transparent',
|
|
12
|
+
},
|
|
13
|
+
controlContainer: {
|
|
14
|
+
height: '100%'
|
|
15
|
+
},
|
|
16
|
+
loadingWrapper: {
|
|
17
|
+
height: '100%',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
paddingLeft: 10,
|
|
21
|
+
paddingRight: 10
|
|
22
|
+
},
|
|
23
|
+
overridenControlContainer: {
|
|
24
|
+
height: '100%'
|
|
25
|
+
},
|
|
26
|
+
shimmerWrapper: {
|
|
27
|
+
height: 10
|
|
28
|
+
},
|
|
29
|
+
errorMessageRoot: {
|
|
30
|
+
height: '100%'
|
|
31
|
+
},
|
|
32
|
+
errorMessageContent: {
|
|
33
|
+
alignItems: 'center'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { getCellContentStyles };
|
|
39
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/CellContent/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\nimport { IColumn } from \"@talxis/client-libraries\"\n\nexport const getCellContentStyles = (columnAlignment: IColumn['alignment']) => {\n return mergeStyleSets({\n controlRoot: {\n height: '100%',\n order: columnAlignment === 'right' ? 2 : undefined,\n minWidth: 0,\n overflow: 'hidden',\n flexGrow: 1,\n border: '2px solid transparent',\n },\n controlContainer: {\n height: '100%'\n },\n loadingWrapper: {\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n paddingLeft: 10,\n paddingRight: 10\n },\n overridenControlContainer: {\n height: '100%'\n },\n shimmerWrapper: {\n height: 10\n },\n errorMessageRoot: {\n height: '100%'\n },\n errorMessageContent: {\n alignItems: 'center'\n }\n })\n}"],"names":[],"mappings":";;AAGa,MAAA,oBAAoB,GAAG,CAAC,eAAqC,KAAI;AAC1E,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,WAAW,EAAE;AACT,YAAA,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,eAAe,KAAK,OAAO,GAAG,CAAC,GAAG,SAAS;AAClD,YAAA,QAAQ,EAAE,CAAC;AACX,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,QAAQ,EAAE,CAAC;AACX,YAAA,MAAM,EAAE,uBAAuB;AAClC,SAAA;AACD,QAAA,gBAAgB,EAAE;AACd,YAAA,MAAM,EAAE,MAAM;AACjB,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,WAAW,EAAE,EAAE;AACf,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;AACD,QAAA,yBAAyB,EAAE;AACvB,YAAA,MAAM,EAAE,MAAM;AACjB,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,MAAM,EAAE,EAAE;AACb,SAAA;AACD,QAAA,gBAAgB,EAAE;AACd,YAAA,MAAM,EAAE,MAAM;AACjB,SAAA;AACD,QAAA,mBAAmB,EAAE;AACjB,YAAA,UAAU,EAAE,QAAQ;AACvB,SAAA;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Commands.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/Commands/Commands.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Commands.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/Commands/Commands.tsx"],"sourcesContent":["import { useCommands } from './useCommands';\nimport { CommandBar } from \"@talxis/react-components\";\nimport { commandStyles, getCommandsLoadingStyles } from './styles';\nimport { useTheme } from '@fluentui/react';\nimport { IRecord } from '@talxis/client-libraries';\n\ninterface ICommands {\n record: IRecord\n}\n\nexport const Commands = ({ record }: ICommands) => {\n const [items] = useCommands(record);\n const loadingStyles = getCommandsLoadingStyles(useTheme());\n if (!items) {\n return <div className={loadingStyles.loading}>\n {Array.from(Array(3).keys()).map((x) =>\n <div key={x} className={loadingStyles.loadingLine} />\n )}\n </div>\n }\n if (items?.length > 0) {\n return <CommandBar className={commandStyles.talxisRoot} overflowButtonProps={{\n styles: {\n root: commandStyles.button,\n rootHovered: commandStyles.button,\n rootPressed: commandStyles.button,\n rootExpanded: commandStyles.button\n }\n }} styles={{\n root: commandStyles.root,\n\n }} items={[]}\n farItems={items}\n />;\n }\n return <></>;\n};"],"names":["_jsx"],"mappings":";;;;;;MAUa,QAAQ,GAAG,CAAC,EAAE,MAAM,EAAa,KAAI;IAC9C,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AACpC,IAAA,MAAM,aAAa,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAOA,aAAK,SAAS,EAAE,aAAa,CAAC,OAAO,EACvC,QAAA,EAAA,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAC/BA,GAAa,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,aAAa,CAAC,WAAW,EAAA,EAAvC,CAAC,CAA0C,CACxD,GACC,CAAA;AACT,KAAA;AACD,IAAA,IAAI,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE;QACnB,OAAOA,GAAA,CAAC,UAAU,EAAA,EAAC,SAAS,EAAE,aAAa,CAAC,UAAU,EAAE,mBAAmB,EAAE;AACzE,gBAAA,MAAM,EAAE;oBACJ,IAAI,EAAE,aAAa,CAAC,MAAM;oBAC1B,WAAW,EAAE,aAAa,CAAC,MAAM;oBACjC,WAAW,EAAE,aAAa,CAAC,MAAM;oBACjC,YAAY,EAAE,aAAa,CAAC,MAAM;AACrC,iBAAA;AACJ,aAAA,EAAE,MAAM,EAAE;gBACP,IAAI,EAAE,aAAa,CAAC,IAAI;aAE3B,EAAE,KAAK,EAAE,EAAE,EACR,QAAQ,EAAE,KAAK,GACjB,CAAC;AACN,KAAA;AACD,IAAA,OAAOA,iBAAK,CAAC;AACjB;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICommandBarItemProps } from "@fluentui/react";
|
|
3
|
+
import { IAddControlNotificationOptions, IColumn, ICustomColumnFormatting } from "@talxis/client-libraries";
|
|
4
|
+
interface INotifications {
|
|
5
|
+
notifications: IAddControlNotificationOptions[];
|
|
6
|
+
formatting: Required<ICustomColumnFormatting>;
|
|
7
|
+
isActionColumn: boolean;
|
|
8
|
+
columnAlignment: IColumn['alignment'];
|
|
9
|
+
farItems?: ICommandBarItemProps[];
|
|
10
|
+
}
|
|
11
|
+
export declare const Notifications: (props: INotifications) => JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useTheme, ThemeProvider, Callout, Text, Link, Icon, PrimaryButton, DefaultButton } from '@fluentui/react';
|
|
3
|
+
import { getNotificationStyles } from './styles.js';
|
|
4
|
+
import { useMemo, useState, useRef, useEffect } from 'react';
|
|
5
|
+
import { useResizeObserver, useThemeGenerator, CommandBar } from '@talxis/react-components';
|
|
6
|
+
import { useGridInstance } from '../../../hooks/useGridInstance.js';
|
|
7
|
+
import { useControlTheme } from '../../../../../../utils/theme/hooks/useControlTheme.js';
|
|
8
|
+
|
|
9
|
+
const Notifications = (props) => {
|
|
10
|
+
const { notifications, formatting, farItems, isActionColumn, columnAlignment } = { ...props };
|
|
11
|
+
const grid = useGridInstance();
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const styles = getNotificationStyles(isActionColumn, columnAlignment);
|
|
14
|
+
const iconId = useMemo(() => `icon${crypto.randomUUID()}`, []);
|
|
15
|
+
const [selectedNotification, setSelectedNotification] = useState(null);
|
|
16
|
+
const commandBarRef = useRef(null);
|
|
17
|
+
const containerRef = useRef(null);
|
|
18
|
+
const observe = useResizeObserver(() => {
|
|
19
|
+
commandBarRef.current?.remeasure();
|
|
20
|
+
});
|
|
21
|
+
const overridenTheme = useThemeGenerator(theme.semanticColors.bodyText, theme.semanticColors.bodyBackground, theme.semanticColors.bodyText, formatting.themeOverride);
|
|
22
|
+
const renderActionButton = (action, buttonType) => {
|
|
23
|
+
const Button = buttonType === 'primary' ? PrimaryButton : DefaultButton;
|
|
24
|
+
return jsx(Button, { text: action.message, iconProps: action?.iconName ? {
|
|
25
|
+
iconName: action.iconName
|
|
26
|
+
} : undefined, onClick: () => action.actions.map(callback => callback()) });
|
|
27
|
+
};
|
|
28
|
+
const renderActions = (actions) => {
|
|
29
|
+
if (actions.length === 0) {
|
|
30
|
+
return jsx(Fragment, {});
|
|
31
|
+
}
|
|
32
|
+
//render actions as buttons
|
|
33
|
+
if (actions.length < 3) {
|
|
34
|
+
return jsx("div", { className: styles.calloutButtons, children: actions.map((action, i) => renderActionButton(action, i === 0 ? 'primary' : 'default')) });
|
|
35
|
+
}
|
|
36
|
+
return jsx(CommandBar, { items: actions.map((action, i) => {
|
|
37
|
+
return {
|
|
38
|
+
key: i.toString(),
|
|
39
|
+
text: action.message,
|
|
40
|
+
commandBarButtonAs: () => jsxs(Link, { onClick: () => action.actions.map(callback => callback()), className: styles.calloutLink, children: [action.iconName &&
|
|
41
|
+
jsx(Icon, { iconName: action.iconName }), action.message] }),
|
|
42
|
+
iconProps: {
|
|
43
|
+
iconName: action.iconName
|
|
44
|
+
},
|
|
45
|
+
onClick: () => {
|
|
46
|
+
action.actions.map(callback => callback());
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}) });
|
|
50
|
+
};
|
|
51
|
+
const onNotificationClick = (notification) => {
|
|
52
|
+
if (notification.actions?.length === 1) {
|
|
53
|
+
notification.actions[0].actions.map(callback => callback());
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setSelectedNotification(notification);
|
|
57
|
+
};
|
|
58
|
+
const getCommandBarItems = () => {
|
|
59
|
+
const items = [];
|
|
60
|
+
const overflowItems = [];
|
|
61
|
+
notifications.map(notification => {
|
|
62
|
+
const item = {
|
|
63
|
+
key: notification.uniqueId,
|
|
64
|
+
text: notification.text,
|
|
65
|
+
tooltipHostProps: {
|
|
66
|
+
...notification.buttonProps?.tooltipHostProps,
|
|
67
|
+
calloutProps: {
|
|
68
|
+
theme: contextualMenuTheme
|
|
69
|
+
},
|
|
70
|
+
tooltipProps: {
|
|
71
|
+
theme: contextualMenuTheme
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
iconProps: notification.iconName ? {
|
|
75
|
+
iconName: notification.iconName,
|
|
76
|
+
...notification.buttonProps?.iconProps
|
|
77
|
+
} : undefined,
|
|
78
|
+
...notification.buttonProps,
|
|
79
|
+
onClick: (e) => {
|
|
80
|
+
notification.buttonProps?.onClick?.(e);
|
|
81
|
+
onNotificationClick(notification);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
if (notification.buttonProps?.renderedInOverflow) {
|
|
85
|
+
overflowItems.push(item);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
items.push(item);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
items: items,
|
|
93
|
+
overflowItems: overflowItems
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
const contextualMenuTheme = useControlTheme(grid.pcfContext.fluentDesignLanguage);
|
|
97
|
+
const { items, overflowItems } = getCommandBarItems();
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (isActionColumn) {
|
|
100
|
+
observe(containerRef.current);
|
|
101
|
+
}
|
|
102
|
+
}, [isActionColumn]);
|
|
103
|
+
return jsxs("div", { ref: containerRef, className: styles.notificationsRoot, children: [jsx(ThemeProvider, { theme: overridenTheme, children: jsx(CommandBar, { contextualMenuTheme: contextualMenuTheme, id: iconId, componentRef: commandBarRef, styles: {
|
|
104
|
+
primarySet: styles.notificationsPrimarySet
|
|
105
|
+
}, items: items, overflowItems: overflowItems, farItems: farItems }) }), selectedNotification &&
|
|
106
|
+
jsx(Callout, { theme: contextualMenuTheme, hidden: !selectedNotification, className: styles.callout, onDismiss: () => setSelectedNotification(null), target: `#${iconId}`, children: jsxs(ThemeProvider, { className: styles.calloutContent, theme: contextualMenuTheme, children: [selectedNotification.text &&
|
|
107
|
+
jsx(Text, { title: selectedNotification.text, className: styles.calloutTitle, variant: selectedNotification.messages.length > 0 ? 'xLarge' : undefined, children: selectedNotification.text }), jsx(Text, { children: selectedNotification.messages[0] }), selectedNotification.actions &&
|
|
108
|
+
renderActions(selectedNotification.actions)] }) })] });
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export { Notifications };
|
|
112
|
+
//# sourceMappingURL=Notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notifications.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/Notifications/Notifications.tsx"],"sourcesContent":["import { Icon, useTheme, Text, Callout, PrimaryButton, DefaultButton, Link, ICommandBar, ThemeProvider, ICommandBarItemProps } from \"@fluentui/react\"\nimport { getNotificationStyles } from \"./styles\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { IAddControlNotificationOptions, IColumn, IControlNotificationAction, ICustomColumnFormatting } from \"@talxis/client-libraries\";\nimport { CommandBar, useResizeObserver, useThemeGenerator } from \"@talxis/react-components\";\nimport { useGridInstance } from \"../../../hooks/useGridInstance\";\nimport { useControlTheme } from \"../../../../../../utils\";\n\ninterface INotifications {\n notifications: IAddControlNotificationOptions[],\n formatting: Required<ICustomColumnFormatting>,\n isActionColumn: boolean;\n columnAlignment: IColumn['alignment'],\n farItems?: ICommandBarItemProps[]\n}\n\n\nexport const Notifications = (props: INotifications) => {\n const { notifications, formatting, farItems, isActionColumn, columnAlignment } = { ...props };\n const grid = useGridInstance();\n const theme = useTheme();\n const styles = getNotificationStyles(isActionColumn, columnAlignment);\n const iconId = useMemo(() => `icon${crypto.randomUUID()}`, []);\n const [selectedNotification, setSelectedNotification] = useState<IAddControlNotificationOptions | null>(null);\n const commandBarRef = useRef<ICommandBar>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const observe = useResizeObserver(() => {\n commandBarRef.current?.remeasure();\n })\n const overridenTheme = useThemeGenerator(theme.semanticColors.bodyText, theme.semanticColors.bodyBackground, theme.semanticColors.bodyText, formatting.themeOverride);\n\n const renderActionButton = (action: IControlNotificationAction, buttonType: 'primary' | 'default') => {\n const Button = buttonType === 'primary' ? PrimaryButton : DefaultButton;\n return <Button\n text={action.message}\n iconProps={action?.iconName ? {\n iconName: action.iconName\n } : undefined}\n onClick={() => action.actions.map(callback => callback())} />\n }\n\n const renderActions = (actions: IControlNotificationAction[]): JSX.Element => {\n if (actions.length === 0) {\n return <></>\n }\n //render actions as buttons\n if (actions.length < 3) {\n return <div className={styles.calloutButtons}>\n {actions.map((action, i) => renderActionButton(action, i === 0 ? 'primary' : 'default'))}\n </div>\n }\n return <CommandBar items={actions.map((action, i) => {\n return {\n key: i.toString(),\n text: action.message,\n commandBarButtonAs: () => <Link onClick={() => action.actions.map(callback => callback())} className={styles.calloutLink}>\n {action.iconName &&\n <Icon iconName={action.iconName} />\n }\n {action.message}\n </Link>,\n iconProps: {\n iconName: action.iconName\n },\n onClick: () => {\n action.actions.map(callback => callback())\n }\n }\n })} />\n }\n\n const onNotificationClick = (notification: IAddControlNotificationOptions) => {\n if (notification.actions?.length === 1) {\n notification.actions[0].actions.map(callback => callback());\n return;\n }\n setSelectedNotification(notification);\n };\n\n\n const getCommandBarItems = (): { items: ICommandBarItemProps[], overflowItems: ICommandBarItemProps[] } => {\n const items: ICommandBarItemProps[] = [];\n const overflowItems: ICommandBarItemProps[] = [];\n\n notifications.map(notification => {\n const item: ICommandBarItemProps = {\n key: notification.uniqueId,\n text: notification.text,\n tooltipHostProps: {\n ...notification.buttonProps?.tooltipHostProps,\n calloutProps: {\n theme: contextualMenuTheme\n },\n tooltipProps: {\n theme: contextualMenuTheme\n },\n },\n iconProps: notification.iconName ? {\n iconName: notification.iconName,\n ...notification.buttonProps?.iconProps\n } : undefined,\n ...notification.buttonProps,\n onClick: (e) => {\n notification.buttonProps?.onClick?.(e);\n onNotificationClick(notification);\n }\n }\n if (notification.buttonProps?.renderedInOverflow) {\n overflowItems.push(item);\n }\n else {\n items.push(item);\n }\n })\n return {\n items: items,\n overflowItems: overflowItems\n }\n }\n\n const contextualMenuTheme = useControlTheme(grid.pcfContext.fluentDesignLanguage);\n const { items, overflowItems } = getCommandBarItems();\n\n useEffect(() => {\n if (isActionColumn) {\n observe(containerRef.current!);\n }\n }, [isActionColumn]);\n\n\n return <div ref={containerRef} className={styles.notificationsRoot}>\n <ThemeProvider theme={overridenTheme}>\n <CommandBar\n contextualMenuTheme={contextualMenuTheme}\n id={iconId}\n componentRef={commandBarRef}\n styles={{\n primarySet: styles.notificationsPrimarySet\n }}\n items={items}\n overflowItems={overflowItems}\n farItems={farItems} />\n </ThemeProvider>\n {selectedNotification &&\n <Callout\n theme={contextualMenuTheme}\n hidden={!selectedNotification}\n className={styles.callout}\n onDismiss={() => setSelectedNotification(null)}\n target={`#${iconId}`}>\n <ThemeProvider className={styles.calloutContent} theme={contextualMenuTheme}>\n {selectedNotification.text &&\n <Text title={selectedNotification.text} className={styles.calloutTitle} variant={selectedNotification.messages.length > 0 ? 'xLarge' : undefined}>{selectedNotification.text}</Text>\n }\n <Text>{selectedNotification.messages[0]}</Text>\n {selectedNotification.actions &&\n renderActions(selectedNotification.actions)\n }\n </ThemeProvider>\n </Callout>\n }\n </div>\n}"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAiBa,MAAA,aAAa,GAAG,CAAC,KAAqB,KAAI;AACnD,IAAA,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;AAC9F,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;AAC/B,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AACtE,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA,IAAA,EAAO,MAAM,CAAC,UAAU,EAAE,CAAA,CAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAwC,IAAI,CAAC,CAAC;AAC9G,IAAA,MAAM,aAAa,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;AAChD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAElD,IAAA,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAK;AACnC,QAAA,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;AACvC,KAAC,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,C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
|
|
2
|
+
export declare const getNotificationStyles: (isActionColumn: boolean, columnAlignment: Required<IColumn['alignment']>) => import("@fluentui/react").IProcessedStyleSet<{
|
|
3
|
+
callout: {
|
|
4
|
+
width: number;
|
|
5
|
+
padding: string;
|
|
6
|
+
};
|
|
7
|
+
calloutContent: {
|
|
8
|
+
display: string;
|
|
9
|
+
flexDirection: string;
|
|
10
|
+
gap: number;
|
|
11
|
+
'.ms-CommandBar-primaryCommand': {
|
|
12
|
+
gap: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
calloutTitle: {
|
|
16
|
+
overflow: string;
|
|
17
|
+
textOverflow: string;
|
|
18
|
+
};
|
|
19
|
+
calloutLink: {
|
|
20
|
+
i: {
|
|
21
|
+
position: string;
|
|
22
|
+
top: number;
|
|
23
|
+
marginRight: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
calloutButtons: {
|
|
27
|
+
display: string;
|
|
28
|
+
justifyContent: string;
|
|
29
|
+
gap: number;
|
|
30
|
+
};
|
|
31
|
+
notificationsRoot: {
|
|
32
|
+
minWidth: number | undefined;
|
|
33
|
+
flex: number | undefined;
|
|
34
|
+
};
|
|
35
|
+
notificationsPrimarySet: {
|
|
36
|
+
order: number;
|
|
37
|
+
justifyContent: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
+
import { getJustifyContent } from '../styles.js';
|
|
3
|
+
|
|
4
|
+
const getNotificationStyles = (isActionColumn, columnAlignment) => {
|
|
5
|
+
return mergeStyleSets({
|
|
6
|
+
callout: {
|
|
7
|
+
width: 320,
|
|
8
|
+
padding: '20px 24px',
|
|
9
|
+
},
|
|
10
|
+
calloutContent: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
gap: 20,
|
|
14
|
+
'.ms-CommandBar-primaryCommand': {
|
|
15
|
+
gap: 10
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
calloutTitle: {
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
textOverflow: 'ellipsis'
|
|
21
|
+
},
|
|
22
|
+
calloutLink: {
|
|
23
|
+
'i': {
|
|
24
|
+
position: 'relative',
|
|
25
|
+
top: 1,
|
|
26
|
+
marginRight: 3
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
calloutButtons: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'flex-end',
|
|
32
|
+
gap: 8
|
|
33
|
+
},
|
|
34
|
+
notificationsRoot: {
|
|
35
|
+
minWidth: isActionColumn ? 0 : undefined,
|
|
36
|
+
flex: isActionColumn ? 1 : undefined,
|
|
37
|
+
},
|
|
38
|
+
notificationsPrimarySet: {
|
|
39
|
+
order: 2,
|
|
40
|
+
justifyContent: isActionColumn ? getJustifyContent(columnAlignment) : undefined
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { getNotificationStyles };
|
|
46
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/Notifications/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\nimport { IColumn } from \"@talxis/client-libraries\"\nimport { getJustifyContent } from \"../styles\"\n\nexport const getNotificationStyles = (isActionColumn: boolean, columnAlignment: Required<IColumn['alignment']>) => {\n return mergeStyleSets({\n callout: {\n width: 320,\n padding: '20px 24px',\n },\n calloutContent: {\n display: 'flex',\n flexDirection: 'column',\n gap: 20,\n '.ms-CommandBar-primaryCommand': {\n gap: 10\n }\n },\n calloutTitle: {\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n },\n calloutLink: {\n 'i': {\n position: 'relative',\n top: 1,\n marginRight: 3\n }\n },\n calloutButtons: {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8\n },\n notificationsRoot: {\n minWidth: isActionColumn ? 0 : undefined,\n flex: isActionColumn ? 1 : undefined,\n },\n notificationsPrimarySet: {\n order: 2,\n justifyContent: isActionColumn ? getJustifyContent(columnAlignment) : undefined\n }\n })\n}"],"names":[],"mappings":";;;MAIa,qBAAqB,GAAG,CAAC,cAAuB,EAAE,eAA+C,KAAI;AAC9G,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,OAAO,EAAE;AACL,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,OAAO,EAAE,WAAW;AACvB,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,+BAA+B,EAAE;AAC7B,gBAAA,GAAG,EAAE,EAAE;AACV,aAAA;AACJ,SAAA;AACD,QAAA,YAAY,EAAE;AACV,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AAC3B,SAAA;AACD,QAAA,WAAW,EAAE;AACT,YAAA,GAAG,EAAE;AACD,gBAAA,QAAQ,EAAE,UAAU;AACpB,gBAAA,GAAG,EAAE,CAAC;AACN,gBAAA,WAAW,EAAE,CAAC;AACjB,aAAA;AACJ,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,cAAc,EAAE,UAAU;AAC1B,YAAA,GAAG,EAAE,CAAC;AACT,SAAA;AACD,QAAA,iBAAiB,EAAE;YACf,QAAQ,EAAE,cAAc,GAAG,CAAC,GAAG,SAAS;YACxC,IAAI,EAAE,cAAc,GAAG,CAAC,GAAG,SAAS;AACvC,SAAA;AACD,QAAA,uBAAuB,EAAE;AACrB,YAAA,KAAK,EAAE,CAAC;AACR,YAAA,cAAc,EAAE,cAAc,GAAG,iBAAiB,CAAC,eAAe,CAAC,GAAG,SAAS;AAClF,SAAA;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ITheme } from "@fluentui/react";
|
|
2
|
+
import { IColumn } from "@talxis/client-libraries";
|
|
3
|
+
export declare const getJustifyContent: (columnAlignment: Required<IColumn['alignment']>) => "center" | "flex-start" | "flex-end" | undefined;
|
|
4
|
+
export declare const getCellStyles: () => import("@fluentui/react").IProcessedStyleSet<{
|
|
5
|
+
cellRoot: {
|
|
6
|
+
height: string;
|
|
7
|
+
width: string;
|
|
8
|
+
display: string;
|
|
9
|
+
alignItems: string;
|
|
10
|
+
justifyContent: string;
|
|
11
|
+
};
|
|
12
|
+
checkbox: {
|
|
13
|
+
marginRight: number;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
export declare const getInnerCellStyles: (isEditing: boolean, theme: ITheme, columnAlignment: IColumn['alignment']) => import("@fluentui/react").IProcessedStyleSet<{
|
|
17
|
+
innerCellRoot: {
|
|
18
|
+
flex: number;
|
|
19
|
+
display: string;
|
|
20
|
+
overflow: string;
|
|
21
|
+
alignItems: string;
|
|
22
|
+
height: string;
|
|
23
|
+
marginLeft: number | undefined;
|
|
24
|
+
marginRight: number | undefined;
|
|
25
|
+
};
|
|
26
|
+
shimmerWrapper: {
|
|
27
|
+
height: number;
|
|
28
|
+
};
|
|
29
|
+
shimmerRoot: {
|
|
30
|
+
width: string;
|
|
31
|
+
paddingLeft: number;
|
|
32
|
+
paddingRight: number;
|
|
33
|
+
};
|
|
34
|
+
errorIconRoot: {
|
|
35
|
+
color: string;
|
|
36
|
+
};
|
|
37
|
+
uneditableIconRoot: {
|
|
38
|
+
color: string;
|
|
39
|
+
};
|
|
40
|
+
}>;
|