@paygreen/pgui 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +9 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/DataList/index.d.ts +8 -1
- package/dist/cjs/types/components/FormGroup/index.d.ts +1 -1
- package/dist/esm/index.js +9 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/DataList/index.d.ts +8 -1
- package/dist/esm/types/components/FormGroup/index.d.ts +1 -1
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { AccordionProps, FlexProps } from '@chakra-ui/react';
|
|
3
|
-
|
|
3
|
+
declare type DataListColumns = Record<string, DataListCellProps>;
|
|
4
|
+
declare type DataListContextValue = {
|
|
5
|
+
setColumns: React.Dispatch<React.SetStateAction<DataListColumns>>;
|
|
6
|
+
columns: DataListColumns;
|
|
7
|
+
isHover: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const DataListContext: React.Context<DataListContextValue>;
|
|
4
10
|
export declare const DataListHeaderContext: React.Context<boolean>;
|
|
5
11
|
export declare type DataListCellProps = FlexProps & {
|
|
6
12
|
colName?: string;
|
|
@@ -33,3 +39,4 @@ export declare type DataListProps = AccordionProps & {
|
|
|
33
39
|
isHover?: boolean;
|
|
34
40
|
};
|
|
35
41
|
export declare const DataList: FC<React.PropsWithChildren<DataListProps>>;
|
|
42
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -2941,13 +2941,11 @@ var ActionsButton = forwardRef(function (_a, ref) {
|
|
|
2941
2941
|
});
|
|
2942
2942
|
ActionsButton.displayName = 'ActionsButton';
|
|
2943
2943
|
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
// };
|
|
2950
|
-
var DataListContext = React.createContext({});
|
|
2944
|
+
var DataListContext = React.createContext({
|
|
2945
|
+
setColumns: function () { },
|
|
2946
|
+
columns: {},
|
|
2947
|
+
isHover: false
|
|
2948
|
+
});
|
|
2951
2949
|
var DataListHeaderContext = React.createContext(false);
|
|
2952
2950
|
var DataListCell = function (_a) {
|
|
2953
2951
|
var _b, _c;
|
|
@@ -2965,9 +2963,9 @@ var DataListCell = function (_a) {
|
|
|
2965
2963
|
}
|
|
2966
2964
|
}, [isInHeader, colName, colWidth, isVisible, setColumns]);
|
|
2967
2965
|
var headerProps = !isInHeader ? (_b = columns === null || columns === void 0 ? void 0 : columns[colName !== null && colName !== void 0 ? colName : '']) !== null && _b !== void 0 ? _b : {} : {};
|
|
2968
|
-
var _g = __assign$1(__assign$1({ colWidth: colWidth, isVisible: isVisible }, headerProps), rest), _h = _g.isVisible,
|
|
2969
|
-
var showCell = useBreakpointValue(typeof
|
|
2970
|
-
var cellWidth = (_c = useBreakpointValue(typeof
|
|
2966
|
+
var _g = __assign$1(__assign$1({ colWidth: colWidth, isVisible: isVisible }, headerProps), rest), _h = _g.isVisible, isCellVisible = _h === void 0 ? true : _h, _j = _g.colWidth, columnWidth = _j === void 0 ? true : _j, cellProps = __rest$1(_g, ["isVisible", "colWidth"]);
|
|
2967
|
+
var showCell = useBreakpointValue(typeof isCellVisible === 'object' ? isCellVisible : { base: isCellVisible });
|
|
2968
|
+
var cellWidth = (_c = useBreakpointValue(typeof columnWidth === 'object' ? columnWidth : { base: columnWidth })) !== null && _c !== void 0 ? _c : 0;
|
|
2971
2969
|
if (!showCell)
|
|
2972
2970
|
return null;
|
|
2973
2971
|
var isWidthUnitless = /^[0-9.]+$/.test(String(cellWidth));
|
|
@@ -2975,7 +2973,7 @@ var DataListCell = function (_a) {
|
|
|
2975
2973
|
};
|
|
2976
2974
|
var DataListAccordion = function (_a) {
|
|
2977
2975
|
var rest = __rest$1(_a, []);
|
|
2978
|
-
return React.createElement(AccordionItem, __assign$1({ border: "none" }, rest));
|
|
2976
|
+
return (React.createElement(AccordionItem, __assign$1({ border: "none" }, rest)));
|
|
2979
2977
|
};
|
|
2980
2978
|
var DataListAccordionButton = function (_a) {
|
|
2981
2979
|
var rest = __rest$1(_a, []);
|