@itwin/core-react 3.0.0-extension.0 → 3.0.1

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 (154) hide show
  1. package/CHANGELOG.md +136 -6
  2. package/ContributeGuidelines.md +1 -1
  3. package/LICENSE.md +1 -1
  4. package/lib/cjs/core-react/UiCore.d.ts +1 -1
  5. package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
  6. package/lib/cjs/core-react/UiCore.js.map +1 -1
  7. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +1 -1
  8. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  9. package/lib/cjs/core-react/dialog/DialogButtonDef.d.ts +3 -3
  10. package/lib/cjs/core-react/dialog/DialogButtonDef.js +2 -2
  11. package/lib/cjs/core-react/dialog/DialogButtonDef.js.map +1 -1
  12. package/lib/cjs/core-react/expandable/ExpandableList.scss +0 -3
  13. package/lib/cjs/core-react/form/Field.d.ts +2 -2
  14. package/lib/cjs/core-react/form/Field.d.ts.map +1 -1
  15. package/lib/cjs/core-react/form/Field.js +4 -3
  16. package/lib/cjs/core-react/form/Field.js.map +1 -1
  17. package/lib/cjs/core-react/form/Form.d.ts +7 -7
  18. package/lib/cjs/core-react/form/Form.d.ts.map +1 -1
  19. package/lib/cjs/core-react/form/Form.js +3 -2
  20. package/lib/cjs/core-react/form/Form.js.map +1 -1
  21. package/lib/cjs/core-react/icons/IconComponent.scss +5 -0
  22. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  23. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +3 -2
  24. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  25. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +13 -0
  26. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  27. package/lib/cjs/core-react/messagebox/MessageBox.js +3 -0
  28. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  29. package/lib/cjs/core-react/messagebox/MessageBox.scss +2 -0
  30. package/lib/cjs/core-react/messagebox/MessageSeverity.d.ts +1 -1
  31. package/lib/cjs/core-react/messagebox/MessageSeverity.js +1 -1
  32. package/lib/cjs/core-react/messagebox/MessageSeverity.js.map +1 -1
  33. package/lib/cjs/core-react/popup/Popup.d.ts +6 -1
  34. package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
  35. package/lib/cjs/core-react/popup/Popup.js +13 -4
  36. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  37. package/lib/cjs/core-react/popup/Popup.scss +11 -2
  38. package/lib/cjs/core-react/select/ThemedSelect.d.ts +1 -1
  39. package/lib/cjs/core-react/select/ThemedSelect.js +1 -1
  40. package/lib/cjs/core-react/select/ThemedSelect.js.map +1 -1
  41. package/lib/cjs/core-react/style/itwinui-overrides.scss +0 -68
  42. package/lib/cjs/core-react/tree/Node.d.ts +1 -0
  43. package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
  44. package/lib/cjs/core-react/tree/Node.js +19 -6
  45. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  46. package/lib/cjs/core-react/tree/Node.scss +14 -7
  47. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +17 -0
  48. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -0
  49. package/lib/cjs/core-react/{uisettings/LocalSettingsStorage.js → uistate/LocalStateStorage.js} +14 -20
  50. package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -0
  51. package/lib/{esm/core-react/uisettings/UiSetting.d.ts → cjs/core-react/uistate/UiStateEntry.d.ts} +15 -15
  52. package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -0
  53. package/lib/cjs/core-react/{uisettings/UiSetting.js → uistate/UiStateEntry.js} +16 -16
  54. package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -0
  55. package/lib/cjs/core-react/uistate/UiStateStorage.d.ts +29 -0
  56. package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -0
  57. package/lib/cjs/core-react/uistate/UiStateStorage.js +22 -0
  58. package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -0
  59. package/lib/cjs/core-react/utils/UiEvent.d.ts +2 -2
  60. package/lib/cjs/core-react/utils/UiEvent.js +2 -2
  61. package/lib/cjs/core-react/utils/UiEvent.js.map +1 -1
  62. package/lib/cjs/core-react.d.ts +4 -5
  63. package/lib/cjs/core-react.d.ts.map +1 -1
  64. package/lib/cjs/core-react.js +4 -5
  65. package/lib/cjs/core-react.js.map +1 -1
  66. package/lib/esm/core-react/UiCore.d.ts +1 -1
  67. package/lib/esm/core-react/UiCore.d.ts.map +1 -1
  68. package/lib/esm/core-react/UiCore.js.map +1 -1
  69. package/lib/esm/core-react/contextmenu/PopupContextMenu.js +1 -1
  70. package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  71. package/lib/esm/core-react/dialog/DialogButtonDef.d.ts +3 -3
  72. package/lib/esm/core-react/dialog/DialogButtonDef.js +2 -2
  73. package/lib/esm/core-react/dialog/DialogButtonDef.js.map +1 -1
  74. package/lib/esm/core-react/expandable/ExpandableList.scss +0 -3
  75. package/lib/esm/core-react/form/Field.d.ts +2 -2
  76. package/lib/esm/core-react/form/Field.d.ts.map +1 -1
  77. package/lib/esm/core-react/form/Field.js +4 -3
  78. package/lib/esm/core-react/form/Field.js.map +1 -1
  79. package/lib/esm/core-react/form/Form.d.ts +7 -7
  80. package/lib/esm/core-react/form/Form.d.ts.map +1 -1
  81. package/lib/esm/core-react/form/Form.js +3 -2
  82. package/lib/esm/core-react/form/Form.js.map +1 -1
  83. package/lib/esm/core-react/icons/IconComponent.scss +5 -0
  84. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  85. package/lib/esm/core-react/inputs/numberinput/NumberInput.js +3 -2
  86. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  87. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +13 -0
  88. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  89. package/lib/esm/core-react/messagebox/MessageBox.js +3 -0
  90. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  91. package/lib/esm/core-react/messagebox/MessageBox.scss +2 -0
  92. package/lib/esm/core-react/messagebox/MessageSeverity.d.ts +1 -1
  93. package/lib/esm/core-react/messagebox/MessageSeverity.js +1 -1
  94. package/lib/esm/core-react/messagebox/MessageSeverity.js.map +1 -1
  95. package/lib/esm/core-react/popup/Popup.d.ts +6 -1
  96. package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
  97. package/lib/esm/core-react/popup/Popup.js +13 -4
  98. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  99. package/lib/esm/core-react/popup/Popup.scss +11 -2
  100. package/lib/esm/core-react/select/ThemedSelect.d.ts +1 -1
  101. package/lib/esm/core-react/select/ThemedSelect.js +1 -1
  102. package/lib/esm/core-react/select/ThemedSelect.js.map +1 -1
  103. package/lib/esm/core-react/style/itwinui-overrides.scss +0 -68
  104. package/lib/esm/core-react/tree/Node.d.ts +1 -0
  105. package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
  106. package/lib/esm/core-react/tree/Node.js +19 -6
  107. package/lib/esm/core-react/tree/Node.js.map +1 -1
  108. package/lib/esm/core-react/tree/Node.scss +14 -7
  109. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +17 -0
  110. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -0
  111. package/lib/esm/core-react/{uisettings/LocalSettingsStorage.js → uistate/LocalStateStorage.js} +12 -17
  112. package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -0
  113. package/lib/{cjs/core-react/uisettings/UiSetting.d.ts → esm/core-react/uistate/UiStateEntry.d.ts} +15 -15
  114. package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -0
  115. package/lib/esm/core-react/{uisettings/UiSetting.js → uistate/UiStateEntry.js} +14 -14
  116. package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -0
  117. package/lib/esm/core-react/uistate/UiStateStorage.d.ts +29 -0
  118. package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -0
  119. package/lib/esm/core-react/uistate/UiStateStorage.js +19 -0
  120. package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -0
  121. package/lib/esm/core-react/utils/UiEvent.d.ts +2 -2
  122. package/lib/esm/core-react/utils/UiEvent.js +2 -2
  123. package/lib/esm/core-react/utils/UiEvent.js.map +1 -1
  124. package/lib/esm/core-react.d.ts +4 -5
  125. package/lib/esm/core-react.d.ts.map +1 -1
  126. package/lib/esm/core-react.js +4 -5
  127. package/lib/esm/core-react.js.map +1 -1
  128. package/package.json +20 -22
  129. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.d.ts +0 -24
  130. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.d.ts.map +0 -1
  131. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.js.map +0 -1
  132. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.d.ts +0 -24
  133. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.d.ts.map +0 -1
  134. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.js +0 -56
  135. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.js.map +0 -1
  136. package/lib/cjs/core-react/uisettings/UiSetting.d.ts.map +0 -1
  137. package/lib/cjs/core-react/uisettings/UiSetting.js.map +0 -1
  138. package/lib/cjs/core-react/uisettings/UiSettingsStorage.d.ts +0 -33
  139. package/lib/cjs/core-react/uisettings/UiSettingsStorage.d.ts.map +0 -1
  140. package/lib/cjs/core-react/uisettings/UiSettingsStorage.js +0 -22
  141. package/lib/cjs/core-react/uisettings/UiSettingsStorage.js.map +0 -1
  142. package/lib/esm/core-react/uisettings/LocalSettingsStorage.d.ts +0 -24
  143. package/lib/esm/core-react/uisettings/LocalSettingsStorage.d.ts.map +0 -1
  144. package/lib/esm/core-react/uisettings/LocalSettingsStorage.js.map +0 -1
  145. package/lib/esm/core-react/uisettings/SessionSettingsStorage.d.ts +0 -24
  146. package/lib/esm/core-react/uisettings/SessionSettingsStorage.d.ts.map +0 -1
  147. package/lib/esm/core-react/uisettings/SessionSettingsStorage.js +0 -51
  148. package/lib/esm/core-react/uisettings/SessionSettingsStorage.js.map +0 -1
  149. package/lib/esm/core-react/uisettings/UiSetting.d.ts.map +0 -1
  150. package/lib/esm/core-react/uisettings/UiSetting.js.map +0 -1
  151. package/lib/esm/core-react/uisettings/UiSettingsStorage.d.ts +0 -33
  152. package/lib/esm/core-react/uisettings/UiSettingsStorage.d.ts.map +0 -1
  153. package/lib/esm/core-react/uisettings/UiSettingsStorage.js +0 -19
  154. package/lib/esm/core-react/uisettings/UiSettingsStorage.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,136 @@
