@oneblink/apps-react 5.12.0-beta.14 → 5.12.0-beta.15
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/Lists.d.ts +1 -1
- package/dist/components/MaterialIcon.d.ts +2 -1
- package/dist/components/MaterialIcon.js +3 -3
- package/dist/components/MaterialIcon.js.map +1 -1
- package/dist/components/formStore/FormStoreTableProvider.js +1 -2
- package/dist/components/formStore/FormStoreTableProvider.js.map +1 -1
- package/dist/components/formStore/OneBlinkFormStoreTable.js +7 -6
- package/dist/components/formStore/OneBlinkFormStoreTable.js.map +1 -1
- package/dist/components/formStore/display/FormStoreIcon.d.ts +2 -2
- package/dist/components/formStore/display/FormStoreIcon.js +3 -3
- package/dist/components/formStore/display/FormStoreIcon.js.map +1 -1
- package/dist/components/formStore/table/HeaderCellMoreButton.js +1 -5
- package/dist/components/formStore/table/HeaderCellMoreButton.js.map +1 -1
- package/dist/components/messages/ErrorMessage.js +3 -6
- package/dist/components/messages/ErrorMessage.js.map +1 -1
- package/dist/components/messages/LargeIconMessage.d.ts +4 -2
- package/dist/components/messages/LargeIconMessage.js +1 -1
- package/dist/components/messages/LargeIconMessage.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/IconComponent.d.ts +0 -7
- package/dist/components/IconComponent.js +0 -13
- package/dist/components/IconComponent.js.map +0 -1
@@ -11,5 +11,5 @@ type ListProps = {
|
|
11
11
|
};
|
12
12
|
export declare const ListItem: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
13
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
14
|
-
}, "className" | "p" | "style" | "children" | "classes" | "sx" | "color" | "height" | "width" | "display" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "align" | "
|
14
|
+
}, "className" | "p" | "style" | "children" | "classes" | "sx" | "color" | "height" | "width" | "display" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "order" | "overflow" | "visibility" | "align" | "border" | "boxShadow" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "ref"> & import("@mui/system").MUIStyledCommonProps<Theme> & ListProps, {}, {}>;
|
15
15
|
export {};
|
@@ -1,2 +1,3 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
|
2
|
+
import { Icon } from '@mui/material';
|
3
|
+
export default function MaterialIcon(props: React.ComponentProps<typeof Icon>): React.JSX.Element;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import
|
3
|
-
export default function MaterialIcon(
|
4
|
-
return
|
2
|
+
import { Icon } from '@mui/material';
|
3
|
+
export default function MaterialIcon(props) {
|
4
|
+
return React.createElement(Icon, { "aria-hidden": true, ...props });
|
5
5
|
}
|
6
6
|
//# sourceMappingURL=MaterialIcon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MaterialIcon.js","sourceRoot":"","sources":["../../src/components/MaterialIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,
|
1
|
+
{"version":3,"file":"MaterialIcon.js","sourceRoot":"","sources":["../../src/components/MaterialIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEpC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAwC;IAC3E,OAAO,oBAAC,IAAI,4BAAiB,KAAK,GAAI,CAAA;AACxC,CAAC","sourcesContent":["import * as React from 'react'\nimport { Icon } from '@mui/material'\n\nexport default function MaterialIcon(props: React.ComponentProps<typeof Icon>) {\n return <Icon aria-hidden {...props} />\n}\n"]}
|
@@ -13,7 +13,6 @@ import NoResourcesYet from '../messages/NoResourcesYet';
|
|
13
13
|
import FormStoreIcon from './display/FormStoreIcon';
|
14
14
|
import { FormStoreTableContext } from './useFormStoreTableContext';
|
15
15
|
import MaterialIcon from '../MaterialIcon';
|
16
|
-
import IconComponent from '../IconComponent';
|
17
16
|
const TABLE_PARAMETERS_FORM_STORE_KEY = 'REACT_TABLE_PARAMETERS_FORM_STORE';
|
18
17
|
function getParamsFromLocalStorage() {
|
19
18
|
const text = localStorage.getItem(TABLE_PARAMETERS_FORM_STORE_KEY);
|
@@ -106,7 +105,7 @@ export function FormStoreTableProvider({ form, children, }) {
|
|
106
105
|
});
|
107
106
|
return (React.createElement(FormStoreTableContext.Provider, { value: formStoreTable },
|
108
107
|
children,
|
109
|
-
formStoreTable.visibleColumns.length ? (React.createElement(React.Fragment, null, !formStoreRecords.length && !isLoading && !loadError && (React.createElement(NoResourcesYet, { IconComponent: FormStoreIcon, title: "No Records Found..." }, "There are no Submissions matching your filters.")))) : (React.createElement(NoResourcesYet, { IconComponent: (props) => (React.createElement(
|
108
|
+
formStoreTable.visibleColumns.length ? (React.createElement(React.Fragment, null, !formStoreRecords.length && !isLoading && !loadError && (React.createElement(NoResourcesYet, { IconComponent: FormStoreIcon, title: "No Records Found..." }, "There are no Submissions matching your filters.")))) : (React.createElement(NoResourcesYet, { IconComponent: (props) => (React.createElement(MaterialIcon, { ...props }, "settings")), title: "No Columns Visible", gutterBottom: true }, "It looks like you have hidden all of the available columns. Please enable at least one column to view submissions.")),
|
110
109
|
isLoading === 'INITIAL' && (React.createElement("div", { className: "ob-form-store-loading-initial" },
|
111
110
|
React.createElement(LoadingWithMessage, { message: "Loading initial records..." }))),
|
112
111
|
loadError && (React.createElement(React.Fragment, null,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormStoreTableProvider.js","sourceRoot":"","sources":["../../../src/components/formStore/FormStoreTableProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,WAAW,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,yBAAyB,MAAM,uCAAuC,CAAA;AAC7E,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,gCAAgC,EAAE,EACvC,cAA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,EAAC,OAAO,EACZ,eAAe,EAAC,OAAO,EACvB,SAAS,EAAE,oBAAC,YAAY,oBAAyB,EACjD,OAAO,EAAE;wBACP,gBAAgB,EAAE,sCAAsC;qBACzD,gBAGa,CACX,CACH,CACP,CAC8B,CAClC,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport querystring from 'query-string'\nimport { FormStoreRecord } from '@oneblink/types/typescript/submissions'\nimport { formStoreService } from '@oneblink/apps'\nimport useInfiniteScrollDataLoad from '../../hooks/useInfiniteScrollDataLoad'\nimport useFormStoreTable from './table/useFormStoreTable'\nimport { Box, Button, Grid } from '@mui/material'\nimport { LoadingButton } from '@mui/lab'\nimport { FormTypes } from '@oneblink/types'\nimport useSubmissionIdValidationMessage, {\n validateIsUUID,\n} from '../../hooks/useSubmissionIdIsValid'\nimport ErrorMessage from '../messages/ErrorMessage'\nimport LoadingWithMessage from '../LoadingWithMessage'\nimport NoResourcesYet from '../messages/NoResourcesYet'\nimport FormStoreIcon from './display/FormStoreIcon'\nimport { FormStoreTableContext } from './useFormStoreTableContext'\nimport MaterialIcon from '../MaterialIcon'\nimport IconComponent from '../IconComponent'\n\nconst TABLE_PARAMETERS_FORM_STORE_KEY = 'REACT_TABLE_PARAMETERS_FORM_STORE'\n\nfunction getParamsFromLocalStorage() {\n const text = localStorage.getItem(TABLE_PARAMETERS_FORM_STORE_KEY)\n if (text) {\n return JSON.parse(text)\n }\n}\n\nexport function FormStoreTableProvider({\n form,\n children,\n}: {\n form: FormTypes.Form\n children: React.ReactNode\n}) {\n const history = useHistory()\n const location = useLocation()\n const {\n isLoading,\n loadError,\n records: formStoreRecords,\n onTryAgain,\n onRefresh,\n filters: parameters,\n onChangeFilters: onChangeParameters,\n nextOffset,\n } = useInfiniteScrollDataLoad<\n formStoreService.FormStoreParameters,\n FormStoreRecord\n >({\n limit: 50,\n isManual: true,\n debounceSearchMs: 1000,\n onDefaultFilters: React.useCallback((query) => {\n let defaultParameters: formStoreService.FormStoreParameters = {}\n const localStorageParams = getParamsFromLocalStorage()\n if (\n localStorageParams &&\n Object(localStorageParams) === localStorageParams\n ) {\n defaultParameters = localStorageParams\n }\n try {\n if (typeof query.parameters === 'string') {\n //allow qs params to override local storage\n defaultParameters = {\n ...defaultParameters,\n ...JSON.parse(query.parameters),\n }\n }\n } catch (error) {\n console.warn('Could not parse filter as JSON', error)\n }\n if (!defaultParameters.sorting) {\n defaultParameters.sorting = [\n { property: 'dateTimeSubmitted', direction: 'descending' },\n ]\n }\n return defaultParameters\n }, []),\n onSearch: React.useCallback(\n async (currentParameters, paging, abortSignal) => {\n // Exclude all search parameters if searching\n // for a specific submission using an identifier\n const filters = currentParameters.filters?.submissionId\n ? {\n submissionId: currentParameters.filters.submissionId,\n }\n : currentParameters.filters\n const result = await formStoreService.searchFormStoreRecords(\n {\n ...currentParameters,\n paging,\n formId: form.id,\n filters,\n },\n abortSignal,\n )\n return {\n records: result.formStoreRecords,\n meta: result.meta,\n }\n },\n [form.id],\n ),\n onValidateFilters: React.useCallback(\n (currentParameters: formStoreService.FormStoreParameters) => {\n return validateIsUUID(currentParameters.filters?.submissionId?.$eq)\n },\n [],\n ),\n })\n\n React.useEffect(() => {\n const currentSearch = querystring.parse(location.search)\n history.replace({\n search: querystring.stringify({\n ...currentSearch,\n parameters: JSON.stringify(parameters),\n }),\n })\n }, [history, location.search, parameters])\n\n const submissionIdValidationMessage = useSubmissionIdValidationMessage(\n parameters.filters?.submissionId?.$eq,\n )\n\n React.useEffect(() => {\n const paramsToStore = {\n unwindRepeatableSets: parameters?.unwindRepeatableSets,\n }\n localStorage.setItem(\n TABLE_PARAMETERS_FORM_STORE_KEY,\n JSON.stringify(paramsToStore),\n )\n }, [parameters?.unwindRepeatableSets])\n\n const formStoreTable = useFormStoreTable({\n formStoreRecords,\n parameters,\n onChangeParameters,\n submissionIdValidationMessage,\n form,\n onRefresh,\n })\n\n return (\n <FormStoreTableContext.Provider value={formStoreTable}>\n {children}\n {formStoreTable.visibleColumns.length ? (\n <>\n {!formStoreRecords.length && !isLoading && !loadError && (\n <NoResourcesYet\n IconComponent={FormStoreIcon}\n title=\"No Records Found...\"\n >\n There are no Submissions matching your filters.\n </NoResourcesYet>\n )}\n </>\n ) : (\n <NoResourcesYet\n IconComponent={(props) => (\n <IconComponent {...props} icon=\"settings\" />\n )}\n title=\"No Columns Visible\"\n gutterBottom\n >\n It looks like you have hidden all of the available columns. Please\n enable at least one column to view submissions.\n </NoResourcesYet>\n )}\n\n {isLoading === 'INITIAL' && (\n <div className=\"ob-form-store-loading-initial\">\n <LoadingWithMessage message=\"Loading initial records...\" />\n </div>\n )}\n\n {loadError && (\n <>\n <ErrorMessage\n title=\"Error Retrieving Submissions\"\n gutterBottom\n gutterTop\n >\n {loadError.message}\n </ErrorMessage>\n <Grid container justifyContent=\"center\">\n <Button\n className=\"ob-form-store-try-again-button\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => onTryAgain()}\n >\n Try Again\n </Button>\n </Grid>\n </>\n )}\n\n {!!nextOffset && !loadError && isLoading !== 'INITIAL' && (\n <Box padding={4} className=\"ob-form-store-load-more-button-container\">\n <Grid container justifyContent=\"center\">\n <LoadingButton\n className=\"ob-form-store-load-more-button\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => onTryAgain(nextOffset)}\n loading={isLoading === 'MORE'}\n size=\"large\"\n loadingPosition=\"start\"\n startIcon={<MaterialIcon>read_more</MaterialIcon>}\n classes={{\n loadingIndicator: 'ob-form-store-loading-more-indicator',\n }}\n >\n Load More\n </LoadingButton>\n </Grid>\n </Box>\n )}\n </FormStoreTableContext.Provider>\n )\n}\n"]}
|
1
|
+
{"version":3,"file":"FormStoreTableProvider.js","sourceRoot":"","sources":["../../../src/components/formStore/FormStoreTableProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,k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SAAS,EAAC,0CAA0C;YACnE,oBAAC,IAAI,IAAC,SAAS,QAAC,cAAc,EAAC,QAAQ;gBACrC,oBAAC,aAAa,IACZ,SAAS,EAAC,gCAAgC,EAC1C,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,SAAS,KAAK,MAAM,EAC7B,IAAI,EAAC,OAAO,EACZ,eAAe,EAAC,OAAO,EACvB,SAAS,EAAE,oBAAC,YAAY,oBAAyB,EACjD,OAAO,EAAE;wBACP,gBAAgB,EAAE,sCAAsC;qBACzD,gBAGa,CACX,CACH,CACP,CAC8B,CAClC,CAAA;AACH,CAAC","sourcesContent":["import * as React from 'react'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport querystring from 'query-string'\nimport { FormStoreRecord } from '@oneblink/types/typescript/submissions'\nimport { formStoreService } from '@oneblink/apps'\nimport useInfiniteScrollDataLoad from '../../hooks/useInfiniteScrollDataLoad'\nimport useFormStoreTable from './table/useFormStoreTable'\nimport { Box, Button, Grid } from '@mui/material'\nimport { LoadingButton } from '@mui/lab'\nimport { FormTypes } from '@oneblink/types'\nimport useSubmissionIdValidationMessage, {\n validateIsUUID,\n} from '../../hooks/useSubmissionIdIsValid'\nimport ErrorMessage from '../messages/ErrorMessage'\nimport LoadingWithMessage from '../LoadingWithMessage'\nimport NoResourcesYet from '../messages/NoResourcesYet'\nimport FormStoreIcon from './display/FormStoreIcon'\nimport { FormStoreTableContext } from './useFormStoreTableContext'\nimport MaterialIcon from '../MaterialIcon'\n\nconst TABLE_PARAMETERS_FORM_STORE_KEY = 'REACT_TABLE_PARAMETERS_FORM_STORE'\n\nfunction getParamsFromLocalStorage() {\n const text = localStorage.getItem(TABLE_PARAMETERS_FORM_STORE_KEY)\n if (text) {\n return JSON.parse(text)\n }\n}\n\nexport function FormStoreTableProvider({\n form,\n children,\n}: {\n form: FormTypes.Form\n children: React.ReactNode\n}) {\n const history = useHistory()\n const location = useLocation()\n const {\n isLoading,\n loadError,\n records: formStoreRecords,\n onTryAgain,\n onRefresh,\n filters: parameters,\n onChangeFilters: onChangeParameters,\n nextOffset,\n } = useInfiniteScrollDataLoad<\n formStoreService.FormStoreParameters,\n FormStoreRecord\n >({\n limit: 50,\n isManual: true,\n debounceSearchMs: 1000,\n onDefaultFilters: React.useCallback((query) => {\n let defaultParameters: formStoreService.FormStoreParameters = {}\n const localStorageParams = getParamsFromLocalStorage()\n if (\n localStorageParams &&\n Object(localStorageParams) === localStorageParams\n ) {\n defaultParameters = localStorageParams\n }\n try {\n if (typeof query.parameters === 'string') {\n //allow qs params to override local storage\n defaultParameters = {\n ...defaultParameters,\n ...JSON.parse(query.parameters),\n }\n }\n } catch (error) {\n console.warn('Could not parse filter as JSON', error)\n }\n if (!defaultParameters.sorting) {\n defaultParameters.sorting = [\n { property: 'dateTimeSubmitted', direction: 'descending' },\n ]\n }\n return defaultParameters\n }, []),\n onSearch: React.useCallback(\n async (currentParameters, paging, abortSignal) => {\n // Exclude all search parameters if searching\n // for a specific submission using an identifier\n const filters = currentParameters.filters?.submissionId\n ? {\n submissionId: currentParameters.filters.submissionId,\n }\n : currentParameters.filters\n const result = await formStoreService.searchFormStoreRecords(\n {\n ...currentParameters,\n paging,\n formId: form.id,\n filters,\n },\n abortSignal,\n )\n return {\n records: result.formStoreRecords,\n meta: result.meta,\n }\n },\n [form.id],\n ),\n onValidateFilters: React.useCallback(\n (currentParameters: formStoreService.FormStoreParameters) => {\n return validateIsUUID(currentParameters.filters?.submissionId?.$eq)\n },\n [],\n ),\n })\n\n React.useEffect(() => {\n const currentSearch = querystring.parse(location.search)\n history.replace({\n search: querystring.stringify({\n ...currentSearch,\n parameters: JSON.stringify(parameters),\n }),\n })\n }, [history, location.search, parameters])\n\n const submissionIdValidationMessage = useSubmissionIdValidationMessage(\n parameters.filters?.submissionId?.$eq,\n )\n\n React.useEffect(() => {\n const paramsToStore = {\n unwindRepeatableSets: parameters?.unwindRepeatableSets,\n }\n localStorage.setItem(\n TABLE_PARAMETERS_FORM_STORE_KEY,\n JSON.stringify(paramsToStore),\n )\n }, [parameters?.unwindRepeatableSets])\n\n const formStoreTable = useFormStoreTable({\n formStoreRecords,\n parameters,\n onChangeParameters,\n submissionIdValidationMessage,\n form,\n onRefresh,\n })\n\n return (\n <FormStoreTableContext.Provider value={formStoreTable}>\n {children}\n {formStoreTable.visibleColumns.length ? (\n <>\n {!formStoreRecords.length && !isLoading && !loadError && (\n <NoResourcesYet\n IconComponent={FormStoreIcon}\n title=\"No Records Found...\"\n >\n There are no Submissions matching your filters.\n </NoResourcesYet>\n )}\n </>\n ) : (\n <NoResourcesYet\n IconComponent={(props) => (\n <MaterialIcon {...props}>settings</MaterialIcon>\n )}\n title=\"No Columns Visible\"\n gutterBottom\n >\n It looks like you have hidden all of the available columns. Please\n enable at least one column to view submissions.\n </NoResourcesYet>\n )}\n\n {isLoading === 'INITIAL' && (\n <div className=\"ob-form-store-loading-initial\">\n <LoadingWithMessage message=\"Loading initial records...\" />\n </div>\n )}\n\n {loadError && (\n <>\n <ErrorMessage\n title=\"Error Retrieving Submissions\"\n gutterBottom\n gutterTop\n >\n {loadError.message}\n </ErrorMessage>\n <Grid container justifyContent=\"center\">\n <Button\n className=\"ob-form-store-try-again-button\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => onTryAgain()}\n >\n Try Again\n </Button>\n </Grid>\n </>\n )}\n\n {!!nextOffset && !loadError && isLoading !== 'INITIAL' && (\n <Box padding={4} className=\"ob-form-store-load-more-button-container\">\n <Grid container justifyContent=\"center\">\n <LoadingButton\n className=\"ob-form-store-load-more-button\"\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => onTryAgain(nextOffset)}\n loading={isLoading === 'MORE'}\n size=\"large\"\n loadingPosition=\"start\"\n startIcon={<MaterialIcon>read_more</MaterialIcon>}\n classes={{\n loadingIndicator: 'ob-form-store-loading-more-indicator',\n }}\n >\n Load More\n </LoadingButton>\n </Grid>\n </Box>\n )}\n </FormStoreTableContext.Provider>\n )\n}\n"]}
|
@@ -5,11 +5,8 @@ import { IsHoveringProvider } from '../../hooks/useIsHovering';
|
|
5
5
|
import HeaderCellMoreButton from './table/HeaderCellMoreButton';
|
6
6
|
import useFormStoreTableContext from './useFormStoreTableContext';
|
7
7
|
import MaterialIcon from '../MaterialIcon';
|
8
|
-
const
|
8
|
+
const SortingIcon = styled(MaterialIcon)(({ theme }) => ({
|
9
9
|
transition: theme.transitions.create('transform'),
|
10
|
-
transform: sortingDirection === 'ascending' ? 'rotate(180deg)' : undefined,
|
11
|
-
fontSize: theme.typography.h6.fontSize + '!important',
|
12
|
-
color: theme.palette[color].main,
|
13
10
|
}));
|
14
11
|
const Table = styled('div')(({ theme }) => ({
|
15
12
|
display: 'inline-block',
|
@@ -154,9 +151,13 @@ function OneBlinkFormStoreTable() {
|
|
154
151
|
React.createElement(IsHoveringProvider, { className: "th-content" },
|
155
152
|
React.createElement("div", { className: "th-label" },
|
156
153
|
React.createElement("span", null, headerGroup.headerText),
|
157
|
-
sortingDirection && (React.createElement(
|
154
|
+
sortingDirection && (React.createElement(SortingIcon, { fontSize: "small", color: "primary", sx: sortingDirection === 'ascending'
|
155
|
+
? {
|
156
|
+
transform: 'rotate(180deg)',
|
157
|
+
}
|
158
|
+
: undefined, className: "th-icon" }, "arrow_downward")),
|
158
159
|
((_c = headerGroup.filter) === null || _c === void 0 ? void 0 : _c.isInvalid) ? (React.createElement(Tooltip, { title: ((_d = headerGroup.filter) === null || _d === void 0 ? void 0 : _d.validationMessage) || '' },
|
159
|
-
React.createElement(
|
160
|
+
React.createElement(MaterialIcon, { fontSize: "small", color: "error", className: "th-icon" }, "warning"))) : ((_e = headerGroup.filter) === null || _e === void 0 ? void 0 : _e.value) ? (React.createElement(MaterialIcon, { fontSize: "small", color: "primary", className: "th-icon" }, "filter_list")) : null),
|
160
161
|
React.createElement(HeaderCellMoreButton, { headerGroup: headerGroup, onHide: headerGroup.toggleHidden }),
|
161
162
|
React.createElement("div", { ...headerGroup.getResizerProps(), className: clsx('resizer', {
|
162
163
|
'is-resizing': headerGroup.isResizing,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"OneBlinkFormStoreTable.js","sourceRoot":"","sources":["../../../src/components/formStore/OneBlinkFormStoreTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,oBAAoB,MAAM,8BAA8B,CAAA;AAC/D,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AAEjE,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,MAAM,UAAU,GAAG,MAAM,CACvB,CAAC,EACC,IAAI,EACJ,GAAG,KAAK,EAGmC,EAAE,EAAE,CAAC,CAChD,oBAAC,YAAY,OAAK,KAAK,IAAG,IAAI,CAAgB,CAC/C,CACF,CAIE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC;IACjD,SAAS,EAAE,gBAAgB,KAAK,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;IAC1E,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,GAAG,YAAY;IACrD,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI;CACjC,CAAC,CAAC,CAAA;AAEH,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,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,IAAI,CAAC,sBAAsB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport clsx from 'clsx'\nimport { styled, Tooltip } from '@mui/material'\nimport { IsHoveringProvider } from '../../hooks/useIsHovering'\nimport HeaderCellMoreButton from './table/HeaderCellMoreButton'\nimport useFormStoreTableContext from './useFormStoreTableContext'\nimport { Color } from '../../types/mui-color'\nimport MaterialIcon from '../MaterialIcon'\n\nconst StyledIcon = styled(\n ({\n icon,\n ...props\n }: {\n icon: string\n } & React.ComponentProps<typeof MaterialIcon>) => (\n <MaterialIcon {...props}>{icon}</MaterialIcon>\n ),\n)<{\n color: Color\n icon: string\n sortingDirection?: 'ascending' | 'descending'\n}>(({ theme, color, sortingDirection }) => ({\n transition: theme.transitions.create('transform'),\n transform: sortingDirection === 'ascending' ? 'rotate(180deg)' : undefined,\n fontSize: theme.typography.h6.fontSize + '!important',\n color: theme.palette[color].main,\n}))\n\nconst Table = styled('div')(({ theme }) => ({\n display: 'inline-block',\n backgroundColor: theme.palette.background.paper,\n fontSize: theme.typography.body2.fontSize,\n '& .ob-form-store-table-row__alternate': {\n backgroundColor: theme.palette.action.hover,\n },\n '& .tc': {\n padding: theme.spacing(1),\n borderBottom: '1px solid',\n borderBottomColor: theme.palette.divider,\n display: 'flex',\n alignItems: 'center',\n '&.is-clickable': {\n cursor: 'pointer',\n transition: theme.transitions.create('transform'),\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n },\n },\n },\n '& .td': {\n position: 'relative',\n borderRight: '1px solid',\n borderRightColor: theme.palette.divider,\n overflowX: 'hidden',\n // minus 1 to cater for the border\n minHeight: `${parseInt(theme.spacing(5.5)) - 1}px`,\n '&.is-resizing': {\n borderRightStyle: 'dashed',\n },\n },\n '& .th': {\n position: 'relative',\n fontWeight: theme.typography.fontWeightBold,\n paddingRight: 0,\n borderBottomWidth: '2px',\n '& .th-content': {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderRight: '1px solid',\n borderRightColor: theme.palette.divider,\n paddingRight: theme.spacing(),\n '& .th-label': {\n display: 'inline-flex',\n alignItems: 'center',\n '& .th-icon': {\n marginLeft: theme.spacing(),\n },\n },\n },\n '& .resizer': {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 0,\n borderLeftStyle: 'solid',\n borderRightStyle: 'solid',\n borderColor: theme.palette.divider,\n paddingTop: theme.spacing(),\n paddingBottom: theme.spacing(),\n paddingRight: `calc(${theme.spacing(1)} + 1px)`,\n position: 'absolute',\n right: 0,\n top: theme.spacing(0.5),\n bottom: theme.spacing(0.5),\n transform: `translateX(calc(${theme.spacing(0.5)} + 1px))`,\n zIndex: 1,\n // prevents from scrolling while dragging on touch devices\n touchAction: 'none',\n '&:hover': {\n borderWidth: '1px',\n },\n '&.is-resizing': {\n borderWidth: '1px',\n borderColor: theme.palette.grey[700],\n },\n },\n },\n}))\n\nfunction OneBlinkFormStoreTable() {\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups: [parentHeaderGroup],\n rows,\n prepareRow,\n onChangeParameters,\n } = useFormStoreTableContext()\n\n if (!parentHeaderGroup) {\n return null\n }\n\n let alternateBackground = false\n\n return (\n <>\n <Table {...getTableProps()} className=\"ob-form-store-table\">\n <div className=\"thead\">\n <div\n {...parentHeaderGroup.getHeaderGroupProps()}\n className=\"tr ob-form-store-table-header-row\"\n >\n {\n // Loop over the headers in each row\n parentHeaderGroup.headers.map((headerGroup) => {\n const sortingProperty = headerGroup.sorting?.property\n const sortingDirection = headerGroup.sorting?.direction\n\n return (\n <Tooltip\n title={headerGroup.tooltip || ''}\n arrow\n key={headerGroup.id}\n PopperProps={{\n sx: {\n zIndex: 'drawer',\n },\n }}\n >\n <div\n className={clsx('th tc ob-form-store-table-header-cell', {\n 'is-clickable': !!sortingProperty,\n })}\n onClick={\n sortingProperty\n ? () => {\n onChangeParameters((currentParameters) => {\n switch (sortingDirection) {\n case 'ascending': {\n return {\n ...currentParameters,\n sorting: [\n {\n property: sortingProperty,\n direction: 'descending',\n },\n ],\n }\n }\n case 'descending': {\n return {\n ...currentParameters,\n sorting: undefined,\n }\n }\n default: {\n return {\n ...currentParameters,\n sorting: [\n {\n property: sortingProperty,\n direction: 'ascending',\n },\n ],\n }\n }\n }\n }, false)\n }\n : undefined\n }\n // Apply the header cell props\n {...headerGroup.getHeaderProps()}\n >\n <IsHoveringProvider className=\"th-content\">\n <div className=\"th-label\">\n <span>{headerGroup.headerText}</span>\n {sortingDirection && (\n <StyledIcon\n className=\"th-icon\"\n sortingDirection={sortingDirection}\n color=\"primary\"\n icon=\"arrow_downward\"\n />\n )}\n {headerGroup.filter?.isInvalid ? (\n <Tooltip\n title={\n headerGroup.filter?.validationMessage || ''\n }\n >\n <StyledIcon\n color=\"error\"\n icon=\"warning\"\n className=\"th-icon\"\n />\n </Tooltip>\n ) : headerGroup.filter?.value ? (\n <StyledIcon\n color=\"primary\"\n icon=\"filter_list\"\n className=\"th-icon\"\n />\n ) : null}\n </div>\n <HeaderCellMoreButton\n headerGroup={headerGroup}\n onHide={headerGroup.toggleHidden}\n />\n <div\n {...headerGroup.getResizerProps()}\n className={clsx('resizer', {\n 'is-resizing': headerGroup.isResizing,\n })}\n onClick={(event) => {\n event.stopPropagation()\n }}\n />\n </IsHoveringProvider>\n </div>\n </Tooltip>\n )\n })\n }\n </div>\n </div>\n <div {...getTableBodyProps()} className=\"tbody\">\n {\n // Loop over the table rows\n rows.map((row, index) => {\n if (\n rows[index - 1]?.original.submissionId !==\n row.original.submissionId\n ) {\n alternateBackground = !alternateBackground\n }\n // Prepare the row for display\n prepareRow(row)\n return (\n // Apply the row props\n <div\n {...row.getRowProps()}\n key={row.id}\n className={clsx('tr ob-form-store-table-row', {\n 'ob-form-store-table-row__alternate': alternateBackground,\n })}\n >\n {\n // Loop over the rows cells\n row.cells.map((cell) => {\n // Apply the cell props\n return (\n <IsHoveringProvider\n {...cell.getCellProps()}\n key={cell.column.id}\n className={clsx(\n 'td tc ob-form-store-table-row-cell',\n {\n 'is-resizing': cell.column.isResizing,\n },\n )}\n >\n {\n // Render the cell contents\n cell.render('Cell')\n }\n </IsHoveringProvider>\n )\n })\n }\n </div>\n )\n })\n }\n </div>\n </Table>\n </>\n )\n}\n\n/**\n * @returns\n * @group Components\n */\nexport default React.memo(OneBlinkFormStoreTable)\n"]}
|
1
|
+
{"version":3,"file":"OneBlinkFormStoreTable.js","sourceRoot":"","sources":["../../../src/components/formStore/OneBlinkFormStoreTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,oBAAoB,MAAM,8BAA8B,CAAA;AAC/D,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AACjE,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAE1C,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACvD,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC;CAClD,CAAC,CAAC,CAAA;AAEH,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,cAAc;IACvB,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;IAC/C,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ;IACzC,uCAAuC,EAAE;QACvC,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;KAC5C;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAA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AAC,OAAO;YAE3C,2BAA2B;YAC3B,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;;gBACtB,IACE,CAAA,MAAA,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,0CAAE,QAAQ,CAAC,YAAY;oBACtC,GAAG,CAAC,QAAQ,CAAC,YAAY,EACzB;oBACA,mBAAmB,GAAG,CAAC,mBAAmB,CAAA;iBAC3C;gBACD,8BAA8B;gBAC9B,UAAU,CAAC,GAAG,CAAC,CAAA;gBACf,OAAO;gBACL,sBAAsB;gBACtB,gCACM,GAAG,CAAC,WAAW,EAAE,EACrB,GAAG,EAAE,GAAG,CAAC,EAAE,EACX,SAAS,EAAE,IAAI,CAAC,4BAA4B,EAAE;wBAC5C,oCAAoC,EAAE,mBAAmB;qBAC1D,CAAC;gBAGA,2BAA2B;gBAC3B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrB,uBAAuB;oBACvB,OAAO,CACL,oBAAC,kBAAkB,OACb,IAAI,CAAC,YAAY,EAAE,EACvB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EACnB,SAAS,EAAE,IAAI,CACb,oCAAoC,EACpC;4BACE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;yBACtC,CACF;oBAGC,2BAA2B;oBAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAEF,CACtB,CAAA;gBACH,CAAC,CAAC,CAEA,CACP,CAAA;YACH,CAAC,CAAC,CAEA,CACA,CACP,CACJ,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,eAAe,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport clsx from 'clsx'\nimport { styled, Tooltip } from '@mui/material'\nimport { IsHoveringProvider } from '../../hooks/useIsHovering'\nimport HeaderCellMoreButton from './table/HeaderCellMoreButton'\nimport useFormStoreTableContext from './useFormStoreTableContext'\nimport MaterialIcon from '../MaterialIcon'\n\nconst SortingIcon = styled(MaterialIcon)(({ theme }) => ({\n transition: theme.transitions.create('transform'),\n}))\n\nconst Table = styled('div')(({ theme }) => ({\n display: 'inline-block',\n backgroundColor: theme.palette.background.paper,\n fontSize: theme.typography.body2.fontSize,\n '& .ob-form-store-table-row__alternate': {\n backgroundColor: theme.palette.action.hover,\n },\n '& .tc': {\n padding: theme.spacing(1),\n borderBottom: '1px solid',\n borderBottomColor: theme.palette.divider,\n display: 'flex',\n alignItems: 'center',\n '&.is-clickable': {\n cursor: 'pointer',\n transition: theme.transitions.create('transform'),\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n },\n },\n },\n '& .td': {\n position: 'relative',\n borderRight: '1px solid',\n borderRightColor: theme.palette.divider,\n overflowX: 'hidden',\n // minus 1 to cater for the border\n minHeight: `${parseInt(theme.spacing(5.5)) - 1}px`,\n '&.is-resizing': {\n borderRightStyle: 'dashed',\n },\n },\n '& .th': {\n position: 'relative',\n fontWeight: theme.typography.fontWeightBold,\n paddingRight: 0,\n borderBottomWidth: '2px',\n '& .th-content': {\n flex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n borderRight: '1px solid',\n borderRightColor: theme.palette.divider,\n paddingRight: theme.spacing(),\n '& .th-label': {\n display: 'inline-flex',\n alignItems: 'center',\n '& .th-icon': {\n marginLeft: theme.spacing(),\n },\n },\n },\n '& .resizer': {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 0,\n borderLeftStyle: 'solid',\n borderRightStyle: 'solid',\n borderColor: theme.palette.divider,\n paddingTop: theme.spacing(),\n paddingBottom: theme.spacing(),\n paddingRight: `calc(${theme.spacing(1)} + 1px)`,\n position: 'absolute',\n right: 0,\n top: theme.spacing(0.5),\n bottom: theme.spacing(0.5),\n transform: `translateX(calc(${theme.spacing(0.5)} + 1px))`,\n zIndex: 1,\n // prevents from scrolling while dragging on touch devices\n touchAction: 'none',\n '&:hover': {\n borderWidth: '1px',\n },\n '&.is-resizing': {\n borderWidth: '1px',\n borderColor: theme.palette.grey[700],\n },\n },\n },\n}))\n\nfunction OneBlinkFormStoreTable() {\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups: [parentHeaderGroup],\n rows,\n prepareRow,\n onChangeParameters,\n } = useFormStoreTableContext()\n\n if (!parentHeaderGroup) {\n return null\n }\n\n let alternateBackground = false\n\n return (\n <>\n <Table {...getTableProps()} className=\"ob-form-store-table\">\n <div className=\"thead\">\n <div\n {...parentHeaderGroup.getHeaderGroupProps()}\n className=\"tr ob-form-store-table-header-row\"\n >\n {\n // Loop over the headers in each row\n parentHeaderGroup.headers.map((headerGroup) => {\n const sortingProperty = headerGroup.sorting?.property\n const sortingDirection = headerGroup.sorting?.direction\n\n return (\n <Tooltip\n title={headerGroup.tooltip || ''}\n arrow\n key={headerGroup.id}\n PopperProps={{\n sx: {\n zIndex: 'drawer',\n },\n }}\n >\n <div\n className={clsx('th tc ob-form-store-table-header-cell', {\n 'is-clickable': !!sortingProperty,\n })}\n onClick={\n sortingProperty\n ? () => {\n onChangeParameters((currentParameters) => {\n switch (sortingDirection) {\n case 'ascending': {\n return {\n ...currentParameters,\n sorting: [\n {\n property: sortingProperty,\n direction: 'descending',\n },\n ],\n }\n }\n case 'descending': {\n return {\n ...currentParameters,\n sorting: undefined,\n }\n }\n default: {\n return {\n ...currentParameters,\n sorting: [\n {\n property: sortingProperty,\n direction: 'ascending',\n },\n ],\n }\n }\n }\n }, false)\n }\n : undefined\n }\n // Apply the header cell props\n {...headerGroup.getHeaderProps()}\n >\n <IsHoveringProvider className=\"th-content\">\n <div className=\"th-label\">\n <span>{headerGroup.headerText}</span>\n {sortingDirection && (\n <SortingIcon\n fontSize=\"small\"\n color=\"primary\"\n sx={\n sortingDirection === 'ascending'\n ? {\n transform: 'rotate(180deg)',\n }\n : undefined\n }\n className=\"th-icon\"\n >\n arrow_downward\n </SortingIcon>\n )}\n {headerGroup.filter?.isInvalid ? (\n <Tooltip\n title={\n headerGroup.filter?.validationMessage || ''\n }\n >\n <MaterialIcon\n fontSize=\"small\"\n color=\"error\"\n className=\"th-icon\"\n >\n warning\n </MaterialIcon>\n </Tooltip>\n ) : headerGroup.filter?.value ? (\n <MaterialIcon\n fontSize=\"small\"\n color=\"primary\"\n className=\"th-icon\"\n >\n filter_list\n </MaterialIcon>\n ) : null}\n </div>\n <HeaderCellMoreButton\n headerGroup={headerGroup}\n onHide={headerGroup.toggleHidden}\n />\n <div\n {...headerGroup.getResizerProps()}\n className={clsx('resizer', {\n 'is-resizing': headerGroup.isResizing,\n })}\n onClick={(event) => {\n event.stopPropagation()\n }}\n />\n </IsHoveringProvider>\n </div>\n </Tooltip>\n )\n })\n }\n </div>\n </div>\n <div {...getTableBodyProps()} className=\"tbody\">\n {\n // Loop over the table rows\n rows.map((row, index) => {\n if (\n rows[index - 1]?.original.submissionId !==\n row.original.submissionId\n ) {\n alternateBackground = !alternateBackground\n }\n // Prepare the row for display\n prepareRow(row)\n return (\n // Apply the row props\n <div\n {...row.getRowProps()}\n key={row.id}\n className={clsx('tr ob-form-store-table-row', {\n 'ob-form-store-table-row__alternate': alternateBackground,\n })}\n >\n {\n // Loop over the rows cells\n row.cells.map((cell) => {\n // Apply the cell props\n return (\n <IsHoveringProvider\n {...cell.getCellProps()}\n key={cell.column.id}\n className={clsx(\n 'td tc ob-form-store-table-row-cell',\n {\n 'is-resizing': cell.column.isResizing,\n },\n )}\n >\n {\n // Render the cell contents\n cell.render('Cell')\n }\n </IsHoveringProvider>\n )\n })\n }\n </div>\n )\n })\n }\n </div>\n </Table>\n </>\n )\n}\n\n/**\n * @returns\n * @group Components\n */\nexport default React.memo(OneBlinkFormStoreTable)\n"]}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import
|
3
|
-
export default function Work(
|
2
|
+
import MaterialIcon from '../../MaterialIcon';
|
3
|
+
export default function Work(props: Omit<React.ComponentProps<typeof MaterialIcon>, 'children'>): React.JSX.Element;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import
|
3
|
-
export default function Work(
|
4
|
-
return React.createElement(
|
2
|
+
import MaterialIcon from '../../MaterialIcon';
|
3
|
+
export default function Work(props) {
|
4
|
+
return React.createElement(MaterialIcon, { ...props }, "work");
|
5
5
|
}
|
6
6
|
//# sourceMappingURL=FormStoreIcon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormStoreIcon.js","sourceRoot":"","sources":["../../../../src/components/formStore/display/FormStoreIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,
|
1
|
+
{"version":3,"file":"FormStoreIcon.js","sourceRoot":"","sources":["../../../../src/components/formStore/display/FormStoreIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,MAAM,CAAC,OAAO,UAAU,IAAI,CAC1B,KAAkE;IAElE,OAAO,oBAAC,YAAY,OAAK,KAAK,WAAqB,CAAA;AACrD,CAAC","sourcesContent":["import * as React from 'react'\nimport MaterialIcon from '../../MaterialIcon'\nexport default function Work(\n props: Omit<React.ComponentProps<typeof MaterialIcon>, 'children'>,\n) {\n return <MaterialIcon {...props}>work</MaterialIcon>\n}\n"]}
|
@@ -7,10 +7,6 @@ import ColumnFilters from './ColumnFilters';
|
|
7
7
|
const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
8
8
|
margin: theme.spacing(-1, -1, -1, 1),
|
9
9
|
}));
|
10
|
-
const StyledMoreVert = styled(MaterialIcon)(({ theme, color }) => ({
|
11
|
-
fontSize: theme.typography.h6.fontSize + '!important',
|
12
|
-
color: theme.palette.action[color],
|
13
|
-
}));
|
14
10
|
const paperStyles = {
|
15
11
|
maxWidth: 500,
|
16
12
|
};
|
@@ -22,7 +18,7 @@ function HeaderCellMoreButton({ headerGroup, onHide, }) {
|
|
22
18
|
event.stopPropagation();
|
23
19
|
setAnchorEl(event.currentTarget);
|
24
20
|
} },
|
25
|
-
React.createElement(
|
21
|
+
React.createElement(MaterialIcon, { fontSize: "small", color: isHovering ? 'action' : 'disabled' }, "more_vert")),
|
26
22
|
React.createElement(Popover, { open: !!anchorEl, anchorEl: anchorEl, onClose: (event) => {
|
27
23
|
event.stopPropagation();
|
28
24
|
clearAnchorEl();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HeaderCellMoreButton.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/HeaderCellMoreButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,
|
1
|
+
{"version":3,"file":"HeaderCellMoreButton.js","sourceRoot":"","sources":["../../../../src/components/formStore/table/HeaderCellMoreButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GACP,MAAM,eAAe,CAAA;AACtB,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,gBAAgB,MAAM,iCAAiC,CAAA;AAC9D,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAG3C,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CACrC,CAAC,CAAC,CAAA;AAEH,MA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CACV,CACJ;YACD,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;gBAC3B,oBAAC,IAAI,IAAC,SAAS,QAAC,cAAc,EAAC,UAAU,EAAC,OAAO,EAAE,CAAC;oBACjD,WAAW,CAAC,MAAM,IAAI,CACrB,oBAAC,IAAI,IAAC,IAAI;wBACR,oBAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,EAChD,OAAO,EAAE,GAAG,EAAE,WAAC,OAAA,MAAA,WAAW,CAAC,MAAM,0CAAE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA,EAAA,EAC7D,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,oBAAC,YAAY,sBAA2B,YAG5C,CACJ,CACR;oBACD,oBAAC,IAAI,IAAC,IAAI;wBACR,oBAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,oBAAC,YAAY,yBAA8B,WAG/C,CACJ,CACF,CACH,CACE,CACL,CACR,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { HeaderGroup } from 'react-table'\nimport {\n Box,\n Button,\n Divider,\n Grid,\n IconButton,\n Popover,\n SxProps,\n styled,\n} from '@mui/material'\nimport MaterialIcon from '../../MaterialIcon'\nimport { useIsHovering } from '../../../hooks/useIsHovering'\nimport useNullableState from '../../../hooks/useNullableState'\nimport ColumnFilters from './ColumnFilters'\nimport { FormStoreRecord } from '@oneblink/types/typescript/submissions'\n\nconst StyledIconButton = styled(IconButton)(({ theme }) => ({\n margin: theme.spacing(-1, -1, -1, 1),\n}))\n\nconst paperStyles: SxProps = {\n maxWidth: 500,\n}\n\nfunction HeaderCellMoreButton({\n headerGroup,\n onHide,\n}: {\n headerGroup: HeaderGroup<FormStoreRecord>\n onHide: () => void\n}) {\n const isHovering = useIsHovering()\n const [anchorEl, setAnchorEl, clearAnchorEl] =\n useNullableState<HTMLButtonElement>(null)\n\n return (\n <span>\n <StyledIconButton\n color=\"inherit\"\n onClick={(event) => {\n event.stopPropagation()\n setAnchorEl(event.currentTarget)\n }}\n >\n <MaterialIcon\n fontSize=\"small\"\n color={isHovering ? 'action' : 'disabled'}\n >\n more_vert\n </MaterialIcon>\n </StyledIconButton>\n <Popover\n open={!!anchorEl}\n anchorEl={anchorEl}\n onClose={(event: React.MouseEvent) => {\n event.stopPropagation()\n clearAnchorEl()\n }}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n PaperProps={{\n sx: paperStyles,\n }}\n onClick={(event) => {\n event.stopPropagation()\n }}\n >\n {headerGroup.filter && (\n <>\n <Box padding={2}>\n <ColumnFilters filter={headerGroup.filter} />\n </Box>\n <Divider />\n </>\n )}\n <Box paddingX={2} paddingY={1}>\n <Grid container justifyContent=\"flex-end\" spacing={1}>\n {headerGroup.filter && (\n <Grid item>\n <Button\n variant=\"outlined\"\n disabled={headerGroup.filter.value === undefined}\n onClick={() => headerGroup.filter?.onChange(undefined, false)}\n size=\"small\"\n startIcon={<MaterialIcon>filter_list</MaterialIcon>}\n >\n Clear\n </Button>\n </Grid>\n )}\n <Grid item>\n <Button\n variant=\"outlined\"\n onClick={onHide}\n size=\"small\"\n startIcon={<MaterialIcon>visibility_off</MaterialIcon>}\n >\n Hide\n </Button>\n </Grid>\n </Grid>\n </Box>\n </Popover>\n </span>\n )\n}\n\nexport default React.memo(HeaderCellMoreButton)\n"]}
|
@@ -1,14 +1,11 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import LargeIconMessage from './LargeIconMessage';
|
3
3
|
import { Button } from '@mui/material';
|
4
|
-
import
|
5
|
-
const ErrorIcon = (props) => React.createElement(
|
4
|
+
import MaterialIcon from '../MaterialIcon';
|
5
|
+
const ErrorIcon = (props) => React.createElement(MaterialIcon, { ...props }, "error");
|
6
6
|
function ErrorMessage({ title, children, gutterTop, gutterBottom, IconComponent, onTryAgain, }) {
|
7
|
-
if (!IconComponent) {
|
8
|
-
IconComponent = ErrorIcon;
|
9
|
-
}
|
10
7
|
return (React.createElement(React.Fragment, null,
|
11
|
-
React.createElement(LargeIconMessage, { IconComponent: IconComponent, title: title, variant: "error", gutterTop: gutterTop, gutterBottom: gutterBottom, action: onTryAgain && (React.createElement(Button, { variant: "outlined", color: "primary", onClick: () => onTryAgain(), "data-cypress": "error-try-again-button" }, "Try Again")), className: "ob-error-snackbar" }, children)));
|
8
|
+
React.createElement(LargeIconMessage, { IconComponent: IconComponent || ErrorIcon, title: title, variant: "error", gutterTop: gutterTop, gutterBottom: gutterBottom, action: onTryAgain && (React.createElement(Button, { variant: "outlined", color: "primary", onClick: () => onTryAgain(), "data-cypress": "error-try-again-button" }, "Try Again")), className: "ob-error-snackbar" }, children)));
|
12
9
|
}
|
13
10
|
export default React.memo(ErrorMessage);
|
14
11
|
//# sourceMappingURL=ErrorMessage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../src/components/messages/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,gBAEN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,
|
1
|
+
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../../src/components/messages/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,gBAEN,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAU1C,MAAM,SAAS,GAA2C,CACxD,KAAgD,EAChD,EAAE,CAAC,oBAAC,YAAY,OAAK,KAAK,YAAsB,CAAA;AAElD,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,UAAU,GACJ;IACN,OAAO,CACL;QACE,oBAAC,gBAAgB,IACf,aAAa,EAAE,aAAa,IAAI,SAAS,EACzC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAC,OAAO,EACf,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,MAAM,EACJ,UAAU,IAAI,CACZ,oBAAC,MAAM,IACL,OAAO,EAAC,UAAU,EAClB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,kBACd,wBAAwB,gBAG9B,CACV,EAEH,SAAS,EAAC,mBAAmB,IAE5B,QAAQ,CACQ,CAClB,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,YAAY,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport LargeIconMessage, {\n Props as LargeIconMessageProps,\n} from './LargeIconMessage'\nimport { Button } from '@mui/material'\nimport MaterialIcon from '../MaterialIcon'\ntype Props = {\n IconComponent?: LargeIconMessageProps['IconComponent']\n title: string\n gutterTop?: boolean\n gutterBottom?: boolean\n children?: React.ReactNode\n onTryAgain?: () => void\n}\n\nconst ErrorIcon: LargeIconMessageProps['IconComponent'] = (\n props: React.ComponentProps<typeof MaterialIcon>,\n) => <MaterialIcon {...props}>error</MaterialIcon>\n\nfunction ErrorMessage({\n title,\n children,\n gutterTop,\n gutterBottom,\n IconComponent,\n onTryAgain,\n}: Props) {\n return (\n <>\n <LargeIconMessage\n IconComponent={IconComponent || ErrorIcon}\n title={title}\n variant=\"error\"\n gutterTop={gutterTop}\n gutterBottom={gutterBottom}\n action={\n onTryAgain && (\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => onTryAgain()}\n data-cypress=\"error-try-again-button\"\n >\n Try Again\n </Button>\n )\n }\n className=\"ob-error-snackbar\"\n >\n {children}\n </LargeIconMessage>\n </>\n )\n}\n\nexport default React.memo<Props>(ErrorMessage)\n"]}
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { Icon } from '@mui/material';
|
2
3
|
import { CommonProps } from '@mui/material/OverridableComponent';
|
3
4
|
import { Color } from '../../types/mui-color';
|
5
|
+
type IconProps = React.ComponentProps<typeof Icon>;
|
4
6
|
export type Props = {
|
5
7
|
IconComponent: React.ComponentType<{
|
6
|
-
color:
|
7
|
-
style:
|
8
|
+
color: IconProps['color'];
|
9
|
+
style: IconProps['style'];
|
8
10
|
}>;
|
9
11
|
title: string;
|
10
12
|
variant: Color;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { Typography, Grid, Container, useTheme, styled } from '@mui/material';
|
2
|
+
import { Typography, Grid, Container, useTheme, styled, } from '@mui/material';
|
3
3
|
function LargeIconMessage({ IconComponent, title, variant, gutterTop, gutterBottom, children, action, className, }) {
|
4
4
|
const theme = useTheme();
|
5
5
|
const fontSize = React.useMemo(() => theme.spacing(16), [theme]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LargeIconMessage.js","sourceRoot":"","sources":["../../../src/components/messages/LargeIconMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,
|
1
|
+
{"version":3,"file":"LargeIconMessage.js","sourceRoot":"","sources":["../../../src/components/messages/LargeIconMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,MAAM,GAEP,MAAM,eAAe,CAAA;AAoBtB,SAAS,gBAAgB,CAAC,EACxB,aAAa,EACb,KAAK,EACL,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CAAC;IAC5B,SAAS,EAAE,QAAQ;IACnB,GAAG,CAAC,SAAS;QACX,CAAC,CAAC;YACE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SAC7B;QACH,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CAAC,CAAA;AAEH,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,EAAE;IAC1C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA0C,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC,CAAA;AAEH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE;IAC9B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA6B,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3D,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport {\n Typography,\n Grid,\n Container,\n useTheme,\n styled,\n Icon,\n} from '@mui/material'\nimport { CommonProps } from '@mui/material/OverridableComponent'\nimport { Color } from '../../types/mui-color'\n\ntype IconProps = React.ComponentProps<typeof Icon>\n\nexport type Props = {\n IconComponent: React.ComponentType<{\n color: IconProps['color']\n style: IconProps['style']\n }>\n title: string\n variant: Color\n gutterTop?: boolean\n gutterBottom?: boolean\n children?: React.ReactNode\n action?: React.ReactNode\n className?: CommonProps['className']\n}\n\nfunction LargeIconMessage({\n IconComponent,\n title,\n variant,\n gutterTop,\n gutterBottom,\n children,\n action,\n className,\n}: Props) {\n const theme = useTheme()\n\n const fontSize = React.useMemo(() => theme.spacing(16), [theme])\n\n return (\n <Container maxWidth=\"sm\" className={className || 'ob-large-icon-message'}>\n <StyledIconContainer gutterTop={gutterTop}>\n <IconComponent color={variant} style={{ fontSize }} />\n </StyledIconContainer>\n <Typography\n variant=\"h5\"\n align=\"center\"\n gutterBottom\n color={`${variant}.main`}\n >\n {title}\n </Typography>\n {children ? (\n <StyledTypography\n align=\"center\"\n variant=\"body2\"\n paragraph={!!action}\n gutterBottom={!action && gutterBottom}\n >\n {children}\n </StyledTypography>\n ) : null}\n {action && (\n <StyledGrid\n container\n justifyContent=\"center\"\n gutterBottom={gutterBottom}\n >\n {action}\n </StyledGrid>\n )}\n </Container>\n )\n}\n\nexport default React.memo<Props>(LargeIconMessage)\n\nconst StyledIconContainer = styled('div', {\n shouldForwardProp: (prop) => prop !== 'gutterTop',\n})<{\n gutterTop?: boolean\n}>(({ theme, gutterTop }) => ({\n textAlign: 'center',\n ...(gutterTop\n ? {\n paddingTop: theme.spacing(4),\n }\n : {}),\n}))\n\nconst StyledTypography = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'gutterBottom',\n})<React.ComponentProps<typeof Typography>>(({ theme, gutterBottom }) => ({\n ...(gutterBottom ? { marginBottom: theme.spacing(4) } : {}),\n}))\n\nconst StyledGrid = styled(Grid, {\n shouldForwardProp: (prop) => prop !== 'gutterBottom',\n})<{ gutterBottom?: boolean }>(({ theme, gutterBottom }) => ({\n ...(gutterBottom ? { marginBottom: theme.spacing(4) } : {}),\n}))\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oneblink/apps-react",
|
3
3
|
"description": "Helper functions for OneBlink apps in ReactJS.",
|
4
|
-
"version": "5.12.0-beta.
|
4
|
+
"version": "5.12.0-beta.15",
|
5
5
|
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/oneblink/apps-react/issues"
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import MaterialIcon from './MaterialIcon';
|
3
|
-
import { Color } from '../types/mui-color';
|
4
|
-
export default function IconComponent({ icon, color, ...props }: {
|
5
|
-
color: Color;
|
6
|
-
icon: string;
|
7
|
-
} & React.ComponentProps<typeof MaterialIcon>): React.JSX.Element;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { styled } from '@mui/material';
|
3
|
-
import MaterialIcon from './MaterialIcon';
|
4
|
-
const StyledMaterialIcon = styled(({ icon, ...props }) => (React.createElement(MaterialIcon, { ...props }, icon)))(({ theme, color }) => {
|
5
|
-
var _a;
|
6
|
-
return ({
|
7
|
-
color: (_a = theme.palette[color]) === null || _a === void 0 ? void 0 : _a.main,
|
8
|
-
});
|
9
|
-
});
|
10
|
-
export default function IconComponent({ icon, color, ...props }) {
|
11
|
-
return React.createElement(StyledMaterialIcon, { color: color, icon: icon, ...props });
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=IconComponent.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"IconComponent.js","sourceRoot":"","sources":["../../src/components/IconComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAoB,EAAE,EAAE,CAAC,CAC1E,oBAAC,YAAY,OAAK,KAAK,IAAG,IAAI,CAAgB,CAC/C,CAAC,CAAiC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;;IAAC,OAAA,CAAC;QACxD,KAAK,EAAE,MAAA,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,0CAAE,IAAI;KAClC,CAAC,CAAA;CAAA,CAAC,CAAA;AAEH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,KAAK,EACL,GAAG,KAAK,EACmE;IAC3E,OAAO,oBAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,KAAM,KAAK,GAAI,CAAA;AACpE,CAAC","sourcesContent":["import * as React from 'react'\nimport { styled } from '@mui/material'\nimport MaterialIcon from './MaterialIcon'\nimport { Color } from '../types/mui-color'\n\nconst StyledMaterialIcon = styled(({ icon, ...props }: { icon: string }) => (\n <MaterialIcon {...props}>{icon}</MaterialIcon>\n))<{ color: Color; icon: string }>(({ theme, color }) => ({\n color: theme.palette[color]?.main,\n}))\n\nexport default function IconComponent({\n icon,\n color,\n ...props\n}: { color: Color; icon: string } & React.ComponentProps<typeof MaterialIcon>) {\n return <StyledMaterialIcon color={color} icon={icon} {...props} />\n}\n"]}
|