xt-element-ui 2.1.72 → 2.2.1

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 (194) hide show
  1. package/lib/index.common.js +267 -61
  2. package/lib/index.css +1 -1
  3. package/lib/index.umd.js +267 -61
  4. package/lib/index.umd.min.js +1 -1
  5. package/lib/xt-badge/demo.html +10 -0
  6. package/lib/xt-badge/index.js +1 -0
  7. package/lib/xt-badge/xt-badge.common.js +335 -0
  8. package/lib/xt-badge/xt-badge.css +1 -0
  9. package/lib/xt-badge/xt-badge.umd.js +345 -0
  10. package/lib/xt-badge/xt-badge.umd.min.js +1 -0
  11. package/lib/xt-button/demo.html +10 -0
  12. package/lib/xt-button/index.js +1 -0
  13. package/lib/xt-button/xt-button.common.js +331 -0
  14. package/lib/xt-button/xt-button.css +1 -0
  15. package/lib/xt-button/xt-button.umd.js +341 -0
  16. package/lib/xt-button/xt-button.umd.min.js +1 -0
  17. package/lib/xt-card/demo.html +10 -0
  18. package/lib/xt-card/index.js +1 -0
  19. package/lib/xt-card/xt-card.common.js +325 -0
  20. package/lib/xt-card/xt-card.css +1 -0
  21. package/lib/xt-card/xt-card.umd.js +335 -0
  22. package/lib/xt-card/xt-card.umd.min.js +1 -0
  23. package/lib/xt-card-item/demo.html +10 -0
  24. package/lib/xt-card-item/index.js +1 -0
  25. package/lib/xt-card-item/xt-card-item.common.js +291 -0
  26. package/lib/xt-card-item/xt-card-item.css +1 -0
  27. package/lib/xt-card-item/xt-card-item.umd.js +301 -0
  28. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -0
  29. package/lib/xt-chart/demo.html +10 -0
  30. package/lib/xt-chart/index.js +1 -0
  31. package/lib/xt-chart/xt-chart.common.js +109203 -0
  32. package/lib/xt-chart/xt-chart.css +1 -0
  33. package/lib/xt-chart/xt-chart.umd.js +109213 -0
  34. package/lib/xt-chart/xt-chart.umd.min.js +1 -0
  35. package/lib/xt-config-provider/demo.html +10 -0
  36. package/lib/xt-config-provider/index.js +1 -0
  37. package/lib/xt-config-provider/xt-config-provider.common.js +108388 -0
  38. package/lib/xt-config-provider/xt-config-provider.css +1 -0
  39. package/lib/xt-config-provider/xt-config-provider.umd.js +108398 -0
  40. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -0
  41. package/lib/xt-date-picker/demo.html +10 -0
  42. package/lib/xt-date-picker/index.js +1 -0
  43. package/lib/xt-date-picker/xt-date-picker.common.js +768 -0
  44. package/lib/xt-date-picker/xt-date-picker.css +1 -0
  45. package/lib/xt-date-picker/xt-date-picker.umd.js +778 -0
  46. package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -0
  47. package/lib/xt-flex-box/demo.html +10 -0
  48. package/lib/xt-flex-box/index.js +1 -0
  49. package/lib/xt-flex-box/xt-flex-box.common.js +303 -0
  50. package/lib/xt-flex-box/xt-flex-box.css +1 -0
  51. package/lib/xt-flex-box/xt-flex-box.umd.js +313 -0
  52. package/lib/xt-flex-box/xt-flex-box.umd.min.js +1 -0
  53. package/lib/xt-form-schema/demo.html +10 -0
  54. package/lib/xt-form-schema/index.js +1 -0
  55. package/lib/xt-form-schema/xt-form-schema.common.js +510 -0
  56. package/lib/xt-form-schema/xt-form-schema.css +1 -0
  57. package/lib/xt-form-schema/xt-form-schema.umd.js +520 -0
  58. package/lib/xt-form-schema/xt-form-schema.umd.min.js +1 -0
  59. package/lib/xt-grid-box/demo.html +10 -0
  60. package/lib/xt-grid-box/index.js +1 -0
  61. package/lib/xt-grid-box/xt-grid-box.common.js +404 -0
  62. package/lib/xt-grid-box/xt-grid-box.css +1 -0
  63. package/lib/xt-grid-box/xt-grid-box.umd.js +414 -0
  64. package/lib/xt-grid-box/xt-grid-box.umd.min.js +1 -0
  65. package/lib/xt-grid-item/demo.html +10 -0
  66. package/lib/xt-grid-item/index.js +1 -0
  67. package/lib/xt-grid-item/xt-grid-item.common.js +381 -0
  68. package/lib/xt-grid-item/xt-grid-item.css +1 -0
  69. package/lib/xt-grid-item/xt-grid-item.umd.js +391 -0
  70. package/lib/xt-grid-item/xt-grid-item.umd.min.js +1 -0
  71. package/lib/xt-icon/demo.html +10 -0
  72. package/lib/xt-icon/index.js +1 -0
  73. package/lib/xt-icon/xt-icon.common.js +430 -0
  74. package/lib/xt-icon/xt-icon.css +1 -0
  75. package/lib/xt-icon/xt-icon.umd.js +440 -0
  76. package/lib/xt-icon/xt-icon.umd.min.js +1 -0
  77. package/lib/xt-input/demo.html +10 -0
  78. package/lib/xt-input/index.js +1 -0
  79. package/lib/xt-input/xt-input.common.js +584 -0
  80. package/lib/xt-input/xt-input.css +1 -0
  81. package/lib/xt-input/xt-input.umd.js +594 -0
  82. package/lib/xt-input/xt-input.umd.min.js +1 -0
  83. package/lib/xt-list/demo.html +10 -0
  84. package/lib/xt-list/index.js +1 -0
  85. package/lib/xt-list/xt-list.common.js +714 -0
  86. package/lib/xt-list/xt-list.css +1 -0
  87. package/lib/xt-list/xt-list.umd.js +724 -0
  88. package/lib/xt-list/xt-list.umd.min.js +1 -0
  89. package/lib/xt-map/demo.html +10 -0
  90. package/lib/xt-map/index.js +1 -0
  91. package/lib/xt-map/xt-map.common.js +1951 -0
  92. package/lib/xt-map/xt-map.css +1 -0
  93. package/lib/xt-map/xt-map.umd.js +1961 -0
  94. package/lib/xt-map/xt-map.umd.min.js +1 -0
  95. package/lib/xt-map-provider/demo.html +10 -0
  96. package/lib/xt-map-provider/index.js +1 -0
  97. package/lib/xt-map-provider/xt-map-provider.common.js +644 -0
  98. package/lib/xt-map-provider/xt-map-provider.css +1 -0
  99. package/lib/xt-map-provider/xt-map-provider.umd.js +654 -0
  100. package/lib/xt-map-provider/xt-map-provider.umd.min.js +1 -0
  101. package/lib/xt-page/demo.html +10 -0
  102. package/lib/xt-page/index.js +1 -0
  103. package/lib/xt-page/xt-page.common.js +353 -0
  104. package/lib/xt-page/xt-page.css +1 -0
  105. package/lib/xt-page/xt-page.umd.js +363 -0
  106. package/lib/xt-page/xt-page.umd.min.js +1 -0
  107. package/lib/xt-progress/demo.html +10 -0
  108. package/lib/xt-progress/index.js +1 -0
  109. package/lib/xt-progress/xt-progress.common.js +327 -0
  110. package/lib/xt-progress/xt-progress.css +1 -0
  111. package/lib/xt-progress/xt-progress.umd.js +337 -0
  112. package/lib/xt-progress/xt-progress.umd.min.js +1 -0
  113. package/lib/xt-scroll-arrow/demo.html +10 -0
  114. package/lib/xt-scroll-arrow/index.js +1 -0
  115. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +495 -0
  116. package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -0
  117. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +505 -0
  118. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -0
  119. package/lib/xt-select-tree/demo.html +10 -0
  120. package/lib/xt-select-tree/index.js +1 -0
  121. package/lib/xt-select-tree/xt-select-tree.common.js +1791 -0
  122. package/lib/xt-select-tree/xt-select-tree.css +1 -0
  123. package/lib/xt-select-tree/xt-select-tree.umd.js +1801 -0
  124. package/lib/xt-select-tree/xt-select-tree.umd.min.js +1 -0
  125. package/lib/xt-step-price/demo.html +10 -0
  126. package/lib/xt-step-price/index.js +1 -0
  127. package/lib/xt-step-price/xt-step-price.common.js +800 -0
  128. package/lib/xt-step-price/xt-step-price.css +1 -0
  129. package/lib/xt-step-price/xt-step-price.umd.js +810 -0
  130. package/lib/xt-step-price/xt-step-price.umd.min.js +1 -0
  131. package/lib/xt-step-price-item/demo.html +10 -0
  132. package/lib/xt-step-price-item/index.js +1 -0
  133. package/lib/xt-step-price-item/xt-step-price-item.common.js +417 -0
  134. package/lib/xt-step-price-item/xt-step-price-item.umd.js +427 -0
  135. package/lib/xt-step-price-item/xt-step-price-item.umd.min.js +1 -0
  136. package/lib/xt-tab-pane/demo.html +10 -0
  137. package/lib/xt-tab-pane/index.js +1 -0
  138. package/lib/xt-tab-pane/xt-tab-pane.common.js +309 -0
  139. package/lib/xt-tab-pane/xt-tab-pane.umd.js +319 -0
  140. package/lib/xt-tab-pane/xt-tab-pane.umd.min.js +1 -0
  141. package/lib/xt-table/demo.html +10 -0
  142. package/lib/xt-table/index.js +1 -0
  143. package/lib/xt-table/xt-table.common.js +1027 -0
  144. package/lib/xt-table/xt-table.css +1 -0
  145. package/lib/xt-table/xt-table.umd.js +1037 -0
  146. package/lib/xt-table/xt-table.umd.min.js +1 -0
  147. package/lib/xt-tabs/demo.html +10 -0
  148. package/lib/xt-tabs/index.js +1 -0
  149. package/lib/xt-tabs/xt-tabs.common.js +463 -0
  150. package/lib/xt-tabs/xt-tabs.css +1 -0
  151. package/lib/xt-tabs/xt-tabs.umd.js +473 -0
  152. package/lib/xt-tabs/xt-tabs.umd.min.js +1 -0
  153. package/lib/xt-text/demo.html +10 -0
  154. package/lib/xt-text/index.js +1 -0
  155. package/lib/xt-text/xt-text.common.js +536 -0
  156. package/lib/xt-text/xt-text.css +1 -0
  157. package/lib/xt-text/xt-text.umd.js +546 -0
  158. package/lib/xt-text/xt-text.umd.min.js +1 -0
  159. package/lib/xt-time/demo.html +10 -0
  160. package/lib/xt-time/index.js +1 -0
  161. package/lib/xt-time/xt-time.common.js +555 -0
  162. package/lib/xt-time/xt-time.css +1 -0
  163. package/lib/xt-time/xt-time.umd.js +565 -0
  164. package/lib/xt-time/xt-time.umd.min.js +1 -0
  165. package/lib/xt-transfer-tree/demo.html +10 -0
  166. package/lib/xt-transfer-tree/index.js +1 -0
  167. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +594 -0
  168. package/lib/xt-transfer-tree/xt-transfer-tree.css +1 -0
  169. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +604 -0
  170. package/lib/xt-transfer-tree/xt-transfer-tree.umd.min.js +1 -0
  171. package/lib/xt-upload/demo.html +10 -0
  172. package/lib/xt-upload/index.js +1 -0
  173. package/lib/xt-upload/xt-upload.common.js +1292 -0
  174. package/lib/xt-upload/xt-upload.css +1 -0
  175. package/lib/xt-upload/xt-upload.umd.js +1302 -0
  176. package/lib/xt-upload/xt-upload.umd.min.js +1 -0
  177. package/package.json +4 -2
  178. package/src/components/xt-badge/index.js +8 -7
  179. package/src/components/xt-button/index.js +1 -0
  180. package/src/components/xt-card/index.js +1 -0
  181. package/src/components/xt-card-item/index.js +1 -0
  182. package/src/components/xt-config-provider/index.js +1 -0
  183. package/src/components/xt-flex-box/index.js +1 -0
  184. package/src/components/xt-grid-box/index.js +1 -0
  185. package/src/components/xt-icon/index.js +1 -0
  186. package/src/components/xt-input/index.js +1 -0
  187. package/src/components/xt-map/index.js +1 -0
  188. package/src/components/xt-progress/index.js +8 -7
  189. package/src/components/xt-scroll-arrow/index.js +8 -7
  190. package/src/components/xt-step-price/index.js +1 -0
  191. package/src/components/xt-tabs/index.js +9 -8
  192. package/src/components/xt-text/index.js +1 -0
  193. package/src/components/xt-time/index.js +1 -0
  194. package/src/index.js +32 -2
