@itwin/components-react 3.1.0-dev.7 → 3.2.0-dev.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 (64) hide show
  1. package/CHANGELOG.md +68 -5
  2. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +2 -0
  3. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.map +1 -1
  4. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  5. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +6 -0
  6. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts.map +1 -1
  7. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  8. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts.map +1 -1
  9. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -0
  10. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  11. package/lib/cjs/components-react/toolbar/Item.d.ts +6 -0
  12. package/lib/cjs/components-react/toolbar/Item.d.ts.map +1 -1
  13. package/lib/cjs/components-react/toolbar/Item.js +1 -1
  14. package/lib/cjs/components-react/toolbar/Item.js.map +1 -1
  15. package/lib/cjs/components-react/toolbar/Overflow.d.ts.map +1 -1
  16. package/lib/cjs/components-react/toolbar/Overflow.js +3 -1
  17. package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
  18. package/lib/cjs/components-react/toolbar/Overflow.scss +7 -0
  19. package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
  20. package/lib/cjs/components-react/toolbar/PopupItem.js +4 -2
  21. package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
  22. package/lib/cjs/components-react/toolbar/PopupItem.scss +13 -2
  23. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  24. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +1 -1
  25. package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  26. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +10 -0
  27. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  28. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +18 -4
  29. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  30. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
  31. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js +1 -1
  32. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
  33. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +2 -0
  34. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts.map +1 -1
  35. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  36. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +6 -0
  37. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts.map +1 -1
  38. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  39. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts.map +1 -1
  40. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -0
  41. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  42. package/lib/esm/components-react/toolbar/Item.d.ts +6 -0
  43. package/lib/esm/components-react/toolbar/Item.d.ts.map +1 -1
  44. package/lib/esm/components-react/toolbar/Item.js +1 -1
  45. package/lib/esm/components-react/toolbar/Item.js.map +1 -1
  46. package/lib/esm/components-react/toolbar/Overflow.d.ts.map +1 -1
  47. package/lib/esm/components-react/toolbar/Overflow.js +4 -2
  48. package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
  49. package/lib/esm/components-react/toolbar/Overflow.scss +7 -0
  50. package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
  51. package/lib/esm/components-react/toolbar/PopupItem.js +5 -3
  52. package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
  53. package/lib/esm/components-react/toolbar/PopupItem.scss +13 -2
  54. package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
  55. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +1 -1
  56. package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  57. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +10 -0
  58. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  59. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +16 -3
  60. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  61. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.d.ts.map +1 -1
  62. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js +1 -1
  63. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.js.map +1 -1
  64. package/package.json +13 -13
package/CHANGELOG.md CHANGED
@@ -1,6 +1,69 @@
1
1
  # Change Log - @itwin/components-react
2
2
 
3
- This log was last generated on Wed, 12 Jan 2022 14:52:38 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
+ - Use ToolbarAutoHidePopupContext to monitor widgets' authoidden state.
11
+
12
+ ## 3.0.0
13
+ Mon, 24 Jan 2022 14:00:52 GMT
14
+
15
+ ### Updates
16
+
17
+ - Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
18
+ - Update CustomNumberEditor to use size='small' itwinUi style.
19
+ - rename to @itwin/components-react
20
+ - remove ClientRequestContext and its subclasses
21
+ - Removed SignIn component
22
+ - Replace usage of I18N with generic Localization interface.
23
+ - Update snapshots
24
+ - Renamed an iModel's parent container to iTwin
25
+ - Support for TypeDoc v0.22.7. Fix various broken docs links.
26
+ - Refactored part of AccuDraw UI & Providing AccuDraw UI documentation
27
+ - Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
28
+ - Add missing public/beta types to the barrel file.
29
+ - Updated recommendation for using Breadcrumbs from itwinui-react instead of deprecated Breadcrumb
30
+ - Change `ControlledTree` to take `TreeModel` instead of `VisibleTreeNodes`.
31
+ - Replace `useVisibleTreeNodes` with `useTreeModel` since consumers don't need to create `VisibleTreeNodes` anymore.
32
+ - Rename `ControlledTreeProps.treeEvents` to `eventsHandler`.
33
+ - Make `width` and `height` required props for `ControlledTree` and `TreeRenderer`.
34
+ - Clean up deprecated Tree and Drag & Drop related APIs
35
+ - Clean up deprecated FilteringInput and PropertyGrid props
36
+ - Make `width` and `height` props required for `VirtualizedPropertyGrid` and `VirtualizedPropertyGridWithDataProvider`
37
+ - Update CustomNumberEditor resetting of bad values.
38
+ - update immer to fix security warning
39
+ - Deprecated Breadcrumb component
40
+ - Deprecate and promote apis
41
+ - Deprecate Table component.
42
+ - Deprecate obsolete APIs. Publish beta APIs from last release.
43
+ - Export BeDragDropContext
44
+ - Upgraded itwinui-react to 1.16.2. Fixed editor sizes.
45
+ - Remove files generated by bad merge
46
+ - Make ToolbarPopupContext public so user can call closePanel from their popup panels.
47
+ - Update props on iTwinUi-react Select so it works properly in auto-sized floating widgets.
48
+ - Deprecated HorizontalTabs in ui-core. Removed older deprecated items. Updated NextVersion.md.
49
+ - Update to latest itwinui-react
50
+ - Clean up css for status bar entries to avoid unwanted text wrapping.
51
+ - Incorporating iTwinUI-CSS and iTwinUI-React into iModel.js
52
+ - iTwinUI-react Table demo
53
+ - Moved iTwinUI style overrides to ui-core from ui-framework
54
+ - Rename ui directories to match new package names.
55
+ - Remove native key handling in React editor components because it's not longer needed with React 17.
56
+ - Add prop that prevents popup button panel from unmounting when closed.
57
+ - Promote property grid related APIs
58
+ - Update to React 17.
59
+ - 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.
60
+ - Remove react 16 peer dependency.
61
+ - Remove itwinUi css overrides.
62
+ - UiFramework and UiIModelComponent initialize method no longer take localization argument, uses IModelApp.localization internally.
63
+ - Replaced ui-core Slider with one from iTwinUi-react.
64
+ - Update to latest types/react package
65
+ - Skip test causing CI job failures
66
+ - Lock down and update version numbers so docs will build.
4
67
 
5
68
  ## 2.19.28
6
69
  Wed, 12 Jan 2022 14:52:38 GMT
@@ -295,7 +358,7 @@ Mon, 24 May 2021 15:58:39 GMT
295
358
  - Improved Multi-Value column filtering in the Table component
296
359
  - Move `VirtualizedPropertyGrid` related types from @alpha to @beta.
297
360
  - Fixed getting distinct values when Table rows are updated
298
- - Update to latest classnames package
361
+ - Update to latest classnames package
299
362
 
300
363
  ## 2.15.6
301
364
  Wed, 26 May 2021 15:55:19 GMT
@@ -761,7 +824,7 @@ Thu, 28 May 2020 22:48:59 GMT
761
824
  ### Updates
762
825
 
763
826
  - Fix toolbar overflow panel display.
764
- - Update to only show group separators if toolbar is not transparent.
827
+ - Update to only show group separators if toolbar is not transparent.
765
828
  - Fix toolbar error when scaling up UI.
766
829
  - Property grid horizontal layout updated according to UX requirements.
767
830
  - Fixed Table filter renderers after react-select version upgrade
@@ -1233,7 +1296,7 @@ Wed, 19 Dec 2018 18:26:14 GMT
1233
1296
  - Added DragDrop tests, added component withDragDrop HOC tests
1234
1297
  - Synchronizing navigation aids with view definition changes
1235
1298
  - Simplified property pane tooltips and improved Property Pane performance.
1236
- - Simplified struct and array tooltips in Table component.
1299
+ - Simplified struct and array tooltips in Table component.
1237
1300
  - Fix BeInspireTree's event listening functions to handle array inputs
1238
1301
  - Fix BeInspireTree's muting events with allowed number of triggers
1239
1302
  - Cache BeInspireTree.visible() result for better performance
@@ -1363,7 +1426,7 @@ Thu, 08 Nov 2018 17:59:21 GMT
1363
1426
 
1364
1427
  ### Updates
1365
1428
 
1366
- - Deprecated dev-cors-proxy-server and use of it.
1429
+ - Deprecated dev-cors-proxy-server and use of it.
1367
1430
  - Fix: Do not start search if input field is empty
1368
1431
  - Use strongly typed enums for identifying keyboard keys
1369
1432
  - PropertyGrid property editing and unit tests
@@ -32,7 +32,9 @@ export interface GridCategoryItem extends FlatGridItemBase {
32
32
  readonly type: FlatGridItemType.Category;
33
33
  readonly name: string;
34
34
  readonly derivedCategory: PropertyCategory;
35
+ /** @deprecated Use [[getChildren]] and filter categories yourself. */
35
36
  getChildCategories(): GridCategoryItem[];
37
+ /** @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. */
36
38
  getDescendantCategoriesAndSelf(): GridCategoryItem[];
37
39
  }
