@gingkoo/pandora-metabase 1.0.57 → 1.0.58

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.
@@ -188,7 +188,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
188
188
  tableName = v.name,
189
189
  _v$datasourceName = v.datasourceName,
190
190
  datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
191
- var fullName = datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName;
191
+ var fullName = datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(tableName, tableAlias)) : (0, _helper2.mergeNameAlias)(tableName, tableAlias);
192
192
  if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
193
193
  // let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
194
194
  return (0, _objectSpread2["default"])({}, v);
@@ -281,8 +281,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
281
281
  },
282
282
  children: (0, _jsxRuntime.jsx)("h3", {
283
283
  className: 'List-item-title ml-2',
284
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName,
285
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName
284
+ title: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(tableName, tableAlias)) : (0, _helper2.mergeNameAlias)(tableName, tableAlias),
285
+ children: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(tableName, tableAlias)) : (0, _helper2.mergeNameAlias)(tableName, tableAlias)
286
286
  })
287
287
  }), isMultiple && !isGroup && (0, _jsxRuntime.jsx)("span", {
288
288
  className: 'List-title-arrow',
@@ -130,7 +130,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
130
130
  tableName = v.name,
131
131
  _v$datasourceName = v.datasourceName,
132
132
  datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
133
- var fullName = datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName;
133
+ var fullName = datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(tableName, tableAlias)) : (0, _helper2.mergeNameAlias)(tableName, tableAlias);
134
134
  if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
135
135
  // let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
136
136
  return (0, _objectSpread2["default"])({}, v);
@@ -220,8 +220,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
220
220
  },
221
221
  children: (0, _jsxRuntime.jsx)("h3", {
222
222
  className: 'List-item-title ml-2',
223
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table,
224
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table
223
+ title: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(table, tableAlias)) : (0, _helper2.mergeNameAlias)(table, tableAlias),
224
+ children: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(table, tableAlias)) : (0, _helper2.mergeNameAlias)(table, tableAlias)
225
225
  })
226
226
  }), isMultiple && (0, _jsxRuntime.jsx)("span", {
227
227
  className: 'List-title-arrow',
@@ -195,8 +195,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
195
195
  },
196
196
  children: (0, _jsxRuntime.jsx)("h3", {
197
197
  className: 'List-item-title ml-2',
198
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table,
199
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table
198
+ title: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(table, tableAlias)) : (0, _helper2.mergeNameAlias)(table, tableAlias),
199
+ children: datasourceName ? "".concat(datasourceName, ".").concat((0, _helper2.mergeNameAlias)(table, tableAlias)) : (0, _helper2.mergeNameAlias)(table, tableAlias)
200
200
  })
