@hitachivantara/uikit-react-core 5.37.1 → 5.38.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 (72) hide show
  1. package/dist/cjs/components/Calendar/CalendarHeader/CalendarHeader.cjs.map +1 -1
  2. package/dist/cjs/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs.map +1 -1
  3. package/dist/cjs/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.cjs.map +1 -1
  4. package/dist/cjs/components/Calendar/model.cjs.map +1 -1
  5. package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs +11 -3
  6. package/dist/cjs/components/FilterGroup/RightPanel/RightPanel.cjs.map +1 -1
  7. package/dist/cjs/components/Grid/Grid.cjs +38 -17
  8. package/dist/cjs/components/Grid/Grid.cjs.map +1 -1
  9. package/dist/cjs/components/Header/Navigation/MenuBar/Bar.cjs.map +1 -1
  10. package/dist/cjs/components/Header/Navigation/MenuBar/MenuBar.cjs.map +1 -1
  11. package/dist/cjs/components/Header/Navigation/MenuItem/MenuItem.cjs.map +1 -1
  12. package/dist/cjs/components/Input/Input.cjs.map +1 -1
  13. package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.cjs +1 -3
  14. package/dist/cjs/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.cjs.map +1 -1
  15. package/dist/cjs/components/QueryBuilder/QueryBuilder.styles.cjs +4 -5
  16. package/dist/cjs/components/QueryBuilder/QueryBuilder.styles.cjs.map +1 -1
  17. package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs +4 -4
  18. package/dist/cjs/components/QueryBuilder/Rule/Rule.cjs.map +1 -1
  19. package/dist/cjs/components/QueryBuilder/Rule/Rule.styles.cjs +7 -4
  20. package/dist/cjs/components/QueryBuilder/Rule/Rule.styles.cjs.map +1 -1
  21. package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.cjs +3 -5
  22. package/dist/cjs/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.cjs.map +1 -1
  23. package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.cjs +6 -10
  24. package/dist/cjs/components/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.cjs.map +1 -1
  25. package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs +10 -13
  26. package/dist/cjs/components/QueryBuilder/RuleGroup/RuleGroup.cjs.map +1 -1
  27. package/dist/cjs/components/Table/TableBody/TableBody.cjs +1 -1
  28. package/dist/cjs/components/Table/TableBody/TableBody.cjs.map +1 -1
  29. package/dist/cjs/components/Tooltip/Tooltip.cjs +1 -1
  30. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  31. package/dist/cjs/components/Typography/Typography.cjs +7 -0
  32. package/dist/cjs/components/Typography/Typography.cjs.map +1 -1
  33. package/dist/cjs/hooks/useControlled.cjs.map +1 -1
  34. package/dist/cjs/hooks/useImageLoaded.cjs +1 -1
  35. package/dist/cjs/hooks/useImageLoaded.cjs.map +1 -1
  36. package/dist/esm/components/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  37. package/dist/esm/components/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
  38. package/dist/esm/components/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
  39. package/dist/esm/components/Calendar/model.js.map +1 -1
  40. package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js +11 -3
  41. package/dist/esm/components/FilterGroup/RightPanel/RightPanel.js.map +1 -1
  42. package/dist/esm/components/Grid/Grid.js +38 -17
  43. package/dist/esm/components/Grid/Grid.js.map +1 -1
  44. package/dist/esm/components/Header/Navigation/MenuBar/Bar.js.map +1 -1
  45. package/dist/esm/components/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
  46. package/dist/esm/components/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
  47. package/dist/esm/components/Input/Input.js.map +1 -1
  48. package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.js +1 -3
  49. package/dist/esm/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.js.map +1 -1
  50. package/dist/esm/components/QueryBuilder/QueryBuilder.styles.js +4 -5
  51. package/dist/esm/components/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  52. package/dist/esm/components/QueryBuilder/Rule/Rule.js +4 -4
  53. package/dist/esm/components/QueryBuilder/Rule/Rule.js.map +1 -1
  54. package/dist/esm/components/QueryBuilder/Rule/Rule.styles.js +7 -4
  55. package/dist/esm/components/QueryBuilder/Rule/Rule.styles.js.map +1 -1
  56. package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.js +3 -5
  57. package/dist/esm/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.js.map +1 -1
  58. package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.js +6 -10
  59. package/dist/esm/components/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.js.map +1 -1
  60. package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js +10 -13
  61. package/dist/esm/components/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
  62. package/dist/esm/components/Table/TableBody/TableBody.js +1 -1
  63. package/dist/esm/components/Table/TableBody/TableBody.js.map +1 -1
  64. package/dist/esm/components/Tooltip/Tooltip.js +1 -1
  65. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  66. package/dist/esm/components/Typography/Typography.js +7 -0
  67. package/dist/esm/components/Typography/Typography.js.map +1 -1
  68. package/dist/esm/hooks/useControlled.js.map +1 -1
  69. package/dist/esm/hooks/useImageLoaded.js +1 -1
  70. package/dist/esm/hooks/useImageLoaded.js.map +1 -1
  71. package/dist/types/index.d.ts +30 -24
  72. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.js","sources":["../../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Grid as MuiGrid, GridProps as MuiGridProps } from \"@mui/material\";\n\nimport isString from \"lodash/isString\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { staticClasses, useClasses } from \"./Grid.styles\";\n\nexport { staticClasses as gridClasses };\n\nexport type HvGridClasses = ExtractNames<typeof useClasses>;\n\nconst BREAKPOINT_GUTTERS = {\n xs: 2,\n sm: 2,\n md: 4,\n lg: 4,\n xl: 4,\n};\n\nconst BREAKPOINT_COLUMNS = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 12,\n xl: 12,\n};\n\nexport type HvGridDirection =\n | \"row\"\n | \"row-reverse\"\n | \"column\"\n | \"column-reverse\";\n\nexport type HvGridSpacing =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"auto\"\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10;\n\nexport interface HvGridProps\n extends Omit<MuiGridProps, \"classes\" | \"columns\">,\n HvBaseProps<HTMLDivElement, \"color\"> {\n /**\n * If `true`, the component will have the flex *container* behavior.\n * You should be wrapping *items* with a *container*.\n */\n container?: boolean;\n /**\n * If `true`, the component will have the flex *item* behavior.\n * You should be wrapping *items* with a *container*.\n */\n item?: boolean;\n /**\n * Defines the space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n */\n spacing?: HvGridSpacing | number;\n /**\n * Defines the vertical space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n rowSpacing?: HvGridSpacing | number;\n /**\n * Defines the horizontal space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n columnSpacing?: HvGridSpacing | number;\n /**\n * The number of columns.\n * Defaults to a 12-column grid.\n * The value \"auto\" implements the Design System directives in terms of variable number of columns.\n * @default 12\n */\n columns?: \"auto\" | MuiGridProps[\"columns\"];\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n */\n direction?: HvGridDirection;\n /**\n * Defines the `justify-content` style property.\n * It is applied for all screen sizes.\n */\n justify?:\n | \"flex-start\"\n | \"center\"\n | \"flex-end\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for all the screen sizes with the lowest priority.\n */\n xs?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `sm` breakpoint and wider screens if not overridden.\n */\n sm?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `md` breakpoint and wider screens if not overridden.\n */\n md?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `lg` breakpoint and wider screens if not overridden.\n */\n lg?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `xl` breakpoint and wider screens.\n */\n xl?: number | boolean;\n /**\n * Defines the `flex-wrap` style property.\n * It's applied for all screen sizes.\n */\n wrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n /**\n * If `true`, it sets `min-width: 0` on the item.\n * Refer to the limitations section of the documentation to better understand the use case.\n */\n zeroMinWidth?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGridClasses;\n}\n\nfunction getGridSpacing(spacing: HvGridProps[\"spacing\"]) {\n let gridSpacing: MuiGridProps[\"spacing\"];\n\n if (isString(spacing)) {\n if (spacing === \"auto\") {\n gridSpacing = BREAKPOINT_GUTTERS;\n } else {\n gridSpacing = BREAKPOINT_GUTTERS[spacing];\n }\n } else if (typeof spacing === \"object\") {\n gridSpacing = Object.keys(spacing).reduce(\n (acc, breakpoint) => ({\n ...acc,\n [breakpoint]:\n BREAKPOINT_GUTTERS[spacing[breakpoint]] ?? spacing[breakpoint],\n }),\n {}\n );\n } else if (spacing === 0) {\n gridSpacing = { xs: 0 };\n } else {\n gridSpacing = spacing;\n }\n\n return gridSpacing;\n}\n\nfunction getNumberOfColumns(columns: HvGridProps[\"columns\"]) {\n let numberOfColumns: MuiGridProps[\"columns\"];\n\n if (columns === \"auto\") {\n numberOfColumns = BREAKPOINT_COLUMNS;\n } else {\n numberOfColumns = columns;\n }\n\n return numberOfColumns;\n}\n\n/**\n * The grid creates visual consistency between layouts while allowing flexibility\n * across a wide variety of designs. This component is based on a 12-column grid layout.\n *\n * It's based on the [Material UI Grid](https://mui.com/material-ui/react-grid/).\n *\n * The definitions were set following the Design System directives:\n *\n * | Breakpoint | Width (in px) | Gutters (in px) | Number of columns |\n * | ---------- | ------------- | --------------- | ----------------- |\n * | xs | [0-600[ | 16 | 4 |\n * | sm | [600-960[ | 16 | 8 |\n * | md | [960-1270[ | 32 | 12 |\n * | lg | [1270-1920[ | 32 | 12 |\n * | xl | [1920-...[ | 32 | 12 |\n *\n * However, the number of columns is set to 12 for all breakpoints, as it serves most\n * of the use cases and simplifies the implementation.\n * To opt-in to the Design System directives, you can set the `columns` prop to `auto`.\n *\n * Also, the Design System specifications are omissive about the horizontal gutters.\n * The HvGrid sets them to the same value as the vertical gutters, depending on the breakpoint.\n * It can be overridden by setting the `rowSpacing` prop.\n */\nexport const HvGrid = forwardRef<HTMLDivElement, HvGridProps>((props, ref) => {\n const {\n container,\n spacing = \"auto\",\n rowSpacing,\n columnSpacing,\n columns,\n classes: classesProp,\n ...others\n } = useDefaultProps(\"HvGrid\", props);\n\n const { classes } = useClasses(classesProp);\n\n const containerProps: Pick<\n MuiGridProps,\n \"container\" | \"spacing\" | \"rowSpacing\" | \"columnSpacing\" | \"columns\"\n > = {};\n\n if (container) {\n containerProps.container = true;\n\n if (spacing != null) {\n containerProps.spacing = getGridSpacing(spacing);\n }\n if (rowSpacing != null) {\n containerProps.rowSpacing = getGridSpacing(rowSpacing);\n }\n if (columnSpacing != null) {\n containerProps.columnSpacing = getGridSpacing(columnSpacing);\n }\n if (columns != null) {\n containerProps.columns = getNumberOfColumns(columns);\n }\n }\n\n return (\n <MuiGrid ref={ref} classes={classes} {...containerProps} {...others} />\n );\n});\n"],"names":["BREAKPOINT_GUTTERS","xs","sm","md","lg","xl","BREAKPOINT_COLUMNS","getGridSpacing","spacing","gridSpacing","isString","Object","keys","reduce","acc","breakpoint","getNumberOfColumns","columns","numberOfColumns","HvGrid","forwardRef","props","ref","container","rowSpacing","columnSpacing","classes","classesProp","others","useDefaultProps","useClasses","containerProps","MuiGrid"],"mappings":";;;;;;;AAeA,MAAMA,qBAAqB;AAAA,EACzBC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AACN;AAEA,MAAMC,qBAAqB;AAAA,EACzBL,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AACN;AAyHA,SAASE,eAAeC,SAAiC;AACnDC,MAAAA;AAEAC,MAAAA,SAASF,OAAO,GAAG;AACrB,QAAIA,YAAY,QAAQ;AACRR,oBAAAA;AAAAA,IAAAA,OACT;AACLS,oBAAcT,mBAAmBQ,OAAO;AAAA,IAC1C;AAAA,EAAA,WACS,OAAOA,YAAY,UAAU;AACtCC,kBAAcE,OAAOC,KAAKJ,OAAO,EAAEK,OACjC,CAACC,KAAKC,gBAAgB;AAAA,MACpB,GAAGD;AAAAA,MACH,CAACC,UAAU,GACTf,mBAAmBQ,QAAQO,UAAU,CAAC,KAAKP,QAAQO,UAAU;AAAA,IAAA,IAEjE,CACF,CAAA;AAAA,EAAA,WACSP,YAAY,GAAG;AACV,kBAAA;AAAA,MAAEP,IAAI;AAAA,IAAA;AAAA,EAAE,OACjB;AACSO,kBAAAA;AAAAA,EAChB;AAEOC,SAAAA;AACT;AAEA,SAASO,mBAAmBC,SAAiC;AACvDC,MAAAA;AAEJ,MAAID,YAAY,QAAQ;AACJX,sBAAAA;AAAAA,EAAAA,OACb;AACaW,sBAAAA;AAAAA,EACpB;AAEOC,SAAAA;AACT;AA0BO,MAAMC,SAASC,WAAwC,CAACC,OAAOC,QAAQ;AACtE,QAAA;AAAA,IACJC;AAAAA,IACAf,UAAU;AAAA,IACVgB;AAAAA,IACAC;AAAAA,IACAR;AAAAA,IACAS,SAASC;AAAAA,IACT,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,UAAUR,KAAK;AAE7B,QAAA;AAAA,IAAEK;AAAAA,EAAAA,IAAYI,WAAWH,WAAW;AAE1C,QAAMI,iBAGF,CAAA;AAEJ,MAAIR,WAAW;AACbQ,mBAAeR,YAAY;AAE3B,QAAIf,WAAW,MAAM;AACJA,qBAAAA,UAAUD,eAAeC,OAAO;AAAA,IACjD;AACA,QAAIgB,cAAc,MAAM;AACPA,qBAAAA,aAAajB,eAAeiB,UAAU;AAAA,IACvD;AACA,QAAIC,iBAAiB,MAAM;AACVA,qBAAAA,gBAAgBlB,eAAekB,aAAa;AAAA,IAC7D;AACA,QAAIR,WAAW,MAAM;AACJA,qBAAAA,UAAUD,mBAAmBC,OAAO;AAAA,IACrD;AAAA,EACF;AAEA,6BACGe,MAAQ,EAAA,KAAU,SAAsBD,GAAAA,gBAAgB,GAAIH,OAAU,CAAA;AAE3E,CAAC;"}