1
1
  # Change Log - @itwin/core-react
2
2
 
3
- This log was last generated on Tue, 21 Sep 2021 21:06:40 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 24 Feb 2022 15:26:55 GMT and should not be manually modified.
4
+
5
+ ## 3.0.1
6
+ Thu, 24 Feb 2022 15:26:55 GMT
7
+
8
+ ### Updates
9
+
10
+ - `TreeNode`: Fix checkbox propagating click events to the parent element, resulting in unexpected TreeNodeProps.onClick invocations.
11
+
12
+ ## 3.0.0
13
+ Mon, 24 Jan 2022 14:00:52 GMT
14
+
15
+ ### Updates
16
+
17
+ - Update NumberInput to select on focus and to capture Enter key
18
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
19
+ - rename to @itwin/core-react
20
+ - remove ClientRequestContext and its subclasses
21
+ - Replace usage of I18N with generic Localization interface.
22
+ - Update snapshots
23
+ - Fix Select menu position when redered in a Popup.
24
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
25
+ - Deprecate obsolete code.
26
+ - Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
27
+ - Add missing public/beta types to the barrel file.
28
+ - Fix infinite loop crash in ContextMenu when the menu is too large to fit in the parent window.
29
+ - Fix issue with PopupContextMenu not closing when click occurs in a parent popup.
30
+ - Deprecate and promote apis
31
+ - Deprecate obsolete APIs. Publish beta APIs from last release.
32
+ - Upgraded itwinui-react to 1.16.2. Fixed editor sizes.
33
+ - Fixed small ExpandableBlock padding
34
+ - Remove files generated by bad merge
35
+ - Update disabled styling for NumberInput.
36
+ - Update styling on some status field items for better popup alignment.
37
+ - Update IconComponent SCSS to ensure color for inline svg is set.
38
+ - Allow size of NumberInput container to be sized via a style prop.
39
+ - Deprecated HorizontalTabs in ui-core. Removed older deprecated items. Updated NextVersion.md.
40
+ - Update to latest itwinui-react
41
+ - Incorporating iTwinUI-CSS and iTwinUI-React into iModel.js
42
+ - Moved iTwinUI style overrides to ui-core from ui-framework
43
+ - Rename ui directories to match new package names.
44
+ - Fix bug that sets the icon on MessageBox.NoSymbol the Success icon.
45
+ - Add prop that prevents popup children from unmounting when popup is closed.
46
+ - Update to React 17.
47
+ - Created imodel-components folder & package and moved color, lineweight, navigationaids, quantity, timeline & viewport. Deprecated MessageSeverity in ui-core & added it ui-abstract. Added MessagePresenter interface to ui-abstract.
48
+ - Remove react 16 peer dependency.
49
+ - Remove itwinUi css overrides.
50
+ - UiFramework and UiIModelComponent initialize method no longer take localization argument, uses IModelApp.localization internally.
51
+ - Fix vertical alignment of text in message box.
52
+ - Avoid error seen sometimes in Electron where resizeObserver.current is null.
53
+ - Fixed z-index of status messages to be on top of a dialog
54
+ - Deprecated ui-core Slider. Wrapped with one from iTwinUi-react to remove dependency on react-compound-slider.
55
+ - Update to latest types/react package
56
+ - Lock down and update version numbers so docs will build.
57
+
58
+ ## 2.19.28
59
+ Wed, 12 Jan 2022 14:52:38 GMT
60
+
61
+ _Version update only_
62
+
63
+ ## 2.19.27
64
+ Wed, 05 Jan 2022 20:07:20 GMT
65
+
66
+ _Version update only_
67
+
68
+ ## 2.19.26
69
+ Wed, 08 Dec 2021 20:54:53 GMT
70
+
71
+ _Version update only_
72
+
73
+ ## 2.19.25
74
+ Fri, 03 Dec 2021 20:05:49 GMT
75
+
76
+ _Version update only_
77
+
78
+ ## 2.19.24
79
+ Mon, 29 Nov 2021 18:44:31 GMT
80
+
81
+ _Version update only_
82
+
83
+ ## 2.19.23
84
+ Mon, 22 Nov 2021 20:41:40 GMT
85
+
86
+ _Version update only_
87
+
88
+ ## 2.19.22
89
+ Wed, 17 Nov 2021 01:23:26 GMT
90
+
91
+ _Version update only_
92
+
93
+ ## 2.19.21
94
+ Wed, 10 Nov 2021 10:58:24 GMT
95
+
96
+ _Version update only_
97
+
98
+ ## 2.19.20
99
+ Fri, 29 Oct 2021 16:14:22 GMT
100
+
101
+ _Version update only_
102
+
103
+ ## 2.19.19
104
+ Mon, 25 Oct 2021 16:16:25 GMT
105
+
106
+ ### Updates
107
+
108
+ - Drop unnecessary dep on @bentley/react-scripts; add a *.d.ts file for svg?sprite loader syntax
109
+
110
+ ## 2.19.18
111
+ Thu, 21 Oct 2021 20:59:44 GMT
112
+
113
+ _Version update only_
114
+
115
+ ## 2.19.17
116
+ Thu, 14 Oct 2021 21:19:43 GMT
117
+
118
+ _Version update only_
119
+
120
+ ## 2.19.16
121
+ Mon, 11 Oct 2021 17:37:46 GMT
122
+
123
+ _Version update only_
124
+
125
+ ## 2.19.15
126
+ Fri, 08 Oct 2021 16:44:23 GMT
127
+
128
+ _Version update only_
129
+
130
+ ## 2.19.14
131
+ Fri, 01 Oct 2021 13:07:03 GMT
132
+
133
+ _Version update only_
4
134
 
5
135
  ## 2.19.13
6
136
  Tue, 21 Sep 2021 21:06:40 GMT
@@ -187,9 +317,9 @@ Mon, 24 May 2021 15:58:39 GMT
187
317
  ### Updates
188
318
 
189
319
  - Wrap resizeObserver in a windows animation frame to prevent loop limit exceeded error.
190
- - Add support for child popup windows.
320
+ - Add support for child popup windows.
191
321
  - Improved Multi-Value column filtering in the Table component
192
- - Update to latest classnames package
322
+ - Update to latest classnames package
193
323
  - Fix GlobalContextMenu layout issue in presentation-test-app by setting display:none on anchoring div.
194
324
 
195
325
  ## 2.15.6
@@ -317,7 +447,7 @@ Thu, 28 Jan 2021 13:39:27 GMT
317
447
 
318
448
  ### Updates
319
449
 
320
- - Update components that support providing refs via React.forwardRef to work better with document generation.
450
+ - Update components that support providing refs via React.forwardRef to work better with document generation.
321
451
  - Add option to use a 'x-small' webfont icon.
322
452
  - Add nested popup support to components that use HOC withOnOutsideClick.
323
453
  - Fix bug processing zero value in Select options.
@@ -588,7 +718,7 @@ Tue, 28 Jul 2020 16:26:24 GMT
588
718
  - Add support for a basic single selection aria compliant listbox.
589
719
  - Checkboxes in lists & trees are out of place
590
720
  - Disabled component styling. Fixed Dialog focus problems.
591
- - Map Layer UX
721
+ - Map Layer UX
592
722
  - Allowing Input component user to override the type
593
723
  - Fix ThemeSelect formatOptionLabel prop to return React.ReactNode.
594
724
  - Added Arrow key navigation in Tabs components. Added ItemKeyboardNavigator.
@@ -911,7 +1041,7 @@ Mon, 13 May 2019 15:52:05 GMT
911
1041
  - Put sourcemap in npm package.
912
1042
  - Added SignIn presentational component to ui-components. Removed --ignoreMissingTags extract-api option.
913
1043
  - Require React & React-dom 16.8
914
- - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
1044
+ - Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
915
1045
  - Added ViewportDialog in ui-test-app, ui-core/ContributeGuidelines.md. TSLint rules in ui-core for no-default-export & completed-docs. @beta release tags.
916
1046
  - Update icons-generic-webfont version to latest available.
917
1047
  - Added TableProp to hide header and supporting style changes
