@itwin/appui-react 5.23.1 → 5.24.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.
- package/CHANGELOG.md +12 -0
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.d.ts +1 -0
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js +9 -3
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.js +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log - @itwin/appui-react
|
|
2
2
|
|
|
3
|
+
## 5.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6d0c07d: Tooltip content for icons in HeaderIconToolbar of WidgetContentLayout
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @itwin/components-react@5.24.0
|
|
12
|
+
- @itwin/core-react@5.24.0
|
|
13
|
+
- @itwin/imodel-components-react@5.24.0
|
|
14
|
+
|
|
3
15
|
## 5.23.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetContentLayout.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,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BAAqB,CAAC,KAAK,CAAC;IACzE;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA+BD,UAAU,8BAA+B,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAC3E;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA6BD,UAAU,wBAAyB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACrE;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA2CD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;;;;CAI9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"WidgetContentLayout.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,KAAK,QAAQ,GAAG,cAAc,GAAG,eAAe,CAAC;AAEjD,UAAU,cAAc;IACtB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CA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,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA2CD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;;;;CAI9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetContentLayout.js","sourceRoot":"","sources":["../../../../../src/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG/E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAwDxD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG;IACxB,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CACnB,sCAAsC,EACtC,SAAS,CACV,KACG,IAAI,EACR,GAAG,EAAE,GAAG;QAER,oBAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAClB;QACD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC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KAAK,GAAG,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,CACvD,oBAAC,OAAO,IAAC,SAAS,EAAC,uCAAuC,GAAG,CAC9D,CACc,CAClB,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE;IACzE,MAAM;IACN,IAAI;IACJ,MAAM;CACP,CAAC,CAAC;AAEH,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC;AACpC,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC;AAChC,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module WidgetContentLayout\n */\n\nimport \"./WidgetContentLayout.scss\";\nimport classNames from \"classnames\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport * as React from \"react\";\n\nimport { Divider, ProgressLinear, ProgressRadial } from \"@itwin/itwinui-react\";\nimport type { ToggleSwitch } from \"@itwin/itwinui-react\";\n\nimport { HeaderLayout } from \"./header/HeaderLayout.js\";\n\ntype IconMenu = IconMenuButton | IconMenuDivider;\n\ninterface IconMenuButton {\n icon: React.ReactNode;\n onClick: () => void;\n label: string;\n type?: \"button\";\n disabled?: boolean;\n isActive?: boolean;\n}\n\ninterface IconMenuDivider {\n type: \"divider\";\n key?: string;\n}\n\ninterface WidgetContentLayoutHeaderProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Toggle switch in the header.\n */\n toggle?: React.ComponentProps<typeof ToggleSwitch>;\n /**\n * Array of buttons to display in the header.\n */\n buttons?: React.ReactNode[];\n /**\n * Menu in the header.\n */\n menu?: {\n title: string;\n items: { label: string; onClick: () => void }[];\n };\n /**\n * Title to display in the header.\n */\n title?: string;\n /**\n * Callback function for search functionality.\n */\n onSearch?: (value: string) => void;\n /**\n * Array of icon menu items to display in the header.\n */\n icons?: IconMenu[];\n /**\n * Size of the icons.\n */\n iconSize?: \"small\" | \"large\";\n /**\n * Child elements to render within the header.\n */\n children?: React.ReactNode;\n}\n\nconst Header = React.forwardRef<HTMLDivElement, WidgetContentLayoutHeaderProps>(\n function Header(props, ref) {\n const {\n className,\n children,\n toggle,\n buttons,\n menu,\n title,\n onSearch,\n icons,\n iconSize,\n ...rest\n } = props;\n\n return (\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-header\",\n className\n )}\n {...rest}\n ref={ref}\n >\n <HeaderLayout\n toggle={toggle}\n buttons={buttons}\n menu={menu}\n title={title}\n onSearch={onSearch}\n icons={icons}\n iconSize={iconSize}\n />\n {children}\n </div>\n );\n }\n);\n\nHeader.displayName = \"appui:WidgetContentLayout.Header\";\n\ninterface WidgetContentLayoutBodyProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Whether the body is in a loading state.\n */\n isLoading?: boolean;\n /**\n * Whether to show a non-blocking loading indicator.\n */\n isNonBlockingLoading?: boolean;\n /**\n * Child elements to render within the body.\n */\n children?: React.ReactNode;\n}\n\nconst Body = React.forwardRef<HTMLDivElement, WidgetContentLayoutBodyProps>(\n function Body(props, ref) {\n const { isNonBlockingLoading, isLoading, className, children, ...rest } =\n props;\n return (\n <div className=\"nz-widget-widgetContentLayout-body_wrapper\">\n {isLoading ? (\n <LoadingOverlay />\n ) : (\n isNonBlockingLoading && (\n <ProgressLinear className=\"nz-widget-widgetContentLayout-progress\" />\n )\n )}\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-body\",\n className\n )}\n {...rest}\n ref={ref}\n >\n {children}\n </div>\n </div>\n );\n }\n);\nBody.displayName = \"appui:WidgetContentLayout.Body\";\n\ninterface WidgetContentLayoutFooterProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Child elements to render within the footer.\n */\n children?: React.ReactNode;\n}\n\nconst Footer = React.forwardRef<HTMLDivElement, WidgetContentLayoutFooterProps>(\n function Footer(props, ref) {\n const { className, children, ...rest } = props;\n return (\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-footer\",\n className\n )}\n {...rest}\n ref={ref}\n >\n {children}\n </div>\n );\n }\n);\nFooter.displayName = \"appui:WidgetContentLayout.Footer\";\n\nfunction LoadingOverlay() {\n return (\n <div className=\"nz-widget-widgetContentLayout-loadingOverlay\">\n <ProgressRadial />\n </div>\n );\n}\n\ninterface WidgetContentLayoutProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Whether the entire layout is in a loading state.\n */\n isLoading?: boolean;\n /**\n * Whether to hide dividers between sections.\n */\n hideDividers?: boolean;\n /**\n * Child elements (Header, Body, Footer) to render.\n */\n children?: React.ReactNode;\n}\n\nconst WidgetContentLayoutInner = React.forwardRef<\n HTMLDivElement,\n WidgetContentLayoutProps\n>(function WidgetContentLayoutInner(props, ref) {\n const { isLoading, hideDividers, children, className, ...divProps } = props;\n const [headerElement, setHeaderElement] = React.useState<React.ReactNode>();\n const [bodyElement, setBodyElement] = React.useState<React.ReactNode>();\n const [footerElement, setFooterElement] = React.useState<React.ReactNode>();\n\n React.useEffect(() => {\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n if (child.type === Header) setHeaderElement(child);\n else if (child.type === Body) setBodyElement(child);\n else if (child.type === Footer) setFooterElement(child);\n });\n }, [children]);\n\n const widgetComponents = [headerElement, bodyElement, footerElement].filter(\n Boolean\n );\n\n return (\n <div\n className={classNames(\"nz-widget-widgetContentLayout\", className)}\n {...divProps}\n ref={ref}\n >\n {isLoading && <LoadingOverlay />}\n {widgetComponents.map((component, index) => (\n <React.Fragment key={index}>\n {component}\n {index < widgetComponents.length - 1 && !hideDividers && (\n <Divider className=\"nz-widget-widgetContentLayout-divider\" />\n )}\n </React.Fragment>\n ))}\n </div>\n );\n});\n\n/**\n * A layout component for widgets that provides a top section for buttons, a body section and a footer section.\n * @example\n * <WidgetContentLayout>\n * <WidgetContentLayout.Header />\n * <WidgetContentLayout.Body>\n * <ContentComponent />\n * </WidgetContentLayout.Body>\n * <WidgetContentLayout.Footer>\n * <FooterComponent />\n * </WidgetContentLayout.Footer>\n * </WidgetContentLayout>\n * @public\n */\nexport const WidgetContentLayout = Object.assign(WidgetContentLayoutInner, {\n Header,\n Body,\n Footer,\n});\n\nWidgetContentLayout.Header = Header;\nWidgetContentLayout.Body = Body;\nWidgetContentLayout.Footer = Footer;\n"]}
|
|
1
|
+
{"version":3,"file":"WidgetContentLayout.js","sourceRoot":"","sources":["../../../../../src/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,4BAA4B,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG/E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAyDxD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG;IACxB,MAAM,EACJ,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CACnB,sCAAsC,EACtC,SAAS,CACV,KACG,IAAI,EACR,GAAG,EAAE,GAAG;QAER,oBAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE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S,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK;YACvB,SAAS;YACT,KAAK,GAAG,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,CACvD,oBAAC,OAAO,IAAC,SAAS,EAAC,uCAAuC,GAAG,CAC9D,CACc,CAClB,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE;IACzE,MAAM;IACN,IAAI;IACJ,MAAM;CACP,CAAC,CAAC;AAEH,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC;AACpC,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC;AAChC,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module WidgetContentLayout\n */\n\nimport \"./WidgetContentLayout.scss\";\nimport classNames from \"classnames\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport * as React from \"react\";\n\nimport { Divider, ProgressLinear, ProgressRadial } from \"@itwin/itwinui-react\";\nimport type { ToggleSwitch } from \"@itwin/itwinui-react\";\n\nimport { HeaderLayout } from \"./header/HeaderLayout.js\";\n\ntype IconMenu = IconMenuButton | IconMenuDivider;\n\ninterface IconMenuButton {\n icon: React.ReactNode;\n onClick: () => void;\n label: string;\n tooltipContent?: string;\n type?: \"button\";\n disabled?: boolean;\n isActive?: boolean;\n}\n\ninterface IconMenuDivider {\n type: \"divider\";\n key?: string;\n}\n\ninterface WidgetContentLayoutHeaderProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Toggle switch in the header.\n */\n toggle?: React.ComponentProps<typeof ToggleSwitch>;\n /**\n * Array of buttons to display in the header.\n */\n buttons?: React.ReactNode[];\n /**\n * Menu in the header.\n */\n menu?: {\n title: string;\n items: { label: string; onClick: () => void }[];\n };\n /**\n * Title to display in the header.\n */\n title?: string;\n /**\n * Callback function for search functionality.\n */\n onSearch?: (value: string) => void;\n /**\n * Array of icon menu items to display in the header.\n */\n icons?: IconMenu[];\n /**\n * Size of the icons.\n */\n iconSize?: \"small\" | \"large\";\n /**\n * Child elements to render within the header.\n */\n children?: React.ReactNode;\n}\n\nconst Header = React.forwardRef<HTMLDivElement, WidgetContentLayoutHeaderProps>(\n function Header(props, ref) {\n const {\n className,\n children,\n toggle,\n buttons,\n menu,\n title,\n onSearch,\n icons,\n iconSize,\n ...rest\n } = props;\n\n return (\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-header\",\n className\n )}\n {...rest}\n ref={ref}\n >\n <HeaderLayout\n toggle={toggle}\n buttons={buttons}\n menu={menu}\n title={title}\n onSearch={onSearch}\n icons={icons}\n iconSize={iconSize}\n />\n {children}\n </div>\n );\n }\n);\n\nHeader.displayName = \"appui:WidgetContentLayout.Header\";\n\ninterface WidgetContentLayoutBodyProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Whether the body is in a loading state.\n */\n isLoading?: boolean;\n /**\n * Whether to show a non-blocking loading indicator.\n */\n isNonBlockingLoading?: boolean;\n /**\n * Child elements to render within the body.\n */\n children?: React.ReactNode;\n}\n\nconst Body = React.forwardRef<HTMLDivElement, WidgetContentLayoutBodyProps>(\n function Body(props, ref) {\n const { isNonBlockingLoading, isLoading, className, children, ...rest } =\n props;\n return (\n <div className=\"nz-widget-widgetContentLayout-body_wrapper\">\n {isLoading ? (\n <LoadingOverlay />\n ) : (\n isNonBlockingLoading && (\n <ProgressLinear className=\"nz-widget-widgetContentLayout-progress\" />\n )\n )}\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-body\",\n className\n )}\n {...rest}\n ref={ref}\n >\n {children}\n </div>\n </div>\n );\n }\n);\nBody.displayName = \"appui:WidgetContentLayout.Body\";\n\ninterface WidgetContentLayoutFooterProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Child elements to render within the footer.\n */\n children?: React.ReactNode;\n}\n\nconst Footer = React.forwardRef<HTMLDivElement, WidgetContentLayoutFooterProps>(\n function Footer(props, ref) {\n const { className, children, ...rest } = props;\n return (\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-footer\",\n className\n )}\n {...rest}\n ref={ref}\n >\n {children}\n </div>\n );\n }\n);\nFooter.displayName = \"appui:WidgetContentLayout.Footer\";\n\nfunction LoadingOverlay() {\n return (\n <div className=\"nz-widget-widgetContentLayout-loadingOverlay\">\n <ProgressRadial />\n </div>\n );\n}\n\ninterface WidgetContentLayoutProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Whether the entire layout is in a loading state.\n */\n isLoading?: boolean;\n /**\n * Whether to hide dividers between sections.\n */\n hideDividers?: boolean;\n /**\n * Child elements (Header, Body, Footer) to render.\n */\n children?: React.ReactNode;\n}\n\nconst WidgetContentLayoutInner = React.forwardRef<\n HTMLDivElement,\n WidgetContentLayoutProps\n>(function WidgetContentLayoutInner(props, ref) {\n const { isLoading, hideDividers, children, className, ...divProps } = props;\n const [headerElement, setHeaderElement] = React.useState<React.ReactNode>();\n const [bodyElement, setBodyElement] = React.useState<React.ReactNode>();\n const [footerElement, setFooterElement] = React.useState<React.ReactNode>();\n\n React.useEffect(() => {\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n if (child.type === Header) setHeaderElement(child);\n else if (child.type === Body) setBodyElement(child);\n else if (child.type === Footer) setFooterElement(child);\n });\n }, [children]);\n\n const widgetComponents = [headerElement, bodyElement, footerElement].filter(\n Boolean\n );\n\n return (\n <div\n className={classNames(\"nz-widget-widgetContentLayout\", className)}\n {...divProps}\n ref={ref}\n >\n {isLoading && <LoadingOverlay />}\n {widgetComponents.map((component, index) => (\n <React.Fragment key={index}>\n {component}\n {index < widgetComponents.length - 1 && !hideDividers && (\n <Divider className=\"nz-widget-widgetContentLayout-divider\" />\n )}\n </React.Fragment>\n ))}\n </div>\n );\n});\n\n/**\n * A layout component for widgets that provides a top section for buttons, a body section and a footer section.\n * @example\n * <WidgetContentLayout>\n * <WidgetContentLayout.Header />\n * <WidgetContentLayout.Body>\n * <ContentComponent />\n * </WidgetContentLayout.Body>\n * <WidgetContentLayout.Footer>\n * <FooterComponent />\n * </WidgetContentLayout.Footer>\n * </WidgetContentLayout>\n * @public\n */\nexport const WidgetContentLayout = Object.assign(WidgetContentLayoutInner, {\n Header,\n Body,\n Footer,\n});\n\nWidgetContentLayout.Header = Header;\nWidgetContentLayout.Body = Body;\nWidgetContentLayout.Footer = Footer;\n"]}
|
package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderIconToolbar.d.ts","sourceRoot":"","sources":["../../../../../../src/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HeaderIconToolbar.d.ts","sourceRoot":"","sources":["../../../../../../src/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,KAAK,8BAA8B,GAAG,KAAK,CAAC,cAAc,CACxD,OAAO,mBAAmB,CAAC,MAAM,CAClC,CAAC;AACF,KAAK,QAAQ,GAAG,WAAW,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,UAAU,cAAc;IACtB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,KAAK,mBAAmB,GAAG;IACzB,OAAO;IACP,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;CAC9C,CAAC;AAEF,UAAU,sBACR,SAAQ,IAAI,CAAC,8BAA8B,EAAE,UAAU,GAAG,UAAU,CAAC;IACrE,0FAA0F;IAC1F,SAAS,EAAE,CAAC,QAAQ,GAAG,cAAc,CAAC,EAAE,CAAC;IACzC,+EAA+E;IAC/E,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAmI9D"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import "./HeaderIconToolbar.scss";
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import { ButtonGroup, Divider, DropdownMenu, IconButton, MenuDivider, MenuItem, } from "@itwin/itwinui-react";
|
|
7
|
+
import { ButtonGroup, Divider, DropdownMenu, IconButton, MenuDivider, MenuItem, Text, Tooltip, } from "@itwin/itwinui-react";
|
|
8
8
|
import { SvgMore, SvgSearch } from "@itwin/itwinui-icons-react";
|
|
9
9
|
import { HeaderSearch } from "./HeaderSearch.js";
|
|
10
10
|
/**
|
|
@@ -27,12 +27,18 @@ export function HeaderIconToolbar(props) {
|
|
|
27
27
|
return icon.type === "divider" ? (_index === 0 || searchIsExpanded ? (React.createElement(React.Fragment, { key: index })) : (React.createElement(MenuDivider, { key: index }))) : icon.type === "search" ? (!searchIsExpanded ? (React.createElement(MenuItem, { key: index, onClick: () => {
|
|
28
28
|
close();
|
|
29
29
|
setSearchIsExpanded(true);
|
|
30
|
-
}, startIcon: React.createElement(SvgSearch, null) }, "Search")) : (React.createElement(React.Fragment, { key: index }))) : (React.createElement(
|
|
30
|
+
}, startIcon: React.createElement(SvgSearch, null) }, "Search")) : (React.createElement(React.Fragment, { key: index }))) : icon.tooltipContent ? (React.createElement(Tooltip, { content: icon.tooltipContent, key: index },
|
|
31
|
+
React.createElement(MenuItem, { isSelected: icon.isActive, disabled: icon.disabled, key: index, onClick: () => {
|
|
32
|
+
icon.onClick();
|
|
33
|
+
close();
|
|
34
|
+
}, startIcon: React.createElement(React.Fragment, null, icon.icon) }, icon.label))) : (React.createElement(MenuItem, { isSelected: icon.isActive, disabled: icon.disabled, key: index, onClick: () => {
|
|
31
35
|
icon.onClick();
|
|
32
36
|
close();
|
|
33
37
|
}, startIcon: React.createElement(React.Fragment, null, icon.icon) }, icon.label));
|
|
34
38
|
}) },
|
|
35
39
|
React.createElement(IconButton, { size: props.iconSize, styleType: "borderless", "aria-label": "More" },
|
|
36
|
-
React.createElement(SvgMore, null)))) }, props.menuIcons.map((icon, index) => icon.type === "divider" ? (React.createElement(Divider, { orientation: "vertical", key: icon.key ?? `divider-${index}` })) : icon.type === "search" ? (React.createElement(HeaderSearch, { key: "search", searchExpandedState: props.searchExpandedState, searchState: searchState, iconSize: props.iconSize, onSearch: props.onSearch })) : (React.createElement(IconButton, { disabled: icon.disabled, label: icon.
|
|
40
|
+
React.createElement(SvgMore, null)))) }, props.menuIcons.map((icon, index) => icon.type === "divider" ? (React.createElement(Divider, { orientation: "vertical", key: icon.key ?? `divider-${index}` })) : icon.type === "search" ? (React.createElement(HeaderSearch, { key: "search", searchExpandedState: props.searchExpandedState, searchState: searchState, iconSize: props.iconSize, onSearch: props.onSearch })) : (React.createElement(IconButton, { disabled: icon.disabled, label: icon.tooltipContent ? (React.createElement("div", { className: "nz-widget-widgetContentLayout-header-headerIconToolbar-iconButton-tooltip" },
|
|
41
|
+
React.createElement(Text, { variant: "small" }, icon.label),
|
|
42
|
+
React.createElement(Text, { isMuted: true, variant: "small" }, icon.tooltipContent))) : (icon.label), key: icon.label, size: props.iconSize, styleType: "borderless", onClick: icon.onClick, labelProps: { placement: "bottom" }, isActive: icon.isActive, className: "nz-iconButton" }, icon.icon))))));
|
|
37
43
|
}
|
|
38
44
|
//# sourceMappingURL=HeaderIconToolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderIconToolbar.js","sourceRoot":"","sources":["../../../../../../src/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAyBjD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC;IAC1E,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,OAAO,CACL,6BACE,SAAS,EAAC,wDAAwD,2BAC3C,KAAK,CAAC,QAAQ,iCACR,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,6BACvC,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;QAExE,oBAAC,WAAW,IACV,GAAG,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC7B,SAAS,EAAC,gBAAgB,EAC1B,iBAAiB,EAAC,KAAK,EACvB,cAAc,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,CACjC,oBAAC,YAAY,IACX,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CACnB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,aAAa,CAAC;qBAC1C,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AAK,CACF,CACZ,CAAC;gBACJ,CAAC,CAAC;gBAGN,oBAAC,UAAU,IACT,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,SAAS,EAAC,YAAY,gBACX,MAAM;oBAEjB,oBAAC,OAAO,OAAG,CACA,CACA,CAChB,IAEA,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACnC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACxB,oBAAC,OAAO,IACN,WAAW,EAAC,UAAU,EACtB,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,WAAW,KAAK,EAAE,GACnC,CACH,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC3B,oBAAC,YAAY,IACX,GAAG,EAAC,QAAQ,EACZ,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACxB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IACT,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,UAAU,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,eAAe,IAExB,IAAI,CAAC,IAAI,CACC,CACd,CACF,CACW,CACV,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./HeaderIconToolbar.scss\";\nimport * as React from \"react\";\nimport {\n ButtonGroup,\n Divider,\n DropdownMenu,\n IconButton,\n MenuDivider,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport { SvgMore, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { HeaderSearch } from \"./HeaderSearch.js\";\nimport type { WidgetContentLayout } from \"../WidgetContentLayout.js\";\n\ntype WidgetContentLayoutHeaderProps = React.ComponentProps<\n typeof WidgetContentLayout.Header\n>;\ntype IconMenu = NonNullable<WidgetContentLayoutHeaderProps[\"icons\"]>[number];\n\ninterface IconMenuSearch {\n type: \"search\";\n}\n\ntype SearchExpandedState = [\n boolean,\n React.Dispatch<React.SetStateAction<boolean>>\n];\n\ninterface HeaderIconToolbarProps\n extends Pick<WidgetContentLayoutHeaderProps, \"iconSize\" | \"onSearch\"> {\n /** Array of icon menu items to display, including regular icons, search, and dividers. */\n menuIcons: (IconMenu | IconMenuSearch)[];\n /** State tuple controlling whether the search box is expanded or collapsed. */\n searchExpandedState: SearchExpandedState;\n}\n\n/**\n * Header toolbar component that displays menu icons with overflow handling.\n * Renders a button group with icons, search functionality, and an overflow menu.\n * Icons that don't fit in the available space are moved into a dropdown menu.\n * @internal\n */\nexport function HeaderIconToolbar(props: HeaderIconToolbarProps) {\n const [searchIsExpanded, setSearchIsExpanded] = props.searchExpandedState;\n const searchState = React.useState(\"\");\n\n return (\n <div\n className=\"nz-widget-widgetContentLayout-header-headerIconToolbar\"\n data-_appui-icon-size={props.iconSize}\n data-_appui-search-expanded={searchIsExpanded ? \"true\" : \"false\"}\n data-_appui-single-item={props.menuIcons.length === 1 ? \"true\" : \"false\"}\n >\n <ButtonGroup\n key={String(searchIsExpanded)}\n className=\"nz-buttonGroup\"\n overflowPlacement=\"end\"\n overflowButton={(overflowStart) => (\n <DropdownMenu\n menuItems={(close) =>\n Array(props.menuIcons.length - overflowStart)\n .fill(null)\n .map((_, _index) => {\n const index = overflowStart + _index;\n const icon = props.menuIcons.at(index);\n if (!icon) return <></>;\n return icon.type === \"divider\" ? (\n _index === 0 || searchIsExpanded ? (\n <React.Fragment key={index}></React.Fragment>\n ) : (\n <MenuDivider key={index} />\n )\n ) : icon.type === \"search\" ? (\n !searchIsExpanded ? (\n <MenuItem\n key={index}\n onClick={() => {\n close();\n setSearchIsExpanded(true);\n }}\n startIcon={<SvgSearch />}\n >\n Search\n </MenuItem>\n ) : (\n <React.Fragment key={index}></React.Fragment>\n )\n ) : (\n <MenuItem\n isSelected={icon.isActive}\n disabled={icon.disabled}\n key={index}\n onClick={() => {\n icon.onClick();\n close();\n }}\n startIcon={<>{icon.icon}</>}\n >\n {icon.label}\n </MenuItem>\n );\n })\n }\n >\n <IconButton\n size={props.iconSize}\n styleType=\"borderless\"\n aria-label=\"More\"\n >\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n )}\n >\n {props.menuIcons.map((icon, index) =>\n icon.type === \"divider\" ? (\n <Divider\n orientation=\"vertical\"\n key={icon.key ?? `divider-${index}`}\n />\n ) : icon.type === \"search\" ? (\n <HeaderSearch\n key=\"search\"\n searchExpandedState={props.searchExpandedState}\n searchState={searchState}\n iconSize={props.iconSize}\n onSearch={props.onSearch}\n />\n ) : (\n <IconButton\n disabled={icon.disabled}\n label={icon.label}\n key={icon.label}\n size={props.iconSize}\n styleType=\"borderless\"\n onClick={icon.onClick}\n labelProps={{ placement: \"bottom\" }}\n isActive={icon.isActive}\n className=\"nz-iconButton\"\n >\n {icon.icon}\n </IconButton>\n )\n )}\n </ButtonGroup>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"HeaderIconToolbar.js","sourceRoot":"","sources":["../../../../../../src/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,WAAW,EACX,OAAO,EACP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AG,EAAE,IAAI,CAAC,KAAK,EACf,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,UAAU,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,eAAe,IAExB,IAAI,CAAC,IAAI,CACC,CACd,CACF,CACW,CACV,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./HeaderIconToolbar.scss\";\nimport * as React from \"react\";\nimport {\n ButtonGroup,\n Divider,\n DropdownMenu,\n IconButton,\n MenuDivider,\n MenuItem,\n Text,\n Tooltip,\n} from \"@itwin/itwinui-react\";\nimport { SvgMore, SvgSearch } from \"@itwin/itwinui-icons-react\";\nimport { HeaderSearch } from \"./HeaderSearch.js\";\nimport type { WidgetContentLayout } from \"../WidgetContentLayout.js\";\n\ntype WidgetContentLayoutHeaderProps = React.ComponentProps<\n typeof WidgetContentLayout.Header\n>;\ntype IconMenu = NonNullable<WidgetContentLayoutHeaderProps[\"icons\"]>[number];\n\ninterface IconMenuSearch {\n type: \"search\";\n}\n\ntype SearchExpandedState = [\n boolean,\n React.Dispatch<React.SetStateAction<boolean>>\n];\n\ninterface HeaderIconToolbarProps\n extends Pick<WidgetContentLayoutHeaderProps, \"iconSize\" | \"onSearch\"> {\n /** Array of icon menu items to display, including regular icons, search, and dividers. */\n menuIcons: (IconMenu | IconMenuSearch)[];\n /** State tuple controlling whether the search box is expanded or collapsed. */\n searchExpandedState: SearchExpandedState;\n}\n\n/**\n * Header toolbar component that displays menu icons with overflow handling.\n * Renders a button group with icons, search functionality, and an overflow menu.\n * Icons that don't fit in the available space are moved into a dropdown menu.\n * @internal\n */\nexport function HeaderIconToolbar(props: HeaderIconToolbarProps) {\n const [searchIsExpanded, setSearchIsExpanded] = props.searchExpandedState;\n const searchState = React.useState(\"\");\n\n return (\n <div\n className=\"nz-widget-widgetContentLayout-header-headerIconToolbar\"\n data-_appui-icon-size={props.iconSize}\n data-_appui-search-expanded={searchIsExpanded ? \"true\" : \"false\"}\n data-_appui-single-item={props.menuIcons.length === 1 ? \"true\" : \"false\"}\n >\n <ButtonGroup\n key={String(searchIsExpanded)}\n className=\"nz-buttonGroup\"\n overflowPlacement=\"end\"\n overflowButton={(overflowStart) => (\n <DropdownMenu\n menuItems={(close) =>\n Array(props.menuIcons.length - overflowStart)\n .fill(null)\n .map((_, _index) => {\n const index = overflowStart + _index;\n const icon = props.menuIcons.at(index);\n if (!icon) return <></>;\n return icon.type === \"divider\" ? (\n _index === 0 || searchIsExpanded ? (\n <React.Fragment key={index}></React.Fragment>\n ) : (\n <MenuDivider key={index} />\n )\n ) : icon.type === \"search\" ? (\n !searchIsExpanded ? (\n <MenuItem\n key={index}\n onClick={() => {\n close();\n setSearchIsExpanded(true);\n }}\n startIcon={<SvgSearch />}\n >\n Search\n </MenuItem>\n ) : (\n <React.Fragment key={index}></React.Fragment>\n )\n ) : icon.tooltipContent ? (\n <Tooltip content={icon.tooltipContent} key={index}>\n <MenuItem\n isSelected={icon.isActive}\n disabled={icon.disabled}\n key={index}\n onClick={() => {\n icon.onClick();\n close();\n }}\n startIcon={<>{icon.icon}</>}\n >\n {icon.label}\n </MenuItem>\n </Tooltip>\n ) : (\n <MenuItem\n isSelected={icon.isActive}\n disabled={icon.disabled}\n key={index}\n onClick={() => {\n icon.onClick();\n close();\n }}\n startIcon={<>{icon.icon}</>}\n >\n {icon.label}\n </MenuItem>\n );\n })\n }\n >\n <IconButton\n size={props.iconSize}\n styleType=\"borderless\"\n aria-label=\"More\"\n >\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n )}\n >\n {props.menuIcons.map((icon, index) =>\n icon.type === \"divider\" ? (\n <Divider\n orientation=\"vertical\"\n key={icon.key ?? `divider-${index}`}\n />\n ) : icon.type === \"search\" ? (\n <HeaderSearch\n key=\"search\"\n searchExpandedState={props.searchExpandedState}\n searchState={searchState}\n iconSize={props.iconSize}\n onSearch={props.onSearch}\n />\n ) : (\n <IconButton\n disabled={icon.disabled}\n label={\n icon.tooltipContent ? (\n <div className=\"nz-widget-widgetContentLayout-header-headerIconToolbar-iconButton-tooltip\">\n <Text variant=\"small\">{icon.label}</Text>\n <Text isMuted variant=\"small\">\n {icon.tooltipContent}\n </Text>\n </div>\n ) : (\n icon.label\n )\n }\n key={icon.label}\n size={props.iconSize}\n styleType=\"borderless\"\n onClick={icon.onClick}\n labelProps={{ placement: \"bottom\" }}\n isActive={icon.isActive}\n className=\"nz-iconButton\"\n >\n {icon.icon}\n </IconButton>\n )\n )}\n </ButtonGroup>\n </div>\n );\n}\n"]}
|
|
@@ -28,7 +28,7 @@ export function HeaderTopBar(props) {
|
|
|
28
28
|
}, [props.icons, props.onSearch]);
|
|
29
29
|
const searchExpandedState = React.useState(false);
|
|
30
30
|
return (React.createElement("div", { className: classNames("nz-widget-widgetContentLayout-header-headerTopBar", (props.primaryContent.length === 0 || menuIcons.length === 0) &&
|
|
31
|
-
"nz-singleColumn"), "data-search-expanded": searchExpandedState[0]
|
|
31
|
+
"nz-singleColumn"), "data-search-expanded": searchExpandedState[0] },
|
|
32
32
|
props.primaryContent.length > 0 && (React.createElement("div", { className: "nz-primaryContent" }, props.primaryContent)),
|
|
33
33
|
menuIcons.length > 0 && (React.createElement(HeaderIconToolbar, { menuIcons: menuIcons, onSearch: props.onSearch, searchExpandedState: searchExpandedState, iconSize: props.iconSize }))));
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderTopBar.js","sourceRoot":"","sources":["../../../../../../src/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,qBAAqB,CA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AAC,MAAM,KAAK,CAAC,CAAC;YAC3D,iBAAiB,CACpB,0BACqB,mBAAmB,CAAC,CAAC,CAAC;QAE3C,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAClC,6BAAK,SAAS,EAAC,mBAAmB,IAAE,KAAK,CAAC,cAAc,CAAO,CAChE;QACA,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CACvB,oBAAC,iBAAiB,IAChB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,mBAAmB,EAAE,mBAAmB,EACxC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GACxB,CACH,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./HeaderTopBar.scss\";\nimport classNames from \"classnames\";\nimport * as React from \"react\";\n\nimport { HeaderIconToolbar } from \"./HeaderIconToolbar.js\";\nimport type { WidgetContentLayout } from \"../WidgetContentLayout.js\";\n\ntype WidgetContentLayoutHeaderProps = React.ComponentProps<\n typeof WidgetContentLayout.Header\n>;\ntype HeaderIconToolbarProps = React.ComponentProps<typeof HeaderIconToolbar>;\n\ninterface HeaderTopBarProps\n extends Pick<\n WidgetContentLayoutHeaderProps,\n \"icons\" | \"onSearch\" | \"iconSize\"\n > {\n primaryContent: React.JSX.Element[];\n}\n\n/**\n * Internal layout component that renders the top bar of the widget header,\n * including optional left content and a top-right icon/search area.\n * @internal\n */\nexport function HeaderTopBar(props: HeaderTopBarProps) {\n const menuIcons = React.useMemo(() => {\n let icons: HeaderIconToolbarProps[\"menuIcons\"] = props.icons || [];\n if (props.onSearch) {\n if (icons.length > 0)\n icons = [\n { type: \"divider\", key: \"search-divider\" },\n ...icons.map((icon, index) =>\n icon.type === \"divider\"\n ? { ...icon, key: `divider-${index}` }\n : icon\n ),\n ];\n icons = [{ type: \"search\" }, ...icons];\n }\n return icons;\n }, [props.icons, props.onSearch]);\n\n const searchExpandedState = React.useState(false);\n\n return (\n <div\n className={classNames(\n \"nz-widget-widgetContentLayout-header-headerTopBar\",\n (props.primaryContent.length === 0 || menuIcons.length === 0) &&\n \"nz-singleColumn\"\n )}\n data-search-expanded={searchExpandedState[0]}\n >\n {props.primaryContent.length > 0 && (\n <div className=\"nz-primaryContent\">{props.primaryContent}</div>\n )}\n {menuIcons.length > 0 && (\n <HeaderIconToolbar\n menuIcons={menuIcons}\n onSearch={props.onSearch}\n searchExpandedState={searchExpandedState}\n iconSize={props.iconSize}\n />\n )}\n </div>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/appui-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0",
|
|
4
4
|
"description": "A react component library for AppUI framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/appui-react.d.ts",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
46
46
|
"react-redux": "^7.2.2 || ^8.0.0 || ^9.0.0",
|
|
47
47
|
"redux": "^4.1.0 || ^5.0.0",
|
|
48
|
-
"@itwin/components-react": "5.
|
|
49
|
-
"@itwin/core-react": "5.
|
|
50
|
-
"@itwin/imodel-components-react": "5.
|
|
48
|
+
"@itwin/components-react": "5.24.0",
|
|
49
|
+
"@itwin/core-react": "5.24.0",
|
|
50
|
+
"@itwin/imodel-components-react": "5.24.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@itwin/appui-abstract": "^5.1.0",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"typescript": "~5.6.2",
|
|
91
91
|
"upath": "^2.0.1",
|
|
92
92
|
"vitest": "^3.2.4",
|
|
93
|
-
"@itwin/components-react": "5.
|
|
94
|
-
"@itwin/core-react": "5.
|
|
95
|
-
"@itwin/imodel-components-react": "5.
|
|
93
|
+
"@itwin/components-react": "5.24.0",
|
|
94
|
+
"@itwin/core-react": "5.24.0",
|
|
95
|
+
"@itwin/imodel-components-react": "5.24.0"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@itwin/itwinui-icons-react": "^2.8.0",
|