@itwin/components-react 5.6.0 → 5.8.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/lib/components-react/editors/CustomNumberEditor.d.ts +3 -1
  3. package/lib/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
  4. package/lib/components-react/editors/CustomNumberEditor.js +133 -69
  5. package/lib/components-react/editors/CustomNumberEditor.js.map +1 -1
  6. package/lib/components-react/editors/EditorContainer.d.ts +6 -0
  7. package/lib/components-react/editors/EditorContainer.d.ts.map +1 -1
  8. package/lib/components-react/editors/EditorContainer.js.map +1 -1
  9. package/lib/components-react/editors/NumericInputEditor.d.ts.map +1 -1
  10. package/lib/components-react/editors/NumericInputEditor.js +22 -3
  11. package/lib/components-react/editors/NumericInputEditor.js.map +1 -1
  12. package/lib/components-react/editors/PropertyEditorManager.d.ts +4 -2
  13. package/lib/components-react/editors/PropertyEditorManager.d.ts.map +1 -1
  14. package/lib/components-react/editors/PropertyEditorManager.js +28 -18
  15. package/lib/components-react/editors/PropertyEditorManager.js.map +1 -1
  16. package/lib/components-react/editors/TextEditor.d.ts.map +1 -1
  17. package/lib/components-react/editors/TextEditor.js +22 -14
  18. package/lib/components-react/editors/TextEditor.js.map +1 -1
  19. package/lib/components-react/editors/registerEditors.d.ts.map +1 -1
  20. package/lib/components-react/editors/registerEditors.js +26 -26
  21. package/lib/components-react/editors/registerEditors.js.map +1 -1
  22. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.d.ts +5 -3
  23. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.d.ts.map +1 -1
  24. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.js +7 -2
  25. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.js.map +1 -1
  26. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts +10 -0
  27. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts.map +1 -1
  28. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js +4 -2
  29. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js.map +1 -1
  30. package/lib/internal.d.ts +5 -1
  31. package/lib/internal.d.ts.map +1 -1
  32. package/lib/internal.js +4 -5
  33. package/lib/internal.js.map +1 -1
  34. package/package.json +3 -3
@@ -1,3 +1,13 @@
1
+ import * as React from "react";
2
+ import type { EditorProps } from "../../Types.js";
3
+ import type { OldEditorMetadata } from "../Metadata.js";
4
+ import type { NumericValue } from "../../values/Values.js";
1
5
  /** @internal */
2
6
  export declare const CustomNumberEditorSpec: import("../../Types.js").EditorSpec;
7
+ interface CustomNumberEditorProps extends EditorProps<OldEditorMetadata, NumericValue> {
8
+ decoration?: React.ReactNode;
9
+ }
10
+ /** @internal */
11
+ export declare function CustomNumberEditor({ metadata, value, onChange, size, disabled, decoration, }: CustomNumberEditorProps): React.JSX.Element | null;
12
+ export {};
3
13
  //# sourceMappingURL=CustomNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomNumber.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/CustomNumber.tsx"],"names":[],"mappings":"AA0BA,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,qCAWjC,CAAC"}
1
+ {"version":3,"file":"CustomNumber.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/CustomNumber.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAW3D,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,qCAWjC,CAAC;AAEH,UAAU,uBACR,SAAQ,WAAW,CAAC,iBAAiB,EAAE,YAAY,CAAC;IACpD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,UAAU,GACX,EAAE,uBAAuB,4BAuDzB"}
@@ -20,7 +20,8 @@ export const CustomNumberEditorSpec = createEditorSpec({
20
20
  isValueSupported: isNumeric,
21
21
  Editor: CustomNumberEditor,
22
22
  });
23
- function CustomNumberEditor({ metadata, value, onChange, size, disabled, }) {
23
+ /** @internal */
24
+ export function CustomNumberEditor({ metadata, value, onChange, size, disabled, decoration, }) {
24
25
  const formatParams = useCustomFormattedNumberParams(metadata);
25
26
  const sizeParams = useInputEditorSizeParams(metadata);
26
27
  const iconParams = useIconEditorParams(metadata);
@@ -53,7 +54,8 @@ function CustomNumberEditor({ metadata, value, onChange, size, disabled, }) {
53
54
  };
54
55
  return (React.createElement(InputWithDecorations, { size: size },
55
56
  icon !== undefined ? (React.createElement(InputWithDecorations.Icon, null, icon)) : null,
56
- React.createElement(InputWithDecorations.Input, { ref: inputRef, style: style, disabled: disabled, onChange: handleChange, value: inputValue })));
57
+ React.createElement(InputWithDecorations.Input, { ref: inputRef, style: style, disabled: disabled, onChange: handleChange, value: inputValue }),
58
+ decoration));
57
59
  }
