@itwin/components-react 5.3.1 → 5.5.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 (197) hide show
  1. package/CHANGELOG.md +356 -13
  2. package/lib/components-react/UiComponents.js +1 -1
  3. package/lib/components-react/UiComponents.js.map +1 -1
  4. package/lib/components-react/common/DisposePolyfill.d.ts +5 -0
  5. package/lib/components-react/common/DisposePolyfill.d.ts.map +1 -0
  6. package/lib/components-react/common/DisposePolyfill.js +14 -0
  7. package/lib/components-react/common/DisposePolyfill.js.map +1 -0
  8. package/lib/components-react/common/ImageRenderer.js +1 -1
  9. package/lib/components-react/common/ImageRenderer.js.map +1 -1
  10. package/lib/components-react/converters/PointTypeConverter.d.ts.map +1 -1
  11. package/lib/components-react/converters/PointTypeConverter.js +1 -0
  12. package/lib/components-react/converters/PointTypeConverter.js.map +1 -1
  13. package/lib/components-react/editors/CustomNumberEditor.d.ts +1 -1
  14. package/lib/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
  15. package/lib/components-react/editors/CustomNumberEditor.js +5 -0
  16. package/lib/components-react/editors/CustomNumberEditor.js.map +1 -1
  17. package/lib/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  18. package/lib/components-react/filter-builder/FilterBuilderRule.js +2 -5
  19. package/lib/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  20. package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts +6 -0
  21. package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  22. package/lib/components-react/filter-builder/FilterBuilderRuleValue.js +3 -2
  23. package/lib/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  24. package/lib/components-react/new-editors/EditorRenderer.d.ts +19 -0
  25. package/lib/components-react/new-editors/EditorRenderer.d.ts.map +1 -0
  26. package/lib/components-react/new-editors/EditorRenderer.js +25 -0
  27. package/lib/components-react/new-editors/EditorRenderer.js.map +1 -0
  28. package/lib/components-react/new-editors/Types.d.ts +46 -0
  29. package/lib/components-react/new-editors/Types.d.ts.map +1 -0
  30. package/lib/components-react/new-editors/Types.js +20 -0
  31. package/lib/components-react/new-editors/Types.js.map +1 -0
  32. package/lib/components-react/new-editors/UseCommittableValue.d.ts +51 -0
  33. package/lib/components-react/new-editors/UseCommittableValue.d.ts.map +1 -0
  34. package/lib/components-react/new-editors/UseCommittableValue.js +85 -0
  35. package/lib/components-react/new-editors/UseCommittableValue.js.map +1 -0
  36. package/lib/components-react/new-editors/editors/BooleanEditor.d.ts +10 -0
  37. package/lib/components-react/new-editors/editors/BooleanEditor.d.ts.map +1 -0
  38. package/lib/components-react/new-editors/editors/BooleanEditor.js +22 -0
  39. package/lib/components-react/new-editors/editors/BooleanEditor.js.map +1 -0
  40. package/lib/components-react/new-editors/editors/DateEditor.d.ts +10 -0
  41. package/lib/components-react/new-editors/editors/DateEditor.d.ts.map +1 -0
  42. package/lib/components-react/new-editors/editors/DateEditor.js +18 -0
  43. package/lib/components-react/new-editors/editors/DateEditor.js.map +1 -0
  44. package/lib/components-react/new-editors/editors/DateInput.d.ts +15 -0
  45. package/lib/components-react/new-editors/editors/DateInput.d.ts.map +1 -0
  46. package/lib/components-react/new-editors/editors/DateInput.js +23 -0
  47. package/lib/components-react/new-editors/editors/DateInput.js.map +1 -0
  48. package/lib/components-react/new-editors/editors/DateTimeEditor.d.ts +10 -0
  49. package/lib/components-react/new-editors/editors/DateTimeEditor.d.ts.map +1 -0
  50. package/lib/components-react/new-editors/editors/DateTimeEditor.js +18 -0
  51. package/lib/components-react/new-editors/editors/DateTimeEditor.js.map +1 -0
  52. package/lib/components-react/new-editors/editors/EnumEditor.d.ts +10 -0
  53. package/lib/components-react/new-editors/editors/EnumEditor.d.ts.map +1 -0
  54. package/lib/components-react/new-editors/editors/EnumEditor.js +30 -0
  55. package/lib/components-react/new-editors/editors/EnumEditor.js.map +1 -0
  56. package/lib/components-react/new-editors/editors/FallbackEditor.d.ts +8 -0
  57. package/lib/components-react/new-editors/editors/FallbackEditor.d.ts.map +1 -0
  58. package/lib/components-react/new-editors/editors/FallbackEditor.js +41 -0
  59. package/lib/components-react/new-editors/editors/FallbackEditor.js.map +1 -0
  60. package/lib/components-react/new-editors/editors/FormattedNumericInput.d.ts +24 -0
  61. package/lib/components-react/new-editors/editors/FormattedNumericInput.d.ts.map +1 -0
  62. package/lib/components-react/new-editors/editors/FormattedNumericInput.js +77 -0
  63. package/lib/components-react/new-editors/editors/FormattedNumericInput.js.map +1 -0
  64. package/lib/components-react/new-editors/editors/NumericEditor.d.ts +10 -0
  65. package/lib/components-react/new-editors/editors/NumericEditor.d.ts.map +1 -0
  66. package/lib/components-react/new-editors/editors/NumericEditor.js +28 -0
  67. package/lib/components-react/new-editors/editors/NumericEditor.js.map +1 -0
  68. package/lib/components-react/new-editors/editors/TextEditor.d.ts +10 -0
  69. package/lib/components-react/new-editors/editors/TextEditor.d.ts.map +1 -0
  70. package/lib/components-react/new-editors/editors/TextEditor.js +17 -0
  71. package/lib/components-react/new-editors/editors/TextEditor.js.map +1 -0
  72. package/lib/components-react/new-editors/editors/ToggleEditor.d.ts +10 -0
  73. package/lib/components-react/new-editors/editors/ToggleEditor.d.ts.map +1 -0
  74. package/lib/components-react/new-editors/editors/ToggleEditor.js +22 -0
  75. package/lib/components-react/new-editors/editors/ToggleEditor.js.map +1 -0
  76. package/lib/components-react/new-editors/editors-registry/DefaultEditors.d.ts +50 -0
  77. package/lib/components-react/new-editors/editors-registry/DefaultEditors.d.ts.map +1 -0
  78. package/lib/components-react/new-editors/editors-registry/DefaultEditors.js +117 -0
  79. package/lib/components-react/new-editors/editors-registry/DefaultEditors.js.map +1 -0
  80. package/lib/components-react/new-editors/editors-registry/EditorsRegistryContext.d.ts +12 -0
  81. package/lib/components-react/new-editors/editors-registry/EditorsRegistryContext.d.ts.map +1 -0
  82. package/lib/components-react/new-editors/editors-registry/EditorsRegistryContext.js +14 -0
  83. package/lib/components-react/new-editors/editors-registry/EditorsRegistryContext.js.map +1 -0
  84. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.d.ts +15 -0
  85. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.d.ts.map +1 -0
  86. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.js +25 -0
  87. package/lib/components-react/new-editors/editors-registry/EditorsRegistryProvider.js.map +1 -0
  88. package/lib/components-react/new-editors/editors-registry/UseEditor.d.ts +16 -0
  89. package/lib/components-react/new-editors/editors-registry/UseEditor.d.ts.map +1 -0
  90. package/lib/components-react/new-editors/editors-registry/UseEditor.js +36 -0
  91. package/lib/components-react/new-editors/editors-registry/UseEditor.js.map +1 -0
  92. package/lib/components-react/new-editors/interop/EditorInterop.d.ts +17 -0
  93. package/lib/components-react/new-editors/interop/EditorInterop.d.ts.map +1 -0
  94. package/lib/components-react/new-editors/interop/EditorInterop.js +146 -0
  95. package/lib/components-react/new-editors/interop/EditorInterop.js.map +1 -0
  96. package/lib/components-react/new-editors/interop/IconsRegistry.d.ts +6 -0
  97. package/lib/components-react/new-editors/interop/IconsRegistry.d.ts.map +1 -0
  98. package/lib/components-react/new-editors/interop/IconsRegistry.js +41 -0
  99. package/lib/components-react/new-editors/interop/IconsRegistry.js.map +1 -0
  100. package/lib/components-react/new-editors/interop/Metadata.d.ts +21 -0
  101. package/lib/components-react/new-editors/interop/Metadata.d.ts.map +1 -0
  102. package/lib/components-react/new-editors/interop/Metadata.js +13 -0
  103. package/lib/components-react/new-editors/interop/Metadata.js.map +1 -0
  104. package/lib/components-react/new-editors/interop/PropertyRecordEditor.d.ts +22 -0
  105. package/lib/components-react/new-editors/interop/PropertyRecordEditor.d.ts.map +1 -0
  106. package/lib/components-react/new-editors/interop/PropertyRecordEditor.js +41 -0
  107. package/lib/components-react/new-editors/interop/PropertyRecordEditor.js.map +1 -0
  108. package/lib/components-react/new-editors/interop/old-editors/Color.d.ts +7 -0
  109. package/lib/components-react/new-editors/interop/old-editors/Color.d.ts.map +1 -0
  110. package/lib/components-react/new-editors/interop/old-editors/Color.js +48 -0
  111. package/lib/components-react/new-editors/interop/old-editors/Color.js.map +1 -0
  112. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts +3 -0
  113. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.d.ts.map +1 -0
  114. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js +59 -0
  115. package/lib/components-react/new-editors/interop/old-editors/CustomNumber.js.map +1 -0
  116. package/lib/components-react/new-editors/interop/old-editors/Enum.d.ts +4 -0
  117. package/lib/components-react/new-editors/interop/old-editors/Enum.d.ts.map +1 -0
  118. package/lib/components-react/new-editors/interop/old-editors/Enum.js +23 -0
  119. package/lib/components-react/new-editors/interop/old-editors/Enum.js.map +1 -0
  120. package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.d.ts +4 -0
  121. package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.d.ts.map +1 -0
  122. package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.js +50 -0
  123. package/lib/components-react/new-editors/interop/old-editors/EnumButtonGroup.js.map +1 -0
  124. package/lib/components-react/new-editors/interop/old-editors/NumericInput.d.ts +4 -0
  125. package/lib/components-react/new-editors/interop/old-editors/NumericInput.d.ts.map +1 -0
  126. package/lib/components-react/new-editors/interop/old-editors/NumericInput.js +86 -0
  127. package/lib/components-react/new-editors/interop/old-editors/NumericInput.js.map +1 -0
  128. package/lib/components-react/new-editors/interop/old-editors/Slider.d.ts +3 -0
  129. package/lib/components-react/new-editors/interop/old-editors/Slider.d.ts.map +1 -0
  130. package/lib/components-react/new-editors/interop/old-editors/Slider.js +66 -0
  131. package/lib/components-react/new-editors/interop/old-editors/Slider.js.map +1 -0
  132. package/lib/components-react/new-editors/interop/old-editors/TextArea.d.ts +3 -0
  133. package/lib/components-react/new-editors/interop/old-editors/TextArea.d.ts.map +1 -0
  134. package/lib/components-react/new-editors/interop/old-editors/TextArea.js +33 -0
  135. package/lib/components-react/new-editors/interop/old-editors/TextArea.js.map +1 -0
  136. package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.d.ts +31 -0
  137. package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.d.ts.map +1 -0
  138. package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.js +52 -0
  139. package/lib/components-react/new-editors/interop/old-editors/UseEditorParams.js.map +1 -0
  140. package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.d.ts +8 -0
  141. package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.d.ts.map +1 -0
  142. package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.js +41 -0
  143. package/lib/components-react/new-editors/interop/old-editors/UseEnumMetadata.js.map +1 -0
  144. package/lib/components-react/new-editors/values/Metadata.d.ts +35 -0
  145. package/lib/components-react/new-editors/values/Metadata.d.ts.map +1 -0
  146. package/lib/components-react/new-editors/values/Metadata.js +9 -0
  147. package/lib/components-react/new-editors/values/Metadata.js.map +1 -0
  148. package/lib/components-react/new-editors/values/ValueUtilities.d.ts +40 -0
  149. package/lib/components-react/new-editors/values/ValueUtilities.d.ts.map +1 -0
  150. package/lib/components-react/new-editors/values/ValueUtilities.js +84 -0
  151. package/lib/components-react/new-editors/values/ValueUtilities.js.map +1 -0
  152. package/lib/components-react/new-editors/values/Values.d.ts +58 -0
  153. package/lib/components-react/new-editors/values/Values.d.ts.map +1 -0
  154. package/lib/components-react/new-editors/values/Values.js +9 -0
  155. package/lib/components-react/new-editors/values/Values.js.map +1 -0
  156. package/lib/components-react/properties/IconNodeEditorParam.d.ts +16 -0
  157. package/lib/components-react/properties/IconNodeEditorParam.d.ts.map +1 -0
  158. package/lib/components-react/properties/IconNodeEditorParam.js +20 -0
  159. package/lib/components-react/properties/IconNodeEditorParam.js.map +1 -0
  160. package/lib/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
  161. package/lib/components-react/properties/renderers/PropertyGridColumns.js +1 -1
  162. package/lib/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  163. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +8 -1
  164. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  165. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.js +2 -1
  166. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  167. package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +6 -0
  168. package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts.map +1 -1
  169. package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
  170. package/lib/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  171. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts +5 -2
  172. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts.map +1 -1
  173. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js +7 -1
  174. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  175. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts.map +1 -1
  176. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +1 -1
  177. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  178. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts.map +1 -1
  179. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  180. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  181. package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +2 -0
  182. package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  183. package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js +3 -3
  184. package/lib/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  185. package/lib/components-react/tree/controlled/TreeEventHandler.d.ts +7 -3
  186. package/lib/components-react/tree/controlled/TreeEventHandler.d.ts.map +1 -1
  187. package/lib/components-react/tree/controlled/TreeEventHandler.js +9 -2
  188. package/lib/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  189. package/lib/components-react.d.ts +9 -0
  190. package/lib/components-react.d.ts.map +1 -1
  191. package/lib/components-react.js +7 -0
  192. package/lib/components-react.js.map +1 -1
  193. package/lib/internal.d.ts +1 -0
  194. package/lib/internal.d.ts.map +1 -1
  195. package/lib/internal.js +1 -0
  196. package/lib/internal.js.map +1 -1
  197. package/package.json +16 -17