38
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,0BAA0B,EAAE,MAAM,GAAG,SAAS,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,qBAAqB,IAAI,YAAY,EAAE,CAAC;IACxC,4BAA4B,IAAI,YAAY,EAAE,CAAC;IAC/C,WAAW,IAAI,YAAY,EAAE,CAAC;IAC9B,8BAA8B,IAAI,YAAY,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAC;IAE3C,kBAAkB,IAAI,gBAAgB,EAAE,CAAC;IACzC,8BAA8B,IAAI,gBAAgB,EAAE,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC;IACvC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC,WAAW,IAAI,uBAAuB,EAAE,CAAC;CAC1C;AAED;;;GAGG;AACH,oBAAY,YAAY,GAAG,uBAAuB,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"FlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,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E,MAAM,CAAC;IAEpC,WAAW,IAAI,uBAAuB,EAAE,CAAC;CAC1C;AAED;;;GAGG;AACH,oBAAY,YAAY,GAAG,uBAAuB,GAAG,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","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\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { CategorizedPropertyTypes, FlatGridItemType } from \"./MutableFlatGridItem\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Base immutable data structure defining common methods and properties for categories and categorized properties\r\n * @beta\r\n */\r\nexport interface FlatGridItemBase {\r\n readonly isExpanded: boolean;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n readonly type: FlatGridItemType;\r\n readonly lastInNumberOfCategories: number;\r\n readonly isLastInRootCategory: boolean;\r\n getDescendantsAndSelf(): FlatGridItem[];\r\n getVisibleDescendantsAndSelf(): FlatGridItem[];\r\n getChildren(): FlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): FlatGridItem;\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[GridCategoryItem]]\r\n * @beta\r\n */\r\nexport interface GridCategoryItem extends FlatGridItemBase {\r\n readonly type: FlatGridItemType.Category;\r\n readonly name: string;\r\n readonly derivedCategory: PropertyCategory;\r\n\r\n getChildCategories(): GridCategoryItem[];\r\n getDescendantCategoriesAndSelf(): GridCategoryItem[];\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[CategorizedPropertyItem]] objects\r\n * @beta\r\n */\r\nexport interface CategorizedPropertyItem extends FlatGridItemBase {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): CategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes immutable [[GridCategoryItem]] or [[CategorizedPropertyItem]]\r\n * @beta\r\n */\r\nexport type FlatGridItem = CategorizedPropertyItem | GridCategoryItem;\r\n"]}
1
+ {"version":3,"file":"FlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/FlatGridItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F","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\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { CategorizedPropertyTypes, FlatGridItemType } from \"./MutableFlatGridItem\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Base immutable data structure defining common methods and properties for categories and categorized properties\r\n * @beta\r\n */\r\nexport interface FlatGridItemBase {\r\n readonly isExpanded: boolean;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n readonly type: FlatGridItemType;\r\n readonly lastInNumberOfCategories: number;\r\n readonly isLastInRootCategory: boolean;\r\n getDescendantsAndSelf(): FlatGridItem[];\r\n getVisibleDescendantsAndSelf(): FlatGridItem[];\r\n getChildren(): FlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): FlatGridItem;\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[GridCategoryItem]]\r\n * @beta\r\n */\r\nexport interface GridCategoryItem extends FlatGridItemBase {\r\n readonly type: FlatGridItemType.Category;\r\n readonly name: string;\r\n readonly derivedCategory: PropertyCategory;\r\n\r\n /** @deprecated Use [[getChildren]] and filter categories yourself. */\r\n getChildCategories(): GridCategoryItem[];\r\n /** @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. */\r\n getDescendantCategoriesAndSelf(): GridCategoryItem[];\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties present on immutable [[CategorizedPropertyItem]] objects\r\n * @beta\r\n */\r\nexport interface CategorizedPropertyItem extends FlatGridItemBase {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): CategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes immutable [[GridCategoryItem]] or [[CategorizedPropertyItem]]\r\n * @beta\r\n */\r\nexport type FlatGridItem = CategorizedPropertyItem | GridCategoryItem;\r\n"]}
@@ -104,7 +104,13 @@ export interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {
104
104
  name: string;
105
105
  derivedCategory: PropertyCategory;
106
106
  isRootCategory: boolean;
107
+ /**
108
+ * @deprecated Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
109
+ */
107
110
  getChildCategories(): IMutableGridCategoryItem[];
111
+ /**
112
+ * @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.
113
+ */
108
114
  getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];
109
115
  }
