@talxis/base-controls 1.2506.5 → 1.2506.6
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/Grid/aggregation/Aggregation.d.ts +18 -0
- package/dist/components/Grid/aggregation/Aggregation.js +129 -0
- package/dist/components/Grid/aggregation/Aggregation.js.map +1 -0
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js +6 -3
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/components/EmptyRecordsOverlay/EmptyRecords.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js +18 -8
- package/dist/components/Grid/core/components/AgGrid/model/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/styles.d.ts +4 -0
- package/dist/components/Grid/core/components/AgGrid/styles.js +4 -0
- package/dist/components/Grid/core/components/AgGrid/styles.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/Cell.js +14 -1
- package/dist/components/Grid/core/components/Cell/Cell.js.map +1 -1
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js +5 -0
- package/dist/components/Grid/core/components/Cell/CellContent/CellContent.js.map +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js +1 -1
- package/dist/components/Grid/core/components/ColumnHeader/ColumnHeader.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +10 -2
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
- package/dist/components/Grid/core/interfaces/IGridColumn.d.ts +1 -0
- package/dist/components/Grid/core/model/Grid.d.ts +3 -0
- package/dist/components/Grid/core/model/Grid.js +36 -13
- package/dist/components/Grid/core/model/Grid.js.map +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.d.ts +3 -0
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.js +1 -1
- package/dist/components/Grid/filtering/components/FilterCallout/components/ConditionValue/model/ConditionComponentValue.js.map +1 -1
- package/dist/components/Grid/interfaces.d.ts +1 -0
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js +58 -34
- package/dist/components/Grid/sorting/components/SortingContextualMenu/SortingContextualMenu.js.map +1 -1
- package/dist/components/Grid/translations.d.ts +36 -0
- package/dist/components/Grid/translations.js +13 -1
- package/dist/components/Grid/translations.js.map +1 -1
- package/dist/components/GridCellRenderer/GridCellRenderer.js +37 -5
- package/dist/components/GridCellRenderer/GridCellRenderer.js.map +1 -1
- package/dist/components/GridCellRenderer/interfaces.d.ts +5 -2
- package/dist/components/GridCellRenderer/styles.d.ts +15 -2
- package/dist/components/GridCellRenderer/styles.js +15 -2
- package/dist/components/GridCellRenderer/styles.js.map +1 -1
- package/dist/components/GridCellRenderer/translations.d.ts +24 -0
- package/dist/components/GridCellRenderer/translations.js +24 -0
- package/dist/components/GridCellRenderer/translations.js.map +1 -1
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js +0 -4
- package/dist/components/NestedControlRenderer/properties/OptionSetProperty.js.map +1 -1
- package/dist/index.d.ts +66 -2
- package/dist/utils/dataset/adapters/VirtualDatasetAdapter.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { SpinnerSize, ThemeProvider, Icon, Link, Image } from '@fluentui/react';
|
|
2
|
+
import { SpinnerSize, ThemeProvider, Label, Icon, Link, Image } from '@fluentui/react';
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import { getGridCellLabelStyles, getDefaultContentRendererStyles } from './styles.js';
|
|
5
5
|
import { Client, Constants, DataTypes, Sanitizer, FetchXmlDataProvider, FileAttribute, Attribute } from '@talxis/client-libraries';
|
|
@@ -19,7 +19,7 @@ const GridCellRenderer = (props) => {
|
|
|
19
19
|
const column = props.parameters.Column.raw;
|
|
20
20
|
const columnAlignment = props.parameters.ColumnAlignment.raw;
|
|
21
21
|
const dataType = props.parameters.value.type;
|
|
22
|
-
const { theme, sizing } = useControl('GridCellLabel', props, getDefaultGridRendererTranslations());
|
|
22
|
+
const { theme, sizing, labels } = useControl('GridCellLabel', props, getDefaultGridRendererTranslations());
|
|
23
23
|
const styles = useMemo(() => getGridCellLabelStyles(columnAlignment ?? 'left', dataType, sizing.height, theme), [columnAlignment, dataType, sizing.height, theme]);
|
|
24
24
|
const defaultContentRendererStyles = useMemo(() => getDefaultContentRendererStyles(theme, dataType, sizing.height), [theme, dataType, sizing.height]);
|
|
25
25
|
const value = props.parameters.value.raw;
|
|
@@ -27,6 +27,7 @@ const GridCellRenderer = (props) => {
|
|
|
27
27
|
const isNavigationEnabled = props.parameters.EnableNavigation.raw;
|
|
28
28
|
const prefixIcon = props.parameters.PrefixIcon?.raw;
|
|
29
29
|
const suffixIcon = props.parameters.SuffixIcon?.raw;
|
|
30
|
+
const aggregationFunction = props.parameters.AggregationFunction.raw;
|
|
30
31
|
const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);
|
|
31
32
|
const [downloadInProgress, setIsDownloadInProgress] = useState(false);
|
|
32
33
|
const getLinkProps = () => {
|
|
@@ -118,7 +119,7 @@ const GridCellRenderer = (props) => {
|
|
|
118
119
|
return 'Attach';
|
|
119
120
|
};
|
|
120
121
|
const renderContent = () => {
|
|
121
|
-
if (!formattedValue) {
|
|
122
|
+
if (!formattedValue || aggregationFunction) {
|
|
122
123
|
return jsx(DefaultContentRenderer, {});
|
|
123
124
|
}
|
|
124
125
|
if (column.isPrimary && isNavigationEnabled) {
|
|
@@ -203,11 +204,34 @@ const GridCellRenderer = (props) => {
|
|
|
203
204
|
});
|
|
204
205
|
setIsDownloadInProgress(false);
|
|
205
206
|
};
|
|
207
|
+
const getAggregationLabel = (aggregationFunction) => {
|
|
208
|
+
switch (aggregationFunction) {
|
|
209
|
+
case 'avg': {
|
|
210
|
+
return labels.avg();
|
|
211
|
+
}
|
|
212
|
+
case 'max': {
|
|
213
|
+
return labels.max();
|
|
214
|
+
}
|
|
215
|
+
case 'min': {
|
|
216
|
+
return labels.min();
|
|
217
|
+
}
|
|
218
|
+
case 'sum': {
|
|
219
|
+
return labels.sum();
|
|
220
|
+
}
|
|
221
|
+
case 'count': {
|
|
222
|
+
return labels.count();
|
|
223
|
+
}
|
|
224
|
+
case 'countcolumn': {
|
|
225
|
+
return labels.countcolumn();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
206
229
|
const componentProps = onOverrideComponentProps({
|
|
207
230
|
onGetLinkProps: (props) => props,
|
|
208
231
|
onGetOptionSetProps: (props) => props,
|
|
209
232
|
onGetRecordCommandsProps: (props) => props,
|
|
210
233
|
onRenderContent: (defaultRenderer) => defaultRenderer(),
|
|
234
|
+
onRenderAggregationLabel: (props, defaultRenderer) => defaultRenderer(props),
|
|
211
235
|
rootContainerProps: {
|
|
212
236
|
theme: theme,
|
|
213
237
|
className: styles.root
|
|
@@ -215,10 +239,13 @@ const GridCellRenderer = (props) => {
|
|
|
215
239
|
contentWrapperProps: {
|
|
216
240
|
className: styles.contentWrapper,
|
|
217
241
|
},
|
|
242
|
+
prefixSuffixWrapperProps: {
|
|
243
|
+
className: styles.prefixSuffixContentWrapper
|
|
244
|
+
},
|
|
218
245
|
textProps: {
|
|
219
246
|
className: getClassNames([defaultContentRendererStyles.content, !formattedValue ? defaultContentRendererStyles.placeholder : undefined]),
|
|
220
247
|
title: formattedValue,
|
|
221
|
-
children:
|
|
248
|
+
children: formattedValue ?? '---'
|
|
222
249
|
},
|
|
223
250
|
fileProps: {
|
|
224
251
|
containerProps: {
|
|
@@ -254,7 +281,12 @@ const GridCellRenderer = (props) => {
|
|
|
254
281
|
const suffixIconProps = getIconProps(suffixIcon);
|
|
255
282
|
return jsx(ComponentPropsContext.Provider, { value: componentPropsProviderValue, children: column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME ?
|
|
256
283
|
jsx(RecordCommands, { applicationTheme: context.fluentDesignLanguage?.applicationTheme ?? theme, theme: theme, themeOverride: context.fluentDesignLanguage?.v8FluentOverrides, commands: props.parameters.RecordCommands?.raw ?? [], alignment: columnAlignment }) :
|
|
257
|
-
jsxs(ThemeProvider, { ...componentProps.rootContainerProps, children: [
|
|
284
|
+
jsxs(ThemeProvider, { ...componentProps.rootContainerProps, children: [aggregationFunction &&
|
|
285
|
+
componentProps.onRenderAggregationLabel({
|
|
286
|
+
className: styles.aggregationLabel
|
|
287
|
+
}, (props) => {
|
|
288
|
+
return jsx(Label, { ...props, children: getAggregationLabel(aggregationFunction) });
|
|
289
|
+
}), jsxs("div", { ...componentProps.prefixSuffixWrapperProps, children: [prefixIconProps && jsx(Icon, { ...prefixIconProps, className: getClassNames([prefixIconProps.className, styles.icon]) }), jsx("div", { ...componentProps.contentWrapperProps, children: componentProps.contentWrapperProps.children ?? renderContent() }), suffixIconProps && jsx(Icon, { ...suffixIconProps, className: getClassNames([suffixIconProps.className, styles.icon]) })] })] }) });
|
|
258
290
|
};
|
|
259
291
|
|
|
260
292
|
export { GridCellRenderer };
|
|
@@ -1 +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, Constants, 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\";\nimport { RecordCommands } from \"./RecordCommands/RecordCommands\";\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 const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</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 if(isNavigationEnabled) {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</Link>\n }\n return <DefaultContentRenderer />\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 onGetRecordCommandsProps: (props) => props,\n onRenderContent: (defaultRenderer) => defaultRenderer(),\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 <ComponentPropsContext.Provider value={componentPropsProviderValue}>\n {column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME ? \n <RecordCommands\n applicationTheme={context.fluentDesignLanguage?.applicationTheme ?? theme}\n theme={theme}\n themeOverride={context.fluentDesignLanguage?.v8FluentOverrides}\n commands={props.parameters.RecordCommands?.raw ?? []}\n alignment={columnAlignment} /> : \n <ThemeProvider {...componentProps.rootContainerProps}>\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 </ThemeProvider>}\n </ComponentPropsContext.Provider>\n}\n\n\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AAaA,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,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,sBAAsB,CAAC,eAAe,IAAI,MAAM,EAAE,QA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CAAC,CAAA;AAEhD,IAAA,OAAOA,IAAC,qBAAqB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,2BAA2B,EACpE,QAAA,EAAA,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,0BAA0B;AACrD,YAAAA,GAAA,CAAC,cAAc,EACX,EAAA,gBAAgB,EAAE,OAAO,CAAC,oBAAoB,EAAE,gBAAgB,IAAI,KAAK,EACzE,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,OAAO,CAAC,oBAAoB,EAAE,iBAAiB,EAC9D,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,IAAI,EAAE,EACpD,SAAS,EAAE,eAAe,EAAA,CAAI;AAClC,YAAAC,IAAA,CAAC,aAAa,EAAA,EAAA,GAAK,cAAc,CAAC,kBAAkB,EAC/C,QAAA,EAAA,CAAA,eAAe,IAAID,GAAA,CAAC,IAAI,EAAA,EAAA,GAAK,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,EAAA,CAC7D,EACL,eAAe,IAAIA,GAAA,CAAC,IAAI,EAAA,EAAA,GAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAI,CAAA,CAAA,EAAA,CACzG,GACa,CAAA;AACrC;;;;"}
|
|
1
|
+
{"version":3,"file":"GridCellRenderer.js","sources":["../../../src/components/GridCellRenderer/GridCellRenderer.tsx"],"sourcesContent":["import { Icon, IIconProps, ILinkProps, Image, Label, Link, SpinnerSize, ThemeProvider } from \"@fluentui/react\";\nimport { useControl } from \"../../hooks\";\nimport { useMemo, useState } from \"react\";\nimport { getDefaultContentRendererStyles, getGridCellLabelStyles } from \"./styles\";\nimport { AggregationFunction, Attribute, Client, Constants, 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\";\nimport { RecordCommands } from \"./RecordCommands/RecordCommands\";\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, labels } = 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 aggregationFunction = props.parameters.AggregationFunction.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 || aggregationFunction) {\n return <DefaultContentRenderer />\n }\n if (column.isPrimary && isNavigationEnabled) {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</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 if (isNavigationEnabled) {\n const linkProps = componentProps.onGetLinkProps(getLinkProps());\n return <Link {...linkProps}>{linkProps.children}</Link>\n }\n return <DefaultContentRenderer />\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 getAggregationLabel = (aggregationFunction: AggregationFunction) => {\n switch (aggregationFunction) {\n case 'avg': {\n return labels.avg();\n }\n case 'max': {\n return labels.max();\n }\n case 'min': {\n return labels.min();\n }\n case 'sum': {\n return labels.sum();\n }\n case 'count': {\n return labels.count()\n }\n case 'countcolumn': {\n return labels.countcolumn()\n }\n }\n }\n\n const componentProps = onOverrideComponentProps({\n onGetLinkProps: (props) => props,\n onGetOptionSetProps: (props) => props,\n onGetRecordCommandsProps: (props) => props,\n onRenderContent: (defaultRenderer) => defaultRenderer(),\n onRenderAggregationLabel: (props, defaultRenderer) => defaultRenderer(props),\n rootContainerProps: {\n theme: theme,\n className: styles.root\n },\n contentWrapperProps: {\n className: styles.contentWrapper,\n },\n prefixSuffixWrapperProps: {\n className: styles.prefixSuffixContentWrapper\n },\n textProps: {\n className: getClassNames([defaultContentRendererStyles.content, !formattedValue ? defaultContentRendererStyles.placeholder : undefined]),\n title: formattedValue,\n children: 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 <ComponentPropsContext.Provider value={componentPropsProviderValue}>\n {column.name === Constants.RIBBON_BUTTONS_COLUMN_NAME ?\n <RecordCommands\n applicationTheme={context.fluentDesignLanguage?.applicationTheme ?? theme}\n theme={theme}\n themeOverride={context.fluentDesignLanguage?.v8FluentOverrides}\n commands={props.parameters.RecordCommands?.raw ?? []}\n alignment={columnAlignment} /> :\n <ThemeProvider {...componentProps.rootContainerProps}>\n {aggregationFunction &&\n componentProps.onRenderAggregationLabel({\n className: styles.aggregationLabel\n }, (props) => {\n return <Label {...props}>{getAggregationLabel(aggregationFunction)}</Label>\n })\n }\n <div {...componentProps.prefixSuffixWrapperProps}>\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 </div>\n </ThemeProvider>}\n </ComponentPropsContext.Provider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Ae,IAAID,GAAC,CAAA,IAAI,EAAK,EAAA,GAAA,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,EAAA,CAC7D,EACL,eAAe,IAAIA,GAAA,CAAC,IAAI,EAAA,EAAA,GAAK,eAAe,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAA,CAAI,CACnH,EAAA,CAAA,CAAA,EAAA,CACM,GACS,CAAA;AACrC;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="@types/powerapps-component-framework" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
-
import { IColumn, ICommand, IDataset, IRecord } from "@talxis/client-libraries";
|
|
3
|
+
import { AggregationFunction, IColumn, ICommand, IDataset, IRecord } from "@talxis/client-libraries";
|
|
4
4
|
import { IControl, IParameters, IStringProperty, ITwoOptionsProperty } from "../../interfaces";
|
|
5
5
|
import { getDefaultGridRendererTranslations } from "./translations";
|
|
6
|
-
import { IIconProps, IImageProps, ILinkProps, ISpinnerProps, ITextProps, ThemeProviderProps } from "@fluentui/react";
|
|
6
|
+
import { IIconProps, IImageProps, ILabelProps, ILinkProps, ISpinnerProps, ITextProps, ThemeProviderProps } from "@fluentui/react";
|
|
7
7
|
import { ICommandBarProps } from "@talxis/react-components";
|
|
8
8
|
export interface IGridCellRenderer extends IControl<IGridCellRendererParameters, {}, ReturnType<typeof getDefaultGridRendererTranslations>, IGridCellRendererComponentProps> {
|
|
9
9
|
}
|
|
@@ -14,6 +14,7 @@ export interface IGridCellRendererParameters extends IParameters {
|
|
|
14
14
|
EnableNavigation: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
15
15
|
PrefixIcon?: IStringProperty;
|
|
16
16
|
SuffixIcon?: IStringProperty;
|
|
17
|
+
AggregationFunction: Omit<ComponentFramework.PropertyTypes.EnumProperty<AggregationFunction | null>, 'type'>;
|
|
17
18
|
Column: {
|
|
18
19
|
raw: IColumn;
|
|
19
20
|
};
|
|
@@ -45,7 +46,9 @@ export interface IGridCellRendererComponentProps {
|
|
|
45
46
|
onGetLinkProps: (props: ILinkProps) => ILinkProps;
|
|
46
47
|
onGetRecordCommandsProps: (props: IRecordCommandsProps) => IRecordCommandsProps;
|
|
47
48
|
onRenderContent: (defaultRenderer: () => JSX.Element) => JSX.Element;
|
|
49
|
+
onRenderAggregationLabel: (props: ILabelProps, defaultRenderer: (props: ILabelProps) => React.ReactElement) => React.ReactElement;
|
|
48
50
|
rootContainerProps: ThemeProviderProps;
|
|
51
|
+
prefixSuffixWrapperProps: React.HTMLAttributes<HTMLDivElement>;
|
|
49
52
|
contentWrapperProps: React.HTMLAttributes<HTMLDivElement>;
|
|
50
53
|
textProps: ITextProps;
|
|
51
54
|
fileProps: {
|
|
@@ -2,11 +2,24 @@ import { DataType, IColumn } from "@talxis/client-libraries";
|
|
|
2
2
|
import { ITheme } from "@talxis/react-components";
|
|
3
3
|
export declare const getGridCellLabelStyles: (columnAlignment: IColumn['alignment'], dataType: DataType, rowHeight: number, theme: ITheme) => import("@fluentui/react").IProcessedStyleSet<{
|
|
4
4
|
root: {
|
|
5
|
-
display: string;
|
|
6
|
-
alignItems: string;
|
|
7
5
|
height: number;
|
|
8
6
|
paddingLeft: number;
|
|
9
7
|
paddingRight: number;
|
|
8
|
+
display: string;
|
|
9
|
+
flexDirection: string;
|
|
10
|
+
};
|
|
11
|
+
aggregationLabel: {
|
|
12
|
+
lineHeight: number;
|
|
13
|
+
textAlign: "left" | "right" | "center" | undefined;
|
|
14
|
+
color: string;
|
|
15
|
+
fontSize: number;
|
|
16
|
+
overflow: string;
|
|
17
|
+
textOverflow: string;
|
|
18
|
+
};
|
|
19
|
+
prefixSuffixContentWrapper: {
|
|
20
|
+
display: string;
|
|
21
|
+
flexGrow: number;
|
|
22
|
+
alignItems: string;
|
|
10
23
|
justifyContent: string | undefined;
|
|
11
24
|
gap: number;
|
|
12
25
|
};
|
|
@@ -3,11 +3,24 @@ import { mergeStyleSets } from '@fluentui/react';
|
|
|
3
3
|
const getGridCellLabelStyles = (columnAlignment, dataType, rowHeight, theme) => {
|
|
4
4
|
return mergeStyleSets({
|
|
5
5
|
root: {
|
|
6
|
-
display: 'flex',
|
|
7
|
-
alignItems: 'center',
|
|
8
6
|
height: rowHeight,
|
|
9
7
|
paddingLeft: 8,
|
|
10
8
|
paddingRight: 8,
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column'
|
|
11
|
+
},
|
|
12
|
+
aggregationLabel: {
|
|
13
|
+
lineHeight: 6,
|
|
14
|
+
textAlign: columnAlignment,
|
|
15
|
+
color: theme.semanticColors.infoIcon,
|
|
16
|
+
fontSize: 12,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
textOverflow: 'ellipsis',
|
|
19
|
+
},
|
|
20
|
+
prefixSuffixContentWrapper: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexGrow: 1,
|
|
23
|
+
alignItems: 'center',
|
|
11
24
|
justifyContent: getJustifyContent(columnAlignment),
|
|
12
25
|
gap: 10,
|
|
13
26
|
},
|
|
@@ -1 +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
|
|
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 height: rowHeight,\n paddingLeft: 8,\n paddingRight: 8,\n display: 'flex',\n flexDirection: 'column'\n },\n aggregationLabel: {\n lineHeight: 6,\n textAlign: columnAlignment,\n color: theme.semanticColors.infoIcon,\n fontSize: 12,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n prefixSuffixContentWrapper: {\n display: 'flex',\n flexGrow: 1,\n alignItems: 'center',\n justifyContent: getJustifyContent(columnAlignment),\n gap: 10,\n\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 rowHeight = rowHeight + 1;\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,MAAM,EAAE,SAAS;AACjB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AAC1B,SAAA;AACD,QAAA,gBAAgB,EAAE;AACd,YAAA,UAAU,EAAE,CAAC;AACb,YAAA,SAAS,EAAE,eAAe;AAC1B,YAAA,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ;AACpC,YAAA,QAAQ,EAAE,EAAE;AACZ,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,YAAY,EAAE,UAAU;AAC3B,SAAA;AACD,QAAA,0BAA0B,EAAE;AACxB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,QAAQ,EAAE,CAAC;AACX,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,cAAc,EAAE,i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K,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO;AACH,QAAA,UAAU,EAAE,KAAK;AACjB,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,oBAAoB,EAAE,UAAU;AAChC,QAAA,SAAS,EAAE,WAAW;AACtB,QAAA,oBAAoB,EAAE,KAAK,CAAC,QAAQ,EAAE;KACzC,CAAC;AACN,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,QAAkB,KAAI;AACtC,IAAA,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,qBAAqB,CAAC;AACzE,CAAC;;;;"}
|
|
@@ -3,4 +3,28 @@ export declare const getDefaultGridRendererTranslations: () => {
|
|
|
3
3
|
1029: string;
|
|
4
4
|
1033: string;
|
|
5
5
|
};
|
|
6
|
+
max: {
|
|
7
|
+
1029: string;
|
|
8
|
+
1033: string;
|
|
9
|
+
};
|
|
10
|
+
min: {
|
|
11
|
+
1029: string;
|
|
12
|
+
1033: string;
|
|
13
|
+
};
|
|
14
|
+
avg: {
|
|
15
|
+
1029: string;
|
|
16
|
+
1033: string;
|
|
17
|
+
};
|
|
18
|
+
sum: {
|
|
19
|
+
1029: string;
|
|
20
|
+
1033: string;
|
|
21
|
+
};
|
|
22
|
+
count: {
|
|
23
|
+
1029: string;
|
|
24
|
+
1033: string;
|
|
25
|
+
};
|
|
26
|
+
countcolumn: {
|
|
27
|
+
1029: string;
|
|
28
|
+
1033: string;
|
|
29
|
+
};
|
|
6
30
|
};
|
|
@@ -3,6 +3,30 @@ const getDefaultGridRendererTranslations = () => {
|
|
|
3
3
|
download: {
|
|
4
4
|
1029: 'Stáhnout',
|
|
5
5
|
1033: 'Download'
|
|
6
|
+
},
|
|
7
|
+
max: {
|
|
8
|
+
1029: 'Maximum',
|
|
9
|
+
1033: 'Maximum'
|
|
10
|
+
},
|
|
11
|
+
min: {
|
|
12
|
+
1029: 'Minimum',
|
|
13
|
+
1033: 'Minimum'
|
|
14
|
+
},
|
|
15
|
+
avg: {
|
|
16
|
+
1029: 'Průměr',
|
|
17
|
+
1033: 'Average'
|
|
18
|
+
},
|
|
19
|
+
sum: {
|
|
20
|
+
1029: 'Součet',
|
|
21
|
+
1033: 'Sum'
|
|
22
|
+
},
|
|
23
|
+
count: {
|
|
24
|
+
1029: 'Počet (včetně prázdných hodnot)',
|
|
25
|
+
1033: 'Count (including empty values)'
|
|
26
|
+
},
|
|
27
|
+
countcolumn: {
|
|
28
|
+
1029: 'Počet',
|
|
29
|
+
1033: 'Count'
|
|
6
30
|
}
|
|
7
31
|
};
|
|
8
32
|
};
|
|
@@ -1 +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;;;;"}
|
|
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 max: {\n 1029: 'Maximum',\n 1033: 'Maximum'\n },\n min: {\n 1029: 'Minimum',\n 1033: 'Minimum'\n },\n avg: {\n 1029: 'Průměr',\n 1033: 'Average'\n },\n sum: {\n 1029: 'Součet',\n 1033: 'Sum'\n },\n count: {\n 1029: 'Počet (včetně prázdných hodnot)',\n 1033: 'Count (including empty values)'\n },\n countcolumn: {\n 1029: 'Počet',\n 1033: 'Count'\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;AACD,QAAA,GAAG,EAAE;AACD,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACD,QAAA,GAAG,EAAE;AACD,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACD,QAAA,GAAG,EAAE;AACD,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EAAE,SAAS;AAClB,SAAA;AACD,QAAA,GAAG,EAAE;AACD,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,IAAI,EAAE,KAAK;AACd,SAAA;AACD,QAAA,KAAK,EAAE;AACH,YAAA,IAAI,EAAE,iCAAiC;AACvC,YAAA,IAAI,EAAE,gCAAgC;AACzC,SAAA;AACD,QAAA,WAAW,EAAE;AACT,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,IAAI,EAAE,OAAO;AAChB,SAAA;KACJ,CAAA;AACL;;;;"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { DataTypes } from '@talxis/client-libraries';
|
|
2
1
|
import { Property } from './Property.js';
|
|
3
2
|
|
|
4
3
|
class OptionSetProperty extends Property {
|
|
5
4
|
getParameter() {
|
|
6
5
|
let value = this.getValue();
|
|
7
|
-
if (this.dataType === DataTypes.TwoOptions) {
|
|
8
|
-
value = value === true;
|
|
9
|
-
}
|
|
10
6
|
return {
|
|
11
7
|
raw: value ?? null,
|
|
12
8
|
formatted: this.getFormattedValue(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionSetProperty.js","sources":["../../../../src/components/NestedControlRenderer/properties/OptionSetProperty.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"OptionSetProperty.js","sources":["../../../../src/components/NestedControlRenderer/properties/OptionSetProperty.ts"],"sourcesContent":["import { Property } from \"./Property\";\nimport { IOptionSetProperty } from \"../../../interfaces\";\n\nexport class OptionSetProperty extends Property {\n\n public getParameter(): IOptionSetProperty {\n let value = this.getValue();\n return {\n raw: value ?? null,\n formatted: this.getFormattedValue(),\n attributes: {\n ...this.attributeMetadata,\n Options: this.attributeMetadata?.OptionSet ?? []\n }\n }\n }\n \n}"],"names":[],"mappings":";;AAGM,MAAO,iBAAkB,SAAQ,QAAQ,CAAA;IAEpC,YAAY,GAAA;AACf,QAAA,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5B,OAAO;YACH,GAAG,EAAE,KAAK,IAAI,IAAI;AAClB,YAAA,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE;AACnC,YAAA,UAAU,EAAE;gBACR,GAAG,IAAI,CAAC,iBAAiB;AACzB,gBAAA,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,IAAI,EAAE;AACnD,aAAA;SACJ,CAAA;KACJ;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="@types/powerapps-component-framework" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import { ITheme, ITextFieldProps, IDatePickerProps, ICommandBarProps, ITagPickerProps, IComboBoxProps } from '@talxis/react-components';
|
|
4
|
-
import { DeepPartial, DataType, IDataset, Dataset, IDataProvider, PowerAppsDatasetProvider, IColumn, IRecord, ICommand } from '@talxis/client-libraries';
|
|
5
|
-
import { ITheme as ITheme$1, ThemeProviderProps, ITextProps, ILinkProps, IIconProps, IImageProps, ISpinnerProps, IShimmerProps, IMessageBar, IButtonProps, IToggleProps } from '@fluentui/react';
|
|
4
|
+
import { DeepPartial, DataType, IDataset, Dataset, IDataProvider, PowerAppsDatasetProvider, AggregationFunction, IColumn, IRecord, ICommand } from '@talxis/client-libraries';
|
|
5
|
+
import { ITheme as ITheme$1, ThemeProviderProps, ITextProps, ILinkProps, ILabelProps, IIconProps, IImageProps, ISpinnerProps, IShimmerProps, IMessageBar, IButtonProps, IToggleProps } from '@fluentui/react';
|
|
6
6
|
import React$1 from 'react';
|
|
7
7
|
import { AgGridReactProps } from '@ag-grid-community/react';
|
|
8
8
|
|
|
@@ -596,6 +596,38 @@ declare const gridTranslations: {
|
|
|
596
596
|
1029: string;
|
|
597
597
|
1033: string;
|
|
598
598
|
};
|
|
599
|
+
"filtersortmenu-total-none": {
|
|
600
|
+
1029: string;
|
|
601
|
+
1033: string;
|
|
602
|
+
};
|
|
603
|
+
"filtersortmenu-total-avg": {
|
|
604
|
+
1029: string;
|
|
605
|
+
1033: string;
|
|
606
|
+
};
|
|
607
|
+
"filtersortmenu-total-max": {
|
|
608
|
+
1029: string;
|
|
609
|
+
1033: string;
|
|
610
|
+
};
|
|
611
|
+
"filtersortmenu-total-min": {
|
|
612
|
+
1029: string;
|
|
613
|
+
1033: string;
|
|
614
|
+
};
|
|
615
|
+
"filtersortmenu-total-sum": {
|
|
616
|
+
1029: string;
|
|
617
|
+
1033: string;
|
|
618
|
+
};
|
|
619
|
+
"filtersortmenu-total-count": {
|
|
620
|
+
1029: string;
|
|
621
|
+
1033: string;
|
|
622
|
+
};
|
|
623
|
+
"filtersortmenu-total-countcolumn": {
|
|
624
|
+
1029: string;
|
|
625
|
+
1033: string;
|
|
626
|
+
};
|
|
627
|
+
"filtersortmenu-total": {
|
|
628
|
+
1029: string;
|
|
629
|
+
1033: string;
|
|
630
|
+
};
|
|
599
631
|
norecordsfound: {
|
|
600
632
|
1029: string;
|
|
601
633
|
1033: string;
|
|
@@ -688,6 +720,10 @@ declare const gridTranslations: {
|
|
|
688
720
|
1029: string;
|
|
689
721
|
1033: string;
|
|
690
722
|
};
|
|
723
|
+
"error-2147750198": {
|
|
724
|
+
1029: string;
|
|
725
|
+
1033: string;
|
|
726
|
+
};
|
|
691
727
|
};
|
|
692
728
|
|
|
693
729
|
interface IGridComponentProps {
|
|
@@ -709,6 +745,7 @@ interface IGridParameters extends IParameters$1 {
|
|
|
709
745
|
EnableChangeEditor?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
710
746
|
EnableMultiEdit?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
711
747
|
EnableZebra?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
748
|
+
EnableAggregation?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
712
749
|
RowHeight?: Omit<IWholeNumberProperty, 'attributes'>;
|
|
713
750
|
EnablePageSizeSwitcher?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
714
751
|
Height?: IStringProperty;
|
|
@@ -931,6 +968,30 @@ declare const getDefaultGridRendererTranslations: () => {
|
|
|
931
968
|
1029: string;
|
|
932
969
|
1033: string;
|
|
933
970
|
};
|
|
971
|
+
max: {
|
|
972
|
+
1029: string;
|
|
973
|
+
1033: string;
|
|
974
|
+
};
|
|
975
|
+
min: {
|
|
976
|
+
1029: string;
|
|
977
|
+
1033: string;
|
|
978
|
+
};
|
|
979
|
+
avg: {
|
|
980
|
+
1029: string;
|
|
981
|
+
1033: string;
|
|
982
|
+
};
|
|
983
|
+
sum: {
|
|
984
|
+
1029: string;
|
|
985
|
+
1033: string;
|
|
986
|
+
};
|
|
987
|
+
count: {
|
|
988
|
+
1029: string;
|
|
989
|
+
1033: string;
|
|
990
|
+
};
|
|
991
|
+
countcolumn: {
|
|
992
|
+
1029: string;
|
|
993
|
+
1033: string;
|
|
994
|
+
};
|
|
934
995
|
};
|
|
935
996
|
|
|
936
997
|
interface IGridCellRenderer extends IControl<IGridCellRendererParameters, {}, ReturnType<typeof getDefaultGridRendererTranslations>, IGridCellRendererComponentProps> {
|
|
@@ -942,6 +1003,7 @@ interface IGridCellRendererParameters extends IParameters$1 {
|
|
|
942
1003
|
EnableNavigation: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
943
1004
|
PrefixIcon?: IStringProperty;
|
|
944
1005
|
SuffixIcon?: IStringProperty;
|
|
1006
|
+
AggregationFunction: Omit<ComponentFramework.PropertyTypes.EnumProperty<AggregationFunction | null>, 'type'>;
|
|
945
1007
|
Column: {
|
|
946
1008
|
raw: IColumn;
|
|
947
1009
|
};
|
|
@@ -973,7 +1035,9 @@ interface IGridCellRendererComponentProps {
|
|
|
973
1035
|
onGetLinkProps: (props: ILinkProps) => ILinkProps;
|
|
974
1036
|
onGetRecordCommandsProps: (props: IRecordCommandsProps) => IRecordCommandsProps;
|
|
975
1037
|
onRenderContent: (defaultRenderer: () => JSX.Element) => JSX.Element;
|
|
1038
|
+
onRenderAggregationLabel: (props: ILabelProps, defaultRenderer: (props: ILabelProps) => React.ReactElement) => React.ReactElement;
|
|
976
1039
|
rootContainerProps: ThemeProviderProps;
|
|
1040
|
+
prefixSuffixWrapperProps: React.HTMLAttributes<HTMLDivElement>;
|
|
977
1041
|
contentWrapperProps: React.HTMLAttributes<HTMLDivElement>;
|
|
978
1042
|
textProps: ITextProps;
|
|
979
1043
|
fileProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualDatasetAdapter.js","sources":["../../../../src/utils/dataset/adapters/VirtualDatasetAdapter.ts"],"sourcesContent":["import { mergeStyles } from \"@fluentui/react\";\nimport { Dataset, FetchXmlDataProvider, IColumn, IDataProvider, MemoryDataProvider } from \"@talxis/client-libraries\";\n\ninterface IOutputs {\n DatasetControl?: any;\n}\n\ninterface IParameterGetters {\n dataProviderType: \"Memory\" | \"FetchXml\" | 'Custom';\n onGetData: () => string | null;\n onGetColumns: () => string | null;\n onGetEntityMetadata: () => string | null;\n customDataProvider?: IDataProvider;\n onGetHeight?: () => string | null;\n /**\n * Callback that gets triggered and awaited before the dataset is initialized. Useful for setting initialization code that needs to run before the dataset is ready.\n */\n onInitialize?: () => void | Promise<void>\n}\n\n/**\n * Helper class that holds boilerplate code for handling a virtual dataset in PCF, like syncing data, columns, and metadata from parameters.\n *\n */\nexport class VirtualDatasetAdapter {\n private _providerClasses = {\n 'FetchXml': FetchXmlDataProvider,\n 'Memory': MemoryDataProvider\n };\n private _dataset!: Dataset<IDataProvider>;\n private _parsedData: any = null;\n private _lastUsedColumns: string | null = null;\n private _lastUsedData: string | null = null;\n private _lastUsedMetadata: string | null = null;\n private _dataProviderClass!: (typeof this._providerClasses[keyof typeof this._providerClasses]);\n private _container!: HTMLDivElement;\n private _notifyOutputChanged!: () => void;\n private _resolveGetOutputs!: (value: boolean | PromiseLike<boolean>) => void;\n private _getOutputsPromise: Promise<boolean> = new Promise(resolve => {\n this._resolveGetOutputs = resolve;\n });\n private _parameters!: IParameterGetters;\n\n public init(notifyOutputChanged: () => void, container: HTMLDivElement, parameters: IParameterGetters) {\n this._parameters = parameters;\n this._notifyOutputChanged = notifyOutputChanged;\n this._container = container;\n let dataProvider: any = null;\n if(parameters.dataProviderType !== 'Custom') {\n //@ts-ignore - typings\n this._dataProviderClass = this._providerClasses[this._parameters.dataProviderType];\n dataProvider = new this._dataProviderClass(this._getData(), this._getEntityMetadata());\n }\n else {\n dataProvider = this._parameters.customDataProvider;\n }\n //@ts-ignore - typings\n this._dataset = new Dataset(dataProvider);\n this._dataset.setColumns(this._getColumns());\n this._dataset.setMetadata(this._getEntityMetadata());\n\n if (this._parameters.onGetHeight?.() === '100%') {\n this._container.classList.add(this._getFullTabStyles());\n }\n this._lastUsedColumns = this._parameters.onGetColumns();\n this._lastUsedData = this._parameters.onGetData();\n this._lastUsedMetadata = this._parameters.onGetEntityMetadata();\n this._notifyOutputChanged();\n this._onDatasetInit();\n return this;\n }\n\n public updateView(): void {\n this._parsedData = null;\n this._refreshOnChange([\n {\n previousValue: this._lastUsedColumns,\n currentValue: this._parameters.onGetColumns(),\n beforeRefreshCallback: () => this._dataset.setColumns(this._getColumns())\n },\n {\n previousValue: this._lastUsedData,\n currentValue: this._parameters.onGetData(),\n beforeRefreshCallback: () => {\n this._dataset.setDataSource(this._getData());\n this._dataset.setColumns(this._getColumns());\n }\n },\n {\n previousValue: this._lastUsedMetadata,\n currentValue: this._parameters.onGetEntityMetadata(),\n beforeRefreshCallback: () => this._dataset.setMetadata(this._getEntityMetadata())\n }\n ]);\n this._lastUsedColumns = this._parameters.onGetColumns();\n this._lastUsedData = this._parameters.onGetData();\n this._lastUsedMetadata = this._parameters.onGetEntityMetadata();\n }\n\n public getDataset(): Dataset<IDataProvider> {\n return this._dataset;\n }\n\n public destroy(): void {\n this._dataset.destroy();\n }\n\n public getOutputs(): IOutputs {\n this._resolveGetOutputs(true);\n return {\n DatasetControl: this.getDataset()\n };\n }\n\n private _onDatasetInit() {\n this.getDataset().setInterceptor('onInitialize', async () => {\n await this._getOutputsPromise;\n await this._parameters.onInitialize?.();\n })\n }\n\n private _getData() {\n if (this._parsedData) {\n return this._parsedData;\n }\n this._parsedData = this._dataProviderClass.GetParsedData(this._parameters.onGetData());\n return this._parsedData;\n }\n\n private _getColumns() {\n try {\n const parameterColumns: IColumn[] = JSON.parse(this._parameters.onGetColumns() ?? \"[]\");\n if (this._shouldMergeColumns()) {\n return this._getMergedColumns(parameterColumns);\n }\n return parameterColumns;\n }\n catch (err) {\n console.error(err);\n return this._dataset.columns;\n }\n }\n\n private _shouldMergeColumns(): boolean {\n if (this._dataset.getDataProvider() instanceof FetchXmlDataProvider) {\n const fetchXml = this._parameters.onGetData();\n if (fetchXml?.includes('savedqueryid') || fetchXml?.includes('userqueryid')) {\n return true;\n }\n }\n return false;\n }\n\n private _getMergedColumns(parameterColumns: IColumn[]): IColumn[] {\n const columnsMap = new Map(this._dataset.columns.map(col => [col.name, col]));\n parameterColumns.forEach(parameterCol => {\n const col = columnsMap.get(parameterCol.name);\n if (col) {\n columnsMap.set(col.name, {\n ...col,\n ...parameterCol\n });\n } else {\n columnsMap.set(parameterCol.name, parameterCol);\n }\n });\n return [...columnsMap.values()];\n }\n\n private _getEntityMetadata() {\n try {\n return JSON.parse(this._parameters.onGetEntityMetadata() ?? \"{}\");\n }\n catch (err) {\n console.error(err);\n return this._dataset.getMetadata();\n }\n }\n\n private _refreshOnChange(objectsToCompare: { currentValue: string | null, previousValue: string | null, beforeRefreshCallback?: () => void }[]) {\n let shouldRefresh = false;\n objectsToCompare.forEach(obj => {\n if (obj.currentValue !== obj.previousValue) {\n shouldRefresh = true;\n obj.beforeRefreshCallback?.();\n }\n });\n if (shouldRefresh) {\n this._dataset.paging.loadExactPage(this._dataset.paging.pageNumber);\n }\n }\n\n private _getFullTabStyles() {\n return mergeStyles({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1\n });\n }\n}"],"names":[],"mappings":";;;AAoBA;;;AAGG;MACU,qBAAqB,CAAA;AAAlC,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,gBAAgB,GAAG;AACvB,YAAA,UAAU,EAAE,oBAAoB;AAChC,YAAA,QAAQ,EAAE,kBAAkB;SAC/B,CAAC;QAEM,IAAW,CAAA,WAAA,GAAQ,IAAI,CAAC;QACxB,IAAgB,CAAA,gBAAA,GAAkB,IAAI,CAAC;QACvC,IAAa,CAAA,aAAA,GAAkB,IAAI,CAAC;QACpC,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAC;AAKxC,QAAA,IAAA,CAAA,kBAAkB,GAAqB,IAAI,OAAO,CAAC,OAAO,IAAG;AACjE,YAAA,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;AACtC,SAAC,CAAC,CAAC;KA+JN;AA5JU,IAAA,IAAI,CAAC,mBAA+B,EAAE,SAAyB,EAAE,UAA6B,EAAA;AACjG,QAAA,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;AAC9B,QAAA,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,YAAY,GAAQ,IAAI,CAAC;AAC7B,QAAA,IAAG,UAAU,CAAC,gBAAgB,KAAK,QAAQ,EAAE;;AAEzC,YAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB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Aa,GAAG,IAAI,CAAC;AACrB,gBAAA,GAAG,CAAC,qBAAqB,IAAI,CAAC;AACjC,aAAA;AACL,SAAC,CAAC,CAAC;AACH,QAAA,IAAI,aAAa,EAAE;AACf,YAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACvE,SAAA;KACJ;IAEO,iBAAiB,GAAA;AACrB,QAAA,OAAO,WAAW,CAAC;AACf,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,QAAQ,EAAE,CAAC;AACd,SAAA,CAAC,CAAC;KACN;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"VirtualDatasetAdapter.js","sources":["../../../../src/utils/dataset/adapters/VirtualDatasetAdapter.ts"],"sourcesContent":["import { mergeStyles } from \"@fluentui/react\";\nimport { Dataset, FetchXmlDataProvider, IColumn, IDataProvider, MemoryDataProvider } from \"@talxis/client-libraries\";\n\ninterface IOutputs {\n DatasetControl?: any;\n}\n\ninterface IParameterGetters {\n dataProviderType: \"Memory\" | \"FetchXml\" | 'Custom';\n onGetData: () => string | null;\n onGetColumns: () => string | null;\n onGetEntityMetadata: () => string | null;\n customDataProvider?: IDataProvider;\n onGetHeight?: () => string | null;\n /**\n * Callback that gets triggered and awaited before the dataset is initialized. Useful for setting initialization code that needs to run before the dataset is ready.\n */\n onInitialize?: () => void | Promise<void>;\n}\n\n/**\n * Helper class that holds boilerplate code for handling a virtual dataset in PCF, like syncing data, columns, and metadata from parameters.\n *\n */\nexport class VirtualDatasetAdapter {\n private _providerClasses = {\n 'FetchXml': FetchXmlDataProvider,\n 'Memory': MemoryDataProvider\n };\n private _dataset!: Dataset<IDataProvider>;\n private _parsedData: any = null;\n private _lastUsedColumns: string | null = null;\n private _lastUsedData: string | null = null;\n private _lastUsedMetadata: string | null = null;\n private _dataProviderClass!: (typeof this._providerClasses[keyof typeof this._providerClasses]);\n private _container!: HTMLDivElement;\n private _notifyOutputChanged!: () => void;\n private _resolveGetOutputs!: (value: boolean | PromiseLike<boolean>) => void;\n private _getOutputsPromise: Promise<boolean> = new Promise(resolve => {\n this._resolveGetOutputs = resolve;\n });\n private _parameters!: IParameterGetters;\n\n public init(notifyOutputChanged: () => void, container: HTMLDivElement, parameters: IParameterGetters) {\n this._parameters = parameters;\n this._notifyOutputChanged = notifyOutputChanged;\n this._container = container;\n let dataProvider: any = null;\n if(parameters.dataProviderType !== 'Custom') {\n //@ts-ignore - typings\n this._dataProviderClass = this._providerClasses[this._parameters.dataProviderType];\n dataProvider = new this._dataProviderClass(this._getData(), this._getEntityMetadata());\n }\n else {\n dataProvider = this._parameters.customDataProvider;\n }\n //@ts-ignore - typings\n this._dataset = new Dataset(dataProvider);\n this._dataset.setColumns(this._getColumns());\n this._dataset.setMetadata(this._getEntityMetadata());\n\n if (this._parameters.onGetHeight?.() === '100%') {\n this._container.classList.add(this._getFullTabStyles());\n }\n this._lastUsedColumns = this._parameters.onGetColumns();\n this._lastUsedData = this._parameters.onGetData();\n this._lastUsedMetadata = this._parameters.onGetEntityMetadata();\n this._notifyOutputChanged();\n this._onDatasetInit();\n return this;\n }\n\n public updateView(): void {\n this._parsedData = null;\n this._refreshOnChange([\n {\n previousValue: this._lastUsedColumns,\n currentValue: this._parameters.onGetColumns(),\n beforeRefreshCallback: () => this._dataset.setColumns(this._getColumns())\n },\n {\n previousValue: this._lastUsedData,\n currentValue: this._parameters.onGetData(),\n beforeRefreshCallback: () => {\n this._dataset.setDataSource(this._getData());\n this._dataset.setColumns(this._getColumns());\n }\n },\n {\n previousValue: this._lastUsedMetadata,\n currentValue: this._parameters.onGetEntityMetadata(),\n beforeRefreshCallback: () => this._dataset.setMetadata(this._getEntityMetadata())\n }\n ]);\n this._lastUsedColumns = this._parameters.onGetColumns();\n this._lastUsedData = this._parameters.onGetData();\n this._lastUsedMetadata = this._parameters.onGetEntityMetadata();\n }\n\n public getDataset(): Dataset<IDataProvider> {\n return this._dataset;\n }\n\n public destroy(): void {\n this._dataset.destroy();\n }\n\n public getOutputs(): IOutputs {\n this._resolveGetOutputs(true);\n return {\n DatasetControl: this.getDataset()\n };\n }\n\n private _onDatasetInit() {\n this.getDataset().setInterceptor('onInitialize', async () => {\n await this._getOutputsPromise;\n await this._parameters.onInitialize?.();\n })\n }\n\n private _getData() {\n if (this._parsedData) {\n return this._parsedData;\n }\n this._parsedData = this._dataProviderClass.GetParsedData(this._parameters.onGetData());\n return this._parsedData;\n }\n\n private _getColumns() {\n try {\n const parameterColumns: IColumn[] = JSON.parse(this._parameters.onGetColumns() ?? \"[]\");\n if (this._shouldMergeColumns()) {\n return this._getMergedColumns(parameterColumns);\n }\n return parameterColumns;\n }\n catch (err) {\n console.error(err);\n return this._dataset.columns;\n }\n }\n\n private _shouldMergeColumns(): boolean {\n if (this._dataset.getDataProvider() instanceof FetchXmlDataProvider) {\n const fetchXml = this._parameters.onGetData();\n if (fetchXml?.includes('savedqueryid') || fetchXml?.includes('userqueryid')) {\n return true;\n }\n }\n return false;\n }\n\n private _getMergedColumns(parameterColumns: IColumn[]): IColumn[] {\n const columnsMap = new Map(this._dataset.columns.map(col => [col.name, col]));\n parameterColumns.forEach(parameterCol => {\n const col = columnsMap.get(parameterCol.name);\n if (col) {\n columnsMap.set(col.name, {\n ...col,\n ...parameterCol\n });\n } else {\n columnsMap.set(parameterCol.name, parameterCol);\n }\n });\n return [...columnsMap.values()];\n }\n\n private _getEntityMetadata() {\n try {\n return JSON.parse(this._parameters.onGetEntityMetadata() ?? \"{}\");\n }\n catch (err) {\n console.error(err);\n return this._dataset.getMetadata();\n }\n }\n\n private _refreshOnChange(objectsToCompare: { currentValue: string | null, previousValue: string | null, beforeRefreshCallback?: () => void }[]) {\n let shouldRefresh = false;\n objectsToCompare.forEach(obj => {\n if (obj.currentValue !== obj.previousValue) {\n shouldRefresh = true;\n obj.beforeRefreshCallback?.();\n }\n });\n if (shouldRefresh) {\n this._dataset.paging.loadExactPage(this._dataset.paging.pageNumber);\n }\n }\n\n private _getFullTabStyles() {\n return mergeStyles({\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1\n });\n }\n}"],"names":[],"mappings":";;;AAoBA;;;AAGG;MACU,qBAAqB,CAAA;AAAlC,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,gBAAgB,GAAG;AACvB,YAAA,UAAU,EAAE,oBAAoB;AAChC,YAAA,QAAQ,EAAE,kBAAkB;SAC/B,CAAC;QAEM,IAAW,CAAA,WAAA,GAAQ,IAAI,CAAC;QACxB,IAAgB,CAAA,gBAAA,GAAkB,IAAI,CAAC;QACvC,IAAa,CAAA,aAAA,GAAkB,IAAI,CAAC;QACpC,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAC;AAKxC,QAAA,IAAA,CAAA,kBAAkB,GAAqB,IAAI,OAAO,CAAC,OAAO,IAAG;AACjE,YAAA,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;AACtC,SAAC,CAAC,CAAC;KA+JN;AA5JU,IAAA,IAAI,CAAC,mBAA+B,EAAE,SAAyB,EAAE,UAA6B,EAAA;AACjG,QAAA,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;AAC9B,QAAA,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;AAChD,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,YAAY,GAAQ,IAAI,CAAC;AAC7B,QAAA,IAAG,UAAU,CAAC,gBAAgB,KAAK,QAAQ,EAAE;;AAEzC,YAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;AACnF,YAAA,YAAY,GAAG,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAC1F,SAAA;AACI,aAAA;AAC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