@@ -0,0 +1,654 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["xt-map-provider"] = factory();
8
+ else
9
+ root["xt-map-provider"] = factory();
10
+ })((typeof self !== 'undefined' ? self : this), function() {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = "fb15");
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ "3cef":
100
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
101
+
102
+ "use strict";
103
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_provider_vue_vue_type_style_index_0_id_16f243b0_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("69c5");
104
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_provider_vue_vue_type_style_index_0_id_16f243b0_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_provider_vue_vue_type_style_index_0_id_16f243b0_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
105
+ /* unused harmony reexport * */
106
+
107
+
108
+ /***/ }),
109
+
110
+ /***/ "69c5":
111
+ /***/ (function(module, exports, __webpack_require__) {
112
+
113
+ // extracted by mini-css-extract-plugin
114
+
115
+ /***/ }),
116
+
117
+ /***/ "fb15":
118
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
119
+
120
+ "use strict";
121
+ // ESM COMPAT FLAG
122
+ __webpack_require__.r(__webpack_exports__);
123
+
124
+ // EXPORTS
125
+ __webpack_require__.d(__webpack_exports__, "XtMapProvider", function() { return /* reexport */ provider; });
126
+
127
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
128
+ // This file is imported into lib/wc client bundles.
129
+
130
+ if (typeof window !== 'undefined') {
131
+ var currentScript = window.document.currentScript
132
+ if (false) { var getCurrentScript; }
133
+
134
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
135
+ if (src) {
136
+ __webpack_require__.p = src[1] // eslint-disable-line
137
+ }
138
+ }
139
+
140
+ // Indicate to webpack that this file can be concatenated
141
+ /* harmony default export */ var setPublicPath = (null);
142
+
143
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-map/provider.vue?vue&type=template&id=16f243b0&scoped=true
144
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{class:['xt-map-provider', { 'xt-map-provider--dark': _vm.mergedTheme === 'dark' }],style:(_vm.wrapperStyle)},[_vm._t("default")],2)
145
+ }
146
+ var staticRenderFns = []
147
+
148
+
149
+ // CONCATENATED MODULE: ./src/components/xt-map/provider.vue?vue&type=template&id=16f243b0&scoped=true
150
+
151
+ // CONCATENATED MODULE: ./src/components/xt-map/config/xt-map-config.js
152
+ /**
153
+ * XtMap 全局配置管理
154
+ * 支持通过 Vue.use 配置或运行时动态设置地图提供商、密钥、URL、主题等
155
+ */
156
+
157
+ // 支持的地图提供商
158
+ const MAP_PROVIDERS = ['amap', 'tianditu', 'baidu']
159
+
160
+ // 支持的地图类型(统一枚举,各适配器会转成对应引擎的类型)
161
+ const MAP_TYPES = ['standard', 'satellite', 'hybrid', 'traffic']
162
+
163
+ // 支持的主题
164
+ const MAP_THEMES = ['light', 'dark']
165
+
166
+ // 默认配置 - 以高德地图为基准
167
+ const defaultConfig = {
168
+ provider: 'amap',
169
+ apiKey: '',
170
+ apiUrl: null,
171
+ mapType: 'standard',
172
+ theme: 'light',
173
+ center: [116.397428, 39.90923],
174
+ zoom: 11,
175
+ plugins: [],
176
+ securityJsCode: null,
177
+ // 天地图专用:图层类型(vec:矢量, img:影像, ter:地形)
178
+ tiandituLayerType: 'vec',
179
+ // 百度地图专用:坐标系(bd09ll:百度经纬度, bd09mc:百度墨卡托)
180
+ baiduCoordType: 'bd09ll'
181
+ }
182
+
183
+ // 当前配置
184
+ let currentConfig = { ...defaultConfig }
185
+
186
+ // 配置变更监听器
187
+ const configChangeListeners = []
188
+
189
+ const emitConfigChange = (key, value) => {
190
+ configChangeListeners.forEach(listener => {
191
+ try {
192
+ listener(key, value)
193
+ } catch (e) {
194
+ console.warn('[XtMap] 配置变更监听异常:', e)
195
+ }
196
+ })
197
+ }
198
+
199
+ // 获取完整配置
200
+ const getMapConfig = () => ({ ...currentConfig })
201
+
202
+ // 设置完整配置
203
+ const setMapConfig = (config) => {
204
+ if (typeof config !== 'object' || config === null) {
205
+ console.warn('[XtMap] setMapConfig 必须传入对象参数')
206
+ return
207
+ }
208
+
209
+ if (config.provider !== undefined) setMapProvider(config.provider)
210
+ if (config.apiKey !== undefined) setMapApiKey(config.apiKey)
211
+ if (config.apiUrl !== undefined) setMapApiUrl(config.apiUrl)
212
+ if (config.mapType !== undefined) setMapType(config.mapType)
213
+ if (config.theme !== undefined) setMapTheme(config.theme)
214
+ if (config.center !== undefined) setMapCenter(config.center)
215
+ if (config.zoom !== undefined) setMapZoom(config.zoom)
216
+ if (config.plugins !== undefined) setMapPlugins(config.plugins)
217
+ if (config.securityJsCode !== undefined) setSecurityJsCode(config.securityJsCode)
218
+ }
219
+
220
+ const setMapProvider = (provider) => {
221
+ if (!MAP_PROVIDERS.includes(provider)) {
222
+ console.warn(`[XtMap] 无效的地图提供商: ${provider},可选: ${MAP_PROVIDERS.join(', ')}`)
223
+ return
224
+ }
225
+ currentConfig.provider = provider
226
+ emitConfigChange('provider', provider)
227
+ }
228
+
229
+ const setMapApiKey = (key) => {
230
+ currentConfig.apiKey = key
231
+ emitConfigChange('apiKey', key)
232
+ }
233
+
234
+ const setMapApiUrl = (url) => {
235
+ currentConfig.apiUrl = url
236
+ emitConfigChange('apiUrl', url)
237
+ }
238
+
239
+ const setMapType = (type) => {
240
+ if (!MAP_TYPES.includes(type)) {
241
+ console.warn(`[XtMap] 无效的地图类型: ${type},可选: ${MAP_TYPES.join(', ')}`)
242
+ return
243
+ }
244
+ currentConfig.mapType = type
245
+ emitConfigChange('mapType', type)
246
+ }
247
+
248
+ const setMapTheme = (theme) => {
249
+ if (!MAP_THEMES.includes(theme)) {
250
+ console.warn(`[XtMap] 无效的主题: ${theme},可选: ${MAP_THEMES.join(', ')}`)
251
+ return
252
+ }
253
+ currentConfig.theme = theme
254
+ emitConfigChange('theme', theme)
255
+ }
256
+
257
+ const setMapCenter = (center) => {
258
+ if (!Array.isArray(center) || center.length !== 2) {
259
+ console.warn('[XtMap] center 必须是 [lng, lat] 数组')
260
+ return
261
+ }
262
+ currentConfig.center = center
263
+ emitConfigChange('center', center)
264
+ }
265
+
266
+ const setMapZoom = (zoom) => {
267
+ const z = Number(zoom)
268
+ if (isNaN(z)) {
269
+ console.warn('[XtMap] zoom 必须是数字')
270
+ return
271
+ }
272
+ currentConfig.zoom = z
273
+ emitConfigChange('zoom', z)
274
+ }
275
+
276
+ const setMapPlugins = (plugins) => {
277
+ if (!Array.isArray(plugins)) {
278
+ console.warn('[XtMap] plugins 必须是数组')
279
+ return
280
+ }
281
+ currentConfig.plugins = plugins
282
+ emitConfigChange('plugins', plugins)
283
+ }
284
+
285
+ const setSecurityJsCode = (code) => {
286
+ currentConfig.securityJsCode = code
287
+ // 高德地图安全密钥:设置 window._AMapSecurityConfig
288
+ if (typeof window !== 'undefined' && code) {
289
+ window._AMapSecurityConfig = {
290
+ securityJsCode: code,
291
+ ...(window._AMapSecurityConfig || {})
292
+ }
293
+ }
294
+ emitConfigChange('securityJsCode', code)
295
+ }
296
+
297
+ // 获取当前配置的快捷方法
298
+ const getMapProvider = () => currentConfig.provider
299
+ const getMapApiKey = () => currentConfig.apiKey
300
+ const getMapApiUrl = () => currentConfig.apiUrl
301
+ const getMapType = () => currentConfig.mapType
302
+ const getMapTheme = () => currentConfig.theme
303
+ const getMapCenter = () => currentConfig.center
304
+ const getMapZoom = () => currentConfig.zoom
305
+ const getMapPlugins = () => currentConfig.plugins
306
+
307
+ // 监听配置变更
308
+ const onMapConfigChange = (listener) => {
309
+ if (typeof listener === 'function') {
310
+ configChangeListeners.push(listener)
311
+ return () => {
312
+ const index = configChangeListeners.indexOf(listener)
313
+ if (index > -1) configChangeListeners.splice(index, 1)
314
+ }
315
+ }
316
+ }
317
+
318
+ // 重置为默认配置
319
+ const resetMapConfig = () => {
320
+ setMapConfig(defaultConfig)
321
+ }
322
+
323
+ /* harmony default export */ var xt_map_config = ({
324
+ MAP_PROVIDERS,
325
+ MAP_TYPES,
326
+ MAP_THEMES,
327
+ getMapConfig,
328
+ setMapConfig,
329
+ setMapProvider,
330
+ setMapApiKey,
331
+ setMapApiUrl,
332
+ setMapType,
333
+ setMapTheme,
334
+ setMapCenter,
335
+ setMapZoom,
336
+ setMapPlugins,
337
+ setSecurityJsCode,
338
+ getMapProvider,
339
+ getMapApiKey,
340
+ getMapApiUrl,
341
+ getMapType,
342
+ getMapTheme,
343
+ getMapCenter,
344
+ getMapZoom,
345
+ getMapPlugins,
346
+ onMapConfigChange,
347
+ resetMapConfig
348
+ });
349
+
350
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-map/provider.vue?vue&type=script&lang=js
351
+
352
+
353
+
354
+ /* harmony default export */ var providervue_type_script_lang_js = ({
355
+ name: 'XtMapProvider',
356
+
357
+ props: {
358
+ provider: {
359
+ type: String,
360
+ default: '',
361
+ validator: (val) => val === '' || MAP_PROVIDERS.includes(val)
362
+ },
363
+ apiKey: {
364
+ type: String,
365
+ default: ''
366
+ },
367
+ apiUrl: {
368
+ type: String,
369
+ default: ''
370
+ },
371
+ mapType: {
372
+ type: String,
373
+ default: '',
374
+ validator: (val) => val === '' || MAP_TYPES.includes(val)
375
+ },
376
+ theme: {
377
+ type: String,
378
+ default: '',
379
+ validator: (val) => val === '' || MAP_THEMES.includes(val)
380
+ },
381
+ center: {
382
+ type: Array,
383
+ default: () => null
384
+ },
385
+ zoom: {
386
+ type: Number,
387
+ default: null
388
+ },
389
+ plugins: {
390
+ type: Array,
391
+ default: () => []
392
+ },
393
+ securityJsCode: {
394
+ type: String,
395
+ default: ''
396
+ },
397
+ tag: {
398
+ type: String,
399
+ default: 'div'
400
+ }
401
+ },
402
+
403
+ data() {
404
+ return {
405
+ mergedTheme: this.theme || getMapTheme() || 'light'
406
+ }
407
+ },
408
+
409
+ computed: {
410
+ wrapperStyle() {
411
+ return {}
412
+ }
413
+ },
414
+
415
+ watch: {
416
+ provider: {
417
+ immediate: true,
418
+ handler(newVal) {
419
+ if (newVal) setMapProvider(newVal)
420
+ }
421
+ },
422
+ apiKey: {
423
+ immediate: true,
424
+ handler(newVal) {
425
+ if (newVal) setMapApiKey(newVal)
426
+ }
427
+ },
428
+ apiUrl: {
429
+ immediate: true,
430
+ handler(newVal) {
431
+ if (newVal) setMapApiUrl(newVal)
432
+ }
433
+ },
434
+ mapType: {
435
+ immediate: true,
436
+ handler(newVal) {
437
+ if (newVal) setMapType(newVal)
438
+ }
439
+ },
440
+ theme: {
441
+ immediate: true,
442
+ handler(newVal) {
443
+ if (newVal) {
444
+ setMapTheme(newVal)
445
+ this.mergedTheme = newVal
446
+ }
447
+ }
448
+ },
449
+ center: {
450
+ immediate: true,
451
+ handler(newVal) {
452
+ if (newVal) setMapCenter(newVal)
453
+ }
454
+ },
455
+ zoom: {
456
+ immediate: true,
457
+ handler(newVal) {
458
+ if (newVal !== null && newVal !== undefined) setMapZoom(newVal)
459
+ }
460
+ },
461
+ plugins: {
462
+ immediate: true,
463
+ handler(newVal) {
464
+ if (newVal && newVal.length > 0) setMapPlugins(newVal)
465
+ }
466
+ },
467
+ securityJsCode: {
468
+ immediate: true,
469
+ handler(newVal) {
470
+ if (newVal) setSecurityJsCode(newVal)
471
+ }
472
+ }
473
+ },
474
+
475
+ provide() {
476
+ return {
477
+ xtMapConfig: {
478
+ getProvider: () => this.provider || getMapProvider(),
479
+ getApiKey: () => this.apiKey || getMapApiKey(),
480
+ getApiUrl: () => this.apiUrl || getMapApiUrl(),
481
+ getMapType: () => this.mapType || getMapType(),
482
+ getTheme: () => this.theme || getMapTheme(),
483
+ getCenter: () => this.center || getMapCenter(),
484
+ getZoom: () => this.zoom !== null ? this.zoom : getMapZoom(),
485
+ getPlugins: () => this.plugins.length > 0 ? this.plugins : getMapPlugins(),
486
+ getConfig: () => ({
487
+ provider: this.provider || getMapProvider(),
488
+ apiKey: this.apiKey || getMapApiKey(),
489
+ apiUrl: this.apiUrl || getMapApiUrl(),
490
+ mapType: this.mapType || getMapType(),
491
+ theme: this.theme || getMapTheme(),
492
+ center: this.center || getMapCenter(),
493
+ zoom: this.zoom !== null ? this.zoom : getMapZoom()
494
+ })
495
+ }
496
+ }
497
+ },
498
+
499
+ created() {
500
+ this._unsubscribe = onMapConfigChange((key, value) => {
501
+ if (key === 'theme') this.mergedTheme = this.theme || value
502
+ })
503
+ },
504
+
505
+ beforeDestroy() {
506
+ if (this._unsubscribe) this._unsubscribe()
507
+ }
508
+ });
509
+
510
+ // CONCATENATED MODULE: ./src/components/xt-map/provider.vue?vue&type=script&lang=js
511
+ /* harmony default export */ var xt_map_providervue_type_script_lang_js = (providervue_type_script_lang_js);
512
+ // EXTERNAL MODULE: ./src/components/xt-map/provider.vue?vue&type=style&index=0&id=16f243b0&prod&scoped=true&lang=css
513
+ var providervue_type_style_index_0_id_16f243b0_prod_scoped_true_lang_css = __webpack_require__("3cef");
514
+
515
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
516
+ /* globals __VUE_SSR_CONTEXT__ */
517
+
518
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
519
+ // This module is a runtime utility for cleaner component module output and will
520
+ // be included in the final webpack user bundle.
521
+
522
+ function normalizeComponent(
523
+ scriptExports,
524
+ render,
525
+ staticRenderFns,
526
+ functionalTemplate,
527
+ injectStyles,
528
+ scopeId,
529
+ moduleIdentifier /* server only */,
530
+ shadowMode /* vue-cli only */
531
+ ) {
532
+ // Vue.extend constructor export interop
533
+ var options =
534
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
535
+
536
+ // render functions
537
+ if (render) {
538
+ options.render = render
539
+ options.staticRenderFns = staticRenderFns
540
+ options._compiled = true
541
+ }
542
+
543
+ // functional template
544
+ if (functionalTemplate) {
545
+ options.functional = true
546
+ }
547
+
548
+ // scopedId
549
+ if (scopeId) {
550
+ options._scopeId = 'data-v-' + scopeId
551
+ }
552
+
553
+ var hook
554
+ if (moduleIdentifier) {
555
+ // server build
556
+ hook = function (context) {
557
+ // 2.3 injection
558
+ context =
559
+ context || // cached call
560
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
561
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
562
+ // 2.2 with runInNewContext: true
563
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
564
+ context = __VUE_SSR_CONTEXT__
565
+ }
566
+ // inject component styles
567
+ if (injectStyles) {
568
+ injectStyles.call(this, context)
569
+ }
570
+ // register component module identifier for async chunk inferrence
571
+ if (context && context._registeredComponents) {
572
+ context._registeredComponents.add(moduleIdentifier)
573
+ }
574
+ }
575
+ // used by ssr in case component is cached and beforeCreate
576
+ // never gets called
577
+ options._ssrRegister = hook
578
+ } else if (injectStyles) {
579
+ hook = shadowMode
580
+ ? function () {
581
+ injectStyles.call(
582
+ this,
583
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
584
+ )
585
+ }
586
+ : injectStyles
587
+ }
588
+
589
+ if (hook) {
590
+ if (options.functional) {
591
+ // for template-only hot-reload because in that case the render fn doesn't
592
+ // go through the normalizer
593
+ options._injectStyles = hook
594
+ // register for functional component in vue file
595
+ var originalRender = options.render
596
+ options.render = function renderWithStyleInjection(h, context) {
597
+ hook.call(context)
598
+ return originalRender(h, context)
599
+ }
600
+ } else {
601
+ // inject component registration as beforeCreate hook
602
+ var existing = options.beforeCreate
603
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
604
+ }
605
+ }
606
+
607
+ return {
608
+ exports: scriptExports,
609
+ options: options
610
+ }
611
+ }
612
+
613
+ // CONCATENATED MODULE: ./src/components/xt-map/provider.vue
614
+
615
+
616
+
617
+
618
+
619
+
620
+ /* normalize component */
621
+
622
+ var component = normalizeComponent(
623
+ xt_map_providervue_type_script_lang_js,
624
+ render,
625
+ staticRenderFns,
626
+ false,
627
+ null,
628
+ "16f243b0",
629
+ null
630
+
631
+ )
632
+
633
+ /* harmony default export */ var provider = (component.exports);
634
+ // CONCATENATED MODULE: ./src/components/xt-map-provider/index.js
635
+
636
+
637
+ provider.install = function (Vue) {
638
+ Vue.component(provider.name, provider)
639
+ }
640
+
641
+ /* harmony default export */ var xt_map_provider = (provider);
642
+
643
+
644
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
645
+
646
+
647
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (xt_map_provider);
648
+
649
+
650
+
651
+ /***/ })
652
+
653
+ /******/ });
654
+ });
@@ -0,0 +1 @@
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["xt-map-provider"]=t():e["xt-map-provider"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({"3cef":function(e,t,r){"use strict";r("69c5")},"69c5":function(e,t,r){},fb15:function(e,t,r){"use strict";if(r.r(t),r.d(t,"XtMapProvider",(function(){return J})),"undefined"!==typeof window){var n=window.document.currentScript,i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var o=function(){var e=this,t=e._self._c;return t("div",{class:["xt-map-provider",{"xt-map-provider--dark":"dark"===e.mergedTheme}],style:e.wrapperStyle},[e._t("default")],2)},a=[];const p=["amap","tianditu","baidu"],s=["standard","satellite","hybrid","traffic"],d=["light","dark"],l={provider:"amap",apiKey:"",apiUrl:null,mapType:"standard",theme:"light",center:[116.397428,39.90923],zoom:11,plugins:[],securityJsCode:null,tiandituLayerType:"vec",baiduCoordType:"bd09ll"};let u={...l};const c=[],f=(e,t)=>{c.forEach(r=>{try{r(e,t)}catch(n){console.warn("[XtMap] 配置变更监听异常:",n)}})},m=e=>{p.includes(e)?(u.provider=e,f("provider",e)):console.warn(`[XtMap] 无效的地图提供商: ${e},可选: ${p.join(", ")}`)},h=e=>{u.apiKey=e,f("apiKey",e)},y=e=>{u.apiUrl=e,f("apiUrl",e)},g=e=>{s.includes(e)?(u.mapType=e,f("mapType",e)):console.warn(`[XtMap] 无效的地图类型: ${e},可选: ${s.join(", ")}`)},v=e=>{d.includes(e)?(u.theme=e,f("theme",e)):console.warn(`[XtMap] 无效的主题: ${e},可选: ${d.join(", ")}`)},b=e=>{Array.isArray(e)&&2===e.length?(u.center=e,f("center",e)):console.warn("[XtMap] center 必须是 [lng, lat] 数组")},_=e=>{const t=Number(e);isNaN(t)?console.warn("[XtMap] zoom 必须是数字"):(u.zoom=t,f("zoom",t))},T=e=>{Array.isArray(e)?(u.plugins=e,f("plugins",e)):console.warn("[XtMap] plugins 必须是数组")},w=e=>{u.securityJsCode=e,"undefined"!==typeof window&&e&&(window._AMapSecurityConfig={securityJsCode:e,...window._AMapSecurityConfig||{}}),f("securityJsCode",e)},S=()=>u.provider,C=()=>u.apiKey,x=()=>u.apiUrl,M=()=>u.mapType,j=()=>u.theme,$=()=>u.center,z=()=>u.zoom,U=()=>u.plugins,X=e=>{if("function"===typeof e)return c.push(e),()=>{const t=c.indexOf(e);t>-1&&c.splice(t,1)}};var A={name:"XtMapProvider",props:{provider:{type:String,default:"",validator:e=>""===e||p.includes(e)},apiKey:{type:String,default:""},apiUrl:{type:String,default:""},mapType:{type:String,default:"",validator:e=>""===e||s.includes(e)},theme:{type:String,default:"",validator:e=>""===e||d.includes(e)},center:{type:Array,default:()=>null},zoom:{type:Number,default:null},plugins:{type:Array,default:()=>[]},securityJsCode:{type:String,default:""},tag:{type:String,default:"div"}},data(){return{mergedTheme:this.theme||j()||"light"}},computed:{wrapperStyle(){return{}}},watch:{provider:{immediate:!0,handler(e){e&&m(e)}},apiKey:{immediate:!0,handler(e){e&&h(e)}},apiUrl:{immediate:!0,handler(e){e&&y(e)}},mapType:{immediate:!0,handler(e){e&&g(e)}},theme:{immediate:!0,handler(e){e&&(v(e),this.mergedTheme=e)}},center:{immediate:!0,handler(e){e&&b(e)}},zoom:{immediate:!0,handler(e){null!==e&&void 0!==e&&_(e)}},plugins:{immediate:!0,handler(e){e&&e.length>0&&T(e)}},securityJsCode:{immediate:!0,handler(e){e&&w(e)}}},provide(){return{xtMapConfig:{getProvider:()=>this.provider||S(),getApiKey:()=>this.apiKey||C(),getApiUrl:()=>this.apiUrl||x(),getMapType:()=>this.mapType||M(),getTheme:()=>this.theme||j(),getCenter:()=>this.center||$(),getZoom:()=>null!==this.zoom?this.zoom:z(),getPlugins:()=>this.plugins.length>0?this.plugins:U(),getConfig:()=>({provider:this.provider||S(),apiKey:this.apiKey||C(),apiUrl:this.apiUrl||x(),mapType:this.mapType||M(),theme:this.theme||j(),center:this.center||$(),zoom:null!==this.zoom?this.zoom:z()})}}},created(){this._unsubscribe=X((e,t)=>{"theme"===e&&(this.mergedTheme=this.theme||t)})},beforeDestroy(){this._unsubscribe&&this._unsubscribe()}},K=A;r("3cef");function O(e,t,r,n,i,o,a,p){var s,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=r,d._compiled=!0),n&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=s):i&&(s=p?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),s)if(d.functional){d._injectStyles=s;var l=d.render;d.render=function(e,t){return s.call(t),l(e,t)}}else{var u=d.beforeCreate;d.beforeCreate=u?[].concat(u,s):[s]}return{exports:e,options:d}}var P=O(K,o,a,!1,null,"16f243b0",null),J=P.exports;J.install=function(e){e.component(J.name,J)};var N=J;t["default"]=N}})}));
@@ -0,0 +1,10 @@
1
+ <meta charset="utf-8">
2
+ <title>xt-page demo</title>
3
+ <script src="./xt-page.umd.js"></script>
4
+
5
+ <link rel="stylesheet" href="./xt-page.css">
6
+
7
+
8
+ <script>
9
+ console.log(xt-page)
10
+ </script>
@@ -0,0 +1 @@
1
+ module.exports = require('./xt-page.common.js');