58
60
  /* v8 ignore stop */
59
61
  //# sourceMappingURL=CustomNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomNumber.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/CustomNumber.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MA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,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,UAAU,GACjB,CACmB,CACxB,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 {\n PropertyEditorParamTypes,\n StandardEditorNames,\n} from \"@itwin/appui-abstract\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport type { EditorProps } from \"../../Types.js\";\nimport { createEditorSpec } from \"../../Types.js\";\nimport type { OldEditorMetadata } from \"../Metadata.js\";\nimport { isOldEditorMetadata } from \"../Metadata.js\";\nimport type { NumericValue } from \"../../values/Values.js\";\nimport {\n useCustomFormattedNumberParams,\n useIconEditorParams,\n useInputEditorSizeParams,\n} from \"./UseEditorParams.js\";\nimport { findIcon } from \"../IconsRegistry.js\";\nimport { isNumeric } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const CustomNumberEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"number\" &&\n !!metadata.params?.find(\n (param) =>\n param.type === PropertyEditorParamTypes.CustomFormattedNumber.valueOf()\n ) &&\n metadata.preferredEditor === StandardEditorNames.NumberCustom,\n isValueSupported: isNumeric,\n Editor: CustomNumberEditor,\n});\n\nfunction CustomNumberEditor({\n metadata,\n value,\n onChange,\n size,\n disabled,\n}: EditorProps<OldEditorMetadata, NumericValue>) {\n const formatParams = useCustomFormattedNumberParams(metadata);\n const sizeParams = useInputEditorSizeParams(metadata);\n const iconParams = useIconEditorParams(metadata);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [inputValue, setInputValue] = React.useState(() => {\n return value?.rawValue !== undefined && formatParams\n ? formatParams.formatFunction(value.rawValue)\n : \"\";\n });\n\n if (!formatParams) {\n return null;\n }\n\n const style: React.CSSProperties | undefined =\n sizeParams?.size !== undefined\n ? {\n minWidth: `${sizeParams?.size * 0.75}em`,\n }\n : undefined;\n const icon =\n iconParams?.definition?.iconSpec !== undefined\n ? findIcon(iconParams.definition.iconSpec)\n : undefined;\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n const result = formatParams.parseFunction(currentValue);\n const parsedValue =\n typeof result.value === \"number\" ? result.value : undefined;\n\n setInputValue(currentValue);\n\n onChange({\n rawValue: parsedValue,\n displayValue: currentValue,\n });\n };\n\n return (\n <InputWithDecorations size={size}>\n {icon !== undefined ? (\n <InputWithDecorations.Icon>{icon}</InputWithDecorations.Icon>\n ) : null}\n <InputWithDecorations.Input\n ref={inputRef}\n style={style}\n disabled={disabled}\n onChange={handleChange}\n value={inputValue}\n />\n </InputWithDecorations>\n );\n}\n\n/* v8 ignore stop */\n"]}
