@hitachivantara/uikit-react-core 5.68.0 → 5.68.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.
@@ -31,12 +31,12 @@ const HvDropdownList = (props) => {
31
31
  notifyChangesOnFirstRender = false,
32
32
  hasTooltips = false,
33
33
  singleSelectionToggle,
34
- height: dropdownHeight,
34
+ height: heightProp,
35
35
  maxHeight,
36
36
  virtualized = false,
37
37
  ...others
38
38
  } = uikitReactUtils.useDefaultProps("HvDropdownList", props);
39
- const { classes, cx, css } = List_styles.useClasses(classesProp);
39
+ const { classes, cx } = List_styles.useClasses(classesProp);
40
40
  const [searchStr, setSearchStr] = React.useState("");
41
41
  const [list, setList] = React.useState(clone(values));
42
42
  const [allSelected, setAllSelected] = React.useState(false);
@@ -169,6 +169,9 @@ const HvDropdownList = (props) => {
169
169
  ] });
170
170
  };
171
171
  const showList = valuesExist(values);
172
+ const elementsSize = uikitStyles.theme.spacing(
173
+ 5 + 2 + (showSearch ? 5 : 0) + (showList && multiSelect ? 4 + 6 : 0)
174
+ );
172
175
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.rootList, children: [
173
176
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.listBorderDown }),
174
177
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.listContainer, children: [
@@ -178,26 +181,15 @@ const HvDropdownList = (props) => {
178
181
  List.HvList,
179
182
  {
180
183
  id: setId.setId(id, "list"),
184
+ style: uikitReactUtils.mergeStyles(void 0, {
185
+ height: heightProp,
186
+ "--maxW": width,
187
+ "--maxH": maxHeight ?? `calc(${height}px - ${elementsSize})`
188
+ }),
181
189
  classes: {
182
- root: cx(
183
- classes.dropdownListContainer,
184
- css({
185
- maxWidth: width,
186
- maxHeight: maxHeight ?? `calc(${height}px - 32px - ${uikitStyles.theme.space.xs} - ${uikitStyles.theme.space.sm})`,
187
- overflow: "auto",
188
- padding: 4,
189
- margin: -4
190
- }),
191
- dropdownHeight && css({
192
- height: dropdownHeight
193
- }),
194
- virtualized && css({
195
- maxWidth: "inherit",
196
- maxHeight: "inherit",
197
- overflow: "inherit",
198
- padding: 0
199
- })
200
- )
190
+ root: cx(classes.dropdownListContainer, {
191
+ [classes.virtualized]: virtualized
192
+ })
201
193
  },
202
194
  values: list,
203
195
  multiSelect,
@@ -209,7 +201,7 @@ const HvDropdownList = (props) => {
209
201
  selectable: true,
210
202
  condensed: true,
211
203
  singleSelectionToggle,
212
- height: dropdownHeight,
204
+ height: heightProp,
213
205
  virtualized,
214
206
  ...others
215
207
  }
@@ -4,7 +4,19 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
4
4
  const uikitStyles = require("@hitachivantara/uikit-styles");
5
5
  const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDropdownList", {
6
6
  rootList: {},
7
- dropdownListContainer: {},
7
+ dropdownListContainer: {
8
+ overflow: "auto",
9
+ padding: 4,
10
+ margin: -4,
11
+ maxWidth: "var(--maxW)",
12
+ maxHeight: "var(--maxH)"
13
+ },
14
+ virtualized: {
15
+ maxWidth: "inherit",
16
+ maxHeight: "inherit",
17
+ overflow: "inherit",
18
+ padding: 0
19
+ },
8
20
  searchContainer: { marginBottom: uikitStyles.theme.space.xs },
9
21
  listBorderDown: {},
10
22
  listContainer: { padding: uikitStyles.theme.space.sm },
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useMemo, useEffect } from "react";
3
- import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
3
+ import { useDefaultProps, mergeStyles } from "@hitachivantara/uikit-react-utils";
4
4
  import { theme } from "@hitachivantara/uikit-styles";
5
5
  import { useBaseDropdownContext } from "../../BaseDropdown/BaseDropdownContext/BaseDropdownContext.js";
6
6
  import { setId } from "../../utils/setId.js";
@@ -30,12 +30,12 @@ const HvDropdownList = (props) => {
30
30
  notifyChangesOnFirstRender = false,
31
31
  hasTooltips = false,
32
32
  singleSelectionToggle,
33
- height: dropdownHeight,
33
+ height: heightProp,
34
34
  maxHeight,
35
35
  virtualized = false,
36
36
  ...others
37
37
  } = useDefaultProps("HvDropdownList", props);
38
- const { classes, cx, css } = useClasses(classesProp);
38
+ const { classes, cx } = useClasses(classesProp);
39
39
  const [searchStr, setSearchStr] = useState("");
40
40
  const [list, setList] = useState(clone(values));
41
41
  const [allSelected, setAllSelected] = useState(false);
@@ -168,6 +168,9 @@ const HvDropdownList = (props) => {
168
168
  ] });
