@talxis/base-controls 1.2503.3 → 1.2503.4

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.
@@ -195,7 +195,7 @@ const CellContent = (props) => {
195
195
  ...controlProps.context,
196
196
  mode: Object.create(controlProps.context.mode, {
197
197
  allocatedHeight: {
198
- value: node.rowHeight
198
+ value: node.rowHeight - 1
199
199
  },
200
200
  }),
201
201
  parameters: parameters,
@@ -1 +1 @@
1
- {"version":3,"file":"CellContent.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/CellContent/CellContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGridInstance } from '../../../hooks/useGridInstance';\nimport { ICellProps } from '../Cell';\nimport { getCellContentStyles } from './styles';\nimport { NestedControlRenderer } from '../../../../../NestedControlRenderer/NestedControlRenderer';\nimport { ControlTheme, IFluentDesignState } from '../../../../../../utils';\nimport { IComboBoxStyles, IDatePickerStyles, ITextFieldStyles, IToggleStyles, merge, useTheme } from '@fluentui/react';\nimport { useRerender } from '@talxis/react-components';\nimport { getJustifyContent } from '../styles';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { Client } from '@talxis/client-libraries';\nimport { AgGridContext } from '../../AgGrid/context';\n\nconst client = new Client();\n\nexport const CellContent = (props: ICellProps) => {\n const columnRef = React.useRef(props.baseColumn);\n const mountedRef = React.useRef(false);\n const valueRef = React.useRef(props.value);\n columnRef.current = props.baseColumn;\n valueRef.current = props.value;\n const rerender = useRerender();\n const grid = useGridInstance();\n const agGrid = React.useContext(AgGridContext);\n const record = props.data;\n const node = props.node;\n const themeRef = React.useRef(useTheme());\n themeRef.current = useTheme();\n const styles = React.useMemo(() => getCellContentStyles(valueRef.current.columnAlignment), [valueRef.current.columnAlignment]);\n //defer loading of the nested control to solve edge case where the changed values from onNotifyOutputChanged triggered by unmount would not be available straight away\n const [shouldRenderNestedControl, setShouldRenderNestedControl] = React.useState(false);\n const getColumn = () => {\n return columnRef.current;\n }\n\n const getFluentDesignLanguage = (fluentDesignLanguage?: IFluentDesignState) => {\n //@ts-ignore\n const formatting = agGrid.getCellFormatting(props);\n const mergedOverrides: any = merge({}, fluentDesignLanguage?.v8FluentOverrides ?? {}, formatting.themeOverride);\n const columnAlignment = valueRef.current.columnAlignment;\n const result = ControlTheme.GenerateFluentDesignLanguage(formatting.primaryColor, formatting.backgroundColor, formatting.textColor, {\n v8FluentOverrides: merge({},\n {\n semanticColors: {\n inputBorder: 'transparent',\n inputBorderHovered: 'transparent',\n inputBackground: formatting.backgroundColor,\n focusBorder: 'transparent',\n disabledBorder: 'transparent',\n inputFocusBorderAlt: 'transparent',\n errorText: 'transparent'\n\n },\n effects: {\n underlined: false\n },\n\n components: {\n 'TextField': {\n styles: {\n field: {\n textAlign: columnAlignment\n }\n \n } as ITextFieldStyles\n },\n 'ComboBox': {\n styles: {\n input: {\n textAlign: columnAlignment === 'right' ? 'right' : undefined,\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n }\n } as IComboBoxStyles\n },\n 'DatePicker': {\n styles: {\n root: {\n '.ms-TextField-field': {\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n textAlign: columnAlignment === 'right' ? 'right' : 'left'\n }\n } as any\n } as IDatePickerStyles\n },\n 'Toggle': {\n styles: {\n root: {\n justifyContent: getJustifyContent(columnAlignment)\n }\n } as IToggleStyles\n }\n }\n },\n mergedOverrides\n ),\n applicationTheme: fluentDesignLanguage?.applicationTheme\n })\n return result;\n }\n\n const onNotifyOutputChanged = (outputs: any) => {\n let isEditing = props.isCellEditor;\n //if we are not mounted, set editing to true so requestRender gets run\n //if this is not present, a PCF editor might trigger this too late and we would not see the current value in renderer until next\n if(!mountedRef.current) {\n isEditing = false;\n }\n grid.onNotifyOutputChanged(record, columnRef.current, isEditing, outputs.value, () => rerender())\n }\n const debouncedNotifyOutputChanged = useDebouncedCallback((outputs) => onNotifyOutputChanged(outputs), 100);\n\n React.useEffect(() => {\n mountedRef.current = true;\n setShouldRenderNestedControl(true);\n return () => {\n mountedRef.current = false;\n }\n }, []);\n if(!shouldRenderNestedControl) {\n return <></>\n }\n\n return <NestedControlRenderer\n context={grid.pcfContext}\n parameters={{\n ControlName: valueRef.current.customControl.name,\n LoadingType: 'shimmer',\n Bindings: grid.getBindings(record, getColumn(), valueRef.current.customControl),\n ControlStates: {\n isControlDisabled: !valueRef.current.editing\n },\n }}\n onNotifyOutputChanged={(outputs) => {\n //talxis portal does not have debounce for notifyoutput\n //Power Apps does a debounce of 100ms\n if(getColumn().oneClickEdit && client.isTalxisPortal()) {\n debouncedNotifyOutputChanged(outputs);\n }\n else {\n onNotifyOutputChanged(outputs);\n }\n }}\n onOverrideComponentProps={(componentProps) => {\n return {\n ...componentProps,\n rootContainerProps: {\n ...componentProps.rootContainerProps,\n className: styles.controlRoot\n },\n controlContainerProps: {\n className: styles.controlContainer\n },\n overridenControlContainerProps: {\n className: styles.overridenControlContainer\n },\n messageBarProps: {\n ...componentProps.messageBarProps,\n styles: {\n root: styles.errorMessageRoot,\n content: styles.errorMessageContent\n }\n },\n loadingProps: {\n ...componentProps.loadingProps,\n shimmerProps: {\n ...componentProps.loadingProps.shimmerProps,\n styles: {\n ...componentProps.loadingProps?.shimmerProps?.styles,\n shimmerWrapper: styles.shimmerWrapper\n }\n },\n containerProps: {\n ...componentProps.loadingProps?.containerProps,\n className: styles.loadingWrapper\n }\n },\n onOverrideRender: (control, isCustomPcfComponent, defaultRender) => {\n if(isCustomPcfComponent) {\n grid.setUsesNestedPcfs();\n }\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onRender(control.getProps(), themeRef.current, control.getContainer())\n }\n return defaultRender();\n },\n onOverrideUnmount: (control, defaultUnmount) => {\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onUnmount(control.getContainer());\n }\n //@ts-ignore - internal types\n //skip the unmounting for custom PCF's in Power Apps\n // PCF unmount in Power Apps causes other nested PCF's to reinitialize which causes flickering\n //umounting of nested PCF's happens on grid destroy to prevent memory leaks (currently done by refreshing the page as no better method was found)\n if(control.isMountedPcfComponent() && !grid.getClient().isTalxisPortal()) {\n return;\n }\n return defaultUnmount();\n },\n onOverrideControlProps: (controlProps) => {\n //here we always need to fetch the latest parameters\n //we still might have old one's cached in valueRef\n const columnInfo = record.getColumnInfo(getColumn().name);\n const parameters = columnInfo.ui.getControlParameters({\n ...controlProps.parameters,\n ...grid.getParameters(record, getColumn(), props.isCellEditor)\n })\n return { \n ...controlProps,\n context: {\n ...controlProps.context,\n mode: Object.create(controlProps.context.mode, {\n allocatedHeight: {\n value: node.rowHeight!\n },\n\n }),\n parameters: parameters,\n fluentDesignLanguage: getFluentDesignLanguage(controlProps.context.fluentDesignLanguage)\n },\n parameters: parameters\n }\n }\n }\n }}\n />\n}\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEf,MAAA,WAAW,GAAG,CAAC,KAAiB,KAAI;IAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3C,IAAA,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC;AACrC,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;AAC/B,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC/C,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;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BAEJ,CAAC;AACF,4BAAA,UAAU,EAAE,UAAU;4BACtB,oBAAoB,EAAE,uBAAuB,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC;AAC3F,yBAAA;AACD,wBAAA,UAAU,EAAE,UAAU;qBACzB,CAAA;iBACJ;aACJ,CAAA;AACL,SAAC,GACH,CAAA;AACN;;;;"}
1
+ {"version":3,"file":"CellContent.js","sources":["../../../../../../../src/components/Grid/core/components/Cell/CellContent/CellContent.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGridInstance } from '../../../hooks/useGridInstance';\nimport { ICellProps } from '../Cell';\nimport { getCellContentStyles } from './styles';\nimport { NestedControlRenderer } from '../../../../../NestedControlRenderer/NestedControlRenderer';\nimport { ControlTheme, IFluentDesignState } from '../../../../../../utils';\nimport { IComboBoxStyles, IDatePickerStyles, ITextFieldStyles, IToggleStyles, merge, useTheme } from '@fluentui/react';\nimport { useRerender } from '@talxis/react-components';\nimport { getJustifyContent } from '../styles';\nimport { useDebouncedCallback } from 'use-debounce';\nimport { Client } from '@talxis/client-libraries';\nimport { AgGridContext } from '../../AgGrid/context';\n\nconst client = new Client();\n\nexport const CellContent = (props: ICellProps) => {\n const columnRef = React.useRef(props.baseColumn);\n const mountedRef = React.useRef(false);\n const valueRef = React.useRef(props.value);\n columnRef.current = props.baseColumn;\n valueRef.current = props.value;\n const rerender = useRerender();\n const grid = useGridInstance();\n const agGrid = React.useContext(AgGridContext);\n const record = props.data;\n const node = props.node;\n const themeRef = React.useRef(useTheme());\n themeRef.current = useTheme();\n const styles = React.useMemo(() => getCellContentStyles(valueRef.current.columnAlignment), [valueRef.current.columnAlignment]);\n //defer loading of the nested control to solve edge case where the changed values from onNotifyOutputChanged triggered by unmount would not be available straight away\n const [shouldRenderNestedControl, setShouldRenderNestedControl] = React.useState(false);\n const getColumn = () => {\n return columnRef.current;\n }\n\n const getFluentDesignLanguage = (fluentDesignLanguage?: IFluentDesignState) => {\n //@ts-ignore\n const formatting = agGrid.getCellFormatting(props);\n const mergedOverrides: any = merge({}, fluentDesignLanguage?.v8FluentOverrides ?? {}, formatting.themeOverride);\n const columnAlignment = valueRef.current.columnAlignment;\n const result = ControlTheme.GenerateFluentDesignLanguage(formatting.primaryColor, formatting.backgroundColor, formatting.textColor, {\n v8FluentOverrides: merge({},\n {\n semanticColors: {\n inputBorder: 'transparent',\n inputBorderHovered: 'transparent',\n inputBackground: formatting.backgroundColor,\n focusBorder: 'transparent',\n disabledBorder: 'transparent',\n inputFocusBorderAlt: 'transparent',\n errorText: 'transparent'\n\n },\n effects: {\n underlined: false\n },\n\n components: {\n 'TextField': {\n styles: {\n field: {\n textAlign: columnAlignment\n }\n \n } as ITextFieldStyles\n },\n 'ComboBox': {\n styles: {\n input: {\n textAlign: columnAlignment === 'right' ? 'right' : undefined,\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n }\n } as IComboBoxStyles\n },\n 'DatePicker': {\n styles: {\n root: {\n '.ms-TextField-field': {\n paddingRight: columnAlignment === 'right' ? 8 : undefined,\n textAlign: columnAlignment === 'right' ? 'right' : 'left'\n }\n } as any\n } as IDatePickerStyles\n },\n 'Toggle': {\n styles: {\n root: {\n justifyContent: getJustifyContent(columnAlignment)\n }\n } as IToggleStyles\n }\n }\n },\n mergedOverrides\n ),\n applicationTheme: fluentDesignLanguage?.applicationTheme\n })\n return result;\n }\n\n const onNotifyOutputChanged = (outputs: any) => {\n let isEditing = props.isCellEditor;\n //if we are not mounted, set editing to true so requestRender gets run\n //if this is not present, a PCF editor might trigger this too late and we would not see the current value in renderer until next\n if(!mountedRef.current) {\n isEditing = false;\n }\n grid.onNotifyOutputChanged(record, columnRef.current, isEditing, outputs.value, () => rerender())\n }\n const debouncedNotifyOutputChanged = useDebouncedCallback((outputs) => onNotifyOutputChanged(outputs), 100);\n\n React.useEffect(() => {\n mountedRef.current = true;\n setShouldRenderNestedControl(true);\n return () => {\n mountedRef.current = false;\n }\n }, []);\n if(!shouldRenderNestedControl) {\n return <></>\n }\n\n return <NestedControlRenderer\n context={grid.pcfContext}\n parameters={{\n ControlName: valueRef.current.customControl.name,\n LoadingType: 'shimmer',\n Bindings: grid.getBindings(record, getColumn(), valueRef.current.customControl),\n ControlStates: {\n isControlDisabled: !valueRef.current.editing\n },\n }}\n onNotifyOutputChanged={(outputs) => {\n //talxis portal does not have debounce for notifyoutput\n //Power Apps does a debounce of 100ms\n if(getColumn().oneClickEdit && client.isTalxisPortal()) {\n debouncedNotifyOutputChanged(outputs);\n }\n else {\n onNotifyOutputChanged(outputs);\n }\n }}\n onOverrideComponentProps={(componentProps) => {\n return {\n ...componentProps,\n rootContainerProps: {\n ...componentProps.rootContainerProps,\n className: styles.controlRoot\n },\n controlContainerProps: {\n className: styles.controlContainer\n },\n overridenControlContainerProps: {\n className: styles.overridenControlContainer\n },\n messageBarProps: {\n ...componentProps.messageBarProps,\n styles: {\n root: styles.errorMessageRoot,\n content: styles.errorMessageContent\n }\n },\n loadingProps: {\n ...componentProps.loadingProps,\n shimmerProps: {\n ...componentProps.loadingProps.shimmerProps,\n styles: {\n ...componentProps.loadingProps?.shimmerProps?.styles,\n shimmerWrapper: styles.shimmerWrapper\n }\n },\n containerProps: {\n ...componentProps.loadingProps?.containerProps,\n className: styles.loadingWrapper\n }\n },\n onOverrideRender: (control, isCustomPcfComponent, defaultRender) => {\n if(isCustomPcfComponent) {\n grid.setUsesNestedPcfs();\n }\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onRender(control.getProps(), themeRef.current, control.getContainer())\n }\n return defaultRender();\n },\n onOverrideUnmount: (control, defaultUnmount) => {\n if(valueRef.current.customComponent) {\n return valueRef.current.customComponent.onUnmount(control.getContainer());\n }\n //@ts-ignore - internal types\n //skip the unmounting for custom PCF's in Power Apps\n // PCF unmount in Power Apps causes other nested PCF's to reinitialize which causes flickering\n //umounting of nested PCF's happens on grid destroy to prevent memory leaks (currently done by refreshing the page as no better method was found)\n if(control.isMountedPcfComponent() && !grid.getClient().isTalxisPortal()) {\n return;\n }\n return defaultUnmount();\n },\n onOverrideControlProps: (controlProps) => {\n //here we always need to fetch the latest parameters\n //we still might have old one's cached in valueRef\n const columnInfo = record.getColumnInfo(getColumn().name);\n const parameters = columnInfo.ui.getControlParameters({\n ...controlProps.parameters,\n ...grid.getParameters(record, getColumn(), props.isCellEditor)\n })\n return { \n ...controlProps,\n context: {\n ...controlProps.context,\n mode: Object.create(controlProps.context.mode, {\n allocatedHeight: {\n value: node.rowHeight! - 1\n },\n\n }),\n parameters: parameters,\n fluentDesignLanguage: getFluentDesignLanguage(controlProps.context.fluentDesignLanguage)\n },\n parameters: parameters\n }\n }\n }\n }}\n />\n}\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAEf,MAAA,WAAW,GAAG,CAAC,KAAiB,KAAI;IAC7C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3C,IAAA,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC;AACrC,IAAA,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;AAC/B,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC/C,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAA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tB,oBAAoB,EAAE,uBAAuB,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC;AAC3F,yBAAA;AACD,wBAAA,UAAU,EAAE,UAAU;qBACzB,CAAA;iBACJ;aACJ,CAAA;AACL,SAAC,GACH,CAAA;AACN;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talxis/base-controls",
3
- "version": "1.2503.3",
3
+ "version": "1.2503.4",
4
4
  "description": "Set of React components that natively work with Power Apps Component Framework API's",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",