110
116
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"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E,CAAC;IACjD,8BAA8B,IAAI,wBAAwB,EAAE,CAAC;CAC9D;AAED;;;GAGG;AACH,MAAM,WAAW,+BAAgC,SAAQ,4BAA4B;IACnF,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC;IACvC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC,WAAW,IAAI,+BAA+B,EAAE,CAAC;CAClD;AAED;;;GAGG;AACH,oBAAY,oBAAoB,GAAG,+BAA+B,GAAG,wBAAwB,CAAC;AAE9F;;;GAGG;AACH,8BAAsB,0BAA2B,SAAQ,2BAA4B,YAAW,OAAO,CAAC,+BAA+B,CAAC;IACtI,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,aAAa,CAAS;gBAG5B,IAAI,EAAE,wBAAwB,EAC9B,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM;IAkB/B,SAAyB,IAAI,EAAE,wBAAwB,CAAC;aAC/B,WAAW,IAAI,+BAA+B,EAAE;IAEzE;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAQlB,OAAO,IAAI,+BAA+B;IAIjD,IAAoB,0BAA0B,WAE7C;IAED,IAAoB,kBAAkB,WAErC;IAED;;OAEG;IACH,IAAW,YAAY,WAEtB;IAED,IAAW,KAAK,WAEf;IAED;;OAEG;IACH,IAAW,aAAa,mBAEvB;CACF"}
1
+ {"version":3,"file":"MutableFlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem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eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,YAAY,CAAC;QAExD,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,MAAsB,EAAE,4BAAiD;QACjG,6DAA6D;QAC7D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,+BAAc,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AA1GD,gEA0GC","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 PropertyGrid\r\n */\r\nimport { immerable } from \"immer\";\r\nimport shortid from \"shortid\";\r\nimport { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\r\n * Category for PropertyCategory\r\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\r\n * @beta\r\n */\r\nexport enum FlatGridItemType {\r\n Category,\r\n Primitive,\r\n Array,\r\n Struct,\r\n}\r\n\r\n/**\r\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\r\n * @beta\r\n */\r\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\r\n\r\n/**\r\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableFlatPropertyGridItem {\r\n readonly type: FlatGridItemType;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n lastInNumberOfCategories: number;\r\n isLastInRootCategory: boolean;\r\n isExpanded: boolean;\r\n getDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getChildren(): IMutableFlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\r\n}\r\n\r\n/**\r\n * Base class for all FlatPropertyGrid items\r\n * @beta\r\n */\r\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\r\n public [immerable] = true;\r\n\r\n public readonly key: string = shortid.generate();\r\n protected _isExpanded: boolean = false;\r\n protected _lastInNumberOfCategories: number = 0;\r\n protected _isLastInRootCategory: boolean = false;\r\n\r\n public constructor(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\r\n if (this._depth < 0)\r\n throw new Error(\"Depth cannot be negative\");\r\n }\r\n\r\n public abstract type: FlatGridItemType;\r\n public abstract label: string;\r\n public abstract selectionKey: string;\r\n\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n public get parentSelectionKey() {\r\n return this._parentSelectionKey;\r\n }\r\n\r\n public get parentCategorySelectionKey() {\r\n return this._parentCategorySelectionKey;\r\n }\r\n\r\n public get isExpanded() {\r\n return this._isExpanded;\r\n }\r\n\r\n public set isExpanded(value: boolean) {\r\n this._isExpanded = value;\r\n }\r\n\r\n public abstract getChildren(): IMutableFlatGridItem[];\r\n public abstract getSelf(): IMutableFlatGridItem;\r\n\r\n protected getDescendants() {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n this.getChildren().forEach((child) => descendants.push(...child.getDescendantsAndSelf()));\r\n\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\r\n */\r\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getDescendants()];\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\r\n */\r\n public getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded)\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\r\n */\r\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getVisibleDescendants()];\r\n }\r\n\r\n /**\r\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\r\n */\r\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\r\n if (!this.isExpanded)\r\n return this.getSelf();\r\n\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return this.getSelf();\r\n\r\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\r\n }\r\n\r\n /**\r\n * Sets lastInNumberOfCategories value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].lastInNumberOfCategories = value;\r\n }\r\n\r\n /**\r\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get isLastInRootCategory(): boolean {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return false;\r\n\r\n return this._isLastInRootCategory;\r\n }\r\n\r\n public set isLastInRootCategory(value: boolean) {\r\n this._isLastInRootCategory = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].isLastInRootCategory = value;\r\n }\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\r\n type: FlatGridItemType.Category;\r\n name: string;\r\n derivedCategory: PropertyCategory;\r\n isRootCategory: boolean;\r\n\r\n getChildCategories(): IMutableGridCategoryItem[];\r\n getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\r\n * @beta\r\n */\r\nexport interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): IMutableCategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes mutable GridCategoryItem or CategorizedProperty\r\n * @beta\r\n */\r\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\r\n\r\n/**\r\n * Base class for all Mutable CategorizedProperties\r\n * @beta\r\n */\r\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\r\n private _derivedRecord: PropertyRecord;\r\n private _selectionKey: string;\r\n\r\n public constructor(\r\n type: CategorizedPropertyTypes,\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(depth, parentSelectionKey, parentCategorySelectionKey);\r\n\r\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\r\n if (recordType !== type) {\r\n const expectedTypeStr = FlatGridItemType[type];\r\n const actualTypeStr = FlatGridItemType[recordType];\r\n throw Error(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\r\n }\r\n\r\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\r\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\r\n\r\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\r\n this._isExpanded = !!record.autoExpand;\r\n }\r\n\r\n public abstract override type: CategorizedPropertyTypes;\r\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\r\n\r\n /**\r\n * Maps PropertyRecord valueFormat to FlatGridItemType\r\n * @param valueType valueFormat to map\r\n * @returns mapped FlatGridItemType\r\n */\r\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\r\n switch (valueType) {\r\n case PropertyValueFormat.Primitive:\r\n return FlatGridItemType.Primitive;\r\n case PropertyValueFormat.Array:\r\n return FlatGridItemType.Array;\r\n case PropertyValueFormat.Struct:\r\n return FlatGridItemType.Struct;\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledType: never = valueType;\r\n throw Error(`Property Value Format not handled: ${unhandledType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Make new property description with overriden fields.\r\n * @param propertyDescription property description to override.\r\n * @param overrideName property description name to override.\r\n * @param overrideDisplay property description display name to override.\r\n */\r\n private makeOverridenProperty(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): PropertyDescription {\r\n const { name, displayLabel, ...property } = { ...propertyDescription };\r\n const newName = overrideName ?? name;\r\n const newDisplayLabel = overrideDisplay ?? displayLabel;\r\n\r\n return { ...property, name: newName, displayLabel: newDisplayLabel };\r\n }\r\n\r\n /**\r\n * Gets derived property record that has it's property description field overriden\r\n */\r\n private makeDerivedRecord(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value, property, ...others } = record;\r\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\r\n\r\n return Object.assign(newRecord, others);\r\n }\r\n\r\n public getSelf(): IMutableCategorizedPropertyItem {\r\n return this;\r\n }\r\n\r\n public override get parentCategorySelectionKey() {\r\n return super.parentCategorySelectionKey!;\r\n }\r\n\r\n public override get parentSelectionKey() {\r\n return super.parentSelectionKey!;\r\n }\r\n\r\n /**\r\n * Unique selection key made of parent selectionKey and this property name.\r\n */\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get label() {\r\n return this._derivedRecord.property.displayLabel;\r\n }\r\n\r\n /**\r\n * Record with overriden property description.\r\n */\r\n public get derivedRecord() {\r\n return this._derivedRecord;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";;;;;;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,iCAAkC;AAClC,sDAA8B;AAC9B,0DAAiG;AAGjG;;;;;GAKG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AA6BD;;;GAGG;AACH,MAAsB,2BAA2B;IAQ/C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AAO,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AA1GD,gEA0GC","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 PropertyGrid\r\n */\r\nimport { immerable } from \"immer\";\r\nimport shortid from \"shortid\";\r\nimport { PropertyDescription, PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\n\r\n/**\r\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\r\n * Category for PropertyCategory\r\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\r\n * @beta\r\n */\r\nexport enum FlatGridItemType {\r\n Category,\r\n Primitive,\r\n Array,\r\n Struct,\r\n}\r\n\r\n/**\r\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\r\n * @beta\r\n */\r\nexport type CategorizedPropertyTypes = FlatGridItemType.Array | FlatGridItemType.Primitive | FlatGridItemType.Struct;\r\n\r\n/**\r\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableFlatPropertyGridItem {\r\n readonly type: FlatGridItemType;\r\n readonly key: string;\r\n readonly selectionKey: string;\r\n readonly parentSelectionKey: string | undefined;\r\n readonly parentCategorySelectionKey: string | undefined;\r\n readonly depth: number;\r\n readonly label: string;\r\n lastInNumberOfCategories: number;\r\n isLastInRootCategory: boolean;\r\n isExpanded: boolean;\r\n getDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\r\n getChildren(): IMutableFlatGridItem[];\r\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\r\n}\r\n\r\n/**\r\n * Base class for all FlatPropertyGrid items\r\n * @beta\r\n */\r\nexport abstract class MutableFlatPropertyGridItem implements IMutableFlatPropertyGridItem {\r\n public [immerable] = true;\r\n\r\n public readonly key: string = shortid.generate();\r\n protected _isExpanded: boolean = false;\r\n protected _lastInNumberOfCategories: number = 0;\r\n protected _isLastInRootCategory: boolean = false;\r\n\r\n public constructor(private _depth: number, private _parentSelectionKey: string | undefined, private _parentCategorySelectionKey: string | undefined) {\r\n if (this._depth < 0)\r\n throw new Error(\"Depth cannot be negative\");\r\n }\r\n\r\n public abstract type: FlatGridItemType;\r\n public abstract label: string;\r\n public abstract selectionKey: string;\r\n\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n public get parentSelectionKey() {\r\n return this._parentSelectionKey;\r\n }\r\n\r\n public get parentCategorySelectionKey() {\r\n return this._parentCategorySelectionKey;\r\n }\r\n\r\n public get isExpanded() {\r\n return this._isExpanded;\r\n }\r\n\r\n public set isExpanded(value: boolean) {\r\n this._isExpanded = value;\r\n }\r\n\r\n public abstract getChildren(): IMutableFlatGridItem[];\r\n public abstract getSelf(): IMutableFlatGridItem;\r\n\r\n protected getDescendants() {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n this.getChildren().forEach((child) => descendants.push(...child.getDescendantsAndSelf()));\r\n\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\r\n */\r\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getDescendants()];\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\r\n */\r\n public getVisibleDescendants(): IMutableFlatGridItem[] {\r\n const descendants: IMutableFlatGridItem[] = [];\r\n if (this.isExpanded)\r\n this.getChildren().forEach((child) => descendants.push(...child.getVisibleDescendantsAndSelf()));\r\n return descendants;\r\n }\r\n\r\n /**\r\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\r\n */\r\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\r\n return [this.getSelf(), ...this.getVisibleDescendants()];\r\n }\r\n\r\n /**\r\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\r\n */\r\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\r\n if (!this.isExpanded)\r\n return this.getSelf();\r\n\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return this.getSelf();\r\n\r\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\r\n }\r\n\r\n /**\r\n * Sets lastInNumberOfCategories value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories;\r\n }\r\n\r\n public set lastInNumberOfCategories(value: number) {\r\n this._lastInNumberOfCategories = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].lastInNumberOfCategories = value;\r\n }\r\n\r\n /**\r\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\r\n * @internal\r\n */\r\n public get isLastInRootCategory(): boolean {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return false;\r\n\r\n return this._isLastInRootCategory;\r\n }\r\n\r\n public set isLastInRootCategory(value: boolean) {\r\n this._isLastInRootCategory = value;\r\n const children = this.getChildren();\r\n if (children.length < 1)\r\n return;\r\n\r\n children[children.length - 1].isLastInRootCategory = value;\r\n }\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\r\n * @beta\r\n */\r\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\r\n type: FlatGridItemType.Category;\r\n name: string;\r\n derivedCategory: PropertyCategory;\r\n isRootCategory: boolean;\r\n\r\n /**\r\n * @deprecated Use [[getChildren]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\r\n getChildCategories(): IMutableGridCategoryItem[];\r\n /**\r\n * @deprecated Use [[getDescendantsAndSelf]] and filter categories yourself. Do not use this method to mutate the grid model, as this may lead to unexpected outcomes.\r\n */\r\n getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[];\r\n}\r\n\r\n/**\r\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\r\n * @beta\r\n */\r\nexport interface IMutableCategorizedPropertyItem extends IMutableFlatPropertyGridItem {\r\n readonly type: CategorizedPropertyTypes;\r\n readonly derivedRecord: PropertyRecord;\r\n readonly parentCategorySelectionKey: string;\r\n readonly parentSelectionKey: string;\r\n\r\n getChildren(): IMutableCategorizedPropertyItem[];\r\n}\r\n\r\n/**\r\n * Type which describes mutable GridCategoryItem or CategorizedProperty\r\n * @beta\r\n */\r\nexport type IMutableFlatGridItem = IMutableCategorizedPropertyItem | IMutableGridCategoryItem;\r\n\r\n/**\r\n * Base class for all Mutable CategorizedProperties\r\n * @beta\r\n */\r\nexport abstract class MutableCategorizedProperty extends MutableFlatPropertyGridItem implements Partial<IMutableCategorizedPropertyItem> {\r\n private _derivedRecord: PropertyRecord;\r\n private _selectionKey: string;\r\n\r\n public constructor(\r\n type: CategorizedPropertyTypes,\r\n record: PropertyRecord,\r\n parentSelectionKey: string,\r\n parentCategorySelectionKey: string,\r\n depth: number,\r\n overrideName?: string,\r\n overrideDisplayLabel?: string,\r\n ) {\r\n super(depth, parentSelectionKey, parentCategorySelectionKey);\r\n\r\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\r\n if (recordType !== type) {\r\n const expectedTypeStr = FlatGridItemType[type];\r\n const actualTypeStr = FlatGridItemType[recordType];\r\n throw Error(`Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`);\r\n }\r\n\r\n const overridenProperty = this.makeOverridenProperty(record.property, overrideName, overrideDisplayLabel);\r\n this._derivedRecord = this.makeDerivedRecord(record, overridenProperty);\r\n\r\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\r\n this._isExpanded = !!record.autoExpand;\r\n }\r\n\r\n public abstract override type: CategorizedPropertyTypes;\r\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\r\n\r\n /**\r\n * Maps PropertyRecord valueFormat to FlatGridItemType\r\n * @param valueType valueFormat to map\r\n * @returns mapped FlatGridItemType\r\n */\r\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\r\n switch (valueType) {\r\n case PropertyValueFormat.Primitive:\r\n return FlatGridItemType.Primitive;\r\n case PropertyValueFormat.Array:\r\n return FlatGridItemType.Array;\r\n case PropertyValueFormat.Struct:\r\n return FlatGridItemType.Struct;\r\n /* istanbul ignore next */\r\n default:\r\n const unhandledType: never = valueType;\r\n throw Error(`Property Value Format not handled: ${unhandledType}`);\r\n }\r\n }\r\n\r\n /**\r\n * Make new property description with overriden fields.\r\n * @param propertyDescription property description to override.\r\n * @param overrideName property description name to override.\r\n * @param overrideDisplay property description display name to override.\r\n */\r\n private makeOverridenProperty(propertyDescription: PropertyDescription, overrideName?: string, overrideDisplay?: string): PropertyDescription {\r\n const { name, displayLabel, ...property } = { ...propertyDescription };\r\n const newName = overrideName ?? name;\r\n const newDisplayLabel = overrideDisplay ?? displayLabel;\r\n\r\n return { ...property, name: newName, displayLabel: newDisplayLabel };\r\n }\r\n\r\n /**\r\n * Gets derived property record that has it's property description field overriden\r\n */\r\n private makeDerivedRecord(record: PropertyRecord, overridenPropertyDescription: PropertyDescription) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { value, property, ...others } = record;\r\n const newRecord = new PropertyRecord(value, overridenPropertyDescription);\r\n\r\n return Object.assign(newRecord, others);\r\n }\r\n\r\n public getSelf(): IMutableCategorizedPropertyItem {\r\n return this;\r\n }\r\n\r\n public override get parentCategorySelectionKey() {\r\n return super.parentCategorySelectionKey!;\r\n }\r\n\r\n public override get parentSelectionKey() {\r\n return super.parentSelectionKey!;\r\n }\r\n\r\n /**\r\n * Unique selection key made of parent selectionKey and this property name.\r\n */\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get label() {\r\n return this._derivedRecord.property.displayLabel;\r\n }\r\n\r\n /**\r\n * Record with overriden property description.\r\n */\r\n public get derivedRecord() {\r\n return this._derivedRecord;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridCategory.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACtI,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,EAAE,CAAC;CAC1C;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,2BAA4B,YAAW,wBAAwB;IACtG,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAmB;gBAGlC,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,uBAAuB,EACxC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,KAAK,GAAE,MAAU;IA0BnB;;OAEG;IACH,IAAW,cAAc,YAExB;IAED,IAAW,YAAY,WAEtB;IAED,IAAW,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAE3C;IAED,IAAW,IAAI,WAEd;IAED,IAAW,KAAK,WAEf;IAED,IAAW,eAAe,IAAI,gBAAgB,CAE7C;IAEM,OAAO;IAIP,WAAW,IAAI,oBAAoB,EAAE;IAIrC,kBAAkB;IAIzB;;OAEG;IACI,8BAA8B,IAAI,wBAAwB,EAAE;IAOnE;;;;;OAKG;IACH,IAAoB,wBAAwB,IAAI,MAAM,CAKrD;IAED,IAAoB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAEzD;CACF"}
1
+ {"version":3,"file":"MutableGridCategory.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACtI,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,EAAE,CAAC;CAC1C;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,2BAA4B,YAAW,wBAAwB;IACtG,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAmB;gBAGlC,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,uBAAuB,EACxC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,KAAK,GAAE,MAAU;IA0BnB;;OAEG;IACH,IAAW,cAAc,YAExB;IAED,IAAW,YAAY,WAEtB;IAED,IAAW,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAE3C;IAED,IAAW,IAAI,WAEd;IAED,IAAW,KAAK,WAEf;IAED,IAAW,eAAe,IAAI,gBAAgB,CAE7C;IAEM,OAAO;IAIP,WAAW,IAAI,oBAAoB,EAAE;IAIrC,kBAAkB;IAIzB;;OAEG;IACI,8BAA8B,IAAI,wBAAwB,EAAE;IAQnE;;;;;OAKG;IACH,IAAoB,wBAAwB,IAAI,MAAM,CAKrD;IAED,IAAoB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAEzD;CACF"}
@@ -65,6 +65,7 @@ class MutableGridCategory extends MutableFlatGridItem_1.MutableFlatPropertyGridI
65
65
  */
