@itwin/components-react 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -4
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +23 -9
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js +19 -8
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts +8 -5
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js +40 -18
- package/lib/cjs/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +7 -4
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +8 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +3 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -2
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +2 -3
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +49 -10
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +106 -13
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts +144 -0
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -0
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js +550 -0
- package/lib/cjs/components-react/toolbar/InternalToolbarComponent.js.map +1 -0
- package/lib/cjs/components-react/toolbar/ItemWrapper.js +3 -3
- package/lib/cjs/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Items.js +5 -5
- package/lib/cjs/components-react/toolbar/Items.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Overflow.js +3 -3
- package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/OverflowPanel.js +5 -5
- package/lib/cjs/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js +4 -4
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js +4 -4
- package/lib/cjs/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js +2 -2
- package/lib/cjs/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.d.ts +2 -2
- package/lib/cjs/components-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.js +2 -69
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +5 -105
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +6 -481
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.d.ts +14 -0
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -0
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js +119 -0
- package/lib/cjs/components-react/toolbar/useConditionalSynchedItems.js.map +1 -0
- package/lib/cjs/components-react.d.ts +6 -2
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +6 -2
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +23 -9
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.js +17 -7
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts +8 -5
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js +40 -18
- package/lib/esm/components-react/filter-builder/FilterBuilderContext.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +8 -5
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +8 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +3 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -2
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +2 -3
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +49 -10
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js +99 -7
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -1
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts +144 -0
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.d.ts.map +1 -0
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js +514 -0
- package/lib/esm/components-react/toolbar/InternalToolbarComponent.js.map +1 -0
- package/lib/esm/components-react/toolbar/ItemWrapper.js +1 -1
- package/lib/esm/components-react/toolbar/ItemWrapper.js.map +1 -1
- package/lib/esm/components-react/toolbar/Items.js +1 -1
- package/lib/esm/components-react/toolbar/Items.js.map +1 -1
- package/lib/esm/components-react/toolbar/Overflow.js +1 -1
- package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/OverflowPanel.js +1 -1
- package/lib/esm/components-react/toolbar/OverflowPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js +1 -1
- package/lib/esm/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js +1 -1
- package/lib/esm/components-react/toolbar/PopupItemsPanel.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.d.ts +2 -2
- package/lib/esm/components-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.js +2 -66
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +5 -105
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +5 -471
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.d.ts +14 -0
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.d.ts.map +1 -0
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js +92 -0
- package/lib/esm/components-react/toolbar/useConditionalSynchedItems.js.map +1 -0
- package/lib/esm/components-react.d.ts +6 -2
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +6 -2
- package/lib/esm/components-react.js.map +1 -1
- package/lib/public/locales/en/UiComponents.json +4 -1
- package/package.json +8 -9
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useConditionalSynchedItems = void 0;
|
|
27
|
+
/*---------------------------------------------------------------------------------------------
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
32
|
+
const core_react_1 = require("@itwin/core-react");
|
|
33
|
+
const React = __importStar(require("react"));
|
|
34
|
+
/**
|
|
35
|
+
* From a list of ToolbarItem, recursively return the list of syncIds
|
|
36
|
+
* that are relevant to every Conditional members used in the items.
|
|
37
|
+
* @param eventIds Set to fill with syncIds
|
|
38
|
+
* @param items ToolbarItems list to search through
|
|
39
|
+
*/
|
|
40
|
+
function gatherSyncIds(eventIds, items) {
|
|
41
|
+
for (const item of items) {
|
|
42
|
+
for (const [, entry] of Object.entries(item)) {
|
|
43
|
+
if (entry instanceof appui_abstract_1.ConditionalBooleanValue) {
|
|
44
|
+
entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
|
|
45
|
+
}
|
|
46
|
+
else if (entry instanceof appui_abstract_1.ConditionalStringValue) {
|
|
47
|
+
entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
|
|
48
|
+
}
|
|
49
|
+
else if (core_react_1.ConditionalIconItem.isConditionalIconItem(entry)) {
|
|
50
|
+
entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if ("items" in item) {
|
|
54
|
+
gatherSyncIds(eventIds, item.items);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Refresh all conditional values interested by the provided eventIds.
|
|
60
|
+
* @param items List of ToolbarItems that may content Conditional properties.
|
|
61
|
+
* @param eventIds Set of triggered eventIds.
|
|
62
|
+
* @returns null if no updates occurred, or the provided items with updated values if ANY were updated.
|
|
63
|
+
*/
|
|
64
|
+
function refreshItems(items, eventIds) {
|
|
65
|
+
if (0 === eventIds.size)
|
|
66
|
+
return null;
|
|
67
|
+
let itemsUpdated = false;
|
|
68
|
+
const updatedItems = [];
|
|
69
|
+
for (const item of items) {
|
|
70
|
+
let updatedItem = { ...item };
|
|
71
|
+
if ("items" in updatedItem) {
|
|
72
|
+
const childItems = refreshItems(updatedItem.items, eventIds);
|
|
73
|
+
updatedItem = {
|
|
74
|
+
...updatedItem,
|
|
75
|
+
items: childItems !== null && childItems !== void 0 ? childItems : updatedItem.items,
|
|
76
|
+
};
|
|
77
|
+
itemsUpdated || (itemsUpdated = !!childItems);
|
|
78
|
+
}
|
|
79
|
+
for (const [, entry] of Object.entries(updatedItem)) {
|
|
80
|
+
if ((entry instanceof appui_abstract_1.ConditionalBooleanValue &&
|
|
81
|
+
appui_abstract_1.ConditionalBooleanValue.refreshValue(entry, eventIds)) ||
|
|
82
|
+
(entry instanceof appui_abstract_1.ConditionalStringValue &&
|
|
83
|
+
appui_abstract_1.ConditionalStringValue.refreshValue(entry, eventIds)) ||
|
|
84
|
+
(core_react_1.ConditionalIconItem.isConditionalIconItem(entry) &&
|
|
85
|
+
core_react_1.ConditionalIconItem.refreshValue(entry, eventIds))) {
|
|
86
|
+
itemsUpdated = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
updatedItems.push(updatedItem);
|
|
90
|
+
}
|
|
91
|
+
return itemsUpdated ? updatedItems : null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Register a listener on the syncUiEVent and updates all conditionals within the provided items.
|
|
95
|
+
* @param items Items to keep up to date
|
|
96
|
+
* @param syncUiEvent Event to attach to (because we don't depend on appui-react);
|
|
97
|
+
* @returns Synched items
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
function useConditionalSynchedItems(items, syncUiEvent) {
|
|
101
|
+
const [eventSynchedItems, setEventSynchedItems] = React.useState([]);
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
var _a;
|
|
104
|
+
const ids = new Set();
|
|
105
|
+
gatherSyncIds(ids, items);
|
|
106
|
+
setEventSynchedItems((_a = refreshItems(items, ids)) !== null && _a !== void 0 ? _a : items);
|
|
107
|
+
const syncIdsOfInterest = [...ids.values()];
|
|
108
|
+
return syncUiEvent === null || syncUiEvent === void 0 ? void 0 : syncUiEvent.addListener((args) => {
|
|
109
|
+
if (0 === syncIdsOfInterest.length)
|
|
110
|
+
return;
|
|
111
|
+
if (syncIdsOfInterest.some((value) => args.eventIds.has(value.toLowerCase()))) {
|
|
112
|
+
setEventSynchedItems((current) => { var _a; return (_a = refreshItems(current, args.eventIds)) !== null && _a !== void 0 ? _a : current; });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}, [syncUiEvent, items]);
|
|
116
|
+
return eventSynchedItems;
|
|
117
|
+
}
|
|
118
|
+
exports.useConditionalSynchedItems = useConditionalSynchedItems;
|
|
119
|
+
//# sourceMappingURL=useConditionalSynchedItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConditionalSynchedItems.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/useConditionalSynchedItems.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,0DAG+B;AAE/B,kDAAwD;AACxD,6CAA+B;AAE/B;;;;;GAKG;AACH,SAAS,aAAa,CACpB,Q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AAG,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5C,OAAO,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;YACvC,IAAI,CAAC,KAAK,iBAAiB,CAAC,MAAM;gBAAE,OAAO;YAE3C,IACE,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAChD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CACvC,EACD;gBACA,oBAAoB,CAClB,CAAC,OAAO,EAAE,EAAE,WAAC,OAAA,MAAA,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,mCAAI,OAAO,CAAA,EAAA,CAC7D,CAAC;aACH;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IACzB,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AA3BD,gEA2BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport type { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport * as React from \"react\";\n\n/**\n * From a list of ToolbarItem, recursively return the list of syncIds\n * that are relevant to every Conditional members used in the items.\n * @param eventIds Set to fill with syncIds\n * @param items ToolbarItems list to search through\n */\nfunction gatherSyncIds<T extends {} | { items: T[] }>(\n eventIds: Set<string>,\n items: readonly T[]\n) {\n for (const item of items) {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n } else if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n } else if (ConditionalIconItem.isConditionalIconItem(entry)) {\n entry.syncEventIds.forEach((eventId: string) =>\n eventIds.add(eventId.toLowerCase())\n );\n }\n }\n if (\"items\" in item) {\n gatherSyncIds(eventIds, item.items);\n }\n }\n}\n\n/**\n * Refresh all conditional values interested by the provided eventIds.\n * @param items List of ToolbarItems that may content Conditional properties.\n * @param eventIds Set of triggered eventIds.\n * @returns null if no updates occurred, or the provided items with updated values if ANY were updated.\n */\nfunction refreshItems<T extends {} | { items: T[] }>(\n items: readonly T[],\n eventIds: Set<string>\n): T[] | null {\n if (0 === eventIds.size) return null;\n let itemsUpdated = false;\n const updatedItems: T[] = [];\n\n for (const item of items) {\n let updatedItem = { ...item };\n if (\"items\" in updatedItem) {\n const childItems = refreshItems(updatedItem.items, eventIds);\n updatedItem = {\n ...updatedItem,\n items: childItems ?? updatedItem.items,\n };\n itemsUpdated ||= !!childItems;\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (\n (entry instanceof ConditionalBooleanValue &&\n ConditionalBooleanValue.refreshValue(entry, eventIds)) ||\n (entry instanceof ConditionalStringValue &&\n ConditionalStringValue.refreshValue(entry, eventIds)) ||\n (ConditionalIconItem.isConditionalIconItem(entry) &&\n ConditionalIconItem.refreshValue(entry, eventIds))\n ) {\n itemsUpdated = true;\n }\n }\n updatedItems.push(updatedItem);\n }\n return itemsUpdated ? updatedItems : null;\n}\n\n/**\n * Register a listener on the syncUiEVent and updates all conditionals within the provided items.\n * @param items Items to keep up to date\n * @param syncUiEvent Event to attach to (because we don't depend on appui-react);\n * @returns Synched items\n * @internal\n */\nexport function useConditionalSynchedItems<T extends {} | { items: T[] }>(\n items: readonly T[],\n syncUiEvent: undefined | BeEvent<(args: { eventIds: Set<string> }) => void>\n) {\n const [eventSynchedItems, setEventSynchedItems] = React.useState<\n readonly T[]\n >([]);\n React.useEffect(() => {\n const ids = new Set<string>();\n gatherSyncIds(ids, items);\n setEventSynchedItems(refreshItems(items, ids) ?? items);\n const syncIdsOfInterest = [...ids.values()];\n return syncUiEvent?.addListener((args) => {\n if (0 === syncIdsOfInterest.length) return;\n\n if (\n syncIdsOfInterest.some((value: string): boolean =>\n args.eventIds.has(value.toLowerCase())\n )\n ) {\n setEventSynchedItems(\n (current) => refreshItems(current, args.eventIds) ?? current\n );\n }\n });\n }, [syncUiEvent, items]);\n return eventSynchedItems;\n}\n"]}
|
|
@@ -58,6 +58,9 @@ export * from "./components-react/properties/renderers/value/MultilineTextProper
|
|
|
58
58
|
export * from "./components-react/properties/renderers/value/UrlPropertyValueRenderer";
|
|
59
59
|
export * from "./components-react/properties/renderers/value/WithContextStyle";
|
|
60
60
|
export * from "./components-react/filter-builder/FilterBuilder";
|
|
61
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleOperator";
|
|
62
|
+
export * from "./components-react/filter-builder/FilterBuilderState";
|
|
63
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleValue";
|
|
61
64
|
export * from "./components-react/filter-builder/Operators";
|
|
62
65
|
export * from "./components-react/filter-builder/Types";
|
|
63
66
|
export * from "./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer";
|
|
@@ -105,10 +108,11 @@ export * from "./components-react/toolbar/groupPanel/Column";
|
|
|
105
108
|
export * from "./components-react/toolbar/groupPanel/Columns";
|
|
106
109
|
export * from "./components-react/toolbar/groupPanel/Panel";
|
|
107
110
|
export * from "./components-react/toolbar/groupPanel/Title";
|
|
108
|
-
export * from "./components-react/toolbar/
|
|
109
|
-
export * from "./components-react/toolbar/ToolbarWithOverflow";
|
|
111
|
+
export * from "./components-react/toolbar/InternalToolbarComponent";
|
|
110
112
|
export * from "./components-react/toolbar/PopupItem";
|
|
111
113
|
export * from "./components-react/toolbar/PopupItemWithDrag";
|
|
114
|
+
export * from "./components-react/toolbar/Toolbar";
|
|
115
|
+
export * from "./components-react/toolbar/ToolbarWithOverflow";
|
|
112
116
|
export * from "./components-react/toolbar/Item";
|
|
113
117
|
export * from "./components-react/toolbar/utilities/Direction";
|
|
114
118
|
export * from "./components-react/tree/TreeDataProvider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.d.ts","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sDAAsD,CAAC;AACrE,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,kDAAkD,CAAC;AACjE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sDAAsD,CAAC;AAErE,cAAc,yDAAyD,CAAC;AAExE,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,qDAAqD,CAAC;AACpE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,yCAAyC,CAAC;AAExD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kDAAkD,CAAC;AACjE,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD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,6CAA6C,CAAC;AAE5D,cAAc,qDAAqD,CAAC;AACpE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,qDAAqD,CAAC;AACpE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
|
@@ -81,6 +81,9 @@ __exportStar(require("./components-react/properties/renderers/value/MultilineTex
|
|
|
81
81
|
__exportStar(require("./components-react/properties/renderers/value/UrlPropertyValueRenderer"), exports);
|
|
82
82
|
__exportStar(require("./components-react/properties/renderers/value/WithContextStyle"), exports);
|
|
83
83
|
__exportStar(require("./components-react/filter-builder/FilterBuilder"), exports);
|
|
84
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleOperator"), exports);
|
|
85
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderState"), exports);
|
|
86
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleValue"), exports);
|
|
84
87
|
__exportStar(require("./components-react/filter-builder/Operators"), exports);
|
|
85
88
|
__exportStar(require("./components-react/filter-builder/Types"), exports);
|
|
86
89
|
__exportStar(require("./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer"), exports);
|
|
@@ -129,10 +132,11 @@ __exportStar(require("./components-react/toolbar/groupPanel/Column"), exports);
|
|
|
129
132
|
__exportStar(require("./components-react/toolbar/groupPanel/Columns"), exports);
|
|
130
133
|
__exportStar(require("./components-react/toolbar/groupPanel/Panel"), exports);
|
|
131
134
|
__exportStar(require("./components-react/toolbar/groupPanel/Title"), exports);
|
|
132
|
-
__exportStar(require("./components-react/toolbar/
|
|
133
|
-
__exportStar(require("./components-react/toolbar/ToolbarWithOverflow"), exports);
|
|
135
|
+
__exportStar(require("./components-react/toolbar/InternalToolbarComponent"), exports);
|
|
134
136
|
__exportStar(require("./components-react/toolbar/PopupItem"), exports);
|
|
135
137
|
__exportStar(require("./components-react/toolbar/PopupItemWithDrag"), exports);
|
|
138
|
+
__exportStar(require("./components-react/toolbar/Toolbar"), exports);
|
|
139
|
+
__exportStar(require("./components-react/toolbar/ToolbarWithOverflow"), exports);
|
|
136
140
|
__exportStar(require("./components-react/toolbar/Item"), exports);
|
|
137
141
|
__exportStar(require("./components-react/toolbar/utilities/Direction"), exports);
|
|
138
142
|
__exportStar(require("./components-react/tree/TreeDataProvider"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA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AwF;AACxF,6GAA2F;AAC3F,oGAAkF;AAClF,6FAA2E;AAC3E,6FAA2E;AAC3E,wGAAsF;AACtF,mGAAiF;AACjF,sGAAoF;AACpF,wHAAsG;AACtG,wHAAsG;AACtG,2HAAyG;AACzG,oHAAkG;AAClG,mHAAiG;AAEjG,0FAAwE;AAExE,wDAAwD;AACxD,kFAAgE;AAEhE,+EAA6D;AAC7D,gFAA8D;AAC9D,8EAA4D;AAC5D,8EAA4D;AAE5D,qEAAmD;AACnD,iFAA+D;AAC/D,uEAAqD;AACrD,+EAA6D;AAC7D,kEAAgD;AAChD,iFAA+D;AAE/D,2EAAyD;AACzD,iFAA+D;AAC/D,6EAA2D;AAC3D,sEAAoD;AACpD,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,2FAAyE;AACzE,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,0EAAwD;AACxD,mFAAiE;AACjE,sEAAoD;AAEpD,8EAA4D;AAC5D,qFAAmE;AACnE,qFAAmE;AACnE,sFAAoE;AACpE,kFAAgE;AAChE,yFAAuE;AACvE,gGAA8E;AAC9E,qFAAmE;AACnE,mFAAiE;AACjE,oFAAkE;AAClE,uFAAqE;AAErE,0FAAwE;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D;AACxD,kFAAgE;AAEhE,+EAA6D;AAC7D,gFAA8D;AAC9D,8EAA4D;AAC5D,8EAA4D;AAE5D,sFAAoE;AACpE,uEAAqD;AACrD,+EAA6D;AAC7D,qEAAmD;AACnD,iFAA+D;AAC/D,kEAAgD;AAChD,iFAA+D;AAE/D,2EAAyD;AACzD,iFAA+D;AAC/D,6EAA2D;AAC3D,sEAAoD;AACpD,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,2FAAyE;AACzE,8FAA4E;AAC5E,gGAA8E;AAC9E,4FAA0E;AAC1E,yFAAuE;AAEvE;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\n\nexport { UiComponents } from \"./components-react/UiComponents\";\n\nexport * from \"./components-react/common/Links\";\nexport * from \"./components-react/common/PageOptions\";\nexport * from \"./components-react/common/selection/SelectionModes\";\nexport * from \"./components-react/common/HighlightingComponentProps\";\nexport * from \"./components-react/common/HighlightedText\";\nexport * from \"./components-react/common/IImageLoader\";\nexport * from \"./components-react/common/selection/SelectionHandler\";\nexport * from \"./components-react/common/UseAsyncValue\";\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\nexport * from \"./components-react/common/DateUtils\";\n\nexport * from \"./components-react/converters/TypeConverter\";\nexport * from \"./components-react/converters/TypeConverterManager\";\nexport * from \"./components-react/converters/BooleanTypeConverter\";\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\nexport * from \"./components-react/converters/EnumTypeConverter\";\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\nexport * from \"./components-react/converters/NumericTypeConverter\";\nexport * from \"./components-react/converters/PointTypeConverter\";\nexport * from \"./components-react/converters/StringTypeConverter\";\nexport * from \"./components-react/converters/CompositeTypeConverter\";\n\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\n\nexport * from \"./components-react/datepicker/DateField\";\nexport * from \"./components-react/datepicker/DatePicker\";\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\nexport * from \"./components-react/datepicker/IntlFormatter\";\nexport * from \"./components-react/datepicker/TimeField\";\n\nexport * from \"./components-react/editors/BooleanEditor\";\nexport * from \"./components-react/editors/CustomNumberEditor\";\nexport * from \"./components-react/editors/DateTimeEditor\";\nexport * from \"./components-react/editors/EditorContainer\";\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\nexport * from \"./components-react/editors/EnumEditor\";\nexport * from \"./components-react/editors/IconEditor\";\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\nexport * from \"./components-react/editors/NumericInputEditor\";\nexport * from \"./components-react/editors/PropertyEditorManager\";\nexport * from \"./components-react/editors/SliderEditor\";\nexport * from \"./components-react/editors/TextEditor\";\nexport * from \"./components-react/editors/TextareaEditor\";\nexport * from \"./components-react/editors/ToggleEditor\";\n\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\nexport * from \"./components-react/favorite/FavoritePropertyList\";\n\nexport * from \"./components-react/filtering/FilteringInput\";\nexport * from \"./components-react/filtering/ResultSelector\";\n\nexport * from \"./components-react/inputs/ParsedInput\";\n\nexport * from \"./components-react/properties/LinkHandler\";\nexport * from \"./components-react/properties/ValueRendererManager\";\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\nexport * from \"./components-react/properties/renderers/PropertyView\";\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\n\nexport * from \"./components-react/filter-builder/FilterBuilder\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\nexport * from \"./components-react/filter-builder/Operators\";\nexport * from \"./components-react/filter-builder/Types\";\n\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\n\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\nexport * from \"./components-react/properties/ItemStyle\";\n\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\nexport * from \"./components-react/propertygrid/component/PropertyList\";\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\n\nexport * from \"./components-react/selectable-content/SelectableContent\";\n\n// TODO: toolbar/groupPanel components needs a refactor.\nexport * from \"./components-react/toolbar/groupPanel/tool/Tool\";\n\nexport * from \"./components-react/toolbar/groupPanel/Column\";\nexport * from \"./components-react/toolbar/groupPanel/Columns\";\nexport * from \"./components-react/toolbar/groupPanel/Panel\";\nexport * from \"./components-react/toolbar/groupPanel/Title\";\n\nexport * from \"./components-react/toolbar/InternalToolbarComponent\";\nexport * from \"./components-react/toolbar/PopupItem\";\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\nexport * from \"./components-react/toolbar/Toolbar\";\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./components-react/toolbar/Item\";\nexport * from \"./components-react/toolbar/utilities/Direction\";\n\nexport * from \"./components-react/tree/TreeDataProvider\";\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\nexport * from \"./components-react/tree/HighlightingEngine\";\nexport * from \"./components-react/tree/ImageLoader\";\nexport * from \"./components-react/tree/controlled/TreeActions\";\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\nexport * from \"./components-react/tree/controlled/TreeEvents\";\nexport * from \"./components-react/tree/controlled/TreeModel\";\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\nexport * from \"./components-react/tree/controlled/Observable\";\nexport * from \"./components-react/tree/controlled/TreeHooks\";\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\nexport * from \"./components-react/tree/controlled/component/NodeContent\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\n\n/** @docs-package-description\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Breadcrumb\n * Classes and components for working with a Breadcrumb.\n * As of version 3.0, the Breadcrumb is deprecated.\n */\n/**\n * @docs-group-description Date\n * Classes, interfaces, and components for showing and setting date and time.\n */\n/**\n * @docs-group-description DragDrop\n * Classes and Higher Order Components for working with the DragDrop API.\n */\n/**\n * @docs-group-description Favorite\n * Classes and components for displaying favorite properties.\n */\n/**\n * @docs-group-description Filtering\n * Classes and components for working with filtering.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input.\n */\n/**\n * @docs-group-description SelectableContent\n * Classes and components for working with SelectableContent component.\n */\n/**\n * @docs-group-description Properties\n * Classes and components for working with Properties.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description PropertyGrid\n * Classes and components for working with a PropertyGrid.\n */\n/**\n * @docs-group-description Table\n * Classes and components for working with a Table.\n */\n/**\n * @docs-group-description Toolbar\n * Functions and components that provide a Toolbar.\n */\n/**\n * @docs-group-description Tree\n * Classes and components for working with a Tree.\n */\n/**\n * @docs-group-description TypeConverters\n * Classes for working with Type Converters.\n */\n/**\n * @docs-group-description PropertyFilterBuilder\n * Classes and components for working with PropertyFilterBuilder.\n */\n"]}
|
|
@@ -4,35 +4,49 @@
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { PropertyDescription } from "@itwin/appui-abstract";
|
|
6
6
|
import type { PropertyFilterBuilderRuleOperatorProps } from "./FilterBuilderRuleOperator";
|
|
7
|
-
import type {
|
|
7
|
+
import type { PropertyFilterBuilderRuleValueRendererProps } from "./FilterBuilderRuleValue";
|
|
8
8
|
import type { PropertyFilter } from "./Types";
|
|
9
|
+
import type { PropertyFilterBuilderActions, PropertyFilterBuilderRuleGroup, UsePropertyFilterBuilderProps } from "./FilterBuilderState";
|
|
9
10
|
/**
|
|
10
11
|
* Props for [[PropertyFilterBuilder]] component.
|
|
11
12
|
* @beta
|
|
12
13
|
*/
|
|
13
|
-
export interface PropertyFilterBuilderProps {
|
|
14
|
-
/** List of properties available to be used in filter rules. */
|
|
15
|
-
properties: PropertyDescription[];
|
|
14
|
+
export interface PropertyFilterBuilderProps extends Omit<PropertyFilterBuilderRendererProps, "actions" | "rootGroup">, UsePropertyFilterBuilderProps {
|
|
16
15
|
/** Callback that is invoked when filter changes. */
|
|
17
16
|
onFilterChanged: (filter?: PropertyFilter) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Component for building complex filters. It allows to create filter rules or rule groups based on provided list of properties.
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export declare function PropertyFilterBuilder(props: PropertyFilterBuilderProps): JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Props for [[PropertyFilterBuilderRenderer]] component.
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
export interface PropertyFilterBuilderRendererProps {
|
|
28
|
+
/** Root group of rules in [[PropertyFilterBuilder]] component. */
|
|
29
|
+
rootGroup: PropertyFilterBuilderRuleGroup;
|
|
30
|
+
/** Actions for modifying [[PropertyFilterBuilder]] state. */
|
|
31
|
+
actions: PropertyFilterBuilderActions;
|
|
32
|
+
/** List of properties available to be used in filter rules. */
|
|
33
|
+
properties: PropertyDescription[];
|
|
18
34
|
/** Callback that is invoked when property is selected in any rule. */
|
|
19
35
|
onRulePropertySelected?: (property: PropertyDescription) => void;
|
|
20
36
|
/** Custom renderer for rule operator selector. */
|
|
21
37
|
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
22
38
|
/** Custom renderer for rule value input. */
|
|
23
|
-
ruleValueRenderer?: (props:
|
|
39
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueRendererProps) => React.ReactNode;
|
|
24
40
|
/** Custom renderer for property selector in rule. */
|
|
25
41
|
propertyRenderer?: (name: string) => React.ReactNode;
|
|
26
42
|
/** Specifies how deep rule groups can be nested. */
|
|
27
43
|
ruleGroupDepthLimit?: number;
|
|
28
44
|
/** Specifies whether component is disabled or not. */
|
|
29
45
|
isDisabled?: boolean;
|
|
30
|
-
/** Initial filter that should be shown when component is mounted. */
|
|
31
|
-
initialFilter?: PropertyFilter;
|
|
32
46
|
}
|
|
33
47
|
/**
|
|
34
|
-
*
|
|
48
|
+
* Renderer for [[PropertyFilterBuilder]] component.
|
|
35
49
|
* @beta
|
|
36
50
|
*/
|
|
37
|
-
export declare function
|
|
51
|
+
export declare function PropertyFilterBuilderRenderer(props: PropertyFilterBuilderRendererProps): JSX.Element;
|
|
38
52
|
//# sourceMappingURL=FilterBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAYjE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAYjE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,KAAK,EAAE,2CAA2C,EAAE,MAAM,0BAA0B,CAAC;AAK5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EACV,4BAA4B,EAC5B,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,kCAAkC,EAAE,SAAS,GAAG,WAAW,CAAC,EACvE,6BAA6B;IAC/B,oDAAoD;IACpD,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;CACpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eAuBtE;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,kEAAkE;IAClE,SAAS,EAAE,8BAA8B,CAAC;IAC1C,6DAA6D;IAC7D,OAAO,EAAE,4BAA4B,CAAC;IACtC,+DAA+D;IAC/D,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,sEAAsE;IACtE,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,CACrB,KAAK,EAAE,sCAAsC,KAC1C,KAAK,CAAC,SAAS,CAAC;IACrB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,CAClB,KAAK,EAAE,2CAA2C,KAC/C,KAAK,CAAC,SAAS,CAAC;IACrB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACrD,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,kCAAkC,eAoD1C"}
|
|
@@ -8,23 +8,33 @@
|
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { ActiveRuleGroupContext, PropertyFilterBuilderContext, PropertyFilterBuilderRuleRenderingContext, useActiveRuleGroupContextProps, } from "./FilterBuilderContext";
|
|
10
10
|
import { PropertyFilterBuilderRuleGroupRenderer } from "./FilterBuilderRuleGroup";
|
|
11
|
-
import { buildPropertyFilter,
|
|
12
|
-
const ROOT_GROUP_PATH = [];
|
|
11
|
+
import { buildPropertyFilter, usePropertyFilterBuilder, } from "./FilterBuilderState";
|
|
13
12
|
/**
|
|
14
13
|
* Component for building complex filters. It allows to create filter rules or rule groups based on provided list of properties.
|
|
15
14
|
* @beta
|
|
16
15
|
*/
|
|
17
16
|
export function PropertyFilterBuilder(props) {
|
|
18
|
-
const {
|
|
19
|
-
const {
|
|
20
|
-
|
|
17
|
+
const { initialFilter, onFilterChanged } = props;
|
|
18
|
+
const { actions, rootGroup } = usePropertyFilterBuilder({
|
|
19
|
+
initialFilter,
|
|
20
|
+
});
|
|
21
21
|
const firstRender = React.useRef(true);
|
|
22
|
-
const filter = React.useMemo(() => buildPropertyFilter(
|
|
22
|
+
const filter = React.useMemo(() => buildPropertyFilter(rootGroup), [rootGroup]);
|
|
23
23
|
React.useEffect(() => {
|
|
24
24
|
if (!firstRender.current)
|
|
25
25
|
onFilterChanged(filter);
|
|
26
26
|
firstRender.current = false;
|
|
27
27
|
}, [filter, onFilterChanged]);
|
|
28
|
+
return (React.createElement(PropertyFilterBuilderRenderer, { ...props, actions: actions, rootGroup: rootGroup }));
|
|
29
|
+
}
|
|
30
|
+
const ROOT_GROUP_PATH = [];
|
|
31
|
+
/**
|
|
32
|
+
* Renderer for [[PropertyFilterBuilder]] component.
|
|
33
|
+
* @beta
|
|
34
|
+
*/
|
|
35
|
+
export function PropertyFilterBuilderRenderer(props) {
|
|
36
|
+
const { rootGroup, actions, properties, onRulePropertySelected, ruleOperatorRenderer, ruleValueRenderer, ruleGroupDepthLimit, propertyRenderer, isDisabled, } = props;
|
|
37
|
+
const rootRef = React.useRef(null);
|
|
28
38
|
const contextValue = React.useMemo(() => ({
|
|
29
39
|
actions,
|
|
30
40
|
properties,
|
|
@@ -41,6 +51,6 @@ export function PropertyFilterBuilder(props) {
|
|
|
41
51
|
React.createElement(PropertyFilterBuilderContext.Provider, { value: contextValue },
|
|
42
52
|
React.createElement(ActiveRuleGroupContext.Provider, { value: useActiveRuleGroupContextProps(rootRef) },
|
|
43
53
|
React.createElement("div", { ref: rootRef, className: "filter-builder" },
|
|
44
|
-
React.createElement(PropertyFilterBuilderRuleGroupRenderer, { path: ROOT_GROUP_PATH, group:
|
|
54
|
+
React.createElement(PropertyFilterBuilderRuleGroupRenderer, { path: ROOT_GROUP_PATH, group: rootGroup }))))));
|
|
45
55
|
}
|
|
46
56
|
//# sourceMappingURL=FilterBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBuilder.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,yCAAyC,EACzC,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EACL,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"FilterBuilder.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,yCAAyC,EACzC,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sCAAsC,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAmB9B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC;QACtD,aAAa;KACd,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,KAAK,CAAC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AC;IACJ,OAAO,CACL,oBAAC,yCAAyC,CAAC,QAAQ,IACjD,KAAK,EAAE,qBAAqB;QAE5B,oBAAC,4BAA4B,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;YACxD,oBAAC,sBAAsB,CAAC,QAAQ,IAC9B,KAAK,EAAE,8BAA8B,CAAC,OAAO,CAAC;gBAE9C,6BAAK,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,gBAAgB;oBAC3C,oBAAC,sCAAsC,IACrC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,SAAS,GAChB,CACE,CAC0B,CACI,CACW,CACtD,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyFilterBuilder\n */\n\nimport * as React from \"react\";\nimport type { PropertyDescription } from \"@itwin/appui-abstract\";\nimport type {\n PropertyFilterBuilderContextProps,\n PropertyFilterBuilderRuleRenderingContextProps,\n} from \"./FilterBuilderContext\";\nimport {\n ActiveRuleGroupContext,\n PropertyFilterBuilderContext,\n PropertyFilterBuilderRuleRenderingContext,\n useActiveRuleGroupContextProps,\n} from \"./FilterBuilderContext\";\nimport { PropertyFilterBuilderRuleGroupRenderer } from \"./FilterBuilderRuleGroup\";\nimport type { PropertyFilterBuilderRuleOperatorProps } from \"./FilterBuilderRuleOperator\";\nimport type { PropertyFilterBuilderRuleValueRendererProps } from \"./FilterBuilderRuleValue\";\nimport {\n buildPropertyFilter,\n usePropertyFilterBuilder,\n} from \"./FilterBuilderState\";\nimport type { PropertyFilter } from \"./Types\";\nimport type {\n PropertyFilterBuilderActions,\n PropertyFilterBuilderRuleGroup,\n UsePropertyFilterBuilderProps,\n} from \"./FilterBuilderState\";\n\n/**\n * Props for [[PropertyFilterBuilder]] component.\n * @beta\n */\nexport interface PropertyFilterBuilderProps\n extends Omit<PropertyFilterBuilderRendererProps, \"actions\" | \"rootGroup\">,\n UsePropertyFilterBuilderProps {\n /** Callback that is invoked when filter changes. */\n onFilterChanged: (filter?: PropertyFilter) => void;\n}\n\n/**\n * Component for building complex filters. It allows to create filter rules or rule groups based on provided list of properties.\n * @beta\n */\nexport function PropertyFilterBuilder(props: PropertyFilterBuilderProps) {\n const { initialFilter, onFilterChanged } = props;\n const { actions, rootGroup } = usePropertyFilterBuilder({\n initialFilter,\n });\n\n const firstRender = React.useRef(true);\n const filter = React.useMemo(\n () => buildPropertyFilter(rootGroup),\n [rootGroup]\n );\n React.useEffect(() => {\n if (!firstRender.current) onFilterChanged(filter);\n firstRender.current = false;\n }, [filter, onFilterChanged]);\n\n return (\n <PropertyFilterBuilderRenderer\n {...props}\n actions={actions}\n rootGroup={rootGroup}\n />\n );\n}\n\n/**\n * Props for [[PropertyFilterBuilderRenderer]] component.\n * @beta\n */\nexport interface PropertyFilterBuilderRendererProps {\n /** Root group of rules in [[PropertyFilterBuilder]] component. */\n rootGroup: PropertyFilterBuilderRuleGroup;\n /** Actions for modifying [[PropertyFilterBuilder]] state. */\n actions: PropertyFilterBuilderActions;\n /** List of properties available to be used in filter rules. */\n properties: PropertyDescription[];\n /** Callback that is invoked when property is selected in any rule. */\n onRulePropertySelected?: (property: PropertyDescription) => void;\n /** Custom renderer for rule operator selector. */\n ruleOperatorRenderer?: (\n props: PropertyFilterBuilderRuleOperatorProps\n ) => React.ReactNode;\n /** Custom renderer for rule value input. */\n ruleValueRenderer?: (\n props: PropertyFilterBuilderRuleValueRendererProps\n ) => React.ReactNode;\n /** Custom renderer for property selector in rule. */\n propertyRenderer?: (name: string) => React.ReactNode;\n /** Specifies how deep rule groups can be nested. */\n ruleGroupDepthLimit?: number;\n /** Specifies whether component is disabled or not. */\n isDisabled?: boolean;\n}\n\nconst ROOT_GROUP_PATH: string[] = [];\n\n/**\n * Renderer for [[PropertyFilterBuilder]] component.\n * @beta\n */\nexport function PropertyFilterBuilderRenderer(\n props: PropertyFilterBuilderRendererProps\n) {\n const {\n rootGroup,\n actions,\n properties,\n onRulePropertySelected,\n ruleOperatorRenderer,\n ruleValueRenderer,\n ruleGroupDepthLimit,\n propertyRenderer,\n isDisabled,\n } = props;\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const contextValue = React.useMemo<PropertyFilterBuilderContextProps>(\n () => ({\n actions,\n properties,\n onRulePropertySelected,\n ruleGroupDepthLimit,\n }),\n [actions, properties, onRulePropertySelected, ruleGroupDepthLimit]\n );\n const renderingContextValue =\n React.useMemo<PropertyFilterBuilderRuleRenderingContextProps>(\n () => ({\n ruleOperatorRenderer,\n ruleValueRenderer,\n propertyRenderer,\n isDisabled,\n }),\n [ruleOperatorRenderer, ruleValueRenderer, propertyRenderer, isDisabled]\n );\n return (\n <PropertyFilterBuilderRuleRenderingContext.Provider\n value={renderingContextValue}\n >\n <PropertyFilterBuilderContext.Provider value={contextValue}>\n <ActiveRuleGroupContext.Provider\n value={useActiveRuleGroupContextProps(rootRef)}\n >\n <div ref={rootRef} className=\"filter-builder\">\n <PropertyFilterBuilderRuleGroupRenderer\n path={ROOT_GROUP_PATH}\n group={rootGroup}\n />\n </div>\n </ActiveRuleGroupContext.Provider>\n </PropertyFilterBuilderContext.Provider>\n </PropertyFilterBuilderRuleRenderingContext.Provider>\n );\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { PropertyDescription } from "@itwin/appui-abstract";
|
|
6
6
|
import type { PropertyFilterBuilderActions } from "./FilterBuilderState";
|
|
7
7
|
import type { PropertyFilterBuilderRuleOperatorProps } from "./FilterBuilderRuleOperator";
|
|
8
|
-
import type {
|
|
8
|
+
import type { PropertyFilterBuilderRuleValueRendererProps } from "./FilterBuilderRuleValue";
|
|
9
9
|
/**
|
|
10
10
|
* Data structure that describes [[PropertyFilterBuilderContext]] value.
|
|
11
11
|
* @internal
|
|
@@ -33,7 +33,7 @@ export interface PropertyFilterBuilderRuleRenderingContextProps {
|
|
|
33
33
|
/** Custom renderer for operator selector in rule. */
|
|
34
34
|
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
35
35
|
/** Custom renderer for value input in rule. */
|
|
36
|
-
ruleValueRenderer?: (props:
|
|
36
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueRendererProps) => React.ReactNode;
|
|
37
37
|
/** Custom renderer for property selector in rule. */
|
|
38
38
|
propertyRenderer?: (name: string) => React.ReactNode;
|
|
39
39
|
/** Specifies that properties selection is disabled. */
|
|
@@ -49,8 +49,10 @@ export declare const PropertyFilterBuilderRuleRenderingContext: React.Context<Pr
|
|
|
49
49
|
* @internal
|
|
50
50
|
*/
|
|
51
51
|
export interface ActiveRuleGroupContextProps {
|
|
52
|
-
/** Element of currently
|
|
53
|
-
|
|
52
|
+
/** Element of currently focused rule group. */
|
|
53
|
+
focusedElement: HTMLElement | undefined;
|
|
54
|
+
/** Element of currently hovered rule group. */
|
|
55
|
+
hoveredElement: HTMLElement | undefined;
|
|
54
56
|
/** Even handler for rule group element 'onFocus' event */
|
|
55
57
|
onFocus: React.FocusEventHandler<HTMLElement>;
|
|
56
58
|
/** Even handler for rule group element 'onBlur' event */
|
|
@@ -71,7 +73,8 @@ export declare const ActiveRuleGroupContext: React.Context<ActiveRuleGroupContex
|
|
|
71
73
|
* @internal
|
|
72
74
|
*/
|
|
73
75
|
export declare function useActiveRuleGroupContextProps(rootElementRef: React.RefObject<HTMLElement>): {
|
|
74
|
-
|
|
76
|
+
focusedElement: HTMLElement | undefined;
|
|
77
|
+
hoveredElement: HTMLElement | undefined;
|
|
75
78
|
onFocus: React.FocusEventHandler<HTMLElement>;
|
|
76
79
|
onBlur: React.FocusEventHandler<HTMLElement>;
|
|
77
80
|
onMouseOver: React.MouseEventHandler<HTMLElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterBuilderContext.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FilterBuilderContext.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,KAAK,EAAE,2CAA2C,EAAE,MAAM,0BAA0B,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,6DAA6D;IAC7D,OAAO,EAAE,4BAA4B,CAAC;IACtC,oCAAoC;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,gEAAgE;IAChE,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,kDACsB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,8CAA8C;IAC7D,qDAAqD;IACrD,oBAAoB,CAAC,EAAE,CACrB,KAAK,EAAE,sCAAsC,KAC1C,KAAK,CAAC,SAAS,CAAC;IACrB,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,CAClB,KAAK,EAAE,2CAA2C,KAC/C,KAAK,CAAC,SAAS,CAAC;IACrB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACrD,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,yCAAyC,+DACmB,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+CAA+C;IAC/C,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,+CAA+C;IAC/C,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,0DAA0D;IAC1D,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC9C,yDAAyD;IACzD,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC7C,8DAA8D;IAC9D,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,6DAA6D;IAC7D,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAClD;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,4CACsB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;;;;;;;EA6D7C"}
|
|
@@ -27,36 +27,58 @@ export const ActiveRuleGroupContext = React.createContext(null);
|
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
29
|
export function useActiveRuleGroupContextProps(rootElementRef) {
|
|
30
|
-
const [
|
|
31
|
-
const
|
|
30
|
+
const [focusedElement, setFocusedElement] = React.useState();
|
|
31
|
+
const [hoveredElement, setHoveredElement] = React.useState();
|
|
32
|
+
// This is used to prevent handling onFocus, onBlur, onMouseOver, onMouseOut in the same event cycle.
|
|
33
|
+
const focusedTimeout = useSetTimeout();
|
|
34
|
+
const hoveredTimeout = useSetTimeout();
|
|
35
|
+
const onFocus = (e) => {
|
|
32
36
|
e.stopPropagation();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
const target = e.currentTarget;
|
|
38
|
+
focusedTimeout(() => {
|
|
39
|
+
setFocusedElement(target);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const onBlur = (e) => {
|
|
36
43
|
e.stopPropagation();
|
|
37
|
-
if (
|
|
44
|
+
if (focusedElement !== e.currentTarget ||
|
|
38
45
|
(rootElementRef.current &&
|
|
39
46
|
rootElementRef.current.contains(e.relatedTarget)))
|
|
40
47
|
return;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
focusedTimeout(() => {
|
|
49
|
+
setFocusedElement(undefined);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const onMouseOver = (e) => {
|
|
53
|
+
const target = e.currentTarget;
|
|
44
54
|
e.stopPropagation();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
hoveredTimeout(() => {
|
|
56
|
+
setHoveredElement(target);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const onMouseOut = (e) => {
|
|
48
60
|
e.stopPropagation();
|
|
49
61
|
// istanbul ignore if
|
|
50
|
-
if (
|
|
62
|
+
if (hoveredElement !== e.currentTarget)
|
|
51
63
|
return;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
hoveredTimeout(() => {
|
|
65
|
+
setHoveredElement(undefined);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
focusedElement,
|
|
70
|
+
hoveredElement,
|
|
56
71
|
onFocus,
|
|
57
72
|
onBlur,
|
|
58
73
|
onMouseOver,
|
|
59
74
|
onMouseOut,
|
|
60
|
-
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function useSetTimeout() {
|
|
78
|
+
const timeoutRef = React.useRef();
|
|
79
|
+
return (callback) => {
|
|
80
|
+
window.clearTimeout(timeoutRef.current);
|
|
81
|
+
timeoutRef.current = window.setTimeout(callback);
|
|
82
|
+
};
|
|
61
83
|
}
|
|
62
84
|
//# sourceMappingURL=FilterBuilderContext.js.map
|