@itwin/imodel-components-react 3.1.0-dev.6 → 3.2.0-dev.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 +46 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +1 -0
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +3 -3
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +6 -6
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +0 -6
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +37 -46
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +10 -6
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +1 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/cjs/imodel-components-react.d.ts +0 -1
- package/lib/cjs/imodel-components-react.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react.js +0 -1
- package/lib/cjs/imodel-components-react.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +1 -0
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +4 -4
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +7 -7
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +2 -2
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +0 -6
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +37 -46
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +10 -6
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/esm/imodel-components-react.d.ts +0 -1
- package/lib/esm/imodel-components-react.d.ts.map +1 -1
- package/lib/esm/imodel-components-react.js +0 -1
- package/lib/esm/imodel-components-react.js.map +1 -1
- package/package.json +21 -21
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.d.ts +0 -55
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.d.ts.map +0 -1
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.js +0 -82
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.js.map +0 -1
- package/lib/cjs/imodel-components-react/timeline/ContextMenu.scss +0 -81
- package/lib/esm/imodel-components-react/timeline/ContextMenu.d.ts +0 -55
- package/lib/esm/imodel-components-react/timeline/ContextMenu.d.ts.map +0 -1
- package/lib/esm/imodel-components-react/timeline/ContextMenu.js +0 -55
- package/lib/esm/imodel-components-react/timeline/ContextMenu.js.map +0 -1
- package/lib/esm/imodel-components-react/timeline/ContextMenu.scss +0 -81
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,qEAAqE;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc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cAAc,6CAA6C,CAAC;AAC5D,cAAc,yDAAyD,CAAC;AAExE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,+DAA+D,CAAC;AAE9E,cAAc,sDAAsD,CAAC;AACrE,cAAc,0DAA0D,CAAC;AACzE,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AACpE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,8DAA8D,CAAC;AAE7E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AAEzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAE3E;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\r\n\r\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents\";\r\n\r\nexport * from \"./imodel-components-react/color/AlphaSlider\";\r\nexport * from \"./imodel-components-react/color/ColorPickerButton\";\r\nexport * from \"./imodel-components-react/color/ColorPickerDialog\";\r\nexport * from \"./imodel-components-react/color/ColorPickerPanel\";\r\nexport * from \"./imodel-components-react/color/ColorPickerPopup\";\r\nexport * from \"./imodel-components-react/color/getCSSColorFromDef\";\r\nexport * from \"./imodel-components-react/color/HueSlider\";\r\nexport * from \"./imodel-components-react/color/SaturationPicker\";\r\nexport * from \"./imodel-components-react/color/Swatch\";\r\n\r\nexport * from \"./imodel-components-react/editors/ColorEditor\";\r\nexport * from \"./imodel-components-react/editors/WeightEditor\";\r\n\r\nexport * from \"./imodel-components-react/inputs/QuantityInput\";\r\nexport * from \"./imodel-components-react/inputs/QuantityNumberInput\";\r\n\r\nexport * from \"./imodel-components-react/lineweight/Swatch\";\r\nexport * from \"./imodel-components-react/lineweight/WeightPickerButton\";\r\n\r\nexport * from \"./imodel-components-react/navigationaids/Cube\";\r\nexport * from \"./imodel-components-react/navigationaids/CubeNavigationAid\";\r\nexport * from \"./imodel-components-react/navigationaids/DrawingNavigationAid\";\r\n\r\nexport * from \"./imodel-components-react/quantityformat/FormatPanel\";\r\nexport * from \"./imodel-components-react/quantityformat/FormatPrecision\";\r\nexport * from \"./imodel-components-react/quantityformat/FormatSample\";\r\nexport * from \"./imodel-components-react/quantityformat/FormatType\";\r\nexport * from \"./imodel-components-react/quantityformat/FormatUnitLabel\";\r\nexport * from \"./imodel-components-react/quantityformat/FormatUnits\";\r\nexport * from \"./imodel-components-react/quantityformat/MiscFormatOptions\";\r\nexport * from \"./imodel-components-react/quantityformat/QuantityFormatPanel\";\r\n\r\nexport * from \"./imodel-components-react/timeline/interfaces\";\r\nexport * from \"./imodel-components-react/timeline/BaseTimelineDataProvider\";\r\nexport * from \"./imodel-components-react/timeline/InlineEdit\";\r\nexport * from \"./imodel-components-react/timeline/PlayerButton\";\r\nexport * from \"./imodel-components-react/timeline/Scrubber\";\r\nexport * from \"./imodel-components-react/timeline/TimelineComponent\";\r\nexport * from \"./imodel-components-react/timeline/SolarTimeline\";\r\nexport * from \"./imodel-components-react/timeline/BaseSolarDataProvider\";\r\n\r\nexport * from \"./imodel-components-react/viewport/ViewportComponent\";\r\nexport * from \"./imodel-components-react/viewport/ViewportComponentEvents\";\r\n\r\n/** @docs-package-description\r\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\r\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\r\n * For more information, see [learning about imodel-components-react]($docs/learning/ui/imodel-components/index.md).\r\n */\r\n/**\r\n * @docs-group-description Color\r\n * Classes and components for working with and picking a Color.\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description Cube\r\n * Component for 3D Cube.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Input Components that format and parse input for IModelApps.\r\n */\r\n/**\r\n * @docs-group-description LineWeight\r\n * Classes and components for working with and picking a Line Weight.\r\n */\r\n/**\r\n * @docs-group-description NavigationAids\r\n * Classes and components for working with Navigation Aids.\r\n */\r\n/**\r\n * @docs-group-description PropertyEditors\r\n * Classes and components for working with Property Editors.\r\n */\r\n/**\r\n * @docs-group-description QuantityFormat\r\n * Classes and components for working with a Quantity Formats.\r\n */\r\n/**\r\n * @docs-group-description Timeline\r\n * Classes and components that provide a timeline\r\n */\r\n/**\r\n * @docs-group-description Viewport\r\n * Classes and components for working with a Viewport.\r\n */\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-dev.0",
|
|
4
4
|
"description": "iTwin.js UI IModel Components",
|
|
5
5
|
"main": "lib/cjs/imodel-components-react.js",
|
|
6
6
|
"module": "lib/esm/imodel-components-react.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"url": "http://www.bentley.com"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@itwin/appui-abstract": "^3.
|
|
25
|
-
"@itwin/components-react": "^3.
|
|
26
|
-
"@itwin/core-bentley": "^3.
|
|
27
|
-
"@itwin/core-common": "^3.
|
|
28
|
-
"@itwin/core-frontend": "^3.
|
|
29
|
-
"@itwin/core-geometry": "^3.
|
|
30
|
-
"@itwin/core-quantity": "^3.
|
|
31
|
-
"@itwin/core-react": "^3.
|
|
24
|
+
"@itwin/appui-abstract": "^3.2.0-dev.0",
|
|
25
|
+
"@itwin/components-react": "^3.2.0-dev.0",
|
|
26
|
+
"@itwin/core-bentley": "^3.2.0-dev.0",
|
|
27
|
+
"@itwin/core-common": "^3.2.0-dev.0",
|
|
28
|
+
"@itwin/core-frontend": "^3.2.0-dev.0",
|
|
29
|
+
"@itwin/core-geometry": "^3.2.0-dev.0",
|
|
30
|
+
"@itwin/core-quantity": "^3.2.0-dev.0",
|
|
31
|
+
"@itwin/core-react": "^3.2.0-dev.0",
|
|
32
32
|
"react": "^17.0.0",
|
|
33
33
|
"react-dom": "^17.0.0"
|
|
34
34
|
},
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@itwin/appui-abstract": "3.
|
|
41
|
-
"@itwin/build-tools": "3.
|
|
42
|
-
"@itwin/components-react": "3.
|
|
43
|
-
"@itwin/core-bentley": "3.
|
|
44
|
-
"@itwin/core-common": "3.
|
|
45
|
-
"@itwin/core-frontend": "3.
|
|
46
|
-
"@itwin/core-geometry": "3.
|
|
47
|
-
"@itwin/core-quantity": "3.
|
|
48
|
-
"@itwin/core-react": "3.
|
|
49
|
-
"@itwin/eslint-plugin": "3.
|
|
40
|
+
"@itwin/appui-abstract": "3.2.0-dev.0",
|
|
41
|
+
"@itwin/build-tools": "3.2.0-dev.0",
|
|
42
|
+
"@itwin/components-react": "3.2.0-dev.0",
|
|
43
|
+
"@itwin/core-bentley": "3.2.0-dev.0",
|
|
44
|
+
"@itwin/core-common": "3.2.0-dev.0",
|
|
45
|
+
"@itwin/core-frontend": "3.2.0-dev.0",
|
|
46
|
+
"@itwin/core-geometry": "3.2.0-dev.0",
|
|
47
|
+
"@itwin/core-quantity": "3.2.0-dev.0",
|
|
48
|
+
"@itwin/core-react": "3.2.0-dev.0",
|
|
49
|
+
"@itwin/eslint-plugin": "3.2.0-dev.0",
|
|
50
50
|
"@testing-library/react": "^12.0.0",
|
|
51
51
|
"@testing-library/react-hooks": "^7.0.2",
|
|
52
52
|
"@testing-library/user-event": "^13.2.1",
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
],
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@bentley/icons-generic-webfont": "^1.0.15",
|
|
100
|
-
"@itwin/itwinui-css": "
|
|
101
|
-
"@itwin/itwinui-react": "
|
|
100
|
+
"@itwin/itwinui-css": "0.44.2",
|
|
101
|
+
"@itwin/itwinui-react": "^1.32.0",
|
|
102
102
|
"callable-instance2": "1.0.0",
|
|
103
103
|
"classnames": "^2.3.1",
|
|
104
104
|
"eventemitter2": "^5.0.1",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import "./ContextMenu.scss";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { RelativePosition } from "@itwin/appui-abstract";
|
|
4
|
-
import { CommonProps } from "@itwin/core-react";
|
|
5
|
-
/** Properties for [[ContextMenuItem]] component
|
|
6
|
-
* @internal
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export interface MenuItem {
|
|
10
|
-
/** Name of the context menu item */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** Optional icon */
|
|
13
|
-
icon?: string;
|
|
14
|
-
/** Disabled */
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/** Checked or not */
|
|
17
|
-
checked?: boolean;
|
|
18
|
-
/** Separator */
|
|
19
|
-
isSeparator?: boolean;
|
|
20
|
-
/** Called when the item is clicked */
|
|
21
|
-
onClick?: () => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A context menu item.
|
|
25
|
-
* @internal
|
|
26
|
-
* @deprecated
|
|
27
|
-
*/
|
|
28
|
-
export declare class ContextMenuItem extends React.Component<MenuItem> {
|
|
29
|
-
private _onClick;
|
|
30
|
-
render(): JSX.Element;
|
|
31
|
-
}
|
|
32
|
-
/** Properties for [[ContextMenu]] component
|
|
33
|
-
* @internal
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
export interface ContextMenuProps extends CommonProps {
|
|
37
|
-
/** Show or hide the context menu */
|
|
38
|
-
isOpened: boolean;
|
|
39
|
-
/** Position the context menu relative to the parent */
|
|
40
|
-
position: RelativePosition;
|
|
41
|
-
/** List of context menu items */
|
|
42
|
-
items?: MenuItem[];
|
|
43
|
-
/** Called when the mouse is clicked outside the context menu */
|
|
44
|
-
onClickOutside?: () => void;
|
|
45
|
-
/** parent element */
|
|
46
|
-
parent: HTMLElement | null;
|
|
47
|
-
}
|
|
48
|
-
/** Context menu for timeline component
|
|
49
|
-
* @internal
|
|
50
|
-
* @deprecated
|
|
51
|
-
*/
|
|
52
|
-
export declare class ContextMenu extends React.Component<ContextMenuProps> {
|
|
53
|
-
render(): JSX.Element;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/ContextMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAS,MAAM,mBAAmB,CAAC;AAIvD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;IAE5D,OAAO,CAAC,QAAQ,CAMd;IAGc,MAAM;CAqBvB;AAGD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,iCAAiC;IACjC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,qBAAqB;IACrB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B;AAGD;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAEhD,MAAM;CAgBvB"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ContextMenu = exports.ContextMenuItem = void 0;
|
|
26
|
-
/*---------------------------------------------------------------------------------------------
|
|
27
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
28
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
29
|
-
*--------------------------------------------------------------------------------------------*/
|
|
30
|
-
require("./ContextMenu.scss");
|
|
31
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
32
|
-
const React = __importStar(require("react"));
|
|
33
|
-
const core_react_1 = require("@itwin/core-react");
|
|
34
|
-
/* istanbul ignore next */
|
|
35
|
-
/**
|
|
36
|
-
* A context menu item.
|
|
37
|
-
* @internal
|
|
38
|
-
* @deprecated
|
|
39
|
-
*/
|
|
40
|
-
class ContextMenuItem extends React.Component {
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments);
|
|
43
|
-
this._onClick = (event) => {
|
|
44
|
-
event.stopPropagation();
|
|
45
|
-
// istanbul ignore else
|
|
46
|
-
if (!this.props.disabled && !this.props.isSeparator && this.props.onClick) {
|
|
47
|
-
this.props.onClick();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
// istanbul ignore next - WIP
|
|
52
|
-
render() {
|
|
53
|
-
const menuClassName = (0, classnames_1.default)("contextmenu-item-wip", this.props.disabled && "disabled", this.props.checked && "checked");
|
|
54
|
-
return (React.createElement(React.Fragment, null,
|
|
55
|
-
this.props.isSeparator && React.createElement("div", { className: "separator", role: "separator" }),
|
|
56
|
-
!this.props.isSeparator &&
|
|
57
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
58
|
-
React.createElement("li", { className: menuClassName, onClick: this._onClick, role: "menuitem" },
|
|
59
|
-
this.props.checked && React.createElement("span", { className: "icon icon-checkmark" }),
|
|
60
|
-
(this.props.icon && !this.props.checked) && React.createElement("span", { className: (0, classnames_1.default)("user-icon icon", this.props.icon) }),
|
|
61
|
-
React.createElement("span", null, this.props.name))));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.ContextMenuItem = ContextMenuItem;
|
|
65
|
-
/* istanbul ignore next */
|
|
66
|
-
/** Context menu for timeline component
|
|
67
|
-
* @internal
|
|
68
|
-
* @deprecated
|
|
69
|
-
*/
|
|
70
|
-
class ContextMenu extends React.Component {
|
|
71
|
-
// istanbul ignore next - WIP
|
|
72
|
-
render() {
|
|
73
|
-
const { items, parent, position, isOpened, onClickOutside } = this.props;
|
|
74
|
-
return (React.createElement(core_react_1.Popup, { isOpen: isOpened, target: parent, position: position, onClose: onClickOutside },
|
|
75
|
-
React.createElement("div", { "data-testid": "timeline-contextmenu-div", className: "contextmenu-wip" },
|
|
76
|
-
React.createElement("ul", null,
|
|
77
|
-
items && items.map((item, index) => (React.createElement(ContextMenuItem, { key: index, name: item.name, icon: item.icon, disabled: item.disabled, onClick: item.onClick, isSeparator: item.isSeparator }))),
|
|
78
|
-
this.props.children))));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.ContextMenu = ContextMenu;
|
|
82
|
-
//# sourceMappingURL=ContextMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/ContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8BAA4B;AAC5B,4DAAoC;AACpC,6CAA+B;AAE/B,kDAAuD;AAuBvD,0BAA0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A0B;AAC1B;;;GAGG;AACH,MAAa,WAAY,SAAQ,KAAK,CAAC,SAA2B;IAChE,6BAA6B;IACb,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACzE,OAAO,CACL,oBAAC,kBAAK,IAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;YAClF,4CAAiB,0BAA0B,EAAC,SAAS,EAAC,iBAAiB;gBACrE;oBACG,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAc,EAAE,KAAa,EAAE,EAAE,CAAC,CACrD,oBAAC,eAAe,IAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,GAAI,CACjJ,CAAC;oBAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CACjB,CACD,CACA,CACT,CAAC;IACJ,CAAC;CACF;AAlBD,kCAkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport \"./ContextMenu.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup } from \"@itwin/core-react\";\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/* istanbul ignore next */\r\n/** Properties for [[ContextMenuItem]] component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport interface MenuItem {\r\n /** Name of the context menu item */\r\n name?: string;\r\n /** Optional icon */\r\n icon?: string;\r\n /** Disabled */\r\n disabled?: boolean;\r\n /** Checked or not */\r\n checked?: boolean;\r\n /** Separator */\r\n isSeparator?: boolean;\r\n /** Called when the item is clicked */\r\n onClick?: () => void;\r\n}\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * A context menu item.\r\n * @internal\r\n * @deprecated\r\n */\r\nexport class ContextMenuItem extends React.Component<MenuItem> {\r\n\r\n private _onClick = (event: any) => {\r\n event.stopPropagation();\r\n // istanbul ignore else\r\n if (!this.props.disabled && !this.props.isSeparator && this.props.onClick) {\r\n this.props.onClick();\r\n }\r\n };\r\n\r\n // istanbul ignore next - WIP\r\n public override render() {\r\n const menuClassName = classnames(\r\n \"contextmenu-item-wip\",\r\n this.props.disabled && \"disabled\",\r\n this.props.checked && \"checked\",\r\n );\r\n\r\n return (\r\n <>\r\n {this.props.isSeparator && <div className=\"separator\" role=\"separator\" />}\r\n {!this.props.isSeparator &&\r\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n <li className={menuClassName} onClick={this._onClick} role=\"menuitem\">\r\n {this.props.checked && <span className=\"icon icon-checkmark\" />}\r\n {(this.props.icon && !this.props.checked) && <span className={classnames(\"user-icon icon\", this.props.icon)} />}\r\n <span>{this.props.name}</span>\r\n </li>\r\n }\r\n </>\r\n );\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\n/** Properties for [[ContextMenu]] component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport interface ContextMenuProps extends CommonProps {\r\n /** Show or hide the context menu */\r\n isOpened: boolean;\r\n /** Position the context menu relative to the parent */\r\n position: RelativePosition;\r\n /** List of context menu items */\r\n items?: MenuItem[];\r\n /** Called when the mouse is clicked outside the context menu */\r\n onClickOutside?: () => void;\r\n /** parent element */\r\n parent: HTMLElement | null;\r\n}\r\n\r\n/* istanbul ignore next */\r\n/** Context menu for timeline component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport class ContextMenu extends React.Component<ContextMenuProps> {\r\n // istanbul ignore next - WIP\r\n public override render() {\r\n const { items, parent, position, isOpened, onClickOutside } = this.props;\r\n return (\r\n <Popup isOpen={isOpened} target={parent} position={position} onClose={onClickOutside}>\r\n <div data-testid=\"timeline-contextmenu-div\" className=\"contextmenu-wip\">\r\n <ul>\r\n {items && items.map((item: MenuItem, index: number) => (\r\n <ContextMenuItem key={index} name={item.name} icon={item.icon} disabled={item.disabled} onClick={item.onClick} isSeparator={item.isSeparator} />\r\n ))\r\n }\r\n {this.props.children}\r\n </ul>\r\n </div>\r\n </Popup>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/cjs/core-react/z-index";
|
|
6
|
-
@import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
|
|
7
|
-
|
|
8
|
-
// cspell:ignore contextmenu
|
|
9
|
-
|
|
10
|
-
.contextmenu-wip {
|
|
11
|
-
cursor: default;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
@include uicore-z-index(context-menu-z);
|
|
14
|
-
background: $buic-background-1;
|
|
15
|
-
border-radius: 3px;
|
|
16
|
-
max-width: 250px;
|
|
17
|
-
|
|
18
|
-
>ul {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 6px 0;
|
|
21
|
-
list-style: none;
|
|
22
|
-
|
|
23
|
-
>.separator {
|
|
24
|
-
padding: .5em 0;
|
|
25
|
-
position: relative;
|
|
26
|
-
|
|
27
|
-
&:before {
|
|
28
|
-
content: '';
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 50%;
|
|
31
|
-
left: 32px;
|
|
32
|
-
right: 4px;
|
|
33
|
-
width: auto;
|
|
34
|
-
height: 1px;
|
|
35
|
-
background: #dce0e3;
|
|
36
|
-
transform: translateY(-50%);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.contextmenu-item-wip {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
margin: 0;
|
|
46
|
-
padding: .5em 0;
|
|
47
|
-
color: $buic-foreground-body;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
position: relative;
|
|
50
|
-
user-select: none;
|
|
51
|
-
|
|
52
|
-
>.user-icon,
|
|
53
|
-
>.icon-checkmark {
|
|
54
|
-
position: absolute;
|
|
55
|
-
left: 10px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// text
|
|
59
|
-
>span:last-child {
|
|
60
|
-
padding-left: 32px;
|
|
61
|
-
padding-right: 1em;
|
|
62
|
-
text-overflow: ellipsis;
|
|
63
|
-
white-space: nowrap;
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:hover:not(.disabled) {
|
|
68
|
-
background: $buic-row-hover;
|
|
69
|
-
color: $buic-foreground-activehover;
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&.disabled {
|
|
74
|
-
color: $buic-foreground-disabled;
|
|
75
|
-
cursor: default;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
>.icon-checkmark {
|
|
79
|
-
color: $buic-foreground-primary;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import "./ContextMenu.scss";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { RelativePosition } from "@itwin/appui-abstract";
|
|
4
|
-
import { CommonProps } from "@itwin/core-react";
|
|
5
|
-
/** Properties for [[ContextMenuItem]] component
|
|
6
|
-
* @internal
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
export interface MenuItem {
|
|
10
|
-
/** Name of the context menu item */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** Optional icon */
|
|
13
|
-
icon?: string;
|
|
14
|
-
/** Disabled */
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/** Checked or not */
|
|
17
|
-
checked?: boolean;
|
|
18
|
-
/** Separator */
|
|
19
|
-
isSeparator?: boolean;
|
|
20
|
-
/** Called when the item is clicked */
|
|
21
|
-
onClick?: () => void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A context menu item.
|
|
25
|
-
* @internal
|
|
26
|
-
* @deprecated
|
|
27
|
-
*/
|
|
28
|
-
export declare class ContextMenuItem extends React.Component<MenuItem> {
|
|
29
|
-
private _onClick;
|
|
30
|
-
render(): JSX.Element;
|
|
31
|
-
}
|
|
32
|
-
/** Properties for [[ContextMenu]] component
|
|
33
|
-
* @internal
|
|
34
|
-
* @deprecated
|
|
35
|
-
*/
|
|
36
|
-
export interface ContextMenuProps extends CommonProps {
|
|
37
|
-
/** Show or hide the context menu */
|
|
38
|
-
isOpened: boolean;
|
|
39
|
-
/** Position the context menu relative to the parent */
|
|
40
|
-
position: RelativePosition;
|
|
41
|
-
/** List of context menu items */
|
|
42
|
-
items?: MenuItem[];
|
|
43
|
-
/** Called when the mouse is clicked outside the context menu */
|
|
44
|
-
onClickOutside?: () => void;
|
|
45
|
-
/** parent element */
|
|
46
|
-
parent: HTMLElement | null;
|
|
47
|
-
}
|
|
48
|
-
/** Context menu for timeline component
|
|
49
|
-
* @internal
|
|
50
|
-
* @deprecated
|
|
51
|
-
*/
|
|
52
|
-
export declare class ContextMenu extends React.Component<ContextMenuProps> {
|
|
53
|
-
render(): JSX.Element;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/ContextMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAS,MAAM,mBAAmB,CAAC;AAIvD;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;IAE5D,OAAO,CAAC,QAAQ,CAMd;IAGc,MAAM;CAqBvB;AAGD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,iCAAiC;IACjC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,qBAAqB;IACrB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B;AAGD;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC;IAEhD,MAAM;CAgBvB"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import "./ContextMenu.scss";
|
|
6
|
-
import classnames from "classnames";
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { Popup } from "@itwin/core-react";
|
|
9
|
-
/* istanbul ignore next */
|
|
10
|
-
/**
|
|
11
|
-
* A context menu item.
|
|
12
|
-
* @internal
|
|
13
|
-
* @deprecated
|
|
14
|
-
*/
|
|
15
|
-
export class ContextMenuItem extends React.Component {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this._onClick = (event) => {
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
// istanbul ignore else
|
|
21
|
-
if (!this.props.disabled && !this.props.isSeparator && this.props.onClick) {
|
|
22
|
-
this.props.onClick();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// istanbul ignore next - WIP
|
|
27
|
-
render() {
|
|
28
|
-
const menuClassName = classnames("contextmenu-item-wip", this.props.disabled && "disabled", this.props.checked && "checked");
|
|
29
|
-
return (React.createElement(React.Fragment, null,
|
|
30
|
-
this.props.isSeparator && React.createElement("div", { className: "separator", role: "separator" }),
|
|
31
|
-
!this.props.isSeparator &&
|
|
32
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
33
|
-
React.createElement("li", { className: menuClassName, onClick: this._onClick, role: "menuitem" },
|
|
34
|
-
this.props.checked && React.createElement("span", { className: "icon icon-checkmark" }),
|
|
35
|
-
(this.props.icon && !this.props.checked) && React.createElement("span", { className: classnames("user-icon icon", this.props.icon) }),
|
|
36
|
-
React.createElement("span", null, this.props.name))));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/* istanbul ignore next */
|
|
40
|
-
/** Context menu for timeline component
|
|
41
|
-
* @internal
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
export class ContextMenu extends React.Component {
|
|
45
|
-
// istanbul ignore next - WIP
|
|
46
|
-
render() {
|
|
47
|
-
const { items, parent, position, isOpened, onClickOutside } = this.props;
|
|
48
|
-
return (React.createElement(Popup, { isOpen: isOpened, target: parent, position: position, onClose: onClickOutside },
|
|
49
|
-
React.createElement("div", { "data-testid": "timeline-contextmenu-div", className: "contextmenu-wip" },
|
|
50
|
-
React.createElement("ul", null,
|
|
51
|
-
items && items.map((item, index) => (React.createElement(ContextMenuItem, { key: index, name: item.name, icon: item.icon, disabled: item.disabled, onClick: item.onClick, isSeparator: item.isSeparator }))),
|
|
52
|
-
this.props.children))));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=ContextMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/ContextMenu.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAe,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAuBvD,0BAA0B;AAC1B;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK,CAAC,SAAmB;IAA9D;;QAEU,aAAQ,GAAG,CAAC,KAAU,EAAE,EAAE;YAChC,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,uBAAuB;YACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;gBACzE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;aACtB;QACH,CAAC,CAAC;IAwBJ,CAAC;IAtBC,6BAA6B;IACb,MAAM;QACpB,MAAM,aAAa,GAAG,UAAU,CAC9B,sBAAsB,EACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,UAAU,EACjC,IAAI,CAA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I,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,GAAI,CACjJ,CAAC;oBAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CACjB,CACD,CACA,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport \"./ContextMenu.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup } from \"@itwin/core-react\";\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/* istanbul ignore next */\r\n/** Properties for [[ContextMenuItem]] component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport interface MenuItem {\r\n /** Name of the context menu item */\r\n name?: string;\r\n /** Optional icon */\r\n icon?: string;\r\n /** Disabled */\r\n disabled?: boolean;\r\n /** Checked or not */\r\n checked?: boolean;\r\n /** Separator */\r\n isSeparator?: boolean;\r\n /** Called when the item is clicked */\r\n onClick?: () => void;\r\n}\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * A context menu item.\r\n * @internal\r\n * @deprecated\r\n */\r\nexport class ContextMenuItem extends React.Component<MenuItem> {\r\n\r\n private _onClick = (event: any) => {\r\n event.stopPropagation();\r\n // istanbul ignore else\r\n if (!this.props.disabled && !this.props.isSeparator && this.props.onClick) {\r\n this.props.onClick();\r\n }\r\n };\r\n\r\n // istanbul ignore next - WIP\r\n public override render() {\r\n const menuClassName = classnames(\r\n \"contextmenu-item-wip\",\r\n this.props.disabled && \"disabled\",\r\n this.props.checked && \"checked\",\r\n );\r\n\r\n return (\r\n <>\r\n {this.props.isSeparator && <div className=\"separator\" role=\"separator\" />}\r\n {!this.props.isSeparator &&\r\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n <li className={menuClassName} onClick={this._onClick} role=\"menuitem\">\r\n {this.props.checked && <span className=\"icon icon-checkmark\" />}\r\n {(this.props.icon && !this.props.checked) && <span className={classnames(\"user-icon icon\", this.props.icon)} />}\r\n <span>{this.props.name}</span>\r\n </li>\r\n }\r\n </>\r\n );\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\n/** Properties for [[ContextMenu]] component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport interface ContextMenuProps extends CommonProps {\r\n /** Show or hide the context menu */\r\n isOpened: boolean;\r\n /** Position the context menu relative to the parent */\r\n position: RelativePosition;\r\n /** List of context menu items */\r\n items?: MenuItem[];\r\n /** Called when the mouse is clicked outside the context menu */\r\n onClickOutside?: () => void;\r\n /** parent element */\r\n parent: HTMLElement | null;\r\n}\r\n\r\n/* istanbul ignore next */\r\n/** Context menu for timeline component\r\n * @internal\r\n * @deprecated\r\n */\r\nexport class ContextMenu extends React.Component<ContextMenuProps> {\r\n // istanbul ignore next - WIP\r\n public override render() {\r\n const { items, parent, position, isOpened, onClickOutside } = this.props;\r\n return (\r\n <Popup isOpen={isOpened} target={parent} position={position} onClose={onClickOutside}>\r\n <div data-testid=\"timeline-contextmenu-div\" className=\"contextmenu-wip\">\r\n <ul>\r\n {items && items.map((item: MenuItem, index: number) => (\r\n <ContextMenuItem key={index} name={item.name} icon={item.icon} disabled={item.disabled} onClick={item.onClick} isSeparator={item.isSeparator} />\r\n ))\r\n }\r\n {this.props.children}\r\n </ul>\r\n </div>\r\n </Popup>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/core-react/lib/cjs/core-react/z-index";
|
|
6
|
-
@import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
|
|
7
|
-
|
|
8
|
-
// cspell:ignore contextmenu
|
|
9
|
-
|
|
10
|
-
.contextmenu-wip {
|
|
11
|
-
cursor: default;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
@include uicore-z-index(context-menu-z);
|
|
14
|
-
background: $buic-background-1;
|
|
15
|
-
border-radius: 3px;
|
|
16
|
-
max-width: 250px;
|
|
17
|
-
|
|
18
|
-
>ul {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 6px 0;
|
|
21
|
-
list-style: none;
|
|
22
|
-
|
|
23
|
-
>.separator {
|
|
24
|
-
padding: .5em 0;
|
|
25
|
-
position: relative;
|
|
26
|
-
|
|
27
|
-
&:before {
|
|
28
|
-
content: '';
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 50%;
|
|
31
|
-
left: 32px;
|
|
32
|
-
right: 4px;
|
|
33
|
-
width: auto;
|
|
34
|
-
height: 1px;
|
|
35
|
-
background: #dce0e3;
|
|
36
|
-
transform: translateY(-50%);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.contextmenu-item-wip {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
margin: 0;
|
|
46
|
-
padding: .5em 0;
|
|
47
|
-
color: $buic-foreground-body;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
position: relative;
|
|
50
|
-
user-select: none;
|
|
51
|
-
|
|
52
|
-
>.user-icon,
|
|
53
|
-
>.icon-checkmark {
|
|
54
|
-
position: absolute;
|
|
55
|
-
left: 10px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// text
|
|
59
|
-
>span:last-child {
|
|
60
|
-
padding-left: 32px;
|
|
61
|
-
padding-right: 1em;
|
|
62
|
-
text-overflow: ellipsis;
|
|
63
|
-
white-space: nowrap;
|
|
64
|
-
overflow: hidden;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:hover:not(.disabled) {
|
|
68
|
-
background: $buic-row-hover;
|
|
69
|
-
color: $buic-foreground-activehover;
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&.disabled {
|
|
74
|
-
color: $buic-foreground-disabled;
|
|
75
|
-
cursor: default;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
>.icon-checkmark {
|
|
79
|
-
color: $buic-foreground-primary;
|
|
80
|
-
}
|
|
81
|
-
}
|