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,565 @@
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-time"] = factory();
8
+ else
9
+ root["xt-time"] = 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
+ /***/ "6c9e":
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__, "XtTime", function() { return /* reexport */ xt_time; });
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-time/style/index.scss
133
+ var style = __webpack_require__("6c9e");
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-time/index.vue?vue&type=template&id=d29acf2c
136
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('span',{staticClass:"xt-time",class:[
137
+ _vm.typeColor ? 'xt-time--' + _vm.typeColor : '',
138
+ 'xt-time--' + _vm.size,
139
+ { 'xt-time--bold': _vm.bold }
140
+ ],style:(_vm.customStyle),on:{"click":_vm.handleClick}},[_vm._t("prefix",function(){return [_vm._v(_vm._s(_vm.prefix))]}),_vm._t("default",function(){return [(_vm.mode === 'text')?[(_vm.displayText !== undefined)?[_vm._v(_vm._s(_vm.displayText))]:(!_vm.hideEmpty)?[_vm._v(_vm._s(_vm.emptyText))]:_vm._e()]:(_vm.mode === 'now')?[_vm._v(" "+_vm._s(_vm.nowText)+" ")]:(_vm.mode === 'countdown')?[(_vm.isCountdownFinished)?[_vm._t("finished",function(){return [_vm._v(_vm._s(_vm.finishedText))]})]:[_vm._v(" "+_vm._s(_vm.countdownText)+" ")]]:_vm._e()]}),_vm._t("suffix",function(){return [_vm._v(_vm._s(_vm.suffix))]})],2)
141
+ }
142
+ var staticRenderFns = []
143
+
144
+
145
+ // CONCATENATED MODULE: ./src/components/xt-time/index.vue?vue&type=template&id=d29acf2c
146
+
147
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-time/index.vue?vue&type=script&lang=js
148
+
149
+ const DEFAULT_FORMAT = 'YYYY-MM-DD HH:mm:ss'
150
+
151
+ function pad(n) {
152
+ const s = String(n)
153
+ return s.length < 2 ? '0' + s : s
154
+ }
155
+
156
+ /**
157
+ * 根据字符串/数字/Date 解析为 Date 对象
158
+ * 兼容:时间戳(ms/s)、Date、"2024-01-01"、"2024/01/01 12:00:00"、ISO 字符串
159
+ */
160
+ function parseDate(value) {
161
+ if (value === null || value === undefined || value === '') return null
162
+ if (value instanceof Date) return isNaN(value.getTime()) ? null : value
163
+
164
+ // 数字时间戳
165
+ if (typeof value === 'number') {
166
+ // 10 位秒级时间戳补 000
167
+ const t = value < 1e12 ? value * 1000 : value
168
+ const d = new Date(t)
169
+ return isNaN(d.getTime()) ? null : d
170
+ }
171
+
172
+ if (typeof value === 'string') {
173
+ // 纯数字字符串
174
+ if (/^\d+$/.test(value)) {
175
+ const n = Number(value)
176
+ const t = n < 1e12 ? n * 1000 : n
177
+ const d = new Date(t)
178
+ return isNaN(d.getTime()) ? null : d
179
+ }
180
+ // 将 "-" 统一为 "/",避免 Safari 下 "YYYY-MM-DD" 解析失败
181
+ const normalized = value.replace(/-/g, '/')
182
+ const d = new Date(normalized)
183
+ return isNaN(d.getTime()) ? null : d
184
+ }
185
+
186
+ return null
187
+ }
188
+
189
+ /**
190
+ * 简易 formatDateTime 实现(不依赖外部库)
191
+ * 支持占位符:YYYY MM DD HH mm ss SSS
192
+ */
193
+ function formatDateTime(date, fmt) {
194
+ if (!date) return ''
195
+ const f = fmt || DEFAULT_FORMAT
196
+ const map = {
197
+ YYYY: date.getFullYear(),
198
+ MM: pad(date.getMonth() + 1),
199
+ DD: pad(date.getDate()),
200
+ HH: pad(date.getHours()),
201
+ mm: pad(date.getMinutes()),
202
+ ss: pad(date.getSeconds()),
203
+ SSS: String(date.getMilliseconds()).padStart(3, '0')
204
+ }
205
+ return f.replace(/YYYY|MM|DD|HH|mm|ss|SSS/g, (k) => map[k])
206
+ }
207
+
208
+ /* harmony default export */ var xt_timevue_type_script_lang_js = ({
209
+ name: 'XtTime',
210
+
211
+ props: {
212
+ // 显示模式:now(当前时间实时刷新)/ countdown(倒计时)/ text(格式化日期文本)
213
+ type: {
214
+ type: String,
215
+ default: 'now',
216
+ validator: (val) => ['now', 'countdown', 'text'].includes(val)
217
+ },
218
+
219
+ // ===== 通用 =====
220
+ size: {
221
+ type: String,
222
+ default: 'base',
223
+ validator: (val) =>
224
+ ['extra-large', 'large', 'medium', 'base', 'small', 'extra-small'].includes(val)
225
+ },
226
+ typeColor: {
227
+ type: String,
228
+ default: '',
229
+ validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
230
+ },
231
+ bold: {
232
+ type: Boolean,
233
+ default: false
234
+ },
235
+ format: {
236
+ type: String,
237
+ default: DEFAULT_FORMAT
238
+ },
239
+ prefix: {
240
+ type: String,
241
+ default: ''
242
+ },
243
+ suffix: {
244
+ type: String,
245
+ default: ''
246
+ },
247
+ emptyText: {
248
+ type: String,
249
+ default: '-'
250
+ },
251
+ hideEmpty: {
252
+ type: Boolean,
253
+ default: false
254
+ },
255
+ interval: {
256
+ type: Number,
257
+ default: 1000,
258
+ validator: (val) => val >= 100
259
+ },
260
+
261
+ // ===== text 模式 =====
262
+ // 兼容 v-model 用法,也可直接传 value / :value
263
+ value: {
264
+ type: [String, Number, Date],
265
+ default: ''
266
+ },
267
+
268
+ // ===== countdown 模式 =====
269
+ targetTime: {
270
+ type: [String, Number, Date],
271
+ default: ''
272
+ },
273
+ // 倒计时显示格式:
274
+ // DHMS -> 3天 12时 08分 30秒
275
+ // HMS -> 12时 08分 30秒(天数自动折算到小时)
276
+ // MS -> 08分 30秒(全部折算到分钟)
277
+ // SEC -> 3200秒
278
+ countdownFormat: {
279
+ type: String,
280
+ default: 'DHMS',
281
+ validator: (val) => ['DHMS', 'HMS', 'MS', 'SEC'].includes(val)
282
+ },
283
+ finishedText: {
284
+ type: String,
285
+ default: '已结束'
286
+ }
287
+ },
288
+
289
+ data() {
290
+ return {
291
+ tick: 0
292
+ }
293
+ },
294
+
295
+ computed: {
296
+ mode() {
297
+ return this.type
298
+ },
299
+
300
+ parsedValue() {
301
+ return parseDate(this.value)
302
+ },
303
+
304
+ parsedTarget() {
305
+ return parseDate(this.targetTime)
306
+ },
307
+
308
+ displayText() {
309
+ if (!this.parsedValue) return undefined
310
+ return formatDateTime(this.parsedValue, this.format)
311
+ },
312
+
313
+ nowText() {
314
+ // 通过 tick 触发刷新
315
+ // eslint-disable-next-line no-unused-vars
316
+ const _ = this.tick
317
+ return formatDateTime(new Date(), this.format)
318
+ },
319
+
320
+ // 剩余毫秒数(countdown 模式)
321
+ remainingMs() {
322
+ if (this.mode !== 'countdown') return 0
323
+ // eslint-disable-next-line no-unused-vars
324
+ const _ = this.tick
325
+ if (!this.parsedTarget) return 0
326
+ const diff = this.parsedTarget.getTime() - Date.now()
327
+ return diff > 0 ? diff : 0
328
+ },
329
+
330
+ isCountdownFinished() {
331
+ return this.mode === 'countdown' && this.parsedTarget && this.remainingMs <= 0
332
+ },
333
+
334
+ countdownText() {
335
+ if (!this.parsedTarget) return this.emptyText
336
+ const total = Math.floor(this.remainingMs / 1000)
337
+ if (total <= 0) return this.finishedText
338
+
339
+ switch (this.countdownFormat) {
340
+ case 'SEC':
341
+ return `${total}秒`
342
+ case 'MS': {
343
+ const m = Math.floor(total / 60)
344
+ const s = total % 60
345
+ return `${pad(m)}分${pad(s)}秒`
346
+ }
347
+ case 'HMS': {
348
+ const h = Math.floor(total / 3600)
349
+ const m = Math.floor((total % 3600) / 60)
350
+ const s = total % 60
351
+ return `${pad(h)}时${pad(m)}分${pad(s)}秒`
352
+ }
353
+ case 'DHMS':
354
+ default: {
355
+ const d = Math.floor(total / 86400)
356
+ const h = Math.floor((total % 86400) / 3600)
357
+ const m = Math.floor((total % 3600) / 60)
358
+ const s = total % 60
359
+ return `${d}天${pad(h)}时${pad(m)}分${pad(s)}秒`
360
+ }
361
+ }
362
+ },
363
+
364
+ customStyle() {
365
+ return {}
366
+ }
367
+ },
368
+
369
+ watch: {
370
+ type() {
371
+ this.restartTimer()
372
+ },
373
+ interval() {
374
+ this.restartTimer()
375
+ }
376
+ },
377
+
378
+ mounted() {
379
+ this.restartTimer()
380
+ },
381
+
382
+ beforeDestroy() {
383
+ this.clearTimer()
384
+ },
385
+
386
+ activated() {
387
+ this.restartTimer()
388
+ },
389
+
390
+ deactivated() {
391
+ this.clearTimer()
392
+ },
393
+
394
+ methods: {
395
+ restartTimer() {
396
+ this.clearTimer()
397
+ if (this.mode === 'now' || this.mode === 'countdown') {
398
+ // 立即刷新一次,避免首次渲染时 tick=0 导致的差异
399
+ this.tick++
400
+ this._timer = setInterval(() => {
401
+ this.tick++
402
+ // 倒计时结束触发 finish 事件
403
+ if (this.mode === 'countdown' && this.parsedTarget && this.remainingMs <= 0) {
404
+ this.clearTimer()
405
+ this.$emit('finish')
406
+ }
407
+ }, this.interval)
408
+ }
409
+ },
410
+
411
+ clearTimer() {
412
+ if (this._timer) {
413
+ clearInterval(this._timer)
414
+ this._timer = null
415
+ }
416
+ },
417
+
418
+ handleClick(e) {
419
+ this.$emit('click', e)
420
+ }
421
+ }
422
+ });
423
+
424
+ // CONCATENATED MODULE: ./src/components/xt-time/index.vue?vue&type=script&lang=js
425
+ /* harmony default export */ var components_xt_timevue_type_script_lang_js = (xt_timevue_type_script_lang_js);
426
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
427
+ /* globals __VUE_SSR_CONTEXT__ */
428
+
429
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
430
+ // This module is a runtime utility for cleaner component module output and will
431
+ // be included in the final webpack user bundle.
432
+
433
+ function normalizeComponent(
434
+ scriptExports,
435
+ render,
436
+ staticRenderFns,
437
+ functionalTemplate,
438
+ injectStyles,
439
+ scopeId,
440
+ moduleIdentifier /* server only */,
441
+ shadowMode /* vue-cli only */
442
+ ) {
443
+ // Vue.extend constructor export interop
444
+ var options =
445
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
446
+
447
+ // render functions
448
+ if (render) {
449
+ options.render = render
450
+ options.staticRenderFns = staticRenderFns
451
+ options._compiled = true
452
+ }
453
+
454
+ // functional template
455
+ if (functionalTemplate) {
456
+ options.functional = true
457
+ }
458
+
459
+ // scopedId
460
+ if (scopeId) {
461
+ options._scopeId = 'data-v-' + scopeId
462
+ }
463
+
464
+ var hook
465
+ if (moduleIdentifier) {
466
+ // server build
467
+ hook = function (context) {
468
+ // 2.3 injection
469
+ context =
470
+ context || // cached call
471
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
472
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
473
+ // 2.2 with runInNewContext: true
474
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
475
+ context = __VUE_SSR_CONTEXT__
476
+ }
477
+ // inject component styles
478
+ if (injectStyles) {
479
+ injectStyles.call(this, context)
480
+ }
481
+ // register component module identifier for async chunk inferrence
482
+ if (context && context._registeredComponents) {
483
+ context._registeredComponents.add(moduleIdentifier)
484
+ }
485
+ }
486
+ // used by ssr in case component is cached and beforeCreate
487
+ // never gets called
488
+ options._ssrRegister = hook
489
+ } else if (injectStyles) {
490
+ hook = shadowMode
491
+ ? function () {
492
+ injectStyles.call(
493
+ this,
494
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
495
+ )
496
+ }
497
+ : injectStyles
498
+ }
499
+
500
+ if (hook) {
501
+ if (options.functional) {
502
+ // for template-only hot-reload because in that case the render fn doesn't
503
+ // go through the normalizer
504
+ options._injectStyles = hook
505
+ // register for functional component in vue file
506
+ var originalRender = options.render
507
+ options.render = function renderWithStyleInjection(h, context) {
508
+ hook.call(context)
509
+ return originalRender(h, context)
510
+ }
511
+ } else {
512
+ // inject component registration as beforeCreate hook
513
+ var existing = options.beforeCreate
514
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
515
+ }
516
+ }
517
+
518
+ return {
519
+ exports: scriptExports,
520
+ options: options
521
+ }
522
+ }
523
+
524
+ // CONCATENATED MODULE: ./src/components/xt-time/index.vue
525
+
526
+
527
+
528
+
529
+
530
+ /* normalize component */
531
+
532
+ var component = normalizeComponent(
533
+ components_xt_timevue_type_script_lang_js,
534
+ render,
535
+ staticRenderFns,
536
+ false,
537
+ null,
538
+ null,
539
+ null
540
+
541
+ )
542
+
543
+ /* harmony default export */ var xt_time = (component.exports);
544
+ // CONCATENATED MODULE: ./src/components/xt-time/index.js
545
+
546
+
547
+
548
+ xt_time.install = function (Vue) {
549
+ Vue.component(xt_time.name, xt_time)
550
+ }
551
+
552
+ /* harmony default export */ var components_xt_time = (xt_time);
553
+
554
+
555
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
556
+
557
+
558
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_time);
559
+
560
+
561
+
562
+ /***/ })
563
+
564
+ /******/ });
565
+ });
@@ -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-time"]=e():t["xt-time"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"6c9e":function(t,e,n){},fb15:function(t,e,n){"use strict";if(n.r(e),n.d(e,"XtTime",(function(){return h})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("6c9e");var o=function(){var t=this,e=t._self._c;return e("span",{staticClass:"xt-time",class:[t.typeColor?"xt-time--"+t.typeColor:"","xt-time--"+t.size,{"xt-time--bold":t.bold}],style:t.customStyle,on:{click:t.handleClick}},[t._t("prefix",(function(){return[t._v(t._s(t.prefix))]})),t._t("default",(function(){return["text"===t.mode?[void 0!==t.displayText?[t._v(t._s(t.displayText))]:t.hideEmpty?t._e():[t._v(t._s(t.emptyText))]]:"now"===t.mode?[t._v(" "+t._s(t.nowText)+" ")]:"countdown"===t.mode?[t.isCountdownFinished?[t._t("finished",(function(){return[t._v(t._s(t.finishedText))]}))]:[t._v(" "+t._s(t.countdownText)+" ")]]:t._e()]})),t._t("suffix",(function(){return[t._v(t._s(t.suffix))]}))],2)},s=[];const a="YYYY-MM-DD HH:mm:ss";function u(t){const e=String(t);return e.length<2?"0"+e:e}function l(t){if(null===t||void 0===t||""===t)return null;if(t instanceof Date)return isNaN(t.getTime())?null:t;if("number"===typeof t){const e=t<1e12?1e3*t:t,n=new Date(e);return isNaN(n.getTime())?null:n}if("string"===typeof t){if(/^\d+$/.test(t)){const e=Number(t),n=e<1e12?1e3*e:e,r=new Date(n);return isNaN(r.getTime())?null:r}const e=t.replace(/-/g,"/"),n=new Date(e);return isNaN(n.getTime())?null:n}return null}function d(t,e){if(!t)return"";const n=e||a,r={YYYY:t.getFullYear(),MM:u(t.getMonth()+1),DD:u(t.getDate()),HH:u(t.getHours()),mm:u(t.getMinutes()),ss:u(t.getSeconds()),SSS:String(t.getMilliseconds()).padStart(3,"0")};return n.replace(/YYYY|MM|DD|HH|mm|ss|SSS/g,t=>r[t])}var c={name:"XtTime",props:{type:{type:String,default:"now",validator:t=>["now","countdown","text"].includes(t)},size:{type:String,default:"base",validator:t=>["extra-large","large","medium","base","small","extra-small"].includes(t)},typeColor:{type:String,default:"",validator:t=>["","primary","success","warning","danger"].includes(t)},bold:{type:Boolean,default:!1},format:{type:String,default:a},prefix:{type:String,default:""},suffix:{type:String,default:""},emptyText:{type:String,default:"-"},hideEmpty:{type:Boolean,default:!1},interval:{type:Number,default:1e3,validator:t=>t>=100},value:{type:[String,Number,Date],default:""},targetTime:{type:[String,Number,Date],default:""},countdownFormat:{type:String,default:"DHMS",validator:t=>["DHMS","HMS","MS","SEC"].includes(t)},finishedText:{type:String,default:"已结束"}},data(){return{tick:0}},computed:{mode(){return this.type},parsedValue(){return l(this.value)},parsedTarget(){return l(this.targetTime)},displayText(){if(this.parsedValue)return d(this.parsedValue,this.format)},nowText(){this.tick;return d(new Date,this.format)},remainingMs(){if("countdown"!==this.mode)return 0;this.tick;if(!this.parsedTarget)return 0;const t=this.parsedTarget.getTime()-Date.now();return t>0?t:0},isCountdownFinished(){return"countdown"===this.mode&&this.parsedTarget&&this.remainingMs<=0},countdownText(){if(!this.parsedTarget)return this.emptyText;const t=Math.floor(this.remainingMs/1e3);if(t<=0)return this.finishedText;switch(this.countdownFormat){case"SEC":return t+"秒";case"MS":{const e=Math.floor(t/60),n=t%60;return`${u(e)}分${u(n)}秒`}case"HMS":{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return`${u(e)}时${u(n)}分${u(r)}秒`}case"DHMS":default:{const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),i=t%60;return`${e}天${u(n)}时${u(r)}分${u(i)}秒`}}},customStyle(){return{}}},watch:{type(){this.restartTimer()},interval(){this.restartTimer()}},mounted(){this.restartTimer()},beforeDestroy(){this.clearTimer()},activated(){this.restartTimer()},deactivated(){this.clearTimer()},methods:{restartTimer(){this.clearTimer(),"now"!==this.mode&&"countdown"!==this.mode||(this.tick++,this._timer=setInterval(()=>{this.tick++,"countdown"===this.mode&&this.parsedTarget&&this.remainingMs<=0&&(this.clearTimer(),this.$emit("finish"))},this.interval))},clearTimer(){this._timer&&(clearInterval(this._timer),this._timer=null)},handleClick(t){this.$emit("click",t)}}},f=c;function p(t,e,n,r,i,o,s,a){var u,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(u=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=u):i&&(u=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(l.functional){l._injectStyles=u;var d=l.render;l.render=function(t,e){return u.call(e),d(t,e)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,u):[u]}return{exports:t,options:l}}var m=p(f,o,s,!1,null,null,null),h=m.exports;h.install=function(t){t.component(h.name,h)};var y=h;e["default"]=y}})}));
@@ -0,0 +1,10 @@
1
+ <meta charset="utf-8">
2
+ <title>xt-transfer-tree demo</title>
3
+ <script src="./xt-transfer-tree.umd.js"></script>
4
+
5
+ <link rel="stylesheet" href="./xt-transfer-tree.css">
6
+
7
+
8
+ <script>
9
+ console.log(xt-transfer-tree)
10
+ </script>
@@ -0,0 +1 @@
1
+ module.exports = require('./xt-transfer-tree.common.js');