@itwin/grouping-mapping-widget 0.3.1 → 0.3.4
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/FormulaFunctionProvider.d.ts +18 -0
- package/lib/cjs/formula/FormulaFunctionProvider.js +136 -0
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -0
- package/lib/cjs/formula/FormulaOperatorsProvider.d.ts +34 -0
- package/lib/cjs/formula/FormulaOperatorsProvider.js +185 -0
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -0
- package/lib/cjs/formula/FormulaSplitter.d.ts +2 -0
- package/lib/cjs/formula/FormulaSplitter.js +140 -0
- package/lib/cjs/formula/FormulaSplitter.js.map +1 -0
- package/lib/cjs/formula/FormulaTokensValidator.d.ts +5 -0
- package/lib/cjs/formula/FormulaTokensValidator.js +135 -0
- package/lib/cjs/formula/FormulaTokensValidator.js.map +1 -0
- package/lib/cjs/formula/FormulaValidator.d.ts +3 -0
- package/lib/cjs/formula/FormulaValidator.js +35 -0
- package/lib/cjs/formula/FormulaValidator.js.map +1 -0
- package/lib/cjs/formula/IResult.d.ts +5 -0
- package/lib/cjs/formula/IResult.js +3 -0
- package/lib/cjs/formula/IResult.js.map +1 -0
- package/lib/cjs/formula/InfixToPostfixConverter.d.ts +18 -0
- package/lib/cjs/formula/InfixToPostfixConverter.js +299 -0
- package/lib/cjs/formula/InfixToPostfixConverter.js.map +1 -0
- package/lib/cjs/formula/InputStream.d.ts +12 -0
- package/lib/cjs/formula/InputStream.js +36 -0
- package/lib/cjs/formula/InputStream.js.map +1 -0
- package/lib/cjs/formula/ParenthesisValidator.d.ts +7 -0
- package/lib/cjs/formula/ParenthesisValidator.js +34 -0
- package/lib/cjs/formula/ParenthesisValidator.js.map +1 -0
- package/lib/cjs/formula/Queue.d.ts +11 -0
- package/lib/cjs/formula/Queue.js +42 -0
- package/lib/cjs/formula/Queue.js.map +1 -0
- package/lib/cjs/formula/Stack.d.ts +14 -0
- package/lib/cjs/formula/Stack.js +71 -0
- package/lib/cjs/formula/Stack.js.map +1 -0
- package/lib/cjs/formula/StringBuilder.d.ts +9 -0
- package/lib/cjs/formula/StringBuilder.js +26 -0
- package/lib/cjs/formula/StringBuilder.js.map +1 -0
- package/lib/cjs/formula/Types.d.ts +8 -0
- package/lib/cjs/formula/Types.js +3 -0
- package/lib/cjs/formula/Types.js.map +1 -0
- package/lib/cjs/formula/Utils.d.ts +7 -0
- package/lib/cjs/formula/Utils.js +39 -0
- package/lib/cjs/formula/Utils.js.map +1 -0
- package/lib/cjs/widget/GroupingMappingWidget.d.ts +4 -0
- package/lib/cjs/widget/GroupingMappingWidget.js +6 -23
- package/lib/cjs/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/widget/components/BlockingOverlay.d.ts +7 -0
- package/lib/cjs/widget/components/BlockingOverlay.js +21 -0
- package/lib/cjs/widget/components/BlockingOverlay.js.map +1 -0
- package/lib/cjs/widget/components/BlockingOverlay.scss +26 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +3 -3
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +15 -10
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +9 -6
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +8 -33
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +3 -3
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +6 -3
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.scss +4 -2
- package/lib/cjs/widget/components/CustomCalculationAction.d.ts +6 -4
- package/lib/cjs/widget/components/CustomCalculationAction.js +23 -12
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationTable.d.ts +9 -6
- package/lib/cjs/widget/components/CustomCalculationTable.js +8 -33
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.d.ts +2 -2
- package/lib/cjs/widget/components/GroupAction.js +10 -13
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.d.ts +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +12 -8
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyTable.d.ts +9 -6
- package/lib/cjs/widget/components/GroupPropertyTable.js +8 -33
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.d.ts +3 -3
- package/lib/cjs/widget/components/Grouping.js +22 -22
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMapping.d.ts +12 -2
- package/lib/cjs/widget/components/GroupingMapping.js +18 -4
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/Mapping.d.ts +2 -2
- package/lib/cjs/widget/components/Mapping.js +37 -15
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.d.ts +2 -2
- package/lib/cjs/widget/components/MappingAction.js +15 -14
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js +2 -2
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.scss +6 -2
- package/lib/cjs/widget/components/PropertyMenu.d.ts +2 -2
- package/lib/cjs/widget/components/PropertyMenu.js +68 -21
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +4 -8
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +2 -1
- package/lib/cjs/widget/components/SelectMapping.scss +2 -1
- package/lib/cjs/widget/components/SelectMappings.d.ts +2 -2
- package/lib/cjs/widget/components/SelectMappings.js +10 -11
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/SelectProject.js +12 -16
- package/lib/cjs/widget/components/SelectProject.js.map +1 -1
- package/lib/cjs/widget/components/SelectProject.scss +3 -8
- package/lib/cjs/widget/hooks/useFetchData.d.ts +9 -0
- package/lib/cjs/widget/hooks/useFetchData.js +41 -0
- package/lib/cjs/widget/hooks/useFetchData.js.map +1 -0
- package/lib/cjs/widget/hooks/useFormulaValidation.d.ts +6 -0
- package/lib/cjs/widget/hooks/useFormulaValidation.js +29 -0
- package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -0
- package/lib/cjs/widget/utils.d.ts +1 -0
- package/lib/cjs/widget/utils.js +9 -0
- package/lib/cjs/widget/utils.js.map +1 -1
- package/lib/esm/formula/FormulaFunctionProvider.d.ts +18 -0
- package/lib/esm/formula/FormulaFunctionProvider.js +130 -0
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -0
- package/lib/esm/formula/FormulaOperatorsProvider.d.ts +34 -0
- package/lib/esm/formula/FormulaOperatorsProvider.js +174 -0
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -0
- package/lib/esm/formula/FormulaSplitter.d.ts +2 -0
- package/lib/esm/formula/FormulaSplitter.js +136 -0
- package/lib/esm/formula/FormulaSplitter.js.map +1 -0
- package/lib/esm/formula/FormulaTokensValidator.d.ts +5 -0
- package/lib/esm/formula/FormulaTokensValidator.js +131 -0
- package/lib/esm/formula/FormulaTokensValidator.js.map +1 -0
- package/lib/esm/formula/FormulaValidator.d.ts +3 -0
- package/lib/esm/formula/FormulaValidator.js +31 -0
- package/lib/esm/formula/FormulaValidator.js.map +1 -0
- package/lib/esm/formula/IResult.d.ts +5 -0
- package/lib/esm/formula/IResult.js +2 -0
- package/lib/esm/formula/IResult.js.map +1 -0
- package/lib/esm/formula/InfixToPostfixConverter.d.ts +18 -0
- package/lib/esm/formula/InfixToPostfixConverter.js +295 -0
- package/lib/esm/formula/InfixToPostfixConverter.js.map +1 -0
- package/lib/esm/formula/InputStream.d.ts +12 -0
- package/lib/esm/formula/InputStream.js +32 -0
- package/lib/esm/formula/InputStream.js.map +1 -0
- package/lib/esm/formula/ParenthesisValidator.d.ts +7 -0
- package/lib/esm/formula/ParenthesisValidator.js +30 -0
- package/lib/esm/formula/ParenthesisValidator.js.map +1 -0
- package/lib/esm/formula/Queue.d.ts +11 -0
- package/lib/esm/formula/Queue.js +38 -0
- package/lib/esm/formula/Queue.js.map +1 -0
- package/lib/esm/formula/Stack.d.ts +14 -0
- package/lib/esm/formula/Stack.js +67 -0
- package/lib/esm/formula/Stack.js.map +1 -0
- package/lib/esm/formula/StringBuilder.d.ts +9 -0
- package/lib/esm/formula/StringBuilder.js +22 -0
- package/lib/esm/formula/StringBuilder.js.map +1 -0
- package/lib/esm/formula/Types.d.ts +8 -0
- package/lib/esm/formula/Types.js +2 -0
- package/lib/esm/formula/Types.js.map +1 -0
- package/lib/esm/formula/Utils.d.ts +7 -0
- package/lib/esm/formula/Utils.js +30 -0
- package/lib/esm/formula/Utils.js.map +1 -0
- package/lib/esm/widget/GroupingMappingWidget.d.ts +4 -0
- package/lib/esm/widget/GroupingMappingWidget.js +6 -4
- package/lib/esm/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/widget/components/BlockingOverlay.d.ts +7 -0
- package/lib/esm/widget/components/BlockingOverlay.js +14 -0
- package/lib/esm/widget/components/BlockingOverlay.js.map +1 -0
- package/lib/esm/widget/components/BlockingOverlay.scss +26 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +3 -3
- package/lib/esm/widget/components/CalculatedPropertyAction.js +16 -11
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +9 -6
- package/lib/esm/widget/components/CalculatedPropertyTable.js +9 -34
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +3 -3
- package/lib/esm/widget/components/ConfirmMappingsImport.js +7 -4
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.scss +4 -2
- package/lib/esm/widget/components/CustomCalculationAction.d.ts +6 -4
- package/lib/esm/widget/components/CustomCalculationAction.js +24 -13
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationTable.d.ts +9 -6
- package/lib/esm/widget/components/CustomCalculationTable.js +9 -34
- package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.d.ts +2 -2
- package/lib/esm/widget/components/GroupAction.js +11 -14
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.d.ts +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.js +13 -9
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyTable.d.ts +9 -6
- package/lib/esm/widget/components/GroupPropertyTable.js +9 -34
- package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/Grouping.d.ts +3 -3
- package/lib/esm/widget/components/Grouping.js +23 -23
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMapping.d.ts +12 -2
- package/lib/esm/widget/components/GroupingMapping.js +17 -4
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/Mapping.d.ts +2 -2
- package/lib/esm/widget/components/Mapping.js +39 -17
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.d.ts +2 -2
- package/lib/esm/widget/components/MappingAction.js +17 -16
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js +2 -2
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.scss +6 -2
- package/lib/esm/widget/components/PropertyMenu.d.ts +2 -2
- package/lib/esm/widget/components/PropertyMenu.js +69 -22
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +5 -6
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +2 -1
- package/lib/esm/widget/components/SelectMapping.scss +2 -1
- package/lib/esm/widget/components/SelectMappings.d.ts +2 -2
- package/lib/esm/widget/components/SelectMappings.js +11 -12
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/SelectProject.js +13 -14
- package/lib/esm/widget/components/SelectProject.js.map +1 -1
- package/lib/esm/widget/components/SelectProject.scss +3 -8
- package/lib/esm/widget/hooks/useFetchData.d.ts +9 -0
- package/lib/esm/widget/hooks/useFetchData.js +35 -0
- package/lib/esm/widget/hooks/useFetchData.js.map +1 -0
- package/lib/esm/widget/hooks/useFormulaValidation.d.ts +6 -0
- package/lib/esm/widget/hooks/useFormulaValidation.js +25 -0
- package/lib/esm/widget/hooks/useFormulaValidation.js.map +1 -0
- package/lib/esm/widget/utils.d.ts +1 -0
- package/lib/esm/widget/utils.js +7 -1
- package/lib/esm/widget/utils.js.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/api/generated/api.d.ts +0 -3222
- package/lib/cjs/api/generated/api.js +0 -5291
- package/lib/cjs/api/generated/api.js.map +0 -1
- package/lib/cjs/api/generated/configuration.d.ts +0 -56
- package/lib/cjs/api/generated/configuration.js +0 -30
- package/lib/cjs/api/generated/configuration.js.map +0 -1
- package/lib/cjs/api/generated/index.d.ts +0 -14
- package/lib/cjs/api/generated/index.js +0 -31
- package/lib/cjs/api/generated/index.js.map +0 -1
- package/lib/cjs/api/reportingClient.d.ts +0 -34
- package/lib/cjs/api/reportingClient.js +0 -177
- package/lib/cjs/api/reportingClient.js.map +0 -1
- package/lib/cjs/widget/hooks/useFetchAccessToken.d.ts +0 -3
- package/lib/cjs/widget/hooks/useFetchAccessToken.js +0 -22
- package/lib/cjs/widget/hooks/useFetchAccessToken.js.map +0 -1
- package/lib/esm/api/generated/api.d.ts +0 -3222
- package/lib/esm/api/generated/api.js +0 -5248
- package/lib/esm/api/generated/api.js.map +0 -1
- package/lib/esm/api/generated/configuration.d.ts +0 -56
- package/lib/esm/api/generated/configuration.js +0 -26
- package/lib/esm/api/generated/configuration.js.map +0 -1
- package/lib/esm/api/generated/index.d.ts +0 -14
- package/lib/esm/api/generated/index.js +0 -19
- package/lib/esm/api/generated/index.js.map +0 -1
- package/lib/esm/api/reportingClient.d.ts +0 -34
- package/lib/esm/api/reportingClient.js +0 -173
- package/lib/esm/api/reportingClient.js.map +0 -1
- package/lib/esm/widget/hooks/useFetchAccessToken.d.ts +0 -3
- package/lib/esm/widget/hooks/useFetchAccessToken.js +0 -20
- package/lib/esm/widget/hooks/useFetchAccessToken.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputStream = 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
|
+
class InputStream {
|
|
9
|
+
constructor(_stream) {
|
|
10
|
+
this._stream = _stream;
|
|
11
|
+
this._nextIndex = 0;
|
|
12
|
+
this._current = "";
|
|
13
|
+
}
|
|
14
|
+
get next() {
|
|
15
|
+
this._current = this.isEOF ? "" : this._stream[this._nextIndex++];
|
|
16
|
+
return this.current;
|
|
17
|
+
}
|
|
18
|
+
get undo() {
|
|
19
|
+
if (this._nextIndex === 0)
|
|
20
|
+
return this.current;
|
|
21
|
+
this._nextIndex--;
|
|
22
|
+
this._current = this._nextIndex === 0 ? "" : this._stream[this._nextIndex - 1];
|
|
23
|
+
return this.current;
|
|
24
|
+
}
|
|
25
|
+
get current() {
|
|
26
|
+
return this._current;
|
|
27
|
+
}
|
|
28
|
+
get peek() {
|
|
29
|
+
return this.isEOF ? "" : this._stream[this._nextIndex];
|
|
30
|
+
}
|
|
31
|
+
get isEOF() {
|
|
32
|
+
return this._nextIndex >= this._stream.length;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.InputStream = InputStream;
|
|
36
|
+
//# sourceMappingURL=InputStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputStream.js","sourceRoot":"","sources":["../../../src/formula/InputStream.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,MAAa,WAAW;IAItB,YAA6B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;QAHpC,eAAU,GAAG,CAAC,CAAC;QACf,aAAQ,GAAG,EAAE,CAAC;IAE0B,CAAC;IAEjD,IAAW,IAAI;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC;YACvB,OAAO,IAAI,CAAC,OAAO,CAAC;QAEtB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAChD,CAAC;CACF;AA/BD,kCA+BC","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*--------------------------------------------------------------------------------------------*/\nexport class InputStream {\n private _nextIndex = 0;\n private _current = \"\";\n\n constructor(private readonly _stream: string) { }\n\n public get next(): string {\n this._current = this.isEOF ? \"\" : this._stream[this._nextIndex++];\n return this.current;\n }\n\n public get undo(): string {\n if (this._nextIndex === 0)\n return this.current;\n\n this._nextIndex--;\n this._current = this._nextIndex === 0 ? \"\" : this._stream[this._nextIndex - 1];\n return this.current;\n }\n\n public get current(): string {\n return this._current;\n }\n\n public get peek(): string {\n return this.isEOF ? \"\" : this._stream[this._nextIndex];\n }\n\n public get isEOF(): boolean {\n return this._nextIndex >= this._stream.length;\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateParenthesis = exports.ParenthesisState = 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 Stack_1 = require("./Stack");
|
|
9
|
+
var ParenthesisState;
|
|
10
|
+
(function (ParenthesisState) {
|
|
11
|
+
ParenthesisState[ParenthesisState["Valid"] = 0] = "Valid";
|
|
12
|
+
ParenthesisState[ParenthesisState["NotClosed"] = 1] = "NotClosed";
|
|
13
|
+
ParenthesisState[ParenthesisState["NotOpened"] = 2] = "NotOpened";
|
|
14
|
+
})(ParenthesisState = exports.ParenthesisState || (exports.ParenthesisState = {}));
|
|
15
|
+
function validateParenthesis(infixFormula) {
|
|
16
|
+
const s = new Stack_1.Stack();
|
|
17
|
+
for (const c of infixFormula) {
|
|
18
|
+
if (c === "(") {
|
|
19
|
+
s.push("(");
|
|
20
|
+
}
|
|
21
|
+
else if (c === ")") {
|
|
22
|
+
if (s.peek() === undefined) {
|
|
23
|
+
return ParenthesisState.NotOpened;
|
|
24
|
+
}
|
|
25
|
+
s.pop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (s.length !== 0) {
|
|
29
|
+
return ParenthesisState.NotClosed;
|
|
30
|
+
}
|
|
31
|
+
return ParenthesisState.Valid;
|
|
32
|
+
}
|
|
33
|
+
exports.validateParenthesis = validateParenthesis;
|
|
34
|
+
//# sourceMappingURL=ParenthesisValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParenthesisValidator.js","sourceRoot":"","sources":["../../../src/formula/ParenthesisValidator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,mCAAgC;AAEhC,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAS,CAAA;IACT,iEAAa,CAAA;IACb,iEAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,SAAgB,mBAAmB,CAAC,YAAoB;IACtD,MAAM,CAAC,GAAG,IAAI,aAAK,EAAU,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE;QAC5B,IAAI,CAAC,KAAK,GAAG,EAAE;YACb,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACb;aAAM,IAAI,CAAC,KAAK,GAAG,EAAE;YACpB,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,SAAS,EAAE;gBAC1B,OAAO,gBAAgB,CAAC,SAAS,CAAC;aACnC;YACD,CAAC,CAAC,GAAG,EAAE,CAAC;SACT;KACF;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAClB,OAAO,gBAAgB,CAAC,SAAS,CAAC;KACnC;IACD,OAAO,gBAAgB,CAAC,KAAK,CAAC;AAChC,CAAC;AAhBD,kDAgBC","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 { Stack } from \"./Stack\";\n\nexport enum ParenthesisState {\n Valid = 0,\n NotClosed = 1,\n NotOpened = 2,\n}\n\nexport function validateParenthesis(infixFormula: string): ParenthesisState {\n const s = new Stack<string>();\n for (const c of infixFormula) {\n if (c === \"(\") {\n s.push(\"(\");\n } else if (c === \")\") {\n if (s.peek() === undefined) {\n return ParenthesisState.NotOpened;\n }\n s.pop();\n }\n }\n if (s.length !== 0) {\n return ParenthesisState.NotClosed;\n }\n return ParenthesisState.Valid;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Queue<TData> {
|
|
2
|
+
private _dataStore;
|
|
3
|
+
constructor(_dataStore?: TData[]);
|
|
4
|
+
enqueue(element: TData): Queue<TData>;
|
|
5
|
+
dequeue(): TData | undefined;
|
|
6
|
+
dequeueN(n: number): TData[];
|
|
7
|
+
peek(): TData | undefined;
|
|
8
|
+
get length(): number;
|
|
9
|
+
get asArray(): TData[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Queue.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Queue = 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
|
+
class Queue {
|
|
9
|
+
constructor(_dataStore = []) {
|
|
10
|
+
this._dataStore = _dataStore;
|
|
11
|
+
}
|
|
12
|
+
enqueue(element) {
|
|
13
|
+
this._dataStore.push(element);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
dequeue() {
|
|
17
|
+
if (this._dataStore.length === 0) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return this._dataStore.splice(0, 1)[0];
|
|
21
|
+
}
|
|
22
|
+
dequeueN(n) {
|
|
23
|
+
if (n <= 0 || this._dataStore.length === 0) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
return this._dataStore.splice(0, n);
|
|
27
|
+
}
|
|
28
|
+
peek() {
|
|
29
|
+
if (this._dataStore.length === 0) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return this._dataStore[0];
|
|
33
|
+
}
|
|
34
|
+
get length() {
|
|
35
|
+
return this._dataStore.length;
|
|
36
|
+
}
|
|
37
|
+
get asArray() {
|
|
38
|
+
return [...this._dataStore];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.Queue = Queue;
|
|
42
|
+
//# sourceMappingURL=Queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Queue.js","sourceRoot":"","sources":["../../../src/formula/Queue.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,MAAa,KAAK;IAChB,YAAoB,aAAsB,EAAE;QAAxB,eAAU,GAAV,UAAU,CAAc;IAAI,CAAC;IAE1C,OAAO,CAAC,OAAc;QAC3B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAEM,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,EAAE,CAAC;SACX;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;IAEM,IAAI;QACT,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;CACF;AAtCD,sBAsCC","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*--------------------------------------------------------------------------------------------*/\nexport class Queue<TData> {\n constructor(private _dataStore: TData[] = []) { }\n\n public enqueue(element: TData): Queue<TData> {\n this._dataStore.push(element);\n return this;\n }\n\n public dequeue(): TData | undefined {\n if (this._dataStore.length === 0) {\n return undefined;\n }\n\n return this._dataStore.splice(0, 1)[0];\n }\n\n public dequeueN(n: number): TData[] {\n if (n <= 0 || this._dataStore.length === 0) {\n return [];\n }\n\n return this._dataStore.splice(0, n);\n }\n\n public peek(): TData | undefined {\n if (this._dataStore.length === 0) {\n return undefined;\n }\n return this._dataStore[0];\n }\n\n public get length(): number {\n return this._dataStore.length;\n }\n\n public get asArray(): TData[] {\n return [...this._dataStore];\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class Stack<TData> {
|
|
2
|
+
private _dataStore;
|
|
3
|
+
constructor();
|
|
4
|
+
push(element: TData): Stack<TData>;
|
|
5
|
+
pop(): TData | undefined;
|
|
6
|
+
popN(n: number): TData[];
|
|
7
|
+
peek(): TData | undefined;
|
|
8
|
+
peekN(n: number): TData[];
|
|
9
|
+
indexOf(element: TData): number;
|
|
10
|
+
findIndex(filter: (element: TData) => boolean): number;
|
|
11
|
+
get length(): number;
|
|
12
|
+
get asArray(): TData[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Stack = 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
|
+
class Stack {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._dataStore = [];
|
|
11
|
+
}
|
|
12
|
+
push(element) {
|
|
13
|
+
this._dataStore.push(element);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
pop() {
|
|
17
|
+
if (this._dataStore.length === 0) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return this._dataStore.pop();
|
|
21
|
+
}
|
|
22
|
+
popN(n) {
|
|
23
|
+
if (n <= 0 || this._dataStore.length === 0) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
if (this._dataStore.length >= n) {
|
|
27
|
+
return [...this._dataStore.splice(this._dataStore.length - n)].reverse();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const result = [...this._dataStore];
|
|
31
|
+
this._dataStore = [];
|
|
32
|
+
return result.reverse();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
peek() {
|
|
36
|
+
if (this._dataStore.length === 0) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return this._dataStore[this._dataStore.length - 1];
|
|
40
|
+
}
|
|
41
|
+
peekN(n) {
|
|
42
|
+
if (n <= 0 || this._dataStore.length === 0) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
if (this._dataStore.length >= n) {
|
|
46
|
+
return this._dataStore.slice(-n).reverse();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return [...this._dataStore].reverse();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
indexOf(element) {
|
|
53
|
+
return this.findIndex((e) => e === element);
|
|
54
|
+
}
|
|
55
|
+
findIndex(filter) {
|
|
56
|
+
for (let i = 0; i < this._dataStore.length; i++) {
|
|
57
|
+
if (filter(this._dataStore[this._dataStore.length - 1 - i])) {
|
|
58
|
+
return i;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return -1;
|
|
62
|
+
}
|
|
63
|
+
get length() {
|
|
64
|
+
return this._dataStore.length;
|
|
65
|
+
}
|
|
66
|
+
get asArray() {
|
|
67
|
+
return [...this._dataStore].reverse();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.Stack = Stack;
|
|
71
|
+
//# sourceMappingURL=Stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../src/formula/Stack.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,MAAa,KAAK;IAEhB;QADQ,eAAU,GAAY,EAAE,CAAC;IACjB,CAAC;IAEV,IAAI,CAAC,OAAc;QACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,GAAG;QACR,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IAC/B,CAAC;IAEM,IAAI,CAAC,CAAS;QACnB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,EAAE,CAAC;SACX;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;YAC/B,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC1E;aAAM;YACL,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC;SACzB;IACH,CAAC;IAEM,IAAI;QACT,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,CAAS;QACpB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,EAAE,CAAC;SACX;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC5C;aAAM;YACL,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;SACvC;IACH,CAAC;IAEM,OAAO,CAAC,OAAc;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEM,SAAS,CAAC,MAAmC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/C,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC3D,OAAO,CAAC,CAAC;aACV;SACF;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;CACF;AArED,sBAqEC","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*--------------------------------------------------------------------------------------------*/\nexport class Stack<TData> {\n private _dataStore: TData[] = [];\n constructor() { }\n\n public push(element: TData): Stack<TData> {\n this._dataStore.push(element);\n return this;\n }\n\n public pop(): TData | undefined {\n if (this._dataStore.length === 0) {\n return undefined;\n }\n return this._dataStore.pop();\n }\n\n public popN(n: number): TData[] {\n if (n <= 0 || this._dataStore.length === 0) {\n return [];\n }\n\n if (this._dataStore.length >= n) {\n return [...this._dataStore.splice(this._dataStore.length - n)].reverse();\n } else {\n const result = [...this._dataStore];\n this._dataStore = [];\n return result.reverse();\n }\n }\n\n public peek(): TData | undefined {\n if (this._dataStore.length === 0) {\n return undefined;\n }\n return this._dataStore[this._dataStore.length - 1];\n }\n\n public peekN(n: number): TData[] {\n if (n <= 0 || this._dataStore.length === 0) {\n return [];\n }\n\n if (this._dataStore.length >= n) {\n return this._dataStore.slice(-n).reverse();\n } else {\n return [...this._dataStore].reverse();\n }\n }\n\n public indexOf(element: TData): number {\n return this.findIndex((e) => e === element);\n }\n\n public findIndex(filter: (element: TData) => boolean): number {\n for (let i = 0; i < this._dataStore.length; i++) {\n if (filter(this._dataStore[this._dataStore.length - 1 - i])) {\n return i;\n }\n }\n return -1;\n }\n\n public get length(): number {\n return this._dataStore.length;\n }\n\n public get asArray(): TData[] {\n return [...this._dataStore].reverse();\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringBuilder = 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
|
+
class StringBuilder {
|
|
9
|
+
constructor(...initial) {
|
|
10
|
+
this._stringParts = initial.filter((v) => !!v);
|
|
11
|
+
}
|
|
12
|
+
push(value) {
|
|
13
|
+
value && this._stringParts.push(value);
|
|
14
|
+
}
|
|
15
|
+
pop() {
|
|
16
|
+
return this._stringParts.pop();
|
|
17
|
+
}
|
|
18
|
+
get length() {
|
|
19
|
+
return this._stringParts.length;
|
|
20
|
+
}
|
|
21
|
+
get value() {
|
|
22
|
+
return this._stringParts.join("");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.StringBuilder = StringBuilder;
|
|
26
|
+
//# sourceMappingURL=StringBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringBuilder.js","sourceRoot":"","sources":["../../../src/formula/StringBuilder.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,MAAa,aAAa;IAGxB,YAAY,GAAG,OAAiB;QAC9B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAEM,IAAI,CAAC,KAAa;QACvB,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAEM,GAAG;QACR,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AAtBD,sCAsBC","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*--------------------------------------------------------------------------------------------*/\nexport class StringBuilder {\n private readonly _stringParts: string[];\n\n constructor(...initial: string[]) {\n this._stringParts = initial.filter((v) => !!v);\n }\n\n public push(value: string) {\n value && this._stringParts.push(value);\n }\n\n public pop() {\n return this._stringParts.pop();\n }\n\n public get length() {\n return this._stringParts.length;\n }\n\n public get value() {\n return this._stringParts.join(\"\");\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare type ValueType = number | string | boolean;
|
|
2
|
+
export declare type PossibleValueType = ValueType | undefined;
|
|
3
|
+
export declare type DataType = "number" | "string" | "boolean";
|
|
4
|
+
export declare type PossibleDataType = DataType | "undefined";
|
|
5
|
+
export interface PropertyMap {
|
|
6
|
+
[key: string]: PossibleDataType;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../src/formula/Types.ts"],"names":[],"mappings":"","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*--------------------------------------------------------------------------------------------*/\nexport type ValueType = number | string | boolean;\n\nexport type PossibleValueType = ValueType | undefined;\n\nexport type DataType = \"number\" | \"string\" | \"boolean\";\n\nexport type PossibleDataType = DataType | \"undefined\";\n\nexport interface PropertyMap { [key: string]: PossibleDataType }\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function isDigit(char: string): boolean;
|
|
2
|
+
export declare function isLetterOrUnderscore(char: string): boolean;
|
|
3
|
+
export declare function isStringDelimiter(char: string): boolean;
|
|
4
|
+
export declare function isWhitespace(char: string): boolean;
|
|
5
|
+
export declare function isDecimalSeparator(char: string): boolean;
|
|
6
|
+
export declare function formatNumericalPositionString(num: number): string;
|
|
7
|
+
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatNumericalPositionString = exports.isDecimalSeparator = exports.isWhitespace = exports.isStringDelimiter = exports.isLetterOrUnderscore = exports.isDigit = 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
|
+
function isDigit(char) {
|
|
9
|
+
return /^\d/.test(char);
|
|
10
|
+
}
|
|
11
|
+
exports.isDigit = isDigit;
|
|
12
|
+
function isLetterOrUnderscore(char) {
|
|
13
|
+
return /^[\p{L}_]/u.test(char);
|
|
14
|
+
}
|
|
15
|
+
exports.isLetterOrUnderscore = isLetterOrUnderscore;
|
|
16
|
+
function isStringDelimiter(char) {
|
|
17
|
+
return ["\"", "'", "`"].includes(char);
|
|
18
|
+
}
|
|
19
|
+
exports.isStringDelimiter = isStringDelimiter;
|
|
20
|
+
function isWhitespace(char) {
|
|
21
|
+
return /^\s/.test(char);
|
|
22
|
+
}
|
|
23
|
+
exports.isWhitespace = isWhitespace;
|
|
24
|
+
function isDecimalSeparator(char) {
|
|
25
|
+
return char === ".";
|
|
26
|
+
}
|
|
27
|
+
exports.isDecimalSeparator = isDecimalSeparator;
|
|
28
|
+
function formatNumericalPositionString(num) {
|
|
29
|
+
const str = num.toString();
|
|
30
|
+
if (str.endsWith("1") && num !== 11)
|
|
31
|
+
return `${str}st`;
|
|
32
|
+
if (str.endsWith("2") && num !== 12)
|
|
33
|
+
return `${str}nd`;
|
|
34
|
+
if (str.endsWith("3") && num !== 13)
|
|
35
|
+
return `${str}rd`;
|
|
36
|
+
return `${str}th`;
|
|
37
|
+
}
|
|
38
|
+
exports.formatNumericalPositionString = formatNumericalPositionString;
|
|
39
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/formula/Utils.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,SAAgB,OAAO,CAAC,IAAY;IAClC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,0BAEC;AAED,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAFD,oDAEC;AAED,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAFD,8CAEC;AAED,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAFD,oCAEC;AAED,SAAgB,kBAAkB,CAAC,IAAY;IAC7C,OAAO,IAAI,KAAK,GAAG,CAAC;AACtB,CAAC;AAFD,gDAEC;AAED,SAAgB,6BAA6B,CAAC,GAAW;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC3B,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE;QACjC,OAAO,GAAG,GAAG,IAAI,CAAC;IACpB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE;QACjC,OAAO,GAAG,GAAG,IAAI,CAAC;IACpB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,EAAE;QACjC,OAAO,GAAG,GAAG,IAAI,CAAC;IAEpB,OAAO,GAAG,GAAG,IAAI,CAAC;AACpB,CAAC;AAVD,sEAUC","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*--------------------------------------------------------------------------------------------*/\nexport function isDigit(char: string): boolean {\n return /^\\d/.test(char);\n}\n\nexport function isLetterOrUnderscore(char: string): boolean {\n return /^[\\p{L}_]/u.test(char);\n}\n\nexport function isStringDelimiter(char: string): boolean {\n return [\"\\\"\", \"'\", \"`\"].includes(char);\n}\n\nexport function isWhitespace(char: string): boolean {\n return /^\\s/.test(char);\n}\n\nexport function isDecimalSeparator(char: string): boolean {\n return char === \".\";\n}\n\nexport function formatNumericalPositionString(num: number): string {\n const str = num.toString();\n if (str.endsWith(\"1\") && num !== 11)\n return `${str}st`;\n if (str.endsWith(\"2\") && num !== 12)\n return `${str}nd`;\n if (str.endsWith(\"3\") && num !== 13)\n return `${str}rd`;\n\n return `${str}th`;\n}\n"]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { AbstractWidgetProps, UiItemsProvider } from "@itwin/appui-abstract";
|
|
2
2
|
import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "@itwin/appui-abstract";
|
|
3
|
+
import type { AccessToken } from "@itwin/core-bentley";
|
|
3
4
|
export declare class GroupingMappingProvider implements UiItemsProvider {
|
|
4
5
|
readonly id = "GroupingMappingProvider";
|
|
6
|
+
private readonly _accessToken?;
|
|
7
|
+
private readonly _prefix?;
|
|
8
|
+
constructor(accessToken?: AccessToken, prefix?: "" | "dev" | "qa");
|
|
5
9
|
provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zonelocation?: AbstractZoneLocation): ReadonlyArray<AbstractWidgetProps>;
|
|
6
10
|
}
|
|
7
11
|
//# sourceMappingURL=GroupingMappingWidget.d.ts.map
|
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
4
|
};
|
|
24
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
6
|
exports.GroupingMappingProvider = void 0;
|
|
26
7
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
27
|
-
const
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
28
9
|
const GroupingMapping_1 = __importDefault(require("./components/GroupingMapping"));
|
|
29
10
|
class GroupingMappingProvider {
|
|
30
|
-
constructor() {
|
|
11
|
+
constructor(accessToken, prefix) {
|
|
31
12
|
this.id = "GroupingMappingProvider";
|
|
13
|
+
this._accessToken = accessToken;
|
|
14
|
+
this._prefix = prefix;
|
|
32
15
|
}
|
|
33
16
|
provideWidgets(_stageId, stageUsage, location, section, zonelocation) {
|
|
34
17
|
const widgets = [];
|
|
@@ -39,8 +22,8 @@ class GroupingMappingProvider {
|
|
|
39
22
|
const GroupingMappingWidget = {
|
|
40
23
|
id: "GroupingMappingWidget",
|
|
41
24
|
label: "Grouping & Mapping",
|
|
42
|
-
getWidgetContent() {
|
|
43
|
-
return
|
|
25
|
+
getWidgetContent: () => {
|
|
26
|
+
return react_1.default.createElement(GroupingMapping_1.default, { accessToken: this._accessToken, prefix: this._prefix });
|
|
44
27
|
},
|
|
45
28
|
};
|
|
46
29
|
widgets.push(GroupingMappingWidget);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingWidget.js","sourceRoot":"","sources":["../../../src/widget/GroupingMappingWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupingMappingWidget.js","sourceRoot":"","sources":["../../../src/widget/GroupingMappingWidget.tsx"],"names":[],"mappings":";;;;;;AAQA,0DAK+B;AAE/B,kDAA0B;AAC1B,mFAA2D;AAE3D,MAAa,uBAAuB;IAMlC,YAAY,WAAyB,EAAE,MAA0B;QALjD,OAAE,GAAG,yBAAyB,CAAC;QAM7C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAEM,cAAc,CACnB,QAAgB,EAChB,UAAkB,EAClB,QAA4B,EAC5B,OAA2B,EAC3B,YAAmC;QAEnC,MAAM,OAAO,GAA0B,EAAE,CAAC;QAC1C,IACE,CAAC,QAAQ,KAAK,mCAAkB,CAAC,IAAI;YACnC,OAAO,KAAK,kCAAiB,CAAC,KAAK;YACnC,UAAU,KAAK,2BAAU,CAAC,OAAO,CAAC;YACpC,YAAY,KAAK,qCAAoB,CAAC,UAAU,EAChD;YACA,MAAM,qBAAqB,GAAwB;gBACjD,EAAE,EAAE,uBAAuB;gBAC3B,KAAK,EAAE,oBAAoB;gBAC3B,gBAAgB,EAAE,GAAG,EAAE;oBACrB,OAAO,8BAAC,yBAAe,IAAC,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,GAAI,CAAC;gBACnF,CAAC;aACF,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;SACrC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAtCD,0DAsCC","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 type {\n AbstractWidgetProps,\n UiItemsProvider,\n} from \"@itwin/appui-abstract\";\nimport {\n AbstractZoneLocation,\n StagePanelLocation,\n StagePanelSection,\n StageUsage,\n} from \"@itwin/appui-abstract\";\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport React from \"react\";\nimport GroupingMapping from \"./components/GroupingMapping\";\n\nexport class GroupingMappingProvider implements UiItemsProvider {\n public readonly id = \"GroupingMappingProvider\";\n\n private readonly _accessToken?: AccessToken;\n private readonly _prefix?: \"\" | \"dev\" | \"qa\";\n\n constructor(accessToken?: AccessToken, prefix?: \"\" | \"dev\" | \"qa\") {\n this._accessToken = accessToken;\n this._prefix = prefix;\n }\n\n public provideWidgets(\n _stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection,\n zonelocation?: AbstractZoneLocation\n ): ReadonlyArray<AbstractWidgetProps> {\n const widgets: AbstractWidgetProps[] = [];\n if (\n (location === StagePanelLocation.Left &&\n section === StagePanelSection.Start &&\n stageUsage === StageUsage.General) ||\n zonelocation === AbstractZoneLocation.CenterLeft\n ) {\n const GroupingMappingWidget: AbstractWidgetProps = {\n id: \"GroupingMappingWidget\",\n label: \"Grouping & Mapping\",\n getWidgetContent: () => {\n return <GroupingMapping accessToken={this._accessToken} prefix={this._prefix} />;\n },\n };\n\n widgets.push(GroupingMappingWidget);\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./BlockingOverlay.scss";
|
|
3
|
+
export interface BlockingOverlayProps {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const BlockingOverlay: ({ isVisible }: BlockingOverlayProps) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=BlockingOverlay.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BlockingOverlay = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const react_1 = __importDefault(require("react"));
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
require("./BlockingOverlay.scss");
|
|
15
|
+
const BlockingOverlay = ({ isVisible }) => {
|
|
16
|
+
return (react_1.default.createElement("div", { className: classnames_1.default("group-mapping-blocking-overlay", isVisible && "visible") },
|
|
17
|
+
react_1.default.createElement("div", { className: "group-mapping-blocking-overlay-spinner" },
|
|
18
|
+
react_1.default.createElement(utils_1.LoadingSpinner, null))));
|
|
19
|
+
};
|
|
20
|
+
exports.BlockingOverlay = BlockingOverlay;
|
|
21
|
+
//# sourceMappingURL=BlockingOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockingOverlay.js","sourceRoot":"","sources":["../../../../src/widget/components/BlockingOverlay.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,4DAAoC;AACpC,kDAA0B;AAC1B,mCAAyC;AACzC,kCAAgC;AAMzB,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAwB,EAAE,EAAE;IACrE,OAAO,CACL,uCAAK,SAAS,EAAE,oBAAU,CAAC,gCAAgC,EAAE,SAAS,IAAI,SAAS,CAAC;QAClF,uCAAK,SAAS,EAAC,wCAAwC;YACrD,8BAAC,sBAAc,OAAG,CACd,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B","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 classnames from \"classnames\";\nimport React from \"react\";\nimport { LoadingSpinner } from \"./utils\";\nimport \"./BlockingOverlay.scss\";\n\nexport interface BlockingOverlayProps {\n isVisible: boolean;\n}\n\nexport const BlockingOverlay = ({ isVisible }: BlockingOverlayProps) => {\n return (\n <div className={classnames(\"group-mapping-blocking-overlay\", isVisible && \"visible\")}>\n <div className=\"group-mapping-blocking-overlay-spinner\">\n <LoadingSpinner />\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 '~@itwin/itwinui-css/scss/variables';
|
|
6
|
+
|
|
7
|
+
.group-mapping-blocking-overlay {
|
|
8
|
+
background-color: black;
|
|
9
|
+
position: absolute;
|
|
10
|
+
height: inherit;
|
|
11
|
+
right: 6px;
|
|
12
|
+
left: 6px;
|
|
13
|
+
opacity: 60%;
|
|
14
|
+
z-index: 9999;
|
|
15
|
+
visibility: hidden;
|
|
16
|
+
|
|
17
|
+
&.visible {
|
|
18
|
+
visibility: visible;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.group-mapping-blocking-overlay-spinner {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
height: inherit;
|
|
26
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./CalculatedPropertyAction.scss";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CalculatedPropertyType } from "./CalculatedPropertyTable";
|
|
4
4
|
interface CalculatedPropertyActionProps {
|
|
5
5
|
iModelId: string;
|
|
6
6
|
mappingId: string;
|
|
7
7
|
groupId: string;
|
|
8
|
-
property?:
|
|
8
|
+
property?: CalculatedPropertyType;
|
|
9
9
|
ids: string[];
|
|
10
|
-
returnFn: () => Promise<void>;
|
|
10
|
+
returnFn: (modified: boolean) => Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
declare const CalculatedPropertyAction: ({ iModelId, mappingId, groupId, property, ids, returnFn, }: CalculatedPropertyActionProps) => JSX.Element;
|
|
13
13
|
export default CalculatedPropertyAction;
|
|
@@ -29,15 +29,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
30
30
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
|
-
const reportingClient_1 = require("../../api/reportingClient");
|
|
33
32
|
const ActionPanel_1 = __importDefault(require("./ActionPanel"));
|
|
34
33
|
const BboxDimensionsDecorator_1 = require("../../decorators/BboxDimensionsDecorator");
|
|
35
34
|
const useValidator_1 = __importStar(require("../hooks/useValidator"));
|
|
36
35
|
const utils_1 = require("./utils");
|
|
37
36
|
const viewerUtils_1 = require("./viewerUtils");
|
|
38
37
|
require("./CalculatedPropertyAction.scss");
|
|
38
|
+
const insights_client_1 = require("@itwin/insights-client");
|
|
39
|
+
const GroupingMapping_1 = require("./GroupingMapping");
|
|
39
40
|
const CalculatedPropertyAction = ({ iModelId, mappingId, groupId, property, ids, returnFn, }) => {
|
|
40
41
|
var _a, _b, _c;
|
|
42
|
+
const apiContext = react_1.useContext(GroupingMapping_1.ApiContext);
|
|
41
43
|
const [propertyName, setPropertyName] = react_1.useState((_a = property === null || property === void 0 ? void 0 : property.propertyName) !== null && _a !== void 0 ? _a : "");
|
|
42
44
|
const [type, setType] = react_1.useState((_b = property === null || property === void 0 ? void 0 : property.type) !== null && _b !== void 0 ? _b : "");
|
|
43
45
|
const [bboxDecorator, setBboxDecorator] = react_1.useState();
|
|
@@ -86,14 +88,17 @@ const CalculatedPropertyAction = ({ iModelId, mappingId, groupId, property, ids,
|
|
|
86
88
|
}
|
|
87
89
|
try {
|
|
88
90
|
setIsLoading(true);
|
|
89
|
-
const
|
|
90
|
-
propertyName,
|
|
91
|
-
type,
|
|
92
|
-
};
|
|
91
|
+
const reportingClientApi = new insights_client_1.ReportingClient(apiContext.prefix);
|
|
93
92
|
property
|
|
94
|
-
? await
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
? await reportingClientApi.updateCalculatedProperty(apiContext.accessToken, iModelId, mappingId, groupId, (_a = property.id) !== null && _a !== void 0 ? _a : "", {
|
|
94
|
+
propertyName,
|
|
95
|
+
type,
|
|
96
|
+
})
|
|
97
|
+
: await reportingClientApi.createCalculatedProperty(apiContext.accessToken, iModelId, mappingId, groupId, {
|
|
98
|
+
propertyName,
|
|
99
|
+
type,
|
|
100
|
+
});
|
|
101
|
+
await returnFn(true);
|
|
97
102
|
}
|
|
98
103
|
catch (error) {
|
|
99
104
|
utils_1.handleError(error.status);
|
|
@@ -107,7 +112,7 @@ const CalculatedPropertyAction = ({ iModelId, mappingId, groupId, property, ids,
|
|
|
107
112
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
108
113
|
react_1.default.createElement(utils_1.WidgetHeader, { title: property
|
|
109
114
|
? `${(_c = property === null || property === void 0 ? void 0 : property.propertyName) !== null && _c !== void 0 ? _c : ""}`
|
|
110
|
-
: "Create Calculated Property", returnFn: returnFn }),
|
|
115
|
+
: "Create Calculated Property", returnFn: async () => returnFn(false) }),
|
|
111
116
|
react_1.default.createElement("div", { className: 'calculated-properties-action-container' },
|
|
112
117
|
react_1.default.createElement(itwinui_react_1.Fieldset, { legend: 'Calculated Property Details', className: 'details-form' },
|
|
113
118
|
react_1.default.createElement(itwinui_react_1.Small, { className: 'field-legend' }, "Asterisk * indicates mandatory fields."),
|
|
@@ -160,7 +165,7 @@ const CalculatedPropertyAction = ({ iModelId, mappingId, groupId, property, ids,
|
|
|
160
165
|
getSpatialData(option.value)))), selectedItemRenderer: (option) => (react_1.default.createElement("div", { className: 'select-item' },
|
|
161
166
|
react_1.default.createElement("div", null, option.label),
|
|
162
167
|
getSpatialData(option.value))), onShow: () => { }, onHide: () => { } }))),
|
|
163
|
-
react_1.default.createElement(ActionPanel_1.default, { onSave: onSave, onCancel: returnFn, isSavingDisabled: !(type && propertyName), isLoading: isLoading })));
|
|
168
|
+
react_1.default.createElement(ActionPanel_1.default, { onSave: onSave, onCancel: async () => returnFn(false), isSavingDisabled: !(type && propertyName), isLoading: isLoading })));
|
|
164
169
|
};
|
|
165
170
|
exports.default = CalculatedPropertyAction;
|
|
166
171
|
//# sourceMappingURL=CalculatedPropertyAction.js.map
|