index.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.VXETable = void 0;
  6. Object.defineProperty(exports, "VxeUI", {
  7. enumerable: true,
  8. get: function () {
  9. return _core.VxeUI;
  10. }
  11. });
  12. exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
  13. var _core = require("@vxe-ui/core");
  14. var _utils = require("./src/utils");
  15. const version = exports.version = "3.19.1";
  16. _core.VxeUI.version = version;
  17. _core.VxeUI.tableVersion = version;
  18. _core.VxeUI.setConfig({
  19. emptyCell: ' ',
  20. table: {
  21. fit: true,
  22. showHeader: true,
  23. animat: true,
  24. delayHover: 250,
  25. autoResize: true,
  26. padding: true,
  27. minHeight: 144,
  28. // keepSource: false,
  29. // showOverflow: null,
  30. // showHeaderOverflow: null,
  31. // showFooterOverflow: null,
  32. // resizeInterval: 500,
  33. // size: null,
  34. // zIndex: null,
  35. // stripe: false,
  36. // border: false,
  37. // round: false,
  38. // emptyText: '暂无数据',
  39. // emptyRender: {
  40. // name: ''
  41. // },
  42. // rowConfig: {
  43. // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
  44. // },
  45. resizeConfig: {
  46. // refreshDelay: 20
  47. },
  48. resizableConfig: {
  49. dragMode: 'auto',
  50. showDragTip: true,
  51. isSyncAutoHeight: true,
  52. isSyncAutoWidth: true,
  53. minHeight: 18
  54. },
  55. radioConfig: {
  56. // trigger: 'default'
  57. strict: true
  58. },
  59. rowDragConfig: {
  60. showIcon: true,
  61. animation: true,
  62. showGuidesStatus: true,
  63. showDragTip: true
  64. },
  65. columnDragConfig: {
  66. showIcon: true,
  67. animation: true,
  68. showGuidesStatus: true,
  69. showDragTip: true
  70. },
  71. checkboxConfig: {
  72. // trigger: 'default',
  73. strict: true
  74. },
  75. tooltipConfig: {
  76. enterable: true
  77. },
  78. headerTooltipConfig: {
  79. enterable: true
  80. },
  81. footerTooltipConfig: {
  82. enterable: true
  83. },
  84. validConfig: {
  85. showMessage: true,
  86. autoClear: true,
  87. autoPos: true,
  88. message: 'inline',
  89. msgMode: 'single',
  90. theme: 'beautify'
  91. },
  92. columnConfig: {
  93. autoOptions: {
  94. isCalcHeader: true,
  95. isCalcBody: true,
  96. isCalcFooter: true
  97. },
  98. maxFixedSize: 4
  99. },
  100. cellConfig: {
  101. padding: true
  102. },
  103. headerCellConfig: {
  104. height: 'unset'
  105. },
  106. footerCellConfig: {
  107. height: 'unset'
  108. },
  109. menuConfig: {
  110. // visibleMethod () {},
  111. // transfer: false,
  112. destroyOnClose: true
  113. },
  114. customConfig: {
  115. // enabled: false,
  116. allowVisible: true,
  117. allowResizable: true,
  118. allowFixed: true,
  119. allowSort: true,
  120. showFooter: true,
  121. placement: 'top-right',
  122. // storage: false,
  123. storeOptions: {
  124. visible: true,
  125. resizable: true,
  126. sort: true,
  127. fixed: true
  128. // rowGroup: false,
  129. // aggFunc: false
  130. },
  131. // autoAggGroupValues: false,
  132. // checkMethod () {},
  133. modalOptions: {
  134. showMaximize: true,
  135. mask: true,
  136. lockView: true,
  137. resize: true,
  138. escClosable: true
  139. },
  140. drawerOptions: {
  141. mask: true,
  142. lockView: true,
  143. escClosable: true,
  144. resize: true
  145. }
  146. },
  147. sortConfig: {
  148. // remote: false,
  149. // trigger: 'default',
  150. // orders: ['asc', 'desc', null],
  151. // sortMethod: null,
  152. showIcon: true,
  153. allowClear: true,
  154. allowBtn: true,
  155. iconLayout: 'vertical'
  156. },
  157. filterConfig: {
  158. // remote: false,
  159. // filterMethod: null,
  160. // isEvery: false,
  161. // transfer: false,
  162. destroyOnClose: true,
  163. multiple: true,
  164. showIcon: true
  165. },
  166. floatingFilterConfig: {
  167. // enabled: false
  168. },
  169. aggregateConfig: {
  170. padding: true,
  171. rowField: 'id',
  172. parentField: '_X_ROW_PARENT_KEY',
  173. childrenField: '_X_ROW_CHILDREN',
  174. mapChildrenField: '_X_ROW_CHILD_LIST',
  175. indent: 20,
  176. showIcon: true,
  177. maxGroupSize: 4,
  178. showAggFuncTitle: true
  179. },
  180. treeConfig: {
  181. padding: true,
  182. rowField: 'id',
  183. parentField: 'parentId',
  184. childrenField: 'children',
  185. hasChildField: 'hasChild',
  186. mapChildrenField: '_X_ROW_CHILD',
  187. indent: 20,
  188. showIcon: true
  189. },
  190. expandConfig: {
  191. // trigger: 'default',
  192. showIcon: true,
  193. mode: 'fixed'
  194. },
  195. editConfig: {
  196. // mode: 'cell',
  197. showIcon: true,
  198. showAsterisk: true,
  199. autoFocus: true
  200. },
  201. importConfig: {
  202. _typeMaps: {
  203. csv: 1,
  204. html: 1,
  205. xml: 1,
  206. txt: 1
  207. }
  208. },
  209. exportConfig: {
  210. _typeMaps: {
  211. csv: 1,
  212. html: 1,
  213. xml: 1,
  214. txt: 1
  215. }
  216. },
  217. printConfig: {},
  218. mouseConfig: {
  219. extension: true
  220. },
  221. keyboardConfig: {
  222. isAll: true,
  223. isEsc: true
  224. },
  225. areaConfig: {
  226. autoClear: true,
  227. selectCellByHeader: true,
  228. selectCellByBody: true,
  229. extendDirection: {
  230. top: true,
  231. left: true,
  232. bottom: true,
  233. right: true
  234. }
  235. },
  236. clipConfig: {
  237. isCopy: true,
  238. isCut: true,
  239. isPaste: true
  240. },
  241. fnrConfig: {
  242. isFind: true,
  243. isReplace: true
  244. },
  245. virtualXConfig: {
  246. // enabled: false,
  247. gt: 24,
  248. preSize: 0,
  249. oSize: 0
  250. },
  251. virtualYConfig: {
  252. // enabled: false,
  253. // mode: 'wheel',
  254. gt: 100,
  255. preSize: 1,
  256. oSize: 0
  257. },
  258. scrollbarConfig: {
  259. // width: 14,
  260. // height: 14,
  261. x: {
  262. // position: 'bottom',
  263. visible: true
  264. },
  265. y: {
  266. // position: 'right',
  267. visible: true
  268. }
  269. }
  270. },
  271. grid: {
  272. // size: null,
  273. // zoomConfig: {
  274. // escRestore: true
  275. // },
  276. formConfig: {
  277. enabled: true
  278. },
  279. pagerConfig: {
  280. enabled: true
  281. // perfect: false
  282. },
  283. toolbarConfig: {
  284. enabled: true
  285. // perfect: false
  286. },
  287. proxyConfig: {
  288. enabled: true,
  289. autoLoad: true,
  290. showLoading: true,
  291. showResponseMsg: true,
  292. showActionMsg: true,
  293. response: {
  294. list: null,
  295. result: 'result',
  296. total: 'page.total',
  297. message: 'message'
  298. }
  299. // beforeItem: null,
  300. // beforeColumn: null,
  301. // beforeQuery: null,
  302. // afterQuery: null,
  303. // beforeDelete: null,
  304. // afterDelete: null,
  305. // beforeSave: null,
  306. // afterSave: null
  307. }
  308. },
  309. toolbar: {
  310. // size: null,
  311. // import: {
  312. // mode: 'covering'
  313. // },
  314. // export: {
  315. // types: ['csv', 'html', 'xml', 'txt']
  316. // },
  317. // buttons: []
  318. },
  319. gantt: {}
  320. });
  321. const iconPrefix = 'vxe-table-icon-';
  322. _core.VxeUI.setIcon({
  323. // table
  324. TABLE_SORT_ASC: iconPrefix + 'caret-up',
  325. TABLE_SORT_DESC: iconPrefix + 'caret-down',
  326. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  327. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  328. TABLE_EDIT: iconPrefix + 'edit',
  329. TABLE_TITLE_PREFIX: iconPrefix + 'question-circle-fill',
  330. TABLE_TITLE_SUFFIX: iconPrefix + 'question-circle-fill',
  331. TABLE_TREE_LOADED: iconPrefix + 'spinner roll',
  332. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  333. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  334. TABLE_EXPAND_LOADED: iconPrefix + 'spinner roll',
  335. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  336. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  337. TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
  338. TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
  339. TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
  340. TABLE_CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
  341. TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
  342. TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
  343. TABLE_RADIO_DISABLED_UNCHECKED: iconPrefix + 'radio-unchecked-fill',
  344. TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
  345. TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
  346. TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
  347. TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
  348. TABLE_DRAG_STATUS_ROW: iconPrefix + 'sort',
  349. TABLE_DRAG_STATUS_SUB_ROW: iconPrefix + 'add-sub',
  350. TABLE_DRAG_STATUS_AGG_GROUP: iconPrefix + 'grouping',
  351. TABLE_DRAG_STATUS_AGG_VALUES: iconPrefix + 'values',
  352. TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
  353. TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
  354. TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
  355. TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
  356. TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
  357. TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
  358. TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
  359. TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
  360. // toolbar
  361. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
  362. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
  363. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  364. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  365. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  366. TOOLBAR_TOOLS_FULLSCREEN: iconPrefix + 'fullscreen',
  367. TOOLBAR_TOOLS_MINIMIZE: iconPrefix + 'minimize',
  368. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'custom-column',
  369. TOOLBAR_TOOLS_FIXED_LEFT: iconPrefix + 'fixed-left',
  370. TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE: iconPrefix + 'fixed-left-fill',
  371. TOOLBAR_TOOLS_FIXED_RIGHT: iconPrefix + 'fixed-right',
  372. TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE: iconPrefix + 'fixed-right-fill'
  373. });
  374. const setTheme = exports.setTheme = _core.VxeUI.setTheme;
  375. const getTheme = exports.getTheme = _core.VxeUI.getTheme;
  376. const setConfig = exports.setConfig = _core.VxeUI.setConfig;
  377. const getConfig = exports.getConfig = _core.VxeUI.getConfig;
  378. const setIcon = exports.setIcon = _core.VxeUI.setIcon;
  379. const getIcon = exports.getIcon = _core.VxeUI.getIcon;
  380. const setLanguage = exports.setLanguage = _core.VxeUI.setLanguage;
  381. const setI18n = exports.setI18n = _core.VxeUI.setI18n;
  382. const getI18n = exports.getI18n = _core.VxeUI.getI18n;
  383. const globalEvents = exports.globalEvents = _core.VxeUI.globalEvents;
  384. const globalResize = exports.globalResize = _core.VxeUI.globalResize;
  385. const renderer = exports.renderer = _core.VxeUI.renderer;
  386. const validators = exports.validators = _core.VxeUI.validators;
  387. const menus = exports.menus = _core.VxeUI.menus;
  388. const formats = exports.formats = _core.VxeUI.formats;
  389. const commands = exports.commands = _core.VxeUI.commands;
  390. const interceptor = exports.interceptor = _core.VxeUI.interceptor;
  391. const clipboard = exports.clipboard = _core.VxeUI.clipboard;
  392. const log = exports.log = _core.VxeUI.log;
  393. const use = exports.use = _core.VxeUI.use;
  394. /**
  395. * 已废弃
  396. * @deprecated
  397. */
  398. const setup = options => {
  399. return _core.VxeUI.setConfig(options);
  400. };
  401. exports.setup = setup;
  402. _core.VxeUI.setup = setup;
  403. /**
  404. * 已废弃
  405. * @deprecated
  406. */
  407. const config = options => {
  408. return _core.VxeUI.setConfig(options);
  409. };
  410. exports.config = config;
  411. _core.VxeUI.config = config;
  412. /**
  413. * 已废弃
  414. * @deprecated
  415. */
  416. const t = (key, args) => {
  417. return _core.VxeUI.getI18n(key, args);
  418. };
  419. exports.t = t;
  420. _core.VxeUI.t = t;
  421. /**
  422. * 已废弃
  423. * @deprecated
  424. */
  425. const _t = (content, args) => {
  426. return (0, _utils.getFuncText)(content, args);
  427. };
  428. exports._t = _t;
  429. _core.VxeUI._t = _t;
  430. /**
  431. * 已废弃,兼容老版本
  432. * @deprecated
  433. */
  434. const VXETable = exports.VXETable = _core.VxeUI;
  435. /**
  436. * 已废弃,兼容老版本
  437. * @deprecated
  438. */
  439. const saveFile = options => {
  440. return _core.VxeUI.saveFile(options);
  441. };
  442. /**
  443. * 已废弃,兼容老版本
  444. * @deprecated
  445. */
  446. exports.saveFile = saveFile;
  447. const readFile = options => {
  448. return _core.VxeUI.readFile(options);
  449. };
  450. /**
  451. * 已废弃,兼容老版本
  452. * @deprecated
  453. */
  454. exports.readFile = readFile;
  455. const print = options => {
  456. return _core.VxeUI.print(options);
  457. };
  458. /**
  459. * 已废弃,兼容老版本
  460. * @deprecated
  461. */
  462. exports.print = print;
  463. const modal = exports.modal = {
  464. /**
  465. * 已废弃,兼容老版本
  466. * @deprecated
  467. */
  468. get(id) {
  469. return _core.VxeUI.modal.get(id);
  470. },
  471. /**
  472. * 已废弃,兼容老版本
  473. * @deprecated
  474. */
  475. close(id) {
  476. return _core.VxeUI.modal.close(id);
  477. },
  478. /**
  479. * 已废弃,兼容老版本
  480. * @deprecated
  481. */
  482. open(options) {
  483. return _core.VxeUI.modal.open(options);
  484. },
  485. /**
  486. * 已废弃,兼容老版本
  487. * @deprecated
  488. */
  489. alert(content, title, options) {
  490. return _core.VxeUI.modal.alert(content, title, options);
  491. },
  492. /**
  493. * 已废弃,兼容老版本
  494. * @deprecated
  495. */
  496. confirm(content, title, options) {
  497. return _core.VxeUI.modal.confirm(content, title, options);
  498. },
  499. /**
  500. * 已废弃,兼容老版本
  501. * @deprecated
  502. */
  503. message(content, options) {
  504. return _core.VxeUI.modal.message(content, options);
  505. },
  506. /**
  507. * 已废弃,兼容老版本
  508. * @deprecated
  509. */
  510. notification(content, title, options) {
  511. return _core.VxeUI.modal.notification(content, title, options);
  512. }
  513. };
  514. var _default = exports.default = _core.VxeUI;