@talxis/base-controls 1.2501.10 → 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/DateTime/translations.d.ts +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/Duration/durationOptions.d.ts +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 +41 -6
- 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 +17 -8
- 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/GridDependency.d.ts +1 -1
- package/dist/components/Grid/core/model/Metadata.d.ts +3 -2
- 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.d.ts +1 -1
- 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/interfaces.d.ts +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/Sorting.d.ts +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/Grid/sorting/controllers/useColumnSortingController.d.ts +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/hooks/useFetchXml.d.ts +1 -1
- package/dist/components/Lookup/hooks/useLookup.d.ts +1 -1
- package/dist/components/Lookup/interfaces.d.ts +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/useControlSizing.d.ts +1 -1
- 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 +453 -141
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/context.d.ts +3 -2
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/property.d.ts +6 -1
- 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 +2 -2
- package/dist/utils/theme/ControlTheme.js +1 -1
- package/dist/utils/theme/ControlTheme.js.map +1 -1
- package/dist/utils/theme/components/ThemeWrapper.d.ts +9 -0
- package/dist/utils/theme/components/ThemeWrapper.js +11 -0
- package/dist/utils/theme/components/ThemeWrapper.js.map +1 -0
- package/dist/utils/theme/components/index.d.ts +1 -0
- package/dist/utils/theme/components/index.js +2 -0
- package/dist/utils/theme/components/index.js.map +1 -0
- package/dist/utils/theme/hooks/useControlTheme.d.ts +1 -1
- package/dist/utils/theme/hooks/useControlTheme.js.map +1 -1
- package/dist/utils/theme/index.d.ts +1 -0
- package/dist/utils/theme/index.js +1 -0
- package/dist/utils/theme/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js +0 -82
- package/dist/components/Grid/core/components/Cell/EditableCell/EditableCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js +0 -93
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/Notifications.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.d.ts +0 -36
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js +0 -42
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/Notifications/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.d.ts +0 -11
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js +0 -221
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyCell.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.d.ts +0 -10
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js +0 -49
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/ReadOnlyOptionSet.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js +0 -27
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/ReadOnlyOptionSet/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.d.ts +0 -99
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js +0 -123
- package/dist/components/Grid/core/components/Cell/ReadOnlyCell/styles.js.map +0 -1
- package/dist/components/Grid/core/components/Component/Component.js.map +0 -1
- package/dist/components/Grid/core/components/Component/controller/useComponentController.js.map +0 -1
- package/dist/components/Grid/core/components/Component/model/Component.js.map +0 -1
- package/dist/components/Grid/core/model/Metadata.js +0 -26
- package/dist/components/Grid/core/model/Metadata.js.map +0 -1
- package/dist/components/Grid/selection/controllers/useSelectionController.d.ts +0 -11
- package/dist/components/Grid/selection/controllers/useSelectionController.js +0 -21
- package/dist/components/Grid/selection/controllers/useSelectionController.js.map +0 -1
- package/dist/hooks/useRerender.d.ts +0 -1
- package/dist/hooks/useRerender.js +0 -9
- package/dist/hooks/useRerender.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridCellRenderer.js","sources":["../../../src/components/GridCellRenderer/GridCellRenderer.tsx"],"sourcesContent":["import { Icon, IIconProps, ILinkProps, Image, Link, SpinnerSize, ThemeProvider } from \"@fluentui/react\";\nimport { useControl } from \"../../hooks\";\nimport { useMemo, useState } from \"react\";\nimport { getDefaultContentRendererStyles, getGridCellLabelStyles } from \"./styles\";\nimport { Attribute, Client, DataType, DataTypes, FetchXmlDataProvider, FileAttribute, IRecord, Sanitizer } from \"@talxis/client-libraries\";\nimport { OptionSet } from './OptionSet';\nimport { IGridCellRenderer } from \"./interfaces\";\nimport { getDefaultGridRendererTranslations } from \"./translations\";\nimport { ComponentPropsContext } from \"./useComponentProps\";\nimport { DefaultContentRenderer } from \"./DefaultContentRenderer\";\nimport { getClassNames, Spinner } from \"@talxis/react-components\";\n\nconst client = new Client();\n\nexport const GridCellRenderer = (props: IGridCellRenderer) => {\n const dataset = props.parameters.Dataset.raw;\n const context = props.context;\n const record: IRecord = props.parameters.Record.raw;\n const column = props.parameters.Column.raw;\n const columnAlignment = props.parameters.ColumnAlignment.raw;\n const dataType: DataType = props.parameters.value.type as DataType;\n const { theme, sizing } = useControl('GridCellLabel', props, getDefaultGridRendererTranslations());\n const styles = useMemo(() => getGridCellLabelStyles(columnAlignment ?? 'left', dataType, sizing.height!, theme), [columnAlignment, dataType, sizing.height, theme]);\n const defaultContentRendererStyles = useMemo(() => getDefaultContentRendererStyles(theme, dataType, sizing.height!), [theme, dataType, sizing.height]);\n const value = props.parameters.value.raw;\n const formattedValue: string = props.parameters.value.formatted;\n const isNavigationEnabled = props.parameters.EnableNavigation.raw;\n const prefixIcon = props.parameters.PrefixIcon?.raw\n const suffixIcon = props.parameters.SuffixIcon?.raw;\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n const [downloadInProgress, setIsDownloadInProgress] = useState(false);\n\n const getLinkProps = (): ILinkProps => {\n const props: ILinkProps = {\n title: formattedValue,\n className: styles.link,\n rel: 'noopener noreferrer',\n children: formattedValue,\n disabled: downloadInProgress\n }\n switch (dataType) {\n case DataTypes.SingleLineEmail: {\n props.href = `mailto:${value}`;\n break;\n }\n case DataTypes.SingleLinePhone: {\n props.href = `tel:${value}`;\n break;\n }\n case DataTypes.SingleLineUrl: {\n props.href = value;\n props.target = '_blank';\n break;\n }\n case DataTypes.Image:\n case DataTypes.File: {\n props.href = value.fileUrl;\n props.download = value.fileName;\n if (dataType === 'Image') {\n props.title = value.fileName;\n props.children = value.fileName;\n }\n if (shouldUsePortalDownload()) {\n props.onClick = (e) => downloadPortalFile(e);\n }\n break;\n }\n case DataTypes.LookupCustomer:\n case DataTypes.LookupOwner:\n case DataTypes.LookupSimple:\n case DataTypes.LookupRegarding: {\n props.onClick = () => {\n dataset.openDatasetItem(Sanitizer.Lookup.getEntityReference(value[0]))\n }\n break;\n }\n //primary navigation link\n default: {\n props.onClick = () => {\n dataset.openDatasetItem(record.getNamedReference());\n }\n }\n }\n return props;\n }\n\n\n //matching could be improved\n const getIconNameForMimeType = (mimeType?: string) => {\n if (!mimeType) {\n return 'Attach';\n }\n const icon_classes: any = {\n image: \"Photo2\",\n audio: \"MusicNote\",\n video: \"Video\",\n \"application/pdf\": \"PDF\",\n \"application/msword\": \"WordDocument\",\n \"application/vnd.ms-word\": \"WordDocument\",\n \"application/vnd.oasis.opendocument.text\": \"WordDocument\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml\": \"WordDocument\",\n \"application/vnd.ms-excel\": \"ExcelDocument\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml\": \"ExcelDocument\",\n \"application/vnd.oasis.opendocument.spreadsheet\": \"ExcelDocument\",\n \"application/vnd.ms-powerpoint\": \"PowerPointDocument\",\n \"application/vnd.openxmlformats-officedocument.presentationml\": \"PowerPointDocument\",\n \"application/vnd.oasis.opendocument.presentation\": \"PowerPointDocument\",\n \"text/plain\": \"TextDocument\",\n \"text/html\": \"FileCode\",\n \"application/json\": \"FileCode\",\n // Archives\n \"application/gzip\": \"ZipFolder\",\n \"application/zip\": \"ZipFolder\"\n };\n\n if (icon_classes[mimeType]) {\n return icon_classes[mimeType];\n }\n else if (icon_classes[mimeType.split(\"/\")[0]]) {\n return icon_classes[mimeType.split(\"/\")[0]];\n }\n return 'Attach';\n }\n\n const renderContent = () => {\n if (!formattedValue) {\n return <DefaultContentRenderer />\n }\n if (column.isPrimary && isNavigationEnabled) {\n return <Link {...componentProps.onGetLinkProps(getLinkProps())}>{formattedValue}</Link>\n }\n switch (dataType) {\n case DataTypes.SingleLineEmail:\n case DataTypes.SingleLinePhone:\n case DataTypes.SingleLineUrl:\n case DataTypes.LookupCustomer:\n case DataTypes.LookupOwner:\n case DataTypes.LookupSimple:\n case DataTypes.LookupRegarding: {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</Link>\n }\n case DataTypes.OptionSet:\n case DataTypes.MultiSelectOptionSet:\n case DataTypes.TwoOptions: {\n return <OptionSet context={props.context} parameters={{ ...props.parameters }} />\n }\n case DataTypes.File:\n case DataTypes.Image: {\n return renderFileLink(dataType === 'Image');\n }\n }\n return <DefaultContentRenderer />\n }\n\n const shouldUsePortalDownload = () => {\n const isFetchXmlDataProvider = dataset.getDataProvider() instanceof FetchXmlDataProvider;\n //only use portal download if within portal, uses fetch xml provider and is not virtual column\n if(client.isTalxisPortal() && isFetchXmlDataProvider && !column.name.endsWith('__virtual')) {\n return true;\n }\n return false;\n }\n\n const renderFileLink = (isImage?: boolean) => {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return (<div {...componentProps.fileProps.containerProps}>\n {!downloadInProgress &&\n <>\n {!isImage &&\n <Icon {...componentProps.fileProps.iconProps} iconName={componentProps.fileProps.iconProps.onGetIconName(getIconNameForMimeType(value.mimeType))} />\n }\n {isImage &&\n <Image {...componentProps.fileProps.imageProps} src={getThumbnailUrl()} />\n }\n </>\n }\n {downloadInProgress &&\n <Spinner {...componentProps.fileProps.loadingProps.spinnerProps} />\n }\n <Link {...linkProps}>{linkProps.children}</Link>\n </div>);\n }\n\n const getIconProps = (json?: string | null): IIconProps | undefined => {\n if (!json) {\n return undefined;\n }\n return JSON.parse(json);\n }\n\n const getThumbnailUrl = () => {\n let src = value.thumbnailUrl;\n if (client.isTalxisPortal()) {\n src = `data:${value.mimeType};base64,${value.fileContent}`\n }\n return componentProps.fileProps.imageProps.onGetSrc(src);\n }\n\n const downloadPortalFile = async (e: React.MouseEvent<HTMLAnchorElement | HTMLElement | HTMLButtonElement, MouseEvent>) => {\n e.preventDefault();\n setIsDownloadInProgress(true);\n const storage = new FileAttribute(context.webAPI);\n let entityName = dataset.getTargetEntityType();\n let recordId = record.getRecordId();\n let attributeName = Attribute.GetNameFromAlias(column.name);\n const entityAliasName = Attribute.GetLinkedEntityAlias(column.name);\n\n if (entityAliasName) {\n entityName = dataset.linking.getLinkedEntities().find(x => x.alias === entityAliasName)!.name;\n const entityMetadata = await context.utils.getEntityMetadata(entityName, []);\n recordId = record.getRawData()![`${entityAliasName}.${entityMetadata.PrimaryIdAttribute}`];\n }\n await storage.downloadFileFromAttribute({\n entityName: entityName,\n recordId: recordId,\n fileAttribute: attributeName\n }, true, undefined, {\n fileName: value.fileName,\n fileSizeInBytes: value.fileSize\n })\n setIsDownloadInProgress(false);\n }\n\n const componentProps = onOverrideComponentProps({\n onGetLinkProps: (props) => props,\n onGetOptionSetProps: (props) => props,\n rootContainerProps: {\n theme: theme,\n className: styles.root\n },\n contentWrapperProps: {\n className: styles.contentWrapper,\n },\n textProps: {\n className: getClassNames([defaultContentRendererStyles.content, !formattedValue ? defaultContentRendererStyles.placeholder : undefined]),\n title: formattedValue,\n children: column.type === 'action' ? '' : (formattedValue || '---')\n },\n fileProps: {\n containerProps: {\n className: styles.fileWrapper\n },\n iconProps: {\n className: styles.fileIcon,\n onGetIconName: (iconName) => iconName\n },\n imageProps: {\n className: styles.fileImage,\n onGetSrc: (src) => src\n },\n loadingProps: {\n spinnerProps: {\n size: SpinnerSize.small,\n styles: {\n circle: styles.loadingSpinnerCircle\n }\n }\n }\n }\n });\n\n const componentPropsProviderValue = useMemo(() => {\n return {\n current: componentProps\n }\n }, []);\n componentPropsProviderValue.current = componentProps;\n\n //this allows to add prefix/sufix icon without the need of cell customizer\n //it can cover a lot of cases where otherwise custom PCF would be needed\n const prefixIconProps = getIconProps(prefixIcon);\n const suffixIconProps = getIconProps(suffixIcon)\n\n return <ThemeProvider {...componentProps.rootContainerProps}>\n <ComponentPropsContext.Provider value={componentPropsProviderValue}>\n {prefixIconProps && <Icon {...prefixIconProps} className={getClassNames([prefixIconProps.className, styles.icon])} />}\n <div {...componentProps.contentWrapperProps}>\n {componentProps.contentWrapperProps.children ?? renderContent()}\n </div>\n {suffixIconProps && <Icon {...suffixIconProps} className={getClassNames([suffixIconProps.className, styles.icon])} />}\n </ComponentPropsContext.Provider>\n </ThemeProvider>\n}\n\n\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;AAYA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEf,MAAA,gBAAgB,GAAG,CAAC,KAAwB,KAAI;IACzD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC;AAC7C,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,MAAM,MAAM,GAAY,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;IAC3C,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,CAAC;IAC7D,MAAM,QAAQ,GAAa,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAgB,CAAC;AACnE,IAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,eAAe,EAAE,KAAK,EAAE,kCAAkC,EAAE,CAAC,CAAC;AACnG,IAAA,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C7D,eAAe,IAAID,GAAC,CAAA,IAAI,OAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAI,CAAA,EACrHA,GAAS,CAAA,KAAA,EAAA,EAAA,GAAA,cAAc,CAAC,mBAAmB,EAAA,QAAA,EACtC,cAAc,CAAC,mBAAmB,CAAC,QAAQ,IAAI,aAAa,EAAE,EAC7D,CAAA,EACL,eAAe,IAAIA,IAAC,IAAI,EAAA,EAAA,GAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAI,CAAA,CAAA,EAAA,CACxF,GACrB,CAAA;AACpB;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IOptionSet } from "../../OptionSet";
|
|
3
|
+
import { IMultiSelectOptionSet } from "../../MultiSelectOptionSet";
|
|
4
|
+
import { ITwoOptions } from "../../TwoOptions";
|
|
5
|
+
export declare const OptionSet: (props: IOptionSet | IMultiSelectOptionSet | ITwoOptions) => JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTheme, ThemeProvider, Text } from '@fluentui/react';
|
|
3
|
+
import { Theming, useThemeGenerator } from '@talxis/react-components';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { getOptionSetStyles, getColorfulOptionStyles } from './styles.js';
|
|
6
|
+
import { useComponentProps } from '../useComponentProps.js';
|
|
7
|
+
import { DefaultContentRenderer } from '../DefaultContentRenderer/DefaultContentRenderer.js';
|
|
8
|
+
|
|
9
|
+
const OptionSet = (props) => {
|
|
10
|
+
const dataType = props.parameters.value.type;
|
|
11
|
+
const options = props.parameters.value.attributes.Options;
|
|
12
|
+
const value = props.parameters.value.raw;
|
|
13
|
+
const styles = useMemo(() => getOptionSetStyles(), []);
|
|
14
|
+
const componentProps = useComponentProps();
|
|
15
|
+
const optionSetProps = componentProps.onGetOptionSetProps({
|
|
16
|
+
containerProps: {
|
|
17
|
+
className: styles.root
|
|
18
|
+
},
|
|
19
|
+
onGetOptionProps: (props) => props
|
|
20
|
+
});
|
|
21
|
+
const shouldRenderDefaultLabel = () => {
|
|
22
|
+
if (!props.parameters.EnableOptionSetColors?.raw || !options.some(option => option.Color)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
27
|
+
const getSelectedOptions = () => {
|
|
28
|
+
let result = value ?? [];
|
|
29
|
+
switch (dataType) {
|
|
30
|
+
case 'OptionSet': {
|
|
31
|
+
result = [value];
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case 'TwoOptions': {
|
|
35
|
+
result = [+value];
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return options.filter(option => result?.includes(option.Value)) ?? [];
|
|
40
|
+
};
|
|
41
|
+
if (shouldRenderDefaultLabel()) {
|
|
42
|
+
return jsx(DefaultContentRenderer, {});
|
|
43
|
+
}
|
|
44
|
+
return (jsx("div", { ...optionSetProps.containerProps, children: getSelectedOptions().map(option => {
|
|
45
|
+
return jsx(ColorfulOption, { optionSetProps: optionSetProps, option: option, context: props.context }, option.Value);
|
|
46
|
+
}) }));
|
|
47
|
+
};
|
|
48
|
+
const ColorfulOption = (props) => {
|
|
49
|
+
const theme = useTheme();
|
|
50
|
+
const option = props.option;
|
|
51
|
+
const backgroundColor = option.Color ?? theme.palette.neutralLight;
|
|
52
|
+
const textColor = Theming.GetTextColorForBackground(backgroundColor);
|
|
53
|
+
const styles = useMemo(() => getColorfulOptionStyles(), []);
|
|
54
|
+
const optionTheme = useThemeGenerator(textColor, backgroundColor, textColor, props.context.fluentDesignLanguage?.v8FluentOverrides);
|
|
55
|
+
const optionProps = props.optionSetProps.onGetOptionProps({
|
|
56
|
+
containerProps: {
|
|
57
|
+
className: styles.option,
|
|
58
|
+
theme: optionTheme
|
|
59
|
+
},
|
|
60
|
+
option: option,
|
|
61
|
+
textProps: {
|
|
62
|
+
children: option.Label
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return (jsx(ThemeProvider, { ...optionProps.containerProps, children: jsx(Text, { ...optionProps.textProps, children: optionProps.textProps.children }) }));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { OptionSet };
|
|
69
|
+
//# sourceMappingURL=OptionSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionSet.js","sources":["../../../../src/components/GridCellRenderer/OptionSet/OptionSet.tsx"],"sourcesContent":["import { DataType } from \"@talxis/client-libraries\";\nimport { IOptionSet } from \"../../OptionSet\"\nimport { IMultiSelectOptionSet } from \"../../MultiSelectOptionSet\";\nimport { ITwoOptions } from \"../../TwoOptions\";\nimport { ThemeProvider, useTheme } from \"@fluentui/react\";\nimport { Theming, useThemeGenerator } from \"@talxis/react-components\";\nimport { Text } from '@fluentui/react';\nimport { IContext } from \"../../../interfaces\";\nimport { useMemo } from \"react\";\nimport { getColorfulOptionStyles, getOptionSetStyles } from \"./styles\";\nimport { useComponentProps } from \"../useComponentProps\";\nimport { IOptionSetProps } from \"../interfaces\";\nimport { DefaultContentRenderer } from \"../DefaultContentRenderer\";\n\nexport const OptionSet = (props: IOptionSet | IMultiSelectOptionSet | ITwoOptions) => {\n const dataType: DataType = props.parameters.value.type as DataType;\n const options = props.parameters.value.attributes.Options;\n const value: any = props.parameters.value.raw;\n const styles = useMemo(() => getOptionSetStyles(), []);\n const componentProps = useComponentProps();\n\n const optionSetProps = componentProps.onGetOptionSetProps({\n containerProps: {\n className: styles.root\n },\n onGetOptionProps: (props) => props\n })\n\n const shouldRenderDefaultLabel = () => {\n if (!props.parameters.EnableOptionSetColors?.raw || !options.some(option => option.Color)) {\n return true;\n }\n return false;\n }\n\n const getSelectedOptions = () => {\n let result: any = value ?? [];\n switch (dataType) {\n case 'OptionSet': {\n result = [value]\n break;\n }\n case 'TwoOptions': {\n result = [+value];\n break;\n }\n }\n return options.filter(option => result?.includes(option.Value)) ?? [];\n }\n\n if (shouldRenderDefaultLabel()) {\n return <DefaultContentRenderer />\n }\n return (<div {...optionSetProps.containerProps}>\n {getSelectedOptions().map(option => {\n return <ColorfulOption\n key={option.Value}\n optionSetProps={optionSetProps}\n option={option}\n context={props.context} />\n })}\n </div>)\n}\n\nconst ColorfulOption = (props: {\n option: ComponentFramework.PropertyHelper.OptionMetadata,\n context: IContext;\n optionSetProps: IOptionSetProps\n}) => {\n const theme = useTheme();\n const option = props.option;\n const backgroundColor = option.Color ?? theme.palette.neutralLight;\n const textColor = Theming.GetTextColorForBackground(backgroundColor);\n const styles = useMemo(() => getColorfulOptionStyles(), []);\n const optionTheme = useThemeGenerator(textColor, backgroundColor, textColor, props.context.fluentDesignLanguage?.v8FluentOverrides);\n\n const optionProps = props.optionSetProps.onGetOptionProps({\n containerProps: {\n className: styles.option,\n theme: optionTheme\n },\n option: option,\n textProps: {\n children: option.Label\n }\n })\n\n return (\n <ThemeProvider {...optionProps.containerProps}>\n <Text {...optionProps.textProps}>{optionProps.textProps.children}</Text>\n </ThemeProvider>\n )\n}"],"names":["_jsx"],"mappings":";;;;;;;;AAca,MAAA,SAAS,GAAG,CAAC,KAAuD,KAAI;IACjF,MAAM,QAAQ,GAAa,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAgB,CAAC;IACnE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;IAC1D,MAAM,KAAK,GAAQ,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9C,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,kBAAkB,EAAE,EAAE,EAAE,CAAC,CAAC;AACvD,IAAA,MAAM,cAAc,GAAG,iBAAiB,EAAE,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|
+
export * from './OptionSet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
root: {
|
|
3
|
-
display: string;
|
|
4
|
-
gap: number;
|
|
5
|
-
overflow: string;
|
|
6
|
-
'--light': number;
|
|
7
|
-
'--threshold': number;
|
|
8
|
-
flexGrow: number;
|
|
9
|
-
};
|
|
1
|
+
export declare const getColorfulOptionStyles: () => import("@fluentui/react").IProcessedStyleSet<{
|
|
10
2
|
option: {
|
|
11
3
|
borderRadius: number;
|
|
4
|
+
padding: number;
|
|
12
5
|
paddingLeft: number;
|
|
13
6
|
paddingRight: number;
|
|
14
7
|
overflow: string;
|
|
15
8
|
textOverflow: string;
|
|
16
9
|
flexGrow: number;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const getOptionSetStyles: () => import("@fluentui/react").IProcessedStyleSet<{
|
|
13
|
+
root: {
|
|
14
|
+
gap: number;
|
|
15
|
+
display: string;
|
|
16
|
+
overflow: string;
|
|
17
|
+
flexGrow: number;
|
|
17
18
|
textAlign: string;
|
|
18
|
-
'>span': {
|
|
19
|
-
color: string;
|
|
20
|
-
};
|
|
21
19
|
};
|
|
22
20
|
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
+
|
|
3
|
+
const getColorfulOptionStyles = () => {
|
|
4
|
+
return mergeStyleSets({
|
|
5
|
+
option: {
|
|
6
|
+
borderRadius: 5,
|
|
7
|
+
padding: 2,
|
|
8
|
+
paddingLeft: 4,
|
|
9
|
+
paddingRight: 4,
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
textOverflow: 'ellipsis',
|
|
12
|
+
flexGrow: 1,
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const getOptionSetStyles = () => {
|
|
17
|
+
return mergeStyleSets({
|
|
18
|
+
root: {
|
|
19
|
+
gap: 5,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
overflow: 'hidden',
|
|
22
|
+
flexGrow: 1,
|
|
23
|
+
textAlign: 'center'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { getColorfulOptionStyles, getOptionSetStyles };
|
|
29
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/GridCellRenderer/OptionSet/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\n\nexport const getColorfulOptionStyles = () => {\n return mergeStyleSets({\n option: {\n borderRadius: 5,\n padding: 2,\n paddingLeft: 4,\n paddingRight: 4,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n flexGrow: 1,\n }\n })\n}\n\nexport const getOptionSetStyles = () => {\n return mergeStyleSets({\n root: {\n gap: 5,\n display: 'flex',\n overflow: 'hidden',\n flexGrow: 1,\n textAlign: 'center'\n }\n })\n}"],"names":[],"mappings":";;AAEO,MAAM,uBAAuB,GAAG,MAAK;AACxC,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,MAAM,EAAE;AACJ,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AACxB,YAAA,QAAQ,EAAE,CAAC;AACd,SAAA;AACJ,KAAA,CAAC,CAAA;AACN,EAAC;AAEM,MAAM,kBAAkB,GAAG,MAAK;AACnC,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,IAAI,EAAE;AACF,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,QAAQ,EAAE,CAAC;AACX,YAAA,SAAS,EAAE,QAAQ;AACtB,SAAA;AACJ,KAAA,CAAC,CAAA;AACN;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GridCellRenderer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="@types/powerapps-component-framework" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import { IColumn, IDataset, IRecord } from "@talxis/client-libraries";
|
|
4
|
+
import { IControl, IParameters, IStringProperty, ITwoOptionsProperty } from "../../interfaces";
|
|
5
|
+
import { getDefaultGridRendererTranslations } from "./translations";
|
|
6
|
+
import { IIconProps, IImageProps, ILinkProps, ISpinnerProps, ITextProps, ThemeProviderProps } from "@fluentui/react";
|
|
7
|
+
export interface IGridCellRenderer extends IControl<IGridCellRendererParameters, {}, ReturnType<typeof getDefaultGridRendererTranslations>, IGridCellRendererComponentProps> {
|
|
8
|
+
}
|
|
9
|
+
export interface IGridCellRendererParameters extends IParameters {
|
|
10
|
+
value: any;
|
|
11
|
+
ColumnAlignment: Omit<ComponentFramework.PropertyTypes.EnumProperty<"left" | "center" | "right">, 'type'>;
|
|
12
|
+
CellType: Omit<ComponentFramework.PropertyTypes.EnumProperty<"renderer" | "editor">, 'type'>;
|
|
13
|
+
EnableNavigation: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
14
|
+
PrefixIcon?: IStringProperty;
|
|
15
|
+
SuffixIcon?: IStringProperty;
|
|
16
|
+
Column: {
|
|
17
|
+
raw: IColumn;
|
|
18
|
+
};
|
|
19
|
+
Dataset: {
|
|
20
|
+
raw: IDataset;
|
|
21
|
+
};
|
|
22
|
+
Record: {
|
|
23
|
+
raw: IRecord;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface IOptionSetProps {
|
|
27
|
+
containerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
onGetOptionProps: (props: IOptionProps) => IOptionProps;
|
|
29
|
+
}
|
|
30
|
+
export interface IOptionProps {
|
|
31
|
+
containerProps: ThemeProviderProps;
|
|
32
|
+
option: ComponentFramework.PropertyHelper.OptionMetadata;
|
|
33
|
+
textProps: ITextProps;
|
|
34
|
+
}
|
|
35
|
+
export interface IGridCellRendererComponentProps {
|
|
36
|
+
onGetOptionSetProps: (props: IOptionSetProps) => IOptionSetProps;
|
|
37
|
+
onGetLinkProps: (props: ILinkProps) => ILinkProps;
|
|
38
|
+
rootContainerProps: ThemeProviderProps;
|
|
39
|
+
contentWrapperProps: React.HTMLAttributes<HTMLDivElement>;
|
|
40
|
+
textProps: ITextProps;
|
|
41
|
+
fileProps: {
|
|
42
|
+
containerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
43
|
+
iconProps: Omit<IIconProps, 'iconName'> & {
|
|
44
|
+
onGetIconName: (iconName: string) => string;
|
|
45
|
+
};
|
|
46
|
+
imageProps: Omit<IImageProps, 'src'> & {
|
|
47
|
+
onGetSrc: (src: string) => string;
|
|
48
|
+
};
|
|
49
|
+
loadingProps: {
|
|
50
|
+
spinnerProps: ISpinnerProps;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DataType, IColumn } from "@talxis/client-libraries";
|
|
2
|
+
import { ITheme } from "@talxis/react-components";
|
|
3
|
+
export declare const getGridCellLabelStyles: (columnAlignment: IColumn['alignment'], dataType: DataType, rowHeight: number, theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
|
|
4
|
+
root: {
|
|
5
|
+
display: string;
|
|
6
|
+
alignItems: string;
|
|
7
|
+
height: number;
|
|
8
|
+
paddingLeft: number;
|
|
9
|
+
paddingRight: number;
|
|
10
|
+
justifyContent: string | undefined;
|
|
11
|
+
gap: number;
|
|
12
|
+
};
|
|
13
|
+
fileWrapper: {
|
|
14
|
+
display: string;
|
|
15
|
+
gap: number;
|
|
16
|
+
overflow: string;
|
|
17
|
+
textOverflow: string;
|
|
18
|
+
alignItems: string;
|
|
19
|
+
};
|
|
20
|
+
contentWrapper: {
|
|
21
|
+
flexGrow: number;
|
|
22
|
+
textAlign: "left" | "right" | "center" | undefined;
|
|
23
|
+
overflow: string;
|
|
24
|
+
textOverflow: string;
|
|
25
|
+
};
|
|
26
|
+
fileImage: {
|
|
27
|
+
marginRight: number;
|
|
28
|
+
flexShrink: number;
|
|
29
|
+
img: {
|
|
30
|
+
width: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
link: {
|
|
34
|
+
lineHeight?: string | undefined;
|
|
35
|
+
display?: string | undefined;
|
|
36
|
+
whiteSpace?: string | undefined;
|
|
37
|
+
'-webkit-box-orient'?: string | undefined;
|
|
38
|
+
wordBreak?: string | undefined;
|
|
39
|
+
'-webkit-line-clamp'?: string | undefined;
|
|
40
|
+
maxWidth: string;
|
|
41
|
+
overflow: string;
|
|
42
|
+
textOverflow: string;
|
|
43
|
+
};
|
|
44
|
+
icon: {
|
|
45
|
+
img: {
|
|
46
|
+
width: number;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
fileIcon: {
|
|
50
|
+
fontSize: number;
|
|
51
|
+
};
|
|
52
|
+
loadingSpinnerCircle: {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
export declare const getDefaultContentRendererStyles: (theme: ITheme, dataType: DataType, rowHeight: number) => import("@fluentui/react").IProcessedStyleSet<{
|
|
58
|
+
content: {
|
|
59
|
+
lineHeight?: string | undefined;
|
|
60
|
+
display?: string | undefined;
|
|
61
|
+
whiteSpace?: string | undefined;
|
|
62
|
+
'-webkit-box-orient'?: string | undefined;
|
|
63
|
+
wordBreak?: string | undefined;
|
|
64
|
+
'-webkit-line-clamp'?: string | undefined;
|
|
65
|
+
overflow: string;
|
|
66
|
+
textOverflow: string;
|
|
67
|
+
flexGrow: number;
|
|
68
|
+
};
|
|
69
|
+
placeholder: {
|
|
70
|
+
color: string;
|
|
71
|
+
};
|
|
72
|
+
}>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { mergeStyleSets } from '@fluentui/react';
|
|
2
|
+
|
|
3
|
+
const getGridCellLabelStyles = (columnAlignment, dataType, rowHeight, theme) => {
|
|
4
|
+
return mergeStyleSets({
|
|
5
|
+
root: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
height: rowHeight + 1,
|
|
9
|
+
paddingLeft: 8,
|
|
10
|
+
paddingRight: 8,
|
|
11
|
+
justifyContent: getJustifyContent(columnAlignment),
|
|
12
|
+
gap: 10,
|
|
13
|
+
},
|
|
14
|
+
fileWrapper: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
gap: 5,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
textOverflow: 'ellipsis',
|
|
19
|
+
alignItems: 'center'
|
|
20
|
+
},
|
|
21
|
+
contentWrapper: {
|
|
22
|
+
flexGrow: 1,
|
|
23
|
+
textAlign: columnAlignment,
|
|
24
|
+
overflow: 'hidden',
|
|
25
|
+
textOverflow: 'ellipsis'
|
|
26
|
+
},
|
|
27
|
+
fileImage: {
|
|
28
|
+
marginRight: 5,
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
'img': {
|
|
31
|
+
width: 32
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
link: {
|
|
35
|
+
maxWidth: '100%',
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
textOverflow: 'ellipsis',
|
|
38
|
+
...(isMultiple(dataType) ? getMultilineStyles(rowHeight, theme) : {})
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
'img': {
|
|
42
|
+
width: 20
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
fileIcon: {
|
|
46
|
+
fontSize: 18
|
|
47
|
+
},
|
|
48
|
+
loadingSpinnerCircle: {
|
|
49
|
+
width: 20,
|
|
50
|
+
height: 20
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const getDefaultContentRendererStyles = (theme, dataType, rowHeight) => {
|
|
55
|
+
return mergeStyleSets({
|
|
56
|
+
content: {
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
textOverflow: 'ellipsis',
|
|
59
|
+
flexGrow: 1,
|
|
60
|
+
...(isMultiple(dataType) ? getMultilineStyles(rowHeight, theme) : {})
|
|
61
|
+
},
|
|
62
|
+
placeholder: {
|
|
63
|
+
color: theme.semanticColors.inputPlaceholderText
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const getJustifyContent = (columnAlignment) => {
|
|
68
|
+
switch (columnAlignment) {
|
|
69
|
+
case 'left': {
|
|
70
|
+
return 'flex-start';
|
|
71
|
+
}
|
|
72
|
+
case 'center': {
|
|
73
|
+
return 'center';
|
|
74
|
+
}
|
|
75
|
+
case 'right': {
|
|
76
|
+
return 'flex-end';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const getMultilineStyles = (rowHeight, theme) => {
|
|
81
|
+
let fontSize = 20;
|
|
82
|
+
const themeFontSize = theme.fonts.medium.fontSize;
|
|
83
|
+
theme.fonts.medium.lineHeight;
|
|
84
|
+
if (typeof themeFontSize === 'number') {
|
|
85
|
+
fontSize = themeFontSize;
|
|
86
|
+
}
|
|
87
|
+
else if (typeof themeFontSize === 'string' && themeFontSize.endsWith('px')) {
|
|
88
|
+
fontSize = parseInt(themeFontSize.replace('px', ''));
|
|
89
|
+
}
|
|
90
|
+
const clamp = Math.floor(rowHeight / fontSize) - 1;
|
|
91
|
+
return {
|
|
92
|
+
lineHeight: '1.2',
|
|
93
|
+
display: '-webkit-box',
|
|
94
|
+
whiteSpace: 'normal',
|
|
95
|
+
'-webkit-box-orient': 'vertical',
|
|
96
|
+
wordBreak: 'break-all',
|
|
97
|
+
'-webkit-line-clamp': clamp.toString(),
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const isMultiple = (dataType) => {
|
|
101
|
+
return dataType === 'Multiple' || dataType === 'SingleLine.TextArea';
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { getDefaultContentRendererStyles, getGridCellLabelStyles };
|
|
105
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/GridCellRenderer/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\nimport { DataType, IColumn } from \"@talxis/client-libraries\";\nimport { ITheme } from \"@talxis/react-components\";\n\nexport const getGridCellLabelStyles = (columnAlignment: IColumn['alignment'], dataType: DataType, rowHeight: number, theme: ITheme) => {\n return mergeStyleSets({\n root: {\n display: 'flex',\n alignItems: 'center',\n height: rowHeight + 1,\n paddingLeft: 8,\n paddingRight: 8,\n justifyContent: getJustifyContent(columnAlignment),\n gap: 10,\n },\n fileWrapper: {\n display: 'flex',\n gap: 5,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n alignItems: 'center'\n },\n contentWrapper: {\n flexGrow: 1,\n textAlign: columnAlignment,\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n },\n fileImage: {\n marginRight: 5,\n flexShrink: 0,\n 'img': {\n width: 32\n }\n },\n link: {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n ...(isMultiple(dataType) ? getMultilineStyles(rowHeight, theme) : {})\n },\n icon: {\n 'img': {\n width: 20\n }\n },\n fileIcon: {\n fontSize: 18\n },\n loadingSpinnerCircle: {\n width: 20,\n height: 20\n }\n })\n}\nexport const getDefaultContentRendererStyles = (theme: ITheme, dataType: DataType, rowHeight: number) => {\n return mergeStyleSets({\n content: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n flexGrow: 1,\n ...(isMultiple(dataType) ? getMultilineStyles(rowHeight, theme) : {})\n },\n placeholder: {\n color: theme.semanticColors.inputPlaceholderText\n }\n });\n}\n\nconst getJustifyContent = (columnAlignment: IColumn['alignment']) => {\n switch (columnAlignment) {\n case 'left': {\n return 'flex-start';\n }\n case 'center': {\n return 'center';\n }\n case 'right': {\n return 'flex-end';\n }\n }\n}\n\nconst getMultilineStyles = (rowHeight: number, theme: ITheme) => {\n let fontSize = 20;\n const themeFontSize = theme.fonts.medium.fontSize;\n theme.fonts.medium.lineHeight\n if(typeof themeFontSize === 'number') {\n fontSize = themeFontSize;\n }\n else if(typeof themeFontSize === 'string' && themeFontSize.endsWith('px')) {\n fontSize = parseInt(themeFontSize.replace('px', ''));\n }\n const clamp = Math.floor(rowHeight / fontSize) - 1;\n return {\n lineHeight: '1.2',\n display: '-webkit-box',\n whiteSpace: 'normal',\n '-webkit-box-orient': 'vertical',\n wordBreak: 'break-all',\n '-webkit-line-clamp': clamp.toString(),\n };\n}\n\nconst isMultiple = (dataType: DataType) => {\n return dataType === 'Multiple' || dataType === 'SingleLine.TextArea';\n}\n"],"names":[],"mappings":";;AAIO,MAAM,sBAAsB,GAAG,CAAC,eAAqC,EAAE,QAAkB,EAAE,SAAiB,EAAE,KAAa,KAAI;AAClI,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,SAAS,GAAG,CAAC;AACrB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,cAAc,EAAE,iBAAiB,CAAC,eAAe,CAAC;AAClD,YAAA,GAAG,EAAE,EAAE;AACV,SAAA;AACD,QAAA,WAAW,EAAE;AACT,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,GAAG,EAAE,CAAC;AACN,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AACxB,YAAA,UAAU,EAAE,QAAQ;AACvB,SA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AED,MAAM,UAAU,GAAG,CAAC,QAAkB,KAAI;AACtC,IAAA,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,qBAAqB,CAAC;AACzE,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.js","sources":["../../../src/components/GridCellRenderer/translations.ts"],"sourcesContent":["export const getDefaultGridRendererTranslations = () => {\n return {\n download: {\n 1029: 'Stáhnout',\n 1033: 'Download'\n }\n }\n};"],"names":[],"mappings":"AAAO,MAAM,kCAAkC,GAAG,MAAK;IACnD,OAAO;AACH,QAAA,QAAQ,EAAE;AACN,YAAA,IAAI,EAAE,UAAU;AAChB,YAAA,IAAI,EAAE,UAAU;AACnB,SAAA;KACJ,CAAA;AACL;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IGridCellRendererComponentProps } from "./interfaces";
|
|
3
|
+
export declare const ComponentPropsContext: import("react").Context<{
|
|
4
|
+
current: IGridCellRendererComponentProps;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useComponentProps: () => IGridCellRendererComponentProps;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const ComponentPropsContext = createContext({});
|
|
4
|
+
const useComponentProps = () => {
|
|
5
|
+
const context = useContext(ComponentPropsContext);
|
|
6
|
+
return context.current;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { ComponentPropsContext, useComponentProps };
|
|
10
|
+
//# sourceMappingURL=useComponentProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComponentProps.js","sources":["../../../src/components/GridCellRenderer/useComponentProps.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { IGridCellRendererComponentProps } from \"./interfaces\";\n\n\nexport const ComponentPropsContext = createContext<{\n current: IGridCellRendererComponentProps\n}>({} as any);\n\nexport const useComponentProps = () => {\n const context = useContext(ComponentPropsContext);\n return context.current;\n}"],"names":[],"mappings":";;MAIa,qBAAqB,GAAG,aAAa,CAE/C,EAAS,EAAE;AAEP,MAAM,iBAAiB,GAAG,MAAK;AAClC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAClD,OAAO,OAAO,CAAC,OAAO,CAAC;AAC3B;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useLookup } from './hooks/useLookup.js';
|
|
3
|
-
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { useRef, useMemo, useState, useEffect } from 'react';
|
|
4
4
|
import { ThemeProvider } from '@fluentui/react';
|
|
5
5
|
import { TagPicker } from '@talxis/react-components';
|
|
6
6
|
import { TargetSelector } from './components/TargetSelector.js';
|
|
7
7
|
import { useMouseOver } from '../../hooks/useMouseOver.js';
|
|
8
|
-
import { getLookupStyles } from './styles.js';
|
|
8
|
+
import { getLookupStyles, getSuggestionsCalloutStyles } from './styles.js';
|
|
9
9
|
import { RecordCreator } from './components/RecordCreator.js';
|
|
10
10
|
import { useFocusIn } from '../../hooks/useFocusIn.js';
|
|
11
11
|
import { useControlSizing } from '../../hooks/useControlSizing.js';
|
|
@@ -19,6 +19,8 @@ const Lookup = (props) => {
|
|
|
19
19
|
const { height } = useControlSizing(props.context.mode);
|
|
20
20
|
const [value, entities, labels, records, selectEntity, getSearchResults, theme] = useLookup(props);
|
|
21
21
|
const styles = getLookupStyles(theme, itemLimit === 1, height);
|
|
22
|
+
const suggestionsCalloutTheme = props.context.fluentDesignLanguage?.applicationTheme ?? theme;
|
|
23
|
+
const suggestionsCalloutStyles = useMemo(() => getSuggestionsCalloutStyles(suggestionsCalloutTheme), [suggestionsCalloutTheme]);
|
|
22
24
|
const mouseOver = useMouseOver(ref);
|
|
23
25
|
const isFocused = useFocusIn(ref, 100);
|
|
24
26
|
const firstRenderRef = useRef(true);
|
|
@@ -135,7 +137,8 @@ const Lookup = (props) => {
|
|
|
135
137
|
layerProps: {
|
|
136
138
|
eventBubblingEnabled: true
|
|
137
139
|
},
|
|
138
|
-
className:
|
|
140
|
+
className: suggestionsCalloutStyles.suggestionsCallout,
|
|
141
|
+
theme: suggestionsCalloutTheme,
|
|
139
142
|
},
|
|
140
143
|
inputProps: {
|
|
141
144
|
placeholder: placeholder,
|
|
@@ -151,7 +154,9 @@ const Lookup = (props) => {
|
|
|
151
154
|
},
|
|
152
155
|
pickerSuggestionsProps: {
|
|
153
156
|
loadingText: labels.searching(),
|
|
157
|
+
theme: suggestionsCalloutTheme,
|
|
154
158
|
noResultsFoundText: labels.noRecordsFound(),
|
|
159
|
+
className: suggestionsCalloutStyles.suggestionsContainer,
|
|
155
160
|
// @ts-ignore
|
|
156
161
|
suggestionsHeaderText: (jsxs(Fragment, { children: [props.parameters.IsInlineNewEnabled?.raw !== false && (jsx(RecordCreator, { labels: labels, entities: entities, onCreateRecord: records.create })), props.parameters.value.attributes.Targets.length > 1 && (jsx(TargetSelector, { labels: labels, entities: entities, onEntitySelected: (entityName) => {
|
|
157
162
|
selectEntity(entityName);
|