@gingkoo/pandora-metabase 0.0.17 → 0.0.18

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 v0.0.17
2
+ * @gingkoo/pandora-metabase v0.0.18
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
@@ -132,20 +132,13 @@ const useStore = () => {
132
132
  const [sourceList, setSourceList] = useState([]); //数据源列表
133
133
  const [_cacheSource2TableMap, set_cacheSource2TableMap] = useState({}); //数据源id 对应数据集列表
134
134
  const [_cacheColumnsMap, set_cacheColumnsMap] = useState({}); //数据源id 对应数据集列表
135
- const [metaList, _setMeta] = useState(defaultMetaList); //数据源id 对应数据集列表
135
+ const [metaList, setMeta] = useState(defaultMetaList); //数据源id 对应数据集列表
136
136
  const [popupData, setPopup] = useState({
137
137
  visible: false,
138
138
  node: null,
139
139
  content: null
140
140
  }); //弹窗
141
141
  const [popupClosable, setClosable] = useState(defaultMetaList); //是否可关闭 如果弹框里面再弹框 则不可关闭
142
- const setMeta = list => {
143
- if (list.length) {
144
- _setMeta(list);
145
- } else {
146
- _setMeta(defaultMetaList);
147
- }
148
- };
149
142
  // const [fetchDatasetFn, setFetchDatasetFn] = useState<(id: string) => Promise<any>>(
150
143
  // async () => {},
151
144
  // ); //fn
@@ -5353,7 +5346,7 @@ const JoinData = props => {
5353
5346
  }
5354
5347
  } else {
5355
5348
  // @ts-ignore
5356
- data = store.metaList.slice(0, index).map(v => {
5349
+ data = metaList.slice(0, index).map(v => {
5357
5350
  if (v.type === TypeEnum.data) {
5358
5351
  return {
5359
5352
  alias: v.table.alias,
@@ -5737,7 +5730,6 @@ const JoinData = props => {
5737
5730
  // 子查询弹窗
5738
5731
  const showSubQuery = (val = []) => {
5739
5732
  const {
5740
- ref,
5741
5733
  subToolbar,
5742
5734
  toolbar,
5743
5735
  ...other
@@ -5771,7 +5763,7 @@ const JoinData = props => {
5771
5763
  const newColumns = items.flatMap(item => item.columns);
5772
5764
  newMeta[index].columns = newColumns;
5773
5765
  newMeta[index].expressions = [];
5774
- store.setMeta(newMeta);
5766
+ store.setPreData(newMeta);
5775
5767
  o.close();
5776
5768
  } catch (e) {
5777
5769
  console.warn(e);
@@ -6474,7 +6466,6 @@ const GroupBy = props => {
6474
6466
  isGroup: true,
6475
6467
  // @ts-ignore
6476
6468
  onGroup: data => {
6477
- console.log('🚀 ~ handleUpdate ~ data:', data);
6478
6469
  // @ts-ignore
6479
6470
  newMeta[index].by.splice(i, 1, data);
6480
6471
  // @ts-ignore
@@ -7269,12 +7260,11 @@ const SqlVisionBuilder = /*#__PURE__*/React__default.forwardRef((props, ref) =>
7269
7260
  store.setProps(props);
7270
7261
  }, [props]);
7271
7262
  useEffect(() => {
7272
- store.setMeta(value);
7273
- // store.setPreData(value);
7274
- }, [JSON.stringify(value)]);
7263
+ store.setPreData(value);
7264
+ }, [value]);
7275
7265
  useEffect(() => {
7276
7266
  store.setSourceList(sourceList);
7277
- }, [JSON.stringify(sourceList)]);
7267
+ }, [sourceList]);
7278
7268
  useEffect(() => {
7279
7269
  store.setShowFields(showFields);
7280
7270
  store.setFieldNameTpl(fieldNameTpl || '${name}');