1
+ {"version":3,"file":"CustomNumber.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/CustomNumber.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAA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E,IAAI,GAAG,IAAI,IAAI;SACzC;QACH,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,IAAI,GACR,UAAU,EAAE,UAAU,EAAE,QAAQ,KAAK,SAAS;QAC5C,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC1C,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,YAAY,GAAG,CAAC,CAAsC,EAAE,EAAE;QAC9D,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QACpC,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACxD,MAAM,WAAW,GACf,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9D,aAAa,CAAC,YAAY,CAAC,CAAC;QAE5B,QAAQ,CAAC;YACP,QAAQ,EAAE,WAAW;YACrB,YAAY,EAAE,YAAY;SAC3B,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI;QAC7B,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACpB,oBAAC,oBAAoB,CAAC,IAAI,QAAE,IAAI,CAA6B,CAC9D,CAAC,CAAC,CAAC,IAAI;QACR,oBAAC,oBAAoB,CAAC,KAAK,IACzB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,UAAU,GACjB;QACD,UAAU,CACU,CACxB,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 {\n PropertyEditorParamTypes,\n StandardEditorNames,\n} from \"@itwin/appui-abstract\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport type { EditorProps } from \"../../Types.js\";\nimport { createEditorSpec } from \"../../Types.js\";\nimport type { OldEditorMetadata } from \"../Metadata.js\";\nimport { isOldEditorMetadata } from \"../Metadata.js\";\nimport type { NumericValue } from \"../../values/Values.js\";\nimport {\n useCustomFormattedNumberParams,\n useIconEditorParams,\n useInputEditorSizeParams,\n} from \"./UseEditorParams.js\";\nimport { findIcon } from \"../IconsRegistry.js\";\nimport { isNumeric } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const CustomNumberEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"number\" &&\n !!metadata.params?.find(\n (param) =>\n param.type === PropertyEditorParamTypes.CustomFormattedNumber.valueOf()\n ) &&\n metadata.preferredEditor === StandardEditorNames.NumberCustom,\n isValueSupported: isNumeric,\n Editor: CustomNumberEditor,\n});\n\ninterface CustomNumberEditorProps\n extends EditorProps<OldEditorMetadata, NumericValue> {\n decoration?: React.ReactNode;\n}\n\n/** @internal */\nexport function CustomNumberEditor({\n metadata,\n value,\n onChange,\n size,\n disabled,\n decoration,\n}: CustomNumberEditorProps) {\n const formatParams = useCustomFormattedNumberParams(metadata);\n const sizeParams = useInputEditorSizeParams(metadata);\n const iconParams = useIconEditorParams(metadata);\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [inputValue, setInputValue] = React.useState(() => {\n return value?.rawValue !== undefined && formatParams\n ? formatParams.formatFunction(value.rawValue)\n : \"\";\n });\n\n if (!formatParams) {\n return null;\n }\n\n const style: React.CSSProperties | undefined =\n sizeParams?.size !== undefined\n ? {\n minWidth: `${sizeParams?.size * 0.75}em`,\n }\n : undefined;\n const icon =\n iconParams?.definition?.iconSpec !== undefined\n ? findIcon(iconParams.definition.iconSpec)\n : undefined;\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n const result = formatParams.parseFunction(currentValue);\n const parsedValue =\n typeof result.value === \"number\" ? result.value : undefined;\n\n setInputValue(currentValue);\n\n onChange({\n rawValue: parsedValue,\n displayValue: currentValue,\n });\n };\n\n return (\n <InputWithDecorations size={size}>\n {icon !== undefined ? (\n <InputWithDecorations.Icon>{icon}</InputWithDecorations.Icon>\n ) : null}\n <InputWithDecorations.Input\n ref={inputRef}\n style={style}\n disabled={disabled}\n onChange={handleChange}\n value={inputValue}\n />\n {decoration}\n </InputWithDecorations>\n );\n}\n\n/* v8 ignore stop */\n"]}
package/lib/internal.d.ts CHANGED
@@ -1,5 +1,9 @@
1
- export { addIconNodeParam, IconNodeEditorParams, } from "./components-react/properties/IconNodeEditorParam.js";
1
+ export { InternalInputEditorProps } from "./components-react/editors/EditorContainer.js";
2
+ export { registerDefaultPropertyEditor } from "./components-react/editors/PropertyEditorManager.js";
2
3
  export { useTranslation } from "./components-react/l10n/useTranslation.js";
4
+ export { CustomNumberEditor, CustomNumberEditorSpec, } from "./components-react/new-editors/interop/old-editors/CustomNumber.js";
5
+ export { OldEditorMetadata, isOldEditorMetadata, } from "./components-react/new-editors/interop/Metadata.js";
6
+ export { addIconNodeParam, IconNodeEditorParams, } from "./components-react/properties/IconNodeEditorParam.js";
3
7
  export { GroupTool } from "./components-react/toolbar/groupPanel/tool/Tool.js";
4
8
  export { GroupColumn } from "./components-react/toolbar/groupPanel/Column.js";
5
9
  export { Columns } from "./components-react/toolbar/groupPanel/Columns.js";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AAEvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,oEAAoE,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AAEvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC"}
