@gingkoo/pandora-metabase 0.0.1-alpha.6 → 0.0.1-alpha.7

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/README.md CHANGED
@@ -42,7 +42,6 @@ export type ToolbarType =
42
42
  export interface MetaBaseProps {
43
43
  loading?: boolean; // 加载状态
44
44
  btnText?: string; //按钮文字
45
- showPermissionTable?: boolean; // 是否显示权限表
46
45
  showFields?:boolean ; //是否显示字段
47
46
  tableNameTpl?: string; //表名
48
47
  fieldNameTpl?: string; //字段名
package/lib/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-metabase v0.0.1-alpha.6
2
+ * @gingkoo/pandora-metabase v0.0.1-alpha.7
3
3
  */
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
@@ -2169,7 +2169,6 @@ class SqlVisionStore {
2169
2169
  constructor() {
2170
2170
  makeAutoObservable(this);
2171
2171
  }
2172
- showPermissionTable = false; // 开启权限表
2173
2172
  showFields = true; // 开启权限表
2174
2173
  //工具列表
2175
2174
  toolbar = ['filter', 'summarize', 'joinData', 'permissionTable', 'customColumn', 'sort', 'rowLimit'];
@@ -2203,6 +2202,9 @@ class SqlVisionStore {
2203
2202
  }
2204
2203
  return false;
2205
2204
  }
2205
+ showToolbar(name) {
2206
+ return !!~this.toolbar.indexOf(name);
2207
+ }
2206
2208
  fetchDatasetFn = async () => {};
2207
2209
  fetchColumnsFn = async () => {};
2208
2210
  setFetchDatasetFn(fn) {
@@ -2414,9 +2416,6 @@ class SqlVisionStore {
2414
2416
  setClosable(payload) {
2415
2417
  this.popupClosable = payload;
2416
2418
  }
2417
- setShowPermissionTable(show) {
2418
- this.showPermissionTable = show;
2419
- }
2420
2419
  setShowFields(show) {
2421
2420
  this.showFields = show;
2422
2421
  }
@@ -4645,7 +4644,7 @@ const NextDom = props => {
4645
4644
  // @ts-ignore
4646
4645
  if (!store.metaList[0].table.name) return null;
4647
4646
  let available = findNextIcon(store, props);
4648
- if (!store.showPermissionTable) {
4647
+ if (!store.showToolbar(TypeEnum.permissionTable)) {
4649
4648
  available = available.filter(v => v !== TypeEnum.permissionTable);
4650
4649
  }
4651
4650
  let size = judgeSize(store, props, available.length);
@@ -6708,7 +6707,6 @@ const Metabase = observer(props => {
6708
6707
  const SqlVisionBuilder = /*#__PURE__*/React__default.forwardRef((props, ref) => {
6709
6708
  let {
6710
6709
  loading = false,
6711
- showPermissionTable = false,
6712
6710
  showFields = true,
6713
6711
  getTables,
6714
6712
  getColumns,
@@ -6723,12 +6721,11 @@ const SqlVisionBuilder = /*#__PURE__*/React__default.forwardRef((props, ref) =>
6723
6721
  getColumns && store.setFetchColumnsFn(getColumns);
6724
6722
  }, []);
6725
6723
  useEffect(() => {
6726
- store.setShowPermissionTable(showPermissionTable);
6727
6724
  store.setShowFields(showFields);
6728
6725
  store.setToolbar(toolbar || []);
6729
6726
  store.setFieldNameTpl(fieldNameTpl || '${name}');
6730
6727
  store.setTableNameTpl(tableNameTpl || '${name}');
6731
- }, [showFields, showPermissionTable, toolbar, fieldNameTpl, tableNameTpl]);
6728
+ }, [showFields, toolbar, fieldNameTpl, tableNameTpl]);
6732
6729
  React__default.useImperativeHandle(ref, () => ({
6733
6730
  setDatasource: list => {
6734
6731
  store.setSourceList(list);