@itwin/appui-react 5.5.0 → 5.7.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 (99) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/lib/appui-react/UiFramework.json +3 -1
  3. package/lib/appui-react/editors/CustomNumberEditor.d.ts +10 -0
  4. package/lib/appui-react/editors/CustomNumberEditor.d.ts.map +1 -0
  5. package/lib/appui-react/editors/CustomNumberEditor.js +24 -0
  6. package/lib/appui-react/editors/CustomNumberEditor.js.map +1 -0
  7. package/lib/appui-react/editors/LockEditor.d.ts +12 -0
  8. package/lib/appui-react/editors/LockEditor.d.ts.map +1 -0
  9. package/lib/appui-react/editors/LockEditor.js +64 -0
  10. package/lib/appui-react/editors/LockEditor.js.map +1 -0
  11. package/lib/appui-react/editors/LockProvider.d.ts +48 -0
  12. package/lib/appui-react/editors/LockProvider.d.ts.map +1 -0
  13. package/lib/appui-react/editors/LockProvider.js +121 -0
  14. package/lib/appui-react/editors/LockProvider.js.map +1 -0
  15. package/lib/appui-react/editors/NumericEditor.d.ts +10 -0
  16. package/lib/appui-react/editors/NumericEditor.d.ts.map +1 -0
  17. package/lib/appui-react/editors/NumericEditor.js +24 -0
  18. package/lib/appui-react/editors/NumericEditor.js.map +1 -0
  19. package/lib/appui-react/editors/TextEditor.d.ts +10 -0
  20. package/lib/appui-react/editors/TextEditor.d.ts.map +1 -0
  21. package/lib/appui-react/editors/TextEditor.js +24 -0
  22. package/lib/appui-react/editors/TextEditor.js.map +1 -0
  23. package/lib/appui-react/editors/registerEditors.d.ts +6 -0
  24. package/lib/appui-react/editors/registerEditors.d.ts.map +1 -0
  25. package/lib/appui-react/editors/registerEditors.js +28 -0
  26. package/lib/appui-react/editors/registerEditors.js.map +1 -0
  27. package/lib/appui-react/hooks/useControlledState.d.ts +4 -0
  28. package/lib/appui-react/hooks/useControlledState.d.ts.map +1 -0
  29. package/lib/appui-react/hooks/useControlledState.js +16 -0
  30. package/lib/appui-react/hooks/useControlledState.js.map +1 -0
  31. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts +7 -0
  32. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts.map +1 -0
  33. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js +14 -0
  34. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js.map +1 -0
  35. package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts +7 -0
  36. package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts.map +1 -0
  37. package/lib/appui-react/icons/snaps/SvgSnapsTangent.js +14 -0
  38. package/lib/appui-react/icons/snaps/SvgSnapsTangent.js.map +1 -0
  39. package/lib/appui-react/new-editors/CustomNumberEditor.d.ts +7 -0
  40. package/lib/appui-react/new-editors/CustomNumberEditor.d.ts.map +1 -0
  41. package/lib/appui-react/new-editors/CustomNumberEditor.js +18 -0
  42. package/lib/appui-react/new-editors/CustomNumberEditor.js.map +1 -0
  43. package/lib/appui-react/new-editors/LockEditor.d.ts +3 -0
  44. package/lib/appui-react/new-editors/LockEditor.d.ts.map +1 -0
  45. package/lib/appui-react/new-editors/LockEditor.js +40 -0
  46. package/lib/appui-react/new-editors/LockEditor.js.map +1 -0
  47. package/lib/appui-react/new-editors/NumericEditor.d.ts +3 -0
  48. package/lib/appui-react/new-editors/NumericEditor.d.ts.map +1 -0
  49. package/lib/appui-react/new-editors/NumericEditor.js +34 -0
  50. package/lib/appui-react/new-editors/NumericEditor.js.map +1 -0
  51. package/lib/appui-react/new-editors/TextEditor.d.ts +3 -0
  52. package/lib/appui-react/new-editors/TextEditor.d.ts.map +1 -0
  53. package/lib/appui-react/new-editors/TextEditor.js +23 -0
  54. package/lib/appui-react/new-editors/TextEditor.js.map +1 -0
  55. package/lib/appui-react/preview/PreviewFeatures.d.ts +6 -0
  56. package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
  57. package/lib/appui-react/preview/PreviewFeatures.js +1 -0
  58. package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
  59. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts +7 -0
  60. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts.map +1 -0
  61. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js +55 -0
  62. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js.map +1 -0
  63. package/lib/appui-react/preview/tool-settings-new-editors/{useToolsSettingsNewEditors.d.ts → useToolSettingsNewEditors.d.ts} +1 -1
  64. package/lib/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.d.ts.map +1 -0
  65. package/lib/appui-react/preview/tool-settings-new-editors/{useToolsSettingsNewEditors.js → useToolSettingsNewEditors.js} +1 -1
  66. package/lib/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.js.map +1 -0
  67. package/lib/appui-react/statusfields/SnapMode.d.ts.map +1 -1
  68. package/lib/appui-react/statusfields/SnapMode.js +24 -0
  69. package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
  70. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +12 -1
  71. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  72. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +13 -17
  73. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  74. package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
  75. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +1 -1
  76. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
  77. package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
  78. package/lib/appui-react/toolbar/new-toolbars/Item.js +1 -1
  79. package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
  80. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.d.ts.map +1 -1
  81. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +12 -3
  82. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  83. package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
  84. package/lib/appui-react/uiprovider/ComponentGenerator.js +27 -14
  85. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  86. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.d.ts.map +1 -1
  87. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js +2 -1
  88. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js.map +1 -1
  89. package/lib/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  90. package/lib/appui-react/widget-panels/ToolSettings.js +12 -7
  91. package/lib/appui-react/widget-panels/ToolSettings.js.map +1 -1
  92. package/lib/appui-react.d.ts +1 -0
  93. package/lib/appui-react.d.ts.map +1 -1
  94. package/lib/appui-react.js +3 -0
  95. package/lib/appui-react.js.map +1 -1
  96. package/lib/public/locales/en/UiFramework.json +3 -1
  97. package/package.json +7 -7
  98. package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.d.ts.map +0 -1
  99. package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,148 @@
