xt-element-ui 2.1.61 → 2.2.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 (202) hide show
  1. package/docs/components/base/xt-bar.md +5 -5
  2. package/docs/components/base/xt-chart.md +5 -5
  3. package/docs/components/base/xt-line.md +4 -4
  4. package/docs/components/base/xt-multi.md +5 -5
  5. package/docs/components/base/xt-pie.md +5 -5
  6. package/lib/index.common.js +503 -165
  7. package/lib/index.css +1 -1
  8. package/lib/index.umd.js +506 -168
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/xt-badge/demo.html +10 -0
  11. package/lib/xt-badge/index.js +1 -0
  12. package/lib/xt-badge/xt-badge.common.js +335 -0
  13. package/lib/xt-badge/xt-badge.css +1 -0
  14. package/lib/xt-badge/xt-badge.umd.js +345 -0
  15. package/lib/xt-badge/xt-badge.umd.min.js +1 -0
  16. package/lib/xt-button/demo.html +10 -0
  17. package/lib/xt-button/index.js +1 -0
  18. package/lib/xt-button/xt-button.common.js +331 -0
  19. package/lib/xt-button/xt-button.css +1 -0
  20. package/lib/xt-button/xt-button.umd.js +341 -0
  21. package/lib/xt-button/xt-button.umd.min.js +1 -0
  22. package/lib/xt-card/demo.html +10 -0
  23. package/lib/xt-card/index.js +1 -0
  24. package/lib/xt-card/xt-card.common.js +325 -0
  25. package/lib/xt-card/xt-card.css +1 -0
  26. package/lib/xt-card/xt-card.umd.js +335 -0
  27. package/lib/xt-card/xt-card.umd.min.js +1 -0
  28. package/lib/xt-card-item/demo.html +10 -0
  29. package/lib/xt-card-item/index.js +1 -0
  30. package/lib/xt-card-item/xt-card-item.common.js +291 -0
  31. package/lib/xt-card-item/xt-card-item.css +1 -0
  32. package/lib/xt-card-item/xt-card-item.umd.js +301 -0
  33. package/lib/xt-card-item/xt-card-item.umd.min.js +1 -0
  34. package/lib/xt-chart/demo.html +10 -0
  35. package/lib/xt-chart/index.js +1 -0
  36. package/lib/xt-chart/xt-chart.common.js +109203 -0
  37. package/lib/xt-chart/xt-chart.css +1 -0
  38. package/lib/xt-chart/xt-chart.umd.js +109213 -0
  39. package/lib/xt-chart/xt-chart.umd.min.js +1 -0
  40. package/lib/xt-config-provider/demo.html +10 -0
  41. package/lib/xt-config-provider/index.js +1 -0
  42. package/lib/xt-config-provider/xt-config-provider.common.js +108388 -0
  43. package/lib/xt-config-provider/xt-config-provider.css +1 -0
  44. package/lib/xt-config-provider/xt-config-provider.umd.js +108398 -0
  45. package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -0
  46. package/lib/xt-date-picker/demo.html +10 -0
  47. package/lib/xt-date-picker/index.js +1 -0
  48. package/lib/xt-date-picker/xt-date-picker.common.js +768 -0
  49. package/lib/xt-date-picker/xt-date-picker.css +1 -0
  50. package/lib/xt-date-picker/xt-date-picker.umd.js +778 -0
  51. package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -0
  52. package/lib/xt-flex-box/demo.html +10 -0
  53. package/lib/xt-flex-box/index.js +1 -0
  54. package/lib/xt-flex-box/xt-flex-box.common.js +303 -0
  55. package/lib/xt-flex-box/xt-flex-box.css +1 -0
  56. package/lib/xt-flex-box/xt-flex-box.umd.js +313 -0
  57. package/lib/xt-flex-box/xt-flex-box.umd.min.js +1 -0
  58. package/lib/xt-form-schema/demo.html +10 -0
  59. package/lib/xt-form-schema/index.js +1 -0
  60. package/lib/xt-form-schema/xt-form-schema.common.js +510 -0
  61. package/lib/xt-form-schema/xt-form-schema.css +1 -0
  62. package/lib/xt-form-schema/xt-form-schema.umd.js +520 -0
  63. package/lib/xt-form-schema/xt-form-schema.umd.min.js +1 -0
  64. package/lib/xt-grid-box/demo.html +10 -0
  65. package/lib/xt-grid-box/index.js +1 -0
  66. package/lib/xt-grid-box/xt-grid-box.common.js +404 -0
  67. package/lib/xt-grid-box/xt-grid-box.css +1 -0
  68. package/lib/xt-grid-box/xt-grid-box.umd.js +414 -0
  69. package/lib/xt-grid-box/xt-grid-box.umd.min.js +1 -0
  70. package/lib/xt-grid-item/demo.html +10 -0
  71. package/lib/xt-grid-item/index.js +1 -0
  72. package/lib/xt-grid-item/xt-grid-item.common.js +381 -0
  73. package/lib/xt-grid-item/xt-grid-item.css +1 -0
  74. package/lib/xt-grid-item/xt-grid-item.umd.js +391 -0
  75. package/lib/xt-grid-item/xt-grid-item.umd.min.js +1 -0
  76. package/lib/xt-icon/demo.html +10 -0
  77. package/lib/xt-icon/index.js +1 -0
  78. package/lib/xt-icon/xt-icon.common.js +430 -0
  79. package/lib/xt-icon/xt-icon.css +1 -0
  80. package/lib/xt-icon/xt-icon.umd.js +440 -0
  81. package/lib/xt-icon/xt-icon.umd.min.js +1 -0
  82. package/lib/xt-input/demo.html +10 -0
  83. package/lib/xt-input/index.js +1 -0
  84. package/lib/xt-input/xt-input.common.js +584 -0
  85. package/lib/xt-input/xt-input.css +1 -0
  86. package/lib/xt-input/xt-input.umd.js +594 -0
  87. package/lib/xt-input/xt-input.umd.min.js +1 -0
  88. package/lib/xt-list/demo.html +10 -0
  89. package/lib/xt-list/index.js +1 -0
  90. package/lib/xt-list/xt-list.common.js +714 -0
  91. package/lib/xt-list/xt-list.css +1 -0
  92. package/lib/xt-list/xt-list.umd.js +724 -0
  93. package/lib/xt-list/xt-list.umd.min.js +1 -0
  94. package/lib/xt-map/demo.html +10 -0
  95. package/lib/xt-map/index.js +1 -0
  96. package/lib/xt-map/xt-map.common.js +1951 -0
  97. package/lib/xt-map/xt-map.css +1 -0
  98. package/lib/xt-map/xt-map.umd.js +1961 -0
  99. package/lib/xt-map/xt-map.umd.min.js +1 -0
  100. package/lib/xt-map-provider/demo.html +10 -0
  101. package/lib/xt-map-provider/index.js +1 -0
  102. package/lib/xt-map-provider/xt-map-provider.common.js +644 -0
  103. package/lib/xt-map-provider/xt-map-provider.css +1 -0
  104. package/lib/xt-map-provider/xt-map-provider.umd.js +654 -0
  105. package/lib/xt-map-provider/xt-map-provider.umd.min.js +1 -0
  106. package/lib/xt-page/demo.html +10 -0
  107. package/lib/xt-page/index.js +1 -0
  108. package/lib/xt-page/xt-page.common.js +353 -0
  109. package/lib/xt-page/xt-page.css +1 -0
  110. package/lib/xt-page/xt-page.umd.js +363 -0
  111. package/lib/xt-page/xt-page.umd.min.js +1 -0
  112. package/lib/xt-progress/demo.html +10 -0
  113. package/lib/xt-progress/index.js +1 -0
  114. package/lib/xt-progress/xt-progress.common.js +327 -0
  115. package/lib/xt-progress/xt-progress.css +1 -0
  116. package/lib/xt-progress/xt-progress.umd.js +337 -0
  117. package/lib/xt-progress/xt-progress.umd.min.js +1 -0
  118. package/lib/xt-scroll-arrow/demo.html +10 -0
  119. package/lib/xt-scroll-arrow/index.js +1 -0
  120. package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +495 -0
  121. package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -0
  122. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +505 -0
  123. package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -0
  124. package/lib/xt-select-tree/demo.html +10 -0
  125. package/lib/xt-select-tree/index.js +1 -0
  126. package/lib/xt-select-tree/xt-select-tree.common.js +1791 -0
  127. package/lib/xt-select-tree/xt-select-tree.css +1 -0
  128. package/lib/xt-select-tree/xt-select-tree.umd.js +1801 -0
  129. package/lib/xt-select-tree/xt-select-tree.umd.min.js +1 -0
  130. package/lib/xt-step-price/demo.html +10 -0
  131. package/lib/xt-step-price/index.js +1 -0
  132. package/lib/xt-step-price/xt-step-price.common.js +800 -0
  133. package/lib/xt-step-price/xt-step-price.css +1 -0
  134. package/lib/xt-step-price/xt-step-price.umd.js +810 -0
  135. package/lib/xt-step-price/xt-step-price.umd.min.js +1 -0
  136. package/lib/xt-step-price-item/demo.html +10 -0
  137. package/lib/xt-step-price-item/index.js +1 -0
  138. package/lib/xt-step-price-item/xt-step-price-item.common.js +417 -0
  139. package/lib/xt-step-price-item/xt-step-price-item.umd.js +427 -0
  140. package/lib/xt-step-price-item/xt-step-price-item.umd.min.js +1 -0
  141. package/lib/xt-tab-pane/demo.html +10 -0
  142. package/lib/xt-tab-pane/index.js +1 -0
  143. package/lib/xt-tab-pane/xt-tab-pane.common.js +309 -0
  144. package/lib/xt-tab-pane/xt-tab-pane.umd.js +319 -0
  145. package/lib/xt-tab-pane/xt-tab-pane.umd.min.js +1 -0
  146. package/lib/xt-table/demo.html +10 -0
  147. package/lib/xt-table/index.js +1 -0
  148. package/lib/xt-table/xt-table.common.js +1027 -0
  149. package/lib/xt-table/xt-table.css +1 -0
  150. package/lib/xt-table/xt-table.umd.js +1037 -0
  151. package/lib/xt-table/xt-table.umd.min.js +1 -0
  152. package/lib/xt-tabs/demo.html +10 -0
  153. package/lib/xt-tabs/index.js +1 -0
  154. package/lib/xt-tabs/xt-tabs.common.js +463 -0
  155. package/lib/xt-tabs/xt-tabs.css +1 -0
  156. package/lib/xt-tabs/xt-tabs.umd.js +473 -0
  157. package/lib/xt-tabs/xt-tabs.umd.min.js +1 -0
  158. package/lib/xt-text/demo.html +10 -0
  159. package/lib/xt-text/index.js +1 -0
  160. package/lib/xt-text/xt-text.common.js +536 -0
  161. package/lib/xt-text/xt-text.css +1 -0
  162. package/lib/xt-text/xt-text.umd.js +546 -0
  163. package/lib/xt-text/xt-text.umd.min.js +1 -0
  164. package/lib/xt-time/demo.html +10 -0
  165. package/lib/xt-time/index.js +1 -0
  166. package/lib/xt-time/xt-time.common.js +555 -0
  167. package/lib/xt-time/xt-time.css +1 -0
  168. package/lib/xt-time/xt-time.umd.js +565 -0
  169. package/lib/xt-time/xt-time.umd.min.js +1 -0
  170. package/lib/xt-transfer-tree/demo.html +10 -0
  171. package/lib/xt-transfer-tree/index.js +1 -0
  172. package/lib/xt-transfer-tree/xt-transfer-tree.common.js +594 -0
  173. package/lib/xt-transfer-tree/xt-transfer-tree.css +1 -0
  174. package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +604 -0
  175. package/lib/xt-transfer-tree/xt-transfer-tree.umd.min.js +1 -0
  176. package/lib/xt-upload/demo.html +10 -0
  177. package/lib/xt-upload/index.js +1 -0
  178. package/lib/xt-upload/xt-upload.common.js +1292 -0
  179. package/lib/xt-upload/xt-upload.css +1 -0
  180. package/lib/xt-upload/xt-upload.umd.js +1302 -0
  181. package/lib/xt-upload/xt-upload.umd.min.js +1 -0
  182. package/package.json +10 -7
  183. package/src/components/xt-badge/index.js +8 -7
  184. package/src/components/xt-button/index.js +1 -0
  185. package/src/components/xt-card/index.js +1 -0
  186. package/src/components/xt-card-item/index.js +1 -0
  187. package/src/components/xt-config-provider/index.js +1 -0
  188. package/src/components/xt-flex-box/index.js +1 -0
  189. package/src/components/xt-grid-box/index.js +1 -0
  190. package/src/components/xt-icon/index.js +1 -0
  191. package/src/components/xt-input/index.js +1 -0
  192. package/src/components/xt-map/index.js +1 -0
  193. package/src/components/xt-progress/index.js +8 -7
  194. package/src/components/xt-scroll-arrow/index.js +8 -7
  195. package/src/components/xt-step-price/index.js +1 -0
  196. package/src/components/xt-tab-pane/index.js +10 -0
  197. package/src/components/{xt-tabs/TabPane.vue → xt-tab-pane/index.vue} +14 -1
  198. package/src/components/xt-tabs/index.js +9 -10
  199. package/src/components/xt-tabs/index.vue +303 -44
  200. package/src/components/xt-text/index.js +1 -0
  201. package/src/components/xt-time/index.js +1 -0
  202. package/src/index.js +34 -2