201
201
  }), isMultiple && (0, _jsxRuntime.jsx)("span", {
202
202
  className: 'List-title-arrow',
@@ -13,6 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
13
13
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
14
14
  var _locale = require("../../../locale");
15
15
  var _icons = require("../../icons");
16
+ var _helper = require("../../../utils/helper");
16
17
  /**
17
18
  * 选择表弹框
18
19
  * 谁在用?
@@ -38,7 +39,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
38
39
  var val = e.target.value;
39
40
  var newList = (0, _cloneDeep["default"])(data.slice());
40
41
  setDatasource(newList.filter(function (v) {
41
- return ~(v.datasourceName + '.' + (v.alias || v.name)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
42
+ return ~(v.datasourceName + '.' + (0, _helper.mergeNameAlias)(v.name, v.alias)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
42
43
  }));
43
44
  }
44
45
  return (0, _jsxRuntime.jsx)("div", {
@@ -84,7 +85,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
84
85
  }), (0, _jsxRuntime.jsx)("div", {
85
86
  children: (0, _jsxRuntime.jsxs)("h4", {
86
87
  className: 'List-item-title ml-2',
87
- children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : v.alias || v.name]
88
+ children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : (0, _helper.mergeNameAlias)(v.name, v.alias)]
88
89
  })
89
90
  })]
90
91
  })
@@ -1347,7 +1347,7 @@ var JoinData = function JoinData(props) {
1347
1347
  if (meta.table1.name === _helper2.SummarizeAlias) {
1348
1348
  return PrevResult;
1349
1349
  } else {
1350
- return "".concat(meta.table1.datasourceName, ".").concat(meta.table1.alias || meta.table1.name);
1350
+ return "".concat(meta.table1.datasourceName, ".").concat((0, _helper.mergeNameAlias)(meta.table1.name, meta.table1.alias));
1351
1351
  }
1352
1352
  } else {
1353
1353
  return '';
@@ -205,6 +205,9 @@ var GroupBy = function GroupBy(props) {
205
205
  newMeta[index].by = newMeta[index].by.map(function (v) {
206
206
  var _store$preProps;
207
207
  var fieldAlias = "".concat((0, _helper.getAlias)(v.alias, newMeta, ((_store$preProps = store.preProps) === null || _store$preProps === void 0 ? void 0 : _store$preProps.notExistsColumns) || []), "__").concat(v.name);
208
+ if (!(0, _utils.isValidSQLAlias)(fieldAlias)) {
209
+ _pandora.Toast.warning((0, _locale.__)('SqlQueryBuilder.aliasForRules'));
210
+ }
208
211
  return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, v), {}, {
209
212
  sql: "".concat(v.alias, ".").concat(v.realName || v.name),
210
213
  fieldAlias: fieldAlias,
@@ -90,7 +90,6 @@ var TableData = function TableData(props) {
90
90
  data: store.sourceList,
91
91
  value: meta.table,
92
92
  onChange: function onChange(data) {
93
- console.log('🚀 ~ selectTable ~ data:', data);
94
93
  if (meta.table.datasourceId !== data.datasourceId || meta.table.name !== data.name) {
95
94
  var _store$preProps;
96
95
  var newMetaList = store.metaList[groupIndex].list.slice()[0];
@@ -17,3 +17,4 @@ export declare const replaceTpl: (inputString: string, values: {
17
17
  }) => string;
18
18
  export declare const uuidv4: (prefix?: string) => string;
19
19
  export declare const getAlias: (name: string | undefined, list: MetaListType[], columns?: any[]) => string;
20
+ export declare const mergeNameAlias: (name: string, alias: string) => string;
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.uuidv4 = exports.throttle = exports.sleep = exports.replaceTpl = exports.mobx2Object = exports.getUrlParams = exports.getScreenInfo = exports.getAlias = exports.fullScreen = exports.flatArray = exports.exitFullscreen = exports.debounce = void 0;
7
+ exports.uuidv4 = exports.throttle = exports.sleep = exports.replaceTpl = exports.mobx2Object = exports.mergeNameAlias = exports.getUrlParams = exports.getScreenInfo = exports.getAlias = exports.fullScreen = exports.flatArray = exports.exitFullscreen = exports.debounce = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
9
9
  var _enum = require("../store/enum");
10
10
  // 节流
@@ -188,4 +188,7 @@ var getAlias = exports.getAlias = function getAlias() {
188
188
  // 获取下一个可用编号
189
189
  var nextIndex = Math.max.apply(Math, (0, _toConsumableArray2["default"])(uniqueIndexes)) + 1;
190
190
  return "".concat(name, "_").concat(nextIndex);
191
+ };
192
+ var mergeNameAlias = exports.mergeNameAlias = function mergeNameAlias(name, alias) {
193
+ return name + (alias ? "\uFF08".concat(alias, "\uFF09") : '');
191
194
  };
package/lib/cjs/utils.js CHANGED
@@ -302,7 +302,7 @@ var _changeAlias = function changeAlias(items, val, type) {
302
302
  };
303
303
  function isValidSQLAlias(str) {
304
304
  if (!str) return false;
305
- var regex = /^[a-zA-Z][a-zA-Z0-9_]{0,30}$/;
305
+ var regex = /^[a-zA-Z][a-zA-Z0-9_]{0,29}$/;
306
306
  return regex.test(str);
307
307
  }
308
308
  var changeTableAlias = exports.changeTableAlias = function changeTableAlias(list, curObj) {
@@ -22,7 +22,7 @@ AtomsTypeEnum } from '../../../store/types';
22
22
  import { __ } from '../../../locale';
23
23
  import { NUMBER_GROUP, DATE_GROUP } from '../const';
24
24
  import { useStore } from '../../../hooks/use-provider';
25
- import { replaceTpl } from '../../../utils/helper';
25
+ import { replaceTpl, mergeNameAlias } from '../../../utils/helper';
26
26
  import { uuidv4 } from '../../../utils/helper';
27
27
  import { SearchIcon, TableIcon, CircleIcon, LetterAaIcon, CalendarIcon, WellIcon, ForeignKeyIcon, UpArrowIcon2, DownArrowIcon2 } from '../../icons';
28
28
  export var DATE_GROUP_MAP = new Map([['分', '分'], ['时', '时'], ['天', '天'], ['周', '周'], ['月', '月'], ['季度', '季度'], ['一小时内的分钟数', '一小时内的分钟数'], ['一天内的小时数', '一天内的小时数'], ['一周内的天数', '一周内的天数'], ['一月内的天数', '一月内的天数'], ['一年内的天数', '一年内的天数'], ['一年的星期数', '一年的星期数'], ['一年的月数', '一年的月数']]);
@@ -183,7 +183,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
183
183
  tableName = v.name,
184
184
  _v$datasourceName = v.datasourceName,
185
185
  datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
186
- var fullName = datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName;
186
+ var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias)) : mergeNameAlias(tableName, tableAlias);
187
187
  if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
188
188
  // let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
189
189
  return _objectSpread({}, v);
@@ -276,8 +276,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
276
276
  },
277
277
  children: _jsx("h3", {
278
278
  className: 'List-item-title ml-2',
279
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName,
280
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName
279
+ title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias)) : mergeNameAlias(tableName, tableAlias),
280
+ children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias)) : mergeNameAlias(tableName, tableAlias)
281
281
  })
282
282
  }), isMultiple && !isGroup && _jsx("span", {
283
283
  className: 'List-title-arrow',
@@ -19,7 +19,7 @@ import { SummarizeAlias } from '../../../store/helper';
19
19
  import { __ } from '../../../locale';
20
20
  import { NUMBER_GROUP, DATE_GROUP } from '../const';
21
21
  import { useStore } from '../../../hooks/use-provider';
22
- import { replaceTpl } from '../../../utils/helper';
22
+ import { replaceTpl, mergeNameAlias } from '../../../utils/helper';
23
23
  import { SearchIcon, TableIcon, CircleIcon, LetterAaIcon, CalendarIcon, WellIcon, ForeignKeyIcon, UpArrowIcon2, DownArrowIcon2, RightArrowIcon } from '../../icons';
24
24
  export var DATE_GROUP_MAP = new Map([['分', '分'], ['时', '时'], ['天', '天'], ['周', '周'], ['月', '月'], ['季度', '季度'], ['一小时内的分钟数', '一小时内的分钟数'], ['一天内的小时数', '一天内的小时数'], ['一周内的天数', '一周内的天数'], ['一月内的天数', '一月内的天数'], ['一年内的天数', '一年内的天数'], ['一年的星期数', '一年的星期数'], ['一年的月数', '一年的月数']]);
25
25
  export var NUMBER_GROUP_MAP = new Map([['自动间隔', '自动分组'], ['10个刻度间隔', '10 刻度间隔'], ['间隔50', '50 刻度间隔'], ['间隔100', '100 刻度间隔'], ['无间隔', '']]);
@@ -122,7 +122,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
122
122
  tableName = v.name,
123
123
  _v$datasourceName = v.datasourceName,
124
124
  datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
125
- var fullName = datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || tableName) : tableAlias || tableName;
125
+ var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias)) : mergeNameAlias(tableName, tableAlias);
126
126
  if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
127
127
  // let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
128
128
  return _objectSpread({}, v);
@@ -212,8 +212,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
212
212
  },
213
213
  children: _jsx("h3", {
214
214
  className: 'List-item-title ml-2',
215
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table,
216
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table
215
+ title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias),
216
+ children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias)
217
217
  })
218
218
  }), isMultiple && _jsx("span", {
219
219
  className: 'List-title-arrow',
@@ -19,7 +19,7 @@ import { SummarizeAlias } from '../../../store/helper';
19
19
  import { __ } from '../../../locale';
20
20
  import { NUMBER_GROUP, DATE_GROUP } from '../const';
21
21
  import { useStore } from '../../../hooks/use-provider';
22
- import { replaceTpl } from '../../../utils/helper';
22
+ import { replaceTpl, mergeNameAlias } from '../../../utils/helper';
23
23
  import { SearchIcon, TableIcon, CircleIcon, LetterAaIcon, CalendarIcon, WellIcon, ForeignKeyIcon, UpArrowIcon2, DownArrowIcon2 } from '../../icons';
24
24
  export var DATE_GROUP_MAP = new Map([['分', '分'], ['时', '时'], ['天', '天'], ['周', '周'], ['月', '月'], ['季度', '季度'], ['一小时内的分钟数', '一小时内的分钟数'], ['一天内的小时数', '一天内的小时数'], ['一周内的天数', '一周内的天数'], ['一月内的天数', '一月内的天数'], ['一年内的天数', '一年内的天数'], ['一年的星期数', '一年的星期数'], ['一年的月数', '一年的月数']]);
25
25
  export var NUMBER_GROUP_MAP = new Map([['自动间隔', '自动分组'], ['10个刻度间隔', '10 刻度间隔'], ['间隔50', '50 刻度间隔'], ['间隔100', '100 刻度间隔'], ['无间隔', '']]);
@@ -187,8 +187,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
187
187
  },
188
188
  children: _jsx("h3", {
189
189
  className: 'List-item-title ml-2',
190
- title: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table,
191
- children: datasourceName ? "".concat(datasourceName, ".").concat(tableAlias || table) : tableAlias || table
190
+ title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias),
191
+ children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias)
192
192
  })
193
193
  }), isMultiple && _jsx("span", {
194
194
  className: 'List-title-arrow',
@@ -11,6 +11,7 @@ import cx from 'classnames';
11
11
  import cloneDeep from 'lodash/cloneDeep';
12
12
  import { __ } from '../../../locale';
13
13
  import { TableIcon, SearchIcon } from '../../icons';
14
+ import { mergeNameAlias } from '../../../utils/helper';
14
15
  var PrevResult = 'Previous results';
15
16
  var SelectPermissionTable = function SelectPermissionTable(_ref) {
16
17
  var _ref$data = _ref.data,
@@ -30,7 +31,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
30
31
  var val = e.target.value;
31
32
  var newList = cloneDeep(data.slice());
32
33
  setDatasource(newList.filter(function (v) {
33
- return ~(v.datasourceName + '.' + (v.alias || v.name)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
34
+ return ~(v.datasourceName + '.' + mergeNameAlias(v.name, v.alias)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
34
35
  }));
35
36
  }
36
37
  return _jsx("div", {
@@ -76,7 +77,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
76
77
  }), _jsx("div", {
77
78
  children: _jsxs("h4", {
78
79
  className: 'List-item-title ml-2',
79
- children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : v.alias || v.name]
80
+ children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : mergeNameAlias(v.name, v.alias)]
80
81
  })
81
82
  })]
82
83
  })
@@ -13,7 +13,7 @@ import { FfPlus, FfLine, Repeat, RelatedWork } from '@gingkoo/pandora-icons';
13
13
  import Metabase from '../../index';
14
14
  import isEqual from 'lodash/isEqual';
15
15
  import cloneDeep from 'lodash/cloneDeep';
16
- import { uuidv4, getAlias } from '../../utils/helper';
16
+ import { uuidv4, getAlias, mergeNameAlias } from '../../utils/helper';
17
17
  import { __ } from '../../locale';
18
18
  import { findIndex, getSubColumns } from '../../utils';
19
19
  import { TypeEnum, ColumnsPopupThemeEnum, JoinEnum, SQL_COLUMN_TYPE } from '../../store/enum';
@@ -1342,7 +1342,7 @@ var JoinData = function JoinData(props) {
1342
1342
  if (meta.table1.name === SummarizeAlias) {
1343
1343
  return PrevResult;
1344
1344
  } else {
1345
- return "".concat(meta.table1.datasourceName, ".").concat(meta.table1.alias || meta.table1.name);
1345
+ return "".concat(meta.table1.datasourceName, ".").concat(mergeNameAlias(meta.table1.name, meta.table1.alias));
1346
1346
  }
1347
1347
  } else {
1348
1348
  return '';
@@ -199,6 +199,9 @@ var GroupBy = function GroupBy(props) {
199
199
  newMeta[index].by = newMeta[index].by.map(function (v) {
200
200
  var _store$preProps;
201
201
  var fieldAlias = "".concat(getAlias(v.alias, newMeta, ((_store$preProps = store.preProps) === null || _store$preProps === void 0 ? void 0 : _store$preProps.notExistsColumns) || []), "__").concat(v.name);
202
+ if (!isValidSQLAlias(fieldAlias)) {
203
+ Toast.warning(__('SqlQueryBuilder.aliasForRules'));
204
+ }
202
205
  return _objectSpread(_objectSpread({}, v), {}, {
203
206
  sql: "".concat(v.alias, ".").concat(v.realName || v.name),
204
207
  fieldAlias: fieldAlias,
@@ -84,7 +84,6 @@ var TableData = function TableData(props) {
84
84
  data: store.sourceList,
85
85
  value: meta.table,
86
86
  onChange: function onChange(data) {
87
- console.log('🚀 ~ selectTable ~ data:', data);
88
87
  if (meta.table.datasourceId !== data.datasourceId || meta.table.name !== data.name) {
89
88
  var _store$preProps;
90
89
  var newMetaList = store.metaList[groupIndex].list.slice()[0];
@@ -17,3 +17,4 @@ export declare const replaceTpl: (inputString: string, values: {
17
17
  }) => string;
18
18
  export declare const uuidv4: (prefix?: string) => string;
19
19
  export declare const getAlias: (name: string | undefined, list: MetaListType[], columns?: any[]) => string;
20
+ export declare const mergeNameAlias: (name: string, alias: string) => string;
@@ -181,4 +181,7 @@ export var getAlias = function getAlias() {
181
181
  // 获取下一个可用编号
182
182
  var nextIndex = Math.max.apply(Math, _toConsumableArray(uniqueIndexes)) + 1;
183
183
  return "".concat(name, "_").concat(nextIndex);
184
+ };
185
+ export var mergeNameAlias = function mergeNameAlias(name, alias) {
186
+ return name + (alias ? "\uFF08".concat(alias, "\uFF09") : '');
184
187
  };
package/lib/es/utils.js CHANGED
@@ -291,7 +291,7 @@ var _changeAlias = function changeAlias(items, val, type) {
291
291
  };
292
292
  export function isValidSQLAlias(str) {
293
293
  if (!str) return false;
294
- var regex = /^[a-zA-Z][a-zA-Z0-9_]{0,30}$/;
294
+ var regex = /^[a-zA-Z][a-zA-Z0-9_]{0,29}$/;
295
295
  return regex.test(str);
296
296
  }
297
297
  export var changeTableAlias = function changeTableAlias(list, curObj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",