@nongt/visql 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MuiTimePicker-CROJXSCL.js → MuiTimePicker-CDzORsxO.js} +1 -1
- package/dist/{PipelineEditor-BLLIEE7R.js → PipelineEditor-CkYV-gdB.js} +3281 -3262
- package/dist/core.js +6 -6
- package/dist/explain.js +3 -3
- package/dist/fixtures.js +1 -1
- package/dist/index.js +9 -9
- package/dist/{issueLocation-CVgAkXMQ.js → issueLocation-DYnJQgvr.js} +2 -2
- package/dist/mui-date-pickers-host.js +1 -1
- package/dist/mui-date-pickers.js +1 -1
- package/dist/mui.js +26 -26
- package/dist/{params-fC03h7rg.js → params-CXRW5B8V.js} +821 -803
- package/dist/{schema-DsMO9oFE.js → schema-C-CgG78X.js} +178 -168
- package/dist/sql-import.js +1 -1
- package/dist/{sqlGen-Czxwqv0E.js → sqlGen-BSHDYdHB.js} +2 -2
- package/dist/{tokens-3SURLAkL.js → tokens-D5mWwogd.js} +10 -6
- package/dist/types/core/schema.d.ts +22 -4
- package/dist/types/core/theme/tokens.d.ts +1 -0
- package/package.json +1 -1
|
@@ -38,6 +38,8 @@ const u = {
|
|
|
38
38
|
fieldGroupBorder: "#fffbeb",
|
|
39
39
|
// The outline around a field card
|
|
40
40
|
fieldCardBorder: "transparent",
|
|
41
|
+
// The row under the pointer in a picker's list or a menu
|
|
42
|
+
optionHoverBg: "rgba(0, 0, 0, 0.04)",
|
|
41
43
|
// IF / CASE (conditional values)
|
|
42
44
|
conditional: "#fbbf24",
|
|
43
45
|
conditionalOnField: "#d97706",
|
|
@@ -107,6 +109,8 @@ const u = {
|
|
|
107
109
|
fieldGroupBorder: "#2c405f",
|
|
108
110
|
// The outline around a field card
|
|
109
111
|
fieldCardBorder: "#2c405f",
|
|
112
|
+
// The row under the pointer in a picker's list or a menu
|
|
113
|
+
optionHoverBg: "rgba(94, 234, 212, 0.16)",
|
|
110
114
|
// IF / CASE (conditional values)
|
|
111
115
|
conditional: "#c4b5fd",
|
|
112
116
|
conditionalOnField: "#7c3aed",
|
|
@@ -141,23 +145,23 @@ function a(e) {
|
|
|
141
145
|
function s(e) {
|
|
142
146
|
return `var(${a(e)})`;
|
|
143
147
|
}
|
|
144
|
-
const
|
|
148
|
+
const t = Object.keys(g);
|
|
145
149
|
function l() {
|
|
146
|
-
const e =
|
|
150
|
+
const e = t.map((r) => `${a(r)}:${g[r]};`).join("");
|
|
147
151
|
return `:where(.${c}){${e}}`;
|
|
148
152
|
}
|
|
149
153
|
function B(e) {
|
|
150
154
|
const r = {};
|
|
151
|
-
return e &&
|
|
155
|
+
return e && t.forEach((o) => {
|
|
152
156
|
const d = e[o];
|
|
153
157
|
d !== void 0 && (r[a(o)] = d);
|
|
154
158
|
}), r;
|
|
155
159
|
}
|
|
156
160
|
function b(e, r) {
|
|
157
161
|
const o = getComputedStyle(e), d = { ...r };
|
|
158
|
-
return
|
|
159
|
-
const n = o.getPropertyValue(a(
|
|
160
|
-
n && (d[
|
|
162
|
+
return t.forEach((f) => {
|
|
163
|
+
const n = o.getPropertyValue(a(f)).trim();
|
|
164
|
+
n && (d[f] = n);
|
|
161
165
|
}), d;
|
|
162
166
|
}
|
|
163
167
|
export {
|
|
@@ -28,6 +28,10 @@ export interface TableColumn {
|
|
|
28
28
|
label: string;
|
|
29
29
|
type: DatabaseColumnType;
|
|
30
30
|
nullable?: boolean;
|
|
31
|
+
/** What the column means, for whoever builds a query: a line under its
|
|
32
|
+
* label in the field picker (search matches it too), and shown on
|
|
33
|
+
* hovering it once picked. E.g. that NULL means "not specified". */
|
|
34
|
+
description?: string;
|
|
31
35
|
/** A fixed set of allowed values (an enum, a status…). Values compared
|
|
32
36
|
* against this column are then picked from a dropdown instead of typed. */
|
|
33
37
|
options?: ColumnOption[];
|
|
@@ -56,14 +60,28 @@ export interface ColumnOption {
|
|
|
56
60
|
* `toTable.toColumn` — so the `from` side is the "many" side (e.g.
|
|
57
61
|
* sale_transaction.product_id → product.id). The reverse direction
|
|
58
62
|
* (product → its sales) is derived wherever it's needed; never declare it as
|
|
59
|
-
* a second entry (validateSchema reports that as a duplicate).
|
|
60
|
-
*
|
|
63
|
+
* a second entry (validateSchema reports that as a duplicate). A key of
|
|
64
|
+
* several columns lists the others in `also`. */
|
|
61
65
|
export interface Relation {
|
|
62
66
|
fromTable: string;
|
|
63
67
|
fromColumn: string;
|
|
64
68
|
toTable: string;
|
|
65
69
|
toColumn: string;
|
|
70
|
+
/** The key's other columns, when it's more than one (issue 44): a sale
|
|
71
|
+
* line referencing its sale by `store_id` and `sale_no`. A join's ON
|
|
72
|
+
* then matches every pair, ANDed. */
|
|
73
|
+
also?: {
|
|
74
|
+
fromColumn: string;
|
|
75
|
+
toColumn: string;
|
|
76
|
+
}[];
|
|
66
77
|
}
|
|
78
|
+
/** Every column pair of a relation's key, `fromColumn`/`toColumn` first. */
|
|
79
|
+
export declare function keyColumns(r: Relation): {
|
|
80
|
+
fromColumn: string;
|
|
81
|
+
toColumn: string;
|
|
82
|
+
}[];
|
|
83
|
+
/** `conditions` ANDed: the one alone, else a group of them. */
|
|
84
|
+
export declare function allOf(conditions: ExpressionNode[]): ExpressionNode;
|
|
67
85
|
/** Everything the builder knows about the database it's building queries for —
|
|
68
86
|
* supplied by the host app (PipelineEditor's `schema` prop, distributed to
|
|
69
87
|
* components via SchemaContext) rather than baked into this package. Every
|
|
@@ -173,8 +191,8 @@ export interface SuggestJoinOptions {
|
|
|
173
191
|
* order (base table first, then join-insertion order) and the first
|
|
174
192
|
* relation found wins, so the result is deterministic. A table with
|
|
175
193
|
* `passThrough: false` is tried only for itself, or when the query has no
|
|
176
|
-
* other table (startsOf). `joinType` is 'left' when the relation's FK
|
|
177
|
-
*
|
|
194
|
+
* other table (startsOf). `joinType` is 'left' when one of the relation's FK
|
|
195
|
+
* columns (`fromColumn`, `also`) is nullable (e.g. sale_transaction.promotion_id:
|
|
178
196
|
* an INNER join there would silently drop unpromoted sales) or the table
|
|
179
197
|
* it's tied to is in `options.leftJoined`, and 'inner' otherwise. Returns
|
|
180
198
|
* undefined if no relation connects `newTable` to anything already
|