@@ -0,0 +1,546 @@
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-text"] = factory();
8
+ else
9
+ root["xt-text"] = 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
+ /***/ "86ae":
100
+ /***/ (function(module, exports, __webpack_require__) {
101
+
102
+ // extracted by mini-css-extract-plugin
103
+
104
+ /***/ }),
105
+
106
+ /***/ "fb15":
107
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
108
+
109
+ "use strict";
110
+ // ESM COMPAT FLAG
111
+ __webpack_require__.r(__webpack_exports__);
112
+
113
+ // EXPORTS
114
+ __webpack_require__.d(__webpack_exports__, "XtText", function() { return /* reexport */ xt_text; });
115
+
116
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
117
+ // This file is imported into lib/wc client bundles.
118
+
119
+ if (typeof window !== 'undefined') {
120
+ var currentScript = window.document.currentScript
121
+ if (false) { var getCurrentScript; }
122
+
123
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
124
+ if (src) {
125
+ __webpack_require__.p = src[1] // eslint-disable-line
126
+ }
127
+ }
128
+
129
+ // Indicate to webpack that this file can be concatenated
130
+ /* harmony default export */ var setPublicPath = (null);
131
+
132
+ // EXTERNAL MODULE: ./src/components/xt-text/style/index.scss
133
+ var style = __webpack_require__("86ae");
134
+
135
+ // 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-text/index.vue?vue&type=template&id=eec3daca
136
+ var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.showTooltip && _vm.ellipsis)?_c('el-tooltip',{attrs:{"content":_vm.displayTooltipContent,"placement":_vm.tooltipPlacement,"disabled":!_vm.isOverflow,"effect":"dark"}},[_c('span',{ref:"textRef",staticClass:"xt-text",class:[
137
+ _vm.type ? 'xt-text--' + _vm.type : '',
138
+ 'xt-text--' + _vm.size,
139
+ { 'xt-text--bold': _vm.bold },
140
+ { 'xt-text--money': _vm.format === 'money' },
141
+ { 'xt-text--ellipsis': _vm.ellipsis },
142
+ { 'xt-text--ellipsis-multiline': _vm.ellipsis && _vm.ellipsisRows > 1 }
143
+ ],style:(_vm.customStyle),on:{"mouseenter":_vm.handleMouseEnter}},[(_vm.$slots.prefix)?[_vm._t("prefix")]:(_vm.prefix)?[_vm._v(_vm._s(_vm.prefix))]:_vm._e(),_vm._t("default",function(){return [(_vm.formattedValue !== undefined)?[_vm._v(_vm._s(_vm.formattedValue))]:_vm._e()]}),(_vm.$slots.suffix)?[_vm._t("suffix")]:(_vm.suffix)?[_vm._v(_vm._s(_vm.suffix))]:_vm._e()],2)]):_c('span',{ref:"textRef",staticClass:"xt-text",class:[
144
+ _vm.type ? 'xt-text--' + _vm.type : '',
145
+ 'xt-text--' + _vm.size,
146
+ { 'xt-text--bold': _vm.bold },
147
+ { 'xt-text--money': _vm.format === 'money' },
148
+ { 'xt-text--ellipsis': _vm.ellipsis },
149
+ { 'xt-text--ellipsis-multiline': _vm.ellipsis && _vm.ellipsisRows > 1 }
150
+ ],style:(_vm.customStyle)},[(_vm.$slots.prefix)?[_vm._t("prefix")]:(_vm.prefix)?[_vm._v(_vm._s(_vm.prefix))]:_vm._e(),_vm._t("default",function(){return [(_vm.formattedValue !== undefined)?[_vm._v(_vm._s(_vm.formattedValue))]:_vm._e()]}),(_vm.$slots.suffix)?[_vm._t("suffix")]:(_vm.suffix)?[_vm._v(_vm._s(_vm.suffix))]:_vm._e()],2)
151
+ }
152
+ var staticRenderFns = []
153
+
154
+
155
+ // CONCATENATED MODULE: ./src/components/xt-text/index.vue?vue&type=template&id=eec3daca
156
+
157
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-text/index.vue?vue&type=script&lang=js
158
+
159
+ /* harmony default export */ var xt_textvue_type_script_lang_js = ({
160
+ name: 'XtText',
161
+ model: {
162
+ prop: 'value',
163
+ event: 'input'
164
+ },
165
+ props: {
166
+ type: {
167
+ type: String,
168
+ default: '',
169
+ validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
170
+ },
171
+ size: {
172
+ type: String,
173
+ default: 'small',
174
+ validator: (val) => ['extra-large', 'large', 'medium', 'small', 'mini', 'extra-small'].includes(val)
175
+ },
176
+ bold: {
177
+ type: Boolean,
178
+ default: false
179
+ },
180
+ letterSpacing: {
181
+ type: [String, Number],
182
+ default: ''
183
+ },
184
+ ellipsis: {
185
+ type: Boolean,
186
+ default: false
187
+ },
188
+ ellipsisRows: {
189
+ type: Number,
190
+ default: 1,
191
+ validator: (val) => val >= 1 && val <= 10
192
+ },
193
+ showTooltip: {
194
+ type: Boolean,
195
+ default: true
196
+ },
197
+ tooltipPlacement: {
198
+ type: String,
199
+ default: 'top',
200
+ validator: (val) => ['top', 'bottom', 'left', 'right', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-start', 'left-end', 'right-start', 'right-end'].includes(val)
201
+ },
202
+ tooltipContent: {
203
+ type: String,
204
+ default: ''
205
+ },
206
+
207
+ // 格式化模式:normal 普通 | thousand 千分位 | money 金额
208
+ format: {
209
+ type: String,
210
+ default: 'normal',
211
+ validator: (val) => ['normal', 'thousand', 'money'].includes(val)
212
+ },
213
+
214
+ // 兼容旧属性 money(老项目继续使用)
215
+ money: {
216
+ type: Boolean,
217
+ default: false
218
+ },
219
+ value: {
220
+ type: [Number, String],
221
+ default: ''
222
+ },
223
+ currency: {
224
+ type: String,
225
+ default: 'CNY',
226
+ validator: (val) => ['CNY', 'USD', 'EUR', 'JPY', 'GBP', 'AUD', 'CAD'].includes(val)
227
+ },
228
+ decimals: {
229
+ type: Number,
230
+ default: 2,
231
+ validator: (val) => val >= 0 && val <= 10
232
+ },
233
+ locale: {
234
+ type: String,
235
+ default: 'zh-CN'
236
+ },
237
+ showSign: {
238
+ type: Boolean,
239
+ default: false
240
+ },
241
+ prefix: {
242
+ type: String,
243
+ default: ''
244
+ },
245
+ suffix: {
246
+ type: String,
247
+ default: ''
248
+ }
249
+ },
250
+ data() {
251
+ return {
252
+ isOverflow: false
253
+ }
254
+ },
255
+ computed: {
256
+ // 兼容旧 money 属性:如果传了 money=true,自动切为金额模式
257
+ realFormat() {
258
+ return this.money ? 'money' : this.format
259
+ },
260
+
261
+ customStyle() {
262
+ const style = {}
263
+ if (this.letterSpacing) {
264
+ style.letterSpacing = typeof this.letterSpacing === 'number' ? `${this.letterSpacing}px` : this.letterSpacing
265
+ }
266
+ if (this.ellipsis && this.ellipsisRows > 1) {
267
+ style.WebkitLineClamp = this.ellipsisRows
268
+ }
269
+ return style
270
+ },
271
+
272
+ displayTooltipContent() {
273
+ if (this.tooltipContent) {
274
+ return this.tooltipContent
275
+ }
276
+ if (this.formattedValue !== undefined) {
277
+ return this.formattedValue
278
+ }
279
+ if (this.$slots.default && this.$slots.default.length > 0) {
280
+ return this.extractSlotText(this.$slots.default)
281
+ }
282
+ return this.value
283
+ },
284
+
285
+ formattedValue() {
286
+ const fmt = this.realFormat
287
+ const { value } = this
288
+
289
+ if (value === '' || value === undefined || value === null) {
290
+ return undefined
291
+ }
292
+
293
+ const numValue = typeof value === 'string' ? parseFloat(value) : value
294
+ if (isNaN(numValue)) {
295
+ return value
296
+ }
297
+
298
+ try {
299
+ let result = ''
300
+ const signOpt = this.showSign ? 'always' : 'auto'
301
+
302
+ switch (fmt) {
303
+ // 千分位格式化(纯数字)
304
+ case 'thousand':
305
+ result = new Intl.NumberFormat(this.locale, {
306
+ minimumFractionDigits: this.decimals,
307
+ maximumFractionDigits: this.decimals,
308
+ signDisplay: signOpt
309
+ }).format(numValue)
310
+ break
311
+
312
+ // 金额格式化(原有逻辑)
313
+ case 'money':
314
+ result = new Intl.NumberFormat(this.locale, {
315
+ style: 'currency',
316
+ currency: this.currency,
317
+ minimumFractionDigits: this.decimals,
318
+ maximumFractionDigits: this.decimals,
319
+ signDisplay: signOpt
320
+ }).format(numValue)
321
+ break
322
+
323
+ // 普通文本,直接返回原值
324
+ default:
325
+ return undefined
326
+ }
327
+
328
+ return result
329
+ } catch (e) {
330
+ return value
331
+ }
332
+ }
333
+ },
334
+ methods: {
335
+ handleMouseEnter() {
336
+ this.checkOverflow()
337
+ },
338
+ checkOverflow() {
339
+ const el = this.$refs.textRef
340
+ if (!el) {
341
+ this.isOverflow = false
342
+ return
343
+ }
344
+
345
+ if (this.ellipsisRows > 1) {
346
+ this.isOverflow = el.scrollHeight > el.clientHeight
347
+ } else {
348
+ this.isOverflow = el.scrollWidth > el.clientWidth
349
+ }
350
+ },
351
+ extractSlotText(nodes) {
352
+ let text = ''
353
+ nodes.forEach(node => {
354
+ if (typeof node.children === 'string') {
355
+ text += node.children
356
+ } else if (typeof node.text === 'string') {
357
+ text += node.text
358
+ } else if (node.children && Array.isArray(node.children)) {
359
+ text += this.extractSlotText(node.children)
360
+ }
361
+ })
362
+ return text.trim()
363
+ }
364
+ },
365
+ mounted() {
366
+ if (this.ellipsis && this.showTooltip) {
367
+ this.$nextTick(() => {
368
+ this.checkOverflow()
369
+ })
370
+ }
371
+ this._resizeObserver = new ResizeObserver(() => {
372
+ if (this.ellipsis && this.showTooltip) {
373
+ this.checkOverflow()
374
+ }
375
+ })
376
+ this.$nextTick(() => {
377
+ if (this.$refs.textRef) {
378
+ this._resizeObserver.observe(this.$refs.textRef)
379
+ }
380
+ })
381
+ },
382
+ beforeDestroy() {
383
+ if (this._resizeObserver) {
384
+ this._resizeObserver.disconnect()
385
+ }
386
+ },
387
+ watch: {
388
+ value() {
389
+ if (this.ellipsis && this.showTooltip) {
390
+ this.$nextTick(() => {
391
+ this.checkOverflow()
392
+ })
393
+ }
394
+ },
395
+ ellipsis(newVal) {
396
+ if (newVal && this.showTooltip) {
397
+ this.$nextTick(() => {
398
+ this.checkOverflow()
399
+ })
400
+ }
401
+ }
402
+ }
403
+ });
404
+
405
+ // CONCATENATED MODULE: ./src/components/xt-text/index.vue?vue&type=script&lang=js
406
+ /* harmony default export */ var components_xt_textvue_type_script_lang_js = (xt_textvue_type_script_lang_js);
407
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
408
+ /* globals __VUE_SSR_CONTEXT__ */
409
+
410
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
411
+ // This module is a runtime utility for cleaner component module output and will
412
+ // be included in the final webpack user bundle.
413
+
414
+ function normalizeComponent(
415
+ scriptExports,
416
+ render,
417
+ staticRenderFns,
418
+ functionalTemplate,
419
+ injectStyles,
420
+ scopeId,
421
+ moduleIdentifier /* server only */,
422
+ shadowMode /* vue-cli only */
423
+ ) {
424
+ // Vue.extend constructor export interop
425
+ var options =
426
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
427
+
428
+ // render functions
429
+ if (render) {
430
+ options.render = render
431
+ options.staticRenderFns = staticRenderFns
432
+ options._compiled = true
433
+ }
434
+
435
+ // functional template
436
+ if (functionalTemplate) {
437
+ options.functional = true
438
+ }
439
+
440
+ // scopedId
441
+ if (scopeId) {
442
+ options._scopeId = 'data-v-' + scopeId
443
+ }
444
+
445
+ var hook
446
+ if (moduleIdentifier) {
447
+ // server build
448
+ hook = function (context) {
449
+ // 2.3 injection
450
+ context =
451
+ context || // cached call
452
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
453
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
454
+ // 2.2 with runInNewContext: true
455
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
456
+ context = __VUE_SSR_CONTEXT__
457
+ }
458
+ // inject component styles
459
+ if (injectStyles) {
460
+ injectStyles.call(this, context)
461
+ }
462
+ // register component module identifier for async chunk inferrence
463
+ if (context && context._registeredComponents) {
464
+ context._registeredComponents.add(moduleIdentifier)
465
+ }
466
+ }
467
+ // used by ssr in case component is cached and beforeCreate
468
+ // never gets called
469
+ options._ssrRegister = hook
470
+ } else if (injectStyles) {
471
+ hook = shadowMode
472
+ ? function () {
473
+ injectStyles.call(
474
+ this,
475
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
476
+ )
477
+ }
478
+ : injectStyles
479
+ }
480
+
481
+ if (hook) {
482
+ if (options.functional) {
483
+ // for template-only hot-reload because in that case the render fn doesn't
484
+ // go through the normalizer
485
+ options._injectStyles = hook
486
+ // register for functional component in vue file
487
+ var originalRender = options.render
488
+ options.render = function renderWithStyleInjection(h, context) {
489
+ hook.call(context)
490
+ return originalRender(h, context)
491
+ }
492
+ } else {
493
+ // inject component registration as beforeCreate hook
494
+ var existing = options.beforeCreate
495
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
496
+ }
497
+ }
498
+
499
+ return {
500
+ exports: scriptExports,
501
+ options: options
502
+ }
503
+ }
504
+
505
+ // CONCATENATED MODULE: ./src/components/xt-text/index.vue
506
+
507
+
508
+
509
+
510
+
511
+ /* normalize component */
512
+
513
+ var component = normalizeComponent(
514
+ components_xt_textvue_type_script_lang_js,
515
+ render,
516
+ staticRenderFns,
517
+ false,
518
+ null,
519
+ null,
520
+ null
521
+
522
+ )
523
+
524
+ /* harmony default export */ var xt_text = (component.exports);
525
+ // CONCATENATED MODULE: ./src/components/xt-text/index.js
526
+
527
+
528
+
529
+ xt_text.install = function (Vue) {
530
+ Vue.component(xt_text.name, xt_text)
531
+ }
532
+
533
+ /* harmony default export */ var components_xt_text = (xt_text);
534
+
535
+
536
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
537
+
538
+
539
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_text);
540
+
541
+
542
+
543
+ /***/ })
544
+
545
+ /******/ });
546
+ });
@@ -0,0 +1 @@
1
+ (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["xt-text"]=e():t["xt-text"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(s,r,function(e){return t[e]}.bind(null,r));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s="fb15")}({"86ae":function(t,e,i){},fb15:function(t,e,i){"use strict";if(i.r(e),i.d(e,"XtText",(function(){return c})),"undefined"!==typeof window){var s=window.document.currentScript,r=s&&s.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(i.p=r[1])}i("86ae");var o=function(){var t=this,e=t._self._c;return t.showTooltip&&t.ellipsis?e("el-tooltip",{attrs:{content:t.displayTooltipContent,placement:t.tooltipPlacement,disabled:!t.isOverflow,effect:"dark"}},[e("span",{ref:"textRef",staticClass:"xt-text",class:[t.type?"xt-text--"+t.type:"","xt-text--"+t.size,{"xt-text--bold":t.bold},{"xt-text--money":"money"===t.format},{"xt-text--ellipsis":t.ellipsis},{"xt-text--ellipsis-multiline":t.ellipsis&&t.ellipsisRows>1}],style:t.customStyle,on:{mouseenter:t.handleMouseEnter}},[t.$slots.prefix?[t._t("prefix")]:t.prefix?[t._v(t._s(t.prefix))]:t._e(),t._t("default",(function(){return[void 0!==t.formattedValue?[t._v(t._s(t.formattedValue))]:t._e()]})),t.$slots.suffix?[t._t("suffix")]:t.suffix?[t._v(t._s(t.suffix))]:t._e()],2)]):e("span",{ref:"textRef",staticClass:"xt-text",class:[t.type?"xt-text--"+t.type:"","xt-text--"+t.size,{"xt-text--bold":t.bold},{"xt-text--money":"money"===t.format},{"xt-text--ellipsis":t.ellipsis},{"xt-text--ellipsis-multiline":t.ellipsis&&t.ellipsisRows>1}],style:t.customStyle},[t.$slots.prefix?[t._t("prefix")]:t.prefix?[t._v(t._s(t.prefix))]:t._e(),t._t("default",(function(){return[void 0!==t.formattedValue?[t._v(t._s(t.formattedValue))]:t._e()]})),t.$slots.suffix?[t._t("suffix")]:t.suffix?[t._v(t._s(t.suffix))]:t._e()],2)},n=[],l={name:"XtText",model:{prop:"value",event:"input"},props:{type:{type:String,default:"",validator:t=>["","primary","success","warning","danger"].includes(t)},size:{type:String,default:"small",validator:t=>["extra-large","large","medium","small","mini","extra-small"].includes(t)},bold:{type:Boolean,default:!1},letterSpacing:{type:[String,Number],default:""},ellipsis:{type:Boolean,default:!1},ellipsisRows:{type:Number,default:1,validator:t=>t>=1&&t<=10},showTooltip:{type:Boolean,default:!0},tooltipPlacement:{type:String,default:"top",validator:t=>["top","bottom","left","right","top-start","top-end","bottom-start","bottom-end","left-start","left-end","right-start","right-end"].includes(t)},tooltipContent:{type:String,default:""},format:{type:String,default:"normal",validator:t=>["normal","thousand","money"].includes(t)},money:{type:Boolean,default:!1},value:{type:[Number,String],default:""},currency:{type:String,default:"CNY",validator:t=>["CNY","USD","EUR","JPY","GBP","AUD","CAD"].includes(t)},decimals:{type:Number,default:2,validator:t=>t>=0&&t<=10},locale:{type:String,default:"zh-CN"},showSign:{type:Boolean,default:!1},prefix:{type:String,default:""},suffix:{type:String,default:""}},data(){return{isOverflow:!1}},computed:{realFormat(){return this.money?"money":this.format},customStyle(){const t={};return this.letterSpacing&&(t.letterSpacing="number"===typeof this.letterSpacing?this.letterSpacing+"px":this.letterSpacing),this.ellipsis&&this.ellipsisRows>1&&(t.WebkitLineClamp=this.ellipsisRows),t},displayTooltipContent(){return this.tooltipContent?this.tooltipContent:void 0!==this.formattedValue?this.formattedValue:this.$slots.default&&this.$slots.default.length>0?this.extractSlotText(this.$slots.default):this.value},formattedValue(){const t=this.realFormat,{value:e}=this;if(""===e||void 0===e||null===e)return;const i="string"===typeof e?parseFloat(e):e;if(isNaN(i))return e;try{let e="";const s=this.showSign?"always":"auto";switch(t){case"thousand":e=new Intl.NumberFormat(this.locale,{minimumFractionDigits:this.decimals,maximumFractionDigits:this.decimals,signDisplay:s}).format(i);break;case"money":e=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,minimumFractionDigits:this.decimals,maximumFractionDigits:this.decimals,signDisplay:s}).format(i);break;default:return}return e}catch(s){return e}}},methods:{handleMouseEnter(){this.checkOverflow()},checkOverflow(){const t=this.$refs.textRef;t?this.ellipsisRows>1?this.isOverflow=t.scrollHeight>t.clientHeight:this.isOverflow=t.scrollWidth>t.clientWidth:this.isOverflow=!1},extractSlotText(t){let e="";return t.forEach(t=>{"string"===typeof t.children?e+=t.children:"string"===typeof t.text?e+=t.text:t.children&&Array.isArray(t.children)&&(e+=this.extractSlotText(t.children))}),e.trim()}},mounted(){this.ellipsis&&this.showTooltip&&this.$nextTick(()=>{this.checkOverflow()}),this._resizeObserver=new ResizeObserver(()=>{this.ellipsis&&this.showTooltip&&this.checkOverflow()}),this.$nextTick(()=>{this.$refs.textRef&&this._resizeObserver.observe(this.$refs.textRef)})},beforeDestroy(){this._resizeObserver&&this._resizeObserver.disconnect()},watch:{value(){this.ellipsis&&this.showTooltip&&this.$nextTick(()=>{this.checkOverflow()})},ellipsis(t){t&&this.showTooltip&&this.$nextTick(()=>{this.checkOverflow()})}}},a=l;function f(t,e,i,s,r,o,n,l){var a,f="function"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=i,f._compiled=!0),s&&(f.functional=!0),o&&(f._scopeId="data-v-"+o),n?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},f._ssrRegister=a):r&&(a=l?function(){r.call(this,(f.functional?this.parent:this).$root.$options.shadowRoot)}:r),a)if(f.functional){f._injectStyles=a;var u=f.render;f.render=function(t,e){return a.call(e),u(t,e)}}else{var c=f.beforeCreate;f.beforeCreate=c?[].concat(c,a):[a]}return{exports:t,options:f}}var u=f(a,o,n,!1,null,null,null),c=u.exports;c.install=function(t){t.component(c.name,c)};var p=c;e["default"]=p}})}));
@@ -0,0 +1,10 @@
1
+ <meta charset="utf-8">
2
+ <title>xt-time demo</title>
3
+ <script src="./xt-time.umd.js"></script>
4
+
5
+ <link rel="stylesheet" href="./xt-time.css">
6
+
7
+
8
+ <script>
9
+ console.log(xt-time)
10
+ </script>
@@ -0,0 +1 @@
1
+ module.exports = require('./xt-time.common.js');