@itwin/imodel-components-react 5.3.0 → 5.4.0
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 +13 -1
- package/lib/imodel-components-react/editors/NewWeightEditor.d.ts +10 -0
- package/lib/imodel-components-react/editors/NewWeightEditor.d.ts.map +1 -0
- package/lib/imodel-components-react/editors/NewWeightEditor.js +32 -0
- package/lib/imodel-components-react/editors/NewWeightEditor.js.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityEditor.d.ts +19 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityEditor.d.ts.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityEditor.js +34 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityEditor.js.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityInput.d.ts +15 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityInput.d.ts.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityInput.js +29 -0
- package/lib/imodel-components-react/inputs/new-editors/QuantityInput.js.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.d.ts +15 -0
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.d.ts.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.js +47 -0
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.js.map +1 -0
- package/lib/imodel-components-react.d.ts +2 -0
- package/lib/imodel-components-react.d.ts.map +1 -1
- package/lib/imodel-components-react.js +2 -0
- package/lib/imodel-components-react.js.map +1 -1
- package/package.json +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @itwin/imodel-components-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Apr 2025 09:55:41 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.4.0
|
|
6
|
+
Thu, 17 Apr 2025 09:55:41 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Added Quantity and Weight property editor specifications for the new editors system.
|
|
11
|
+
|
|
12
|
+
## 5.3.1
|
|
13
|
+
Thu, 20 Mar 2025 11:10:28 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
4
16
|
|
|
5
17
|
## 5.3.0
|
|
6
18
|
Fri, 14 Mar 2025 17:37:48 GMT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module PropertyEditors
|
|
3
|
+
*/
|
|
4
|
+
import { type EditorSpec } from "@itwin/components-react";
|
|
5
|
+
/**
|
|
6
|
+
* Editor specification for weight editor.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare const WeightEditorSpec: EditorSpec;
|
|
10
|
+
//# sourceMappingURL=NewWeightEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewWeightEditor.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/editors/NewWeightEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAM7B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module PropertyEditors
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { StandardEditorNames } from "@itwin/appui-abstract";
|
|
10
|
+
import { WeightPickerButton } from "../lineweight/WeightPickerButton.js";
|
|
11
|
+
import { createEditorSpec, ValueUtilities, } from "@itwin/components-react";
|
|
12
|
+
/* v8 ignore start */
|
|
13
|
+
/**
|
|
14
|
+
* Editor specification for weight editor.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export const WeightEditorSpec = createEditorSpec({
|
|
18
|
+
isMetadataSupported: (metadata) => metadata.type === "number" &&
|
|
19
|
+
metadata.preferredEditor === StandardEditorNames.WeightPicker,
|
|
20
|
+
isValueSupported: ValueUtilities.isNumeric,
|
|
21
|
+
Editor: WeightEditor,
|
|
22
|
+
});
|
|
23
|
+
function WeightEditor({ value, onChange, commit, }) {
|
|
24
|
+
const currentValue = value ? value : { rawValue: 0, displayValue: "" };
|
|
25
|
+
return (React.createElement(WeightPickerButton, { activeWeight: currentValue.rawValue ?? 0, onLineWeightPick: (newWeight) => {
|
|
26
|
+
const newValue = { rawValue: newWeight, displayValue: "" };
|
|
27
|
+
onChange(newValue);
|
|
28
|
+
commit?.();
|
|
29
|
+
} }));
|
|
30
|
+
}
|
|
31
|
+
/* v8 ignore stop */
|
|
32
|
+
//# sourceMappingURL=NewWeightEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewWeightEditor.js","sourceRoot":"","sources":["../../../src/imodel-components-react/editors/NewWeightEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EACL,gBAAgB,EAIhB,cAAc,GACf,MAAM,yBAAyB,CAAC;AAEjC,qBAAqB;AAErB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe,gBAAgB,CAAC;IAC3D,mBAAmB,EAAE,CAAC,QAAQ,EAA6B,EAAE,CAC3D,QAAQ,CAAC,IAAI,KAAK,QAAQ;QAC1B,QAAQ,CAAC,eAAe,KAAK,mBAAmB,CAAC,YAAY;IAC/D,gBAAgB,EAAE,cAAc,CAAC,SAAS;IAC1C,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEH,SAAS,YAAY,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,MAAM,GACmC;IACzC,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAEvE,OAAO,CACL,oBAAC,kBAAkB,IACjB,YAAY,EAAE,YAAY,CAAC,QAAQ,IAAI,CAAC,EACxC,gBAAgB,EAAE,CAAC,SAAS,EAAE,EAAE;YAC9B,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;YAC3D,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnB,MAAM,EAAE,EAAE,CAAC;QACb,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAED,oBAAoB","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 PropertyEditors\n */\n\nimport * as React from \"react\";\nimport { StandardEditorNames } from \"@itwin/appui-abstract\";\nimport { WeightPickerButton } from \"../lineweight/WeightPickerButton.js\";\nimport type { ValueMetadata } from \"@itwin/components-react\";\nimport {\n createEditorSpec,\n type EditorProps,\n type EditorSpec,\n type NumericValue,\n ValueUtilities,\n} from \"@itwin/components-react\";\n\n/* v8 ignore start */\n\n/**\n * Editor specification for weight editor.\n * @beta\n */\nexport const WeightEditorSpec: EditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is ValueMetadata =>\n metadata.type === \"number\" &&\n metadata.preferredEditor === StandardEditorNames.WeightPicker,\n isValueSupported: ValueUtilities.isNumeric,\n Editor: WeightEditor,\n});\n\nfunction WeightEditor({\n value,\n onChange,\n commit,\n}: EditorProps<ValueMetadata, NumericValue>) {\n const currentValue = value ? value : { rawValue: 0, displayValue: \"\" };\n\n return (\n <WeightPickerButton\n activeWeight={currentValue.rawValue ?? 0}\n onLineWeightPick={(newWeight) => {\n const newValue = { rawValue: newWeight, displayValue: \"\" };\n onChange(newValue);\n commit?.();\n }}\n />\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module PropertyEditors
|
|
3
|
+
*/
|
|
4
|
+
import { type QuantityTypeArg } from "@itwin/core-frontend";
|
|
5
|
+
import { type EditorSpec, type ValueMetadata } from "@itwin/components-react";
|
|
6
|
+
/**
|
|
7
|
+
* Editor specification for quantity values based on `IModelApp.quantityFormatter`.
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare const QuantityEditorSpec: EditorSpec;
|
|
11
|
+
/**
|
|
12
|
+
* Metadata for quantity values.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
export interface QuantityValueMetadata extends ValueMetadata {
|
|
16
|
+
type: "number";
|
|
17
|
+
quantityType: QuantityTypeArg;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=QuantityEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuantityEditor.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/QuantityEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAGL,KAAK,UAAU,EAEf,KAAK,aAAa,EAEnB,MAAM,yBAAyB,CAAC;AAKjC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAO/B,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module PropertyEditors
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { useQuantityInfo } from "./UseQuantityInfo.js";
|
|
10
|
+
import { createEditorSpec, ValueUtilities, } from "@itwin/components-react";
|
|
11
|
+
import { QuantityInput } from "./QuantityInput.js";
|
|
12
|
+
/* v8 ignore start */
|
|
13
|
+
/**
|
|
14
|
+
* Editor specification for quantity values based on `IModelApp.quantityFormatter`.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
export const QuantityEditorSpec = createEditorSpec({
|
|
18
|
+
isMetadataSupported: (metadata) => metadata.type === "number" &&
|
|
19
|
+
"quantityType" in metadata &&
|
|
20
|
+
metadata.quantityType !== undefined,
|
|
21
|
+
isValueSupported: ValueUtilities.isNumeric,
|
|
22
|
+
Editor: QuantityEditor,
|
|
23
|
+
});
|
|
24
|
+
function QuantityEditor({ metadata, value, onChange, size, }) {
|
|
25
|
+
const { formatter, parser } = useQuantityInfo({
|
|
26
|
+
type: metadata.quantityType,
|
|
27
|
+
});
|
|
28
|
+
const currentValue = value
|
|
29
|
+
? value
|
|
30
|
+
: { rawValue: undefined, displayValue: "" };
|
|
31
|
+
return (React.createElement(QuantityInput, { value: currentValue, onChange: onChange, size: size, formatter: formatter, parser: parser }));
|
|
32
|
+
}
|
|
33
|
+
/* v8 ignore stop */
|
|
34
|
+
//# sourceMappingURL=QuantityEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuantityEditor.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/QuantityEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,gBAAgB,EAKhB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAqB;AAErB;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAe,gBAAgB,CAAC;IAC7D,mBAAmB,EAAE,CAAC,QAAQ,EAAqC,EAAE,CACnE,QAAQ,CAAC,IAAI,KAAK,QAAQ;QAC1B,cAAc,IAAI,QAAQ;QAC1B,QAAQ,CAAC,YAAY,KAAK,SAAS;IACrC,gBAAgB,EAAE,cAAc,CAAC,SAAS;IAC1C,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAWH,SAAS,cAAc,CAAC,EACtB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,GAC6C;IACjD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC;QAC5C,IAAI,EAAE,QAAQ,CAAC,YAAY;KAC5B,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,KAAK;QACxB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAE9C,OAAO,CACL,oBAAC,aAAa,IACZ,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC;AAED,oBAAoB","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 PropertyEditors\n */\n\nimport * as React from \"react\";\nimport { type QuantityTypeArg } from \"@itwin/core-frontend\";\nimport { useQuantityInfo } from \"./UseQuantityInfo.js\";\nimport {\n createEditorSpec,\n type EditorProps,\n type EditorSpec,\n type NumericValue,\n type ValueMetadata,\n ValueUtilities,\n} from \"@itwin/components-react\";\nimport { QuantityInput } from \"./QuantityInput.js\";\n\n/* v8 ignore start */\n\n/**\n * Editor specification for quantity values based on `IModelApp.quantityFormatter`.\n * @beta\n */\nexport const QuantityEditorSpec: EditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is QuantityValueMetadata =>\n metadata.type === \"number\" &&\n \"quantityType\" in metadata &&\n metadata.quantityType !== undefined,\n isValueSupported: ValueUtilities.isNumeric,\n Editor: QuantityEditor,\n});\n\n/**\n * Metadata for quantity values.\n * @beta\n */\nexport interface QuantityValueMetadata extends ValueMetadata {\n type: \"number\";\n quantityType: QuantityTypeArg;\n}\n\nfunction QuantityEditor({\n metadata,\n value,\n onChange,\n size,\n}: EditorProps<QuantityValueMetadata, NumericValue>) {\n const { formatter, parser } = useQuantityInfo({\n type: metadata.quantityType,\n });\n const currentValue = value\n ? value\n : { rawValue: undefined, displayValue: \"\" };\n\n return (\n <QuantityInput\n value={currentValue}\n onChange={onChange}\n size={size}\n formatter={formatter}\n parser={parser}\n />\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormattedNumericInput } from "@itwin/components-react";
|
|
3
|
+
import type { FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
4
|
+
type FormattedNumericInputProps = React.ComponentPropsWithoutRef<typeof FormattedNumericInput>;
|
|
5
|
+
interface QuantityInputProps extends Omit<FormattedNumericInputProps, "parseValue" | "formatValue" | "disabled"> {
|
|
6
|
+
formatter?: FormatterSpec;
|
|
7
|
+
parser?: ParserSpec;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A component that wraps `FormattedNumericInput` and takes a formatter and parser for quantity values.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function QuantityInput({ formatter, parser, ...props }: QuantityInputProps): React.JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=QuantityInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuantityInput.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/QuantityInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAItE,KAAK,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CAC9D,OAAO,qBAAqB,CAC7B,CAAC;AAEF,UAAU,kBACR,SAAQ,IAAI,CACV,0BAA0B,EAC1B,YAAY,GAAG,aAAa,GAAG,UAAU,CAC1C;IACD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAgCpB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { FormattedNumericInput } from "@itwin/components-react";
|
|
7
|
+
/**
|
|
8
|
+
* A component that wraps `FormattedNumericInput` and takes a formatter and parser for quantity values.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function QuantityInput({ formatter, parser, ...props }) {
|
|
12
|
+
const initialValue = React.useRef(props.value);
|
|
13
|
+
const formatValue = React.useCallback((currValue) => {
|
|
14
|
+
if (!formatter) {
|
|
15
|
+
return initialValue.current.displayValue;
|
|
16
|
+
}
|
|
17
|
+
return formatter.applyFormatting(currValue);
|
|
18
|
+
}, [formatter]);
|
|
19
|
+
const parseString = React.useCallback((userInput) => {
|
|
20
|
+
if (!parser) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const parseResult = parser.parseToQuantityValue(userInput);
|
|
24
|
+
return parseResult.ok ? parseResult.value : undefined;
|
|
25
|
+
}, [parser]);
|
|
26
|
+
return (React.createElement(FormattedNumericInput, { ...props, value: props.value, formatValue: formatValue, parseValue: parseString, disabled: !formatter || !parser }));
|
|
27
|
+
}
|
|
28
|
+
/* v8 ignore stop */
|
|
29
|
+
//# sourceMappingURL=QuantityInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuantityInput.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/QuantityInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAkBhE;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACW;IACnB,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,SAAiB,EAAE,EAAE;QACpB,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC;QAC3C,CAAC;QACD,OAAO,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,SAAiB,EAAE,EAAE;QACpB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAC3D,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACxD,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO,CACL,oBAAC,qBAAqB,OAChB,KAAK,EACT,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,WAAW,EACvB,QAAQ,EAAE,CAAC,SAAS,IAAI,CAAC,MAAM,GAC/B,CACH,CAAC;AACJ,CAAC;AAED,oBAAoB","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\nimport * as React from \"react\";\nimport { FormattedNumericInput } from \"@itwin/components-react\";\nimport type { FormatterSpec, ParserSpec } from \"@itwin/core-quantity\";\n\n/* v8 ignore start */\n\ntype FormattedNumericInputProps = React.ComponentPropsWithoutRef<\n typeof FormattedNumericInput\n>;\n\ninterface QuantityInputProps\n extends Omit<\n FormattedNumericInputProps,\n \"parseValue\" | \"formatValue\" | \"disabled\"\n > {\n formatter?: FormatterSpec;\n parser?: ParserSpec;\n}\n\n/**\n * A component that wraps `FormattedNumericInput` and takes a formatter and parser for quantity values.\n * @internal\n */\nexport function QuantityInput({\n formatter,\n parser,\n ...props\n}: QuantityInputProps) {\n const initialValue = React.useRef(props.value);\n const formatValue = React.useCallback(\n (currValue: number) => {\n if (!formatter) {\n return initialValue.current.displayValue;\n }\n return formatter.applyFormatting(currValue);\n },\n [formatter]\n );\n\n const parseString = React.useCallback(\n (userInput: string) => {\n if (!parser) {\n return undefined;\n }\n const parseResult = parser.parseToQuantityValue(userInput);\n return parseResult.ok ? parseResult.value : undefined;\n },\n [parser]\n );\n\n return (\n <FormattedNumericInput\n {...props}\n value={props.value}\n formatValue={formatValue}\n parseValue={parseString}\n disabled={!formatter || !parser}\n />\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QuantityTypeArg } from "@itwin/core-frontend";
|
|
2
|
+
import type { FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
3
|
+
interface UseQuantityInfoProps {
|
|
4
|
+
type: QuantityTypeArg | undefined;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Hook that finds the formatter and parser in `IModelApp.quantityFormatter` for a given quantity type.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function useQuantityInfo({ type }: UseQuantityInfoProps): {
|
|
11
|
+
formatter: FormatterSpec | undefined;
|
|
12
|
+
parser: ParserSpec | undefined;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=UseQuantityInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseQuantityInfo.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKtE,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAoB;;;EAiD7D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
/**
|
|
8
|
+
* Hook that finds the formatter and parser in `IModelApp.quantityFormatter` for a given quantity type.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function useQuantityInfo({ type }) {
|
|
12
|
+
const [{ formatter, parser }, setState] = React.useState(() => ({
|
|
13
|
+
formatter: undefined,
|
|
14
|
+
parser: undefined,
|
|
15
|
+
}));
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (type === undefined) {
|
|
18
|
+
setState({
|
|
19
|
+
formatter: undefined,
|
|
20
|
+
parser: undefined,
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const loadFormatterParser = () => {
|
|
25
|
+
const formatterSpec = IModelApp.quantityFormatter.findFormatterSpecByQuantityType(type);
|
|
26
|
+
const parserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(type);
|
|
27
|
+
setState({ formatter: formatterSpec, parser: parserSpec });
|
|
28
|
+
};
|
|
29
|
+
loadFormatterParser();
|
|
30
|
+
const removeListeners = [
|
|
31
|
+
IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(loadFormatterParser),
|
|
32
|
+
IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(({ quantityType }) => {
|
|
33
|
+
if (quantityType === type) {
|
|
34
|
+
loadFormatterParser();
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
];
|
|
38
|
+
return () => {
|
|
39
|
+
removeListeners.forEach((remove) => {
|
|
40
|
+
remove();
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}, [type]);
|
|
44
|
+
return { formatter, parser };
|
|
45
|
+
}
|
|
46
|
+
/* v8 ignore stop */
|
|
47
|
+
//# sourceMappingURL=UseQuantityInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UseQuantityInfo.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAwB;IAC5D,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAGrD,GAAG,EAAE,CAAC,CAAC;QACR,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,QAAQ,CAAC;gBACP,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,mBAAmB,GAAG,GAAG,EAAE;YAC/B,MAAM,aAAa,GACjB,SAAS,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;YACpE,MAAM,UAAU,GACd,SAAS,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;YAEjE,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QAC7D,CAAC,CAAC;QAEF,mBAAmB,EAAE,CAAC;QACtB,MAAM,eAAe,GAAG;YACtB,SAAS,CAAC,iBAAiB,CAAC,mCAAmC,CAAC,WAAW,CACzE,mBAAmB,CACpB;YACD,SAAS,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,WAAW,CAC9D,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;gBACnB,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;oBAC1B,mBAAmB,EAAE,CAAC;gBACxB,CAAC;YACH,CAAC,CACF;SACF,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACjC,MAAM,EAAE,CAAC;YACX,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC;AAED,oBAAoB","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\nimport type { QuantityTypeArg } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { FormatterSpec, ParserSpec } from \"@itwin/core-quantity\";\nimport * as React from \"react\";\n\n/* v8 ignore start */\n\ninterface UseQuantityInfoProps {\n type: QuantityTypeArg | undefined;\n}\n\n/**\n * Hook that finds the formatter and parser in `IModelApp.quantityFormatter` for a given quantity type.\n * @internal\n */\nexport function useQuantityInfo({ type }: UseQuantityInfoProps) {\n const [{ formatter, parser }, setState] = React.useState<{\n formatter: FormatterSpec | undefined;\n parser: ParserSpec | undefined;\n }>(() => ({\n formatter: undefined,\n parser: undefined,\n }));\n\n React.useEffect(() => {\n if (type === undefined) {\n setState({\n formatter: undefined,\n parser: undefined,\n });\n return;\n }\n\n const loadFormatterParser = () => {\n const formatterSpec =\n IModelApp.quantityFormatter.findFormatterSpecByQuantityType(type);\n const parserSpec =\n IModelApp.quantityFormatter.findParserSpecByQuantityType(type);\n\n setState({ formatter: formatterSpec, parser: parserSpec });\n };\n\n loadFormatterParser();\n const removeListeners = [\n IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(\n loadFormatterParser\n ),\n IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(\n ({ quantityType }) => {\n if (quantityType === type) {\n loadFormatterParser();\n }\n }\n ),\n ];\n\n return () => {\n removeListeners.forEach((remove) => {\n remove();\n });\n };\n }, [type]);\n\n return { formatter, parser };\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -8,8 +8,10 @@ export { SaturationPicker, SaturationPickerProps, } from "./imodel-components-re
|
|
|
8
8
|
export { ColorSwatch, ColorSwatchProps, } from "./imodel-components-react/color/Swatch.js";
|
|
9
9
|
export { ColorEditor, ColorPropertyEditor, } from "./imodel-components-react/editors/ColorEditor.js";
|
|
10
10
|
export { WeightEditor, WeightPropertyEditor, } from "./imodel-components-react/editors/WeightEditor.js";
|
|
11
|
+
export { WeightEditorSpec } from "./imodel-components-react/editors/NewWeightEditor.js";
|
|
11
12
|
export { QuantityInput, QuantityProps, } from "./imodel-components-react/inputs/QuantityInput.js";
|
|
12
13
|
export { QuantityNumberInput, QuantityNumberInputProps, StepFunctionProp, } from "./imodel-components-react/inputs/QuantityNumberInput.js";
|
|
14
|
+
export { QuantityEditorSpec } from "./imodel-components-react/inputs/new-editors/QuantityEditor.js";
|
|
13
15
|
export { LineWeightSwatch, LineWeightSwatchProps, } from "./imodel-components-react/lineweight/Swatch.js";
|
|
14
16
|
export { WeightPickerButton, WeightPickerProps, } from "./imodel-components-react/lineweight/WeightPickerButton.js";
|
|
15
17
|
export { Cube, CubeProps, Face, } from "./imodel-components-react/navigationaids/Cube.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,cAAc,GACf,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,cAAc,GACf,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAA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E,CAAC;AAEzE,OAAO,EACL,8BAA8B,EAC9B,gBAAgB,EAChB,6BAA6B,EAC7B,iBAAiB,EACjB,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,GACd,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gEAAgE,CAAC;AAC1G,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,aAAa,GACd,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAsB3E;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
|
@@ -13,8 +13,10 @@ export { SaturationPicker, } from "./imodel-components-react/color/SaturationPic
|
|
|
13
13
|
export { ColorSwatch, } from "./imodel-components-react/color/Swatch.js";
|
|
14
14
|
export { ColorEditor, ColorPropertyEditor, } from "./imodel-components-react/editors/ColorEditor.js";
|
|
15
15
|
export { WeightEditor, WeightPropertyEditor, } from "./imodel-components-react/editors/WeightEditor.js";
|
|
16
|
+
export { WeightEditorSpec } from "./imodel-components-react/editors/NewWeightEditor.js";
|
|
16
17
|
export { QuantityInput, } from "./imodel-components-react/inputs/QuantityInput.js";
|
|
17
18
|
export { QuantityNumberInput, } from "./imodel-components-react/inputs/QuantityNumberInput.js";
|
|
19
|
+
export { QuantityEditorSpec } from "./imodel-components-react/inputs/new-editors/QuantityEditor.js";
|
|
18
20
|
export { LineWeightSwatch, } from "./imodel-components-react/lineweight/Swatch.js";
|
|
19
21
|
export { WeightPickerButton, } from "./imodel-components-react/lineweight/WeightPickerButton.js";
|
|
20
22
|
export { Cube, Face, } from "./imodel-components-react/navigationaids/Cube.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,GAEZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,GAEV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,GAEZ,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iD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;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents.js\";\n\nexport {\n AlphaSlider,\n AlphaSliderProps,\n} from \"./imodel-components-react/color/AlphaSlider.js\";\nexport {\n ColorPickerButton,\n ColorPickerProps,\n} from \"./imodel-components-react/color/ColorPickerButton.js\";\nexport {\n ColorPickerDialog,\n ColorPickerDialogProps,\n} from \"./imodel-components-react/color/ColorPickerDialog.js\";\nexport {\n ColorPickerPopup,\n ColorPickerPopupProps,\n} from \"./imodel-components-react/color/ColorPickerPopup.js\";\nexport {\n HueSlider,\n HueSliderProps,\n} from \"./imodel-components-react/color/HueSlider.js\";\nexport {\n SaturationPicker,\n SaturationPickerProps,\n} from \"./imodel-components-react/color/SaturationPicker.js\";\nexport {\n ColorSwatch,\n ColorSwatchProps,\n} from \"./imodel-components-react/color/Swatch.js\";\n\nexport {\n ColorEditor,\n ColorPropertyEditor,\n} from \"./imodel-components-react/editors/ColorEditor.js\";\nexport {\n WeightEditor,\n WeightPropertyEditor,\n} from \"./imodel-components-react/editors/WeightEditor.js\";\nexport { WeightEditorSpec } from \"./imodel-components-react/editors/NewWeightEditor.js\";\n\nexport {\n QuantityInput,\n QuantityProps,\n} from \"./imodel-components-react/inputs/QuantityInput.js\";\nexport {\n QuantityNumberInput,\n QuantityNumberInputProps,\n StepFunctionProp,\n} from \"./imodel-components-react/inputs/QuantityNumberInput.js\";\nexport { QuantityEditorSpec } from \"./imodel-components-react/inputs/new-editors/QuantityEditor.js\";\n\nexport {\n LineWeightSwatch,\n LineWeightSwatchProps,\n} from \"./imodel-components-react/lineweight/Swatch.js\";\nexport {\n WeightPickerButton,\n WeightPickerProps,\n} from \"./imodel-components-react/lineweight/WeightPickerButton.js\";\n\nexport {\n Cube,\n CubeProps,\n Face,\n} from \"./imodel-components-react/navigationaids/Cube.js\";\nexport {\n CubeNavigationAid,\n CubeNavigationAidProps,\n CubeNavigationHitBoxX,\n CubeNavigationHitBoxY,\n CubeNavigationHitBoxZ,\n} from \"./imodel-components-react/navigationaids/CubeNavigationAid.js\";\nexport {\n DrawingNavigationAid,\n DrawingNavigationAidProps,\n} from \"./imodel-components-react/navigationaids/DrawingNavigationAid.js\";\n\nexport {\n FormatPanel,\n FormatPanelProps,\n} from \"./imodel-components-react/quantityformat/FormatPanel.js\";\nexport {\n FormatPrecision,\n FormatPrecisionProps,\n} from \"./imodel-components-react/quantityformat/FormatPrecision.js\";\nexport {\n FormatSample,\n FormatSampleProps,\n} from \"./imodel-components-react/quantityformat/FormatSample.js\";\nexport {\n FormatTypeOption,\n FormatTypeOptionProps,\n} from \"./imodel-components-react/quantityformat/FormatType.js\";\nexport {\n FormatUnitLabel,\n FormatUnitLabelProps,\n} from \"./imodel-components-react/quantityformat/FormatUnitLabel.js\";\nexport {\n FormatUnits,\n FormatUnitsProps,\n} from \"./imodel-components-react/quantityformat/FormatUnits.js\";\nexport {\n MiscFormatOptions,\n MiscFormatOptionsProps,\n} from \"./imodel-components-react/quantityformat/MiscFormatOptions.js\";\nexport {\n QuantityFormatPanel,\n QuantityFormatPanelProps,\n} from \"./imodel-components-react/quantityformat/QuantityFormatPanel.js\";\n\nexport {\n AnimationFractionChangeHandler,\n PlaybackSettings,\n PlaybackSettingsChangeHandler,\n SolarDataProvider,\n SolarPlaybackProgressHandler,\n TimelineDataProvider,\n TimelineDateDisplay,\n TimelinePausePlayAction,\n TimelinePausePlayArgs,\n TimelineScale,\n} from \"./imodel-components-react/timeline/interfaces.js\";\nexport { BaseTimelineDataProvider } from \"./imodel-components-react/timeline/BaseTimelineDataProvider.js\";\nexport {\n TimelineComponent,\n TimelineComponentProps,\n TimelineDateMarkerProps,\n TimelineMenuItemOption,\n TimelineMenuItemProps,\n} from \"./imodel-components-react/timeline/TimelineComponent.js\";\nexport { SolarTimeline } from \"./imodel-components-react/timeline/SolarTimeline.js\";\nexport { BaseSolarDataProvider } from \"./imodel-components-react/timeline/BaseSolarDataProvider.js\";\n\nexport {\n ViewStateProp,\n ViewportComponent,\n ViewportProps,\n} from \"./imodel-components-react/viewport/ViewportComponent.js\";\nexport {\n ViewportComponentEvents,\n CubeRotationChangeEvent,\n CubeRotationChangeEventArgs,\n DrawingViewportChangeEvent,\n DrawingViewportChangeEventArgs,\n StandardRotationChangeEvent,\n StandardRotationChangeEventArgs,\n ViewClassFullNameChangedEvent,\n ViewClassFullNameChangedEventArgs,\n ViewIdChangedEvent,\n ViewIdChangedEventArgs,\n ViewRotationChangeEvent,\n ViewRotationChangeEventArgs,\n} from \"./imodel-components-react/viewport/ViewportComponentEvents.js\";\n\nexport { ToolUtilities } from \"./imodel-components-react/ToolUtilities.js\";\n\n// #region \"SideEffects\"\n\nimport { StandardEditorNames, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { PropertyEditorManager } from \"@itwin/components-react\";\nimport { ColorPropertyEditor } from \"./imodel-components-react/editors/ColorEditor.js\";\nimport { WeightPropertyEditor } from \"./imodel-components-react/editors/WeightEditor.js\";\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n ColorPropertyEditor,\n StandardEditorNames.ColorPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n WeightPropertyEditor,\n StandardEditorNames.WeightPicker\n);\n\n// #endregion \"SideEffects\"\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "A react component library of iTwin.js UI iModel components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/imodel-components-react.d.ts",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@itwin/appui-abstract": "^4.0.0",
|
|
39
|
-
"@itwin/components-react": "^5.
|
|
39
|
+
"@itwin/components-react": "^5.4.0",
|
|
40
40
|
"@itwin/core-bentley": "^4.0.0",
|
|
41
41
|
"@itwin/core-common": "^4.0.0",
|
|
42
42
|
"@itwin/core-frontend": "^4.0.0",
|
|
43
43
|
"@itwin/core-geometry": "^4.0.0",
|
|
44
44
|
"@itwin/core-quantity": "^4.0.0",
|
|
45
|
-
"@itwin/core-react": "^5.
|
|
45
|
+
"@itwin/core-react": "^5.4.0",
|
|
46
46
|
"@itwin/itwinui-react": "^3.15.0",
|
|
47
47
|
"react": "^18.0.0",
|
|
48
48
|
"react-dom": "^18.0.0"
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"@testing-library/dom": "^10.1.0",
|
|
63
63
|
"@testing-library/react": "^15.0.7",
|
|
64
64
|
"@testing-library/user-event": "^14.5.2",
|
|
65
|
-
"@types/faker": "^4.1.0",
|
|
66
65
|
"@types/node": "20.17.8",
|
|
67
66
|
"@types/react": "^18.3.12",
|
|
68
67
|
"@types/react-dom": "^18.3.1",
|
|
@@ -70,7 +69,6 @@
|
|
|
70
69
|
"cpx2": "^3.0.0",
|
|
71
70
|
"eslint": "^8.57.1",
|
|
72
71
|
"eslint-config-prettier": "~8.8.0",
|
|
73
|
-
"faker": "^4.1.0",
|
|
74
72
|
"ignore-styles": "^5.0.1",
|
|
75
73
|
"inversify": "^6.0.1",
|
|
76
74
|
"jsdom": "^24.0.0",
|
|
@@ -85,8 +83,8 @@
|
|
|
85
83
|
"typescript": "~5.6.2",
|
|
86
84
|
"upath": "^2.0.1",
|
|
87
85
|
"vitest": "^3.0.6",
|
|
88
|
-
"@itwin/components-react": "5.
|
|
89
|
-
"@itwin/core-react": "5.
|
|
86
|
+
"@itwin/components-react": "5.4.0",
|
|
87
|
+
"@itwin/core-react": "5.4.0"
|
|
90
88
|
},
|
|
91
89
|
"dependencies": {
|
|
92
90
|
"@itwin/itwinui-icons-react": "^2.8.0",
|