@itwin/components-react 4.11.0 → 4.12.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 +8 -1
- package/lib/cjs/components-react/UiComponents.d.ts +0 -4
- package/lib/cjs/components-react/UiComponents.d.ts.map +1 -1
- package/lib/cjs/components-react/UiComponents.js +2 -12
- package/lib/cjs/components-react/UiComponents.js.map +1 -1
- package/lib/cjs/components-react/UiComponents.json +153 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/Operators.js +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +4 -7
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +1 -4
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js +2 -3
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/useTranslation.d.ts +4 -7
- package/lib/cjs/components-react/useTranslation.d.ts.map +1 -1
- package/lib/cjs/components-react/useTranslation.js +39 -7
- package/lib/cjs/components-react/useTranslation.js.map +1 -1
- package/lib/cjs/components-react.d.ts +1 -0
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +1 -0
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/UiComponents.d.ts +0 -4
- package/lib/esm/components-react/UiComponents.d.ts.map +1 -1
- package/lib/esm/components-react/UiComponents.js +2 -12
- package/lib/esm/components-react/UiComponents.js.map +1 -1
- package/lib/esm/components-react/UiComponents.json +153 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts +1 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/Operators.js +1 -0
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +5 -8
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +2 -5
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js +3 -4
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/useTranslation.d.ts +4 -7
- package/lib/esm/components-react/useTranslation.d.ts.map +1 -1
- package/lib/esm/components-react/useTranslation.js +14 -5
- package/lib/esm/components-react/useTranslation.js.map +1 -1
- package/lib/esm/components-react.d.ts +1 -0
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +1 -0
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +4 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupItemWithDrag.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,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,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK;YAEZ,6BAAK,SAAS,EAAC,iBAAiB,IAAE,IAAI,CAAO;YAC5C,KAAK,CAAC,KAAK,IAAI,6BAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAO;YAC/D,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CAChC;QACT,oBAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,8BAA8B,CACtC,kBAAkB,EAClB,cAAc,CACf,EACD,MAAM,EAAE,MAAM;YAEd,oBAAC,eAAe,IACd,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,mBAAmB,EAAE,IAAI,GACzB,CACa,CACY,CAChC,CAAC;AACJ,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAC5C,SAAoB,EACpB,SAAgC;IAEhC,uBAAuB;IACvB,QAAQ,SAAS,EAAE;QACjB,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC;YACrB,IAAI,SAAS,KAAK,qBAAqB,CAAC,GAAG;gBACzC,OAAO,gBAAgB,CAAC,WAAW,CAAC;YACtC,OAAO,gBAAgB,CAAC,UAAU,CAAC;SACpC;QACD,KAAK,SAAS,CAAC,IAAI;YACjB,OAAO,gBAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,SAAS,CAAC,KAAK;YAClB,OAAO,gBAAgB,CAAC,QAAQ,CAAC;QACnC,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,gBAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,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 Toolbar\n */\n\nimport \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ActionButton, GroupButton } from \"@itwin/appui-abstract\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n RelativePosition,\n ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, IconHelper, useRefState } from \"@itwin/core-react\";\nimport type { ToolbarButtonItemProps } from \"./Item\";\nimport { PopupItemPopup, ToolbarPopupContext } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport {\n ToolbarPanelAlignment,\n useToolbarWithOverflowDirectionContext,\n useToolItemEntryContext,\n} from \"./InternalToolbarComponent\";\nimport { useDragInteraction } from \"./useDragInteraction\";\nimport { Direction } from \"./utilities/Direction\";\n\n/** Properties of [[PopupItem]] component.\n * @public\n */\nexport interface PopupItemWithDragProps extends ToolbarButtonItemProps {\n /** Panel of the toolbar. */\n groupItem: GroupButton;\n}\n\nfunction tryFindActiveAction(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n if (childItem.isActive) return childItem;\n } else if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = tryFindActiveAction(childItem);\n if (nestedChild) return nestedChild;\n }\n }\n return undefined;\n}\n\nfunction getFirstAvailableChildActionItem(\n item: GroupButton\n): ActionButton | undefined {\n for (const childItem of item.items) {\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = getFirstAvailableChildActionItem(childItem);\n // istanbul ignore else\n if (nestedChild) return nestedChild;\n }\n }\n }\n return undefined;\n}\n\nfunction getActiveAction(item: GroupButton): ActionButton | undefined {\n const activeItem = tryFindActiveAction(item);\n if (activeItem) return activeItem;\n\n // initially look only in root items\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n }\n }\n\n // if not found look inside groups\n return getFirstAvailableChildActionItem(item);\n}\n\n/** Expandable Group button Item\n * @public\n */\nexport function PopupItemWithDrag(props: PopupItemWithDragProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const [activeAction, setActiveAction] = React.useState(\n getActiveAction(props.groupItem)\n );\n const {\n expandsTo,\n overflowExpandsTo,\n panelAlignment,\n onPopupPanelOpenClose,\n } = useToolbarWithOverflowDirectionContext();\n\n React.useEffect(() => {\n const newActiveAction = getActiveAction(props.groupItem);\n // istanbul ignore else\n if (newActiveAction) {\n // istanbul ignore next\n if (newActiveAction.isActive) {\n setActiveAction(newActiveAction);\n } else {\n if (activeAction && activeAction.isActive) {\n setActiveAction({ ...activeAction, isActive: false });\n }\n }\n }\n }, [props.groupItem, activeAction]);\n\n const processPanelOpenClose = React.useCallback(\n (isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening) onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n },\n [setPanelShown, onPopupPanelOpenClose]\n );\n\n // handle open and closing popup panel\n const onOpenPanel = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n }, [isPanelShown, processPanelOpenClose]);\n\n // handle open and closing popup panel\n const onGroupButtonClick = React.useCallback(() => {\n // only execute action if not disabled\n activeAction &&\n !ConditionalBooleanValue.getValue(activeAction.isDisabled) &&\n activeAction.execute();\n }, [activeAction]);\n\n const badge = activeAction\n ? BadgeUtilities.getComponentForBadgeType(activeAction.badgeType)\n : props.badge;\n const icon = activeAction\n ? IconHelper.getIconReactNode(activeAction.icon, activeAction.internalData)\n : props.icon;\n const title = activeAction\n ? ConditionalStringValue.getValue(activeAction.label)\n : props.title;\n const isActive = activeAction ? activeAction.isActive : props.isActive;\n const isDisabled = ConditionalBooleanValue.getValue(\n activeAction ? activeAction.isDisabled : props.isDisabled\n );\n\n const { handlePointerDown, handleButtonClick } = useDragInteraction(\n onGroupButtonClick,\n onOpenPanel\n );\n\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n isActive && \"components-active\",\n isDisabled && \"components-disabled-drag\",\n props.className\n );\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow\n ? /* istanbul ignore next */ overflowExpandsTo\n : expandsTo;\n\n return (\n <ToolbarPopupContext.Provider\n value={{\n closePanel: /* istanbul ignore next */ () =>\n processPanelOpenClose(false),\n setSelectedItem: /* istanbul ignore next */ (\n buttonItem: ActionButton\n ) => setActiveAction(buttonItem),\n }}\n >\n <button\n data-item-id={props.itemId}\n data-item-type=\"action-tool-button\"\n data-item-group-priority={props.groupPriority}\n data-item-priority={props.itemPriority}\n data-item-provider-id={props.providerId}\n ref={targetRef}\n onPointerDown={handlePointerDown}\n onClick={handleButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={title}\n >\n <div className=\"components-icon\">{icon}</div>\n {props.badge && <div className=\"components-badge\">{badge}</div>}\n <div className=\"components-triangle\" />\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(\n expandsToDirection,\n panelAlignment\n )}\n target={target}\n >\n <PopupItemsPanel\n groupItem={props.groupItem}\n activateOnPointerUp={true}\n />\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\nexport function toToolbarPopupRelativePosition(\n expandsTo: Direction,\n alignment: ToolbarPanelAlignment\n): RelativePosition {\n // istanbul ignore next\n switch (expandsTo) {\n case Direction.Bottom: {\n if (alignment === ToolbarPanelAlignment.End)\n return RelativePosition.BottomRight;\n return RelativePosition.BottomLeft;\n }\n case Direction.Left:\n return RelativePosition.LeftTop;\n case Direction.Right:\n return RelativePosition.RightTop;\n case Direction.Top:\n return RelativePosition.Top;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PopupItemWithDrag.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,qBAAqB,EACrB,sCAAsC,EACtC,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAUlD,SAAS,mBAAmB,CAAC,IAAiB;IAC5C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE;QAClC,uBAAuB;QACvB,IAAI,oBAAoB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;YAClD,IAAI,SAAS,CAAC,QAAQ;gBAAE,OAAO,SAAS,CAAC;SAC1C;aAAM,IAAI,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YACxD,MAAM,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,WAAW;gBAAE,OAAO,WAAW,CAAC;SACrC;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,gCAAgC,CACvC,IAAiB;IAEjB,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AU,CAAC;SACpC;QACD,KAAK,SAAS,CAAC,IAAI;YACjB,OAAO,gBAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,SAAS,CAAC,KAAK;YAClB,OAAO,gBAAgB,CAAC,QAAQ,CAAC;QACnC,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,gBAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,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 Toolbar\n */\n\nimport \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ActionButton, GroupButton } from \"@itwin/appui-abstract\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n RelativePosition,\n ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { Badge, IconHelper, useRefState } from \"@itwin/core-react\";\nimport type { ToolbarButtonItemProps } from \"./Item\";\nimport { PopupItemPopup, ToolbarPopupContext } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport {\n ToolbarPanelAlignment,\n useToolbarWithOverflowDirectionContext,\n useToolItemEntryContext,\n} from \"./InternalToolbarComponent\";\nimport { useDragInteraction } from \"./useDragInteraction\";\nimport { Direction } from \"./utilities/Direction\";\n\n/** Properties of [[PopupItem]] component.\n * @public\n */\nexport interface PopupItemWithDragProps extends ToolbarButtonItemProps {\n /** Panel of the toolbar. */\n groupItem: GroupButton;\n}\n\nfunction tryFindActiveAction(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n if (childItem.isActive) return childItem;\n } else if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = tryFindActiveAction(childItem);\n if (nestedChild) return nestedChild;\n }\n }\n return undefined;\n}\n\nfunction getFirstAvailableChildActionItem(\n item: GroupButton\n): ActionButton | undefined {\n for (const childItem of item.items) {\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = getFirstAvailableChildActionItem(childItem);\n // istanbul ignore else\n if (nestedChild) return nestedChild;\n }\n }\n }\n return undefined;\n}\n\nfunction getActiveAction(item: GroupButton): ActionButton | undefined {\n const activeItem = tryFindActiveAction(item);\n if (activeItem) return activeItem;\n\n // initially look only in root items\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n }\n }\n\n // if not found look inside groups\n return getFirstAvailableChildActionItem(item);\n}\n\n/** Expandable Group button Item\n * @public\n */\nexport function PopupItemWithDrag(props: PopupItemWithDragProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const [activeAction, setActiveAction] = React.useState(\n getActiveAction(props.groupItem)\n );\n const {\n expandsTo,\n overflowExpandsTo,\n panelAlignment,\n onPopupPanelOpenClose,\n } = useToolbarWithOverflowDirectionContext();\n\n React.useEffect(() => {\n const newActiveAction = getActiveAction(props.groupItem);\n // istanbul ignore else\n if (newActiveAction) {\n // istanbul ignore next\n if (newActiveAction.isActive) {\n setActiveAction(newActiveAction);\n } else {\n if (activeAction && activeAction.isActive) {\n setActiveAction({ ...activeAction, isActive: false });\n }\n }\n }\n }, [props.groupItem, activeAction]);\n\n const processPanelOpenClose = React.useCallback(\n (isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening) onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n },\n [setPanelShown, onPopupPanelOpenClose]\n );\n\n // handle open and closing popup panel\n const onOpenPanel = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n }, [isPanelShown, processPanelOpenClose]);\n\n // handle open and closing popup panel\n const onGroupButtonClick = React.useCallback(() => {\n // only execute action if not disabled\n activeAction &&\n !ConditionalBooleanValue.getValue(activeAction.isDisabled) &&\n activeAction.execute();\n }, [activeAction]);\n\n const icon = activeAction\n ? IconHelper.getIconReactNode(activeAction.icon, activeAction.internalData)\n : props.icon;\n const title = activeAction\n ? ConditionalStringValue.getValue(activeAction.label)\n : props.title;\n const isActive = activeAction ? activeAction.isActive : props.isActive;\n const isDisabled = ConditionalBooleanValue.getValue(\n activeAction ? activeAction.isDisabled : props.isDisabled\n );\n\n const { handlePointerDown, handleButtonClick } = useDragInteraction(\n onGroupButtonClick,\n onOpenPanel\n );\n\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n isActive && \"components-active\",\n isDisabled && \"components-disabled-drag\",\n props.className\n );\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow\n ? /* istanbul ignore next */ overflowExpandsTo\n : expandsTo;\n\n return (\n <ToolbarPopupContext.Provider\n value={{\n closePanel: /* istanbul ignore next */ () =>\n processPanelOpenClose(false),\n setSelectedItem: /* istanbul ignore next */ (\n buttonItem: ActionButton\n ) => setActiveAction(buttonItem),\n }}\n >\n <button\n data-item-id={props.itemId}\n data-item-type=\"action-tool-button\"\n data-item-group-priority={props.groupPriority}\n data-item-priority={props.itemPriority}\n data-item-provider-id={props.providerId}\n ref={targetRef}\n onPointerDown={handlePointerDown}\n onClick={handleButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={title}\n >\n <div className=\"components-icon\">{icon}</div>\n {props.badge && (\n <div className=\"components-badge\">\n {activeAction ? (\n <Badge type={activeAction.badgeType} />\n ) : (\n props.badge\n )}\n </div>\n )}\n <div className=\"components-triangle\" />\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(\n expandsToDirection,\n panelAlignment\n )}\n target={target}\n >\n <PopupItemsPanel\n groupItem={props.groupItem}\n activateOnPointerUp={true}\n />\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\nexport function toToolbarPopupRelativePosition(\n expandsTo: Direction,\n alignment: ToolbarPanelAlignment\n): RelativePosition {\n // istanbul ignore next\n switch (expandsTo) {\n case Direction.Bottom: {\n if (alignment === ToolbarPanelAlignment.End)\n return RelativePosition.BottomRight;\n return RelativePosition.BottomLeft;\n }\n case Direction.Left:\n return RelativePosition.LeftTop;\n case Direction.Right:\n return RelativePosition.RightTop;\n case Direction.Top:\n return RelativePosition.Top;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupItemsPanel.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemsPanel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAwBvE,UAAU,oBAAoB;IAC5B,SAAS,EAAE,WAAW,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"PopupItemsPanel.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemsPanel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAwBvE,UAAU,oBAAoB;IAC5B,SAAS,EAAE,WAAW,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAmK1D"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import classnames from "classnames";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { ConditionalBooleanValue, ConditionalStringValue, ToolbarItemUtilities, } from "@itwin/appui-abstract";
|
|
11
|
-
import {
|
|
11
|
+
import { Badge, IconHelper } from "@itwin/core-react";
|
|
12
12
|
import { BackArrow } from "./groupPanel/BackArrow";
|
|
13
13
|
import { GroupColumn } from "./groupPanel/Column";
|
|
14
14
|
import { Columns } from "./groupPanel/Columns";
|
|
@@ -91,13 +91,12 @@ export function PopupItemsPanel(props) {
|
|
|
91
91
|
}, [onKeyDown]);
|
|
92
92
|
// build n-number of columns
|
|
93
93
|
const columns = React.useMemo(() => columnToItems.map((columnItems, columnIndex) => (React.createElement(GroupColumn, { key: columnIndex }, columnItems.map((panelItem) => {
|
|
94
|
-
const badge = BadgeUtilities.getComponentForBadgeType(panelItem.badgeType);
|
|
95
94
|
const icon = IconHelper.getIconReactNode(panelItem.icon, panelItem.internalData);
|
|
96
95
|
const label = ConditionalStringValue.getValue(panelItem.label);
|
|
97
96
|
if (ToolbarItemUtilities.isGroupButton(panelItem)) {
|
|
98
|
-
return (React.createElement(GroupToolExpander, { isDisabled: ConditionalBooleanValue.getValue(panelItem.isDisabled), key: panelItem.id, label: label, icon: icon, badge:
|
|
97
|
+
return (React.createElement(GroupToolExpander, { isDisabled: ConditionalBooleanValue.getValue(panelItem.isDisabled), key: panelItem.id, label: label, icon: icon, badge: React.createElement(Badge, { type: panelItem.badgeType }), item: panelItem, onClick: handleGroupItemClick }));
|
|
99
98
|
}
|
|
100
|
-
return (React.createElement(GroupTool, { isDisabled: ConditionalBooleanValue.getValue(panelItem.isDisabled), isActive: !!panelItem.isActive, key: panelItem.id, label: label, icon: icon, item: panelItem, onClick: handleActionItemClick, onPointerUp: handleOnPointerUp, badge:
|
|
99
|
+
return (React.createElement(GroupTool, { isDisabled: ConditionalBooleanValue.getValue(panelItem.isDisabled), isActive: !!panelItem.isActive, key: panelItem.id, label: label, icon: icon, item: panelItem, onClick: handleActionItemClick, onPointerUp: handleOnPointerUp, badge: React.createElement(Badge, { type: panelItem.badgeType }) }));
|
|
101
100
|
})))), [
|
|
102
101
|
columnToItems,
|
|
103
102
|
handleActionItemClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupItemsPanel.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemsPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAEpF,SAAS,mBAAmB,CAAC,aAAqB;IAChD,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC;IAC7C,IAAI,aAAa,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC7D,IAAI,aAAa,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG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AU,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,oBAAC,SAAS,IAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,oBAAoB,GAAI,CACzE;QACA,UAAU,IAAI,oBAAC,KAAK,QAAE,UAAU,CAAS;QACzC,OAAO,IAAI,oBAAC,OAAO,QAAE,OAAO,CAAW,CAClC,CACT,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/** @packageDocumentation\n * @module Toolbar\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ActionButton, GroupButton } from \"@itwin/appui-abstract\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, IconHelper } from \"@itwin/core-react\";\nimport { BackArrow } from \"./groupPanel/BackArrow\";\nimport { GroupColumn } from \"./groupPanel/Column\";\nimport { Columns } from \"./groupPanel/Columns\";\nimport { Panel } from \"./groupPanel/Panel\";\nimport { Title } from \"./groupPanel/Title\";\nimport { GroupToolExpander } from \"./groupPanel/tool/Expander\";\nimport { GroupTool } from \"./groupPanel/tool/Tool\";\nimport { useToolbarPopupContext } from \"./PopupItem\";\nimport { useToolbarWithOverflowDirectionContext } from \"./InternalToolbarComponent\";\n\nfunction getNumItemsInColumn(numTotalItems: number): number {\n if (numTotalItems <= 6) return numTotalItems;\n if (numTotalItems <= 24) return Math.ceil(numTotalItems / 2);\n if (numTotalItems <= 36) return Math.ceil(numTotalItems / 3);\n return Math.ceil(numTotalItems / 4);\n}\n\ninterface PopupItemsPanelProps {\n groupItem: GroupButton;\n activateOnPointerUp?: boolean;\n}\n\n/** Component that displays a list of tools in a panel.\n * @internal future\n */\nexport function PopupItemsPanel(props: PopupItemsPanelProps) {\n const [groupArray, setGroupArray] = React.useState([props.groupItem]);\n const activeGroup = React.useMemo(() => groupArray[0], [groupArray]);\n const items = React.useMemo(() => activeGroup.items, [activeGroup]);\n\n const preferredNumItemsInColumn = getNumItemsInColumn(items.length);\n\n // Divide items equally between columns.\n const numberOfColumns = Math.ceil(items.length / preferredNumItemsInColumn);\n const numItemsPerColumn = Math.ceil(items.length / numberOfColumns);\n\n const columnToItems = React.useMemo(\n () =>\n items.reduce<ReadonlyArray<ReadonlyArray<GroupButton | ActionButton>>>(\n (acc, item, index) => {\n const columnIndex = Math.floor(index / numItemsPerColumn);\n if (columnIndex >= acc.length) {\n return [...acc, [item]];\n }\n return [\n ...acc.slice(0, columnIndex),\n [...acc[columnIndex], item],\n ...acc.slice(columnIndex + 1),\n ];\n },\n []\n ),\n [items, numItemsPerColumn]\n );\n\n const handleGroupItemClick = React.useCallback(\n (item: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(item)) {\n // push group to front of array\n setGroupArray([item, ...groupArray]);\n }\n },\n [groupArray]\n );\n\n const handleBackArrowClick = React.useCallback(() => {\n // istanbul ignore else\n if (groupArray.length > 1) {\n setGroupArray(groupArray.slice(1));\n }\n }, [groupArray]);\n\n const { closePanel, setSelectedItem } = useToolbarPopupContext();\n const { onItemExecuted, onKeyDown } =\n useToolbarWithOverflowDirectionContext();\n\n const handleOnPointerUp = React.useCallback(\n /* istanbul ignore next */ (panelItem: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(panelItem)) {\n props.activateOnPointerUp &&\n setSelectedItem &&\n setSelectedItem(panelItem);\n props.activateOnPointerUp && panelItem.execute();\n onItemExecuted(panelItem);\n props.activateOnPointerUp && closePanel();\n }\n },\n [props.activateOnPointerUp, setSelectedItem, closePanel, onItemExecuted]\n );\n\n const handleActionItemClick = React.useCallback(\n (panelItem: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(panelItem)) {\n setSelectedItem && setSelectedItem(panelItem);\n panelItem.execute();\n onItemExecuted(panelItem);\n closePanel();\n }\n },\n [setSelectedItem, closePanel, onItemExecuted]\n );\n\n // istanbul ignore next - NEEDSWORK add complete tests\n const handleOnKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n onKeyDown(e);\n },\n [onKeyDown]\n );\n\n // build n-number of columns\n const columns = React.useMemo(\n () =>\n columnToItems.map((columnItems, columnIndex) => (\n <GroupColumn key={columnIndex}>\n {columnItems.map((panelItem) => {\n const badge = BadgeUtilities.getComponentForBadgeType(\n panelItem.badgeType\n );\n const icon = IconHelper.getIconReactNode(\n panelItem.icon,\n panelItem.internalData\n );\n const label = ConditionalStringValue.getValue(panelItem.label);\n if (ToolbarItemUtilities.isGroupButton(panelItem)) {\n return (\n <GroupToolExpander\n isDisabled={ConditionalBooleanValue.getValue(\n panelItem.isDisabled\n )}\n key={panelItem.id}\n label={label}\n icon={icon}\n badge={badge}\n item={panelItem}\n onClick={handleGroupItemClick}\n />\n );\n }\n\n return (\n <GroupTool\n isDisabled={ConditionalBooleanValue.getValue(\n panelItem.isDisabled\n )}\n isActive={!!panelItem.isActive}\n key={panelItem.id}\n label={label}\n icon={icon}\n item={panelItem}\n onClick={handleActionItemClick}\n onPointerUp={handleOnPointerUp}\n badge={badge}\n />\n );\n })}\n </GroupColumn>\n )),\n [\n columnToItems,\n handleActionItemClick,\n handleGroupItemClick,\n handleOnPointerUp,\n ]\n );\n\n // ensure we have a panel title for nested groups\n const titleString = activeGroup.panelLabel\n ? activeGroup.panelLabel\n : activeGroup.label;\n const panelTitle = React.useMemo(\n () => ConditionalStringValue.getValue(titleString),\n [titleString]\n );\n const className = classnames(\n 1 === groupArray.length && \"components-toolbar-item-expandable-group-group\",\n groupArray.length > 1 && \"components-toolbar-item-expandable-group-nested\"\n );\n\n return (\n <Panel className={className} onKeyDown={handleOnKeyDown}>\n {groupArray.length > 1 && (\n <BackArrow className=\"components-back\" onClick={handleBackArrowClick} />\n )}\n {panelTitle && <Title>{panelTitle}</Title>}\n {columns && <Columns>{columns}</Columns>}\n </Panel>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PopupItemsPanel.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemsPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,sCAAsC,EAAE,MAAM,4BAA4B,CAAC;AAEpF,SAAS,mBAAmB,CAAC,aAAqB;IAChD,IAAI,aAAa,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC;IAC7C,IAAI,aAAa,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC7D,IAAI,aAAa,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC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,EAAC,iBAAiB,EAAC,OAAO,EAAE,oBAAoB,GAAI,CACzE;QACA,UAAU,IAAI,oBAAC,KAAK,QAAE,UAAU,CAAS;QACzC,OAAO,IAAI,oBAAC,OAAO,QAAE,OAAO,CAAW,CAClC,CACT,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/** @packageDocumentation\n * @module Toolbar\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { ActionButton, GroupButton } from \"@itwin/appui-abstract\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { Badge, IconHelper } from \"@itwin/core-react\";\nimport { BackArrow } from \"./groupPanel/BackArrow\";\nimport { GroupColumn } from \"./groupPanel/Column\";\nimport { Columns } from \"./groupPanel/Columns\";\nimport { Panel } from \"./groupPanel/Panel\";\nimport { Title } from \"./groupPanel/Title\";\nimport { GroupToolExpander } from \"./groupPanel/tool/Expander\";\nimport { GroupTool } from \"./groupPanel/tool/Tool\";\nimport { useToolbarPopupContext } from \"./PopupItem\";\nimport { useToolbarWithOverflowDirectionContext } from \"./InternalToolbarComponent\";\n\nfunction getNumItemsInColumn(numTotalItems: number): number {\n if (numTotalItems <= 6) return numTotalItems;\n if (numTotalItems <= 24) return Math.ceil(numTotalItems / 2);\n if (numTotalItems <= 36) return Math.ceil(numTotalItems / 3);\n return Math.ceil(numTotalItems / 4);\n}\n\ninterface PopupItemsPanelProps {\n groupItem: GroupButton;\n activateOnPointerUp?: boolean;\n}\n\n/** Component that displays a list of tools in a panel.\n * @internal future\n */\nexport function PopupItemsPanel(props: PopupItemsPanelProps) {\n const [groupArray, setGroupArray] = React.useState([props.groupItem]);\n const activeGroup = React.useMemo(() => groupArray[0], [groupArray]);\n const items = React.useMemo(() => activeGroup.items, [activeGroup]);\n\n const preferredNumItemsInColumn = getNumItemsInColumn(items.length);\n\n // Divide items equally between columns.\n const numberOfColumns = Math.ceil(items.length / preferredNumItemsInColumn);\n const numItemsPerColumn = Math.ceil(items.length / numberOfColumns);\n\n const columnToItems = React.useMemo(\n () =>\n items.reduce<ReadonlyArray<ReadonlyArray<GroupButton | ActionButton>>>(\n (acc, item, index) => {\n const columnIndex = Math.floor(index / numItemsPerColumn);\n if (columnIndex >= acc.length) {\n return [...acc, [item]];\n }\n return [\n ...acc.slice(0, columnIndex),\n [...acc[columnIndex], item],\n ...acc.slice(columnIndex + 1),\n ];\n },\n []\n ),\n [items, numItemsPerColumn]\n );\n\n const handleGroupItemClick = React.useCallback(\n (item: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(item)) {\n // push group to front of array\n setGroupArray([item, ...groupArray]);\n }\n },\n [groupArray]\n );\n\n const handleBackArrowClick = React.useCallback(() => {\n // istanbul ignore else\n if (groupArray.length > 1) {\n setGroupArray(groupArray.slice(1));\n }\n }, [groupArray]);\n\n const { closePanel, setSelectedItem } = useToolbarPopupContext();\n const { onItemExecuted, onKeyDown } =\n useToolbarWithOverflowDirectionContext();\n\n const handleOnPointerUp = React.useCallback(\n /* istanbul ignore next */ (panelItem: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(panelItem)) {\n props.activateOnPointerUp &&\n setSelectedItem &&\n setSelectedItem(panelItem);\n props.activateOnPointerUp && panelItem.execute();\n onItemExecuted(panelItem);\n props.activateOnPointerUp && closePanel();\n }\n },\n [props.activateOnPointerUp, setSelectedItem, closePanel, onItemExecuted]\n );\n\n const handleActionItemClick = React.useCallback(\n (panelItem: GroupButton | ActionButton) => {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(panelItem)) {\n setSelectedItem && setSelectedItem(panelItem);\n panelItem.execute();\n onItemExecuted(panelItem);\n closePanel();\n }\n },\n [setSelectedItem, closePanel, onItemExecuted]\n );\n\n // istanbul ignore next - NEEDSWORK add complete tests\n const handleOnKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n onKeyDown(e);\n },\n [onKeyDown]\n );\n\n // build n-number of columns\n const columns = React.useMemo(\n () =>\n columnToItems.map((columnItems, columnIndex) => (\n <GroupColumn key={columnIndex}>\n {columnItems.map((panelItem) => {\n const icon = IconHelper.getIconReactNode(\n panelItem.icon,\n panelItem.internalData\n );\n const label = ConditionalStringValue.getValue(panelItem.label);\n if (ToolbarItemUtilities.isGroupButton(panelItem)) {\n return (\n <GroupToolExpander\n isDisabled={ConditionalBooleanValue.getValue(\n panelItem.isDisabled\n )}\n key={panelItem.id}\n label={label}\n icon={icon}\n badge={<Badge type={panelItem.badgeType} />}\n item={panelItem}\n onClick={handleGroupItemClick}\n />\n );\n }\n\n return (\n <GroupTool\n isDisabled={ConditionalBooleanValue.getValue(\n panelItem.isDisabled\n )}\n isActive={!!panelItem.isActive}\n key={panelItem.id}\n label={label}\n icon={icon}\n item={panelItem}\n onClick={handleActionItemClick}\n onPointerUp={handleOnPointerUp}\n badge={<Badge type={panelItem.badgeType} />}\n />\n );\n })}\n </GroupColumn>\n )),\n [\n columnToItems,\n handleActionItemClick,\n handleGroupItemClick,\n handleOnPointerUp,\n ]\n );\n\n // ensure we have a panel title for nested groups\n const titleString = activeGroup.panelLabel\n ? activeGroup.panelLabel\n : activeGroup.label;\n const panelTitle = React.useMemo(\n () => ConditionalStringValue.getValue(titleString),\n [titleString]\n );\n const className = classnames(\n 1 === groupArray.length && \"components-toolbar-item-expandable-group-group\",\n groupArray.length > 1 && \"components-toolbar-item-expandable-group-nested\"\n );\n\n return (\n <Panel className={className} onKeyDown={handleOnKeyDown}>\n {groupArray.length > 1 && (\n <BackArrow className=\"components-back\" onClick={handleBackArrowClick} />\n )}\n {panelTitle && <Title>{panelTitle}</Title>}\n {columns && <Columns>{columns}</Columns>}\n </Panel>\n );\n}\n"]}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
translate: (key: string) => string;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Returns a translation function.
|
|
1
|
+
/** Returns a translation function.
|
|
6
2
|
* @internal
|
|
7
3
|
*/
|
|
8
|
-
export declare function useTranslation():
|
|
9
|
-
|
|
4
|
+
export declare function useTranslation(): {
|
|
5
|
+
translate: (key: string) => string;
|
|
6
|
+
};
|
|
10
7
|
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/components-react/useTranslation.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,cAAc;;EAY7B"}
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as defaults from "./UiComponents.json";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { usePackageTranslation } from "@itwin/core-react";
|
|
5
8
|
import { UiComponents } from "./UiComponents";
|
|
6
|
-
/**
|
|
7
|
-
* Returns a translation function.
|
|
9
|
+
/** Returns a translation function.
|
|
8
10
|
* @internal
|
|
9
11
|
*/
|
|
10
12
|
export function useTranslation() {
|
|
11
|
-
const
|
|
13
|
+
const fallback = React.useCallback((key) => {
|
|
14
|
+
if (!UiComponents.initialized) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
12
17
|
return UiComponents.translate(key);
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
18
|
+
}, []);
|
|
19
|
+
return usePackageTranslation({
|
|
20
|
+
namespace: UiComponents.localizationNamespace,
|
|
21
|
+
fallback,
|
|
22
|
+
defaults,
|
|
23
|
+
});
|
|
15
24
|
}
|
|
16
25
|
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/components-react/useTranslation.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;YAC7B,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,qBAAqB,CAAC;QAC3B,SAAS,EAAE,YAAY,CAAC,qBAAqB;QAC7C,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,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 *--------------------------------------------------------------------------------------------*/\nimport * as defaults from \"./UiComponents.json\";\nimport * as React from \"react\";\nimport { usePackageTranslation } from \"@itwin/core-react\";\nimport { UiComponents } from \"./UiComponents\";\n\n/** Returns a translation function.\n * @internal\n */\nexport function useTranslation() {\n const fallback = React.useCallback((key: string) => {\n if (!UiComponents.initialized) {\n return undefined;\n }\n return UiComponents.translate(key);\n }, []);\n return usePackageTranslation({\n namespace: UiComponents.localizationNamespace,\n fallback,\n defaults,\n });\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { UiComponents } from "./components-react/UiComponents";
|
|
2
|
+
export * from "./components-react/useTranslation";
|
|
2
3
|
export * from "./components-react/common/Links";
|
|
3
4
|
export * from "./components-react/common/PageOptions";
|
|
4
5
|
export * from "./components-react/common/selection/SelectionModes";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAElD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AAErE,cAAc,yDAAyD,CAAC;AAExE,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,qDAAqD,CAAC;AACpE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,y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AAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat
|
|
6
6
|
export { UiComponents } from "./components-react/UiComponents";
|
|
7
|
+
export * from "./components-react/useTranslation";
|
|
7
8
|
export * from "./components-react/common/Links";
|
|
8
9
|
export * from "./components-react/common/PageOptions";
|
|
9
10
|
export * from "./components-react/common/selection/SelectionModes";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,qEAAqE;AAErE,OAAO,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,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/CustomizablePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\nexport * from \"./components-react/filter-builder/FilterBuilderRangeValue\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\nexport * from \"./components-react/filter-builder/FilterBuilderLogicalOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderToolbar\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/InternalToolbarComponent\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,qEAAqE;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAElD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD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6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,qDAAqD,CAAC;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\nexport * from \"./components-react/useTranslation\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/CustomizablePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\nexport * from \"./components-react/filter-builder/FilterBuilderRangeValue\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\nexport * from \"./components-react/filter-builder/FilterBuilderLogicalOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderToolbar\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/InternalToolbarComponent\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/components-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "iTwin.js UI complex components",
|
|
5
5
|
"main": "lib/cjs/components-react.js",
|
|
6
6
|
"module": "lib/esm/components-react.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@itwin/appui-abstract": "^3.7.0 || ^4.0.0",
|
|
26
26
|
"@itwin/core-bentley": "^3.7.0 || ^4.0.0",
|
|
27
|
-
"@itwin/core-react": "^4.
|
|
27
|
+
"@itwin/core-react": "^4.12.0",
|
|
28
28
|
"react": "^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"typemoq": "^2.1.0",
|
|
84
84
|
"typescript": "~5.0.2",
|
|
85
85
|
"upath": "^2.0.1",
|
|
86
|
-
"@itwin/core-react": "4.
|
|
86
|
+
"@itwin/core-react": "4.12.0"
|
|
87
87
|
},
|
|
88
88
|
"//dependencies": [
|
|
89
89
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|
|
@@ -126,8 +126,7 @@
|
|
|
126
126
|
"build:esm": "npm run -s copy:esm && tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
127
127
|
"copy:cjs": "cpx \"./src/**/*.*css\" ./lib/cjs",
|
|
128
128
|
"copy:esm": "cpx \"./src/**/*.*css\" ./lib/esm",
|
|
129
|
-
"copy:locale": "cpx
|
|
130
|
-
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
129
|
+
"copy:locale": "cpx ./src/components-react/UiComponents.json ./lib/public/locales/en",
|
|
131
130
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
132
131
|
"cover": "nyc npm -s test",
|
|
133
132
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|