@nulogy/components 8.18.0 → 9.0.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/main.js +33 -29
- package/dist/main.module.js +33 -29
- package/dist/src/Table/Table.types.d.ts +5 -5
- package/dist/src/Table/TableHead.d.ts +4 -4
- package/dist/src/Toggle/Toggle.d.ts +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -12879,7 +12879,7 @@
|
|
|
12879
12879
|
};
|
|
12880
12880
|
}
|
|
12881
12881
|
|
|
12882
|
-
var index
|
|
12882
|
+
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
12883
12883
|
|
|
12884
12884
|
var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
12885
12885
|
// ==============================
|
|
@@ -13392,7 +13392,7 @@
|
|
|
13392
13392
|
placement = _useState4[0],
|
|
13393
13393
|
setPlacement = _useState4[1];
|
|
13394
13394
|
var controlHeight = theme.spacing.controlHeight;
|
|
13395
|
-
index
|
|
13395
|
+
index(function () {
|
|
13396
13396
|
var menuEl = ref.current;
|
|
13397
13397
|
if (!menuEl) return;
|
|
13398
13398
|
|
|
@@ -13557,7 +13557,7 @@
|
|
|
13557
13557
|
});
|
|
13558
13558
|
}
|
|
13559
13559
|
}, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
|
|
13560
|
-
index
|
|
13560
|
+
index(function () {
|
|
13561
13561
|
updateComputedPosition();
|
|
13562
13562
|
}, [updateComputedPosition]);
|
|
13563
13563
|
var runAutoUpdate = React.useCallback(function () {
|
|
@@ -13571,7 +13571,7 @@
|
|
|
13571
13571
|
});
|
|
13572
13572
|
}
|
|
13573
13573
|
}, [controlElement, updateComputedPosition]);
|
|
13574
|
-
index
|
|
13574
|
+
index(function () {
|
|
13575
13575
|
runAutoUpdate();
|
|
13576
13576
|
}, [runAutoUpdate]);
|
|
13577
13577
|
var setMenuPortalElement = React.useCallback(function (menuPortalElement) {
|
|
@@ -49295,21 +49295,28 @@
|
|
|
49295
49295
|
return label;
|
|
49296
49296
|
};
|
|
49297
49297
|
|
|
49298
|
-
var renderHeaderCellContent = function renderHeaderCellContent(
|
|
49299
|
-
var
|
|
49300
|
-
headerFormatter =
|
|
49301
|
-
|
|
49302
|
-
|
|
49303
|
-
|
|
49298
|
+
var renderHeaderCellContent = function renderHeaderCellContent(_ref3) {
|
|
49299
|
+
var _ref3$headerFormatter = _ref3.headerFormatter,
|
|
49300
|
+
headerFormatter = _ref3$headerFormatter === void 0 ? defaultheaderFormatter : _ref3$headerFormatter,
|
|
49301
|
+
align = _ref3.align,
|
|
49302
|
+
label = _ref3.label,
|
|
49303
|
+
dataKey = _ref3.dataKey,
|
|
49304
|
+
width = _ref3.width;
|
|
49305
|
+
return headerFormatter({
|
|
49306
|
+
align: align,
|
|
49307
|
+
label: label,
|
|
49308
|
+
dataKey: dataKey,
|
|
49309
|
+
width: width
|
|
49310
|
+
});
|
|
49304
49311
|
};
|
|
49305
49312
|
|
|
49306
|
-
var TableHead = function TableHead(
|
|
49307
|
-
var columns =
|
|
49308
|
-
compact =
|
|
49309
|
-
sticky =
|
|
49313
|
+
var TableHead = function TableHead(_ref4) {
|
|
49314
|
+
var columns = _ref4.columns,
|
|
49315
|
+
compact = _ref4.compact,
|
|
49316
|
+
sticky = _ref4.sticky;
|
|
49310
49317
|
|
|
49311
49318
|
var renderColumns = function renderColumns(allColumns) {
|
|
49312
|
-
return allColumns.map(function (column) {
|
|
49319
|
+
return allColumns.map(function (column, index) {
|
|
49313
49320
|
var _a, _b;
|
|
49314
49321
|
|
|
49315
49322
|
return /*#__PURE__*/React__default["default"].createElement(StyledTh, {
|
|
@@ -49326,10 +49333,6 @@
|
|
|
49326
49333
|
return /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement(StyledHeaderRow, null, renderColumns(columns)));
|
|
49327
49334
|
};
|
|
49328
49335
|
|
|
49329
|
-
TableHead.defaultProps = {
|
|
49330
|
-
sticky: false
|
|
49331
|
-
};
|
|
49332
|
-
|
|
49333
49336
|
var columnPropType = PropTypes__default["default"].shape({
|
|
49334
49337
|
align: PropTypes__default["default"].oneOf(["right", "left", "center"]),
|
|
49335
49338
|
label: PropTypes__default["default"].string,
|
|
@@ -51865,16 +51868,15 @@
|
|
|
51865
51868
|
onClick = _ref.onClick;
|
|
51866
51869
|
return /*#__PURE__*/React__default["default"].createElement(AnimatedBox, {
|
|
51867
51870
|
position: "relative",
|
|
51868
|
-
display: "flex",
|
|
51869
|
-
alignItems: "center",
|
|
51870
|
-
justifyContent: toggled ? "flex-end" : "flex-start",
|
|
51871
51871
|
height: "24px",
|
|
51872
51872
|
width: "48px",
|
|
51873
51873
|
bg: disabled ? "grey" : getSwitchBackground(toggled),
|
|
51874
51874
|
borderRadius: "20px",
|
|
51875
51875
|
padding: "2px",
|
|
51876
51876
|
boxShadow: "small",
|
|
51877
|
-
|
|
51877
|
+
animate: toggled ? "toggled" : "initial",
|
|
51878
|
+
whileHover: "active",
|
|
51879
|
+
whileFocus: "active",
|
|
51878
51880
|
onClick: onClick
|
|
51879
51881
|
}, children);
|
|
51880
51882
|
};
|
|
@@ -51884,18 +51886,20 @@
|
|
|
51884
51886
|
children = _ref2.children;
|
|
51885
51887
|
return /*#__PURE__*/React__default["default"].createElement(motion.div, {
|
|
51886
51888
|
className: "slider",
|
|
51887
|
-
|
|
51889
|
+
initial: false,
|
|
51888
51890
|
variants: {
|
|
51889
|
-
|
|
51891
|
+
active: {
|
|
51890
51892
|
boxShadow: disabled ? undefined : Theme.shadows.focus,
|
|
51891
51893
|
scale: disabled ? undefined : animationConfig.scale
|
|
51894
|
+
},
|
|
51895
|
+
toggled: {
|
|
51896
|
+
marginLeft: Theme.space.x3
|
|
51897
|
+
},
|
|
51898
|
+
initial: {
|
|
51899
|
+
marginLeft: Theme.space.none
|
|
51892
51900
|
}
|
|
51893
51901
|
},
|
|
51894
51902
|
transition: animationConfig.transition,
|
|
51895
|
-
whileFocus: {
|
|
51896
|
-
boxShadow: disabled ? undefined : Theme.shadows.focus,
|
|
51897
|
-
scale: disabled ? undefined : animationConfig.scale
|
|
51898
|
-
},
|
|
51899
51903
|
style: {
|
|
51900
51904
|
height: "20px",
|
|
51901
51905
|
width: "20px",
|
package/dist/main.module.js
CHANGED
|
@@ -12862,7 +12862,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
12862
12862
|
};
|
|
12863
12863
|
}
|
|
12864
12864
|
|
|
12865
|
-
var index
|
|
12865
|
+
var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
|
12866
12866
|
|
|
12867
12867
|
var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
12868
12868
|
// ==============================
|
|
@@ -13375,7 +13375,7 @@ var MenuPlacer = function MenuPlacer(props) {
|
|
|
13375
13375
|
placement = _useState4[0],
|
|
13376
13376
|
setPlacement = _useState4[1];
|
|
13377
13377
|
var controlHeight = theme.spacing.controlHeight;
|
|
13378
|
-
index
|
|
13378
|
+
index(function () {
|
|
13379
13379
|
var menuEl = ref.current;
|
|
13380
13380
|
if (!menuEl) return;
|
|
13381
13381
|
|
|
@@ -13540,7 +13540,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
13540
13540
|
});
|
|
13541
13541
|
}
|
|
13542
13542
|
}, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
|
|
13543
|
-
index
|
|
13543
|
+
index(function () {
|
|
13544
13544
|
updateComputedPosition();
|
|
13545
13545
|
}, [updateComputedPosition]);
|
|
13546
13546
|
var runAutoUpdate = useCallback(function () {
|
|
@@ -13554,7 +13554,7 @@ var MenuPortal = function MenuPortal(props) {
|
|
|
13554
13554
|
});
|
|
13555
13555
|
}
|
|
13556
13556
|
}, [controlElement, updateComputedPosition]);
|
|
13557
|
-
index
|
|
13557
|
+
index(function () {
|
|
13558
13558
|
runAutoUpdate();
|
|
13559
13559
|
}, [runAutoUpdate]);
|
|
13560
13560
|
var setMenuPortalElement = useCallback(function (menuPortalElement) {
|
|
@@ -49278,21 +49278,28 @@ var defaultheaderFormatter = function defaultheaderFormatter(_ref2) {
|
|
|
49278
49278
|
return label;
|
|
49279
49279
|
};
|
|
49280
49280
|
|
|
49281
|
-
var renderHeaderCellContent = function renderHeaderCellContent(
|
|
49282
|
-
var
|
|
49283
|
-
headerFormatter =
|
|
49284
|
-
|
|
49285
|
-
|
|
49286
|
-
|
|
49281
|
+
var renderHeaderCellContent = function renderHeaderCellContent(_ref3) {
|
|
49282
|
+
var _ref3$headerFormatter = _ref3.headerFormatter,
|
|
49283
|
+
headerFormatter = _ref3$headerFormatter === void 0 ? defaultheaderFormatter : _ref3$headerFormatter,
|
|
49284
|
+
align = _ref3.align,
|
|
49285
|
+
label = _ref3.label,
|
|
49286
|
+
dataKey = _ref3.dataKey,
|
|
49287
|
+
width = _ref3.width;
|
|
49288
|
+
return headerFormatter({
|
|
49289
|
+
align: align,
|
|
49290
|
+
label: label,
|
|
49291
|
+
dataKey: dataKey,
|
|
49292
|
+
width: width
|
|
49293
|
+
});
|
|
49287
49294
|
};
|
|
49288
49295
|
|
|
49289
|
-
var TableHead = function TableHead(
|
|
49290
|
-
var columns =
|
|
49291
|
-
compact =
|
|
49292
|
-
sticky =
|
|
49296
|
+
var TableHead = function TableHead(_ref4) {
|
|
49297
|
+
var columns = _ref4.columns,
|
|
49298
|
+
compact = _ref4.compact,
|
|
49299
|
+
sticky = _ref4.sticky;
|
|
49293
49300
|
|
|
49294
49301
|
var renderColumns = function renderColumns(allColumns) {
|
|
49295
|
-
return allColumns.map(function (column) {
|
|
49302
|
+
return allColumns.map(function (column, index) {
|
|
49296
49303
|
var _a, _b;
|
|
49297
49304
|
|
|
49298
49305
|
return /*#__PURE__*/React__default.createElement(StyledTh, {
|
|
@@ -49309,10 +49316,6 @@ var TableHead = function TableHead(_ref3) {
|
|
|
49309
49316
|
return /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement(StyledHeaderRow, null, renderColumns(columns)));
|
|
49310
49317
|
};
|
|
49311
49318
|
|
|
49312
|
-
TableHead.defaultProps = {
|
|
49313
|
-
sticky: false
|
|
49314
|
-
};
|
|
49315
|
-
|
|
49316
49319
|
var columnPropType = PropTypes.shape({
|
|
49317
49320
|
align: PropTypes.oneOf(["right", "left", "center"]),
|
|
49318
49321
|
label: PropTypes.string,
|
|
@@ -51848,16 +51851,15 @@ var Switch = function Switch(_ref) {
|
|
|
51848
51851
|
onClick = _ref.onClick;
|
|
51849
51852
|
return /*#__PURE__*/React__default.createElement(AnimatedBox, {
|
|
51850
51853
|
position: "relative",
|
|
51851
|
-
display: "flex",
|
|
51852
|
-
alignItems: "center",
|
|
51853
|
-
justifyContent: toggled ? "flex-end" : "flex-start",
|
|
51854
51854
|
height: "24px",
|
|
51855
51855
|
width: "48px",
|
|
51856
51856
|
bg: disabled ? "grey" : getSwitchBackground(toggled),
|
|
51857
51857
|
borderRadius: "20px",
|
|
51858
51858
|
padding: "2px",
|
|
51859
51859
|
boxShadow: "small",
|
|
51860
|
-
|
|
51860
|
+
animate: toggled ? "toggled" : "initial",
|
|
51861
|
+
whileHover: "active",
|
|
51862
|
+
whileFocus: "active",
|
|
51861
51863
|
onClick: onClick
|
|
51862
51864
|
}, children);
|
|
51863
51865
|
};
|
|
@@ -51867,18 +51869,20 @@ var Slider = function Slider(_ref2) {
|
|
|
51867
51869
|
children = _ref2.children;
|
|
51868
51870
|
return /*#__PURE__*/React__default.createElement(motion.div, {
|
|
51869
51871
|
className: "slider",
|
|
51870
|
-
|
|
51872
|
+
initial: false,
|
|
51871
51873
|
variants: {
|
|
51872
|
-
|
|
51874
|
+
active: {
|
|
51873
51875
|
boxShadow: disabled ? undefined : Theme.shadows.focus,
|
|
51874
51876
|
scale: disabled ? undefined : animationConfig.scale
|
|
51877
|
+
},
|
|
51878
|
+
toggled: {
|
|
51879
|
+
marginLeft: Theme.space.x3
|
|
51880
|
+
},
|
|
51881
|
+
initial: {
|
|
51882
|
+
marginLeft: Theme.space.none
|
|
51875
51883
|
}
|
|
51876
51884
|
},
|
|
51877
51885
|
transition: animationConfig.transition,
|
|
51878
|
-
whileFocus: {
|
|
51879
|
-
boxShadow: disabled ? undefined : Theme.shadows.focus,
|
|
51880
|
-
scale: disabled ? undefined : animationConfig.scale
|
|
51881
|
-
},
|
|
51882
51886
|
style: {
|
|
51883
51887
|
height: "20px",
|
|
51884
51888
|
width: "20px",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Key } from "react";
|
|
1
|
+
import type { Key } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
export type RowType = unknown;
|
|
4
|
-
export
|
|
4
|
+
export interface CellInfoType {
|
|
5
5
|
cellData: unknown;
|
|
6
6
|
column: ColumnType;
|
|
7
7
|
row: RowType;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
interface ColumnInfoType {
|
|
10
10
|
align?: ColumnAlignment;
|
|
11
11
|
label: string;
|
|
12
12
|
dataKey?: Key;
|
|
13
13
|
width?: string | number;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
type ColumnAlignment = "left" | "right" | "center";
|
|
16
16
|
export type ColumnType = {
|
|
17
17
|
align?: ColumnAlignment;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Columns } from "./Table.types";
|
|
3
|
-
|
|
2
|
+
import type { Columns } from "./Table.types";
|
|
3
|
+
interface TableHeadProps {
|
|
4
4
|
columns: Columns;
|
|
5
5
|
compact?: boolean;
|
|
6
6
|
sticky?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const TableHead: React.
|
|
7
|
+
}
|
|
8
|
+
declare const TableHead: ({ columns, compact, sticky }: TableHeadProps) => React.JSX.Element;
|
|
9
9
|
export default TableHead;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps } from "styled-system";
|
|
3
|
-
import { DefaultNDSThemeType } from "../theme.type";
|
|
4
3
|
import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
|
|
4
|
+
import { DefaultNDSThemeType } from "../theme.type";
|
|
5
5
|
declare const ToggleComponent: React.ForwardRefExoticComponent<SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
|
6
6
|
onChange?: (...args: any[]) => any;
|
|
7
7
|
size?: ComponentSize;
|