@itwin/core-react 5.0.5 → 5.1.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 +26 -19
- package/lib/cjs/core-react/colorthemes.scss +0 -1
- package/lib/cjs/core-react/colorvariables.scss +0 -2
- package/lib/cjs/core-react/inputs/variables.scss +0 -2
- package/lib/cjs/core-react/style/themecolors.scss +0 -2
- package/lib/core-react/UiCore.js +1 -1
- package/lib/core-react/UiCore.js.map +1 -1
- package/lib/core-react/autosuggest/AutoSuggest.d.ts +1 -0
- package/lib/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/core-react/autosuggest/AutoSuggest.js +1 -0
- package/lib/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/core-react/badge/Badge.js.map +1 -1
- package/lib/core-react/badge/BadgeType.d.ts +1 -1
- package/lib/core-react/badge/BadgeType.js +1 -1
- package/lib/core-react/badge/BadgeType.js.map +1 -1
- package/lib/core-react/base/Centered.js +2 -2
- package/lib/core-react/base/Centered.js.map +1 -1
- package/lib/core-react/base/Div.js +1 -1
- package/lib/core-react/base/Div.js.map +1 -1
- package/lib/core-react/base/DivWithOutsideClick.d.ts +2 -2
- package/lib/core-react/base/DivWithOutsideClick.js +2 -2
- package/lib/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/core-react/base/FillCentered.js +2 -2
- package/lib/core-react/base/FillCentered.js.map +1 -1
- package/lib/core-react/base/FlexWrapContainer.js +2 -2
- package/lib/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/core-react/base/Gap.js +1 -1
- package/lib/core-react/base/Gap.js.map +1 -1
- package/lib/core-react/base/ScrollView.js +2 -2
- package/lib/core-react/base/ScrollView.js.map +1 -1
- package/lib/core-react/button/UnderlinedButton.js +1 -1
- package/lib/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/core-react/checklistbox/CheckListBox.js +1 -1
- package/lib/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/core-react/colorthemes.scss +0 -1
- package/lib/core-react/colorvariables.scss +0 -2
- package/lib/core-react/contextmenu/ContextMenu.d.ts +1 -0
- package/lib/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/core-react/contextmenu/ContextMenu.js +1 -0
- package/lib/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/core-react/contextmenu/ContextMenuDivider.js +1 -1
- package/lib/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/core-react/contextmenu/ContextMenuItem.d.ts +1 -0
- package/lib/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/core-react/contextmenu/ContextMenuItem.js +2 -1
- package/lib/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/core-react/contextmenu/ContextSubMenu.d.ts +1 -0
- package/lib/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/core-react/contextmenu/ContextSubMenu.js +2 -1
- package/lib/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/core-react/contextmenu/TildeFinder.d.ts.map +1 -1
- package/lib/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/core-react/dialog/Dialog.js +14 -14
- package/lib/core-react/dialog/Dialog.js.map +1 -1
- package/lib/core-react/dialog/GlobalDialog.js +3 -3
- package/lib/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/core-react/expandable/ExpandableList.js +3 -3
- package/lib/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/core-react/focustrap/FocusTrap.js +2 -2
- package/lib/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/core-react/hocs/withIsPressed.d.ts +1 -1
- package/lib/core-react/hocs/withIsPressed.d.ts.map +1 -1
- package/lib/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/core-react/hocs/withOnOutsideClick.d.ts +3 -3
- package/lib/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/core-react/hocs/withTimeout.d.ts +3 -1
- package/lib/core-react/hocs/withTimeout.d.ts.map +1 -1
- package/lib/core-react/hocs/withTimeout.js +3 -2
- package/lib/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/core-react/icons/ConditionalIconItem.js +1 -1
- package/lib/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/core-react/icons/IconComponent.js.map +1 -1
- package/lib/core-react/icons/SvgPath.js +1 -1
- package/lib/core-react/icons/SvgPath.js.map +1 -1
- package/lib/core-react/icons/WebFontIcon.js +1 -1
- package/lib/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/core-react/inputs/Input.js.map +1 -1
- package/lib/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/core-react/inputs/iconinput/IconInput.js +2 -2
- package/lib/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/core-react/inputs/variables.scss +0 -2
- package/lib/core-react/l10n/useTranslation.js +1 -1
- package/lib/core-react/l10n/useTranslation.js.map +1 -1
- package/lib/core-react/listbox/Listbox.js.map +1 -1
- package/lib/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/core-react/notification/MessageRenderer.js +1 -1
- package/lib/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/core-react/notification/MessageType.js.map +1 -1
- package/lib/core-react/popup/Popup.d.ts +2 -1
- package/lib/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/core-react/popup/Popup.js +5 -4
- package/lib/core-react/popup/Popup.js.map +1 -1
- package/lib/core-react/radialmenu/RadialMenu.d.ts +1 -0
- package/lib/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/core-react/radialmenu/RadialMenu.js +1 -0
- package/lib/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/core-react/settings/SettingsContainer.js +1 -1
- package/lib/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/core-react/style/themecolors.scss +0 -2
- package/lib/core-react/tabs/Tabs.d.ts +1 -0
- package/lib/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/core-react/tabs/Tabs.js +1 -0
- package/lib/core-react/tabs/Tabs.js.map +1 -1
- package/lib/core-react/tabs/VerticalTabs.js +1 -1
- package/lib/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/core-react/text/BlockText.js +2 -2
- package/lib/core-react/text/BlockText.js.map +1 -1
- package/lib/core-react/text/BodyText.js +2 -2
- package/lib/core-react/text/BodyText.js.map +1 -1
- package/lib/core-react/text/DisabledText.js +1 -1
- package/lib/core-react/text/DisabledText.js.map +1 -1
- package/lib/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/core-react/text/FilteredText.js +1 -2
- package/lib/core-react/text/FilteredText.js.map +1 -1
- package/lib/core-react/text/MutedText.js +2 -2
- package/lib/core-react/text/MutedText.js.map +1 -1
- package/lib/core-react/text/StyledText.js.map +1 -1
- package/lib/core-react/text/TextProps.js.map +1 -1
- package/lib/core-react/tree/Branch.js +1 -1
- package/lib/core-react/tree/Branch.js.map +1 -1
- package/lib/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/core-react/tree/Node.js.map +1 -1
- package/lib/core-react/tree/Placeholder.js +1 -1
- package/lib/core-react/tree/Placeholder.js.map +1 -1
- package/lib/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/core-react/tree/Tree.js +4 -4
- package/lib/core-react/tree/Tree.js.map +1 -1
- package/lib/core-react/uistate/LocalStateStorage.js +1 -1
- package/lib/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/core-react/uistate/UiStateEntry.js +1 -1
- package/lib/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/core-react/utils/IconHelper.js +1 -1
- package/lib/core-react/utils/IconHelper.js.map +1 -1
- package/lib/core-react/utils/IconWebComponent.js +1 -1
- package/lib/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/core-react/utils/Props.js.map +1 -1
- package/lib/core-react/utils/Rectangle.js.map +1 -1
- package/lib/core-react/utils/ScrollPositionMaintainer.js +4 -4
- package/lib/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/core-react/utils/Size.js.map +1 -1
- package/lib/core-react/utils/Timer.js +1 -1
- package/lib/core-react/utils/Timer.js.map +1 -1
- package/lib/core-react/utils/flattenChildren.d.ts.map +1 -1
- package/lib/core-react/utils/getBestBWContrastColor.d.ts.map +1 -1
- package/lib/core-react/utils/getBestBWContrastColor.js +1 -1
- package/lib/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/core-react/utils/getCssVariable.js +1 -1
- package/lib/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/core-react/utils/getDisplayName.d.ts.map +1 -1
- package/lib/core-react/utils/hooks/useCrossOriginPopup.js +1 -1
- package/lib/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/core-react/utils/hooks/useResizeObserver.js +1 -1
- package/lib/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/core-react/utils/hooks/useTargeted.d.ts.map +1 -1
- package/lib/core-react/utils/shallowDiffers.d.ts.map +1 -1
- package/lib/core-react.js +1 -1
- package/lib/core-react.js.map +1 -1
- package/lib/esm/core-react/colorthemes.scss +0 -1
- package/lib/esm/core-react/colorvariables.scss +0 -2
- package/lib/esm/core-react/inputs/variables.scss +0 -2
- package/lib/esm/core-react/style/themecolors.scss +0 -2
- package/package.json +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/core-react/tabs/Tabs.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,SAAS,kBAAkB,CAAC,IAAuB;IACjD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,IAAuB;IACzC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAkCD;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAuC;IAIrE,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QAJP,gBAAW,GAA8C,EAAE,CAAC;QAwD5D,qBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;YAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACxC,IAAI,OAAO,IAAI,OAA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ACD,6BAAK,SAAS,EAAC,sCAAsC;4BACnD,kCACG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAC3C;4BACN,QAAQ,IAAI,CACX,8BAAM,SAAS,EAAC,sBAAsB,IAAE,QAAQ,CAAQ,CACzD,CACG,CACF,CACJ,CACD,CACN,CAAC;QACJ,CAAC,CAAC,CACC,CACN,CAAC;IACJ,CAAC;CACF","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 Tabs\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { Orientation } from \"../enums/Orientation.js\";\nimport { ItemKeyboardNavigator } from \"../focus/ItemKeyboardNavigator.js\";\nimport { IconHelper } from \"../utils/IconHelper.js\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** TabLabel provides ability to define label, icon, and tooltip for a tab entry. The tooltip can be defined as JSX|Element\n * to support react-tooltip component or a string that will be use to set the title property.\n * @public\n * @deprecated in 4.12.0. Interface used in a deprecated component {@link Tabs}.\n */\nexport interface TabLabel {\n label: string;\n subLabel?: string;\n icon?: string | React.ReactElement;\n tabId: string /* optional id added to tab so it can be used by react-tooltip */;\n /** tooltip allows React.ReactElement to support styled tooltips like react-tooltip. */\n tooltip?: string | React.ReactElement;\n disabled?: boolean;\n}\n\nfunction isTabLabelWithIcon(item: string | TabLabel): item is TabLabel {\n return typeof item !== \"string\" && !!item.icon;\n}\n\nfunction isTabLabel(item: string | TabLabel): item is TabLabel {\n return typeof item !== \"string\";\n}\n\n/** Properties for the [[VerticalTabs]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.\n */\nexport interface TabsProps\n extends React.AllHTMLAttributes<HTMLUListElement>,\n CommonProps {\n /** Text shown for each tab */\n labels: Array<string | TabLabel>;\n /** Handler for activating a tab */\n onActivateTab?: (index: number) => any;\n /** Index of the initial active tab */\n activeIndex?: number;\n /** Indicates whether the bar on the active tab is green instead of the default blue */\n green?: boolean;\n}\n\ninterface TabsState {\n activeIndex: number;\n}\n\n/** Properties for the base [[Tabs]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.\n */\nexport interface MainTabsProps extends TabsProps {\n /** Main CSS class name */\n mainClassName: string;\n /** Orientation of the Tabs list */\n orientation: Orientation;\n}\n\n/** Tabs meant to represent the current position in a page/section\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/tabs iTwinUI Tabs} instead.\n */\nexport class Tabs extends React.PureComponent<MainTabsProps, TabsState> {\n private _anchorRefs: Array<React.RefObject<HTMLAnchorElement>> = [];\n private _itemKeyboardNavigator: ItemKeyboardNavigator;\n\n constructor(props: MainTabsProps) {\n super(props);\n\n const activeIndex = this.validateActiveIndex(props.activeIndex);\n this.state = {\n activeIndex,\n };\n\n props.labels.forEach(() =>\n this._anchorRefs.push(React.createRef<HTMLAnchorElement>())\n );\n this._itemKeyboardNavigator = new ItemKeyboardNavigator(\n this._handleFocusItem,\n this._activateTab\n );\n }\n\n private validateActiveIndex(idx?: number): number {\n let activeIndex = 0;\n if (idx && idx >= 0 && idx < this.props.labels.length) activeIndex = idx;\n return activeIndex;\n }\n\n public override componentDidMount() {\n this._itemKeyboardNavigator.itemCount = this.props.labels.length;\n this._itemKeyboardNavigator.orientation = this.props.orientation;\n }\n\n public override componentDidUpdate(prevProps: MainTabsProps) {\n if (prevProps.labels !== this.props.labels)\n this._itemKeyboardNavigator.itemCount = this.props.labels.length;\n\n if (prevProps.orientation !== this.props.orientation)\n this._itemKeyboardNavigator.orientation = this.props.orientation;\n\n if (prevProps.activeIndex !== this.props.activeIndex) {\n let hadFocus = false;\n const element = this._anchorRefs[this.state.activeIndex].current;\n if (element && document.activeElement === element) hadFocus = true;\n const activeIndex = this.validateActiveIndex(this.props.activeIndex);\n\n this.setState(\n () => ({ activeIndex }),\n () => {\n if (hadFocus) {\n const newElement = this._anchorRefs[activeIndex].current;\n if (newElement) newElement.focus();\n }\n }\n );\n }\n }\n\n private _handleFocusItem = (index: number) => {\n const itemRef = this._anchorRefs[index];\n if (itemRef && itemRef.current) itemRef.current.focus();\n };\n\n private _handleTabClick = (index: number) => {\n this._activateTab(index);\n };\n\n /** Handle keydown on tabs */\n private _handleKeyDownEvent(event: React.KeyboardEvent, index: number) {\n this._itemKeyboardNavigator.handleKeyDownEvent(event, index);\n }\n\n /** Handle keyup on tabs */\n private _handleKeyUpEvent(event: React.KeyboardEvent, index: number) {\n this._itemKeyboardNavigator.handleKeyUpEvent(event, index);\n }\n\n private _activateTab = (index: number) => {\n this.props.onActivateTab && this.props.onActivateTab(index);\n this.setState({ activeIndex: index });\n };\n\n public override render(): React.ReactElement {\n const ulClassNames = classnames(\n this.props.mainClassName,\n this.props.green && \"uicore-tabs-green\",\n this.props.className\n );\n\n const anyIconsPresent =\n this.props.labels.reduce(\n (a, b) => a + (isTabLabelWithIcon(b) ? 1 : 0),\n 0\n ) > 0;\n\n return (\n <ul\n className={ulClassNames}\n style={this.props.style}\n role=\"tablist\"\n aria-orientation={\n this.props.orientation === Orientation.Vertical\n ? \"vertical\"\n : \"horizontal\"\n }\n >\n {this.props.labels.map((label, index) => {\n let disabled;\n let tooltipElement: React.ReactElement | undefined;\n let title: string | undefined;\n let subLabel: string | undefined;\n let tabId = \"\";\n let icon;\n if (isTabLabel(label)) {\n icon = IconHelper.getIconReactNode(label.icon);\n subLabel = label.subLabel;\n disabled = label.disabled;\n tabId = label.tabId;\n if (React.isValidElement(label.tooltip))\n tooltipElement = label.tooltip;\n else if (typeof label.tooltip === \"string\") title = label.tooltip;\n }\n return (\n <li\n key={index}\n title={title}\n className={classnames(\n index === this.state.activeIndex && \"core-active\",\n disabled && \"core-tab-item-disabled\"\n )}\n role=\"tab\"\n aria-selected={index === this.state.activeIndex}\n data-for={`${tabId}`} /* to support react-tooltip */\n >\n {tooltipElement}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n ref={this._anchorRefs[index]}\n tabIndex={index === this.state.activeIndex ? 0 : -1}\n onClick={() => this._handleTabClick(index)}\n onKeyDown={(event) => this._handleKeyDownEvent(event, index)}\n onKeyUp={(event) => this._handleKeyUpEvent(event, index)}\n data-testid={`${tabId}`}\n role=\"button\"\n >\n <div\n className={classnames(\n \"uicore-tabs-inline-label\",\n disabled && \"core-tab-item-disabled\"\n )}\n >\n {anyIconsPresent && (\n <span className=\"uicore-tabs-icon\">{icon}</span>\n )}\n <div className=\"uicore-tabs-label-subLabel-container\">\n <span>\n {typeof label === \"string\" ? label : label.label}\n </span>\n {subLabel && (\n <span className=\"uicore-tabs-subLabel\">{subLabel}</span>\n )}\n </div>\n </div>\n </a>\n </li>\n );\n })}\n </ul>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/core-react/tabs/Tabs.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,SAAS,kBAAkB,CAAC,IAAuB;IACjD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACjD,CAAC;AAED,SAAS,UAAU,CAAC,IAAuB;IACzC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAkCD;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAuC;I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CAAC,KAAK,EAAE,KAAK,CAAC,iBAC3C,GAAG,KAAK,EAAE,EACvB,IAAI,EAAC,QAAQ;oBAEb,6BACE,SAAS,EAAE,UAAU,CACnB,0BAA0B,EAC1B,QAAQ,IAAI,wBAAwB,CACrC;wBAEA,eAAe,IAAI,CAClB,8BAAM,SAAS,EAAC,kBAAkB,IAAE,IAAI,CAAQ,CACjD;wBACD,6BAAK,SAAS,EAAC,sCAAsC;4BACnD,kCACG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAC3C;4BACN,QAAQ,IAAI,CACX,8BAAM,SAAS,EAAC,sBAAsB,IAAE,QAAQ,CAAQ,CACzD,CACG,CACF,CACJ,CACD,CACN,CAAC;QACJ,CAAC,CAAC,CACC,CACN,CAAC;IACJ,CAAC;CACF","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 Tabs\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { Orientation } from \"../enums/Orientation.js\";\nimport { ItemKeyboardNavigator } from \"../focus/ItemKeyboardNavigator.js\";\nimport { IconHelper } from \"../utils/IconHelper.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** TabLabel provides ability to define label, icon, and tooltip for a tab entry. The tooltip can be defined as JSX|Element\n * to support react-tooltip component or a string that will be use to set the title property.\n * @public\n * @deprecated in 4.12.0. Interface used in a deprecated component {@link Tabs}.\n */\nexport interface TabLabel {\n label: string;\n subLabel?: string;\n icon?: string | React.ReactElement;\n tabId: string /* optional id added to tab so it can be used by react-tooltip */;\n /** tooltip allows React.ReactElement to support styled tooltips like react-tooltip. */\n tooltip?: string | React.ReactElement;\n disabled?: boolean;\n}\n\nfunction isTabLabelWithIcon(item: string | TabLabel): item is TabLabel {\n return typeof item !== \"string\" && !!item.icon;\n}\n\nfunction isTabLabel(item: string | TabLabel): item is TabLabel {\n return typeof item !== \"string\";\n}\n\n/** Properties for the [[VerticalTabs]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.\n */\nexport interface TabsProps\n extends React.AllHTMLAttributes<HTMLUListElement>,\n CommonProps {\n /** Text shown for each tab */\n labels: Array<string | TabLabel>;\n /** Handler for activating a tab */\n onActivateTab?: (index: number) => any;\n /** Index of the initial active tab */\n activeIndex?: number;\n /** Indicates whether the bar on the active tab is green instead of the default blue */\n green?: boolean;\n}\n\ninterface TabsState {\n activeIndex: number;\n}\n\n/** Properties for the base [[Tabs]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link Tabs}.\n */\nexport interface MainTabsProps extends TabsProps {\n /** Main CSS class name */\n mainClassName: string;\n /** Orientation of the Tabs list */\n orientation: Orientation;\n}\n\n/** Tabs meant to represent the current position in a page/section\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/tabs iTwinUI Tabs} instead.\n */\nexport class Tabs extends React.PureComponent<MainTabsProps, TabsState> {\n private _anchorRefs: Array<React.RefObject<HTMLAnchorElement>> = [];\n private _itemKeyboardNavigator: ItemKeyboardNavigator;\n\n constructor(props: MainTabsProps) {\n super(props);\n\n const activeIndex = this.validateActiveIndex(props.activeIndex);\n this.state = {\n activeIndex,\n };\n\n props.labels.forEach(() =>\n this._anchorRefs.push(React.createRef<HTMLAnchorElement>())\n );\n this._itemKeyboardNavigator = new ItemKeyboardNavigator(\n this._handleFocusItem,\n this._activateTab\n );\n }\n\n private validateActiveIndex(idx?: number): number {\n let activeIndex = 0;\n if (idx && idx >= 0 && idx < this.props.labels.length) activeIndex = idx;\n return activeIndex;\n }\n\n public override componentDidMount() {\n this._itemKeyboardNavigator.itemCount = this.props.labels.length;\n this._itemKeyboardNavigator.orientation = this.props.orientation;\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: MainTabsProps) {\n if (prevProps.labels !== this.props.labels)\n this._itemKeyboardNavigator.itemCount = this.props.labels.length;\n\n if (prevProps.orientation !== this.props.orientation)\n this._itemKeyboardNavigator.orientation = this.props.orientation;\n\n if (prevProps.activeIndex !== this.props.activeIndex) {\n let hadFocus = false;\n const element = this._anchorRefs[this.state.activeIndex].current;\n if (element && document.activeElement === element) hadFocus = true;\n const activeIndex = this.validateActiveIndex(this.props.activeIndex);\n\n this.setState(\n () => ({ activeIndex }),\n () => {\n if (hadFocus) {\n const newElement = this._anchorRefs[activeIndex].current;\n if (newElement) newElement.focus();\n }\n }\n );\n }\n }\n\n private _handleFocusItem = (index: number) => {\n const itemRef = this._anchorRefs[index];\n if (itemRef && itemRef.current) itemRef.current.focus();\n };\n\n private _handleTabClick = (index: number) => {\n this._activateTab(index);\n };\n\n /** Handle keydown on tabs */\n private _handleKeyDownEvent(event: React.KeyboardEvent, index: number) {\n this._itemKeyboardNavigator.handleKeyDownEvent(event, index);\n }\n\n /** Handle keyup on tabs */\n private _handleKeyUpEvent(event: React.KeyboardEvent, index: number) {\n this._itemKeyboardNavigator.handleKeyUpEvent(event, index);\n }\n\n private _activateTab = (index: number) => {\n this.props.onActivateTab && this.props.onActivateTab(index);\n this.setState({ activeIndex: index });\n };\n\n public override render(): React.ReactElement {\n const ulClassNames = classnames(\n this.props.mainClassName,\n this.props.green && \"uicore-tabs-green\",\n this.props.className\n );\n\n const anyIconsPresent =\n this.props.labels.reduce(\n (a, b) => a + (isTabLabelWithIcon(b) ? 1 : 0),\n 0\n ) > 0;\n\n return (\n <ul\n className={ulClassNames}\n style={this.props.style}\n role=\"tablist\"\n aria-orientation={\n this.props.orientation === Orientation.Vertical\n ? \"vertical\"\n : \"horizontal\"\n }\n >\n {this.props.labels.map((label, index) => {\n let disabled;\n let tooltipElement: React.ReactElement | undefined;\n let title: string | undefined;\n let subLabel: string | undefined;\n let tabId = \"\";\n let icon;\n if (isTabLabel(label)) {\n icon = IconHelper.getIconReactNode(label.icon);\n subLabel = label.subLabel;\n disabled = label.disabled;\n tabId = label.tabId;\n if (React.isValidElement(label.tooltip))\n tooltipElement = label.tooltip;\n else if (typeof label.tooltip === \"string\") title = label.tooltip;\n }\n return (\n <li\n key={index}\n title={title}\n className={classnames(\n index === this.state.activeIndex && \"core-active\",\n disabled && \"core-tab-item-disabled\"\n )}\n role=\"tab\"\n aria-selected={index === this.state.activeIndex}\n data-for={`${tabId}`} /* to support react-tooltip */\n >\n {tooltipElement}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n <a\n ref={this._anchorRefs[index]}\n tabIndex={index === this.state.activeIndex ? 0 : -1}\n onClick={() => this._handleTabClick(index)}\n onKeyDown={(event) => this._handleKeyDownEvent(event, index)}\n onKeyUp={(event) => this._handleKeyUpEvent(event, index)}\n data-testid={`${tabId}`}\n role=\"button\"\n >\n <div\n className={classnames(\n \"uicore-tabs-inline-label\",\n disabled && \"core-tab-item-disabled\"\n )}\n >\n {anyIconsPresent && (\n <span className=\"uicore-tabs-icon\">{icon}</span>\n )}\n <div className=\"uicore-tabs-label-subLabel-container\">\n <span>\n {typeof label === \"string\" ? label : label.label}\n </span>\n {subLabel && (\n <span className=\"uicore-tabs-subLabel\">{subLabel}</span>\n )}\n </div>\n </div>\n </a>\n </li>\n );\n })}\n </ul>\n );\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { Tabs } from "./Tabs.js";
|
|
10
10
|
import { Orientation } from "../enums/Orientation.js";
|
|
11
|
-
/* eslint-disable
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
12
12
|
/** Vertical tabs meant to represent the current position in a page/section
|
|
13
13
|
* @public
|
|
14
14
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/tabs#vertical iTwinUI Tabs} instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalTabs.js","sourceRoot":"","sources":["../../../src/core-react/tabs/VerticalTabs.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,
|
|
1
|
+
{"version":3,"file":"VerticalTabs.js","sourceRoot":"","sources":["../../../src/core-react/tabs/VerticalTabs.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,qDAAqD;AAErD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC3C,OAAO,CACL,oBAAC,IAAI,IACH,aAAa,EAAC,sBAAsB,EACpC,WAAW,EAAE,WAAW,CAAC,QAAQ,KAC7B,KAAK,GACT,CACH,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 Tabs\n */\n\nimport * as React from \"react\";\nimport type { TabsProps } from \"./Tabs.js\";\nimport { Tabs } from \"./Tabs.js\";\nimport { Orientation } from \"../enums/Orientation.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Vertical tabs meant to represent the current position in a page/section\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/tabs#vertical iTwinUI Tabs} instead.\n */\nexport function VerticalTabs(props: TabsProps) {\n return (\n <Tabs\n mainClassName=\"uicore-tabs-vertical\"\n orientation={Orientation.Vertical}\n {...props}\n />\n );\n}\n"]}
|
|
@@ -11,9 +11,9 @@ import { StyledText } from "./StyledText.js";
|
|
|
11
11
|
* @public
|
|
12
12
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
13
13
|
*/
|
|
14
|
-
// eslint-disable-next-line
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
15
15
|
export function BlockText(props) {
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
17
|
return React.createElement(StyledText, { ...props, mainClassName: "uicore-text-block" });
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=BlockText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockText.js","sourceRoot":"","sources":["../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"BlockText.js","sourceRoot":"","sources":["../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,4DAA4D;IAC5D,OAAO,oBAAC,UAAU,OAAK,KAAK,EAAE,aAAa,EAAC,mBAAmB,GAAG,CAAC;AACrE,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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText.js\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/** Styled block text React functional component\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function BlockText(props: TextProps) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return <StyledText {...props} mainClassName=\"uicore-text-block\" />;\n}\n"]}
|
|
@@ -11,9 +11,9 @@ import { StyledText } from "./StyledText.js";
|
|
|
11
11
|
* @public
|
|
12
12
|
* @deprecated in 4.0.0. Use `<Text variant='body' />` from iTwinUI-react package.
|
|
13
13
|
*/
|
|
14
|
-
// eslint-disable-next-line
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
15
15
|
export function BodyText(props) {
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
17
|
return React.createElement(StyledText, { ...props, mainClassName: "uicore-text-body" });
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=BodyText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyText.js","sourceRoot":"","sources":["../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"BodyText.js","sourceRoot":"","sources":["../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,UAAU,QAAQ,CAAC,KAAgB;IACvC,4DAA4D;IAC5D,OAAO,oBAAC,UAAU,OAAK,KAAK,EAAE,aAAa,EAAC,kBAAkB,GAAG,CAAC;AACpE,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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText.js\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/** Styled body text React functional component\n * @public\n * @deprecated in 4.0.0. Use `<Text variant='body' />` from iTwinUI-react package.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function BodyText(props: TextProps) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return <StyledText {...props} mainClassName=\"uicore-text-body\" />;\n}\n"]}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { StyledText } from "./StyledText.js";
|
|
10
|
-
/* eslint-disable
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
11
11
|
/** Styled disabled text React functional component
|
|
12
12
|
* @public
|
|
13
13
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisabledText.js","sourceRoot":"","sources":["../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,
|
|
1
|
+
{"version":3,"file":"DisabledText.js","sourceRoot":"","sources":["../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,qDAAqD;AAErD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC3C,OAAO,oBAAC,UAAU,OAAK,KAAK,EAAE,aAAa,EAAC,sBAAsB,GAAG,CAAC;AACxE,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 Text\n */\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText.js\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Styled disabled text React functional component\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.\n */\nexport function DisabledText(props: TextProps) {\n return <StyledText {...props} mainClassName=\"uicore-text-disabled\" />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteredText.d.ts","sourceRoot":"","sources":["../../../src/core-react/text/FilteredText.tsx"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"FilteredText.d.ts","sourceRoot":"","sources":["../../../src/core-react/text/FilteredText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,qBAAqB,CAAC;AAE7B;;;GAGG;AAEH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;;GAGG;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA2DpD"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Text
|
|
7
7
|
*/
|
|
8
|
-
// cSpell:ignore focusvalue
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
import classnames from "classnames";
|
|
11
10
|
import "./FilteredText.scss";
|
|
@@ -13,7 +12,7 @@ import "./FilteredText.scss";
|
|
|
13
12
|
* @alpha
|
|
14
13
|
* @deprecated in 4.15.0. Used internally.
|
|
15
14
|
*/
|
|
16
|
-
// eslint-disable-next-line
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
16
|
export function FilteredText(props) {
|
|
18
17
|
const { value, className, matches, matchClassName, matchStyle, ...otherProps } = props;
|
|
19
18
|
if (matches && matches.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilteredText.js","sourceRoot":"","sources":["../../../src/core-react/text/FilteredText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"FilteredText.js","sourceRoot":"","sources":["../../../src/core-react/text/FilteredText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,qBAAqB,CAAC;AAkB7B;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EACJ,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GA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------------------------\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 Text\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport type { IMatch } from \"../utils/matches.js\";\nimport \"./FilteredText.scss\";\n\n/** Props supported by [FilteredText] component\n * @alpha\n * @deprecated in 4.15.0. Props of deprecated {@link FilteredText} component.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface FilteredTextProps extends CommonProps {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** holds class name for matching span text. */\n matchClassName?: string;\n /** holds style for matching span text. */\n matchStyle?: React.CSSProperties;\n}\n\n/** Component used to highlight filter matches within a text string.\n * @alpha\n * @deprecated in 4.15.0. Used internally.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function FilteredText(props: FilteredTextProps) {\n const {\n value,\n className,\n matches,\n matchClassName,\n matchStyle,\n ...otherProps\n } = props;\n if (matches && matches.length > 0) {\n const spans: React.ReactNode[] = [];\n\n let startPos = 0;\n for (const span of matches) {\n if (span.start !== startPos)\n spans.push(\n <span key={startPos} className=\"uicore-partial-filtered-text\">\n {value.substring(startPos, span.start)}\n </span>\n );\n spans.push(\n <span\n key={span.start}\n style={matchStyle}\n className={classnames(\"uicore-filtered-text-match\", matchClassName)}\n >\n {value.substring(span.start, span.end)}\n </span>\n );\n startPos = span.end;\n }\n const endPos = value.length;\n if (startPos < endPos) {\n spans.push(\n <span key={startPos} className=\"uicore-partial-filtered-text\">\n {value.substring(startPos, endPos)}\n </span>\n );\n }\n return (\n <div\n {...otherProps}\n className={classnames(\"uicore-filtered-text\", className)}\n title={value}\n >\n {spans}\n </div>\n );\n }\n\n return (\n <span\n {...otherProps}\n className={classnames(\"uicore-filtered-text\", className)}\n title={value}\n >\n {value}\n </span>\n );\n}\n"]}
|
|
@@ -11,9 +11,9 @@ import { StyledText } from "./StyledText.js";
|
|
|
11
11
|
* @public
|
|
12
12
|
* @deprecated in 4.0.0. Use \<Text isMuted /\> from iTwinUI-react package.
|
|
13
13
|
*/
|
|
14
|
-
// eslint-disable-next-line
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
15
15
|
export function MutedText(props) {
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
17
|
return React.createElement(StyledText, { ...props, mainClassName: "uicore-text-muted" });
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=MutedText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutedText.js","sourceRoot":"","sources":["../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"MutedText.js","sourceRoot":"","sources":["../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,4DAA4D;IAC5D,OAAO,oBAAC,UAAU,OAAK,KAAK,EAAE,aAAa,EAAC,mBAAmB,GAAG,CAAC;AACrE,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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText.js\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/** Styled muted/gray text React functional component\n * @public\n * @deprecated in 4.0.0. Use \\<Text isMuted /\\> from iTwinUI-react package.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function MutedText(props: TextProps) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return <StyledText {...props} mainClassName=\"uicore-text-muted\" />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledText.js","sourceRoot":"","sources":["../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1E,OAAO,CACL,iCACM,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,EAC/C,KAAK,EAAE,KAAK,IAEX,QAAQ,CACJ,CACR,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 Text\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/* eslint-disable
|
|
1
|
+
{"version":3,"file":"StyledText.js","sourceRoot":"","sources":["../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1E,OAAO,CACL,iCACM,SAAS,EACb,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,EAC/C,KAAK,EAAE,KAAK,IAEX,QAAQ,CACJ,CACR,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 Text\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { TextProps } from \"./TextProps.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for [[StyledText]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link StyledText}.\n */\nexport interface StyledTextProps extends TextProps {\n /** Main CSS class name */\n mainClassName: string;\n}\n\n/** The base component for other text components that pass a main CSS class name.\n * @public\n * @deprecated in 4.0.0. Use \\<Text /\\> component from iTwinUI-react library.\n */\nexport function StyledText(props: StyledTextProps) {\n const { mainClassName, className, style, children, ...spanProps } = props;\n\n return (\n <span\n {...spanProps}\n className={classnames(mainClassName, className)}\n style={style}\n >\n {children}\n </span>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextProps.js","sourceRoot":"","sources":["../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 Text\n */\n\nimport type * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/** Properties for various text components\n * @public\n * @deprecated in 4.12.0. Props of deprecated text components.\n */\nexport interface TextProps\n extends React.AllHTMLAttributes<HTMLSpanElement>,\n CommonProps {} // eslint-disable-line
|
|
1
|
+
{"version":3,"file":"TextProps.js","sourceRoot":"","sources":["../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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 Text\n */\n\nimport type * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/** Properties for various text components\n * @public\n * @deprecated in 4.12.0. Props of deprecated text components.\n */\nexport interface TextProps\n extends React.AllHTMLAttributes<HTMLSpanElement>,\n CommonProps {} // eslint-disable-line @typescript-eslint/no-deprecated\n"]}
|
|
@@ -12,7 +12,7 @@ import * as React from "react";
|
|
|
12
12
|
* @public
|
|
13
13
|
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.
|
|
14
14
|
*/
|
|
15
|
-
// eslint-disable-next-line
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
16
16
|
export class TreeBranch extends React.PureComponent {
|
|
17
17
|
render() {
|
|
18
18
|
const className = classnames("core-tree-branch", this.props.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../../../src/core-react/tree/Branch.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../../../src/core-react/tree/Branch.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAClD,MAAM;QACpB,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAEvE,OAAO,CACL,6BAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAC/C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;CACF","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 Tree\n */\n\nimport \"./Branch.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\n\n/** Properties for [[TreeBranch]] React component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link TreeBranch} component.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface TreeBranchProps extends CommonProps {\n /** Child nodes of the tree branch */\n children?: React.ReactNode;\n}\n\n/** Presentation React component for a Tree branch\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class TreeBranch extends React.PureComponent<TreeBranchProps> {\n public override render() {\n const className = classnames(\"core-tree-branch\", this.props.className);\n\n return (\n <div className={className} style={this.props.style}>\n {this.props.children}\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpansionToggle.js","sourceRoot":"","sources":["../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAc3D;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,UAAU,CAC1B,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,aAAa,EACjC,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAE5E,OAAO;IACL,iEAAiE;IACjE,6BACE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,iBACL,KAAK,CAAC,aAAa,CAAC,EACjC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,CAAC,gBACA,KAAK;QAEjB,oBAAC,IAAI,IAAC,SAAS,EAAC,aAAa,EAAC,QAAQ,EAAE,oBAAC,eAAe,OAAG,GAAI,CAC3D,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/** @packageDocumentation\n * @module Tree\n */\n\nimport \"./ExpansionToggle.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { Icon } from \"../icons/IconComponent.js\";\nimport { SvgChevronRight } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../l10n/useTranslation.js\";\n\n/* eslint-disable
|
|
1
|
+
{"version":3,"file":"ExpansionToggle.js","sourceRoot":"","sources":["../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAc3D;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,UAAU,CAC1B,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,aAAa,EACjC,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAE5E,OAAO;IACL,iEAAiE;IACjE,6BACE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,iBACL,KAAK,CAAC,aAAa,CAAC,EACjC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,CAAC,gBACA,KAAK;QAEjB,oBAAC,IAAI,IAAC,SAAS,EAAC,aAAa,EAAC,QAAQ,EAAE,oBAAC,eAAe,OAAG,GAAI,CAC3D,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/** @packageDocumentation\n * @module Tree\n */\n\nimport \"./ExpansionToggle.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { Icon } from \"../icons/IconComponent.js\";\nimport { SvgChevronRight } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../l10n/useTranslation.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Properties for the [[ExpansionToggle]] component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link ExpansionToggle} component.\n */\nexport interface ExpansionToggleProps extends CommonProps {\n isExpanded?: boolean;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n [\"data-testid\"]?: string;\n}\n\n/** ExpansionToggle React component used by the [[TreeNode]] component to show collapsed or expanded state\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\nexport function ExpansionToggle(props: ExpansionToggleProps) {\n const { translate } = useTranslation();\n const className = classnames(\n \"core-tree-expansionToggle\",\n props.isExpanded && \"is-expanded\",\n props.className\n );\n const label = translate(props.isExpanded ? \"tree.collapse\" : \"tree.expand\");\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n onMouseDown={(e) => e.stopPropagation()}\n onClick={props.onClick}\n className={className}\n style={props.style}\n data-testid={props[\"data-testid\"]}\n role=\"button\"\n tabIndex={-1}\n aria-label={label}\n >\n <Icon className=\"toggle icon\" iconSpec={<SvgChevronRight />} />\n </div>\n );\n}\n"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C,aAAa,EACvC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,IAAI,EAAC,UAAU,mBACA,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACvD,QAAQ,EAAE,CAAC,CAAC;YAEZ,6BACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,iBAChB,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;gBAErD,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CACvB,oBAAC,cAAc,IACb,IAAI,EAAC,SAAS,EACd,aAAa,QACb,SAAS,EAAC,yBAAyB,GACnC,CACH;gBACA,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CA0BF","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 Tree\n */\n\nimport \"./Node.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Checkbox, ProgressRadial } from \"@itwin/itwinui-react\";\nimport { CheckBoxState } from \"../enums/CheckBoxState.js\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { ExpansionToggle } from \"./ExpansionToggle.js\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof Checkbox>;\n\n/** Props for node Checkbox renderer\n * @public\n * @deprecated in 4.16.0. Type is inlined in component props. Use `React.ComponentProps` type helper instead.\n */\nexport type NodeCheckboxRenderProps = Omit<\n CheckboxProps,\n \"onChange\" | \"onClick\"\n> & {\n onChange: (checked: boolean) => void;\n onClick: (e: React.MouseEvent) => void;\n};\n\n/** Type for node Checkbox renderer\n * @public\n * @deprecated in 4.16.0. Type is inlined in component props. Use `React.ComponentProps` type helper instead.\n */\nexport type NodeCheckboxRenderer = (\n props: NodeCheckboxRenderProps\n) => React.ReactNode;\n\n/** Number of pixels the node gets offset per each hierarchy level\n * @internal\n */\nexport const LEVEL_OFFSET = 20;\n\nconst EXPANSION_TOGGLE_WIDTH = 24;\n\n/** Properties for Tree Node CheckBox\n * @public\n * @deprecated in 4.15.0. Used in deprecated {@link TreeNodeProps} props.\n */\nexport interface NodeCheckboxProps {\n /** State of the checkbox */\n state?: CheckBoxState;\n /** Click event callback */\n onClick?: (newState: CheckBoxState) => void;\n /** Indicates whether checkbox is disabled */\n isDisabled?: boolean;\n /** Tooltip to be displayed when mouse is hovered over checkbox */\n tooltip?: string;\n}\n\n/** Properties for the [[TreeNode]] React component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link TreeNode} component.\n */\nexport interface TreeNodeProps extends CommonProps {\n label: React.ReactNode;\n level: number;\n icon?: React.ReactElement | string | number;\n checkboxProps?: NodeCheckboxProps;\n isLeaf?: boolean;\n isLoading?: boolean;\n isExpanded?: boolean;\n isFocused?: boolean;\n isSelected?: boolean;\n isHoverDisabled?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n onContextMenu?: (e: React.MouseEvent) => void;\n onMouseMove?: (e: React.MouseEvent) => void;\n onMouseDown?: (e: React.MouseEvent) => void;\n onMouseUp?: (e: React.MouseEvent) => void;\n onClickExpansionToggle?: () => void;\n children?: React.ReactNode;\n\n /** Contains render overrides for different pieces of the node component. */\n renderOverrides?: {\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\n renderCheckbox?: NodeCheckboxRenderer;\n };\n [\"data-testid\"]?: string;\n}\n\n/** Presentation React component for a Tree node\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\nexport class TreeNode extends React.Component<TreeNodeProps> {\n constructor(props: TreeNodeProps) {\n super(props);\n }\n\n public override render() {\n const className = classnames(\n \"core-tree-node\",\n this.props.isFocused && \"is-focused\",\n this.props.isSelected && \"is-selected\",\n this.props.isHoverDisabled && \"is-hover-disabled\",\n this.props.className\n );\n let offset = this.props.level * LEVEL_OFFSET;\n if (!this.props.isLoading && this.props.isLeaf)\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\n\n let checkbox: React.ReactNode;\n if (this.props.checkboxProps) {\n const props: NodeCheckboxRenderProps = {\n label: \"\",\n checked: this.props.checkboxProps.state === CheckBoxState.On,\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\n disabled: this.props.checkboxProps.isDisabled,\n title: this.props.checkboxProps.tooltip,\n onClick: this._onCheckboxClick,\n onChange: this._onCheckboxChange,\n };\n if (\n this.props.renderOverrides &&\n this.props.renderOverrides.renderCheckbox\n ) {\n checkbox = this.props.renderOverrides.renderCheckbox(props);\n } else {\n checkbox = (\n <Checkbox\n {...props}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n this._onCheckboxChange(e.target.checked)\n }\n data-testid={this.createSubComponentTestId(\"checkbox\")}\n />\n );\n }\n }\n\n const icon = this.props.icon ? (\n <div className=\"core-tree-node-icon\">{this.props.icon}</div>\n ) : undefined;\n\n const toggle = this.props.isLoading ? undefined : this.props.isLeaf ? (\n <div />\n ) : (\n <ExpansionToggle\n className=\"expansion-toggle\"\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\n onClick={this._onClickExpansionToggle}\n isExpanded={this.props.isExpanded}\n />\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n className={className}\n style={this.props.style}\n data-testid={this.props[\"data-testid\"]}\n onClick={this._onClick}\n onContextMenu={this.props.onContextMenu}\n onMouseDown={this.props.onMouseDown}\n onMouseUp={this.props.onMouseUp}\n onMouseMove={this.props.onMouseMove}\n role=\"treeitem\"\n aria-selected={this.props.isSelected ? \"true\" : \"false\"}\n tabIndex={-1}\n >\n <div\n className=\"contents\"\n style={{ marginLeft: offset }}\n data-testid={this.createSubComponentTestId(\"contents\")}\n >\n {this.props.isLoading && (\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n className=\"core-progress-indicator\"\n />\n )}\n {toggle}\n {checkbox}\n {icon}\n {this.props.label}\n </div>\n {this.props.children}\n </div>\n );\n }\n\n private createSubComponentTestId(subId: string): string | undefined {\n if (!this.props[\"data-testid\"]) return undefined;\n return `${this.props[\"data-testid\"]}-${subId}`;\n }\n\n private _onCheckboxChange = (checked: boolean) => {\n if (\n this.props.checkboxProps &&\n this.props.checkboxProps.onClick &&\n !this.props.checkboxProps.isDisabled\n )\n this.props.checkboxProps.onClick(\n checked ? CheckBoxState.On : CheckBoxState.Off\n );\n };\n\n private _onCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n if (this.props.onClickExpansionToggle) this.props.onClickExpansionToggle();\n };\n\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n this.props.onClick?.(e);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,O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,CAAC,OAAO,EACvD,QAAQ,EAAE,CAAC,CAAC;YAEZ,6BACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,iBAChB,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;gBAErD,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CACvB,oBAAC,cAAc,IACb,IAAI,EAAC,SAAS,EACd,aAAa,QACb,SAAS,EAAC,yBAAyB,GACnC,CACH;gBACA,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CA0BF","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 Tree\n */\n\nimport \"./Node.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Checkbox, ProgressRadial } from \"@itwin/itwinui-react\";\nimport { CheckBoxState } from \"../enums/CheckBoxState.js\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { ExpansionToggle } from \"./ExpansionToggle.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof Checkbox>;\n\n/** Props for node Checkbox renderer\n * @public\n * @deprecated in 4.16.0. Type is inlined in component props. Use `React.ComponentProps` type helper instead.\n */\nexport type NodeCheckboxRenderProps = Omit<\n CheckboxProps,\n \"onChange\" | \"onClick\"\n> & {\n onChange: (checked: boolean) => void;\n onClick: (e: React.MouseEvent) => void;\n};\n\n/** Type for node Checkbox renderer\n * @public\n * @deprecated in 4.16.0. Type is inlined in component props. Use `React.ComponentProps` type helper instead.\n */\nexport type NodeCheckboxRenderer = (\n props: NodeCheckboxRenderProps\n) => React.ReactNode;\n\n/** Number of pixels the node gets offset per each hierarchy level\n * @internal\n */\nexport const LEVEL_OFFSET = 20;\n\nconst EXPANSION_TOGGLE_WIDTH = 24;\n\n/** Properties for Tree Node CheckBox\n * @public\n * @deprecated in 4.15.0. Used in deprecated {@link TreeNodeProps} props.\n */\nexport interface NodeCheckboxProps {\n /** State of the checkbox */\n state?: CheckBoxState;\n /** Click event callback */\n onClick?: (newState: CheckBoxState) => void;\n /** Indicates whether checkbox is disabled */\n isDisabled?: boolean;\n /** Tooltip to be displayed when mouse is hovered over checkbox */\n tooltip?: string;\n}\n\n/** Properties for the [[TreeNode]] React component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link TreeNode} component.\n */\nexport interface TreeNodeProps extends CommonProps {\n label: React.ReactNode;\n level: number;\n icon?: React.ReactElement | string | number;\n checkboxProps?: NodeCheckboxProps;\n isLeaf?: boolean;\n isLoading?: boolean;\n isExpanded?: boolean;\n isFocused?: boolean;\n isSelected?: boolean;\n isHoverDisabled?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n onContextMenu?: (e: React.MouseEvent) => void;\n onMouseMove?: (e: React.MouseEvent) => void;\n onMouseDown?: (e: React.MouseEvent) => void;\n onMouseUp?: (e: React.MouseEvent) => void;\n onClickExpansionToggle?: () => void;\n children?: React.ReactNode;\n\n /** Contains render overrides for different pieces of the node component. */\n renderOverrides?: {\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\n renderCheckbox?: NodeCheckboxRenderer;\n };\n [\"data-testid\"]?: string;\n}\n\n/** Presentation React component for a Tree node\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\nexport class TreeNode extends React.Component<TreeNodeProps> {\n constructor(props: TreeNodeProps) {\n super(props);\n }\n\n public override render() {\n const className = classnames(\n \"core-tree-node\",\n this.props.isFocused && \"is-focused\",\n this.props.isSelected && \"is-selected\",\n this.props.isHoverDisabled && \"is-hover-disabled\",\n this.props.className\n );\n let offset = this.props.level * LEVEL_OFFSET;\n if (!this.props.isLoading && this.props.isLeaf)\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\n\n let checkbox: React.ReactNode;\n if (this.props.checkboxProps) {\n const props: NodeCheckboxRenderProps = {\n label: \"\",\n checked: this.props.checkboxProps.state === CheckBoxState.On,\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\n disabled: this.props.checkboxProps.isDisabled,\n title: this.props.checkboxProps.tooltip,\n onClick: this._onCheckboxClick,\n onChange: this._onCheckboxChange,\n };\n if (\n this.props.renderOverrides &&\n this.props.renderOverrides.renderCheckbox\n ) {\n checkbox = this.props.renderOverrides.renderCheckbox(props);\n } else {\n checkbox = (\n <Checkbox\n {...props}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n this._onCheckboxChange(e.target.checked)\n }\n data-testid={this.createSubComponentTestId(\"checkbox\")}\n />\n );\n }\n }\n\n const icon = this.props.icon ? (\n <div className=\"core-tree-node-icon\">{this.props.icon}</div>\n ) : undefined;\n\n const toggle = this.props.isLoading ? undefined : this.props.isLeaf ? (\n <div />\n ) : (\n <ExpansionToggle\n className=\"expansion-toggle\"\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\n onClick={this._onClickExpansionToggle}\n isExpanded={this.props.isExpanded}\n />\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n className={className}\n style={this.props.style}\n data-testid={this.props[\"data-testid\"]}\n onClick={this._onClick}\n onContextMenu={this.props.onContextMenu}\n onMouseDown={this.props.onMouseDown}\n onMouseUp={this.props.onMouseUp}\n onMouseMove={this.props.onMouseMove}\n role=\"treeitem\"\n aria-selected={this.props.isSelected ? \"true\" : \"false\"}\n tabIndex={-1}\n >\n <div\n className=\"contents\"\n style={{ marginLeft: offset }}\n data-testid={this.createSubComponentTestId(\"contents\")}\n >\n {this.props.isLoading && (\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n className=\"core-progress-indicator\"\n />\n )}\n {toggle}\n {checkbox}\n {icon}\n {this.props.label}\n </div>\n {this.props.children}\n </div>\n );\n }\n\n private createSubComponentTestId(subId: string): string | undefined {\n if (!this.props[\"data-testid\"]) return undefined;\n return `${this.props[\"data-testid\"]}-${subId}`;\n }\n\n private _onCheckboxChange = (checked: boolean) => {\n if (\n this.props.checkboxProps &&\n this.props.checkboxProps.onClick &&\n !this.props.checkboxProps.isDisabled\n )\n this.props.checkboxProps.onClick(\n checked ? CheckBoxState.On : CheckBoxState.Off\n );\n };\n\n private _onCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n if (this.props.onClickExpansionToggle) this.props.onClickExpansionToggle();\n };\n\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n this.props.onClick?.(e);\n };\n}\n"]}
|
|
@@ -14,7 +14,7 @@ import { LEVEL_OFFSET } from "./Node.js";
|
|
|
14
14
|
* @public
|
|
15
15
|
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.
|
|
16
16
|
*/
|
|
17
|
-
// eslint-disable-next-line
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
18
18
|
export class TreeNodePlaceholder extends React.PureComponent {
|
|
19
19
|
render() {
|
|
20
20
|
const className = classnames("core-tree-placeholder", this.props.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placeholder.js","sourceRoot":"","sources":["../../../src/core-react/tree/Placeholder.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;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AAK,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,GAAI,CACxD,CACP,CAAC;IACJ,CAAC;CACF","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 Tree\n */\n\nimport \"./Placeholder.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { LEVEL_OFFSET } from \"./Node.js\";\n\n/** Properties for the [[TreeNodePlaceholder]] React component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link TreeNodePlaceholder} component.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface TreeNodePlaceholderProps extends CommonProps {\n level: number;\n minWidth?: number;\n maxWidth?: number;\n [\"data-testid\"]?: string;\n}\n\n/**\n * Presentation React component for a placeholder to be displayed instead of a node while it's being loaded\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class TreeNodePlaceholder extends React.PureComponent<TreeNodePlaceholderProps> {\n public override render() {\n const className = classnames(\"core-tree-placeholder\", this.props.className);\n const offset = this.props.level * LEVEL_OFFSET;\n const min = this.props.minWidth || 50;\n const max = this.props.maxWidth || 200;\n const width = Math.floor(min + Math.random() * (max - min));\n const style = { ...this.props.style, paddingLeft: `${offset}px` };\n return (\n <div\n className={className}\n style={style}\n data-testid={this.props[\"data-testid\"]}\n >\n <div className=\"contents\" style={{ width: `${width}px` }} />\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../src/core-react/tree/Tree.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,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K,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACpD,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;CACtD;AAED;;;GAGG;AAEH,qBAAa,IAAK,SAAQ,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IACtD,OAAO,CAAC,YAAY,CAAsD;IAE1E,OAAO,KAAK,oBAAoB,GAsB/B;IAEM,eAAe,CAAC,OAAO,EAAE,OAAO;IAwDhC,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE;IAUpD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAcrC,MAAM;CAoBvB"}
|
|
@@ -13,7 +13,7 @@ import { Rectangle } from "../utils/Rectangle.js";
|
|
|
13
13
|
* @public
|
|
14
14
|
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.
|
|
15
15
|
*/
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
17
|
export class Tree extends React.PureComponent {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
@@ -80,11 +80,11 @@ export class Tree extends React.PureComponent {
|
|
|
80
80
|
getElementsByClassName(className) {
|
|
81
81
|
if (!this._treeElement.current)
|
|
82
82
|
return [];
|
|
83
|
-
const
|
|
83
|
+
const elements = new Array();
|
|
84
84
|
const collection = this._treeElement.current.getElementsByClassName(className);
|
|
85
85
|
for (let i = 0; i < collection.length; ++i)
|
|
86
|
-
|
|
87
|
-
return
|
|
86
|
+
elements.push(collection.item(i));
|
|
87
|
+
return elements;
|
|
88
88
|
}
|
|
89
89
|
setFocusByClassName(selector) {
|
|
90
90
|
let status = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../src/core-react/tree/Tree.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgBlD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../../src/core-react/tree/Tree.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgBlD;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,aAAwB;IAAxD;;QACU,iBAAY,GAAoC,KAAK,CAAC,SAAS,EAAE,CAAC;IA8H5E,CAAC;IA5HC,IAAY,oBAAoB;QAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAEjD,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,EAAE;YACxC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC/C,OAAO,CACL,KAAK,CAAC,QAAQ,KAAK,MAAM;gBACzB,KAAK,CAAC,QAAQ,KAAK,QAAQ;gBAC3B,KAAK,CAAC,SAAS,KAAK,MAAM;gBAC1B,KAAK,CAAC,SAAS,KAAK,QAAQ;gBAC5B,KAAK,CAAC,SAAS,KAAK,MAAM;gBAC1B,KAAK,CAAC,SAAS,KAAK,QAAQ,CAC7B,CAAC;QACJ,CAAC,CA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AO,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CACrD,QAAQ,CACM,CAAC;YACjB,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBAC7B,OAAO,CAAC,KAAK,EAAE,CAAC;gBAChB,MAAM,GAAG,IAAI,CAAC;YAChB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEe,MAAM;QACpB,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAEhE,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,CAAC,YAAY,EACtB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,IAEX,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;CACF","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 Tree\n */\n\nimport \"./Tree.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props.js\";\nimport { Rectangle } from \"../utils/Rectangle.js\";\n\n/** Properties for the [[Tree]] presentational React component\n * @public\n * @deprecated in 4.15.0. Props of deprecated {@link Tree} component.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface TreeProps extends CommonProps {\n children?: React.ReactNode;\n onMouseDown?: React.MouseEventHandler<HTMLDivElement>;\n onMouseMove?: React.MouseEventHandler<HTMLDivElement>;\n onMouseUp?: React.MouseEventHandler<HTMLDivElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;\n onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;\n}\n\n/** Presentation React component for a Tree\n * @public\n * @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/tree iTwinUI Tree} instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class Tree extends React.PureComponent<TreeProps> {\n private _treeElement: React.RefObject<HTMLDivElement> = React.createRef();\n\n private get _scrollableContainer(): Element | undefined {\n if (!this._treeElement.current) return undefined;\n\n const isScrollable = (element: Element) => {\n const style = window.getComputedStyle(element);\n return (\n style.overflow === \"auto\" ||\n style.overflow === \"scroll\" ||\n style.overflowY === \"auto\" ||\n style.overflowY === \"scroll\" ||\n style.overflowX === \"auto\" ||\n style.overflowX === \"scroll\"\n );\n };\n let scrollableContainer: Element | undefined = this._treeElement.current;\n while (scrollableContainer && !isScrollable(scrollableContainer))\n scrollableContainer =\n scrollableContainer.children.length > 0\n ? scrollableContainer.children[0]\n : undefined;\n\n return scrollableContainer;\n }\n\n public scrollToElement(element: Element) {\n const container = this._scrollableContainer;\n if (!container) return;\n\n if (!Element.prototype.scrollTo) {\n // workaround for Edge scrollTo issue https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/15534521/\n element.scrollIntoView();\n return;\n }\n\n const elementBox = element.getBoundingClientRect();\n const elementRange = Rectangle.createXYXY(\n elementBox.left,\n elementBox.top,\n elementBox.right,\n elementBox.bottom\n );\n const containerBox = container.getBoundingClientRect();\n const containerRange = Rectangle.createXYXY(\n containerBox.left - container.scrollLeft,\n containerBox.top - container.scrollTop,\n containerBox.right - container.scrollLeft,\n containerBox.bottom - container.scrollTop\n );\n\n let left: number;\n if (\n container.scrollLeft > 0 &&\n elementRange.right <= containerRange.right\n ) {\n // always attempt to keep horizontal scroll at 0\n left = 0;\n } else if (\n containerRange.left <= elementRange.left &&\n containerRange.right >= elementRange.right\n ) {\n // already visible - no need to scroll to\n left = container.scrollLeft;\n } else {\n left = elementRange.left - containerRange.left;\n }\n\n let top: number;\n if (\n containerRange.top <= elementRange.top &&\n containerRange.bottom >= elementRange.bottom\n ) {\n // already visible - no need to scroll to\n top = container.scrollTop;\n } else {\n top = elementRange.top - containerRange.top;\n }\n\n container.scrollTo({ left, top });\n }\n\n public getElementsByClassName(className: string): Element[] {\n if (!this._treeElement.current) return [];\n\n const elements = new Array<Element>();\n const collection =\n this._treeElement.current.getElementsByClassName(className);\n for (let i = 0; i < collection.length; ++i)\n elements.push(collection.item(i)!);\n return elements;\n }\n public setFocusByClassName(selector: string): boolean {\n let status = false;\n if (this._treeElement.current) {\n const element = this._treeElement.current.querySelector(\n selector\n ) as HTMLElement;\n if (element && element.focus) {\n element.focus();\n status = true;\n }\n }\n return status;\n }\n\n public override render() {\n const className = classnames(\"core-tree\", this.props.className);\n\n return (\n <div\n ref={this._treeElement}\n className={className}\n style={this.props.style}\n onMouseDown={this.props.onMouseDown}\n onMouseMove={this.props.onMouseMove}\n onMouseUp={this.props.onMouseUp}\n onKeyDown={this.props.onKeyDown}\n onKeyUp={this.props.onKeyUp}\n role=\"tree\"\n tabIndex={-1}\n >\n {this.props.children}\n </div>\n );\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module UiStateStorage
|
|
7
7
|
*/
|
|
8
8
|
import { UiStateStorageStatus } from "./UiStateStorage.js";
|
|
9
|
-
/* eslint-disable
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
10
10
|
/** Implementation of [[UiStateStorage]] using Window.localStorage.
|
|
11
11
|
* @public
|
|
12
12
|
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#LocalStateStorage} instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStateStorage.js","sourceRoot":"","sources":["../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,
|
|
1
|
+
{"version":3,"file":"LocalStateStorage.js","sourceRoot":"","sources":["../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,qDAAqD;AAErD;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAC5B,YAAmB,IAAY,MAAM;QAAlB,MAAC,GAAD,CAAC,CAAiB;IAAG,CAAC;IAElC,KAAK,CAAC,UAAU,CACrB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACzC,GAAG,gBAAgB,IAAI,WAAW,EAAE,CACrC,CAAC;QACF,IAAI,OAAO,KAAK,IAAI;YAClB,OAAO;gBACL,MAAM,EAAE,oBAAoB,CAAC,OAAO;gBACpC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;aAC7B,CAAC;;YACC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC;IACxD,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,gBAAwB,EACxB,WAAmB,EACnB,OAAY;QAEZ,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACzB,GAAG,gBAAgB,IAAI,WAAW,EAAE,EACpC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CACxB,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,UAAU,CACrB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC;QACvE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;CACF","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 UiStateStorage\n */\n\nimport type { UiStateStorage, UiStateStorageResult } from \"./UiStateStorage.js\";\nimport { UiStateStorageStatus } from \"./UiStateStorage.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Implementation of [[UiStateStorage]] using Window.localStorage.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#LocalStateStorage} instead.\n */\nexport class LocalStateStorage implements UiStateStorage {\n constructor(public w: Window = window) {}\n\n public async getSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult> {\n const setting = this.w.localStorage.getItem(\n `${settingNamespace}.${settingName}`\n );\n if (setting !== null)\n return {\n status: UiStateStorageStatus.Success,\n setting: JSON.parse(setting),\n };\n else return { status: UiStateStorageStatus.NotFound };\n }\n\n public async saveSetting(\n settingNamespace: string,\n settingName: string,\n setting: any\n ): Promise<UiStateStorageResult> {\n this.w.localStorage.setItem(\n `${settingNamespace}.${settingName}`,\n JSON.stringify(setting)\n );\n return { status: UiStateStorageStatus.Success };\n }\n\n public async hasSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<boolean> {\n const name = `${settingNamespace}.${settingName}`;\n const setting = this.w.localStorage.getItem(name);\n if (setting === null) return false;\n return true;\n }\n\n public async deleteSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult> {\n const name = `${settingNamespace}.${settingName}`;\n const setting = this.w.localStorage.getItem(name);\n if (setting === null) return { status: UiStateStorageStatus.NotFound };\n this.w.localStorage.removeItem(name);\n return { status: UiStateStorageStatus.Success };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateEntry.d.ts","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKhF;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC;IAShB,gBAAgB,EAAE,MAAM;IACxB,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"UiStateEntry.d.ts","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAKhF;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC;IAShB,gBAAgB,EAAE,MAAM;IACxB,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,GAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI;IAC3B,YAAY,CAAC,EAAE,CAAC;IAZzB;;;;;;OAMG;gBAEM,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,GAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,aAAA,EAC3B,YAAY,CAAC,EAAE,CAAC,YAAA;IAGzB,+CAA+C;IAClC,UAAU,CACrB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAIhC,6EAA6E;IAChE,WAAW,CACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAQhC,8CAA8C;IACjC,aAAa,CACxB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAIhC,iGAAiG;IACpF,uBAAuB,CAClC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;CAcjC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module UiStateStorage
|
|
7
7
|
*/
|
|
8
8
|
import { UiStateStorageStatus } from "./UiStateStorage.js";
|
|
9
|
-
/* eslint-disable
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
10
10
|
/** A single UI State entry that is identified by namespace and setting name.
|
|
11
11
|
* @public
|
|
12
12
|
* @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateEntry.js","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,
|
|
1
|
+
{"version":3,"file":"UiStateEntry.js","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateEntry.ts"],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AC;iBAAM,IAAI,SAAS,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;gBACnC,MAAM,CAAC,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC;YAC/C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;CACF","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 UiStateStorage\n */\n\nimport type { UiStateStorage, UiStateStorageResult } from \"./UiStateStorage.js\";\nimport { UiStateStorageStatus } from \"./UiStateStorage.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** A single UI State entry that is identified by namespace and setting name.\n * @public\n * @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.\n */\nexport class UiStateEntry<T> {\n /** Constructor\n * @param settingNamespace Namespace for the setting, passed to UiStateStorage.\n * @param settingName Name for the setting, passed to UiStateStorage.\n * @param getValue Function for getting the value from the application.\n * @param applyValue Function for applying the setting value to the application.\n * @param defaultValue Optional default value if not already stored.\n */\n public constructor(\n public settingNamespace: string,\n public settingName: string,\n public getValue: () => T,\n public applyValue?: (v: T) => void,\n public defaultValue?: T\n ) {}\n\n /** Gets the setting from [[UiStateStorage]] */\n public async getSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.getSetting(this.settingNamespace, this.settingName);\n }\n\n /** Saves the setting value from the `getValue` function to UiStateStorage */\n public async saveSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.saveSetting(\n this.settingNamespace,\n this.settingName,\n this.getValue()\n );\n }\n\n /** Deletes the setting from UiStateStorage */\n public async deleteSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.deleteSetting(this.settingNamespace, this.settingName);\n }\n\n /** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */\n public async getSettingAndApplyValue(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n if (this.applyValue) {\n const result = await this.getSetting(storage);\n if (result.status === UiStateStorageStatus.Success) {\n this.applyValue(result.setting);\n } else if (undefined !== this.defaultValue) {\n this.applyValue(this.defaultValue);\n result.setting = this.defaultValue;\n result.status = UiStateStorageStatus.Success;\n }\n return result;\n }\n return { status: UiStateStorageStatus.Uninitialized };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateStorage.js","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAwBH;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,qEAAW,CAAA;IACX,uEAAY,CAAA;IACZ,+EAAgB,CAAA;IAChB,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;AACxB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B","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 UiStateStorage\n */\n\n/* eslint-disable
|
|
1
|
+
{"version":3,"file":"UiStateStorage.js","sourceRoot":"","sources":["../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAwBH;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,qEAAW,CAAA;IACX,uEAAY,CAAA;IACZ,+EAAgB,CAAA;IAChB,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;AACxB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B","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 UiStateStorage\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Interface for getting, saving and deleting settings.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorage} instead.\n */\nexport interface UiStateStorage {\n getSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult>;\n saveSetting(\n settingNamespace: string,\n settingName: string,\n setting: any\n ): Promise<UiStateStorageResult>;\n deleteSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult>;\n}\n\n/** Enum for [[UiStateStorage]] status.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageStatus} instead.\n */\nexport enum UiStateStorageStatus {\n Success = 0,\n NotFound = 1,\n UnknownError = 2,\n Uninitialized = 3,\n AuthorizationError = 4,\n}\n\n/** Interface for result of accessing UI state setting in [[UiStateStorage]].\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageResult} instead.\n */\nexport interface UiStateStorageResult {\n status: UiStateStorageStatus;\n setting?: any;\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Utilities
|
|
7
7
|
*/
|
|
8
|
-
/* eslint-disable
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { ConditionalStringValue } from "@itwin/appui-abstract";
|
|
11
11
|
import { Icon } from "../icons/IconComponent.js";
|