@gingkoo/pandora-metabase 1.0.0-alpha.22 → 1.0.0-alpha.24

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/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-metabase v1.0.0-alpha.22
2
+ * @gingkoo/pandora-metabase v1.0.0-alpha.24
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
@@ -725,7 +725,7 @@ const changeTableAlias = (list, curObj) => {
725
725
  alias
726
726
  } = cloneDeep(curObj);
727
727
  const newList = cloneDeep(list);
728
- newList?.map(v => {
728
+ return newList?.map(v => {
729
729
  if (v.type === TypeEnum.data) {
730
730
  if (v.table.tableUuid === tableUuid) {
731
731
  v.table.alias = alias;
@@ -816,13 +816,16 @@ const changeTableAlias = (list, curObj) => {
816
816
  item.table2.alias = alias;
817
817
  // item.table2.sql = '';
818
818
  }
819
+ if (item.subquery) {
820
+ item.subquery = changeTableAlias(item.subquery || [], curObj);
821
+ }
819
822
  });
820
823
  }
821
824
  if (v.subquery) {
822
825
  v.subquery = changeTableAlias(v.subquery || [], curObj);
823
826
  }
824
- });
825
- return newList || [];
827
+ return v;
828
+ }) || [];
826
829
  };
827
830
  const changeFieldAlias = (list, curObj) => {
828
831
  const {
@@ -830,7 +833,7 @@ const changeFieldAlias = (list, curObj) => {
830
833
  fieldAlias
831
834
  } = cloneDeep(curObj);
832
835
  const newList = cloneDeep(list);
833
- newList.map(v => {
836
+ return newList?.map(v => {
834
837
  if (v.type === TypeEnum.data) ;
835
838
  if (v.type === TypeEnum.joinData) {
836
839
  if (v.table1.fieldUuid === fieldUuid) {
@@ -926,10 +929,12 @@ const changeFieldAlias = (list, curObj) => {
926
929
  // }
927
930
  // }
928
931
  }
932
+ if (item.subquery) {
933
+ item.subquery = changeFieldAlias(item.subquery || [], curObj);
934
+ }
929
935
  });
930
936
  }
931
- });
932
- return newList;
937
+ }) || [];
933
938
  };
934
939
  function splitByUnion(data) {
935
940
  if (!data) return [];
@@ -2211,13 +2216,13 @@ const LeftJoinIcon = ({
2211
2216
  })
2212
2217
  });
2213
2218
  const InnerJoinIcon = ({
2214
- width: _width0 = 32,
2215
- height: _height0 = 32,
2219
+ width: _width10 = 32,
2220
+ height: _height10 = 32,
2216
2221
  style
2217
2222
  }) => jsx("svg", {
2218
2223
  viewBox: '0 0 32 32',
2219
- width: _width0,
2220
- height: _height0,
2224
+ width: _width10,
2225
+ height: _height10,
2221
2226
  fill: 'currentcolor',
2222
2227
  role: 'img',
2223
2228
  "aria-label": 'join_inner icon',
@@ -2227,13 +2232,13 @@ const InnerJoinIcon = ({
2227
2232
  })
2228
2233
  });
2229
2234
  const UpArrowIcon = ({
2230
- width: _width1 = 16,
2231
- height: _height1 = 17
2235
+ width: _width11 = 16,
2236
+ height: _height11 = 17
2232
2237
  }) => jsx("svg", {
2233
2238
  className: 'sort-arrow',
2234
2239
  viewBox: '0 0 32 34',
2235
- width: _width1,
2236
- height: _height1,
2240
+ width: _width11,
2241
+ height: _height11,
2237
2242
  fill: 'currentcolor',
2238
2243
  role: 'img',
2239
2244
  "aria-label": 'arrow_up icon',
@@ -2242,13 +2247,13 @@ const UpArrowIcon = ({
2242
2247
  })
2243
2248
  });
2244
2249
  const DownArrowIcon = ({
2245
- width: _width10 = 16,
2246
- height: _height10 = 17
2250
+ width: _width12 = 16,
2251
+ height: _height12 = 17
2247
2252
  }) => jsx("svg", {
2248
2253
  className: 'sort-arrow',
2249
2254
  viewBox: '0 0 32 34',
2250
- width: _width10,
2251
- height: _height10,
2255
+ width: _width12,
2256
+ height: _height12,
2252
2257
  fill: 'currentcolor',
2253
2258
  role: 'img',
2254
2259
  "aria-label": 'arrow_down icon',
@@ -2257,13 +2262,13 @@ const DownArrowIcon = ({
2257
2262
  })
2258
2263
  });