package/lib/internal.js CHANGED
@@ -1,9 +1,8 @@
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
- export { addIconNodeParam, } from "./components-react/properties/IconNodeEditorParam.js";
1
+ export { registerDefaultPropertyEditor } from "./components-react/editors/PropertyEditorManager.js";
6
2
  export { useTranslation } from "./components-react/l10n/useTranslation.js";
3
+ export { CustomNumberEditor, CustomNumberEditorSpec, } from "./components-react/new-editors/interop/old-editors/CustomNumber.js";
4
+ export { isOldEditorMetadata, } from "./components-react/new-editors/interop/Metadata.js";
5
+ export { addIconNodeParam, } from "./components-react/properties/IconNodeEditorParam.js";
7
6
  export { GroupTool } from "./components-react/toolbar/groupPanel/tool/Tool.js";
8
7
  export { GroupColumn } from "./components-react/toolbar/groupPanel/Column.js";
9
8
  export { Columns } from "./components-react/toolbar/groupPanel/Columns.js";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EACL,gBAAgB,GAEjB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC","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 *--------------------------------------------------------------------------------------------*/\nexport {\n addIconNodeParam,\n IconNodeEditorParams,\n} from \"./components-react/properties/IconNodeEditorParam.js\";\n\nexport { useTranslation } from \"./components-react/l10n/useTranslation.js\";\n\nexport { GroupTool } from \"./components-react/toolbar/groupPanel/tool/Tool.js\";\nexport { GroupColumn } from \"./components-react/toolbar/groupPanel/Column.js\";\nexport { Columns } from \"./components-react/toolbar/groupPanel/Columns.js\";\nexport { Panel } from \"./components-react/toolbar/groupPanel/Panel.js\";\nexport { Title } from \"./components-react/toolbar/groupPanel/Title.js\";\n\nexport { CommonToolbarItemWithBadgeKind } from \"./components-react/toolbar/InternalToolbarComponent.js\";\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,oEAAoE,CAAC;AAE5E,OAAO,EAEL,mBAAmB,GACpB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EACL,gBAAgB,GAEjB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAC","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 *--------------------------------------------------------------------------------------------*/\nexport { InternalInputEditorProps } from \"./components-react/editors/EditorContainer.js\";\nexport { registerDefaultPropertyEditor } from \"./components-react/editors/PropertyEditorManager.js\";\n\nexport { useTranslation } from \"./components-react/l10n/useTranslation.js\";\n\nexport {\n CustomNumberEditor,\n CustomNumberEditorSpec,\n} from \"./components-react/new-editors/interop/old-editors/CustomNumber.js\";\n\nexport {\n OldEditorMetadata,\n isOldEditorMetadata,\n} from \"./components-react/new-editors/interop/Metadata.js\";\n\nexport {\n addIconNodeParam,\n IconNodeEditorParams,\n} from \"./components-react/properties/IconNodeEditorParam.js\";\n\nexport { GroupTool } from \"./components-react/toolbar/groupPanel/tool/Tool.js\";\nexport { GroupColumn } from \"./components-react/toolbar/groupPanel/Column.js\";\nexport { Columns } from \"./components-react/toolbar/groupPanel/Columns.js\";\nexport { Panel } from \"./components-react/toolbar/groupPanel/Panel.js\";\nexport { Title } from \"./components-react/toolbar/groupPanel/Title.js\";\n\nexport { CommonToolbarItemWithBadgeKind } from \"./components-react/toolbar/InternalToolbarComponent.js\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/components-react",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "A react component library of iTwin.js UI data-oriented components",
5
5
  "type": "module",
6
6
  "types": "./lib/components-react.d.ts",
@@ -40,7 +40,7 @@
40
40
  "@itwin/itwinui-react": "^3.15.0",
41
41
  "react": "^18.0.0",
42
42
  "react-dom": "^18.0.0",
43
- "@itwin/core-react": "5.6.0"
43
+ "@itwin/core-react": "5.8.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@itwin/appui-abstract": "rc",
@@ -76,7 +76,7 @@
76
76
  "typescript": "~5.6.2",
77
77
  "upath": "^2.0.1",
78
78
  "vitest": "^3.0.6",
79
- "@itwin/core-react": "5.6.0"
79
+ "@itwin/core-react": "5.8.0"
80
80
  },
81
81
  "dependencies": {
82
82
  "@itwin/itwinui-icons-react": "^2.8.0",