@vxe-ui/core 0.0.1 → 0.1.0

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.
Files changed (81) hide show
  1. package/es/index.esm.js +4 -6
  2. package/es/src/commands.js +3 -3
  3. package/es/src/core.js +49 -14
  4. package/es/src/event.js +11 -19
  5. package/es/src/formats.js +3 -3
  6. package/es/src/globalStore.js +1 -3
  7. package/es/src/i18n.js +3 -5
  8. package/es/src/i18nStore.js +4 -0
  9. package/es/src/iconStore.js +1 -2
  10. package/es/src/interceptor.js +2 -2
  11. package/es/src/log.js +8 -8
  12. package/es/src/menus.js +3 -3
  13. package/es/src/renderer.js +2 -2
  14. package/es/src/resize.js +9 -7
  15. package/es/src/store.js +2 -2
  16. package/es/src/themeStore.js +3 -0
  17. package/lib/index.common.js +2 -4
  18. package/lib/index.umd.js +301 -99
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/src/commands.js +2 -2
  21. package/lib/src/commands.min.js +1 -1
  22. package/lib/src/core.js +105 -22
  23. package/lib/src/core.min.js +1 -1
  24. package/lib/src/event.js +12 -23
  25. package/lib/src/event.min.js +1 -1
  26. package/lib/src/formats.js +2 -2
  27. package/lib/src/formats.min.js +1 -1
  28. package/lib/src/globalStore.js +3 -5
  29. package/lib/src/globalStore.min.js +1 -1
  30. package/lib/src/i18n.js +3 -5
  31. package/lib/src/i18n.min.js +1 -1
  32. package/lib/src/i18nStore.js +10 -0
  33. package/lib/src/i18nStore.min.js +1 -0
  34. package/lib/src/iconStore.js +2 -3
  35. package/lib/src/iconStore.min.js +1 -1
  36. package/lib/src/interceptor.js +1 -1
  37. package/lib/src/interceptor.min.js +1 -1
  38. package/lib/src/log.js +9 -11
  39. package/lib/src/log.min.js +1 -1
  40. package/lib/src/menus.js +2 -2
  41. package/lib/src/menus.min.js +1 -1
  42. package/lib/src/renderer.js +1 -1
  43. package/lib/src/renderer.min.js +1 -1
  44. package/lib/src/resize.js +10 -10
  45. package/lib/src/resize.min.js +1 -1
  46. package/lib/src/store.js +1 -1
  47. package/lib/src/store.min.js +1 -1
  48. package/lib/src/themeStore.js +9 -0
  49. package/lib/src/themeStore.min.js +1 -0
  50. package/package.json +2 -2
  51. package/packages/index.ts +4 -6
  52. package/packages/src/commands.ts +6 -6
  53. package/packages/src/core.ts +61 -18
  54. package/packages/src/event.ts +14 -23
  55. package/packages/src/formats.ts +6 -6
  56. package/packages/src/globalStore.ts +1 -4
  57. package/packages/src/i18n.ts +3 -5
  58. package/packages/src/i18nStore.ts +9 -0
  59. package/packages/src/iconStore.ts +1 -3
  60. package/packages/src/interceptor.ts +3 -3
  61. package/packages/src/log.ts +9 -8
  62. package/packages/src/menus.ts +6 -6
  63. package/packages/src/renderer.ts +5 -5
  64. package/packages/src/resize.ts +10 -6
  65. package/packages/src/store.ts +3 -3
  66. package/packages/src/themeStore.ts +7 -0
  67. package/packages/src/validators.ts +1 -1
  68. package/types/core/global-config.d.ts +0 -1
  69. package/types/core/global-event.d.ts +26 -0
  70. package/types/core/global-icon.d.ts +3 -1
  71. package/types/core/global-lang.d.ts +1 -0
  72. package/types/core/global-resize.d.ts +3 -0
  73. package/types/core/global-theme.d.ts +1 -0
  74. package/types/core/index.d.ts +62 -9
  75. package/types/core/log.d.ts +8 -0
  76. package/types/core/renderer.d.ts +5 -16
  77. package/types/index.d.ts +2 -2
  78. package/es/src/theme.js +0 -10
  79. package/lib/src/theme.js +0 -17
  80. package/lib/src/theme.min.js +0 -1
  81. package/packages/src/theme.ts +0 -13
