@hitachivantara/uikit-react-core 5.98.0 → 5.99.0

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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AppSwitcher/Action/Action.cjs +4 -1
  3. package/dist/cjs/BaseRadio/BaseRadio.cjs +2 -2
  4. package/dist/cjs/BaseSwitch/BaseSwitch.cjs +2 -2
  5. package/dist/cjs/Card/Header/Header.styles.cjs +3 -1
  6. package/dist/cjs/CheckBox/CheckBox.cjs +2 -2
  7. package/dist/cjs/ColorPicker/Fields/Fields.cjs +0 -1
  8. package/dist/cjs/ColorPicker/Fields/Fields.styles.cjs +1 -3
  9. package/dist/cjs/ColorPicker/Picker/Picker.cjs +0 -1
  10. package/dist/cjs/ColorPicker/Picker/Picker.styles.cjs +1 -3
  11. package/dist/cjs/ColorPicker/PresetColors/PresetColors.cjs +0 -1
  12. package/dist/cjs/ColorPicker/PresetColors/PresetColors.styles.cjs +1 -3
  13. package/dist/cjs/ColorPicker/SavedColors/SavedColors.cjs +0 -1
  14. package/dist/cjs/ColorPicker/SavedColors/SavedColors.styles.cjs +1 -3
  15. package/dist/cjs/Dialog/Content/Content.cjs +26 -0
  16. package/dist/cjs/Dialog/Content/Content.styles.cjs +5 -2
  17. package/dist/cjs/Dialog/Dialog.styles.cjs +3 -1
  18. package/dist/cjs/Dialog/Title/Title.cjs +2 -2
  19. package/dist/cjs/DropdownButton/DropdownButton.cjs +2 -2
  20. package/dist/cjs/QueryBuilder/ConfirmationDialog.cjs +32 -0
  21. package/dist/cjs/QueryBuilder/QueryBuilder.cjs +4 -4
  22. package/dist/cjs/QueryBuilder/Rule/{Attribute/Attribute.cjs → Attribute.cjs} +3 -4
  23. package/dist/cjs/QueryBuilder/Rule/{Operator/Operator.cjs → Operator.cjs} +3 -4
  24. package/dist/cjs/QueryBuilder/Rule/Rule.cjs +3 -4
  25. package/dist/cjs/QueryBuilder/Rule/Rule.styles.cjs +46 -50
  26. package/dist/cjs/QueryBuilder/{RuleGroup/RuleGroup.cjs → RuleGroup.cjs} +9 -9
  27. package/dist/cjs/QueryBuilder/{Rule/Value/BooleanValue → Value}/BooleanValue.cjs +3 -5
  28. package/dist/cjs/QueryBuilder/{Rule/Value/DateTimeValue → Value}/DateTimeValue.cjs +67 -40
  29. package/dist/cjs/QueryBuilder/{Rule/Value/EmptyValue → Value}/EmptyValue.cjs +1 -1
  30. package/dist/cjs/QueryBuilder/{Rule/Value/NumericValue → Value}/NumericValue.cjs +33 -8
  31. package/dist/cjs/QueryBuilder/{Rule/Value/TextValue → Value}/TextValue.cjs +9 -5
  32. package/dist/cjs/QueryBuilder/{Rule/Value → Value}/Value.cjs +7 -9
  33. package/dist/cjs/Radio/Radio.cjs +3 -3
  34. package/dist/cjs/Section/Section.cjs +43 -18
  35. package/dist/cjs/Section/Section.styles.cjs +14 -2
  36. package/dist/cjs/Select/Select.cjs +2 -2
  37. package/dist/cjs/Switch/Switch.cjs +1 -1
  38. package/dist/cjs/Table/TableSection/TableSection.styles.cjs +1 -7
  39. package/dist/cjs/TagsInput/TagsInput.cjs +2 -2
  40. package/dist/cjs/TextArea/TextArea.cjs +2 -2
  41. package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +2 -2
  42. package/dist/cjs/providers/Provider.cjs +1 -4
  43. package/dist/cjs/themes/ds3.cjs +16 -0
  44. package/dist/cjs/themes/ds5.cjs +20 -0
  45. package/dist/cjs/themes/pentahoPlus.cjs +50 -16
  46. package/dist/esm/AppSwitcher/Action/Action.js +4 -1
  47. package/dist/esm/BaseRadio/BaseRadio.js +2 -2
  48. package/dist/esm/BaseSwitch/BaseSwitch.js +2 -2
  49. package/dist/esm/Card/Header/Header.styles.js +3 -1
  50. package/dist/esm/CheckBox/CheckBox.js +2 -2
  51. package/dist/esm/ColorPicker/Fields/Fields.js +1 -3
  52. package/dist/esm/ColorPicker/Fields/Fields.styles.js +1 -3
  53. package/dist/esm/ColorPicker/Picker/Picker.js +1 -3
  54. package/dist/esm/ColorPicker/Picker/Picker.styles.js +1 -3
  55. package/dist/esm/ColorPicker/PresetColors/PresetColors.js +1 -3
  56. package/dist/esm/ColorPicker/PresetColors/PresetColors.styles.js +1 -3
  57. package/dist/esm/ColorPicker/SavedColors/SavedColors.js +1 -3
  58. package/dist/esm/ColorPicker/SavedColors/SavedColors.styles.js +1 -3
  59. package/dist/esm/Dialog/Content/Content.js +27 -1
  60. package/dist/esm/Dialog/Content/Content.styles.js +5 -2
  61. package/dist/esm/Dialog/Dialog.styles.js +3 -1
  62. package/dist/esm/Dialog/Title/Title.js +3 -3
  63. package/dist/esm/DropdownButton/DropdownButton.js +2 -2
  64. package/dist/esm/QueryBuilder/ConfirmationDialog.js +32 -0
  65. package/dist/esm/QueryBuilder/QueryBuilder.js +4 -4
  66. package/dist/esm/QueryBuilder/Rule/{Attribute/Attribute.js → Attribute.js} +4 -5
  67. package/dist/esm/QueryBuilder/Rule/{Operator/Operator.js → Operator.js} +4 -5
  68. package/dist/esm/QueryBuilder/Rule/Rule.js +4 -6
  69. package/dist/esm/QueryBuilder/Rule/Rule.styles.js +47 -51
  70. package/dist/esm/QueryBuilder/{RuleGroup/RuleGroup.js → RuleGroup.js} +9 -9
  71. package/dist/esm/QueryBuilder/{Rule/Value/BooleanValue → Value}/BooleanValue.js +3 -5
  72. package/dist/esm/QueryBuilder/{Rule/Value/DateTimeValue → Value}/DateTimeValue.js +63 -35
  73. package/dist/esm/QueryBuilder/{Rule/Value/EmptyValue → Value}/EmptyValue.js +1 -1
  74. package/dist/esm/QueryBuilder/{Rule/Value/NumericValue → Value}/NumericValue.js +33 -8
  75. package/dist/esm/QueryBuilder/{Rule/Value/TextValue → Value}/TextValue.js +9 -5
  76. package/dist/esm/QueryBuilder/{Rule/Value → Value}/Value.js +7 -9
  77. package/dist/esm/Radio/Radio.js +3 -3
  78. package/dist/esm/Section/Section.js +44 -19
  79. package/dist/esm/Section/Section.styles.js +14 -2
  80. package/dist/esm/Select/Select.js +2 -2
  81. package/dist/esm/Switch/Switch.js +1 -1
  82. package/dist/esm/Table/TableSection/TableSection.styles.js +1 -7
  83. package/dist/esm/TagsInput/TagsInput.js +2 -2
  84. package/dist/esm/TextArea/TextArea.js +2 -2
  85. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +2 -2
  86. package/dist/esm/providers/Provider.js +2 -5
  87. package/dist/esm/themes/ds3.js +16 -0
  88. package/dist/esm/themes/ds5.js +20 -0
  89. package/dist/esm/themes/pentahoPlus.js +50 -16
  90. package/dist/types/index.d.ts +51 -47
  91. package/package.json +6 -6
  92. package/dist/cjs/QueryBuilder/ConfirmationDialog/ConfirmationDialog.cjs +0 -53
  93. package/dist/cjs/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.cjs +0 -11
  94. package/dist/cjs/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.cjs +0 -37
  95. package/dist/cjs/QueryBuilder/Rule/Value/DateTimeValue/utils.cjs +0 -36
  96. package/dist/cjs/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.cjs +0 -34
  97. package/dist/cjs/QueryBuilder/Rule/Value/TextValue/TextValue.styles.cjs +0 -13
  98. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js +0 -53
  99. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.js +0 -11
  100. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.js +0 -37
  101. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/utils.js +0 -34
  102. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.js +0 -34
  103. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.styles.js +0 -13
