@itwin/components-react 4.0.0-dev.17 → 4.0.0-dev.19
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.
- package/CHANGELOG.md +28 -6
- package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts +2 -0
- package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js +3 -3
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react.d.ts +0 -2
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +0 -2
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.d.ts +2 -0
- package/lib/esm/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js +3 -3
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react.d.ts +0 -2
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +0 -2
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts +0 -62
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts.map +0 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js +0 -188
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +0 -1
- package/lib/cjs/components-react/table/TableDataProvider.d.ts +0 -11
- package/lib/cjs/components-react/table/TableDataProvider.d.ts.map +0 -1
- package/lib/cjs/components-react/table/TableDataProvider.js +0 -19
- package/lib/cjs/components-react/table/TableDataProvider.js.map +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts +0 -62
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts.map +0 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.js +0 -158
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +0 -1
- package/lib/esm/components-react/table/TableDataProvider.d.ts +0 -11
- package/lib/esm/components-react/table/TableDataProvider.d.ts.map +0 -1
- package/lib/esm/components-react/table/TableDataProvider.js +0 -15
- package/lib/esm/components-react/table/TableDataProvider.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module PropertyGrid
|
|
3
|
-
*/
|
|
4
|
-
import "./PropertyGrid.scss";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { PropertyRecord } from "@itwin/appui-abstract";
|
|
7
|
-
import { Orientation } from "@itwin/core-react";
|
|
8
|
-
import { IPropertyDataProvider, PropertyCategory } from "../PropertyDataProvider";
|
|
9
|
-
import { CommonPropertyGridProps } from "./PropertyGridCommons";
|
|
10
|
-
/** Properties for [[PropertyGrid]] React component
|
|
11
|
-
* @public
|
|
12
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
13
|
-
*/
|
|
14
|
-
export interface PropertyGridProps extends CommonPropertyGridProps {
|
|
15
|
-
/** Property data provider */
|
|
16
|
-
dataProvider: IPropertyDataProvider;
|
|
17
|
-
}
|
|
18
|
-
interface CategorizedPropertyGridRecords {
|
|
19
|
-
category: PropertyCategory;
|
|
20
|
-
records: PropertyRecord[];
|
|
21
|
-
children: CategorizedPropertyGridRecords[];
|
|
22
|
-
}
|
|
23
|
-
/** State of [[PropertyGrid]] React component
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
interface PropertyGridState {
|
|
27
|
-
/** List of PropertyGrid categories */
|
|
28
|
-
categories: CategorizedPropertyGridRecords[];
|
|
29
|
-
/** Actual orientation used by the property grid */
|
|
30
|
-
orientation: Orientation;
|
|
31
|
-
/** If property grid currently loading data, the loading start time */
|
|
32
|
-
loadStart?: Date;
|
|
33
|
-
/** Width of PropertyGrid */
|
|
34
|
-
width: number;
|
|
35
|
-
}
|
|
36
|
-
/** PropertyGrid React component.
|
|
37
|
-
* @public
|
|
38
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
39
|
-
*/
|
|
40
|
-
export declare class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {
|
|
41
|
-
private _dataChangesListenerDisposeFunc?;
|
|
42
|
-
private _isMounted;
|
|
43
|
-
private _isInDataRequest;
|
|
44
|
-
private _hasPendingDataRequest;
|
|
45
|
-
/** @internal */
|
|
46
|
-
constructor(props: PropertyGridProps);
|
|
47
|
-
/** @internal */
|
|
48
|
-
componentDidMount(): void;
|
|
49
|
-
/** @internal */
|
|
50
|
-
componentWillUnmount(): void;
|
|
51
|
-
componentDidUpdate(prevProps: PropertyGridProps): void;
|
|
52
|
-
private _onPropertyDataChanged;
|
|
53
|
-
private gatherData;
|
|
54
|
-
private getPreferredOrientation;
|
|
55
|
-
private _onResize;
|
|
56
|
-
private _onCategoryExpansionToggled;
|
|
57
|
-
private updateOrientation;
|
|
58
|
-
/** @internal */
|
|
59
|
-
render(): JSX.Element;
|
|
60
|
-
}
|
|
61
|
-
export {};
|
|
62
|
-
//# sourceMappingURL=PropertyGrid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAGhG,OAAO,EAAE,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAIrF;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE,6BAA6B;IAC7B,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED,UAAU,8BAA8B;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,sCAAsC;IACtC,UAAU,EAAE,8BAA8B,EAAE,CAAC;IAC7C,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,uEAAuE;IACvE,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACrF,OAAO,CAAC,+BAA+B,CAAC,CAAc;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,sBAAsB,CAAS;IAEvC,gBAAgB;gBACJ,KAAK,EAAE,iBAAiB;IASpC,gBAAgB;IACA,iBAAiB;IAQjC,gBAAgB;IACA,oBAAoB;IASpB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAiB/D,OAAO,CAAC,sBAAsB,CAG5B;YAEY,UAAU;IAyCxB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,2BAA2B,CAWjC;IAEF,OAAO,CAAC,iBAAiB;IAQzB,gBAAgB;IACA,MAAM;CA4CvB"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.PropertyGrid = void 0;
|
|
34
|
-
/** @packageDocumentation
|
|
35
|
-
* @module PropertyGrid
|
|
36
|
-
*/
|
|
37
|
-
require("./PropertyGrid.scss");
|
|
38
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
39
|
-
const immer_1 = require("immer");
|
|
40
|
-
const React = __importStar(require("react"));
|
|
41
|
-
const core_react_1 = require("@itwin/core-react");
|
|
42
|
-
const DelayedSpinner_1 = require("../../common/DelayedSpinner");
|
|
43
|
-
const ColumnResizingPropertyListPropsSupplier_1 = require("./ColumnResizingPropertyListPropsSupplier");
|
|
44
|
-
const PropertyCategoryBlock_1 = require("./PropertyCategoryBlock");
|
|
45
|
-
const PropertyGridCommons_1 = require("./PropertyGridCommons");
|
|
46
|
-
const PropertyGridEventsRelatedPropsSupplier_1 = require("./PropertyGridEventsRelatedPropsSupplier");
|
|
47
|
-
const PropertyList_1 = require("./PropertyList");
|
|
48
|
-
/** PropertyGrid React component.
|
|
49
|
-
* @public
|
|
50
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
51
|
-
*/
|
|
52
|
-
class PropertyGrid extends React.Component {
|
|
53
|
-
/** @internal */
|
|
54
|
-
constructor(props) {
|
|
55
|
-
super(props);
|
|
56
|
-
this._isMounted = false;
|
|
57
|
-
this._isInDataRequest = false;
|
|
58
|
-
this._hasPendingDataRequest = false;
|
|
59
|
-
this._onPropertyDataChanged = () => {
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
61
|
-
this.gatherData();
|
|
62
|
-
};
|
|
63
|
-
this._onResize = (width) => {
|
|
64
|
-
this.updateOrientation(width);
|
|
65
|
-
};
|
|
66
|
-
this._onCategoryExpansionToggled = (categoryName) => {
|
|
67
|
-
this.setState((state) => {
|
|
68
|
-
return (0, immer_1.produce)(state, (draft) => {
|
|
69
|
-
const records = findCategory(draft.categories, categoryName, true);
|
|
70
|
-
// istanbul ignore else
|
|
71
|
-
if (records) {
|
|
72
|
-
const category = records.category;
|
|
73
|
-
category.expand = !category.expand;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
this.state = {
|
|
79
|
-
categories: [],
|
|
80
|
-
orientation: this.getPreferredOrientation(),
|
|
81
|
-
width: 0,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/** @internal */
|
|
85
|
-
componentDidMount() {
|
|
86
|
-
this._isMounted = true;
|
|
87
|
-
this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
89
|
-
this.gatherData();
|
|
90
|
-
}
|
|
91
|
-
/** @internal */
|
|
92
|
-
componentWillUnmount() {
|
|
93
|
-
// istanbul ignore else
|
|
94
|
-
if (this._dataChangesListenerDisposeFunc) {
|
|
95
|
-
this._dataChangesListenerDisposeFunc();
|
|
96
|
-
this._dataChangesListenerDisposeFunc = undefined;
|
|
97
|
-
}
|
|
98
|
-
this._isMounted = false;
|
|
99
|
-
}
|
|
100
|
-
componentDidUpdate(prevProps) {
|
|
101
|
-
if (this.props.dataProvider !== prevProps.dataProvider) {
|
|
102
|
-
// istanbul ignore else
|
|
103
|
-
if (this._dataChangesListenerDisposeFunc)
|
|
104
|
-
this._dataChangesListenerDisposeFunc();
|
|
105
|
-
this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
106
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
107
|
-
this.gatherData();
|
|
108
|
-
}
|
|
109
|
-
if (this.props.orientation !== prevProps.orientation
|
|
110
|
-
|| this.props.isOrientationFixed !== prevProps.isOrientationFixed
|
|
111
|
-
|| this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth)
|
|
112
|
-
this.updateOrientation(this.state.width);
|
|
113
|
-
}
|
|
114
|
-
async gatherData() {
|
|
115
|
-
if (this._isInDataRequest) {
|
|
116
|
-
this._hasPendingDataRequest = true;
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });
|
|
120
|
-
this._isInDataRequest = true;
|
|
121
|
-
let propertyData;
|
|
122
|
-
try {
|
|
123
|
-
propertyData = await this.props.dataProvider.getData();
|
|
124
|
-
}
|
|
125
|
-
finally {
|
|
126
|
-
this._isInDataRequest = false;
|
|
127
|
-
}
|
|
128
|
-
if (!this._isMounted)
|
|
129
|
-
return;
|
|
130
|
-
if (this._hasPendingDataRequest) {
|
|
131
|
-
this._hasPendingDataRequest = false;
|
|
132
|
-
return this.gatherData();
|
|
133
|
-
}
|
|
134
|
-
this.setState((prevState) => {
|
|
135
|
-
const buildCategoriesHierarchy = (newCategories, stateCategories) => newCategories.map((category) => {
|
|
136
|
-
const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);
|
|
137
|
-
return {
|
|
138
|
-
category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },
|
|
139
|
-
records: propertyData.records[category.name] ?? [],
|
|
140
|
-
children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
return {
|
|
144
|
-
categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),
|
|
145
|
-
loadStart: undefined,
|
|
146
|
-
};
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
getPreferredOrientation() {
|
|
150
|
-
return (this.props.orientation !== undefined) ? this.props.orientation : core_react_1.Orientation.Horizontal;
|
|
151
|
-
}
|
|
152
|
-
updateOrientation(width) {
|
|
153
|
-
const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };
|
|
154
|
-
const currentOrientation = PropertyGridCommons_1.PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
|
|
155
|
-
if (currentOrientation !== this.state.orientation || width !== this.state.width)
|
|
156
|
-
this.setState({ orientation: currentOrientation, width });
|
|
157
|
-
}
|
|
158
|
-
/** @internal */
|
|
159
|
-
render() {
|
|
160
|
-
if (this.state.loadStart) {
|
|
161
|
-
return (React.createElement("div", { className: "components-property-grid-loader" },
|
|
162
|
-
React.createElement(DelayedSpinner_1.DelayedSpinner, { loadStart: this.state.loadStart, size: "large" })));
|
|
163
|
-
}
|
|
164
|
-
return (React.createElement(PropertyGridEventsRelatedPropsSupplier_1.PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: this.props.isPropertySelectionEnabled ?? false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: this.props.isPropertyHoverEnabled ?? false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: (0, classnames_1.default)("components-property-grid-wrapper", this.props.className), style: this.props.style },
|
|
165
|
-
React.createElement("div", { className: (0, classnames_1.default)("components-property-grid", "components-smallEditor-host") },
|
|
166
|
-
React.createElement("div", { className: "property-categories" }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
|
|
167
|
-
React.createElement(core_react_1.ResizableContainerObserver, { onResize: this._onResize })))));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
exports.PropertyGrid = PropertyGrid;
|
|
171
|
-
function findCategory(categories, lookupName, recurseIntoChildren) {
|
|
172
|
-
for (const category of categories) {
|
|
173
|
-
if (category.category.name === lookupName)
|
|
174
|
-
return category;
|
|
175
|
-
if (recurseIntoChildren) {
|
|
176
|
-
const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);
|
|
177
|
-
if (matchingChild)
|
|
178
|
-
return matchingChild;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return undefined;
|
|
182
|
-
}
|
|
183
|
-
function NestedCategoryBlock(props) {
|
|
184
|
-
return (React.createElement(PropertyCategoryBlock_1.PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
|
|
185
|
-
props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier_1.ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation }, (partialListProps) => (React.createElement(PropertyList_1.PropertyList, { ...partialListProps, orientation: props.orientation, category: props.categorizedRecords.category, properties: props.categorizedRecords.records, selectedPropertyKey: props.selectedPropertyKey, onPropertyClicked: props.onPropertyClicked, onPropertyRightClicked: props.onPropertyRightClicked, onPropertyContextMenu: props.onPropertyContextMenu, propertyValueRendererManager: props.propertyValueRendererManager, editingPropertyKey: props.editingPropertyKey, onEditCommit: props.onEditCommit, onEditCancel: props.onEditCancel, isPropertyHoverEnabled: props.isPropertyHoverEnabled, isPropertySelectionEnabled: props.isPropertySelectionEnabled, isPropertyRightClickSelectionEnabled: props.isPropertyRightClickSelectionEnabled, actionButtonRenderers: props.actionButtonRenderers })))) : undefined,
|
|
186
|
-
props.categorizedRecords.children.length ? (React.createElement("div", { className: "property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=PropertyGrid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AACH,+BAA6B;AAC7B,4DAAoC;AACpC,iCAAgC;AAChC,6CAA+B;AAG/B,kDAA4E;AAC5E,gEAA6D;AAE7D,uGAA0I;AAC1I,mEAAgE;AAChE,+DAAqF;AACrF,qGAAkG;AAClG,iDAAiE;AA+BjE;;;GAGG;AACH,MAAa,YAAa,SAAQ,KAAK,CAAC,SAA+C;IAMrF,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,eAAU,GAAG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,EAAE,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,GAAI,CAC5H,CAAC,CAEA,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,CAAC;AACJ,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\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./PropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport { produce } from \"immer\";\r\nimport * as React from \"react\";\r\nimport { DisposeFunc } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\r\nimport { DelayedSpinner } from \"../../common/DelayedSpinner\";\r\nimport { IPropertyDataProvider, PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\r\nimport { ColumnResizeRelatedPropertyListProps, ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\nimport { PropertyList, PropertyListProps } from \"./PropertyList\";\r\n\r\n/** Properties for [[PropertyGrid]] React component\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport interface PropertyGridProps extends CommonPropertyGridProps {\r\n /** Property data provider */\r\n dataProvider: IPropertyDataProvider;\r\n}\r\n\r\ninterface CategorizedPropertyGridRecords {\r\n category: PropertyCategory;\r\n records: PropertyRecord[];\r\n children: CategorizedPropertyGridRecords[];\r\n}\r\n\r\n/** State of [[PropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface PropertyGridState {\r\n /** List of PropertyGrid categories */\r\n categories: CategorizedPropertyGridRecords[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** If property grid currently loading data, the loading start time */\r\n loadStart?: Date;\r\n /** Width of PropertyGrid */\r\n width: number;\r\n}\r\n\r\n/** PropertyGrid React component.\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> { // eslint-disable-line deprecation/deprecation\r\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\r\n private _isMounted = false;\r\n private _isInDataRequest = false;\r\n private _hasPendingDataRequest = false;\r\n\r\n /** @internal */\r\n constructor(props: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n this.state = {\r\n categories: [],\r\n orientation: this.getPreferredOrientation(),\r\n width: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc) {\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = undefined;\r\n }\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.dataProvider !== prevProps.dataProvider) {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc)\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth)\r\n this.updateOrientation(this.state.width);\r\n }\r\n\r\n private _onPropertyDataChanged = () => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n };\r\n\r\n private async gatherData(): Promise<void> {\r\n if (this._isInDataRequest) {\r\n this._hasPendingDataRequest = true;\r\n return;\r\n }\r\n\r\n this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });\r\n\r\n this._isInDataRequest = true;\r\n let propertyData: PropertyData;\r\n try {\r\n propertyData = await this.props.dataProvider.getData();\r\n } finally {\r\n this._isInDataRequest = false;\r\n }\r\n\r\n if (!this._isMounted)\r\n return;\r\n\r\n if (this._hasPendingDataRequest) {\r\n this._hasPendingDataRequest = false;\r\n return this.gatherData();\r\n }\r\n\r\n this.setState((prevState) => {\r\n const buildCategoriesHierarchy = (newCategories: PropertyCategory[], stateCategories: CategorizedPropertyGridRecords[] | undefined) =>\r\n newCategories.map((category): CategorizedPropertyGridRecords => {\r\n const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);\r\n return {\r\n category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },\r\n records: propertyData.records[category.name] ?? [],\r\n children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),\r\n };\r\n });\r\n return {\r\n categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),\r\n loadStart: undefined,\r\n };\r\n });\r\n }\r\n\r\n private getPreferredOrientation(): Orientation {\r\n return (this.props.orientation !== undefined) ? this.props.orientation : Orientation.Horizontal;\r\n }\r\n\r\n private _onResize = (width: number) => {\r\n this.updateOrientation(width);\r\n };\r\n\r\n private _onCategoryExpansionToggled = (categoryName: string) => {\r\n this.setState((state) => {\r\n return produce(state, (draft) => {\r\n const records = findCategory(draft.categories, categoryName, true);\r\n // istanbul ignore else\r\n if (records) {\r\n const category = records.category;\r\n category.expand = !category.expand;\r\n }\r\n });\r\n });\r\n };\r\n\r\n private updateOrientation(width: number): void {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation || width !== this.state.width)\r\n this.setState({ orientation: currentOrientation, width });\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n if (this.state.loadStart) {\r\n return (\r\n <div className=\"components-property-grid-loader\">\r\n <DelayedSpinner loadStart={this.state.loadStart} size=\"large\" />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n >\r\n {(selectionContext) => (\r\n <div className={classnames(\"components-property-grid-wrapper\", this.props.className)} style={this.props.style}>\r\n <div className={classnames(\"components-property-grid\", \"components-smallEditor-host\")}>\r\n <div className=\"property-categories\">\r\n {\r\n this.state.categories.map((categorizedRecords: CategorizedPropertyGridRecords) => (\r\n <NestedCategoryBlock\r\n {...selectionContext}\r\n key={categorizedRecords.category.name}\r\n categorizedRecords={categorizedRecords}\r\n onCategoryExpansionToggled={this._onCategoryExpansionToggled}\r\n orientation={this.state.orientation}\r\n propertyValueRendererManager={this.props.propertyValueRendererManager}\r\n actionButtonRenderers={this.props.actionButtonRenderers}\r\n />\r\n ))\r\n }\r\n </div>\r\n </div>\r\n <ResizableContainerObserver onResize={this._onResize} />\r\n </div>\r\n )}\r\n </PropertyGridEventsRelatedPropsSupplier>\r\n );\r\n }\r\n}\r\n\r\nfunction findCategory(categories: CategorizedPropertyGridRecords[], lookupName: string, recurseIntoChildren: boolean): CategorizedPropertyGridRecords | undefined {\r\n for (const category of categories) {\r\n if (category.category.name === lookupName)\r\n return category;\r\n if (recurseIntoChildren) {\r\n const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);\r\n if (matchingChild)\r\n return matchingChild;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\ninterface NestedCategoryBlockProps extends Omit<PropertyListProps, (keyof ColumnResizeRelatedPropertyListProps) | \"properties\"> {\r\n categorizedRecords: CategorizedPropertyGridRecords;\r\n onCategoryExpansionToggled: (categoryName: string) => void;\r\n orientation: Orientation;\r\n}\r\nfunction NestedCategoryBlock(props: NestedCategoryBlockProps) {\r\n return (\r\n <PropertyCategoryBlock\r\n category={props.categorizedRecords.category}\r\n onExpansionToggled={props.onCategoryExpansionToggled}\r\n >\r\n {props.categorizedRecords.records.length ? (\r\n <ColumnResizingPropertyListPropsSupplier orientation={props.orientation}>\r\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\r\n <PropertyList\r\n {...partialListProps}\r\n orientation={props.orientation}\r\n category={props.categorizedRecords.category}\r\n properties={props.categorizedRecords.records}\r\n selectedPropertyKey={props.selectedPropertyKey}\r\n onPropertyClicked={props.onPropertyClicked}\r\n onPropertyRightClicked={props.onPropertyRightClicked}\r\n onPropertyContextMenu={props.onPropertyContextMenu}\r\n propertyValueRendererManager={props.propertyValueRendererManager}\r\n editingPropertyKey={props.editingPropertyKey}\r\n onEditCommit={props.onEditCommit}\r\n onEditCancel={props.onEditCancel}\r\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\r\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\r\n isPropertyRightClickSelectionEnabled={props.isPropertyRightClickSelectionEnabled}\r\n actionButtonRenderers={props.actionButtonRenderers}\r\n />\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>\r\n ) : undefined}\r\n {props.categorizedRecords.children.length ? (\r\n <div className=\"property-categories\">\r\n {\r\n props.categorizedRecords.children.map((categorizedChildRecords) => (\r\n <NestedCategoryBlock {...props} key={categorizedChildRecords.category.name} categorizedRecords={categorizedChildRecords} />\r\n ))\r\n }\r\n </div>\r\n ) : undefined}\r\n </PropertyCategoryBlock>\r\n );\r\n}\r\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Table
|
|
3
|
-
*/
|
|
4
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
5
|
-
/** An event broadcasted on table data changes
|
|
6
|
-
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare class TableDataChangeEvent extends BeEvent<() => void> {
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=TableDataProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,MAAM,IAAI,CAAC;CAAI"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Table
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TableDataChangeEvent = void 0;
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
/** An event broadcasted on table data changes
|
|
13
|
-
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class TableDataChangeEvent extends core_bentley_1.BeEvent {
|
|
17
|
-
}
|
|
18
|
-
exports.TableDataChangeEvent = TableDataChangeEvent;
|
|
19
|
-
//# sourceMappingURL=TableDataProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAE9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAmB;CAAI;AAAjE,oDAAiE","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 Table\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/** An event broadcasted on table data changes\r\n * @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.\r\n * @public\r\n */\r\nexport class TableDataChangeEvent extends BeEvent<() => void> { }\r\n"]}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module PropertyGrid
|
|
3
|
-
*/
|
|
4
|
-
import "./PropertyGrid.scss";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { PropertyRecord } from "@itwin/appui-abstract";
|
|
7
|
-
import { Orientation } from "@itwin/core-react";
|
|
8
|
-
import { IPropertyDataProvider, PropertyCategory } from "../PropertyDataProvider";
|
|
9
|
-
import { CommonPropertyGridProps } from "./PropertyGridCommons";
|
|
10
|
-
/** Properties for [[PropertyGrid]] React component
|
|
11
|
-
* @public
|
|
12
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
13
|
-
*/
|
|
14
|
-
export interface PropertyGridProps extends CommonPropertyGridProps {
|
|
15
|
-
/** Property data provider */
|
|
16
|
-
dataProvider: IPropertyDataProvider;
|
|
17
|
-
}
|
|
18
|
-
interface CategorizedPropertyGridRecords {
|
|
19
|
-
category: PropertyCategory;
|
|
20
|
-
records: PropertyRecord[];
|
|
21
|
-
children: CategorizedPropertyGridRecords[];
|
|
22
|
-
}
|
|
23
|
-
/** State of [[PropertyGrid]] React component
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
interface PropertyGridState {
|
|
27
|
-
/** List of PropertyGrid categories */
|
|
28
|
-
categories: CategorizedPropertyGridRecords[];
|
|
29
|
-
/** Actual orientation used by the property grid */
|
|
30
|
-
orientation: Orientation;
|
|
31
|
-
/** If property grid currently loading data, the loading start time */
|
|
32
|
-
loadStart?: Date;
|
|
33
|
-
/** Width of PropertyGrid */
|
|
34
|
-
width: number;
|
|
35
|
-
}
|
|
36
|
-
/** PropertyGrid React component.
|
|
37
|
-
* @public
|
|
38
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
39
|
-
*/
|
|
40
|
-
export declare class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {
|
|
41
|
-
private _dataChangesListenerDisposeFunc?;
|
|
42
|
-
private _isMounted;
|
|
43
|
-
private _isInDataRequest;
|
|
44
|
-
private _hasPendingDataRequest;
|
|
45
|
-
/** @internal */
|
|
46
|
-
constructor(props: PropertyGridProps);
|
|
47
|
-
/** @internal */
|
|
48
|
-
componentDidMount(): void;
|
|
49
|
-
/** @internal */
|
|
50
|
-
componentWillUnmount(): void;
|
|
51
|
-
componentDidUpdate(prevProps: PropertyGridProps): void;
|
|
52
|
-
private _onPropertyDataChanged;
|
|
53
|
-
private gatherData;
|
|
54
|
-
private getPreferredOrientation;
|
|
55
|
-
private _onResize;
|
|
56
|
-
private _onCategoryExpansionToggled;
|
|
57
|
-
private updateOrientation;
|
|
58
|
-
/** @internal */
|
|
59
|
-
render(): JSX.Element;
|
|
60
|
-
}
|
|
61
|
-
export {};
|
|
62
|
-
//# sourceMappingURL=PropertyGrid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAGhG,OAAO,EAAE,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAIrF;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE,6BAA6B;IAC7B,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED,UAAU,8BAA8B;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,sCAAsC;IACtC,UAAU,EAAE,8BAA8B,EAAE,CAAC;IAC7C,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,uEAAuE;IACvE,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACrF,OAAO,CAAC,+BAA+B,CAAC,CAAc;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,sBAAsB,CAAS;IAEvC,gBAAgB;gBACJ,KAAK,EAAE,iBAAiB;IASpC,gBAAgB;IACA,iBAAiB;IAQjC,gBAAgB;IACA,oBAAoB;IASpB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAiB/D,OAAO,CAAC,sBAAsB,CAG5B;YAEY,UAAU;IAyCxB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,2BAA2B,CAWjC;IAEF,OAAO,CAAC,iBAAiB;IAQzB,gBAAgB;IACA,MAAM;CA4CvB"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module PropertyGrid
|
|
7
|
-
*/
|
|
8
|
-
import "./PropertyGrid.scss";
|
|
9
|
-
import classnames from "classnames";
|
|
10
|
-
import { produce } from "immer";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import { Orientation, ResizableContainerObserver } from "@itwin/core-react";
|
|
13
|
-
import { DelayedSpinner } from "../../common/DelayedSpinner";
|
|
14
|
-
import { ColumnResizingPropertyListPropsSupplier } from "./ColumnResizingPropertyListPropsSupplier";
|
|
15
|
-
import { PropertyCategoryBlock } from "./PropertyCategoryBlock";
|
|
16
|
-
import { PropertyGridCommons } from "./PropertyGridCommons";
|
|
17
|
-
import { PropertyGridEventsRelatedPropsSupplier } from "./PropertyGridEventsRelatedPropsSupplier";
|
|
18
|
-
import { PropertyList } from "./PropertyList";
|
|
19
|
-
/** PropertyGrid React component.
|
|
20
|
-
* @public
|
|
21
|
-
* @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
|
|
22
|
-
*/
|
|
23
|
-
export class PropertyGrid extends React.Component {
|
|
24
|
-
/** @internal */
|
|
25
|
-
constructor(props) {
|
|
26
|
-
super(props);
|
|
27
|
-
this._isMounted = false;
|
|
28
|
-
this._isInDataRequest = false;
|
|
29
|
-
this._hasPendingDataRequest = false;
|
|
30
|
-
this._onPropertyDataChanged = () => {
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
32
|
-
this.gatherData();
|
|
33
|
-
};
|
|
34
|
-
this._onResize = (width) => {
|
|
35
|
-
this.updateOrientation(width);
|
|
36
|
-
};
|
|
37
|
-
this._onCategoryExpansionToggled = (categoryName) => {
|
|
38
|
-
this.setState((state) => {
|
|
39
|
-
return produce(state, (draft) => {
|
|
40
|
-
const records = findCategory(draft.categories, categoryName, true);
|
|
41
|
-
// istanbul ignore else
|
|
42
|
-
if (records) {
|
|
43
|
-
const category = records.category;
|
|
44
|
-
category.expand = !category.expand;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
this.state = {
|
|
50
|
-
categories: [],
|
|
51
|
-
orientation: this.getPreferredOrientation(),
|
|
52
|
-
width: 0,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
|
-
componentDidMount() {
|
|
57
|
-
this._isMounted = true;
|
|
58
|
-
this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
60
|
-
this.gatherData();
|
|
61
|
-
}
|
|
62
|
-
/** @internal */
|
|
63
|
-
componentWillUnmount() {
|
|
64
|
-
// istanbul ignore else
|
|
65
|
-
if (this._dataChangesListenerDisposeFunc) {
|
|
66
|
-
this._dataChangesListenerDisposeFunc();
|
|
67
|
-
this._dataChangesListenerDisposeFunc = undefined;
|
|
68
|
-
}
|
|
69
|
-
this._isMounted = false;
|
|
70
|
-
}
|
|
71
|
-
componentDidUpdate(prevProps) {
|
|
72
|
-
if (this.props.dataProvider !== prevProps.dataProvider) {
|
|
73
|
-
// istanbul ignore else
|
|
74
|
-
if (this._dataChangesListenerDisposeFunc)
|
|
75
|
-
this._dataChangesListenerDisposeFunc();
|
|
76
|
-
this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
78
|
-
this.gatherData();
|
|
79
|
-
}
|
|
80
|
-
if (this.props.orientation !== prevProps.orientation
|
|
81
|
-
|| this.props.isOrientationFixed !== prevProps.isOrientationFixed
|
|
82
|
-
|| this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth)
|
|
83
|
-
this.updateOrientation(this.state.width);
|
|
84
|
-
}
|
|
85
|
-
async gatherData() {
|
|
86
|
-
if (this._isInDataRequest) {
|
|
87
|
-
this._hasPendingDataRequest = true;
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });
|
|
91
|
-
this._isInDataRequest = true;
|
|
92
|
-
let propertyData;
|
|
93
|
-
try {
|
|
94
|
-
propertyData = await this.props.dataProvider.getData();
|
|
95
|
-
}
|
|
96
|
-
finally {
|
|
97
|
-
this._isInDataRequest = false;
|
|
98
|
-
}
|
|
99
|
-
if (!this._isMounted)
|
|
100
|
-
return;
|
|
101
|
-
if (this._hasPendingDataRequest) {
|
|
102
|
-
this._hasPendingDataRequest = false;
|
|
103
|
-
return this.gatherData();
|
|
104
|
-
}
|
|
105
|
-
this.setState((prevState) => {
|
|
106
|
-
const buildCategoriesHierarchy = (newCategories, stateCategories) => newCategories.map((category) => {
|
|
107
|
-
const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);
|
|
108
|
-
return {
|
|
109
|
-
category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },
|
|
110
|
-
records: propertyData.records[category.name] ?? [],
|
|
111
|
-
children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
return {
|
|
115
|
-
categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),
|
|
116
|
-
loadStart: undefined,
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
getPreferredOrientation() {
|
|
121
|
-
return (this.props.orientation !== undefined) ? this.props.orientation : Orientation.Horizontal;
|
|
122
|
-
}
|
|
123
|
-
updateOrientation(width) {
|
|
124
|
-
const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };
|
|
125
|
-
const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);
|
|
126
|
-
if (currentOrientation !== this.state.orientation || width !== this.state.width)
|
|
127
|
-
this.setState({ orientation: currentOrientation, width });
|
|
128
|
-
}
|
|
129
|
-
/** @internal */
|
|
130
|
-
render() {
|
|
131
|
-
if (this.state.loadStart) {
|
|
132
|
-
return (React.createElement("div", { className: "components-property-grid-loader" },
|
|
133
|
-
React.createElement(DelayedSpinner, { loadStart: this.state.loadStart, size: "large" })));
|
|
134
|
-
}
|
|
135
|
-
return (React.createElement(PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: this.props.isPropertySelectionEnabled ?? false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: this.props.isPropertyHoverEnabled ?? false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: classnames("components-property-grid-wrapper", this.props.className), style: this.props.style },
|
|
136
|
-
React.createElement("div", { className: classnames("components-property-grid", "components-smallEditor-host") },
|
|
137
|
-
React.createElement("div", { className: "property-categories" }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
|
|
138
|
-
React.createElement(ResizableContainerObserver, { onResize: this._onResize })))));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function findCategory(categories, lookupName, recurseIntoChildren) {
|
|
142
|
-
for (const category of categories) {
|
|
143
|
-
if (category.category.name === lookupName)
|
|
144
|
-
return category;
|
|
145
|
-
if (recurseIntoChildren) {
|
|
146
|
-
const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);
|
|
147
|
-
if (matchingChild)
|
|
148
|
-
return matchingChild;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return undefined;
|
|
152
|
-
}
|
|
153
|
-
function NestedCategoryBlock(props) {
|
|
154
|
-
return (React.createElement(PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
|
|
155
|
-
props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation }, (partialListProps) => (React.createElement(PropertyList, { ...partialListProps, orientation: props.orientation, category: props.categorizedRecords.category, properties: props.categorizedRecords.records, selectedPropertyKey: props.selectedPropertyKey, onPropertyClicked: props.onPropertyClicked, onPropertyRightClicked: props.onPropertyRightClicked, onPropertyContextMenu: props.onPropertyContextMenu, propertyValueRendererManager: props.propertyValueRendererManager, editingPropertyKey: props.editingPropertyKey, onEditCommit: props.onEditCommit, onEditCancel: props.onEditCancel, isPropertyHoverEnabled: props.isPropertyHoverEnabled, isPropertySelectionEnabled: props.isPropertySelectionEnabled, isPropertyRightClickSelectionEnabled: props.isPropertyRightClickSelectionEnabled, actionButtonRenderers: props.actionButtonRenderers })))) : undefined,
|
|
156
|
-
props.categorizedRecords.children.length ? (React.createElement("div", { className: "property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
|
|
157
|
-
}
|
|
158
|
-
//# sourceMappingURL=PropertyGrid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAwC,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AAC1I,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA2B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AA+BjE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA+C;IAMrF,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;QACzB,2BAAsB,GAAG,KAAK,CAAC;QAgD/B,2BAAsB,GAAG,GAAG,EAAE;YACpC,mEAAmE;YACnE,IAAI,CAAC,UAAU,EA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------------\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 \"./PropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport { produce } from \"immer\";\r\nimport * as React from \"react\";\r\nimport { DisposeFunc } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\r\nimport { DelayedSpinner } from \"../../common/DelayedSpinner\";\r\nimport { IPropertyDataProvider, PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\r\nimport { ColumnResizeRelatedPropertyListProps, ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\nimport { PropertyList, PropertyListProps } from \"./PropertyList\";\r\n\r\n/** Properties for [[PropertyGrid]] React component\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport interface PropertyGridProps extends CommonPropertyGridProps {\r\n /** Property data provider */\r\n dataProvider: IPropertyDataProvider;\r\n}\r\n\r\ninterface CategorizedPropertyGridRecords {\r\n category: PropertyCategory;\r\n records: PropertyRecord[];\r\n children: CategorizedPropertyGridRecords[];\r\n}\r\n\r\n/** State of [[PropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface PropertyGridState {\r\n /** List of PropertyGrid categories */\r\n categories: CategorizedPropertyGridRecords[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** If property grid currently loading data, the loading start time */\r\n loadStart?: Date;\r\n /** Width of PropertyGrid */\r\n width: number;\r\n}\r\n\r\n/** PropertyGrid React component.\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> { // eslint-disable-line deprecation/deprecation\r\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\r\n private _isMounted = false;\r\n private _isInDataRequest = false;\r\n private _hasPendingDataRequest = false;\r\n\r\n /** @internal */\r\n constructor(props: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n this.state = {\r\n categories: [],\r\n orientation: this.getPreferredOrientation(),\r\n width: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc) {\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = undefined;\r\n }\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.dataProvider !== prevProps.dataProvider) {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc)\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth)\r\n this.updateOrientation(this.state.width);\r\n }\r\n\r\n private _onPropertyDataChanged = () => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n };\r\n\r\n private async gatherData(): Promise<void> {\r\n if (this._isInDataRequest) {\r\n this._hasPendingDataRequest = true;\r\n return;\r\n }\r\n\r\n this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });\r\n\r\n this._isInDataRequest = true;\r\n let propertyData: PropertyData;\r\n try {\r\n propertyData = await this.props.dataProvider.getData();\r\n } finally {\r\n this._isInDataRequest = false;\r\n }\r\n\r\n if (!this._isMounted)\r\n return;\r\n\r\n if (this._hasPendingDataRequest) {\r\n this._hasPendingDataRequest = false;\r\n return this.gatherData();\r\n }\r\n\r\n this.setState((prevState) => {\r\n const buildCategoriesHierarchy = (newCategories: PropertyCategory[], stateCategories: CategorizedPropertyGridRecords[] | undefined) =>\r\n newCategories.map((category): CategorizedPropertyGridRecords => {\r\n const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);\r\n return {\r\n category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },\r\n records: propertyData.records[category.name] ?? [],\r\n children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),\r\n };\r\n });\r\n return {\r\n categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),\r\n loadStart: undefined,\r\n };\r\n });\r\n }\r\n\r\n private getPreferredOrientation(): Orientation {\r\n return (this.props.orientation !== undefined) ? this.props.orientation : Orientation.Horizontal;\r\n }\r\n\r\n private _onResize = (width: number) => {\r\n this.updateOrientation(width);\r\n };\r\n\r\n private _onCategoryExpansionToggled = (categoryName: string) => {\r\n this.setState((state) => {\r\n return produce(state, (draft) => {\r\n const records = findCategory(draft.categories, categoryName, true);\r\n // istanbul ignore else\r\n if (records) {\r\n const category = records.category;\r\n category.expand = !category.expand;\r\n }\r\n });\r\n });\r\n };\r\n\r\n private updateOrientation(width: number): void {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation || width !== this.state.width)\r\n this.setState({ orientation: currentOrientation, width });\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n if (this.state.loadStart) {\r\n return (\r\n <div className=\"components-property-grid-loader\">\r\n <DelayedSpinner loadStart={this.state.loadStart} size=\"large\" />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n >\r\n {(selectionContext) => (\r\n <div className={classnames(\"components-property-grid-wrapper\", this.props.className)} style={this.props.style}>\r\n <div className={classnames(\"components-property-grid\", \"components-smallEditor-host\")}>\r\n <div className=\"property-categories\">\r\n {\r\n this.state.categories.map((categorizedRecords: CategorizedPropertyGridRecords) => (\r\n <NestedCategoryBlock\r\n {...selectionContext}\r\n key={categorizedRecords.category.name}\r\n categorizedRecords={categorizedRecords}\r\n onCategoryExpansionToggled={this._onCategoryExpansionToggled}\r\n orientation={this.state.orientation}\r\n propertyValueRendererManager={this.props.propertyValueRendererManager}\r\n actionButtonRenderers={this.props.actionButtonRenderers}\r\n />\r\n ))\r\n }\r\n </div>\r\n </div>\r\n <ResizableContainerObserver onResize={this._onResize} />\r\n </div>\r\n )}\r\n </PropertyGridEventsRelatedPropsSupplier>\r\n );\r\n }\r\n}\r\n\r\nfunction findCategory(categories: CategorizedPropertyGridRecords[], lookupName: string, recurseIntoChildren: boolean): CategorizedPropertyGridRecords | undefined {\r\n for (const category of categories) {\r\n if (category.category.name === lookupName)\r\n return category;\r\n if (recurseIntoChildren) {\r\n const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);\r\n if (matchingChild)\r\n return matchingChild;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\ninterface NestedCategoryBlockProps extends Omit<PropertyListProps, (keyof ColumnResizeRelatedPropertyListProps) | \"properties\"> {\r\n categorizedRecords: CategorizedPropertyGridRecords;\r\n onCategoryExpansionToggled: (categoryName: string) => void;\r\n orientation: Orientation;\r\n}\r\nfunction NestedCategoryBlock(props: NestedCategoryBlockProps) {\r\n return (\r\n <PropertyCategoryBlock\r\n category={props.categorizedRecords.category}\r\n onExpansionToggled={props.onCategoryExpansionToggled}\r\n >\r\n {props.categorizedRecords.records.length ? (\r\n <ColumnResizingPropertyListPropsSupplier orientation={props.orientation}>\r\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\r\n <PropertyList\r\n {...partialListProps}\r\n orientation={props.orientation}\r\n category={props.categorizedRecords.category}\r\n properties={props.categorizedRecords.records}\r\n selectedPropertyKey={props.selectedPropertyKey}\r\n onPropertyClicked={props.onPropertyClicked}\r\n onPropertyRightClicked={props.onPropertyRightClicked}\r\n onPropertyContextMenu={props.onPropertyContextMenu}\r\n propertyValueRendererManager={props.propertyValueRendererManager}\r\n editingPropertyKey={props.editingPropertyKey}\r\n onEditCommit={props.onEditCommit}\r\n onEditCancel={props.onEditCancel}\r\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\r\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\r\n isPropertyRightClickSelectionEnabled={props.isPropertyRightClickSelectionEnabled}\r\n actionButtonRenderers={props.actionButtonRenderers}\r\n />\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>\r\n ) : undefined}\r\n {props.categorizedRecords.children.length ? (\r\n <div className=\"property-categories\">\r\n {\r\n props.categorizedRecords.children.map((categorizedChildRecords) => (\r\n <NestedCategoryBlock {...props} key={categorizedChildRecords.category.name} categorizedRecords={categorizedChildRecords} />\r\n ))\r\n }\r\n </div>\r\n ) : undefined}\r\n </PropertyCategoryBlock>\r\n );\r\n}\r\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Table
|
|
3
|
-
*/
|
|
4
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
5
|
-
/** An event broadcasted on table data changes
|
|
6
|
-
* @deprecated in 3.5. Use the Table component in @itwin/itwinui-react instead, which does not use this class.
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare class TableDataChangeEvent extends BeEvent<() => void> {
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=TableDataProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/table/TableDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,MAAM,IAAI,CAAC;CAAI"}
|