@adaptabletools/adaptable 24.0.1 → 24.0.2
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/package.json +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +3 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +15 -7
- package/src/Utilities/Services/QueryLanguageService.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +22 -31
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/aql/api/QueryLanguageApi.d.ts +2 -1
- package/vendor/aql/api/QueryLanguageApi.d.ts.map +1 -1
- package/vendor/aql/api/QueryLanguageApi.js +28 -108
- package/vendor/aql/api/QueryLanguageApi.js.map +1 -1
- package/vendor/aql/contract/index.js +0 -34
- package/vendor/aql/contract/index.js.map +1 -1
- package/vendor/aql/corpus/corpusExpressions.js +0 -13
- package/vendor/aql/corpus/corpusExpressions.js.map +1 -1
- package/vendor/aql/corpus/corpusFixture.js +0 -7
- package/vendor/aql/corpus/corpusFixture.js.map +1 -1
- package/vendor/aql/draft/index.js +0 -4
- package/vendor/aql/draft/index.js.map +1 -1
- package/vendor/aql/evaluate.js +0 -22
- package/vendor/aql/evaluate.js.map +1 -1
- package/vendor/aql/evaluator/ExpressionEvaluationError.js +0 -4
- package/vendor/aql/evaluator/ExpressionEvaluationError.js.map +1 -1
- package/vendor/aql/evaluator/ExpressionNaError.js +0 -4
- package/vendor/aql/evaluator/ExpressionNaError.js.map +1 -1
- package/vendor/aql/evaluator/evaluateNode.js +0 -23
- package/vendor/aql/evaluator/evaluateNode.js.map +1 -1
- package/vendor/aql/functions/dateUtils.js +0 -63
- package/vendor/aql/functions/dateUtils.js.map +1 -1
- package/vendor/aql/functions/numberUtils.js +0 -12
- package/vendor/aql/functions/numberUtils.js.map +1 -1
- package/vendor/aql/functions/operatorFunctions.js +0 -13
- package/vendor/aql/functions/operatorFunctions.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/AND.js +0 -5
- package/vendor/aql/functions/scalar/functions/AND.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/ANY_CHANGE.js +0 -4
- package/vendor/aql/functions/scalar/functions/ANY_CHANGE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/ANY_CONTAINS.js +0 -4
- package/vendor/aql/functions/scalar/functions/ANY_CONTAINS.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/AVG.js +0 -1
- package/vendor/aql/functions/scalar/functions/AVG.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/CASE.js +2 -2
- package/vendor/aql/functions/scalar/functions/CASE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/COL.js +0 -2
- package/vendor/aql/functions/scalar/functions/COL.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/CONTAINS.js +0 -3
- package/vendor/aql/functions/scalar/functions/CONTAINS.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/DATE.js +0 -2
- package/vendor/aql/functions/scalar/functions/DATE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/ENDS_WITH.js +0 -1
- package/vendor/aql/functions/scalar/functions/ENDS_WITH.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/EQ.js +0 -5
- package/vendor/aql/functions/scalar/functions/EQ.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/GT.js +0 -3
- package/vendor/aql/functions/scalar/functions/GT.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/GTE.js +0 -3
- package/vendor/aql/functions/scalar/functions/GTE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IF.js +0 -5
- package/vendor/aql/functions/scalar/functions/IF.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IFERROR.js +0 -4
- package/vendor/aql/functions/scalar/functions/IFERROR.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IFNA.js +0 -5
- package/vendor/aql/functions/scalar/functions/IFNA.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IN.d.ts.map +1 -1
- package/vendor/aql/functions/scalar/functions/IN.js +54 -11
- package/vendor/aql/functions/scalar/functions/IN.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IS_BLANK.js +0 -1
- package/vendor/aql/functions/scalar/functions/IS_BLANK.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IS_DIFFERENT_DAY.js +0 -1
- package/vendor/aql/functions/scalar/functions/IS_DIFFERENT_DAY.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/IS_NOT_BLANK.js +0 -1
- package/vendor/aql/functions/scalar/functions/IS_NOT_BLANK.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/LT.js +0 -3
- package/vendor/aql/functions/scalar/functions/LT.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/LTE.js +0 -3
- package/vendor/aql/functions/scalar/functions/LTE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/NA.js +0 -3
- package/vendor/aql/functions/scalar/functions/NA.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/NOT_CONTAINS.js +0 -1
- package/vendor/aql/functions/scalar/functions/NOT_CONTAINS.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/NOT_IN.js +0 -3
- package/vendor/aql/functions/scalar/functions/NOT_IN.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/OR.js +0 -4
- package/vendor/aql/functions/scalar/functions/OR.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/PRODUCT.js +0 -6
- package/vendor/aql/functions/scalar/functions/PRODUCT.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/QUERY.js +0 -1
- package/vendor/aql/functions/scalar/functions/QUERY.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/REGEX.js +0 -1
- package/vendor/aql/functions/scalar/functions/REGEX.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/SCOPE.js +0 -4
- package/vendor/aql/functions/scalar/functions/SCOPE.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/STARTS_WITH.js +0 -1
- package/vendor/aql/functions/scalar/functions/STARTS_WITH.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/SUB.js +0 -1
- package/vendor/aql/functions/scalar/functions/SUB.js.map +1 -1
- package/vendor/aql/functions/scalar/functions/SUM.js +0 -5
- package/vendor/aql/functions/scalar/functions/SUM.js.map +1 -1
- package/vendor/aql/functions/scalar/helpers.js +0 -3
- package/vendor/aql/functions/scalar/helpers.js.map +1 -1
- package/vendor/aql/functions/shared/FIELD.js +0 -3
- package/vendor/aql/functions/shared/FIELD.js.map +1 -1
- package/vendor/aql/functions/shared/VAR.js +0 -4
- package/vendor/aql/functions/shared/VAR.js.map +1 -1
- package/vendor/aql/functions/shared/index.js +0 -9
- package/vendor/aql/functions/shared/index.js.map +1 -1
- package/vendor/aql/functions/stringUtils.js +0 -25
- package/vendor/aql/functions/stringUtils.js.map +1 -1
- package/vendor/aql/functions/utils.js +0 -20
- package/vendor/aql/functions/utils.js.map +1 -1
- package/vendor/aql/host/access.js +0 -2
- package/vendor/aql/host/access.js.map +1 -1
- package/vendor/aql/host/createHostExpressionContext.js +0 -25
- package/vendor/aql/host/createHostExpressionContext.js.map +1 -1
- package/vendor/aql/host/createObjectDataHost.js +0 -9
- package/vendor/aql/host/createObjectDataHost.js.map +1 -1
- package/vendor/aql/index.js +0 -2
- package/vendor/aql/index.js.map +1 -1
- package/vendor/aql/normalize/canonicalize.js +0 -7
- package/vendor/aql/normalize/canonicalize.js.map +1 -1
- package/vendor/aql/normalize/migrateExpression.js +0 -8
- package/vendor/aql/normalize/migrateExpression.js.map +1 -1
- package/vendor/aql/normalize/names.js +0 -72
- package/vendor/aql/normalize/names.js.map +1 -1
- package/vendor/aql/normalize/normalizeAst.js +0 -102
- package/vendor/aql/normalize/normalizeAst.js.map +1 -1
- package/vendor/aql/normalize/print.js +0 -35
- package/vendor/aql/normalize/print.js.map +1 -1
- package/vendor/aql/operator/primitiveSlots.js +0 -4
- package/vendor/aql/operator/primitiveSlots.js.map +1 -1
- package/vendor/aql/operator/resolve.js +0 -18
- package/vendor/aql/operator/resolve.js.map +1 -1
- package/vendor/aql/parser/parser.js +4 -125
- package/vendor/aql/parser/parser.js.map +1 -1
- package/vendor/aql/plan/catalogue.js +0 -35
- package/vendor/aql/plan/catalogue.js.map +1 -1
- package/vendor/aql/plan/compile.js +0 -68
- package/vendor/aql/plan/compile.js.map +1 -1
- package/vendor/aql/plan/deepMap.js +0 -16
- package/vendor/aql/plan/deepMap.js.map +1 -1
- package/vendor/aql/plan/execute.js +0 -91
- package/vendor/aql/plan/execute.js.map +1 -1
- package/vendor/aql/plan/magnitudeLiteral.js +0 -29
- package/vendor/aql/plan/magnitudeLiteral.js.map +1 -1
- package/vendor/aql/plan/observable.js +0 -31
- package/vendor/aql/plan/observable.js.map +1 -1
- package/vendor/aql/plan/observableFixture.js +0 -3
- package/vendor/aql/plan/observableFixture.js.map +1 -1
- package/vendor/aql/plan/operators.js +0 -35
- package/vendor/aql/plan/operators.js.map +1 -1
- package/vendor/aql/plan/outer.js +0 -16
- package/vendor/aql/plan/outer.js.map +1 -1
- package/vendor/aql/predicate/mapExpressionToQlPredicate.js +1 -46
- package/vendor/aql/predicate/mapExpressionToQlPredicate.js.map +1 -1
- package/vendor/aql/predicate/mapQlPredicateToExpression.js +0 -13
- package/vendor/aql/predicate/mapQlPredicateToExpression.js.map +1 -1
- package/vendor/aql/store/computedValueStore.js +0 -35
- package/vendor/aql/store/computedValueStore.js.map +1 -1
- package/vendor/aql/store/history/clock.js +0 -1
- package/vendor/aql/store/history/clock.js.map +1 -1
- package/vendor/aql/store/history/historyStore.js +0 -14
- package/vendor/aql/store/history/historyStore.js.map +1 -1
- package/vendor/aql/store/history/monotonicDeque.js +0 -9
- package/vendor/aql/store/history/monotonicDeque.js.map +1 -1
- package/vendor/aql/store/history/operators.js +0 -13
- package/vendor/aql/store/history/operators.js.map +1 -1
- package/vendor/aql/store/history/ringBuffer.js +0 -12
- package/vendor/aql/store/history/ringBuffer.js.map +1 -1
- package/vendor/aql/store/history/rowSeries.js +0 -17
- package/vendor/aql/store/history/rowSeries.js.map +1 -1
- package/vendor/aql/store/history/types.js +0 -18
- package/vendor/aql/store/history/types.js.map +1 -1
- package/vendor/aql/tokenizer/tokenizer.js +0 -3
- package/vendor/aql/tokenizer/tokenizer.js.map +1 -1
- package/vendor/aql/types.js +0 -27
- package/vendor/aql/types.js.map +1 -1
- package/vendor/aql/utils/astUtils.js +0 -1
- package/vendor/aql/utils/astUtils.js.map +1 -1
- package/vendor/aql/utils/dependencyCycle.js +0 -5
- package/vendor/aql/utils/dependencyCycle.js.map +1 -1
- package/vendor/aql/validation/classifyExpression.js +0 -4
- package/vendor/aql/validation/classifyExpression.js.map +1 -1
- package/vendor/aql/validation/functionMetadata.js +0 -31
- package/vendor/aql/validation/functionMetadata.js.map +1 -1
- package/vendor/aql/validation/validateAqlExpression.js +2 -81
- package/vendor/aql/validation/validateAqlExpression.js.map +1 -1
- package/vendor/aql/validation/validateExpressionTypes.js +0 -64
- package/vendor/aql/validation/validateExpressionTypes.js.map +1 -1
- package/vendor/components/Button/index.js +0 -6
- package/vendor/components/Button/index.js.map +1 -1
- package/vendor/components/ColorField/index.js +0 -18
- package/vendor/components/ColorField/index.js.map +1 -1
- package/vendor/components/ColorPicker/colorPickerTab.js +0 -6
- package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -1
- package/vendor/components/ColorPicker/index.js +1 -66
- package/vendor/components/ColorPicker/index.js.map +1 -1
- package/vendor/components/ColorPicker/themeColors.js +0 -55
- package/vendor/components/ColorPicker/themeColors.js.map +1 -1
- package/vendor/components/Combobox/VirtualizedList.js +0 -5
- package/vendor/components/Combobox/VirtualizedList.js.map +1 -1
- package/vendor/components/Combobox/comboboxUtils.js +0 -5
- package/vendor/components/Combobox/comboboxUtils.js.map +1 -1
- package/vendor/components/Combobox/index.js +7 -106
- package/vendor/components/Combobox/index.js.map +1 -1
- package/vendor/components/Combobox/useScrollNearEnd.js +0 -6
- package/vendor/components/Combobox/useScrollNearEnd.js.map +1 -1
- package/vendor/components/DropdownButton/index.js +0 -5
- package/vendor/components/DropdownButton/index.js.map +1 -1
- package/vendor/components/NumberInput/index.js +0 -10
- package/vendor/components/NumberInput/index.js.map +1 -1
- package/vendor/components/Resizable/index.js +3 -26
- package/vendor/components/Resizable/index.js.map +1 -1
- package/vendor/components/Resizable/resizableUtils.js +0 -24
- package/vendor/components/Resizable/resizableUtils.js.map +1 -1
- package/vendor/components/SearchInput/index.js +0 -5
- package/vendor/components/SearchInput/index.js.map +1 -1
- package/vendor/components/Tree/TreeDropdown/index.js +3 -139
- package/vendor/components/Tree/TreeDropdown/index.js.map +1 -1
- package/vendor/components/Tree/treeUtils.js +0 -4
- package/vendor/components/Tree/treeUtils.js.map +1 -1
- package/vendor/components/index.js +0 -5
- package/vendor/components/index.js.map +1 -1
- package/vendor/components/lib/useProperty.js +0 -18
- package/vendor/components/lib/useProperty.js.map +1 -1
- package/vendor/components/twMerge.js +0 -2
- package/vendor/components/twMerge.js.map +1 -1
- package/vendor/components/twUtils.js +3 -12
- package/vendor/components/twUtils.js.map +1 -1
- package/vendor/components/ui/alert-dialog.js +0 -4
- package/vendor/components/ui/alert-dialog.js.map +1 -1
- package/vendor/components/ui/calendar.js +1 -9
- package/vendor/components/ui/calendar.js.map +1 -1
- package/vendor/components/ui/combobox.js +2 -38
- package/vendor/components/ui/combobox.js.map +1 -1
- package/vendor/components/ui/dialog.js +0 -4
- package/vendor/components/ui/dialog.js.map +1 -1
- package/vendor/components/ui/input-group.js +3 -12
- package/vendor/components/ui/input-group.js.map +1 -1
- package/vendor/components/ui/tabs.js +0 -3
- package/vendor/components/ui/tabs.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/shared/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/shared/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Excel-compatible string extractors. Positions are 1-based where applicable.
|
|
3
|
-
* Non-string inputs are coerced with `String(...)` (same spirit as `LEN`).
|
|
4
|
-
*/
|
|
5
1
|
const asText = (value) => {
|
|
6
2
|
if (value == null) {
|
|
7
3
|
return '';
|
|
@@ -12,7 +8,6 @@ const asCount = (value) => {
|
|
|
12
8
|
const n = Math.trunc(Number(value));
|
|
13
9
|
return Number.isFinite(n) ? n : 0;
|
|
14
10
|
};
|
|
15
|
-
/** First `count` characters (Excel `LEFT`). */
|
|
16
11
|
export const extractLeft = (value, count) => {
|
|
17
12
|
const text = asText(value);
|
|
18
13
|
const n = asCount(count);
|
|
@@ -21,7 +16,6 @@ export const extractLeft = (value, count) => {
|
|
|
21
16
|
}
|
|
22
17
|
return text.slice(0, n);
|
|
23
18
|
};
|
|
24
|
-
/** Last `count` characters (Excel `RIGHT`). */
|
|
25
19
|
export const extractRight = (value, count) => {
|
|
26
20
|
const text = asText(value);
|
|
27
21
|
const n = asCount(count);
|
|
@@ -30,10 +24,6 @@ export const extractRight = (value, count) => {
|
|
|
30
24
|
}
|
|
31
25
|
return text.slice(-n);
|
|
32
26
|
};
|
|
33
|
-
/**
|
|
34
|
-
* `count` characters starting at 1-based `start` (Excel `MID`).
|
|
35
|
-
* `start < 1` is treated as starting at 1.
|
|
36
|
-
*/
|
|
37
27
|
export const extractMid = (value, start, count) => {
|
|
38
28
|
const text = asText(value);
|
|
39
29
|
const startPos = asCount(start);
|
|
@@ -44,13 +34,6 @@ export const extractMid = (value, start, count) => {
|
|
|
44
34
|
const from = Math.max(startPos, 1) - 1;
|
|
45
35
|
return text.slice(from, from + n);
|
|
46
36
|
};
|
|
47
|
-
/**
|
|
48
|
-
* Excel-compatible `TEXTJOIN(delimiter, ignore_empty, text1, …)`.
|
|
49
|
-
* Nested arrays are flattened. When `ignoreEmpty` is truthy, empty strings
|
|
50
|
-
* (and null/undefined coerced to `''`) are skipped so delimiters do not double.
|
|
51
|
-
*
|
|
52
|
-
* Use this (not `CONCAT`) when a delimiter is needed — `CONCAT` joins with no separator.
|
|
53
|
-
*/
|
|
54
37
|
export const textJoin = (delimiter, ignoreEmpty, ...texts) => {
|
|
55
38
|
const sep = delimiter == null ? '' : String(delimiter);
|
|
56
39
|
const skipEmpty = Boolean(ignoreEmpty);
|
|
@@ -60,19 +43,11 @@ export const textJoin = (delimiter, ignoreEmpty, ...texts) => {
|
|
|
60
43
|
const filtered = skipEmpty ? parts.filter((part) => part !== '') : parts;
|
|
61
44
|
return filtered.join(sep);
|
|
62
45
|
};
|
|
63
|
-
/** Excel-style `CONCAT`: join with no delimiter. Null/undefined → `''`. */
|
|
64
46
|
export const concatTexts = (...texts) => {
|
|
65
47
|
return texts.map((value) => asText(value)).join('');
|
|
66
48
|
};
|
|
67
|
-
/** Leading/trailing whitespace only (JS `trim`, not Excel’s collapse-of-internals). */
|
|
68
49
|
export const trimText = (value) => asText(value).trim();
|
|
69
50
|
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
70
|
-
/**
|
|
71
|
-
* Replace **all** literal occurrences of `search` in `text`.
|
|
72
|
-
* Case-insensitive mode uses an escaped global regex so special characters in
|
|
73
|
-
* `search` are treated literally (not as a pattern).
|
|
74
|
-
* Empty `search` leaves `text` unchanged (avoids split/`RegExp('')` pitfalls).
|
|
75
|
-
*/
|
|
76
51
|
export const replaceAllLiteral = (text, search, replacement, caseInsensitive) => {
|
|
77
52
|
const haystack = asText(text);
|
|
78
53
|
const needle = asText(search);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../../src/functions/stringUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../../src/functions/stringUtils.ts"],"names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,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAEzE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAQ7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAa,EACb,MAAe,EACf,WAAoB,EACpB,eAAwB,EAChB,EAAE;IACV,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QAClB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { ExpressionEvaluationError } from '../evaluator/ExpressionEvaluationError.js';
|
|
2
2
|
export const isNullOrEmpty = (value) => value == null || (typeof value === 'string' && value.trim().length === 0);
|
|
3
|
-
/** Blank cell: null / undefined / whitespace-only string (aggregations skip these). */
|
|
4
3
|
export const isUndefinedValue = (input) => input == undefined || (typeof input === 'string' && input.trim() === '');
|
|
5
4
|
export const isDefinedValue = (input) => !isUndefinedValue(input);
|
|
6
|
-
// string functions may be case (in)sensitive, see host.isTextComparisonCaseSensitive()
|
|
7
|
-
// if case is insensitive, we convert ALL involved strings to lower case
|
|
8
5
|
export const getStringValues = (context, ...stringArguments) => {
|
|
9
6
|
return isTextSearchCaseInsensitive(context)
|
|
10
7
|
? stringArguments.map((string) => string.toLowerCase())
|
|
@@ -14,9 +11,6 @@ export const getStringValue = (context, stringArgument) => {
|
|
|
14
11
|
return isTextSearchCaseInsensitive(context) ? stringArgument.toLowerCase() : stringArgument;
|
|
15
12
|
};
|
|
16
13
|
export const isTextSearchCaseInsensitive = (context) => !context.isTextComparisonCaseSensitive?.();
|
|
17
|
-
/**
|
|
18
|
-
* Converts value to a number (drop-in replacement for lodash/toNumber).
|
|
19
|
-
*/
|
|
20
14
|
const _reTrimStart = /^\s+/;
|
|
21
15
|
const _reTrimEnd = /\s+$/;
|
|
22
16
|
const _reIsBinary = /^0b[01]+$/i;
|
|
@@ -51,10 +45,6 @@ export const toNumber = (value) => {
|
|
|
51
45
|
const other = typeof value.valueOf === 'function' ? value.valueOf() : value;
|
|
52
46
|
return +other;
|
|
53
47
|
};
|
|
54
|
-
/**
|
|
55
|
-
* Converts string to an integer with an explicit default radix of 10
|
|
56
|
-
* (drop-in replacement for lodash/parseInt).
|
|
57
|
-
*/
|
|
58
48
|
export const parseIntFn = (string, radix) => {
|
|
59
49
|
const str = typeof string === 'string' ? string.trim() : String(string);
|
|
60
50
|
return globalThis.parseInt(str, radix || 10);
|
|
@@ -69,7 +59,6 @@ export const getNumericValue = (input, returnRawValue) => {
|
|
|
69
59
|
}
|
|
70
60
|
return isNaN(numericValue) ? 0 : numericValue;
|
|
71
61
|
};
|
|
72
|
-
/** Finite number, or undefined when the value cannot be used in arithmetic. */
|
|
73
62
|
export const toFiniteNumber = (input) => {
|
|
74
63
|
const numericValue = getNumericValue(input, true);
|
|
75
64
|
return Number.isFinite(numericValue) ? numericValue : undefined;
|
|
@@ -101,10 +90,6 @@ export function extractParameters(consumingFunctionName, allowedType, allowedOpe
|
|
|
101
90
|
}
|
|
102
91
|
return result;
|
|
103
92
|
}
|
|
104
|
-
/**
|
|
105
|
-
* `COL(...)` in the operand pools (legacy observable / aggregated): validates the
|
|
106
|
-
* column and yields a {@link ColumnParameter} for the consuming function.
|
|
107
|
-
*/
|
|
108
93
|
export const handleColumnFunction = (args, context) => {
|
|
109
94
|
if (isNullOrEmpty(args[0])) {
|
|
110
95
|
throw new ExpressionEvaluationError('COL', `no column name is provided`);
|
|
@@ -124,11 +109,6 @@ export const validateColumnType = (columnId, validColumnTypes, consumingFunction
|
|
|
124
109
|
}
|
|
125
110
|
return columnType;
|
|
126
111
|
};
|
|
127
|
-
/**
|
|
128
|
-
* Declared column data type, or undefined when the column is missing / untyped.
|
|
129
|
-
* Does not throw — callers that cannot proceed without a type still use
|
|
130
|
-
* {@link validateColumnType}.
|
|
131
|
-
*/
|
|
132
112
|
export const resolveColumnType = (columnId, context) => {
|
|
133
113
|
return context.host.getColumn(columnId)?.dataType;
|
|
134
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAoBnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAW,EAAE,CACvD,KAAK,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/functions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAoBnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAW,EAAE,CACvD,KAAK,IAAI,IAAI,IAAI,CAAC,O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CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAE,OAA8B,EAAQ,EAAE;IACzF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,yBAAyB,CAAC,EAAE,EAAE,gBAAgB,QAAQ,gBAAgB,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,IAAI,yBAAyB,CAAC,EAAE,EAAE,gBAAgB,QAAQ,oBAAoB,CAAC,CAAC;IACxF,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/** Raw (pre-normalisation) cell value; falls back to the comparison value. */
|
|
2
1
|
export const hostGetRawColumnValue = (host, rowRef, columnId) => host.values?.getRawColumnValue
|
|
3
2
|
? host.values.getRawColumnValue(rowRef, columnId)
|
|
4
3
|
: host.getColumnValue(rowRef, columnId);
|
|
5
|
-
/** Display (formatted) cell value; falls back to the comparison value. */
|
|
6
4
|
export const hostGetDisplayValue = (host, rowRef, columnId) => host.values?.getDisplayValue
|
|
7
5
|
? host.values.getDisplayValue(rowRef, columnId)
|
|
8
6
|
: host.getColumnValue(rowRef, columnId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../../src/host/access.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../../src/host/access.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAa,EACb,MAAiB,EACjB,QAAgB,EACP,EAAE,CACX,IAAI,CAAC,MAAM,EAAE,iBAAiB;IAC5B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC;IACjD,CA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AAG,CACzC,IAAa,EACb,IAAY,EACQ,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,IAAa,EACb,IAAY,EACQ,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,uBAAuB,EAAE,CAAC,IAAI,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAa,EACb,IAAY,EACZ,IAAgB,EACP,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,IAAa,EACb,MAKC,EACoB,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { ExpressionEvaluationError } from '../evaluator/ExpressionEvaluationError.js';
|
|
2
2
|
import { hostGetFieldDataType, hostGetRawColumnValue } from './access.js';
|
|
3
|
-
/**
|
|
4
|
-
* Known per-evaluation fields. Derivation copies these (including `ext`)
|
|
5
|
-
* rather than spreading the whole context object, so rebuilt accessors never
|
|
6
|
-
* leak as config and host extras survive only through the typed `ext` slot.
|
|
7
|
-
*/
|
|
8
3
|
const HOST_CONTEXT_CONFIG_KEYS = [
|
|
9
4
|
'host',
|
|
10
5
|
'functions',
|
|
@@ -21,17 +16,6 @@ const HOST_CONTEXT_CONFIG_KEYS = [
|
|
|
21
16
|
'clock',
|
|
22
17
|
'ext',
|
|
23
18
|
];
|
|
24
|
-
/**
|
|
25
|
-
* Memoizes a per-evaluation row-set provider so that N aggregations compiled
|
|
26
|
-
* from one expression share a single row pass (and a single WHERE evaluation
|
|
27
|
-
* per row) instead of re-scanning the grid per aggregated function.
|
|
28
|
-
*
|
|
29
|
-
* The wrapper is created per context and contexts are created per evaluation
|
|
30
|
-
* run, so the cache never outlives a run. Derived contexts re-wrap the
|
|
31
|
-
* parent's wrapper: they share the parent's resolved row set within the run
|
|
32
|
-
* (narrowing happens via `filterFn`, not by changing the row source), while a
|
|
33
|
-
* derivation that *overrides* `getRowRefs` naturally starts a fresh cache.
|
|
34
|
-
*/
|
|
35
19
|
const memoizeGetRowRefs = (getRowRefs) => {
|
|
36
20
|
if (!getRowRefs) {
|
|
37
21
|
return undefined;
|
|
@@ -50,8 +34,6 @@ const configOf = (context) => {
|
|
|
50
34
|
};
|
|
51
35
|
export const createHostExpressionContext = (config) => {
|
|
52
36
|
const { host } = config;
|
|
53
|
-
// Override / alias / rowRef are read from `context` at call time so a
|
|
54
|
-
// prepared evaluator can rebind them per row without rebuilding accessors.
|
|
55
37
|
const resolveColumnValue = (columnId, options) => {
|
|
56
38
|
const reference = options?.reference ?? 'COL';
|
|
57
39
|
const column = host.getColumn(columnId);
|
|
@@ -91,13 +73,6 @@ export const createHostExpressionContext = (config) => {
|
|
|
91
73
|
};
|
|
92
74
|
return context;
|
|
93
75
|
};
|
|
94
|
-
/**
|
|
95
|
-
* Builds a context that differs from `context` in the given fields — the shape
|
|
96
|
-
* `WHERE` clauses and per-row aggregation need (new row, other registry). The
|
|
97
|
-
* named-query call stack is shared unless explicitly replaced. `ext` is
|
|
98
|
-
* preserved unless the caller overrides it.
|
|
99
|
-
*/
|
|
100
|
-
/** Current time as the context's clock sees it (system clock when none is bound). */
|
|
101
76
|
export const getNow = (context) => context?.clock?.now() ?? Date.now();
|
|
102
77
|
export const deriveHostExpressionContext = (context, overrides) => createHostExpressionContext({ ...configOf(context), ...overrides });
|
|
103
78
|
//# sourceMappingURL=createHostExpressionContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHostExpressionContext.js","sourceRoot":"","sources":["../../../src/host/createHostExpressionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAMnF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"createHostExpressionContext.js","sourceRoot":"","sources":["../../../src/host/createHostExpressionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAMnF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAgBvE,MAAM,wBAAwB,GAAG;IAC/B,MAAM;IACN,WAAW;IACX,QAAQ;IACR,aAAa;IACb,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,qBAAqB;IACrB,SAAS;IACT,OAAO;IACP,KAAK;CACG,CAAC;AA4GX,MAAM,iBAAiB,GAAG,CACxB,UAA2C,EACV,EAAE;IACnC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,aAAsC,CAAC;IAC3C,OAAO,GAAG,EAAE,CAAC,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CACf,OAAoC,EACD,EAAE;IACrC,MAAM,MAAM,GAAG,EAAuC,CAAC;IACvD,KAAK,MAAM,GAAG,IAAI,wBAAwB,EAAE,CAAC;QAC3C,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;YAClB,MAA6C,CAAC,GAAG,CAAC,GACjD,OACD,CAAC,GAAG,CAAC,CAAC;QACT,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,MAAyC,EACZ,EAAE;IAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAIxB,MAAM,kBAAkB,GAAG,CACzB,QAAgB,EAChB,OAAgC,EACvB,EAAE;QACX,MAAM,S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CAAC;YACpD,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBACjE,OAAO,iBAAiB,CAAC,KAAK,CAAC;YACjC,CAAC;YACD,OAAO,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QACD,aAAa,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;QAC3E,iBAAiB,EAAE,CAAC,QAAgB,EAA6B,EAAE,CACjE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,QAAQ;QACpC,gBAAgB,EAAE,CAAC,KAAa,EAAwB,EAAE,CACxD,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC;QACnC,6BAA6B,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,6BAA6B,EAAE;KAC1E,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAsC,EAAU,EAAE,CACvE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AAEtC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,OAAoC,EACpC,SAAqD,EACxB,EAAE,CAC/B,2BAA2B,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC"}
|
|
@@ -10,15 +10,6 @@ const defaultGetFieldValue = (row, field) => {
|
|
|
10
10
|
return value[key];
|
|
11
11
|
}, row);
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Reference `AqlHost` over an array of plain objects. No grid types, no
|
|
15
|
-
* legacy observables, no group-column matching — enough for scalar/boolean
|
|
16
|
-
* evaluation and aggregations.
|
|
17
|
-
*
|
|
18
|
-
* Host applications compose this with their own calendar / named-query /
|
|
19
|
-
* variable / comparison delegates (see Adaptable's
|
|
20
|
-
* `createExternalDataAqlHost`).
|
|
21
|
-
*/
|
|
22
13
|
export const createObjectDataHost = (config) => {
|
|
23
14
|
const rows = config.rows ?? [];
|
|
24
15
|
const columnDefs = new Map((config.columns ?? []).map((column) => [column.columnId, column]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createObjectDataHost.js","sourceRoot":"","sources":["../../../src/host/createObjectDataHost.ts"],"names":[],"mappings":"AAuCA,MAAM,KAAK,GAAG,CAAC,MAAiB,EAAuC,EAAE,CACvE,MAA6C,CAAC;AAEhD,MAAM,oBAAoB,GAAG,CAAC,GAAwC,EAAE,KAAa,EAAW,EAAE;IAChG,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAU,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACrD,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/C,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAQ,KAAiC,CAAC,GAAG,CAAC,CAAC;IACjD,CAAC,EAAE,GAAG,CAAC,CAAC;AACV,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"createObjectDataHost.js","sourceRoot":"","sources":["../../../src/host/createObjectDataHost.ts"],"names":[],"mappings":"AAuCA,MAAM,KAAK,GAAG,CAAC,MAAiB,EAAuC,EAAE,CACvE,MAA6C,CAAC;AAEhD,MAAM,oBAAoB,GAAG,CAAC,GAAwC,EAAE,KAAa,EAAW,EAAE;IAChG,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAU,CAAC,KAAK,EAAE,GAAG,EAAE,EA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,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1E,GAAG,MAAM,CAAC,UAAU;SACrB;QAED,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC,CAAC"}
|
package/vendor/aql/index.js
CHANGED
|
@@ -6,8 +6,6 @@ export { parse, getAST, evaluate, getAbstractSyntaxTree } from './evaluate.js';
|
|
|
6
6
|
export * from './normalize/index.js';
|
|
7
7
|
export * from './contract/index.js';
|
|
8
8
|
export * from './plan/index.js';
|
|
9
|
-
// `ComputedValueStore` and the history store ship from `@adaptabletools/aql/store`
|
|
10
|
-
// (see package.json exports).
|
|
11
9
|
export * from './predicate/index.js';
|
|
12
10
|
export * from './operator/index.js';
|
|
13
11
|
export * from './draft/index.js';
|
package/vendor/aql/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC5E,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC5E,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AA4BnC,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { parse } from '../evaluate.js';
|
|
2
2
|
import { normalizeAst } from './normalizeAst.js';
|
|
3
3
|
import { printAst } from './print.js';
|
|
4
|
-
/**
|
|
5
|
-
* Greenfield pretty-print (`print ∘ normalize ∘ parse`). Runtime only —
|
|
6
|
-
* leftover legacy spellings are not rewritten (use {@link migrateExpression}).
|
|
7
|
-
*
|
|
8
|
-
* Unparseable input is returned unchanged — cache/store keying must never
|
|
9
|
-
* throw, and unparseable text must not share a key with anything else.
|
|
10
|
-
*/
|
|
11
4
|
export function canonicalizeExpression(expression, options) {
|
|
12
5
|
const text = expression ?? '';
|
|
13
6
|
if (!text.trim()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../../src/normalize/canonicalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAyB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../../src/normalize/canonicalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAyB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASnC,MAAM,UAAU,sBAAsB,CACpC,UAAkB,EAClB,OAA0B;IAE1B,MAAM,IAAI,GAAG,UAAU,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { parse } from '../evaluate.js';
|
|
2
2
|
import { migrateAstDetailed } from './normalizeAst.js';
|
|
3
3
|
import { printAst } from './print.js';
|
|
4
|
-
/**
|
|
5
|
-
* Convert a (possibly legacy) expression to canonical greenfield text:
|
|
6
|
-
* `print ∘ migrateAst ∘ parse`.
|
|
7
|
-
*
|
|
8
|
-
* Unparseable input is returned unchanged with `error` set — never dropped
|
|
9
|
-
* or half-rewritten. Already-canonical text is a no-op (`changed: false`
|
|
10
|
-
* when print matches the input).
|
|
11
|
-
*/
|
|
12
4
|
export function migrateExpression(expression, options) {
|
|
13
5
|
const text = expression ?? '';
|
|
14
6
|
if (!text.trim()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateExpression.js","sourceRoot":"","sources":["../../../src/normalize/migrateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAyC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"migrateExpression.js","sourceRoot":"","sources":["../../../src/normalize/migrateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAyC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwBnC,MAAM,UAAU,iBAAiB,CAC/B,UAAkB,EAClB,OAAwB;IAExB,MAAM,IAAI,GAAG,UAAU,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACjB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,MAAM,GAA4B;YACtC,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,QAAQ,KAAK,IAAI;SAC3B,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACvB,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC9D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Name registries driving the normalizer's call classification.
|
|
3
|
-
*
|
|
4
|
-
* Deliberately curated as static sets — the normalizer must stay
|
|
5
|
-
* dependency-light (no function-pool imports, no rxjs) so it can be reused
|
|
6
|
-
* by tooling, migrations, and SSRM emission. `names.test.ts` cross-checks
|
|
7
|
-
* every set against the actual function pools so they cannot drift.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Aggregation call names that exist ONLY as aggregations (no scalar-pool
|
|
11
|
-
* homonym). A leftover paren call with one of these names can only mean
|
|
12
|
-
* the aggregation; `migrateAst` rewrites it to an `AGG_CALL`.
|
|
13
|
-
*
|
|
14
|
-
* Deliberately excluded:
|
|
15
|
-
* - `CUMUL` — higher-order wrapper, rewritten to the `CUMULATIVE` clause
|
|
16
|
-
* by migrate only.
|
|
17
|
-
* - `ABSOLUTE_DIFF` / `PERCENT_DIFF` / `PERCENTAGE` — wrappers kept
|
|
18
|
-
* callable as paren calls until their sugar expansion lands (they
|
|
19
|
-
* dissolve into scalar math, not brace calls).
|
|
20
|
-
* - comparators `EQ`..`GTE`, operand markers `OVER`/`WEIGHT`/`GROUP_BY`/
|
|
21
|
-
* `COL`/`WHERE` — not aggregation calls.
|
|
22
|
-
*/
|
|
23
1
|
export const AGGREGATION_ONLY_NAMES = new Set([
|
|
24
2
|
'MEDIAN',
|
|
25
3
|
'MODE',
|
|
@@ -39,14 +17,6 @@ export const AGGREGATION_ONLY_NAMES = new Set([
|
|
|
39
17
|
'LAST',
|
|
40
18
|
'RANK',
|
|
41
19
|
]);
|
|
42
|
-
/**
|
|
43
|
-
* Names that exist in BOTH the scalar and the aggregated pool. A leftover
|
|
44
|
-
* paren call with one of these is ambiguous: `migrateAst` rewrites it to
|
|
45
|
-
* an `AGG_CALL` only when the call shape proves aggregation (an operand-tag
|
|
46
|
-
* argument) or the migrate `aggregatedContext` hint says so and the call has exactly one
|
|
47
|
-
* argument (a single-argument dual name in aggregation context —
|
|
48
|
-
* multi-argument dual calls are the row-wise scalar).
|
|
49
|
-
*/
|
|
50
20
|
export const DUAL_AGGREGATION_NAMES = new Set([
|
|
51
21
|
'SUM',
|
|
52
22
|
'AVG',
|
|
@@ -54,25 +24,12 @@ export const DUAL_AGGREGATION_NAMES = new Set([
|
|
|
54
24
|
'MAX',
|
|
55
25
|
'PRODUCT',
|
|
56
26
|
]);
|
|
57
|
-
/**
|
|
58
|
-
* Legacy observable source names (`ROW_CHANGE{…}`, `GRID_CHANGE{…}`,
|
|
59
|
-
* `ROW_ADDED{}`, `ROW_REMOVED{}`). No longer evaluable: `migrateAst`
|
|
60
|
-
* rewrites them to observable comparisons (`rewriteLegacyObservable`) and
|
|
61
|
-
* the validator reports any leftover as an `AQL_LEGACY_SPELLING` error
|
|
62
|
-
* with the migrated text as the quick-fix.
|
|
63
|
-
*/
|
|
64
27
|
export const LEGACY_OBSERVABLE_SOURCE_NAMES = new Set([
|
|
65
28
|
'ROW_CHANGE',
|
|
66
29
|
'GRID_CHANGE',
|
|
67
30
|
'ROW_ADDED',
|
|
68
31
|
'ROW_REMOVED',
|
|
69
32
|
]);
|
|
70
|
-
/**
|
|
71
|
-
* Observable source names — brace calls that read a cell's change history
|
|
72
|
-
* (`CHANGE_COUNT{[price], WITHIN(5m)}`). Value nodes, legal anywhere a
|
|
73
|
-
* scalar is legal. `PERCENT_CHANGE` is dual-named: the paren form is the
|
|
74
|
-
* existing data-change scalar, the brace form is the windowed observable read.
|
|
75
|
-
*/
|
|
76
33
|
export const OBSERVABLE_SOURCE_NAMES = new Set([
|
|
77
34
|
'CHANGE_COUNT',
|
|
78
35
|
'NO_CHANGES',
|
|
@@ -88,26 +45,9 @@ export const OBSERVABLE_SOURCE_NAMES = new Set([
|
|
|
88
45
|
'ROWS_ADDED',
|
|
89
46
|
'ROWS_REMOVED',
|
|
90
47
|
]);
|
|
91
|
-
/**
|
|
92
|
-
* Retired clause spellings inside an observable brace body. `GRID()` was
|
|
93
|
-
* renamed `ALL_ROWS()`; `migrateAst` rewrites it and the validator reports a
|
|
94
|
-
* leftover as `AQL_LEGACY_SPELLING` with the rename as the quick-fix.
|
|
95
|
-
*/
|
|
96
48
|
export const RETIRED_CLAUSE_RENAMES = {
|
|
97
49
|
GRID: 'ALL_ROWS',
|
|
98
50
|
};
|
|
99
|
-
/**
|
|
100
|
-
* Named operand-call names that become `CLAUSE` nodes when they appear as
|
|
101
|
-
* items of a brace-call body (`GROUP_BY([m])`, `OVER([d])`, `WEIGHT([w])`,
|
|
102
|
-
* `CUMULATIVE([d])`, `ANY_COL()`, `WITHIN(5m)`, `LAST_N(20)`, `ALL_ROWS()`,
|
|
103
|
-
* `TRIGGER('edit')`) — and whose presence among a paren call's arguments is
|
|
104
|
-
* the shape proof that the call is an aggregation.
|
|
105
|
-
*
|
|
106
|
-
* Retired pattern markers (`COUNT` / `MIN` / `MAX` / `NONE`) are promoted
|
|
107
|
-
* only inside a legacy observable call being migrated —
|
|
108
|
-
* `MIN([bid], [ask])` as a computed aggregation input must stay a
|
|
109
|
-
* `FUNCTION`.
|
|
110
|
-
*/
|
|
111
51
|
export const OPERAND_CLAUSE_NAMES = new Set([
|
|
112
52
|
'GROUP_BY',
|
|
113
53
|
'OVER',
|
|
@@ -119,18 +59,12 @@ export const OPERAND_CLAUSE_NAMES = new Set([
|
|
|
119
59
|
'ALL_ROWS',
|
|
120
60
|
'TRIGGER',
|
|
121
61
|
]);
|
|
122
|
-
/**
|
|
123
|
-
* Legacy observable pattern-marker call names (`COUNT(3)`, `MIN()`,
|
|
124
|
-
* `MAX()`, `NONE()`). Recognised only while migrating a legacy observable
|
|
125
|
-
* call; they never survive into a normalized program.
|
|
126
|
-
*/
|
|
127
62
|
export const LEGACY_OBSERVABLE_MARKER_NAMES = new Set([
|
|
128
63
|
'COUNT',
|
|
129
64
|
'MIN',
|
|
130
65
|
'MAX',
|
|
131
66
|
'NONE',
|
|
132
67
|
]);
|
|
133
|
-
/** Clause node types of contract v3 (partition target for consumers). */
|
|
134
68
|
export const CLAUSE_TYPES = new Set([
|
|
135
69
|
'GROUP_BY',
|
|
136
70
|
'OVER',
|
|
@@ -143,12 +77,6 @@ export const CLAUSE_TYPES = new Set([
|
|
|
143
77
|
'ALL_ROWS',
|
|
144
78
|
'TRIGGER',
|
|
145
79
|
]);
|
|
146
|
-
/**
|
|
147
|
-
* Canonical clause order inside a normalized brace body, after the input
|
|
148
|
-
* expression and positional parameters (the `WHERE` filter clause always
|
|
149
|
-
* sorts last; unknown/future clauses sort before it, in source order).
|
|
150
|
-
* `ANY_COL` is the observable subject, so it sorts first.
|
|
151
|
-
*/
|
|
152
80
|
export const CANONICAL_CLAUSE_ORDER = [
|
|
153
81
|
'ANY_COL',
|
|
154
82
|
'GROUP_BY',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../src/normalize/names.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../../src/normalize/names.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,eAAe;IACf,OAAO;IACP,UAAU;IACV,YAAY;IACZ,OAAO;IACP,OAAO;IACP,SAAS;IACT,OAAO;IACP,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,SAAS;CACV,CAAC,CAAC;AASH,MAAM,CAAC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