@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
package/dist/index.js
CHANGED
|
@@ -3,19 +3,24 @@ export { useControlSizing } from './hooks/useControlSizing.js';
|
|
|
3
3
|
export { useFocusIn } from './hooks/useFocusIn.js';
|
|
4
4
|
export { useInputBasedControl } from './hooks/useInputBasedControl.js';
|
|
5
5
|
export { useMouseOver } from './hooks/useMouseOver.js';
|
|
6
|
+
export { useControlLabels } from './hooks/useControlLabels.js';
|
|
6
7
|
export { useControlTheme } from './utils/theme/hooks/useControlTheme.js';
|
|
7
8
|
export { ControlTheme } from './utils/theme/ControlTheme.js';
|
|
8
9
|
export { useControlThemeGenerator } from './utils/theme/hooks/useControlThemeGenerator.js';
|
|
10
|
+
export { ThemeWrapper } from './utils/theme/components/ThemeWrapper.js';
|
|
11
|
+
export { BaseControls } from './utils/BaseControls.js';
|
|
12
|
+
export { DatasetControl } from './components/DatasetControl/DatasetControl.js';
|
|
9
13
|
export { DateTime } from './components/DateTime/DateTime.js';
|
|
10
14
|
export { useDateTime } from './components/DateTime/hooks/useDateTime.js';
|
|
11
15
|
export { Decimal } from './components/Decimal/Decimal.js';
|
|
12
|
-
export { Duration } from './components/Duration/Duration.js';
|
|
13
16
|
export { Grid } from './components/Grid/Grid.js';
|
|
17
|
+
export { GridCellRenderer } from './components/GridCellRenderer/GridCellRenderer.js';
|
|
14
18
|
export { Lookup } from './components/Lookup/Lookup.js';
|
|
15
19
|
export { useLookup } from './components/Lookup/hooks/useLookup.js';
|
|
16
20
|
export { MultiSelectOptionSet } from './components/MultiSelectOptionSet/MultiSelectOptionSet.js';
|
|
21
|
+
export { NestedControlRenderer } from './components/NestedControlRenderer/NestedControlRenderer.js';
|
|
17
22
|
export { OptionSet } from './components/OptionSet/OptionSet.js';
|
|
18
23
|
export { TextField } from './components/TextField/TextField.js';
|
|
19
24
|
export { TwoOptions } from './components/TwoOptions/TwoOptions.js';
|
|
20
|
-
export {
|
|
25
|
+
export { Duration } from './components/Duration/Duration.js';
|
|
21
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="@types/powerapps-component-framework" />
|
|
2
|
+
import { IParameters } from ".";
|
|
2
3
|
import { IFluentDesignState } from "../utils";
|
|
3
4
|
export interface IOutputs {
|
|
4
5
|
[key: string]: any;
|
|
@@ -6,7 +7,7 @@ export interface IOutputs {
|
|
|
6
7
|
export interface IContext extends ComponentFramework.Context<any> {
|
|
7
8
|
fluentDesignLanguage?: IFluentDesignState;
|
|
8
9
|
}
|
|
9
|
-
export interface IControl<TParameters, TOutputs, TTranslations, TComponentProps> {
|
|
10
|
+
export interface IControl<TParameters extends IParameters, TOutputs, TTranslations, TComponentProps> {
|
|
10
11
|
context: IContext;
|
|
11
12
|
parameters: TParameters;
|
|
12
13
|
translations?: TTranslations;
|
|
@@ -5,6 +5,10 @@ export interface IProperty extends Omit<Partial<ComponentFramework.PropertyTypes
|
|
|
5
5
|
export interface IStringProperty extends IProperty, Partial<ComponentFramework.PropertyTypes.StringProperty> {
|
|
6
6
|
raw: string | null;
|
|
7
7
|
}
|
|
8
|
+
export interface IFileProperty extends IProperty {
|
|
9
|
+
raw: ComponentFramework.FileObject | null;
|
|
10
|
+
formatted: string;
|
|
11
|
+
}
|
|
8
12
|
export interface ITwoOptionsProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.TwoOptionsProperty>, 'attributes'> {
|
|
9
13
|
raw: boolean;
|
|
10
14
|
attributes: Omit<Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.OptionSetMetadata>, 'DefaultValue'> & {
|
|
@@ -19,6 +23,7 @@ export interface IDecimalNumberProperty extends IProperty, Omit<Partial<Componen
|
|
|
19
23
|
}
|
|
20
24
|
export interface IWholeNumberProperty extends IProperty, Omit<Partial<ComponentFramework.PropertyTypes.WholeNumberProperty>, 'attributes'> {
|
|
21
25
|
raw: number | null;
|
|
26
|
+
attributes?: Partial<ComponentFramework.PropertyHelper.FieldPropertyMetadata.DecimalNumberMetadata>;
|
|
22
27
|
}
|
|
23
28
|
export interface IDateTimeProperty extends IProperty, Partial<ComponentFramework.PropertyTypes.DateTimeProperty> {
|
|
24
29
|
raw: Date | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataType } from "@talxis/client-libraries";
|
|
2
|
+
export type BaseControl = 'TextField' | 'OptionSet' | 'MultiSelectOptionSet' | 'DateTime' | 'Decimal' | 'Duration' | 'GridCellRenderer' | 'Lookup' | 'TwoOptions' | 'GridCellRenderer' | 'Grid' | 'DatasetControl' | 'NestedControl';
|
|
3
|
+
export declare class BaseControls {
|
|
4
|
+
static get TextField(): 'TextField';
|
|
5
|
+
static get OptionSet(): 'OptionSet';
|
|
6
|
+
static get MultiSelectOptionSet(): 'MultiSelectOptionSet';
|
|
7
|
+
static get DateTime(): 'DateTime';
|
|
8
|
+
static get Decimal(): 'Decimal';
|
|
9
|
+
static get Duration(): 'Duration';
|
|
10
|
+
static get GridCellRenderer(): 'GridCellRenderer';
|
|
11
|
+
static get Lookup(): 'Lookup';
|
|
12
|
+
static get TwoOptions(): 'TwoOptions';
|
|
13
|
+
static GetControlNameForDataType(dataType: DataType): "Decimal" | "TextField" | "OptionSet" | "MultiSelectOptionSet" | "DateTime" | "Duration" | "Lookup" | "TwoOptions";
|
|
14
|
+
static GetAll(): BaseControl[];
|
|
15
|
+
static IsBaseControl(name: string): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
class BaseControls {
|
|
2
|
+
static get TextField() {
|
|
3
|
+
return 'TextField';
|
|
4
|
+
}
|
|
5
|
+
static get OptionSet() {
|
|
6
|
+
return 'OptionSet';
|
|
7
|
+
}
|
|
8
|
+
static get MultiSelectOptionSet() {
|
|
9
|
+
return 'MultiSelectOptionSet';
|
|
10
|
+
}
|
|
11
|
+
static get DateTime() {
|
|
12
|
+
return 'DateTime';
|
|
13
|
+
}
|
|
14
|
+
static get Decimal() {
|
|
15
|
+
return 'Decimal';
|
|
16
|
+
}
|
|
17
|
+
static get Duration() {
|
|
18
|
+
return 'Duration';
|
|
19
|
+
}
|
|
20
|
+
static get GridCellRenderer() {
|
|
21
|
+
return 'GridCellRenderer';
|
|
22
|
+
}
|
|
23
|
+
static get Lookup() {
|
|
24
|
+
return 'Lookup';
|
|
25
|
+
}
|
|
26
|
+
static get TwoOptions() {
|
|
27
|
+
return 'TwoOptions';
|
|
28
|
+
}
|
|
29
|
+
static GetControlNameForDataType(dataType) {
|
|
30
|
+
switch (dataType) {
|
|
31
|
+
case 'Currency':
|
|
32
|
+
case 'Whole.None':
|
|
33
|
+
case 'Decimal': {
|
|
34
|
+
return BaseControls.Decimal;
|
|
35
|
+
}
|
|
36
|
+
case 'DateAndTime.DateAndTime':
|
|
37
|
+
case 'DateAndTime.DateOnly': {
|
|
38
|
+
return BaseControls.DateTime;
|
|
39
|
+
}
|
|
40
|
+
case 'Lookup.Customer':
|
|
41
|
+
case 'Lookup.Owner':
|
|
42
|
+
case 'Lookup.Regarding':
|
|
43
|
+
case 'Lookup.Simple': {
|
|
44
|
+
return BaseControls.Lookup;
|
|
45
|
+
}
|
|
46
|
+
case 'OptionSet': {
|
|
47
|
+
return BaseControls.OptionSet;
|
|
48
|
+
}
|
|
49
|
+
case 'MultiSelectPicklist': {
|
|
50
|
+
return BaseControls.MultiSelectOptionSet;
|
|
51
|
+
}
|
|
52
|
+
case 'TwoOptions': {
|
|
53
|
+
return BaseControls.TwoOptions;
|
|
54
|
+
}
|
|
55
|
+
case 'Whole.Duration': {
|
|
56
|
+
return BaseControls.Duration;
|
|
57
|
+
}
|
|
58
|
+
default: {
|
|
59
|
+
return BaseControls.TextField;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
static GetAll() {
|
|
64
|
+
return [
|
|
65
|
+
BaseControls.Decimal,
|
|
66
|
+
BaseControls.DateTime,
|
|
67
|
+
BaseControls.Lookup,
|
|
68
|
+
BaseControls.OptionSet,
|
|
69
|
+
BaseControls.MultiSelectOptionSet,
|
|
70
|
+
BaseControls.TwoOptions,
|
|
71
|
+
BaseControls.Duration,
|
|
72
|
+
BaseControls.TextField,
|
|
73
|
+
BaseControls.GridCellRenderer
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
static IsBaseControl(name) {
|
|
77
|
+
return this.GetAll().includes(name);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { BaseControls };
|
|
82
|
+
//# sourceMappingURL=BaseControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseControls.js","sources":["../../src/utils/BaseControls.ts"],"sourcesContent":["import { DataType } from \"@talxis/client-libraries\";\n\nexport type BaseControl =\n | 'TextField'\n | 'OptionSet'\n | 'MultiSelectOptionSet'\n | 'DateTime'\n | 'Decimal'\n | 'Duration'\n | 'GridCellRenderer'\n | 'Lookup'\n | 'TwoOptions'\n | 'GridCellRenderer'\n | 'Grid'\n | 'DatasetControl'\n | 'NestedControl'\n\nexport class BaseControls {\n public static get TextField(): 'TextField' {\n return 'TextField';\n }\n\n public static get OptionSet(): 'OptionSet' {\n return 'OptionSet';\n }\n\n public static get MultiSelectOptionSet(): 'MultiSelectOptionSet' {\n return 'MultiSelectOptionSet';\n }\n\n public static get DateTime(): 'DateTime' {\n return 'DateTime';\n }\n\n public static get Decimal(): 'Decimal' {\n return 'Decimal';\n }\n\n public static get Duration(): 'Duration' {\n return 'Duration';\n }\n\n public static get GridCellRenderer(): 'GridCellRenderer' {\n return 'GridCellRenderer';\n }\n\n public static get Lookup(): 'Lookup' {\n return 'Lookup';\n }\n \n public static get TwoOptions(): 'TwoOptions' {\n return 'TwoOptions';\n }\n\n public static GetControlNameForDataType(dataType: DataType) {\n switch(dataType) {\n case 'Currency':\n case 'Whole.None':\n case 'Decimal': {\n return BaseControls.Decimal;\n }\n case 'DateAndTime.DateAndTime':\n case 'DateAndTime.DateOnly': {\n return BaseControls.DateTime;\n }\n case 'Lookup.Customer':\n case 'Lookup.Owner':\n case 'Lookup.Regarding':\n case 'Lookup.Simple': {\n return BaseControls.Lookup;\n }\n case 'OptionSet': {\n return BaseControls.OptionSet;\n }\n case 'MultiSelectPicklist': {\n return BaseControls.MultiSelectOptionSet;\n }\n case 'TwoOptions': {\n return BaseControls.TwoOptions;\n }\n case 'Whole.Duration': {\n return BaseControls.Duration;\n }\n default: {\n return BaseControls.TextField;\n }\n }\n }\n public static GetAll(): BaseControl[] {\n return [\n BaseControls.Decimal,\n BaseControls.DateTime,\n BaseControls.Lookup,\n BaseControls.OptionSet,\n BaseControls.MultiSelectOptionSet,\n BaseControls.TwoOptions,\n BaseControls.Duration,\n BaseControls.TextField,\n BaseControls.GridCellRenderer\n ]\n }\n public static IsBaseControl(name: string) {\n return this.GetAll().includes(name as BaseControl);\n }\n}"],"names":[],"mappings":"MAiBa,YAAY,CAAA;AACd,IAAA,WAAW,SAAS,GAAA;AACvB,QAAA,OAAO,WAAW,CAAC;KACtB;AAEM,IAAA,WAAW,SAAS,GAAA;AACvB,QAAA,OAAO,WAAW,CAAC;KACtB;AAEM,IAAA,WAAW,oBAAoB,GAAA;AAClC,QAAA,OAAO,sBAAsB,CAAC;KACjC;AAEM,IAAA,WAAW,QAAQ,GAAA;AACtB,QAAA,OAAO,UAAU,CAAC;KACrB;AAEM,IAAA,WAAW,OAAO,GAAA;AACrB,QAAA,OAAO,SAAS,CAAC;KACpB;AAEM,IAAA,WAAW,QAAQ,GAAA;AACtB,QAAA,OAAO,UAAU,CAAC;KACrB;AAEM,IAAA,WAAW,gBAAgB,GAAA;AAC9B,QAAA,OAAO,kBAAkB,CAAC;KAC7B;AAEM,IAAA,WAAW,MAAM,GAAA;AACpB,QAAA,OAAO,QAAQ,CAAC;KACnB;AAEM,IAAA,WAAW,UAAU,GAAA;AACxB,QAAA,OAAO,YAAY,CAAC;KACvB;IAEM,OAAO,yBAAyB,CAAC,QAAkB,EAAA;AACtD,QAAA,QAAO,QAAQ;AACX,YAAA,KAAK,UAAU,CAAC;AAChB,YAAA,KAAK,YAAY,CAAC;YAClB,KAAK,SAAS,EAAE;gBACZ,OAAO,YAAY,CAAC,OAAO,CAAC;AAC/B,aAAA;AACD,YAAA,KAAK,yBAAyB,CAAC;YAC/B,KAAK,sBAAsB,EAAE;gBACzB,OAAO,YAAY,CAAC,QAAQ,CAAC;AAChC,aAAA;AACD,YAAA,KAAK,iBAAiB,CAAC;AACvB,YAAA,KAAK,cAAc,CAAC;AACpB,YAAA,KAAK,kBAAkB,CAAC;YACxB,KAAK,eAAe,EAAE;gBAClB,OAAO,YAAY,CAAC,MAAM,CAAC;AAC9B,aAAA;YACD,KAAK,WAAW,EAAE;gBACd,OAAO,YAAY,CAAC,SAAS,CAAC;AACjC,aAAA;YACD,KAAK,qBAAqB,EAAE;gBACxB,OAAO,YAAY,CAAC,oBAAoB,CAAC;AAC5C,aAAA;YACD,KAAK,YAAY,EAAE;gBACf,OAAO,YAAY,CAAC,UAAU,CAAC;AAClC,aAAA;YACD,KAAK,gBAAgB,EAAE;gBACnB,OAAO,YAAY,CAAC,QAAQ,CAAC;AAChC,aAAA;AACD,YAAA,SAAS;gBACL,OAAO,YAAY,CAAC,SAAS,CAAC;AACjC,aAAA;AACJ,SAAA;KACJ;AACM,IAAA,OAAO,MAAM,GAAA;QAChB,OAAO;AACH,YAAA,YAAY,CAAC,OAAO;AACpB,YAAA,YAAY,CAAC,QAAQ;AACrB,YAAA,YAAY,CAAC,MAAM;AACnB,YAAA,YAAY,CAAC,SAAS;AACtB,YAAA,YAAY,CAAC,oBAAoB;AACjC,YAAA,YAAY,CAAC,UAAU;AACvB,YAAA,YAAY,CAAC,QAAQ;AACrB,YAAA,YAAY,CAAC,SAAS;AACtB,YAAA,YAAY,CAAC,gBAAgB;SAChC,CAAA;KACJ;IACM,OAAO,aAAa,CAAC,IAAY,EAAA;QACpC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAmB,CAAC,CAAC;KACtD;AACJ;;;;"}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { BaseControls } from './BaseControls.js';
|
|
1
2
|
export { ControlTheme } from './theme/ControlTheme.js';
|
|
2
3
|
export { useControlTheme } from './theme/hooks/useControlTheme.js';
|
|
3
4
|
export { useControlThemeGenerator } from './theme/hooks/useControlThemeGenerator.js';
|
|
5
|
+
export { ThemeWrapper } from './theme/components/ThemeWrapper.js';
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@types/powerapps-component-framework" />
|
|
2
|
-
import { ITheme } from "@talxis/react-components";
|
|
3
2
|
import { DeepPartial } from "@talxis/client-libraries";
|
|
3
|
+
import { ITheme } from "@talxis/react-components";
|
|
4
4
|
export interface IFluentDesignState extends ComponentFramework.FluentDesignState {
|
|
5
5
|
/**
|
|
6
6
|
* Optional overrides that will get applied when v8 theme is generated from fluentDesignLanguage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTheme } from '@fluentui/react';
|
|
2
|
-
import { Theming } from '@talxis/react-components';
|
|
3
2
|
import { createV9Theme, createBrandVariants } from '@fluentui/react-migration-v8-v9';
|
|
3
|
+
import { Theming } from '@talxis/react-components';
|
|
4
4
|
|
|
5
5
|
class ControlTheme {
|
|
6
6
|
static GetV8ThemeFromFluentDesignLanguage(fluentDesignLanguage) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlTheme.js","sources":["../../../src/utils/theme/ControlTheme.ts"],"sourcesContent":["import { getTheme } from \"@fluentui/react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ControlTheme.js","sources":["../../../src/utils/theme/ControlTheme.ts"],"sourcesContent":["import { getTheme } from \"@fluentui/react\";\nimport { DeepPartial } from \"@talxis/client-libraries\";\nimport { createBrandVariants, createV9Theme } from \"@fluentui/react-migration-v8-v9\";\nimport { ITheme, Theming } from \"@talxis/react-components\";\n\nexport interface IFluentDesignState extends ComponentFramework.FluentDesignState {\n /**\n * Optional overrides that will get applied when v8 theme is generated from fluentDesignLanguage\n */\n v8FluentOverrides?: DeepPartial<ITheme>;\n /**\n * The application's theme may differ from the control's theme. This is often the case when rendering a PCF as a cell customizer with conditional formatting.\n * This object provides access to the application's theme, enabling you to render elements like callouts and other surfaces accurately.\n */\n applicationTheme?: ITheme;\n}\n\nexport class ControlTheme {\n public static GetV8ThemeFromFluentDesignLanguage(fluentDesignLanguage?: IFluentDesignState): ITheme {\n let primaryColor;\n let backgroundColor;\n let textColor;\n const tokenTheme = fluentDesignLanguage?.tokenTheme;\n if (!tokenTheme) {\n const baseTheme = getTheme();\n primaryColor = baseTheme.palette.themePrimary;\n backgroundColor = baseTheme.semanticColors.bodyBackground;\n textColor = baseTheme.semanticColors.bodyText;\n }\n else {\n primaryColor = tokenTheme.colorCompoundBrandForeground1;\n backgroundColor = tokenTheme.colorNeutralBackground1;\n textColor = tokenTheme.colorNeutralForeground1;\n }\n return Theming.GenerateThemeV8(primaryColor, backgroundColor, textColor, fluentDesignLanguage?.v8FluentOverrides);\n }\n\n public static GenerateFluentDesignLanguage(primaryColor: string, backgroundColor: string, textColor: string, options?: {\n v8FluentOverrides?: DeepPartial<ITheme>;\n applicationTheme?: ITheme\n }): IFluentDesignState {\n const theme = Theming.GenerateThemeV8(primaryColor, backgroundColor, textColor, options?.v8FluentOverrides)\n const v9 = createV9Theme(theme);\n const brand = createBrandVariants(theme.palette);\n\n return {\n brand: brand,\n applicationTheme: options?.applicationTheme,\n isDarkTheme: Theming.IsDarkColor(theme.semanticColors.bodyBackground),\n v8FluentOverrides: options?.v8FluentOverrides,\n tokenTheme: v9\n };;\n }\n}"],"names":[],"mappings":";;;;MAiBa,YAAY,CAAA;IACd,OAAO,kCAAkC,CAAC,oBAAyC,EAAA;AACtF,QAAA,IAAI,YAAY,CAAC;AACjB,QAAA,IAAI,eAAe,CAAC;AACpB,QAAA,IAAI,SAAS,CAAC;AACd,QAAA,MAAM,UAAU,GAAG,oBAAoB,EAAE,UAAU,CAAC;QACpD,IAAI,CAAC,UAAU,EAAE;AACb,YAAA,MAAM,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fluentui/react';
|
|
4
|
+
interface IThemeWrapper extends ThemeProviderProps {
|
|
5
|
+
fluentDesignLanguage?: ComponentFramework.FluentDesignState;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ThemeWrapper: React.FC<IThemeWrapper>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ThemeProvider } from '@fluentui/react';
|
|
3
|
+
import { useControlTheme } from '../hooks/useControlTheme.js';
|
|
4
|
+
|
|
5
|
+
const ThemeWrapper = (props) => {
|
|
6
|
+
const theme = useControlTheme(props.fluentDesignLanguage);
|
|
7
|
+
return (jsx(ThemeProvider, { theme: theme, ...props, children: props.children }));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { ThemeWrapper };
|
|
11
|
+
//# sourceMappingURL=ThemeWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeWrapper.js","sources":["../../../../src/utils/theme/components/ThemeWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport { ThemeProvider, ThemeProviderProps } from '@fluentui/react';\nimport { useControlTheme } from '../hooks';\n\ninterface IThemeWrapper extends ThemeProviderProps {\n fluentDesignLanguage?: ComponentFramework.FluentDesignState;\n children?: React.ReactNode;\n}\n\nexport const ThemeWrapper: React.FC<IThemeWrapper> = (props: IThemeWrapper) => {\n const theme = useControlTheme(props.fluentDesignLanguage);\n return (\n <ThemeProvider theme={theme} {...props}>\n {props.children}\n </ThemeProvider>\n );\n};"],"names":["_jsx"],"mappings":";;;;AASa,MAAA,YAAY,GAA4B,CAAC,KAAoB,KAAI;IAC1E,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAC1D,IAAA,QACIA,GAAA,CAAC,aAAa,EAAA,EAAC,KAAK,EAAE,KAAK,EAAM,GAAA,KAAK,YACjC,KAAK,CAAC,QAAQ,EAAA,CACH,EAClB;AACN;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ThemeWrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControlTheme.js","sources":["../../../../src/utils/theme/hooks/useControlTheme.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"useControlTheme.js","sources":["../../../../src/utils/theme/hooks/useControlTheme.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { ControlTheme, IFluentDesignState } from \"../ControlTheme\";\nimport { ITheme } from \"@talxis/react-components\";\n\nexport const useControlTheme = (fluentDesignLanguage?: IFluentDesignState): ITheme => {\n const primaryColor = fluentDesignLanguage?.tokenTheme.colorCompoundBrandForeground1;\n const backgroundColor = fluentDesignLanguage?.tokenTheme.colorNeutralBackground1;\n const textColor = fluentDesignLanguage?.tokenTheme.colorNeutralForeground1;\n\n return useMemo(() => ControlTheme.GetV8ThemeFromFluentDesignLanguage(fluentDesignLanguage), [primaryColor, backgroundColor, textColor]);\n};\n"],"names":[],"mappings":";;;AAIa,MAAA,eAAe,GAAG,CAAC,oBAAyC,KAAY;AACjF,IAAA,MAAM,YAAY,GAAG,oBAAoB,EAAE,UAAU,CAAC,6BAA6B,CAAC;AACpF,IAAA,MAAM,eAAe,GAAG,oBAAoB,EAAE,UAAU,CAAC,uBAAuB,CAAC;AACjF,IAAA,MAAM,SAAS,GAAG,oBAAoB,EAAE,UAAU,CAAC,uBAAuB,CAAC;IAE3E,OAAO,OAAO,CAAC,MAAM,YAAY,CAAC,kCAAkC,CAAC,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5I;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ControlTheme } from './ControlTheme.js';
|
|
2
2
|
export { useControlTheme } from './hooks/useControlTheme.js';
|
|
3
3
|
export { useControlThemeGenerator } from './hooks/useControlThemeGenerator.js';
|
|
4
|
+
export { ThemeWrapper } from './components/ThemeWrapper.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talxis/base-controls",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2503.2",
|
|
4
4
|
"description": "Set of React components that natively work with Power Apps Component Framework API's",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react": "^16.8.6 || ^17.0.2",
|
|
87
87
|
"react-dom": "^16.8.6 || ^17.0.2",
|
|
88
|
-
"@talxis/react-components": "^1.
|
|
89
|
-
"@talxis/client-libraries": "^1.
|
|
88
|
+
"@talxis/react-components": "^1.2503.1",
|
|
89
|
+
"@talxis/client-libraries": "^1.2503.3",
|
|
90
90
|
"@fluentui/react": "<=8.121.5"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IGridColumn } from '../../../interfaces/IGridColumn';
|
|
3
|
-
import { ICellEditorParams } from '@ag-grid-community/core';
|
|
4
|
-
import { IRecord } from '@talxis/client-libraries';
|
|
5
|
-
interface ICell extends ICellEditorParams {
|
|
6
|
-
baseColumn: IGridColumn;
|
|
7
|
-
data: IRecord;
|
|
8
|
-
}
|
|
9
|
-
export declare const EditableCell: (editableCellProps: ICell) => JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { DataType } from '../../../enums/DataType.js';
|
|
3
|
-
import { Component } from '../../Component/Component.js';
|
|
4
|
-
import { useGridInstance } from '../../../hooks/useGridInstance.js';
|
|
5
|
-
import { useRerender } from '../../../../../../hooks/useRerender.js';
|
|
6
|
-
|
|
7
|
-
const EditableCell = (editableCellProps) => {
|
|
8
|
-
const grid = useGridInstance();
|
|
9
|
-
const column = editableCellProps.baseColumn;
|
|
10
|
-
const record = editableCellProps.data;
|
|
11
|
-
const rerender = useRerender();
|
|
12
|
-
const onNotifyOutputChanged = (value) => {
|
|
13
|
-
switch (column.dataType) {
|
|
14
|
-
case DataType.OPTIONSET:
|
|
15
|
-
case DataType.DATE_AND_TIME_DATE_ONLY:
|
|
16
|
-
case DataType.WHOLE_DURATION: {
|
|
17
|
-
editableCellProps.stopEditing();
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
case DataType.LOOKUP_OWNER:
|
|
21
|
-
case DataType.LOOKUP_SIMPLE:
|
|
22
|
-
case DataType.LOOKUP_CUSTOMER: {
|
|
23
|
-
if (value?.length > 0) {
|
|
24
|
-
editableCellProps.stopEditing();
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (grid.parameters.EnableMultiEdit?.raw && grid.dataset.getSelectedRecordIds().includes(record.getRecordId())) {
|
|
30
|
-
const records = grid.records.filter(record => grid.dataset.getSelectedRecordIds().includes(record.getRecordId()));
|
|
31
|
-
records.map(record => setValue(record, value));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
setValue(record, value);
|
|
35
|
-
}
|
|
36
|
-
grid.pcfContext.factory.requestRender();
|
|
37
|
-
rerender();
|
|
38
|
-
};
|
|
39
|
-
const setValue = (record, value) => {
|
|
40
|
-
record.setValue(column.name, value);
|
|
41
|
-
editableCellProps.api.resetRowHeights();
|
|
42
|
-
};
|
|
43
|
-
return jsx(Component, { column: column, record: record, onNotifyOutputChanged: onNotifyOutputChanged, onOverrideControlProps: (props) => {
|
|
44
|
-
return {
|
|
45
|
-
...props,
|
|
46
|
-
context: {
|
|
47
|
-
...props.context,
|
|
48
|
-
mode: {
|
|
49
|
-
...props.context.mode,
|
|
50
|
-
allocatedHeight: (() => {
|
|
51
|
-
return editableCellProps.node.rowHeight;
|
|
52
|
-
})()
|
|
53
|
-
},
|
|
54
|
-
fluentDesignLanguage: props.context.fluentDesignLanguage ? {
|
|
55
|
-
...props.context.fluentDesignLanguage,
|
|
56
|
-
tokenTheme: {
|
|
57
|
-
...props.context.fluentDesignLanguage.tokenTheme,
|
|
58
|
-
underlined: false,
|
|
59
|
-
}
|
|
60
|
-
} : undefined
|
|
61
|
-
},
|
|
62
|
-
parameters: {
|
|
63
|
-
...props.parameters,
|
|
64
|
-
AutoFocus: {
|
|
65
|
-
raw: true
|
|
66
|
-
},
|
|
67
|
-
EnableNavigation: {
|
|
68
|
-
raw: false
|
|
69
|
-
},
|
|
70
|
-
IsInlineNewEnabled: {
|
|
71
|
-
raw: false
|
|
72
|
-
},
|
|
73
|
-
EnableTypeSuffix: {
|
|
74
|
-
raw: false
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
} });
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { EditableCell };
|
|
82
|
-
//# sourceMappingURL=EditableCell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditableCell.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/EditableCell/EditableCell.tsx"],"sourcesContent":["import { DataType } from '../../../enums/DataType';\nimport { IGridColumn } from '../../../interfaces/IGridColumn';\nimport { Component } from '../../Component/Component';\nimport { ICellEditorParams } from '@ag-grid-community/core';\nimport { IRecord } from '@talxis/client-libraries';\nimport { useGridInstance } from '../../../hooks/useGridInstance';\nimport { useRerender } from '../../../../../../hooks/useRerender';\n\ninterface ICell extends ICellEditorParams {\n baseColumn: IGridColumn;\n data: IRecord\n}\n\nexport const EditableCell = (editableCellProps: ICell) => {\n const grid = useGridInstance();\n const column = editableCellProps.baseColumn;\n const record = editableCellProps.data;\n const rerender = useRerender();\n\n const onNotifyOutputChanged = (value: any) => {\n switch(column.dataType) {\n case DataType.OPTIONSET:\n case DataType.DATE_AND_TIME_DATE_ONLY:\n case DataType.WHOLE_DURATION: {\n editableCellProps.stopEditing();\n break;\n }\n case DataType.LOOKUP_OWNER:\n case DataType.LOOKUP_SIMPLE:\n case DataType.LOOKUP_CUSTOMER: {\n if(value?.length > 0) {\n editableCellProps.stopEditing();\n }\n break;\n }\n }\n if(grid.parameters.EnableMultiEdit?.raw && grid.dataset.getSelectedRecordIds().includes(record.getRecordId())) {\n const records = grid.records.filter(record => grid.dataset.getSelectedRecordIds().includes(record.getRecordId()))\n records.map(record => setValue(record, value))\n }\n else {\n setValue(record, value)\n }\n grid.pcfContext.factory.requestRender();\n rerender();\n }\n\n const setValue = (record: IRecord, value: any) => {\n record.setValue(column.name, value);\n editableCellProps.api.resetRowHeights();\n }\n\n return <Component\n column={column}\n record={record}\n onNotifyOutputChanged={onNotifyOutputChanged}\n onOverrideControlProps={(props) => {\n return {\n ...props,\n context: {\n ...props.context,\n mode: {\n ...props.context.mode,\n allocatedHeight: (() => {\n return editableCellProps.node.rowHeight!\n })()\n },\n fluentDesignLanguage: props.context.fluentDesignLanguage ? {\n ...props.context.fluentDesignLanguage,\n tokenTheme: {\n ...props.context.fluentDesignLanguage.tokenTheme,\n underlined: false,\n }\n } : undefined\n },\n parameters: {\n ...props.parameters,\n AutoFocus: {\n raw: true\n },\n EnableNavigation: {\n raw: false\n },\n IsInlineNewEnabled: {\n raw: false\n },\n EnableTypeSuffix: {\n raw: false\n }\n }\n }\n }}\n />\n}"],"names":["_jsx"],"mappings":";;;;;;AAaa,MAAA,YAAY,GAAG,CAAC,iBAAwB,KAAI;AACrD,IAAA,MAAM,IAAI,GAAG,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A,kBAAkB,EAAE;AAChB,wBAAA,GAAG,EAAE,KAAK;AACb,qBAAA;AACD,oBAAA,gBAAgB,EAAE;AACd,wBAAA,GAAG,EAAE,KAAK;AACb,qBAAA;AACJ,iBAAA;aACJ,CAAA;AACL,SAAC,GACH,CAAA;AACN;;;;"}
|
package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IAddControlNotificationOptions } from "@talxis/client-libraries";
|
|
3
|
-
interface INotifications {
|
|
4
|
-
notifications: IAddControlNotificationOptions[];
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface INotificationsRef {
|
|
8
|
-
remeasureCommandBar: () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const Notifications: import("react").ForwardRefExoticComponent<INotifications & import("react").RefAttributes<INotificationsRef>>;
|
|
11
|
-
export {};
|
package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useTheme, ThemeProvider, Callout, Text, Link, Icon, PrimaryButton, DefaultButton } from '@fluentui/react';
|
|
3
|
-
import { getNotificationIconStyles } from './styles.js';
|
|
4
|
-
import { forwardRef, useMemo, useState, useRef, useImperativeHandle } from 'react';
|
|
5
|
-
import { useThemeGenerator, CommandBar } from '@talxis/react-components';
|
|
6
|
-
|
|
7
|
-
const Notifications = forwardRef((props, ref) => {
|
|
8
|
-
const { notifications } = { ...props };
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const styles = getNotificationIconStyles();
|
|
11
|
-
const iconId = useMemo(() => `icon${crypto.randomUUID()}`, []);
|
|
12
|
-
const [selectedNotification, setSelectedNotification] = useState(null);
|
|
13
|
-
const commandBarRef = useRef(null);
|
|
14
|
-
const overridenTheme = useThemeGenerator(theme.palette.themePrimary, 'transparent', theme.semanticColors.bodyText);
|
|
15
|
-
useImperativeHandle(ref, () => {
|
|
16
|
-
return {
|
|
17
|
-
remeasureCommandBar: () => {
|
|
18
|
-
commandBarRef.current?.remeasure();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
const getIconName = (notification) => {
|
|
23
|
-
if (notification.iconName) {
|
|
24
|
-
return notification.iconName;
|
|
25
|
-
}
|
|
26
|
-
return notification.notificationLevel === 'ERROR' ? 'Error' : undefined;
|
|
27
|
-
};
|
|
28
|
-
const renderActionButton = (action, buttonType) => {
|
|
29
|
-
const Button = buttonType === 'primary' ? PrimaryButton : DefaultButton;
|
|
30
|
-
return jsx(Button, { text: action.message, iconProps: action?.iconName ? {
|
|
31
|
-
iconName: action.iconName
|
|
32
|
-
} : undefined, onClick: () => action.actions.map(callback => callback()) });
|
|
33
|
-
};
|
|
34
|
-
const renderActions = (actions) => {
|
|
35
|
-
if (actions.length === 0) {
|
|
36
|
-
return jsx(Fragment, {});
|
|
37
|
-
}
|
|
38
|
-
//render actions as buttons
|
|
39
|
-
if (actions.length < 3) {
|
|
40
|
-
return jsx("div", { className: styles.buttons, children: actions.map((action, i) => renderActionButton(action, i === 0 ? 'primary' : 'default')) });
|
|
41
|
-
}
|
|
42
|
-
return jsx(CommandBar, { items: actions.map((action, i) => {
|
|
43
|
-
return {
|
|
44
|
-
key: i.toString(),
|
|
45
|
-
text: action.message,
|
|
46
|
-
commandBarButtonAs: () => jsxs(Link, { onClick: () => action.actions.map(callback => callback()), className: styles.link, children: [action.iconName &&
|
|
47
|
-
jsx(Icon, { iconName: action.iconName }), action.message] }),
|
|
48
|
-
iconProps: {
|
|
49
|
-
iconName: action.iconName
|
|
50
|
-
},
|
|
51
|
-
onClick: () => {
|
|
52
|
-
action.actions.map(callback => callback());
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}) });
|
|
56
|
-
};
|
|
57
|
-
const onNotificationClick = (notification) => {
|
|
58
|
-
if (notification.actions?.length === 1) {
|
|
59
|
-
notification.actions[0].actions.map(callback => callback());
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
setSelectedNotification(notification);
|
|
63
|
-
};
|
|
64
|
-
const getCommandBarItem = (notification) => {
|
|
65
|
-
const icon = getIconName(notification);
|
|
66
|
-
return {
|
|
67
|
-
key: notification.uniqueId,
|
|
68
|
-
text: notification.title,
|
|
69
|
-
title: notification.title,
|
|
70
|
-
onClick: () => onNotificationClick(notification),
|
|
71
|
-
buttonStyles: {
|
|
72
|
-
textContainer: {
|
|
73
|
-
display: notification.compact ? 'none' : undefined
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
iconProps: notification ? {
|
|
77
|
-
iconName: icon,
|
|
78
|
-
styles: {
|
|
79
|
-
root: {
|
|
80
|
-
color: notification.notificationLevel === 'ERROR' ? `${theme.semanticColors.errorIcon} !important` : undefined
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
} : undefined
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
return jsxs("div", { className: `${styles.root}${props.className ? ` ${props.className}` : ''}`, children: [jsx(ThemeProvider, { theme: overridenTheme, applyTo: "none", children: jsx(CommandBar, { overflowItems: notifications.filter(x => x.renderedInOverflow).map(y => getCommandBarItem(y)), theme: overridenTheme, id: iconId, componentRef: commandBarRef, items: notifications.filter(x => !x.renderedInOverflow).map(y => getCommandBarItem(y)) }) }), selectedNotification &&
|
|
87
|
-
jsxs(Callout, { hidden: !selectedNotification, className: styles.callout, onDismiss: () => setSelectedNotification(null), target: `#${iconId}`, children: [selectedNotification.title &&
|
|
88
|
-
jsx(Text, { title: selectedNotification.title, className: styles.calloutTitle, variant: selectedNotification.messages.length > 0 ? 'xLarge' : undefined, children: selectedNotification.title }), jsx(Text, { children: selectedNotification.messages[0] }), selectedNotification.actions &&
|
|
89
|
-
renderActions(selectedNotification.actions)] })] });
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
export { Notifications };
|
|
93
|
-
//# sourceMappingURL=Notifications.js.map
|
package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sources":["../../../../../../../../src/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.tsx"],"sourcesContent":["import { Icon, useTheme, Text, Callout, PrimaryButton, DefaultButton, Link, ICommandBar, ThemeProvider } from \"@fluentui/react\"\nimport { getNotificationIconStyles } from \"./styles\";\nimport { forwardRef, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport { IAddControlNotificationOptions, IControlNotificationAction } from \"@talxis/client-libraries\";\nimport { CommandBar, useThemeGenerator } from \"@talxis/react-components\";\n\ninterface INotifications {\n notifications: IAddControlNotificationOptions[],\n className?: string;\n}\n\nexport interface INotificationsRef {\n remeasureCommandBar: () => void;\n}\n\n\nexport const Notifications = forwardRef<INotificationsRef, INotifications>((props, ref) => {\n const { notifications } = { ...props };\n const theme = useTheme();\n const styles = getNotificationIconStyles(theme);\n const iconId = useMemo(() => `icon${crypto.randomUUID()}`, []);\n const [selectedNotification, setSelectedNotification] = useState<IAddControlNotificationOptions | null>(null);\n const commandBarRef = useRef<ICommandBar>(null);\n const overridenTheme = useThemeGenerator(theme.palette.themePrimary, 'transparent', theme.semanticColors.bodyText);\n\n useImperativeHandle(ref, () => {\n return {\n remeasureCommandBar: () => {\n commandBarRef.current?.remeasure();\n }\n }\n })\n\n const getIconName = (notification: IAddControlNotificationOptions): string | undefined => {\n if (notification.iconName) {\n return notification.iconName;\n }\n return notification.notificationLevel === 'ERROR' ? 'Error' : undefined;\n }\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.buttons}>\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.link}>\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 const getCommandBarItem = (notification: IAddControlNotificationOptions) => {\n const icon = getIconName(notification);\n return {\n key: notification.uniqueId,\n text: notification.title,\n title: notification.title,\n onClick: () => onNotificationClick(notification),\n buttonStyles: {\n textContainer: {\n display: notification.compact ? 'none' : undefined\n }\n },\n iconProps: notification ? {\n iconName: icon,\n styles: {\n root: {\n color: notification.notificationLevel === 'ERROR' ? `${theme.semanticColors.errorIcon} !important` : undefined\n }\n }\n } : undefined\n }\n };\n\n return <div className={`${styles.root}${props.className ? ` ${props.className}` : ''}`}>\n <ThemeProvider theme={overridenTheme} applyTo=\"none\">\n <CommandBar\n overflowItems={notifications.filter(x => x.renderedInOverflow).map(y => getCommandBarItem(y))}\n theme={overridenTheme}\n id={iconId}\n componentRef={commandBarRef}\n items={notifications.filter(x => !x.renderedInOverflow).map(y => getCommandBarItem(y))} />\n </ThemeProvider>\n {selectedNotification &&\n <Callout\n hidden={!selectedNotification}\n className={styles.callout}\n onDismiss={() => setSelectedNotification(null)}\n target={`#${iconId}`}>\n {selectedNotification.title &&\n <Text title={selectedNotification.title} className={styles.calloutTitle} variant={selectedNotification.messages.length > 0 ? 'xLarge' : undefined}>{selectedNotification.title}</Text>\n }\n <Text>{selectedNotification.messages[0]}</Text>\n {selectedNotification.actions &&\n renderActions(selectedNotification.actions)\n }\n </Callout>\n }\n </div>\n});"],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAgBa,MAAA,aAAa,GAAG,UAAU,CAAoC,CAAC,KAAK,EAAE,GAAG,KAAI;IACtF,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;AACvC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AACzB,IAAA,MAAM,MAAM,GAAG,yBAAyB,CAAM,CAAC,CAAC;AAChD,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,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEnH,IAAA,mBAAmB,CAAC,GAAG,EAAE,MAAK;QAC1B,OAAO;YACH,mBAAmB,EAAE,MAAK;AACtB,gBAAA,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;aACtC;SACJ,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,MAAM,WAAW,GAAG,CAAC,YAA4C,KAAwB;QACrF,IAAI,YAAY,CAAC,QAAQ,EAAE;YACvB,OAAO,YAAY,CAAC,QAAQ,CAAC;AAChC,SAAA;AACD,QAAA,OAAO,YAAY,CAAC,iBAAiB,KAAK,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAC5E,KAAC,CAAA;AAED,IAAA,MAA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A,CAAA,oBAAoB,CAAC,KAAK;4BACvBD,GAAC,CAAA,IAAI,IAAC,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,GAAG,SAAS,YAAG,oBAAoB,CAAC,KAAK,EAAA,CAAQ,EAE1LA,GAAA,CAAC,IAAI,EAAE,EAAA,QAAA,EAAA,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAQ,CAAA,EAC9C,oBAAoB,CAAC,OAAO;AACzB,4BAAA,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA,EAAA,CAEzC,IAEZ,CAAA;AACV,CAAC;;;;"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ITheme } from "@fluentui/react";
|
|
2
|
-
export declare const getNotificationIconStyles: (theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
|
|
3
|
-
callout: {
|
|
4
|
-
width: number;
|
|
5
|
-
padding: string;
|
|
6
|
-
'.ms-Callout-main': {
|
|
7
|
-
display: string;
|
|
8
|
-
flexDirection: string;
|
|
9
|
-
gap: number;
|
|
10
|
-
'.ms-CommandBar-primaryCommand': {
|
|
11
|
-
gap: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
calloutTitle: {
|
|
16
|
-
overflow: string;
|
|
17
|
-
textOverflow: string;
|
|
18
|
-
};
|
|
19
|
-
link: {
|
|
20
|
-
i: {
|
|
21
|
-
position: string;
|
|
22
|
-
top: number;
|
|
23
|
-
marginRight: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
buttons: {
|
|
27
|
-
display: string;
|
|
28
|
-
justifyContent: string;
|
|
29
|
-
gap: number;
|
|
30
|
-
};
|
|
31
|
-
root: {
|
|
32
|
-
'.ms-CommandBar-primaryCommand': {
|
|
33
|
-
justifyContent: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}>;
|