66
66
  getDescendantCategoriesAndSelf() {
67
67
  const descendants = [];
68
+ // eslint-disable-next-line deprecation/deprecation
68
69
  this._childCategories.forEach((value) => descendants.push(...value.getDescendantCategoriesAndSelf()));
69
70
  return [this, ...descendants];
70
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,+DAAsI;AAWtI;;;GAGG;AACH,MAAa,mBAAoB,SAAQ,iDAA2B;IAMlE,YACE,QAA0B,EAC1B,WAAgC,EAChC,eAAwC,EACxC,kBAA2B,EAC3B,QAAgB,CAAC;;QAEjB,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,EAA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AW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,IAAI;QACb,OAAO,sCAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC7B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACxD,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,8BAA8B;QACnC,MAAM,WAAW,GAA+B,EAAE,CAAC;QACnD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC;QAEtG,OAAO,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,IAAoB,wBAAwB;QAC1C,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,CAAC,CAAC;QAEX,OAAO,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAtGD,kDAsGC","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\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\r\n * @beta\r\n */\r\nexport interface CategoryRecordsDict {\r\n [categoryName: string]: PropertyRecord[];\r\n}\r\n\r\n/**\r\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\r\n * @beta\r\n */\r\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private _children: IMutableFlatGridItem[];\r\n private _childCategories: IMutableGridCategoryItem[];\r\n private _selectionKey: string;\r\n private _category: PropertyCategory;\r\n\r\n constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey?: string,\r\n depth: number = 0,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n this._category = { name: category.name, label: category.label, expand: category.expand };\r\n\r\n if (parentSelectionKey !== undefined)\r\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\r\n else\r\n this._selectionKey = category.name;\r\n\r\n this._isExpanded = category.expand;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\r\n\r\n const childCategories = category.childCategories ?? [];\r\n this._childCategories = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\r\n\r\n this._children.push(...this._childCategories);\r\n\r\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\r\n this.lastInNumberOfCategories = 0;\r\n this.isLastInRootCategory = this.isRootCategory;\r\n }\r\n\r\n /**\r\n * Category is considered to be root category if its depth is 0\r\n */\r\n public get isRootCategory() {\r\n return this.depth === 0;\r\n }\r\n\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get type(): FlatGridItemType.Category {\r\n return FlatGridItemType.Category;\r\n }\r\n\r\n public get name() {\r\n return this._category.name;\r\n }\r\n\r\n public get label() {\r\n return this._category.label;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return { ...this._category, expand: this.isExpanded };\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n public getChildCategories() {\r\n return this._childCategories;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all categories beneath this category and itself in depth first visiting order.\r\n */\r\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\r\n const descendants: IMutableGridCategoryItem[] = [];\r\n this._childCategories.forEach((value) => descendants.push(...value.getDescendantCategoriesAndSelf()));\r\n\r\n return [this, ...descendants];\r\n }\r\n\r\n /**\r\n * Gets and Sets lastInNumberOfCategories.\r\n * Setter increments set value by one to account self as category.\r\n * New value is sent down to this items last child\r\n * @internal\r\n */\r\n public override get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories - 1;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n super.lastInNumberOfCategories = value + 1;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableGridCategory.js","sourceRoot":"","sources":["../../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;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AAC;YAClD,OAAO,CAAC,CAAC;QAEX,OAAO,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,IAAoB,wBAAwB,CAAC,KAAa;QACxD,KAAK,CAAC,wBAAwB,GAAG,KAAK,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAvGD,kDAuGC","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\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\r\nimport { FlatGridItemType, IMutableFlatGridItem, IMutableGridCategoryItem, MutableFlatPropertyGridItem } from \"./MutableFlatGridItem\";\r\nimport { IMutableGridItemFactory } from \"./MutableGridItemFactory\";\r\n\r\n/**\r\n * Category name to PropertyRecord[] key pair interface used to describe which records belong to which category.\r\n * @beta\r\n */\r\nexport interface CategoryRecordsDict {\r\n [categoryName: string]: PropertyRecord[];\r\n}\r\n\r\n/**\r\n * Mutable wrapper object for PropertyCategory which provides methods for working with and managing category and record children hierarchies\r\n * @beta\r\n */\r\nexport class MutableGridCategory extends MutableFlatPropertyGridItem implements IMutableGridCategoryItem {\r\n private _children: IMutableFlatGridItem[];\r\n private _childCategories: IMutableGridCategoryItem[];\r\n private _selectionKey: string;\r\n private _category: PropertyCategory;\r\n\r\n constructor(\r\n category: PropertyCategory,\r\n recordsDict: CategoryRecordsDict,\r\n gridItemFactory: IMutableGridItemFactory,\r\n parentSelectionKey?: string,\r\n depth: number = 0,\r\n ) {\r\n super(depth, parentSelectionKey, parentSelectionKey);\r\n this._category = { name: category.name, label: category.label, expand: category.expand };\r\n\r\n if (parentSelectionKey !== undefined)\r\n this._selectionKey = `${parentSelectionKey}_${category.name}`;\r\n else\r\n this._selectionKey = category.name;\r\n\r\n this._isExpanded = category.expand;\r\n\r\n // Even though categories are nested and have their own depth, categorized properties depth is counted starting with the parent category.\r\n const categoryRecords = recordsDict[category.name] ?? [];\r\n this._children = categoryRecords.map((value) => gridItemFactory.createCategorizedProperty(value, this.selectionKey, this.selectionKey, 0));\r\n\r\n const childCategories = category.childCategories ?? [];\r\n this._childCategories = childCategories.map((childCategory) => gridItemFactory.createGridCategory(childCategory, recordsDict, this.selectionKey, this.depth + 1));\r\n\r\n this._children.push(...this._childCategories);\r\n\r\n // Assign lastInNumberOfCategories and isLastInRootCategory for entire children hierarchy\r\n this.lastInNumberOfCategories = 0;\r\n this.isLastInRootCategory = this.isRootCategory;\r\n }\r\n\r\n /**\r\n * Category is considered to be root category if its depth is 0\r\n */\r\n public get isRootCategory() {\r\n return this.depth === 0;\r\n }\r\n\r\n public get selectionKey() {\r\n return this._selectionKey;\r\n }\r\n\r\n public get type(): FlatGridItemType.Category {\r\n return FlatGridItemType.Category;\r\n }\r\n\r\n public get name() {\r\n return this._category.name;\r\n }\r\n\r\n public get label() {\r\n return this._category.label;\r\n }\r\n\r\n public get derivedCategory(): PropertyCategory {\r\n return { ...this._category, expand: this.isExpanded };\r\n }\r\n\r\n public getSelf() {\r\n return this;\r\n }\r\n\r\n public getChildren(): IMutableFlatGridItem[] {\r\n return this._children;\r\n }\r\n\r\n public getChildCategories() {\r\n return this._childCategories;\r\n }\r\n\r\n /**\r\n * Gets a flat list of all categories beneath this category and itself in depth first visiting order.\r\n */\r\n public getDescendantCategoriesAndSelf(): IMutableGridCategoryItem[] {\r\n const descendants: IMutableGridCategoryItem[] = [];\r\n // eslint-disable-next-line deprecation/deprecation\r\n this._childCategories.forEach((value) => descendants.push(...value.getDescendantCategoriesAndSelf()));\r\n\r\n return [this, ...descendants];\r\n }\r\n\r\n /**\r\n * Gets and Sets lastInNumberOfCategories.\r\n * Setter increments set value by one to account self as category.\r\n * New value is sent down to this items last child\r\n * @internal\r\n */\r\n public override get lastInNumberOfCategories(): number {\r\n if (this.isExpanded && this.getChildren().length > 0)\r\n return 0;\r\n\r\n return this._lastInNumberOfCategories - 1;\r\n }\r\n\r\n public override set lastInNumberOfCategories(value: number) {\r\n super.lastInNumberOfCategories = value + 1;\r\n }\r\n}\r\n"]}
@@ -24,6 +24,12 @@ export interface ToolbarButtonItemProps extends CommonProps {
24
24
  badge?: React.ReactNode;
25
25
  /** If true add a gap before button. Default to false. */
26
26
  addGroupSeparator?: boolean;
27
+ /** value added to DOM element as a data attribute to hold name of items provider. If specified in `FrontstageProvider` then this will be undefined */
28
+ providerId?: string;
29
+ /** value added to DOM element as a data attribute, shows 0 is undefined */
30
+ itemPriority?: number;
31
+ /** value added to DOM element as a data attribute */
32
+ groupPriority?: number;
27
33
  }
