@gingkoo/pandora-metabase 1.0.125 → 1.0.127
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/expression/index.js +15 -5
- package/lib/cjs/components/dialog/expression/index.less +31 -16
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +14 -5
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +236 -62
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +3 -2
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +19 -11
- package/lib/cjs/components/dialog/formula-list/index.d.ts +1 -0
- package/lib/cjs/components/dialog/formula-list/index.js +658 -174
- package/lib/cjs/components/dialog/formula-list/index.less +1438 -145
- package/lib/cjs/components/dialog/formula-list/utils.js +50 -19
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +1 -0
- package/lib/cjs/components/dialog/select-column-multiple/index.js +42 -22
- package/lib/cjs/components/dialog/select-summarize/index.js +10 -2
- package/lib/cjs/components/dialog/select-table/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-table/index.js +197 -52
- package/lib/cjs/components/dialog/select-table/index.less +45 -2
- package/lib/cjs/components/metabase/index.less +156 -39
- package/lib/cjs/components/modules/custom-column.js +7 -3
- package/lib/cjs/components/modules/filter.js +6 -3
- package/lib/cjs/components/modules/join-data.js +62 -14
- package/lib/cjs/components/modules/permission-table.js +8 -4
- package/lib/cjs/components/modules/sort.js +2 -1
- package/lib/cjs/components/modules/summarize/group-by.js +20 -6
- package/lib/cjs/components/modules/summarize/select-index.js +9 -5
- package/lib/cjs/components/modules/table-data.js +21 -3
- package/lib/cjs/hooks/use-state.js +143 -17
- package/lib/cjs/index.js +7 -1
- package/lib/cjs/store/types.d.ts +14 -7
- package/lib/cjs/types.d.ts +8 -0
- package/lib/cjs/utils/transformSql.js +44 -21
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +381 -63
- package/lib/es/components/dialog/expression/index.js +15 -5
- package/lib/es/components/dialog/expression/index.less +31 -16
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +14 -5
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +238 -64
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +3 -2
- package/lib/es/components/dialog/formula-list/LogicGroup.js +19 -11
- package/lib/es/components/dialog/formula-list/index.d.ts +1 -0
- package/lib/es/components/dialog/formula-list/index.js +660 -176
- package/lib/es/components/dialog/formula-list/index.less +1438 -145
- package/lib/es/components/dialog/formula-list/utils.js +50 -19
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +1 -0
- package/lib/es/components/dialog/select-column-multiple/index.js +42 -22
- package/lib/es/components/dialog/select-summarize/index.js +10 -2
- package/lib/es/components/dialog/select-table/index.d.ts +2 -1
- package/lib/es/components/dialog/select-table/index.js +197 -52
- package/lib/es/components/dialog/select-table/index.less +45 -2
- package/lib/es/components/metabase/index.less +156 -39
- package/lib/es/components/modules/custom-column.js +7 -3
- package/lib/es/components/modules/filter.js +6 -3
- package/lib/es/components/modules/join-data.js +62 -14
- package/lib/es/components/modules/permission-table.js +8 -4
- package/lib/es/components/modules/sort.js +2 -1
- package/lib/es/components/modules/summarize/group-by.js +21 -7
- package/lib/es/components/modules/summarize/select-index.js +10 -6
- package/lib/es/components/modules/table-data.js +21 -3
- package/lib/es/hooks/use-state.js +143 -17
- package/lib/es/index.js +7 -1
- package/lib/es/store/types.d.ts +14 -7
- package/lib/es/types.d.ts +8 -0
- package/lib/es/utils/transformSql.js +45 -22
- package/lib/es/utils.d.ts +2 -2
- package/lib/es/utils.js +382 -64
- package/package.json +1 -1
|
@@ -106,55 +106,135 @@
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
.Sqb-Filter-item {
|
|
109
|
+
--sqb-item-shell-margin-x: 14px;
|
|
110
|
+
--sqb-action-size: 12px;
|
|
111
|
+
--sqb-action-height: 18px;
|
|
112
|
+
--sqb-action-zone: 16px;
|
|
113
|
+
--sqb-action-bridge: 18px;
|
|
114
|
+
--sqb-action-radius: 5px;
|
|
115
|
+
--sqb-action-offset: -16px;
|
|
116
|
+
--sqb-arrow-offset-left: var(--sqb-action-offset);
|
|
117
|
+
--sqb-arrow-offset-right: var(--sqb-action-offset);
|
|
109
118
|
position: relative;
|
|
110
|
-
margin: 0
|
|
119
|
+
// margin: 0 var(--sqb-item-shell-margin-x);
|
|
111
120
|
.right-arrow,
|
|
112
121
|
.left-arrow {
|
|
113
122
|
position: absolute;
|
|
114
123
|
top: 50%;
|
|
115
|
-
|
|
116
|
-
|
|
124
|
+
z-index: 3;
|
|
125
|
+
height: var(--sqb-action-height);
|
|
126
|
+
width: var(--sqb-action-zone);
|
|
117
127
|
display: flex;
|
|
118
128
|
align-items: center;
|
|
119
129
|
justify-content: center;
|
|
120
|
-
|
|
130
|
+
border: 0;
|
|
131
|
+
background: transparent;
|
|
132
|
+
opacity: 0;
|
|
121
133
|
cursor: pointer;
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
transform: translateY(-50%) scale(0.86);
|
|
136
|
+
transition:
|
|
137
|
+
opacity 160ms ease,
|
|
138
|
+
border-color 160ms ease,
|
|
139
|
+
background-color 160ms ease,
|
|
140
|
+
transform 160ms ease;
|
|
141
|
+
|
|
142
|
+
&::before {
|
|
143
|
+
content: none;
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: 50%;
|
|
146
|
+
width: var(--sqb-action-size);
|
|
147
|
+
height: var(--sqb-action-height);
|
|
148
|
+
border: 0;
|
|
149
|
+
border-radius: var(--sqb-action-radius);
|
|
150
|
+
background: transparent;
|
|
151
|
+
box-shadow: none;
|
|
152
|
+
transform: translateY(-50%);
|
|
153
|
+
transition:
|
|
154
|
+
border-color 160ms ease,
|
|
155
|
+
background-color 160ms ease;
|
|
156
|
+
}
|
|
157
|
+
|
|
124
158
|
img {
|
|
125
|
-
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 50%;
|
|
161
|
+
left: 50%;
|
|
162
|
+
z-index: 1;
|
|
163
|
+
width: 16px;
|
|
164
|
+
height: 12px;
|
|
165
|
+
pointer-events: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&:hover::before {
|
|
169
|
+
border-color: rgba(80, 158, 227, 0.36);
|
|
170
|
+
background: #fff;
|
|
126
171
|
}
|
|
172
|
+
|
|
127
173
|
&:hover {
|
|
128
174
|
opacity: 1;
|
|
129
175
|
}
|
|
130
176
|
}
|
|
131
177
|
.left-arrow {
|
|
132
|
-
transform: translateY(-50%) rotate(180deg) scale(0);
|
|
133
|
-
transform-origin: 50% 50%;
|
|
134
178
|
// padding-top: 10px;
|
|
135
|
-
left: -
|
|
179
|
+
left: var(--sqb-arrow-offset-left);
|
|
180
|
+
|
|
181
|
+
&::before {
|
|
182
|
+
left: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
img {
|
|
186
|
+
transform: translate(-50%, -50%) rotate(180deg);
|
|
187
|
+
}
|
|
136
188
|
}
|
|
137
189
|
.right-arrow {
|
|
138
|
-
right: -
|
|
190
|
+
right: var(--sqb-arrow-offset-right);
|
|
139
191
|
// padding-bottom: 10px;
|
|
192
|
+
|
|
193
|
+
&::before {
|
|
194
|
+
right: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
img {
|
|
198
|
+
transform: translate(-50%, -50%);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
&.has-left-arrow::before,
|
|
202
|
+
&.has-right-arrow::after {
|
|
203
|
+
content: '';
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 0;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
z-index: 2;
|
|
208
|
+
width: var(--sqb-action-bridge);
|
|
209
|
+
}
|
|
210
|
+
&.has-left-arrow::before {
|
|
211
|
+
left: var(--sqb-arrow-offset-left);
|
|
212
|
+
}
|
|
213
|
+
&.has-right-arrow::after {
|
|
214
|
+
right: var(--sqb-arrow-offset-right);
|
|
140
215
|
}
|
|
141
216
|
&:not(.item-fixed).hover {
|
|
142
217
|
> .left-arrow {
|
|
143
|
-
|
|
218
|
+
opacity: 0.82;
|
|
219
|
+
pointer-events: auto;
|
|
220
|
+
transform: translateY(-50%) scale(1);
|
|
144
221
|
}
|
|
145
222
|
> .right-arrow {
|
|
223
|
+
opacity: 0.82;
|
|
224
|
+
pointer-events: auto;
|
|
146
225
|
transform: translateY(-50%) scale(1);
|
|
147
226
|
}
|
|
148
227
|
}
|
|
149
228
|
}
|
|
150
229
|
.Sqb-NotebookCell {
|
|
151
230
|
box-sizing: border-box;
|
|
152
|
-
padding:
|
|
231
|
+
padding: 12px 16px;
|
|
153
232
|
color: rgb(80, 158, 227);
|
|
154
233
|
display: flex;
|
|
155
234
|
flex-wrap: wrap;
|
|
156
235
|
-webkit-box-align: center;
|
|
157
236
|
align-items: center;
|
|
237
|
+
gap: 8px 14px;
|
|
158
238
|
border-radius: 8px;
|
|
159
239
|
background-color: rgba(80, 158, 227, 0.1);
|
|
160
240
|
|
|
@@ -171,22 +251,23 @@
|
|
|
171
251
|
|
|
172
252
|
.Sqb-TableName {
|
|
173
253
|
position: relative;
|
|
174
|
-
border:
|
|
175
|
-
border-radius:
|
|
254
|
+
border: 1px solid transparent;
|
|
255
|
+
border-radius: 5px;
|
|
176
256
|
color: white;
|
|
177
257
|
background-color: rgb(80, 158, 227);
|
|
178
258
|
transition:
|
|
179
259
|
background 300ms linear 0s,
|
|
180
260
|
border 300ms linear 0s;
|
|
181
261
|
box-sizing: border-box;
|
|
182
|
-
margin
|
|
183
|
-
|
|
184
|
-
padding: 8px;
|
|
262
|
+
margin: 0;
|
|
263
|
+
padding: 4px 7px;
|
|
185
264
|
display: flex;
|
|
186
265
|
-webkit-box-align: center;
|
|
187
266
|
align-items: center;
|
|
188
267
|
cursor: pointer;
|
|
189
|
-
min-height:
|
|
268
|
+
min-height: 28px;
|
|
269
|
+
font-size: 13px;
|
|
270
|
+
line-height: 18px;
|
|
190
271
|
word-break: break-word;
|
|
191
272
|
// &-OPERATOR {
|
|
192
273
|
// // 操作符
|
|
@@ -210,11 +291,11 @@
|
|
|
210
291
|
margin: 0;
|
|
211
292
|
padding: 0;
|
|
212
293
|
border: none;
|
|
213
|
-
border-radius:
|
|
214
|
-
width:
|
|
215
|
-
height:
|
|
216
|
-
min-height:
|
|
217
|
-
font-size:
|
|
294
|
+
border-radius: 999px;
|
|
295
|
+
width: 16px;
|
|
296
|
+
height: 16px;
|
|
297
|
+
min-height: 16px;
|
|
298
|
+
font-size: 10px;
|
|
218
299
|
display: inline-flex;
|
|
219
300
|
align-items: center;
|
|
220
301
|
justify-content: center;
|
|
@@ -223,9 +304,8 @@
|
|
|
223
304
|
}
|
|
224
305
|
&-input {
|
|
225
306
|
//输入框样式,稍微小了一点
|
|
226
|
-
margin
|
|
227
|
-
|
|
228
|
-
padding: 9px;
|
|
307
|
+
margin: 0;
|
|
308
|
+
padding: 5px 7px;
|
|
229
309
|
}
|
|
230
310
|
&::selection {
|
|
231
311
|
color: #ffffff;
|
|
@@ -242,7 +322,7 @@
|
|
|
242
322
|
}
|
|
243
323
|
}
|
|
244
324
|
&.notSelected {
|
|
245
|
-
border:
|
|
325
|
+
border: 1px solid rgba(80, 158, 227, 0.25);
|
|
246
326
|
color: rgb(80, 158, 227);
|
|
247
327
|
background-color: transparent;
|
|
248
328
|
&:hover {
|
|
@@ -256,11 +336,15 @@
|
|
|
256
336
|
background-color: rgba(113, 114, 173, 0.8);
|
|
257
337
|
}
|
|
258
338
|
svg.closeIcon {
|
|
339
|
+
display: block;
|
|
340
|
+
flex: 0 0 auto;
|
|
259
341
|
opacity: 0.6;
|
|
260
|
-
margin-left:
|
|
342
|
+
margin-left: 5px;
|
|
343
|
+
width: 12px;
|
|
344
|
+
height: 12px;
|
|
261
345
|
}
|
|
262
346
|
&.notSelected {
|
|
263
|
-
border:
|
|
347
|
+
border: 1px solid rgba(113, 114, 173, 0.25);
|
|
264
348
|
color: rgb(113, 114, 173);
|
|
265
349
|
background-color: transparent;
|
|
266
350
|
&:hover {
|
|
@@ -275,11 +359,17 @@
|
|
|
275
359
|
background-color: rgba(147, 161, 171, 0.8);
|
|
276
360
|
}
|
|
277
361
|
svg.sort-arrow {
|
|
278
|
-
margin-right: 0.
|
|
362
|
+
margin-right: 0.35rem;
|
|
363
|
+
width: 12px;
|
|
364
|
+
height: 12px;
|
|
279
365
|
}
|
|
280
366
|
svg.closeIcon {
|
|
367
|
+
display: block;
|
|
368
|
+
flex: 0 0 auto;
|
|
281
369
|
opacity: 0.6;
|
|
282
|
-
margin-left:
|
|
370
|
+
margin-left: 5px;
|
|
371
|
+
width: 12px;
|
|
372
|
+
height: 12px;
|
|
283
373
|
}
|
|
284
374
|
}
|
|
285
375
|
&.green-name {
|
|
@@ -289,11 +379,15 @@
|
|
|
289
379
|
background-color: rgba(136, 191, 77, 0.8);
|
|
290
380
|
}
|
|
291
381
|
svg.closeIcon {
|
|
382
|
+
display: block;
|
|
383
|
+
flex: 0 0 auto;
|
|
292
384
|
opacity: 0.6;
|
|
293
|
-
margin-left:
|
|
385
|
+
margin-left: 5px;
|
|
386
|
+
width: 12px;
|
|
387
|
+
height: 12px;
|
|
294
388
|
}
|
|
295
389
|
&.notSelected {
|
|
296
|
-
border:
|
|
390
|
+
border: 1px solid rgba(136, 191, 77, 0.25);
|
|
297
391
|
color: rgb(136, 191, 77);
|
|
298
392
|
background-color: transparent;
|
|
299
393
|
&:hover {
|
|
@@ -309,6 +403,13 @@
|
|
|
309
403
|
}
|
|
310
404
|
}
|
|
311
405
|
|
|
406
|
+
> .pd-Badge,
|
|
407
|
+
.Sqb-where > .pd-Badge {
|
|
408
|
+
display: inline-flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
line-height: 1;
|
|
411
|
+
}
|
|
412
|
+
|
|
312
413
|
.ant-input-number {
|
|
313
414
|
margin-bottom: 0.5rem;
|
|
314
415
|
.ant-input-number-input {
|
|
@@ -332,13 +433,27 @@
|
|
|
332
433
|
margin-bottom: 8px;
|
|
333
434
|
.Sqb-NotebookCell {
|
|
334
435
|
padding-bottom: 0;
|
|
335
|
-
padding-top:
|
|
436
|
+
// padding-top: 0;
|
|
336
437
|
}
|
|
337
438
|
}
|
|
338
439
|
.operator-icon,
|
|
339
440
|
.operator-icon button {
|
|
340
|
-
|
|
441
|
+
display: inline-flex !important;
|
|
442
|
+
align-items: center !important;
|
|
443
|
+
justify-content: center !important;
|
|
444
|
+
min-width: 28px !important;
|
|
445
|
+
height: 28px !important;
|
|
446
|
+
padding: 0 7px !important;
|
|
447
|
+
font-size: 14px !important;
|
|
341
448
|
border: none !important;
|
|
449
|
+
line-height: 1 !important;
|
|
450
|
+
vertical-align: middle;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.operator-icon svg,
|
|
454
|
+
.operator-icon button svg {
|
|
455
|
+
width: 14px;
|
|
456
|
+
height: 14px;
|
|
342
457
|
}
|
|
343
458
|
|
|
344
459
|
.subquery-icon {
|
|
@@ -380,7 +495,7 @@
|
|
|
380
495
|
cursor: pointer;
|
|
381
496
|
font-weight: bold;
|
|
382
497
|
padding: 12px 16px;
|
|
383
|
-
border-radius:
|
|
498
|
+
border-radius: 5px;
|
|
384
499
|
margin-right: 16px;
|
|
385
500
|
margin-top: 16px;
|
|
386
501
|
border: none;
|
|
@@ -462,8 +577,10 @@
|
|
|
462
577
|
|
|
463
578
|
& > &-btn {
|
|
464
579
|
min-width: 220px;
|
|
465
|
-
height:
|
|
466
|
-
border-radius:
|
|
580
|
+
height: 32px;
|
|
581
|
+
border-radius: 5px;
|
|
582
|
+
padding: 0 14px;
|
|
583
|
+
font-size: 13px;
|
|
467
584
|
color: #ffffff;
|
|
468
585
|
background-color: #509ee3 !important;
|
|
469
586
|
border: 1px solid #509ee3;
|
|
@@ -127,6 +127,7 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
127
127
|
alias: prevGroupBy.alias,
|
|
128
128
|
datasourceId: '',
|
|
129
129
|
datasourceName: '',
|
|
130
|
+
datasourceType: '',
|
|
130
131
|
columns: []
|
|
131
132
|
};
|
|
132
133
|
if (prevGroupBy !== null && prevGroupBy !== void 0 && (_prevGroupBy$group = prevGroupBy.group) !== null && _prevGroupBy$group !== void 0 && _prevGroupBy$group.length) {
|
|
@@ -170,7 +171,8 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
170
171
|
tableUuid: v.table2.tableUuid || uuidv4('table'),
|
|
171
172
|
columns: v.columns,
|
|
172
173
|
datasourceId: v.table2.datasourceId,
|
|
173
|
-
datasourceName: v.table2.datasourceName
|
|
174
|
+
datasourceName: v.table2.datasourceName,
|
|
175
|
+
datasourceType: v.table2.datasourceType
|
|
174
176
|
});
|
|
175
177
|
}));
|
|
176
178
|
}
|
|
@@ -184,7 +186,8 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
184
186
|
tableUuid: v.table.tableUuid || uuidv4('table'),
|
|
185
187
|
columns: v.columns,
|
|
186
188
|
datasourceId: mainTable.table.datasourceId,
|
|
187
|
-
datasourceName: mainTable.table.datasourceName
|
|
189
|
+
datasourceName: mainTable.table.datasourceName,
|
|
190
|
+
datasourceType: mainTable.table.datasourceType
|
|
188
191
|
});
|
|
189
192
|
} else if (v.type === TypeEnum.joinData) {
|
|
190
193
|
return _objectSpread(_objectSpread({}, v.table2), {}, {
|
|
@@ -194,7 +197,8 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
194
197
|
tableUuid: v.table2.tableUuid || uuidv4('table'),
|
|
195
198
|
columns: v.columns,
|
|
196
199
|
datasourceId: v.table2.datasourceId,
|
|
197
|
-
datasourceName: v.table2.datasourceName
|
|
200
|
+
datasourceName: v.table2.datasourceName,
|
|
201
|
+
datasourceType: v.table2.datasourceType
|
|
198
202
|
});
|
|
199
203
|
} else {
|
|
200
204
|
return {
|
|
@@ -82,7 +82,8 @@ var Filter = function Filter(props) {
|
|
|
82
82
|
tableUuid: v.table2.tableUuid || uuidv4('table'),
|
|
83
83
|
columns: v.columns,
|
|
84
84
|
datasourceId: v.table2.datasourceId,
|
|
85
|
-
datasourceName: v.table2.datasourceName
|
|
85
|
+
datasourceName: v.table2.datasourceName,
|
|
86
|
+
datasourceType: v.table2.datasourceType
|
|
86
87
|
};
|
|
87
88
|
}));
|
|
88
89
|
}
|
|
@@ -97,7 +98,8 @@ var Filter = function Filter(props) {
|
|
|
97
98
|
tableUuid: v.table.tableUuid || uuidv4('table'),
|
|
98
99
|
columns: v.columns,
|
|
99
100
|
datasourceId: mainTable.table.datasourceId,
|
|
100
|
-
datasourceName: mainTable.table.datasourceName
|
|
101
|
+
datasourceName: mainTable.table.datasourceName,
|
|
102
|
+
datasourceType: mainTable.table.datasourceType
|
|
101
103
|
};
|
|
102
104
|
} else if (v.type === TypeEnum.joinData) {
|
|
103
105
|
return {
|
|
@@ -108,7 +110,8 @@ var Filter = function Filter(props) {
|
|
|
108
110
|
tableUuid: v.table2.tableUuid || uuidv4('table'),
|
|
109
111
|
columns: v.columns,
|
|
110
112
|
datasourceId: v.table2.datasourceId,
|
|
111
|
-
datasourceName: v.table2.datasourceName
|
|
113
|
+
datasourceName: v.table2.datasourceName,
|
|
114
|
+
datasourceType: v.table2.datasourceType
|
|
112
115
|
};
|
|
113
116
|
} else {
|
|
114
117
|
return {
|