@itwin/frontend-devtools 3.0.0-dev.72
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 +723 -0
- package/LICENSE.md +9 -0
- package/README.md +321 -0
- package/lib/ClipboardUtilities.d.ts +9 -0
- package/lib/ClipboardUtilities.d.ts.map +1 -0
- package/lib/ClipboardUtilities.js +27 -0
- package/lib/ClipboardUtilities.js.map +1 -0
- package/lib/FrontEndDevTools.d.ts +19 -0
- package/lib/FrontEndDevTools.d.ts.map +1 -0
- package/lib/FrontEndDevTools.js +203 -0
- package/lib/FrontEndDevTools.js.map +1 -0
- package/lib/effects/Convolution.d.ts +69 -0
- package/lib/effects/Convolution.d.ts.map +1 -0
- package/lib/effects/Convolution.js +166 -0
- package/lib/effects/Convolution.js.map +1 -0
- package/lib/effects/EffectTools.d.ts +34 -0
- package/lib/effects/EffectTools.d.ts.map +1 -0
- package/lib/effects/EffectTools.js +69 -0
- package/lib/effects/EffectTools.js.map +1 -0
- package/lib/effects/Explosion.d.ts +13 -0
- package/lib/effects/Explosion.d.ts.map +1 -0
- package/lib/effects/Explosion.js +168 -0
- package/lib/effects/Explosion.js.map +1 -0
- package/lib/effects/FlipImage.d.ts +31 -0
- package/lib/effects/FlipImage.d.ts.map +1 -0
- package/lib/effects/FlipImage.js +100 -0
- package/lib/effects/FlipImage.js.map +1 -0
- package/lib/effects/LensDistortion.d.ts +35 -0
- package/lib/effects/LensDistortion.d.ts.map +1 -0
- package/lib/effects/LensDistortion.js +110 -0
- package/lib/effects/LensDistortion.js.map +1 -0
- package/lib/effects/Random.d.ts +25 -0
- package/lib/effects/Random.d.ts.map +1 -0
- package/lib/effects/Random.js +50 -0
- package/lib/effects/Random.js.map +1 -0
- package/lib/effects/Saturation.d.ts +31 -0
- package/lib/effects/Saturation.d.ts.map +1 -0
- package/lib/effects/Saturation.js +86 -0
- package/lib/effects/Saturation.js.map +1 -0
- package/lib/effects/Snow.d.ts +77 -0
- package/lib/effects/Snow.d.ts.map +1 -0
- package/lib/effects/Snow.js +187 -0
- package/lib/effects/Snow.js.map +1 -0
- package/lib/effects/Vignette.d.ts +40 -0
- package/lib/effects/Vignette.d.ts.map +1 -0
- package/lib/effects/Vignette.js +109 -0
- package/lib/effects/Vignette.js.map +1 -0
- package/lib/frontend-devtools.d.ts +82 -0
- package/lib/frontend-devtools.d.ts.map +1 -0
- package/lib/frontend-devtools.js +98 -0
- package/lib/frontend-devtools.js.map +1 -0
- package/lib/public/locales/en/FrontendDevTools.json +449 -0
- package/lib/public/sprites/particle_explosion.png +0 -0
- package/lib/public/sprites/particle_flame.png +0 -0
- package/lib/public/sprites/particle_snow.png +0 -0
- package/lib/tools/AnimationIntervalTool.d.ts +16 -0
- package/lib/tools/AnimationIntervalTool.d.ts.map +1 -0
- package/lib/tools/AnimationIntervalTool.js +31 -0
- package/lib/tools/AnimationIntervalTool.js.map +1 -0
- package/lib/tools/ChangeUnitsTool.d.ts +16 -0
- package/lib/tools/ChangeUnitsTool.d.ts.map +1 -0
- package/lib/tools/ChangeUnitsTool.js +42 -0
- package/lib/tools/ChangeUnitsTool.js.map +1 -0
- package/lib/tools/ClipTools.d.ts +68 -0
- package/lib/tools/ClipTools.d.ts.map +1 -0
- package/lib/tools/ClipTools.js +162 -0
- package/lib/tools/ClipTools.js.map +1 -0
- package/lib/tools/DisplayStyleTools.d.ts +99 -0
- package/lib/tools/DisplayStyleTools.d.ts.map +1 -0
- package/lib/tools/DisplayStyleTools.js +242 -0
- package/lib/tools/DisplayStyleTools.js.map +1 -0
- package/lib/tools/EmphasizeElementsTool.d.ts +61 -0
- package/lib/tools/EmphasizeElementsTool.d.ts.map +1 -0
- package/lib/tools/EmphasizeElementsTool.js +155 -0
- package/lib/tools/EmphasizeElementsTool.js.map +1 -0
- package/lib/tools/FrustumDecoration.d.ts +58 -0
- package/lib/tools/FrustumDecoration.d.ts.map +1 -0
- package/lib/tools/FrustumDecoration.js +372 -0
- package/lib/tools/FrustumDecoration.js.map +1 -0
- package/lib/tools/InspectElementTool.d.ts +42 -0
- package/lib/tools/InspectElementTool.d.ts.map +1 -0
- package/lib/tools/InspectElementTool.js +185 -0
- package/lib/tools/InspectElementTool.js.map +1 -0
- package/lib/tools/MapLayerTool.d.ts +248 -0
- package/lib/tools/MapLayerTool.d.ts.map +1 -0
- package/lib/tools/MapLayerTool.js +462 -0
- package/lib/tools/MapLayerTool.js.map +1 -0
- package/lib/tools/MeasureTileLoadTime.d.ts +13 -0
- package/lib/tools/MeasureTileLoadTime.d.ts.map +1 -0
- package/lib/tools/MeasureTileLoadTime.js +61 -0
- package/lib/tools/MeasureTileLoadTime.js.map +1 -0
- package/lib/tools/ModelAppearanceTools.d.ts +87 -0
- package/lib/tools/ModelAppearanceTools.d.ts.map +1 -0
- package/lib/tools/ModelAppearanceTools.js +184 -0
- package/lib/tools/ModelAppearanceTools.js.map +1 -0
- package/lib/tools/PlanProjectionTools.d.ts +41 -0
- package/lib/tools/PlanProjectionTools.d.ts.map +1 -0
- package/lib/tools/PlanProjectionTools.js +150 -0
- package/lib/tools/PlanProjectionTools.js.map +1 -0
- package/lib/tools/PlanarMaskTools.d.ts +182 -0
- package/lib/tools/PlanarMaskTools.d.ts.map +1 -0
- package/lib/tools/PlanarMaskTools.js +366 -0
- package/lib/tools/PlanarMaskTools.js.map +1 -0
- package/lib/tools/ProjectExtents.d.ts +41 -0
- package/lib/tools/ProjectExtents.d.ts.map +1 -0
- package/lib/tools/ProjectExtents.js +108 -0
- package/lib/tools/ProjectExtents.js.map +1 -0
- package/lib/tools/RealityModelTools.d.ts +117 -0
- package/lib/tools/RealityModelTools.d.ts.map +1 -0
- package/lib/tools/RealityModelTools.js +269 -0
- package/lib/tools/RealityModelTools.js.map +1 -0
- package/lib/tools/RealityTransitionTool.d.ts +26 -0
- package/lib/tools/RealityTransitionTool.d.ts.map +1 -0
- package/lib/tools/RealityTransitionTool.js +110 -0
- package/lib/tools/RealityTransitionTool.js.map +1 -0
- package/lib/tools/RenderSystemTools.d.ts +46 -0
- package/lib/tools/RenderSystemTools.d.ts.map +1 -0
- package/lib/tools/RenderSystemTools.js +81 -0
- package/lib/tools/RenderSystemTools.js.map +1 -0
- package/lib/tools/RenderTargetTools.d.ts +101 -0
- package/lib/tools/RenderTargetTools.d.ts.map +1 -0
- package/lib/tools/RenderTargetTools.js +167 -0
- package/lib/tools/RenderTargetTools.js.map +1 -0
- package/lib/tools/ReportWebGLCompatibilityTool.d.ts +12 -0
- package/lib/tools/ReportWebGLCompatibilityTool.d.ts.map +1 -0
- package/lib/tools/ReportWebGLCompatibilityTool.js +31 -0
- package/lib/tools/ReportWebGLCompatibilityTool.js.map +1 -0
- package/lib/tools/SavedViews.d.ts +47 -0
- package/lib/tools/SavedViews.d.ts.map +1 -0
- package/lib/tools/SavedViews.js +137 -0
- package/lib/tools/SavedViews.js.map +1 -0
- package/lib/tools/SelectionTools.d.ts +17 -0
- package/lib/tools/SelectionTools.d.ts.map +1 -0
- package/lib/tools/SelectionTools.js +28 -0
- package/lib/tools/SelectionTools.js.map +1 -0
- package/lib/tools/SetGpuMemoryLimitTool.d.ts +16 -0
- package/lib/tools/SetGpuMemoryLimitTool.d.ts.map +1 -0
- package/lib/tools/SetGpuMemoryLimitTool.js +34 -0
- package/lib/tools/SetGpuMemoryLimitTool.js.map +1 -0
- package/lib/tools/SourceAspectIdTools.d.ts +41 -0
- package/lib/tools/SourceAspectIdTools.d.ts.map +1 -0
- package/lib/tools/SourceAspectIdTools.js +105 -0
- package/lib/tools/SourceAspectIdTools.js.map +1 -0
- package/lib/tools/TileRequestDecoration.d.ts +13 -0
- package/lib/tools/TileRequestDecoration.d.ts.map +1 -0
- package/lib/tools/TileRequestDecoration.js +84 -0
- package/lib/tools/TileRequestDecoration.js.map +1 -0
- package/lib/tools/TileTreeBoundsDecoration.d.ts +12 -0
- package/lib/tools/TileTreeBoundsDecoration.d.ts.map +1 -0
- package/lib/tools/TileTreeBoundsDecoration.js +75 -0
- package/lib/tools/TileTreeBoundsDecoration.js.map +1 -0
- package/lib/tools/ToolTipProvider.d.ts +16 -0
- package/lib/tools/ToolTipProvider.d.ts.map +1 -0
- package/lib/tools/ToolTipProvider.js +67 -0
- package/lib/tools/ToolTipProvider.js.map +1 -0
- package/lib/tools/ViewportTools.d.ts +194 -0
- package/lib/tools/ViewportTools.d.ts.map +1 -0
- package/lib/tools/ViewportTools.js +451 -0
- package/lib/tools/ViewportTools.js.map +1 -0
- package/lib/tools/parseArgs.d.ts +24 -0
- package/lib/tools/parseArgs.d.ts.map +1 -0
- package/lib/tools/parseArgs.js +52 -0
- package/lib/tools/parseArgs.js.map +1 -0
- package/lib/tools/parseBoolean.d.ts +9 -0
- package/lib/tools/parseBoolean.d.ts.map +1 -0
- package/lib/tools/parseBoolean.js +27 -0
- package/lib/tools/parseBoolean.js.map +1 -0
- package/lib/tools/parseToggle.d.ts +9 -0
- package/lib/tools/parseToggle.d.ts.map +1 -0
- package/lib/tools/parseToggle.js +26 -0
- package/lib/tools/parseToggle.js.map +1 -0
- package/lib/ui/Button.d.ts +30 -0
- package/lib/ui/Button.d.ts.map +1 -0
- package/lib/ui/Button.js +27 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/CheckBox.d.ts +24 -0
- package/lib/ui/CheckBox.d.ts.map +1 -0
- package/lib/ui/CheckBox.js +28 -0
- package/lib/ui/CheckBox.js.map +1 -0
- package/lib/ui/ColorInput.d.ts +28 -0
- package/lib/ui/ColorInput.d.ts.map +1 -0
- package/lib/ui/ColorInput.js +54 -0
- package/lib/ui/ColorInput.js.map +1 -0
- package/lib/ui/ComboBox.d.ts +29 -0
- package/lib/ui/ComboBox.d.ts.map +1 -0
- package/lib/ui/ComboBox.js +43 -0
- package/lib/ui/ComboBox.js.map +1 -0
- package/lib/ui/DataList.d.ts +28 -0
- package/lib/ui/DataList.d.ts.map +1 -0
- package/lib/ui/DataList.js +40 -0
- package/lib/ui/DataList.js.map +1 -0
- package/lib/ui/NestedMenu.d.ts +20 -0
- package/lib/ui/NestedMenu.d.ts.map +1 -0
- package/lib/ui/NestedMenu.js +47 -0
- package/lib/ui/NestedMenu.js.map +1 -0
- package/lib/ui/NumericInput.d.ts +35 -0
- package/lib/ui/NumericInput.d.ts.map +1 -0
- package/lib/ui/NumericInput.js +60 -0
- package/lib/ui/NumericInput.js.map +1 -0
- package/lib/ui/RadioBox.d.ts +29 -0
- package/lib/ui/RadioBox.d.ts.map +1 -0
- package/lib/ui/RadioBox.js +77 -0
- package/lib/ui/RadioBox.js.map +1 -0
- package/lib/ui/Slider.d.ts +25 -0
- package/lib/ui/Slider.d.ts.map +1 -0
- package/lib/ui/Slider.js +33 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/TextBox.d.ts +33 -0
- package/lib/ui/TextBox.d.ts.map +1 -0
- package/lib/ui/TextBox.js +57 -0
- package/lib/ui/TextBox.js.map +1 -0
- package/lib/widgets/DiagnosticsPanel.d.ts +36 -0
- package/lib/widgets/DiagnosticsPanel.d.ts.map +1 -0
- package/lib/widgets/DiagnosticsPanel.js +76 -0
- package/lib/widgets/DiagnosticsPanel.js.map +1 -0
- package/lib/widgets/FpsTracker.d.ts +20 -0
- package/lib/widgets/FpsTracker.d.ts.map +1 -0
- package/lib/widgets/FpsTracker.js +57 -0
- package/lib/widgets/FpsTracker.js.map +1 -0
- package/lib/widgets/GpuProfiler.d.ts +17 -0
- package/lib/widgets/GpuProfiler.d.ts.map +1 -0
- package/lib/widgets/GpuProfiler.js +193 -0
- package/lib/widgets/GpuProfiler.js.map +1 -0
- package/lib/widgets/KeyinField.d.ts +62 -0
- package/lib/widgets/KeyinField.d.ts.map +1 -0
- package/lib/widgets/KeyinField.js +188 -0
- package/lib/widgets/KeyinField.js.map +1 -0
- package/lib/widgets/MemoryTracker.d.ts +28 -0
- package/lib/widgets/MemoryTracker.d.ts.map +1 -0
- package/lib/widgets/MemoryTracker.js +244 -0
- package/lib/widgets/MemoryTracker.js.map +1 -0
- package/lib/widgets/TileMemoryBreakdown.d.ts +31 -0
- package/lib/widgets/TileMemoryBreakdown.d.ts.map +1 -0
- package/lib/widgets/TileMemoryBreakdown.js +205 -0
- package/lib/widgets/TileMemoryBreakdown.js.map +1 -0
- package/lib/widgets/TileStatisticsTracker.d.ts +22 -0
- package/lib/widgets/TileStatisticsTracker.d.ts.map +1 -0
- package/lib/widgets/TileStatisticsTracker.js +143 -0
- package/lib/widgets/TileStatisticsTracker.js.map +1 -0
- package/lib/widgets/ToolSettingsTracker.d.ts +10 -0
- package/lib/widgets/ToolSettingsTracker.d.ts.map +1 -0
- package/lib/widgets/ToolSettingsTracker.js +182 -0
- package/lib/widgets/ToolSettingsTracker.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseBoolean.js","sourceRoot":"","sources":["../../src/tools/parseBoolean.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAuB;IAClD,IAAI,SAAS,KAAK,GAAG;QACnB,OAAO,SAAS,CAAC;IAEnB,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE;QACzB,KAAK,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC;QACvB,KAAK,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC;QACzB,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;QACzB,KAAK,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;KAC3B;AACH,CAAC;AAXD,oCAWC","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/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Parses a string case-insensitively returning true for \"ON\" or \"TRUE\", false for \"OFF\" or \"FALSE\" and undefined otherwise.\r\n * Used by various tools which take such arguments.\r\n * @beta\r\n */\r\nexport function parseBoolean(arg: string | undefined): boolean | undefined {\r\n if (undefined === arg)\r\n return undefined;\r\n\r\n switch (arg.toLowerCase()) {\r\n case \"on\": return true;\r\n case \"true\": return true;\r\n case \"off\": return false;\r\n case \"false\": return false;\r\n default: return undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/** Parses a string case-insensitively returning true for "ON", false for "OFF" undefined for "TOGGLE" or undefined, and the input string for anything else
|
|
5
|
+
* Used by various tools which take such arguments.
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseToggle(arg: string | undefined): string | boolean | undefined;
|
|
9
|
+
//# sourceMappingURL=parseToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseToggle.d.ts","sourceRoot":"","sources":["../../src/tools/parseToggle.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAUjF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.parseToggle = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Utilities
|
|
10
|
+
*/
|
|
11
|
+
/** Parses a string case-insensitively returning true for "ON", false for "OFF" undefined for "TOGGLE" or undefined, and the input string for anything else
|
|
12
|
+
* Used by various tools which take such arguments.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
function parseToggle(arg) {
|
|
16
|
+
if (undefined === arg)
|
|
17
|
+
return undefined;
|
|
18
|
+
switch (arg.toLowerCase()) {
|
|
19
|
+
case "on": return true;
|
|
20
|
+
case "off": return false;
|
|
21
|
+
case "toggle": return undefined;
|
|
22
|
+
default: return arg;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.parseToggle = parseToggle;
|
|
26
|
+
//# sourceMappingURL=parseToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseToggle.js","sourceRoot":"","sources":["../../src/tools/parseToggle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;GAGG;AACH,SAAgB,WAAW,CAAC,GAAuB;IACjD,IAAI,SAAS,KAAK,GAAG;QACnB,OAAO,SAAS,CAAC;IAEnB,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE;QACzB,KAAK,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC;QACvB,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;QACzB,KAAK,QAAQ,CAAC,CAAC,OAAO,SAAS,CAAC;QAChC,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC;KACrB;AACH,CAAC;AAVD,kCAUC","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/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Parses a string case-insensitively returning true for \"ON\", false for \"OFF\" undefined for \"TOGGLE\" or undefined, and the input string for anything else\r\n * Used by various tools which take such arguments.\r\n * @beta\r\n */\r\nexport function parseToggle(arg: string | undefined): string | boolean | undefined {\r\n if (undefined === arg)\r\n return undefined;\r\n\r\n switch (arg.toLowerCase()) {\r\n case \"on\": return true;\r\n case \"off\": return false;\r\n case \"toggle\": return undefined;\r\n default: return arg;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
/** Wraps an HTML button
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export interface Button {
|
|
8
|
+
button: HTMLInputElement;
|
|
9
|
+
div: HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
/** Callback invoked by Button when clicked.
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export declare type ButtonHandler = (button: HTMLInputElement) => void;
|
|
15
|
+
/** Describes how to create a Button.
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export interface ButtonProps {
|
|
19
|
+
handler: ButtonHandler;
|
|
20
|
+
id?: string;
|
|
21
|
+
parent?: HTMLElement;
|
|
22
|
+
value: string;
|
|
23
|
+
inline?: boolean;
|
|
24
|
+
tooltip?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Creates a Button as specified by the ButtonProps.
|
|
27
|
+
* @alpha
|
|
28
|
+
*/
|
|
29
|
+
export declare function createButton(props: ButtonProps): Button;
|
|
30
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/ui/Button.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,oBAAY,aAAa,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAcvD"}
|
package/lib/ui/Button.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createButton = void 0;
|
|
8
|
+
/** Creates a Button as specified by the ButtonProps.
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
11
|
+
function createButton(props) {
|
|
12
|
+
const div = document.createElement(props.inline ? "span" : "div");
|
|
13
|
+
const button = document.createElement("input");
|
|
14
|
+
button.type = "button";
|
|
15
|
+
button.value = props.value;
|
|
16
|
+
button.addEventListener("click", () => props.handler(button));
|
|
17
|
+
div.appendChild(button);
|
|
18
|
+
if (undefined !== props.id)
|
|
19
|
+
button.id = props.id;
|
|
20
|
+
if (undefined !== props.tooltip)
|
|
21
|
+
div.title = props.tooltip;
|
|
22
|
+
if (undefined !== props.parent)
|
|
23
|
+
props.parent.appendChild(div);
|
|
24
|
+
return { button, div };
|
|
25
|
+
}
|
|
26
|
+
exports.createButton = createButton;
|
|
27
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/ui/Button.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AA+B/F;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAkB;IAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAElE,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC3B,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAExB,IAAI,SAAS,KAAK,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACjD,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAAE,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAC3D,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAE9D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AACzB,CAAC;AAdD,oCAcC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Controls\n */\n\n/** Wraps an HTML button\n * @alpha\n */\nexport interface Button {\n button: HTMLInputElement;\n div: HTMLElement;\n}\n\n/** Callback invoked by Button when clicked.\n * @alpha\n */\nexport type ButtonHandler = (button: HTMLInputElement) => void;\n\n/** Describes how to create a Button.\n * @alpha\n */\nexport interface ButtonProps {\n handler: ButtonHandler;\n id?: string;\n parent?: HTMLElement;\n value: string;\n inline?: boolean;\n tooltip?: string;\n}\n\n/** Creates a Button as specified by the ButtonProps.\n * @alpha\n */\nexport function createButton(props: ButtonProps): Button {\n const div = document.createElement(props.inline ? \"span\" : \"div\");\n\n const button = document.createElement(\"input\");\n button.type = \"button\";\n button.value = props.value;\n button.addEventListener(\"click\", () => props.handler(button));\n div.appendChild(button);\n\n if (undefined !== props.id) button.id = props.id;\n if (undefined !== props.tooltip) div.title = props.tooltip;\n if (undefined !== props.parent) props.parent.appendChild(div);\n\n return { button, div };\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export interface CheckBox {
|
|
6
|
+
label: HTMLLabelElement;
|
|
7
|
+
checkbox: HTMLInputElement;
|
|
8
|
+
div: HTMLDivElement;
|
|
9
|
+
}
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export declare type CheckBoxHandler = (checkbox: HTMLInputElement) => void;
|
|
12
|
+
/** @alpha */
|
|
13
|
+
export interface CheckBoxProps {
|
|
14
|
+
name: string;
|
|
15
|
+
handler: CheckBoxHandler;
|
|
16
|
+
id: string;
|
|
17
|
+
parent?: HTMLElement;
|
|
18
|
+
isChecked?: boolean;
|
|
19
|
+
typeOverride?: string;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
}
|
|
22
|
+
/** @alpha */
|
|
23
|
+
export declare function createCheckBox(props: CheckBoxProps): CheckBox;
|
|
24
|
+
//# sourceMappingURL=CheckBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckBox.d.ts","sourceRoot":"","sources":["../../src/ui/CheckBox.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,aAAa;AACb,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;CACrB;AAED,aAAa;AACb,oBAAY,eAAe,GAAG,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEnE,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,aAAa;AACb,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAsB7D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createCheckBox = void 0;
|
|
8
|
+
/** @alpha */
|
|
9
|
+
function createCheckBox(props) {
|
|
10
|
+
const div = document.createElement("div");
|
|
11
|
+
const checkbox = document.createElement("input");
|
|
12
|
+
checkbox.type = props.typeOverride ? props.typeOverride : "checkbox";
|
|
13
|
+
checkbox.id = props.id;
|
|
14
|
+
checkbox.checked = !!props.isChecked;
|
|
15
|
+
checkbox.addEventListener("click", () => props.handler(checkbox));
|
|
16
|
+
div.appendChild(checkbox);
|
|
17
|
+
const label = document.createElement("label");
|
|
18
|
+
label.htmlFor = props.id;
|
|
19
|
+
label.innerText = props.name;
|
|
20
|
+
div.appendChild(label);
|
|
21
|
+
if (undefined !== props.parent)
|
|
22
|
+
props.parent.appendChild(div);
|
|
23
|
+
if (undefined !== props.tooltip)
|
|
24
|
+
div.title = props.tooltip;
|
|
25
|
+
return { label, checkbox, div };
|
|
26
|
+
}
|
|
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EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AAClC,CAAC;AAtBD,wCAsBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Controls\n */\n\n/** @alpha */\nexport interface CheckBox {\n label: HTMLLabelElement;\n checkbox: HTMLInputElement;\n div: HTMLDivElement;\n}\n\n/** @alpha */\nexport type CheckBoxHandler = (checkbox: HTMLInputElement) => void;\n\n/** @alpha */\nexport interface CheckBoxProps {\n name: string;\n handler: CheckBoxHandler;\n id: string;\n parent?: HTMLElement;\n isChecked?: boolean;\n typeOverride?: string;\n tooltip?: string;\n}\n\n/** @alpha */\nexport function createCheckBox(props: CheckBoxProps): CheckBox {\n const div = document.createElement(\"div\");\n\n const checkbox = document.createElement(\"input\");\n checkbox.type = props.typeOverride ? props.typeOverride : \"checkbox\";\n checkbox.id = props.id;\n checkbox.checked = !!props.isChecked;\n checkbox.addEventListener(\"click\", () => props.handler(checkbox));\n div.appendChild(checkbox);\n\n const label = document.createElement(\"label\");\n label.htmlFor = props.id;\n label.innerText = props.name;\n div.appendChild(label);\n\n if (undefined !== props.parent)\n props.parent.appendChild(div);\n\n if (undefined !== props.tooltip)\n div.title = props.tooltip;\n\n return { label, checkbox, div };\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
import { RgbColor } from "@itwin/core-common";
|
|
5
|
+
/** @alpha */
|
|
6
|
+
export declare type ColorInputHandler = (value: string) => void;
|
|
7
|
+
/** @alpha */
|
|
8
|
+
export interface ColorInputProps {
|
|
9
|
+
handler: ColorInputHandler;
|
|
10
|
+
value: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
parent?: HTMLElement;
|
|
14
|
+
display?: "inline" | "none" | "block";
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
}
|
|
18
|
+
/** @alpha */
|
|
19
|
+
export interface ColorInput {
|
|
20
|
+
div: HTMLDivElement;
|
|
21
|
+
input: HTMLInputElement;
|
|
22
|
+
label?: HTMLLabelElement;
|
|
23
|
+
}
|
|
24
|
+
/** @alpha */
|
|
25
|
+
export declare function convertHexToRgb(hex: string): RgbColor | undefined;
|
|
26
|
+
/** @alpha */
|
|
27
|
+
export declare function createColorInput(props: ColorInputProps): ColorInput;
|
|
28
|
+
//# sourceMappingURL=ColorInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorInput.d.ts","sourceRoot":"","sources":["../../src/ui/ColorInput.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,aAAa;AACb,oBAAY,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAExD,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,aAAa;AACb,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED,aAAa;AACb,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQjE;AAED,aAAa;AACb,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,CAgCnE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Controls
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createColorInput = exports.convertHexToRgb = void 0;
|
|
11
|
+
const core_common_1 = require("@itwin/core-common");
|
|
12
|
+
/** @alpha */
|
|
13
|
+
function convertHexToRgb(hex) {
|
|
14
|
+
// Parse a hex color string formatted as "#FFFFFF"
|
|
15
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
16
|
+
return result ? new core_common_1.RgbColor(parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)) : undefined;
|
|
17
|
+
}
|
|
18
|
+
exports.convertHexToRgb = convertHexToRgb;
|
|
19
|
+
/** @alpha */
|
|
20
|
+
function createColorInput(props) {
|
|
21
|
+
const inputDiv = document.createElement("div");
|
|
22
|
+
const colorInput = document.createElement("input");
|
|
23
|
+
colorInput.type = "color";
|
|
24
|
+
colorInput.value = props.value;
|
|
25
|
+
colorInput.onchange = () => {
|
|
26
|
+
try {
|
|
27
|
+
const value = colorInput.value;
|
|
28
|
+
props.handler(value);
|
|
29
|
+
}
|
|
30
|
+
catch (_ex) {
|
|
31
|
+
//
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
let colorLabel;
|
|
35
|
+
if (undefined !== props.label) {
|
|
36
|
+
colorLabel = document.createElement("label");
|
|
37
|
+
colorLabel.innerText = `${props.label} `;
|
|
38
|
+
inputDiv.appendChild(colorLabel);
|
|
39
|
+
}
|
|
40
|
+
inputDiv.appendChild(colorInput);
|
|
41
|
+
if (undefined !== props.display)
|
|
42
|
+
inputDiv.style.display = props.display;
|
|
43
|
+
if (undefined !== props.id)
|
|
44
|
+
colorInput.id = props.id;
|
|
45
|
+
if (undefined !== props.tooltip)
|
|
46
|
+
colorInput.title = props.tooltip;
|
|
47
|
+
if (undefined !== props.disabled)
|
|
48
|
+
colorInput.disabled = props.disabled;
|
|
49
|
+
if (undefined !== props.parent)
|
|
50
|
+
props.parent.appendChild(inputDiv);
|
|
51
|
+
return undefined !== colorLabel ? { div: inputDiv, input: colorInput, label: colorLabel } : { div: inputDiv, input: colorInput };
|
|
52
|
+
}
|
|
53
|
+
exports.createColorInput = createColorInput;
|
|
54
|
+
//# sourceMappingURL=ColorInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorInput.js","sourceRoot":"","sources":["../../src/ui/ColorInput.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA8C;AAwB9C,aAAa;AACb,SAAgB,eAAe,CAAC,GAAW;IACzC,kDAAkD;IAClD,MAAM,MAAM,GAAG,2CAA2C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,sBAAQ,CAC1B,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EACvB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EACvB,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACxB,CAAC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AARD,0CAQC;AAED,aAAa;AACb,SAAgB,gBAAgB,CAAC,KAAsB;IAErD,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE/C,MAAM,UAAU,GAAG,QAAQ,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AAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrI,CAAC;AAhCD,4CAgCC","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 Controls\n */\n\nimport { RgbColor } from \"@itwin/core-common\";\n\n/** @alpha */\nexport type ColorInputHandler = (value: string) => void;\n\n/** @alpha */\nexport interface ColorInputProps {\n handler: ColorInputHandler;\n value: string;\n id?: string;\n label?: string;\n parent?: HTMLElement;\n display?: \"inline\" | \"none\" | \"block\";\n disabled?: boolean;\n tooltip?: string;\n}\n\n/** @alpha */\nexport interface ColorInput {\n div: HTMLDivElement;\n input: HTMLInputElement;\n label?: HTMLLabelElement;\n}\n\n/** @alpha */\nexport function convertHexToRgb(hex: string): RgbColor | undefined {\n // Parse a hex color string formatted as \"#FFFFFF\"\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? new RgbColor(\n parseInt(result[1], 16),\n parseInt(result[2], 16),\n parseInt(result[3], 16),\n ) : undefined;\n}\n\n/** @alpha */\nexport function createColorInput(props: ColorInputProps): ColorInput {\n\n const inputDiv = document.createElement(\"div\");\n\n const colorInput = document.createElement(\"input\");\n colorInput.type = \"color\";\n colorInput.value = props.value;\n\n colorInput.onchange = () => {\n try {\n const value = colorInput.value;\n props.handler(value);\n } catch (_ex) {\n //\n }\n };\n let colorLabel: HTMLLabelElement;\n\n if (undefined !== props.label) {\n colorLabel = document.createElement(\"label\");\n colorLabel.innerText = `${props.label} `;\n inputDiv.appendChild(colorLabel);\n }\n inputDiv.appendChild(colorInput);\n\n if (undefined !== props.display) inputDiv.style.display = props.display;\n if (undefined !== props.id) colorInput.id = props.id;\n if (undefined !== props.tooltip) colorInput.title = props.tooltip;\n if (undefined !== props.disabled) colorInput.disabled = props.disabled;\n if (undefined !== props.parent) props.parent.appendChild(inputDiv);\n\n return undefined !== colorLabel! ? { div: inputDiv, input: colorInput, label: colorLabel! } : { div: inputDiv, input: colorInput };\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export interface ComboBoxEntry {
|
|
6
|
+
name: string;
|
|
7
|
+
value: number | string | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** @alpha */
|
|
10
|
+
export declare type ComboBoxHandler = (select: HTMLSelectElement) => void;
|
|
11
|
+
/** @alpha */
|
|
12
|
+
export interface ComboBoxProps {
|
|
13
|
+
name?: string;
|
|
14
|
+
id: string;
|
|
15
|
+
entries: ComboBoxEntry[];
|
|
16
|
+
parent?: HTMLElement;
|
|
17
|
+
handler?: ComboBoxHandler;
|
|
18
|
+
value?: number | string;
|
|
19
|
+
tooltip?: string;
|
|
20
|
+
}
|
|
21
|
+
/** @alpha */
|
|
22
|
+
export interface ComboBox {
|
|
23
|
+
label?: HTMLLabelElement;
|
|
24
|
+
select: HTMLSelectElement;
|
|
25
|
+
div: HTMLDivElement;
|
|
26
|
+
}
|
|
27
|
+
/** @alpha */
|
|
28
|
+
export declare function createComboBox(props: ComboBoxProps): ComboBox;
|
|
29
|
+
//# sourceMappingURL=ComboBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../src/ui/ComboBox.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,aAAa;AACb,oBAAY,eAAe,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAElE,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,aAAa;AACb,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,cAAc,CAAC;CACrB;AAUD,aAAa;AACb,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAiC7D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createComboBox = void 0;
|
|
8
|
+
function _appendComboBoxEntry(select, entry) {
|
|
9
|
+
const option = document.createElement("option");
|
|
10
|
+
option.innerText = entry.name;
|
|
11
|
+
if (undefined !== entry.value)
|
|
12
|
+
option.value = entry.value.toString();
|
|
13
|
+
select.appendChild(option);
|
|
14
|
+
}
|
|
15
|
+
/** @alpha */
|
|
16
|
+
function createComboBox(props) {
|
|
17
|
+
const div = document.createElement("div");
|
|
18
|
+
let label;
|
|
19
|
+
if (undefined !== props.name) {
|
|
20
|
+
label = document.createElement("label");
|
|
21
|
+
label.htmlFor = props.id;
|
|
22
|
+
label.innerText = props.name;
|
|
23
|
+
div.appendChild(label);
|
|
24
|
+
}
|
|
25
|
+
const select = document.createElement("select");
|
|
26
|
+
select.id = props.id;
|
|
27
|
+
for (const entry of props.entries) {
|
|
28
|
+
_appendComboBoxEntry(select, entry);
|
|
29
|
+
}
|
|
30
|
+
if (undefined !== props.value)
|
|
31
|
+
select.value = props.value.toString();
|
|
32
|
+
const handler = props.handler;
|
|
33
|
+
if (undefined !== handler)
|
|
34
|
+
select.onchange = () => handler(select);
|
|
35
|
+
if (undefined !== props.tooltip)
|
|
36
|
+
div.title = props.tooltip;
|
|
37
|
+
div.appendChild(select);
|
|
38
|
+
if (undefined !== props.parent)
|
|
39
|
+
props.parent.appendChild(div);
|
|
40
|
+
return { div, label, select };
|
|
41
|
+
}
|
|
42
|
+
exports.createComboBox = createComboBox;
|
|
43
|
+
//# sourceMappingURL=ComboBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComboBox.js","sourceRoot":"","sources":["../../src/ui/ComboBox.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAiC/F,SAAS,oBAAoB,CAAC,MAAyB,EAAE,KAAoB;IAC3E,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;IAC9B,IAAI,SAAS,KAAK,KAAK,CAAC,KAAK;QAC3B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACxC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,aAAa;AACb,SAAgB,cAAc,CAAC,KAAoB;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,KAAmC,CAAC;IACxC,IAAI,SAAS,KAAK,KAAK,CAAC,IAAI,EAAE;QAC5B,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;QAC7B,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACxB;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IAErB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE;QACjC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,IAAI,SAAS,KAAK,KAAK,CAAC,KAAK;QAC3B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAExC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAI,SAAS,KAAK,OAAO;QACvB,MAAM,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAE5B,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACxB,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;QAC5B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEhC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAChC,CAAC;AAjCD,wCAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Controls\n */\n\n/** @alpha */\nexport interface ComboBoxEntry {\n name: string;\n value: number | string | undefined;\n}\n\n/** @alpha */\nexport type ComboBoxHandler = (select: HTMLSelectElement) => void;\n\n/** @alpha */\nexport interface ComboBoxProps {\n name?: string;\n id: string;\n entries: ComboBoxEntry[];\n parent?: HTMLElement;\n handler?: ComboBoxHandler;\n value?: number | string;\n tooltip?: string;\n}\n\n/** @alpha */\nexport interface ComboBox {\n label?: HTMLLabelElement;\n select: HTMLSelectElement;\n div: HTMLDivElement;\n}\n\nfunction _appendComboBoxEntry(select: HTMLSelectElement, entry: ComboBoxEntry) {\n const option = document.createElement(\"option\");\n option.innerText = entry.name;\n if (undefined !== entry.value)\n option.value = entry.value.toString();\n select.appendChild(option);\n}\n\n/** @alpha */\nexport function createComboBox(props: ComboBoxProps): ComboBox {\n const div = document.createElement(\"div\");\n\n let label: HTMLLabelElement | undefined;\n if (undefined !== props.name) {\n label = document.createElement(\"label\");\n label.htmlFor = props.id;\n label.innerText = props.name;\n div.appendChild(label);\n }\n\n const select = document.createElement(\"select\");\n select.id = props.id;\n\n for (const entry of props.entries) {\n _appendComboBoxEntry(select, entry);\n }\n\n if (undefined !== props.value)\n select.value = props.value.toString();\n\n const handler = props.handler;\n if (undefined !== handler)\n select.onchange = () => handler(select);\n\n if (undefined !== props.tooltip)\n div.title = props.tooltip;\n\n div.appendChild(select);\n if (undefined !== props.parent)\n props.parent.appendChild(div);\n\n return { div, label, select };\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export interface DataListEntry {
|
|
6
|
+
value: number | string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** @alpha */
|
|
9
|
+
export declare type DataListHandler = (list: HTMLDataListElement) => void;
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export interface DataListProps {
|
|
12
|
+
name?: string;
|
|
13
|
+
id: string;
|
|
14
|
+
entries: DataListEntry[];
|
|
15
|
+
parent?: HTMLElement;
|
|
16
|
+
handler?: DataListHandler;
|
|
17
|
+
inline?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** @alpha */
|
|
20
|
+
export interface DataList {
|
|
21
|
+
list: HTMLDataListElement;
|
|
22
|
+
div: HTMLDivElement;
|
|
23
|
+
}
|
|
24
|
+
/** @alpha */
|
|
25
|
+
export declare function appendDataListEntries(dl: DataList, entries: DataListEntry[]): void;
|
|
26
|
+
/** @alpha */
|
|
27
|
+
export declare function createDataList(props: DataListProps): DataList;
|
|
28
|
+
//# sourceMappingURL=DataList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataList.d.ts","sourceRoot":"","sources":["../../src/ui/DataList.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,aAAa;AACb,oBAAY,eAAe,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAElE,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,aAAa;AACb,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,GAAG,EAAE,cAAc,CAAC;CACrB;AASD,aAAa;AACb,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,QAI3E;AAED,aAAa;AACb,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,CAqB7D"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createDataList = exports.appendDataListEntries = void 0;
|
|
8
|
+
function _appendDataListEntry(list, entry) {
|
|
9
|
+
const option = document.createElement("option");
|
|
10
|
+
if (undefined !== entry.value)
|
|
11
|
+
option.value = entry.value.toString();
|
|
12
|
+
list.appendChild(option);
|
|
13
|
+
}
|
|
14
|
+
/** @alpha */
|
|
15
|
+
function appendDataListEntries(dl, entries) {
|
|
16
|
+
for (const entry of entries) {
|
|
17
|
+
_appendDataListEntry(dl.list, entry);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.appendDataListEntries = appendDataListEntries;
|
|
21
|
+
/** @alpha */
|
|
22
|
+
function createDataList(props) {
|
|
23
|
+
const list = document.createElement("datalist");
|
|
24
|
+
list.id = props.id;
|
|
25
|
+
for (const entry of props.entries) {
|
|
26
|
+
_appendDataListEntry(list, entry);
|
|
27
|
+
}
|
|
28
|
+
const handler = props.handler;
|
|
29
|
+
if (undefined !== handler)
|
|
30
|
+
list.onselect = () => handler(list);
|
|
31
|
+
const div = document.createElement("div");
|
|
32
|
+
if (props.inline)
|
|
33
|
+
div.style.display = "inline";
|
|
34
|
+
div.appendChild(list);
|
|
35
|
+
if (undefined !== props.parent)
|
|
36
|
+
props.parent.appendChild(div);
|
|
37
|
+
return { div, list };
|
|
38
|
+
}
|
|
39
|
+
exports.createDataList = createDataList;
|
|
40
|
+
//# sourceMappingURL=DataList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataList.js","sourceRoot":"","sources":["../../src/ui/DataList.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AA8B/F,SAAS,oBAAoB,CAAC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E,IAAI,EAAE,CAAC;AACvB,CAAC;AArBD,wCAqBC","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/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** @alpha */\r\nexport interface DataListEntry {\r\n value: number | string | undefined;\r\n}\r\n\r\n/** @alpha */\r\nexport type DataListHandler = (list: HTMLDataListElement) => void;\r\n\r\n/** @alpha */\r\nexport interface DataListProps {\r\n name?: string;\r\n id: string;\r\n entries: DataListEntry[];\r\n parent?: HTMLElement;\r\n handler?: DataListHandler;\r\n inline?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface DataList {\r\n list: HTMLDataListElement;\r\n div: HTMLDivElement;\r\n}\r\n\r\nfunction _appendDataListEntry(list: HTMLDataListElement, entry: DataListEntry) {\r\n const option = document.createElement(\"option\");\r\n if (undefined !== entry.value)\r\n option.value = entry.value.toString();\r\n list.appendChild(option);\r\n}\r\n\r\n/** @alpha */\r\nexport function appendDataListEntries(dl: DataList, entries: DataListEntry[]) {\r\n for (const entry of entries) {\r\n _appendDataListEntry(dl.list, entry);\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport function createDataList(props: DataListProps): DataList {\r\n const list = document.createElement(\"datalist\");\r\n list.id = props.id;\r\n\r\n for (const entry of props.entries) {\r\n _appendDataListEntry(list, entry);\r\n }\r\n\r\n const handler = props.handler;\r\n if (undefined !== handler)\r\n list.onselect = () => handler(list);\r\n\r\n const div = document.createElement(\"div\");\r\n if (props.inline)\r\n div.style.display = \"inline\";\r\n\r\n div.appendChild(list);\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n return { div, list };\r\n}\r\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @alpha */
|
|
2
|
+
export declare type NestMenuHandler = (expanded: boolean) => void;
|
|
3
|
+
/** @alpha */
|
|
4
|
+
export interface NestedMenuProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
parent?: HTMLElement;
|
|
8
|
+
expand?: boolean;
|
|
9
|
+
handler?: NestMenuHandler;
|
|
10
|
+
body?: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
/** @alpha */
|
|
13
|
+
export interface NestedMenu {
|
|
14
|
+
div: HTMLDivElement;
|
|
15
|
+
label: HTMLLabelElement;
|
|
16
|
+
body: HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
/** @alpha */
|
|
19
|
+
export declare function createNestedMenu(props: NestedMenuProps): NestedMenu;
|
|
20
|
+
//# sourceMappingURL=NestedMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedMenu.d.ts","sourceRoot":"","sources":["../../src/ui/NestedMenu.ts"],"names":[],"mappings":"AAWA,aAAa;AACb,oBAAY,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAE1D,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,aAAa;AACb,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,aAAa;AACb,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,CAsCnE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createNestedMenu = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Controls
|
|
10
|
+
*/
|
|
11
|
+
const Button_1 = require("./Button");
|
|
12
|
+
/** @alpha */
|
|
13
|
+
function createNestedMenu(props) {
|
|
14
|
+
const div = document.createElement("div");
|
|
15
|
+
const body = undefined !== props.body ? props.body : document.createElement("div");
|
|
16
|
+
const header = document.createElement("div");
|
|
17
|
+
div.appendChild(header);
|
|
18
|
+
div.appendChild(body);
|
|
19
|
+
header.style.width = "100%";
|
|
20
|
+
const label = document.createElement("label");
|
|
21
|
+
label.innerText = undefined !== props.label ? props.label : "";
|
|
22
|
+
header.appendChild(label);
|
|
23
|
+
let isExpanded = undefined !== props.expand ? props.expand : false;
|
|
24
|
+
body.style.display = isExpanded ? "block" : "none";
|
|
25
|
+
const toggleMenuButton = (0, Button_1.createButton)({
|
|
26
|
+
parent: header,
|
|
27
|
+
inline: true,
|
|
28
|
+
value: isExpanded ? "-" : "+",
|
|
29
|
+
handler: () => undefined,
|
|
30
|
+
});
|
|
31
|
+
header.onclick = () => {
|
|
32
|
+
isExpanded = !isExpanded;
|
|
33
|
+
body.style.display = isExpanded ? "block" : "none";
|
|
34
|
+
toggleMenuButton.button.value = isExpanded ? "-" : "+";
|
|
35
|
+
if (undefined !== props.handler)
|
|
36
|
+
props.handler(isExpanded);
|
|
37
|
+
};
|
|
38
|
+
toggleMenuButton.div.style.cssFloat = "right";
|
|
39
|
+
header.appendChild(document.createElement("hr"));
|
|
40
|
+
if (undefined !== props.parent)
|
|
41
|
+
props.parent.appendChild(div);
|
|
42
|
+
if (undefined !== props.id)
|
|
43
|
+
div.id = props.id;
|
|
44
|
+
return { body, label, div };
|
|
45
|
+
}
|
|
46
|
+
exports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,EAAE,MAAM;QACd,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;QAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;KACzB,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QACpB,UAAU,GAAG,CAAC,UAAU,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,gBAAgB,CAAC,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACvD,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;YAC7B,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IAE9C,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjD,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9D,IAAI,SAAS,KAAK,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAC9B,CAAC;AAtCD,4CAsCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Controls\n */\n\nimport { createButton } from \"./Button\";\n\n/** @alpha */\nexport type NestMenuHandler = (expanded: boolean) => void;\n\n/** @alpha */\nexport interface NestedMenuProps {\n id?: string;\n label?: string;\n parent?: HTMLElement;\n expand?: boolean;\n handler?: NestMenuHandler;\n body?: HTMLElement;\n}\n\n/** @alpha */\nexport interface NestedMenu {\n div: HTMLDivElement;\n label: HTMLLabelElement;\n body: HTMLElement;\n}\n\n/** @alpha */\nexport function createNestedMenu(props: NestedMenuProps): NestedMenu {\n const div = document.createElement(\"div\");\n const body = undefined !== props.body ? props.body : document.createElement(\"div\");\n const header = document.createElement(\"div\");\n\n div.appendChild(header);\n div.appendChild(body);\n header.style.width = \"100%\";\n\n const label = document.createElement(\"label\");\n label.innerText = undefined !== props.label ? props.label : \"\";\n header.appendChild(label);\n\n let isExpanded = undefined !== props.expand ? props.expand : false;\n body.style.display = isExpanded ? \"block\" : \"none\";\n\n const toggleMenuButton = createButton({\n parent: header,\n inline: true,\n value: isExpanded ? \"-\" : \"+\",\n handler: () => undefined,\n });\n\n header.onclick = () => {\n isExpanded = !isExpanded;\n body.style.display = isExpanded ? \"block\" : \"none\";\n toggleMenuButton.button.value = isExpanded ? \"-\" : \"+\";\n if (undefined !== props.handler)\n props.handler(isExpanded);\n };\n\n toggleMenuButton.div.style.cssFloat = \"right\";\n\n header.appendChild(document.createElement(\"hr\"));\n\n if (undefined !== props.parent) props.parent.appendChild(div);\n if (undefined !== props.id) div.id = props.id;\n return { body, label, div };\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Controls
|
|
3
|
+
*/
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export declare type NumericInputHandler = (value: number, input: HTMLInputElement) => void;
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface NumericInputProps {
|
|
8
|
+
handler: NumericInputHandler;
|
|
9
|
+
id?: string;
|
|
10
|
+
parent?: HTMLElement;
|
|
11
|
+
value: number;
|
|
12
|
+
display?: "inline" | "none" | "block";
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
step?: number;
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
parseAsFloat?: true;
|
|
19
|
+
}
|
|
20
|
+
/** @alpha */
|
|
21
|
+
export declare function createNumericInput(props: NumericInputProps, useFloat?: boolean): HTMLInputElement;
|
|
22
|
+
/** @alpha */
|
|
23
|
+
export interface LabeledNumericInputProps extends NumericInputProps {
|
|
24
|
+
name: string;
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
/** @alpha */
|
|
28
|
+
export interface LabeledNumericInput {
|
|
29
|
+
input: HTMLInputElement;
|
|
30
|
+
div: HTMLDivElement;
|
|
31
|
+
label: HTMLLabelElement;
|
|
32
|
+
}
|
|
33
|
+
/** @alpha */
|
|
34
|
+
export declare function createLabeledNumericInput(props: LabeledNumericInputProps): LabeledNumericInput;
|
|
35
|
+
//# sourceMappingURL=NumericInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../src/ui/NumericInput.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,aAAa;AACb,oBAAY,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEnF,aAAa;AACb,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,IAAI,CAAC;CACrB;AAED,aAAa;AACb,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,GAAE,OAAe,GAAG,gBAAgB,CAyBxG;AAED,aAAa;AACb,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,aAAa;AACb,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,aAAa;AACb,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,mBAAmB,CAoB9F"}
|