package/lib/index.umd.js CHANGED
@@ -1662,20 +1662,30 @@ __webpack_require__.r(__webpack_exports__);
1662
1662
 
1663
1663
  // EXPORTS
1664
1664
  __webpack_require__.d(__webpack_exports__, {
1665
+ GLOBAL_EVENT_KEYS: function() { return /* reexport */ GLOBAL_EVENT_KEYS; },
1666
+ VxeUI: function() { return /* reexport */ VxeUI; },
1667
+ clipboard: function() { return /* reexport */ clipboard; },
1665
1668
  commands: function() { return /* reexport */ commands; },
1669
+ coreVersion: function() { return /* reexport */ coreVersion; },
1666
1670
  "default": function() { return /* binding */ entry_lib; },
1667
1671
  formats: function() { return /* reexport */ formats; },
1668
1672
  getConfig: function() { return /* reexport */ getConfig; },
1669
1673
  getI18n: function() { return /* reexport */ getI18n; },
1670
1674
  getIcon: function() { return /* reexport */ getIcon; },
1675
+ getTheme: function() { return /* reexport */ getTheme; },
1676
+ globalEvents: function() { return /* reexport */ globalEvents; },
1677
+ globalResize: function() { return /* reexport */ globalResize; },
1671
1678
  hooks: function() { return /* reexport */ hooks; },
1672
1679
  interceptor: function() { return /* reexport */ interceptor; },
1680
+ log: function() { return /* reexport */ log; },
1673
1681
  menus: function() { return /* reexport */ menus; },
1674
1682
  renderer: function() { return /* reexport */ renderer; },
1675
1683
  setConfig: function() { return /* reexport */ setConfig; },
1684
+ setI18n: function() { return /* reexport */ setI18n; },
1676
1685
  setIcon: function() { return /* reexport */ setIcon; },
1677
- validators: function() { return /* reexport */ validators; },
1678
- version: function() { return /* reexport */ version; }
1686
+ setLanguage: function() { return /* reexport */ setLanguage; },
1687
+ setTheme: function() { return /* reexport */ setTheme; },
1688
+ validators: function() { return /* reexport */ validators; }
1679
1689
  });
1680
1690
 
1681
1691
  ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