1
+ {"version":3,"file":"Grid.js","sources":["../../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Grid as MuiGrid, GridProps as MuiGridProps } from \"@mui/material\";\n\nimport isString from \"lodash/isString\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { useDefaultProps, useWidth } from \"@core/hooks\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { staticClasses, useClasses } from \"./Grid.styles\";\n\nexport { staticClasses as gridClasses };\n\nexport type HvGridClasses = ExtractNames<typeof useClasses>;\n\nconst BREAKPOINT_GUTTERS = {\n xs: 2,\n sm: 2,\n md: 4,\n lg: 4,\n xl: 4,\n};\n\nconst BREAKPOINT_COLUMNS = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 12,\n xl: 12,\n};\n\nexport type HvGridDirection =\n | \"row\"\n | \"row-reverse\"\n | \"column\"\n | \"column-reverse\";\n\nexport type HvGridSpacing =\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"auto\"\n | 1\n | 2\n | 3\n | 4\n | 5\n | 6\n | 7\n | 8\n | 9\n | 10;\n\nexport interface HvGridProps\n extends Omit<MuiGridProps, \"classes\" | \"columns\">,\n HvBaseProps<HTMLDivElement, \"color\"> {\n /**\n * If `true`, the component will have the flex *container* behavior.\n * You should be wrapping *items* with a *container*.\n */\n container?: boolean;\n /**\n * If `true`, the component will have the flex *item* behavior.\n * You should be wrapping *items* with a *container*.\n */\n item?: boolean;\n /**\n * Defines the space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n */\n spacing?: HvGridSpacing | number;\n /**\n * Defines the vertical space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n rowSpacing?: HvGridSpacing | number;\n /**\n * Defines the horizontal space between the type item component. It can only be used on a type container component.\n * Based in the 8x factor defined in the theme, it allows the definition of this factor based on the factor\n * (number between 0 and 10), breakpoint or auto.\n * It overrides the value of the spacing prop.\n */\n columnSpacing?: HvGridSpacing | number;\n /**\n * The number of columns.\n * Defaults to a 12-column grid.\n * The value \"auto\" implements the Design System directives in terms of variable number of columns.\n * @default 12\n */\n columns?: \"auto\" | MuiGridProps[\"columns\"];\n /**\n * Defines the `flex-direction` style property.\n * It is applied for all screen sizes.\n */\n direction?: HvGridDirection;\n /**\n * Defines the `justify-content` style property.\n * It is applied for all screen sizes.\n */\n justify?:\n | \"flex-start\"\n | \"center\"\n | \"flex-end\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for all the screen sizes with the lowest priority.\n */\n xs?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `sm` breakpoint and wider screens if not overridden.\n */\n sm?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `md` breakpoint and wider screens if not overridden.\n */\n md?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `lg` breakpoint and wider screens if not overridden.\n */\n lg?: number | boolean;\n /**\n * Defines the number of grids the component is going to use.\n * It's applied for the `xl` breakpoint and wider screens.\n */\n xl?: number | boolean;\n /**\n * Defines the `flex-wrap` style property.\n * It's applied for all screen sizes.\n */\n wrap?: \"nowrap\" | \"wrap\" | \"wrap-reverse\";\n /**\n * If `true`, it sets `min-width: 0` on the item.\n * Refer to the limitations section of the documentation to better understand the use case.\n */\n zeroMinWidth?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvGridClasses;\n}\n\nfunction getGridSpacing(spacing: HvGridProps[\"spacing\"]) {\n let gridSpacing: MuiGridProps[\"spacing\"];\n\n if (isString(spacing)) {\n if (spacing === \"auto\") {\n gridSpacing = BREAKPOINT_GUTTERS;\n } else {\n gridSpacing = BREAKPOINT_GUTTERS[spacing];\n }\n } else if (typeof spacing === \"object\") {\n gridSpacing = Object.keys(spacing).reduce(\n (acc, breakpoint) => ({\n ...acc,\n [breakpoint]:\n BREAKPOINT_GUTTERS[spacing[breakpoint]] ?? spacing[breakpoint],\n }),\n {}\n );\n } else if (spacing === 0) {\n gridSpacing = { xs: 0 };\n } else {\n gridSpacing = spacing;\n }\n\n return gridSpacing;\n}\n\nfunction getNumberOfColumns(columns: HvGridProps[\"columns\"]) {\n let numberOfColumns: MuiGridProps[\"columns\"];\n\n if (columns === \"auto\") {\n numberOfColumns = BREAKPOINT_COLUMNS;\n } else {\n numberOfColumns = columns;\n }\n\n return numberOfColumns;\n}\n\nfunction getContainerProps(\n spacing: HvGridProps[\"spacing\"],\n rowSpacing: HvGridProps[\"rowSpacing\"],\n columnSpacing: HvGridProps[\"columnSpacing\"],\n columns: HvGridProps[\"columns\"]\n) {\n const containerProps: Pick<\n MuiGridProps,\n \"container\" | \"spacing\" | \"rowSpacing\" | \"columnSpacing\" | \"columns\"\n > = { container: true };\n\n if (spacing != null) {\n containerProps.spacing = getGridSpacing(spacing);\n }\n if (rowSpacing != null) {\n containerProps.rowSpacing = getGridSpacing(rowSpacing);\n }\n if (columnSpacing != null) {\n containerProps.columnSpacing = getGridSpacing(columnSpacing);\n }\n if (columns != null) {\n containerProps.columns = getNumberOfColumns(columns);\n }\n\n return containerProps;\n}\n\nconst WidthGrid = forwardRef<HTMLDivElement, HvGridProps>((props, ref) => {\n const { container, spacing, rowSpacing, columnSpacing, columns, ...others } =\n props;\n\n const width = useWidth();\n\n const containerProps = container\n ? getContainerProps(\n spacing === \"auto\" ? width : spacing,\n rowSpacing === \"auto\" ? width : rowSpacing,\n columnSpacing === \"auto\" ? width : columnSpacing,\n columns\n )\n : {};\n\n return <MuiGrid ref={ref} {...containerProps} {...others} />;\n});\n\n/**\n * The grid creates visual consistency between layouts while allowing flexibility\n * across a wide variety of designs. This component is based on a 12-column grid layout.\n *\n * It's based on the [Material UI Grid](https://mui.com/material-ui/react-grid/).\n *\n * The definitions were set following the Design System directives:\n *\n * | Breakpoint | Width (in px) | Gutters (in px) | Number of columns |\n * | ---------- | ------------- | --------------- | ----------------- |\n * | xs | [0-600[ | 16 | 4 |\n * | sm | [600-960[ | 16 | 8 |\n * | md | [960-1270[ | 32 | 12 |\n * | lg | [1270-1920[ | 32 | 12 |\n * | xl | [1920-...[ | 32 | 12 |\n *\n * However, the number of columns is set to 12 for all breakpoints, as it serves most\n * of the use cases and simplifies the implementation.\n * To opt-in to the Design System directives, you can set the `columns` prop to `auto`.\n *\n * Also, the Design System specifications are omissive about the horizontal gutters.\n * The HvGrid sets them to the same value as the vertical gutters, depending on the breakpoint.\n * It can be overridden by setting the `rowSpacing` prop.\n */\nexport const HvGrid = forwardRef<HTMLDivElement, HvGridProps>((props, ref) => {\n const {\n item,\n container,\n spacing = \"auto\",\n rowSpacing,\n columnSpacing,\n columns,\n classes: classesProp,\n ...others\n } = useDefaultProps(\"HvGrid\", props);\n\n const { classes } = useClasses(classesProp);\n\n // Fixes MUI error when using spacings as objects and the grid is an item and container\n // When set to \"auto\", the spacing changes depending on the screen's breakpoint\n // The condition avoids using useWidth and re-rendering the component unnecessarily\n if (\n container &&\n item &&\n (spacing === \"auto\" || rowSpacing === \"auto\" || columnSpacing === \"auto\")\n ) {\n return (\n <WidthGrid\n ref={ref}\n classes={classes}\n item={item}\n container={container}\n spacing={spacing}\n rowSpacing={rowSpacing}\n columnSpacing={columnSpacing}\n columns={columns}\n {...others}\n />\n );\n }\n\n const containerProps = container\n ? getContainerProps(spacing, rowSpacing, columnSpacing, columns)\n : {};\n\n return (\n <MuiGrid\n ref={ref}\n classes={classes}\n item={item}\n {...containerProps}\n {...others}\n />\n );\n});\n"],"names":["BREAKPOINT_GUTTERS","xs","sm","md","lg","xl","BREAKPOINT_COLUMNS","getGridSpacing","spacing","gridSpacing","isString","Object","keys","reduce","acc","breakpoint","getNumberOfColumns","columns","numberOfColumns","getContainerProps","rowSpacing","columnSpacing","containerProps","container","WidthGrid","forwardRef","props","ref","others","width","useWidth","MuiGrid","HvGrid","item","classes","classesProp","useDefaultProps","useClasses"],"mappings":";;;;;;;;AAeA,MAAMA,qBAAqB;AAAA,EACzBC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AACN;AAEA,MAAMC,qBAAqB;AAAA,EACzBL,IAAI;AAAA,EACJC,IAAI;AAAA,EACJC,IAAI;AAA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AWf;AAAAA,IAASY;AAAAA,IAAYC;AAAAA,IAAeJ;AAAAA,IAAS,GAAGW;AAAAA,EACjEF,IAAAA;AAEF,QAAMG,QAAQC;AAEd,QAAMR,iBAAiBC,YACnBJ,kBACEX,YAAY,SAASqB,QAAQrB,SAC7BY,eAAe,SAASS,QAAQT,YAChCC,kBAAkB,SAASQ,QAAQR,eACnCJ,OACF,IACA;AAEJ,6BAAQc,MAAQ,EAAA,KAAU,GAAIT,gBAAoBM,GAAAA,OAAU,CAAA;AAC9D,CAAC;AA0BM,MAAMI,SAASP,WAAwC,CAACC,OAAOC,QAAQ;AACtE,QAAA;AAAA,IACJM;AAAAA,IACAV;AAAAA,IACAf,UAAU;AAAA,IACVY;AAAAA,IACAC;AAAAA,IACAJ;AAAAA,IACAiB,SAASC;AAAAA,IACT,GAAGP;AAAAA,EAAAA,IACDQ,gBAAgB,UAAUV,KAAK;AAE7B,QAAA;AAAA,IAAEQ;AAAAA,EAAAA,IAAYG,WAAWF,WAAW;AAK1C,MACEZ,aACAU,SACCzB,YAAY,UAAUY,eAAe,UAAUC,kBAAkB,SAClE;AAEE,WAAA,oBAAC,WACC,EAAA,KACA,SACA,MACA,WACA,SACA,YACA,eACA,SACA,GAAIO,OACJ,CAAA;AAAA,EAEN;AAEMN,QAAAA,iBAAiBC,YACnBJ,kBAAkBX,SAASY,YAAYC,eAAeJ,OAAO,IAC7D;AAGF,SAAA,oBAACc,QACC,KACA,SACA,MACA,GAAIT,gBACJ,GAAIM,OACJ,CAAA;AAEN,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Bar.js","sources":["../../../../../../src/components/Header/Navigation/MenuBar/Bar.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { SelectionContext } from \"../utils/SelectionContext\";\nimport { staticClasses, useClasses } from \"./Bar.styles\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\n\nexport { staticClasses as headerMenuBarClasses };\n\nexport type HvHeaderMenuBarClasses = ExtractNames<typeof useClasses>;\n\nexport interface BarProps extends HvBaseProps {\n data: HvHeaderNavigationItemProp[];\n type?: string;\n classes?: HvHeaderMenuBarClasses;\n}\n\nexport const Bar = (props: BarProps) => {\n const {\n id,\n data = [],\n type = \"menubar\",\n className,\n children,\n classes: classesProp,\n } = useDefaultProps(\"HvHeaderMenuBarBar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const selectionPath = useContext(SelectionContext);\n\n const isMenu = type === \"menu\";\n\n const isActive =\n isMenu && data.filter((item) => item.id === selectionPath?.[1]).length > 0;\n\n return (\n <div\n className={cx(\n classes.root,\n classes[type],\n {\n [classes.hidden]: isMenu,\n [classes.active]: isActive,\n },\n className\n )}\n >\n <ul className={classes.list} id={id} onFocus={() => {}}>\n {children}\n </ul>\n </div>\n );\n};\n"],"names":["Bar","props","id","data","type","className","children","classes","classesProp","useDefaultProps","cx","useClasses","selectionPath","useContext","SelectionContext","isMenu","isActive","filter","item","length","root","hidden","active","list"],"mappings":";;;;;;AAqBaA,MAAAA,MAAMA,CAACC,UAAoB;AAChC,QAAA;AAAA,IACJC;AAAAA,IACAC,OAAO,CAAE;AAAA,IACTC,OAAO;AAAA,IACPC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,EAAAA,IACPC,gBAAgB,sBAAsBR,KAAK;AACzC,QAAA;AAAA,IAAEM;AAAAA,IAASG;AAAAA,EAAAA,IAAOC,WAAWH,WAAW;AAExCI,QAAAA,gBAAgBC,WAAWC,gBAAgB;AAEjD,QAAMC,SAASX,SAAS;AAElBY,QAAAA,WACJD,UAAUZ,KAAKc,OAAQC,CAAAA,SAASA,KAAKhB,OAAOU,gBAAgB,CAAC,CAAC,EAAEO,SAAS;AAGzE,SAAA,oBAAC,SACC,WAAWT,GACTH,QAAQa,MACRb,QAAQH,IAAI,GACZ;AAAA,IACE,CAACG,QAAQc,MAAM,GAAGN;AAAAA,IAClB,CAACR,QAAQe,MAAM,GAAGN;AAAAA,EACpB,GACAX,SACF,GAEA,UAAC,oBAAA,MAAA,EAAG,WAAWE,QAAQgB,MAAM,IAAQ,SAAS,MAAM;AAAA,EAAA,GACjDjB,UACH,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Bar.js","sources":["../../../../../../src/components/Header/Navigation/MenuBar/Bar.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { SelectionContext } from \"../utils/SelectionContext\";\nimport { staticClasses, useClasses } from \"./Bar.styles\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\n\nexport { staticClasses as headerMenuBarClasses };\n\nexport type HvHeaderMenuBarClasses = ExtractNames<typeof useClasses>;\n\nexport interface BarProps extends HvBaseProps {\n data: HvHeaderNavigationItemProp[];\n type?: \"menubar\" | \"menu\";\n classes?: HvHeaderMenuBarClasses;\n}\n\nexport const Bar = (props: BarProps) => {\n const {\n id,\n data = [],\n type = \"menubar\",\n className,\n children,\n classes: classesProp,\n } = useDefaultProps(\"HvHeaderMenuBarBar\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const selectionPath = useContext(SelectionContext);\n\n const isMenu = type === \"menu\";\n\n const isActive =\n isMenu && data.filter((item) => item.id === selectionPath?.[1]).length > 0;\n\n return (\n <div\n className={cx(\n classes.root,\n classes[type],\n {\n [classes.hidden]: isMenu,\n [classes.active]: isActive,\n },\n className\n )}\n >\n <ul className={classes.list} id={id} onFocus={() => {}}>\n {children}\n </ul>\n </div>\n );\n};\n"],"names":["Bar","props","id","data","type","className","children","classes","classesProp","useDefaultProps","cx","useClasses","selectionPath","useContext","SelectionContext","isMenu","isActive","filter","item","length","root","hidden","active","list"],"mappings":";;;;;;AAqBaA,MAAAA,MAAMA,CAACC,UAAoB;AAChC,QAAA;AAAA,IACJC;AAAAA,IACAC,OAAO,CAAE;AAAA,IACTC,OAAO;AAAA,IACPC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,EAAAA,IACPC,gBAAgB,sBAAsBR,KAAK;AACzC,QAAA;AAAA,IAAEM;AAAAA,IAASG;AAAAA,EAAAA,IAAOC,WAAWH,WAAW;AAExCI,QAAAA,gBAAgBC,WAAWC,gBAAgB;AAEjD,QAAMC,SAASX,SAAS;AAElBY,QAAAA,WACJD,UAAUZ,KAAKc,OAAQC,CAAAA,SAASA,KAAKhB,OAAOU,gBAAgB,CAAC,CAAC,EAAEO,SAAS;AAGzE,SAAA,oBAAC,SACC,WAAWT,GACTH,QAAQa,MACRb,QAAQH,IAAI,GACZ;AAAA,IACE,CAACG,QAAQc,MAAM,GAAGN;AAAAA,IAClB,CAACR,QAAQe,MAAM,GAAGN;AAAAA,EACpB,GACAX,SACF,GAEA,UAAC,oBAAA,MAAA,EAAG,WAAWE,QAAQgB,MAAM,IAAQ,SAAS,MAAM;AAAA,EAAA,GACjDjB,UACH,EACF,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuBar.js","sources":["../../../../../../src/components/Header/Navigation/MenuBar/MenuBar.tsx"],"sourcesContent":["import { MouseEvent } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { HvHeaderMenuItem } from \"../MenuItem\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\nimport { Bar, HvHeaderMenuBarClasses } from \"./Bar\";\n\nexport interface HvHeaderMenuBarProps\n extends HvBaseProps<HTMLDivElement, \"onClick\"> {\n data: HvHeaderNavigationItemProp[];\n type: string;\n onClick?: (event: MouseEvent, selection: HvHeaderNavigationItemProp) => void;\n levels: number;\n currentLevel: number;\n classes?: HvHeaderMenuBarClasses;\n}\n\nexport const HvHeaderMenuBar = (props: HvHeaderMenuBarProps) => {\n const {\n data = [],\n onClick,\n type = \"menubar\",\n levels,\n currentLevel,\n classes,\n ...others\n } = useDefaultProps(\"HvHeaderMenuBar\", props);\n return (\n <Bar data={data} type={type} classes={classes} {...others}>\n {data.map((item: HvHeaderNavigationItemProp) => (\n <HvHeaderMenuItem\n key={item.id}\n item={item}\n type={type}\n onClick={onClick}\n levels={levels}\n currentLevel={currentLevel}\n />\n ))}\n </Bar>\n );\n};\n"],"names":["HvHeaderMenuBar","props","data","onClick","type","levels","currentLevel","classes","others","useDefaultProps","map","item","id"],"mappings":";;;;AAoBaA,MAAAA,kBAAkBA,CAACC,UAAgC;AACxD,QAAA;AAAA,IACJC,OAAO,CAAE;AAAA,IACTC;AAAAA,IACAC,OAAO;AAAA,IACPC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,mBAAmBR,KAAK;AAE1C,SAAA,oBAAC,OAAI,MAAY,MAAY,SAAsBO,GAAAA,QAChDN,eAAKQ,IAAI,CAACC,SACR,oBAAA,kBAAA,EAEC,MACA,MACA,SACA,QACA,aALKA,GAAAA,KAAKC,EAKiB,CAE9B,EACH,CAAA;AAEJ;"}
1
+ {"version":3,"file":"MenuBar.js","sources":["../../../../../../src/components/Header/Navigation/MenuBar/MenuBar.tsx"],"sourcesContent":["import { MouseEvent } from \"react\";\n\nimport { HvBaseProps } from \"@core/types/generic\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { HvHeaderMenuItem } from \"../MenuItem\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\nimport { Bar, BarProps, HvHeaderMenuBarClasses } from \"./Bar\";\n\nexport interface HvHeaderMenuBarProps\n extends HvBaseProps<HTMLDivElement, \"onClick\"> {\n data: HvHeaderNavigationItemProp[];\n type?: BarProps[\"type\"];\n onClick?: (event: MouseEvent, selection: HvHeaderNavigationItemProp) => void;\n levels: number;\n currentLevel: number;\n classes?: HvHeaderMenuBarClasses;\n}\n\nexport const HvHeaderMenuBar = (props: HvHeaderMenuBarProps) => {\n const {\n data = [],\n onClick,\n type = \"menubar\",\n levels,\n currentLevel,\n classes,\n ...others\n } = useDefaultProps(\"HvHeaderMenuBar\", props);\n return (\n <Bar data={data} type={type} classes={classes} {...others}>\n {data.map((item: HvHeaderNavigationItemProp) => (\n <HvHeaderMenuItem\n key={item.id}\n item={item}\n type={type}\n onClick={onClick}\n levels={levels}\n currentLevel={currentLevel}\n />\n ))}\n </Bar>\n );\n};\n"],"names":["HvHeaderMenuBar","props","data","onClick","type","levels","currentLevel","classes","others","useDefaultProps","map","item","id"],"mappings":";;;;AAoBaA,MAAAA,kBAAkBA,CAACC,UAAgC;AACxD,QAAA;AAAA,IACJC,OAAO,CAAE;AAAA,IACTC;AAAAA,IACAC,OAAO;AAAA,IACPC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDC,gBAAgB,mBAAmBR,KAAK;AAE1C,SAAA,oBAAC,OAAI,MAAY,MAAY,SAAsBO,GAAAA,QAChDN,eAAKQ,IAAI,CAACC,SACR,oBAAA,kBAAA,EAEC,MACA,MACA,SACA,QACA,aALKA,GAAAA,KAAKC,EAKiB,CAE9B,EACH,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","sources":["../../../../../../src/components/Header/Navigation/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { MouseEvent, useContext } from \"react\";\n\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { isKey } from \"@core/utils/keyboardUtils\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { FocusContext } from \"../utils/FocusContext\";\nimport { SelectionContext } from \"../utils/SelectionContext\";\nimport { useClasses, staticClasses } from \"./MenuItem.styles\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\nimport { Bar } from \"../MenuBar/Bar\";\n\nexport { staticClasses as headerMenuItemClasses };\n\nexport type HvHeaderMenuItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvHeaderMenuItemProps\n extends HvBaseProps<HTMLDivElement, \"onClick\"> {\n item: HvHeaderNavigationItemProp;\n type?: string;\n onClick?: (event: MouseEvent, selection: HvHeaderNavigationItemProp) => void;\n levels: number;\n currentLevel: number;\n classes?: HvHeaderMenuItemClasses;\n}\n\n// Traverse the tree of items and return the first href it finds\nconst traverseItem = (node: HvHeaderNavigationItemProp) => {\n let href;\n let target;\n\n if (node?.href) {\n href = node?.href;\n target = node?.target;\n } else if (node?.data != null && node?.data?.length > 0) {\n let i = 0;\n while (href == null && i < node.data.length) {\n const childNavItem = traverseItem(node?.data[i]);\n if (childNavItem?.href != null) {\n href = childNavItem?.href;\n target = childNavItem?.target;\n break;\n }\n\n i += 1;\n }\n }\n\n return { href, target };\n};\n\nexport const HvHeaderMenuItem = (props: HvHeaderMenuItemProps) => {\n const {\n id,\n item,\n type,\n onClick,\n levels,\n currentLevel,\n classes: classesProp,\n className,\n } = useDefaultProps(\"HvHeaderMenuItem\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const selectionPath = useContext(SelectionContext);\n\n const { dispatch } = useContext(FocusContext);\n\n const { data } = item;\n\n const hasSubLevel = data && data.length;\n\n const isMenu = type === \"menu\";\n\n const isSelected = selectionPath?.[isMenu ? 1 : 0] === item.id;\n\n // true: if the item is part of the selection path but is not the current page the user is seeing, i.e has more sub levels\n // page: used when the selected item is actually the current page the user is seeing\n const isCurrent = isSelected ? (hasSubLevel ? true : \"page\") : undefined;\n\n const actionHandler = (event: any) => {\n if (\n event.type === \"click\" ||\n isKey(event, \"Enter\") ||\n isKey(event, \"Space\")\n ) {\n if (event.type === \"click\") {\n event.currentTarget.blur();\n }\n\n onClick?.(event, item);\n }\n };\n\n const handleFocus = (event: React.FocusEvent) => {\n dispatch?.({ type: \"setItemFocused\", itemFocused: event.currentTarget });\n };\n\n const itemProps = {\n onClick: actionHandler,\n onKeyDown: actionHandler,\n onFocus: handleFocus,\n };\n\n const label = (\n <HvTypography\n component=\"span\"\n variant={isSelected ? \"label\" : \"body\"}\n data-text={item.label}\n >\n {item.label}\n </HvTypography>\n );\n\n let itemHref = item?.href;\n let itemTarget = item?.target;\n\n // apps should configure the href even on parent items without content\n // so the fallback logic is theirs, but if not we'll do our best to find a link\n if (item?.href == null) {\n const { href, target } = traverseItem(item);\n itemHref = href;\n itemTarget = target;\n }\n\n return (\n <li\n id={id}\n key={item.label}\n className={cx(\n classes.root,\n {\n [classes.menu]: isMenu,\n [classes.menubar]: !isMenu,\n [classes.selected]: !!isSelected,\n },\n className\n )}\n >\n {itemHref ? (\n <a\n className={classes.link}\n href={itemHref}\n target={itemTarget}\n {...itemProps}\n aria-current={isCurrent}\n // Fix for a possible bug in playwright where, even though hidden from screen readers and not appearing in the accessibility\n // tree, due to the styling duplication (span::after - using 'data-text'), locators have to double the name.\n aria-label={item.label}\n >\n {label}\n </a>\n ) : (\n // keeping this code path for backwards compatibility, but\n // shouldn't really be used as it's not accessible\n <div\n className={classes.button}\n role=\"button\"\n {...itemProps}\n tabIndex={0}\n aria-current={isCurrent}\n >\n {label}\n </div>\n )}\n {/* Limits levels to no more than 2. More than that is not expected and not in DS. */}\n {hasSubLevel && currentLevel < levels && currentLevel < 2 && (\n <Bar data={data} type=\"menu\">\n {data.map((itm: HvHeaderNavigationItemProp) => (\n <HvHeaderMenuItem\n key={itm.id}\n item={itm}\n type=\"menu\"\n onClick={onClick}\n levels={levels}\n currentLevel={currentLevel + 1}\n />\n ))}\n </Bar>\n )}\n </li>\n );\n};\n"],"names":["traverseItem","node","href","target","data","length","i","childNavItem","HvHeaderMenuItem","props","id","item","type","onClick","levels","currentLevel","classes","classesProp","className","useDefaultProps","cx","useClasses","selectionPath","useContext","SelectionContext","dispatch","FocusContext","hasSubLevel","isMenu","isSelected","isCurrent","undefined","actionHandler","event","isKey","currentTarget","blur","handleFocus","itemFocused","itemProps","onKeyDown","onFocus","label","itemH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AA;AAAA;AAAA,MAIC,oBAAA,OAAA,EACC,WAAW1B,QAAQkC,QACnB,MAAK,UACDX,GAAAA,WACJ,UAAU,GACV,gBAAcT,WAEbY,UACH,OAAA;AAAA;AAAA,IAGDf,eAAeZ,eAAeD,UAAUC,eAAe,KACtD,oBAAC,KAAI,EAAA,MAAY,MAAK,QACnBX,UAAK+C,KAAAA,IAAI,CAACC,QACR,oBAAA,kBAAA,EAEC,MAAMA,KACN,MAAK,QACL,SACA,QACA,cAAcrC,eAAe,EALxBqC,GAAAA,IAAI1C,EAKsB,CAElC,EACH,CAAA;AAAA,EAAA,KAlDGC,KAAK+B,KAoDZ;AAEJ;"}
1
+ {"version":3,"file":"MenuItem.js","sources":["../../../../../../src/components/Header/Navigation/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { MouseEvent, useContext } from \"react\";\n\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvBaseProps } from \"@core/types/generic\";\nimport { isKey } from \"@core/utils/keyboardUtils\";\nimport { ExtractNames } from \"@core/utils/classes\";\n\nimport { useDefaultProps } from \"@core/hooks\";\n\nimport { FocusContext } from \"../utils/FocusContext\";\nimport { SelectionContext } from \"../utils/SelectionContext\";\nimport { useClasses, staticClasses } from \"./MenuItem.styles\";\nimport { HvHeaderNavigationItemProp } from \"../useSelectionPath\";\nimport { Bar } from \"../MenuBar/Bar\";\n\nexport { staticClasses as headerMenuItemClasses };\n\nexport type HvHeaderMenuItemClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvHeaderMenuItemProps\n extends HvBaseProps<HTMLDivElement, \"onClick\"> {\n item: HvHeaderNavigationItemProp;\n type?: string;\n onClick?: (event: MouseEvent, selection: HvHeaderNavigationItemProp) => void;\n levels: number;\n currentLevel: number;\n classes?: HvHeaderMenuItemClasses;\n}\n\n// Traverse the tree of items and return the first href it finds\nconst traverseItem = (\n node: HvHeaderNavigationItemProp\n): { href?: string; target?: string } => {\n let href: string | undefined;\n let target: string | undefined;\n\n if (node?.href) {\n href = node?.href;\n target = node?.target;\n } else if (node?.data != null && node?.data?.length > 0) {\n let i = 0;\n while (href == null && i < node.data.length) {\n const childNavItem = traverseItem(node?.data[i]);\n if (childNavItem?.href != null) {\n href = childNavItem?.href;\n target = childNavItem?.target;\n break;\n }\n\n i += 1;\n }\n }\n\n return { href, target };\n};\n\nexport const HvHeaderMenuItem = (props: HvHeaderMenuItemProps) => {\n const {\n id,\n item,\n type,\n onClick,\n levels,\n currentLevel,\n classes: classesProp,\n className,\n } = useDefaultProps(\"HvHeaderMenuItem\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const selectionPath = useContext(SelectionContext);\n\n const { dispatch } = useContext(FocusContext);\n\n const { data } = item;\n\n const hasSubLevel = data && data.length;\n\n const isMenu = type === \"menu\";\n\n const isSelected = selectionPath?.[isMenu ? 1 : 0] === item.id;\n\n // true: if the item is part of the selection path but is not the current page the user is seeing, i.e has more sub levels\n // page: used when the selected item is actually the current page the user is seeing\n const isCurrent = isSelected ? (hasSubLevel ? true : \"page\") : undefined;\n\n const actionHandler = (event: any) => {\n if (\n event.type === \"click\" ||\n isKey(event, \"Enter\") ||\n isKey(event, \"Space\")\n ) {\n if (event.type === \"click\") {\n event.currentTarget.blur();\n }\n\n onClick?.(event, item);\n }\n };\n\n const handleFocus = (event: React.FocusEvent) => {\n dispatch?.({ type: \"setItemFocused\", itemFocused: event.currentTarget });\n };\n\n const itemProps = {\n onClick: actionHandler,\n onKeyDown: actionHandler,\n onFocus: handleFocus,\n };\n\n const label = (\n <HvTypography\n component=\"span\"\n variant={isSelected ? \"label\" : \"body\"}\n data-text={item.label}\n >\n {item.label}\n </HvTypography>\n );\n\n let itemHref = item?.href;\n let itemTarget = item?.target;\n\n // apps should configure the href even on parent items without content\n // so the fallback logic is theirs, but if not we'll do our best to find a link\n if (item?.href == null) {\n const { href, target } = traverseItem(item);\n itemHref = href;\n itemTarget = target;\n }\n\n return (\n <li\n id={id}\n key={item.label}\n className={cx(\n classes.root,\n {\n [classes.menu]: isMenu,\n [classes.menubar]: !isMenu,\n [classes.selected]: !!isSelected,\n },\n className\n )}\n >\n {itemHref ? (\n <a\n className={classes.link}\n href={itemHref}\n target={itemTarget}\n {...itemProps}\n aria-current={isCurrent}\n // Fix for a possible bug in playwright where, even though hidden from screen readers and not appearing in the accessibility\n // tree, due to the styling duplication (span::after - using 'data-text'), locators have to double the name.\n aria-label={item.label}\n >\n {label}\n </a>\n ) : (\n // keeping this code path for backwards compatibility, but\n // shouldn't really be used as it's not accessible\n <div\n className={classes.button}\n role=\"button\"\n {...itemProps}\n tabIndex={0}\n aria-current={isCurrent}\n >\n {label}\n </div>\n )}\n {/* Limits levels to no more than 2. More than that is not expected and not in DS. */}\n {hasSubLevel && currentLevel < levels && currentLevel < 2 && (\n <Bar data={data} type=\"menu\">\n {data.map((itm: HvHeaderNavigationItemProp) => (\n <HvHeaderMenuItem\n key={itm.id}\n item={itm}\n type=\"menu\"\n onClick={onClick}\n levels={levels}\n currentLevel={currentLevel + 1}\n />\n ))}\n </Bar>\n )}\n </li>\n );\n};\n"],"names":["traverseItem","node","href","target","data","length","i","childNavItem","HvHeaderMenuItem","props","id","item","type","onClick","levels","currentLevel","classes","classesProp","className","useDefaultProps","cx","useClasses","selectionPath","useContext","SelectionContext","dispatch","FocusContext","hasSubLevel","isMenu","isSelected","isCurrent","undefined","actionHandler","event","isKey","currentTarget","blur","handleFocus","itemFocused","itemProps","onKeyDown","onFocus","label","itemHref","itemTarget","root","menu","menubar","selected","link","button","map","itm"],"mappings":";;;;;;;;;;AA8BA,MAAMA,eAAeA,CACnBC,SACuC;AACnCC,MAAAA;AACAC,MAAAA;AAEJ,MAAIF,MAAMC,MAAM;AACdA,WAAOD,MAAMC;AACbC,aAASF,MAAME;AAAAA,EAAAA,WACNF,MAAMG,QAAQ,QAAQH,MAAMG,MAAMC,SAAS,GAAG;AACvD,QAAIC,IAAI;AACR,WAAOJ,QAAQ,QAAQI,IAAIL,KAAKG,KAAKC,QAAQ;AAC3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,IAAI1C,EAKsB,CAElC,EACH,CAAA;AAAA,EAAA,KAlDGC,KAAK+B,KAoDZ;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, {\n HTMLInputTypeAttribute,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n InputBaseComponentProps as MuiInputBaseComponentProps,\n useForkRef,\n} from \"@mui/material\";\n\nimport {\n CloseXS,\n PreviewOff,\n Preview,\n Search,\n Success,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { isBrowser } from \"@core/utils/browser\";\nimport { isKey } from \"@core/utils/keyboardUtils\";\nimport { setId } from \"@core/utils/setId\";\nimport {\n HvInputLabels,\n HvInputSuggestion,\n HvValidationMessages,\n} from \"@core/types/forms\";\nimport { HvBaseProps, HvExtraProps } from \"@core/types/generic\";\nimport {\n HvAdornment,\n HvAdornmentProps,\n HvFormElement,\n HvFormElementProps,\n HvFormStatus,\n HvInfoMessage,\n HvLabel,\n HvSuggestion,\n HvSuggestions,\n HvSuggestionsProps,\n HvWarningText,\n isValid,\n isInvalid,\n} from \"@core/components/Forms\";\nimport validationStates from \"@core/components/Forms/FormElement/validationStates\";\nimport { HvBaseInput, HvBaseInputProps } from \"@core/components/BaseInput\";\nimport {\n DEFAULT_ERROR_MESSAGES,\n computeValidationType,\n hasBuiltInValidations,\n validateInput,\n computeValidationState,\n computeValidationMessage,\n HvInputValidity,\n} from \"@core/components/BaseInput/validations\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { useControlled } from \"@core/hooks/useControlled\";\nimport { useIsMounted } from \"@core/hooks/useIsMounted\";\nimport { useUniqueId } from \"@core/hooks/useUniqueId\";\nimport { useLabels } from \"@core/hooks/useLabels\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { staticClasses, useClasses } from \"./Input.styles\";\n\nexport { staticClasses as inputClasses };\n\nexport type HvInputClasses = ExtractNames<typeof useClasses>;\n\ntype InputElement = HTMLInputElement | HTMLTextAreaElement;\n\nexport interface HvInputProps\n extends HvBaseProps<\n HTMLElement,\n \"onChange\" | \"onBlur\" | \"onFocus\" | \"onKeyDown\" | \"color\"\n > {\n /** The form element name. */\n name?: string;\n /** The value of the form element. */\n value?: string;\n /** When uncontrolled, defines the initial input value. */\n defaultValue?: string;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** Indicates that the form element is not editable. */\n readOnly?: boolean;\n /** Indicates that user input is required on the form element. */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /**\n * The function that will be executed onChange, allows modification of the input,\n * it receives the value. If a new value should be presented it must returned it.\n */\n onChange?: HvBaseInputProps[\"onChange\"];\n /**\n * Callback called when the user submits the value by pressing Enter/Return.\n *\n * Also called when the search button is clicked (when type is \"search\").\n */\n onEnter?: (\n event: React.KeyboardEvent<InputElement> | React.MouseEvent,\n value: string\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the validation state,\n * it receives the value and the validation state.\n */\n onBlur?: (\n event: React.FocusEvent<InputElement>,\n value: string,\n validationState: HvInputValidity\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (event: React.FocusEvent<InputElement>, value: string) => void;\n /**\n * The function that will be executed onKeyDown, allows checking the value state,\n * it receives the event and value.\n */\n onKeyDown?: (\n event: React.KeyboardEvent<InputElement> | React.MouseEvent,\n value: string\n ) => void;\n /** The input type. */\n type?: HTMLInputTypeAttribute;\n /** The placeholder value of the input. */\n placeholder?: string;\n /** Internal labels?. */\n labels?: HvInputLabels & HvExtraProps;\n /** An Object containing the various texts associated with the input. */\n validationMessages?: HvValidationMessages;\n /** Attributes applied to the input element. */\n inputProps?: MuiInputBaseComponentProps;\n /**\n * Allows passing a ref to the underlying input\n * @deprecated Use `ref` directly instead\n * */\n inputRef?: HvBaseInputProps[\"inputRef\"];\n /** The function that will be executed to received an array of objects that has a label and id to create list of suggestion */\n suggestionListCallback?: (value: string) => HvInputSuggestion[] | null;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /** If `true` it should autofocus. */\n autoFocus?: boolean;\n /** If `true` the clear button is disabled. */\n disableClear?: boolean;\n /** If `true` the reveal password button is disabled. Valid only when type is \"password\". */\n disableRevealPassword?: boolean;\n /** If `true` the search button is disabled. Valid only when type is \"search\". */\n disableSearchButton?: boolean;\n /**\n * If `true` the validation icon adornment is visible. Defaults to `false`.\n *\n * Currently, DS specifications define only a positive feedback icon;\n * errors are signaled through the border style and by displaying the error message.\n */\n showValidationIcon?: boolean;\n /** A custom icon to be added into the input. */\n endAdornment?: React.ReactNode;\n /** The maximum allowed length of the characters, if this value is null no check will be performed. */\n maxCharQuantity?: number;\n /** The minimum allowed length of the characters, if this value is null no check will be perform. */\n minCharQuantity?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInputClasses;\n}\n\nconst DEFAULT_LABELS = {\n clearButtonLabel: \"Clear the text\",\n revealPasswordButtonLabel: \"Reveal password\",\n revealPasswordButtonClickToShowTooltip: \"Click to show password.\",\n revealPasswordButtonClickToHideTooltip: \"Click to hide password.\",\n searchButtonLabel: \"Search\",\n};\n\n/**\n * Find the focused element onBlur.\n */\nconst getFocusedElement = (event) =>\n isBrowser(\"ie\") ? document.activeElement : event.relatedTarget;\n\nfunction eventTargetIsInsideContainer(container, event) {\n return container != null && container.contains(getFocusedElement(event));\n}\n\n/** Changes a given `input`'s `value`, triggering its `onChange` */\nconst changeInputValue = (input: HTMLInputElement | null, value = \"\") => {\n const event = new Event(\"input\", { bubbles: true });\n\n /** Original `input.value` setter (React overrides it). */\n const setInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n \"value\"\n )?.set;\n\n setInputValue?.call(input, value);\n input?.dispatchEvent(event);\n};\n\n/**\n * A text input box is a graphical control element intended to enable the user to input text information to be used by the software.\n */\nexport const HvInput = forwardRef<InputElement, HvInputProps>((props, ref) => {\n const {\n classes: classesProp,\n className,\n id,\n name,\n value: valueProp,\n defaultValue = \"\",\n required = false,\n readOnly = false,\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n onChange,\n onEnter,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n type = \"text\",\n placeholder,\n autoFocus = false,\n labels: labelsProp,\n validationMessages,\n disableClear = false,\n disableRevealPassword = false,\n disableSearchButton = false,\n endAdornment,\n maxCharQuantity,\n minCharQuantity,\n validation,\n showValidationIcon = false,\n suggestionListCallback,\n inputRef: inputRefProp,\n onBlur,\n onFocus,\n onKeyDown,\n inputProps = {},\n ...others\n } = useDefaultProps(\"HvInput\", props);\n const { classes, cx } = useClasses(classesProp);\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const elementId = useUniqueId(id, \"hvinput\");\n\n const inputRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, inputRef, inputRefProp);\n const suggestionsRef = useRef<HTMLElement>(null);\n\n const [focused, setFocused] = useState(false);\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef(false);\n\n // Value related state\n const [value, setValue] = useControlled(valueProp, defaultValue);\n\n const isEmptyValue = value == null || value === \"\";\n\n // Validation related state\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\"\n );\n\n // validationMessages reference tends to change, as users will not memoize/useState for it;\n // dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n validationMessages?.typeMismatchError,\n ]\n );\n\n const validationType = useMemo(() => computeValidationType(type), [type]);\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n value,\n required,\n minCharQuantity,\n maxCharQuantity,\n validationType,\n validation\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages)\n );\n\n return inputValidity;\n }, [\n errorMessages,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n validationType,\n value,\n ]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationType,\n minCharQuantity,\n maxCharQuantity,\n validation,\n inputProps\n )));\n\n const isStateInvalid = isInvalid(validationState);\n\n // Input type related state\n const [revealPassword, setRevealPassword] = useState(false);\n\n const realType = useMemo(() => {\n if (type === \"password\") {\n return revealPassword ? \"text\" : \"password\";\n }\n\n if (type === \"search\") {\n return \"search\";\n }\n\n return \"text\";\n }, [revealPassword, type]);\n\n // Suggestions related state\n const [suggestionValues, setSuggestionValues] = useState<\n HvSuggestion[] | null\n >(null);\n\n const canShowSuggestions = suggestionListCallback != null;\n const hasSuggestions = !!suggestionValues;\n\n // Miscellaneous state\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n /**\n * Looks for the node that represent the input inside the material tree and focus it.\n */\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n const isMounted = useIsMounted();\n\n /**\n * Clears the suggestion array.\n */\n const suggestionClearHandler = () => {\n if (isMounted.current) {\n setSuggestionValues(null);\n }\n };\n\n /**\n * Fills of the suggestion array.\n */\n const suggestionHandler = (val: string) => {\n const suggestionsArray = suggestionListCallback?.(val);\n if (suggestionsArray?.[0]?.label) {\n setSuggestionValues(suggestionsArray);\n } else {\n suggestionClearHandler();\n }\n };\n\n /**\n * Executes the user callback adds the selection to the state and clears the suggestions.\n */\n const suggestionSelectedHandler = (event, item) => {\n const newValue = item.value || item.label;\n\n changeInputValue(inputRef.current, newValue);\n\n focusInput();\n suggestionClearHandler();\n\n if (type === \"search\") {\n // trigger the onEnter callback when the user selects an option in a search box\n onEnter?.(event, newValue);\n }\n };\n\n const onChangeHandler: HvBaseInputProps[\"onChange\"] = (event, newValue) => {\n isDirty.current = true;\n\n // set the input value (only when value is uncontrolled)\n setValue(newValue);\n\n onChange?.(event, newValue);\n\n if (canShowSuggestions) {\n // an edge case might be a controlled input whose onChange callback\n // doesn't change the value (or sets another): the suggestionListCallback\n // callback will still receive the original rejected value.\n // a refactor is needed so the suggestionListCallback might be called only\n // when the input is uncontrolled, providing a way to externally control\n // the suggestion values.\n suggestionHandler(newValue);\n }\n };\n\n /**\n * Validates the input updating the state and modifying the info text, also executes\n * the user provided onBlur passing the current validation status and value.\n */\n const onInputBlurHandler: HvBaseInputProps[\"onBlur\"] = (event) => {\n // If the blur is executed when choosing an suggestion it should be ignored.\n if (eventTargetIsInsideContainer(suggestionsRef.current, event)) return;\n\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event, value, inputValidity);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler: HvBaseInputProps[\"onFocus\"] = (event) => {\n setFocused(true);\n\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event, value);\n };\n\n const getSuggestions = (li: number | null) => {\n // TODO Replace with ref\n const listEl = document.getElementById(\n setId(elementId, \"suggestions-list\") || \"\"\n );\n return li != null ? listEl?.getElementsByTagName(\"li\")?.[li] : listEl;\n };\n\n const onSuggestionKeyDown: HvSuggestionsProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Esc\")) {\n suggestionClearHandler();\n focusInput();\n } else if (isKey(event, \"Tab\")) {\n suggestionClearHandler();\n }\n };\n\n /** Focus the suggestion list when the arrow down is pressed. */\n const onKeyDownHandler: HvBaseInputProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"ArrowDown\") && hasSuggestions) {\n const li = getSuggestions(0);\n li?.focus();\n } else if (isKey(event, \"Enter\")) {\n onEnter?.(event, value);\n }\n\n onKeyDown?.(event, value);\n };\n\n /** Clears the suggestion list on blur. */\n const onContainerBlurHandler: HvFormElementProps[\"onBlur\"] = (event) => {\n if (event.relatedTarget) {\n setTimeout(() => {\n const list = getSuggestions(null);\n if (!list?.contains(document.activeElement)) suggestionClearHandler();\n }, 10);\n }\n };\n\n const hasOnEnter = onEnter != null;\n\n // show the clear button only if the input is enabled, not read-only, disableClear is false and the input is not empty\n // also, don't show it when the input type is \"search\" and the input is active (standBy)\n const showClear =\n !disabled &&\n !readOnly &&\n !disableClear &&\n !isEmptyValue &&\n (!hasOnEnter ||\n type !== \"search\" ||\n disableSearchButton ||\n validationState !== validationStates.standBy);\n\n const showSearchIcon = type === \"search\" && !disableSearchButton;\n\n const showRevealPasswordButton =\n type === \"password\" && !disableRevealPassword;\n\n /**\n * Clears the input value from the state and refocus the input.\n */\n const handleClear = useCallback(() => {\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n changeInputValue(inputRef.current, \"\");\n\n // we want to focus the input when clicked and not active\n setTimeout(focusInput);\n }, [setValidationState]);\n\n const clearButton = useMemo(() => {\n if (!showClear) {\n return null;\n }\n\n return (\n <HvAdornment\n // Don't control visibility when the search icon is enabled\n className={cx(classes.adornmentButton, {\n [classes.iconClear]: !showSearchIcon,\n })}\n onClick={handleClear}\n aria-label={labels?.clearButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={<CloseXS />}\n />\n );\n }, [\n showClear,\n classes.adornmentButton,\n classes.iconClear,\n showSearchIcon,\n handleClear,\n labels?.clearButtonLabel,\n elementId,\n cx,\n ]);\n\n /**\n * Calls the onEnter callback and refocus the input.\n */\n const handleSearch = useCallback<NonNullable<HvAdornmentProps[\"onClick\"]>>(\n (event) => {\n onEnter?.(event, value);\n },\n [onEnter, value]\n );\n\n const searchButton = useMemo(() => {\n // If the search icon is not actionable, only show it when the input is empty or active\n const reallyShowIt =\n showSearchIcon &&\n (isEmptyValue ||\n (hasOnEnter && validationState === validationStates.standBy));\n\n if (!reallyShowIt) {\n return null;\n }\n\n return (\n <HvAdornment\n className={classes.adornmentButton}\n onClick={hasOnEnter ? handleSearch : undefined}\n aria-label={labels?.searchButtonLabel}\n icon={<Search />}\n />\n );\n }, [\n showSearchIcon,\n isEmptyValue,\n hasOnEnter,\n validationState,\n classes.adornmentButton,\n handleSearch,\n labels?.searchButtonLabel,\n ]);\n\n /**\n * Changes input type and refocus the input.\n */\n const handleRevealPassword = useCallback(() => {\n setRevealPassword(!revealPassword);\n }, [revealPassword]);\n\n const revealPasswordButton = useMemo(() => {\n if (!showRevealPasswordButton) {\n return null;\n }\n\n return (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={\n <HvTypography>\n {revealPassword\n ? labels?.revealPasswordButtonClickToHideTooltip\n : labels?.revealPasswordButtonClickToShowTooltip}\n </HvTypography>\n }\n >\n <HvAdornment\n className={classes.adornmentButton}\n onClick={handleRevealPassword}\n aria-label={labels?.revealPasswordButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={revealPassword ? <PreviewOff /> : <Preview />}\n />\n </HvTooltip>\n );\n }, [\n showRevealPasswordButton,\n revealPassword,\n labels?.revealPasswordButtonClickToHideTooltip,\n labels?.revealPasswordButtonClickToShowTooltip,\n labels?.revealPasswordButtonLabel,\n classes.adornmentButton,\n handleRevealPassword,\n elementId,\n ]);\n\n const validationIcon = useMemo(() => {\n if (!showValidationIcon) {\n return null;\n }\n\n if (!isValid(validationState)) {\n return null;\n }\n\n return <Success color=\"positive\" className={classes.icon} />;\n }, [showValidationIcon, validationState, classes.icon]);\n\n // useMemo to avoid repetitive cloning of the custom icon\n const customIconEl = useMemo(\n () =>\n isValidElement(endAdornment) &&\n React.cloneElement(endAdornment as React.ReactElement, {\n className: cx(endAdornment.props.className, classes.icon),\n }),\n [classes.icon, endAdornment, cx]\n );\n\n const adornments = useMemo(() => {\n if (\n !clearButton &&\n !revealPasswordButton &&\n !searchButton &&\n !validationIcon &&\n !customIconEl\n )\n return null;\n\n // note: specification implies that the custom icon should be hidden when\n // a validation feedback icon is being shown.\n return (\n <div className={classes.adornmentsBox} aria-hidden=\"true\">\n {clearButton}\n {revealPasswordButton}\n {searchButton}\n {validationIcon || customIconEl}\n </div>\n );\n }, [\n classes.adornmentsBox,\n clearButton,\n customIconEl,\n revealPasswordButton,\n searchButton,\n validationIcon,\n ]);\n\n // run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(\n classes.root,\n {\n [classes.hasSuggestions]: hasSuggestions,\n },\n className\n )}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel\n id={setId(elementId, \"label\")}\n className={classes.label}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <HvInfoMessage\n id={setId(elementId, \"description\")}\n className={classes.description}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseInput\n id={\n hasLabel || showClear || showRevealPasswordButton\n ? setId(elementId, \"input\")\n : setId(id, \"input\")\n }\n name={name}\n value={value}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onKeyDown={onKeyDownHandler}\n onBlur={onInputBlurHandler}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n type={realType}\n classes={{\n input: classes.input,\n inputRoot: classes.inputRoot,\n inputRootFocused: classes.inputRootFocused,\n inputRootDisabled: classes.inputRootDisabled,\n inputRootMultiline: classes.inputRootMultiline,\n inputBorderContainer: classes.inputBorderContainer,\n }}\n invalid={isStateInvalid}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : description\n ? setId(elementId, \"description\")\n : undefined,\n \"aria-controls\": canShowSuggestions\n ? setId(elementId, \"suggestions\")\n : undefined,\n\n ref: inputRef,\n\n // prevent browsers auto-fill/suggestions when we have our own\n autoComplete: canShowSuggestions ? \"off\" : undefined,\n\n ...inputProps,\n }}\n inputRef={forkedRef}\n endAdornment={adornments}\n {...others}\n />\n {canShowSuggestions && (\n <>\n {hasSuggestions && (\n <div role=\"presentation\" className={classes.inputExtension} />\n )}\n <HvSuggestions\n ref={suggestionsRef}\n id={setId(elementId, \"suggestions\")}\n classes={{\n root: classes.suggestionsContainer,\n list: classes.suggestionList,\n }}\n expanded={hasSuggestions}\n anchorEl={inputRef.current?.parentElement}\n onClose={suggestionClearHandler}\n onKeyDown={onSuggestionKeyDown}\n onSuggestionSelected={suggestionSelectedHandler}\n suggestionValues={suggestionValues}\n />\n </>\n )}\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n});\n"],"names":["DEFAULT_LABELS","clearButtonLabel","revealPasswordButtonLabel","revealPasswordButtonClickToShowTooltip","revealPasswordButtonClickToHideTooltip","searchButtonLabel","getFocusedElement","event","isBrowser","document","activeElement","relatedTarget","eventTargetIsInsideContainer","container","contains","changeInputValue","input","value","Event","bubbles","setInputValue","Object","getOwnPropertyDescriptor","window","HTMLInputElement","prototype","set","call","dispatchEvent","HvInput","forwardRef","props","ref","classes","classesProp","className","id","name","valueProp","defaultValue","required","readOnly","disabled","label","ariaLabel","ariaLabelledBy","description","ariaDescribedBy","onChange","onEnter","status","statusMessage","ariaErrorMessage","type","placeholder","autoFocus","labels","labelsProp","validationMessages","disableClear","disableRevealPassword","disableSearchButton","endAdornment","maxCharQuantity","minCharQuantity","validation","showValidationIcon","suggestionListCallback","inputRef","inputRefProp","onBlur","onFocus","onKeyDown","inputProps","others","useDefaultProps","cx","useClasses","useLabels","elementId","useUniqueId","useRef","forkedRef","useForkRef","suggestionsRef","focused","setFocused","useState","isDirty","setValue","useControlled","isEmptyValue","validationState","setValidationState","validationStates","standBy","validationMessage","setValidationMessage","errorMessages","useMemo","DEFAULT_ERROR_MESSAGES","error","requiredError","minCharError","maxCharError","typeMismatchError","validationType","computeValidationType","performValidation","useCallback","inputValidity","validateInput","current","computeValidationState","computeValidationMessage","canShowError","undefined","hasBuiltInValidations","isStateInvalid","isInvalid","revealPassword","setRevealPassword","realType","suggestionValues","setSuggestionValues","canShowSuggestions","hasSuggestions","hasLabel","hasDescription","focusInput","focus","isMounted","useIsMounted","suggestionClearHandler","suggestionHandler","val","suggestionsArray","suggestionSelectedHandler","item","newValue","onChangeHandler","onInputBlurHandler","onFocusHandler","getSuggestions","li","listEl","getElementById","setId","getElementsByTagName","onSuggestionKeyDown","isKey","onKeyDownHandler","onContainerBlurHandler","setTimeout","list","hasOnEnter","showClear","showSearchIcon","showRevealPasswordButton","handleClear","clearButton","adornmentButton","iconClear","handleSearch","searchButton","reallyShowIt","handleRevealPassword","revealPasswordButton","validationIcon","isValid","icon","customIconEl","isValidElement","React","cloneElement","adornments","adornmentsBox","useEffect","errorMessageId","root","labelContainer","inputRoot","inputRootFocused","inputRootDisabled","inputRootMultiline","inputBorderContainer","autoComplete","inputExtension","suggestionsContainer","suggestionList","parentElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsMA,MAAMA,iBAAiB;AAAA,EACrBC,kBAAkB;AAAA,EAClBC,2BAA2B;AAAA,EAC3BC,wCAAwC;AAAA,EACxCC,wCAAwC;AAAA,EACxCC,mBAAmB;AACrB;AAKA,MAAMC,oBAAqBC,CACzBC,UAAAA,UAAU,IAAI,IAAIC,SAASC,gBAAgBH,MAAMI;AAEnD,SAASC,6BAA6BC,WAAWN,OAAO;AACtD,SAAOM,aAAa,QAAQA,UAAUC,SAASR,kBAAkBC,KAAK,CAAC;AACzE;AAGA,MAAMQ,mBAAmBA,CAACC,OAAgCC,QAAQ,OAAO;AACjEV,QAAAA,QAAQ,IAAIW,MAAM,SAAS;AAAA,IAAEC,SAAS;AAAA,EAAA,CAAM;AAGlD,QAAMC,gBAAgBC,OAAOC,yBAC3BC,OAAOC,iBAAiBC,WACxB,OACF,GAAGC;AAEYC,iBAAAA,KAAKX,OAAOC,KAAK;AAChCD,SAAOY,cAAcrB,KAAK;AAC5B;AAKO,MAAMsB,UAAUC,WAAuC,CAACC,OAAOC,QAAQ;AACtE,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AA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3BC,oBAAoBvJ,QAAQuJ;AAAAA,MAC5BC,sBAAsBxJ,QAAQwJ;AAAAA,IAAAA,GAEhC,SAASnE,gBACT,YAAY;AAAA,MACV,cAAc1E;AAAAA,MACd,mBAAmBC;AAAAA,MACnB,gBAAgByE,iBAAiB,OAAOF;AAAAA,MACxC,qBAAqB8D;AAAAA,MACrB,oBACEnI,mBAAmB,OACfA,kBACAD,cACAqG,MAAMpE,WAAW,aAAa,IAC9BqC;AAAAA,MACN,iBAAiBS,qBACbsB,MAAMpE,WAAW,aAAa,IAC9BqC;AAAAA,MAEJpF,KAAKoC;AAAAA;AAAAA,MAGLsH,cAAc7D,qBAAqB,QAAQT;AAAAA,MAE3C,GAAG3C;AAAAA,IAAAA,GAEL,UAAUS,WACV,cAAc6F,YACd,GAAIrG,OAAO,CAAA;AAAA,IAEZmD,sBAEIC,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,MAAAA,sCACE,OAAI,EAAA,MAAK,gBAAe,WAAW7F,QAAQ0J,gBAC7C;AAAA,MACD,oBAAC,iBACC,KAAKvG,gBACL,IAAI+D,MAAMpE,WAAW,aAAa,GAClC,SAAS;AAAA,QACPoG,MAAMlJ,QAAQ2J;AAAAA,QACdlC,MAAMzH,QAAQ4J;AAAAA,MAEhB,GAAA,UAAU/D,gBACV,UAAU1D,SAAS4C,SAAS8E,eAC5B,SAASzD,wBACT,WAAWgB,qBACX,sBAAsBZ,2BACtB,iBAAmC,CAAA;AAAA,IAAA,GAEvC;AAAA,IAEDtB,gBACC,oBAAC,eACC,EAAA,IAAIgC,MAAMpE,WAAW,OAAO,GAC5B,eAAa,MACb,WAAW9C,QAAQoE,OAElBL,UACH,mBAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, {\n FocusEvent,\n HTMLInputTypeAttribute,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n InputBaseComponentProps as MuiInputBaseComponentProps,\n useForkRef,\n} from \"@mui/material\";\n\nimport {\n CloseXS,\n PreviewOff,\n Preview,\n Search,\n Success,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { ExtractNames } from \"@core/utils/classes\";\nimport { isBrowser } from \"@core/utils/browser\";\nimport { isKey } from \"@core/utils/keyboardUtils\";\nimport { setId } from \"@core/utils/setId\";\nimport {\n HvInputLabels,\n HvInputSuggestion,\n HvValidationMessages,\n} from \"@core/types/forms\";\nimport { HvBaseProps, HvExtraProps } from \"@core/types/generic\";\nimport {\n HvAdornment,\n HvAdornmentProps,\n HvFormElement,\n HvFormElementProps,\n HvFormStatus,\n HvInfoMessage,\n HvLabel,\n HvSuggestion,\n HvSuggestions,\n HvSuggestionsProps,\n HvWarningText,\n isValid,\n isInvalid,\n} from \"@core/components/Forms\";\nimport validationStates from \"@core/components/Forms/FormElement/validationStates\";\nimport { HvBaseInput, HvBaseInputProps } from \"@core/components/BaseInput\";\nimport {\n DEFAULT_ERROR_MESSAGES,\n computeValidationType,\n hasBuiltInValidations,\n validateInput,\n computeValidationState,\n computeValidationMessage,\n HvInputValidity,\n} from \"@core/components/BaseInput/validations\";\nimport { HvTypography } from \"@core/components/Typography\";\nimport { HvTooltip } from \"@core/components/Tooltip\";\nimport { useControlled } from \"@core/hooks/useControlled\";\nimport { useIsMounted } from \"@core/hooks/useIsMounted\";\nimport { useUniqueId } from \"@core/hooks/useUniqueId\";\nimport { useLabels } from \"@core/hooks/useLabels\";\n\nimport { useDefaultProps } from \"@core/hooks/useDefaultProps\";\n\nimport { staticClasses, useClasses } from \"./Input.styles\";\n\nexport { staticClasses as inputClasses };\n\nexport type HvInputClasses = ExtractNames<typeof useClasses>;\n\ntype InputElement = HTMLInputElement | HTMLTextAreaElement;\n\nexport interface HvInputProps\n extends HvBaseProps<\n HTMLElement,\n \"onChange\" | \"onBlur\" | \"onFocus\" | \"onKeyDown\" | \"color\"\n > {\n /** The form element name. */\n name?: string;\n /** The value of the form element. */\n value?: string;\n /** When uncontrolled, defines the initial input value. */\n defaultValue?: string;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /** Provide additional descriptive text for the form element. */\n description?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** Indicates that the form element is not editable. */\n readOnly?: boolean;\n /** Indicates that user input is required on the form element. */\n required?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /** The error message to show when `status` is \"invalid\". */\n statusMessage?: string;\n /**\n * The function that will be executed onChange, allows modification of the input,\n * it receives the value. If a new value should be presented it must returned it.\n */\n onChange?: HvBaseInputProps[\"onChange\"];\n /**\n * Callback called when the user submits the value by pressing Enter/Return.\n *\n * Also called when the search button is clicked (when type is \"search\").\n */\n onEnter?: (\n event: React.KeyboardEvent<InputElement> | React.MouseEvent,\n value: string\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the validation state,\n * it receives the value and the validation state.\n */\n onBlur?: (\n event: React.FocusEvent<InputElement>,\n value: string,\n validationState: HvInputValidity\n ) => void;\n /**\n * The function that will be executed onBlur, allows checking the value state,\n * it receives the value.\n */\n onFocus?: (event: React.FocusEvent<InputElement>, value: string) => void;\n /**\n * The function that will be executed onKeyDown, allows checking the value state,\n * it receives the event and value.\n */\n onKeyDown?: (\n event: React.KeyboardEvent<InputElement> | React.MouseEvent,\n value: string\n ) => void;\n /** The input type. */\n type?: HTMLInputTypeAttribute;\n /** The placeholder value of the input. */\n placeholder?: string;\n /** Internal labels?. */\n labels?: HvInputLabels & HvExtraProps;\n /** An Object containing the various texts associated with the input. */\n validationMessages?: HvValidationMessages;\n /** Attributes applied to the input element. */\n inputProps?: MuiInputBaseComponentProps;\n /**\n * Allows passing a ref to the underlying input\n * @deprecated Use `ref` directly instead\n * */\n inputRef?: HvBaseInputProps[\"inputRef\"];\n /** The function that will be executed to received an array of objects that has a label and id to create list of suggestion */\n suggestionListCallback?: (value: string) => HvInputSuggestion[] | null;\n /**\n * The custom validation function, it receives the value and must return\n * either `true` for valid or `false` for invalid, default validations would only\n * occur if this function is null or undefined\n */\n validation?: (value: string) => boolean;\n /** If `true` it should autofocus. */\n autoFocus?: boolean;\n /** If `true` the clear button is disabled. */\n disableClear?: boolean;\n /** If `true` the reveal password button is disabled. Valid only when type is \"password\". */\n disableRevealPassword?: boolean;\n /** If `true` the search button is disabled. Valid only when type is \"search\". */\n disableSearchButton?: boolean;\n /**\n * If `true` the validation icon adornment is visible. Defaults to `false`.\n *\n * Currently, DS specifications define only a positive feedback icon;\n * errors are signaled through the border style and by displaying the error message.\n */\n showValidationIcon?: boolean;\n /** A custom icon to be added into the input. */\n endAdornment?: React.ReactNode;\n /** The maximum allowed length of the characters, if this value is null no check will be performed. */\n maxCharQuantity?: number;\n /** The minimum allowed length of the characters, if this value is null no check will be perform. */\n minCharQuantity?: number;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvInputClasses;\n}\n\nconst DEFAULT_LABELS = {\n clearButtonLabel: \"Clear the text\",\n revealPasswordButtonLabel: \"Reveal password\",\n revealPasswordButtonClickToShowTooltip: \"Click to show password.\",\n revealPasswordButtonClickToHideTooltip: \"Click to hide password.\",\n searchButtonLabel: \"Search\",\n};\n\n/**\n * Find the focused element onBlur.\n */\nconst getFocusedElement = (event: FocusEvent) =>\n isBrowser(\"ie\") ? document.activeElement : event.relatedTarget;\n\nfunction eventTargetIsInsideContainer(\n container: HTMLElement | null,\n event: FocusEvent<any>\n) {\n return container != null && container.contains(getFocusedElement(event));\n}\n\n/** Changes a given `input`'s `value`, triggering its `onChange` */\nconst changeInputValue = (input: HTMLInputElement | null, value = \"\") => {\n const event = new Event(\"input\", { bubbles: true });\n\n /** Original `input.value` setter (React overrides it). */\n const setInputValue = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n \"value\"\n )?.set;\n\n setInputValue?.call(input, value);\n input?.dispatchEvent(event);\n};\n\n/**\n * A text input box is a graphical control element intended to enable the user to input text information to be used by the software.\n */\nexport const HvInput = forwardRef<InputElement, HvInputProps>((props, ref) => {\n const {\n classes: classesProp,\n className,\n id,\n name,\n value: valueProp,\n defaultValue = \"\",\n required = false,\n readOnly = false,\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n description,\n \"aria-describedby\": ariaDescribedBy,\n onChange,\n onEnter,\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n type = \"text\",\n placeholder,\n autoFocus = false,\n labels: labelsProp,\n validationMessages,\n disableClear = false,\n disableRevealPassword = false,\n disableSearchButton = false,\n endAdornment,\n maxCharQuantity,\n minCharQuantity,\n validation,\n showValidationIcon = false,\n suggestionListCallback,\n inputRef: inputRefProp,\n onBlur,\n onFocus,\n onKeyDown,\n inputProps = {},\n ...others\n } = useDefaultProps(\"HvInput\", props);\n const { classes, cx } = useClasses(classesProp);\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const elementId = useUniqueId(id, \"hvinput\");\n\n const inputRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, inputRef, inputRefProp);\n const suggestionsRef = useRef<HTMLElement>(null);\n\n const [focused, setFocused] = useState(false);\n\n // Signals that the user has manually edited the input value\n const isDirty = useRef(false);\n\n // Value related state\n const [value, setValue] = useControlled(valueProp, defaultValue);\n\n const isEmptyValue = value == null || value === \"\";\n\n // Validation related state\n const [validationState, setValidationState] = useControlled(\n status,\n validationStates.standBy\n );\n\n const [validationMessage, setValidationMessage] = useControlled(\n statusMessage,\n \"\"\n );\n\n // validationMessages reference tends to change, as users will not memoize/useState for it;\n // dependencies must be more explicit so we set\n const errorMessages = useMemo(\n () => ({ ...DEFAULT_ERROR_MESSAGES, ...validationMessages }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n validationMessages?.error,\n validationMessages?.requiredError,\n validationMessages?.minCharError,\n validationMessages?.maxCharError,\n validationMessages?.typeMismatchError,\n ]\n );\n\n const validationType = useMemo(() => computeValidationType(type), [type]);\n\n // Validates the input, sets the status and the statusMessage accordingly (if uncontrolled)\n // and returns the validity state of the input.\n const performValidation = useCallback(() => {\n const inputValidity = validateInput(\n inputRef.current,\n value,\n required,\n minCharQuantity,\n maxCharQuantity,\n validationType,\n validation\n );\n\n // This will only run if status is uncontrolled\n setValidationState(computeValidationState(inputValidity, isEmptyValue));\n\n // This will only run if statusMessage is uncontrolled\n setValidationMessage(\n computeValidationMessage(inputValidity, errorMessages)\n );\n\n return inputValidity;\n }, [\n errorMessages,\n isEmptyValue,\n maxCharQuantity,\n minCharQuantity,\n required,\n setValidationMessage,\n setValidationState,\n validation,\n validationType,\n value,\n ]);\n\n // The error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and any of the built-in validations are active\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined &&\n hasBuiltInValidations(\n required,\n validationType,\n minCharQuantity,\n maxCharQuantity,\n validation,\n inputProps\n )));\n\n const isStateInvalid = isInvalid(validationState);\n\n // Input type related state\n const [revealPassword, setRevealPassword] = useState(false);\n\n const realType = useMemo(() => {\n if (type === \"password\") {\n return revealPassword ? \"text\" : \"password\";\n }\n\n if (type === \"search\") {\n return \"search\";\n }\n\n return \"text\";\n }, [revealPassword, type]);\n\n // Suggestions related state\n const [suggestionValues, setSuggestionValues] = useState<\n HvSuggestion[] | null\n >(null);\n\n const canShowSuggestions = suggestionListCallback != null;\n const hasSuggestions = !!suggestionValues;\n\n // Miscellaneous state\n const hasLabel = label != null;\n const hasDescription = description != null;\n\n /**\n * Looks for the node that represent the input inside the material tree and focus it.\n */\n const focusInput = () => {\n inputRef.current?.focus();\n };\n\n const isMounted = useIsMounted();\n\n /**\n * Clears the suggestion array.\n */\n const suggestionClearHandler = () => {\n if (isMounted.current) {\n setSuggestionValues(null);\n }\n };\n\n /**\n * Fills of the suggestion array.\n */\n const suggestionHandler = (val: string) => {\n const suggestionsArray = suggestionListCallback?.(val);\n if (suggestionsArray?.[0]?.label) {\n setSuggestionValues(suggestionsArray);\n } else {\n suggestionClearHandler();\n }\n };\n\n /**\n * Executes the user callback adds the selection to the state and clears the suggestions.\n */\n const suggestionSelectedHandler: HvSuggestionsProps[\"onSuggestionSelected\"] =\n (event, item) => {\n const newValue = item.value || (item.label as any);\n\n changeInputValue(inputRef.current, newValue);\n\n focusInput();\n suggestionClearHandler();\n\n if (type === \"search\") {\n // trigger the onEnter callback when the user selects an option in a search box\n onEnter?.(event, newValue);\n }\n };\n\n const onChangeHandler: HvBaseInputProps[\"onChange\"] = (event, newValue) => {\n isDirty.current = true;\n\n // set the input value (only when value is uncontrolled)\n setValue(newValue);\n\n onChange?.(event, newValue);\n\n if (canShowSuggestions) {\n // an edge case might be a controlled input whose onChange callback\n // doesn't change the value (or sets another): the suggestionListCallback\n // callback will still receive the original rejected value.\n // a refactor is needed so the suggestionListCallback might be called only\n // when the input is uncontrolled, providing a way to externally control\n // the suggestion values.\n suggestionHandler(newValue);\n }\n };\n\n /**\n * Validates the input updating the state and modifying the info text, also executes\n * the user provided onBlur passing the current validation status and value.\n */\n const onInputBlurHandler: HvBaseInputProps[\"onBlur\"] = (event) => {\n // If the blur is executed when choosing an suggestion it should be ignored.\n if (eventTargetIsInsideContainer(suggestionsRef.current, event)) return;\n\n setFocused(false);\n\n const inputValidity = performValidation();\n\n onBlur?.(event, value, inputValidity);\n };\n\n /**\n * Updates the state putting again the value from the state because the input value is\n * not automatically manage, it also executes the onFocus function from the user passing the value\n */\n const onFocusHandler: HvBaseInputProps[\"onFocus\"] = (event) => {\n setFocused(true);\n\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n onFocus?.(event, value);\n };\n\n const getSuggestions = (li: number | null) => {\n // TODO Replace with ref\n const listEl = document.getElementById(\n setId(elementId, \"suggestions-list\") || \"\"\n );\n return li != null ? listEl?.getElementsByTagName(\"li\")?.[li] : listEl;\n };\n\n const onSuggestionKeyDown: HvSuggestionsProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"Esc\")) {\n suggestionClearHandler();\n focusInput();\n } else if (isKey(event, \"Tab\")) {\n suggestionClearHandler();\n }\n };\n\n /** Focus the suggestion list when the arrow down is pressed. */\n const onKeyDownHandler: HvBaseInputProps[\"onKeyDown\"] = (event) => {\n if (isKey(event, \"ArrowDown\") && hasSuggestions) {\n const li = getSuggestions(0);\n li?.focus();\n } else if (isKey(event, \"Enter\")) {\n onEnter?.(event, value);\n }\n\n onKeyDown?.(event, value);\n };\n\n /** Clears the suggestion list on blur. */\n const onContainerBlurHandler: HvFormElementProps[\"onBlur\"] = (event) => {\n if (event.relatedTarget) {\n setTimeout(() => {\n const list = getSuggestions(null);\n if (!list?.contains(document.activeElement)) suggestionClearHandler();\n }, 10);\n }\n };\n\n const hasOnEnter = onEnter != null;\n\n // show the clear button only if the input is enabled, not read-only, disableClear is false and the input is not empty\n // also, don't show it when the input type is \"search\" and the input is active (standBy)\n const showClear =\n !disabled &&\n !readOnly &&\n !disableClear &&\n !isEmptyValue &&\n (!hasOnEnter ||\n type !== \"search\" ||\n disableSearchButton ||\n validationState !== validationStates.standBy);\n\n const showSearchIcon = type === \"search\" && !disableSearchButton;\n\n const showRevealPasswordButton =\n type === \"password\" && !disableRevealPassword;\n\n /**\n * Clears the input value from the state and refocus the input.\n */\n const handleClear = useCallback(() => {\n // reset validation status to standBy (only when status is uncontrolled)\n setValidationState(validationStates.standBy);\n\n changeInputValue(inputRef.current, \"\");\n\n // we want to focus the input when clicked and not active\n setTimeout(focusInput);\n }, [setValidationState]);\n\n const clearButton = useMemo(() => {\n if (!showClear) {\n return null;\n }\n\n return (\n <HvAdornment\n // Don't control visibility when the search icon is enabled\n className={cx(classes.adornmentButton, {\n [classes.iconClear]: !showSearchIcon,\n })}\n onClick={handleClear}\n aria-label={labels?.clearButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={<CloseXS />}\n />\n );\n }, [\n showClear,\n classes.adornmentButton,\n classes.iconClear,\n showSearchIcon,\n handleClear,\n labels?.clearButtonLabel,\n elementId,\n cx,\n ]);\n\n /**\n * Calls the onEnter callback and refocus the input.\n */\n const handleSearch = useCallback<NonNullable<HvAdornmentProps[\"onClick\"]>>(\n (event) => {\n onEnter?.(event, value);\n },\n [onEnter, value]\n );\n\n const searchButton = useMemo(() => {\n // If the search icon is not actionable, only show it when the input is empty or active\n const reallyShowIt =\n showSearchIcon &&\n (isEmptyValue ||\n (hasOnEnter && validationState === validationStates.standBy));\n\n if (!reallyShowIt) {\n return null;\n }\n\n return (\n <HvAdornment\n className={classes.adornmentButton}\n onClick={hasOnEnter ? handleSearch : undefined}\n aria-label={labels?.searchButtonLabel}\n icon={<Search />}\n />\n );\n }, [\n showSearchIcon,\n isEmptyValue,\n hasOnEnter,\n validationState,\n classes.adornmentButton,\n handleSearch,\n labels?.searchButtonLabel,\n ]);\n\n /**\n * Changes input type and refocus the input.\n */\n const handleRevealPassword = useCallback(() => {\n setRevealPassword(!revealPassword);\n }, [revealPassword]);\n\n const revealPasswordButton = useMemo(() => {\n if (!showRevealPasswordButton) {\n return null;\n }\n\n return (\n <HvTooltip\n disableFocusListener\n disableTouchListener\n title={\n <HvTypography>\n {revealPassword\n ? labels?.revealPasswordButtonClickToHideTooltip\n : labels?.revealPasswordButtonClickToShowTooltip}\n </HvTypography>\n }\n >\n <HvAdornment\n className={classes.adornmentButton}\n onClick={handleRevealPassword}\n aria-label={labels?.revealPasswordButtonLabel}\n aria-controls={setId(elementId, \"input\")}\n icon={revealPassword ? <PreviewOff /> : <Preview />}\n />\n </HvTooltip>\n );\n }, [\n showRevealPasswordButton,\n revealPassword,\n labels?.revealPasswordButtonClickToHideTooltip,\n labels?.revealPasswordButtonClickToShowTooltip,\n labels?.revealPasswordButtonLabel,\n classes.adornmentButton,\n handleRevealPassword,\n elementId,\n ]);\n\n const validationIcon = useMemo(() => {\n if (!showValidationIcon) {\n return null;\n }\n\n if (!isValid(validationState)) {\n return null;\n }\n\n return <Success color=\"positive\" className={classes.icon} />;\n }, [showValidationIcon, validationState, classes.icon]);\n\n // useMemo to avoid repetitive cloning of the custom icon\n const customIconEl = useMemo(\n () =>\n isValidElement(endAdornment) &&\n React.cloneElement(endAdornment as React.ReactElement, {\n className: cx(endAdornment.props.className, classes.icon),\n }),\n [classes.icon, endAdornment, cx]\n );\n\n const adornments = useMemo(() => {\n if (\n !clearButton &&\n !revealPasswordButton &&\n !searchButton &&\n !validationIcon &&\n !customIconEl\n )\n return null;\n\n // note: specification implies that the custom icon should be hidden when\n // a validation feedback icon is being shown.\n return (\n <div className={classes.adornmentsBox} aria-hidden=\"true\">\n {clearButton}\n {revealPasswordButton}\n {searchButton}\n {validationIcon || customIconEl}\n </div>\n );\n }, [\n classes.adornmentsBox,\n clearButton,\n customIconEl,\n revealPasswordButton,\n searchButton,\n validationIcon,\n ]);\n\n // run initial validation after first render\n // and also when any validation condition changes\n useEffect(() => {\n if (focused || (!isDirty.current && isEmptyValue)) {\n // skip validation if currently focused or if empty and\n // the user never manually edited the input value\n return;\n }\n\n performValidation();\n }, [focused, isEmptyValue, performValidation]);\n\n const errorMessageId = isStateInvalid\n ? canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage\n : undefined;\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(\n classes.root,\n {\n [classes.hasSuggestions]: hasSuggestions,\n },\n className\n )}\n onBlur={onContainerBlurHandler}\n >\n {(hasLabel || hasDescription) && (\n <div className={classes.labelContainer}>\n {hasLabel && (\n <HvLabel\n id={setId(elementId, \"label\")}\n className={classes.label}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n />\n )}\n\n {hasDescription && (\n <HvInfoMessage\n id={setId(elementId, \"description\")}\n className={classes.description}\n >\n {description}\n </HvInfoMessage>\n )}\n </div>\n )}\n <HvBaseInput\n id={\n hasLabel || showClear || showRevealPasswordButton\n ? setId(elementId, \"input\")\n : setId(id, \"input\")\n }\n name={name}\n value={value}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n onChange={onChangeHandler}\n autoFocus={autoFocus}\n onKeyDown={onKeyDownHandler}\n onBlur={onInputBlurHandler}\n onFocus={onFocusHandler}\n placeholder={placeholder}\n type={realType}\n classes={{\n input: classes.input,\n inputRoot: classes.inputRoot,\n inputRootFocused: classes.inputRootFocused,\n inputRootDisabled: classes.inputRootDisabled,\n inputRootMultiline: classes.inputRootMultiline,\n inputBorderContainer: classes.inputBorderContainer,\n }}\n invalid={isStateInvalid}\n inputProps={{\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-describedby\":\n ariaDescribedBy != null\n ? ariaDescribedBy\n : description\n ? setId(elementId, \"description\")\n : undefined,\n \"aria-controls\": canShowSuggestions\n ? setId(elementId, \"suggestions\")\n : undefined,\n\n ref: inputRef,\n\n // prevent browsers auto-fill/suggestions when we have our own\n autoComplete: canShowSuggestions ? \"off\" : undefined,\n\n ...inputProps,\n }}\n inputRef={forkedRef}\n endAdornment={adornments}\n {...others}\n />\n {canShowSuggestions && (\n <>\n {hasSuggestions && (\n <div role=\"presentation\" className={classes.inputExtension} />\n )}\n <HvSuggestions\n ref={suggestionsRef}\n id={setId(elementId, \"suggestions\")}\n classes={{\n root: classes.suggestionsContainer,\n list: classes.suggestionList,\n }}\n expanded={hasSuggestions}\n anchorEl={inputRef.current?.parentElement}\n onClose={suggestionClearHandler}\n onKeyDown={onSuggestionKeyDown}\n onSuggestionSelected={suggestionSelectedHandler}\n suggestionValues={suggestionValues}\n />\n </>\n )}\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n disableBorder\n className={classes.error}\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n});\n"],"names":["DEFAULT_LABELS","clearButtonLabel","revealPasswordButtonLabel","revealPasswordButtonClickToShowTooltip","revealPasswordButtonClickToHideTooltip","searchButtonLabel","getFocusedElement","event","isBrowser","document","activeElement","relatedTarget","eventTargetIsInsideContainer","container","contains","changeInputValue","input","value","Event","bubbles","setInputValue","Object","getOwnPropertyDescriptor","window","HTMLInputElement","prototype","set","call","dispatchEvent","HvInput","forwardRef","props","ref","classes","classesProp","className","id","name","valueProp","defaultValue","required","readOnly","disabled","label","ariaLabel","ariaLabelledBy","description","ariaDescribedBy","onChange","onEnter","status","statusMessage","ariaErrorMessage","type","placeholder","autoFocus","labels","labelsProp","validationMessages","disableClear","disableRevealPassword","disableSearchButton","endAdornment","maxCharQuantity","minCharQuantity","validation","showValidationIcon","suggestionListCallback","inputRef","inputRefProp","onBlur","onFocus","onKeyDown","inputProps","others","useDefaultProps","cx","useClasses","useLabels","elementId","useUniqueId","useRef","forkedRef","useForkRef","suggestionsRef","focused","setFocused","useState","isDirty","setValue","useControlled","isEmptyValue","validationState","setValidationState","validationStates","standBy","validationMessage","setValidationMessage","errorMessages","useMemo","DEFAULT_ERROR_MESSAGES","error","requiredError","minCharError","maxCharError","typeMismatchError","validationType","computeValidationType","performValidation","useCallback","inputValidity","validateInput","current","computeValidationState","computeValidationMessage","canShowError","undefined","hasBuiltInValidations","isStateInvalid","isInvalid","revealPassword","setRevealPassword","realType","suggestionValues","setSuggestionValues","canShowSuggestions","hasSuggestions","hasLabel","hasDescription","focusInput","focus","isMounted","useIsMounted","suggestionClearHandler","suggestionHandler","val","suggestionsArray","suggestionSelectedHandler","item","newValue","onChangeHandler","onInputBlurHandler","onFocusHandler","getSuggestions","li","listEl","getElementById","setId","getElementsByTagName","onSuggestionKeyDown","isKey","onKeyDownHandler","onContainerBlurHandler","setTimeout","list","hasOnEnter","showClear","showSearchIcon","showRevealPasswordButton","handleClear","clearButton","adornmentButton","iconClear","handleSearch","searchButton","reallyShowIt","handleRevealPassword","revealPasswordButton","validationIcon","isValid","icon","customIconEl","isValidElement","React","cloneElement","adornments","adornmentsBox","useEffect","errorMessageId","root","labelContainer","inputRoot","inputRootFocused","inputRootDisabled","inputRootMultiline","inputBorderContainer","autoComplete","inputExtension","suggestionsContainer","suggestionList","parentElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,MAAMA,iBAAiB;AAAA,EACrBC,kBAAkB;AAAA,EAClBC,2BAA2B;AAAA,EAC3BC,wCAAwC;AAAA,EACxCC,wCAAwC;AAAA,EACxCC,mBAAmB;AACrB;AAKA,MAAMC,oBAAoBA,CAACC,UACzBC,UAAU,IAAI,IAAIC,SAASC,gBAAgBH,MAAMI;AAEnD,SAASC,6BACPC,WACAN,OACA;AACA,SAAOM,aAAa,QAAQA,UAAUC,SAASR,kBAAkBC,KAAK,CAAC;AACzE;AAGA,MAAMQ,mBAAmBA,CAACC,OAAgCC,QAAQ,OAAO;AACjEV,QAAAA,QAAQ,IAAIW,MAAM,SAAS;AAAA,IAAEC,SAAS;AAAA,EAAA,CAAM;AAGlD,QAAMC,gBAAgBC,OAAOC,yBAC3BC,OAAOC,iBAAiBC,WACxB,OACF,GAAGC;AAEYC,iBAAAA,KAAKX,OAAOC,KAAK;AAChCD,SAAOY,cAAcrB,KAAK;AAC5B;AAKO,MAAMsB,UAAUC,WAAuC,CAACC,OAAOC,QAAQ;AACtE,QAAA;AAAA,IACJC,SAASC;AAAAA,IACTC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACApB,OAAOqB;AAAAA,IACPC,eAAe;AAAA,IACfC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC,WAAW;AAAA,IACXC;AAAAA,IACA,cAAcC;AAAAA,I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AgByE,iBAAiB,OAAOF;AAAAA,MACxC,qBAAqB8D;AAAAA,MACrB,oBACEnI,mBAAmB,OACfA,kBACAD,cACAqG,MAAMpE,WAAW,aAAa,IAC9BqC;AAAAA,MACN,iBAAiBS,qBACbsB,MAAMpE,WAAW,aAAa,IAC9BqC;AAAAA,MAEJpF,KAAKoC;AAAAA;AAAAA,MAGLsH,cAAc7D,qBAAqB,QAAQT;AAAAA,MAE3C,GAAG3C;AAAAA,IAAAA,GAEL,UAAUS,WACV,cAAc6F,YACd,GAAIrG,OAAO,CAAA;AAAA,IAEZmD,sBAEIC,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,MAAAA,sCACE,OAAI,EAAA,MAAK,gBAAe,WAAW7F,QAAQ0J,gBAC7C;AAAA,MACD,oBAAC,iBACC,KAAKvG,gBACL,IAAI+D,MAAMpE,WAAW,aAAa,GAClC,SAAS;AAAA,QACPoG,MAAMlJ,QAAQ2J;AAAAA,QACdlC,MAAMzH,QAAQ4J;AAAAA,MAEhB,GAAA,UAAU/D,gBACV,UAAU1D,SAAS4C,SAAS8E,eAC5B,SAASzD,wBACT,WAAWgB,qBACX,sBAAsBZ,2BACtB,iBAAmC,CAAA;AAAA,IAAA,GAEvC;AAAA,IAEDtB,gBACC,oBAAC,eACC,EAAA,IAAIgC,MAAMpE,WAAW,OAAO,GAC5B,eAAa,MACb,WAAW9C,QAAQoE,OAElBL,UACH,mBAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
@@ -3,9 +3,7 @@ const {
3
3
  useClasses,
4
4
  staticClasses
5
5
  } = createClasses("HvQueryBuilder-ConfirmationDialog", {
6
- paper: {
7
- width: 500
8
- }
6
+ paper: {}
9
7
  });
10
8
  export {
11
9
  staticClasses,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmationDialog.styles.js","sources":["../../../../../src/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.tsx"],"sourcesContent":["import { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-ConfirmationDialog\",\n {\n paper: {\n width: 500,\n },\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","paper","width"],"mappings":";AAEa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,qCACA;AAAA,EACEC,OAAO;AAAA,IACLC,OAAO;AAAA,EACT;AACF,CACF;"}
1
+ {"version":3,"file":"ConfirmationDialog.styles.js","sources":["../../../../../src/components/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.tsx"],"sourcesContent":["import { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-ConfirmationDialog\",\n {\n paper: {},\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","paper"],"mappings":";AAEa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,qCACA;AAAA,EACEC,OAAO,CAAC;AACV,CACF;"}
@@ -17,14 +17,13 @@ const {
17
17
  margin: theme.space.sm,
18
18
  backgroundColor: "transparent",
19
19
  maxWidth: "100%",
20
- minWidth: 740,
21
- paddingBottom: `calc(${theme.space.md} * 3)`
20
+ paddingBottom: theme.space.lg
22
21
  },
23
22
  /** Styles applied to the sub group containers. */
24
23
  subGroup: {
25
24
  margin: "40px 14px 32px 20px",
26
25
  minHeight: 120,
27
- paddingBottom: 60,
26
+ paddingBottom: theme.space.md,
28
27
  "&::before": {
29
28
  content: '""',
30
29
  position: "absolute",
@@ -54,8 +53,8 @@ const {
54
53
  /** Styles applied to the multi-button combinator container on the top group. */
55
54
  topCombinator: {
56
55
  position: "absolute",
57
- top: `calc( -1 * ${theme.space.sm})`,
58
- left: `calc( -1 * ${theme.space.sm})`
56
+ top: `calc(-1 * ${theme.space.sm})`,
57
+ left: `calc(-1 * ${theme.space.sm})`
59
58
  },
60
59
  /** Styles applied to each combinator button. */
61
60
  combinatorButton: {},
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilder.styles.js","sources":["../../../../src/components/QueryBuilder/QueryBuilder.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvQueryBuilder\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n padding: theme.space.sm,\n marginTop: 12,\n marginBottom: 32,\n border: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the top group container. */\n topGroup: {\n margin: theme.space.sm,\n backgroundColor: \"transparent\",\n maxWidth: \"100%\",\n minWidth: 740,\n paddingBottom: `calc(${theme.space.md} * 3)`,\n },\n /** Styles applied to the sub group containers. */\n subGroup: {\n margin: \"40px 14px 32px 20px\",\n minHeight: 120,\n paddingBottom: 60,\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: 21,\n height: 36,\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: -38,\n left: -38,\n },\n \":not($topRulesContainer)>&:last-child::after\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: 32,\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(${theme.space.sm} + 2)`,\n },\n },\n /** Styles applied to the radio button+label topGroup when the radio button is disabled. */\n combinator: { minWidth: 80 },\n /** Styles applied to the multi-button combinator container on the top group. */\n topCombinator: {\n position: \"absolute\",\n top: `calc( -1 * ${theme.space.sm})`,\n left: `calc( -1 * ${theme.space.sm})`,\n },\n /** Styles applied to each combinator button. */\n combinatorButton: {},\n /** Styles applied to the remove button. */\n removeButton: {},\n /** Styles applied to the remove button on the top group. */\n topRemoveButton: { position: \"absolute\", top: -16, right: -16 },\n /** Styles applied to the remove button when disabled on the top group. */\n topRemoveButtonDisabled: { backgroundColor: theme.colors.atmo2 },\n /** Styles applied to the rules container. */\n rulesContainer: {},\n /** Styles applied to the sub rules container. */\n subRulesContainer: {\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n marginLeft: theme.space.sm,\n marginBottom: theme.space.md,\n paddingLeft: theme.space.sm,\n paddingTop: 7,\n position: \"relative\",\n left: -33,\n width: \"100%\",\n },\n /** Styles applied to the action button container. */\n actionButtonContainer: {\n marginLeft: \"auto\",\n\n \"&>*\": {\n marginLeft: theme.space.sm,\n },\n },\n /** Styles applied to the top action button container. */\n topActionButtonContainer: {\n position: \"absolute\",\n bottom: `calc(-1 * ${theme.space.md} * 0.5 - 3px)`,\n right: `calc(${theme.space.sm} * 1.75 + 2px)`,\n },\n /** Styles applied to the top rules container. */\n topRulesContainer: {},\n /** Styles applied to the background of buttons to remove transparency */\n buttonBackground: {\n backgroundColor: theme.colors.atmo2,\n display: \"inline-flex\",\n },\n createConditionButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n createGroupButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n});\n"],"names":["useClasses","staticClasses","createClasses","root","position","padding","theme","space","sm","marginTop","marginBottom","border","colors","atmo4","topGroup","margin","backgroundColor","maxWidth","minWidth","paddingBottom","md","subGroup","minHeight","content","zIndex","width","height","borderBottom","borderLeft","top","left","combinator","topCombinator","combinatorButton","removeButton","topRemoveButton","right","topRemoveButtonDisabled","atmo2","rulesContainer","subRulesContainer","marginLeft","paddingLeft","paddingTop","actionButtonContainer","topActionButtonContainer","bottom","topRulesContainer","buttonBackground","display","createConditionButton","cursor","createGroupButton"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAAc,kBAAkB;AAAA;AAAA,EAE3EC,MAAM;AAAA,IACJC,UAAU;AAAA,IACVC,SAASC,MAAMC,MAAMC;AAAAA,IACrBC,WAAW;AAAA,IACXC,cAAc;AAAA,IACdC,QAAS,aAAYL,MAAMM,OAAOC,KAAM;AAAA,EAC1C;AAAA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;AAAA;AAAA,EAE/DC,gBAAgB,CAAC;AAAA;AAAA,EAEjBC,mBAAmB;AAAA,IACjBZ,YAAa,aAAYtB,MAAMM,OAAOC,KAAM;AAAA,IAC5C4B,YAAYnC,MAAMC,MAAMC;AAAAA,IACxBE,cAAcJ,MAAMC,MAAMa;AAAAA,IAC1BsB,aAAapC,MAAMC,MAAMC;AAAAA,IACzBmC,YAAY;AAAA,IACZvC,UAAU;AAAA,IACV0B,MAAM;AAAA,IACNL,OAAO;AAAA,EACT;AAAA;AAAA,EAEAmB,uBAAuB;AAAA,IACrBH,YAAY;AAAA,IAEZ,OAAO;AAAA,MACLA,YAAYnC,MAAMC,MAAMC;AAAAA,IAC1B;AAAA,EACF;AAAA;AAAA,EAEAqC,0BAA0B;AAAA,IACxBzC,UAAU;AAAA,IACV0C,QAAS,aAAYxC,MAAMC,MAAMa,EAAG;AAAA,IACpCgB,OAAQ,QAAO9B,MAAMC,MAAMC,EAAG;AAAA,EAChC;AAAA;AAAA,EAEAuC,mBAAmB,CAAC;AAAA;AAAA,EAEpBC,kBAAkB;AAAA,IAChBhC,iBAAiBV,MAAMM,OAAO0B;AAAAA,IAC9BW,SAAS;AAAA,EACX;AAAA,EACAC,uBAAuB;AAAA,IACrBC,QAAQ;AAAA,IACRnC,iBAAiB;AAAA,IACjBX,SAAS;AAAA,EACX;AAAA,EACA+C,mBAAmB;AAAA,IACjBD,QAAQ;AAAA,IACRnC,iBAAiB;AAAA,IACjBX,SAAS;AAAA,EACX;AACF,CAAC;"}
1
+ {"version":3,"file":"QueryBuilder.styles.js","sources":["../../../../src/components/QueryBuilder/QueryBuilder.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvQueryBuilder\", {\n /** Styles applied to the component root class. */\n root: {\n position: \"relative\",\n padding: theme.space.sm,\n marginTop: 12,\n marginBottom: 32,\n border: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the top group container. */\n topGroup: {\n margin: theme.space.sm,\n backgroundColor: \"transparent\",\n maxWidth: \"100%\",\n paddingBottom: theme.space.lg,\n },\n /** Styles applied to the sub group containers. */\n subGroup: {\n margin: \"40px 14px 32px 20px\",\n minHeight: 120,\n paddingBottom: theme.space.md,\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: 21,\n height: 36,\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: -38,\n left: -38,\n },\n \":not($topRulesContainer)>&:last-child::after\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: 32,\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(${theme.space.sm} + 2)`,\n },\n },\n /** Styles applied to the radio button+label topGroup when the radio button is disabled. */\n combinator: { minWidth: 80 },\n /** Styles applied to the multi-button combinator container on the top group. */\n topCombinator: {\n position: \"absolute\",\n top: `calc(-1 * ${theme.space.sm})`,\n left: `calc(-1 * ${theme.space.sm})`,\n },\n /** Styles applied to each combinator button. */\n combinatorButton: {},\n /** Styles applied to the remove button. */\n removeButton: {},\n /** Styles applied to the remove button on the top group. */\n topRemoveButton: { position: \"absolute\", top: -16, right: -16 },\n /** Styles applied to the remove button when disabled on the top group. */\n topRemoveButtonDisabled: { backgroundColor: theme.colors.atmo2 },\n /** Styles applied to the rules container. */\n rulesContainer: {},\n /** Styles applied to the sub rules container. */\n subRulesContainer: {\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n marginLeft: theme.space.sm,\n marginBottom: theme.space.md,\n paddingLeft: theme.space.sm,\n paddingTop: 7,\n position: \"relative\",\n left: -33,\n width: \"100%\",\n },\n /** Styles applied to the action button container. */\n actionButtonContainer: {\n marginLeft: \"auto\",\n\n \"&>*\": {\n marginLeft: theme.space.sm,\n },\n },\n /** Styles applied to the top action button container. */\n topActionButtonContainer: {\n position: \"absolute\",\n bottom: `calc(-1 * ${theme.space.md} * 0.5 - 3px)`,\n right: `calc(${theme.space.sm} * 1.75 + 2px)`,\n },\n /** Styles applied to the top rules container. */\n topRulesContainer: {},\n /** Styles applied to the background of buttons to remove transparency */\n buttonBackground: {\n backgroundColor: theme.colors.atmo2,\n display: \"inline-flex\",\n },\n createConditionButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n createGroupButton: {\n cursor: \"pointer\",\n backgroundColor: \"transparent\",\n padding: 0,\n },\n});\n"],"names":["useClasses","staticClasses","createClasses","root","position","padding","theme","space","sm","marginTop","marginBottom","border","colors","atmo4","topGroup","margin","backgroundColor","maxWidth","paddingBottom","lg","subGroup","minHeight","md","content","zIndex","width","height","borderBottom","borderLeft","top","left","combinator","minWidth","topCombinator","combinatorButton","removeButton","topRemoveButton","right","topRemoveButtonDisabled","atmo2","rulesContainer","subRulesContainer","marginLeft","paddingLeft","paddingTop","actionButtonContainer","topActionButtonContainer","bottom","topRulesContainer","buttonBackground","display","createConditionButton","cursor","createGroupButton"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAAc,kBAAkB;AAAA;AAAA,EAE3EC,MAAM;AAAA,IACJC,UAAU;AAAA,IACVC,SAASC,MAAMC,MAAMC;AAAAA,IACrBC,WAAW;AAAA,IACXC,cAAc;AAAA,IACdC,QAAS,aAAYL,MAAMM,OAAOC,KAAM;AAAA,EAC1C;AAAA;AAAA,EAEAC,UAAU;AAAA,IACRC,QAAQT,MAAMC,MAAMC;AAAAA,IACpBQ,iBAAiB;AAAA,IACjBC,UAAU;AAAA,IACVC,eAAeZ,MAAMC,MAAMY;AAAAA,EAC7B;AAAA;AAAA,EAEAC,UAAU;AAAA,IACRL,QAAQ;AAAA,IACRM,WAAW;AAAA,IACXH,eAAeZ,MAAMC,MAAMe;AAAAA,IAE3B,aAAa;AAAA,MACXC,SAAS;AAAA,MACT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,OAAO;AAAA,EACT;AAAA;AAAA,EAEAoB,uBAAuB;AAAA,IACrBH,YAAY;AAAA,IAEZ,OAAO;AAAA,MACLA,YAAYpC,MAAMC,MAAMC;AAAAA,IAC1B;AAAA,EACF;AAAA;AAAA,EAEAsC,0BAA0B;AAAA,IACxB1C,UAAU;AAAA,IACV2C,QAAS,aAAYzC,MAAMC,MAAMe,EAAG;AAAA,IACpCe,OAAQ,QAAO/B,MAAMC,MAAMC,EAAG;AAAA,EAChC;AAAA;AAAA,EAEAwC,mBAAmB,CAAC;AAAA;AAAA,EAEpBC,kBAAkB;AAAA,IAChBjC,iBAAiBV,MAAMM,OAAO2B;AAAAA,IAC9BW,SAAS;AAAA,EACX;AAAA,EACAC,uBAAuB;AAAA,IACrBC,QAAQ;AAAA,IACRpC,iBAAiB;AAAA,IACjBX,SAAS;AAAA,EACX;AAAA,EACAgD,mBAAmB;AAAA,IACjBD,QAAQ;AAAA,IACRpC,iBAAiB;AAAA,IACjBX,SAAS;AAAA,EACX;AACF,CAAC;"}
@@ -52,10 +52,10 @@ const Rule = (props) => {
52
52
  const DeleteIcon = withTooltip(() => /* @__PURE__ */ jsx(Delete, {}), labels.rule.delete.tooltip, "bottom");
53
53
  return /* @__PURE__ */ jsxs(HvGrid, { container: true, className: cx(classes.root, {
54
54
  [classes.isMdDown]: isMdDown
55
- }), spacing: 0, wrap: "nowrap", children: [
56
- /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 2, lg: 3, children: /* @__PURE__ */ jsx(Attribute, { attribute, id, disabled, isInvalid }) }),
57
- attribute != null && availableOperators > 0 && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 2, lg: 3, children: /* @__PURE__ */ jsx(Operator, { id, combinator, attribute, operator }) }),
58
- attribute != null && (operator != null || availableOperators === 0) && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: true, children: shouldShowValueInput && /* @__PURE__ */ jsx(Value, { attribute, id, operator, value }) }),
55
+ }), spacing: 0, children: [
56
+ /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: 3, children: /* @__PURE__ */ jsx(Attribute, { attribute, id, disabled, isInvalid }) }),
57
+ attribute != null && availableOperators > 0 && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: 3, children: /* @__PURE__ */ jsx(Operator, { id, combinator, attribute, operator }) }),
58
+ attribute != null && (operator != null || availableOperators === 0) && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: true, children: shouldShowValueInput && /* @__PURE__ */ jsx(Value, { attribute, id, operator, value }) }),
59
59
  /* @__PURE__ */ jsx(HvGrid, { item: true, className: classes.actionsContainer, children: /* @__PURE__ */ jsx(HvButton, { icon: true, "aria-label": labels.rule.delete.ariaLabel, onClick: () => disableConfirmation ? dispatchAction({
60
60
  type: "remove-node",
61
61
  id
@@ -1 +1 @@
1
- {"version":3,"file":"Rule.js","sources":["../../../../../src/components/QueryBuilder/Rule/Rule.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Delete } from \"@hitachivantara/uikit-react-icons\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\nimport { HvGrid } from \"@core/components/Grid\";\nimport { HvButton } from \"@core/components/Button\";\nimport { withTooltip } from \"@core/hocs/withTooltip\";\nimport { useDefaultProps } from \"@core/hooks\";\nimport { ExtractNames } from \"@core/utils\";\n\nimport { useQueryBuilderContext } from \"../Context\";\nimport { Attribute } from \"./Attribute\";\nimport { Operator } from \"./Operator\";\nimport { Value } from \"./Value\";\nimport { staticClasses, useClasses } from \"./Rule.styles\";\n\nexport { staticClasses as queryBuilderRuleClasses };\n\nexport type HvQueryBuilderRuleClasses = ExtractNames<typeof useClasses>;\n\nexport interface RuleProps {\n id: React.Key;\n combinator: string;\n attribute?: string;\n operator?: string;\n value?: any;\n disabled?: boolean;\n isInvalid: boolean;\n classes?: HvQueryBuilderRuleClasses;\n}\n\nexport const Rule = (props: RuleProps) => {\n const {\n id,\n combinator,\n attribute,\n operator,\n value,\n disabled,\n isInvalid,\n classes: classesProp,\n } = useDefaultProps(\"HvQueryBuilderRule\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const {\n askAction,\n dispatchAction,\n attributes,\n operators,\n labels,\n readOnly,\n disableConfirmation,\n } = useQueryBuilderContext();\n\n const theme = useTheme();\n\n const isMdDown = useMediaQuery(theme.breakpoints.down(\"md\"));\n\n const availableOperators = useMemo(() => {\n const attributeSpec =\n attribute != null && attributes ? attributes[attribute] : null;\n if (attributeSpec != null) {\n const typeOperators = operators[attributeSpec.type];\n if (typeOperators != null) {\n return typeOperators.reduce(\n (count, item) =>\n count + (item.combinators.includes(combinator) ? 1 : 0),\n 0\n );\n }\n }\n\n return -1;\n }, [attribute, attributes, combinator, operators]);\n\n const shouldShowValueInput =\n operator !== \"Empty\" && operator !== \"IsNotEmpty\";\n\n const DeleteIcon = withTooltip(\n () => <Delete />,\n labels.rule.delete.tooltip,\n \"bottom\"\n );\n\n return (\n <HvGrid\n container\n className={cx(classes.root, { [classes.isMdDown]: isMdDown })}\n spacing={0}\n wrap=\"nowrap\"\n >\n <HvGrid item xs={2} lg={3}>\n <Attribute\n attribute={attribute}\n id={id}\n disabled={disabled}\n isInvalid={isInvalid}\n />\n </HvGrid>\n {attribute != null && availableOperators > 0 && (\n <HvGrid item xs={2} lg={3}>\n <Operator\n id={id}\n combinator={combinator}\n attribute={attribute}\n operator={operator}\n />\n </HvGrid>\n )}\n {attribute != null && (operator != null || availableOperators === 0) && (\n <HvGrid item xs>\n {shouldShowValueInput && (\n <Value\n attribute={attribute}\n id={id}\n operator={operator}\n value={value}\n />\n )}\n </HvGrid>\n )}\n <HvGrid item className={classes.actionsContainer}>\n <HvButton\n icon\n aria-label={labels.rule.delete.ariaLabel}\n onClick={() =>\n disableConfirmation\n ? dispatchAction({ type: \"remove-node\", id })\n : askAction({\n actions: [{ type: \"remove-node\", id }],\n dialog: labels.rule.delete,\n })\n }\n disabled={readOnly}\n >\n <DeleteIcon />\n </HvButton>\n </HvGrid>\n </HvGrid>\n );\n};\n"],"names":["Rule","props","id","combinator","attribute","operator","value","disabled","isInvalid","classes","classesProp","useDefaultProps","cx","useClasses","askAction","dispatchAction","attributes","operators","labels","readOnly","disableConfirmation","useQueryBuilderContext","theme","useTheme","isMdDown","useMediaQuery","breakpoints","down","availableOperators","useMemo","attributeSpec","typeOperators","type","reduce","count","item","combinators","includes","shouldShowValueInput","DeleteIcon","withTooltip","rule","delete","tooltip","root","actionsContainer","ariaLabel","actions","dialog"],"mappings":";;;;;;;;;;;;;;AA+BaA,MAAAA,OAAOA,CAACC,UAAqB;AAClC,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,EAAAA,IACPC,gBAAgB,sBAAsBV,KAAK;AAEzC,QAAA;AAAA,IAAEQ;AAAAA,IAASG;AAAAA,EAAAA,IAAOC,WAAWH,WAAW;AAExC,QAAA;AAAA,IACJI;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,MACEC,uBAAuB;AAE3B,QAAMC,QAAQC;AAEd,QAAMC,WAAWC,cAAcH,MAAMI,YAAYC,KAAK,IAAI,CAAC;AAErDC,QAAAA,qBAAqBC,QAAQ,MAAM;AACvC,UAAMC,gBACJ1B,aAAa,QAAQY,aAAaA,WAAWZ,SAAS,IAAI;AAC5D,QAAI0B,iBAAiB,MAAM;AACnBC,YAAAA,gBAAgBd,UAAUa,cAAcE,IAAI;AAClD,UAAID,iBAAiB,MAAM;AACzB,eAAOA,cAAcE,OACnB,CAACC,OAAOC,SACND,SAASC,KAAKC,YAAYC,SAASlC,UAAU,IAAI,IAAI,IACvD,CACF;AAAA,MACF;AAAA,IACF;AAEO,WAAA;AAAA,KACN,CAACC,WAAWY,YAAYb,YAAYc,SAAS,CAAC;AAE3CqB,QAAAA,uBACJjC,aAAa,WAAWA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.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Delete } from \"@hitachivantara/uikit-react-icons\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\nimport { HvGrid } from \"@core/components/Grid\";\nimport { HvButton } from \"@core/components/Button\";\nimport { withTooltip } from \"@core/hocs/withTooltip\";\nimport { useDefaultProps } from \"@core/hooks\";\nimport { ExtractNames } from \"@core/utils\";\n\nimport { useQueryBuilderContext } from \"../Context\";\nimport { Attribute } from \"./Attribute\";\nimport { Operator } from \"./Operator\";\nimport { Value } from \"./Value\";\nimport { staticClasses, useClasses } from \"./Rule.styles\";\n\nexport { staticClasses as queryBuilderRuleClasses };\n\nexport type HvQueryBuilderRuleClasses = ExtractNames<typeof useClasses>;\n\nexport interface RuleProps {\n id: React.Key;\n combinator: string;\n attribute?: string;\n operator?: string;\n value?: any;\n disabled?: boolean;\n isInvalid: boolean;\n classes?: HvQueryBuilderRuleClasses;\n}\n\nexport const Rule = (props: RuleProps) => {\n const {\n id,\n combinator,\n attribute,\n operator,\n value,\n disabled,\n isInvalid,\n classes: classesProp,\n } = useDefaultProps(\"HvQueryBuilderRule\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const {\n askAction,\n dispatchAction,\n attributes,\n operators,\n labels,\n readOnly,\n disableConfirmation,\n } = useQueryBuilderContext();\n\n const theme = useTheme();\n\n const isMdDown = useMediaQuery(theme.breakpoints.down(\"md\"));\n\n const availableOperators = useMemo(() => {\n const attributeSpec =\n attribute != null && attributes ? attributes[attribute] : null;\n if (attributeSpec != null) {\n const typeOperators = operators[attributeSpec.type];\n if (typeOperators != null) {\n return typeOperators.reduce(\n (count, item) =>\n count + (item.combinators.includes(combinator) ? 1 : 0),\n 0\n );\n }\n }\n\n return -1;\n }, [attribute, attributes, combinator, operators]);\n\n const shouldShowValueInput =\n operator !== \"Empty\" && operator !== \"IsNotEmpty\";\n\n const DeleteIcon = withTooltip(\n () => <Delete />,\n labels.rule.delete.tooltip,\n \"bottom\"\n );\n\n return (\n <HvGrid\n container\n className={cx(classes.root, { [classes.isMdDown]: isMdDown })}\n spacing={0}\n >\n <HvGrid item xs={12} md={3}>\n <Attribute\n attribute={attribute}\n id={id}\n disabled={disabled}\n isInvalid={isInvalid}\n />\n </HvGrid>\n {attribute != null && availableOperators > 0 && (\n <HvGrid item xs={12} md={3}>\n <Operator\n id={id}\n combinator={combinator}\n attribute={attribute}\n operator={operator}\n />\n </HvGrid>\n )}\n {attribute != null && (operator != null || availableOperators === 0) && (\n <HvGrid item xs={12} md>\n {shouldShowValueInput && (\n <Value\n attribute={attribute}\n id={id}\n operator={operator}\n value={value}\n />\n )}\n </HvGrid>\n )}\n <HvGrid item className={classes.actionsContainer}>\n <HvButton\n icon\n aria-label={labels.rule.delete.ariaLabel}\n onClick={() =>\n disableConfirmation\n ? dispatchAction({ type: \"remove-node\", id })\n : askAction({\n actions: [{ type: \"remove-node\", id }],\n dialog: labels.rule.delete,\n })\n }\n disabled={readOnly}\n >\n <DeleteIcon />\n </HvButton>\n </HvGrid>\n </HvGrid>\n );\n};\n"],"names":["Rule","props","id","combinator","attribute","operator","value","disabled","isInvalid","classes","classesProp","useDefaultProps","cx","useClasses","askAction","dispatchAction","attributes","operators","labels","readOnly","disableConfirmation","useQueryBuilderContext","theme","useTheme","isMdDown","useMediaQuery","breakpoints","down","availableOperators","useMemo","attributeSpec","typeOperators","type","reduce","count","item","combinators","includes","shouldShowValueInput","DeleteIcon","withTooltip","rule","delete","tooltip","root","actionsContainer","ariaLabel","actions","dialog"],"mappings":";;;;;;;;;;;;;;AA+BaA,MAAAA,OAAOA,CAACC,UAAqB;AAClC,QAAA;AAAA,IACJC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC,SAASC;AAAAA,EAAAA,IACPC,gBAAgB,sBAAsBV,KAAK;AAEzC,QAAA;AAAA,IAAEQ;AAAAA,IAASG;AAAAA,EAAAA,IAAOC,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AuB,MAChE,oBAAC,UAAO,MAAI,MAAC,IAAI,IAAI,IAAE,MACpBU,UACC,wBAAA,oBAAC,SACC,WACA,IACA,UACA,MAAA,CAEH,EACH,CAAA;AAAA,wBAED,QAAO,EAAA,MAAI,MAAC,WAAW7B,QAAQoC,kBAC9B,UAAC,oBAAA,UAAA,EACC,MAAI,MACJ,cAAY3B,OAAOuB,KAAKC,OAAOI,WAC/B,SAAS,MACP1B,sBACIL,eAAe;AAAA,MAAEiB,MAAM;AAAA,MAAe9B;AAAAA,IAAI,CAAA,IAC1CY,UAAU;AAAA,MACRiC,SAAS,CAAC;AAAA,QAAEf,MAAM;AAAA,QAAe9B;AAAAA,MAAAA,CAAI;AAAA,MACrC8C,QAAQ9B,OAAOuB,KAAKC;AAAAA,IAAAA,CACrB,GAEP,UAAUvB,UAEV,UAAC,oBAAA,YAAA,CAAA,CAAU,EACb,CAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -10,7 +10,7 @@ const {
10
10
  marginTop: theme.space.xs,
11
11
  minHeight: 94,
12
12
  "&>div:not(:last-child)": {
13
- marginRight: theme.space.md
13
+ paddingRight: theme.space.md
14
14
  },
15
15
  // hide required * as all fields are required
16
16
  "& label>span[aria-hidden]": {
@@ -25,7 +25,7 @@ const {
25
25
  borderBottom: `1px solid ${theme.colors.atmo4}`,
26
26
  borderLeft: `1px solid ${theme.colors.atmo4}`,
27
27
  top: 0,
28
- left: `calc( -1 * 17px)`
28
+ left: `calc(-1 * 17px)`
29
29
  },
30
30
  [`:not(.${staticClasses$1.topRulesContainer})>&:last-child::after`]: {
31
31
  content: '""',
@@ -35,7 +35,7 @@ const {
35
35
  height: "100%",
36
36
  borderLeft: `1px solid ${theme.colors.atmo4}`,
37
37
  top: 0,
38
- left: `calc( -1 * 17px)`
38
+ left: `calc(-1 * 17px)`
39
39
  }
40
40
  },
41
41
  actionsContainer: {
@@ -47,7 +47,10 @@ const {
47
47
  },
48
48
  isMdDown: {
49
49
  "&>div:not(:last-child)": {
50
- marginRight: `calc(${theme.space.md} / 2)`
50
+ paddingRight: 0
51
+ },
52
+ "&>div:not(:first-child)": {
53
+ marginTop: theme.space.xs
51
54
  }
52
55
  }
53
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Rule.styles.js","sources":["../../../../../src/components/QueryBuilder/Rule/Rule.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nimport { staticClasses as queryBuilderClasses } from \"../QueryBuilder.styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-Rule\",\n {\n root: {\n position: \"relative\",\n marginTop: theme.space.xs,\n\n minHeight: 94,\n\n \"&>div:not(:last-child)\": {\n marginRight: theme.space.md,\n },\n\n // hide required * as all fields are required\n \"& label>span[aria-hidden]\": {\n visibility: \"hidden\",\n },\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: \"17px\",\n height: \"39px\",\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc( -1 * 17px)`,\n },\n [`:not(.${queryBuilderClasses.topRulesContainer})>&:last-child::after`]: {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: \"17px\",\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc( -1 * 17px)`,\n },\n },\n actionsContainer: {\n marginLeft: \"auto\",\n marginTop: \"24px\",\n\n \"&>:not(:last-child)\": {\n marginRight: theme.space.xs,\n },\n },\n isMdDown: {\n \"&>div:not(:last-child)\": {\n marginRight: `calc(${theme.space.md} / 2)`,\n },\n },\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","root","position","marginTop","theme","space","xs","minHeight","marginRight","md","visibility","content","zIndex","width","height","borderBottom","colors","atmo4","borderLeft","top","left","queryBuilderClasses","topRulesContainer","actionsContainer","marginLeft","isMdDown"],"mappings":";;;AAMa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,uBACA;AAAA,EACEC,MAAM;AAAA,IACJC,UAAU;AAAA,IACVC,WAAWC,MAAMC,MAAMC;AAAAA,IAEvBC,WAAW;AAAA,IAEX,0BAA0B;AAAA,MACxBC,aAAaJ,MAAMC,MAAMI;AAAAA,IAC3B;AAAA;AAAA,IAGA,6BAA6B;AAAA,MAC3BC,YAAY;AAAA,IACd;AAAA,IACA,aAAa;AAAA,MACXC,SAAS;AAAA,MACTT,UAAU;AAAA,MACVU,QAAQ;AAAA,MAERC,OAAO;AAAA,MACPC,QAAQ;AAAA,MAERC,cAAe,aAAYX,MAAMY,OAAOC,KAAM;AAAA,MAC9CC,YAAa,aAAYd,MAAMY,OAAOC,KAAM;AAAA,MAE5CE,KAAK;AAAA,MACLC,MAAO;AAAA,IACT;AAAA,IACA,CAAE,SAAQC,gBAAoBC,iBAAkB,uBAAsB,GAAG;AAAA,MACvEX,SAAS;AAAA,MACTT,UAAU;AAAA,MACVU,QAAQ;AAAA,MAERC,OAAO;AAAA,MACPC,QAAQ;AAAA,MAERI,YAAa,aAAYd,MAAMY,OAAOC,KAAM;AAAA,MAE5CE,KAAK;AAAA,MACLC,MAAO;AAAA,IACT;AAAA,EACF;AAAA,EACAG,kBAAkB;AAAA,IAChBC,YAAY;AAAA,IACZrB,WAAW;AAAA,IAEX,uBAAuB;AAAA,MACrBK,aAAaJ,MAAMC,MAAMC;AAAAA,IAC3B;AAAA,EACF;AAAA,EACAmB,UAAU;AAAA,IACR,0BAA0B;AAAA,MACxBjB,aAAc,QAAOJ,MAAMC,MAAMI,EAAG;AAAA,IACtC;AAAA,EACF;AACF,CACF;"}
1
+ {"version":3,"file":"Rule.styles.js","sources":["../../../../../src/components/QueryBuilder/Rule/Rule.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nimport { staticClasses as queryBuilderClasses } from \"../QueryBuilder.styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-Rule\",\n {\n root: {\n position: \"relative\",\n marginTop: theme.space.xs,\n minHeight: 94,\n\n \"&>div:not(:last-child)\": {\n paddingRight: theme.space.md,\n },\n\n // hide required * as all fields are required\n \"& label>span[aria-hidden]\": {\n visibility: \"hidden\",\n },\n\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 2,\n\n width: \"17px\",\n height: \"39px\",\n\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(-1 * 17px)`,\n },\n\n [`:not(.${queryBuilderClasses.topRulesContainer})>&:last-child::after`]: {\n content: '\"\"',\n position: \"absolute\",\n zIndex: 1,\n\n width: \"17px\",\n height: \"100%\",\n\n borderLeft: `1px solid ${theme.colors.atmo4}`,\n\n top: 0,\n left: `calc(-1 * 17px)`,\n },\n },\n actionsContainer: {\n marginLeft: \"auto\",\n marginTop: \"24px\",\n\n \"&>:not(:last-child)\": {\n marginRight: theme.space.xs,\n },\n },\n isMdDown: {\n \"&>div:not(:last-child)\": {\n paddingRight: 0,\n },\n \"&>div:not(:first-child)\": {\n marginTop: theme.space.xs,\n },\n },\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","root","position","marginTop","theme","space","xs","minHeight","paddingRight","md","visibility","content","zIndex","width","height","borderBottom","colors","atmo4","borderLeft","top","left","queryBuilderClasses","topRulesContainer","actionsContainer","marginLeft","marginRight","isMdDown"],"mappings":";;;AAMa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,uBACA;AAAA,EACEC,MAAM;AAAA,IACJC,UAAU;AAAA,IACVC,WAAWC,MAAMC,MAAMC;AAAAA,IACvBC,WAAW;AAAA,IAEX,0BAA0B;AAAA,MACxBC,cAAcJ,MAAMC,MAAMI;AAAAA,IAC5B;AAAA;AAAA,IAGA,6BAA6B;AAAA,MAC3BC,YAAY;AAAA,IACd;AAAA,IAEA,aAAa;AAAA,MACXC,SAAS;AAAA,MACTT,UAAU;AAAA,MACVU,QAAQ;AAAA,MAERC,OAAO;AAAA,MACPC,QAAQ;AAAA,MAERC,cAAe,aAAYX,MAAMY,OAAOC,KAAM;AAAA,MAC9CC,YAAa,aAAYd,MAAMY,OAAOC,KAAM;AAAA,MAE5CE,KAAK;AAAA,MACLC,MAAO;AAAA,IACT;AAAA,IAEA,CAAE,SAAQC,gBAAoBC,iBAAkB,uBAAsB,GAAG;AAAA,MACvEX,SAAS;AAAA,MACTT,UAAU;AAAA,MACVU,QAAQ;AAAA,MAERC,OAAO;AAAA,MACPC,QAAQ;AAAA,MAERI,YAAa,aAAYd,MAAMY,OAAOC,KAAM;AAAA,MAE5CE,KAAK;AAAA,MACLC,MAAO;AAAA,IACT;AAAA,EACF;AAAA,EACAG,kBAAkB;AAAA,IAChBC,YAAY;AAAA,IACZrB,WAAW;AAAA,IAEX,uBAAuB;AAAA,MACrBsB,aAAarB,MAAMC,MAAMC;AAAAA,IAC3B;AAAA,EACF;AAAA,EACAoB,UAAU;AAAA,IACR,0BAA0B;AAAA,MACxBlB,cAAc;AAAA,IAChB;AAAA,IACA,2BAA2B;AAAA,MACzBL,WAAWC,MAAMC,MAAMC;AAAAA,IACzB;AAAA,EACF;AACF,CACF;"}
@@ -8,9 +8,7 @@ const {
8
8
  display: "flex",
9
9
  flexDirection: "column"
10
10
  },
11
- row: {
12
- minHeight: 94
13
- },
11
+ row: {},
14
12
  vertical: {
15
13
  display: "flex",
16
14
  flexDirection: "column"
@@ -27,10 +25,10 @@ const {
27
25
  }
28
26
  },
29
27
  datePicker: {
30
- flex: "0 1 300px"
28
+ flex: 1
31
29
  },
32
30
  timePicker: {
33
- flex: "0 1 220px"
31
+ flex: 1
34
32
  }
35
33
  });
36
34
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeValue.styles.js","sources":["../../../../../../../src/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-DateTimeValue\",\n {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n row: {\n minHeight: 94,\n },\n vertical: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n horizontal: {\n display: \"flex\",\n\n \"& > div:not(:last-child)\": {\n marginRight: theme.space.md,\n },\n },\n isMdDown: {\n \"& > div:not(:last-child)\": {\n marginRight: `calc(${theme.space.md} / 2)`,\n },\n },\n datePicker: {\n flex: \"0 1 300px\",\n },\n timePicker: {\n flex: \"0 1 220px\",\n },\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","root","display","flexDirection","row","minHeight","vertical","horizontal","marginRight","theme","space","md","isMdDown","datePicker","flex","timePicker"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,gCACA;AAAA,EACEC,MAAM;AAAA,IACJC,SAAS;AAAA,IACTC,eAAe;AAAA,EACjB;AAAA,EACAC,KAAK;AAAA,IACHC,WAAW;AAAA,EACb;AAAA,EACAC,UAAU;AAAA,IACRJ,SAAS;AAAA,IACTC,eAAe;AAAA,EACjB;AAAA,EACAI,YAAY;AAAA,IACVL,SAAS;AAAA,IAET,4BAA4B;AAAA,MAC1BM,aAAaC,MAAMC,MAAMC;AAAAA,IAC3B;AAAA,EACF;AAAA,EACAC,UAAU;AAAA,IACR,4BAA4B;AAAA,MAC1BJ,aAAc,QAAOC,MAAMC,MAAMC,EAAG;AAAA,IACtC;AAAA,EACF;AAAA,EACAE,YAAY;AAAA,IACVC,MAAM;AAAA,EACR;AAAA,EACAC,YAAY;AAAA,IACVD,MAAM;AAAA,EACR;AACF,CACF;"}
1
+ {"version":3,"file":"DateTimeValue.styles.js","sources":["../../../../../../../src/components/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"@core/utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\n \"HvQueryBuilder-DateTimeValue\",\n {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n row: {},\n vertical: {\n display: \"flex\",\n flexDirection: \"column\",\n },\n horizontal: {\n display: \"flex\",\n\n \"& > div:not(:last-child)\": {\n marginRight: theme.space.md,\n },\n },\n isMdDown: {\n \"& > div:not(:last-child)\": {\n marginRight: `calc(${theme.space.md} / 2)`,\n },\n },\n datePicker: {\n flex: 1,\n },\n timePicker: {\n flex: 1,\n },\n }\n);\n"],"names":["useClasses","staticClasses","createClasses","root","display","flexDirection","row","vertical","horizontal","marginRight","theme","space","md","isMdDown","datePicker","flex","timePicker"],"mappings":";;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAYC;AAAc,IAAIC,cAC3C,gCACA;AAAA,EACEC,MAAM;AAAA,IACJC,SAAS;AAAA,IACTC,eAAe;AAAA,EACjB;AAAA,EACAC,KAAK,CAAC;AAAA,EACNC,UAAU;AAAA,IACRH,SAAS;AAAA,IACTC,eAAe;AAAA,EACjB;AAAA,EACAG,YAAY;AAAA,IACVJ,SAAS;AAAA,IAET,4BAA4B;AAAA,MAC1BK,aAAaC,MAAMC,MAAMC;AAAAA,IAC3B;AAAA,EACF;AAAA,EACAC,UAAU;AAAA,IACR,4BAA4B;AAAA,MAC1BJ,aAAc,QAAOC,MAAMC,MAAMC,EAAG;AAAA,IACtC;AAAA,EACF;AAAA,EACAE,YAAY;AAAA,IACVC,MAAM;AAAA,EACR;AAAA,EACAC,YAAY;AAAA,IACVD,MAAM;AAAA,EACR;AACF,CACF;"}