28
34
  /** Toolbar item component. Used in [[Toolbar]] component.
29
35
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,mBAAmB;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC7C,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AAEH,eAAO,MAAM,iBAAiB,6DA6B1B,CAAC"}
1
+ {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,mBAAmB;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC7C,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sJAAsJ;IACtJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AAEH,eAAO,MAAM,iBAAiB,6DAgC1B,CAAC"}
@@ -39,7 +39,7 @@ const React = __importStar(require("react"));
39
39
  // eslint-disable-next-line react/display-name
40
40
  exports.ToolbarButtonItem = React.memo((props) => {
41
41
  const className = (0, classnames_1.default)("components-toolbar-button-item", props.isActive && "components-active", props.isDisabled && "components-disabled", props.className);
42
- return (React.createElement("button", { "data-item-id": props.itemId, "data-item-type": "tool-button", disabled: props.isDisabled, onClick: props.onClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: props.title },
42
+ return (React.createElement("button", { "data-item-id": props.itemId, "data-item-type": "action-tool-button", "data-item-group-priority": props.groupPriority, "data-item-priority": props.itemPriority, "data-item-providerid": props.providerId, disabled: props.isDisabled, onClick: props.onClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: props.title },
43
43
  React.createElement("div", { className: "components-icon" }, props.icon),
44
44
  props.badge &&
45
45
  React.createElement("div", { className: "components-badge" }, props.badge)));
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AAyB/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,aAAa,EAC5B,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,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 Toolbar\r\n */\r\n\r\nimport \"./Item.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Properties of [[ToolbarButtonItem]] component.\r\n * @public\r\n */\r\nexport interface ToolbarButtonItemProps extends CommonProps {\r\n /** button icon. */\r\n icon?: React.ReactNode;\r\n /** Describes if item is active. */\r\n isActive?: boolean;\r\n /** Describes if the item is disabled. */\r\n isDisabled?: boolean;\r\n /** Function called when the item is clicked. */\r\n onClick?: () => void;\r\n /** Function called when a key is pressed. */\r\n onKeyDown?: (e: React.KeyboardEvent) => void;\r\n /** Title for the item. */\r\n title: string;\r\n /** A badge to draw. */\r\n badge?: React.ReactNode;\r\n /** If true add a gap before button. Default to false. */\r\n addGroupSeparator?: boolean;\r\n}\r\n\r\n/** Toolbar item component. Used in [[Toolbar]] component.\r\n * @public\r\n */\r\n// eslint-disable-next-line react/display-name\r\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\r\n (props: ToolbarButtonItemProps) => {\r\n const className = classnames(\r\n \"components-toolbar-button-item\",\r\n props.isActive && \"components-active\",\r\n props.isDisabled && \"components-disabled\",\r\n props.className);\r\n\r\n return (\r\n <button\r\n data-item-id={props.itemId}\r\n data-item-type=\"tool-button\"\r\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\r\n onClick={props.onClick}\r\n onKeyDown={props.onKeyDown}\r\n className={className}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n {props.icon}\r\n </div>\r\n {props.badge &&\r\n <div className=\"components-badge\">\r\n {props.badge}\r\n </div>\r\n }\r\n </button>\r\n );\r\n });\r\n"]}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AA+B/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,oBAAoB,8BACT,KAAK,CAAC,aAAa,wBACzB,KAAK,CAAC,YAAY,0BAChB,KAAK,CAAC,UAAU,EACtC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,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 Toolbar\r\n */\r\n\r\nimport \"./Item.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\n\r\n/** Properties of [[ToolbarButtonItem]] component.\r\n * @public\r\n */\r\nexport interface ToolbarButtonItemProps extends CommonProps {\r\n /** button icon. */\r\n icon?: React.ReactNode;\r\n /** Describes if item is active. */\r\n isActive?: boolean;\r\n /** Describes if the item is disabled. */\r\n isDisabled?: boolean;\r\n /** Function called when the item is clicked. */\r\n onClick?: () => void;\r\n /** Function called when a key is pressed. */\r\n onKeyDown?: (e: React.KeyboardEvent) => void;\r\n /** Title for the item. */\r\n title: string;\r\n /** A badge to draw. */\r\n badge?: React.ReactNode;\r\n /** If true add a gap before button. Default to false. */\r\n addGroupSeparator?: boolean;\r\n /** value added to DOM element as a data attribute to hold name of items provider. If specified in `FrontstageProvider` then this will be undefined */\r\n providerId?: string;\r\n /** value added to DOM element as a data attribute, shows 0 is undefined */\r\n itemPriority?: number;\r\n /** value added to DOM element as a data attribute */\r\n groupPriority?: number;\r\n}\r\n\r\n/** Toolbar item component. Used in [[Toolbar]] component.\r\n * @public\r\n */\r\n// eslint-disable-next-line react/display-name\r\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\r\n (props: ToolbarButtonItemProps) => {\r\n const className = classnames(\r\n \"components-toolbar-button-item\",\r\n props.isActive && \"components-active\",\r\n props.isDisabled && \"components-disabled\",\r\n props.className);\r\n\r\n return (\r\n <button\r\n data-item-id={props.itemId}\r\n data-item-type=\"action-tool-button\"\r\n data-item-group-priority={props.groupPriority}\r\n data-item-priority={props.itemPriority}\r\n data-item-providerid={props.providerId}\r\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\r\n onClick={props.onClick}\r\n onKeyDown={props.onKeyDown}\r\n className={className}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n {props.icon}\r\n </div>\r\n {props.badge &&\r\n <div className=\"components-badge\">\r\n {props.badge}\r\n </div>\r\n }\r\n </button>\r\n );\r\n });\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Overflow.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Overflow.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAsB,MAAM,mBAAmB,CAAC;AAGrF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW,EAAE,eAAe;IAC9E,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8BAA8B;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eA0CtE;AAED,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,SAAS,GAAG,gBAAgB,CAWxF"}
1
+ {"version":3,"file":"Overflow.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Overflow.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAsB,MAAM,mBAAmB,CAAC;AAGrF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW,EAAE,eAAe;IAC9E,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8BAA8B;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,qDAAqD;IACrD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eA+CtE;AAED,gBAAgB;AAChB,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,SAAS,GAAG,gBAAgB,CAWxF"}
@@ -45,13 +45,15 @@ function ToolbarOverflowButton(props) {
45
45
  const { onResize, useHeight } = (0, ToolbarWithOverflow_1.useToolItemEntryContext)();
46
46
  const [targetRef, target] = (0, core_react_1.useRefState)();
47
47
  const ref = (0, ItemWrapper_1.useResizeObserverSingleDimension)(onResize, useHeight);
48
+ const isHidden = (0, ToolbarWithOverflow_1.useToolbarPopupAutoHideContext)();
49
+ const popupClassName = (0, classnames_1.default)("components-toolbar-overflow_popup", isHidden && "nz-hidden");
48
50
  const className = (0, classnames_1.default)("components-toolbar-item-container", "components-toolbar-overflow-button", props.className);
49
51
  const buttonClassName = (0, classnames_1.default)("components-toolbar-button-item", "components-ellipsis-icon");
50
52
  return (React.createElement("div", { className: className, ref: targetRef },
51
53
  React.createElement("button", { ref: ref, onClick: props.onClick, className: buttonClassName, style: props.style, title: props.title },
52
54
  React.createElement("div", { className: "components-icon" },
53
55
  React.createElement("div", { className: "components-ellipsis" }))),
54
- React.createElement(core_react_1.Popup, { className: "components-toolbar-overflow_popup", offset: 0, showShadow: false, isOpen: props.open, onClose: props.onClose, position: toToolbarOverflowRelativePosition(props.expandsTo), target: target }, props.panelNode)));
56
+ React.createElement(core_react_1.Popup, { className: popupClassName, offset: 0, showShadow: false, isOpen: props.open, onClose: props.onClose, position: toToolbarOverflowRelativePosition(props.expandsTo), target: target }, props.panelNode)));
55
57
  }
