@gingkoo/pandora-metabase 1.0.157-alpha.7 → 1.0.157-alpha.8
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 +4 -3
- package/lib/cjs/components/dialog/formula-list/index.d.ts +2 -1
- package/lib/cjs/components/dialog/formula-list/index.js +984 -212
- package/lib/cjs/components/dialog/formula-list/index.less +322 -58
- 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/metabase/index.less +12 -14
- package/lib/cjs/components/modules/components/meta-icon.js +6 -4
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/locale/en.js +24 -0
- package/lib/cjs/locale/index.js +10 -6
- package/lib/cjs/locale/zh.js +24 -0
- package/lib/cjs/types.d.ts +31 -0
- package/lib/es/components/dialog/custom-editor/index.js +4 -3
- package/lib/es/components/dialog/formula-list/index.d.ts +2 -1
- package/lib/es/components/dialog/formula-list/index.js +986 -214
- package/lib/es/components/dialog/formula-list/index.less +322 -58
- 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/metabase/index.less +12 -14
- package/lib/es/components/modules/components/meta-icon.js +6 -4
- package/lib/es/index.d.ts +2 -2
- package/lib/es/locale/en.js +24 -0
- package/lib/es/locale/index.js +10 -6
- package/lib/es/locale/zh.js +24 -0
- package/lib/es/types.d.ts +31 -0
- package/package.json +1 -1
|
@@ -47,35 +47,312 @@
|
|
|
47
47
|
display: flex;
|
|
48
48
|
flex: 1 1 auto;
|
|
49
49
|
flex-direction: column;
|
|
50
|
-
gap: 16px;
|
|
51
50
|
width: 100%;
|
|
52
51
|
height: 100%;
|
|
53
52
|
min-height: 0;
|
|
54
53
|
box-sizing: border-box;
|
|
55
|
-
|
|
54
|
+
background: #f8fafc;
|
|
56
55
|
|
|
57
|
-
&-
|
|
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;
|
|
58
140
|
flex: 1 1 auto;
|
|
59
|
-
|
|
60
|
-
|
|
141
|
+
flex-wrap: wrap;
|
|
142
|
+
gap: 6px;
|
|
61
143
|
overflow: hidden;
|
|
62
|
-
|
|
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;
|
|
63
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;
|
|
64
205
|
}
|
|
65
206
|
|
|
66
|
-
&-
|
|
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 {
|
|
67
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;
|
|
68
269
|
flex: 0 0 auto;
|
|
69
|
-
|
|
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;
|
|
70
306
|
gap: 8px;
|
|
71
|
-
|
|
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;
|
|
72
315
|
border-top: 1px solid rgba(83, 92, 112, 0.12);
|
|
316
|
+
background: #ffffff;
|
|
73
317
|
}
|
|
74
318
|
|
|
75
|
-
&-
|
|
76
|
-
|
|
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;
|
|
77
335
|
height: 30px;
|
|
78
|
-
|
|
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
|
+
}
|
|
79
356
|
}
|
|
80
357
|
}
|
|
81
358
|
|
|
@@ -85,6 +362,26 @@
|
|
|
85
362
|
overflow: hidden;
|
|
86
363
|
}
|
|
87
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
|
+
|
|
88
385
|
.Sqb-FormulaSqlImport-editor > .pd-Editor,
|
|
89
386
|
.Sqb-FormulaSqlImport-editor .pd-Editor-main,
|
|
90
387
|
.Sqb-FormulaSqlImport-editor .CodeMirror {
|
|
@@ -290,10 +587,7 @@
|
|
|
290
587
|
cursor: pointer;
|
|
291
588
|
pointer-events: none;
|
|
292
589
|
transform: translateY(-50%) scale(0.86);
|
|
293
|
-
transition:
|
|
294
|
-
opacity 160ms ease,
|
|
295
|
-
border-color 160ms ease,
|
|
296
|
-
background-color 160ms ease,
|
|
590
|
+
transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease,
|
|
297
591
|
transform 160ms ease;
|
|
298
592
|
|
|
299
593
|
&::before {
|
|
@@ -307,9 +601,7 @@
|
|
|
307
601
|
background: transparent;
|
|
308
602
|
box-shadow: none;
|
|
309
603
|
transform: translateY(-50%);
|
|
310
|
-
transition:
|
|
311
|
-
border-color 160ms ease,
|
|
312
|
-
background-color 160ms ease;
|
|
604
|
+
transition: border-color 160ms ease, background-color 160ms ease;
|
|
313
605
|
}
|
|
314
606
|
|
|
315
607
|
img {
|
|
@@ -566,10 +858,7 @@
|
|
|
566
858
|
cursor: pointer;
|
|
567
859
|
pointer-events: none;
|
|
568
860
|
transform: translateY(-50%) scale(0.86);
|
|
569
|
-
transition:
|
|
570
|
-
opacity 160ms ease,
|
|
571
|
-
border-color 160ms ease,
|
|
572
|
-
background-color 160ms ease,
|
|
861
|
+
transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease,
|
|
573
862
|
transform 160ms ease;
|
|
574
863
|
|
|
575
864
|
&::before {
|
|
@@ -583,9 +872,7 @@
|
|
|
583
872
|
background: transparent;
|
|
584
873
|
box-shadow: none;
|
|
585
874
|
transform: translateY(-50%);
|
|
586
|
-
transition:
|
|
587
|
-
border-color 160ms ease,
|
|
588
|
-
background-color 160ms ease;
|
|
875
|
+
transition: border-color 160ms ease, background-color 160ms ease;
|
|
589
876
|
}
|
|
590
877
|
|
|
591
878
|
img {
|
|
@@ -673,10 +960,7 @@
|
|
|
673
960
|
background: transparent;
|
|
674
961
|
color: rgba(83, 92, 112, 0.46);
|
|
675
962
|
opacity: 0.72;
|
|
676
|
-
transition:
|
|
677
|
-
color 160ms ease,
|
|
678
|
-
background-color 160ms ease,
|
|
679
|
-
opacity 160ms ease;
|
|
963
|
+
transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
|
|
680
964
|
|
|
681
965
|
&:hover {
|
|
682
966
|
background: rgba(83, 92, 112, 0.08);
|
|
@@ -706,9 +990,7 @@
|
|
|
706
990
|
border-radius: 10px;
|
|
707
991
|
background: #f9fbff;
|
|
708
992
|
border-color: rgba(80, 158, 227, 0.2);
|
|
709
|
-
box-shadow:
|
|
710
|
-
inset 3px 0 0 rgba(80, 158, 227, 0.34),
|
|
711
|
-
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);
|
|
712
994
|
}
|
|
713
995
|
|
|
714
996
|
.Sqb-CaseWhenTools {
|
|
@@ -740,10 +1022,7 @@
|
|
|
740
1022
|
color: rgba(83, 92, 112, 0.58);
|
|
741
1023
|
opacity: 0.76;
|
|
742
1024
|
cursor: pointer;
|
|
743
|
-
transition:
|
|
744
|
-
color 160ms ease,
|
|
745
|
-
background-color 160ms ease,
|
|
746
|
-
opacity 160ms ease;
|
|
1025
|
+
transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
|
|
747
1026
|
|
|
748
1027
|
&:hover {
|
|
749
1028
|
background: rgba(80, 158, 227, 0.1);
|
|
@@ -981,9 +1260,7 @@
|
|
|
981
1260
|
.Sqb-CaseWhenGroup .Sqb-FormulaGroup-row.row-else:hover:not(:has(.Sqb-CaseWhenGroup:hover)) {
|
|
982
1261
|
border-color: rgba(80, 158, 227, 0.64);
|
|
983
1262
|
background: rgba(80, 158, 227, 0.07);
|
|
984
|
-
box-shadow:
|
|
985
|
-
0 0 0 2px rgba(80, 158, 227, 0.18),
|
|
986
|
-
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);
|
|
987
1264
|
}
|
|
988
1265
|
|
|
989
1266
|
.Sqb-CaseWhenGroup
|
|
@@ -1553,10 +1830,7 @@
|
|
|
1553
1830
|
cursor: pointer;
|
|
1554
1831
|
line-height: 0;
|
|
1555
1832
|
box-shadow: 0 1px 2px rgba(83, 92, 112, 0.08);
|
|
1556
|
-
transition:
|
|
1557
|
-
border-color 160ms ease,
|
|
1558
|
-
background-color 160ms ease,
|
|
1559
|
-
box-shadow 160ms ease,
|
|
1833
|
+
transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease,
|
|
1560
1834
|
color 160ms ease;
|
|
1561
1835
|
|
|
1562
1836
|
svg {
|
|
@@ -1581,10 +1855,7 @@
|
|
|
1581
1855
|
cursor: pointer;
|
|
1582
1856
|
font-size: 11px;
|
|
1583
1857
|
line-height: 1;
|
|
1584
|
-
transition:
|
|
1585
|
-
border-color 160ms ease,
|
|
1586
|
-
background-color 160ms ease,
|
|
1587
|
-
color 160ms ease;
|
|
1858
|
+
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
|
|
1588
1859
|
|
|
1589
1860
|
svg {
|
|
1590
1861
|
width: 10px;
|
|
@@ -2128,12 +2399,8 @@
|
|
|
2128
2399
|
cursor: pointer;
|
|
2129
2400
|
line-height: 0;
|
|
2130
2401
|
box-shadow: 0 1px 2px rgba(83, 92, 112, 0.08);
|
|
2131
|
-
transition:
|
|
2132
|
-
|
|
2133
|
-
background-color 160ms ease,
|
|
2134
|
-
box-shadow 160ms ease,
|
|
2135
|
-
color 160ms ease,
|
|
2136
|
-
opacity 160ms ease;
|
|
2402
|
+
transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease,
|
|
2403
|
+
color 160ms ease, opacity 160ms ease;
|
|
2137
2404
|
}
|
|
2138
2405
|
|
|
2139
2406
|
.Sqb-FormulaListZoomEditor .Sqb-CaseRow-add svg,
|
|
@@ -2190,10 +2457,7 @@
|
|
|
2190
2457
|
cursor: pointer;
|
|
2191
2458
|
font-size: 11px;
|
|
2192
2459
|
line-height: 1;
|
|
2193
|
-
transition:
|
|
2194
|
-
border-color 160ms ease,
|
|
2195
|
-
background-color 160ms ease,
|
|
2196
|
-
color 160ms ease;
|
|
2460
|
+
transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
|
|
2197
2461
|
}
|
|
2198
2462
|
|
|
2199
2463
|
.Sqb-FormulaListZoomEditor .Sqb-CaseRecover svg {
|
|
@@ -6,9 +6,12 @@ interface PropsType {
|
|
|
6
6
|
data: DatasourceType[];
|
|
7
7
|
sourceTable: any[];
|
|
8
8
|
value: MetaData_TableType;
|
|
9
|
+
selectedValues?: MetaData_TableType[];
|
|
10
|
+
lockedValues?: MetaData_TableType[];
|
|
11
|
+
multiple?: boolean;
|
|
9
12
|
onChange: (reocrd: MetaData_TableType) => void;
|
|
10
13
|
didUpdate?: Function;
|
|
11
14
|
tableFlat?: boolean;
|
|
12
15
|
}
|
|
13
|
-
declare const SelectTable: ({ data, sourceTable, value, onChange, didUpdate, tableFlat, }: PropsType) => React.JSX.Element;
|
|
16
|
+
declare const SelectTable: ({ data, sourceTable, value, selectedValues, lockedValues, multiple, onChange, didUpdate, tableFlat, }: PropsType) => React.JSX.Element;
|
|
14
17
|
export default SelectTable;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
12
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
@@ -95,6 +96,12 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
95
96
|
_ref$sourceTable = _ref.sourceTable,
|
|
96
97
|
sourceTable = _ref$sourceTable === void 0 ? EMPTY_ARRAY : _ref$sourceTable,
|
|
97
98
|
value = _ref.value,
|
|
99
|
+
_ref$selectedValues = _ref.selectedValues,
|
|
100
|
+
selectedValues = _ref$selectedValues === void 0 ? EMPTY_ARRAY : _ref$selectedValues,
|
|
101
|
+
_ref$lockedValues = _ref.lockedValues,
|
|
102
|
+
lockedValues = _ref$lockedValues === void 0 ? EMPTY_ARRAY : _ref$lockedValues,
|
|
103
|
+
_ref$multiple = _ref.multiple,
|
|
104
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
98
105
|
_ref$onChange = _ref.onChange,
|
|
99
106
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
100
107
|
didUpdate = _ref.didUpdate,
|
|
@@ -136,10 +143,14 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
136
143
|
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
137
144
|
selectedFlatTableTypes = _useState16[0],
|
|
138
145
|
setSelectedFlatTableTypes = _useState16[1];
|
|
139
|
-
var _useState17 = (0, _react.useState)(
|
|
146
|
+
var _useState17 = (0, _react.useState)(selectedValues),
|
|
140
147
|
_useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
multipleValues = _useState18[0],
|
|
149
|
+
setMultipleValues = _useState18[1];
|
|
150
|
+
var _useState19 = (0, _react.useState)(value),
|
|
151
|
+
_useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
|
|
152
|
+
val = _useState20[0],
|
|
153
|
+
setVal = _useState20[1];
|
|
143
154
|
var searchInputRef = (0, _react.useRef)(null);
|
|
144
155
|
var flatSearchInputRef = (0, _react.useRef)(null);
|
|
145
156
|
var tableTypeOptions = (0, _react.useMemo)(function () {
|
|
@@ -149,6 +160,21 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
149
160
|
return getFlatTableTypeOptions(sourceTable);
|
|
150
161
|
}, [sourceTable]);
|
|
151
162
|
var nextPage = !val.datasourceId;
|
|
163
|
+
var isLockedTable = function isLockedTable(tableValue) {
|
|
164
|
+
return lockedValues.some(function (item) {
|
|
165
|
+
return (0, _helper.isSameTableByIdName)(item, tableValue);
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
var isTableSelected = function isTableSelected(tableValue) {
|
|
169
|
+
return multiple ? multipleValues.some(function (item) {
|
|
170
|
+
return (0, _helper.isSameTableByIdName)(item, tableValue);
|
|
171
|
+
}) : (0, _helper.isSameTableByIdName)(value, tableValue);
|
|
172
|
+
};
|
|
173
|
+
(0, _react.useEffect)(function () {
|
|
174
|
+
if (multiple) {
|
|
175
|
+
setMultipleValues(selectedValues);
|
|
176
|
+
}
|
|
177
|
+
}, [multiple, selectedValues]);
|
|
152
178
|
(0, _react.useEffect)(function () {
|
|
153
179
|
if (value.datasourceId) {
|
|
154
180
|
getTables(value.datasourceId);
|
|
@@ -258,6 +284,22 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
258
284
|
alias: ''
|
|
259
285
|
});
|
|
260
286
|
}
|
|
287
|
+
function handleTableClick(tableValue) {
|
|
288
|
+
if (!multiple) {
|
|
289
|
+
onChange(tableValue);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (isLockedTable(tableValue)) return;
|
|
293
|
+
setMultipleValues(function (list) {
|
|
294
|
+
var exists = list.some(function (item) {
|
|
295
|
+
return (0, _helper.isSameTableByIdName)(item, tableValue);
|
|
296
|
+
});
|
|
297
|
+
return exists ? list.filter(function (item) {
|
|
298
|
+
return !(0, _helper.isSameTableByIdName)(item, tableValue);
|
|
299
|
+
}) : [].concat((0, _toConsumableArray2["default"])(list), [tableValue]);
|
|
300
|
+
});
|
|
301
|
+
onChange(tableValue);
|
|
302
|
+
}
|
|
261
303
|
function renderTableTypeFilter(tableTypes) {
|
|
262
304
|
if (tableTypes.length <= 1) return null;
|
|
263
305
|
return (0, _jsxRuntime.jsx)("div", {
|
|
@@ -350,10 +392,11 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
350
392
|
className: (0, _classnames["default"])("Sqb-List-section"),
|
|
351
393
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
352
394
|
className: (0, _classnames["default"])("Sqb-List-item mx-2", {
|
|
353
|
-
active: (
|
|
395
|
+
active: isTableSelected(tableValue),
|
|
396
|
+
disabled: isLockedTable(tableValue)
|
|
354
397
|
}),
|
|
355
398
|
onClick: function onClick() {
|
|
356
|
-
|
|
399
|
+
handleTableClick(tableValue);
|
|
357
400
|
},
|
|
358
401
|
children: (0, _jsxRuntime.jsxs)("a", {
|
|
359
402
|
className: 'p-2',
|
|
@@ -472,10 +515,11 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
472
515
|
className: (0, _classnames["default"])("Sqb-List-section"),
|
|
473
516
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
474
517
|
className: (0, _classnames["default"])("Sqb-List-item mx-2", {
|
|
475
|
-
active: (
|
|
518
|
+
active: isTableSelected(tableValue),
|
|
519
|
+
disabled: isLockedTable(tableValue)
|
|
476
520
|
}),
|
|
477
521
|
onClick: function onClick() {
|
|
478
|
-
|
|
522
|
+
handleTableClick(tableValue);
|
|
479
523
|
},
|
|
480
524
|
children: (0, _jsxRuntime.jsxs)("a", {
|
|
481
525
|
className: 'p-2',
|
|
@@ -45,6 +45,16 @@
|
|
|
45
45
|
color: #949aab !important;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
&.active.disabled {
|
|
49
|
+
background-color: #e8f4ff;
|
|
50
|
+
border: 1px solid #b9dcfb;
|
|
51
|
+
.List-item-icon {
|
|
52
|
+
color: #509ee3 !important;
|
|
53
|
+
}
|
|
54
|
+
.List-item-title {
|
|
55
|
+
color: #2d7fbd !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
48
58
|
}
|
|
49
59
|
}
|
|
50
60
|
|
|
@@ -156,6 +166,16 @@
|
|
|
156
166
|
color: #949aab !important;
|
|
157
167
|
}
|
|
158
168
|
}
|
|
169
|
+
&.active.disabled {
|
|
170
|
+
background-color: #e8f4ff;
|
|
171
|
+
border: 1px solid #b9dcfb;
|
|
172
|
+
.List-item-icon {
|
|
173
|
+
color: #509ee3 !important;
|
|
174
|
+
}
|
|
175
|
+
.List-item-title {
|
|
176
|
+
color: #2d7fbd !important;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
159
179
|
}
|
|
160
180
|
|
|
161
181
|
.Sqb-List-search {
|
|
@@ -172,10 +172,7 @@
|
|
|
172
172
|
cursor: pointer;
|
|
173
173
|
pointer-events: none;
|
|
174
174
|
transform: translateY(-50%) scale(0.86);
|
|
175
|
-
transition:
|
|
176
|
-
opacity 160ms ease,
|
|
177
|
-
border-color 160ms ease,
|
|
178
|
-
background-color 160ms ease,
|
|
175
|
+
transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease,
|
|
179
176
|
transform 160ms ease;
|
|
180
177
|
|
|
181
178
|
&::before {
|
|
@@ -189,9 +186,7 @@
|
|
|
189
186
|
background: transparent;
|
|
190
187
|
box-shadow: none;
|
|
191
188
|
transform: translateY(-50%);
|
|
192
|
-
transition:
|
|
193
|
-
border-color 160ms ease,
|
|
194
|
-
background-color 160ms ease;
|
|
189
|
+
transition: border-color 160ms ease, background-color 160ms ease;
|
|
195
190
|
}
|
|
196
191
|
|
|
197
192
|
img {
|
|
@@ -294,9 +289,7 @@
|
|
|
294
289
|
border-radius: 5px;
|
|
295
290
|
color: white;
|
|
296
291
|
background-color: rgb(80, 158, 227);
|
|
297
|
-
transition:
|
|
298
|
-
background 300ms linear 0s,
|
|
299
|
-
border 300ms linear 0s;
|
|
292
|
+
transition: background 300ms linear 0s, border 300ms linear 0s;
|
|
300
293
|
box-sizing: border-box;
|
|
301
294
|
margin: 0;
|
|
302
295
|
padding: 4px 7px;
|
|
@@ -555,7 +548,7 @@
|
|
|
555
548
|
svg {
|
|
556
549
|
flex-shrink: 0;
|
|
557
550
|
}
|
|
558
|
-
|
|
551
|
+
.Sqb-button-label {
|
|
559
552
|
margin-top: 0.5rem;
|
|
560
553
|
}
|
|
561
554
|
}
|
|
@@ -587,15 +580,20 @@
|
|
|
587
580
|
&.small {
|
|
588
581
|
margin-right: 8px;
|
|
589
582
|
margin-top: 0;
|
|
590
|
-
padding: 0.5rem;
|
|
583
|
+
padding: 0.5rem 0.75rem;
|
|
591
584
|
& > div {
|
|
592
585
|
min-width: 0;
|
|
586
|
+
flex-direction: row;
|
|
587
|
+
gap: 4px;
|
|
593
588
|
svg {
|
|
594
589
|
width: 14px;
|
|
595
590
|
height: 14px;
|
|
596
591
|
}
|
|
597
|
-
|
|
598
|
-
|
|
592
|
+
.Sqb-button-label {
|
|
593
|
+
margin-top: 0;
|
|
594
|
+
font-size: 12px;
|
|
595
|
+
line-height: 14px;
|
|
596
|
+
white-space: nowrap;
|
|
599
597
|
}
|
|
600
598
|
}
|
|
601
599
|
}
|