@itwin/grouping-mapping-widget 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/formula/FormulaDataTypeResolver.d.ts +12 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js +50 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -0
- package/lib/cjs/formula/FormulaFunctionProvider.js +59 -59
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaOperatorsProvider.js +7 -7
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.d.ts +6 -0
- package/lib/cjs/formula/{FormulaTokensValidator.js → FormulaTokensDataTypeResolver.js} +32 -32
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -0
- package/lib/cjs/formula/Types.d.ts +2 -2
- package/lib/cjs/formula/Types.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +6 -1
- package/lib/cjs/grouping-mapping-widget.js +6 -3
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/widget/GroupingMappingWidget.d.ts +3 -6
- package/lib/cjs/widget/GroupingMappingWidget.js +3 -5
- package/lib/cjs/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -5
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +6 -4
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +6 -4
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationAction.js +7 -5
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationTable.js +6 -4
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.js +9 -7
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +19 -8
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyTable.js +6 -4
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js +8 -6
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.js +54 -65
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMapping.d.ts +8 -13
- package/lib/cjs/widget/components/GroupingMapping.js +15 -30
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/Mapping.js +18 -14
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.js +7 -5
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.js +16 -15
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/QueryBuilder.d.ts +2 -2
- package/lib/cjs/widget/components/QueryBuilder.js +6 -12
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +13 -4
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectMappings.js +9 -7
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/SelectProject.js +13 -4
- package/lib/cjs/widget/components/SelectProject.js.map +1 -1
- package/lib/cjs/widget/components/{GroupQueryBuilderContext.d.ts → context/GroupQueryBuilderContext.d.ts} +1 -1
- package/lib/cjs/widget/components/{GroupQueryBuilderContext.js → context/GroupQueryBuilderContext.js} +1 -1
- package/lib/cjs/widget/components/context/GroupQueryBuilderContext.js.map +1 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.d.ts +11 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js +37 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/cjs/widget/components/context/MappingClientContext.d.ts +7 -0
- package/lib/cjs/widget/components/context/MappingClientContext.js +30 -0
- package/lib/cjs/widget/components/context/MappingClientContext.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +5 -5
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +2 -2
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.js +9 -6
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
- package/lib/cjs/widget/hooks/useFormulaValidation.js +3 -2
- package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/formula/FormulaDataTypeResolver.d.ts +12 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js +46 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -0
- package/lib/esm/formula/FormulaFunctionProvider.js +59 -59
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/esm/formula/FormulaOperatorsProvider.js +7 -7
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/esm/formula/FormulaTokensDataTypeResolver.d.ts +6 -0
- package/lib/esm/formula/{FormulaTokensValidator.js → FormulaTokensDataTypeResolver.js} +30 -30
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -0
- package/lib/esm/formula/Types.d.ts +2 -2
- package/lib/esm/formula/Types.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +6 -1
- package/lib/esm/grouping-mapping-widget.js +3 -1
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/widget/GroupingMappingWidget.d.ts +3 -6
- package/lib/esm/widget/GroupingMappingWidget.js +3 -5
- package/lib/esm/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.js +8 -6
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.js +7 -5
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js +7 -5
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationAction.js +8 -6
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationTable.js +7 -5
- package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.js +10 -8
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.js +20 -9
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyTable.js +7 -5
- package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js +8 -6
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +1 -1
- package/lib/esm/widget/components/Grouping.js +56 -67
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMapping.d.ts +8 -13
- package/lib/esm/widget/components/GroupingMapping.js +13 -26
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/Mapping.js +19 -15
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.js +8 -6
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/PropertyMenu.js +17 -16
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/QueryBuilder.d.ts +2 -2
- package/lib/esm/widget/components/QueryBuilder.js +6 -12
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +14 -5
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectMappings.js +10 -8
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/SelectProject.js +14 -5
- package/lib/esm/widget/components/SelectProject.js.map +1 -1
- package/lib/esm/widget/components/{GroupQueryBuilderContext.d.ts → context/GroupQueryBuilderContext.d.ts} +1 -1
- package/lib/esm/widget/components/{GroupQueryBuilderContext.js → context/GroupQueryBuilderContext.js} +1 -1
- package/lib/esm/widget/components/context/GroupQueryBuilderContext.js.map +1 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.d.ts +11 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js +14 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/esm/widget/components/context/MappingClientContext.d.ts +7 -0
- package/lib/esm/widget/components/context/MappingClientContext.js +25 -0
- package/lib/esm/widget/components/context/MappingClientContext.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +6 -6
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +2 -2
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyView.js +9 -6
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/esm/widget/components/viewerUtils.js.map +1 -1
- package/lib/esm/widget/hooks/useFormulaValidation.js +3 -2
- package/lib/esm/widget/hooks/useFormulaValidation.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/formula/FormulaTokensValidator.d.ts +0 -5
- package/lib/cjs/formula/FormulaTokensValidator.js.map +0 -1
- package/lib/cjs/formula/FormulaValidator.d.ts +0 -3
- package/lib/cjs/formula/FormulaValidator.js +0 -35
- package/lib/cjs/formula/FormulaValidator.js.map +0 -1
- package/lib/cjs/widget/components/GroupQueryBuilderContext.js.map +0 -1
- package/lib/esm/formula/FormulaTokensValidator.d.ts +0 -5
- package/lib/esm/formula/FormulaTokensValidator.js.map +0 -1
- package/lib/esm/formula/FormulaValidator.d.ts +0 -3
- package/lib/esm/formula/FormulaValidator.js +0 -31
- package/lib/esm/formula/FormulaValidator.js.map +0 -1
- package/lib/esm/widget/components/GroupQueryBuilderContext.js.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { splitFormula } from "./FormulaSplitter";
|
|
6
|
-
import { validateTokens } from "./FormulaTokensValidator";
|
|
7
|
-
import { convertInfixToPostfix } from "./InfixToPostfixConverter";
|
|
8
|
-
import { ParenthesisState, validateParenthesis } from "./ParenthesisValidator";
|
|
9
|
-
export function validateFormula(formulaName, formula, properties) {
|
|
10
|
-
var _a;
|
|
11
|
-
const parenthesisState = validateParenthesis(formula);
|
|
12
|
-
if (ParenthesisState.NotClosed === parenthesisState) {
|
|
13
|
-
return "Opened but not closed parenthesis found.";
|
|
14
|
-
}
|
|
15
|
-
else if (ParenthesisState.NotOpened === parenthesisState) {
|
|
16
|
-
return "Closed but not opened parenthesis found.";
|
|
17
|
-
}
|
|
18
|
-
let infixFormulaTokens;
|
|
19
|
-
try {
|
|
20
|
-
infixFormulaTokens = splitFormula(formula);
|
|
21
|
-
}
|
|
22
|
-
catch (ex) {
|
|
23
|
-
return ex.message;
|
|
24
|
-
}
|
|
25
|
-
const postfixFormulaTokens = convertInfixToPostfix(infixFormulaTokens);
|
|
26
|
-
if (undefined === postfixFormulaTokens.value) {
|
|
27
|
-
return (_a = postfixFormulaTokens.errorMessage) !== null && _a !== void 0 ? _a : "Unknown error";
|
|
28
|
-
}
|
|
29
|
-
return validateTokens(formulaName, postfixFormulaTokens.value, properties);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=FormulaValidator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormulaValidator.js","sourceRoot":"","sources":["../../../src/formula/FormulaValidator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,OAAe,EAAE,UAAuB;;IAC3F,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,gBAAgB,CAAC,SAAS,KAAK,gBAAgB,EAAE;QACnD,OAAO,0CAA0C,CAAC;KACnD;SAAM,IAAI,gBAAgB,CAAC,SAAS,KAAK,gBAAgB,EAAE;QAC1D,OAAO,0CAA0C,CAAC;KACnD;IAED,IAAI,kBAAkB,CAAC;IACvB,IAAI;QACF,kBAAkB,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;KAC5C;IAAC,OAAO,EAAE,EAAE;QACX,OAAQ,EAAY,CAAC,OAAO,CAAC;KAC9B;IAED,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAEvE,IAAI,SAAS,KAAK,oBAAoB,CAAC,KAAK,EAAE;QAC5C,OAAO,MAAA,oBAAoB,CAAC,YAAY,mCAAI,eAAe,CAAC;KAC7D;IAED,OAAO,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { splitFormula } from \"./FormulaSplitter\";\nimport { validateTokens } from \"./FormulaTokensValidator\";\nimport { convertInfixToPostfix } from \"./InfixToPostfixConverter\";\nimport { ParenthesisState, validateParenthesis } from \"./ParenthesisValidator\";\nimport type { PropertyMap } from \"./Types\";\n\nexport function validateFormula(formulaName: string, formula: string, properties: PropertyMap): string {\n const parenthesisState = validateParenthesis(formula);\n if (ParenthesisState.NotClosed === parenthesisState) {\n return \"Opened but not closed parenthesis found.\";\n } else if (ParenthesisState.NotOpened === parenthesisState) {\n return \"Closed but not opened parenthesis found.\";\n }\n\n let infixFormulaTokens;\n try {\n infixFormulaTokens = splitFormula(formula);\n } catch (ex) {\n return (ex as Error).message;\n }\n\n const postfixFormulaTokens = convertInfixToPostfix(infixFormulaTokens);\n\n if (undefined === postfixFormulaTokens.value) {\n return postfixFormulaTokens.errorMessage ?? \"Unknown error\";\n }\n\n return validateTokens(formulaName, postfixFormulaTokens.value, properties);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupQueryBuilderContext.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupQueryBuilderContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAe9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,aAAa,CAAoB;IAC7E,mBAAmB,EAAE,EAAE;IACvB,sBAAsB,EAAE,GAAG,EAAE,CAAC,EAAE;IAChC,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,YAAY,EAAE,IAAI,YAAY,CAAC,SAAS,CAAC;IACzC,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC;IAClD,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;CAC1B,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { QueryBuilder } from \"./QueryBuilder\";\n\nexport interface PropertySelection {\n currentPropertyList: PropertyRecord[];\n setCurrentPropertyList: React.Dispatch<\n React.SetStateAction<PropertyRecord[]>\n >;\n query: string;\n setQuery: React.Dispatch<React.SetStateAction<string>>;\n queryBuilder: QueryBuilder;\n setQueryBuilder: React.Dispatch<React.SetStateAction<QueryBuilder>>;\n isLoading: boolean;\n isRendering: boolean;\n resetView: () => Promise<void>;\n}\nexport const GroupQueryBuilderContext = React.createContext<PropertySelection>({\n currentPropertyList: [],\n setCurrentPropertyList: () => [],\n query: \"\",\n setQuery: () => \"\",\n queryBuilder: new QueryBuilder(undefined),\n setQueryBuilder: () => new QueryBuilder(undefined),\n isLoading: false,\n isRendering: false,\n resetView: async () => {},\n});\n"]}
|