1
1
  # Change Log - @itwin/appui-react
2
2
 
3
+ ## 5.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6a13347: Add `data-item-id` attributes to toolbar items of `Toolbar` component.
8
+ - ba32702: Added new `SnapMode.PerpendicularPoint` and `SnapMode.TangentPoint` options to the `SnapModeField` component. These new snap modes are only available when using the `@itwin/core-frontend@>=5.0.0`.
9
+ - e3f7b56: Updated tool settings to display the lock button as an input decoration when the `toolSettingsLockButton` preview feature is enabled. This is supported when using the new editor system via the `toolSettingsNewEditors` preview feature.
10
+
11
+ Editors that support the lock button input decoration:
12
+
13
+ - Text editor
14
+ - Numeric editor
15
+ - Custom number editor
16
+
17
+ A separate control will still be displayed as a sibling if the lock cannot be displayed by the editor. Common cases include:
18
+
19
+ - Non-input editors (i.e. locking a toggle property)
20
+ - Custom editors (i.e. custom editor implementations that do not display the lock decoration)
21
+
22
+ Note that a separate lock control can only be displayed for the first dialog item in a row. Consider this scenario:
23
+
24
+ ```tsx
25
+ const useX = new DialogProperty();
26
+ const x = new DialogProperty();
27
+
28
+ const useY = new DialogProperty();
29
+ const y = new DialogProperty();
30
+
31
+ // Tool is supplying these tool setting properties.
32
+ const dialogItems = [
33
+ x.toDialogItem(
34
+ {
35
+ columnIndex: 0,
36
+ rowPriority: 1,
37
+ },
38
+ useX.toDialogItem({ columnIndex: 0, rowPriority: 1 })
39
+ ),
40
+ y.toDialogItem(
41
+ {
42
+ columnIndex: 0,
43
+ rowPriority: 1,
44
+ },
45
+ useY.toDialogItem({ columnIndex: 0, rowPriority: 1 })
46
+ ),
47
+ ];
48
+
49
+ // The old behavior would display the lock as a separate control for the first dialog item of the row, which is `x`.
50
+ // The new behavior will display the lock as an input decoration for both `x` and `y`. A separate lock control might be displayed for `x` only.
51
+ ```
52
+
53
+ Added `LockButtonInputDecoration` component to allow consumers to display the lock button as an input decoration in custom editors. For now this component is only compatible with the [iTwinUI Input](https://itwinui.bentley.com/docs/inputwithdecorations), but additional APIs can be exposed in the future. Usage example:
54
+
55
+ ```tsx
56
+ function MyCustomEditor(props) {
57
+ // ...
58
+ return (
59
+ <InputWithDecorations>
60
+ {/* ... */}
61
+ <LockButtonInputDecoration />
62
+ </InputWithDecorations>
63
+ );
64
+ }
65
+ ```
66
+
67
+ - fe40d0a: Add `visible`, `onVisibleChange`, `pinned` and `onPinnedChange` props to `ToolAssistanceField` component. These props can be used to manually control the visibility and pinned state of the field.
68
+
69
+ ```tsx
70
+ function CustomField(props) {
71
+ // Field is open by default
72
+ const [visible, setVisible] = React.useState(true);
73
+ return (
74
+ <ToolAssistanceField
75
+ {...props}
76
+ visible={visible}
77
+ // Update the state so the field can be opened/closed
78
+ onVisibleChange={setVisible}
79
+ // Field is always pinned
80
+ pinned={true}
81
+ />
82
+ );
83
+ }
84
+ ```
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [fd58c9f]
89
+ - @itwin/components-react@5.7.0
90
+ - @itwin/imodel-components-react@5.7.0
91
+ - @itwin/core-react@5.7.0
92
+
93
+ ## 5.6.0
94
+
95
+ ### Minor Changes
96
+
97
+ - 1d29f92: Added `toolSettingsLockButton` preview feature, which when enabled will render an icon button instead of a checkbox as the default tool settings lock editor.
98
+
99
+ ```tsx
100
+ <PreviewFeaturesProvider
101
+ features={{
102
+ toolSettingsLockButton: true,
103
+ }}
104
+ >
105
+ <App />
106
+ </PreviewFeaturesProvider>
107
+ ```
108
+
109
+ Displayed icon button can be customized via the `BaseDialogItem` interface.
110
+
111
+ ```ts
112
+ const propertyDescription =
113
+ PropertyDescriptionHelper.buildLockPropertyDescription("useLength");
114
+ propertyDescription.displayLabel = "Toggle length lock";
115
+
116
+ const property: BaseDialogItem = {
117
+ value: {
118
+ value: true,
119
+ },
120
+ property: propertyDescription,
121
+ isDisabled: true,
122
+ };
123
+ // Displays an active, disabled icon button with a custom label.
124
+ ```
125
+
126
+ Custom lock editor components can still be displayed by customizing the lock `PropertyDescription`, even if `toolSettingsLockButton` is enabled.
127
+
128
+ ```ts
129
+ const property =
130
+ PropertyDescriptionHelper.buildLockPropertyDescription("useRadius");
131
+ property.editor = {
132
+ name: StandardEditorNames.Toggle,
133
+ };
134
+ // Displays a switch component.
135
+ ```
136
+
137
+ - 6c97fa4: Updated the tool settings data provider to invoke `IModelApp.toolAdmin.simulateMotionEvent` after applying the tool setting property change. This causes the update to the dynamic graphics of the active tool without requiring an explicit motion event. `simulateMotionEvent` is only available from `v5.0` of `@itwin/core-frontend`.
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies [a4b74f9]
142
+ - @itwin/components-react@5.6.0
143
+ - @itwin/imodel-components-react@5.6.0
144
+ - @itwin/core-react@5.6.0
145
+
3
146
  ## 5.5.0
4
147
 
5
148
  ### Minor Changes
@@ -62,7 +62,9 @@
62
62
  "origin": "Origin",
63
63
  "midpoint": "Midpoint",
64
64
  "bisector": "Bisector",
65
- "multi": "Multiple"
65
+ "multi": "Multiple",
66
+ "perpendicularPoint": "Perpendicular point",
67
+ "tangentPoint": "Tangent point"
66
68
  },
