@talxis/base-controls 1.2502.1 → 1.2503.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +229 -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 +118 -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 +22 -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 +16 -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 +36 -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 +17 -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 +23 -0
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -0
- package/dist/components/NestedControlRenderer/properties/Property.d.ts +16 -0
- package/dist/components/NestedControlRenderer/properties/Property.js +41 -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 +452 -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
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
-
|
|
3
|
-
const getNotificationIconStyles = (theme) => {
|
|
4
|
-
return mergeStyleSets({
|
|
5
|
-
callout: {
|
|
6
|
-
width: 320,
|
|
7
|
-
padding: '20px 24px',
|
|
8
|
-
'.ms-Callout-main': {
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
gap: 20,
|
|
12
|
-
'.ms-CommandBar-primaryCommand': {
|
|
13
|
-
gap: 10
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
calloutTitle: {
|
|
18
|
-
overflow: 'hidden',
|
|
19
|
-
textOverflow: 'ellipsis'
|
|
20
|
-
},
|
|
21
|
-
link: {
|
|
22
|
-
'i': {
|
|
23
|
-
position: 'relative',
|
|
24
|
-
top: 1,
|
|
25
|
-
marginRight: 3
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
buttons: {
|
|
29
|
-
display: 'flex',
|
|
30
|
-
justifyContent: 'flex-end',
|
|
31
|
-
gap: 8
|
|
32
|
-
},
|
|
33
|
-
root: {
|
|
34
|
-
'.ms-CommandBar-primaryCommand': {
|
|
35
|
-
justifyContent: 'flex-end'
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { getNotificationIconStyles };
|
|
42
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../../src/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.ts"],"sourcesContent":["import { ITheme, mergeStyleSets } from \"@fluentui/react\"\n\nexport const getNotificationIconStyles = (theme: ITheme) => {\n return mergeStyleSets({\n callout: {\n width: 320,\n padding: '20px 24px',\n '.ms-Callout-main': {\n display: 'flex',\n flexDirection: 'column',\n gap: 20,\n '.ms-CommandBar-primaryCommand': {\n gap: 10\n }\n }\n },\n calloutTitle: {\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n },\n link: {\n 'i': {\n position: 'relative',\n top: 1,\n marginRight: 3\n }\n },\n buttons: {\n display: 'flex',\n justifyContent: 'flex-end',\n gap: 8\n },\n root: {\n '.ms-CommandBar-primaryCommand': {\n justifyContent: 'flex-end'\n }\n }\n })\n}"],"names":[],"mappings":";;AAEa,MAAA,yBAAyB,GAAG,CAAC,KAAa,KAAI;AACvD,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,OAAO,EAAE;AACL,YAAA,KAAK,EAAE,GAAG;AACV,YAAA,OAAO,EAAE,WAAW;AACpB,YAAA,kBAAkB,EAAE;AAChB,gBAAA,OAAO,EAAE,MAAM;AACf,gBAAA,aAAa,EAAE,QAAQ;AACvB,gBAAA,GAAG,EAAE,EAAE;AACP,gBAAA,+BAA+B,EAAE;AAC7B,oBAAA,GAAG,EAAE,EAAE;AACV,iBAAA;AACJ,aAAA;AACJ,SAAA;AACD,QAAA,YAAY,EAAE;AACV,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AAC3B,SAAA;AACD,QAAA,IAAI,EAAE;AACF,YAAA,GAAG,EAAE;AACD,gBAAA,QAAQ,EAAE,UAAU;AACpB,gBAAA,GAAG,EAAE,CAAC;AACN,gBAAA,WAAW,EAAE,CAAC;AACjB,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,EAAE;AACL,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,cAAc,EAAE,UAAU;AAC1B,YAAA,GAAG,EAAE,CAAC;AACT,SAAA;AACD,QAAA,IAAI,EAAE;AACF,YAAA,+BAA+B,EAAE;AAC7B,gBAAA,cAAc,EAAE,UAAU;AAC7B,aAAA;AACJ,SAAA;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IRecord } from '@talxis/client-libraries';
|
|
3
|
-
import { IGridColumn } from '../../../interfaces/IGridColumn';
|
|
4
|
-
import { ICellRendererParams } from '@ag-grid-community/core';
|
|
5
|
-
interface ICellProps extends ICellRendererParams {
|
|
6
|
-
baseColumn: IGridColumn;
|
|
7
|
-
data: IRecord;
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
}
|
|
10
|
-
export declare const ReadOnlyCell: (props: ICellProps) => JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTheme, Checkbox, Shimmer, Image, Icon, Link, Text } from '@fluentui/react';
|
|
4
|
-
import { getReadOnlyCellStyles, getMultilineStyle } from './styles.js';
|
|
5
|
-
import { Commands } from '../Commands/Commands.js';
|
|
6
|
-
import { Constants, DataTypes, FileAttribute } from '@talxis/client-libraries';
|
|
7
|
-
import { ReadOnlyOptionSet } from './ReadOnlyOptionSet/ReadOnlyOptionSet.js';
|
|
8
|
-
import { DataType } from '../../../enums/DataType.js';
|
|
9
|
-
import { useGridInstance } from '../../../hooks/useGridInstance.js';
|
|
10
|
-
import { useSelectionController } from '../../../../selection/controllers/useSelectionController.js';
|
|
11
|
-
import { CHECKBOX_COLUMN_KEY } from '../../../../constants.js';
|
|
12
|
-
import { Notifications } from './Notifications/Notifications.js';
|
|
13
|
-
import { useDebouncedCallback } from 'use-debounce';
|
|
14
|
-
|
|
15
|
-
const ReadOnlyCell = (props) => {
|
|
16
|
-
const selection = useSelectionController();
|
|
17
|
-
const column = props.baseColumn;
|
|
18
|
-
const record = props.data;
|
|
19
|
-
const theme = useTheme();
|
|
20
|
-
const styles = React.useMemo(() => getReadOnlyCellStyles(theme), [theme]);
|
|
21
|
-
if (column.name === CHECKBOX_COLUMN_KEY) {
|
|
22
|
-
return jsx("div", { className: styles.cellContent, children: jsx(Checkbox, { checked: props.node.isSelected(), onChange: (e, checked) => {
|
|
23
|
-
e?.stopPropagation();
|
|
24
|
-
selection.toggle(record, checked);
|
|
25
|
-
} }) });
|
|
26
|
-
}
|
|
27
|
-
const MemoizedNotifications = React.useMemo(() => {
|
|
28
|
-
return React.memo(Notifications, (prevProps, nextProps) => {
|
|
29
|
-
const previousIds = prevProps.notifications.map(x => x.uniqueId).join(';');
|
|
30
|
-
const nextIds = nextProps.notifications.map(x => x.uniqueId).join(';');
|
|
31
|
-
if (previousIds !== nextIds) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
});
|
|
36
|
-
}, []);
|
|
37
|
-
const grid = useGridInstance();
|
|
38
|
-
const notifications = record.ui.getNotifications?.(column.name);
|
|
39
|
-
const notificationRef = React.useRef(null);
|
|
40
|
-
//TODO: only do this if editable
|
|
41
|
-
const validation = record.getColumnInfo(column.name);
|
|
42
|
-
const debounceNotificationRemeasure = useDebouncedCallback(() => {
|
|
43
|
-
if (notifications && notifications.length > 0) {
|
|
44
|
-
notificationRef.current?.remeasureCommandBar();
|
|
45
|
-
}
|
|
46
|
-
}, 10);
|
|
47
|
-
debounceNotificationRemeasure();
|
|
48
|
-
const shouldShowNotEditableNotification = () => {
|
|
49
|
-
if (column.isEditable && !record.getColumnInfo(column.name).security.editable) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
};
|
|
54
|
-
const calculateNotificationsWrapperMinWidth = () => {
|
|
55
|
-
let count = 0;
|
|
56
|
-
if (notifications && notifications.length > 0) {
|
|
57
|
-
count++;
|
|
58
|
-
}
|
|
59
|
-
if (validation?.error === true) {
|
|
60
|
-
count++;
|
|
61
|
-
}
|
|
62
|
-
if (shouldShowNotEditableNotification()) {
|
|
63
|
-
count++;
|
|
64
|
-
}
|
|
65
|
-
return count * 40;
|
|
66
|
-
};
|
|
67
|
-
const shouldRenderNotificationsWrapper = () => {
|
|
68
|
-
if (validation?.error === true) {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
if (shouldShowNotEditableNotification()) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (notifications && notifications.length > 0) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
};
|
|
79
|
-
React.useEffect(() => {
|
|
80
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
81
|
-
debounceNotificationRemeasure();
|
|
82
|
-
});
|
|
83
|
-
resizeObserver.observe(props.eGridCell);
|
|
84
|
-
}, []);
|
|
85
|
-
if (record.ui?.isLoading(column.name)) {
|
|
86
|
-
return jsx(Shimmer, { className: styles.loading });
|
|
87
|
-
}
|
|
88
|
-
if (column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {
|
|
89
|
-
return jsx("div", { className: styles.cellContent, children: jsx(Commands, { record: record }) });
|
|
90
|
-
}
|
|
91
|
-
return (jsxs("div", { style: {
|
|
92
|
-
'--test': `${calculateNotificationsWrapperMinWidth()}px`
|
|
93
|
-
}, className: styles.root, "data-is-valid": !validation || validation.error === false, children: [jsx("div", { className: styles.cellContentWrapper, children: jsx("div", { className: styles.cellContent, children: jsx(InternalReadOnlyCell, { ...props }) }) }), shouldRenderNotificationsWrapper() &&
|
|
94
|
-
jsxs("div", { className: styles.notificationsWrapper, children: [notifications && notifications.length > 0 &&
|
|
95
|
-
jsx(MemoizedNotifications, { className: styles.notifications, ref: notificationRef, notifications: notifications }), validation?.error === true &&
|
|
96
|
-
jsx(MemoizedNotifications, { notifications: [
|
|
97
|
-
{
|
|
98
|
-
notificationLevel: 'ERROR',
|
|
99
|
-
messages: [],
|
|
100
|
-
iconName: 'Error',
|
|
101
|
-
uniqueId: column.name,
|
|
102
|
-
title: validation.errorMessage,
|
|
103
|
-
compact: true
|
|
104
|
-
}
|
|
105
|
-
] }), shouldShowNotEditableNotification() &&
|
|
106
|
-
jsx(MemoizedNotifications, { className: styles.uneditableNotification, notifications: [{
|
|
107
|
-
iconName: 'Uneditable',
|
|
108
|
-
notificationLevel: 'RECOMMENDATION',
|
|
109
|
-
uniqueId: column.name,
|
|
110
|
-
title: grid.labels['value-not-editable'](),
|
|
111
|
-
compact: true,
|
|
112
|
-
messages: []
|
|
113
|
-
}] })] })] }));
|
|
114
|
-
};
|
|
115
|
-
const InternalReadOnlyCell = (props) => {
|
|
116
|
-
const grid = useGridInstance();
|
|
117
|
-
const column = props.baseColumn;
|
|
118
|
-
const theme = useTheme();
|
|
119
|
-
const styles = getReadOnlyCellStyles(theme);
|
|
120
|
-
const record = props.data;
|
|
121
|
-
const formattedValue = record.getFormattedValue(column.name);
|
|
122
|
-
const renderLink = (props, formattedValue) => {
|
|
123
|
-
switch (column.dataType) {
|
|
124
|
-
case DataType.LOOKUP_OWNER:
|
|
125
|
-
case DataType.LOOKUP_SIMPLE:
|
|
126
|
-
case DataType.LOOKUP_CUSTOMER: {
|
|
127
|
-
if (!grid.isNavigationEnabled) {
|
|
128
|
-
return renderText();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (!formattedValue) {
|
|
133
|
-
return jsx(Fragment, {});
|
|
134
|
-
}
|
|
135
|
-
let className = styles.link;
|
|
136
|
-
switch (column.dataType) {
|
|
137
|
-
case DataTypes.Multiple:
|
|
138
|
-
case DataTypes.SingleLineTextArea: {
|
|
139
|
-
className += ` ${getMultilineStyle(props.node.rowHeight)}`;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return (jsx(Link, { ...props, className: className, title: formattedValue, children: formattedValue }));
|
|
143
|
-
};
|
|
144
|
-
const renderText = () => {
|
|
145
|
-
if (column.isPrimary && grid.isNavigationEnabled) {
|
|
146
|
-
return renderLink({
|
|
147
|
-
onClick: () => grid.openDatasetItem(record.getNamedReference())
|
|
148
|
-
}, formattedValue);
|
|
149
|
-
}
|
|
150
|
-
let className = `${styles.text} talxis-cell-text`;
|
|
151
|
-
switch (column.dataType) {
|
|
152
|
-
case DataTypes.Multiple:
|
|
153
|
-
case DataTypes.SingleLineTextArea: {
|
|
154
|
-
className += ` ${getMultilineStyle(props.node.rowHeight)}`;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return jsx(Text, { className: className, title: formattedValue, children: formattedValue });
|
|
158
|
-
};
|
|
159
|
-
const downloadFile = () => {
|
|
160
|
-
const storage = new FileAttribute(grid.pcfContext.webAPI);
|
|
161
|
-
const namedReference = record.getNamedReference();
|
|
162
|
-
storage.downloadFileFromAttribute({
|
|
163
|
-
//@ts-ignore - PowerApps do not follow the typings
|
|
164
|
-
entityName: namedReference.etn ?? namedReference.entityName,
|
|
165
|
-
recordId: record.getRecordId(),
|
|
166
|
-
fileAttribute: column.name,
|
|
167
|
-
}, true);
|
|
168
|
-
};
|
|
169
|
-
switch (column.dataType) {
|
|
170
|
-
case DataType.SINGLE_LINE_EMAIL: {
|
|
171
|
-
return renderLink({ href: `mailto:${formattedValue}` }, formattedValue);
|
|
172
|
-
}
|
|
173
|
-
case DataType.SINGLE_LINE_PHONE: {
|
|
174
|
-
return renderLink({ href: `tel:${formattedValue}` }, formattedValue);
|
|
175
|
-
}
|
|
176
|
-
case DataType.SINGLE_LINE_URL: {
|
|
177
|
-
return renderLink({
|
|
178
|
-
href: formattedValue ?? "",
|
|
179
|
-
target: '_blank',
|
|
180
|
-
rel: 'noopener noreferrer'
|
|
181
|
-
}, formattedValue);
|
|
182
|
-
}
|
|
183
|
-
case DataType.LOOKUP_SIMPLE:
|
|
184
|
-
case DataType.LOOKUP_OWNER:
|
|
185
|
-
case DataType.LOOKUP_CUSTOMER: {
|
|
186
|
-
return renderLink({
|
|
187
|
-
onClick: () => grid.openDatasetItem(record.getValue(column.name)[0])
|
|
188
|
-
}, formattedValue);
|
|
189
|
-
}
|
|
190
|
-
case DataType.FILE: {
|
|
191
|
-
if (!formattedValue) {
|
|
192
|
-
return jsx(Fragment, {});
|
|
193
|
-
}
|
|
194
|
-
return (jsxs("div", { className: styles.fileWrapper, children: [jsx(Icon, { iconName: 'Attach' }), renderLink({
|
|
195
|
-
onClick: downloadFile
|
|
196
|
-
}, grid.labels.download())] }));
|
|
197
|
-
}
|
|
198
|
-
case DataType.IMAGE: {
|
|
199
|
-
if (!formattedValue) {
|
|
200
|
-
return jsx(Fragment, {});
|
|
201
|
-
}
|
|
202
|
-
return (jsxs("div", { className: styles.fileWrapper, children: [jsx(Image, { className: styles.image, src: `data:image/png;base64,${formattedValue}` }), renderLink({
|
|
203
|
-
onClick: downloadFile
|
|
204
|
-
}, 'Download')] }));
|
|
205
|
-
}
|
|
206
|
-
case DataType.OPTIONSET:
|
|
207
|
-
case DataType.MULTI_SELECT_OPTIONSET:
|
|
208
|
-
case DataType.TWO_OPTIONS: {
|
|
209
|
-
if (grid.enableOptionSetColors) {
|
|
210
|
-
return jsx(ReadOnlyOptionSet, { column: column, record: record, defaultRender: renderText });
|
|
211
|
-
}
|
|
212
|
-
return renderText();
|
|
213
|
-
}
|
|
214
|
-
default: {
|
|
215
|
-
return renderText();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
export { ReadOnlyCell };
|
|
221
|
-
//# sourceMappingURL=ReadOnlyCell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyCell.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ILinkProps, Shimmer } from '@fluentui/react';\nimport { Link } from '@fluentui/react';\nimport { Text } from '@fluentui/react';\nimport { getMultilineStyle, getReadOnlyCellStyles } from './styles';\nimport { Commands } from '../Commands/Commands';\nimport { Checkbox, Icon, useTheme, Image } from '@fluentui/react';\nimport { Constants, DataTypes, FileAttribute, IRecord } from '@talxis/client-libraries';\nimport { ReadOnlyOptionSet } from './ReadOnlyOptionSet/ReadOnlyOptionSet';\nimport { IGridColumn } from '../../../interfaces/IGridColumn';\nimport { DataType } from '../../../enums/DataType';\nimport { useGridInstance } from '../../../hooks/useGridInstance';\nimport { useSelectionController } from '../../../../selection/controllers/useSelectionController';\nimport { ICellRendererParams } from '@ag-grid-community/core';\nimport { CHECKBOX_COLUMN_KEY } from '../../../../constants';\nimport { INotificationsRef, Notifications } from './Notifications/Notifications';\nimport { useDebouncedCallback } from 'use-debounce';\n\ninterface ICellProps extends ICellRendererParams {\n baseColumn: IGridColumn;\n data: IRecord;\n [key: string]: any;\n}\n\nexport const ReadOnlyCell = (props: ICellProps) => {\n const selection = useSelectionController();\n const column = props.baseColumn;\n const record = props.data;\n const theme = useTheme();\n const styles = React.useMemo(() => getReadOnlyCellStyles(theme), [theme]);\n\n if(column.name === CHECKBOX_COLUMN_KEY) {\n return <div className={styles.cellContent}>\n <Checkbox\n checked={props.node.isSelected()}\n onChange={(e, checked) => {\n e?.stopPropagation()\n selection.toggle(record, checked!)\n }} />\n </div>\n }\n const MemoizedNotifications = React.useMemo(() => {\n return React.memo(Notifications, (prevProps, nextProps) => {\n const previousIds = prevProps.notifications.map(x => x.uniqueId).join(';');\n const nextIds = nextProps.notifications.map(x => x.uniqueId).join(';');\n if (previousIds !== nextIds) {\n return false;\n }\n return true;\n });\n }, []);\n \n const grid = useGridInstance();\n const notifications = record.ui.getNotifications?.(column.name);\n const notificationRef = React.useRef<INotificationsRef>(null);\n //TODO: only do this if editable\n const validation = record.getColumnInfo(column.name);\n\n const debounceNotificationRemeasure = useDebouncedCallback(() => {\n if (notifications && notifications.length > 0) {\n notificationRef.current?.remeasureCommandBar();\n }\n }, 10)\n\n debounceNotificationRemeasure();\n\n const shouldShowNotEditableNotification = (): boolean => {\n if (column.isEditable && !record.getColumnInfo(column.name).security.editable) {\n return true;\n }\n return false;\n }\n\n const calculateNotificationsWrapperMinWidth = (): number => {\n let count = 0;\n if (notifications && notifications.length > 0) {\n count++\n }\n if (validation?.error === true) {\n count++;\n }\n if (shouldShowNotEditableNotification()) {\n count++;\n }\n return count * 40;\n }\n\n const shouldRenderNotificationsWrapper = (): boolean => {\n if (validation?.error === true) {\n return true;\n }\n if (shouldShowNotEditableNotification()) {\n return true;\n }\n if (notifications && notifications.length > 0) {\n return true;\n }\n return false;\n }\n\n React.useEffect(() => {\n const resizeObserver = new ResizeObserver(() => {\n debounceNotificationRemeasure();\n })\n resizeObserver.observe(props.eGridCell);\n }, []);\n\n\n if (record.ui?.isLoading(column.name)) {\n return <Shimmer className={styles.loading} />\n }\n if(column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME) {\n return <div className={styles.cellContent}>\n <Commands record={record} />\n </div>\n }\n return (\n <div style={{\n '--test': `${calculateNotificationsWrapperMinWidth()}px`\n } as React.CSSProperties} className={styles.root} data-is-valid={!validation || validation.error === false}>\n <div className={styles.cellContentWrapper}>\n <div className={styles.cellContent}>\n <InternalReadOnlyCell {...props} />\n </div>\n </div>\n {shouldRenderNotificationsWrapper() &&\n <div className={styles.notificationsWrapper}>\n {notifications && notifications.length > 0 &&\n <MemoizedNotifications className={styles.notifications} ref={notificationRef} notifications={notifications} />\n }\n {validation?.error === true &&\n <MemoizedNotifications notifications={[\n {\n notificationLevel: 'ERROR',\n messages: [],\n iconName: 'Error',\n uniqueId: column.name,\n title: validation.errorMessage,\n compact: true\n }\n ]} />\n }\n {\n shouldShowNotEditableNotification() &&\n <MemoizedNotifications className={styles.uneditableNotification} notifications={[{\n iconName: 'Uneditable',\n notificationLevel: 'RECOMMENDATION',\n uniqueId: column.name,\n title: grid.labels['value-not-editable'](),\n compact: true,\n messages: []\n }]} />\n }\n </div>\n }\n </div>\n )\n};\n\nconst InternalReadOnlyCell = (props: ICellProps) => {\n const grid = useGridInstance();\n const column = props.baseColumn;\n const theme = useTheme();\n const styles = getReadOnlyCellStyles(theme);\n const record = props.data;\n const formattedValue = record.getFormattedValue(column.name);\n\n const renderLink = (props: ILinkProps, formattedValue: string | null): JSX.Element => {\n switch (column.dataType) {\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_CUSTOMER: {\n if (!grid.isNavigationEnabled) {\n return renderText();\n }\n }\n }\n if (!formattedValue) {\n return <></>\n }\n let className = styles.link;\n switch(column.dataType) {\n case DataTypes.Multiple:\n case DataTypes.SingleLineTextArea: {\n className += ` ${getMultilineStyle(props.node.rowHeight!)}`\n }\n }\n return (\n <Link {...props} className={className} title={formattedValue}>\n {formattedValue}\n </Link>\n );\n };\n const renderText = (): JSX.Element => {\n if (column.isPrimary && grid.isNavigationEnabled) {\n return renderLink({\n onClick: () => grid.openDatasetItem(record.getNamedReference())\n }, formattedValue);\n }\n let className = `${styles.text} talxis-cell-text`\n switch(column.dataType) {\n case DataTypes.Multiple:\n case DataTypes.SingleLineTextArea: {\n className += ` ${getMultilineStyle(props.node.rowHeight!)}`\n }\n }\n return <Text className={className} title={formattedValue!}>{formattedValue}</Text>\n }\n const downloadFile = () => {\n const storage = new FileAttribute(grid.pcfContext.webAPI);\n const namedReference = record.getNamedReference();\n storage.downloadFileFromAttribute({\n //@ts-ignore - PowerApps do not follow the typings\n entityName: namedReference.etn ?? namedReference.entityName,\n recordId: record.getRecordId(),\n fileAttribute: column.name,\n }, true)\n }\n\n switch (column.dataType) {\n case DataType.SINGLE_LINE_EMAIL: {\n return renderLink({ href: `mailto:${formattedValue}` }, formattedValue);\n }\n case DataType.SINGLE_LINE_PHONE: {\n return renderLink({ href: `tel:${formattedValue}` }, formattedValue);\n }\n case DataType.SINGLE_LINE_URL: {\n return renderLink({\n href: formattedValue ?? \"\",\n target: '_blank',\n rel: 'noopener noreferrer'\n }, formattedValue);\n }\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_CUSTOMER: {\n return renderLink({\n onClick: () => grid.openDatasetItem(record.getValue(column.name)[0])\n }, formattedValue);\n }\n case DataType.FILE: {\n if (!formattedValue) {\n return <></>\n }\n return (\n <div className={styles.fileWrapper}>\n <Icon iconName='Attach' />\n {\n renderLink({\n onClick: downloadFile\n }, grid.labels.download())\n }\n </div>\n )\n }\n case DataType.IMAGE: {\n if (!formattedValue) {\n return <></>\n }\n return (\n <div className={styles.fileWrapper}>\n <Image className={styles.image} src={`data:image/png;base64,${formattedValue}`} />\n {\n renderLink({\n onClick: downloadFile\n }, 'Download')\n }\n </div>\n )\n }\n case DataType.OPTIONSET:\n case DataType.MULTI_SELECT_OPTIONSET:\n case DataType.TWO_OPTIONS: {\n if (grid.enableOptionSetColors) {\n return <ReadOnlyOptionSet\n column={column}\n record={record}\n defaultRender={renderText} />\n }\n return renderText();\n }\n default: {\n return renderText()\n }\n\n }\n}"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAwBa,MAAA,YAAY,GAAG,CAAC,KAAiB,KAAI;A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D,GAAC,CAAA,IAAI,IAAC,QAAQ,EAAC,QAAQ,EAAG,CAAA,EAEtB,UAAU,CAAC;AACP,wBAAA,OAAO,EAAE,YAAY;qBACxB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAE5B,EAAA,CAAA,EACT;AACJ,SAAA;AACD,QAAA,KAAK,QAAQ,CAAC,KAAK,EAAE;YACjB,IAAI,CAAC,cAAc,EAAE;AACjB,gBAAA,OAAOA,iBAAK,CAAA;AACf,aAAA;YACD,QACIC,IAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,WAAW,EAAA,QAAA,EAAA,CAC9BD,GAAC,CAAA,KAAK,EAAC,EAAA,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,CAAyB,sBAAA,EAAA,cAAc,CAAE,CAAA,EAAA,CAAI,EAE9E,UAAU,CAAC;AACP,wBAAA,OAAO,EAAE,YAAY;AACxB,qBAAA,EAAE,UAAU,CAAC,CAEhB,EAAA,CAAA,EACT;AACJ,SAAA;QACD,KAAK,QAAQ,CAAC,SAAS,CAAC;QACxB,KAAK,QAAQ,CAAC,sBAAsB,CAAC;AACrC,QAAA,KAAK,QAAQ,CAAC,WAAW,EAAE;YACvB,IAAI,IAAI,CAAC,qBAAqB,EAAE;AAC5B,gBAAA,OAAOA,GAAC,CAAA,iBAAiB,EACrB,EAAA,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,UAAU,GAAI,CAAA;AACpC,aAAA;YACD,OAAO,UAAU,EAAE,CAAC;AACvB,SAAA;AACD,QAAA,SAAS;YACL,OAAO,UAAU,EAAE,CAAA;AACtB,SAAA;AAEJ,KAAA;AACL,CAAC;;;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
import { IGridColumn } from "../../../../interfaces/IGridColumn";
|
|
3
|
-
import { IRecord } from "@talxis/client-libraries";
|
|
4
|
-
interface IReadOnlyOptionSet {
|
|
5
|
-
column: IGridColumn;
|
|
6
|
-
record: IRecord;
|
|
7
|
-
defaultRender: () => ReactElement;
|
|
8
|
-
}
|
|
9
|
-
export declare const ReadOnlyOptionSet: (props: IReadOnlyOptionSet) => JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { useTheme, Text } from '@fluentui/react';
|
|
4
|
-
import { optionSetStyles } from './styles.js';
|
|
5
|
-
import Color from 'color';
|
|
6
|
-
import { useGridInstance } from '../../../../hooks/useGridInstance.js';
|
|
7
|
-
import { DataType } from '../../../../enums/DataType.js';
|
|
8
|
-
|
|
9
|
-
const ReadOnlyOptionSet = (props) => {
|
|
10
|
-
const grid = useGridInstance();
|
|
11
|
-
const { record, column, defaultRender } = { ...props };
|
|
12
|
-
const [options, setOptions] = useState(null);
|
|
13
|
-
const theme = useTheme();
|
|
14
|
-
const defaultColor = theme.palette.neutralLight;
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
(async () => {
|
|
17
|
-
const getOptions = async () => {
|
|
18
|
-
const [defaultValue, options] = await grid.metadata.getOptions(column.name);
|
|
19
|
-
let value = record.getValue(column.name);
|
|
20
|
-
if (column.dataType === DataType.OPTIONSET) {
|
|
21
|
-
value = value ? [parseInt(value)] : null;
|
|
22
|
-
}
|
|
23
|
-
if (column.dataType === DataType.MULTI_SELECT_OPTIONSET) {
|
|
24
|
-
value = value ? value.split(',').map((value) => parseInt(value)) : null;
|
|
25
|
-
}
|
|
26
|
-
if (column.dataType === DataType.TWO_OPTIONS) {
|
|
27
|
-
value = [parseInt(value)];
|
|
28
|
-
}
|
|
29
|
-
return options.filter(option => value?.includes(option.Value)) ?? [];
|
|
30
|
-
};
|
|
31
|
-
const results = await getOptions();
|
|
32
|
-
setOptions(results);
|
|
33
|
-
})();
|
|
34
|
-
}, [record.getValue(column.name)]);
|
|
35
|
-
//options not loaded yet
|
|
36
|
-
if (options === null) {
|
|
37
|
-
return jsx(Fragment, {});
|
|
38
|
-
}
|
|
39
|
-
//options loaded but either no value selected or no colors are present
|
|
40
|
-
if (options.length === 0 || !options.find(x => x.Color)) {
|
|
41
|
-
return defaultRender();
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return (jsx("div", { className: optionSetStyles.root, children: options.map(x => jsx("div", { title: x.Label, className: optionSetStyles.option, style: { backgroundColor: x.Color ?? defaultColor, color: new Color(x.Color ?? defaultColor).isDark() ? 'white' : 'black' }, children: jsx(Text, { children: x.Label }) }, x.Value)) }));
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { ReadOnlyOptionSet };
|
|
49
|
-
//# sourceMappingURL=ReadOnlyOptionSet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyOptionSet.js","sources":["../../../../../../../../src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { Text } from '@fluentui/react';\nimport { optionSetStyles } from \"./styles\";\nimport color from 'color';\nimport { useTheme } from \"@fluentui/react\";\nimport { IGridColumn } from \"../../../../interfaces/IGridColumn\";\nimport { useGridInstance } from \"../../../../hooks/useGridInstance\";\nimport { DataType } from \"../../../../enums/DataType\";\nimport { IRecord } from \"@talxis/client-libraries\";\n\ninterface IReadOnlyOptionSet {\n column: IGridColumn;\n record: IRecord\n defaultRender: () => ReactElement\n}\n\nexport const ReadOnlyOptionSet = (props: IReadOnlyOptionSet) => {\n const grid = useGridInstance();\n const { record, column, defaultRender } = { ...props }\n const [options, setOptions] = useState<ComponentFramework.PropertyHelper.OptionMetadata[] | null>(null);\n const theme = useTheme();\n const defaultColor = theme.palette.neutralLight;\n\n useEffect(() => {\n (async () => {\n const getOptions = async (): Promise<ComponentFramework.PropertyHelper.OptionMetadata[]> => {\n const [defaultValue, options] = await grid.metadata.getOptions(column.name);\n let value: any = record.getValue(column.name);\n if (column.dataType === DataType.OPTIONSET) {\n value = value ? [parseInt(value)] : null;\n }\n if (column.dataType === DataType.MULTI_SELECT_OPTIONSET) {\n value = value ? value.split(',').map((value: string) => parseInt(value)) : null;\n }\n if (column.dataType === DataType.TWO_OPTIONS) {\n value = [parseInt(value)];\n }\n return options.filter(option => value?.includes(option.Value)) ?? [];\n }\n const results = await getOptions();\n setOptions(results);\n })();\n }, [record.getValue(column.name)]);\n\n //options not loaded yet\n if (options === null) {\n return <></>\n }\n //options loaded but either no value selected or no colors are present\n if (options.length === 0 || !options.find(x => x.Color)) {\n return defaultRender();\n }\n else {\n return (\n <div className={optionSetStyles.root}>\n {options.map(x => <div\n key={x.Value}\n title={x.Label}\n className={optionSetStyles.option}\n style={{ backgroundColor: x.Color ?? defaultColor, color: new color(x.Color ?? defaultColor).isDark() ? 'white' : 'black' }}>\n <Text>{x.Label}</Text>\n </div>)}\n </div>\n )\n }\n\n}"],"names":["_jsx","color"],"mappings":";;;;;;;;AAiBa,MAAA,iBAAiB,GAAG,CAAC,KAAyB,KAAI;AAC3D,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;AAC/B,IAAA,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;IACtD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA4D,IAAI,CAAC,CAAC;AACxG,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AACzB,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;IAEhD,SAAS,CAAC,MAAK;QACX,CAAC,YAAW;AACR,YAAA,MAAM,UAAU,GAAG,YAAwE;AACvF,gBAAA,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,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,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;QACrD,OAAO,aAAa,EAAE,CAAC;AAC1B,KAAA;AACI,SAAA;AACD,QAAA,QACIA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,eAAe,CAAC,IAAI,EAAA,QAAA,EAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,IAAIA,GAEd,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,SAAS,EAAE,eAAe,CAAC,MAAM,EACjC,KAAK,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,IAAI,YAAY,EAAE,KAAK,EAAE,IAAIC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,MAAM,EAAE,GAAG,OAAO,GAAG,OAAO,EAAE,EAC3H,QAAA,EAAAD,GAAA,CAAC,IAAI,EAAA,EAAA,QAAA,EAAE,CAAC,CAAC,KAAK,EAAQ,CAAA,EAAA,EAJjB,CAAC,CAAC,KAAK,CAKV,CAAC,EAAA,CACL,EACT;AACJ,KAAA;AAEL;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
-
|
|
3
|
-
const optionSetStyles = mergeStyleSets({
|
|
4
|
-
root: {
|
|
5
|
-
display: 'flex',
|
|
6
|
-
gap: 5,
|
|
7
|
-
overflow: 'hidden',
|
|
8
|
-
'--light': 80,
|
|
9
|
-
'--threshold': 60,
|
|
10
|
-
flexGrow: 1
|
|
11
|
-
},
|
|
12
|
-
option: {
|
|
13
|
-
borderRadius: 5,
|
|
14
|
-
paddingLeft: 4,
|
|
15
|
-
paddingRight: 4,
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
textOverflow: 'ellipsis',
|
|
18
|
-
flexGrow: 1,
|
|
19
|
-
textAlign: 'center',
|
|
20
|
-
'>span': {
|
|
21
|
-
color: 'inherit',
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export { optionSetStyles };
|
|
27
|
-
//# sourceMappingURL=styles.js.map
|
package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../../src/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\";\n\nexport const optionSetStyles = mergeStyleSets({\n root: {\n display: 'flex',\n gap: 5,\n overflow: 'hidden',\n '--light': 80,\n '--threshold': 60,\n flexGrow: 1\n },\n option: {\n borderRadius: 5,\n paddingLeft: 4,\n paddingRight: 4,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n flexGrow: 1,\n textAlign: 'center',\n '>span': {\n color: 'inherit',\n }\n }\n})"],"names":[],"mappings":";;AAEO,MAAM,eAAe,GAAG,cAAc,CAAC;AAC1C,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,GAAG,EAAE,CAAC;AACN,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,aAAa,EAAE,EAAE;AACjB,QAAA,QAAQ,EAAE,CAAC;AACd,KAAA;AACD,IAAA,MAAM,EAAE;AACJ,QAAA,YAAY,EAAE,CAAC;AACf,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,YAAY,EAAE,CAAC;AACf,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,YAAY,EAAE,UAAU;AACxB,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,SAAS,EAAE,QAAQ;AACnB,QAAA,OAAO,EAAE;AACL,YAAA,KAAK,EAAE,SAAS;AACnB,SAAA;AACJ,KAAA;AACJ,CAAA;;;;"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ITheme } from "@fluentui/react";
|
|
2
|
-
export declare const getReadOnlyCellStyles: (theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
|
|
3
|
-
loading: {
|
|
4
|
-
height: string;
|
|
5
|
-
alignItems: string;
|
|
6
|
-
display: string;
|
|
7
|
-
'.ms-Shimmer-shimmerWrapper': {
|
|
8
|
-
height: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
root: {
|
|
12
|
-
display: string;
|
|
13
|
-
height: string;
|
|
14
|
-
alignItems: string;
|
|
15
|
-
};
|
|
16
|
-
text: {
|
|
17
|
-
fontSize: number;
|
|
18
|
-
overflow: string;
|
|
19
|
-
textOverflow: string;
|
|
20
|
-
};
|
|
21
|
-
link: {
|
|
22
|
-
fontSize: number;
|
|
23
|
-
overflow: string;
|
|
24
|
-
textOverflow: string;
|
|
25
|
-
};
|
|
26
|
-
fileWrapper: {
|
|
27
|
-
display: string;
|
|
28
|
-
gap: number;
|
|
29
|
-
};
|
|
30
|
-
image: {
|
|
31
|
-
marginRight: number;
|
|
32
|
-
img: {
|
|
33
|
-
width: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
cellContent: {
|
|
37
|
-
flex: number;
|
|
38
|
-
display: string;
|
|
39
|
-
overflow: string;
|
|
40
|
-
alignItems: string;
|
|
41
|
-
height: string;
|
|
42
|
-
};
|
|
43
|
-
cellContentWrapper: {
|
|
44
|
-
display: string;
|
|
45
|
-
height: string;
|
|
46
|
-
alignItems: string;
|
|
47
|
-
overflow: string;
|
|
48
|
-
flexShrink: number;
|
|
49
|
-
flexGrow: number;
|
|
50
|
-
':global(.talxis-cell-align-right &)': {
|
|
51
|
-
order: number;
|
|
52
|
-
};
|
|
53
|
-
':only-child': {
|
|
54
|
-
flexGrow: number;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
uneditableNotification: {
|
|
58
|
-
i: {
|
|
59
|
-
color: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
notificationsWrapper: {
|
|
63
|
-
display: string;
|
|
64
|
-
flexGrow: number;
|
|
65
|
-
flexShrink: number;
|
|
66
|
-
flexBasis: number;
|
|
67
|
-
justifyContent: string;
|
|
68
|
-
minWidth: string;
|
|
69
|
-
alignItems: string;
|
|
70
|
-
overflow: string;
|
|
71
|
-
':global(.talxis-cell-align-right &)': {
|
|
72
|
-
order: number;
|
|
73
|
-
justifyContent: string;
|
|
74
|
-
'.ms-CommandBar .ms-CommandBar-primaryCommand': {
|
|
75
|
-
justifyContent: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
notifications: {
|
|
80
|
-
minWidth: number;
|
|
81
|
-
flex: number;
|
|
82
|
-
':global(.talxis-cell-align-right &)': {
|
|
83
|
-
order: number;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
loadingLine: {
|
|
87
|
-
height: number;
|
|
88
|
-
borderRadius: number;
|
|
89
|
-
width: string;
|
|
90
|
-
animation: string;
|
|
91
|
-
backgroundSize: string;
|
|
92
|
-
background: string;
|
|
93
|
-
};
|
|
94
|
-
multiline: {
|
|
95
|
-
alignSelf: string;
|
|
96
|
-
whiteSpace: string;
|
|
97
|
-
};
|
|
98
|
-
}>;
|
|
99
|
-
export declare const getMultilineStyle: (height: number) => string;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { keyframes, mergeStyleSets, mergeStyles } from '@fluentui/react';
|
|
2
|
-
|
|
3
|
-
const shimmer = keyframes({
|
|
4
|
-
'100%': {
|
|
5
|
-
backgroundPosition: '150px 0'
|
|
6
|
-
},
|
|
7
|
-
});
|
|
8
|
-
const getReadOnlyCellStyles = (theme) => {
|
|
9
|
-
return mergeStyleSets({
|
|
10
|
-
loading: {
|
|
11
|
-
height: '100%',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
display: 'flex',
|
|
14
|
-
'.ms-Shimmer-shimmerWrapper': {
|
|
15
|
-
height: 10
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
root: {
|
|
19
|
-
display: 'flex',
|
|
20
|
-
height: '100%',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
},
|
|
23
|
-
text: {
|
|
24
|
-
fontSize: 14,
|
|
25
|
-
overflow: 'hidden',
|
|
26
|
-
textOverflow: 'ellipsis',
|
|
27
|
-
},
|
|
28
|
-
link: {
|
|
29
|
-
fontSize: 14,
|
|
30
|
-
overflow: 'hidden',
|
|
31
|
-
textOverflow: 'ellipsis'
|
|
32
|
-
},
|
|
33
|
-
fileWrapper: {
|
|
34
|
-
display: 'flex',
|
|
35
|
-
gap: 3
|
|
36
|
-
},
|
|
37
|
-
image: {
|
|
38
|
-
marginRight: 5,
|
|
39
|
-
'img': {
|
|
40
|
-
width: 32
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
cellContent: {
|
|
44
|
-
flex: 1,
|
|
45
|
-
display: 'flex',
|
|
46
|
-
overflow: 'hidden',
|
|
47
|
-
alignItems: 'center',
|
|
48
|
-
height: '100%',
|
|
49
|
-
},
|
|
50
|
-
cellContentWrapper: {
|
|
51
|
-
display: 'flex',
|
|
52
|
-
height: '100%',
|
|
53
|
-
alignItems: 'center',
|
|
54
|
-
overflow: 'hidden',
|
|
55
|
-
flexShrink: 1,
|
|
56
|
-
flexGrow: 0,
|
|
57
|
-
':global(.talxis-cell-align-right &)': {
|
|
58
|
-
order: 2
|
|
59
|
-
},
|
|
60
|
-
':only-child': {
|
|
61
|
-
flexGrow: 1
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
uneditableNotification: {
|
|
65
|
-
'i': {
|
|
66
|
-
color: `${theme.semanticColors.infoIcon} !important`
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
notificationsWrapper: {
|
|
70
|
-
display: 'flex',
|
|
71
|
-
flexGrow: 1,
|
|
72
|
-
flexShrink: 0,
|
|
73
|
-
flexBasis: 0,
|
|
74
|
-
justifyContent: 'flex-end',
|
|
75
|
-
minWidth: 'var(--test, 0px)',
|
|
76
|
-
alignItems: 'center',
|
|
77
|
-
overflow: 'hidden',
|
|
78
|
-
':global(.talxis-cell-align-right &)': {
|
|
79
|
-
order: 1,
|
|
80
|
-
justifyContent: 'flex-start',
|
|
81
|
-
'.ms-CommandBar .ms-CommandBar-primaryCommand': {
|
|
82
|
-
justifyContent: 'flex-start'
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
notifications: {
|
|
87
|
-
minWidth: 0,
|
|
88
|
-
flex: 1,
|
|
89
|
-
':global(.talxis-cell-align-right &)': {
|
|
90
|
-
order: 2
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
loadingLine: {
|
|
94
|
-
height: 7,
|
|
95
|
-
borderRadius: 5,
|
|
96
|
-
width: '100%',
|
|
97
|
-
animation: `${shimmer} 2s infinite`,
|
|
98
|
-
backgroundSize: '1000px 100%',
|
|
99
|
-
background: `linear-gradient(to right, color-mix(in oklab, ${theme.palette.white}, ${theme.palette.black} 8%) 4%, color-mix(in oklab, ${theme.palette.white}, ${theme.palette.black} 5%) 25%, color-mix(in oklab, ${theme.palette.white}, ${theme.palette.black} 8%) 36%)`
|
|
100
|
-
},
|
|
101
|
-
multiline: {
|
|
102
|
-
alignSelf: 'baseline',
|
|
103
|
-
whiteSpace: 'normal'
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
const getMultilineStyle = (height) => {
|
|
108
|
-
const clamp = Math.floor(height / 20);
|
|
109
|
-
return mergeStyles({
|
|
110
|
-
alignSelf: 'baseline',
|
|
111
|
-
whiteSpace: 'normal',
|
|
112
|
-
display: '-webkit-box',
|
|
113
|
-
textAlign: 'left',
|
|
114
|
-
overflowWrap: 'break-word',
|
|
115
|
-
lineHeight: "1.2",
|
|
116
|
-
paddingTop: 2,
|
|
117
|
-
'-webkit-line-clamp': clamp.toString(),
|
|
118
|
-
'-webkit-box-orient': 'vertical'
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export { getMultilineStyle, getReadOnlyCellStyles };
|
|
123
|
-
//# sourceMappingURL=styles.js.map
|