@talxis/base-controls 1.2503.10 → 1.2503.11
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 +6 -5
- package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
- package/dist/components/DatasetControl/interfaces.d.ts +2 -1
- package/dist/components/DatasetControl/styles.d.ts +1 -1
- package/dist/components/DatasetControl/styles.js +1 -1
- package/dist/components/DatasetControl/styles.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useMemo } from 'react';
|
|
3
3
|
import { ThemeProvider, MessageBar, MessageBarButton, MessageBarType } from '@fluentui/react';
|
|
4
4
|
import { datasetControlTranslations } from './translations.js';
|
|
@@ -30,10 +30,10 @@ const DatasetControl = (props) => {
|
|
|
30
30
|
},
|
|
31
31
|
containerProps: {
|
|
32
32
|
theme: theme,
|
|
33
|
-
className: styles.
|
|
33
|
+
className: styles.datasetControlRoot,
|
|
34
34
|
},
|
|
35
35
|
headerProps: {
|
|
36
|
-
|
|
36
|
+
headerContainerProps: {},
|
|
37
37
|
onRender: (renderQuickFind) => renderQuickFind(),
|
|
38
38
|
onGetQuickFindProps: (props) => props
|
|
39
39
|
},
|
|
@@ -51,8 +51,9 @@ const DatasetControl = (props) => {
|
|
|
51
51
|
useMemo(() => {
|
|
52
52
|
componentProps.onDatasetInit();
|
|
53
53
|
}, []);
|
|
54
|
-
return (jsxs(ThemeProvider, { ...componentProps.containerProps, children: [jsx("div", { ...componentProps.headerProps, children: componentProps.headerProps.onRender(() => {
|
|
55
|
-
return jsx(
|
|
54
|
+
return (jsxs(ThemeProvider, { ...componentProps.containerProps, children: [jsx("div", { ...componentProps.headerProps.headerContainerProps, children: componentProps.headerProps.onRender(() => {
|
|
55
|
+
return jsx(Fragment, { children: props.parameters.EnableQuickFind?.raw &&
|
|
56
|
+
jsx(QuickFind, { dataset: dataset, labels: labels, onGetQuickFindComponentProps: (props) => componentProps.headerProps.onGetQuickFindProps(props) }) });
|
|
56
57
|
}) }), jsx(ErrorBoundary, { fallback: (resetError) => { renderErrorMessageBar(() => resetError()); }, children: jsx(Grid, { ...props, onOverrideComponentProps: (props) => props, context: injectedContextRef.current }) })] }));
|
|
57
58
|
};
|
|
58
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetControl.js","sources":["../../../src/components/DatasetControl/DatasetControl.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"DatasetControl.js","sources":["../../../src/components/DatasetControl/DatasetControl.tsx"],"sourcesContent":["import { useMemo, useRef } from \"react\";\nimport { Grid } from \"../Grid\";\nimport { useControl } from \"../../hooks\";\nimport { MessageBar, MessageBarButton, MessageBarType, ThemeProvider } from \"@fluentui/react\";\nimport { datasetControlTranslations } from \"./translations\";\nimport { getDatasetControlStyles } from \"./styles\";\nimport { IDatasetControl } from \"./interfaces\";\nimport { QuickFind } from \"./QuickFind/QuickFind\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\nimport { useRerender } from \"@talxis/react-components\";\n\nexport const DatasetControl = (props: IDatasetControl) => {\n const { labels, theme } = useControl('DatasetControl', props, datasetControlTranslations);\n const rerender = useRerender();\n const dataset = props.parameters.Grid;\n const injectedContextRef = useRef(props.context);\n const styles = useMemo(() => getDatasetControlStyles(theme, props.parameters.Height?.raw), []);\n const onOverrideComponentProps = props.onOverrideComponentProps ?? ((props) => props);\n //@ts-ignore - private property\n dataset._setRenderer(() => rerender());\n\n //we need to have a way to customize the init behavior from above\n const componentProps = onOverrideComponentProps({\n onDatasetInit: () => {\n if (dataset.paging.pageNumber > 1) {\n dataset.paging.loadExactPage(dataset.paging.pageNumber)\n }\n else {\n dataset.refresh();\n }\n },\n containerProps: {\n theme: theme,\n className: styles.datasetControlRoot,\n },\n headerProps: {\n headerContainerProps: {},\n onRender: (renderQuickFind) => renderQuickFind(),\n onGetQuickFindProps: (props) => props\n },\n });\n\n const renderErrorMessageBar = (onReset?: () => void) => {\n <MessageBar\n isMultiline={false}\n actions={<MessageBarButton className={styles.messageBarBtn} text={labels.reload()} onClick={() => {\n onReset?.();\n dataset.refresh();\n }} />}\n messageBarType={MessageBarType.error}>\n {dataset.errorMessage || labels.generalError()}\n </MessageBar>\n }\n\n useMemo(() => {\n //@ts-ignore - private property\n injectedContextRef.current = dataset._patchContext(props.context);\n }, [props.context]);\n\n useMemo(() => {\n componentProps.onDatasetInit();\n }, []);\n\n\n return (\n <ThemeProvider {...componentProps.containerProps}>\n <div {...componentProps.headerProps.headerContainerProps}>\n {componentProps.headerProps.onRender(() => {\n return <>\n {props.parameters.EnableQuickFind?.raw &&\n <QuickFind dataset={dataset} labels={labels} onGetQuickFindComponentProps={(props) => componentProps.headerProps.onGetQuickFindProps(props)} />\n }\n </>\n })}\n </div>\n <ErrorBoundary fallback={(resetError: () => void) => { renderErrorMessageBar(() => resetError()) }}>\n <Grid\n {...props}\n onOverrideComponentProps={(props) => props}\n context={injectedContextRef.current} />\n </ErrorBoundary>\n </ThemeProvider>\n )\n}"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAWa,MAAA,cAAc,GAAG,CAAC,KAAsB,KAAI;AACvD,IAAA,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,CAAC,CAAC;AAC1F,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;IACtC,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,uBAAuB,CAAC,K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asetInit: () => void;
|
|
11
11
|
containerProps: ThemeProviderProps;
|
|
12
|
-
headerProps:
|
|
12
|
+
headerProps: {
|
|
13
|
+
headerContainerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
13
14
|
onRender: (renderQuickFind: () => React.ReactElement) => React.ReactElement;
|
|
14
15
|
onGetQuickFindProps: (props: ITextFieldProps) => ITextFieldProps;
|
|
15
16
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITheme } from "@talxis/react-components";
|
|
2
2
|
export declare const getDatasetControlStyles: (theme: ITheme, height?: string | null) => import("@fluentui/react").IProcessedStyleSet<{
|
|
3
|
-
|
|
3
|
+
datasetControlRoot: {
|
|
4
4
|
flexGrow?: number | undefined;
|
|
5
5
|
paddingLeft?: number | undefined;
|
|
6
6
|
paddingRight?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/components/DatasetControl/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\nimport { Client } from \"@talxis/client-libraries\";\nimport { ITheme } from \"@talxis/react-components\";\n\nconst client = new Client();\n\nexport const getDatasetControlStyles = (theme: ITheme, height?: string | null) => {\n return mergeStyleSets({\n
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/DatasetControl/styles.ts"],"sourcesContent":["import { mergeStyleSets } from \"@fluentui/react\"\nimport { Client } from \"@talxis/client-libraries\";\nimport { ITheme } from \"@talxis/react-components\";\n\nconst client = new Client();\n\nexport const getDatasetControlStyles = (theme: ITheme, height?: string | null) => {\n return mergeStyleSets({\n datasetControlRoot: {\n display: 'flex',\n flexDirection: 'column',\n gap: 15,\n ...(height === '100%' ? getFullHeightStyles(theme) : {})\n\n },\n messageBarBtn: {\n minHeight: 'inherit'\n }\n });\n}\n\nconst getFullHeightStyles = (theme: ITheme) => {\n const styles = {\n flexGrow: 1,\n paddingLeft: 15,\n paddingRight: 15,\n paddingTop: 15\n }\n if (!client.isTalxisPortal()) {\n return {\n ...styles,\n boxShadow: theme.effects.elevation8,\n borderRadius: theme.effects.roundedCorner4,\n margin: 16,\n marginRight: 20\n }\n }\n else {\n return styles;\n }\n}"],"names":[],"mappings":";;;AAIA,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;MAEf,uBAAuB,GAAG,CAAC,KAAa,EAAE,MAAsB,KAAI;AAC7E,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,kBAAkB,EAAE;AAChB,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,aAAa,EAAE,QAAQ;AACvB,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,IAAI,MAAM,KAAK,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAE3D,SAAA;AACD,QAAA,aAAa,EAAE;AACX,YAAA,SAAS,EAAE,SAAS;AACvB,SAAA;AACJ,KAAA,CAAC,CAAC;AACP,EAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,KAAa,KAAI;AAC1C,IAAA,MAAM,MAAM,GAAG;AACX,QAAA,QAAQ,EAAE,CAAC;AACX,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,UAAU,EAAE,EAAE;KACjB,CAAA;AACD,IAAA,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE;QAC1B,OAAO;AACH,YAAA,GAAG,MAAM;AACT,YAAA,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;AACnC,YAAA,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;AAC1C,YAAA,MAAM,EAAE,EAAE;AACV,YAAA,WAAW,EAAE,EAAE;SAClB,CAAA;AACJ,KAAA;AACI,SAAA;AACD,QAAA,OAAO,MAAM,CAAC;AACjB,KAAA;AACL,CAAC;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -650,7 +650,8 @@ declare const datasetControlTranslations: {
|
|
|
650
650
|
interface IDatasetControlComponentProps {
|
|
651
651
|
onDatasetInit: () => void;
|
|
652
652
|
containerProps: ThemeProviderProps;
|
|
653
|
-
headerProps:
|
|
653
|
+
headerProps: {
|
|
654
|
+
headerContainerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
654
655
|
onRender: (renderQuickFind: () => React.ReactElement) => React.ReactElement;
|
|
655
656
|
onGetQuickFindProps: (props: ITextFieldProps) => ITextFieldProps;
|
|
656
657
|
};
|
package/package.json
CHANGED