@itwin/core-frontend 5.11.0-dev.1 → 5.11.0-dev.11
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 +30 -1
- package/lib/cjs/AccuDraw.d.ts.map +1 -1
- package/lib/cjs/AccuDraw.js +2 -1
- package/lib/cjs/AccuDraw.js.map +1 -1
- package/lib/cjs/BingLocation.d.ts +1 -0
- package/lib/cjs/BingLocation.d.ts.map +1 -1
- package/lib/cjs/BingLocation.js +1 -0
- package/lib/cjs/BingLocation.js.map +1 -1
- package/lib/cjs/GraphicalEditingScope.d.ts +21 -0
- package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/cjs/GraphicalEditingScope.js +26 -0
- package/lib/cjs/GraphicalEditingScope.js.map +1 -1
- package/lib/cjs/HitDetail.d.ts.map +1 -1
- package/lib/cjs/HitDetail.js +10 -7
- package/lib/cjs/HitDetail.js.map +1 -1
- package/lib/cjs/IModelConnection.d.ts.map +1 -1
- package/lib/cjs/IModelConnection.js +4 -0
- package/lib/cjs/IModelConnection.js.map +1 -1
- package/lib/cjs/NativeApp.d.ts.map +1 -1
- package/lib/cjs/NativeApp.js +1 -3
- package/lib/cjs/NativeApp.js.map +1 -1
- package/lib/cjs/internal/tile/DynamicIModelTile.d.ts +3 -3
- package/lib/cjs/internal/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/cjs/internal/tile/DynamicIModelTile.js +26 -6
- package/lib/cjs/internal/tile/DynamicIModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +4 -2
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -0
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -0
- package/lib/cjs/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/cjs/properties/AngleDescription.d.ts +1 -0
- package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
- package/lib/cjs/properties/AngleDescription.js +3 -0
- package/lib/cjs/properties/AngleDescription.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts +29 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +35 -0
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/properties/LengthDescription.d.ts +3 -0
- package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
- package/lib/cjs/properties/LengthDescription.js +9 -0
- package/lib/cjs/properties/LengthDescription.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +6 -2
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +8 -5
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tile/internal.d.ts +0 -1
- package/lib/cjs/tile/internal.d.ts.map +1 -1
- package/lib/cjs/tile/internal.js +0 -1
- package/lib/cjs/tile/internal.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +5 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +1 -0
- package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/cjs/tile/map/MapLayerImageryFormats.js +4 -8
- package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +1 -0
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +23 -3
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/AccuDraw.d.ts.map +1 -1
- package/lib/esm/AccuDraw.js +2 -1
- package/lib/esm/AccuDraw.js.map +1 -1
- package/lib/esm/BingLocation.d.ts +1 -0
- package/lib/esm/BingLocation.d.ts.map +1 -1
- package/lib/esm/BingLocation.js +1 -0
- package/lib/esm/BingLocation.js.map +1 -1
- package/lib/esm/GraphicalEditingScope.d.ts +21 -0
- package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
- package/lib/esm/GraphicalEditingScope.js +26 -0
- package/lib/esm/GraphicalEditingScope.js.map +1 -1
- package/lib/esm/HitDetail.d.ts.map +1 -1
- package/lib/esm/HitDetail.js +11 -8
- package/lib/esm/HitDetail.js.map +1 -1
- package/lib/esm/IModelConnection.d.ts.map +1 -1
- package/lib/esm/IModelConnection.js +5 -1
- package/lib/esm/IModelConnection.js.map +1 -1
- package/lib/esm/NativeApp.d.ts.map +1 -1
- package/lib/esm/NativeApp.js +1 -3
- package/lib/esm/NativeApp.js.map +1 -1
- package/lib/esm/internal/tile/DynamicIModelTile.d.ts +3 -3
- package/lib/esm/internal/tile/DynamicIModelTile.d.ts.map +1 -1
- package/lib/esm/internal/tile/DynamicIModelTile.js +26 -6
- package/lib/esm/internal/tile/DynamicIModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +4 -2
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts +1 -0
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.d.ts.map +1 -1
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js +1 -0
- package/lib/esm/internal/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
- package/lib/esm/properties/AngleDescription.d.ts +1 -0
- package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
- package/lib/esm/properties/AngleDescription.js +3 -0
- package/lib/esm/properties/AngleDescription.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts +29 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +35 -1
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/properties/LengthDescription.d.ts +3 -0
- package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
- package/lib/esm/properties/LengthDescription.js +9 -0
- package/lib/esm/properties/LengthDescription.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +6 -2
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +8 -5
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tile/internal.d.ts +0 -1
- package/lib/esm/tile/internal.d.ts.map +1 -1
- package/lib/esm/tile/internal.js +0 -1
- package/lib/esm/tile/internal.js.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +5 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +1 -0
- package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
- package/lib/esm/tile/map/MapLayerImageryFormats.js +5 -9
- package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +1 -0
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +23 -3
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/lib/public/locales/en/iModelJs.json +2 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +24 -23
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +0 -14
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +0 -1
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +0 -34
- package/lib/cjs/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +0 -1
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts +0 -14
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.d.ts.map +0 -1
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js +0 -30
- package/lib/esm/internal/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +0 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
5
5
|
import { ScreenViewport } from "../../../../Viewport";
|
|
6
6
|
import { MapLayerImageryProvider } from "../../../../tile/internal";
|
|
7
|
+
/** @deprecated in 5.11.0. Bing Maps imagery is deprecated. For basemap imagery providers, see `@itwin/map-layers-formats`. */
|
|
7
8
|
export declare class BingMapsImageryLayerProvider extends MapLayerImageryProvider {
|
|
8
9
|
private _urlTemplate?;
|
|
9
10
|
private _urlSubdomains?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingImageryProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/tile/map/ImageryProviders/BingImageryProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,qBAAqB,EAAe,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,uBAAuB,EAExB,MAAM,2BAA2B,CAAC;AAoDnC,qBAAa,4BAA6B,SAAQ,uBAAuB;IACvE,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAC,CAAW;IAClC,OAAO,CAAC,QAAQ,CAAS;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C,aAAa,CAAC,CAAoB;IAC1C,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,qBAAqB;IAQ3C,IAAW,SAAS,IAAI,MAAM,CAA4B;IAC1D,IAAW,UAAU,IAAI,MAAM,CAA6B;IAE5D,OAAO,CAAC,eAAe;IAuBV,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAa1F,OAAO,CAAC,uBAAuB;IAqB9B,sGAAsG;IACvF,YAAY,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,cAAc,GAAG,IAAI;IAiBzD,eAAe,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BjD,OAAO,CAAC,gBAAgB;CAezB"}
|
|
@@ -66,6 +66,7 @@ class BingAttribution {
|
|
|
66
66
|
function replaceHttpWithHttps(originalUrl) {
|
|
67
67
|
return originalUrl.startsWith("http:") ? "https:".concat(originalUrl.slice(5)) : originalUrl;
|
|
68
68
|
}
|
|
69
|
+
/** @deprecated in 5.11.0. Bing Maps imagery is deprecated. For basemap imagery providers, see `@itwin/map-layers-formats`. */
|
|
69
70
|
export class BingMapsImageryLayerProvider extends MapLayerImageryProvider {
|
|
70
71
|
_urlTemplate;
|
|
71
72
|
_urlSubdomains;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingImageryProvider.js","sourceRoot":"","sources":["../../../../../../src/internal/tile/map/ImageryProviders/BingImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,EAAE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AAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1I,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACxD,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC/B,CAAC;YACD,MAAM,eAAe,GAAoB,IAAI,eAAe,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;YAC1F,IAAI,CAAC,IAAI,CAAC,aAAa;gBACrB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAmB,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;IACH,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\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BentleyError, expectDefined, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\r\nimport { request } from \"../../../../request/Request\";\r\nimport { IModelApp } from \"../../../../IModelApp\";\r\nimport { ScreenViewport } from \"../../../../Viewport\";\r\nimport {\r\n MapLayerImageryProvider, MapTile, MapTilingScheme, QuadId,\r\n Tile, WebMercatorTilingScheme,\r\n} from \"../../../../tile/internal\";\r\n\r\n/** Represents one range of geography and tile zoom levels for a bing data provider\r\n */\r\nclass Coverage {\r\n constructor(private _lowerLeftLatitude: number,\r\n private _lowerLeftLongitude: number,\r\n private _upperRightLatitude: number,\r\n private _upperRightLongitude: number,\r\n private _minimumZoomLevel: number,\r\n private _maximumZoomLevel: number) { }\r\n\r\n public overlaps(quadId: QuadId, tilingScheme: MapTilingScheme): boolean {\r\n const range: Range2d = quadId.getLatLongRangeDegrees(tilingScheme);\r\n if (quadId.level < this._minimumZoomLevel)\r\n return false;\r\n if (quadId.level > this._maximumZoomLevel)\r\n return false;\r\n if (range.low.x > this._upperRightLongitude)\r\n return false;\r\n if (range.low.y > this._upperRightLatitude)\r\n return false;\r\n if (range.high.x < this._lowerLeftLongitude)\r\n return false;\r\n if (range.high.y < this._lowerLeftLatitude)\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Represents the copyright message and an array of coverage data for one of bing's data providers (HERE for example).\r\n */\r\nclass BingAttribution {\r\n constructor(public copyrightMessage: string, private _coverages: Coverage[]) { }\r\n\r\n public matchesTile(tile: Tile, tilingScheme: MapTilingScheme): boolean {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n for (const coverage of this._coverages) {\r\n if (coverage.overlaps(quadId, tilingScheme))\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n// in deployed applications, we can only make https requests, but the Bing Maps metadata request returns templates with \"http:\".\r\n// This function fixes those.\r\nfunction replaceHttpWithHttps(originalUrl: string) {\r\n return originalUrl.startsWith(\"http:\") ? \"https:\".concat(originalUrl.slice(5)) : originalUrl;\r\n}\r\n\r\nexport class BingMapsImageryLayerProvider extends MapLayerImageryProvider {\r\n private _urlTemplate?: string;\r\n private _urlSubdomains?: string[];\r\n private _zoomMax: number;\r\n private _tileHeight: number;\r\n private _tileWidth: number;\r\n private _attributions?: BingAttribution[]; // array of Bing's data providers.\r\n private _mapTilingScheme: MapTilingScheme;\r\n private _urlBase: string;\r\n\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._urlBase = settings.url;\r\n this._zoomMax = 0;\r\n this._tileHeight = this._tileWidth = 0;\r\n this._mapTilingScheme = new WebMercatorTilingScheme();\r\n }\r\n\r\n public get tileWidth(): number { return this._tileWidth; }\r\n public get tileHeight(): number { return this._tileHeight; }\r\n\r\n private tileXYToQuadKey(tileX: number, tileY: number, zoomLevel: number) {\r\n // from C# example in bing documentation https://msdn.microsoft.com/en-us/library/bb259689.aspx\r\n let quadKey: string = \"\";\r\n\r\n // Root tile is not displayable. Returns 0 for _GetMaximumSize(). Should not end up here.\r\n assert(0 !== zoomLevel);\r\n\r\n for (let i: number = zoomLevel; i > 0; i--) {\r\n let digit: number = 0x30; // '0'\r\n const mask: number = 1 << (i - 1);\r\n if ((tileX & mask) !== 0) {\r\n digit++;\r\n }\r\n if ((tileY & mask) !== 0) {\r\n digit++;\r\n digit++;\r\n }\r\n quadKey = quadKey.concat(String.fromCharCode(digit));\r\n }\r\n return quadKey;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n // From the tile, get a \"quadKey\" the Microsoft way.\r\n const quadKey: string = this.tileXYToQuadKey(column, row, zoomLevel);\r\n const subdomain: string = expectDefined(this._urlSubdomains)[(row + column) % expectDefined(this._urlSubdomains).length];\r\n\r\n // from the template url, construct the tile url.\r\n let url: string = expectDefined(this._urlTemplate).replace(\"{subdomain}\", subdomain);\r\n url = url.replace(\"{quadkey}\", quadKey);\r\n\r\n return url;\r\n }\r\n\r\n // gets the attributions that match the tile set.\r\n private getMatchingAttributions(tiles: Set<Tile> | undefined): BingAttribution[] {\r\n const matchingAttributions: BingAttribution[] = new Array<BingAttribution>();\r\n if (!this._attributions || !tiles)\r\n return matchingAttributions;\r\n\r\n const unmatchedSet: BingAttribution[] = this._attributions.slice();\r\n for (const tile of tiles) {\r\n if (tile instanceof MapTile) {\r\n // compare to the set of Bing attributions that we have not yet matched.\r\n for (let iAttr = 0; iAttr < unmatchedSet.length; iAttr++) {\r\n const attribution = unmatchedSet[iAttr];\r\n if (attribution.matchesTile(tile, this._mapTilingScheme)) {\r\n matchingAttributions.push(attribution);\r\n unmatchedSet.splice(iAttr, 1);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return matchingAttributions;\r\n }\r\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */\r\n public override addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n const tiles = IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\r\n const matchingAttributions = this.getMatchingAttributions(tiles);\r\n const copyrights: string[] = [];\r\n for (const match of matchingAttributions)\r\n copyrights.push(match.copyrightMessage);\r\n\r\n let copyrightMsg = \"\";\r\n for (let i = 0; i < copyrights.length; ++i) {\r\n if (i > 0)\r\n copyrightMsg += \"<br>\";\r\n copyrightMsg += copyrights[i];\r\n }\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({ iconSrc: `${IModelApp.publicPath}images/bing.svg`, heading: \"Microsoft Bing\", notice: copyrightMsg }));\r\n }\r\n\r\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return Promise.resolve(this.addLogoCards(cards, vp));\r\n }\r\n\r\n // initializes the BingImageryProvider by reading the templateUrl, logo image, and attribution list.\r\n public override async initialize(): Promise<void> {\r\n // get the template url\r\n const bingRequestUrl = this._urlBase.replace(\"{bingKey}\", this._settings.accessKey ? this._settings.accessKey.value : \"\");\r\n\r\n try {\r\n const bingResponseProps = await request(bingRequestUrl, \"json\");\r\n\r\n const thisResourceSetProps = bingResponseProps.resourceSets[0];\r\n const thisResourceProps = thisResourceSetProps.resources[0];\r\n this._zoomMax = thisResourceProps.zoomMax;\r\n this._tileHeight = thisResourceProps.imageHeight;\r\n this._tileWidth = thisResourceProps.imageWidth;\r\n this._urlTemplate = replaceHttpWithHttps(thisResourceProps.imageUrl.replace(\"{culture}\", \"en-US\")); // NEEDSWORK - get locale from somewhere.\r\n this._urlSubdomains = thisResourceProps.imageUrlSubdomains;\r\n // read the list of Bing's data suppliers and the range of data they provide. Used in calculation of copyright message.\r\n this.readAttributions(thisResourceProps.imageryProviders);\r\n\r\n // Bing sometimes provides tiles that have nothing but a camera icon in the middle of them when you ask\r\n // for tiles at zoom levels where they don't have data. Their application stops you from zooming in when that's the\r\n // case, but we can't stop - the user might want to look at design data a closer zoom. So we intentionally load such\r\n // a tile, and then compare other tiles to it, rejecting them if they match.\r\n this.loadTile(0, 0, this._zoomMax - 1).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined)\r\n this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n } catch {\r\n throw new BentleyError(IModelStatus.BadModel, \"Error in Bing Server communications\");\r\n }\r\n }\r\n\r\n // reads the list of Bing data providers and the map range for which they each provide data.\r\n private readAttributions(attributionProps: any) {\r\n for (const thisAttributionProps of attributionProps) {\r\n const copyrightMessage: string = thisAttributionProps.attribution;\r\n const coverages: Coverage[] = new Array<Coverage>();\r\n for (const thisCoverageProps of thisAttributionProps.coverageAreas) {\r\n const thisCoverage = new Coverage(thisCoverageProps.bbox[0], thisCoverageProps.bbox[1], thisCoverageProps.bbox[2], thisCoverageProps.bbox[3],\r\n thisCoverageProps.zoomMin, thisCoverageProps.zoomMax);\r\n coverages.push(thisCoverage);\r\n }\r\n const thisAttribution: BingAttribution = new BingAttribution(copyrightMessage, coverages);\r\n if (!this._attributions)\r\n this._attributions = new Array<BingAttribution>();\r\n this._attributions.push(thisAttribution);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BingImageryProvider.js","sourceRoot":"","sources":["../../../../../../src/internal/tile/map/ImageryProviders/BingImageryProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxF,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO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AC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1I,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;gBACxD,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC/B,CAAC;YACD,MAAM,eAAe,GAAoB,IAAI,eAAe,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;YAC1F,IAAI,CAAC,IAAI,CAAC,aAAa;gBACrB,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,EAAmB,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;IACH,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\n/** @packageDocumentation\r\n * @module Tiles\r\n */\r\n\r\nimport { assert, BentleyError, expectDefined, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { Range2d } from \"@itwin/core-geometry\";\r\nimport { ImageMapLayerSettings, ImageSource } from \"@itwin/core-common\";\r\nimport { request } from \"../../../../request/Request\";\r\nimport { IModelApp } from \"../../../../IModelApp\";\r\nimport { ScreenViewport } from \"../../../../Viewport\";\r\nimport {\r\n MapLayerImageryProvider, MapTile, MapTilingScheme, QuadId,\r\n Tile, WebMercatorTilingScheme,\r\n} from \"../../../../tile/internal\";\r\n\r\n/** Represents one range of geography and tile zoom levels for a bing data provider\r\n */\r\nclass Coverage {\r\n constructor(private _lowerLeftLatitude: number,\r\n private _lowerLeftLongitude: number,\r\n private _upperRightLatitude: number,\r\n private _upperRightLongitude: number,\r\n private _minimumZoomLevel: number,\r\n private _maximumZoomLevel: number) { }\r\n\r\n public overlaps(quadId: QuadId, tilingScheme: MapTilingScheme): boolean {\r\n const range: Range2d = quadId.getLatLongRangeDegrees(tilingScheme);\r\n if (quadId.level < this._minimumZoomLevel)\r\n return false;\r\n if (quadId.level > this._maximumZoomLevel)\r\n return false;\r\n if (range.low.x > this._upperRightLongitude)\r\n return false;\r\n if (range.low.y > this._upperRightLatitude)\r\n return false;\r\n if (range.high.x < this._lowerLeftLongitude)\r\n return false;\r\n if (range.high.y < this._lowerLeftLatitude)\r\n return false;\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** Represents the copyright message and an array of coverage data for one of bing's data providers (HERE for example).\r\n */\r\nclass BingAttribution {\r\n constructor(public copyrightMessage: string, private _coverages: Coverage[]) { }\r\n\r\n public matchesTile(tile: Tile, tilingScheme: MapTilingScheme): boolean {\r\n const quadId = QuadId.createFromContentId(tile.contentId);\r\n for (const coverage of this._coverages) {\r\n if (coverage.overlaps(quadId, tilingScheme))\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n// in deployed applications, we can only make https requests, but the Bing Maps metadata request returns templates with \"http:\".\r\n// This function fixes those.\r\nfunction replaceHttpWithHttps(originalUrl: string) {\r\n return originalUrl.startsWith(\"http:\") ? \"https:\".concat(originalUrl.slice(5)) : originalUrl;\r\n}\r\n\r\n/** @deprecated in 5.11.0. Bing Maps imagery is deprecated. For basemap imagery providers, see `@itwin/map-layers-formats`. */\r\nexport class BingMapsImageryLayerProvider extends MapLayerImageryProvider {\r\n private _urlTemplate?: string;\r\n private _urlSubdomains?: string[];\r\n private _zoomMax: number;\r\n private _tileHeight: number;\r\n private _tileWidth: number;\r\n private _attributions?: BingAttribution[]; // array of Bing's data providers.\r\n private _mapTilingScheme: MapTilingScheme;\r\n private _urlBase: string;\r\n\r\n constructor(settings: ImageMapLayerSettings) {\r\n super(settings, true);\r\n this._urlBase = settings.url;\r\n this._zoomMax = 0;\r\n this._tileHeight = this._tileWidth = 0;\r\n this._mapTilingScheme = new WebMercatorTilingScheme();\r\n }\r\n\r\n public get tileWidth(): number { return this._tileWidth; }\r\n public get tileHeight(): number { return this._tileHeight; }\r\n\r\n private tileXYToQuadKey(tileX: number, tileY: number, zoomLevel: number) {\r\n // from C# example in bing documentation https://msdn.microsoft.com/en-us/library/bb259689.aspx\r\n let quadKey: string = \"\";\r\n\r\n // Root tile is not displayable. Returns 0 for _GetMaximumSize(). Should not end up here.\r\n assert(0 !== zoomLevel);\r\n\r\n for (let i: number = zoomLevel; i > 0; i--) {\r\n let digit: number = 0x30; // '0'\r\n const mask: number = 1 << (i - 1);\r\n if ((tileX & mask) !== 0) {\r\n digit++;\r\n }\r\n if ((tileY & mask) !== 0) {\r\n digit++;\r\n digit++;\r\n }\r\n quadKey = quadKey.concat(String.fromCharCode(digit));\r\n }\r\n return quadKey;\r\n }\r\n\r\n // construct the Url from the desired Tile\r\n public async constructUrl(row: number, column: number, zoomLevel: number): Promise<string> {\r\n // From the tile, get a \"quadKey\" the Microsoft way.\r\n const quadKey: string = this.tileXYToQuadKey(column, row, zoomLevel);\r\n const subdomain: string = expectDefined(this._urlSubdomains)[(row + column) % expectDefined(this._urlSubdomains).length];\r\n\r\n // from the template url, construct the tile url.\r\n let url: string = expectDefined(this._urlTemplate).replace(\"{subdomain}\", subdomain);\r\n url = url.replace(\"{quadkey}\", quadKey);\r\n\r\n return url;\r\n }\r\n\r\n // gets the attributions that match the tile set.\r\n private getMatchingAttributions(tiles: Set<Tile> | undefined): BingAttribution[] {\r\n const matchingAttributions: BingAttribution[] = new Array<BingAttribution>();\r\n if (!this._attributions || !tiles)\r\n return matchingAttributions;\r\n\r\n const unmatchedSet: BingAttribution[] = this._attributions.slice();\r\n for (const tile of tiles) {\r\n if (tile instanceof MapTile) {\r\n // compare to the set of Bing attributions that we have not yet matched.\r\n for (let iAttr = 0; iAttr < unmatchedSet.length; iAttr++) {\r\n const attribution = unmatchedSet[iAttr];\r\n if (attribution.matchesTile(tile, this._mapTilingScheme)) {\r\n matchingAttributions.push(attribution);\r\n unmatchedSet.splice(iAttr, 1);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return matchingAttributions;\r\n }\r\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [addAttributions] instead. */\r\n public override addLogoCards(cards: HTMLTableElement, vp: ScreenViewport): void {\r\n const tiles = IModelApp.tileAdmin.getTilesForUser(vp)?.selected;\r\n const matchingAttributions = this.getMatchingAttributions(tiles);\r\n const copyrights: string[] = [];\r\n for (const match of matchingAttributions)\r\n copyrights.push(match.copyrightMessage);\r\n\r\n let copyrightMsg = \"\";\r\n for (let i = 0; i < copyrights.length; ++i) {\r\n if (i > 0)\r\n copyrightMsg += \"<br>\";\r\n copyrightMsg += copyrights[i];\r\n }\r\n\r\n cards.appendChild(IModelApp.makeLogoCard({ iconSrc: `${IModelApp.publicPath}images/bing.svg`, heading: \"Microsoft Bing\", notice: copyrightMsg }));\r\n }\r\n\r\n public override async addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void> {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return Promise.resolve(this.addLogoCards(cards, vp));\r\n }\r\n\r\n // initializes the BingImageryProvider by reading the templateUrl, logo image, and attribution list.\r\n public override async initialize(): Promise<void> {\r\n // get the template url\r\n const bingRequestUrl = this._urlBase.replace(\"{bingKey}\", this._settings.accessKey ? this._settings.accessKey.value : \"\");\r\n\r\n try {\r\n const bingResponseProps = await request(bingRequestUrl, \"json\");\r\n\r\n const thisResourceSetProps = bingResponseProps.resourceSets[0];\r\n const thisResourceProps = thisResourceSetProps.resources[0];\r\n this._zoomMax = thisResourceProps.zoomMax;\r\n this._tileHeight = thisResourceProps.imageHeight;\r\n this._tileWidth = thisResourceProps.imageWidth;\r\n this._urlTemplate = replaceHttpWithHttps(thisResourceProps.imageUrl.replace(\"{culture}\", \"en-US\")); // NEEDSWORK - get locale from somewhere.\r\n this._urlSubdomains = thisResourceProps.imageUrlSubdomains;\r\n // read the list of Bing's data suppliers and the range of data they provide. Used in calculation of copyright message.\r\n this.readAttributions(thisResourceProps.imageryProviders);\r\n\r\n // Bing sometimes provides tiles that have nothing but a camera icon in the middle of them when you ask\r\n // for tiles at zoom levels where they don't have data. Their application stops you from zooming in when that's the\r\n // case, but we can't stop - the user might want to look at design data a closer zoom. So we intentionally load such\r\n // a tile, and then compare other tiles to it, rejecting them if they match.\r\n this.loadTile(0, 0, this._zoomMax - 1).then((tileData: ImageSource | undefined) => { // eslint-disable-line @typescript-eslint/no-floating-promises\r\n if (tileData !== undefined)\r\n this._missingTileData = tileData.data as Uint8Array;\r\n });\r\n } catch {\r\n throw new BentleyError(IModelStatus.BadModel, \"Error in Bing Server communications\");\r\n }\r\n }\r\n\r\n // reads the list of Bing data providers and the map range for which they each provide data.\r\n private readAttributions(attributionProps: any) {\r\n for (const thisAttributionProps of attributionProps) {\r\n const copyrightMessage: string = thisAttributionProps.attribution;\r\n const coverages: Coverage[] = new Array<Coverage>();\r\n for (const thisCoverageProps of thisAttributionProps.coverageAreas) {\r\n const thisCoverage = new Coverage(thisCoverageProps.bbox[0], thisCoverageProps.bbox[1], thisCoverageProps.bbox[2], thisCoverageProps.bbox[3],\r\n thisCoverageProps.zoomMin, thisCoverageProps.zoomMax);\r\n coverages.push(thisCoverage);\r\n }\r\n const thisAttribution: BingAttribution = new BingAttribution(copyrightMessage, coverages);\r\n if (!this._attributions)\r\n this._attributions = new Array<BingAttribution>();\r\n this._attributions.push(thisAttribution);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -5,6 +5,7 @@ import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
|
5
5
|
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
6
6
|
/**
|
|
7
7
|
* Angle Property Description
|
|
8
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
8
9
|
* @beta
|
|
9
10
|
*/
|
|
10
11
|
export declare class AngleDescription extends FormattedQuantityDescription {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"AngleDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;;GAIG;AAEH,qBAAa,gBAAiB,SAAQ,4BAA4B;gBACpD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAWhG,IAAW,qBAAqB,IAAI,YAAY,CAA+B;IAC/E;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAoB;IAErD,IAAW,UAAU,IAAI,MAAM,CAAgG;CAChI"}
|
|
@@ -10,11 +10,14 @@ import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
|
10
10
|
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
11
11
|
/**
|
|
12
12
|
* Angle Property Description
|
|
13
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
13
14
|
* @beta
|
|
14
15
|
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
15
17
|
export class AngleDescription extends FormattedQuantityDescription {
|
|
16
18
|
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
17
19
|
const defaultName = "angle";
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
18
21
|
super({
|
|
19
22
|
name: name ?? defaultName,
|
|
20
23
|
displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString("iModelJs:Properties.Angle"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleDescription.js","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"AngleDescription.js","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;;GAIG;AACH,4DAA4D;AAC5D,MAAM,OAAO,gBAAiB,SAAQ,4BAA4B;IAChE,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB,EAAE,kBAA2B;QAC9F,MAAM,WAAW,GAAG,OAAO,CAAC;QAC5B,4DAA4D;QAC5D,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,IAAI,WAAW;YACzB,YAAY,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;YACpG,kBAAkB,EAAE,kBAAkB,IAAI,yBAAyB;YACnE,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,IAAW,qBAAqB,KAAmB,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAErD,IAAW,UAAU,KAAa,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC,CAAC,CAAC;CAChI","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/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\r\nimport { FormattedQuantityDescription } from \"./FormattedQuantityDescription\";\r\n\r\n/**\r\n * Angle Property Description\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class AngleDescription extends FormattedQuantityDescription {\r\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\r\n const defaultName = \"angle\";\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n super({\r\n name: name ?? defaultName,\r\n displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Angle\"),\r\n kindOfQuantityName: kindOfQuantityName ?? \"DefaultToolsUnits.ANGLE\",\r\n iconSpec,\r\n });\r\n }\r\n\r\n public get formatterQuantityType(): QuantityType { return QuantityType.Angle; }\r\n /**\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.\r\n */\r\n public get quantityType(): string { return \"Angle\"; }\r\n\r\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseAngle\"); }\r\n}\r\n"]}
|
|
@@ -2,9 +2,36 @@
|
|
|
2
2
|
* @module Properties
|
|
3
3
|
*/
|
|
4
4
|
import { FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
5
|
-
import { BaseQuantityDescription, ParseResults } from "@itwin/appui-abstract";
|
|
5
|
+
import { BaseQuantityDescription, ParseResults, type PropertyDescription } from "@itwin/appui-abstract";
|
|
6
6
|
import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
7
|
+
/** Properties for [createQuantityDescription]($frontend).
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export interface CreateQuantityDescriptionProps {
|
|
11
|
+
/** Programmatic property name. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** User-facing property label. */
|
|
14
|
+
displayLabel: string;
|
|
15
|
+
/** KindOfQuantity name used to resolve formatting and parsing behavior. */
|
|
16
|
+
kindOfQuantityName: string;
|
|
17
|
+
/** Persistence unit name for values stored in the property. */
|
|
18
|
+
persistenceUnitName: string;
|
|
19
|
+
/** Optional parse failure message override shown when the input cannot be converted.
|
|
20
|
+
*
|
|
21
|
+
* If omitted, [createQuantityDescription]($frontend) falls back to a generic parse error message.
|
|
22
|
+
*/
|
|
23
|
+
parseError?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Creates a quantity-aware [PropertyDescription]($appui-abstract) for tool settings and other UI property flows.
|
|
26
|
+
*
|
|
27
|
+
* The returned description uses a `NumberCustom` editor with synchronous formatting and parsing callbacks backed by the
|
|
28
|
+
* active [IModelApp.quantityFormatter]($frontend). Formatting falls back to `numberValue.toFixed(2)` until specs are available.
|
|
29
|
+
*
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
32
|
+
export declare function createQuantityDescription(props: CreateQuantityDescriptionProps): PropertyDescription;
|
|
7
33
|
/**
|
|
34
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
8
35
|
* @beta
|
|
9
36
|
*/
|
|
10
37
|
export interface FormattedQuantityDescriptionArgs {
|
|
@@ -15,6 +42,7 @@ export interface FormattedQuantityDescriptionArgs {
|
|
|
15
42
|
}
|
|
16
43
|
/**
|
|
17
44
|
* Base Quantity Property Description
|
|
45
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
18
46
|
* @beta
|
|
19
47
|
*/
|
|
20
48
|
export declare abstract class FormattedQuantityDescription extends BaseQuantityDescription {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedQuantityDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAU,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"FormattedQuantityDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAU,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,uBAAuB,EAAoC,YAAY,EAAE,KAAK,mBAAmB,EAClG,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,GAAG,mBAAmB,CA0BpG;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,8BAAsB,4BAA6B,SAAQ,uBAAuB;IAChF,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,WAAW,CAAC,CAAa;gBAErB,IAAI,EAAE,gCAAgC;gBACtC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAU9F,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAOlD,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAYtD,IAAW,aAAa,IAAI,aAAa,GAAG,SAAS,CAWpD;IAED,IAAW,UAAU,IAAI,UAAU,GAAG,SAAS,CAW9C;IAED,aAAoB,qBAAqB,IAAI,YAAY,CAAC;IAE1D,aAA6B,UAAU,IAAI,MAAM,CAAC;CACnD"}
|
|
@@ -6,10 +6,44 @@
|
|
|
6
6
|
* @module Properties
|
|
7
7
|
*/
|
|
8
8
|
import { Parser } from "@itwin/core-quantity";
|
|
9
|
-
import { BaseQuantityDescription } from "@itwin/appui-abstract";
|
|
9
|
+
import { BaseQuantityDescription, PropertyEditorParamTypes, StandardEditorNames, StandardTypeNames, } from "@itwin/appui-abstract";
|
|
10
10
|
import { IModelApp } from "../IModelApp";
|
|
11
|
+
/** Creates a quantity-aware [PropertyDescription]($appui-abstract) for tool settings and other UI property flows.
|
|
12
|
+
*
|
|
13
|
+
* The returned description uses a `NumberCustom` editor with synchronous formatting and parsing callbacks backed by the
|
|
14
|
+
* active [IModelApp.quantityFormatter]($frontend). Formatting falls back to `numberValue.toFixed(2)` until specs are available.
|
|
15
|
+
*
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export function createQuantityDescription(props) {
|
|
19
|
+
const { name, displayLabel, kindOfQuantityName, persistenceUnitName } = props;
|
|
20
|
+
const parseError = props.parseError ?? IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseValue");
|
|
21
|
+
const formatSpecHandle = IModelApp.quantityFormatter.getFormatSpecHandle(kindOfQuantityName, persistenceUnitName);
|
|
22
|
+
const editorParams = [{
|
|
23
|
+
type: PropertyEditorParamTypes.CustomFormattedNumber,
|
|
24
|
+
formatFunction: (numberValue) => {
|
|
25
|
+
const formatterSpec = formatSpecHandle.formatterSpec;
|
|
26
|
+
return formatterSpec ? IModelApp.quantityFormatter.formatQuantity(numberValue, formatterSpec) : numberValue.toFixed(2);
|
|
27
|
+
},
|
|
28
|
+
parseFunction: (userInput) => {
|
|
29
|
+
const parseResult = formatSpecHandle.parserSpec?.parseToQuantityValue(userInput);
|
|
30
|
+
return parseResult && parseResult.ok ? { value: parseResult.value } : { parseError };
|
|
31
|
+
},
|
|
32
|
+
}];
|
|
33
|
+
return {
|
|
34
|
+
name,
|
|
35
|
+
displayLabel,
|
|
36
|
+
kindOfQuantityName,
|
|
37
|
+
typename: StandardTypeNames.Number,
|
|
38
|
+
editor: {
|
|
39
|
+
name: StandardEditorNames.NumberCustom,
|
|
40
|
+
params: editorParams,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
11
44
|
/**
|
|
12
45
|
* Base Quantity Property Description
|
|
46
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
13
47
|
* @beta
|
|
14
48
|
*/
|
|
15
49
|
export class FormattedQuantityDescription extends BaseQuantityDescription {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedQuantityDescription.js","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAiB,MAAM,EAAc,MAAM,sBAAsB,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"FormattedQuantityDescription.js","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAiB,MAAM,EAAc,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,uBAAuB,EAA4E,wBAAwB,EAAE,mBAAmB,EAAE,iBAAiB,GACpK,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAsBzC;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAqC;IAC7E,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;IAC3H,MAAM,gBAAgB,GAAG,SAAS,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAClH,MAAM,YAAY,GAAkC,CAAC;YACnD,IAAI,EAAE,wBAAwB,CAAC,qBAAqB;YACpD,cAAc,EAAE,CAAC,WAAmB,EAAU,EAAE;gBAC9C,MAAM,aAAa,GAAG,gBAAgB,CAAC,aAAa,CAAC;gBACrD,OAAO,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,cAAc,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;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,WAAW,CAAC,SAAiB;QACrC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,WAAW,GAAG,SAAS,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YACjG,IAAI,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;gBACzC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC;YACtC,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;YACzC,CAAC;QACH,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAC7C,CAAC;IAED,IAAW,aAAa;QACtB,IAAI,IAAI,CAAC,cAAc;YACrB,OAAO,IAAI,CAAC,cAAc,CAAC;QAE7B,MAAM,aAAa,GAAG,SAAS,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC9G,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;YACpC,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAW,UAAU;QACnB,IAAI,IAAI,CAAC,WAAW;YAClB,OAAO,IAAI,CAAC,WAAW,CAAC;QAE1B,MAAM,UAAU,GAAG,SAAS,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACxG,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CAKF","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/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { FormatterSpec, Parser, ParserSpec } from \"@itwin/core-quantity\";\r\nimport {\r\n BaseQuantityDescription, type CustomFormattedNumberParams, ParseResults, type PropertyDescription, PropertyEditorParamTypes, StandardEditorNames, StandardTypeNames,\r\n} from \"@itwin/appui-abstract\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\r\n\r\n/** Properties for [createQuantityDescription]($frontend).\r\n * @beta\r\n */\r\nexport interface CreateQuantityDescriptionProps {\r\n /** Programmatic property name. */\r\n name: string;\r\n /** User-facing property label. */\r\n displayLabel: string;\r\n /** KindOfQuantity name used to resolve formatting and parsing behavior. */\r\n kindOfQuantityName: string;\r\n /** Persistence unit name for values stored in the property. */\r\n persistenceUnitName: string;\r\n /** Optional parse failure message override shown when the input cannot be converted.\r\n *\r\n * If omitted, [createQuantityDescription]($frontend) falls back to a generic parse error message.\r\n */\r\n parseError?: string;\r\n}\r\n\r\n/** Creates a quantity-aware [PropertyDescription]($appui-abstract) for tool settings and other UI property flows.\r\n *\r\n * The returned description uses a `NumberCustom` editor with synchronous formatting and parsing callbacks backed by the\r\n * active [IModelApp.quantityFormatter]($frontend). Formatting falls back to `numberValue.toFixed(2)` until specs are available.\r\n *\r\n * @beta\r\n */\r\nexport function createQuantityDescription(props: CreateQuantityDescriptionProps): PropertyDescription {\r\n const { name, displayLabel, kindOfQuantityName, persistenceUnitName } = props;\r\n const parseError = props.parseError ?? IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseValue\");\r\n const formatSpecHandle = IModelApp.quantityFormatter.getFormatSpecHandle(kindOfQuantityName, persistenceUnitName);\r\n const editorParams: CustomFormattedNumberParams[] = [{\r\n type: PropertyEditorParamTypes.CustomFormattedNumber,\r\n formatFunction: (numberValue: number): string => {\r\n const formatterSpec = formatSpecHandle.formatterSpec;\r\n return formatterSpec ? IModelApp.quantityFormatter.formatQuantity(numberValue, formatterSpec) : numberValue.toFixed(2);\r\n },\r\n parseFunction: (userInput: string) => {\r\n const parseResult = formatSpecHandle.parserSpec?.parseToQuantityValue(userInput);\r\n return parseResult && parseResult.ok ? { value: parseResult.value } : { parseError };\r\n },\r\n }];\r\n\r\n return {\r\n name,\r\n displayLabel,\r\n kindOfQuantityName,\r\n typename: StandardTypeNames.Number,\r\n editor: {\r\n name: StandardEditorNames.NumberCustom,\r\n params: editorParams,\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).\r\n * @beta\r\n */\r\nexport interface FormattedQuantityDescriptionArgs {\r\n name: string;\r\n displayLabel: string;\r\n iconSpec?: string;\r\n kindOfQuantityName?: string;\r\n}\r\n\r\n/**\r\n * Base Quantity Property Description\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).\r\n * @beta\r\n */\r\nexport abstract class FormattedQuantityDescription extends BaseQuantityDescription {\r\n private _formatterSpec?: FormatterSpec;\r\n private _parserSpec?: ParserSpec;\r\n\r\n constructor(args: FormattedQuantityDescriptionArgs); // eslint-disable-line @typescript-eslint/no-deprecated\r\n constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string);\r\n constructor(argsOrName: FormattedQuantityDescriptionArgs | string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) { // eslint-disable-line @typescript-eslint/no-deprecated\r\n if (typeof argsOrName === \"string\") {\r\n // if argsOrName is a string, displayLabel must be defined.\r\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\r\n super(argsOrName, displayLabel!, iconSpec, kindOfQuantityName);\r\n } else {\r\n super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);\r\n }\r\n }\r\n protected formatValue(numberValue: number): string {\r\n if (this.formatterSpec) {\r\n return IModelApp.quantityFormatter.formatQuantity(numberValue, this.formatterSpec);\r\n }\r\n return numberValue.toFixed(2);\r\n }\r\n\r\n protected parseString(userInput: string): ParseResults {\r\n if (this.parserSpec) {\r\n const parseResult = IModelApp.quantityFormatter.parseToQuantityValue(userInput, this.parserSpec);\r\n if (Parser.isParsedQuantity(parseResult)) {\r\n return { value: parseResult.value };\r\n } else {\r\n return { parseError: this.parseError };\r\n }\r\n }\r\n return { parseError: \"no parser defined\" };\r\n }\r\n\r\n public get formatterSpec(): FormatterSpec | undefined {\r\n if (this._formatterSpec)\r\n return this._formatterSpec;\r\n\r\n const formatterSpec = IModelApp.quantityFormatter.findFormatterSpecByQuantityType(this.formatterQuantityType);\r\n if (formatterSpec) {\r\n this._formatterSpec = formatterSpec;\r\n return formatterSpec;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public get parserSpec(): ParserSpec | undefined {\r\n if (this._parserSpec)\r\n return this._parserSpec;\r\n\r\n const parserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(this.formatterQuantityType);\r\n if (parserSpec) {\r\n this._parserSpec = parserSpec;\r\n return parserSpec;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n public abstract get formatterQuantityType(): QuantityType;\r\n\r\n public abstract override get parseError(): string;\r\n}\r\n"]}
|
|
@@ -5,6 +5,7 @@ import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
|
5
5
|
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
6
6
|
/**
|
|
7
7
|
* Length Property Description
|
|
8
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
8
9
|
* @beta
|
|
9
10
|
*/
|
|
10
11
|
export declare class LengthDescription extends FormattedQuantityDescription {
|
|
@@ -18,6 +19,7 @@ export declare class LengthDescription extends FormattedQuantityDescription {
|
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Survey Length Property Description
|
|
22
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) in new code. To preserve survey-length behavior, configure a dedicated [FormatsProvider]($quantity) such as [FormatSetFormatsProvider]($ecschema-metadata).
|
|
21
23
|
* @beta
|
|
22
24
|
*/
|
|
23
25
|
export declare class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
@@ -31,6 +33,7 @@ export declare class SurveyLengthDescription extends FormattedQuantityDescriptio
|
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Engineering Length Property Description
|
|
36
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
34
37
|
* @beta
|
|
35
38
|
*/
|
|
36
39
|
export declare class EngineeringLengthDescription extends FormattedQuantityDescription {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LengthDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"LengthDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;;GAIG;AAEH,qBAAa,iBAAkB,SAAQ,4BAA4B;gBACrD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAWhG,IAAW,qBAAqB,IAAI,YAAY,CAAgC;IAChF;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAqB;IAEtD,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI;AAED;;;;GAIG;AAEH,qBAAa,uBAAwB,SAAQ,4BAA4B;gBAC3D,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAWhG,IAAW,qBAAqB,IAAI,YAAY,CAAsC;IACtF;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAA2B;IAE5D,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI;AAED;;;;GAIG;AAEH,qBAAa,4BAA6B,SAAQ,4BAA4B;gBAEhE,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAWhG,IAAW,qBAAqB,IAAI,YAAY,CAA2C;IAC3F;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAgC;IAEjE,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI"}
|
|
@@ -10,11 +10,14 @@ import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
|
10
10
|
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
11
11
|
/**
|
|
12
12
|
* Length Property Description
|
|
13
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
13
14
|
* @beta
|
|
14
15
|
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
15
17
|
export class LengthDescription extends FormattedQuantityDescription {
|
|
16
18
|
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
17
19
|
const defaultName = "length";
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
18
21
|
super({
|
|
19
22
|
name: name ?? defaultName,
|
|
20
23
|
displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
@@ -31,11 +34,14 @@ export class LengthDescription extends FormattedQuantityDescription {
|
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Survey Length Property Description
|
|
37
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) in new code. To preserve survey-length behavior, configure a dedicated [FormatsProvider]($quantity) such as [FormatSetFormatsProvider]($ecschema-metadata).
|
|
34
38
|
* @beta
|
|
35
39
|
*/
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
36
41
|
export class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
37
42
|
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
38
43
|
const defaultName = "surveyLength";
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
39
45
|
super({
|
|
40
46
|
name: name ?? defaultName,
|
|
41
47
|
displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
@@ -52,11 +58,14 @@ export class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
|
52
58
|
}
|
|
53
59
|
/**
|
|
54
60
|
* Engineering Length Property Description
|
|
61
|
+
* @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).
|
|
55
62
|
* @beta
|
|
56
63
|
*/
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
57
65
|
export class EngineeringLengthDescription extends FormattedQuantityDescription {
|
|
58
66
|
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
59
67
|
const defaultName = "engineeringLength";
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
60
69
|
super({
|
|
61
70
|
name: name ?? defaultName,
|
|
62
71
|
displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LengthDescription.js","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"LengthDescription.js","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;;GAIG;AACH,4DAA4D;AAC5D,MAAM,OAAO,iBAAkB,SAAQ,4BAA4B;IACjE,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB,EAAE,kBAA2B;QAC9F,MAAM,WAAW,GAAG,QAAQ,CAAC;QAC7B,4DAA4D;QAC5D,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,IAAI,WAAW;YACzB,YAAY,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,4BAA4B,CAAC;YACrG,kBAAkB,EAAE,kBAAkB,IAAI,0BAA0B;YACpE,QAAQ;SACT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B,CAAC;YACrG,kBAAkB,EAAE,kBAAkB,IAAI,iBAAiB;YAC3D,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,IAAW,qBAAqB,KAAmB,OAAO,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3F;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,mBAAmB,CAAC,CAAC,CAAC;IAEjE,IAAW,UAAU,KAAa,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,yCAAyC,CAAC,CAAC,CAAC,CAAC;CACjI","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/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\r\nimport { FormattedQuantityDescription } from \"./FormattedQuantityDescription\";\r\n\r\n/**\r\n * Length Property Description\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class LengthDescription extends FormattedQuantityDescription {\r\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\r\n const defaultName = \"length\";\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n super({\r\n name: name ?? defaultName,\r\n displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\r\n kindOfQuantityName: kindOfQuantityName ?? \"DefaultToolsUnits.LENGTH\",\r\n iconSpec,\r\n });\r\n }\r\n\r\n public get formatterQuantityType(): QuantityType { return QuantityType.Length; }\r\n /**\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.\r\n */\r\n public get quantityType(): string { return \"Length\"; }\r\n\r\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\r\n}\r\n\r\n/**\r\n * Survey Length Property Description\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) in new code. To preserve survey-length behavior, configure a dedicated [FormatsProvider]($quantity) such as [FormatSetFormatsProvider]($ecschema-metadata).\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class SurveyLengthDescription extends FormattedQuantityDescription {\r\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\r\n const defaultName = \"surveyLength\";\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n super({\r\n name: name ?? defaultName,\r\n displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\r\n kindOfQuantityName: kindOfQuantityName ?? \"CivilUnits.LENGTH\",\r\n iconSpec,\r\n });\r\n }\r\n\r\n public get formatterQuantityType(): QuantityType { return QuantityType.LengthSurvey; }\r\n /**\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.\r\n */\r\n public get quantityType(): string { return \"LengthSurvey\"; }\r\n\r\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\r\n}\r\n\r\n/**\r\n * Engineering Length Property Description\r\n * @deprecated in 5.11.0. This appui-based quantity description API is deprecated. Use [createQuantityDescription]($frontend) to build a plain [PropertyDescription]($appui-abstract) with synchronous quantity formatting callbacks backed by [IModelApp.quantityFormatter]($frontend).\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport class EngineeringLengthDescription extends FormattedQuantityDescription {\r\n\r\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\r\n const defaultName = \"engineeringLength\";\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n super({\r\n name: name ?? defaultName,\r\n displayLabel: displayLabel ?? IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\r\n kindOfQuantityName: kindOfQuantityName ?? \"AecUnits.LENGTH\",\r\n iconSpec,\r\n });\r\n }\r\n\r\n public get formatterQuantityType(): QuantityType { return QuantityType.LengthEngineering; }\r\n /**\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.\r\n */\r\n public get quantityType(): string { return \"LengthEngineering\"; }\r\n\r\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\r\n}\r\n"]}
|
|
@@ -205,7 +205,7 @@ export declare class QuantityTypeFormatsProvider implements FormatsProvider {
|
|
|
205
205
|
constructor();
|
|
206
206
|
[Symbol.dispose](): void;
|
|
207
207
|
private _kindOfQuantityMap;
|
|
208
|
-
getFormat(name: string,
|
|
208
|
+
getFormat(name: string, system?: UnitSystemKey): Promise<FormatDefinition | undefined>;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* An implementation of the [[FormatsProvider]] interface that forwards calls to getFormats to the underlying FormatsProvider.
|
|
@@ -527,8 +527,12 @@ export declare class QuantityFormatter implements UnitsProvider, FormattingSpecP
|
|
|
527
527
|
/**
|
|
528
528
|
* @beta
|
|
529
529
|
* Returns a map of [[FormattingSpecEntry]] keyed by persistence unit for a given name, typically a KindOfQuantity full name.
|
|
530
|
+
* @param name - The KoQ name to look up.
|
|
531
|
+
* @param options - Optional lookup options. When `options.system` is omitted, the active unit system is used.
|
|
530
532
|
*/
|
|
531
|
-
getSpecsByName(name: string
|
|
533
|
+
getSpecsByName(name: string, options?: {
|
|
534
|
+
system?: UnitSystemKey;
|
|
535
|
+
}): ReadonlyMap<string, FormattingSpecEntry> | undefined;
|
|
532
536
|
/**
|
|
533
537
|
* Returns a [[FormattingSpecEntry]] for a given name and persistence unit.
|
|
534
538
|
* @beta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantityFormatter.d.ts","sourceRoot":"","sources":["../../../src/quantity-formatting/QuantityFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAE,kBAAkB,EAAU,MAAM,qBAAqB,CAAC;AACnG,OAAO,EACL,qBAAqB,EAAE,2BAA2B,EAA8B,gBAAgB,EAAE,WAAW,EAC7G,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,wBAAwB,EAC9F,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB,EAAc,UAAU,EACvF,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAClF,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE;;;GAGG;AACH,oBAAY,YAAY;IACtB,6HAA6H;IAC7H,MAAM,IAAI;IACV,8IAA8I;IAC9I,KAAK,IAAI;IACT,wIAAwI;IACxI,IAAI,IAAI;IACR,8IAA8I;IAC9I,MAAM,IAAI;IACV,4JAA4J;IAC5J,OAAO,IAAI;IACX,yIAAyI;IACzI,UAAU,IAAI;IACd,wIAAwI;IACxI,UAAU,IAAI;IACd,kJAAkJ;IAClJ,YAAY,IAAI;IAChB,gJAAgJ;IAChJ,iBAAiB,IAAI;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5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,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,aAAa,CAAA;KAAE,GAAG,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS;IAa/H;;;OAGG;IACI,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,SAAS;IAKvF;;;;;;;OAOG;IACI,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,gBAAgB;IAI9G;;;KAGC;IACY,4BAA4B,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAmCtF"}
|
|
@@ -162,11 +162,11 @@ export class QuantityTypeFormatsProvider {
|
|
|
162
162
|
["CivilUnits.LENGTH", QuantityType.LengthEngineering],
|
|
163
163
|
["AecUnits.LENGTH", QuantityType.LengthEngineering]
|
|
164
164
|
]);
|
|
165
|
-
async getFormat(name,
|
|
165
|
+
async getFormat(name, system) {
|
|
166
166
|
const quantityType = this._kindOfQuantityMap.get(name);
|
|
167
167
|
if (!quantityType)
|
|
168
168
|
return undefined;
|
|
169
|
-
return IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);
|
|
169
|
+
return IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType, system);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
@@ -979,15 +979,18 @@ export class QuantityFormatter {
|
|
|
979
979
|
/**
|
|
980
980
|
* @beta
|
|
981
981
|
* Returns a map of [[FormattingSpecEntry]] keyed by persistence unit for a given name, typically a KindOfQuantity full name.
|
|
982
|
+
* @param name - The KoQ name to look up.
|
|
983
|
+
* @param options - Optional lookup options. When `options.system` is omitted, the active unit system is used.
|
|
982
984
|
*/
|
|
983
|
-
getSpecsByName(name) {
|
|
985
|
+
getSpecsByName(name, options) {
|
|
986
|
+
const effectiveSystem = options?.system ?? this._activeUnitSystem;
|
|
984
987
|
const unitMap = this._formatSpecsRegistry.get(name);
|
|
985
988
|
if (!unitMap)
|
|
986
989
|
return undefined;
|
|
987
|
-
// Return
|
|
990
|
+
// Return projection for the effective system
|
|
988
991
|
const result = new Map();
|
|
989
992
|
for (const [persistenceUnit, systemMap] of unitMap) {
|
|
990
|
-
const entry = systemMap.get(
|
|
993
|
+
const entry = systemMap.get(effectiveSystem);
|
|
991
994
|
if (entry)
|
|
992
995
|
result.set(persistenceUnit, entry);
|
|
993
996
|
}
|