@itwin/appui-abstract 5.1.0-dev.15 → 5.1.0-dev.17
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/cjs/appui-abstract/properties/Description.d.ts +5 -0
- package/lib/cjs/appui-abstract/properties/Description.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.d.ts +2 -2
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js +3 -1
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.d.ts +5 -0
- package/lib/esm/appui-abstract/properties/Description.d.ts.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.d.ts +2 -2
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.d.ts.map +1 -1
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js +3 -1
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/package.json +5 -5
@@ -70,8 +70,13 @@ export interface PropertyDescription {
|
|
70
70
|
/** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool
|
71
71
|
* or the full name of a KOQ (schema:koq).
|
72
72
|
* @alpha
|
73
|
+
* @deprecated in 5.0. Use `kindOfQuantityName` instead.
|
73
74
|
*/
|
74
75
|
quantityType?: string;
|
76
|
+
/** [[KindOfQuantity]] full name used to look up [[FormatProps]]
|
77
|
+
* @beta
|
78
|
+
*/
|
79
|
+
kindOfQuantityName?: string;
|
75
80
|
/** Get the custom DataController by this name and register it with the property editor */
|
76
81
|
dataController?: string;
|
77
82
|
/** Should property label for composite (struct & array) properties be rendered. */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EAA0C,oBAAoB,EAA4B,iBAAiB,EAEpI,MAAM,gBAAgB,CAAC;AAMxB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,wCAAwC;IACxC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EAA0C,oBAAoB,EAA4B,iBAAiB,EAEpI,MAAM,gBAAgB,CAAC;AAMxB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,sDAAsD;IAC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cesContent":["/*---------------------------------------------------------------------------------------------\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 Properties\n */\n\nimport {\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\n SuppressLabelEditorParams,\n} from \"./EditorParams\";\nimport { StandardEditorNames } from \"./StandardEditorNames\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\n\n// cSpell:ignore Picklist\n\n/**\n * Information about an enumeration choice\n * @public\n */\nexport interface EnumerationChoice {\n label: string;\n value: string | number;\n}\n\n/**\n * Information about a set of enumeration choices\n * @public\n */\nexport interface EnumerationChoicesInfo {\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\n isStrict?: boolean;\n maxDisplayedRows?: number;\n}\n\n/**\n * Property renderer identification and customization attributes\n * @public\n */\nexport interface PropertyRendererInfo {\n name: string;\n}\n\n/**\n * Information about a Property Editor\n * @public\n */\nexport interface PropertyEditorInfo {\n /** Editor name used in addition to the typename to find the registered property editor */\n name?: string;\n /** Editor params provided to the property editor */\n params?: PropertyEditorParams[];\n}\n\n/**\n * Information about a Property Converter\n * @public\n */\nexport interface PropertyConverterInfo {\n /** Converter name used in addition to the typename to find the registered property converter */\n name?: string;\n /** map of options for type converter */\n options?: { [key: string]: any };\n}\n\n/**\n * [[PropertyDescription]] contains metadata about a Property\n * @public\n */\nexport interface PropertyDescription {\n /** Name of the property description */\n name: string;\n /** Display label for the property description */\n displayLabel: string;\n /** Type name used to determine applicable Type Converter and Property Editor */\n typename: string;\n /** Additional information for enumerations */\n enum?: EnumerationChoicesInfo;\n /** Information for property renderer customization */\n renderer?: PropertyRendererInfo;\n /** Information for a property editor */\n editor?: PropertyEditorInfo;\n /** Information for a property converter */\n converter?: PropertyConverterInfo;\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\n * or the full name of a KOQ (schema:koq).\n * @alpha\n */\n quantityType?: string;\n /** Get the custom DataController by this name and register it with the property editor */\n dataController?: string;\n /** Should property label for composite (struct & array) properties be rendered. */\n hideCompositePropertyLabel?: boolean;\n}\n\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\n * @public\n */\nexport class PropertyDescriptionHelper {\n /** Builds a number description with a \"weight-picker\" editor name\n * @public\n */\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.WeightPicker,\n params: additionalParams,\n },\n };\n }\n\n /** Builds an editor that uses [NumberInput]($core-react) control\n * @public\n */\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.Range,\n step: 1,\n precision: 0,\n ...overrideParams,\n } as RangeEditorParams, ...additionalParams];\n\n const editor = {\n name: StandardEditorNames.NumericInput,\n params: editorParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor,\n };\n }\n\n /** Builds a string description\n * @public\n */\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.String,\n editor,\n };\n }\n\n /** Builds an enum description\n * @public\n */\n public static buildEnumPicklistEditorDescription(name: string, label: string,\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = additionalParams.length ? {\n params: additionalParams,\n } : undefined;\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Enum,\n editor,\n enum: {\n choices,\n },\n };\n }\n\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\n * @public\n */\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [\n {\n type: PropertyEditorParamTypes.ColorData,\n colorValues,\n numColumns,\n } as ColorEditorParams,\n ...additionalParams,\n ];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.ColorPicker,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\n * @public\n */\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.Toggle,\n params: additionalParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\n * @public\n */\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.CheckBoxImages,\n imageOff,\n imageOn,\n } as ImageCheckBoxParams, ...additionalParams];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.ImageCheckBox,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\n * @public\n */\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\n * @public\n */\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const defaultParams = {\n type: PropertyEditorParamTypes.SuppressEditorLabel,\n suppressLabelPlaceholder: true,\n } as SuppressLabelEditorParams;\n\n const editor = {\n params: [defaultParams, ...additionalParams],\n };\n\n return {\n name,\n displayLabel: \"\",\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Bumps an enum property description value\n * @public\n */\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\n let choices: EnumerationChoice[] | undefined;\n\n if (description.enum) {\n if (description.enum.choices instanceof Promise) {\n choices = await description.enum.choices;\n } else {\n choices = description.enum.choices;\n }\n }\n\n if (!choices || choices.length === 0)\n return value;\n\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\n if (choiceIndex < 0)\n return value;\n\n choiceIndex++;\n if (choiceIndex >= choices.length)\n choiceIndex = 0;\n\n const newValue = choices[choiceIndex].value;\n return newValue;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iDAGwB;AACxB,+DAA4D;AAC5D,2DAAwD;AAwFxD;;GAEG;AACH,MAAa,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+C,EAAE;QACvH,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,qCAAiB,CAAC,MAAM;YAClC,MAAM,EAAE;gBACN,IAAI,EAAE,yCAAmB,CAAC,YAAY;gBACtC,MAAM,EAAE,gBAAgB;aACzB;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,cAAkC,EAAE,mBAA+C,EAAE;QAC3J,MAAM,YAAY,GAAG,CAAC;gBACpB,IAAI,EAAE,uCAAwB,CAAC,KAAK;gBACpC,IAAI,EAAE,CAAC;gBACP,SAAS,EAAE,CAAC;gBACZ,GAAG,cAAc;aACG,EAAE,GAAG,gBAAgB,CAAC,CAAC;QAE7C,MAAM,MAAM,GAAG;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b,MAAM,EAAE,CAAC,aAAa,EAAE,GAAG,gBAAgB,CAAC;SAC7C,CAAC;QAEF,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE,qCAAiB,CAAC,OAAO;YACnC,MAAM;SACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,WAAgC,EAAE,KAAsB;QAC3F,IAAI,OAAwC,CAAC;QAE7C,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;YACrB,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,YAAY,OAAO,EAAE,CAAC;gBAChD,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAClC,OAAO,KAAK,CAAC;QAEf,IAAI,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACxE,IAAI,WAAW,GAAG,CAAC;YACjB,OAAO,KAAK,CAAC;QAEf,WAAW,EAAE,CAAC;QACd,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM;YAC/B,WAAW,GAAG,CAAC,CAAC;QAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA3MD,8DA2MC","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 Properties\n */\n\nimport {\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\n SuppressLabelEditorParams,\n} from \"./EditorParams\";\nimport { StandardEditorNames } from \"./StandardEditorNames\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\n\n// cSpell:ignore Picklist\n\n/**\n * Information about an enumeration choice\n * @public\n */\nexport interface EnumerationChoice {\n label: string;\n value: string | number;\n}\n\n/**\n * Information about a set of enumeration choices\n * @public\n */\nexport interface EnumerationChoicesInfo {\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\n isStrict?: boolean;\n maxDisplayedRows?: number;\n}\n\n/**\n * Property renderer identification and customization attributes\n * @public\n */\nexport interface PropertyRendererInfo {\n name: string;\n}\n\n/**\n * Information about a Property Editor\n * @public\n */\nexport interface PropertyEditorInfo {\n /** Editor name used in addition to the typename to find the registered property editor */\n name?: string;\n /** Editor params provided to the property editor */\n params?: PropertyEditorParams[];\n}\n\n/**\n * Information about a Property Converter\n * @public\n */\nexport interface PropertyConverterInfo {\n /** Converter name used in addition to the typename to find the registered property converter */\n name?: string;\n /** map of options for type converter */\n options?: { [key: string]: any };\n}\n\n/**\n * [[PropertyDescription]] contains metadata about a Property\n * @public\n */\nexport interface PropertyDescription {\n /** Name of the property description */\n name: string;\n /** Display label for the property description */\n displayLabel: string;\n /** Type name used to determine applicable Type Converter and Property Editor */\n typename: string;\n /** Additional information for enumerations */\n enum?: EnumerationChoicesInfo;\n /** Information for property renderer customization */\n renderer?: PropertyRendererInfo;\n /** Information for a property editor */\n editor?: PropertyEditorInfo;\n /** Information for a property converter */\n converter?: PropertyConverterInfo;\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\n * or the full name of a KOQ (schema:koq).\n * @alpha\n * @deprecated in 5.0. Use `kindOfQuantityName` instead.\n */\n quantityType?: string;\n /** [[KindOfQuantity]] full name used to look up [[FormatProps]]\n * @beta\n */\n kindOfQuantityName?: string;\n /** Get the custom DataController by this name and register it with the property editor */\n dataController?: string;\n /** Should property label for composite (struct & array) properties be rendered. */\n hideCompositePropertyLabel?: boolean;\n}\n\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\n * @public\n */\nexport class PropertyDescriptionHelper {\n /** Builds a number description with a \"weight-picker\" editor name\n * @public\n */\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.WeightPicker,\n params: additionalParams,\n },\n };\n }\n\n /** Builds an editor that uses [NumberInput]($core-react) control\n * @public\n */\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.Range,\n step: 1,\n precision: 0,\n ...overrideParams,\n } as RangeEditorParams, ...additionalParams];\n\n const editor = {\n name: StandardEditorNames.NumericInput,\n params: editorParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor,\n };\n }\n\n /** Builds a string description\n * @public\n */\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.String,\n editor,\n };\n }\n\n /** Builds an enum description\n * @public\n */\n public static buildEnumPicklistEditorDescription(name: string, label: string,\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = additionalParams.length ? {\n params: additionalParams,\n } : undefined;\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Enum,\n editor,\n enum: {\n choices,\n },\n };\n }\n\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\n * @public\n */\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [\n {\n type: PropertyEditorParamTypes.ColorData,\n colorValues,\n numColumns,\n } as ColorEditorParams,\n ...additionalParams,\n ];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.ColorPicker,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\n * @public\n */\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.Toggle,\n params: additionalParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\n * @public\n */\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.CheckBoxImages,\n imageOff,\n imageOn,\n } as ImageCheckBoxParams, ...additionalParams];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.ImageCheckBox,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\n * @public\n */\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\n * @public\n */\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const defaultParams = {\n type: PropertyEditorParamTypes.SuppressEditorLabel,\n suppressLabelPlaceholder: true,\n } as SuppressLabelEditorParams;\n\n const editor = {\n params: [defaultParams, ...additionalParams],\n };\n\n return {\n name,\n displayLabel: \"\",\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Bumps an enum property description value\n * @public\n */\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\n let choices: EnumerationChoice[] | undefined;\n\n if (description.enum) {\n if (description.enum.choices instanceof Promise) {\n choices = await description.enum.choices;\n } else {\n choices = description.enum.choices;\n }\n }\n\n if (!choices || choices.length === 0)\n return value;\n\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\n if (choiceIndex < 0)\n return value;\n\n choiceIndex++;\n if (choiceIndex >= choices.length)\n choiceIndex = 0;\n\n const newValue = choices[choiceIndex].value;\n return newValue;\n }\n}\n"]}
|
@@ -12,12 +12,12 @@ export declare abstract class BaseQuantityDescription implements PropertyDescrip
|
|
12
12
|
displayLabel: string;
|
13
13
|
typename: string;
|
14
14
|
editor: PropertyEditorInfo;
|
15
|
-
|
15
|
+
kindOfQuantityName?: string;
|
16
|
+
constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string);
|
16
17
|
protected abstract formatValue(numberValue: number): string;
|
17
18
|
format: (numberValue: number) => string;
|
18
19
|
protected abstract parseString(userInput: string): ParseResults;
|
19
20
|
parse: (userInput: string) => ParseResults;
|
20
|
-
abstract get quantityType(): string;
|
21
21
|
abstract get parseError(): string;
|
22
22
|
}
|
23
23
|
//# sourceMappingURL=BaseQuantityDescription.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseQuantityDescription.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAiD,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAInI;;;GAGG;AACH,8BAAsB,uBAAwB,YAAW,mBAAmB;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"BaseQuantityDescription.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAiD,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAInI;;;GAGG;AACH,8BAAsB,uBAAwB,YAAW,mBAAmB;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;gBAGvB,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAyB9F,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAEpD,MAAM,gBAAiB,MAAM,KAAG,MAAM,CAE3C;IACF,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAExD,KAAK,cAAe,MAAM,KAAG,YAAY,CAE9C;IAEF,aAAoB,UAAU,IAAI,MAAM,CAAC;CAE1C"}
|
@@ -20,9 +20,11 @@ class BaseQuantityDescription {
|
|
20
20
|
displayLabel;
|
21
21
|
typename;
|
22
22
|
editor;
|
23
|
-
|
23
|
+
kindOfQuantityName;
|
24
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
24
25
|
this.name = name;
|
25
26
|
this.displayLabel = displayLabel;
|
27
|
+
this.kindOfQuantityName = kindOfQuantityName;
|
26
28
|
this.typename = StandardTypeNames_1.StandardTypeNames.Number;
|
27
29
|
this.editor = {
|
28
30
|
name: StandardEditorNames_1.StandardEditorNames.NumberCustom,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6DAAmI;AACnI,uEAAoE;AACpE,2EAAwE;AAExE;;;GAGG;AACH,MAAsB,uBAAuB;IACpC,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,QAAQ,CAAS;IACjB,MAAM,CAAqB;
|
1
|
+
{"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,6DAAmI;AACnI,uEAAoE;AACpE,2EAAwE;AAExE;;;GAGG;AACH,MAAsB,uBAAuB;IACpC,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,QAAQ,CAAS;IACjB,MAAM,CAAqB;IAC3B,kBAAkB,CAAU;IAGnC,YAAY,IAAY,EAAE,YAAoB,EAAE,QAAiB,EAAE,kBAA2B;QAC5F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,qCAAiB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,yCAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,uCAAwB,CAAC,qBAAqB;oBACpD,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,aAAa,EAAE,IAAI,CAAC,KAAK;iBACK;aAC/B;SACF,CAAC;QAEF,uBAAuB;QACvB,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAqB;gBAC/B,IAAI,EAAE,uCAAwB,CAAC,IAAI;gBACnC,UAAU,EAAE,EAAE,QAAQ,EAAE;aACzB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,MAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAIM,MAAM,GAAG,CAAC,WAAmB,EAAU,EAAE;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC;IAGK,KAAK,GAAG,CAAC,SAAiB,EAAgB,EAAE;QACjD,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC;CAIH;AA9CD,0DA8CC","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 Properties\n */\n\nimport { PropertyDescription, PropertyEditorInfo } from \"../properties/Description\";\nimport { CustomFormattedNumberParams, IconEditorParams, ParseResults, PropertyEditorParamTypes } from \"../properties/EditorParams\";\nimport { StandardTypeNames } from \"../properties/StandardTypeNames\";\nimport { StandardEditorNames } from \"../properties/StandardEditorNames\";\n\n/**\n * Base Quantity Property Description\n * @beta\n */\nexport abstract class BaseQuantityDescription implements PropertyDescription {\n public name: string;\n public displayLabel: string;\n public typename: string;\n public editor: PropertyEditorInfo;\n public kindOfQuantityName?: string;\n\n\n constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string) {\n this.name = name;\n this.displayLabel = displayLabel;\n this.kindOfQuantityName = kindOfQuantityName;\n this.typename = StandardTypeNames.Number;\n this.editor = {\n name: StandardEditorNames.NumberCustom,\n params: [{\n type: PropertyEditorParamTypes.CustomFormattedNumber,\n formatFunction: this.format,\n parseFunction: this.parse,\n } as CustomFormattedNumberParams,\n ],\n };\n\n // istanbul ignore else\n if (iconSpec) {\n const params: IconEditorParams = {\n type: PropertyEditorParamTypes.Icon,\n definition: { iconSpec },\n };\n this.editor.params!.push(params);\n }\n }\n\n protected abstract formatValue(numberValue: number): string;\n\n public format = (numberValue: number): string => {\n return this.formatValue(numberValue);\n };\n protected abstract parseString(userInput: string): ParseResults;\n\n public parse = (userInput: string): ParseResults => {\n return this.parseString(userInput);\n };\n\n public abstract get parseError(): string;\n\n}\n"]}
|
@@ -70,8 +70,13 @@ export interface PropertyDescription {
|
|
70
70
|
/** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool
|
71
71
|
* or the full name of a KOQ (schema:koq).
|
72
72
|
* @alpha
|
73
|
+
* @deprecated in 5.0. Use `kindOfQuantityName` instead.
|
73
74
|
*/
|
74
75
|
quantityType?: string;
|
76
|
+
/** [[KindOfQuantity]] full name used to look up [[FormatProps]]
|
77
|
+
* @beta
|
78
|
+
*/
|
79
|
+
kindOfQuantityName?: string;
|
75
80
|
/** Get the custom DataController by this name and register it with the property editor */
|
76
81
|
dataController?: string;
|
77
82
|
/** Should property label for composite (struct & array) properties be rendered. */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EAA0C,oBAAoB,EAA4B,iBAAiB,EAEpI,MAAM,gBAAgB,CAAC;AAMxB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,wCAAwC;IACxC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EAA0C,oBAAoB,EAA4B,iBAAiB,EAEpI,MAAM,gBAAgB,CAAC;AAMxB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAG,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;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OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;CAyBzH"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACmF,wBAAwB,GAEjH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAmFxD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+C,EAAE;QACvH,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,iBAAiB,CAAC,MAAM;YAClC,MAAM,EAAE;gBACN,IAAI,EAAE,mBAAmB,CAAC,YAAY;gBACtC,MAAM,EAAE,gBAAgB;aACzB;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,cAAkC,EAAE,mBAA+C,EAAE;QAC3J,MAAM,YAAY,GAAG,CAAC;gBACpB,IAAI,EAAE,wBAAwB,CAAC,KAAK;gBACpC,IAAI,EAAE,CAAC;gBACP,SAAS,EAAE,CAAC;gBACZ,GAAG,cAAc;aACG,EAAE,GAAG,gBAAgB,CAAC,CAAC;QAE7C,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,mBAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,YAAY;SACrB,CAAC;QAEF,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,iBAAiB,CAAC,MAAM;YAClC,MAAM;SACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,0BAA0B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+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F,IAAI,OAAwC,CAAC;QAE7C,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;YACrB,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,YAAY,OAAO,EAAE,CAAC;gBAChD,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAClC,OAAO,KAAK,CAAC;QAEf,IAAI,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACxE,IAAI,WAAW,GAAG,CAAC;YACjB,OAAO,KAAK,CAAC;QAEf,WAAW,EAAE,CAAC;QACd,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM;YAC/B,WAAW,GAAG,CAAC,CAAC;QAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","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 Properties\n */\n\nimport {\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\n SuppressLabelEditorParams,\n} from \"./EditorParams\";\nimport { StandardEditorNames } from \"./StandardEditorNames\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\n\n// cSpell:ignore Picklist\n\n/**\n * Information about an enumeration choice\n * @public\n */\nexport interface EnumerationChoice {\n label: string;\n value: string | number;\n}\n\n/**\n * Information about a set of enumeration choices\n * @public\n */\nexport interface EnumerationChoicesInfo {\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\n isStrict?: boolean;\n maxDisplayedRows?: number;\n}\n\n/**\n * Property renderer identification and customization attributes\n * @public\n */\nexport interface PropertyRendererInfo {\n name: string;\n}\n\n/**\n * Information about a Property Editor\n * @public\n */\nexport interface PropertyEditorInfo {\n /** Editor name used in addition to the typename to find the registered property editor */\n name?: string;\n /** Editor params provided to the property editor */\n params?: PropertyEditorParams[];\n}\n\n/**\n * Information about a Property Converter\n * @public\n */\nexport interface PropertyConverterInfo {\n /** Converter name used in addition to the typename to find the registered property converter */\n name?: string;\n /** map of options for type converter */\n options?: { [key: string]: any };\n}\n\n/**\n * [[PropertyDescription]] contains metadata about a Property\n * @public\n */\nexport interface PropertyDescription {\n /** Name of the property description */\n name: string;\n /** Display label for the property description */\n displayLabel: string;\n /** Type name used to determine applicable Type Converter and Property Editor */\n typename: string;\n /** Additional information for enumerations */\n enum?: EnumerationChoicesInfo;\n /** Information for property renderer customization */\n renderer?: PropertyRendererInfo;\n /** Information for a property editor */\n editor?: PropertyEditorInfo;\n /** Information for a property converter */\n converter?: PropertyConverterInfo;\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\n * or the full name of a KOQ (schema:koq).\n * @alpha\n */\n quantityType?: string;\n /** Get the custom DataController by this name and register it with the property editor */\n dataController?: string;\n /** Should property label for composite (struct & array) properties be rendered. */\n hideCompositePropertyLabel?: boolean;\n}\n\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\n * @public\n */\nexport class PropertyDescriptionHelper {\n /** Builds a number description with a \"weight-picker\" editor name\n * @public\n */\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.WeightPicker,\n params: additionalParams,\n },\n };\n }\n\n /** Builds an editor that uses [NumberInput]($core-react) control\n * @public\n */\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.Range,\n step: 1,\n precision: 0,\n ...overrideParams,\n } as RangeEditorParams, ...additionalParams];\n\n const editor = {\n name: StandardEditorNames.NumericInput,\n params: editorParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor,\n };\n }\n\n /** Builds a string description\n * @public\n */\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.String,\n editor,\n };\n }\n\n /** Builds an enum description\n * @public\n */\n public static buildEnumPicklistEditorDescription(name: string, label: string,\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = additionalParams.length ? {\n params: additionalParams,\n } : undefined;\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Enum,\n editor,\n enum: {\n choices,\n },\n };\n }\n\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\n * @public\n */\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [\n {\n type: PropertyEditorParamTypes.ColorData,\n colorValues,\n numColumns,\n } as ColorEditorParams,\n ...additionalParams,\n ];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.ColorPicker,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\n * @public\n */\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.Toggle,\n params: additionalParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\n * @public\n */\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.CheckBoxImages,\n imageOff,\n imageOn,\n } as ImageCheckBoxParams, ...additionalParams];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.ImageCheckBox,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\n * @public\n */\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\n * @public\n */\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const defaultParams = {\n type: PropertyEditorParamTypes.SuppressEditorLabel,\n suppressLabelPlaceholder: true,\n } as SuppressLabelEditorParams;\n\n const editor = {\n params: [defaultParams, ...additionalParams],\n };\n\n return {\n name,\n displayLabel: \"\",\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Bumps an enum property description value\n * @public\n */\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\n let choices: EnumerationChoice[] | undefined;\n\n if (description.enum) {\n if (description.enum.choices instanceof Promise) {\n choices = await description.enum.choices;\n } else {\n choices = description.enum.choices;\n }\n }\n\n if (!choices || choices.length === 0)\n return value;\n\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\n if (choiceIndex < 0)\n return value;\n\n choiceIndex++;\n if (choiceIndex >= choices.length)\n choiceIndex = 0;\n\n const newValue = choices[choiceIndex].value;\n return newValue;\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACmF,wBAAwB,GAEjH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAwFxD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+C,EAAE;QACvH,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,iBAAiB,CAAC,MAAM;YAClC,MAAM,EAAE;gBACN,IAAI,EAAE,mBAAmB,CAAC,YAAY;gBACtC,MAAM,EAAE,gBAAgB;aACzB;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,cAAkC,EAAE,mBAA+C,EAAE;QAC3J,MAAM,YAAY,GAAG,CAAC;gBACpB,IAAI,EAAE,wBAAwB,CAAC,KAAK;gBACpC,IAAI,EAAE,CAAC;gBACP,SAAS,EAAE,CAAC;gBACZ,GAAG,cAAc;aACG,EAAE,GAAG,gBAAgB,CAAC,CAAC;QAE7C,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,mBAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,YAAY;SACrB,CAAC;QAEF,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,iBAAiB,CAAC,MAAM;YAClC,MAAM;SACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,0BAA0B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+C,EAAE;QACrH,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,gBAAgB;SACzB,CAAC;QAEF,OAAO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W,CAAC,IAAI,CAAC,OAAO,YAAY,OAAO,EAAE,CAAC;gBAChD,OAAO,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAClC,OAAO,KAAK,CAAC;QAEf,IAAI,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACxE,IAAI,WAAW,GAAG,CAAC;YACjB,OAAO,KAAK,CAAC;QAEf,WAAW,EAAE,CAAC;QACd,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM;YAC/B,WAAW,GAAG,CAAC,CAAC;QAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","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 Properties\n */\n\nimport {\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\n SuppressLabelEditorParams,\n} from \"./EditorParams\";\nimport { StandardEditorNames } from \"./StandardEditorNames\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\n\n// cSpell:ignore Picklist\n\n/**\n * Information about an enumeration choice\n * @public\n */\nexport interface EnumerationChoice {\n label: string;\n value: string | number;\n}\n\n/**\n * Information about a set of enumeration choices\n * @public\n */\nexport interface EnumerationChoicesInfo {\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\n isStrict?: boolean;\n maxDisplayedRows?: number;\n}\n\n/**\n * Property renderer identification and customization attributes\n * @public\n */\nexport interface PropertyRendererInfo {\n name: string;\n}\n\n/**\n * Information about a Property Editor\n * @public\n */\nexport interface PropertyEditorInfo {\n /** Editor name used in addition to the typename to find the registered property editor */\n name?: string;\n /** Editor params provided to the property editor */\n params?: PropertyEditorParams[];\n}\n\n/**\n * Information about a Property Converter\n * @public\n */\nexport interface PropertyConverterInfo {\n /** Converter name used in addition to the typename to find the registered property converter */\n name?: string;\n /** map of options for type converter */\n options?: { [key: string]: any };\n}\n\n/**\n * [[PropertyDescription]] contains metadata about a Property\n * @public\n */\nexport interface PropertyDescription {\n /** Name of the property description */\n name: string;\n /** Display label for the property description */\n displayLabel: string;\n /** Type name used to determine applicable Type Converter and Property Editor */\n typename: string;\n /** Additional information for enumerations */\n enum?: EnumerationChoicesInfo;\n /** Information for property renderer customization */\n renderer?: PropertyRendererInfo;\n /** Information for a property editor */\n editor?: PropertyEditorInfo;\n /** Information for a property converter */\n converter?: PropertyConverterInfo;\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\n * or the full name of a KOQ (schema:koq).\n * @alpha\n * @deprecated in 5.0. Use `kindOfQuantityName` instead.\n */\n quantityType?: string;\n /** [[KindOfQuantity]] full name used to look up [[FormatProps]]\n * @beta\n */\n kindOfQuantityName?: string;\n /** Get the custom DataController by this name and register it with the property editor */\n dataController?: string;\n /** Should property label for composite (struct & array) properties be rendered. */\n hideCompositePropertyLabel?: boolean;\n}\n\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\n * @public\n */\nexport class PropertyDescriptionHelper {\n /** Builds a number description with a \"weight-picker\" editor name\n * @public\n */\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.WeightPicker,\n params: additionalParams,\n },\n };\n }\n\n /** Builds an editor that uses [NumberInput]($core-react) control\n * @public\n */\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.Range,\n step: 1,\n precision: 0,\n ...overrideParams,\n } as RangeEditorParams, ...additionalParams];\n\n const editor = {\n name: StandardEditorNames.NumericInput,\n params: editorParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor,\n };\n }\n\n /** Builds a string description\n * @public\n */\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.String,\n editor,\n };\n }\n\n /** Builds an enum description\n * @public\n */\n public static buildEnumPicklistEditorDescription(name: string, label: string,\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = additionalParams.length ? {\n params: additionalParams,\n } : undefined;\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Enum,\n editor,\n enum: {\n choices,\n },\n };\n }\n\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\n * @public\n */\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [\n {\n type: PropertyEditorParamTypes.ColorData,\n colorValues,\n numColumns,\n } as ColorEditorParams,\n ...additionalParams,\n ];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.ColorPicker,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\n * @public\n */\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.Toggle,\n params: additionalParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\n * @public\n */\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.CheckBoxImages,\n imageOff,\n imageOn,\n } as ImageCheckBoxParams, ...additionalParams];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.ImageCheckBox,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\n * @public\n */\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\n * @public\n */\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const defaultParams = {\n type: PropertyEditorParamTypes.SuppressEditorLabel,\n suppressLabelPlaceholder: true,\n } as SuppressLabelEditorParams;\n\n const editor = {\n params: [defaultParams, ...additionalParams],\n };\n\n return {\n name,\n displayLabel: \"\",\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Bumps an enum property description value\n * @public\n */\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\n let choices: EnumerationChoice[] | undefined;\n\n if (description.enum) {\n if (description.enum.choices instanceof Promise) {\n choices = await description.enum.choices;\n } else {\n choices = description.enum.choices;\n }\n }\n\n if (!choices || choices.length === 0)\n return value;\n\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\n if (choiceIndex < 0)\n return value;\n\n choiceIndex++;\n if (choiceIndex >= choices.length)\n choiceIndex = 0;\n\n const newValue = choices[choiceIndex].value;\n return newValue;\n }\n}\n"]}
|
@@ -12,12 +12,12 @@ export declare abstract class BaseQuantityDescription implements PropertyDescrip
|
|
12
12
|
displayLabel: string;
|
13
13
|
typename: string;
|
14
14
|
editor: PropertyEditorInfo;
|
15
|
-
|
15
|
+
kindOfQuantityName?: string;
|
16
|
+
constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string);
|
16
17
|
protected abstract formatValue(numberValue: number): string;
|
17
18
|
format: (numberValue: number) => string;
|
18
19
|
protected abstract parseString(userInput: string): ParseResults;
|
19
20
|
parse: (userInput: string) => ParseResults;
|
20
|
-
abstract get quantityType(): string;
|
21
21
|
abstract get parseError(): string;
|
22
22
|
}
|
23
23
|
//# sourceMappingURL=BaseQuantityDescription.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseQuantityDescription.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAiD,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAInI;;;GAGG;AACH,8BAAsB,uBAAwB,YAAW,mBAAmB;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"BaseQuantityDescription.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAiD,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAInI;;;GAGG;AACH,8BAAsB,uBAAwB,YAAW,mBAAmB;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;gBAGvB,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAyB9F,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAEpD,MAAM,gBAAiB,MAAM,KAAG,MAAM,CAE3C;IACF,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAExD,KAAK,cAAe,MAAM,KAAG,YAAY,CAE9C;IAEF,aAAoB,UAAU,IAAI,MAAM,CAAC;CAE1C"}
|
@@ -17,9 +17,11 @@ export class BaseQuantityDescription {
|
|
17
17
|
displayLabel;
|
18
18
|
typename;
|
19
19
|
editor;
|
20
|
-
|
20
|
+
kindOfQuantityName;
|
21
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
21
22
|
this.name = name;
|
22
23
|
this.displayLabel = displayLabel;
|
24
|
+
this.kindOfQuantityName = kindOfQuantityName;
|
23
25
|
this.typename = StandardTypeNames.Number;
|
24
26
|
this.editor = {
|
25
27
|
name: StandardEditorNames.NumberCustom,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA+D,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,OAAgB,uBAAuB;IACpC,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,QAAQ,CAAS;IACjB,MAAM,CAAqB;
|
1
|
+
{"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA+D,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,OAAgB,uBAAuB;IACpC,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,QAAQ,CAAS;IACjB,MAAM,CAAqB;IAC3B,kBAAkB,CAAU;IAGnC,YAAY,IAAY,EAAE,YAAoB,EAAE,QAAiB,EAAE,kBAA2B;QAC5F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,mBAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,wBAAwB,CAAC,qBAAqB;oBACpD,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,aAAa,EAAE,IAAI,CAAC,KAAK;iBACK;aAC/B;SACF,CAAC;QAEF,uBAAuB;QACvB,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAqB;gBAC/B,IAAI,EAAE,wBAAwB,CAAC,IAAI;gBACnC,UAAU,EAAE,EAAE,QAAQ,EAAE;aACzB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,MAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAIM,MAAM,GAAG,CAAC,WAAmB,EAAU,EAAE;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC;IAGK,KAAK,GAAG,CAAC,SAAiB,EAAgB,EAAE;QACjD,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC;CAIH","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 Properties\n */\n\nimport { PropertyDescription, PropertyEditorInfo } from \"../properties/Description\";\nimport { CustomFormattedNumberParams, IconEditorParams, ParseResults, PropertyEditorParamTypes } from \"../properties/EditorParams\";\nimport { StandardTypeNames } from \"../properties/StandardTypeNames\";\nimport { StandardEditorNames } from \"../properties/StandardEditorNames\";\n\n/**\n * Base Quantity Property Description\n * @beta\n */\nexport abstract class BaseQuantityDescription implements PropertyDescription {\n public name: string;\n public displayLabel: string;\n public typename: string;\n public editor: PropertyEditorInfo;\n public kindOfQuantityName?: string;\n\n\n constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string) {\n this.name = name;\n this.displayLabel = displayLabel;\n this.kindOfQuantityName = kindOfQuantityName;\n this.typename = StandardTypeNames.Number;\n this.editor = {\n name: StandardEditorNames.NumberCustom,\n params: [{\n type: PropertyEditorParamTypes.CustomFormattedNumber,\n formatFunction: this.format,\n parseFunction: this.parse,\n } as CustomFormattedNumberParams,\n ],\n };\n\n // istanbul ignore else\n if (iconSpec) {\n const params: IconEditorParams = {\n type: PropertyEditorParamTypes.Icon,\n definition: { iconSpec },\n };\n this.editor.params!.push(params);\n }\n }\n\n protected abstract formatValue(numberValue: number): string;\n\n public format = (numberValue: number): string => {\n return this.formatValue(numberValue);\n };\n protected abstract parseString(userInput: string): ParseResults;\n\n public parse = (userInput: string): ParseResults => {\n return this.parseString(userInput);\n };\n\n public abstract get parseError(): string;\n\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@itwin/appui-abstract",
|
3
|
-
"version": "5.1.0-dev.
|
3
|
+
"version": "5.1.0-dev.17",
|
4
4
|
"description": "iTwin.js UI abstractions",
|
5
5
|
"main": "lib/cjs/appui-abstract.js",
|
6
6
|
"module": "lib/esm/appui-abstract.js",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"url": "http://www.bentley.com"
|
23
23
|
},
|
24
24
|
"peerDependencies": {
|
25
|
-
"@itwin/core-bentley": "5.1.0-dev.
|
25
|
+
"@itwin/core-bentley": "5.1.0-dev.17"
|
26
26
|
},
|
27
27
|
"//devDependencies": [
|
28
28
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
@@ -48,9 +48,9 @@
|
|
48
48
|
"source-map-loader": "^5.0.0",
|
49
49
|
"typescript": "~5.6.2",
|
50
50
|
"webpack": "^5.97.1",
|
51
|
-
"@itwin/build-tools": "5.1.0-dev.
|
52
|
-
"@itwin/
|
53
|
-
"@itwin/
|
51
|
+
"@itwin/build-tools": "5.1.0-dev.17",
|
52
|
+
"@itwin/core-bentley": "5.1.0-dev.17",
|
53
|
+
"@itwin/certa": "5.1.0-dev.17"
|
54
54
|
},
|
55
55
|
"//dependencies": [
|
56
56
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|