2259
2264
  const CloseIcon = ({
2260
- width: _width11 = 16,
2261
- height: _height11 = 16
2265
+ width: _width13 = 16,
2266
+ height: _height13 = 16
2262
2267
  }) => jsx("svg", {
2263
2268
  className: 'closeIcon',
2264
2269
  viewBox: '0 0 32 32',
2265
- width: _width11,
2266
- height: _height11,
2270
+ width: _width13,
2271
+ height: _height13,
2267
2272
  fill: 'currentcolor',
2268
2273
  role: 'img',
2269
2274
  "aria-label": 'close icon',
@@ -2272,12 +2277,12 @@ const CloseIcon = ({
2272
2277
  })
2273
2278
  });
2274
2279
  const AddIcon = ({
2275
- width: _width12 = 16,
2276
- height: _height12 = 16
2280
+ width: _width14 = 16,
2281
+ height: _height14 = 16
2277
2282
  }) => jsx("svg", {
2278
2283
  viewBox: '0 0 32 32',
2279
- width: _width12,
2280
- height: _height12,
2284
+ width: _width14,
2285
+ height: _height14,
2281
2286
  fill: 'currentcolor',
2282
2287
  role: 'img',
2283
2288
  "aria-label": 'add icon',
@@ -2286,12 +2291,12 @@ const AddIcon = ({
2286
2291
  })
2287
2292
  });
2288
2293
  const TableIcon = ({
2289
- width: _width13 = 18,
2290
- height: _height13 = 18
2294
+ width: _width15 = 18,
2295
+ height: _height15 = 18
2291
2296
  }) => jsx("svg", {
2292
2297
  viewBox: '0 0 32 32',
2293
- width: _width13,
2294
- height: _height13,
2298
+ width: _width15,
2299
+ height: _height15,
2295
2300
  fill: 'currentcolor',
2296
2301
  role: 'img',
2297
2302
  "aria-label": 'table2 icon',
@@ -2300,12 +2305,12 @@ const TableIcon = ({
2300
2305
  })
2301
2306
  });
2302
2307
  const SearchIcon = ({
2303
- width: _width14 = 16,
2304
- height: _height14 = 16
2308
+ width: _width16 = 16,
2309
+ height: _height16 = 16
2305
2310
  }) => jsx("svg", {
2306
2311
  viewBox: '0 0 32 32',
2307
- width: _width14,
2308
- height: _height14,
2312
+ width: _width16,
2313
+ height: _height16,
2309
2314
  fill: 'currentcolor',
2310
2315
  role: 'img',
2311
2316
  "aria-label": 'search icon',
@@ -7564,6 +7569,9 @@ const Filter = props => {
7564
7569
  let {
7565
7570
  filter
7566
7571
  } = meta;
7572
+ const {
7573
+ notExistsColumns
7574
+ } = store.preProps;
7567
7575
  React__default.useRef(null);
7568
7576
  let index = findIndex(store.metaList[groupIndex].list, meta);
7569
7577
  let notSelected = !meta.filter.length;
@@ -7673,7 +7681,7 @@ const Filter = props => {
7673
7681
  showNotExists(i, '');
7674
7682
  return;
7675
7683
  }
7676
- let data = getColumns();
7684
+ let data = [...getColumns(), ...cloneDeep(notExistsColumns)];
7677
7685
  store.setPopup({
7678
7686
  visible: true,
7679
7687
  node: e.currentTarget,
@@ -7783,6 +7791,7 @@ const Filter = props => {
7783
7791
  let _toolbar = notExistsToolbar || toolbar;
7784
7792
  _toolbar = _toolbar.filter(v => v !== 'group'); // 子查询不需要分组
7785
7793
  let zIndex = store.popupContainer.current ? getMaxZIndexInParents(store.popupContainer.current) : null;
7794
+ let notExistsColumns = getColumns();
7786
7795
  let o = Modal2.openModal({
7787
7796
  title: 'NOT EXISTS',
7788
7797
  transparentMask: true,
@@ -7790,6 +7799,7 @@ const Filter = props => {
7790
7799
  content: jsx(Fragment, {
7791
7800
  children: jsx(SqlVisionBuilder, {
7792
7801
  ...other,
7802
+ notExistsColumns: notExistsColumns,
7793
7803
  showFields: false,
7794
7804
  showSubquery: false,
7795
7805
  toolbar: _toolbar,