@itwin/components-react 3.3.0-dev.62 → 3.3.0-dev.63
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 +6 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/DateTimeEditor.js +2 -0
- package/lib/cjs/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts +36 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js +118 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilder.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +76 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +41 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +29 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js +79 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +73 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +12 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js +47 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js +52 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js +43 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts +43 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js +152 -0
- package/lib/cjs/components-react/filter-builder/FilterBuilderState.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts +27 -0
- package/lib/cjs/components-react/filter-builder/Operators.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/Operators.js +113 -0
- package/lib/cjs/components-react/filter-builder/Operators.js.map +1 -0
- package/lib/cjs/components-react/filter-builder/Types.d.ts +18 -0
- package/lib/cjs/components-react/filter-builder/Types.d.ts.map +1 -0
- package/lib/cjs/components-react/filter-builder/Types.js +9 -0
- package/lib/cjs/components-react/filter-builder/Types.js.map +1 -0
- package/lib/cjs/components-react.d.ts +9 -0
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +9 -0
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/DateTimeEditor.js +2 -0
- package/lib/esm/components-react/editors/DateTimeEditor.js.map +1 -1
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts +36 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.js +94 -0
- package/lib/esm/components-react/filter-builder/FilterBuilder.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +53 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +41 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts +29 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js +55 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +73 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts +12 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js +24 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleOperator.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js +29 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleProperty.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts +11 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js +20 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts +43 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js +127 -0
- package/lib/esm/components-react/filter-builder/FilterBuilderState.js.map +1 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts +27 -0
- package/lib/esm/components-react/filter-builder/Operators.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/Operators.js +107 -0
- package/lib/esm/components-react/filter-builder/Operators.js.map +1 -0
- package/lib/esm/components-react/filter-builder/Types.d.ts +18 -0
- package/lib/esm/components-react/filter-builder/Types.d.ts.map +1 -0
- package/lib/esm/components-react/filter-builder/Types.js +5 -0
- package/lib/esm/components-react/filter-builder/Types.js.map +1 -0
- package/lib/esm/components-react.d.ts +9 -0
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +9 -0
- package/lib/esm/components-react.js.map +1 -1
- package/lib/public/locales/en/UiComponents.json +16 -0
- package/package.json +14 -11
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isUnaryPropertyFilterOperator = exports.getPropertyFilterOperatorLabel = exports.getPropertyFilterOperators = exports.PropertyFilterRuleOperator = exports.PropertyFilterRuleGroupOperator = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
9
|
+
const UiComponents_1 = require("../UiComponents");
|
|
10
|
+
/** @alpha */
|
|
11
|
+
var PropertyFilterRuleGroupOperator;
|
|
12
|
+
(function (PropertyFilterRuleGroupOperator) {
|
|
13
|
+
PropertyFilterRuleGroupOperator[PropertyFilterRuleGroupOperator["And"] = 0] = "And";
|
|
14
|
+
PropertyFilterRuleGroupOperator[PropertyFilterRuleGroupOperator["Or"] = 1] = "Or";
|
|
15
|
+
})(PropertyFilterRuleGroupOperator = exports.PropertyFilterRuleGroupOperator || (exports.PropertyFilterRuleGroupOperator = {}));
|
|
16
|
+
/** @alpha */
|
|
17
|
+
var PropertyFilterRuleOperator;
|
|
18
|
+
(function (PropertyFilterRuleOperator) {
|
|
19
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsTrue"] = 0] = "IsTrue";
|
|
20
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsFalse"] = 1] = "IsFalse";
|
|
21
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsEqual"] = 2] = "IsEqual";
|
|
22
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsNotEqual"] = 3] = "IsNotEqual";
|
|
23
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["Greater"] = 4] = "Greater";
|
|
24
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["GreaterOrEqual"] = 5] = "GreaterOrEqual";
|
|
25
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["Less"] = 6] = "Less";
|
|
26
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["LessOrEqual"] = 7] = "LessOrEqual";
|
|
27
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["Like"] = 8] = "Like";
|
|
28
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsNull"] = 9] = "IsNull";
|
|
29
|
+
PropertyFilterRuleOperator[PropertyFilterRuleOperator["IsNotNull"] = 10] = "IsNotNull";
|
|
30
|
+
})(PropertyFilterRuleOperator = exports.PropertyFilterRuleOperator || (exports.PropertyFilterRuleOperator = {}));
|
|
31
|
+
/** @alpha */
|
|
32
|
+
function getPropertyFilterOperators(property) {
|
|
33
|
+
const typename = property.typename;
|
|
34
|
+
if (typename === appui_abstract_1.StandardTypeNames.Bool || typename === appui_abstract_1.StandardTypeNames.Boolean) {
|
|
35
|
+
return [
|
|
36
|
+
PropertyFilterRuleOperator.IsTrue,
|
|
37
|
+
PropertyFilterRuleOperator.IsFalse,
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
const operators = [
|
|
41
|
+
PropertyFilterRuleOperator.IsEqual,
|
|
42
|
+
PropertyFilterRuleOperator.IsNotEqual,
|
|
43
|
+
PropertyFilterRuleOperator.IsNull,
|
|
44
|
+
PropertyFilterRuleOperator.IsNotNull,
|
|
45
|
+
];
|
|
46
|
+
if (typename === appui_abstract_1.StandardTypeNames.Number
|
|
47
|
+
|| typename === appui_abstract_1.StandardTypeNames.Int
|
|
48
|
+
|| typename === appui_abstract_1.StandardTypeNames.Integer
|
|
49
|
+
|| typename === appui_abstract_1.StandardTypeNames.Double
|
|
50
|
+
|| typename === appui_abstract_1.StandardTypeNames.Float
|
|
51
|
+
|| typename === appui_abstract_1.StandardTypeNames.Hex
|
|
52
|
+
|| typename === appui_abstract_1.StandardTypeNames.Hexadecimal
|
|
53
|
+
|| typename === appui_abstract_1.StandardTypeNames.ShortDate
|
|
54
|
+
|| typename === appui_abstract_1.StandardTypeNames.DateTime) {
|
|
55
|
+
return [
|
|
56
|
+
...operators,
|
|
57
|
+
PropertyFilterRuleOperator.Greater,
|
|
58
|
+
PropertyFilterRuleOperator.GreaterOrEqual,
|
|
59
|
+
PropertyFilterRuleOperator.Less,
|
|
60
|
+
PropertyFilterRuleOperator.LessOrEqual,
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
if (typename === appui_abstract_1.StandardTypeNames.String || typename === appui_abstract_1.StandardTypeNames.Text) {
|
|
64
|
+
return [
|
|
65
|
+
...operators,
|
|
66
|
+
PropertyFilterRuleOperator.Like,
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
return operators;
|
|
70
|
+
}
|
|
71
|
+
exports.getPropertyFilterOperators = getPropertyFilterOperators;
|
|
72
|
+
/* istanbul ignore next */
|
|
73
|
+
/** @alpha */
|
|
74
|
+
function getPropertyFilterOperatorLabel(operator) {
|
|
75
|
+
switch (operator) {
|
|
76
|
+
case PropertyFilterRuleOperator.IsTrue:
|
|
77
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.isTrue");
|
|
78
|
+
case PropertyFilterRuleOperator.IsFalse:
|
|
79
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.isFalse");
|
|
80
|
+
case PropertyFilterRuleOperator.IsEqual:
|
|
81
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.equal");
|
|
82
|
+
case PropertyFilterRuleOperator.IsNotEqual:
|
|
83
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.notEqual");
|
|
84
|
+
case PropertyFilterRuleOperator.Greater:
|
|
85
|
+
return ">";
|
|
86
|
+
case PropertyFilterRuleOperator.GreaterOrEqual:
|
|
87
|
+
return ">=";
|
|
88
|
+
case PropertyFilterRuleOperator.Less:
|
|
89
|
+
return "<";
|
|
90
|
+
case PropertyFilterRuleOperator.LessOrEqual:
|
|
91
|
+
return "<=";
|
|
92
|
+
case PropertyFilterRuleOperator.Like:
|
|
93
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.contains");
|
|
94
|
+
case PropertyFilterRuleOperator.IsNull:
|
|
95
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.isNull");
|
|
96
|
+
case PropertyFilterRuleOperator.IsNotNull:
|
|
97
|
+
return UiComponents_1.UiComponents.translate("filterBuilder.operators.isNotNull");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.getPropertyFilterOperatorLabel = getPropertyFilterOperatorLabel;
|
|
101
|
+
/** @alpha */
|
|
102
|
+
function isUnaryPropertyFilterOperator(operator) {
|
|
103
|
+
switch (operator) {
|
|
104
|
+
case PropertyFilterRuleOperator.IsTrue:
|
|
105
|
+
case PropertyFilterRuleOperator.IsFalse:
|
|
106
|
+
case PropertyFilterRuleOperator.IsNull:
|
|
107
|
+
case PropertyFilterRuleOperator.IsNotNull:
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
exports.isUnaryPropertyFilterOperator = isUnaryPropertyFilterOperator;
|
|
113
|
+
//# sourceMappingURL=Operators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operators.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/Operators.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,0DAA+E;AAC/E,kDAA+C;AAE/C,aAAa;AACb,IAAY,+BAGX;AAHD,WAAY,+BAA+B;IACzC,mFAAG,CAAA;IACH,iFAAE,CAAA;AACJ,CAAC,EAHW,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAG1C;AAED,aAAa;AACb,IAAY,0BAgBX;AAhBD,WAAY,0BAA0B;IACpC,+EAAM,CAAA;IACN,iFAAO,CAAA;IAEP,iFAAO,CAAA;IACP,uFAAU,CAAA;IAEV,iFAAO,CAAA;IACP,+FAAc,CAAA;IACd,2EAAI,CAAA;IACJ,yFAAW,CAAA;IAEX,2EAAI,CAAA;IAEJ,+EAAM,CAAA;IACN,sFAAS,CAAA;AACX,CAAC,EAhBW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAgBrC;AAED,aAAa;AACb,SAAgB,0BAA0B,CAAC,QAA6B;IACtE,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAEnC,IAAI,QAAQ,KAAK,kCAAiB,CAAC,IAAI,IAAI,QAAQ,KAAK,kCAAiB,CAAC,OAAO,EAAE;QACjF,OAAO;YACL,0BAA0B,CAAC,MAAM;YACjC,0BAA0B,CAAC,OAAO;SACnC,CAAC;KACH;IAED,MAAM,SAAS,GAAG;QAChB,0BAA0B,CAAC,OAAO;QAClC,0BAA0B,CAAC,UAAU;QACrC,0BAA0B,CAAC,MAAM;QACjC,0BAA0B,CAAC,SAAS;KACrC,CAAC;IAEF,IAAI,QAAQ,KAAK,kCAAiB,CAAC,MAAM;WACpC,QAAQ,KAAK,kCAAiB,CAAC,GAAG;WAClC,QAAQ,KA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,OAAO,GAAG,CAAC;QACb,KAAK,0BAA0B,CAAC,WAAW;YACzC,OAAO,IAAI,CAAC;QACd,KAAK,0BAA0B,CAAC,IAAI;YAClC,OAAO,2BAAY,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;QACpE,KAAK,0BAA0B,CAAC,MAAM;YACpC,OAAO,2BAAY,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC;QAClE,KAAK,0BAA0B,CAAC,SAAS;YACvC,OAAO,2BAAY,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;KACtE;AACH,CAAC;AAzBD,wEAyBC;AAED,aAAa;AACb,SAAgB,6BAA6B,CAAC,QAAoC;IAChF,QAAQ,QAAQ,EAAE;QAChB,KAAK,0BAA0B,CAAC,MAAM,CAAC;QACvC,KAAK,0BAA0B,CAAC,OAAO,CAAC;QACxC,KAAK,0BAA0B,CAAC,MAAM,CAAC;QACvC,KAAK,0BAA0B,CAAC,SAAS;YACvC,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AATD,sEASC","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\nimport { PropertyDescription, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"../UiComponents\";\r\n\r\n/** @alpha */\r\nexport enum PropertyFilterRuleGroupOperator {\r\n And,\r\n Or,\r\n}\r\n\r\n/** @alpha */\r\nexport enum PropertyFilterRuleOperator {\r\n IsTrue,\r\n IsFalse,\r\n\r\n IsEqual,\r\n IsNotEqual,\r\n\r\n Greater,\r\n GreaterOrEqual,\r\n Less,\r\n LessOrEqual,\r\n\r\n Like,\r\n\r\n IsNull,\r\n IsNotNull,\r\n}\r\n\r\n/** @alpha */\r\nexport function getPropertyFilterOperators(property: PropertyDescription) {\r\n const typename = property.typename;\r\n\r\n if (typename === StandardTypeNames.Bool || typename === StandardTypeNames.Boolean) {\r\n return [\r\n PropertyFilterRuleOperator.IsTrue,\r\n PropertyFilterRuleOperator.IsFalse,\r\n ];\r\n }\r\n\r\n const operators = [\r\n PropertyFilterRuleOperator.IsEqual,\r\n PropertyFilterRuleOperator.IsNotEqual,\r\n PropertyFilterRuleOperator.IsNull,\r\n PropertyFilterRuleOperator.IsNotNull,\r\n ];\r\n\r\n if (typename === StandardTypeNames.Number\r\n || typename === StandardTypeNames.Int\r\n || typename === StandardTypeNames.Integer\r\n || typename === StandardTypeNames.Double\r\n || typename === StandardTypeNames.Float\r\n || typename === StandardTypeNames.Hex\r\n || typename === StandardTypeNames.Hexadecimal\r\n || typename === StandardTypeNames.ShortDate\r\n || typename === StandardTypeNames.DateTime) {\r\n return [\r\n ...operators,\r\n PropertyFilterRuleOperator.Greater,\r\n PropertyFilterRuleOperator.GreaterOrEqual,\r\n PropertyFilterRuleOperator.Less,\r\n PropertyFilterRuleOperator.LessOrEqual,\r\n ];\r\n }\r\n\r\n if (typename === StandardTypeNames.String || typename === StandardTypeNames.Text) {\r\n return [\r\n ...operators,\r\n PropertyFilterRuleOperator.Like,\r\n ];\r\n }\r\n\r\n return operators;\r\n}\r\n\r\n/* istanbul ignore next */\r\n/** @alpha */\r\nexport function getPropertyFilterOperatorLabel(operator: PropertyFilterRuleOperator) {\r\n switch(operator) {\r\n case PropertyFilterRuleOperator.IsTrue:\r\n return UiComponents.translate(\"filterBuilder.operators.isTrue\");\r\n case PropertyFilterRuleOperator.IsFalse:\r\n return UiComponents.translate(\"filterBuilder.operators.isFalse\");\r\n case PropertyFilterRuleOperator.IsEqual:\r\n return UiComponents.translate(\"filterBuilder.operators.equal\");\r\n case PropertyFilterRuleOperator.IsNotEqual:\r\n return UiComponents.translate(\"filterBuilder.operators.notEqual\");\r\n case PropertyFilterRuleOperator.Greater:\r\n return \">\";\r\n case PropertyFilterRuleOperator.GreaterOrEqual:\r\n return \">=\";\r\n case PropertyFilterRuleOperator.Less:\r\n return \"<\";\r\n case PropertyFilterRuleOperator.LessOrEqual:\r\n return \"<=\";\r\n case PropertyFilterRuleOperator.Like:\r\n return UiComponents.translate(\"filterBuilder.operators.contains\");\r\n case PropertyFilterRuleOperator.IsNull:\r\n return UiComponents.translate(\"filterBuilder.operators.isNull\");\r\n case PropertyFilterRuleOperator.IsNotNull:\r\n return UiComponents.translate(\"filterBuilder.operators.isNotNull\");\r\n }\r\n}\r\n\r\n/** @alpha */\r\nexport function isUnaryPropertyFilterOperator(operator: PropertyFilterRuleOperator) {\r\n switch (operator) {\r\n case PropertyFilterRuleOperator.IsTrue:\r\n case PropertyFilterRuleOperator.IsFalse:\r\n case PropertyFilterRuleOperator.IsNull:\r\n case PropertyFilterRuleOperator.IsNotNull:\r\n return true;\r\n }\r\n return false;\r\n}\r\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PropertyDescription, PropertyValue } from "@itwin/appui-abstract";
|
|
2
|
+
import { PropertyFilterRuleGroupOperator, PropertyFilterRuleOperator } from "./Operators";
|
|
3
|
+
/** @alpha */
|
|
4
|
+
export declare type PropertyFilter = PropertyFilterRule | PropertyFilterRuleGroup;
|
|
5
|
+
/** @alpha */
|
|
6
|
+
export interface PropertyFilterRuleGroup {
|
|
7
|
+
operator: PropertyFilterRuleGroupOperator;
|
|
8
|
+
rules: Array<PropertyFilter>;
|
|
9
|
+
}
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export interface PropertyFilterRule {
|
|
12
|
+
property: PropertyDescription;
|
|
13
|
+
operator: PropertyFilterRuleOperator;
|
|
14
|
+
value?: PropertyValue;
|
|
15
|
+
}
|
|
16
|
+
/** @alpha */
|
|
17
|
+
export declare function isPropertyFilterRuleGroup(filter: PropertyFilter): filter is PropertyFilterRuleGroup;
|
|
18
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/Types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE1F,aAAa;AACb,oBAAY,cAAc,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AAE1E,aAAa;AACb,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;CAC9B;AAED,aAAa;AACb,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,EAAE,0BAA0B,CAAC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,aAAa;AACb,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,uBAAuB,CAEnG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPropertyFilterRuleGroup = void 0;
|
|
4
|
+
/** @alpha */
|
|
5
|
+
function isPropertyFilterRuleGroup(filter) {
|
|
6
|
+
return filter.rules !== undefined;
|
|
7
|
+
}
|
|
8
|
+
exports.isPropertyFilterRuleGroup = isPropertyFilterRuleGroup;
|
|
9
|
+
//# sourceMappingURL=Types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/Types.ts"],"names":[],"mappings":";;;AAuBA,aAAa;AACb,SAAgB,yBAAyB,CAAC,MAAsB;IAC9D,OAAQ,MAAc,CAAC,KAAK,KAAK,SAAS,CAAC;AAC7C,CAAC;AAFD,8DAEC","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\nimport { PropertyDescription, PropertyValue } from \"@itwin/appui-abstract\";\r\nimport { PropertyFilterRuleGroupOperator, PropertyFilterRuleOperator } from \"./Operators\";\r\n\r\n/** @alpha */\r\nexport type PropertyFilter = PropertyFilterRule | PropertyFilterRuleGroup;\r\n\r\n/** @alpha */\r\nexport interface PropertyFilterRuleGroup {\r\n operator: PropertyFilterRuleGroupOperator;\r\n rules: Array<PropertyFilter>;\r\n}\r\n\r\n/** @alpha */\r\nexport interface PropertyFilterRule {\r\n property: PropertyDescription;\r\n operator: PropertyFilterRuleOperator;\r\n value?: PropertyValue;\r\n}\r\n\r\n/** @alpha */\r\nexport function isPropertyFilterRuleGroup(filter: PropertyFilter): filter is PropertyFilterRuleGroup {\r\n return (filter as any).rules !== undefined;\r\n}\r\n"]}
|
|
@@ -66,6 +66,15 @@ export * from "./components-react/properties/renderers/value/MergedPropertyValue
|
|
|
66
66
|
export * from "./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer";
|
|
67
67
|
export * from "./components-react/properties/renderers/value/UrlPropertyValueRenderer";
|
|
68
68
|
export * from "./components-react/properties/renderers/value/WithContextStyle";
|
|
69
|
+
export * from "./components-react/filter-builder/FilterBuilder";
|
|
70
|
+
export * from "./components-react/filter-builder/FilterBuilderRule";
|
|
71
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleGroup";
|
|
72
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleOperator";
|
|
73
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleProperty";
|
|
74
|
+
export * from "./components-react/filter-builder/FilterBuilderRuleValue";
|
|
75
|
+
export * from "./components-react/filter-builder/FilterBuilderState";
|
|
76
|
+
export * from "./components-react/filter-builder/Operators";
|
|
77
|
+
export * from "./components-react/filter-builder/Types";
|
|
69
78
|
export * from "./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer";
|
|
70
79
|
export * from "./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer";
|
|
71
80
|
export * from "./components-react/properties/renderers/label/PropertyLabelRenderer";
|
|
@@ -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,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAEhE,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,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,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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AAC;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,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"}
|
|
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,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAEhE,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,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,iDAAiD,CAAC;AAChE,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,iDAA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derers/value/MergedProper
|
|
|
85
85
|
__exportStar(require("./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer"), exports);
|
|
86
86
|
__exportStar(require("./components-react/properties/renderers/value/UrlPropertyValueRenderer"), exports);
|
|
87
87
|
__exportStar(require("./components-react/properties/renderers/value/WithContextStyle"), exports);
|
|
88
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilder"), exports);
|
|
89
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRule"), exports);
|
|
90
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleGroup"), exports);
|
|
91
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleOperator"), exports);
|
|
92
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleProperty"), exports);
|
|
93
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderRuleValue"), exports);
|
|
94
|
+
__exportStar(require("./components-react/filter-builder/FilterBuilderState"), exports);
|
|
95
|
+
__exportStar(require("./components-react/filter-builder/Operators"), exports);
|
|
96
|
+
__exportStar(require("./components-react/filter-builder/Types"), exports);
|
|
88
97
|
__exportStar(require("./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer"), exports);
|
|
89
98
|
__exportStar(require("./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer"), exports);
|
|
90
99
|
__exportStar(require("./components-react/properties/renderers/label/PropertyLabelRenderer"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,2EAAyD;AACzD,+EAA6D;AAC7D,oFAAkE;AAClE,kFAAgE;AAEhE,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,oFAAkE;AAClE,kF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GAA2F;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,6EAA2D;AAC3D,mFAAiE;AACjE,2FAAyE;AACzE,2GAAyF;AACzF,2EAAyD;AACzD,+EAA6D;AAC7D,iFAA+D;AAC/D,gGAA8E;AAE9E,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,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","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// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\r\n\r\nexport { UiComponents } from \"./components-react/UiComponents\";\r\n\r\nexport * from \"./components-react/breadcrumb/Breadcrumb\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbPath\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbTreeUtils\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbDetails\";\r\n\r\nexport * from \"./components-react/common/Links\";\r\nexport * from \"./components-react/common/PageOptions\";\r\nexport * from \"./components-react/common/selection/SelectionModes\";\r\nexport * from \"./components-react/common/HighlightingComponentProps\";\r\nexport * from \"./components-react/common/HighlightedText\";\r\nexport * from \"./components-react/common/IImageLoader\";\r\nexport * from \"./components-react/common/selection/SelectionHandler\";\r\nexport * from \"./components-react/common/showhide/ShowHideDialog\";\r\nexport * from \"./components-react/common/showhide/ShowHideItem\";\r\nexport * from \"./components-react/common/showhide/ShowHideMenu\";\r\nexport * from \"./components-react/common/UseAsyncValue\";\r\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\r\nexport * from \"./components-react/common/DateUtils\";\r\n\r\nexport * from \"./components-react/converters/TypeConverter\";\r\nexport * from \"./components-react/converters/TypeConverterManager\";\r\nexport * from \"./components-react/converters/BooleanTypeConverter\";\r\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\r\nexport * from \"./components-react/converters/EnumTypeConverter\";\r\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\r\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\r\nexport * from \"./components-react/converters/NumericTypeConverter\";\r\nexport * from \"./components-react/converters/PointTypeConverter\";\r\nexport * from \"./components-react/converters/StringTypeConverter\";\r\nexport * from \"./components-react/converters/CompositeTypeConverter\";\r\n\r\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\r\n\r\nexport * from \"./components-react/datepicker/DateField\";\r\nexport * from \"./components-react/datepicker/DatePicker\";\r\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\r\nexport * from \"./components-react/datepicker/IntlFormatter\";\r\nexport * from \"./components-react/datepicker/TimeField\";\r\n\r\nexport * from \"./components-react/editors/BooleanEditor\";\r\nexport * from \"./components-react/editors/CustomNumberEditor\";\r\nexport * from \"./components-react/editors/DateTimeEditor\";\r\nexport * from \"./components-react/editors/EditorContainer\";\r\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\r\nexport * from \"./components-react/editors/EnumEditor\";\r\nexport * from \"./components-react/editors/IconEditor\";\r\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\r\nexport * from \"./components-react/editors/NumericInputEditor\";\r\nexport * from \"./components-react/editors/PropertyEditorManager\";\r\nexport * from \"./components-react/editors/SliderEditor\";\r\nexport * from \"./components-react/editors/TextEditor\";\r\nexport * from \"./components-react/editors/TextareaEditor\";\r\nexport * from \"./components-react/editors/ThemedEnumEditor\";\r\nexport * from \"./components-react/editors/ToggleEditor\";\r\n\r\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\r\nexport * from \"./components-react/favorite/FavoritePropertyList\";\r\n\r\nexport * from \"./components-react/filtering/FilteringInput\";\r\nexport * from \"./components-react/filtering/ResultSelector\";\r\n\r\nexport * from \"./components-react/iconpicker/IconPickerButton\";\r\n\r\nexport * from \"./components-react/inputs/ParsedInput\";\r\n\r\nexport * from \"./components-react/properties/LinkHandler\";\r\nexport * from \"./components-react/properties/ValueRendererManager\";\r\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyView\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\r\n\r\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\r\n\r\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\r\nexport * from \"./components-react/properties/ItemStyle\";\r\n\r\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\r\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\r\nexport * from \"./components-react/propertygrid/component/PropertyList\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\r\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\r\n\r\nexport * from \"./components-react/selectable-content/SelectableContent\";\r\n\r\nexport * from \"./components-react/table/TableDataProvider\";\r\nexport * from \"./components-react/table/SimpleTableDataProvider\";\r\nexport * from \"./components-react/table/columnfiltering/ColumnFiltering\";\r\nexport * from \"./components-react/table/columnfiltering/TableFilterDescriptorCollection\";\r\nexport * from \"./components-react/table/component/Table\";\r\nexport * from \"./components-react/table/component/TableCell\";\r\nexport * from \"./components-react/table/component/TableColumn\";\r\nexport * from \"./components-react/table/component/dragdrop/BeDragDropContext\";\r\n\r\nexport * from \"./components-react/toolbar/Toolbar\";\r\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\r\nexport * from \"./components-react/toolbar/PopupItem\";\r\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\r\nexport * from \"./components-react/toolbar/Item\";\r\nexport * from \"./components-react/toolbar/utilities/Direction\";\r\n\r\nexport * from \"./components-react/tree/TreeDataProvider\";\r\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\r\nexport * from \"./components-react/tree/HighlightingEngine\";\r\nexport * from \"./components-react/tree/ImageLoader\";\r\nexport * from \"./components-react/tree/controlled/TreeActions\";\r\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\r\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\r\nexport * from \"./components-react/tree/controlled/TreeEvents\";\r\nexport * from \"./components-react/tree/controlled/TreeModel\";\r\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\r\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\r\nexport * from \"./components-react/tree/controlled/Observable\";\r\nexport * from \"./components-react/tree/controlled/TreeHooks\";\r\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\r\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\r\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\r\n\r\n/** @docs-package-description\r\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\r\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description Breadcrumb\r\n * Classes and components for working with a Breadcrumb.\r\n * As of version 3.0, the Breadcrumb is deprecated.\r\n */\r\n/**\r\n * @docs-group-description Date\r\n * Classes, interfaces, and components for showing and setting date and time.\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes and Higher Order Components for working with the DragDrop API.\r\n */\r\n/**\r\n * @docs-group-description Favorite\r\n * Classes and components for displaying favorite properties.\r\n */\r\n/**\r\n * @docs-group-description Filtering\r\n * Classes and components for working with filtering.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Input Components that format and parse input.\r\n */\r\n/**\r\n * @docs-group-description SelectableContent\r\n * Classes and components for working with SelectableContent component.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes and components for working with Properties.\r\n */\r\n/**\r\n * @docs-group-description PropertyEditors\r\n * Classes and components for working with Property Editors.\r\n */\r\n/**\r\n * @docs-group-description PropertyGrid\r\n * Classes and components for working with a PropertyGrid.\r\n */\r\n/**\r\n * @docs-group-description Table\r\n * Classes and components for working with a Table.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Functions and components that provide a Toolbar.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Classes and components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description TypeConverters\r\n * Classes for working with Type Converters.\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"components-react.js","sourceRoot":"","sources":["../../src/components-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,qEAAqE;AAErE,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AAErB,2EAAyD;AACzD,+EAA6D;AAC7D,oFAAkE;AAClE,kFAAgE;AAEhE,kEAAgD;AAChD,wEAAsD;AACtD,qFAAmE;AACnE,uFAAqE;AACrE,4EAA0D;AAC1D,yEAAuD;AACvD,uFAAqE;AACrE,oFAAkE;AAClE,kFAAgE;AAChE,kFAAgE;AAChE,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;AAExE,0EAAwD;AACxD,2EAAyD;AACzD,sFAAoE;AACpE,8EAA4D;AAC5D,0EAAwD;AAExD,2EAAyD;AACzD,gFAA8D;AAC9D,4EAA0D;AAC1D,6EAA2D;AAC3D,mFAAiE;AACjE,wEAAsD;AACtD,wEAAsD;AACtD,iFAA+D;AAC/D,gFAA8D;AAC9D,mFAAiE;AACjE,0EAAwD;AACxD,wEAAsD;AACtD,4EAA0D;AAC1D,8EAA4D;AAC5D,0EAAwD;AAExD,yFAAuE;AACvE,mFAAiE;AAEjE,8EAA4D;AAC5D,8E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D,iFAA+D;AAC/D,yFAAuE;AACvE,sFAAoE;AACpE,gFAA8D;AAC9D,+EAA6D;AAC7D,qFAAmE;AACnE,oFAAkE;AAClE,gFAA8D;AAC9D,+EAA6D;AAC7D,8FAA4E;AAC5E,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","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// cSpell:ignore iconpicker lineweight hocs datepicker quantityformat\r\n\r\nexport { UiComponents } from \"./components-react/UiComponents\";\r\n\r\nexport * from \"./components-react/breadcrumb/Breadcrumb\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbPath\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbTreeUtils\";\r\nexport * from \"./components-react/breadcrumb/BreadcrumbDetails\";\r\n\r\nexport * from \"./components-react/common/Links\";\r\nexport * from \"./components-react/common/PageOptions\";\r\nexport * from \"./components-react/common/selection/SelectionModes\";\r\nexport * from \"./components-react/common/HighlightingComponentProps\";\r\nexport * from \"./components-react/common/HighlightedText\";\r\nexport * from \"./components-react/common/IImageLoader\";\r\nexport * from \"./components-react/common/selection/SelectionHandler\";\r\nexport * from \"./components-react/common/showhide/ShowHideDialog\";\r\nexport * from \"./components-react/common/showhide/ShowHideItem\";\r\nexport * from \"./components-react/common/showhide/ShowHideMenu\";\r\nexport * from \"./components-react/common/UseAsyncValue\";\r\nexport * from \"./components-react/common/UseDebouncedAsyncValue\";\r\nexport * from \"./components-react/common/DateUtils\";\r\n\r\nexport * from \"./components-react/converters/TypeConverter\";\r\nexport * from \"./components-react/converters/TypeConverterManager\";\r\nexport * from \"./components-react/converters/BooleanTypeConverter\";\r\nexport * from \"./components-react/converters/DateTimeTypeConverter\";\r\nexport * from \"./components-react/converters/EnumTypeConverter\";\r\nexport * from \"./components-react/converters/HexadecimalTypeConverter\";\r\nexport * from \"./components-react/converters/NavigationPropertyTypeConverter\";\r\nexport * from \"./components-react/converters/NumericTypeConverter\";\r\nexport * from \"./components-react/converters/PointTypeConverter\";\r\nexport * from \"./components-react/converters/StringTypeConverter\";\r\nexport * from \"./components-react/converters/CompositeTypeConverter\";\r\n\r\nexport * from \"./components-react/converters/valuetypes/ConvertedTypes\";\r\n\r\nexport * from \"./components-react/datepicker/DateField\";\r\nexport * from \"./components-react/datepicker/DatePicker\";\r\nexport * from \"./components-react/datepicker/DatePickerPopupButton\";\r\nexport * from \"./components-react/datepicker/IntlFormatter\";\r\nexport * from \"./components-react/datepicker/TimeField\";\r\n\r\nexport * from \"./components-react/editors/BooleanEditor\";\r\nexport * from \"./components-react/editors/CustomNumberEditor\";\r\nexport * from \"./components-react/editors/DateTimeEditor\";\r\nexport * from \"./components-react/editors/EditorContainer\";\r\nexport * from \"./components-react/editors/EnumButtonGroupEditor\";\r\nexport * from \"./components-react/editors/EnumEditor\";\r\nexport * from \"./components-react/editors/IconEditor\";\r\nexport * from \"./components-react/editors/ImageCheckBoxEditor\";\r\nexport * from \"./components-react/editors/NumericInputEditor\";\r\nexport * from \"./components-react/editors/PropertyEditorManager\";\r\nexport * from \"./components-react/editors/SliderEditor\";\r\nexport * from \"./components-react/editors/TextEditor\";\r\nexport * from \"./components-react/editors/TextareaEditor\";\r\nexport * from \"./components-react/editors/ThemedEnumEditor\";\r\nexport * from \"./components-react/editors/ToggleEditor\";\r\n\r\nexport * from \"./components-react/favorite/FavoritePropertiesRenderer\";\r\nexport * from \"./components-react/favorite/FavoritePropertyList\";\r\n\r\nexport * from \"./components-react/filtering/FilteringInput\";\r\nexport * from \"./components-react/filtering/ResultSelector\";\r\n\r\nexport * from \"./components-react/iconpicker/IconPickerButton\";\r\n\r\nexport * from \"./components-react/inputs/ParsedInput\";\r\n\r\nexport * from \"./components-react/properties/LinkHandler\";\r\nexport * from \"./components-react/properties/ValueRendererManager\";\r\nexport * from \"./components-react/properties/renderers/NonPrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PrimitivePropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyRenderer\";\r\nexport * from \"./components-react/properties/renderers/PropertyView\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonList\";\r\nexport * from \"./components-react/properties/renderers/ActionButtonRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MergedPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/MultilineTextPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/UrlPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/WithContextStyle\";\r\n\r\nexport * from \"./components-react/filter-builder/FilterBuilder\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRule\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleGroup\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleOperator\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleProperty\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderRuleValue\";\r\nexport * from \"./components-react/filter-builder/FilterBuilderState\";\r\nexport * from \"./components-react/filter-builder/Operators\";\r\nexport * from \"./components-react/filter-builder/Types\";\r\n\r\nexport * from \"./components-react/properties/renderers/label/NonPrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PrimitivePropertyLabelRenderer\";\r\nexport * from \"./components-react/properties/renderers/label/PropertyLabelRenderer\";\r\n\r\nexport * from \"./components-react/properties/renderers/value/PrimitivePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/ArrayPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/StructPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/DoublePropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/NavigationPropertyValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/ArrayValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/StructValueRenderer\";\r\nexport * from \"./components-react/properties/renderers/value/table/NonPrimitiveValueRenderer\";\r\nexport * from \"./components-react/properties/ItemStyle\";\r\n\r\nexport * from \"./components-react/propertygrid/PropertyCategoryRendererManager\";\r\nexport * from \"./components-react/propertygrid/PropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/SimplePropertyDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGrid\";\r\nexport * from \"./components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider\";\r\nexport * from \"./components-react/propertygrid/component/PropertyCategoryBlock\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridEventsRelatedPropsSupplier\";\r\nexport * from \"./components-react/propertygrid/component/PropertyGridCommons\";\r\nexport * from \"./components-react/propertygrid/component/PropertyList\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/FlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableFlatGridItem\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridCategory\";\r\nexport * from \"./components-react/propertygrid/internal/flat-items/MutableGridItemFactory\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridEventHandler\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridHooks\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModel\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelChangeEvent\";\r\nexport * from \"./components-react/propertygrid/internal/PropertyGridModelSource\";\r\nexport * from \"./components-react/propertygrid/dataproviders/FilteringDataProvider\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer\";\r\nexport * from \"./components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase\";\r\n\r\nexport * from \"./components-react/selectable-content/SelectableContent\";\r\n\r\nexport * from \"./components-react/table/TableDataProvider\";\r\nexport * from \"./components-react/table/SimpleTableDataProvider\";\r\nexport * from \"./components-react/table/columnfiltering/ColumnFiltering\";\r\nexport * from \"./components-react/table/columnfiltering/TableFilterDescriptorCollection\";\r\nexport * from \"./components-react/table/component/Table\";\r\nexport * from \"./components-react/table/component/TableCell\";\r\nexport * from \"./components-react/table/component/TableColumn\";\r\nexport * from \"./components-react/table/component/dragdrop/BeDragDropContext\";\r\n\r\nexport * from \"./components-react/toolbar/Toolbar\";\r\nexport * from \"./components-react/toolbar/ToolbarWithOverflow\";\r\nexport * from \"./components-react/toolbar/PopupItem\";\r\nexport * from \"./components-react/toolbar/PopupItemWithDrag\";\r\nexport * from \"./components-react/toolbar/Item\";\r\nexport * from \"./components-react/toolbar/utilities/Direction\";\r\n\r\nexport * from \"./components-react/tree/TreeDataProvider\";\r\nexport * from \"./components-react/tree/SimpleTreeDataProvider\";\r\nexport * from \"./components-react/tree/HighlightingEngine\";\r\nexport * from \"./components-react/tree/ImageLoader\";\r\nexport * from \"./components-react/tree/controlled/TreeActions\";\r\nexport * from \"./components-react/tree/controlled/TreeEventDispatcher\";\r\nexport * from \"./components-react/tree/controlled/TreeEventHandler\";\r\nexport * from \"./components-react/tree/controlled/TreeEvents\";\r\nexport * from \"./components-react/tree/controlled/TreeModel\";\r\nexport * from \"./components-react/tree/controlled/TreeModelSource\";\r\nexport * from \"./components-react/tree/controlled/TreeNodeLoader\";\r\nexport * from \"./components-react/tree/controlled/Observable\";\r\nexport * from \"./components-react/tree/controlled/TreeHooks\";\r\nexport * from \"./components-react/tree/controlled/component/ControlledTree\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeEditor\";\r\nexport * from \"./components-react/tree/controlled/component/TreeNodeRenderer\";\r\nexport * from \"./components-react/tree/controlled/component/TreeRenderer\";\r\nexport * from \"./components-react/tree/controlled/internal/SparseTree\";\r\n\r\n/** @docs-package-description\r\n * The components-react package contains React components that are data-oriented, such as PropertyGrid, Table and Tree.\r\n * For more information, see [learning about components-react]($docs/learning/ui/components/index.md).\r\n */\r\n/**\r\n * @docs-group-description Common\r\n * Common classes used across various UI components.\r\n */\r\n/**\r\n * @docs-group-description Breadcrumb\r\n * Classes and components for working with a Breadcrumb.\r\n * As of version 3.0, the Breadcrumb is deprecated.\r\n */\r\n/**\r\n * @docs-group-description Date\r\n * Classes, interfaces, and components for showing and setting date and time.\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes and Higher Order Components for working with the DragDrop API.\r\n */\r\n/**\r\n * @docs-group-description Favorite\r\n * Classes and components for displaying favorite properties.\r\n */\r\n/**\r\n * @docs-group-description Filtering\r\n * Classes and components for working with filtering.\r\n */\r\n/**\r\n * @docs-group-description Inputs\r\n * Input Components that format and parse input.\r\n */\r\n/**\r\n * @docs-group-description SelectableContent\r\n * Classes and components for working with SelectableContent component.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes and components for working with Properties.\r\n */\r\n/**\r\n * @docs-group-description PropertyEditors\r\n * Classes and components for working with Property Editors.\r\n */\r\n/**\r\n * @docs-group-description PropertyGrid\r\n * Classes and components for working with a PropertyGrid.\r\n */\r\n/**\r\n * @docs-group-description Table\r\n * Classes and components for working with a Table.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Functions and components that provide a Toolbar.\r\n */\r\n/**\r\n * @docs-group-description Tree\r\n * Classes and components for working with a Tree.\r\n */\r\n/**\r\n * @docs-group-description TypeConverters\r\n * Classes for working with Type Converters.\r\n */\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components-react/editors/DateTimeEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACiB,aAAa,EAA0C,WAAW,EACzF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAyB,MAAM,yBAAyB,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAS5D,gBAAgB;AAChB,UAAU,mBAAmB;IAC3B,KAAK,EAAE,IAAI,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,gBAAgB;AAChB,UAAU,mBAAoB,SAAQ,mBAAmB;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,mBAAmB,CAAE,YAAW,UAAU;IACrH,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAqC;IAExD,gBAAgB;IAChB,SAAyB,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,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{
|
|
|
155
155
|
initialValue = new Date(record.value.value);
|
|
156
156
|
else if (typeof record.value.value === "string")
|
|
157
157
|
initialValue = new Date(record.value.value);
|
|
158
|
+
else if (record.value.value === undefined)
|
|
159
|
+
initialValue = new Date();
|
|
158
160
|
typeConverter = TypeConverterManager.getConverter(record.property.typename, (_a = record.property.converter) === null || _a === void 0 ? void 0 : _a.name);
|
|
159
161
|
const options = (_b = record.property.converter) === null || _b === void 0 ? void 0 : _b.options;
|
|
160
162
|
if (options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/DateTimeEditor.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,oBAAoB,EAAiB,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,GACzF,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,SAAS,EAAY,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAmB3D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAuD;IAAjG;;QACU,eAAU,GAAG,KAAK,CAAC;QACnB,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;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC/F,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyEditors\r\n */\r\n\r\nimport \"./DateTimeEditor.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n AlternateDateFormats, PropertyValue, PropertyValueFormat, StandardTypeNames, TimeDisplay,\r\n} from \"@itwin/appui-abstract\";\r\nimport { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\r\nimport { PropertyEditorBase, PropertyEditorManager } from \"./PropertyEditorManager\";\r\nimport { PopupButton, PopupContent, PopupOkCancelButtons } from \"./PopupButton\";\r\nimport { TimeField, TimeSpec } from \"../datepicker/TimeField\";\r\nimport { TypeConverter } from \"../converters/TypeConverter\";\r\nimport { DatePicker } from \"../datepicker/DatePicker\";\r\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\r\nimport { DateTimeTypeConverterBase } from \"../converters/DateTimeTypeConverter\";\r\nimport { BodyText } from \"@itwin/core-react\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\n\r\n// cSpell:ignore datepicker\r\n\r\n/** @internal */\r\ninterface DateTimeEditorState {\r\n value: Date;\r\n displayValue?: string;\r\n timeDisplay?: TimeDisplay;\r\n isDisabled?: boolean;\r\n typeConverter?: TypeConverter;\r\n editInUtc: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface DateTimeEditorProps extends PropertyEditorProps {\r\n showTime?: boolean;\r\n}\r\n\r\n/** DateTimeEditor React component that is a property editor for selection of date and time.\r\n * @internal\r\n */\r\nexport class DateTimeEditor extends React.PureComponent<DateTimeEditorProps, DateTimeEditorState> implements TypeEditor {\r\n private _isMounted = false;\r\n private _enterKey = false;\r\n private _divElement = React.createRef<HTMLDivElement>();\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DateTimeEditorState> = {\r\n value: new Date(),\r\n editInUtc: false,\r\n };\r\n\r\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\r\n const record = this.props.propertyRecord;\r\n let propertyValue: PropertyValue | undefined;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n propertyValue = {\r\n valueFormat: PropertyValueFormat.Primitive,\r\n value: this.state.value,\r\n displayValue: this.state.displayValue,\r\n };\r\n }\r\n\r\n return propertyValue;\r\n }\r\n\r\n public get htmlElement(): HTMLElement | null {\r\n return this._divElement.current;\r\n }\r\n\r\n public get hasFocus(): boolean {\r\n let containsFocus = false;\r\n // istanbul ignore else\r\n if (this.htmlElement)\r\n containsFocus = this.htmlElement.contains(document.activeElement);\r\n return containsFocus;\r\n }\r\n\r\n public async processDateChange(typeConverter: TypeConverter, newValue: Date): Promise<void> {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord) {\r\n const displayValue = await typeConverter.convertPropertyToString(this.props.propertyRecord.property, newValue);\r\n this.setState({\r\n value: newValue,\r\n displayValue,\r\n });\r\n }\r\n }\r\n\r\n private _handleChange = (newValue: Date): void => {\r\n // istanbul ignore else\r\n if (this._isMounted && this.state.typeConverter) {\r\n // istanbul ignore else\r\n if (this.state.editInUtc) {\r\n newValue = adjustDateToTimezone(newValue, newValue.getTimezoneOffset() * -1);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.processDateChange(this.state.typeConverter, newValue);\r\n }\r\n };\r\n\r\n private _handleTimeChange = (time: TimeSpec): void => {\r\n // Combine new time into selected Date\r\n if (this.state.editInUtc) {\r\n const newWorkingDate = adjustDateToTimezone(this.state.value, 0);\r\n newWorkingDate.setUTCHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n } else {\r\n const newWorkingDate = new Date(this.state.value.getTime());\r\n newWorkingDate.setHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\r\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n }\r\n\r\n private async setStateFromProps() {\r\n const record = this.props.propertyRecord;\r\n let initialValue: Date | undefined;\r\n let typeConverter: TypeConverter | undefined;\r\n let timeDisplay: TimeDisplay | undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n let editInUtc = false;\r\n\r\n // istanbul ignore else\r\n if (this.props.showTime)\r\n timeDisplay = TimeDisplay.H12MC;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n // istanbul ignore else\r\n if (record.value.value instanceof Date)\r\n initialValue = new Date(record.value.value);\r\n else if (typeof record.value.value === \"string\")\r\n initialValue = new Date(record.value.value);\r\n\r\n typeConverter = TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name);\r\n\r\n const options = record.property.converter?.options;\r\n if (options) {\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options) {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n timeDisplay = TimeDisplay.H24MS;\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n }\r\n\r\n if (\"timeDisplay\" in options && this.props.showTime) {\r\n timeDisplay = options.timeDisplay;\r\n // use 24 hr time display if alternateDateFormat is defined\r\n // istanbul ignore next\r\n if (alternateDateFormat && timeDisplay !== TimeDisplay.H24MS && timeDisplay !== TimeDisplay.H24M)\r\n timeDisplay = TimeDisplay.H24MS;\r\n }\r\n\r\n // istanbul ignore else\r\n if (alternateDateFormat) {\r\n editInUtc = true;\r\n\r\n if (this.props.showTime) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort) {\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n }\r\n } else {\r\n timeDisplay = undefined;\r\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\r\n alternateDateFormat = AlternateDateFormats.IsoShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\r\n alternateDateFormat = AlternateDateFormats.UtcShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // istanbul ignore next\r\n if (!initialValue) {\r\n throw new Error(\"Bad Value\");\r\n }\r\n\r\n // istanbul ignore next\r\n if (!typeConverter) {\r\n throw new Error(\"Unable to determine TypeConverter\");\r\n }\r\n\r\n const isDisabled = record && !!record.isDisabled;\r\n const displayValue = await typeConverter.convertPropertyToString(record!.property, initialValue);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({\r\n value: initialValue,\r\n isDisabled,\r\n timeDisplay,\r\n typeConverter,\r\n displayValue,\r\n editInUtc,\r\n });\r\n }\r\n\r\n private _handleEnter = async (): Promise<void> => {\r\n this._enterKey = true;\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleClose = async (): Promise<void> => {\r\n if (this._enterKey) {\r\n this._enterKey = false;\r\n } else {\r\n // istanbul ignore next\r\n if (this.props.onCancel)\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleCancel = (_event: React.MouseEvent): void => {\r\n // istanbul ignore else\r\n if (this.props.onCancel) {\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleCommit = async (): Promise<void> => {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord && this.props.onCommit) {\r\n const propertyValue = await this.getPropertyValue();\r\n // istanbul ignore else\r\n if (propertyValue !== undefined) {\r\n this.props.onCommit({ propertyRecord: this.props.propertyRecord, newValue: propertyValue });\r\n }\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override render(): React.ReactNode {\r\n const date = this.state.editInUtc ? adjustDateToTimezone(this.state.value, 0) : this.state.value;\r\n const timeSpec: TimeSpec = {\r\n hours: date.getHours(),\r\n minutes: date.getMinutes(),\r\n seconds: date.getSeconds(),\r\n };\r\n\r\n const className = classnames(\"components-cell-editor\", \"components-datetime-editor\", this.props.className);\r\n\r\n return (\r\n <div className={className} ref={this._divElement}>\r\n <PopupButton label={this.state.displayValue} onClose={this._handleClose} onEnter={this._handleEnter}\r\n setFocus={this.props.setFocus}>\r\n <PopupContent>\r\n <>\r\n <div className=\"components-date-picker-calendar-popup-panel\" data-testid=\"components-date-picker-calendar-popup-panel\">\r\n <DatePicker selected={date} onDateChange={this._handleChange} showFocusOutline={false} />\r\n {this.state.timeDisplay &&\r\n <div className=\"time-container\">\r\n <BodyText className=\"time-label\">{\"Time\"}</BodyText>\r\n <TimeField time={timeSpec} timeDisplay={this.state.timeDisplay} onTimeChange={this._handleTimeChange} />\r\n </div>\r\n }\r\n </div>\r\n </>\r\n <PopupOkCancelButtons onOk={this._handleOk} onCancel={this._handleCancel} />\r\n </PopupContent>\r\n </PopupButton>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class ShortDateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={false} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class DateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={true} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\nPropertyEditorManager.registerEditor(StandardTypeNames.ShortDate, ShortDateTimePropertyEditor);\r\nPropertyEditorManager.registerEditor(StandardTypeNames.DateTime, DateTimePropertyEditor);\r\n"]}
|
|
1
|
+
{"version":3,"file":"DateTimeEditor.js","sourceRoot":"","sources":["../../../../src/components-react/editors/DateTimeEditor.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,oBAAoB,EAAiB,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,GACzF,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,SAAS,EAAY,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,M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AM,OAAO,2BAA4B,SAAQ,kBAAkB;IACjE,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,KAAK,GAAI,CAAC;IAC7C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,IAAW,SAAS;QAClB,OAAO,oBAAC,cAAc,IAAC,QAAQ,EAAE,IAAI,GAAI,CAAC;IAC5C,CAAC;IACD,uBAAuB;IACvB,IAAoB,mBAAmB;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC;AAC/F,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyEditors\r\n */\r\n\r\nimport \"./DateTimeEditor.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport {\r\n AlternateDateFormats, PropertyValue, PropertyValueFormat, StandardTypeNames, TimeDisplay,\r\n} from \"@itwin/appui-abstract\";\r\nimport { PropertyEditorProps, TypeEditor } from \"./EditorContainer\";\r\nimport { PropertyEditorBase, PropertyEditorManager } from \"./PropertyEditorManager\";\r\nimport { PopupButton, PopupContent, PopupOkCancelButtons } from \"./PopupButton\";\r\nimport { TimeField, TimeSpec } from \"../datepicker/TimeField\";\r\nimport { TypeConverter } from \"../converters/TypeConverter\";\r\nimport { DatePicker } from \"../datepicker/DatePicker\";\r\nimport { TypeConverterManager } from \"../converters/TypeConverterManager\";\r\nimport { DateTimeTypeConverterBase } from \"../converters/DateTimeTypeConverter\";\r\nimport { BodyText } from \"@itwin/core-react\";\r\nimport { adjustDateToTimezone } from \"../common/DateUtils\";\r\n\r\n// cSpell:ignore datepicker\r\n\r\n/** @internal */\r\ninterface DateTimeEditorState {\r\n value: Date;\r\n displayValue?: string;\r\n timeDisplay?: TimeDisplay;\r\n isDisabled?: boolean;\r\n typeConverter?: TypeConverter;\r\n editInUtc: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface DateTimeEditorProps extends PropertyEditorProps {\r\n showTime?: boolean;\r\n}\r\n\r\n/** DateTimeEditor React component that is a property editor for selection of date and time.\r\n * @internal\r\n */\r\nexport class DateTimeEditor extends React.PureComponent<DateTimeEditorProps, DateTimeEditorState> implements TypeEditor {\r\n private _isMounted = false;\r\n private _enterKey = false;\r\n private _divElement = React.createRef<HTMLDivElement>();\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<DateTimeEditorState> = {\r\n value: new Date(),\r\n editInUtc: false,\r\n };\r\n\r\n public async getPropertyValue(): Promise<PropertyValue | undefined> {\r\n const record = this.props.propertyRecord;\r\n let propertyValue: PropertyValue | undefined;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n propertyValue = {\r\n valueFormat: PropertyValueFormat.Primitive,\r\n value: this.state.value,\r\n displayValue: this.state.displayValue,\r\n };\r\n }\r\n\r\n return propertyValue;\r\n }\r\n\r\n public get htmlElement(): HTMLElement | null {\r\n return this._divElement.current;\r\n }\r\n\r\n public get hasFocus(): boolean {\r\n let containsFocus = false;\r\n // istanbul ignore else\r\n if (this.htmlElement)\r\n containsFocus = this.htmlElement.contains(document.activeElement);\r\n return containsFocus;\r\n }\r\n\r\n public async processDateChange(typeConverter: TypeConverter, newValue: Date): Promise<void> {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord) {\r\n const displayValue = await typeConverter.convertPropertyToString(this.props.propertyRecord.property, newValue);\r\n this.setState({\r\n value: newValue,\r\n displayValue,\r\n });\r\n }\r\n }\r\n\r\n private _handleChange = (newValue: Date): void => {\r\n // istanbul ignore else\r\n if (this._isMounted && this.state.typeConverter) {\r\n // istanbul ignore else\r\n if (this.state.editInUtc) {\r\n newValue = adjustDateToTimezone(newValue, newValue.getTimezoneOffset() * -1);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.processDateChange(this.state.typeConverter, newValue);\r\n }\r\n };\r\n\r\n private _handleTimeChange = (time: TimeSpec): void => {\r\n // Combine new time into selected Date\r\n if (this.state.editInUtc) {\r\n const newWorkingDate = adjustDateToTimezone(this.state.value, 0);\r\n newWorkingDate.setUTCHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n } else {\r\n const newWorkingDate = new Date(this.state.value.getTime());\r\n newWorkingDate.setHours(time.hours, time.minutes, time.seconds);\r\n this._handleChange(newWorkingDate);\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: PropertyEditorProps) {\r\n if (this.props.propertyRecord !== prevProps.propertyRecord) {\r\n this.setStateFromProps(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n }\r\n\r\n private async setStateFromProps() {\r\n const record = this.props.propertyRecord;\r\n let initialValue: Date | undefined;\r\n let typeConverter: TypeConverter | undefined;\r\n let timeDisplay: TimeDisplay | undefined;\r\n let alternateDateFormat = AlternateDateFormats.None;\r\n let editInUtc = false;\r\n\r\n // istanbul ignore else\r\n if (this.props.showTime)\r\n timeDisplay = TimeDisplay.H12MC;\r\n\r\n // istanbul ignore else\r\n if (record && record.value.valueFormat === PropertyValueFormat.Primitive) {\r\n // istanbul ignore else\r\n if (record.value.value instanceof Date)\r\n initialValue = new Date(record.value.value);\r\n else if (typeof record.value.value === \"string\")\r\n initialValue = new Date(record.value.value);\r\n else if (record.value.value === undefined)\r\n initialValue = new Date();\r\n\r\n typeConverter = TypeConverterManager.getConverter(record.property.typename, record.property.converter?.name);\r\n\r\n const options = record.property.converter?.options;\r\n if (options) {\r\n // istanbul ignore else\r\n if (\"alternateDateFormat\" in options) {\r\n // istanbul ignore else\r\n if (DateTimeTypeConverterBase.isAlternateDateFormats(options.alternateDateFormat)) {\r\n timeDisplay = TimeDisplay.H24MS;\r\n alternateDateFormat = options.alternateDateFormat;\r\n }\r\n }\r\n\r\n if (\"timeDisplay\" in options && this.props.showTime) {\r\n timeDisplay = options.timeDisplay;\r\n // use 24 hr time display if alternateDateFormat is defined\r\n // istanbul ignore next\r\n if (alternateDateFormat && timeDisplay !== TimeDisplay.H24MS && timeDisplay !== TimeDisplay.H24M)\r\n timeDisplay = TimeDisplay.H24MS;\r\n }\r\n\r\n // istanbul ignore else\r\n if (alternateDateFormat) {\r\n editInUtc = true;\r\n\r\n if (this.props.showTime) {\r\n if (alternateDateFormat === AlternateDateFormats.IsoShort) {\r\n alternateDateFormat = AlternateDateFormats.IsoDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShort) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTime;\r\n }\r\n if (alternateDateFormat === AlternateDateFormats.UtcShortWithDay) {\r\n alternateDateFormat = AlternateDateFormats.UtcDateTimeWithDay;\r\n }\r\n } else {\r\n timeDisplay = undefined;\r\n if (alternateDateFormat === AlternateDateFormats.IsoDateTime)\r\n alternateDateFormat = AlternateDateFormats.IsoShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTime)\r\n alternateDateFormat = AlternateDateFormats.UtcShort;\r\n if (alternateDateFormat === AlternateDateFormats.UtcDateTimeWithDay)\r\n alternateDateFormat = AlternateDateFormats.UtcShortWithDay;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // istanbul ignore next\r\n if (!initialValue) {\r\n throw new Error(\"Bad Value\");\r\n }\r\n\r\n // istanbul ignore next\r\n if (!typeConverter) {\r\n throw new Error(\"Unable to determine TypeConverter\");\r\n }\r\n\r\n const isDisabled = record && !!record.isDisabled;\r\n const displayValue = await typeConverter.convertPropertyToString(record!.property, initialValue);\r\n\r\n // istanbul ignore else\r\n if (this._isMounted)\r\n this.setState({\r\n value: initialValue,\r\n isDisabled,\r\n timeDisplay,\r\n typeConverter,\r\n displayValue,\r\n editInUtc,\r\n });\r\n }\r\n\r\n private _handleEnter = async (): Promise<void> => {\r\n this._enterKey = true;\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleClose = async (): Promise<void> => {\r\n if (this._enterKey) {\r\n this._enterKey = false;\r\n } else {\r\n // istanbul ignore next\r\n if (this.props.onCancel)\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleOk = async (_event: React.MouseEvent): Promise<void> => {\r\n await this._handleCommit();\r\n };\r\n\r\n private _handleCancel = (_event: React.MouseEvent): void => {\r\n // istanbul ignore else\r\n if (this.props.onCancel) {\r\n this.props.onCancel();\r\n }\r\n };\r\n\r\n private _handleCommit = async (): Promise<void> => {\r\n // istanbul ignore else\r\n if (this.props.propertyRecord && this.props.onCommit) {\r\n const propertyValue = await this.getPropertyValue();\r\n // istanbul ignore else\r\n if (propertyValue !== undefined) {\r\n this.props.onCommit({ propertyRecord: this.props.propertyRecord, newValue: propertyValue });\r\n }\r\n }\r\n };\r\n\r\n /** @internal */\r\n public override render(): React.ReactNode {\r\n const date = this.state.editInUtc ? adjustDateToTimezone(this.state.value, 0) : this.state.value;\r\n const timeSpec: TimeSpec = {\r\n hours: date.getHours(),\r\n minutes: date.getMinutes(),\r\n seconds: date.getSeconds(),\r\n };\r\n\r\n const className = classnames(\"components-cell-editor\", \"components-datetime-editor\", this.props.className);\r\n\r\n return (\r\n <div className={className} ref={this._divElement}>\r\n <PopupButton label={this.state.displayValue} onClose={this._handleClose} onEnter={this._handleEnter}\r\n setFocus={this.props.setFocus}>\r\n <PopupContent>\r\n <>\r\n <div className=\"components-date-picker-calendar-popup-panel\" data-testid=\"components-date-picker-calendar-popup-panel\">\r\n <DatePicker selected={date} onDateChange={this._handleChange} showFocusOutline={false} />\r\n {this.state.timeDisplay &&\r\n <div className=\"time-container\">\r\n <BodyText className=\"time-label\">{\"Time\"}</BodyText>\r\n <TimeField time={timeSpec} timeDisplay={this.state.timeDisplay} onTimeChange={this._handleTimeChange} />\r\n </div>\r\n }\r\n </div>\r\n </>\r\n <PopupOkCancelButtons onOk={this._handleOk} onCancel={this._handleCancel} />\r\n </PopupContent>\r\n </PopupButton>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class ShortDateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={false} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\n/** DateTime Property Editor registered for the \"number\" type name and \"DateTime\" editor name.\r\n * It uses the [[DateTimeEditor]] React component.\r\n * @internal\r\n */\r\nexport class DateTimePropertyEditor extends PropertyEditorBase {\r\n public get reactNode(): React.ReactNode {\r\n return <DateTimeEditor showTime={true} />;\r\n }\r\n // istanbul ignore next\r\n public override get containerHandlesTab(): boolean {\r\n return false;\r\n }\r\n}\r\n\r\nPropertyEditorManager.registerEditor(StandardTypeNames.ShortDate, ShortDateTimePropertyEditor);\r\nPropertyEditorManager.registerEditor(StandardTypeNames.DateTime, DateTimePropertyEditor);\r\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropertyDescription } from "@itwin/appui-abstract";
|
|
3
|
+
import { PropertyFilterBuilderRuleOperatorProps } from "./FilterBuilderRuleOperator";
|
|
4
|
+
import { PropertyFilterBuilderRuleValueProps } from "./FilterBuilderRuleValue";
|
|
5
|
+
import { PropertyFilterBuilderActions, PropertyFilterBuilderRuleGroupItem } from "./FilterBuilderState";
|
|
6
|
+
import { PropertyFilter } from "./Types";
|
|
7
|
+
/** @alpha */
|
|
8
|
+
export interface PropertyFilterBuilderProps {
|
|
9
|
+
properties: PropertyDescription[];
|
|
10
|
+
onFilterChanged: (filter?: PropertyFilter) => void;
|
|
11
|
+
onRulePropertySelected?: (property: PropertyDescription) => void;
|
|
12
|
+
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
13
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueProps) => React.ReactNode;
|
|
14
|
+
ruleGroupDepthLimit?: number;
|
|
15
|
+
}
|
|
16
|
+
/** @alpha */
|
|
17
|
+
export interface PropertyFilterBuilderContextProps {
|
|
18
|
+
actions: PropertyFilterBuilderActions;
|
|
19
|
+
properties: PropertyDescription[];
|
|
20
|
+
onRulePropertySelected?: (property: PropertyDescription) => void;
|
|
21
|
+
ruleGroupDepthLimit?: number;
|
|
22
|
+
}
|
|
23
|
+
/** @alpha */
|
|
24
|
+
export declare const PropertyFilterBuilderContext: React.Context<PropertyFilterBuilderContextProps>;
|
|
25
|
+
/** @alpha */
|
|
26
|
+
export interface PropertyFilterBuilderRuleRenderingContextProps {
|
|
27
|
+
ruleOperatorRenderer?: (props: PropertyFilterBuilderRuleOperatorProps) => React.ReactNode;
|
|
28
|
+
ruleValueRenderer?: (props: PropertyFilterBuilderRuleValueProps) => React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/** @alpha */
|
|
31
|
+
export declare const PropertyFilterBuilderRuleRenderingContext: React.Context<PropertyFilterBuilderRuleRenderingContextProps>;
|
|
32
|
+
/** @alpha */
|
|
33
|
+
export declare function PropertyFilterBuilder(props: PropertyFilterBuilderProps): JSX.Element;
|
|
34
|
+
/** @internal */
|
|
35
|
+
export declare function buildPropertyFilter(groupItem: PropertyFilterBuilderRuleGroupItem): PropertyFilter | undefined;
|
|
36
|
+
//# sourceMappingURL=FilterBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilder.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAuB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAC6B,4BAA4B,EAC9D,kCAAkC,EACnC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,aAAa;AACb,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,sCAAsC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1F,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,KAAK,CAAC,SAAS,CAAC;IACpF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,aAAa;AACb,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,4BAA4B,CAAC;IACtC,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,aAAa;AACb,eAAO,MAAM,4BAA4B,kDAAgE,CAAC;AAE1G,aAAa;AACb,MAAM,WAAW,8CAA8C;IAC7D,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,sCAAsC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1F,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,mCAAmC,KAAK,KAAK,CAAC,SAAS,CAAC;CACrF;AAED,aAAa;AACb,eAAO,MAAM,yCAAyC,+DAA0E,CAAC;AAIjI,aAAa;AACb,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eA6BtE;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,kCAAkC,GAAG,cAAc,GAAG,SAAS,CAI7G"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
import * as React from "react";
|
|
6
|
+
import { PropertyValueFormat } from "@itwin/appui-abstract";
|
|
7
|
+
import { ActiveRuleGroupContext, PropertyFilterBuilderRuleGroupRenderer } from "./FilterBuilderRuleGroup";
|
|
8
|
+
import { isPropertyFilterBuilderRuleGroup, usePropertyFilterBuilderState, } from "./FilterBuilderState";
|
|
9
|
+
import { isUnaryPropertyFilterOperator } from "./Operators";
|
|
10
|
+
/** @alpha */
|
|
11
|
+
export const PropertyFilterBuilderContext = React.createContext(null);
|
|
12
|
+
/** @alpha */
|
|
13
|
+
export const PropertyFilterBuilderRuleRenderingContext = React.createContext({});
|
|
14
|
+
const ROOT_GROUP_PATH = [];
|
|
15
|
+
/** @alpha */
|
|
16
|
+
export function PropertyFilterBuilder(props) {
|
|
17
|
+
const { properties, onFilterChanged, onRulePropertySelected, ruleOperatorRenderer, ruleValueRenderer, ruleGroupDepthLimit } = props;
|
|
18
|
+
const { state, actions } = usePropertyFilterBuilderState();
|
|
19
|
+
const rootRef = React.useRef(null);
|
|
20
|
+
const filter = React.useMemo(() => buildPropertyFilter(state.rootGroup), [state]);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
onFilterChanged(filter);
|
|
23
|
+
}, [filter, onFilterChanged]);
|
|
24
|
+
const contextValue = React.useMemo(() => ({ actions, properties, onRulePropertySelected, ruleGroupDepthLimit }), [actions, properties, onRulePropertySelected, ruleGroupDepthLimit]);
|
|
25
|
+
const renderingContextValue = React.useMemo(() => ({ ruleOperatorRenderer, ruleValueRenderer }), [ruleOperatorRenderer, ruleValueRenderer]);
|
|
26
|
+
return (React.createElement(PropertyFilterBuilderRuleRenderingContext.Provider, { value: renderingContextValue },
|
|
27
|
+
React.createElement(PropertyFilterBuilderContext.Provider, { value: contextValue },
|
|
28
|
+
React.createElement(ActiveRuleGroupContext.Provider, { value: useActiveRuleGroupContextProps(rootRef) },
|
|
29
|
+
React.createElement("div", { ref: rootRef, className: "filter-builder" },
|
|
30
|
+
React.createElement(PropertyFilterBuilderRuleGroupRenderer, { path: ROOT_GROUP_PATH, group: state.rootGroup }))))));
|
|
31
|
+
}
|
|
32
|
+
/** @internal */
|
|
33
|
+
export function buildPropertyFilter(groupItem) {
|
|
34
|
+
if (isPropertyFilterBuilderRuleGroup(groupItem))
|
|
35
|
+
return buildPropertyFilterFromRuleGroup(groupItem);
|
|
36
|
+
return buildPropertyFilterFromRule(groupItem);
|
|
37
|
+
}
|
|
38
|
+
function buildPropertyFilterFromRuleGroup(rootGroup) {
|
|
39
|
+
if (rootGroup.items.length === 0)
|
|
40
|
+
return undefined;
|
|
41
|
+
const rules = new Array();
|
|
42
|
+
for (const item of rootGroup.items) {
|
|
43
|
+
const rule = buildPropertyFilter(item);
|
|
44
|
+
if (!rule)
|
|
45
|
+
return undefined;
|
|
46
|
+
rules.push(rule);
|
|
47
|
+
}
|
|
48
|
+
if (rules.length === 1)
|
|
49
|
+
return rules[0];
|
|
50
|
+
return {
|
|
51
|
+
operator: rootGroup.operator,
|
|
52
|
+
rules,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function buildPropertyFilterFromRule(rule) {
|
|
56
|
+
const { property, operator, value } = rule;
|
|
57
|
+
if (!property || operator === undefined)
|
|
58
|
+
return undefined;
|
|
59
|
+
if (!isUnaryPropertyFilterOperator(operator) && (value === undefined || value.valueFormat !== PropertyValueFormat.Primitive || value.value === undefined))
|
|
60
|
+
return undefined;
|
|
61
|
+
return { property, operator, value };
|
|
62
|
+
}
|
|
63
|
+
function useActiveRuleGroupContextProps(rootElementRef) {
|
|
64
|
+
const [activeElement, setActiveElement] = React.useState();
|
|
65
|
+
const onFocus = React.useCallback((e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
setActiveElement(e.currentTarget);
|
|
68
|
+
}, []);
|
|
69
|
+
const onBlur = React.useCallback((e) => {
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
if (activeElement !== e.currentTarget || (rootElementRef.current && rootElementRef.current.contains(e.relatedTarget)))
|
|
72
|
+
return;
|
|
73
|
+
setActiveElement(undefined);
|
|
74
|
+
}, [activeElement, rootElementRef]);
|
|
75
|
+
const onMouseOver = React.useCallback((e) => {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
setActiveElement(e.currentTarget);
|
|
78
|
+
}, []);
|
|
79
|
+
const onMouseOut = React.useCallback((e) => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
// istanbul ignore if
|
|
82
|
+
if (activeElement !== e.currentTarget)
|
|
83
|
+
return;
|
|
84
|
+
setActiveElement(undefined);
|
|
85
|
+
}, [activeElement]);
|
|
86
|
+
return React.useMemo(() => ({
|
|
87
|
+
activeElement,
|
|
88
|
+
onFocus,
|
|
89
|
+
onBlur,
|
|
90
|
+
onMouseOver,
|
|
91
|
+
onMouseOut,
|
|
92
|
+
}), [activeElement, onFocus, onBlur, onMouseOver, onMouseOut]);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=FilterBuilder.js.map
|