67
69
  "selectionScopeField": {
68
70
  "label": "Scope",
@@ -0,0 +1,10 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ import * as React from "react";
5
+ import { CustomNumberPropertyEditor as BaseCustomNumberPropertyEditor } from "@itwin/components-react";
6
+ /** @internal */
7
+ export declare class CustomNumberPropertyEditor extends BaseCustomNumberPropertyEditor {
8
+ get reactNode(): React.JSX.Element;
9
+ }
10
+ //# sourceMappingURL=CustomNumberEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomNumberEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/CustomNumberEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,0BAA0B,IAAI,8BAA8B,EAC7D,MAAM,yBAAyB,CAAC;AAOjC,gBAAgB;AAChB,qBAAa,0BAA2B,SAAQ,8BAA8B;IAC5E,IAAoB,SAAS,sBAE5B;CACF"}
@@ -0,0 +1,24 @@
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 { CustomNumberEditor as BaseCustomNumberEditor, CustomNumberPropertyEditor as BaseCustomNumberPropertyEditor, } from "@itwin/components-react";
10
+ import { LockButtonInputDecoration, useLockDecoration, } from "./LockProvider.js";
11
+ /** @internal */
12
+ export class CustomNumberPropertyEditor extends BaseCustomNumberPropertyEditor {
13
+ get reactNode() {
14
+ return React.createElement(CustomNumberEditor, null);
15
+ }
16
+ }
17
+ const CustomNumberEditor = React.forwardRef(function CustomNumberEditor(props, forwardedRef) {
18
+ const lockDecoration = useLockDecoration();
19
+ const internalProps = {
20
+ decoration: lockDecoration ? React.createElement(LockButtonInputDecoration, null) : undefined,
21
+ };
22
+ return (React.createElement(BaseCustomNumberEditor, { ...props, ...internalProps, ref: forwardedRef }));
23
+ });
24
+ //# sourceMappingURL=CustomNumberEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomNumberEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/CustomNumberEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,IAAI,sBAAsB,EAC5C,0BAA0B,IAAI,8BAA8B,GAC7D,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,OAAO,0BAA2B,SAAQ,8BAA8B;IAC5E,IAAoB,SAAS;QAC3B,OAAO,oBAAC,kBAAkB,OAAG,CAAC;IAChC,CAAC;CACF;AAED,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,SAAS,kBAAkB,CAAC,KAAK,EAAE,YAAY;IAC7C,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG;QACpB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,oBAAC,yBAAyB,OAAG,CAAC,CAAC,CAAC,SAAS;KACpC,CAAC;IACrC,OAAO,CACL,oBAAC,sBAAsB,OACjB,KAAK,KACL,aAAa,EACjB,GAAG,EAAE,YAAY,GACjB,CACH,CAAC;AACJ,CAAC,CACF,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyEditors\n */\n\nimport * as React from \"react\";\nimport {\n CustomNumberEditor as BaseCustomNumberEditor,\n CustomNumberPropertyEditor as BaseCustomNumberPropertyEditor,\n} from \"@itwin/components-react\";\nimport type { InternalInputEditorProps } from \"@itwin/components-react/internal\";\nimport {\n LockButtonInputDecoration,\n useLockDecoration,\n} from \"./LockProvider.js\";\n\n/** @internal */\nexport class CustomNumberPropertyEditor extends BaseCustomNumberPropertyEditor {\n public override get reactNode() {\n return <CustomNumberEditor />;\n }\n}\n\nconst CustomNumberEditor = React.forwardRef<BaseCustomNumberEditor>(\n function CustomNumberEditor(props, forwardedRef) {\n const lockDecoration = useLockDecoration();\n const internalProps = {\n decoration: lockDecoration ? <LockButtonInputDecoration /> : undefined,\n } satisfies InternalInputEditorProps;\n return (\n <BaseCustomNumberEditor\n {...props}\n {...internalProps}\n ref={forwardedRef}\n />\n );\n }\n);\n"]}
@@ -0,0 +1,12 @@
1
+ /** @packageDocumentation
2
+ * @module UiProvider
3
+ */
4
+ import * as React from "react";
5
+ import { PropertyEditorBase } from "@itwin/components-react";
6
+ /** @internal */
7
+ export declare class LockPropertyEditor extends PropertyEditorBase {
8
+ get reactNode(): React.JSX.Element;
9
+ }
10
+ /** @internal */
11
+ export declare const LockPropertyEditorName = "appui-internal:tool-settings-lock";
12
+ //# sourceMappingURL=LockEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LockEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAyE7D,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS,sBAEnB;CACF;AAED,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,sCAAsC,CAAC"}
@@ -0,0 +1,64 @@
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 UiProvider
7
+ */
8
+ import * as React from "react";
9
+ import { PropertyEditorBase } from "@itwin/components-react";
10
+ import { IconButton } from "@itwin/itwinui-react";
11
+ import { SvgLock, SvgLockUnlocked } from "@itwin/itwinui-icons-react";
12
+ import { PropertyValueFormat } from "@itwin/appui-abstract";
13
+ const LockEditor = React.forwardRef(function LockEditor(props, forwardedRef) {
14
+ const ref = React.useRef(null);
15
+ const getCurrentValue = () => {
16
+ if (props.propertyRecord &&
17
+ props.propertyRecord.value.valueFormat === PropertyValueFormat.Primitive) {
18
+ return props.propertyRecord.value.value;
19
+ }
20
+ return false;
21
+ };
22
+ const currentValue = getCurrentValue();
23
+ React.useImperativeHandle(forwardedRef, () => ({
24
+ getPropertyValue: async () => {
25
+ let propertyValue;
26
+ if (props.propertyRecord &&
27
+ props.propertyRecord.value.valueFormat ===
28
+ PropertyValueFormat.Primitive) {
29
+ propertyValue = {
30
+ valueFormat: PropertyValueFormat.Primitive,
31
+ value: currentValue,
32
+ displayValue: "",
33
+ };
34
+ }
35
+ return propertyValue;
36
+ },
37
+ htmlElement: ref.current,
38
+ hasFocus: document.activeElement === ref.current,
39
+ }), [currentValue, props.propertyRecord]);
40
+ const displayLabel = props.propertyRecord?.property.displayLabel;
41
+ const label = displayLabel ? displayLabel : "Toggle lock";
42
+ const disabled = props.propertyRecord?.isDisabled;
43
+ return (React.createElement(IconButton, { ref: ref, label: label, size: "small", styleType: "borderless", isActive: currentValue, disabled: disabled, onClick: () => {
44
+ if (!props.propertyRecord || !props.onCommit)
45
+ return;
46
+ props.onCommit({
47
+ propertyRecord: props.propertyRecord,
48
+ newValue: {
49
+ valueFormat: PropertyValueFormat.Primitive,
50
+ value: !currentValue,
51
+ displayValue: "",
52
+ },
53
+ });
54
+ } }, currentValue ? React.createElement(SvgLock, null) : React.createElement(SvgLockUnlocked, null)));
55
+ });
56
+ /** @internal */
57
+ export class LockPropertyEditor extends PropertyEditorBase {
58
+ get reactNode() {
59
+ return React.createElement(LockEditor, null);
60
+ }
61
+ }
62
+ /** @internal */
63
+ export const LockPropertyEditorName = "appui-internal:tool-settings-lock";
64
+ //# sourceMappingURL=LockEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LockEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,SAAS,UAAU,CAAC,KAAK,EAAE,YAAY;IACrC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,IACE,KAAK,CAAC,cAAc;YACpB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,EACxE,CAAC;YACD,OAAO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAgB,CAAC;QACrD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IACF,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,KAAK,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AAC,YAAY;oBACpB,YAAY,EAAE,EAAE;iBACjB;aACF,CAAC,CAAC;QACL,CAAC,IAEA,YAAY,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CACtC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB;AAChB,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,mCAAmC,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiProvider\n */\n\nimport * as React from \"react\";\nimport type { PropertyEditorProps, TypeEditor } from \"@itwin/components-react\";\nimport { PropertyEditorBase } from \"@itwin/components-react\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport type { PropertyValue } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\n\nconst LockEditor = React.forwardRef<TypeEditor, PropertyEditorProps>(\n function LockEditor(props, forwardedRef) {\n const ref = React.useRef<HTMLButtonElement>(null);\n const getCurrentValue = () => {\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n return props.propertyRecord.value.value as boolean;\n }\n return false;\n };\n const currentValue = getCurrentValue();\n\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n getPropertyValue: async () => {\n let propertyValue: PropertyValue | undefined;\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n ) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: currentValue,\n displayValue: \"\",\n };\n }\n return propertyValue;\n },\n htmlElement: ref.current,\n hasFocus: document.activeElement === ref.current,\n }),\n [currentValue, props.propertyRecord]\n );\n\n const displayLabel = props.propertyRecord?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = props.propertyRecord?.isDisabled;\n return (\n <IconButton\n ref={ref}\n label={label}\n size=\"small\"\n styleType=\"borderless\"\n isActive={currentValue}\n disabled={disabled}\n onClick={() => {\n if (!props.propertyRecord || !props.onCommit) return;\n props.onCommit({\n propertyRecord: props.propertyRecord,\n newValue: {\n valueFormat: PropertyValueFormat.Primitive,\n value: !currentValue,\n displayValue: \"\",\n },\n });\n }}\n >\n {currentValue ? <SvgLock /> : <SvgLockUnlocked />}\n </IconButton>\n );\n }\n);\n\n/** @internal */\nexport class LockPropertyEditor extends PropertyEditorBase {\n public get reactNode() {\n return <LockEditor />;\n }\n}\n\n/** @internal */\nexport const LockPropertyEditorName = \"appui-internal:tool-settings-lock\";\n"]}
@@ -0,0 +1,48 @@
1
+ /** @packageDocumentation
2
+ * @module ToolSettings
3
+ */
4
+ import * as React from "react";
5
+ import type { UiLayoutDataProvider } from "@itwin/appui-abstract";
6
+ /** This is used to notify the parent component that the lock decoration is displayed in the editor
7
+ * and a separate lock component should not be displayed as a sibling.
8
+ * @internal
9
+ */
10
+ export declare const LockContext: React.Context<{
11
+ /** Describes if the lock is displayed as an editor decoration. */
12
+ lockDecorations: Record<string, true>;
13
+ /** Called by editors that display lock decoration. */
14
+ setLockDecoration: (propertyName: string, lockDecoration: boolean) => void;
15
+ } | undefined>;
16
+ /** @internal */
17
+ export declare function LockProvider({ children }: React.PropsWithChildren): React.JSX.Element;
18
+ /** Additional context for property editors that support lock decoration.
19
+ * @internal
20
+ */
21
+ export declare const PropertyEditorContext: React.Context<{
22
+ uiDataProvider: UiLayoutDataProvider;
23
+ itemPropertyName: string;
24
+ /** Specified when rendering a lock editor. */
25
+ lockPropertyName: string | undefined;
26
+ } | undefined>;
27
+ type PropertyEditorContextType = React.ContextType<typeof PropertyEditorContext>;
28
+ interface PropertyEditorProviderProps extends NonNullable<PropertyEditorContextType> {
29
+ children?: React.ReactNode;
30
+ }
31
+ /** @internal */
32
+ export declare function PropertyEditorProvider(props: PropertyEditorProviderProps): React.JSX.Element;
33
+ /** Returns `true` if the lock decoration should be displayed.
34
+ * @internal
35
+ */
36
+ export declare function useLockDecoration(): boolean;
37
+ interface UseLockPropertyArgs {
38
+ provider: UiLayoutDataProvider;
39
+ itemPropertyName: string;
40
+ }
41
+ /** @internal */
42
+ export declare function useLockProperty(args: UseLockPropertyArgs | undefined): import("@itwin/appui-abstract").BaseDialogItem | undefined;
43
+ /** This component displays a lock button in the property editor when the `toolSettingsLockButton` preview feature is enabled.
44
+ * @alpha
45
+ */
46
+ export declare function LockButtonInputDecoration(): React.JSX.Element | null;
47
+ export {};
48
+ //# sourceMappingURL=LockProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LockProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/LockProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,WAAW;IAElB,kEAAkE;qBACjD,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;IACrC,sDAAsD;uBACnC,CACjB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,OAAO,KACpB,IAAI;cAGH,CAAC;AAEb,gBAAgB;AAChB,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,qBAgCjE;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;oBAEZ,oBAAoB;sBAClB,MAAM;IACxB,8CAA8C;sBAC5B,MAAM,GAAG,SAAS;cAG9B,CAAC;AAEb,KAAK,yBAAyB,GAAG,KAAK,CAAC,WAAW,CAChD,OAAO,qBAAqB,CAC7B,CAAC;AAEF,UAAU,2BACR,SAAQ,WAAW,CAAC,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,qBAiBxE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,YAchC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,SAAS,8DAqBpE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,6BAuDxC"}
@@ -0,0 +1,121 @@
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 ToolSettings
7
+ */
8
+ import * as React from "react";
9
+ import { InputWithDecorations } from "@itwin/itwinui-react";
10
+ import { SvgLock, SvgLockUnlocked } from "@itwin/itwinui-icons-react";
11
+ import { produce } from "immer";
12
+ import { usePreviewFeatures } from "../preview/PreviewFeatures.js";
13
+ /** This is used to notify the parent component that the lock decoration is displayed in the editor
14
+ * and a separate lock component should not be displayed as a sibling.
15
+ * @internal
16
+ */
17
+ export const LockContext = React.createContext(undefined);
18
+ /** @internal */
19
+ export function LockProvider({ children }) {
20
+ const [lockDecorations, setLockDecorations] = React.useState({});
21
+ const setLockDecoration = React.useCallback((propertyName, lockDecoration) => {
22
+ setLockDecorations(produce((draft) => {
23
+ if (lockDecoration) {
24
+ draft[propertyName] = true;
25
+ return;
26
+ }
27
+ delete draft[propertyName];
28
+ }));
29
+ }, []);
30
+ return (React.createElement(LockContext.Provider, { value: React.useMemo(() => ({
31
+ lockDecorations,
32
+ setLockDecoration,
33
+ }), [lockDecorations, setLockDecoration]) }, children));
34
+ }
35
+ /** Additional context for property editors that support lock decoration.
36
+ * @internal
37
+ */
38
+ export const PropertyEditorContext = React.createContext(undefined);
39
+ /** @internal */
40
+ export function PropertyEditorProvider(props) {
41
+ const { children, uiDataProvider, itemPropertyName, lockPropertyName } = props;
42
+ return (React.createElement(PropertyEditorContext.Provider, { value: React.useMemo(() => ({
43
+ uiDataProvider,
44
+ itemPropertyName,
45
+ lockPropertyName,
46
+ }), [uiDataProvider, itemPropertyName, lockPropertyName]) }, children));
47
+ }
48
+ /** Returns `true` if the lock decoration should be displayed.
49
+ * @internal
50
+ */
51
+ export function useLockDecoration() {
52
+ const { lockPropertyName, itemPropertyName, uiDataProvider } = React.useContext(PropertyEditorContext) ?? {};
53
+ const { toolSettingsLockButton } = usePreviewFeatures();
54
+ const dialogItem = React.useMemo(() => uiDataProvider?.items.find((item) => item.property.name === itemPropertyName), [uiDataProvider, itemPropertyName]);
55
+ return (!!toolSettingsLockButton && !lockPropertyName && !!dialogItem?.lockProperty);
56
+ }
57
+ /** @internal */
58
+ export function useLockProperty(args) {
59
+ const { provider, itemPropertyName } = args ?? {};
60
+ const subscribe = React.useCallback((onStoreChange) => {
61
+ const listeners = provider
62
+ ? [
63
+ provider.onItemsReloadedEvent.addListener(onStoreChange),
64
+ provider.onSyncPropertiesChangeEvent.addListener(onStoreChange),
65
+ ]
66
+ : [];
67
+ return () => listeners.forEach((l) => l());
68
+ }, [provider]);
69
+ const getSnapshot = React.useCallback(() => {
70
+ const dialogItem = provider?.items.find((item) => item.property.name === itemPropertyName);
71
+ return dialogItem?.lockProperty;
72
+ }, [provider, itemPropertyName]);
73
+ return React.useSyncExternalStore(subscribe, getSnapshot);
74
+ }
75
+ /** This component displays a lock button in the property editor when the `toolSettingsLockButton` preview feature is enabled.
76
+ * @alpha
77
+ */
78
+ export function LockButtonInputDecoration() {
79
+ const { itemPropertyName, uiDataProvider: provider } = React.useContext(PropertyEditorContext) ?? {};
80
+ const { setLockDecoration } = React.useContext(LockContext) ?? {};
81
+ const lockDecoration = useLockDecoration();
82
+ const lockProperty = useLockProperty(provider && itemPropertyName
83
+ ? {
84
+ provider,
85
+ itemPropertyName,
86
+ }
87
+ : undefined);
88
+ React.useLayoutEffect(() => {
89
+ if (!lockDecoration)
90
+ return;
91
+ if (!setLockDecoration)
92
+ return;
93
+ if (!itemPropertyName)
94
+ return;
95
+ setLockDecoration(itemPropertyName, true);
96
+ return () => {
97
+ setLockDecoration(itemPropertyName, false);
98
+ };
99
+ }, [setLockDecoration, itemPropertyName, lockDecoration]);
100
+ if (!lockDecoration)
101
+ return null;
102
+ const isLocked = !!lockProperty?.value.value;
103
+ const displayLabel = lockProperty?.property.displayLabel;
104
+ const label = displayLabel ? displayLabel : "Toggle lock";
105
+ const disabled = lockProperty?.isDisabled;
106
+ return (React.createElement(InputWithDecorations.Button, { isActive: isLocked, label: label, disabled: disabled, size: "small", styleType: "borderless", onClick: () => {
107
+ if (!provider)
108
+ return;
109
+ if (!lockProperty)
110
+ return;
111
+ provider.applyUiPropertyChange({
112
+ value: {
113
+ ...lockProperty.value,
114
+ value: !isLocked,
115
+ },
116
+ propertyName: lockProperty.property.name,
117
+ });
118
+ provider.reloadDialogItems();
119
+ } }, isLocked ? React.createElement(SvgLock, null) : React.createElement(SvgLockUnlocked, null)));
120
+ }
121
+ //# sourceMappingURL=LockProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LockProvider.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,OA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,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1D,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,QAAQ,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC;IAC7C,MAAM,YAAY,GAAG,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC;IACzD,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAC1D,MAAM,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC;IAC1C,OAAO,CACL,oBAAC,oBAAoB,CAAC,MAAM,IAC1B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,IAAI,CAAC,YAAY;gBAAE,OAAO;YAE1B,QAAQ,CAAC,qBAAqB,CAAC;gBAC7B,KAAK,EAAE;oBACL,GAAG,YAAY,CAAC,KAAK;oBACrB,KAAK,EAAE,CAAC,QAAQ;iBACjB;gBACD,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI;aACzC,CAAC,CAAC;YACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAC/B,CAAC,IAEA,QAAQ,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CACjB,CAC/B,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ToolSettings\n */\n\nimport * as React from \"react\";\nimport type { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport { produce } from \"immer\";\nimport { usePreviewFeatures } from \"../preview/PreviewFeatures.js\";\n\n/** This is used to notify the parent component that the lock decoration is displayed in the editor\n * and a separate lock component should not be displayed as a sibling.\n * @internal\n */\nexport const LockContext = React.createContext<\n | {\n /** Describes if the lock is displayed as an editor decoration. */\n lockDecorations: Record<string, true>;\n /** Called by editors that display lock decoration. */\n setLockDecoration: (\n propertyName: string,\n lockDecoration: boolean\n ) => void;\n }\n | undefined\n>(undefined);\n\n/** @internal */\nexport function LockProvider({ children }: React.PropsWithChildren) {\n const [lockDecorations, setLockDecorations] = React.useState<\n Record<string, true>\n >({});\n const setLockDecoration = React.useCallback(\n (propertyName: string, lockDecoration: boolean) => {\n setLockDecorations(\n produce((draft) => {\n if (lockDecoration) {\n draft[propertyName] = true;\n return;\n }\n\n delete draft[propertyName];\n })\n );\n },\n []\n );\n return (\n <LockContext.Provider\n value={React.useMemo(\n () => ({\n lockDecorations,\n setLockDecoration,\n }),\n [lockDecorations, setLockDecoration]\n )}\n >\n {children}\n </LockContext.Provider>\n );\n}\n\n/** Additional context for property editors that support lock decoration.\n * @internal\n */\nexport const PropertyEditorContext = React.createContext<\n | {\n uiDataProvider: UiLayoutDataProvider;\n itemPropertyName: string;\n /** Specified when rendering a lock editor. */\n lockPropertyName: string | undefined;\n }\n | undefined\n>(undefined);\n\ntype PropertyEditorContextType = React.ContextType<\n typeof PropertyEditorContext\n>;\n\ninterface PropertyEditorProviderProps\n extends NonNullable<PropertyEditorContextType> {\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport function PropertyEditorProvider(props: PropertyEditorProviderProps) {\n const { children, uiDataProvider, itemPropertyName, lockPropertyName } =\n props;\n return (\n <PropertyEditorContext.Provider\n value={React.useMemo(\n () => ({\n uiDataProvider,\n itemPropertyName,\n lockPropertyName,\n }),\n [uiDataProvider, itemPropertyName, lockPropertyName]\n )}\n >\n {children}\n </PropertyEditorContext.Provider>\n );\n}\n\n/** Returns `true` if the lock decoration should be displayed.\n * @internal\n */\nexport function useLockDecoration() {\n const { lockPropertyName, itemPropertyName, uiDataProvider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { toolSettingsLockButton } = usePreviewFeatures();\n const dialogItem = React.useMemo(\n () =>\n uiDataProvider?.items.find(\n (item) => item.property.name === itemPropertyName\n ),\n [uiDataProvider, itemPropertyName]\n );\n return (\n !!toolSettingsLockButton && !lockPropertyName && !!dialogItem?.lockProperty\n );\n}\n\ninterface UseLockPropertyArgs {\n provider: UiLayoutDataProvider;\n itemPropertyName: string;\n}\n\n/** @internal */\nexport function useLockProperty(args: UseLockPropertyArgs | undefined) {\n const { provider, itemPropertyName } = args ?? {};\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n const listeners = provider\n ? [\n provider.onItemsReloadedEvent.addListener(onStoreChange),\n provider.onSyncPropertiesChangeEvent.addListener(onStoreChange),\n ]\n : [];\n return () => listeners.forEach((l) => l());\n },\n [provider]\n );\n const getSnapshot = React.useCallback(() => {\n const dialogItem = provider?.items.find(\n (item) => item.property.name === itemPropertyName\n );\n return dialogItem?.lockProperty;\n }, [provider, itemPropertyName]);\n return React.useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/** This component displays a lock button in the property editor when the `toolSettingsLockButton` preview feature is enabled.\n * @alpha\n */\nexport function LockButtonInputDecoration() {\n const { itemPropertyName, uiDataProvider: provider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { setLockDecoration } = React.useContext(LockContext) ?? {};\n const lockDecoration = useLockDecoration();\n\n const lockProperty = useLockProperty(\n provider && itemPropertyName\n ? {\n provider,\n itemPropertyName,\n }\n : undefined\n );\n\n React.useLayoutEffect(() => {\n if (!lockDecoration) return;\n if (!setLockDecoration) return;\n if (!itemPropertyName) return;\n setLockDecoration(itemPropertyName, true);\n return () => {\n setLockDecoration(itemPropertyName, false);\n };\n }, [setLockDecoration, itemPropertyName, lockDecoration]);\n\n if (!lockDecoration) return null;\n\n const isLocked = !!lockProperty?.value.value;\n const displayLabel = lockProperty?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = lockProperty?.isDisabled;\n return (\n <InputWithDecorations.Button\n isActive={isLocked}\n label={label}\n disabled={disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n if (!provider) return;\n if (!lockProperty) return;\n\n provider.applyUiPropertyChange({\n value: {\n ...lockProperty.value,\n value: !isLocked,\n },\n propertyName: lockProperty.property.name,\n });\n provider.reloadDialogItems();\n }}\n >\n {isLocked ? <SvgLock /> : <SvgLockUnlocked />}\n </InputWithDecorations.Button>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ import * as React from "react";
5
+ import { NumericInputPropertyEditor as BaseNumericInputPropertyEditor } from "@itwin/components-react";
6
+ /** @internal */
7
+ export declare class NumericInputPropertyEditor extends BaseNumericInputPropertyEditor {
8
+ get reactNode(): React.JSX.Element;
9
+ }
10
+ //# sourceMappingURL=NumericEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/NumericEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,0BAA0B,IAAI,8BAA8B,EAC7D,MAAM,yBAAyB,CAAC;AAOjC,gBAAgB;AAChB,qBAAa,0BAA2B,SAAQ,8BAA8B;IAC5E,IAAoB,SAAS,sBAE5B;CACF"}
@@ -0,0 +1,24 @@
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 { NumericInputEditor as BaseNumericInputEditor, NumericInputPropertyEditor as BaseNumericInputPropertyEditor, } from "@itwin/components-react";
10
+ import { LockButtonInputDecoration, useLockDecoration, } from "./LockProvider.js";
11
+ /** @internal */
12
+ export class NumericInputPropertyEditor extends BaseNumericInputPropertyEditor {
13
+ get reactNode() {
14
+ return React.createElement(NumericEditor, null);
15
+ }
16
+ }
17
+ const NumericEditor = React.forwardRef(function NumericEditor(props, forwardedRef) {
18
+ const lockDecoration = useLockDecoration();
19
+ const internalProps = {
20
+ decoration: lockDecoration ? React.createElement(LockButtonInputDecoration, null) : undefined,
21
+ };
22
+ return (React.createElement(BaseNumericInputEditor, { ...props, ...internalProps, ref: forwardedRef }));
23
+ });
24
+ //# sourceMappingURL=NumericEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/NumericEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,IAAI,sBAAsB,EAC5C,0BAA0B,IAAI,8BAA8B,GAC7D,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,OAAO,0BAA2B,SAAQ,8BAA8B;IAC5E,IAAoB,SAAS;QAC3B,OAAO,oBAAC,aAAa,OAAG,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CACpC,SAAS,aAAa,CAAC,KAAK,EAAE,YAAY;IACxC,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG;QACpB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,oBAAC,yBAAyB,OAAG,CAAC,CAAC,CAAC,SAAS;KACpC,CAAC;IACrC,OAAO,CACL,oBAAC,sBAAsB,OACjB,KAAK,KACL,aAAa,EACjB,GAAG,EAAE,YAAY,GACjB,CACH,CAAC;AACJ,CAAC,CACF,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyEditors\n */\n\nimport * as React from \"react\";\nimport {\n NumericInputEditor as BaseNumericInputEditor,\n NumericInputPropertyEditor as BaseNumericInputPropertyEditor,\n} from \"@itwin/components-react\";\nimport type { InternalInputEditorProps } from \"@itwin/components-react/internal\";\nimport {\n LockButtonInputDecoration,\n useLockDecoration,\n} from \"./LockProvider.js\";\n\n/** @internal */\nexport class NumericInputPropertyEditor extends BaseNumericInputPropertyEditor {\n public override get reactNode() {\n return <NumericEditor />;\n }\n}\n\nconst NumericEditor = React.forwardRef<BaseNumericInputEditor>(\n function NumericEditor(props, forwardedRef) {\n const lockDecoration = useLockDecoration();\n const internalProps = {\n decoration: lockDecoration ? <LockButtonInputDecoration /> : undefined,\n } satisfies InternalInputEditorProps;\n return (\n <BaseNumericInputEditor\n {...props}\n {...internalProps}\n ref={forwardedRef}\n />\n );\n }\n);\n"]}
@@ -0,0 +1,10 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ import * as React from "react";
5
+ import { BasicPropertyEditor as BaseTextPropertyEditor } from "@itwin/components-react";
6
+ /** @internal */
7
+ export declare class TextPropertyEditor extends BaseTextPropertyEditor {
8
+ get reactNode(): React.JSX.Element;
9
+ }
10
+ //# sourceMappingURL=TextEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,mBAAmB,IAAI,sBAAsB,EAC9C,MAAM,yBAAyB,CAAC;AAOjC,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,sBAAsB;IAC5D,IAAoB,SAAS,sBAE5B;CACF"}
@@ -0,0 +1,24 @@
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 { TextEditor as BaseTextEditor, BasicPropertyEditor as BaseTextPropertyEditor, } from "@itwin/components-react";
10
+ import { LockButtonInputDecoration, useLockDecoration, } from "./LockProvider.js";
11
+ /** @internal */
12
+ export class TextPropertyEditor extends BaseTextPropertyEditor {
13
+ get reactNode() {
14
+ return React.createElement(TextEditor, null);
15
+ }
16
+ }
17
+ const TextEditor = React.forwardRef(function TextEditor(props, forwardedRef) {
18
+ const lockDecoration = useLockDecoration();
19
+ const internalProps = {
20
+ decoration: lockDecoration ? React.createElement(LockButtonInputDecoration, null) : undefined,
21
+ };
22
+ return React.createElement(BaseTextEditor, { ...props, ...internalProps, ref: forwardedRef });
23
+ });
24
+ //# sourceMappingURL=TextEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/TextEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,mBAAmB,IAAI,sBAAsB,GAC9C,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,gBAAgB;AAChB,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,IAAoB,SAAS;QAC3B,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAiB,SAAS,UAAU,CACrE,KAAK,EACL,YAAY;IAEZ,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,aAAa,GAAG;QACpB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,oBAAC,yBAAyB,OAAG,CAAC,CAAC,CAAC,SAAS;KACpC,CAAC;IACrC,OAAO,oBAAC,cAAc,OAAK,KAAK,KAAM,aAAa,EAAE,GAAG,EAAE,YAAY,GAAI,CAAC;AAC7E,CAAC,CAAC,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 *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyEditors\n */\n\nimport * as React from \"react\";\nimport {\n TextEditor as BaseTextEditor,\n BasicPropertyEditor as BaseTextPropertyEditor,\n} from \"@itwin/components-react\";\nimport type { InternalInputEditorProps } from \"@itwin/components-react/internal\";\nimport {\n LockButtonInputDecoration,\n useLockDecoration,\n} from \"./LockProvider.js\";\n\n/** @internal */\nexport class TextPropertyEditor extends BaseTextPropertyEditor {\n public override get reactNode() {\n return <TextEditor />;\n }\n}\n\nconst TextEditor = React.forwardRef<BaseTextEditor>(function TextEditor(\n props,\n forwardedRef\n) {\n const lockDecoration = useLockDecoration();\n const internalProps = {\n decoration: lockDecoration ? <LockButtonInputDecoration /> : undefined,\n } satisfies InternalInputEditorProps;\n return <BaseTextEditor {...props} {...internalProps} ref={forwardedRef} />;\n});\n"]}
@@ -0,0 +1,6 @@
1
+ /** @packageDocumentation
2
+ * @module PropertyEditors
3
+ */
4
+ /** @internal */
5
+ export declare function registerEditors(): void;
6
+ //# sourceMappingURL=registerEditors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerEditors.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/registerEditors.ts"],"names":[],"mappings":"AAIA;;GAEG;AASH,gBAAgB;AAChB,wBAAgB,eAAe,SAwD9B"}
@@ -0,0 +1,28 @@
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 { StandardEditorNames, StandardTypeNames } from "@itwin/appui-abstract";
9
+ import { registerDefaultPropertyEditor } from "@itwin/components-react/internal";
10
+ import { LockPropertyEditor, LockPropertyEditorName } from "./LockEditor.js";
11
+ import { CustomNumberPropertyEditor } from "./CustomNumberEditor.js";
12
+ import { TextPropertyEditor } from "./TextEditor.js";
13
+ import { NumericInputPropertyEditor } from "./NumericEditor.js";
14
+ /** @internal */
15
+ export function registerEditors() {
16
+ // Editors that support lock decorations.
17
+ registerDefaultPropertyEditor(StandardTypeNames.Text, TextPropertyEditor, undefined, true);
18
+ registerDefaultPropertyEditor(StandardTypeNames.String, TextPropertyEditor, undefined, true);
19
+ registerDefaultPropertyEditor(StandardTypeNames.Number, NumericInputPropertyEditor, StandardEditorNames.NumericInput, true);
20
+ registerDefaultPropertyEditor(StandardTypeNames.Int, NumericInputPropertyEditor, StandardEditorNames.NumericInput, true);
21
+ registerDefaultPropertyEditor(StandardTypeNames.Float, NumericInputPropertyEditor, StandardEditorNames.NumericInput, true);
22
+ registerDefaultPropertyEditor(StandardTypeNames.Double, NumericInputPropertyEditor, StandardEditorNames.NumericInput, true);
23
+ registerDefaultPropertyEditor(StandardTypeNames.Number, CustomNumberPropertyEditor, StandardEditorNames.NumberCustom, true);
24
+ // `appui-react` specific editors.
25
+ registerDefaultPropertyEditor(StandardTypeNames.Bool, LockPropertyEditor, LockPropertyEditorName);
26
+ registerDefaultPropertyEditor(StandardTypeNames.Boolean, LockPropertyEditor, LockPropertyEditorName);
27
+ }
28
+ //# sourceMappingURL=registerEditors.js.map