@itwin/ecschema-rpcinterface-tests 5.0.0-dev.24 → 5.0.0-dev.25
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/lib/dist/bundled-tests.js +87 -7
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -71821,8 +71821,10 @@ class ThreeAxes {
|
|
|
71821
71821
|
class AccuDraw {
|
|
71822
71822
|
constructor() {
|
|
71823
71823
|
this._currentState = CurrentState.NotEnabled;
|
|
71824
|
-
|
|
71825
|
-
this.
|
|
71824
|
+
/** The current compass mode */
|
|
71825
|
+
this.compassMode = CompassMode.Rectangular;
|
|
71826
|
+
/** The current compass rotation */
|
|
71827
|
+
this.rotationMode = RotationMode.View;
|
|
71826
71828
|
/** @internal */
|
|
71827
71829
|
this.published = new AccudrawData(); // Staging area for hints
|
|
71828
71830
|
/** @internal */
|
|
@@ -71895,15 +71897,23 @@ class AccuDraw {
|
|
|
71895
71897
|
this._frameColorNoFocus = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.create(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorByName.darkGrey);
|
|
71896
71898
|
/** @internal */
|
|
71897
71899
|
this._fillColorNoFocus = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.create(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorByName.lightGrey);
|
|
71898
|
-
|
|
71900
|
+
/** When true improve behavior for +/- input when cursor switches side and try to automatically manage focus */
|
|
71899
71901
|
this.smartKeyin = true;
|
|
71902
|
+
/** When true the compass follows the origin hint as opposed to remaining at a fixed location */
|
|
71900
71903
|
this.floatingOrigin = true;
|
|
71904
|
+
/** When true the z input field will remain locked with it's current value after a data button */
|
|
71901
71905
|
this.stickyZLock = false;
|
|
71906
|
+
/** When true the compass is always active and on screen instead of following the current tools request to activate */
|
|
71902
71907
|
this.alwaysShowCompass = false;
|
|
71908
|
+
/** When true all tool hints are applied as opposed to only selected hints */
|
|
71903
71909
|
this.contextSensitive = true;
|
|
71910
|
+
/** When true the current point is adjusted to the x and y axes when within a close tolerance */
|
|
71904
71911
|
this.axisIndexing = true;
|
|
71912
|
+
/** When true the current point is adjusted to the last locked distance value when within a close tolerance */
|
|
71905
71913
|
this.distanceIndexing = true;
|
|
71914
|
+
/** When true locking the angle also moves focus to the angle input field */
|
|
71906
71915
|
this.autoFocusFields = true;
|
|
71916
|
+
/** When true fully specifying a point by entering both distance and angle in polar mode or XY[Z] in rectangular mode, the point is automatically accepted */
|
|
71907
71917
|
this.autoPointPlacement = false;
|
|
71908
71918
|
}
|
|
71909
71919
|
/** Current AccuDraw state */
|
|
@@ -71925,9 +71935,13 @@ class AccuDraw {
|
|
|
71925
71935
|
_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRows(this.axes.x, this.axes.y, this.axes.z, rMatrix);
|
|
71926
71936
|
return rMatrix;
|
|
71927
71937
|
}
|
|
71928
|
-
|
|
71938
|
+
/** When true AccuDraw is enabled by the application and can be used by interactive tools */
|
|
71929
71939
|
get isEnabled() { return (this.currentState > CurrentState.NotEnabled); }
|
|
71940
|
+
/** When true the compass is displayed and adjusting input points for the current interactive tool */
|
|
71941
|
+
get isActive() { return CurrentState.Active === this.currentState; }
|
|
71942
|
+
/** When true the compass is not displayed or adjusting points, but it can be automatically activated by the current interactive tool or via shortcuts */
|
|
71930
71943
|
get isInactive() { return (CurrentState.Inactive === this.currentState); }
|
|
71944
|
+
/** When true the compass is not displayed or adjusting points, the current interactive tool has disabled automatic activation, but can still be enabled via shortcuts */
|
|
71931
71945
|
get isDeactivated() { return (CurrentState.Deactivated === this.currentState); }
|
|
71932
71946
|
/** Get the current lock state for the supplied input field */
|
|
71933
71947
|
getFieldLock(index) { return this._fieldLocked[index]; }
|
|
@@ -72493,25 +72507,64 @@ class AccuDraw {
|
|
|
72493
72507
|
getLengthParser() {
|
|
72494
72508
|
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.findParserSpecByQuantityType(_quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_12__.QuantityType.Length);
|
|
72495
72509
|
}
|
|
72510
|
+
/** Allow the AccuDraw user interface to supply the distance parser */
|
|
72511
|
+
getLengthFormatter() {
|
|
72512
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.findFormatterSpecByQuantityType(_quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_12__.QuantityType.Length);
|
|
72513
|
+
}
|
|
72496
72514
|
stringToDistance(str) {
|
|
72497
72515
|
const parserSpec = this.getLengthParser();
|
|
72498
72516
|
if (parserSpec)
|
|
72499
72517
|
return parserSpec.parseToQuantityValue(str);
|
|
72500
72518
|
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_13__.ParseError.InvalidParserSpec };
|
|
72501
72519
|
}
|
|
72520
|
+
stringFromDistance(distance) {
|
|
72521
|
+
const formatterSpec = this.getLengthFormatter();
|
|
72522
|
+
let formattedValue = distance.toString();
|
|
72523
|
+
if (formatterSpec)
|
|
72524
|
+
formattedValue = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(distance, formatterSpec);
|
|
72525
|
+
return formattedValue;
|
|
72526
|
+
}
|
|
72502
72527
|
/** Allow the AccuDraw user interface to specify bearing */
|
|
72503
|
-
get isBearingMode() { return
|
|
72528
|
+
get isBearingMode() { return this.getAngleParser()?.format.type === _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_13__.FormatType.Bearing; }
|
|
72529
|
+
/** Allow the AccuDraw user interface to specify bearing directions are always in xy plane */
|
|
72530
|
+
get bearingFixedToPlane2d() { return this.flags.bearingFixToPlane2D; }
|
|
72531
|
+
set bearingFixedToPlane2d(enable) { this.flags.bearingFixToPlane2D = enable; }
|
|
72504
72532
|
/** Allow the AccuDraw user interface to supply the angle/direction parser */
|
|
72505
72533
|
getAngleParser() {
|
|
72506
|
-
// TODO: Use QuantityType.Angle when isBearingMode=false and "Bearing" for isBearingMode=true.
|
|
72507
72534
|
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.findParserSpecByQuantityType(_quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_12__.QuantityType.Angle);
|
|
72508
72535
|
}
|
|
72536
|
+
/** Allow the AccuDraw user interface to supply the angle/direction formatter */
|
|
72537
|
+
getAngleFormatter() {
|
|
72538
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.findFormatterSpecByQuantityType(_quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_12__.QuantityType.Angle);
|
|
72539
|
+
}
|
|
72509
72540
|
stringToAngle(inString) {
|
|
72510
72541
|
const parserSpec = this.getAngleParser();
|
|
72511
72542
|
if (parserSpec)
|
|
72512
72543
|
return parserSpec.parseToQuantityValue(inString);
|
|
72513
72544
|
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_13__.ParseError.InvalidParserSpec };
|
|
72514
72545
|
}
|
|
72546
|
+
stringFromAngle(angle) {
|
|
72547
|
+
if (this.isBearingMode && this.flags.bearingFixToPlane2D) {
|
|
72548
|
+
const point = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.axes.x.x, this.axes.x.y, 0.0);
|
|
72549
|
+
point.normalizeInPlace();
|
|
72550
|
+
let adjustment = Math.acos(point.x);
|
|
72551
|
+
if (point.y < 0.0)
|
|
72552
|
+
adjustment = -adjustment;
|
|
72553
|
+
angle += adjustment;
|
|
72554
|
+
}
|
|
72555
|
+
const formatterSpec = this.getAngleFormatter();
|
|
72556
|
+
let formattedValue = angle.toString();
|
|
72557
|
+
if (formatterSpec)
|
|
72558
|
+
formattedValue = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(angle, formatterSpec);
|
|
72559
|
+
return formattedValue;
|
|
72560
|
+
}
|
|
72561
|
+
/** Can be called by sub-classes to get a formatted value to display for an AccuDraw input field */
|
|
72562
|
+
getFormattedValueByIndex(index) {
|
|
72563
|
+
const value = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.accuDraw.getValueByIndex(index);
|
|
72564
|
+
if (ItemField.ANGLE_Item === index)
|
|
72565
|
+
return this.stringFromAngle(value);
|
|
72566
|
+
return this.stringFromDistance(value);
|
|
72567
|
+
}
|
|
72515
72568
|
updateFieldValue(index, input) {
|
|
72516
72569
|
if (input.length === 0)
|
|
72517
72570
|
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR;
|
|
@@ -74020,9 +74073,35 @@ class AccuDraw {
|
|
|
74020
74073
|
onBeginDynamics() { return this.upgradeToActiveState(); }
|
|
74021
74074
|
/** @internal */
|
|
74022
74075
|
onEndDynamics() { return this.downgradeInactiveState(); }
|
|
74076
|
+
/** Can be called by sub-classes as the default implementation of onMotion.
|
|
74077
|
+
* @see [[onMotion]]
|
|
74078
|
+
* @note Input fields are expected to call [[AccuDrawShortcuts.itemFieldNewInput]] when the user enters a value that is not a shortcut
|
|
74079
|
+
* and call [[AccuDrawShortcuts.itemFieldCompletedInput]] when a value is accepted, such as when focusing out of the field. This is
|
|
74080
|
+
* required for processMotion to correctly handle updating dynamic field values to reflect the current cursor location.
|
|
74081
|
+
*/
|
|
74082
|
+
processMotion() {
|
|
74083
|
+
if (this.flags.dialogNeedsUpdate || !this.isActive) {
|
|
74084
|
+
if (this.isActive && this.smartKeyin) {
|
|
74085
|
+
// NOTE: fixPointRectangular sets newFocus to either x or y based on which axis is closer to the input point...
|
|
74086
|
+
if (CompassMode.Rectangular === this.compassMode && !this.dontMoveFocus && !this.getFieldLock(this.newFocus))
|
|
74087
|
+
this.setFocusItem(this.newFocus);
|
|
74088
|
+
}
|
|
74089
|
+
const sendDynamicFieldValueChange = (item) => {
|
|
74090
|
+
if (KeyinStatus.Dynamic === this.getKeyinStatus(item))
|
|
74091
|
+
this.onFieldValueChange(item);
|
|
74092
|
+
};
|
|
74093
|
+
// NOTE: Shows the current deltas for rectangular mode when active and current coordinate when not active...
|
|
74094
|
+
sendDynamicFieldValueChange(ItemField.X_Item);
|
|
74095
|
+
sendDynamicFieldValueChange(ItemField.Y_Item);
|
|
74096
|
+
sendDynamicFieldValueChange(ItemField.Z_Item);
|
|
74097
|
+
sendDynamicFieldValueChange(ItemField.ANGLE_Item);
|
|
74098
|
+
sendDynamicFieldValueChange(ItemField.DIST_Item);
|
|
74099
|
+
}
|
|
74100
|
+
}
|
|
74023
74101
|
/** Implemented by sub-classes to update ui fields to show current deltas or coordinates when inactive.
|
|
74024
74102
|
* Should also choose active x or y input field in rectangular mode based on cursor position when
|
|
74025
74103
|
* axis isn't locked to support "smart lock".
|
|
74104
|
+
* @see [[processMotion]]
|
|
74026
74105
|
*/
|
|
74027
74106
|
onMotion(_ev) { }
|
|
74028
74107
|
/** @internal */
|
|
@@ -162589,6 +162668,7 @@ class AccuDrawShortcuts {
|
|
|
162589
162668
|
accudraw.dontMoveFocus = true;
|
|
162590
162669
|
}
|
|
162591
162670
|
static itemFieldNewInput(index) { _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.accuDraw.setKeyinStatus(index, _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.KeyinStatus.Partial); }
|
|
162671
|
+
static itemFieldCompletedInput(index) { _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.accuDraw.setKeyinStatus(index, _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.KeyinStatus.Dynamic); }
|
|
162592
162672
|
static async itemFieldAcceptInput(index, str) {
|
|
162593
162673
|
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.accuDraw;
|
|
162594
162674
|
await accudraw.processFieldInput(index, str, true);
|
|
@@ -305538,7 +305618,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
305538
305618
|
/***/ ((module) => {
|
|
305539
305619
|
|
|
305540
305620
|
"use strict";
|
|
305541
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
305621
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.25","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run --coverage","test:debug":"vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
305542
305622
|
|
|
305543
305623
|
/***/ })
|
|
305544
305624
|
|