56
58
  exports.ToolbarOverflowButton = ToolbarOverflowButton;
57
59
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"Overflow.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Overflow.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2BAAyB;AACzB,4DAAoC;AACpC,6CAA+B;AAC/B,kDAAqF;AACrF,+DAAgE;AAChE,+CAAiE;AACjE,qDAAkD;AAClD,0DAAyD;AAoBzD;;GAEG;AACH,SAAgB,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,6CAAuB,GAAE,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,IAAA,wBAAW,GAAkB,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAA,8CAAgC,EAAoB,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrF,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,MAAM,eAAe,GAAG,IAAA,oBAAU,EAChC,gCAAgC,EAChC,0BAA0B,CAC3B,CAAC;IACF,OAAO,CACL,6BACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,SAAS;QAEd,gCACE,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAElB,6BAAK,SAAS,EAAC,iBAAiB;gBAC9B,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACnC,CACC;QACT,oBAAC,kBAAK,IACJ,SAAS,EAAC,mCAAmC,EAC7C,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,KAAK,CAAC,IAAI,EAClB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,iCAAiC,CAAC,KAAK,CAAC,SAAS,CAAC,EAC5D,MAAM,EAAE,MAAM,IAEb,KAAK,CAAC,SAAS,CACV,CACJ,CACP,CAAC;AACJ,CAAC;AA1CD,sDA0CC;AAED,gBAAgB;AAChB,SAAgB,iCAAiC,CAAC,SAAoB;IACpE,QAAQ,SAAS,EAAE;QACjB,KAAK,qBAAS,CAAC,MAAM;YACnB,OAAO,iCAAgB,CAAC,MAAM,CAAC;QACjC,KAAK,qBAAS,CAAC,IAAI;YACjB,OAAO,iCAAgB,CAAC,IAAI,CAAC;QAC/B,KAAK,qBAAS,CAAC,KAAK;YAClB,OAAO,iCAAgB,CAAC,KAAK,CAAC;QAChC,KAAK,qBAAS,CAAC,GAAG;YAChB,OAAO,iCAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,CAAC;AAXD,8EAWC","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 ToolSettings\r\n */\r\n\r\nimport \"./Overflow.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, NoChildrenProps, Popup, useRefState } from \"@itwin/core-react\";\r\nimport { useToolItemEntryContext } from \"./ToolbarWithOverflow\";\r\nimport { useResizeObserverSingleDimension } from \"./ItemWrapper\";\r\nimport { Direction } from \"./utilities/Direction\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\n\r\n/** Properties of [[ToolbarOverflowButton]] component.\r\n * @internal\r\n */\r\nexport interface ToolbarOverflowButtonProps extends CommonProps, NoChildrenProps {\r\n /** Function called when button is clicked. */\r\n onClick?: () => void;\r\n /** Function called when panel is closed. */\r\n onClose?: () => void;\r\n /** Describes if the panel is open. */\r\n open?: boolean;\r\n /** Panel expand direction. */\r\n expandsTo: Direction;\r\n /** Panel element containing the overflown buttons */\r\n panelNode?: React.ReactNode;\r\n /** Title for the item. */\r\n title?: string;\r\n}\r\n\r\n/** Button to toggle display of overflown tools.\r\n * @internal\r\n */\r\nexport function ToolbarOverflowButton(props: ToolbarOverflowButtonProps) {\r\n const { onResize, useHeight } = useToolItemEntryContext();\r\n const [targetRef, target] = useRefState<HTMLDivElement>();\r\n const ref = useResizeObserverSingleDimension<HTMLButtonElement>(onResize, useHeight);\r\n const className = classnames(\r\n \"components-toolbar-item-container\",\r\n \"components-toolbar-overflow-button\",\r\n props.className,\r\n );\r\n const buttonClassName = classnames(\r\n \"components-toolbar-button-item\",\r\n \"components-ellipsis-icon\",\r\n );\r\n return (\r\n <div\r\n className={className}\r\n ref={targetRef}\r\n >\r\n <button\r\n ref={ref}\r\n onClick={props.onClick}\r\n className={buttonClassName}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n <div className=\"components-ellipsis\" />\r\n </div>\r\n </button>\r\n <Popup\r\n className=\"components-toolbar-overflow_popup\"\r\n offset={0}\r\n showShadow={false}\r\n isOpen={props.open}\r\n onClose={props.onClose}\r\n position={toToolbarOverflowRelativePosition(props.expandsTo)}\r\n target={target}\r\n >\r\n {props.panelNode}\r\n </Popup>\r\n </div>\r\n );\r\n}\r\n\r\n/** @internal */\r\nexport function toToolbarOverflowRelativePosition(expandsTo: Direction): RelativePosition {\r\n switch (expandsTo) {\r\n case Direction.Bottom:\r\n return RelativePosition.Bottom;\r\n case Direction.Left:\r\n return RelativePosition.Left;\r\n case Direction.Right:\r\n return RelativePosition.Right;\r\n case Direction.Top:\r\n return RelativePosition.Top;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Overflow.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/Overflow.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2BAAyB;AACzB,4DAAoC;AACpC,6CAA+B;AAC/B,kDAAqF;AACrF,+DAAgG;AAChG,+CAAiE;AACjE,qDAAkD;AAClD,0DAAyD;AAoBzD;;GAEG;AACH,SAAgB,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,6CAAuB,GAAE,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,IAAA,wBAAW,GAAkB,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAA,8CAAgC,EAAoB,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrF,MAAM,QAAQ,GAAG,IAAA,oDAA8B,GAAE,CAAC;IAClD,MAAM,cAAc,GAAG,IAAA,oBAAU,EAC/B,mCAAmC,EACnC,QAAQ,IAAI,WAAW,CAAC,CAAC;IAE3B,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,MAAM,eAAe,GAAG,IAAA,oBAAU,EAChC,gCAAgC,EAChC,0BAA0B,CAC3B,CAAC;IACF,OAAO,CACL,6BACE,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,SAAS;QAEd,gCACE,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAElB,6BAAK,SAAS,EAAC,iBAAiB;gBAC9B,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACnC,CACC;QACT,oBAAC,kBAAK,IACJ,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,KAAK,CAAC,IAAI,EAClB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,QAAQ,EAAE,iCAAiC,CAAC,KAAK,CAAC,SAAS,CAAC,EAC5D,MAAM,EAAE,MAAM,IAEb,KAAK,CAAC,SAAS,CACV,CACJ,CACP,CAAC;AACJ,CAAC;AA/CD,sDA+CC;AAED,gBAAgB;AAChB,SAAgB,iCAAiC,CAAC,SAAoB;IACpE,QAAQ,SAAS,EAAE;QACjB,KAAK,qBAAS,CAAC,MAAM;YACnB,OAAO,iCAAgB,CAAC,MAAM,CAAC;QACjC,KAAK,qBAAS,CAAC,IAAI;YACjB,OAAO,iCAAgB,CAAC,IAAI,CAAC;QAC/B,KAAK,qBAAS,CAAC,KAAK;YAClB,OAAO,iCAAgB,CAAC,KAAK,CAAC;QAChC,KAAK,qBAAS,CAAC,GAAG;YAChB,OAAO,iCAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,CAAC;AAXD,8EAWC","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 ToolSettings\r\n */\r\n\r\nimport \"./Overflow.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, NoChildrenProps, Popup, useRefState } from \"@itwin/core-react\";\r\nimport { useToolbarPopupAutoHideContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\r\nimport { useResizeObserverSingleDimension } from \"./ItemWrapper\";\r\nimport { Direction } from \"./utilities/Direction\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\n\r\n/** Properties of [[ToolbarOverflowButton]] component.\r\n * @internal\r\n */\r\nexport interface ToolbarOverflowButtonProps extends CommonProps, NoChildrenProps {\r\n /** Function called when button is clicked. */\r\n onClick?: () => void;\r\n /** Function called when panel is closed. */\r\n onClose?: () => void;\r\n /** Describes if the panel is open. */\r\n open?: boolean;\r\n /** Panel expand direction. */\r\n expandsTo: Direction;\r\n /** Panel element containing the overflown buttons */\r\n panelNode?: React.ReactNode;\r\n /** Title for the item. */\r\n title?: string;\r\n}\r\n\r\n/** Button to toggle display of overflown tools.\r\n * @internal\r\n */\r\nexport function ToolbarOverflowButton(props: ToolbarOverflowButtonProps) {\r\n const { onResize, useHeight } = useToolItemEntryContext();\r\n const [targetRef, target] = useRefState<HTMLDivElement>();\r\n const ref = useResizeObserverSingleDimension<HTMLButtonElement>(onResize, useHeight);\r\n const isHidden = useToolbarPopupAutoHideContext();\r\n const popupClassName = classnames(\r\n \"components-toolbar-overflow_popup\",\r\n isHidden && \"nz-hidden\");\r\n\r\n const className = classnames(\r\n \"components-toolbar-item-container\",\r\n \"components-toolbar-overflow-button\",\r\n props.className,\r\n );\r\n const buttonClassName = classnames(\r\n \"components-toolbar-button-item\",\r\n \"components-ellipsis-icon\",\r\n );\r\n return (\r\n <div\r\n className={className}\r\n ref={targetRef}\r\n >\r\n <button\r\n ref={ref}\r\n onClick={props.onClick}\r\n className={buttonClassName}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n <div className=\"components-ellipsis\" />\r\n </div>\r\n </button>\r\n <Popup\r\n className={popupClassName}\r\n offset={0}\r\n showShadow={false}\r\n isOpen={props.open}\r\n onClose={props.onClose}\r\n position={toToolbarOverflowRelativePosition(props.expandsTo)}\r\n target={target}\r\n >\r\n {props.panelNode}\r\n </Popup>\r\n </div>\r\n );\r\n}\r\n\r\n/** @internal */\r\nexport function toToolbarOverflowRelativePosition(expandsTo: Direction): RelativePosition {\r\n switch (expandsTo) {\r\n case Direction.Bottom:\r\n return RelativePosition.Bottom;\r\n case Direction.Left:\r\n return RelativePosition.Left;\r\n case Direction.Right:\r\n return RelativePosition.Right;\r\n case Direction.Top:\r\n return RelativePosition.Top;\r\n }\r\n}\r\n"]}
@@ -46,4 +46,11 @@
46
46
  background: none;