169
169
  };
170
170
  const showList = valuesExist(values);
171
+ const elementsSize = theme.spacing(
172
+ 5 + 2 + (showSearch ? 5 : 0) + (showList && multiSelect ? 4 + 6 : 0)
173
+ );
171
174
  return /* @__PURE__ */ jsxs("div", { className: classes.rootList, children: [
172
175
  /* @__PURE__ */ jsx("div", { className: classes.listBorderDown }),
173
176
  /* @__PURE__ */ jsxs("div", { className: classes.listContainer, children: [
@@ -177,26 +180,15 @@ const HvDropdownList = (props) => {
177
180
  HvList,
178
181
  {
179
182
  id: setId(id, "list"),
183
+ style: mergeStyles(void 0, {
184
+ height: heightProp,
185
+ "--maxW": width,
186
+ "--maxH": maxHeight ?? `calc(${height}px - ${elementsSize})`
187
+ }),
180
188
  classes: {
181
- root: cx(
182
- classes.dropdownListContainer,
183
- css({
184
- maxWidth: width,
185
- maxHeight: maxHeight ?? `calc(${height}px - 32px - ${theme.space.xs} - ${theme.space.sm})`,
186
- overflow: "auto",
187
- padding: 4,
188
- margin: -4
189
- }),
190
- dropdownHeight && css({
191
- height: dropdownHeight
192
- }),
193
- virtualized && css({
194
- maxWidth: "inherit",
195
- maxHeight: "inherit",
196
- overflow: "inherit",
197
- padding: 0
198
- })
199
- )
189
+ root: cx(classes.dropdownListContainer, {
190
+ [classes.virtualized]: virtualized
191
+ })
200
192
  },
201
193
  values: list,
202
194
  multiSelect,
@@ -208,7 +200,7 @@ const HvDropdownList = (props) => {
208
200
  selectable: true,
209
201
  condensed: true,
210
202
  singleSelectionToggle,
211
- height: dropdownHeight,
203
+ height: heightProp,
212
204
  virtualized,
213
205
  ...others
214
206
  }
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/Dropdown/List/List.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvActionBar } from \"../../ActionBar\";\nimport { useBaseDropdownContext } from \"../../BaseDropdown/BaseDropdownContext/BaseDropdownContext\";\nimport { HvButton } from \"../../Button\";\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps, HvListValue } from \"../../List\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport type { HvDropdownLabels } from \"../Dropdown\";\nimport { getSelected } from \"../utils\";\nimport { staticClasses, useClasses } from \"./List.styles\";\n\nexport { staticClasses as dropdownListClasses };\n\nexport type HvDropdownListClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownListProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvDropdownListClasses;\n /**\n * The list to be rendered.\n */\n values?: HvListValue[];\n /**\n * If true renders a multi select list.\n */\n multiSelect?: boolean;\n /**\n * If true renders the search component.\n */\n showSearch?: boolean;\n /**\n * A function to be executed whenever a item is selected in the list\n * or the Apply button is activated (when `multiSelect` is `true`).\n */\n onChange: (\n /** An array containing the selected values */\n listValues: HvListValue[],\n /** If `true` the selection if finally committed the dropdown header text should reflect the new selection */\n commitChanges: boolean,\n /** If `true` the dropdown should toggle it's current state */\n toggle: boolean,\n /** If `true` the dropdown will call onChange */\n notifyChanges: boolean,\n ) => void;\n /**\n * A function to be executed whenever the Cancel button is activated.\n */\n onCancel: (event: React.MouseEvent) => void;\n /**\n * An object containing all the labels for the dropdown.\n */\n labels?: HvDropdownLabels;\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender?: boolean;\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips?: boolean;\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle?: boolean;\n /**\n * Experimental. Height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class. Required in case virtualized is used\n */\n height?: number;\n /**\n * Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.\n */\n maxHeight?: number;\n /**\n * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.\n */\n virtualized?: boolean;\n}\n\n/**\n * The values property was being deeply cloned. That created a significant performance\n * hit when the values contained complex properties' values, like React Nodes.\n *\n * For minimizing the impact of removing the clone, a shallow clone of the array and its\n * objects is performed instead. That should have the same effect in the majority of the\n * cases, where the properties' values are primitive.\n */\nconst clone = (values: HvListValue[]) => values.map((value) => ({ ...value }));\n\n/**\n * Set all hidden's to false.\n */\nconst cleanHidden = (lst: HvListValue[]) =>\n lst.map((item) => ({ ...item, isHidden: false }));\n\nconst valuesExist = (values: HvListValue[]) =>\n values != null && values?.length > 0;\n\n/** Filter selected ordered element `id`s (or `label`) */\nconst getSelectedIds = (list: HvListValue[]) =>\n getSelected(list).map((item) => item.id || item.label);\n\nexport const HvDropdownList = (props: HvDropdownListProps) => {\n const {\n id,\n classes: classesProp,\n values = [],\n multiSelect = false,\n showSearch = false,\n onChange,\n onCancel,\n labels,\n notifyChangesOnFirstRender = false,\n hasTooltips = false,\n singleSelectionToggle,\n height: dropdownHeight,\n maxHeight,\n virtualized = false,\n ...others\n } = useDefaultProps(\"HvDropdownList\", props);\n const { classes, cx, css } = useClasses(classesProp);\n\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [list, setList] = useState<HvListValue[]>(clone(values));\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n const { width, height } = useBaseDropdownContext();\n\n const hasChanges = useMemo(() => {\n return String(getSelectedIds(values)) !== String(getSelectedIds(list));\n }, [list, values]);\n\n const newLabels = {\n selectAll: labels?.selectAll,\n selectionConjunction: labels?.multiSelectionConjunction,\n };\n\n /**\n * Update states associated with select all.\n */\n const updateSelectAll = (listValues: HvListValue[]) => {\n if (!listValues) return;\n const nbrSelected = getSelected(listValues).length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === listValues.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n };\n\n /**\n * After the first render, call onChange if notifyChangesOnFirstRender.\n */\n useEffect(() => {\n if (!valuesExist(values)) return;\n setList(clone(values));\n updateSelectAll(values);\n if (notifyChangesOnFirstRender) {\n onChange?.(values, false, false, true);\n }\n }, [values, notifyChangesOnFirstRender, onChange]);\n\n /**\n * Sets the filtered values to the state.\n *\n * @param {String} str - The value that is being looked.\n */\n const handleSearch = (str: string) => {\n const results = list\n ? list.filter(\n ({\n searchValue,\n label,\n value,\n }: {\n searchValue?: any;\n label?: any;\n value?: any;\n }) => {\n let stringValue = \"\";\n if (\n typeof searchValue === \"string\" ||\n searchValue instanceof String\n ) {\n stringValue = searchValue.toLowerCase();\n } else if (typeof label === \"string\" || label instanceof String) {\n stringValue = label.toLowerCase();\n } else if (typeof value === \"string\" || value instanceof String) {\n stringValue = value.toLowerCase();\n }\n\n return stringValue.indexOf(str.toLowerCase()) >= 0;\n },\n )\n : null;\n\n if (results != null) {\n const newList = list.map((elem) => {\n const isResult = results.find((result) => result.label === elem.label);\n return { ...elem, isHidden: !isResult };\n });\n\n setList(newList);\n setSearchStr(str);\n }\n return str;\n };\n\n /**\n * Create search element.\n *\n * @returns {*}\n */\n const renderSearch = () => (\n <div className={classes.searchContainer}>\n <HvInput\n id={setId(id, \"search\")}\n type=\"search\"\n value={searchStr}\n placeholder={labels?.searchPlaceholder}\n aria-label={labels?.searchPlaceholder}\n onChange={(event, str) => handleSearch(str)}\n />\n </div>\n );\n\n /**\n * Select all the values inside the dropdown.\n *\n */\n const handleSelectAll = () => {\n const newList = list.map((elem) => ({ ...elem, selected: !anySelected }));\n setList(newList);\n updateSelectAll(newList);\n };\n\n /**\n * Create selecteAll component.\n *\n * @returns {*}\n */\n const renderSelectAll = () => {\n const selectAll = labels?.selectAll;\n const multiSelectionConjunction = labels?.multiSelectionConjunction;\n const nbrSelected = getSelected(list).length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${multiSelectionConjunction} ${list.length}`}\n </>\n ) : (\n <>\n <b>{selectAll}</b>\n {` (${list.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n classes={{\n container: classes.selection,\n }}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n };\n\n /**\n * When selecting the state list is updated with the corresponding selection.\n *\n * @param listValues - elements selected.\n */\n const onSelection: HvListProps[\"onChange\"] = (listValues) => {\n if (!multiSelect) {\n onChange(cleanHidden(listValues), true, true, true);\n } else {\n updateSelectAll(listValues);\n setList(clone(listValues));\n }\n };\n\n /**\n * Render action buttons.\n */\n const renderActions = () => {\n const applyLabel = labels?.applyLabel;\n const cancelLabel = labels?.cancelLabel;\n return (\n <HvActionBar id={setId(id, \"actions\")}>\n <HvButton\n id={setId(id, \"actions-apply\")}\n disabled={!hasChanges}\n onClick={() => onChange(cleanHidden(list), true, true, true)}\n variant=\"primaryGhost\"\n >\n {applyLabel}\n </HvButton>\n <HvButton\n id={setId(id, \"actions-cancel\")}\n onClick={onCancel}\n variant=\"primaryGhost\"\n >\n {cancelLabel}\n </HvButton>\n </HvActionBar>\n );\n };\n\n const showList = valuesExist(values);\n\n return (\n <div className={classes.rootList}>\n <div className={classes.listBorderDown} />\n <div className={classes.listContainer}>\n {showSearch && renderSearch()}\n {showList && multiSelect && renderSelectAll()}\n {showList && (\n <HvList\n id={setId(id, \"list\")}\n classes={{\n root: cx(\n classes.dropdownListContainer,\n css({\n maxWidth: width,\n maxHeight:\n maxHeight ??\n `calc(${height}px - 32px - ${theme.space.xs} - ${theme.space.sm})`,\n overflow: \"auto\",\n padding: 4,\n margin: -4,\n }),\n dropdownHeight &&\n css({\n height: dropdownHeight,\n }),\n virtualized &&\n css({\n maxWidth: \"inherit\",\n maxHeight: \"inherit\",\n overflow: \"inherit\",\n padding: 0,\n }),\n ),\n }}\n values={list}\n multiSelect={multiSelect}\n useSelector={multiSelect}\n showSelectAll={false}\n onChange={onSelection}\n labels={newLabels}\n hasTooltips={hasTooltips}\n selectable\n condensed\n singleSelectionToggle={singleSelectionToggle}\n height={dropdownHeight}\n virtualized={virtualized}\n {...others}\n />\n )}\n </div>\n {showList && multiSelect ? renderActions() : null}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoGA,MAAM,QAAQ,CAAC,WAA0B,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,MAAQ,EAAA;AAK7E,MAAM,cAAc,CAAC,QACnB,IAAI,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,UAAU,MAAA,EAAQ;AAElD,MAAM,cAAc,CAAC,WACnB,UAAU,QAAQ,QAAQ,SAAS;AAGrC,MAAM,iBAAiB,CAAC,SACtB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS,KAAK,MAAM,KAAK,KAAK;AAE1C,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,SAAS,CAAC;AAAA,IACV,cAAc;AAAA,IACd,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA,6BAA6B;AAAA,IAC7B,cAAc;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,cAAc;AAAA,IACd,GAAG;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,MACH;AAAA,IACF,EAAA,CAAA;AAAA,EAAA;AAIE,QAAA,WAAW,YAAY,MAAM;AAEnC,SACG,qBAAA,OAAA,EAAI,WAAW,QAAQ,UACtB,UAAA;AAAA,IAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,eAAgB,CAAA;AAAA,IACvC,qBAAA,OAAA,EAAI,WAAW,QAAQ,eACrB,UAAA;AAAA,MAAA,cAAc,aAAa;AAAA,MAC3B,YAAY,eAAe,gBAAgB;AAAA,MAC3C,YACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,IAAI,MAAM;AAAA,UACpB,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,QAAQ;AAAA,cACR,IAAI;AAAA,gBACF,UAAU;AAAA,gBACV,WACE,aACA,QAAQ,MAAM,eAAe,MAAM,MAAM,EAAE,MAAM,MAAM,MAAM,EAAE;AAAA,gBACjE,UAAU;AAAA,gBACV,SAAS;AAAA,gBACT,QAAQ;AAAA,cAAA,CACT;AAAA,cACD,kBACE,IAAI;AAAA,gBACF,QAAQ;AAAA,cAAA,CACT;AAAA,cACH,eACE,IAAI;AAAA,gBACF,UAAU;AAAA,gBACV,WAAW;AAAA,gBACX,UAAU;AAAA,gBACV,SAAS;AAAA,cAAA,CACV;AAAA,YACL;AAAA,UACF;AAAA,UACA,QAAQ;AAAA,UACR;AAAA,UACA,aAAa;AAAA,UACb,eAAe;AAAA,UACf,UAAU;AAAA,UACV,QAAQ;AAAA,UACR;AAAA,UACA,YAAU;AAAA,UACV,WAAS;AAAA,UACT;AAAA,UACA,QAAQ;AAAA,UACR;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MACN;AAAA,IAAA,GAEJ;AAAA,IACC,YAAY,cAAc,cAAA,IAAkB;AAAA,EAC/C,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/Dropdown/List/List.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvActionBar } from \"../../ActionBar\";\nimport { useBaseDropdownContext } from \"../../BaseDropdown/BaseDropdownContext/BaseDropdownContext\";\nimport { HvButton } from \"../../Button\";\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps, HvListValue } from \"../../List\";\nimport { HvTypography } from \"../../Typography\";\nimport { setId } from \"../../utils/setId\";\nimport type { HvDropdownLabels } from \"../Dropdown\";\nimport { getSelected } from \"../utils\";\nimport { staticClasses, useClasses } from \"./List.styles\";\n\nexport { staticClasses as dropdownListClasses };\n\nexport type HvDropdownListClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownListProps {\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvDropdownListClasses;\n /**\n * The list to be rendered.\n */\n values?: HvListValue[];\n /**\n * If true renders a multi select list.\n */\n multiSelect?: boolean;\n /**\n * If true renders the search component.\n */\n showSearch?: boolean;\n /**\n * A function to be executed whenever a item is selected in the list\n * or the Apply button is activated (when `multiSelect` is `true`).\n */\n onChange: (\n /** An array containing the selected values */\n listValues: HvListValue[],\n /** If `true` the selection if finally committed the dropdown header text should reflect the new selection */\n commitChanges: boolean,\n /** If `true` the dropdown should toggle it's current state */\n toggle: boolean,\n /** If `true` the dropdown will call onChange */\n notifyChanges: boolean,\n ) => void;\n /**\n * A function to be executed whenever the Cancel button is activated.\n */\n onCancel: (event: React.MouseEvent) => void;\n /**\n * An object containing all the labels for the dropdown.\n */\n labels?: HvDropdownLabels;\n /**\n * If 'true' the dropdown will notify on the first render.\n */\n notifyChangesOnFirstRender?: boolean;\n /**\n * If `true` the dropdown will show tooltips when user mouseenter text in list\n */\n hasTooltips?: boolean;\n /**\n * If `true`, selection can be toggled when single selection.\n */\n singleSelectionToggle?: boolean;\n /**\n * Experimental. Height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class. Required in case virtualized is used\n */\n height?: number;\n /**\n * Experimental. Max height of the dropdown, in case you want to control it from a prop. Styles can also be used through dropdownListContainer class.\n */\n maxHeight?: number;\n /**\n * Experimental. Uses dropdown in a virtualized form, where not all options are rendered initially. Good for use cases with a lot of options.\n */\n virtualized?: boolean;\n}\n\n/**\n * The values property was being deeply cloned. That created a significant performance\n * hit when the values contained complex properties' values, like React Nodes.\n *\n * For minimizing the impact of removing the clone, a shallow clone of the array and its\n * objects is performed instead. That should have the same effect in the majority of the\n * cases, where the properties' values are primitive.\n */\nconst clone = (values: HvListValue[]) => values.map((value) => ({ ...value }));\n\n/**\n * Set all hidden's to false.\n */\nconst cleanHidden = (lst: HvListValue[]) =>\n lst.map((item) => ({ ...item, isHidden: false }));\n\nconst valuesExist = (values: HvListValue[]) =>\n values != null && values?.length > 0;\n\n/** Filter selected ordered element `id`s (or `label`) */\nconst getSelectedIds = (list: HvListValue[]) =>\n getSelected(list).map((item) => item.id || item.label);\n\nexport const HvDropdownList = (props: HvDropdownListProps) => {\n const {\n id,\n classes: classesProp,\n values = [],\n multiSelect = false,\n showSearch = false,\n onChange,\n onCancel,\n labels,\n notifyChangesOnFirstRender = false,\n hasTooltips = false,\n singleSelectionToggle,\n height: heightProp,\n maxHeight,\n virtualized = false,\n ...others\n } = useDefaultProps(\"HvDropdownList\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [list, setList] = useState<HvListValue[]>(clone(values));\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n const { width, height } = useBaseDropdownContext();\n\n const hasChanges = useMemo(() => {\n return String(getSelectedIds(values)) !== String(getSelectedIds(list));\n }, [list, values]);\n\n const newLabels = {\n selectAll: labels?.selectAll,\n selectionConjunction: labels?.multiSelectionConjunction,\n };\n\n /**\n * Update states associated with select all.\n */\n const updateSelectAll = (listValues: HvListValue[]) => {\n if (!listValues) return;\n const nbrSelected = getSelected(listValues).length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === listValues.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n };\n\n /**\n * After the first render, call onChange if notifyChangesOnFirstRender.\n */\n useEffect(() => {\n if (!valuesExist(values)) return;\n setList(clone(values));\n updateSelectAll(values);\n if (notifyChangesOnFirstRender) {\n onChange?.(values, false, false, true);\n }\n }, [values, notifyChangesOnFirstRender, onChange]);\n\n /**\n * Sets the filtered values to the state.\n *\n * @param {String} str - The value that is being looked.\n */\n const handleSearch = (str: string) => {\n const results = list\n ? list.filter(\n ({\n searchValue,\n label,\n value,\n }: {\n searchValue?: any;\n label?: any;\n value?: any;\n }) => {\n let stringValue = \"\";\n if (\n typeof searchValue === \"string\" ||\n searchValue instanceof String\n ) {\n stringValue = searchValue.toLowerCase();\n } else if (typeof label === \"string\" || label instanceof String) {\n stringValue = label.toLowerCase();\n } else if (typeof value === \"string\" || value instanceof String) {\n stringValue = value.toLowerCase();\n }\n\n return stringValue.indexOf(str.toLowerCase()) >= 0;\n },\n )\n : null;\n\n if (results != null) {\n const newList = list.map((elem) => {\n const isResult = results.find((result) => result.label === elem.label);\n return { ...elem, isHidden: !isResult };\n });\n\n setList(newList);\n setSearchStr(str);\n }\n return str;\n };\n\n /**\n * Create search element.\n *\n * @returns {*}\n */\n const renderSearch = () => (\n <div className={classes.searchContainer}>\n <HvInput\n id={setId(id, \"search\")}\n type=\"search\"\n value={searchStr}\n placeholder={labels?.searchPlaceholder}\n aria-label={labels?.searchPlaceholder}\n onChange={(event, str) => handleSearch(str)}\n />\n </div>\n );\n\n /**\n * Select all the values inside the dropdown.\n *\n */\n const handleSelectAll = () => {\n const newList = list.map((elem) => ({ ...elem, selected: !anySelected }));\n setList(newList);\n updateSelectAll(newList);\n };\n\n /**\n * Create selecteAll component.\n *\n * @returns {*}\n */\n const renderSelectAll = () => {\n const selectAll = labels?.selectAll;\n const multiSelectionConjunction = labels?.multiSelectionConjunction;\n const nbrSelected = getSelected(list).length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${multiSelectionConjunction} ${list.length}`}\n </>\n ) : (\n <>\n <b>{selectAll}</b>\n {` (${list.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n classes={{\n container: classes.selection,\n }}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n };\n\n /**\n * When selecting the state list is updated with the corresponding selection.\n *\n * @param listValues - elements selected.\n */\n const onSelection: HvListProps[\"onChange\"] = (listValues) => {\n if (!multiSelect) {\n onChange(cleanHidden(listValues), true, true, true);\n } else {\n updateSelectAll(listValues);\n setList(clone(listValues));\n }\n };\n\n /**\n * Render action buttons.\n */\n const renderActions = () => {\n const applyLabel = labels?.applyLabel;\n const cancelLabel = labels?.cancelLabel;\n return (\n <HvActionBar id={setId(id, \"actions\")}>\n <HvButton\n id={setId(id, \"actions-apply\")}\n disabled={!hasChanges}\n onClick={() => onChange(cleanHidden(list), true, true, true)}\n variant=\"primaryGhost\"\n >\n {applyLabel}\n </HvButton>\n <HvButton\n id={setId(id, \"actions-cancel\")}\n onClick={onCancel}\n variant=\"primaryGhost\"\n >\n {cancelLabel}\n </HvButton>\n </HvActionBar>\n );\n };\n\n const showList = valuesExist(values);\n /** bottom margin + Panel padding + Search size + SelectAll + ActionBar size */\n const elementsSize = theme.spacing(\n 5 + 2 + (showSearch ? 5 : 0) + (showList && multiSelect ? 4 + 6 : 0),\n );\n\n return (\n <div className={classes.rootList}>\n <div className={classes.listBorderDown} />\n <div className={classes.listContainer}>\n {showSearch && renderSearch()}\n {showList && multiSelect && renderSelectAll()}\n {showList && (\n <HvList\n id={setId(id, \"list\")}\n style={mergeStyles(undefined, {\n height: heightProp,\n \"--maxW\": width,\n \"--maxH\": maxHeight ?? `calc(${height}px - ${elementsSize})`,\n })}\n classes={{\n root: cx(classes.dropdownListContainer, {\n [classes.virtualized]: virtualized,\n }),\n }}\n values={list}\n multiSelect={multiSelect}\n useSelector={multiSelect}\n showSelectAll={false}\n onChange={onSelection}\n labels={newLabels}\n hasTooltips={hasTooltips}\n selectable\n condensed\n singleSelectionToggle={singleSelectionToggle}\n height={heightProp}\n virtualized={virtualized}\n {...others}\n />\n )}\n </div>\n {showList && multiSelect ? renderActions() : null}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqGA,MAAM,QAAQ,CAAC,WAA0B,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,MAAQ,EAAA;AAK7E,MAAM,cAAc,CAAC,QACnB,IAAI,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,UAAU,MAAA,EAAQ;AAElD,MAAM,cAAc,CAAC,WACnB,UAAU,QAAQ,QAAQ,SAAS;AAGrC,MAAM,iBAAiB,CAAC,SACtB,YAAY,IAAI,EAAE,IAAI,CAAC,SAAS,KAAK,MAAM,KAAK,KAAK;AAE1C,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,SAAS,CAAC;AAAA,IACV,cAAc;AAAA,IACd,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA,6BAA6B;AAAA,IAC7B,cAAc;AAAA,IACd;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA,cAAc;AAAA,IACd,GAAG;AAAA,EAAA,IACD,gBAAgB,kBAAkB,KAAK;AAC3C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAiB,EAAE;AACrD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAwB,MAAM,MAAM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EAAI,WAAW,QAAQ,UACtB,UAAA;AAAA,IAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,eAAgB,CAAA;AAAA,IACvC,qBAAA,OAAA,EAAI,WAAW,QAAQ,eACrB,UAAA;AAAA,MAAA,cAAc,aAAa;AAAA,MAC3B,YAAY,eAAe,gBAAgB;AAAA,MAC3C,YACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAI,MAAM,IAAI,MAAM;AAAA,UACpB,OAAO,YAAY,QAAW;AAAA,YAC5B,QAAQ;AAAA,YACR,UAAU;AAAA,YACV,UAAU,aAAa,QAAQ,MAAM,QAAQ,YAAY;AAAA,UAAA,CAC1D;AAAA,UACD,SAAS;AAAA,YACP,MAAM,GAAG,QAAQ,uBAAuB;AAAA,cACtC,CAAC,QAAQ,WAAW,GAAG;AAAA,YAAA,CACxB;AAAA,UACH;AAAA,UACA,QAAQ;AAAA,UACR;AAAA,UACA,aAAa;AAAA,UACb,eAAe;AAAA,UACf,UAAU;AAAA,UACV,QAAQ;AAAA,UACR;AAAA,UACA,YAAU;AAAA,UACV,WAAS;AAAA,UACT;AAAA,UACA,QAAQ;AAAA,UACR;AAAA,UACC,GAAG;AAAA,QAAA;AAAA,MACN;AAAA,IAAA,GAEJ;AAAA,IACC,YAAY,cAAc,cAAA,IAAkB;AAAA,EAC/C,EAAA,CAAA;AAEJ;"}
@@ -2,7 +2,19 @@ import { createClasses } from "@hitachivantara/uikit-react-utils";
2
2
  import { theme } from "@hitachivantara/uikit-styles";
3
3
  const { staticClasses, useClasses } = createClasses("HvDropdownList", {
4
4
  rootList: {},
5
- dropdownListContainer: {},
5
+ dropdownListContainer: {
6
+ overflow: "auto",
7
+ padding: 4,
8
+ margin: -4,
9
+ maxWidth: "var(--maxW)",
10
+ maxHeight: "var(--maxH)"
11
+ },
12
+ virtualized: {
13
+ maxWidth: "inherit",
14
+ maxHeight: "inherit",
15
+ overflow: "inherit",
16
+ padding: 0
17
+ },
6
18
  searchContainer: { marginBottom: theme.space.xs },
7
19
  listBorderDown: {},
8
20
  listContainer: { padding: theme.space.sm },
@@ -1 +1 @@
1
- {"version":3,"file":"List.styles.js","sources":["../../../../src/Dropdown/List/List.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdownList\", {\n rootList: {},\n dropdownListContainer: {},\n searchContainer: { marginBottom: theme.space.xs },\n listBorderDown: {},\n listContainer: { padding: theme.space.sm },\n selectAllContainer: {},\n selection: {},\n selectAll: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,UAAU,CAAC;AAAA,EACX,uBAAuB,CAAC;AAAA,EACxB,iBAAiB,EAAE,cAAc,MAAM,MAAM,GAAG;AAAA,EAChD,gBAAgB,CAAC;AAAA,EACjB,eAAe,EAAE,SAAS,MAAM,MAAM,GAAG;AAAA,EACzC,oBAAoB,CAAC;AAAA,EACrB,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AACd,CAAC;"}
1
+ {"version":3,"file":"List.styles.js","sources":["../../../../src/Dropdown/List/List.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdownList\", {\n rootList: {},\n dropdownListContainer: {\n overflow: \"auto\",\n padding: 4,\n margin: -4,\n maxWidth: \"var(--maxW)\",\n maxHeight: \"var(--maxH)\",\n },\n virtualized: {\n maxWidth: \"inherit\",\n maxHeight: \"inherit\",\n overflow: \"inherit\",\n padding: 0,\n },\n searchContainer: { marginBottom: theme.space.xs },\n listBorderDown: {},\n listContainer: { padding: theme.space.sm },\n selectAllContainer: {},\n selection: {},\n selectAll: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,UAAU,CAAC;AAAA,EACX,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,EACb;AAAA,EACA,aAAa;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AAAA,EACA,iBAAiB,EAAE,cAAc,MAAM,MAAM,GAAG;AAAA,EAChD,gBAAgB,CAAC;AAAA,EACjB,eAAe,EAAE,SAAS,MAAM,MAAM,GAAG;AAAA,EACzC,oBAAoB,CAAC;AAAA,EACrB,WAAW,CAAC;AAAA,EACZ,WAAW,CAAC;AACd,CAAC;"}
@@ -9544,10 +9544,11 @@ declare const useClasses_57: (classesProp?: Partial<Record<"label" | "root" | "p
9544
9544
  cx: (...args: any) => string;
9545
9545
  };
9546
9546
 
9547
- declare const useClasses_58: (classesProp?: Partial<Record<"listContainer" | "selection" | "selectAll" | "selectAllContainer" | "dropdownListContainer" | "rootList" | "searchContainer" | "listBorderDown", string>>, addStatic?: boolean) => {
9547
+ declare const useClasses_58: (classesProp?: Partial<Record<"listContainer" | "selection" | "virtualized" | "selectAll" | "selectAllContainer" | "dropdownListContainer" | "rootList" | "searchContainer" | "listBorderDown", string>>, addStatic?: boolean) => {
9548
9548
  classes: {
9549
9549
  listContainer: string;
9550
9550
  selection: string;
9551
+ virtualized: string;
9551
9552
  selectAll: string;
9552
9553
  selectAllContainer: string;
9553
9554
  dropdownListContainer: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.68.0",
3
+ "version": "5.68.1",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Core React components for the NEXT Design System.",
@@ -62,7 +62,7 @@
62
62
  "access": "public",
63
63
  "directory": "package"
64
64
  },
65
- "gitHead": "6a83ea59c8a9709fba4d58125777ef9f30a13f56",
65
+ "gitHead": "e6a4e1b89e4fec6bcebf1a88fcaab0ba41c0bda7",
66
66
  "exports": {
67
67
  ".": {
68
68
  "require": "./dist/cjs/index.cjs",