@gingkoo/pandora-metabase 1.0.156 → 1.0.157-alpha.10
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/components/dialog/custom-editor/index.js +61 -5
- package/lib/cjs/components/dialog/expression/index.js +132 -54
- package/lib/cjs/components/dialog/expression/index.less +43 -0
- package/lib/cjs/components/dialog/formula/index.js +3 -1
- package/lib/cjs/components/dialog/formula/utils.d.ts +1 -0
- package/lib/cjs/components/dialog/formula/utils.js +20 -2
- package/lib/cjs/components/dialog/formula-list/index.d.ts +2 -0
- package/lib/cjs/components/dialog/formula-list/index.js +1119 -151
- package/lib/cjs/components/dialog/formula-list/index.less +362 -46
- package/lib/cjs/components/dialog/formula-list/utils.d.ts +13 -1
- package/lib/cjs/components/dialog/formula-list/utils.js +100 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.js +4 -2
- package/lib/cjs/components/dialog/select-join/index.js +11 -0
- package/lib/cjs/components/dialog/select-summarize/index.d.ts +4 -0
- package/lib/cjs/components/dialog/select-summarize/index.js +136 -15
- package/lib/cjs/components/dialog/select-summarize/index.less +34 -1
- package/lib/cjs/components/dialog/select-table/index.d.ts +4 -1
- package/lib/cjs/components/dialog/select-table/index.js +51 -7
- package/lib/cjs/components/dialog/select-table/index.less +20 -0
- package/lib/cjs/components/icons.d.ts +1 -0
- package/lib/cjs/components/icons.js +54 -29
- package/lib/cjs/components/metabase/index.js +8 -0
- package/lib/cjs/components/metabase/index.less +17 -14
- package/lib/cjs/components/modules/components/item-name.js +16 -2
- package/lib/cjs/components/modules/components/meta-icon.js +6 -4
- package/lib/cjs/components/modules/join-data.js +5 -0
- package/lib/cjs/components/modules/summarize/group-by.js +12 -1
- package/lib/cjs/components/modules/summarize/select-index.js +12 -1
- package/lib/cjs/hooks/use-state.js +1 -13
- package/lib/cjs/index.d.ts +3 -2
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/locale/en.js +31 -0
- package/lib/cjs/locale/index.js +10 -6
- package/lib/cjs/locale/zh.js +31 -0
- package/lib/cjs/store/enum.d.ts +2 -1
- package/lib/cjs/store/enum.js +1 -0
- package/lib/cjs/store/helper.js +25 -2
- package/lib/cjs/store/types.d.ts +7 -1
- package/lib/cjs/types.d.ts +41 -1
- package/lib/cjs/utils/helper.js +20 -0
- package/lib/cjs/utils/transformSql.js +59 -2
- package/lib/cjs/utils.js +25 -4
- package/lib/es/components/dialog/custom-editor/index.js +62 -6
- package/lib/es/components/dialog/expression/index.js +133 -55
- package/lib/es/components/dialog/expression/index.less +43 -0
- package/lib/es/components/dialog/formula/index.js +4 -2
- package/lib/es/components/dialog/formula/utils.d.ts +1 -0
- package/lib/es/components/dialog/formula/utils.js +18 -1
- package/lib/es/components/dialog/formula-list/index.d.ts +2 -0
- package/lib/es/components/dialog/formula-list/index.js +1121 -153
- package/lib/es/components/dialog/formula-list/index.less +362 -46
- package/lib/es/components/dialog/formula-list/utils.d.ts +13 -1
- package/lib/es/components/dialog/formula-list/utils.js +99 -0
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/es/components/dialog/select-column-multiple/index.js +4 -2
- package/lib/es/components/dialog/select-join/index.js +12 -1
- package/lib/es/components/dialog/select-summarize/index.d.ts +4 -0
- package/lib/es/components/dialog/select-summarize/index.js +140 -19
- package/lib/es/components/dialog/select-summarize/index.less +34 -1
- package/lib/es/components/dialog/select-table/index.d.ts +4 -1
- package/lib/es/components/dialog/select-table/index.js +51 -7
- package/lib/es/components/dialog/select-table/index.less +20 -0
- package/lib/es/components/icons.d.ts +1 -0
- package/lib/es/components/icons.js +53 -28
- package/lib/es/components/metabase/index.js +8 -0
- package/lib/es/components/metabase/index.less +17 -14
- package/lib/es/components/modules/components/item-name.js +16 -2
- package/lib/es/components/modules/components/meta-icon.js +6 -4
- package/lib/es/components/modules/join-data.js +6 -1
- package/lib/es/components/modules/summarize/group-by.js +12 -1
- package/lib/es/components/modules/summarize/select-index.js +12 -1
- package/lib/es/hooks/use-state.js +1 -13
- package/lib/es/index.d.ts +3 -2
- package/lib/es/index.js +3 -1
- package/lib/es/locale/en.js +31 -0
- package/lib/es/locale/index.js +10 -6
- package/lib/es/locale/zh.js +31 -0
- package/lib/es/store/enum.d.ts +2 -1
- package/lib/es/store/enum.js +1 -0
- package/lib/es/store/helper.js +25 -2
- package/lib/es/store/types.d.ts +7 -1
- package/lib/es/types.d.ts +41 -1
- package/lib/es/utils/helper.js +20 -0
- package/lib/es/utils/transformSql.js +59 -2
- package/lib/es/utils.js +25 -4
- package/package.json +1 -1
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
p {
|
|
13
13
|
margin: 0;
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
.Sqb-FormulaAddSqlAction {
|
|
17
|
+
order: 999;
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.isSqlError {
|
|
@@ -39,6 +43,351 @@
|
|
|
39
43
|
// }
|
|
40
44
|
}
|
|
41
45
|
|
|
46
|
+
.Sqb-FormulaSqlImport {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex: 1 1 auto;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
min-height: 0;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
background: #f8fafc;
|
|
55
|
+
|
|
56
|
+
&-header {
|
|
57
|
+
flex: 0 0 auto;
|
|
58
|
+
padding: 16px 18px 12px;
|
|
59
|
+
border-bottom: 1px solid rgba(83, 92, 112, 0.12);
|
|
60
|
+
background: #ffffff;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-title {
|
|
64
|
+
color: #1f2937;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
font-weight: 700;
|
|
67
|
+
line-height: 22px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&-desc {
|
|
71
|
+
margin-top: 4px;
|
|
72
|
+
color: #7b8798;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
line-height: 20px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-scope {
|
|
78
|
+
display: flex;
|
|
79
|
+
min-height: 48px;
|
|
80
|
+
align-items: flex-start;
|
|
81
|
+
gap: 8px;
|
|
82
|
+
flex: 0 0 auto;
|
|
83
|
+
padding: 6px 10px;
|
|
84
|
+
border-bottom: 1px solid rgba(83, 92, 112, 0.1);
|
|
85
|
+
background: #f8fafc;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-scopeHeader {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
flex: 0 0 auto;
|
|
92
|
+
gap: 6px;
|
|
93
|
+
padding-top: 6px;
|
|
94
|
+
color: #64748b;
|
|
95
|
+
font-size: 12px;
|
|
96
|
+
font-weight: 500;
|
|
97
|
+
|
|
98
|
+
> span {
|
|
99
|
+
line-height: 28px;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-addTable {
|
|
105
|
+
display: flex;
|
|
106
|
+
width: 30px;
|
|
107
|
+
min-width: 30px;
|
|
108
|
+
height: 30px;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
padding: 0;
|
|
112
|
+
border: 2px solid transparent;
|
|
113
|
+
border-radius: 6px;
|
|
114
|
+
background-color: #93a1ab;
|
|
115
|
+
color: #ffffff;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
transition: background 0.2s ease;
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
background-color: #509ee3;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&:disabled {
|
|
124
|
+
background-color: #b8c3cc;
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
svg {
|
|
129
|
+
display: block;
|
|
130
|
+
color: #ffffff;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&-scopeSelected {
|
|
135
|
+
display: flex;
|
|
136
|
+
min-width: 0;
|
|
137
|
+
max-height: 36px;
|
|
138
|
+
min-height: 36px;
|
|
139
|
+
align-items: flex-start;
|
|
140
|
+
flex: 1 1 auto;
|
|
141
|
+
flex-wrap: wrap;
|
|
142
|
+
gap: 6px;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
padding-top: 6px;
|
|
145
|
+
|
|
146
|
+
&--expanded {
|
|
147
|
+
max-height: 132px;
|
|
148
|
+
overflow-y: auto;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&-scopeToggle {
|
|
153
|
+
height: 30px !important;
|
|
154
|
+
flex: 0 0 auto;
|
|
155
|
+
margin-top: 6px;
|
|
156
|
+
padding: 0 !important;
|
|
157
|
+
color: #509ee3 !important;
|
|
158
|
+
font-size: 12px !important;
|
|
159
|
+
line-height: 30px !important;
|
|
160
|
+
white-space: nowrap;
|
|
161
|
+
|
|
162
|
+
&.pd-Button,
|
|
163
|
+
.pd-Button-content {
|
|
164
|
+
height: 30px !important;
|
|
165
|
+
line-height: 30px !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:hover {
|
|
169
|
+
color: #2d7fbd !important;
|
|
170
|
+
text-decoration: underline;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&-scopeTag {
|
|
175
|
+
position: relative;
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
max-width: 190px;
|
|
178
|
+
height: 30px;
|
|
179
|
+
align-items: center;
|
|
180
|
+
padding: 0 18px 0 10px;
|
|
181
|
+
border: 0;
|
|
182
|
+
border-radius: 6px;
|
|
183
|
+
background: #509ee3;
|
|
184
|
+
color: #ffffff;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
font-size: 13px;
|
|
187
|
+
line-height: 30px;
|
|
188
|
+
|
|
189
|
+
> span:first-child {
|
|
190
|
+
min-width: 0;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
text-overflow: ellipsis;
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&--fixed {
|
|
197
|
+
background: #eaf4ff;
|
|
198
|
+
color: #2563eb;
|
|
199
|
+
cursor: default;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&-scopeTagFixed {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&-scopeTagClose {
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: -6px;
|
|
210
|
+
right: -6px;
|
|
211
|
+
width: 14px;
|
|
212
|
+
height: 14px;
|
|
213
|
+
border-radius: 50%;
|
|
214
|
+
background: #8fa0ad;
|
|
215
|
+
color: #ffffff;
|
|
216
|
+
font-size: 12px;
|
|
217
|
+
line-height: 1;
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
|
|
222
|
+
&:hover {
|
|
223
|
+
background: #e5534b;
|
|
224
|
+
color: #ffffff;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&-scopeHint {
|
|
229
|
+
color: #9aa4b2;
|
|
230
|
+
font-size: 12px;
|
|
231
|
+
line-height: 24px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&-messages {
|
|
235
|
+
flex: 1 1 auto;
|
|
236
|
+
min-height: 0;
|
|
237
|
+
padding: 16px;
|
|
238
|
+
overflow: auto;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&-empty {
|
|
242
|
+
display: flex;
|
|
243
|
+
height: 100%;
|
|
244
|
+
align-items: center;
|
|
245
|
+
justify-content: center;
|
|
246
|
+
color: #9aa4b2;
|
|
247
|
+
font-size: 13px;
|
|
248
|
+
text-align: center;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&-message {
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: flex-start;
|
|
254
|
+
gap: 8px;
|
|
255
|
+
margin-bottom: 14px;
|
|
256
|
+
|
|
257
|
+
&--user {
|
|
258
|
+
flex-direction: row-reverse;
|
|
259
|
+
|
|
260
|
+
.Sqb-FormulaSqlImport-bubble {
|
|
261
|
+
border-color: #d7e8fb;
|
|
262
|
+
background: #eaf4ff;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&-avatar {
|
|
268
|
+
display: inline-flex;
|
|
269
|
+
flex: 0 0 auto;
|
|
270
|
+
width: 28px;
|
|
271
|
+
height: 28px;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
border-radius: 50%;
|
|
275
|
+
background: #eaf2ff;
|
|
276
|
+
color: #2b6ff6;
|
|
277
|
+
font-size: 12px;
|
|
278
|
+
font-weight: 700;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&-bubble {
|
|
282
|
+
max-width: min(620px, calc(100% - 44px));
|
|
283
|
+
padding: 9px 11px;
|
|
284
|
+
border: 1px solid rgba(83, 92, 112, 0.12);
|
|
285
|
+
border-radius: 7px;
|
|
286
|
+
background: #ffffff;
|
|
287
|
+
color: #4b5565;
|
|
288
|
+
font-size: 13px;
|
|
289
|
+
line-height: 20px;
|
|
290
|
+
white-space: pre-wrap;
|
|
291
|
+
word-break: break-word;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&-loading {
|
|
295
|
+
color: #64748b;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&-status {
|
|
299
|
+
margin-top: 8px;
|
|
300
|
+
color: #7b8798;
|
|
301
|
+
font-size: 12px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&-proposal {
|
|
305
|
+
display: flex;
|
|
306
|
+
gap: 8px;
|
|
307
|
+
justify-content: flex-end;
|
|
308
|
+
margin-top: 10px;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&-composer {
|
|
312
|
+
position: relative;
|
|
313
|
+
flex: 0 0 auto;
|
|
314
|
+
padding: 12px 14px;
|
|
315
|
+
border-top: 1px solid rgba(83, 92, 112, 0.12);
|
|
316
|
+
background: #ffffff;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
&-composer .pd-Input,
|
|
320
|
+
&-composer textarea {
|
|
321
|
+
width: 100%;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&-composer textarea {
|
|
325
|
+
padding-right: 48px;
|
|
326
|
+
padding-bottom: 42px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&-send {
|
|
330
|
+
position: absolute;
|
|
331
|
+
right: 24px;
|
|
332
|
+
bottom: 24px;
|
|
333
|
+
display: inline-flex;
|
|
334
|
+
width: 30px;
|
|
335
|
+
height: 30px;
|
|
336
|
+
align-items: center;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
border: 0;
|
|
339
|
+
border-radius: 50%;
|
|
340
|
+
background: #8bc7f5;
|
|
341
|
+
color: #ffffff;
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
|
|
344
|
+
&:hover {
|
|
345
|
+
background: #509ee3;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
&:disabled {
|
|
349
|
+
background: #c9d5df;
|
|
350
|
+
cursor: not-allowed;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
svg {
|
|
354
|
+
display: block;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.Sqb-FormulaSqlImportModal .pd-Viewer-modal-main {
|
|
360
|
+
display: flex;
|
|
361
|
+
min-height: 0;
|
|
362
|
+
overflow: hidden;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.Sqb-FormulaSqlConfigPreviewModal .pd-Viewer-modal-main {
|
|
366
|
+
display: flex;
|
|
367
|
+
min-height: 0;
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.Sqb-FormulaSqlConfigPreview {
|
|
372
|
+
box-sizing: border-box;
|
|
373
|
+
width: 100%;
|
|
374
|
+
height: 100%;
|
|
375
|
+
min-height: 0;
|
|
376
|
+
padding: 14px;
|
|
377
|
+
overflow: auto;
|
|
378
|
+
background: #f8fafc;
|
|
379
|
+
|
|
380
|
+
> .Sqb-NotebookCell {
|
|
381
|
+
background: rgba(147, 161, 171, 0.1);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.Sqb-FormulaSqlImport-editor > .pd-Editor,
|
|
386
|
+
.Sqb-FormulaSqlImport-editor .pd-Editor-main,
|
|
387
|
+
.Sqb-FormulaSqlImport-editor .CodeMirror {
|
|
388
|
+
height: 100%;
|
|
389
|
+
}
|
|
390
|
+
|
|
42
391
|
.Sqb-Filter-item {
|
|
43
392
|
--sqb-item-shell-margin-x: 14px;
|
|
44
393
|
--sqb-item-gap-x: 8px;
|
|
@@ -238,10 +587,7 @@
|
|
|
238
587
|
cursor: pointer;
|
|
239
588
|
pointer-events: none;
|
|
240
589
|
transform: translateY(-50%) scale(0.86);
|
|
241
|
-
transition:
|
|
242
|
-
opacity 160ms ease,
|
|
243
|
-
border-color 160ms ease,
|
|
244
|
-
background-color 160ms ease,
|
|
590
|
+
transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease,
|
|
245
591
|
transform 160ms ease;
|
|
246
592
|
|
|
247
593
|
&::before {
|
|
@@ -255,9 +601,7 @@
|
|
|
255
601
|
background: transparent;
|
|
256
602
|
box-shadow: none;
|
|
257
603
|
transform: translateY(-50%);
|
|
258
|
-
transition:
|
|
259
|
-
border-color 160ms ease,
|
|
260
|
-
background-color 160ms ease;
|
|
604
|
+
transition: border-color 160ms ease, background-color 160ms ease;
|
|
261
605
|
}
|
|
262
606
|
|
|
263
607
|
img {
|
|
@@ -514,10 +858,7 @@
|
|
|
514
858
|
cursor: pointer;
|
|
515
859
|
pointer-events: none;
|
|
516
860
|
transform: translateY(-50%) scale(0.86);
|
|
517
|
-
transition:
|
|
518
|
-
opacity 160ms ease,
|
|
519
|
-
border-color 160ms ease,
|
|
520
|
-
background-color 160ms ease,
|
|
861
|
+
transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease,
|
|
521
862
|
transform 160ms ease;
|
|
522
863
|
|
|
523
864
|
&::before {
|
|
@@ -531,9 +872,7 @@
|
|
|
531
872
|
background: transparent;
|
|
532
873
|
box-shadow: none;
|
|
533
874
|
transform: translateY(-50%);
|
|
534
|
-
transition:
|
|
535
|
-
border-color 160ms ease,
|
|
536
|
-
background-color 160ms ease;
|
|
875
|
+
transition: border-color 160ms ease, background-color 160ms ease;
|
|
537
876
|
}
|
|
538
877
|
|
|
539
878
|
img {
|
|
@@ -621,10 +960,7 @@
|
|
|
621
960
|
background: transparent;
|
|
622
961
|
color: rgba(83, 92, 112, 0.46);
|
|
623
962
|
opacity: 0.72;
|
|
624
|
-
transition:
|
|
625
|
-
color 160ms ease,
|
|
626
|
-
background-color 160ms ease,
|
|
627
|
-
opacity 160ms ease;
|
|
963
|
+
transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
|
|
628
964
|
|
|
629
965
|
&:hover {
|
|
630
966
|
background: rgba(83, 92, 112, 0.08);
|
|
@@ -654,9 +990,7 @@
|
|
|
654
990
|
border-radius: 10px;
|
|
655
991
|
background: #f9fbff;
|
|
656
992
|
border-color: rgba(80, 158, 227, 0.2);
|
|
657
|
-
box-shadow:
|
|
658
|
-
inset 3px 0 0 rgba(80, 158, 227, 0.34),
|
|
659
|
-
0 1px 2px rgba(80, 158, 227, 0.06);
|
|
993
|
+
box-shadow: inset 3px 0 0 rgba(80, 158, 227, 0.34), 0 1px 2px rgba(80, 158, 227, 0.06);
|
|
660
994
|
}
|
|
661
995
|
|
|
662
996
|
.Sqb-CaseWhenTools {
|
|
@@ -688,10 +1022,7 @@
|
|
|
688
1022
|
color: rgba(83, 92, 112, 0.58);
|
|
689
1023
|
opacity: 0.76;
|
|
690
1024
|
cursor: pointer;
|
|
691
|
-
transition:
|
|
692
|
-
color 160ms ease,
|
|
693
|
-
background-color 160ms ease,
|
|
694
|
-
opacity 160ms ease;
|
|
1025
|
+
transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
|
|
695
1026
|
|
|
696
1027
|
&:hover {
|
|
697
1028
|
background: rgba(80, 158, 227, 0.1);
|
|
@@ -929,9 +1260,7 @@
|
|
|
929
1260
|
.Sqb-CaseWhenGroup .Sqb-FormulaGroup-row.row-else:hover:not(:has(.Sqb-CaseWhenGroup:hover)) {
|
|
930
1261
|
border-color: rgba(80, 158, 227, 0.64);
|
|
931
1262
|
background: rgba(80, 158, 227, 0.07);
|
|
932
|
-
box-shadow:
|
|
933
|
-
0 0 0 2px rgba(80, 158, 227, 0.18),
|
|
934
|
-
0 2px 8px rgba(80, 158, 227, 0.1);
|
|
1263
|
+
box-shadow: 0 0 0 2px rgba(80, 158, 227, 0.18), 0 2px 8px rgba(80, 158, 227, 0.1);
|
|
935
1264
|
}
|
|
936
1265
|
|
|
937
1266
|
.Sqb-CaseWhenGroup
|
|
@@ -1501,10 +1830,7 @@
|
|
|
1501
1830
|
cursor: pointer;
|
|
1502
1831
|
line-height: 0;
|
|
1503
1832
|
box-shadow: 0 1px 2px rgba(83, 92, 112, 0.08);
|
|
1504
|
-
transition:
|
|
1505
|
-
border-color 160ms ease,
|
|
1506
|
-
background-color 160ms ease,
|
|
1507
|
-
box-shadow 160ms ease,
|
|
1833
|
+
transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease,
|
|
1508
1834
|
color 160ms ease;
|
|
1509
1835
|
|
|
1510
1836
|
svg {
|
|
@@ -1529,10 +1855,7 @@
|
|
|
1529
1855
|
cursor: pointer;
|
|
1530
1856
|
font-size: 11px;
|
|
1531
1857
|
line-height: 1;
|
|
1532
|
-
transition:
|
|
1533
|
-
border-color 160ms ease,
|
|
1534
|
-
background-color 160ms ease,
|
|
1535
|
-
color 160ms ease;
|
|
1858
|
+
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
|
|
1536
1859
|
|
|
1537
1860
|
svg {
|
|
1538
1861
|
width: 10px;
|
|
@@ -2076,12 +2399,8 @@
|
|
|
2076
2399
|
cursor: pointer;
|
|
2077
2400
|
line-height: 0;
|
|
2078
2401
|
box-shadow: 0 1px 2px rgba(83, 92, 112, 0.08);
|
|
2079
|
-
transition:
|
|
2080
|
-
|
|
2081
|
-
background-color 160ms ease,
|
|
2082
|
-
box-shadow 160ms ease,
|
|
2083
|
-
color 160ms ease,
|
|
2084
|
-
opacity 160ms ease;
|
|
2402
|
+
transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease,
|
|
2403
|
+
color 160ms ease, opacity 160ms ease;
|
|
2085
2404
|
}
|
|
2086
2405
|
|
|
2087
2406
|
.Sqb-FormulaListZoomEditor .Sqb-CaseRow-add svg,
|
|
@@ -2138,10 +2457,7 @@
|
|
|
2138
2457
|
cursor: pointer;
|
|
2139
2458
|
font-size: 11px;
|
|
2140
2459
|
line-height: 1;
|
|
2141
|
-
transition:
|
|
2142
|
-
border-color 160ms ease,
|
|
2143
|
-
background-color 160ms ease,
|
|
2144
|
-
color 160ms ease;
|
|
2460
|
+
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
|
|
2145
2461
|
}
|
|
2146
2462
|
|
|
2147
2463
|
.Sqb-FormulaListZoomEditor .Sqb-CaseRecover svg {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { AtomsTypeEnum, AtomsItem } from '../../../store/types';
|
|
1
|
+
import { AtomsTypeEnum, AtomsItem, AtomsExpression } from '../../../store/types';
|
|
2
|
+
type ExpressionTable = {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
alias?: string;
|
|
6
|
+
tableUuid?: string;
|
|
7
|
+
columns?: any[];
|
|
8
|
+
};
|
|
9
|
+
export declare const EMPTY_RHS_CONDITIONS: Set<string>;
|
|
10
|
+
export declare const getExpressionDatabaseType: (expression: AtomsExpression, tables?: ExpressionTable[]) => string;
|
|
11
|
+
export declare const normalizeExpressionAtom: (expression: AtomsExpression, tables?: ExpressionTable[]) => AtomsExpression;
|
|
12
|
+
export declare const normalizeExpressionAtoms: (atoms?: AtomsItem[], tables?: ExpressionTable[]) => AtomsItem[];
|
|
2
13
|
export declare const insertTemplateAt: (oldType: string, type: string, list: any[], index: number) => any[];
|
|
3
14
|
export declare const operatorList: string[];
|
|
4
15
|
export declare const customTypes: ({
|
|
@@ -20,3 +31,4 @@ export declare function validateExpressionIntegrity(list: AtomsItem[]): {
|
|
|
20
31
|
isOver?: boolean;
|
|
21
32
|
};
|
|
22
33
|
export declare const getConstantLabel: (list: any[], val: string, defaultVal?: string) => any;
|
|
34
|
+
export {};
|
|
@@ -4,12 +4,111 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.operatorList = exports.isOk = exports.insertTemplateAt = exports.getTemplateItem = exports.getConstantLabel = exports.customTypes = void 0;
|
|
7
|
+
exports.operatorList = exports.normalizeExpressionAtoms = exports.normalizeExpressionAtom = exports.isOk = exports.insertTemplateAt = exports.getTemplateItem = exports.getExpressionDatabaseType = exports.getConstantLabel = exports.customTypes = exports.EMPTY_RHS_CONDITIONS = void 0;
|
|
8
8
|
exports.validateExpressionIntegrity = validateExpressionIntegrity;
|
|
9
9
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createForOfIteratorHelper"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
11
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
13
|
var _locale = require("../../../locale");
|
|
12
14
|
var _types = require("../../../store/types");
|
|
15
|
+
var EMPTY_RHS_CONDITIONS = exports.EMPTY_RHS_CONDITIONS = new Set(['为空', '不为空', '是空的', '不是空的']);
|
|
16
|
+
var isSameValue = function isSameValue(left, right) {
|
|
17
|
+
return left !== undefined && left !== null && left !== '' && right !== undefined && right !== null && right !== '' && String(left) === String(right);
|
|
18
|
+
};
|
|
19
|
+
var findExpressionColumn = function findExpressionColumn(expression) {
|
|
20
|
+
var _expression$lhs;
|
|
21
|
+
var tables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
22
|
+
var field = (_expression$lhs = expression.lhs) === null || _expression$lhs === void 0 ? void 0 : _expression$lhs.find(function (item) {
|
|
23
|
+
return item.type === _types.AtomsTypeEnum.FIELD;
|
|
24
|
+
});
|
|
25
|
+
if (!field) return undefined;
|
|
26
|
+
var matchedTable = tables.find(function (table) {
|
|
27
|
+
return isSameValue(field.tableUuid, table.tableUuid) || isSameValue(field.tableId, table.id) || isSameValue(field.tableAlias, table.alias) || isSameValue(field.tableName, table.name);
|
|
28
|
+
});
|
|
29
|
+
var candidateColumns = matchedTable ? matchedTable.columns || [] : tables.flatMap(function (table) {
|
|
30
|
+
return table.columns || [];
|
|
31
|
+
});
|
|
32
|
+
var matchedColumns = candidateColumns.filter(function (column) {
|
|
33
|
+
return isSameValue(field.fieldUuid, column.fieldUuid) || isSameValue(field.fieldId, column.id || column.fieldId) || isSameValue(field.fieldAlias, column.fieldAlias) || isSameValue(field.fieldName, column.name || column.realName);
|
|
34
|
+
});
|
|
35
|
+
return matchedColumns.length === 1 ? matchedColumns[0] : undefined;
|
|
36
|
+
};
|
|
37
|
+
var getExpressionDatabaseType = exports.getExpressionDatabaseType = function getExpressionDatabaseType(expression) {
|
|
38
|
+
var tables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
39
|
+
var column = findExpressionColumn(expression, tables);
|
|
40
|
+
return String((column === null || column === void 0 ? void 0 : column.database_type) || expression.database_type || '').toUpperCase();
|
|
41
|
+
};
|
|
42
|
+
var normalizeExpressionRhs = function normalizeExpressionRhs(expression) {
|
|
43
|
+
if (EMPTY_RHS_CONDITIONS.has(expression.condition)) return [];
|
|
44
|
+
return expression.rhs || [];
|
|
45
|
+
};
|
|
46
|
+
var normalizeExpressionAtom = exports.normalizeExpressionAtom = function normalizeExpressionAtom(expression) {
|
|
47
|
+
var tables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
48
|
+
var databaseType = getExpressionDatabaseType(expression, tables);
|
|
49
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, expression), {}, {
|
|
50
|
+
lhs: expression.lhs || [],
|
|
51
|
+
rhs: normalizeExpressionRhs(expression),
|
|
52
|
+
database_type: databaseType
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var normalizeExpressionAtoms = exports.normalizeExpressionAtoms = function normalizeExpressionAtoms() {
|
|
56
|
+
var atoms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
57
|
+
var tables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
58
|
+
var normalizeList = function normalizeList() {
|
|
59
|
+
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
60
|
+
return items.map(normalizeItem);
|
|
61
|
+
};
|
|
62
|
+
var normalizeItem = function normalizeItem(item) {
|
|
63
|
+
if (!item || (0, _typeof2["default"])(item) !== 'object') return item;
|
|
64
|
+
if (item.type === _types.AtomsTypeEnum.EXPRESSION) {
|
|
65
|
+
var nextExpression = normalizeExpressionAtom(item, tables);
|
|
66
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, nextExpression), {}, {
|
|
67
|
+
lhs: normalizeList(nextExpression.lhs),
|
|
68
|
+
rhs: normalizeList(nextExpression.rhs)
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (item.type === _types.AtomsTypeEnum.AND_OR) {
|
|
72
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, item), {}, {
|
|
73
|
+
items: (item.items || []).map(function (logicItem) {
|
|
74
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, logicItem), {}, {
|
|
75
|
+
atoms: normalizeList(logicItem.atoms || [])
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (item.type === _types.AtomsTypeEnum.CASE_WHEN) {
|
|
81
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, item), {}, {
|
|
82
|
+
caseAtoms: normalizeList(item.caseAtoms || []),
|
|
83
|
+
whenClauses: (item.whenClauses || []).map(function (clause) {
|
|
84
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, clause), {}, {
|
|
85
|
+
whenAtoms: normalizeList(clause.whenAtoms || []),
|
|
86
|
+
thenAtoms: normalizeList(clause.thenAtoms || [])
|
|
87
|
+
});
|
|
88
|
+
}),
|
|
89
|
+
elseAtoms: normalizeList(item.elseAtoms || [])
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (item.type === _types.AtomsTypeEnum.FORMULA) {
|
|
93
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, item), {}, {
|
|
94
|
+
args: normalizeList(item.args || [])
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (item.type === _types.AtomsTypeEnum.COLLECTION) {
|
|
98
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, item), {}, {
|
|
99
|
+
list: normalizeList(item.list || [])
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (item.type === _types.AtomsTypeEnum.JOIN_DEFAULT) {
|
|
103
|
+
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, item), {}, {
|
|
104
|
+
lhs: normalizeList(item.lhs || []),
|
|
105
|
+
rhs: normalizeList(item.rhs || [])
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return item;
|
|
109
|
+
};
|
|
110
|
+
return normalizeList(atoms);
|
|
111
|
+
};
|
|
13
112
|
var insertTemplateAt = exports.insertTemplateAt = function insertTemplateAt(oldType, type, list, index) {
|
|
14
113
|
var temList = [];
|
|
15
114
|
var needChange = ['RANK()', 'DENSE_RANK()', 'ROW_NUMBER()', 'when', 'case', 'then'].includes(oldType);
|
|
@@ -34,6 +34,7 @@ interface PropsType {
|
|
|
34
34
|
theme: ColumnsPopupThemeEnum;
|
|
35
35
|
isGroup?: boolean;
|
|
36
36
|
onSelect?: (fields: AtomsField[], quotes: string) => void;
|
|
37
|
+
onValueSync?: (fields: AtomsField[], quotes: string) => void;
|
|
37
38
|
onGroup?: (record: ColumnType & ColumnGroupType & {
|
|
38
39
|
realName?: string;
|
|
39
40
|
}) => void;
|
|
@@ -44,5 +45,5 @@ interface PropsType {
|
|
|
44
45
|
onNextStep?: () => void;
|
|
45
46
|
readonly?: boolean;
|
|
46
47
|
}
|
|
47
|
-
declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, readonly, }: PropsType) => React.JSX.Element;
|
|
48
|
+
declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, onValueSync, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, readonly, }: PropsType) => React.JSX.Element;
|
|
48
49
|
export default SelectJoinColumn;
|
|
@@ -46,6 +46,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
46
46
|
_ref$theme = _ref.theme,
|
|
47
47
|
theme = _ref$theme === void 0 ? _enum.ColumnsPopupThemeEnum.skyBlue : _ref$theme,
|
|
48
48
|
onSelect = _ref.onSelect,
|
|
49
|
+
onValueSync = _ref.onValueSync,
|
|
49
50
|
isGroup = _ref.isGroup,
|
|
50
51
|
onGroup = _ref.onGroup,
|
|
51
52
|
didUpdate = _ref.didUpdate,
|
|
@@ -271,9 +272,10 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
271
272
|
});
|
|
272
273
|
setValue(syncedValue);
|
|
273
274
|
if (!readonly && !(0, _isEqual["default"])(syncedValue, _value || [])) {
|
|
274
|
-
|
|
275
|
+
var _ref2;
|
|
276
|
+
(_ref2 = onValueSync || onSelect) === null || _ref2 === void 0 || _ref2(syncedValue, getQuotes(syncedValue));
|
|
275
277
|
}
|
|
276
|
-
}, [data, _value]);
|
|
278
|
+
}, [data, _value, onValueSync]);
|
|
277
279
|
var changeValue = function changeValue(tableUuid, val) {
|
|
278
280
|
if (readonly) return;
|
|
279
281
|
if (!multiple) {
|
|
@@ -44,6 +44,17 @@ var JoinList = [{
|
|
|
44
44
|
cursor: 'pointer'
|
|
45
45
|
}
|
|
46
46
|
})
|
|
47
|
+
}, {
|
|
48
|
+
type: _enum.JoinEnum.full,
|
|
49
|
+
name: 'Full outer join',
|
|
50
|
+
icon: (0, _jsxRuntime.jsx)(_icons.FullJoinIcon, {
|
|
51
|
+
width: 24,
|
|
52
|
+
height: 24,
|
|
53
|
+
style: {
|
|
54
|
+
marginRight: '0.5rem',
|
|
55
|
+
cursor: 'pointer'
|
|
56
|
+
}
|
|
57
|
+
})
|
|
47
58
|
}];
|
|
48
59
|
var SelectJoin = function SelectJoin(_ref) {
|
|
49
60
|
var value = _ref.value,
|
|
@@ -10,6 +10,10 @@ export type ValueType = Partial<ColumnType> & {
|
|
|
10
10
|
condition: string;
|
|
11
11
|
quotes: string;
|
|
12
12
|
atoms?: AtomsItem[];
|
|
13
|
+
delimiter?: string;
|
|
14
|
+
distinct?: boolean;
|
|
15
|
+
orderBy?: AtomsItem[];
|
|
16
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
13
17
|
};
|
|
14
18
|
interface PropsType {
|
|
15
19
|
data: DataType[];
|