@@ -1811,49 +1821,255 @@ var DomZIndex = {
1811
1821
  ;// CONCATENATED MODULE: ./packages/src/globalStore.ts
1812
1822
  const globalConfigStore = {
1813
1823
  size: '',
1814
- theme: '',
1815
1824
  version: 1,
1816
1825
  zIndex: 999,
1817
1826
  resizeInterval: 500,
1818
1827
  i18n: key => key
1819
1828
  };
1820
- /* harmony default export */ var globalStore = (globalConfigStore);
1821
1829
  ;// CONCATENATED MODULE: ./packages/src/iconStore.ts
1822
1830
  const iconConfigStore = {};
1823
- /* harmony default export */ var iconStore = (iconConfigStore);
1824
- ;// CONCATENATED MODULE: ./packages/src/theme.ts
1831
+ ;// CONCATENATED MODULE: ./packages/src/themeStore.ts
1832
+ const themeConfigStore = {
1833
+ theme: ''
1834
+ };
1835
+ ;// CONCATENATED MODULE: ./packages/src/i18nStore.ts
1836
+ const i18nConfigStore = {
1837
+ language: '',
1838
+ langMaps: {}
1839
+ };
1840
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
1841
+ var es_array_push = __webpack_require__(4114);
1842
+ ;// CONCATENATED MODULE: ./packages/src/event.ts
1843
+
1844
+
1845
+ const GLOBAL_EVENT_KEYS = {
1846
+ F2: 'F2',
1847
+ ESCAPE: 'Escape',
1848
+ ENTER: 'Enter',
1849
+ TAB: 'Tab',
1850
+ DELETE: 'Delete',
1851
+ BACKSPACE: 'Backspace',
1852
+ SPACEBAR: ' ',
1853
+ CONTEXT_MENU: 'ContextMenu',
1854
+ ARROW_UP: 'ArrowUp',
1855
+ ARROW_DOWN: 'ArrowDown',
1856
+ ARROW_LEFT: 'ArrowLeft',
1857
+ ARROW_RIGHT: 'ArrowRight',
1858
+ PAGE_UP: 'PageUp',
1859
+ PAGE_DOWN: 'PageDown'
1860
+ };
1861
+ const browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
1862
+ const convertEventKeys = {
1863
+ ' ': 'Spacebar',
1864
+ Apps: GLOBAL_EVENT_KEYS.CONTEXT_MENU,
1865
+ Del: GLOBAL_EVENT_KEYS.DELETE,
1866
+ Up: GLOBAL_EVENT_KEYS.ARROW_UP,
1867
+ Down: GLOBAL_EVENT_KEYS.ARROW_DOWN,
1868
+ Left: GLOBAL_EVENT_KEYS.ARROW_LEFT,
1869
+ Right: GLOBAL_EVENT_KEYS.ARROW_RIGHT
1870
+ };
1871
+ // 监听全局事件
1872
+ const wheelName = browse.firefox ? 'DOMMouseScroll' : 'mousewheel';
1873
+ const eventStore = [];
1874
+ function triggerEvent(evnt) {
1875
+ const isWheel = evnt.type === wheelName;
1876
+ eventStore.forEach(({
1877
+ type,
1878
+ cb
1879
+ }) => {
1880
+ // 如果被取消冒泡,不再执行
1881
+ if (!evnt.cancelBubble) {
1882
+ if (type === evnt.type || isWheel && type === 'mousewheel') {
1883
+ cb(evnt);
1884
+ }
1885
+ }
1886
+ });
1887
+ }
1888
+ const globalEvents = {
1889
+ on(comp, type, cb) {
1890
+ eventStore.push({
1891
+ comp,
1892
+ type,
1893
+ cb
1894
+ });
1895
+ },
1896
+ off(comp, type) {
1897
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().remove(eventStore, item => item.comp === comp && item.type === type);
1898
+ },
1899
+ hasKey(evnt, targetKey) {
1900
+ const {
1901
+ key
1902
+ } = evnt;
1903
+ targetKey = targetKey.toLowerCase();
1904
+ return key ? targetKey === key.toLowerCase() || !!(convertEventKeys[key] && convertEventKeys[key].toLowerCase() === targetKey) : false;
1905
+ }
1906
+ };
1907
+ if (browse.isDoc) {
1908
+ if (!browse.msie) {
1909
+ window.addEventListener('copy', triggerEvent, false);
1910
+ window.addEventListener('cut', triggerEvent, false);
1911
+ window.addEventListener('paste', triggerEvent, false);
1912
+ }
1913
+ document.addEventListener('keydown', triggerEvent, false);
1914
+ document.addEventListener('contextmenu', triggerEvent, false);
1915
+ window.addEventListener('mousedown', triggerEvent, false);
1916
+ window.addEventListener('blur', triggerEvent, false);
1917
+ window.addEventListener('resize', triggerEvent, false);
1918
+ window.addEventListener(wheelName, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().throttle(triggerEvent, 100, {
1919
+ leading: true,
1920
+ trailing: false
1921
+ }), {
1922
+ passive: true,
1923
+ capture: false
1924
+ });
1925
+ }
1926
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1927
+ function _typeof(o) {
1928
+ "@babel/helpers - typeof";
1825
1929
 
1826
- function setTheme(options) {
1827
- const theme = (options ? options.theme : null) || globalStore.theme || 'default';
1828
- if (typeof document !== 'undefined') {
1829
- const documentElement = document.documentElement;
1830
- if (documentElement) {
1831
- documentElement.setAttribute('data-vxe-theme', theme);
1930
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
1931
+ return typeof o;
1932
+ } : function (o) {
1933
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1934
+ }, _typeof(o);
1935
+ }
1936
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1937
+
1938
+ function toPrimitive(t, r) {
1939
+ if ("object" != _typeof(t) || !t) return t;
1940
+ var e = t[Symbol.toPrimitive];
1941
+ if (void 0 !== e) {
1942
+ var i = e.call(t, r || "default");
1943
+ if ("object" != _typeof(i)) return i;
1944
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1945
+ }
1946
+ return ("string" === r ? String : Number)(t);
1947
+ }
1948
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1949
+
1950
+
1951
+ function toPropertyKey(t) {
1952
+ var i = toPrimitive(t, "string");
1953
+ return "symbol" == _typeof(i) ? i : i + "";
1954
+ }
1955
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
1956
+
1957
+ function _defineProperty(obj, key, value) {
1958
+ key = toPropertyKey(key);
1959
+ if (key in obj) {
1960
+ Object.defineProperty(obj, key, {
1961
+ value: value,
1962
+ enumerable: true,
1963
+ configurable: true,
1964
+ writable: true
1965
+ });
1966
+ } else {
1967
+ obj[key] = value;
1968
+ }
1969
+ return obj;
1970
+ }
1971
+ ;// CONCATENATED MODULE: ./packages/src/resize.ts
1972
+
1973
+
1974
+
1975
+
1976
+ /**
1977
+ * 监听 resize 事件
1978
+ * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
1979
+ */
1980
+ let resizeTimeout;
1981
+ /* eslint-disable no-use-before-define */
1982
+ const resize_eventStore = [];
1983
+ const defaultInterval = 500;
1984
+ function eventHandle() {
1985
+ if (resize_eventStore.length) {
1986
+ resize_eventStore.forEach(item => {
1987
+ item.tarList.forEach(observer => {
1988
+ const {
1989
+ target,
1990
+ width,
1991
+ heighe
1992
+ } = observer;
1993
+ const clientWidth = target.clientWidth;
1994
+ const clientHeight = target.clientHeight;
1995
+ const rWidth = clientWidth && width !== clientWidth;
1996
+ const rHeight = clientHeight && heighe !== clientHeight;
1997
+ if (rWidth || rHeight) {
1998
+ observer.width = clientWidth;
1999
+ observer.heighe = clientHeight;
2000
+ setTimeout(item.callback);
2001
+ }
2002
+ });
2003
+ });
2004
+ /* eslint-disable @typescript-eslint/no-use-before-define */
2005
+ eventListener();
2006
+ }
2007
+ }
2008
+ function eventListener() {
2009
+ clearTimeout(resizeTimeout);
2010
+ resizeTimeout = setTimeout(eventHandle, globalConfigStore.resizeInterval || defaultInterval);
2011
+ }
2012
+ class XEResizeObserver {
2013
+ constructor(callback) {
2014
+ _defineProperty(this, "tarList", []);
2015
+ _defineProperty(this, "callback", void 0);
2016
+ this.callback = callback;
2017
+ }
2018
+ observe(target) {
2019
+ if (target) {
2020
+ const {
2021
+ tarList
2022
+ } = this;
2023
+ if (!tarList.some(observer => observer.target === target)) {
2024
+ tarList.push({
2025
+ target,
2026
+ width: target.clientWidth,
2027
+ heighe: target.clientHeight
2028
+ });
2029
+ }
2030
+ if (!resize_eventStore.length) {
2031
+ eventListener();
2032
+ }
2033
+ if (!resize_eventStore.some(item => item === this)) {
2034
+ resize_eventStore.push(this);
2035
+ }
1832
2036
  }
1833
2037
  }
2038
+ unobserve(target) {
2039
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().remove(resize_eventStore, item => item.tarList.some(observer => observer.target === target));
2040
+ }
2041
+ disconnect() {
2042
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().remove(resize_eventStore, item => item === this);
2043
+ }
1834
2044
  }
2045
+ const globalResize = {
2046
+ create(callback) {
2047
+ if (window.ResizeObserver) {
2048
+ return new window.ResizeObserver(callback);
2049
+ }
2050
+ return new XEResizeObserver(callback);
2051
+ }
2052
+ };
1835
2053
  ;// CONCATENATED MODULE: ./packages/src/i18n.ts
1836
2054
 
2055
+
1837
2056
  function getI18n(key, args) {
1838
- if (globalStore.i18n) {
1839
- return globalStore.i18n(key, args);
1840
- }
1841
- return key;
2057
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(i18nConfigStore.langMaps[i18nConfigStore.language], key), args);
1842
2058
  }
1843
2059
  ;// CONCATENATED MODULE: ./packages/src/log.ts
1844
2060
 
1845
- function getLog(message, params) {
1846
- return `[vxe-table v${"0.0.1"}] ${getI18n(message, params)}`;
1847
- }
1848
- function outLog(type) {
1849
- return function (message, params) {
1850
- const msg = getLog(message, params);
2061
+ function createLog(type, name) {
2062
+ return function (key, args) {
2063
+ const msg = `[${name || 'vxe'} v${"0.1.0"}] ${getI18n(key, args)}`;
1851
2064
  console[type](msg);
1852
2065
  return msg;
1853
2066
  };
1854
2067
  }
1855
- const warnLog = outLog('warn');
1856
- const errLog = outLog('error');
2068
+ const log = {
2069
+ create: createLog,
2070
+ warn: createLog('warn'),
2071
+ err: createLog('error')
2072
+ };
1857
2073
  ;// CONCATENATED MODULE: ./packages/src/renderer.ts
1858
2074
 
1859
2075
 
@@ -1880,7 +2096,7 @@ const renderer = {
1880
2096
  if (true) {
1881
2097
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(options, (val, key) => {
1882
2098
  if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(renders[key]) && renders[key] !== val) {
1883
- warnLog('vxe.error.coverProp', [`Renderer.${name}`, key]);
2099
+ log.warn('vxe.error.coverProp', [`Renderer.${name}`, key]);
1884
2100
  }
1885
2101
  });
1886
2102
  }
@@ -1900,51 +2116,6 @@ const renderer = {
1900
2116
  return renderer;
1901
2117
  }
1902
2118
  };
1903
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
1904
- function _typeof(o) {
1905
- "@babel/helpers - typeof";
1906
-
1907
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
1908
- return typeof o;
1909
- } : function (o) {
1910
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1911
- }, _typeof(o);
1912
- }
1913
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1914
-
1915
- function toPrimitive(t, r) {
1916
- if ("object" != _typeof(t) || !t) return t;
1917
- var e = t[Symbol.toPrimitive];
1918
- if (void 0 !== e) {
1919
- var i = e.call(t, r || "default");
1920
- if ("object" != _typeof(i)) return i;
1921
- throw new TypeError("@@toPrimitive must return a primitive value.");
1922
- }
1923
- return ("string" === r ? String : Number)(t);
1924
- }
1925
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1926
-
1927
-
1928
- function toPropertyKey(t) {
1929
- var i = toPrimitive(t, "string");
1930
- return "symbol" == _typeof(i) ? i : i + "";
1931
- }
1932
- ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
1933
-
1934
- function _defineProperty(obj, key, value) {
1935
- key = toPropertyKey(key);
1936
- if (key in obj) {
1937
- Object.defineProperty(obj, key, {
1938
- value: value,
1939
- enumerable: true,
1940
- configurable: true,
1941
- writable: true
1942
- });
1943
- } else {
1944
- obj[key] = value;
1945
- }
1946
- return obj;
1947
- }
1948
2119
  ;// CONCATENATED MODULE: ./packages/src/store.ts
1949
2120
 
1950
2121
 
@@ -1975,7 +2146,7 @@ class Store {
1975
2146
  const confKeys = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(conf);
1976
2147
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(options, (item, key) => {
1977
2148
  if (confKeys.includes(key)) {
1978
- warnLog('vxe.error.coverProp', [name, key]);
2149
+ log.warn('vxe.error.coverProp', [name, key]);
1979
2150
  }
1980
2151
  });
1981
2152
  }
@@ -2023,7 +2194,7 @@ class VXEMenusStore {
2023
2194
  // 兼容
2024
2195
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(render)) {
2025
2196
  if (true) {
2026
- warnLog('vxe.error.delProp', ['menus -> callback', 'menuMethod']);
2197
+ log.warn('vxe.error.delProp', ['menus -> callback', 'menuMethod']);
2027
2198
  }
2028
2199
  render = {
2029
2200
  menuMethod: render
@@ -2034,7 +2205,7 @@ class VXEMenusStore {
2034
2205
  const confKeys = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(conf);
2035
2206
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(render, (item, key) => {
2036
2207
  if (confKeys.includes(key)) {
2037
- warnLog('vxe.error.coverProp', [name, key]);
2208
+ log.warn('vxe.error.coverProp', [name, key]);
2038
2209
  }
2039
2210
  });
2040
2211
  }
@@ -2079,7 +2250,7 @@ class VXEFormatsStore {
2079
2250
  // 兼容
2080
2251
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(render)) {
2081
2252
  if (true) {
2082
- warnLog('vxe.error.delProp', ['formats -> callback', 'cellFormatMethod']);
2253
+ log.warn('vxe.error.delProp', ['formats -> callback', 'cellFormatMethod']);
2083
2254
  }
2084
2255
  render = {
2085
2256
  cellFormatMethod: render
@@ -2090,7 +2261,7 @@ class VXEFormatsStore {
2090
2261
  const confKeys = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(conf);
2091
2262
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(render, (item, key) => {
2092
2263
  if (confKeys.includes(key)) {
2093
- warnLog('vxe.error.coverProp', [name, key]);
2264
+ log.warn('vxe.error.coverProp', [name, key]);
2094
2265
  }
2095
2266
  });
2096
2267
  }
@@ -2135,7 +2306,7 @@ class VXECommandsStore {
2135
2306
  // 兼容
2136
2307
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(render)) {
2137
2308
  if (true) {
2138
- warnLog('vxe.error.delProp', ['commands -> callback', 'commandMethod']);
2309
+ log.warn('vxe.error.delProp', ['commands -> callback', 'commandMethod']);
2139
2310
  }
2140
2311
  render = {
2141
2312
  commandMethod: render
@@ -2146,7 +2317,7 @@ class VXECommandsStore {
2146
2317
  const confKeys = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(conf);
2147
2318
  external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(render, (item, key) => {
2148
2319
  if (confKeys.includes(key)) {
2149
- warnLog('vxe.error.coverProp', [name, key]);
2320
+ log.warn('vxe.error.coverProp', [name, key]);
2150
2321
  }
2151
2322
  });
2152
2323
  }
@@ -2166,8 +2337,6 @@ if (true) {
2166
2337
  _name: 'Commands'
2167
2338
  });
2168
2339
  }
2169
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
2170
- var es_array_push = __webpack_require__(4114);
2171
2340
  ;// CONCATENATED MODULE: ./packages/src/interceptor.ts
2172
2341
 
2173
2342
 
@@ -2192,7 +2361,7 @@ const interceptor = {
2192
2361
  // 检测重复
2193
2362
  if (true) {
2194
2363
  if (eList.indexOf(callback) > -1) {
2195
- warnLog('vxe.error.coverProp', ['Interceptor', type]);
2364
+ log.warn('vxe.error.coverProp', ['Interceptor', type]);
2196
2365
  }
2197
2366
  }
2198
2367
  eList.push(callback);
@@ -2263,44 +2432,74 @@ const hooks = new store();
2263
2432
 
2264
2433
 
2265
2434
 
2435
+
2436
+
2437
+
2438
+
2439
+ function setTheme(name) {
2440
+ const theme = name || 'default';
2441
+ themeConfigStore.theme = theme;
2442
+ if (typeof document !== 'undefined') {
2443
+ const documentElement = document.documentElement;
2444
+ if (documentElement) {
2445
+ documentElement.setAttribute('data-vxe-theme', theme);
2446
+ }
2447
+ }
2448
+ return VxeUI;
2449
+ }
2450
+ function getTheme() {
2451
+ return themeConfigStore.theme;
2452
+ }
2453
+ function setLanguage(locale) {
2454
+ i18nConfigStore.language = locale;
2455
+ return VxeUI;
2456
+ }
2457
+ function setI18n(locale, data) {
2458
+ i18nConfigStore.language = locale;
2459
+ i18nConfigStore.langMaps[i18nConfigStore.language] = data || {};
2460
+ return VxeUI;
2461
+ }
2266
2462
  /**
2267
2463
  * 全局参数设置
2268
2464
  */
2269
2465
  function setConfig(options) {
2270
2466
  if (options) {
2271
- if (options.theme) {
2272
- setTheme(options);
2273
- }
2274
2467
  if (options.zIndex) {
2275
2468
  index_esm.setCurrent(options.zIndex);
2276
2469
  }
2277
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().merge(globalStore, options);
2470
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().merge(globalConfigStore, options);
2278
2471
  }
2279
- return VxeCore;
2472
+ return VxeUI;
2280
2473
  }
2281
2474
  /**
2282
2475
  * 获取全局参数
2283
2476
  */
2284
2477
  function getConfig(key, defaultValue) {
2285
- return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(globalStore, key, defaultValue) : globalStore;
2478
+ return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(globalConfigStore, key, defaultValue) : globalConfigStore;
2286
2479
  }
2287
2480
  function setIcon(options) {
2288
2481
  if (options) {
2289
- Object.assign(iconStore, options);
2482
+ Object.assign(iconConfigStore, options);
2290
2483
  }
2291
- return VxeCore;
2484
+ return VxeUI;
2292
2485
  }
2293
2486
  function getIcon(key) {
2294
- return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(iconStore, key) : iconStore;
2487
+ return arguments.length ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(iconConfigStore, key) : iconConfigStore;
2295
2488
  }
2296
- const version = "0.0.1";
2297
- const VxeCore = {
2298
- version,
2489
+ const coreVersion = "0.1.0";
2490
+ const VxeUI = {
2491
+ coreVersion,
2492
+ setTheme,
2493
+ getTheme,
2299
2494
  setConfig,
2300
- getConfig,
2495
+ getConfig: getConfig,
2301
2496
  setIcon,
2302
- getIcon,
2497
+ getIcon: getIcon,
2498
+ setLanguage,
2499
+ setI18n,
2303
2500
  getI18n: getI18n,
2501
+ globalEvents: globalEvents,
2502
+ globalResize: globalResize,
2304
2503
  renderer: renderer,
2305
2504
  validators: validators,
2306
2505
  menus: menus,
@@ -2308,6 +2507,7 @@ const VxeCore = {
2308
2507
  commands: commands,
2309
2508
  interceptor: interceptor,
2310
2509
  clipboard: clipboard,
2510
+ log: log,
2311
2511
  hooks: hooks
2312
2512
  };
2313
2513
  setTheme();
@@ -2319,7 +2519,11 @@ setTheme();
2319
2519
 
2320
2520
 
2321
2521
 
2322
- /* harmony default export */ var core = (VxeCore);
2522
+
2523
+
2524
+
2525
+
2526
+ /* harmony default export */ var core = (VxeUI);
2323
2527
  ;// CONCATENATED MODULE: ./packages/language/zh-CN.ts
2324
2528
  /* harmony default export */ var zh_CN = ({
2325
2529
  vxe: {
@@ -2804,11 +3008,9 @@ setTheme();
2804
3008
  ;// CONCATENATED MODULE: ./packages/index.ts
2805
3009
 
2806
3010
 
2807
-
2808
3011
  // 默认中文
2809
- setConfig({
2810
- i18n: (key, args) => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFormatString(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(zh_CN, key), args)
2811
- });
3012
+ setI18n('zh-CN', zh_CN);
3013
+ setTheme('default');
2812
3014
 
2813
3015
  /* harmony default export */ var packages_0 = (core);
2814
3016
  ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js