@@ -0,0 +1,50 @@
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 { StandardEditorNames, } from "@itwin/appui-abstract";
7
+ import { createEditorSpec } from "../../Types.js";
8
+ import { isOldEditorMetadata } from "../Metadata.js";
9
+ import { useEnumMetadata } from "./UseEnumMetadata.js";
10
+ import { useButtonGroupEditorParams } from "./UseEditorParams.js";
11
+ import { ButtonGroup, IconButton } from "@itwin/itwinui-react";
12
+ import { findIcon } from "../IconsRegistry.js";
13
+ import { isEnum } from "../../values/ValueUtilities.js";
14
+ /* v8 ignore start */
15
+ /** @internal */
16
+ export const EnumButtonGroupEditorSpec = createEditorSpec({
17
+ isMetadataSupported: (metadata) => isOldEditorMetadata(metadata) &&
18
+ metadata.type === "enum" &&
19
+ metadata.preferredEditor === StandardEditorNames.EnumButtonGroup,
20
+ isValueSupported: isEnum,
21
+ Editor: EnumButtonGroupEditor,
22
+ });
23
+ function EnumButtonGroupEditor({ value, onChange, commit, size, disabled, metadata, }) {
24
+ const enumMetadata = useEnumMetadata(metadata);
25
+ const buttonGroupParams = useButtonGroupEditorParams(metadata);
26
+ const enumIcons = React.useMemo(() => {
27
+ return buttonGroupParams
28
+ ? createIconsMap(enumMetadata.choices, buttonGroupParams)
29
+ : undefined;
30
+ }, [enumMetadata, buttonGroupParams]);
31
+ const firstChoice = enumMetadata.choices[0];
32
+ const currentValue = value ? value : { choice: firstChoice?.value ?? "" };
33
+ return (React.createElement(ButtonGroup, { orientation: "horizontal" }, enumMetadata.choices.map((choice) => {
34
+ const icon = findIcon(enumIcons?.get(choice.value));
35
+ return (React.createElement(IconButton, { key: choice.value, onClick: () => {
36
+ onChange({ choice: choice.value });
37
+ commit?.();
38
+ }, label: choice.label, isActive: choice.value === currentValue.choice, size: size, disabled: disabled }, icon));
39
+ })));
40
+ }
41
+ function createIconsMap(choices, params) {
42
+ const icons = new Map();
43
+ for (let i = 0; i < choices.length; i++) {
44
+ const iconDef = params.buttons[i];
45
+ icons.set(choices[i].value, iconDef.iconSpec);
46
+ }
47
+ return icons;
48
+ }
49
+ /* v8 ignore stop */
50
+ //# sourceMappingURL=EnumButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnumButtonGroup.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/EnumButtonGroup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,qBAAq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ACT,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE;gBACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;gBACnC,MAAM,EAAE,EAAE,CAAC;YACb,CAAC,EACD,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,YAAY,CAAC,MAAM,EAC9C,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,IAEjB,IAAI,CACM,CACd,CAAC;IACJ,CAAC,CAAC,CACU,CACf,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CACrB,OAA4B,EAC5B,MAA+B;IAE/B,MAAM,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,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 type { ButtonGroupEditorParams } from \"@itwin/appui-abstract\";\nimport {\n type EnumerationChoice,\n StandardEditorNames,\n} from \"@itwin/appui-abstract\";\nimport type { EditorProps, EditorSpec } from \"../../Types.js\";\nimport { createEditorSpec } from \"../../Types.js\";\nimport type { OldEditorMetadata } from \"../Metadata.js\";\nimport { isOldEditorMetadata } from \"../Metadata.js\";\nimport type { EnumValue } from \"../../values/Values.js\";\nimport { useEnumMetadata } from \"./UseEnumMetadata.js\";\nimport { useButtonGroupEditorParams } from \"./UseEditorParams.js\";\nimport { ButtonGroup, IconButton } from \"@itwin/itwinui-react\";\nimport { findIcon } from \"../IconsRegistry.js\";\nimport { isEnum } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const EnumButtonGroupEditorSpec: EditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"enum\" &&\n metadata.preferredEditor === StandardEditorNames.EnumButtonGroup,\n isValueSupported: isEnum,\n Editor: EnumButtonGroupEditor,\n});\n\nfunction EnumButtonGroupEditor({\n value,\n onChange,\n commit,\n size,\n disabled,\n metadata,\n}: EditorProps<OldEditorMetadata, EnumValue>) {\n const enumMetadata = useEnumMetadata(metadata);\n const buttonGroupParams = useButtonGroupEditorParams(metadata);\n\n const enumIcons = React.useMemo(() => {\n return buttonGroupParams\n ? createIconsMap(enumMetadata.choices, buttonGroupParams)\n : undefined;\n }, [enumMetadata, buttonGroupParams]);\n\n const firstChoice = enumMetadata.choices[0] as EnumerationChoice | undefined;\n const currentValue = value ? value : { choice: firstChoice?.value ?? \"\" };\n\n return (\n <ButtonGroup orientation=\"horizontal\">\n {enumMetadata.choices.map((choice) => {\n const icon = findIcon(enumIcons?.get(choice.value));\n return (\n <IconButton\n key={choice.value}\n onClick={() => {\n onChange({ choice: choice.value });\n commit?.();\n }}\n label={choice.label}\n isActive={choice.value === currentValue.choice}\n size={size}\n disabled={disabled}\n >\n {icon}\n </IconButton>\n );\n })}\n </ButtonGroup>\n );\n}\n\nfunction createIconsMap(\n choices: EnumerationChoice[],\n params: ButtonGroupEditorParams\n) {\n const icons = new Map<string | number, string>();\n for (let i = 0; i < choices.length; i++) {\n const iconDef = params.buttons[i];\n icons.set(choices[i].value, iconDef.iconSpec);\n }\n return icons;\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,4 @@
1
+ import type { EditorSpec } from "../../Types.js";
2
+ /** @internal */
3
+ export declare const NumericInputEditorSpec: EditorSpec;
4
+ //# sourceMappingURL=NumericInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericInput.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/NumericInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAe,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAc9D,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,UAOnC,CAAC"}
@@ -0,0 +1,86 @@
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 { StandardEditorNames } from "@itwin/appui-abstract";
7
+ import { createEditorSpec } from "../../Types.js";
8
+ import { isOldEditorMetadata } from "../Metadata.js";
9
+ import { useInputEditorSizeParams, useRangeEditorParams, } from "./UseEditorParams.js";
10
+ import { Input } from "@itwin/itwinui-react";
11
+ import { isNumeric } from "../../values/ValueUtilities.js";
12
+ /* v8 ignore start */
13
+ /** @internal */
14
+ export const NumericInputEditorSpec = createEditorSpec({
15
+ isMetadataSupported: (metadata) => isOldEditorMetadata(metadata) &&
16
+ metadata.type === "number" &&
17
+ metadata.preferredEditor === StandardEditorNames.NumericInput,
18
+ isValueSupported: isNumeric,
19
+ Editor: NumericInputEditor,
20
+ });
21
+ function NumericInputEditor({ metadata, value, onChange, size, disabled, }) {
22
+ const sizeParams = useInputEditorSizeParams(metadata);
23
+ const rangeParams = useRangeEditorParams(metadata);
24
+ const handleChange = (newValue) => {
25
+ onChange({
26
+ displayValue: newValue,
27
+ rawValue: parseFloat(newValue),
28
+ });
29
+ };
30
+ const style = sizeParams?.size !== undefined
31
+ ? {
32
+ minWidth: `${sizeParams?.size * 0.75}em`,
33
+ }
34
+ : undefined;
35
+ const inputProps = useNumericInput({
36
+ min: rangeParams?.minimum,
37
+ max: rangeParams?.maximum,
38
+ precision: rangeParams?.precision,
39
+ step: rangeParams?.step,
40
+ maxLength: sizeParams?.maxLength,
41
+ onChange: handleChange,
42
+ value: value?.displayValue ?? "",
43
+ });
44
+ return (React.createElement(Input, { style: style, size: size, disabled: disabled, ...inputProps }));
45
+ }
46
+ function useNumericInput({ min, max, step, precision, maxLength, value, onChange, }) {
47
+ const formatValue = (val) => {
48
+ const appliedMin = min ?? Number.MIN_VALUE;
49
+ const appliedMax = max ?? Number.MAX_VALUE;
50
+ const valueInRange = Math.min(appliedMax, Math.max(appliedMin, val));
51
+ return precision
52
+ ? valueInRange.toFixed(precision)
53
+ : valueInRange.toString();
54
+ };
55
+ const [formattedValue, setFormattedValue] = React.useState(() => {
56
+ return value.length !== 0 ? formatValue(Number(value)) : value;
57
+ });
58
+ const handleChange = (event) => {
59
+ const currentValue = event.target.value;
60
+ if (maxLength && currentValue.length > maxLength) {
61
+ return;
62
+ }
63
+ setFormattedValue(currentValue);
64
+ onChange(currentValue);
65
+ };
66
+ const handleBlur = () => {
67
+ if (precision) {
68
+ const newFormattedValue = formatValue(Number(formattedValue));
69
+ if (newFormattedValue !== formattedValue) {
70
+ setFormattedValue(newFormattedValue);
71
+ onChange(newFormattedValue);
72
+ }
73
+ }
74
+ };
75
+ return {
76
+ type: "number",
77
+ min,
78
+ max,
79
+ step,
80
+ value: formattedValue,
81
+ onChange: handleChange,
82
+ onBlur: handleBlur,
83
+ };
84
+ }
85
+ /* v8 ignore stop */
86
+ //# sourceMappingURL=NumericInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericInput.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/NumericInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC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AAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;QACxC,IAAI,SAAS,IAAI,YAAY,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;YACjD,OAAO;QACT,CAAC;QACD,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAChC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;YAC9D,IAAI,iBAAiB,KAAK,cAAc,EAAE,CAAC;gBACzC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;gBACrC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,GAAG;QACH,GAAG;QACH,IAAI;QACJ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,UAAU;KACnB,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 { StandardEditorNames } from \"@itwin/appui-abstract\";\nimport type { EditorProps, EditorSpec } 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 useInputEditorSizeParams,\n useRangeEditorParams,\n} from \"./UseEditorParams.js\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { isNumeric } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const NumericInputEditorSpec: EditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"number\" &&\n metadata.preferredEditor === StandardEditorNames.NumericInput,\n isValueSupported: isNumeric,\n Editor: NumericInputEditor,\n});\n\nfunction NumericInputEditor({\n metadata,\n value,\n onChange,\n size,\n disabled,\n}: EditorProps<OldEditorMetadata, NumericValue>) {\n const sizeParams = useInputEditorSizeParams(metadata);\n const rangeParams = useRangeEditorParams(metadata);\n const handleChange = (newValue: string) => {\n onChange({\n displayValue: newValue,\n rawValue: parseFloat(newValue),\n });\n };\n\n const style: React.CSSProperties | undefined =\n sizeParams?.size !== undefined\n ? {\n minWidth: `${sizeParams?.size * 0.75}em`,\n }\n : undefined;\n\n const inputProps = useNumericInput({\n min: rangeParams?.minimum,\n max: rangeParams?.maximum,\n precision: rangeParams?.precision,\n step: rangeParams?.step,\n maxLength: sizeParams?.maxLength,\n onChange: handleChange,\n value: value?.displayValue ?? \"\",\n });\n\n return (\n <Input style={style} size={size} disabled={disabled} {...inputProps} />\n );\n}\n\ninterface UseNumericInputProps {\n min?: number;\n max?: number;\n step?: number;\n precision?: number;\n maxLength?: number;\n value: string;\n onChange: (newValue: string) => void;\n}\n\nfunction useNumericInput({\n min,\n max,\n step,\n precision,\n maxLength,\n value,\n onChange,\n}: UseNumericInputProps) {\n const formatValue = (val: number) => {\n const appliedMin = min ?? Number.MIN_VALUE;\n const appliedMax = max ?? Number.MAX_VALUE;\n const valueInRange = Math.min(appliedMax, Math.max(appliedMin, val));\n\n return precision\n ? valueInRange.toFixed(precision)\n : valueInRange.toString();\n };\n\n const [formattedValue, setFormattedValue] = React.useState(() => {\n return value.length !== 0 ? formatValue(Number(value)) : value;\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = event.target.value;\n if (maxLength && currentValue.length > maxLength) {\n return;\n }\n setFormattedValue(currentValue);\n onChange(currentValue);\n };\n\n const handleBlur = () => {\n if (precision) {\n const newFormattedValue = formatValue(Number(formattedValue));\n if (newFormattedValue !== formattedValue) {\n setFormattedValue(newFormattedValue);\n onChange(newFormattedValue);\n }\n }\n };\n\n return {\n type: \"number\",\n min,\n max,\n step,\n value: formattedValue,\n onChange: handleChange,\n onBlur: handleBlur,\n };\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,3 @@
1
+ /** @internal */
2
+ export declare const SliderEditorSpec: import("../../Types.js").EditorSpec;
3
+ //# sourceMappingURL=Slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/Slider.tsx"],"names":[],"mappings":"AAuBA,gBAAgB;AAChB,eAAO,MAAM,gBAAgB,qCAU3B,CAAC"}
@@ -0,0 +1,66 @@
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 { createEditorSpec } from "../../Types.js";
7
+ import { isOldEditorMetadata } from "../Metadata.js";
8
+ import { PropertyEditorParamTypes, StandardEditorNames, } from "@itwin/appui-abstract";
9
+ import { Button, Icon, Popover, Slider } from "@itwin/itwinui-react";
10
+ import { useSliderEditorParams } from "./UseEditorParams.js";
11
+ import { findIcon } from "../IconsRegistry.js";
12
+ import { isNumeric } from "../../values/ValueUtilities.js";
13
+ /* v8 ignore start */
14
+ /** @internal */
15
+ export const SliderEditorSpec = createEditorSpec({
16
+ isMetadataSupported: (metadata) => isOldEditorMetadata(metadata) &&
17
+ metadata.type === "number" &&
18
+ !!metadata.params?.find((param) => param.type === PropertyEditorParamTypes.Slider.valueOf()) &&
19
+ metadata.preferredEditor === StandardEditorNames.Slider,
20
+ isValueSupported: isNumeric,
21
+ Editor: SliderEditor,
22
+ });
23
+ function SliderEditor({ metadata, value, disabled, onChange, commit, size, }) {
24
+ const sliderParams = useSliderEditorParams(metadata);
25
+ if (!sliderParams) {
26
+ return null;
27
+ }
28
+ const minLabel = sliderParams.showMinMax && sliderParams.minIconSpec ? (React.createElement(Icon, null, findIcon(sliderParams.minIconSpec))) : undefined;
29
+ const maxLabel = sliderParams.showMinMax && sliderParams.maxIconSpec ? (React.createElement(Icon, null, findIcon(sliderParams.maxIconSpec))) : undefined;
30
+ const handleChange = (values) => {
31
+ const newValue = values[0];
32
+ onChange({ rawValue: newValue, displayValue: `${newValue}` });
33
+ };
34
+ const currentValue = value?.rawValue ?? sliderParams.minimum;
35
+ const slider = (React.createElement(Slider, { values: [currentValue], min: sliderParams.minimum, max: sliderParams.maximum, step: sliderParams.step, thumbMode: 1 === sliderParams.mode ? "allow-crossing" : "inhibit-crossing", trackDisplayMode: !sliderParams.reversed ? "auto" : "odd-segments", minLabel: minLabel, maxLabel: maxLabel, tooltipProps: (_index, tooltipValue) => {
36
+ return {
37
+ placement: sliderParams.tooltipBelow ? "bottom" : "top",
38
+ content: formatTickLabel(tooltipValue, sliderParams),
39
+ visible: sliderParams.showTooltip,
40
+ };
41
+ }, tickLabels: getTickLabels(sliderParams), onChange: handleChange, disabled: disabled }));
42
+ return (React.createElement(Popover, { placement: "bottom", style: { minWidth: "300px", padding: "8px" }, content: slider, onVisibleChange: (visible) => {
43
+ if (!visible) {
44
+ commit?.();
45
+ }
46
+ }, applyBackground: true },
47
+ React.createElement(Button, { style: { width: "100%" }, size: size, disabled: disabled }, currentValue)));
48
+ }
49
+ function getTickLabels(sliderParams) {
50
+ if (!sliderParams.showTicks || !sliderParams.showTickLabels) {
51
+ return undefined;
52
+ }
53
+ const count = sliderParams.getTickCount ? sliderParams.getTickCount() : 0;
54
+ if (count > 0) {
55
+ const increment = (sliderParams.maximum - sliderParams.minimum) / count;
56
+ return Array.from({ length: count + 1 }, (_, i) => formatTickLabel(i * increment + sliderParams.minimum, sliderParams));
57
+ }
58
+ return sliderParams
59
+ .getTickValues?.()
60
+ .map((val) => formatTickLabel(val, sliderParams));
61
+ }
62
+ function formatTickLabel(value, params) {
63
+ return params.formatTooltip ? params.formatTooltip(value) : `${value}`;
64
+ }
65
+ /* v8 ignore stop */
66
+ //# sourceMappingURL=Slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Slider.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/Slider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;IAC/C,mBAAmB,EAAE,CAAC,QAAQ,EAAiC,EAAE,CAC/D,mBAAmB,CAAC,QAAQ,CAAC;QAC7B,QAAQ,CAAC,IAAI,KAAK,QAAQ;QAC1B,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CACrB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,wBAAwB,CAAC,MAAM,CAAC,OAAO,EAAE,CACpE;QACD,QAAQ,CAAC,eAAe,KAAK,mBAAmB,CAAC,MAAM;IACzD,gBAAgB,EAAE,SAAS;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEH,SAAS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G,CAAC,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,CAAC,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;QACxE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAChD,eAAe,CAAC,CAAC,GAAG,SAAS,GAAG,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CACpE,CAAC;IACJ,CAAC;IACD,OAAO,YAAY;SAChB,aAAa,EAAE,EAAE;SACjB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,eAAe,CAAC,KAAa,EAAE,MAA0B;IAChE,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;AACzE,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 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 type { SliderEditorParams } from \"@itwin/appui-abstract\";\nimport {\n PropertyEditorParamTypes,\n StandardEditorNames,\n} from \"@itwin/appui-abstract\";\nimport { Button, Icon, Popover, Slider } from \"@itwin/itwinui-react\";\nimport { useSliderEditorParams } from \"./UseEditorParams.js\";\nimport { findIcon } from \"../IconsRegistry.js\";\nimport { isNumeric } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const SliderEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"number\" &&\n !!metadata.params?.find(\n (param) => param.type === PropertyEditorParamTypes.Slider.valueOf()\n ) &&\n metadata.preferredEditor === StandardEditorNames.Slider,\n isValueSupported: isNumeric,\n Editor: SliderEditor,\n});\n\nfunction SliderEditor({\n metadata,\n value,\n disabled,\n onChange,\n commit,\n size,\n}: EditorProps<OldEditorMetadata, NumericValue>) {\n const sliderParams = useSliderEditorParams(metadata);\n if (!sliderParams) {\n return null;\n }\n\n const minLabel =\n sliderParams.showMinMax && sliderParams.minIconSpec ? (\n <Icon>{findIcon(sliderParams.minIconSpec)}</Icon>\n ) : undefined;\n const maxLabel =\n sliderParams.showMinMax && sliderParams.maxIconSpec ? (\n <Icon>{findIcon(sliderParams.maxIconSpec)}</Icon>\n ) : undefined;\n\n const handleChange = (values: ReadonlyArray<number>): void => {\n const newValue = values[0];\n onChange({ rawValue: newValue, displayValue: `${newValue}` });\n };\n\n const currentValue = value?.rawValue ?? sliderParams.minimum;\n const slider = (\n <Slider\n values={[currentValue]}\n min={sliderParams.minimum}\n max={sliderParams.maximum}\n step={sliderParams.step}\n thumbMode={\n 1 === sliderParams.mode ? \"allow-crossing\" : \"inhibit-crossing\"\n }\n trackDisplayMode={!sliderParams.reversed ? \"auto\" : \"odd-segments\"}\n minLabel={minLabel}\n maxLabel={maxLabel}\n tooltipProps={(_index, tooltipValue) => {\n return {\n placement: sliderParams.tooltipBelow ? \"bottom\" : \"top\",\n content: formatTickLabel(tooltipValue, sliderParams),\n visible: sliderParams.showTooltip,\n };\n }}\n tickLabels={getTickLabels(sliderParams)}\n onChange={handleChange}\n disabled={disabled}\n />\n );\n return (\n <Popover\n placement=\"bottom\"\n style={{ minWidth: \"300px\", padding: \"8px\" }}\n content={slider}\n onVisibleChange={(visible) => {\n if (!visible) {\n commit?.();\n }\n }}\n applyBackground={true}\n >\n <Button style={{ width: \"100%\" }} size={size} disabled={disabled}>\n {currentValue}\n </Button>\n </Popover>\n );\n}\n\nfunction getTickLabels(sliderParams: SliderEditorParams) {\n if (!sliderParams.showTicks || !sliderParams.showTickLabels) {\n return undefined;\n }\n const count = sliderParams.getTickCount ? sliderParams.getTickCount() : 0;\n if (count > 0) {\n const increment = (sliderParams.maximum - sliderParams.minimum) / count;\n return Array.from({ length: count + 1 }, (_, i) =>\n formatTickLabel(i * increment + sliderParams.minimum, sliderParams)\n );\n }\n return sliderParams\n .getTickValues?.()\n .map((val) => formatTickLabel(val, sliderParams));\n}\n\nfunction formatTickLabel(value: number, params: SliderEditorParams) {\n return params.formatTooltip ? params.formatTooltip(value) : `${value}`;\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,3 @@
1
+ /** @internal */
2
+ export declare const MultilineEditorSpec: import("../../Types.js").EditorSpec;
3
+ //# sourceMappingURL=TextArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/TextArea.tsx"],"names":[],"mappings":"AAeA,gBAAgB;AAChB,eAAO,MAAM,mBAAmB,qCAO9B,CAAC"}
@@ -0,0 +1,33 @@
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 { Button, Popover, Textarea } from "@itwin/itwinui-react";
7
+ import { createEditorSpec } from "../../Types.js";
8
+ import { isOldEditorMetadata } from "../Metadata.js";
9
+ import { StandardEditorNames } from "@itwin/appui-abstract";
10
+ import { isText } from "../../values/ValueUtilities.js";
11
+ /* v8 ignore start */
12
+ /** @internal */
13
+ export const MultilineEditorSpec = createEditorSpec({
14
+ isMetadataSupported: (metadata) => isOldEditorMetadata(metadata) &&
15
+ metadata.type === "string" &&
16
+ metadata.preferredEditor === StandardEditorNames.MultiLine,
17
+ isValueSupported: isText,
18
+ Editor: TextAreaEditor,
19
+ });
20
+ function TextAreaEditor({ value, onChange, commit, size, disabled, }) {
21
+ const currentValue = value ?? { value: "" };
22
+ return (React.createElement(Popover, { placement: "bottom", content: React.createElement(Textarea, { value: currentValue.value, onChange: (e) => {
23
+ const newValue = e.currentTarget.value;
24
+ onChange({ value: newValue });
25
+ } }), onVisibleChange: (visible) => {
26
+ if (!visible) {
27
+ commit?.();
28
+ }
29
+ } },
30
+ React.createElement(Button, { style: { width: "100%" }, size: size, disabled: disabled }, currentValue.value)));
31
+ }
32
+ /* v8 ignore stop */
33
+ //# sourceMappingURL=TextArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/TextArea.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAA0B,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;IAClD,mBAAmB,EAAE,CAAC,QAAQ,EAAiC,EAAE,CAC/D,mBAAmB,CAAC,QAAQ,CAAC;QAC7B,QAAQ,CAAC,IAAI,KAAK,QAAQ;QAC1B,QAAQ,CAAC,eAAe,KAAK,mBAAmB,CAAC,SAAS;IAC5D,gBAAgB,EAAE,MAAM;IACxB,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,EACtB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,GACkC;IAC1C,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAE5C,OAAO,CACL,oBAAC,OAAO,IACN,SAAS,EAAC,QAAQ,EAClB,OAAO,EACL,oBAAC,QAAQ,IACP,KAAK,EAAE,YAAY,CAAC,KAAK,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,MAAM,QAAQ,GAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;gBACvC,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;YAChC,CAAC,GACD,EAEJ,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,EAAE,EAAE,CAAC;YACb,CAAC;QACH,CAAC;QAED,oBAAC,MAAM,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,IAC7D,YAAY,CAAC,KAAK,CACZ,CACD,CACX,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 { Button, Popover, Textarea } from \"@itwin/itwinui-react\";\nimport { createEditorSpec, type EditorProps } from \"../../Types.js\";\nimport { isOldEditorMetadata, type OldEditorMetadata } from \"../Metadata.js\";\nimport { type TextValue } from \"../../values/Values.js\";\nimport { StandardEditorNames } from \"@itwin/appui-abstract\";\nimport { isText } from \"../../values/ValueUtilities.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const MultilineEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is OldEditorMetadata =>\n isOldEditorMetadata(metadata) &&\n metadata.type === \"string\" &&\n metadata.preferredEditor === StandardEditorNames.MultiLine,\n isValueSupported: isText,\n Editor: TextAreaEditor,\n});\n\nfunction TextAreaEditor({\n value,\n onChange,\n commit,\n size,\n disabled,\n}: EditorProps<OldEditorMetadata, TextValue>) {\n const currentValue = value ?? { value: \"\" };\n\n return (\n <Popover\n placement=\"bottom\"\n content={\n <Textarea\n value={currentValue.value}\n onChange={(e) => {\n const newValue = e.currentTarget.value;\n onChange({ value: newValue });\n }}\n />\n }\n onVisibleChange={(visible) => {\n if (!visible) {\n commit?.();\n }\n }}\n >\n <Button style={{ width: \"100%\" }} size={size} disabled={disabled}>\n {currentValue.value}\n </Button>\n </Popover>\n );\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,31 @@
1
+ import type { OldEditorMetadata } from "../Metadata.js";
2
+ import type { ButtonGroupEditorParams, ColorEditorParams, CustomFormattedNumberParams, IconEditorParams, InputEditorSizeParams, RangeEditorParams, SliderEditorParams } from "@itwin/appui-abstract";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare function useCustomFormattedNumberParams(metadata: OldEditorMetadata): CustomFormattedNumberParams | undefined;
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare function useInputEditorSizeParams(metadata: OldEditorMetadata): InputEditorSizeParams | undefined;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare function useIconEditorParams(metadata: OldEditorMetadata): IconEditorParams | undefined;
15
+ /**
16
+ * @internal
17
+ */
18
+ export declare function useButtonGroupEditorParams(metadata: OldEditorMetadata): ButtonGroupEditorParams | undefined;
19
+ /**
20
+ * @internal
21
+ */
22
+ export declare function useColorEditorParams(metadata: OldEditorMetadata): ColorEditorParams | undefined;
23
+ /**
24
+ * @internal
25
+ */
26
+ export declare function useRangeEditorParams(metadata: OldEditorMetadata): RangeEditorParams | undefined;
27
+ /**
28
+ * @internal
29
+ */
30
+ export declare function useSliderEditorParams(metadata: OldEditorMetadata): SliderEditorParams | undefined;
31
+ //# sourceMappingURL=UseEditorParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseEditorParams.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/UseEditorParams.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAK/B;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,iBAAiB,GAC1B,2BAA2B,GAAG,SAAS,CAUzC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,iBAAiB,GAC1B,qBAAqB,GAAG,SAAS,CASnC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,GAC1B,gBAAgB,GAAG,SAAS,CAQ9B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,iBAAiB,GAC1B,uBAAuB,GAAG,SAAS,CASrC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,GAAG,SAAS,CAQ/B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,GAAG,SAAS,CAQ/B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,iBAAiB,GAC1B,kBAAkB,GAAG,SAAS,CAQhC"}
@@ -0,0 +1,52 @@
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 { PropertyEditorParamTypes } from "@itwin/appui-abstract";
7
+ /* v8 ignore start */
8
+ /**
9
+ * @internal
10
+ */
11
+ export function useCustomFormattedNumberParams(metadata) {
12
+ return React.useMemo(() => metadata.params?.find((param) => param.type ===
13
+ PropertyEditorParamTypes.CustomFormattedNumber.valueOf()), [metadata]);
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ export function useInputEditorSizeParams(metadata) {
19
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()), [metadata]);
20
+ }
21
+ /**
22
+ * @internal
23
+ */
24
+ export function useIconEditorParams(metadata) {
25
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.Icon.valueOf()), [metadata]);
26
+ }
27
+ /**
28
+ * @internal
29
+ */
30
+ export function useButtonGroupEditorParams(metadata) {
31
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.ButtonGroupData.valueOf()), [metadata]);
32
+ }
33
+ /**
34
+ * @internal
35
+ */
36
+ export function useColorEditorParams(metadata) {
37
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.ColorData.valueOf()), [metadata]);
38
+ }
39
+ /**
40
+ * @internal
41
+ */
42
+ export function useRangeEditorParams(metadata) {
43
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.Range.valueOf()), [metadata]);
44
+ }
45
+ /**
46
+ * @internal
47
+ */
48
+ export function useSliderEditorParams(metadata) {
49
+ return React.useMemo(() => metadata.params?.find((param) => param.type === PropertyEditorParamTypes.Slider.valueOf()), [metadata]);
50
+ }
51
+ /* v8 ignore stop */
52
+ //# sourceMappingURL=UseEditorParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseEditorParams.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/UseEditorParams.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO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,CAAC,CACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA2B;IAE3B,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,QAAQ,CAAC,MAAM,EAAE,IAAI,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,wBAAwB,CAAC,SAAS,CAAC,OAAO,EAAE,CAClD,EACxB,CAAC,QAAQ,CAAC,CACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA2B;IAE3B,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,QAAQ,CAAC,MAAM,EAAE,IAAI,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,wBAAwB,CAAC,KAAK,CAAC,OAAO,EAAE,CAC9C,EACxB,CAAC,QAAQ,CAAC,CACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAA2B;IAE3B,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,QAAQ,CAAC,MAAM,EAAE,IAAI,CACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,wBAAwB,CAAC,MAAM,CAAC,OAAO,EAAE,CAC9C,EACzB,CAAC,QAAQ,CAAC,CACX,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 type { OldEditorMetadata } from \"../Metadata.js\";\nimport type {\n ButtonGroupEditorParams,\n ColorEditorParams,\n CustomFormattedNumberParams,\n IconEditorParams,\n InputEditorSizeParams,\n RangeEditorParams,\n SliderEditorParams,\n} from \"@itwin/appui-abstract\";\nimport { PropertyEditorParamTypes } from \"@itwin/appui-abstract\";\n\n/* v8 ignore start */\n\n/**\n * @internal\n */\nexport function useCustomFormattedNumberParams(\n metadata: OldEditorMetadata\n): CustomFormattedNumberParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) =>\n param.type ===\n PropertyEditorParamTypes.CustomFormattedNumber.valueOf()\n ) as CustomFormattedNumberParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useInputEditorSizeParams(\n metadata: OldEditorMetadata\n): InputEditorSizeParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) =>\n param.type === PropertyEditorParamTypes.InputEditorSize.valueOf()\n ) as InputEditorSizeParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useIconEditorParams(\n metadata: OldEditorMetadata\n): IconEditorParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) => param.type === PropertyEditorParamTypes.Icon.valueOf()\n ) as IconEditorParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useButtonGroupEditorParams(\n metadata: OldEditorMetadata\n): ButtonGroupEditorParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) =>\n param.type === PropertyEditorParamTypes.ButtonGroupData.valueOf()\n ) as ButtonGroupEditorParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useColorEditorParams(\n metadata: OldEditorMetadata\n): ColorEditorParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) => param.type === PropertyEditorParamTypes.ColorData.valueOf()\n ) as ColorEditorParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useRangeEditorParams(\n metadata: OldEditorMetadata\n): RangeEditorParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) => param.type === PropertyEditorParamTypes.Range.valueOf()\n ) as RangeEditorParams,\n [metadata]\n );\n}\n\n/**\n * @internal\n */\nexport function useSliderEditorParams(\n metadata: OldEditorMetadata\n): SliderEditorParams | undefined {\n return React.useMemo(\n () =>\n metadata.params?.find(\n (param) => param.type === PropertyEditorParamTypes.Slider.valueOf()\n ) as SliderEditorParams,\n [metadata]\n );\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,8 @@
1
+ import type { OldEditorMetadata } from "../Metadata.js";
2
+ import type { EnumValueMetadata } from "../../values/Metadata.js";
3
+ /**
4
+ * Converts old enum metadata definition into the new one. It takes care of lazy loaded choices.
5
+ * @internal
6
+ */
7
+ export declare function useEnumMetadata(oldMetadata: OldEditorMetadata): EnumValueMetadata;
8
+ //# sourceMappingURL=UseEnumMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseEnumMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/UseEnumMetadata.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,iBAAiB,GAC7B,iBAAiB,CAkCnB"}
@@ -0,0 +1,41 @@
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
+ /* v8 ignore start */
7
+ /**
8
+ * Converts old enum metadata definition into the new one. It takes care of lazy loaded choices.
9
+ * @internal
10
+ */
11
+ export function useEnumMetadata(oldMetadata) {
12
+ const [metadata, setMetadata] = React.useState(() => ({
13
+ type: "enum",
14
+ choices: [],
15
+ isStrict: false,
16
+ }));
17
+ React.useEffect(() => {
18
+ let disposed = false;
19
+ const loadChoices = async () => {
20
+ const loadedChoices = oldMetadata.enum === undefined
21
+ ? []
22
+ : oldMetadata.enum.choices instanceof Promise
23
+ ? [...(await oldMetadata.enum.choices)]
24
+ : [...oldMetadata.enum.choices];
25
+ if (!disposed) {
26
+ setMetadata({
27
+ type: "enum",
28
+ choices: loadedChoices,
29
+ isStrict: oldMetadata.enum?.isStrict ?? false,
30
+ });
31
+ }
32
+ };
33
+ void loadChoices();
34
+ return () => {
35
+ disposed = true;
36
+ };
37
+ }, [oldMetadata]);
38
+ return metadata;
39
+ }
40
+ /* v8 ignore stop */
41
+ //# sourceMappingURL=UseEnumMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseEnumMetadata.js","sourceRoot":"","sources":["../../../../../src/components-react/new-editors/interop/old-editors/UseEnumMetadata.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,qBAAqB;AAErB;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,WAA8B;IAE9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAoB,GAAG,EAAE,CAAC,CAAC;QACvE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;YAC7B,MAAM,aAAa,GACjB,WAAW,CAAC,IAAI,KAAK,SAAS;gBAC5B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,YAAY,OAAO;oBAC7C,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACvC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEpC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,WAAW,CAAC;oBACV,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,aAAa;oBACtB,QAAQ,EAAE,WAAW,CAAC,IAAI,EAAE,QAAQ,IAAI,KAAK;iBAC9C,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,KAAK,WAAW,EAAE,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,QAAQ,CAAC;AAClB,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 type { OldEditorMetadata } from \"../Metadata.js\";\nimport type { EnumValueMetadata } from \"../../values/Metadata.js\";\n\n/* v8 ignore start */\n\n/**\n * Converts old enum metadata definition into the new one. It takes care of lazy loaded choices.\n * @internal\n */\nexport function useEnumMetadata(\n oldMetadata: OldEditorMetadata\n): EnumValueMetadata {\n const [metadata, setMetadata] = React.useState<EnumValueMetadata>(() => ({\n type: \"enum\",\n choices: [],\n isStrict: false,\n }));\n\n React.useEffect(() => {\n let disposed = false;\n const loadChoices = async () => {\n const loadedChoices =\n oldMetadata.enum === undefined\n ? []\n : oldMetadata.enum.choices instanceof Promise\n ? [...(await oldMetadata.enum.choices)]\n : [...oldMetadata.enum.choices];\n\n if (!disposed) {\n setMetadata({\n type: \"enum\",\n choices: loadedChoices,\n isStrict: oldMetadata.enum?.isStrict ?? false,\n });\n }\n };\n\n void loadChoices();\n\n return () => {\n disposed = true;\n };\n }, [oldMetadata]);\n\n return metadata;\n}\n\n/* v8 ignore stop */\n"]}
@@ -0,0 +1,35 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ /**
5
+ * Value types supported by editor system.
6
+ * @beta
7
+ */
8
+ export type ValueType = "string" | "number" | "bool" | "date" | "dateTime" | "enum" | "instanceKey" | (string & {});
9
+ /**
10
+ * Additional metadata that is used along side value.
11
+ * @beta
12
+ */
13
+ export interface ValueMetadata {
14
+ type: ValueType;
15
+ preferredEditor?: string;
16
+ isNullable?: boolean;
17
+ }
18
+ /**
19
+ * Type definition for available enum choice that can be supplied for editing enum values.
20
+ * @beta
21
+ */
22
+ export interface EnumChoice {
23
+ value: number | string;
24
+ label: string;
25
+ }
26
+ /**
27
+ * Additional metadata that is used along side enum value to determine applicable editor.
28
+ * @beta
29
+ */
30
+ export interface EnumValueMetadata extends ValueMetadata {
31
+ type: "enum";
32
+ choices: EnumChoice[];
33
+ isStrict: boolean;
34
+ }
35
+ //# sourceMappingURL=Metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metadata.d.ts","sourceRoot":"","sources":["../../../../src/components-react/new-editors/values/Metadata.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,MAAM,GACN,aAAa,GACb,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=Metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../../src/components-react/new-editors/values/Metadata.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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\n/**\n * Value types supported by editor system.\n * @beta\n */\nexport type ValueType =\n | \"string\"\n | \"number\"\n | \"bool\"\n | \"date\"\n | \"dateTime\"\n | \"enum\"\n | \"instanceKey\"\n | (string & {});\n\n/**\n * Additional metadata that is used along side value.\n * @beta\n */\nexport interface ValueMetadata {\n type: ValueType;\n preferredEditor?: string;\n isNullable?: boolean;\n}\n\n/**\n * Type definition for available enum choice that can be supplied for editing enum values.\n * @beta\n */\nexport interface EnumChoice {\n value: number | string;\n label: string;\n}\n\n/**\n * Additional metadata that is used along side enum value to determine applicable editor.\n * @beta\n */\nexport interface EnumValueMetadata extends ValueMetadata {\n type: \"enum\";\n choices: EnumChoice[];\n isStrict: boolean;\n}\n"]}
@@ -0,0 +1,40 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ import type { BooleanValue, DateValue, EnumValue, InstanceKeyValue, NumericValue, TextValue, Value } from "./Values.js";
5
+ /**
6
+ * Type guard for text value.
7
+ * @beta
8
+ */
9
+ export declare function isText(value: Value): value is TextValue;
10
+ /**
11
+ * Type guard for numeric value.
12
+ * @beta
13
+ */
14
+ export declare function isNumeric(value: Value): value is NumericValue;
15
+ /**
16
+ * Type guard for boolean value.
17
+ * @beta
18
+ */
19
+ export declare function isBoolean(value: Value): value is BooleanValue;
20
+ /**
21
+ * Type guard for date value.
22
+ * @beta
23
+ */
24
+ export declare function isDate(value: Value): value is DateValue;
25
+ /**
26
+ * Type guard for enum value.
27
+ * @beta
28
+ */
29
+ export declare function isEnum(value: Value): value is EnumValue;
30
+ /**
31
+ * Type guard for instance key value.
32
+ * @beta
33
+ */
34
+ export declare function isInstanceKey(value: Value): value is InstanceKeyValue;
35
+ /**
36
+ * Checks if two values are equal.
37
+ * @beta
38
+ */
39
+ export declare function areEqual(lhs: Value | undefined, rhs: Value | undefined): boolean;
40
+ //# sourceMappingURL=ValueUtilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValueUtilities.d.ts","sourceRoot":"","sources":["../../../../src/components-react/new-editors/values/ValueUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,KAAK,EACN,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,CAEvD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE7D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE7D;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,CAEvD;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,CAEvD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,gBAAgB,CAErE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,KAAK,GAAG,SAAS,EACtB,GAAG,EAAE,KAAK,GAAG,SAAS,GACrB,OAAO,CA8BT"}