47
47
 
48
48
  @include uicore-z-index(toolbar-panels);
49
+
50
+ transition: visibility 0.5s ease, opacity 0.5s ease;
51
+
52
+ &.nz-hidden {
53
+ opacity: 0;
54
+ visibility: hidden;
55
+ }
49
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PopupItem.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAIhD,cAAc;AACd,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,YAAY,KAAK,IAAI,CAAC;CAC/D;AAED;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,yCAK9B,CAAC;AAEH;;;GAGG;AACH,wBAAgB,sBAAsB,6BAErC;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;kEAC8D;IAC9D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,eAsE9C;AAED,gBAAgB;AAChB,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,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AI,IAAI,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,gBAAgB;AAChB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAYxD"}
@@ -88,7 +88,7 @@ function PopupItem(props) {
88
88
  return (React.createElement(exports.ToolbarPopupContext.Provider, { value: {
89
89
  closePanel: () => processPanelOpenClose(false),
90
90
  } },
91
- React.createElement("button", { "data-item-id": props.itemId, "data-item-type": "tool-button", ref: targetRef, disabled: props.isDisabled, onClick: onButtonClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: props.title },
91
+ React.createElement("button", { "data-item-id": props.itemId, "data-item-type": "tool-button-popup", "data-item-group-priority": props.groupPriority, "data-item-priority": props.itemPriority, "data-item-providerid": props.providerId, ref: targetRef, disabled: props.isDisabled, onClick: onButtonClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: props.title },
92
92
  React.createElement("div", { className: "components-icon" }, props.icon),
93
93
  props.badge &&
94
94
  React.createElement("div", { className: "components-badge" }, props.badge),
@@ -98,7 +98,9 @@ function PopupItem(props) {
98
98
  exports.PopupItem = PopupItem;
99
99
  /** @internal */
100
100
  function PopupItemPopup(props) {
101
- return React.createElement(core_react_1.Popup, { className: "components-toolbar-popupItem_popupItemPopup", offset: 0, showShadow: false, ...props });
101
+ const isHidden = (0, ToolbarWithOverflow_1.useToolbarPopupAutoHideContext)();
102
+ const className = (0, classnames_1.default)("components-toolbar-popupItem_popupItemPopup", isHidden && "nz-hidden");
103
+ return React.createElement(core_react_1.Popup, { className: className, offset: 0, showShadow: false, ...props });
102
104
  }
103
105
  exports.PopupItemPopup = PopupItemPopup;
104
106
  //# sourceMappingURL=PopupItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopupItem.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItem.tsx"],"names":[],"mappings":";AAAA;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9B,KAAK,CAAC,KAAK,CACR;YAEP,aAAa,CAAC,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACxF;QACT,oBAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,IAAA,kDAA8B,EAAC,kBAAkB,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE,MAAM,EACd,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,IAE7C,KAAK,CACS,CACY,CAChC,CAAC;AACJ,CAAC;AAtED,8BAsEC;AAYD,gBAAgB;AAChB,SAAgB,cAAc,CAAC,KAA0B;IACvD,OAAO,oBAAC,kBAAK,IACX,SAAS,EAAC,6CAA6C,EACvD,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,KACb,KAAK,GACT,CAAC;AACL,CAAC;AAPD,wCAOC","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 Toolbar\r\n */\r\n\r\nimport \"./PopupItem.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ActionButton, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { Popup, useRefState } from \"@itwin/core-react\";\r\nimport { ToolbarButtonItemProps } from \"./Item\";\r\nimport { useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\r\nimport { toToolbarPopupRelativePosition } from \"./PopupItemWithDrag\";\r\n\r\n/** @public */\r\nexport interface ToolbarPopupContextProps {\r\n readonly closePanel: () => void;\r\n readonly setSelectedItem?: (buttonItem: ActionButton) => void;\r\n}\r\n\r\n/**\r\n * Context used by Toolbar items in popups to close the popup panel.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const ToolbarPopupContext = React.createContext<ToolbarPopupContextProps>({\r\n /** function used to close popup panel */\r\n closePanel: /* istanbul ignore next */ () => { },\r\n /** if popup panel is a GroupButton then this is call to set the selected action item within the panel */\r\n setSelectedItem: /* istanbul ignore next */ (_buttonItem: ActionButton) => { },\r\n});\r\n\r\n/**\r\n * React hook used to retrieve the ToolbarPopupContext.\r\n * @public\r\n */\r\nexport function useToolbarPopupContext() {\r\n return React.useContext(ToolbarPopupContext);\r\n}\r\n\r\n/** Properties of [[PopupItem]] component.\r\n * @public\r\n */\r\nexport interface PopupItemProps extends ToolbarButtonItemProps {\r\n /** Describes if expandable item triangle indicator should be hidden. */\r\n hideIndicator?: boolean;\r\n /** Panel of the toolbar. */\r\n panel?: React.ReactNode;\r\n /** If true the popup panel is mounted once and unmounted when button is unmounted. If false the\r\n * content node is unmounted each time the popup is closed. */\r\n keepContentsMounted?: boolean;\r\n}\r\n\r\n/** Popup toolbar item that displays a panel\r\n * @public\r\n */\r\nexport function PopupItem(props: PopupItemProps) {\r\n const [isPanelShown, setPanelShown] = React.useState(false);\r\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\r\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\r\n setPanelShown((prev) => {\r\n // istanbul ignore else\r\n if (prev !== isOpening)\r\n onPopupPanelOpenClose(isOpening);\r\n return isOpening;\r\n });\r\n }, [setPanelShown, onPopupPanelOpenClose]);\r\n\r\n // handle open and closing overflow panel\r\n const onButtonClick = React.useCallback(() => {\r\n processPanelOpenClose(!isPanelShown);\r\n // istanbul ignore next\r\n if (props.onClick)\r\n props.onClick();\r\n }, [props, isPanelShown, processPanelOpenClose]);\r\n const className = classnames(\r\n \"components-toolbar-button-item\",\r\n \"components-toolbar-expandable-button\",\r\n props.isDisabled && \"components-disabled\",\r\n props.className);\r\n\r\n const [targetRef, target] = useRefState<HTMLButtonElement>();\r\n // istanbul ignore next\r\n const handleClose = React.useCallback(() => {\r\n processPanelOpenClose(false);\r\n }, [processPanelOpenClose]);\r\n const { hasOverflow } = useToolItemEntryContext();\r\n const expandsToDirection = hasOverflow ? overflowExpandsTo : expandsTo;\r\n\r\n const { hideIndicator, panel } = props;\r\n return (\r\n <ToolbarPopupContext.Provider value={{\r\n closePanel: () => processPanelOpenClose(false),\r\n }}>\r\n <button\r\n data-item-id={props.itemId}\r\n data-item-type=\"tool-button\"\r\n ref={targetRef}\r\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\r\n onClick={onButtonClick}\r\n onKeyDown={props.onKeyDown}\r\n className={className}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n {props.icon}\r\n </div>\r\n {props.badge &&\r\n <div className=\"components-badge\">\r\n {props.badge}\r\n </div>\r\n }\r\n {hideIndicator ? /* istanbul ignore next */ undefined : <div className=\"components-triangle\" />}\r\n </button>\r\n <PopupItemPopup\r\n isOpen={isPanelShown}\r\n onClose={handleClose}\r\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\r\n target={target}\r\n keepContentsMounted={props.keepContentsMounted}\r\n >\r\n {panel}\r\n </PopupItemPopup>\r\n </ToolbarPopupContext.Provider>\r\n );\r\n}\r\n\r\n/** @internal */\r\ninterface PopupItemPopupProps {\r\n children?: React.ReactNode;\r\n isOpen?: boolean;\r\n onClose(): void;\r\n position: RelativePosition;\r\n target?: HTMLElement;\r\n keepContentsMounted?: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport function PopupItemPopup(props: PopupItemPopupProps) {\r\n return <Popup\r\n className=\"components-toolbar-popupItem_popupItemPopup\"\r\n offset={0}\r\n showShadow={false}\r\n {...props}\r\n />;\r\n}\r\n"]}
1
+ {"version":3,"file":"PopupItem.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItem.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;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AAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR;YAEP,aAAa,CAAC,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACxF;QACT,oBAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,IAAA,kDAA8B,EAAC,kBAAkB,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE,MAAM,EACd,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,IAE7C,KAAK,CACS,CACY,CAChC,CAAC;AACJ,CAAC;AAzED,8BAyEC;AAYD,gBAAgB;AAChB,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,QAAQ,GAAG,IAAA,oDAA8B,GAAE,CAAC;IAClD,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,6CAA6C,EAC7C,QAAQ,IAAI,WAAW,CAAC,CAAC;IAE3B,OAAO,oBAAC,kBAAK,IACX,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,KACb,KAAK,GACT,CAAC;AACL,CAAC;AAZD,wCAYC","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 Toolbar\r\n */\r\n\r\nimport \"./PopupItem.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ActionButton, RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { Popup, useRefState } from \"@itwin/core-react\";\r\nimport { ToolbarButtonItemProps } from \"./Item\";\r\nimport { useToolbarPopupAutoHideContext, useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\r\nimport { toToolbarPopupRelativePosition } from \"./PopupItemWithDrag\";\r\n\r\n/** @public */\r\nexport interface ToolbarPopupContextProps {\r\n readonly closePanel: () => void;\r\n readonly setSelectedItem?: (buttonItem: ActionButton) => void;\r\n}\r\n\r\n/**\r\n * Context used by Toolbar items in popups to close the popup panel.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const ToolbarPopupContext = React.createContext<ToolbarPopupContextProps>({\r\n /** function used to close popup panel */\r\n closePanel: /* istanbul ignore next */ () => { },\r\n /** if popup panel is a GroupButton then this is call to set the selected action item within the panel */\r\n setSelectedItem: /* istanbul ignore next */ (_buttonItem: ActionButton) => { },\r\n});\r\n\r\n/**\r\n * React hook used to retrieve the ToolbarPopupContext.\r\n * @public\r\n */\r\nexport function useToolbarPopupContext() {\r\n return React.useContext(ToolbarPopupContext);\r\n}\r\n\r\n/** Properties of [[PopupItem]] component.\r\n * @public\r\n */\r\nexport interface PopupItemProps extends ToolbarButtonItemProps {\r\n /** Describes if expandable item triangle indicator should be hidden. */\r\n hideIndicator?: boolean;\r\n /** Panel of the toolbar. */\r\n panel?: React.ReactNode;\r\n /** If true the popup panel is mounted once and unmounted when button is unmounted. If false the\r\n * content node is unmounted each time the popup is closed. */\r\n keepContentsMounted?: boolean;\r\n}\r\n\r\n/** Popup toolbar item that displays a panel\r\n * @public\r\n */\r\nexport function PopupItem(props: PopupItemProps) {\r\n const [isPanelShown, setPanelShown] = React.useState(false);\r\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\r\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\r\n setPanelShown((prev) => {\r\n // istanbul ignore else\r\n if (prev !== isOpening)\r\n onPopupPanelOpenClose(isOpening);\r\n return isOpening;\r\n });\r\n }, [setPanelShown, onPopupPanelOpenClose]);\r\n\r\n // handle open and closing overflow panel\r\n const onButtonClick = React.useCallback(() => {\r\n processPanelOpenClose(!isPanelShown);\r\n // istanbul ignore next\r\n if (props.onClick)\r\n props.onClick();\r\n }, [props, isPanelShown, processPanelOpenClose]);\r\n const className = classnames(\r\n \"components-toolbar-button-item\",\r\n \"components-toolbar-expandable-button\",\r\n props.isDisabled && \"components-disabled\",\r\n props.className);\r\n\r\n const [targetRef, target] = useRefState<HTMLButtonElement>();\r\n // istanbul ignore next\r\n const handleClose = React.useCallback(() => {\r\n processPanelOpenClose(false);\r\n }, [processPanelOpenClose]);\r\n const { hasOverflow } = useToolItemEntryContext();\r\n const expandsToDirection = hasOverflow ? overflowExpandsTo : expandsTo;\r\n\r\n const { hideIndicator, panel } = props;\r\n return (\r\n <ToolbarPopupContext.Provider value={{\r\n closePanel: () => processPanelOpenClose(false),\r\n }}>\r\n <button\r\n data-item-id={props.itemId}\r\n data-item-type=\"tool-button-popup\"\r\n data-item-group-priority={props.groupPriority}\r\n data-item-priority={props.itemPriority}\r\n data-item-providerid={props.providerId}\r\n ref={targetRef}\r\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\r\n onClick={onButtonClick}\r\n onKeyDown={props.onKeyDown}\r\n className={className}\r\n style={props.style}\r\n title={props.title}\r\n >\r\n <div className=\"components-icon\">\r\n {props.icon}\r\n </div>\r\n {props.badge &&\r\n <div className=\"components-badge\">\r\n {props.badge}\r\n </div>\r\n }\r\n {hideIndicator ? /* istanbul ignore next */ undefined : <div className=\"components-triangle\" />}\r\n </button>\r\n <PopupItemPopup\r\n isOpen={isPanelShown}\r\n onClose={handleClose}\r\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\r\n target={target}\r\n keepContentsMounted={props.keepContentsMounted}\r\n >\r\n {panel}\r\n </PopupItemPopup>\r\n </ToolbarPopupContext.Provider>\r\n );\r\n}\r\n\r\n/** @internal */\r\ninterface PopupItemPopupProps {\r\n children?: React.ReactNode;\r\n isOpen?: boolean;\r\n onClose(): void;\r\n position: RelativePosition;\r\n target?: HTMLElement;\r\n keepContentsMounted?: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport function PopupItemPopup(props: PopupItemPopupProps) {\r\n const isHidden = useToolbarPopupAutoHideContext();\r\n const className = classnames(\r\n \"components-toolbar-popupItem_popupItemPopup\",\r\n isHidden && \"nz-hidden\");\r\n\r\n return <Popup\r\n className={className}\r\n offset={0}\r\n showShadow={false}\r\n {...props}\r\n />;\r\n}\r\n"]}
@@ -29,7 +29,11 @@
29
29
  filter: $arrow-shadow;
30
30
  pointer-events: none;
31
31
 
32
- @include triangle-bottom-right($width: $triangle-width, $height: $triangle-height, $color: $buic-icon-color);
32
+ @include triangle-bottom-right(
33
+ $width: $triangle-width,
34
+ $height: $triangle-height,
35
+ $color: $buic-icon-color
36
+ );
33
37
  }
34
38
 
35
39
  &:active>.components-triangle {
@@ -73,4 +77,11 @@
73
77
  border-width: 1px;
74
78
  border-style: solid;
75
79
  border-radius: 3px;
76
- }
80
+
81
+ transition: visibility 0.5s ease, opacity 0.5s ease;
82
+
83
+ &.nz-hidden {
84
+ opacity: 0;
85
+ visibility: hidden;
86
+ }
87
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PopupItemWithDrag.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAiE,WAAW,EAAE,gBAAgB,EAAwB,MAAM,uBAAuB,CAAC;AAE3J,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,qBAAqB,EAAmE,MAAM,uBAAuB,CAAC;AAE/H,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,4BAA4B;IAC5B,SAAS,EAAE,WAAW,CAAC;CACxB;AAmDD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAiG9D;AAED,gBAAgB;AAChB,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB,GAAG,gBAAgB,CAevH"}
1
+ {"version":3,"file":"PopupItemWithDrag.d.ts","sourceRoot":"","sources":["../../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAiE,WAAW,EAAE,gBAAgB,EAAwB,MAAM,uBAAuB,CAAC;AAE3J,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,qBAAqB,EAAmE,MAAM,uBAAuB,CAAC;AAE/H,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,4BAA4B;IAC5B,SAAS,EAAE,WAAW,CAAC;CACxB;AAmDD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAsG9D;AAED,gBAAgB;AAChB,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB,GAAG,gBAAgB,CAevH"}
@@ -142,7 +142,7 @@ function PopupItemWithDrag(props) {
142
142
  closePanel: /* istanbul ignore next */ () => processPanelOpenClose(false),
143
143
  setSelectedItem: /* istanbul ignore next */ (buttonItem) => setActiveAction(buttonItem),
144
144
  } },
145
- React.createElement("button", { ref: targetRef, onPointerDown: handlePointerDown, onClick: handleButtonClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: title },
145
+ React.createElement("button", { "data-item-id": props.itemId, "data-item-type": "action-tool-button", "data-item-group-priority": props.groupPriority, "data-item-priority": props.itemPriority, "data-item-providerid": props.providerId, ref: targetRef, onPointerDown: handlePointerDown, onClick: handleButtonClick, onKeyDown: props.onKeyDown, className: className, style: props.style, title: title },
146
146
  React.createElement("div", { className: "components-icon" }, icon),
147
147
  props.badge &&
148
148
  React.createElement("div", { className: "components-badge" }, badge),