@@ -1,60 +1,56 @@
1
1
  import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
- import { staticClasses as staticClasses$1 } from "../QueryBuilder.styles.js";
4
- const { useClasses, staticClasses } = createClasses(
5
- "HvQueryBuilder-Rule",
6
- {
7
- root: {
8
- position: "relative",
9
- marginTop: theme.space.xs,
10
- minHeight: 94,
11
- "&>div:not(:last-child)": {
12
- paddingRight: theme.space.md
13
- },
14
- // hide required * as all fields are required
15
- "& label>span[aria-hidden]": {
16
- visibility: "hidden"
17
- },
18
- "&::before": {
19
- content: '""',
20
- position: "absolute",
21
- zIndex: 2,
22
- width: "17px",
23
- height: "44px",
24
- borderBottom: `1px solid ${theme.colors.border}`,
25
- borderLeft: `1px solid ${theme.colors.border}`,
26
- top: 0,
27
- left: `calc(-1 * 17px)`
28
- },
29
- [`:not(.${staticClasses$1.topRulesContainer})>&:last-child::after`]: {
30
- content: '""',
31
- position: "absolute",
32
- zIndex: 1,
33
- width: "17px",
34
- height: "100%",
35
- borderLeft: `1px solid ${theme.colors.border}`,
36
- top: 0,
37
- left: `calc(-1 * 17px)`
38
- }
3
+ import { staticClasses } from "../QueryBuilder.styles.js";
4
+ const { useClasses } = createClasses("HvQueryBuilderRule", {
5
+ root: {
6
+ position: "relative",
7
+ marginTop: theme.space.xs,
8
+ minHeight: 94,
9
+ "&>div:not(:last-child)": {
10
+ paddingRight: theme.space.md
39
11
  },
40
- actionsContainer: {
41
- marginLeft: "auto",
42
- marginTop: "24px",
43
- "&>:not(:last-child)": {
44
- marginRight: theme.space.xs
45
- }
12
+ // hide required * as all fields are required
13
+ "& label>span[aria-hidden]": {
14
+ visibility: "hidden"
46
15
  },
47
- isMdDown: {
48
- "&>div:not(:last-child)": {
49
- paddingRight: 0
50
- },
51
- "&>div:not(:first-of-type)": {
52
- marginTop: theme.space.xs
53
- }
16
+ "&::before": {
17
+ content: '""',
18
+ position: "absolute",
19
+ zIndex: 2,
20
+ width: "17px",
21
+ height: "44px",
22
+ borderBottom: `1px solid ${theme.colors.border}`,
23
+ borderLeft: `1px solid ${theme.colors.border}`,
24
+ top: 0,
25
+ left: `calc(-1 * 17px)`
26
+ },
27
+ [`:not(.${staticClasses.topRulesContainer})>&:last-child::after`]: {
28
+ content: '""',
29
+ position: "absolute",
30
+ zIndex: 1,
31
+ width: "17px",
32
+ height: "100%",
33
+ borderLeft: `1px solid ${theme.colors.border}`,
34
+ top: 0,
35
+ left: `calc(-1 * 17px)`
36
+ }
37
+ },
38
+ actionsContainer: {
39
+ marginLeft: "auto",
40
+ marginTop: "24px",
41
+ "&>:not(:last-child)": {
42
+ marginRight: theme.space.xs
43
+ }
44
+ },
45
+ isMdDown: {
46
+ "&>div:not(:last-child)": {
47
+ paddingRight: 0
48
+ },
49
+ "&>div:not(:first-of-type)": {
50
+ marginTop: theme.space.xs
54
51
  }
55
52
  }
56
- );
53
+ });
57
54
  export {
58
- staticClasses,
59
55
  useClasses
60
56
  };
@@ -1,14 +1,14 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useCallback } from "react";
3
- import { HvIcon } from "../../icons.js";
4
- import { useQueryBuilderContext } from "../Context.js";
5
- import { useClasses } from "../QueryBuilder.styles.js";
6
- import { HvButton } from "../../Button/Button.js";
7
- import { Rule } from "../Rule/Rule.js";
8
- import { HvEmptyState } from "../../EmptyState/EmptyState.js";
9
- import { HvMultiButton } from "../../MultiButton/MultiButton.js";
10
- import { HvIconButton } from "../../IconButton/IconButton.js";
11
- import { HvTypography } from "../../Typography/Typography.js";
3
+ import { HvIcon } from "../icons.js";
4
+ import { useQueryBuilderContext } from "./Context.js";
5
+ import { useClasses } from "./QueryBuilder.styles.js";
6
+ import { Rule } from "./Rule/Rule.js";
7
+ import { HvButton } from "../Button/Button.js";
8
+ import { HvEmptyState } from "../EmptyState/EmptyState.js";
9
+ import { HvMultiButton } from "../MultiButton/MultiButton.js";
10
+ import { HvIconButton } from "../IconButton/IconButton.js";
11
+ import { HvTypography } from "../Typography/Typography.js";
12
12
  const RuleGroup = ({
13
13
  level = 0,
14
14
  id,
@@ -1,8 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import { useQueryBuilderContext } from "../../../Context.js";
4
- import { isBigList } from "../../../utils/index.js";
5
- import { HvDropdown } from "../../../../Dropdown/Dropdown.js";
2
+ import { useQueryBuilderContext } from "../Context.js";
3
+ import { isBigList } from "../utils/index.js";
4
+ import { HvDropdown } from "../../Dropdown/Dropdown.js";
6
5
  const BooleanValue = ({ id, value = true }) => {
7
6
  const { labels, dispatchAction, readOnly } = useQueryBuilderContext();
8
7
  const values = ["true", "false"].map((v) => ({
@@ -36,7 +35,6 @@ const BooleanValue = ({ id, value = true }) => {
36
35
  }
37
36
  );
38
37
  };
39
- memo(BooleanValue);
40
38
  export {
41
39
  BooleanValue
42
40
  };
@@ -1,18 +1,63 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useCallback, useMemo, memo } from "react";
2
+ import { useState, useCallback, useMemo } from "react";
3
3
  import { useTheme } from "@mui/material/styles";
4
4
  import useMediaQuery from "@mui/material/useMediaQuery";
5
- import dayjs from "dayjs";
6
- import { uniqueId } from "../../../../utils/helpers.js";
7
- import { useQueryBuilderContext } from "../../../Context.js";
8
- import { useClasses } from "./DateTimeValue.styles.js";
9
- import { padTime, parseDate, parseTime } from "./utils.js";
10
- import { HvDatePicker } from "../../../../DatePicker/DatePicker.js";
11
- import { HvTimePicker } from "../../../../TimePicker/TimePicker.js";
12
- import { HvWarningText } from "../../../../FormElement/WarningText/WarningText.js";
13
- function valueIsRange(operator) {
14
- return operator === "range";
5
+ import { createClasses } from "@hitachivantara/uikit-react-utils";
6
+ import { theme } from "@hitachivantara/uikit-styles";
7
+ import { uniqueId } from "../../utils/helpers.js";
8
+ import { useQueryBuilderContext } from "../Context.js";
9
+ import { HvDatePicker } from "../../DatePicker/DatePicker.js";
10
+ import { HvTimePicker } from "../../TimePicker/TimePicker.js";
11
+ import { HvWarningText } from "../../FormElement/WarningText/WarningText.js";
12
+ function formatDate(date) {
13
+ return date?.toISOString().slice(0, 10);
15
14
  }
15
+ function formatTime(time) {
16
+ if (!time) return void 0;
17
+ const { hours, minutes, seconds } = time;
18
+ const date = new Date(Date.UTC(2020, 8, 8, hours, minutes, seconds));
19
+ return date.toISOString().slice(11, 19);
20
+ }
21
+ function parseDate(date) {
22
+ return date ? new Date(date) : void 0;
23
+ }
24
+ function parseTime(time) {
25
+ if (!time) return null;
26
+ const parts = time.split(":");
27
+ return {
28
+ hours: Number(parts[0]),
29
+ minutes: Number(parts[1]),
30
+ seconds: Number(parts[2]) || 0
31
+ };
32
+ }
33
+ const { useClasses } = createClasses("HvQueryBuilderDateTimeValue", {
34
+ root: {
35
+ display: "flex",
36
+ flexDirection: "column"
37
+ },
38
+ row: {},
39
+ vertical: {
40
+ display: "flex",
41
+ flexDirection: "column"
42
+ },
43
+ horizontal: {
44
+ display: "flex",
45
+ "& > div:not(:last-child)": {
46
+ marginRight: theme.space.md
47
+ }
48
+ },
49
+ isMdDown: {
50
+ "& > div:not(:last-child)": {
51
+ marginRight: `calc(${theme.space.md} / 2)`
52
+ }
53
+ },
54
+ datePicker: {
55
+ flex: 1
56
+ },
57
+ timePicker: {
58
+ flex: 1
59
+ }
60
+ });
16
61
  const DateTimeValue = ({
17
62
  id,
18
63
  operator,
@@ -20,9 +65,9 @@ const DateTimeValue = ({
20
65
  initialTouched = false
21
66
  }) => {
22
67
  const { classes, cx } = useClasses();
23
- const theme = useTheme();
24
- const isMdDown = useMediaQuery(theme.breakpoints.down("md"));
25
- const isRange = valueIsRange(operator);
68
+ const theme2 = useTheme();
69
+ const isMdDown = useMediaQuery(theme2.breakpoints.down("md"));
70
+ const isRange = operator === "range";
26
71
  const { labels, dispatchAction, readOnly } = useQueryBuilderContext();
27
72
  const elementId = uniqueId(`datetime${id}`);
28
73
  const [touchedDate, setTouchedDate] = useState(initialTouched);
@@ -32,10 +77,7 @@ const DateTimeValue = ({
32
77
  const onDateChange = useCallback(
33
78
  (data) => {
34
79
  setTouchedDate(true);
35
- let date;
36
- if (data != null) {
37
- date = dayjs(data).format("YYYY-MM-DD");
38
- }
80
+ const date = formatDate(data);
39
81
  const oldValue = !isRange ? valueProp?.date : valueProp?.start?.date;
40
82
  if (date !== oldValue) {
41
83
  let value;
@@ -65,12 +107,7 @@ const DateTimeValue = ({
65
107
  const onTimeChange = useCallback(
66
108
  (data) => {
67
109
  setTouchedTime(true);
68
- let time;
69
- if (data != null) {
70
- time = `${padTime(data.hours)}:${padTime(data.minutes)}:${padTime(
71
- data.seconds
72
- )}`;
73
- }
110
+ const time = formatTime(data);
74
111
  const oldValue = !isRange ? valueProp?.time : valueProp?.start?.time;
75
112
  if (time !== oldValue) {
76
113
  let value;
@@ -100,10 +137,7 @@ const DateTimeValue = ({
100
137
  const onEndDateChange = useCallback(
101
138
  (data) => {
102
139
  setTouchedEndDate(true);
103
- let date;
104
- if (data != null) {
105
- date = dayjs(data).format("YYYY-MM-DD");
106
- }
140
+ const date = formatDate(data);
107
141
  if (date !== valueProp?.end?.date) {
108
142
  const value = {
109
143
  start: valueProp?.start,
@@ -124,12 +158,7 @@ const DateTimeValue = ({
124
158
  const onEndTimeChange = useCallback(
125
159
  (data) => {
126
160
  setTouchedEndTime(true);
127
- let time;
128
- if (data != null) {
129
- time = `${padTime(data.hours)}:${padTime(data.minutes)}:${padTime(
130
- data.seconds
131
- )}`;
132
- }
161
+ const time = formatTime(data);
133
162
  if (time !== valueProp?.end?.time) {
134
163
  const value = {
135
164
  start: valueProp?.start,
@@ -274,7 +303,6 @@ const DateTimeValue = ({
274
303
  ] })
275
304
  ] });
276
305
  };
277
- memo(DateTimeValue);
278
306
  export {
279
307
  DateTimeValue
280
308
  };
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from "react";
2
- import { useQueryBuilderContext } from "../../../Context.js";
2
+ import { useQueryBuilderContext } from "../Context.js";
3
3
  const EmptyValue = ({ id }) => {
4
4
  const { dispatchAction } = useQueryBuilderContext();
5
5
  useEffect(() => {
@@ -1,11 +1,37 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useCallback, useState, memo } from "react";
2
+ import { useCallback, useState } from "react";
3
3
  import { useTheme } from "@mui/material/styles";
4
4
  import useMediaQuery from "@mui/material/useMediaQuery";
5
- import { uniqueId } from "../../../../utils/helpers.js";
6
- import { useQueryBuilderContext } from "../../../Context.js";
7
- import { useClasses } from "./Numeric.styles.js";
8
- import { HvInput } from "../../../../Input/Input.js";
5
+ import { createClasses } from "@hitachivantara/uikit-react-utils";
6
+ import { theme } from "@hitachivantara/uikit-styles";
7
+ import { uniqueId } from "../../utils/helpers.js";
8
+ import { useQueryBuilderContext } from "../Context.js";
9
+ import { HvInput } from "../../Input/Input.js";
10
+ const { useClasses } = createClasses("HvQueryBuilderNumericValue", {
11
+ root: {},
12
+ label: {
13
+ paddingBottom: "6px"
14
+ },
15
+ inputContainer: {},
16
+ rangeContainer: {
17
+ display: "flex",
18
+ "& $inputContainer": {
19
+ flexGrow: 1,
20
+ overflow: "auto"
21
+ },
22
+ "& > $inputContainer:not(:last-child)": {
23
+ marginRight: theme.space.md
24
+ }
25
+ },
26
+ input: {
27
+ flexGrow: 1
28
+ },
29
+ isMdDown: {
30
+ "& > $inputContainer:not(:last-child)": {
31
+ marginRight: `calc(${theme.space.md} / 2)`
32
+ }
33
+ }
34
+ });
9
35
  const NumericValue = ({
10
36
  id,
11
37
  value,
@@ -15,8 +41,8 @@ const NumericValue = ({
15
41
  const { classes, cx } = useClasses();
16
42
  const isRange = operator === "range";
17
43
  const { labels, dispatchAction, readOnly } = useQueryBuilderContext();
18
- const theme = useTheme();
19
- const isMdDown = useMediaQuery(theme.breakpoints.down("md"));
44
+ const theme2 = useTheme();
45
+ const isMdDown = useMediaQuery(theme2.breakpoints.down("md"));
20
46
  const onSingleValueChange = useCallback(
21
47
  (event, data) => {
22
48
  dispatchAction({
@@ -177,7 +203,6 @@ const NumericValue = ({
177
203
  ) })
178
204
  ] });
179
205
  };
180
- memo(NumericValue);
181
206
  export {
182
207
  NumericValue
183
208
  };
@@ -1,8 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useState, memo } from "react";
3
- import { useQueryBuilderContext } from "../../../Context.js";
4
- import { useClasses } from "./TextValue.styles.js";
5
- import { HvInput } from "../../../../Input/Input.js";
2
+ import { useState } from "react";
3
+ import { createClasses } from "@hitachivantara/uikit-react-utils";
4
+ import { useQueryBuilderContext } from "../Context.js";
5
+ import { HvInput } from "../../Input/Input.js";
6
+ const { useClasses } = createClasses("HvQueryBuilderTextValue", {
7
+ location: {
8
+ flexGrow: 1
9
+ }
10
+ });
6
11
  const TextValue = ({
7
12
  id,
8
13
  value = "",
@@ -46,7 +51,6 @@ const TextValue = ({
46
51
  }
47
52
  );
48
53
  };
49
- memo(TextValue);
50
54
  export {
51
55
  TextValue
52
56
  };
@@ -1,12 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import { useQueryBuilderContext } from "../../Context.js";
4
- import { defaultRendererKey } from "../../types.js";
5
- import { EmptyValue } from "./EmptyValue/EmptyValue.js";
6
- import { TextValue } from "./TextValue/TextValue.js";
7
- import { DateTimeValue } from "./DateTimeValue/DateTimeValue.js";
8
- import { NumericValue } from "./NumericValue/NumericValue.js";
9
- import { BooleanValue } from "./BooleanValue/BooleanValue.js";
2
+ import { useQueryBuilderContext } from "../Context.js";
3
+ import { defaultRendererKey } from "../types.js";
4
+ import { BooleanValue } from "./BooleanValue.js";
5
+ import { DateTimeValue } from "./DateTimeValue.js";
6
+ import { EmptyValue } from "./EmptyValue.js";
7
+ import { NumericValue } from "./NumericValue.js";
8
+ import { TextValue } from "./TextValue.js";
10
9
  const getRenderer = (renderer, operator) => (
11
10
  // 1. Custom renderer
12
11
  typeof renderer === "function" && renderer || // 2. Custom operator renderer
@@ -70,7 +69,6 @@ const Value = ({
70
69
  return /* @__PURE__ */ jsx(TextValue, { id, value: valueProp, initialTouched });
71
70
  }
72
71
  };
73
- memo(Value);
74
72
  export {
75
73
  Value
76
74
  };
@@ -114,11 +114,11 @@ const HvRadio = forwardRef(
114
114
  "div",
115
115
  {
116
116
  className: cx(classes.container, {
117
- [classes.disabled]: disabled,
118
117
  [classes.focusVisible]: !!(focusVisible && label),
119
- [classes.invalidContainer]: isStateInvalid,
118
+ [classes.semantic]: semantic,
120
119
  [classes.checked]: isChecked,
121
- [classes.semantic]: semantic
120
+ [classes.invalidContainer]: isStateInvalid,
121
+ [classes.disabled]: disabled
122
122
  }),
123
123
  children: [
124
124
  radio,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
2
+ import { forwardRef, useRef } from "react";
3
3
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
4
  import { useExpandable } from "../hooks/useExpandable.js";
5
5
  import { HvIcon } from "../icons.js";
@@ -15,6 +15,7 @@ const HvSection = forwardRef(
15
15
  title,
16
16
  expandable,
17
17
  expanded,
18
+ expandableHeader,
18
19
  defaultExpanded = true,
19
20
  actions,
20
21
  onToggle,
@@ -25,6 +26,7 @@ const HvSection = forwardRef(
25
26
  ...others
26
27
  } = useDefaultProps("HvSection", props);
27
28
  const { classes, cx } = useClasses(classesProp);
29
+ const expandButtonRef = useRef(null);
28
30
  const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable({
29
31
  id,
30
32
  expanded,
@@ -41,24 +43,47 @@ const HvSection = forwardRef(
41
43
  }),
42
44
  ...others,
43
45
  children: [
44
- hasHeader && /* @__PURE__ */ jsxs("div", { className: classes.header, children: [
45
- expandable && /* @__PURE__ */ jsx(
46
- HvButton,
47
- {
48
- icon: true,
49
- onClick: (event) => {
50
- toggleOpen();
51
- onToggle?.(event, !isOpen);
52
- },
53
- "aria-label": isOpen ? "Collapse" : "Expand",
54
- ...buttonProps,
55
- ...expandButtonProps,
56
- children: /* @__PURE__ */ jsx(HvIcon, { name: "CaretDown", size: "xs", rotate: isOpen })
57
- }
58
- ),
59
- title,
60
- /* @__PURE__ */ jsx("div", { className: classes.actions, children: actions })
61
- ] }),
46
+ hasHeader && /* @__PURE__ */ jsxs(
47
+ "div",
48
+ {
49
+ className: cx(classes.header, {
50
+ [classes.headerExpandable]: expandable && expandableHeader
51
+ }),
52
+ onClick: () => {
53
+ if (!expandableHeader) return;
54
+ expandButtonRef.current?.click();
55
+ },
56
+ children: [
57
+ expandable && /* @__PURE__ */ jsx(
58
+ HvButton,
59
+ {
60
+ ref: expandButtonRef,
61
+ icon: true,
62
+ onClick: (event) => {
63
+ event.stopPropagation();
64
+ toggleOpen();
65
+ onToggle?.(event, !isOpen);
66
+ },
67
+ "aria-label": isOpen ? "Collapse" : "Expand",
68
+ ...buttonProps,
69
+ ...expandButtonProps,
70
+ children: /* @__PURE__ */ jsx(HvIcon, { name: "CaretDown", size: "xs", rotate: isOpen })
71
+ }
72
+ ),
73
+ title,
74
+ /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ className: classes.actions,
78
+ onClick: (evt) => {
79
+ evt.stopPropagation();
80
+ },
81
+ children: actions
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ ),
62
87
  /* @__PURE__ */ jsx(
63
88
  "div",
64
89
  {
@@ -7,6 +7,7 @@ const { staticClasses, useClasses } = createClasses("HvSection", {
7
7
  flexDirection: "column",
8
8
  backgroundColor: theme.colors.bgContainer,
9
9
  borderRadius: theme.radii.round,
10
+ overflow: "hidden",
10
11
  border: `1px solid ${theme.colors.border}`
11
12
  },
12
13
  hidden: { height: 0, display: "none" },
@@ -15,12 +16,23 @@ const { staticClasses, useClasses } = createClasses("HvSection", {
15
16
  alignItems: "center",
16
17
  borderColor: "inherit",
17
18
  position: "relative",
18
- padding: theme.space.sm
19
+ padding: theme.space.sm,
20
+ "+ $content": {
21
+ borderTopLeftRadius: 0,
22
+ borderTopRightRadius: 0
23
+ }
24
+ },
25
+ headerExpandable: {
26
+ cursor: "pointer",
27
+ ":hover": {
28
+ backgroundColor: theme.colors.bgHover
29
+ }
19
30
  },
20
31
  content: {
21
32
  padding: theme.space.sm,
22
33
  borderRadius: "inherit",
23
- borderColor: "inherit"
34
+ borderColor: "inherit",
35
+ flex: 1
24
36
  },
25
37
  hasHeader: {
26
38
  paddingTop: 0
@@ -130,8 +130,8 @@ const HvSelect = fixedForwardRef(function HvSelect2(props, ref) {
130
130
  readOnly,
131
131
  status: validationState,
132
132
  className: cx(classes.root, className, {
133
- [classes.disabled]: disabled,
134
- [classes.readOnly]: readOnly
133
+ [classes.readOnly]: readOnly,
134
+ [classes.disabled]: disabled
135
135
  }),
136
136
  ...others,
137
137
  children: [
@@ -120,7 +120,7 @@ const HvSwitch = forwardRef(
120
120
  switchBase: css({
121
121
  "&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track": {
122
122
  backgroundColor: getColor(color),
123
- borderColor: isSemantical(color) ? getColor(`${color}_120`) : "#00000032"
123
+ borderColor: isSemantical(color) ? getColor(`${color}Deep`) : "#00000032"
124
124
  }
125
125
  })
126
126
  }
@@ -14,13 +14,7 @@ import { staticClasses as staticClasses$6 } from "../TableContainer/TableContain
14
14
  import "../TableContainer/TableContainer.js";
15
15
  const { staticClasses, useClasses } = createClasses("HvTableSection", {
16
16
  root: {},
17
- header: {
18
- // Only apply the border to divide the header and content when both are displayed
19
- "+ div": {
20
- borderTopLeftRadius: 0,
21
- borderTopRightRadius: 0
22
- }
23
- },
17
+ header: {},
24
18
  actions: {},
25
19
  content: {
26
20
  marginTop: 0,
@@ -295,8 +295,8 @@ const HvTagsInput = forwardRef(
295
295
  className: cx(
296
296
  classes.root,
297
297
  {
298
- [classes.disabled]: disabled,
299
- [classes.readOnly]: readOnly
298
+ [classes.readOnly]: readOnly,
299
+ [classes.disabled]: disabled
300
300
  },
301
301
  className
302
302
  ),
@@ -189,8 +189,8 @@ const HvTextArea = forwardRef(function HvTextArea2(props, ref) {
189
189
  classes.root,
190
190
  {
191
191
  [classes.resizable]: resizable,
192
- [classes.disabled]: disabled,
193
- [classes.invalid]: isStateInvalid
192
+ [classes.invalid]: isStateInvalid,
193
+ [classes.disabled]: disabled
194
194
  },
195
195
  className
196
196
  ),
@@ -386,7 +386,6 @@ const HvVerticalNavigationTreeViewItem = forwardRef(
386
386
  className: cx(
387
387
  classes.node,
388
388
  {
389
- [classes.disabled]: disabled,
390
389
  [classes.expandable]: expandable,
391
390
  [classes.collapsed]: expandable && !expanded,
392
391
  [classes.expanded]: expandable && expanded,
@@ -395,7 +394,8 @@ const HvVerticalNavigationTreeViewItem = forwardRef(
395
394
  [classes.selected]: !disabled && selectable && selected || !isOpen && useIcons && isChildSelected && isChildSelected(nodeId),
396
395
  [classes.unselected]: !disabled && selectable && !selected,
397
396
  [classes.focused]: focused,
398
- [classes.hide]: !isOpen && !useIcons
397
+ [classes.hide]: !isOpen && !useIcons,
398
+ [classes.disabled]: disabled
399
399
  },
400
400
  className
401
401
  ),