@trackunit/react-components 0.0.68 → 0.0.71
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.
|
@@ -28,8 +28,6 @@ export interface CheckboxProps extends CommonProps, React.InputHTMLAttributes<HT
|
|
|
28
28
|
indeterminate?: boolean;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Checkbox are interactive elements that represent the boolean logical value (true or false) that can be used for boolean inputs, selectors etc.
|
|
32
|
-
*
|
|
33
31
|
* Checkboxes are used when there are multiple items to select in a list. Users can select zero, one, or any number of items.
|
|
34
32
|
*
|
|
35
33
|
* Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Matcher } from "react-day-picker";
|
|
3
3
|
import { BaseInputProps } from "../BaseInput";
|
|
4
|
-
export interface DateFieldProps extends Pick<BaseInputProps, "placeholder" | "id" | "dataTestId" | "onChange"> {
|
|
4
|
+
export interface DateFieldProps extends Pick<BaseInputProps, "placeholder" | "id" | "dataTestId" | "onChange" | "readOnly"> {
|
|
5
5
|
/**
|
|
6
6
|
* A text label to be displayed next to the indicator
|
|
7
7
|
*/
|
package/index.js
CHANGED
|
@@ -875,7 +875,7 @@ const BaseInput = React.forwardRef((_a, ref) => {
|
|
|
875
875
|
return jsxs(InputContainer, Object.assign({
|
|
876
876
|
"$fieldSize": fieldSize,
|
|
877
877
|
"$invalid": isInvalid,
|
|
878
|
-
"$disabled": rest.disabled,
|
|
878
|
+
"$disabled": rest.disabled || rest.readOnly,
|
|
879
879
|
className: className,
|
|
880
880
|
"data-testid": `${dataTestId}-container`
|
|
881
881
|
}, {
|
|
@@ -1432,8 +1432,6 @@ const IndeterminateIcon = ({
|
|
|
1432
1432
|
}));
|
|
1433
1433
|
|
|
1434
1434
|
/**
|
|
1435
|
-
* Checkbox are interactive elements that represent the boolean logical value (true or false) that can be used for boolean inputs, selectors etc.
|
|
1436
|
-
*
|
|
1437
1435
|
* Checkboxes are used when there are multiple items to select in a list. Users can select zero, one, or any number of items.
|
|
1438
1436
|
*
|
|
1439
1437
|
* Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections.
|
|
@@ -1466,6 +1464,7 @@ const Checkbox = React.forwardRef((_a, ref) => {
|
|
|
1466
1464
|
|
|
1467
1465
|
const icon = indeterminate ? jsx(StyledIndeterminateIcon, {}) : checked && jsx(StyledCheckIcon, {});
|
|
1468
1466
|
const internalRef = React.useRef(null);
|
|
1467
|
+
const isReadonly = disabled || readOnly;
|
|
1469
1468
|
|
|
1470
1469
|
const onKeyPress = e => {
|
|
1471
1470
|
var _a;
|
|
@@ -1494,20 +1493,20 @@ const Checkbox = React.forwardRef((_a, ref) => {
|
|
|
1494
1493
|
}, rest, {
|
|
1495
1494
|
ref: ref
|
|
1496
1495
|
})), jsx(CheckboxWrapper, Object.assign({
|
|
1497
|
-
"$disabled":
|
|
1496
|
+
"$disabled": isReadonly,
|
|
1498
1497
|
"$checked": checked,
|
|
1499
1498
|
"$indeterminate": indeterminate,
|
|
1500
|
-
"$isInvalid":
|
|
1499
|
+
"$isInvalid": isReadonly ? false : isInvalid,
|
|
1501
1500
|
className: className,
|
|
1502
|
-
tabIndex:
|
|
1501
|
+
tabIndex: isReadonly ? -1 : tabIndex,
|
|
1503
1502
|
onKeyPress: onKeyPress
|
|
1504
1503
|
}, {
|
|
1505
1504
|
children: icon
|
|
1506
1505
|
})), label && jsx(Label$4, Object.assign({
|
|
1507
1506
|
ref: internalRef,
|
|
1508
1507
|
htmlFor: uuid,
|
|
1509
|
-
"$disabled":
|
|
1510
|
-
"$isInvalid":
|
|
1508
|
+
"$disabled": isReadonly,
|
|
1509
|
+
"$isInvalid": isReadonly ? false : isInvalid,
|
|
1511
1510
|
"data-testid": dataTestId ? `${dataTestId}Label` : ""
|
|
1512
1511
|
}, {
|
|
1513
1512
|
children: label
|
|
@@ -1988,6 +1987,7 @@ const DateField = forwardRef(({
|
|
|
1988
1987
|
defaultValue,
|
|
1989
1988
|
onChange,
|
|
1990
1989
|
disabled = false,
|
|
1990
|
+
readOnly = false,
|
|
1991
1991
|
id,
|
|
1992
1992
|
dataTestId,
|
|
1993
1993
|
placeholder,
|
|
@@ -2019,6 +2019,7 @@ const DateField = forwardRef(({
|
|
|
2019
2019
|
value: (selectedDay === null || selectedDay === void 0 ? void 0 : selectedDay.toLocaleDateString()) || "",
|
|
2020
2020
|
onChange: () => {},
|
|
2021
2021
|
disabled: disabled,
|
|
2022
|
+
readOnly: readOnly,
|
|
2022
2023
|
dataTestId: dataTestId,
|
|
2023
2024
|
id: id,
|
|
2024
2025
|
ref: ref,
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@trackunit/css-core": "0.0.
|
|
8
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
7
|
+
"@trackunit/css-core": "0.0.44",
|
|
8
|
+
"@trackunit/tailwind-styled-components": "0.0.40",
|
|
9
9
|
"react": "17.0.1",
|
|
10
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
10
|
+
"@trackunit/ui-design-tokens": "0.0.39",
|
|
11
11
|
"echarts-for-react": "^3.0.2",
|
|
12
12
|
"uuid": "^8.3.2",
|
|
13
13
|
"@react-spring/web": "^9.4.4",
|
|
14
14
|
"react-use": "^17.3.2",
|
|
15
15
|
"react-day-picker": "^8.0.3",
|
|
16
16
|
"date-fns": "^2.28.0",
|
|
17
|
-
"@trackunit/ui-icons": "0.0.
|
|
17
|
+
"@trackunit/ui-icons": "0.0.41",
|
|
18
18
|
"react-useportal": "^1.0.16",
|
|
19
19
|
"react-helmet": "^6.1.0",
|
|
20
20
|
"@popperjs/core": "^2.11.4",
|