@itwin/core-frontend
Version:
iTwin.js frontend components
74 lines • 3.45 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Properties
*/
import { IModelApp } from "../IModelApp";
import { QuantityType } from "../quantity-formatting/QuantityFormatter";
import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
/**
* Length Property Description
* @beta
*/
export class LengthDescription extends FormattedQuantityDescription {
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
const defaultName = "length";
super({
name: name ? name : defaultName,
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
iconSpec,
});
}
get formatterQuantityType() { return QuantityType.Length; }
/**
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.
*/
get quantityType() { return "Length"; }
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}
/**
* Survey Length Property Description
* @beta
*/
export class SurveyLengthDescription extends FormattedQuantityDescription {
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
const defaultName = "surveyLength";
super({
name: name ? name : defaultName,
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
iconSpec,
});
}
get formatterQuantityType() { return QuantityType.LengthSurvey; }
/**
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.
*/
get quantityType() { return "LengthSurvey"; }
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}
/**
* Engineering Length Property Description
* @beta
*/
export class EngineeringLengthDescription extends FormattedQuantityDescription {
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
const defaultName = "engineeringLength";
super({
name: name ? name : defaultName,
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
iconSpec,
});
}
get formatterQuantityType() { return QuantityType.LengthEngineering; }
/**
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use the `kindOfQuantityName` property instead.
*/
get quantityType() { return "LengthEngineering"; }
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
}
//# sourceMappingURL=LengthDescription.js.map