@@ -18,7 +18,7 @@ In order to maintain consistency in the iTwin.js UI source code, please abide by
18
18
  ```
19
19
 
20
20
  * Document __all__ exported classes, interfaces, enums, types, etc.
21
- * Add release tags (`@public`, `@beta`, `@alpha` or `@internal`) to all exported classes, interfaces, enums, types, etc. For more information on release tags, see [Release Tags](https://github.com/imodeljs/imodeljs/blob/master/docs/learning/guidelines/release-tags-guidelines.md).
21
+ * Add release tags (`@public`, `@beta`, `@alpha` or `@internal`) to all exported classes, interfaces, enums, types, etc. For more information on release tags, see [Release Tags](https://github.com/iTwin/itwinjs-core/blob/master/docs/learning/guidelines/release-tags-guidelines.md).
22
22
  * In addition, it’s preferable that all *Props interface members and component public methods be documented. You can put `@internal` on React lifecycle and render methods.
23
23
  * Add a,
24
24
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright © 2017-2021 Bentley Systems, Incorporated. All rights reserved.
3
+ Copyright © 2017-2022 Bentley Systems, Incorporated. All rights reserved.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -6,7 +6,7 @@ import "./colorthemes.scss";
6
6
  import "./colorvariables.scss";
7
7
  import "./layout-variables.scss";
8
8
  import "./classes.scss";
9
- import { Localization } from "@itwin/core-common";
9
+ import type { Localization } from "@itwin/core-common";
10
10
  /**
11
11
  * Manages the Localization service for the core-react package.
12
12
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"UiCore.d.ts","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,4EAA4E;AAC5E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAe;IAE5C;;;OAGG;WACiB,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,I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B,OAAO,MAAM,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;YACzB,qBAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,4FAA4F,CAAC,CAAC;YAC3I,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,+BAA+B,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AApEH,wBAsEC;AArEgB,mBAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Import color variables, layout variables and Sass classes barrel file */\r\nimport \"./colorthemes.scss\";\r\nimport \"./colorvariables.scss\";\r\nimport \"./layout-variables.scss\";\r\nimport \"./classes.scss\";\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { Localization } from \"@itwin/core-common\";\r\nimport { getClassName, UiError } from \"@itwin/appui-abstract\";\r\n\r\n// cSpell:ignore colorthemes colorvariables\r\n\r\n/**\r\n * Manages the Localization service for the core-react package.\r\n * @public\r\n */\r\nexport class UiCore {\r\n private static _initialized = false;\r\n private static _localization?: Localization;\r\n\r\n /**\r\n * Registers the Localization service namespace for UiCore.\r\n * @param localization The internationalization service created by the host application.\r\n */\r\n public static async initialize(localization: Localization): Promise<void> {\r\n if (UiCore._initialized) {\r\n Logger.logInfo(UiCore.loggerCategory(UiCore), `UiCore.initialize already called`);\r\n return;\r\n }\r\n\r\n UiCore._localization = localization;\r\n await UiCore._localization.registerNamespace(UiCore.localizationNamespace);\r\n UiCore._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiCore localization namespace */\r\n public static terminate() {\r\n if (UiCore._localization)\r\n UiCore._localization.unregisterNamespace(UiCore.localizationNamespace);\r\n UiCore._localization = undefined;\r\n\r\n UiCore._initialized = false;\r\n }\r\n\r\n /** Determines if UiCore has been initialized */\r\n public static get initialized(): boolean { return UiCore._initialized; }\r\n\r\n /** The internationalization service created by the host application.\r\n * @internal\r\n */\r\n public static get localization(): Localization {\r\n // istanbul ignore else\r\n if (!UiCore._localization)\r\n throw new UiError(UiCore.loggerCategory(this), \"localization: UiCore.initialize has not been called. Unable to return Localization object.\");\r\n // istanbul ignore next\r\n return UiCore._localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiCore\";\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiCore\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiCore._localization) {\r\n Logger.logError(UiCore.loggerCategory(this), `translate: UiCore must be initialize with a localization provider. Returning blank string.`);\r\n return \"\";\r\n }\r\n return UiCore._localization.getLocalizedStringWithNamespace(UiCore.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"core-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiCore.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"UiCore.js","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4EAA4E;AAC5E,8BAA4B;AAC5B,iCAA+B;AAC/B,mCAAiC;AACjC,0BAAwB;AAExB,sDAA6C;AAE7C,0DAA8D;AAE9D,2CAA2C;AAE3C;;;GAGG;AACH,MAAa,MAAM;IAIjB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,MAAM,CAAC,YAAY,EAAE;YACvB,qBAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,kCAAkC,CAAC,CAAC;YAClF,OAAO;SACR;QAED,MAAM,CAAC,aAAa,GAAG,YAAY,CAAC;QACpC,MAAM,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC3E,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,oDAAoD;IAC7C,MAAM,CAAC,SAAS;QACrB,IAAI,MAAM,CAAC,aAAa;YACtB,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACzE,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;QAEjC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,gDAAgD;IACzC,MAAM,KAAK,WAAW,KAAc,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAExE;;OAEG;IACI,MAAM,KAAK,YAAY;QAC5B,uBAAuB;QACvB,IAAI,CAAC,MAAM,CAAC,aAAa;YACvB,MAAM,IAAI,wBAAO,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,4FAA4F,CAAC,CAAC;QAC/I,uBAAuB;QACvB,OAAO,MAAM,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;YACzB,qBAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,4FAA4F,CAAC,CAAC;YAC3I,OAAO,EAAE,CAAC;SACX;QACD,OAAO,MAAM,CAAC,aAAa,CAAC,+BAA+B,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,IAAA,6BAAY,EAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AApEH,wBAsEC;AArEgB,mBAAY,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Import color variables, layout variables and Sass classes barrel file */\r\nimport \"./colorthemes.scss\";\r\nimport \"./colorvariables.scss\";\r\nimport \"./layout-variables.scss\";\r\nimport \"./classes.scss\";\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport type { Localization } from \"@itwin/core-common\";\r\nimport { getClassName, UiError } from \"@itwin/appui-abstract\";\r\n\r\n// cSpell:ignore colorthemes colorvariables\r\n\r\n/**\r\n * Manages the Localization service for the core-react package.\r\n * @public\r\n */\r\nexport class UiCore {\r\n private static _initialized = false;\r\n private static _localization?: Localization;\r\n\r\n /**\r\n * Registers the Localization service namespace for UiCore.\r\n * @param localization The internationalization service created by the host application.\r\n */\r\n public static async initialize(localization: Localization): Promise<void> {\r\n if (UiCore._initialized) {\r\n Logger.logInfo(UiCore.loggerCategory(UiCore), `UiCore.initialize already called`);\r\n return;\r\n }\r\n\r\n UiCore._localization = localization;\r\n await UiCore._localization.registerNamespace(UiCore.localizationNamespace);\r\n UiCore._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiCore localization namespace */\r\n public static terminate() {\r\n if (UiCore._localization)\r\n UiCore._localization.unregisterNamespace(UiCore.localizationNamespace);\r\n UiCore._localization = undefined;\r\n\r\n UiCore._initialized = false;\r\n }\r\n\r\n /** Determines if UiCore has been initialized */\r\n public static get initialized(): boolean { return UiCore._initialized; }\r\n\r\n /** The internationalization service created by the host application.\r\n * @internal\r\n */\r\n public static get localization(): Localization {\r\n // istanbul ignore else\r\n if (!UiCore._localization)\r\n throw new UiError(UiCore.loggerCategory(this), \"localization: UiCore.initialize has not been called. Unable to return Localization object.\");\r\n // istanbul ignore next\r\n return UiCore._localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiCore\";\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiCore\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiCore._localization) {\r\n Logger.logError(UiCore.loggerCategory(this), `translate: UiCore must be initialize with a localization provider. Returning blank string.`);\r\n return \"\";\r\n }\r\n return UiCore._localization.getLocalizedStringWithNamespace(UiCore.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"core-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiCore.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
@@ -19,7 +19,7 @@ const ContextMenuDirection_1 = require("./ContextMenuDirection");
19
19
  function PopupContextMenu(props) {
20
20
  const { style, onSelect, onEsc, autoflip, edgeLimit, hotkeySelect, selectedIndex, children, ...popupProps } = props;
21
21
  const menuDirection = getContextMenuDirectionFromRelativePosition(popupProps.position);
22
- return (React.createElement(Popup_1.Popup, { ...popupProps, showShadow: false, showArrow: false, moveFocus: true, style: { ...style, border: "none" } },
22
+ return (React.createElement(Popup_1.Popup, { ...popupProps, closeOnNestedPopupOutsideClick: true, showShadow: false, showArrow: false, moveFocus: true, style: { ...style, border: "none" } },
23
23
  React.createElement(ContextMenu_1.ContextMenu, { opened: true, onSelect: onSelect, onEsc: onEsc, autoflip: autoflip, edgeLimit: edgeLimit, hotkeySelect: hotkeySelect, selectedIndex: selectedIndex, direction: menuDirection }, children)));
24
24
  }
25
25
  exports.PopupContextMenu = PopupContextMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"PopupContextMenu.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/PopupContextMenu.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,0CAAuC;AACvC,+CAA4C;AAC5C,0DAAyD;AAEzD,iEAA8D;AAgD9D;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACpH,MAAM,aAAa,GAAG,2CAA2C,CAAC,UAAU,CAAC,QAAQ,CAA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AC,WAAW;YAC/B,aAAa,GAAG,2CAAoB,CAAC,UAAU,CAAC;YAChD,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Popup } from \"../popup/Popup\";\r\nimport { ContextMenu } from \"./ContextMenu\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { ContextMenuDirection } from \"./ContextMenuDirection\";\r\n\r\n/** Properties for [[PopupContextMenu]] component\r\n * @public\r\n */\r\nexport interface PopupContextMenuProps extends CommonProps {\r\n /** Indicates whether the popup is shown or not (defaults to false) */\r\n isOpen: boolean;\r\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\r\n position?: RelativePosition;\r\n /** Target element to position popup */\r\n target?: HTMLElement | null;\r\n /** Function called when the popup is opened */\r\n onOpen?: () => void;\r\n /** Function called when user clicks outside the popup */\r\n onOutsideClick?: (e: MouseEvent) => void;\r\n /** Function called when the popup is closed */\r\n onClose?: () => void;\r\n /** Function called when the popup is closed on Enter */\r\n onEnter?: () => void;\r\n /** Top position (absolute positioning - defaults to 0) */\r\n top?: number;\r\n /** Left position (absolute positioning - defaults to 0) */\r\n left?: number;\r\n /** Offset from the parent (defaults to 4) */\r\n offset?: number;\r\n /** accessibility label */\r\n ariaLabel?: string;\r\n /** Indicates whether to use animation for open/close (defaults to true) */\r\n animate?: boolean;\r\n\r\n /** When list item or submenu is selected */\r\n onSelect?: (event: React.MouseEvent | undefined) => void;\r\n /** when Escape button is pressed */\r\n onEsc?: (event: React.KeyboardEvent) => void;\r\n /** Whether menu flips directions based on screen edge. Default: true */\r\n autoflip?: boolean;\r\n /** Whether menu hugs screen edge when autoflip is off. Default: true */\r\n edgeLimit?: boolean;\r\n /** Whether Hotkey press selects item, or just highlights item. Default: true */\r\n hotkeySelect?: boolean;\r\n /** starting menu item selected index Default: -1 */\r\n selectedIndex?: number;\r\n\r\n /** ContextMenu items */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** Component that displays a ContextMenu within a Popup component, allowing the target element to be specified.\r\n * @public\r\n */\r\nexport function PopupContextMenu(props: PopupContextMenuProps) {\r\n const { style, onSelect, onEsc, autoflip, edgeLimit, hotkeySelect, selectedIndex, children, ...popupProps } = props;\r\n const menuDirection = getContextMenuDirectionFromRelativePosition(popupProps.position);\r\n return (\r\n <Popup {...popupProps}\r\n showShadow={false} showArrow={false} moveFocus={true}\r\n style={{ ...style, border: \"none\" }}>\r\n <ContextMenu\r\n opened={true} onSelect={onSelect} onEsc={onEsc}\r\n autoflip={autoflip} edgeLimit={edgeLimit}\r\n hotkeySelect={hotkeySelect} selectedIndex={selectedIndex}\r\n direction={menuDirection}\r\n >\r\n {children}\r\n </ContextMenu>\r\n </Popup >\r\n );\r\n}\r\n\r\nfunction getContextMenuDirectionFromRelativePosition(relativePosition?: RelativePosition): ContextMenuDirection {\r\n let menuDirection = ContextMenuDirection.Bottom;\r\n switch (relativePosition) {\r\n case RelativePosition.Top:\r\n menuDirection = ContextMenuDirection.Top;\r\n break;\r\n case RelativePosition.TopLeft:\r\n menuDirection = ContextMenuDirection.TopRight;\r\n break;\r\n case RelativePosition.TopRight:\r\n menuDirection = ContextMenuDirection.TopLeft;\r\n break;\r\n case RelativePosition.Left:\r\n menuDirection = ContextMenuDirection.Left;\r\n break;\r\n case RelativePosition.Right:\r\n menuDirection = ContextMenuDirection.Right;\r\n break;\r\n case RelativePosition.Bottom:\r\n menuDirection = ContextMenuDirection.Bottom;\r\n break;\r\n case RelativePosition.BottomLeft:\r\n menuDirection = ContextMenuDirection.BottomRight;\r\n break;\r\n case RelativePosition.BottomRight:\r\n menuDirection = ContextMenuDirection.BottomLeft;\r\n break;\r\n }\r\n return menuDirection;\r\n}\r\n"]}
1
+ {"version":3,"file":"PopupContextMenu.js","sourceRoot":"","sources":["../../../../src/core-react/contextmenu/PopupContextMenu.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,0CAAuC;AACvC,+CAA4C;AAC5C,0DAAyD;AAEzD,iEAA8D;AAgD9D;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACpH,MAAM,aAAa,GAAG,2CAA2C,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvF,OAAO,CACL,oBAAC,aAAK,OAAK,UAAU,EAAE,8BAA8B,QACnD,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EACpD,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QACnC,oBAAC,yBAAW,IACV,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAC9C,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EACxC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EACxD,SAAS,EAAE,aAAa,IAEvB,QAAQ,CACG,CACP,CACV,CAAC;AACJ,CAAC;AAjBD,4CAiBC;AAED,SAAS,2CAA2C,CAAC,gBAAmC;IACtF,IAAI,aAAa,GAAG,2CAAoB,CAAC,MAAM,CAAC;IAChD,QAAQ,gBAAgB,EAAE;QACxB,KAAK,iCAAgB,CAAC,GAAG;YACvB,aAAa,GAAG,2CAAoB,CAAC,GAAG,CAAC;YACzC,MAAM;QACR,KAAK,iCAAgB,CAAC,OAAO;YAC3B,aAAa,GAAG,2CAAoB,CAAC,QAAQ,CAAC;YAC9C,MAAM;QACR,KAAK,iCAAgB,CAAC,QAAQ;YAC5B,aAAa,GAAG,2CAAoB,CAAC,OAAO,CAAC;YAC7C,MAAM;QACR,KAAK,iCAAgB,CAAC,IAAI;YACxB,aAAa,GAAG,2CAAoB,CAAC,IAAI,CAAC;YAC1C,MAAM;QACR,KAAK,iCAAgB,CAAC,KAAK;YACzB,aAAa,GAAG,2CAAoB,CAAC,KAAK,CAAC;YAC3C,MAAM;QACR,KAAK,iCAAgB,CAAC,MAAM;YAC1B,aAAa,GAAG,2CAAoB,CAAC,MAAM,CAAC;YAC5C,MAAM;QACR,KAAK,iCAAgB,CAAC,UAAU;YAC9B,aAAa,GAAG,2CAAoB,CAAC,WAAW,CAAC;YACjD,MAAM;QACR,KAAK,iCAAgB,CAAC,WAAW;YAC/B,aAAa,GAAG,2CAAoB,CAAC,UAAU,CAAC;YAChD,MAAM;KACT;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContextMenu\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Popup } from \"../popup/Popup\";\r\nimport { ContextMenu } from \"./ContextMenu\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { ContextMenuDirection } from \"./ContextMenuDirection\";\r\n\r\n/** Properties for [[PopupContextMenu]] component\r\n * @public\r\n */\r\nexport interface PopupContextMenuProps extends CommonProps {\r\n /** Indicates whether the popup is shown or not (defaults to false) */\r\n isOpen: boolean;\r\n /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */\r\n position?: RelativePosition;\r\n /** Target element to position popup */\r\n target?: HTMLElement | null;\r\n /** Function called when the popup is opened */\r\n onOpen?: () => void;\r\n /** Function called when user clicks outside the popup */\r\n onOutsideClick?: (e: MouseEvent) => void;\r\n /** Function called when the popup is closed */\r\n onClose?: () => void;\r\n /** Function called when the popup is closed on Enter */\r\n onEnter?: () => void;\r\n /** Top position (absolute positioning - defaults to 0) */\r\n top?: number;\r\n /** Left position (absolute positioning - defaults to 0) */\r\n left?: number;\r\n /** Offset from the parent (defaults to 4) */\r\n offset?: number;\r\n /** accessibility label */\r\n ariaLabel?: string;\r\n /** Indicates whether to use animation for open/close (defaults to true) */\r\n animate?: boolean;\r\n\r\n /** When list item or submenu is selected */\r\n onSelect?: (event: React.MouseEvent | undefined) => void;\r\n /** when Escape button is pressed */\r\n onEsc?: (event: React.KeyboardEvent) => void;\r\n /** Whether menu flips directions based on screen edge. Default: true */\r\n autoflip?: boolean;\r\n /** Whether menu hugs screen edge when autoflip is off. Default: true */\r\n edgeLimit?: boolean;\r\n /** Whether Hotkey press selects item, or just highlights item. Default: true */\r\n hotkeySelect?: boolean;\r\n /** starting menu item selected index Default: -1 */\r\n selectedIndex?: number;\r\n\r\n /** ContextMenu items */\r\n children?: React.ReactNode;\r\n}\r\n\r\n/** Component that displays a ContextMenu within a Popup component, allowing the target element to be specified.\r\n * @public\r\n */\r\nexport function PopupContextMenu(props: PopupContextMenuProps) {\r\n const { style, onSelect, onEsc, autoflip, edgeLimit, hotkeySelect, selectedIndex, children, ...popupProps } = props;\r\n const menuDirection = getContextMenuDirectionFromRelativePosition(popupProps.position);\r\n return (\r\n <Popup {...popupProps} closeOnNestedPopupOutsideClick\r\n showShadow={false} showArrow={false} moveFocus={true}\r\n style={{ ...style, border: \"none\" }}>\r\n <ContextMenu\r\n opened={true} onSelect={onSelect} onEsc={onEsc}\r\n autoflip={autoflip} edgeLimit={edgeLimit}\r\n hotkeySelect={hotkeySelect} selectedIndex={selectedIndex}\r\n direction={menuDirection}\r\n >\r\n {children}\r\n </ContextMenu>\r\n </Popup >\r\n );\r\n}\r\n\r\nfunction getContextMenuDirectionFromRelativePosition(relativePosition?: RelativePosition): ContextMenuDirection {\r\n let menuDirection = ContextMenuDirection.Bottom;\r\n switch (relativePosition) {\r\n case RelativePosition.Top:\r\n menuDirection = ContextMenuDirection.Top;\r\n break;\r\n case RelativePosition.TopLeft:\r\n menuDirection = ContextMenuDirection.TopRight;\r\n break;\r\n case RelativePosition.TopRight:\r\n menuDirection = ContextMenuDirection.TopLeft;\r\n break;\r\n case RelativePosition.Left:\r\n menuDirection = ContextMenuDirection.Left;\r\n break;\r\n case RelativePosition.Right:\r\n menuDirection = ContextMenuDirection.Right;\r\n break;\r\n case RelativePosition.Bottom:\r\n menuDirection = ContextMenuDirection.Bottom;\r\n break;\r\n case RelativePosition.BottomLeft:\r\n menuDirection = ContextMenuDirection.BottomRight;\r\n break;\r\n case RelativePosition.BottomRight:\r\n menuDirection = ContextMenuDirection.BottomLeft;\r\n break;\r\n }\r\n return menuDirection;\r\n}\r\n"]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  /** Enum for button types. Determines button label, and default button style.
5
5
  * @public
6
- * @deprecated Use DialogButtonType in bentley/appui-abstract instead
6
+ * @deprecated Use [DialogButtonType]($appui-abstract) instead
7
7
  */
8
8
  export declare enum DialogButtonType {
9
9
  None = "",
@@ -18,7 +18,7 @@ export declare enum DialogButtonType {
18
18
  }
19
19
  /** Enum for button style.
20
20
  * @public
21
- * @deprecated Use DialogButtonStyle in bentley/appui-abstract instead
21
+ * @deprecated Use [DialogButtonStyle]($appui-abstract) instead
22
22
  */
23
23
  export declare enum DialogButtonStyle {
24
24
  None = "",
@@ -28,7 +28,7 @@ export declare enum DialogButtonStyle {
28
28
  }
29
29
  /** Interface for a dialog button in a button cluster
30
30
  * @public
31
- * @deprecated Use DialogButtonDef in bentley/appui-abstract instead
31
+ * @deprecated Use [DialogButtonDef]($appui-abstract) instead
32
32
  */
33
33
  export interface DialogButtonDef {
34
34
  /** type of button */
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.DialogButtonStyle = exports.DialogButtonType = void 0;
11
11
  /** Enum for button types. Determines button label, and default button style.
12
12
  * @public
13
- * @deprecated Use DialogButtonType in bentley/appui-abstract instead
13
+ * @deprecated Use [DialogButtonType]($appui-abstract) instead
14
14
  */
15
15
  var DialogButtonType;
16
16
  (function (DialogButtonType) {
@@ -26,7 +26,7 @@ var DialogButtonType;
26
26
  })(DialogButtonType = exports.DialogButtonType || (exports.DialogButtonType = {}));
27
27
  /** Enum for button style.
28
28
  * @public
29
- * @deprecated Use DialogButtonStyle in bentley/appui-abstract instead
29
+ * @deprecated Use [DialogButtonStyle]($appui-abstract) instead
30
30
  */
31
31
  var DialogButtonStyle;
32
32
  (function (DialogButtonStyle) {
@@ -1 +1 @@
1
- {"version":3,"file":"DialogButtonDef.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/DialogButtonDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;IAGI;AACJ,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED;;;IAGI;AACJ,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,iDAA4B,CAAA;AAC9B,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\n/** Enum for button types. Determines button label, and default button style.\r\n * @public\r\n * @deprecated Use DialogButtonType in bentley/appui-abstract instead\r\n */\r\nexport enum DialogButtonType {\r\n None = \"\",\r\n Close = \"close\",\r\n OK = \"ok\",\r\n Cancel = \"cancel\",\r\n Yes = \"yes\",\r\n No = \"no\",\r\n Retry = \"retry\",\r\n Next = \"next\",\r\n Previous = \"previous\"\r\n}\r\n\r\n/** Enum for button style.\r\n * @public\r\n * @deprecated Use DialogButtonStyle in bentley/appui-abstract instead\r\n */\r\nexport enum DialogButtonStyle {\r\n None = \"\",\r\n Primary = \"iui-cta\",\r\n Hollow = \"iui-default\",\r\n Blue = \"iui-high-visibility\",\r\n}\r\n\r\n/** Interface for a dialog button in a button cluster\r\n * @public\r\n * @deprecated Use DialogButtonDef in bentley/appui-abstract instead\r\n */\r\nexport interface DialogButtonDef {\r\n /** type of button */\r\n type: DialogButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Triggered on button click */\r\n onClick: () => void;\r\n /** Which button style to decorate button width */\r\n buttonStyle?: DialogButtonStyle; // eslint-disable-line deprecation/deprecation\r\n /** Disable the button */\r\n disabled?: boolean;\r\n /** Custom label */\r\n label?: string;\r\n /** Custom CSS class */\r\n className?: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"DialogButtonDef.js","sourceRoot":"","sources":["../../../../src/core-react/dialog/DialogButtonDef.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;IAGI;AACJ,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AAED;;;IAGI;AACJ,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,iDAA4B,CAAA;AAC9B,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\n/** Enum for button types. Determines button label, and default button style.\r\n * @public\r\n * @deprecated Use [DialogButtonType]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonType {\r\n None = \"\",\r\n Close = \"close\",\r\n OK = \"ok\",\r\n Cancel = \"cancel\",\r\n Yes = \"yes\",\r\n No = \"no\",\r\n Retry = \"retry\",\r\n Next = \"next\",\r\n Previous = \"previous\"\r\n}\r\n\r\n/** Enum for button style.\r\n * @public\r\n * @deprecated Use [DialogButtonStyle]($appui-abstract) instead\r\n */\r\nexport enum DialogButtonStyle {\r\n None = \"\",\r\n Primary = \"iui-cta\",\r\n Hollow = \"iui-default\",\r\n Blue = \"iui-high-visibility\",\r\n}\r\n\r\n/** Interface for a dialog button in a button cluster\r\n * @public\r\n * @deprecated Use [DialogButtonDef]($appui-abstract) instead\r\n */\r\nexport interface DialogButtonDef {\r\n /** type of button */\r\n type: DialogButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Triggered on button click */\r\n onClick: () => void;\r\n /** Which button style to decorate button width */\r\n buttonStyle?: DialogButtonStyle; // eslint-disable-line deprecation/deprecation\r\n /** Disable the button */\r\n disabled?: boolean;\r\n /** Custom label */\r\n label?: string;\r\n /** Custom CSS class */\r\n className?: string;\r\n}\r\n"]}
@@ -3,10 +3,7 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "./list.scss";
6
- @import "~@itwin/core-react/lib/cjs/core-react/style/itwinui-overrides";
7
6
 
8
7
  .uicore-expandable-blocks-list {
9
8
  @include uicore-expandable-blocks-list;
10
-
11
- @include small-itwinui-expandable-block;
12
9
  }
@@ -4,13 +4,13 @@
4
4
  import * as React from "react";
5
5
  import { FieldDef } from "./Form";
6
6
  /** Properties used to create a [[Field]] in a [[Form]]
7
- * @public
7
+ * @public @deprecated
8
8
  */
9
9
  export interface FieldProps extends FieldDef {
10
10
  id: string;
11
11
  }
12
12
  /** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
13
- * @public
13
+ * @public @deprecated
14
14
  */
15
15
  export declare class Field extends React.Component<FieldProps> {
16
16
  constructor(props: FieldProps);
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAiC,MAAM,QAAQ,CAAC;AAIjE;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAE1C,EAAE,EAAE,MAAM,CAAC;CACZ;AAID;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;gBACxC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,sBAAsB,CAc5B;IAEc,MAAM;CAgDvB"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAiC,MAAM,QAAQ,CAAC;AAIjE;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAE1C,EAAE,EAAE,MAAM,CAAC;CACZ;AAID;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;gBACxC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,sBAAsB,CAc5B;IAEc,MAAM;CAkDvB"}
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
+ /* eslint-disable deprecation/deprecation */
6
7
  /** @packageDocumentation
7
8
  * @module Form
8
9
  */
@@ -12,7 +13,7 @@ const React = require("react");
12
13
  const itwinui_react_1 = require("@itwin/itwinui-react");
13
14
  const Form_1 = require("./Form");
14
15
  /** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.
15
- * @public
16
+ * @public @deprecated
16
17
  */
17
18
  class Field extends React.Component {
18
19
  constructor(props) {
@@ -32,12 +33,12 @@ class Field extends React.Component {
32
33
  const selectOptions = this._generateSelectOptions(this.props.options);
33
34
  return (React.createElement(Form_1.FormContext.Consumer, null, (context) => (React.createElement("div", { className: "core-form-group" },
34
35
  this.props.editor.toLowerCase() !== "checkbox" && this.props.label && React.createElement("label", { className: "core-form-label", htmlFor: this.props.id }, this.props.label),
35
- this.props.editor.toLowerCase() === "textbox" && (React.createElement(itwinui_react_1.Input, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-input" })),
36
+ this.props.editor.toLowerCase() === "textbox" && (React.createElement(itwinui_react_1.Input, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-input", size: "small" })),
36
37
  this.props.editor.toLowerCase() === "checkbox" && (React.createElement(itwinui_react_1.Checkbox, { label: this.props.label, id: this.props.id, checked: context.values[this.props.id], onChange: () => context.setValues({ [this.props.id]: !context.values[this.props.id] }) })),
37
38
  this.props.editor.toLowerCase() === "multilinetextbox" && (React.createElement(itwinui_react_1.Textarea, { id: this.props.id, value: context.values[this.props.id], onChange: (event) => context.setValues({ [this.props.id]: event.currentTarget.value }), className: "core-form-textarea" })),
38
39
  this.props.editor.toLowerCase() === "dropdown" && this.props.options && (React.createElement(itwinui_react_1.Select, { id: this.props.id,
39
40
  // name={this.props.id}
40
- value: context.values[this.props.id], onChange: (newValue) => context.setValues({ [this.props.id]: newValue }), options: selectOptions, className: "core-form-select" }))))));
41
+ value: context.values[this.props.id], onChange: (newValue) => context.setValues({ [this.props.id]: newValue }), options: selectOptions, className: "core-form-select", size: "small" }))))));
41
42
  }
42
43
  }
43
44
  exports.Field = Field;
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAuF;AACvF,iCAAiE;AAcjE;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,SAAqB;IACpD,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,2BAAsB,GAAG,CAAC,WAA4B,EAA0B,EAAE;YACxF,IAAI,aAAa,GAA2B,EAAE,CAAC;YAE/C,IAAI,WAAW,YAAY,KAAK,EAAE;gBAChC,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,CAClD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CACjC,CAAC,CAAC;aACJ;iBAAM,IAAI,WAAW,KAAK,SAAS,EAAE;gBACpC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACpD,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CACxC,CAAC,CAAC;aACJ;YAED,OAAO,aAAa,CAAC;QACvB,CAAC,CAAC;IAh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AC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,GACxF,CACH;YACA,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,WAAW,EAAE,KAAK,kBAAkB,IAAI,CAC1D,oBAAC,wBAAQ,IACP,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,KAAK,EAAE,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EACrC,QAAQ,EAAE,CAAC,KAA6C,EAAE,EAAE,CAAC,OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAC/H,SAAS,EAAC,oBAAoB,GAC9B,CACH;YACA,IAAI,CAAC,KAAK,CAAC,MAAO,CAAC,WAAW,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CACxE,oBAAC,sBAAM,IACL,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;gBACjB,uBAAuB;gBACvB,KAAK,EAAE,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EACrC,QAAQ,EAAE,CAAC,QAAa,EAAE,EAAE,CAAC,OAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAC9E,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,kBAAkB,GAC5B,CACH,CACG,CACP,CACoB,CACxB,CAAC;IACJ,CAAC;CACF;AArED,sBAqEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Form\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Checkbox, Input, Select, SelectOption, Textarea } from \"@itwin/itwinui-react\";\r\nimport { FieldDef, FormContext, FormContextState } from \"./Form\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** Properties used to create a [[Field]] in a [[Form]]\r\n * @public\r\n */\r\nexport interface FieldProps extends FieldDef {\r\n /* The unique field name */\r\n id: string;\r\n}\r\n\r\ntype FieldDefOptions = FieldDef[\"options\"];\r\n\r\n/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.\r\n * @public\r\n */\r\nexport class Field extends React.Component<FieldProps> {\r\n constructor(props: FieldProps) {\r\n super(props);\r\n }\r\n\r\n private _generateSelectOptions = (propOptions: FieldDefOptions): SelectOption<string>[] => {\r\n let selectOptions: SelectOption<string>[] = [];\r\n\r\n if (propOptions instanceof Array) {\r\n selectOptions = propOptions.map((option: string) => (\r\n { value: option, label: option }\r\n ));\r\n } else if (propOptions !== undefined) {\r\n selectOptions = Object.keys(propOptions).map((key) => (\r\n { value: key, label: propOptions[key] }\r\n ));\r\n }\r\n\r\n return selectOptions;\r\n };\r\n\r\n public override render() {\r\n const selectOptions = this._generateSelectOptions(this.props.options);\r\n\r\n return (\r\n <FormContext.Consumer>\r\n {(context: FormContextState | undefined) => (\r\n <div className=\"core-form-group\">\r\n {this.props.editor!.toLowerCase() !== \"checkbox\" && this.props.label && <label className=\"core-form-label\" htmlFor={this.props.id}>{this.props.label}</label>}\r\n\r\n {this.props.editor!.toLowerCase() === \"textbox\" && (\r\n <Input\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-input\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"checkbox\" && (\r\n <Checkbox\r\n label={this.props.label}\r\n id={this.props.id}\r\n checked={context!.values[this.props.id]}\r\n onChange={() => context!.setValues({ [this.props.id]: !context!.values[this.props.id] })}\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"multilinetextbox\" && (\r\n <Textarea\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-textarea\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"dropdown\" && this.props.options && (\r\n <Select\r\n id={this.props.id}\r\n // name={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(newValue: any) => context!.setValues({ [this.props.id]: newValue })}\r\n options={selectOptions}\r\n className=\"core-form-select\"\r\n />\r\n )}\r\n </div>\r\n )}\r\n </FormContext.Consumer>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../src/core-react/form/Field.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAuF;AACvF,iCAAiE;AAcjE;;GAEG;AACH,MAAa,KAAM,SAAQ,KAAK,CAAC,SAAqB;IACpD,YAAY,KAAiB;QAC3B,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,2BAAsB,GAAG,CAAC,WAA4B,EAA0B,EAAE;YACxF,IAAI,aAAa,GAA2B,EAAE,CAAC;YAE/C,IAAI,WAAW,YAAY,KAAK,EAAE;gBAChC,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,CAClD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CACjC,CAAC,CAAC;aACJ;iBAAM,IAAI,WAAW,KAAK,SAAS,EAAE;gBACpC,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EA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I,EAAC,OAAO,GACZ,CACH,CACG,CACP,CACoB,CACxB,CAAC;IACJ,CAAC;CACF;AAvED,sBAuEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Form\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Checkbox, Input, Select, SelectOption, Textarea } from \"@itwin/itwinui-react\";\r\nimport { FieldDef, FormContext, FormContextState } from \"./Form\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** Properties used to create a [[Field]] in a [[Form]]\r\n * @public @deprecated\r\n */\r\nexport interface FieldProps extends FieldDef {\r\n /* The unique field name */\r\n id: string;\r\n}\r\n\r\ntype FieldDefOptions = FieldDef[\"options\"];\r\n\r\n/** Component that represents a single field in an input form. Only four type of editors are supported. Field gets/sets state data from/to the context control by the form.\r\n * @public @deprecated\r\n */\r\nexport class Field extends React.Component<FieldProps> {\r\n constructor(props: FieldProps) {\r\n super(props);\r\n }\r\n\r\n private _generateSelectOptions = (propOptions: FieldDefOptions): SelectOption<string>[] => {\r\n let selectOptions: SelectOption<string>[] = [];\r\n\r\n if (propOptions instanceof Array) {\r\n selectOptions = propOptions.map((option: string) => (\r\n { value: option, label: option }\r\n ));\r\n } else if (propOptions !== undefined) {\r\n selectOptions = Object.keys(propOptions).map((key) => (\r\n { value: key, label: propOptions[key] }\r\n ));\r\n }\r\n\r\n return selectOptions;\r\n };\r\n\r\n public override render() {\r\n const selectOptions = this._generateSelectOptions(this.props.options);\r\n\r\n return (\r\n <FormContext.Consumer>\r\n {(context: FormContextState | undefined) => (\r\n <div className=\"core-form-group\">\r\n {this.props.editor!.toLowerCase() !== \"checkbox\" && this.props.label && <label className=\"core-form-label\" htmlFor={this.props.id}>{this.props.label}</label>}\r\n\r\n {this.props.editor!.toLowerCase() === \"textbox\" && (\r\n <Input\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-input\"\r\n size=\"small\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"checkbox\" && (\r\n <Checkbox\r\n label={this.props.label}\r\n id={this.props.id}\r\n checked={context!.values[this.props.id]}\r\n onChange={() => context!.setValues({ [this.props.id]: !context!.values[this.props.id] })}\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"multilinetextbox\" && (\r\n <Textarea\r\n id={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => context!.setValues({ [this.props.id]: event.currentTarget.value })}\r\n className=\"core-form-textarea\"\r\n />\r\n )}\r\n {this.props.editor!.toLowerCase() === \"dropdown\" && this.props.options && (\r\n <Select\r\n id={this.props.id}\r\n // name={this.props.id}\r\n value={context!.values[this.props.id]}\r\n onChange={(newValue: any) => context!.setValues({ [this.props.id]: newValue })}\r\n options={selectOptions}\r\n className=\"core-form-select\"\r\n size=\"small\"\r\n />\r\n )}\r\n </div>\r\n )}\r\n </FormContext.Consumer>\r\n );\r\n }\r\n}\r\n"]}
@@ -4,11 +4,11 @@
4
4
  import "./Form.scss";
5
5
  import * as React from "react";
6
6
  /** The available editors for the fields in a [[Form]].
7
- * @public
7
+ * @public @deprecated
8
8
  */
9
9
  export declare type FieldEditor = "textbox" | "multilinetextbox" | "dropdown" | "checkbox";
10
10
  /** Interface used to define each [[Field]] in a [[Form]]
11
- * @public
11
+ * @public @deprecated
12
12
  */
13
13
  export interface FieldDef {
14
14
  label?: string;
@@ -19,13 +19,13 @@ export interface FieldDef {
19
19
  value?: any;
20
20
  }
21
21
  /** Key/value pairs for all the field values with key being the field HTML Id.
22
- * @public
22
+ * @public @deprecated
23
23
  */
24
24
  export interface FieldValues {
25
25
  [key: string]: any;
26
26
  }
27
27
  /** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.
28
- * @public
28
+ * @public @deprecated
29
29
  */
30
30
  interface FormState {
31
31
  values: FieldValues;
@@ -34,13 +34,13 @@ interface FormState {
34
34
  }
35
35
  /**
36
36
  * FormContextState combines the Form's state data with the callbacks used to update the value of the state data.
37
- * @public
37
+ * @public @deprecate
38
38
  */
39
39
  export interface FormContextState extends FormState {
40
40
  setValues: (values: FieldValues) => void;
41
41
  }
42
42
  /** React context used by Form as a Provider and by the Fields as Consumers and updaters.
43
- * @public
43
+ * @public @deprecated
44
44
  */
45
45
  export declare const FormContext: React.Context<FormContextState | undefined>;
46
46
  /** Key/value pairs for all the field definitions to be displayed in a [[Form]].
@@ -112,7 +112,7 @@ export interface FormProps {
112
112
  * </div >
113
113
  * );
114
114
  * }
115
- * @public
115
+ * @public @deprecate
116
116
  */
117
117
  export declare class Form extends React.Component<FormProps, FormState> {
118
118
  private _submitButtonLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../src/core-react/form/Form.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,aAAa,CAAC;AACrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,oBAAY,WAAW,GAAG,SAAS,GAAG,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnF;;GAEG;AACH,MAAM,WAAW,QAAQ;IAEvB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,MAAM,CAAC,EAAE,WAAW,CAAC;IAGrB,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAG/C,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AAC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,CAAwC;IAC5D,OAAO,CAAC,YAAY,CAAwC;gBAEhD,KAAK,EAAE,SAAS;IAa5B;;;OAGG;IACH,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,UAAU,CAEhB;IAEF,OAAO,CAAC,aAAa,CAgBnB;IAEc,MAAM;CA2BvB"}
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
+ /* eslint-disable deprecation/deprecation */
6
7
  /** @packageDocumentation
7
8
  * @module Form
8
9
  */
@@ -14,7 +15,7 @@ const UiCore_1 = require("../UiCore");
14
15
  const Field_1 = require("./Field");
15
16
  const itwinui_react_1 = require("@itwin/itwinui-react");
16
17
  /** React context used by Form as a Provider and by the Fields as Consumers and updaters.
17
- * @public
18
+ * @public @deprecated
18
19
  */
19
20
  // eslint-disable-next-line @typescript-eslint/naming-convention
20
21
  exports.FormContext = React.createContext(undefined);
@@ -71,7 +72,7 @@ exports.FormContext.displayName = "core-react:FormContext";
71
72
  * </div >
72
73
  * );
73
74
  * }
74
- * @public
75
+ * @public @deprecate
75
76
  */
76
77
  class Form extends React.Component {
77
78
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../../src/core-react/form/Form.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uBAAqB;AACrB,+BAA+B;AAC/B,sCAAmC;AACnC,mCAAgC;AAChC,wDAA8C;AAuD9C;;GAEG;AACH,gEAAgE;AACnD,QAAA,WAAW,GAAG,KAAK,CAAC,aAAa,CAA+B,SAAS,CAAC,CAAC;AACxF,mBAAW,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAqBnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAa,IAAK,SAAQ,KAAK,CAAC,S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,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CACzD,CACL;4BACL,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CACtD,6BAAK,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,IAAE,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAO,CAC9G,CACG,CACF,CACD,CACH,CACe,CACxB,CAAC;IACJ,CAAC;CACF;AA3ED,oBA2EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Form\r\n */\r\n\r\nimport \"./Form.scss\";\r\nimport * as React from \"react\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { Field } from \"./Field\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** The available editors for the fields in a [[Form]].\r\n * @public\r\n */\r\nexport type FieldEditor = \"textbox\" | \"multilinetextbox\" | \"dropdown\" | \"checkbox\";\r\n\r\n/** Interface used to define each [[Field]] in a [[Form]]\r\n * @public\r\n */\r\nexport interface FieldDef {\r\n /* The label text for the field */\r\n label?: string;\r\n\r\n /* The editor for the field */\r\n editor?: FieldEditor;\r\n\r\n /* The drop down items for the field */\r\n options?: string[] | { [key: string]: string };\r\n\r\n /* The initial field value */\r\n value?: any;\r\n}\r\n\r\n/** Key/value pairs for all the field values with key being the field HTML Id.\r\n * @public\r\n */\r\nexport interface FieldValues {\r\n [key: string]: any;\r\n}\r\n\r\n/** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.\r\n * @public\r\n */\r\ninterface FormState {\r\n /* The field values */\r\n values: FieldValues;\r\n\r\n /* The errorMsg message return in catch of async submit button processing */\r\n errorMsg: string;\r\n\r\n /* Whether the form has been successfully submitted */\r\n submitSuccess?: boolean;\r\n}\r\n\r\n/**\r\n * FormContextState combines the Form's state data with the callbacks used to update the value of the state data.\r\n * @public\r\n */\r\nexport interface FormContextState extends FormState {\r\n setValues: (values: FieldValues) => void;\r\n}\r\n\r\n/** React context used by Form as a Provider and by the Fields as Consumers and updaters.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const FormContext = React.createContext<FormContextState | undefined>(undefined);\r\nFormContext.displayName = \"core-react:FormContext\";\r\n\r\n/** Key/value pairs for all the field definitions to be displayed in a [[Form]].\r\n * @public\r\n */\r\nexport interface FieldDefinitions {\r\n [key: string]: FieldDef;\r\n}\r\n\r\n/** Properties that define [[Form]] including the callback to be called when the Submit button is pressed.\r\n * @public\r\n */\r\nexport interface FormProps {\r\n /** Required async callback the processes the Form data and throws and Error if the data cannot be processed. */\r\n handleFormSubmit: (values: FieldValues) => Promise<void>;\r\n /** Definition used to create each Field in the Form. */\r\n fields: FieldDefinitions;\r\n /** Optional label which will override default Submit button label. */\r\n submitButtonLabel?: string;\r\n}\r\n\r\n/** Component used to create a Form using supplied properties to specify the fields of the Form.\r\n * @example\r\n * // Example of using a form as contents of a modal dialog.\r\n * export class ExampleForm extends React.Component {\r\n * public static open() {\r\n * const form = new ExampleForm({});\r\n * ModalDialogManager.openDialog(form.render());\r\n * }\r\n *\r\n * protected async handleSubmit(values: FieldValues): Promise<void> {\r\n * await this.processFormSubmission(values);\r\n * ModalDialogManager.closeDialog();\r\n * const msg = JSON.stringify(values);\r\n * IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Form Submitted\", msg));\r\n * }\r\n *\r\n * protected async processFormSubmission(values: FieldValues): Promise<void> {\r\n * // if error occurs during async processing throw an Error and return error message back to form.\r\n * throw new Error(\"Error processing form\");\r\n * }\r\n *\r\n * protected handleCancel() {\r\n * ModalDialogManager.closeDialog();\r\n * }\r\n *\r\n * public render() {\r\n * const fields: FieldDefinitions = {\r\n * Name: {\r\n * label: this._nameLabel,\r\n * editor: \"textbox\",\r\n * value: \"John Smith\",\r\n * },\r\n * PickList: {\r\n * label: this._pickListLabel,\r\n * editor: \"dropdown\",\r\n * value: \"one\",\r\n * options: [\"one\", \"two\", \"three\", \"four\"],\r\n * },\r\n * };\r\n *\r\n * return (\r\n * <div>\r\n * <Dialog title=\"Example Form\"\r\n * opened={true}\r\n * onClose={() => this.handleCancel()}>\r\n * <Form handleFormSubmit={(values: FieldValues) => this.handleSubmit(values)}\r\n * fields={fields}\r\n * />\r\n * </Dialog>\r\n * </div >\r\n * );\r\n * }\r\n * @public\r\n */\r\nexport class Form extends React.Component<FormProps, FormState> {\r\n private _submitButtonLabel = UiCore.translate(\"form.submitButtonLabel\");\r\n private _errorPrefix = UiCore.translate(\"form.errorPrefix\");\r\n private _errorSuffix = UiCore.translate(\"form.errorSuffix\");\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n\r\n // set initial values for field values\r\n const values: FieldValues = {};\r\n Object.keys(props.fields).forEach((key) => values[key] = props.fields[key].value);\r\n\r\n this.state = {\r\n errorMsg: \"\",\r\n values,\r\n };\r\n }\r\n\r\n /**\r\n * Returns whether there is an errorMsg message in the state/context\r\n * @param errorMsg - The form errorMsg\r\n */\r\n private haveError(errorMsg: string) {\r\n return errorMsg && errorMsg.length;\r\n }\r\n\r\n private _setValues = (values: FieldValues) => {\r\n this.setState((prevState) => ({ values: { ...prevState.values, ...values } }));\r\n };\r\n\r\n private _handleSubmit = (event: React.FormEvent<HTMLFormElement>, values: FieldValues) => {\r\n event.preventDefault();\r\n\r\n // istanbul ignore next\r\n if (!this.props.handleFormSubmit || !values || 0 === values.length)\r\n throw new Error(\"A handleFormSubmit function and values must be defined\");\r\n\r\n this.props.handleFormSubmit(values)\r\n .then(() => {\r\n // Currently we don't need to do anything if successful. Typically the hosting dialog will close when the\r\n // submission is successful.\r\n // console.log(rtnMsg);\r\n })\r\n .catch((reason: Error) => {\r\n this.setState({ submitSuccess: false, errorMsg: reason.message });\r\n });\r\n };\r\n\r\n public override render() {\r\n const { submitSuccess, errorMsg } = this.state;\r\n const { fields, submitButtonLabel } = this.props;\r\n const context: FormContextState = { ...this.state, setValues: this._setValues };\r\n\r\n return (\r\n <FormContext.Provider value={context}>\r\n <div className=\"core-form-wrapper\">\r\n <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => this._handleSubmit(event, this.state.values)} noValidate={true}>\r\n <div className=\"core-form-container\">\r\n {Object.keys(fields).map((key) => <Field key={key} id={key} {...this.props.fields[key]} />)}\r\n <div className=\"core-form-footer\">\r\n <div className=\"core-form-buttons\">\r\n <Button type=\"submit\" styleType=\"high-visibility\">\r\n {submitButtonLabel ? submitButtonLabel : this._submitButtonLabel}\r\n </Button>\r\n </div>\r\n {submitSuccess === false && this.haveError(errorMsg) && (\r\n <div className=\"core-form-alert\" role=\"alert\">{`${this._errorPrefix}-${errorMsg} ${this._errorSuffix}`}</div>\r\n )}\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </FormContext.Provider>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Form.js","sourceRoot":"","sources":["../../../../src/core-react/form/Form.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,uBAAqB;AACrB,+BAA+B;AAC/B,sCAAmC;AACnC,mCAAgC;AAChC,wDAA8C;AAuD9C;;GAEG;AACH,gEAAgE;AACnD,QAAA,WAAW,GAAG,KAAK,CAAC,aAAa,CAA+B,SAAS,CAAC,CAAC;AACxF,mBAAW,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAqBnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAa,IAAK,SAAQ,KAAK,CAAC,SAA+B;IAK7D,YAAY,KAAgB;QAC1B,KAAK,CAAC,KAAK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AC,IAAI,CAAC,kBAAkB,CACzD,CACL;4BACL,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CACtD,6BAAK,SAAS,EAAC,iBAAiB,EAAC,IAAI,EAAC,OAAO,IAAE,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAO,CAC9G,CACG,CACF,CACD,CACH,CACe,CACxB,CAAC;IACJ,CAAC;CACF;AA3ED,oBA2EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Form\r\n */\r\n\r\nimport \"./Form.scss\";\r\nimport * as React from \"react\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { Field } from \"./Field\";\r\nimport { Button } from \"@itwin/itwinui-react\";\r\n\r\n// cSpell:ignore multilinetextbox\r\n\r\n/** The available editors for the fields in a [[Form]].\r\n * @public @deprecated\r\n */\r\nexport type FieldEditor = \"textbox\" | \"multilinetextbox\" | \"dropdown\" | \"checkbox\";\r\n\r\n/** Interface used to define each [[Field]] in a [[Form]]\r\n * @public @deprecated\r\n */\r\nexport interface FieldDef {\r\n /* The label text for the field */\r\n label?: string;\r\n\r\n /* The editor for the field */\r\n editor?: FieldEditor;\r\n\r\n /* The drop down items for the field */\r\n options?: string[] | { [key: string]: string };\r\n\r\n /* The initial field value */\r\n value?: any;\r\n}\r\n\r\n/** Key/value pairs for all the field values with key being the field HTML Id.\r\n * @public @deprecated\r\n */\r\nexport interface FieldValues {\r\n [key: string]: any;\r\n}\r\n\r\n/** The state data used by [[Form]] to hold state of each [[Field]] and the result of submit button processing.\r\n * @public @deprecated\r\n */\r\ninterface FormState {\r\n /* The field values */\r\n values: FieldValues;\r\n\r\n /* The errorMsg message return in catch of async submit button processing */\r\n errorMsg: string;\r\n\r\n /* Whether the form has been successfully submitted */\r\n submitSuccess?: boolean;\r\n}\r\n\r\n/**\r\n * FormContextState combines the Form's state data with the callbacks used to update the value of the state data.\r\n * @public @deprecate\r\n */\r\nexport interface FormContextState extends FormState {\r\n setValues: (values: FieldValues) => void;\r\n}\r\n\r\n/** React context used by Form as a Provider and by the Fields as Consumers and updaters.\r\n * @public @deprecated\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const FormContext = React.createContext<FormContextState | undefined>(undefined);\r\nFormContext.displayName = \"core-react:FormContext\";\r\n\r\n/** Key/value pairs for all the field definitions to be displayed in a [[Form]].\r\n * @public\r\n */\r\nexport interface FieldDefinitions {\r\n [key: string]: FieldDef;\r\n}\r\n\r\n/** Properties that define [[Form]] including the callback to be called when the Submit button is pressed.\r\n * @public\r\n */\r\nexport interface FormProps {\r\n /** Required async callback the processes the Form data and throws and Error if the data cannot be processed. */\r\n handleFormSubmit: (values: FieldValues) => Promise<void>;\r\n /** Definition used to create each Field in the Form. */\r\n fields: FieldDefinitions;\r\n /** Optional label which will override default Submit button label. */\r\n submitButtonLabel?: string;\r\n}\r\n\r\n/** Component used to create a Form using supplied properties to specify the fields of the Form.\r\n * @example\r\n * // Example of using a form as contents of a modal dialog.\r\n * export class ExampleForm extends React.Component {\r\n * public static open() {\r\n * const form = new ExampleForm({});\r\n * ModalDialogManager.openDialog(form.render());\r\n * }\r\n *\r\n * protected async handleSubmit(values: FieldValues): Promise<void> {\r\n * await this.processFormSubmission(values);\r\n * ModalDialogManager.closeDialog();\r\n * const msg = JSON.stringify(values);\r\n * IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, \"Form Submitted\", msg));\r\n * }\r\n *\r\n * protected async processFormSubmission(values: FieldValues): Promise<void> {\r\n * // if error occurs during async processing throw an Error and return error message back to form.\r\n * throw new Error(\"Error processing form\");\r\n * }\r\n *\r\n * protected handleCancel() {\r\n * ModalDialogManager.closeDialog();\r\n * }\r\n *\r\n * public render() {\r\n * const fields: FieldDefinitions = {\r\n * Name: {\r\n * label: this._nameLabel,\r\n * editor: \"textbox\",\r\n * value: \"John Smith\",\r\n * },\r\n * PickList: {\r\n * label: this._pickListLabel,\r\n * editor: \"dropdown\",\r\n * value: \"one\",\r\n * options: [\"one\", \"two\", \"three\", \"four\"],\r\n * },\r\n * };\r\n *\r\n * return (\r\n * <div>\r\n * <Dialog title=\"Example Form\"\r\n * opened={true}\r\n * onClose={() => this.handleCancel()}>\r\n * <Form handleFormSubmit={(values: FieldValues) => this.handleSubmit(values)}\r\n * fields={fields}\r\n * />\r\n * </Dialog>\r\n * </div >\r\n * );\r\n * }\r\n * @public @deprecate\r\n */\r\nexport class Form extends React.Component<FormProps, FormState> {\r\n private _submitButtonLabel = UiCore.translate(\"form.submitButtonLabel\");\r\n private _errorPrefix = UiCore.translate(\"form.errorPrefix\");\r\n private _errorSuffix = UiCore.translate(\"form.errorSuffix\");\r\n\r\n constructor(props: FormProps) {\r\n super(props);\r\n\r\n // set initial values for field values\r\n const values: FieldValues = {};\r\n Object.keys(props.fields).forEach((key) => values[key] = props.fields[key].value);\r\n\r\n this.state = {\r\n errorMsg: \"\",\r\n values,\r\n };\r\n }\r\n\r\n /**\r\n * Returns whether there is an errorMsg message in the state/context\r\n * @param errorMsg - The form errorMsg\r\n */\r\n private haveError(errorMsg: string) {\r\n return errorMsg && errorMsg.length;\r\n }\r\n\r\n private _setValues = (values: FieldValues) => {\r\n this.setState((prevState) => ({ values: { ...prevState.values, ...values } }));\r\n };\r\n\r\n private _handleSubmit = (event: React.FormEvent<HTMLFormElement>, values: FieldValues) => {\r\n event.preventDefault();\r\n\r\n // istanbul ignore next\r\n if (!this.props.handleFormSubmit || !values || 0 === values.length)\r\n throw new Error(\"A handleFormSubmit function and values must be defined\");\r\n\r\n this.props.handleFormSubmit(values)\r\n .then(() => {\r\n // Currently we don't need to do anything if successful. Typically the hosting dialog will close when the\r\n // submission is successful.\r\n // console.log(rtnMsg);\r\n })\r\n .catch((reason: Error) => {\r\n this.setState({ submitSuccess: false, errorMsg: reason.message });\r\n });\r\n };\r\n\r\n public override render() {\r\n const { submitSuccess, errorMsg } = this.state;\r\n const { fields, submitButtonLabel } = this.props;\r\n const context: FormContextState = { ...this.state, setValues: this._setValues };\r\n\r\n return (\r\n <FormContext.Provider value={context}>\r\n <div className=\"core-form-wrapper\">\r\n <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => this._handleSubmit(event, this.state.values)} noValidate={true}>\r\n <div className=\"core-form-container\">\r\n {Object.keys(fields).map((key) => <Field key={key} id={key} {...this.props.fields[key]} />)}\r\n <div className=\"core-form-footer\">\r\n <div className=\"core-form-buttons\">\r\n <Button type=\"submit\" styleType=\"high-visibility\">\r\n {submitButtonLabel ? submitButtonLabel : this._submitButtonLabel}\r\n </Button>\r\n </div>\r\n {submitSuccess === false && this.haveError(errorMsg) && (\r\n <div className=\"core-form-alert\" role=\"alert\">{`${this._errorPrefix}-${errorMsg} ${this._errorSuffix}`}</div>\r\n )}\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </FormContext.Provider>\r\n );\r\n }\r\n}\r\n"]}
@@ -7,4 +7,9 @@
7
7
  .core-svg-icon {
8
8
  width: $uicore-icons-small;
9
9
  height: $uicore-icons-small;
10
+ svg {
11
+ width: $uicore-icons-small;
12
+ height: $uicore-icons-small;
13
+ fill: currentColor;
14
+ }
10
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAS,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIzD;;GAEG;AACH,oBAAY,gBAAgB,GAAG,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM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