xt-element-ui 2.1.72 → 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 (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,594 @@
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-input"] = factory();
8
+ else
9
+ root["xt-input"] = 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
+ /***/ "0563":
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__, "XtInput", function() { return /* reexport */ xt_input; });
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-input/style/index.scss
133
+ var style = __webpack_require__("0563");
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-input/index.vue?vue&type=template&id=6a24ab05
136
+ var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-input",class:[
137
+ _vm.size ? 'xt-input--' + _vm.size : '',
138
+ { 'is-disabled': _vm.disabled },
139
+ { 'is-error': _vm.hasError }
140
+ ]},[_c('el-input',{style:(_vm.inputStyle),attrs:{"value":_vm.displayValue,"placeholder":_vm.placeholder,"type":_vm.inputType,"size":_vm.size,"disabled":_vm.disabled,"readonly":_vm.readonly,"maxlength":_vm.maxlength,"show-word-limit":_vm.showWordLimit,"prefix-icon":_vm.prefixIcon,"suffix-icon":_vm.suffixIcon},on:{"input":_vm.handleInput,"change":_vm.handleChange,"focus":_vm.handleFocus,"blur":_vm.handleBlur,"clear":_vm.handleClear},scopedSlots:_vm._u([(_vm.$slots.prefix)?{key:"prefix",fn:function(){return [_vm._t("prefix")]},proxy:true}:null,(_vm.$slots.suffix)?{key:"suffix",fn:function(){return [_vm._t("suffix")]},proxy:true}:null],null,true)})],1)
141
+ }
142
+ var staticRenderFns = []
143
+
144
+
145
+ // CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=template&id=6a24ab05
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-input/index.vue?vue&type=script&lang=js
148
+
149
+ /* harmony default export */ var xt_inputvue_type_script_lang_js = ({
150
+ name: 'XtInput',
151
+ props: {
152
+ value: [String, Number],
153
+ placeholder: {
154
+ type: String,
155
+ default: '请输入内容'
156
+ },
157
+ type: {
158
+ type: String,
159
+ default: 'text',
160
+ validator: (val) => ['text', 'number', 'integer', 'decimal', 'money', 'phone', 'email', 'idcard', 'password', 'textarea'].includes(val)
161
+ },
162
+ size: {
163
+ type: String,
164
+ default: ''
165
+ },
166
+ disabled: {
167
+ type: Boolean,
168
+ default: false
169
+ },
170
+ readonly: {
171
+ type: Boolean,
172
+ default: false
173
+ },
174
+ color: {
175
+ type: String,
176
+ default: ''
177
+ },
178
+ precision: {
179
+ type: Number,
180
+ default: 2,
181
+ validator: (val) => val >= 0 && val <= 10
182
+ },
183
+ min: {
184
+ type: Number,
185
+ default: undefined
186
+ },
187
+ max: {
188
+ type: Number,
189
+ default: undefined
190
+ },
191
+ allowNegative: {
192
+ type: Boolean,
193
+ default: false
194
+ },
195
+ thousandSeparator: {
196
+ type: Boolean,
197
+ default: false
198
+ },
199
+ maxlength: {
200
+ type: Number,
201
+ default: undefined
202
+ },
203
+ showWordLimit: {
204
+ type: Boolean,
205
+ default: false
206
+ },
207
+ prefixIcon: {
208
+ type: String,
209
+ default: ''
210
+ },
211
+ suffixIcon: {
212
+ type: String,
213
+ default: ''
214
+ },
215
+ trim: {
216
+ type: Boolean,
217
+ default: false
218
+ }
219
+ },
220
+ data() {
221
+ return {
222
+ currentStr: '',
223
+ isFocused: false,
224
+ hasError: false
225
+ }
226
+ },
227
+ computed: {
228
+ inputType() {
229
+ if (this.type === 'textarea') {
230
+ return 'textarea'
231
+ }
232
+ if (this.type === 'password') {
233
+ return 'password'
234
+ }
235
+ if (this.isNumberType) {
236
+ return 'text'
237
+ }
238
+ return 'text'
239
+ },
240
+ isNumberType() {
241
+ return ['number', 'integer', 'decimal', 'money'].includes(this.type)
242
+ },
243
+ displayValue() {
244
+ if (this.isNumberType) {
245
+ if (this.thousandSeparator && this.currentStr) {
246
+ return this.formatThousand(this.currentStr)
247
+ }
248
+ return this.currentStr
249
+ }
250
+ return this.value
251
+ },
252
+ inputStyle() {
253
+ const style = {}
254
+ if (this.color) {
255
+ style['--xt-input-focus-color'] = this.color
256
+ }
257
+ return style
258
+ }
259
+ },
260
+ watch: {
261
+ value: {
262
+ immediate: true,
263
+ handler(val) {
264
+ if (this.isNumberType && !this.isFocused) {
265
+ if (val === null || val === undefined || val === '') {
266
+ this.currentStr = ''
267
+ } else {
268
+ const strVal = String(val)
269
+ if (this.thousandSeparator) {
270
+ this.currentStr = this.parseThousand(strVal)
271
+ } else {
272
+ this.currentStr = strVal
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+ },
279
+ methods: {
280
+ isValidNumber(str) {
281
+ if (!str) return true
282
+ const negativePattern = this.allowNegative ? '[-+]?' : ''
283
+ if (this.type === 'integer') {
284
+ return new RegExp(`^${negativePattern}\\d*$`).test(str)
285
+ }
286
+ if (this.type === 'decimal' || this.type === 'number') {
287
+ if (this.precision === 0) {
288
+ return new RegExp(`^${negativePattern}\\d*$`).test(str)
289
+ }
290
+ return new RegExp(`^${negativePattern}\\d*\\.?\\d{0,${this.precision}}$`).test(str)
291
+ }
292
+ if (this.type === 'money') {
293
+ return new RegExp(`^${negativePattern}\\d*\\.?\\d{0,${this.precision}}$`).test(str)
294
+ }
295
+ return true
296
+ },
297
+ isValidPhone(str) {
298
+ return /^1[3-9]\d{0,9}$/.test(str)
299
+ },
300
+ isValidEmail(str) {
301
+ if (!str) return true
302
+ return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(str)
303
+ },
304
+ isValidIdCard(str) {
305
+ return /^[1-9]\d{0,17}$/.test(str)
306
+ },
307
+ formatThousand(str) {
308
+ if (!str) return ''
309
+ const parts = str.split('.')
310
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
311
+ return parts.join('.')
312
+ },
313
+ parseThousand(str) {
314
+ return str.replace(/,/g, '')
315
+ },
316
+ parseToNumber(str) {
317
+ if (!str || str === '+' || str === '-' || str === '.' || str === '+.' || str === '-.' || str === '-.') {
318
+ return undefined
319
+ }
320
+ const num = parseFloat(str)
321
+ return isNaN(num) ? undefined : num
322
+ },
323
+ handleInput(val) {
324
+ let inputVal = val
325
+
326
+ if (this.thousandSeparator && this.isNumberType) {
327
+ inputVal = this.parseThousand(val)
328
+ }
329
+
330
+ if (this.type === 'phone') {
331
+ inputVal = val.replace(/[^\d]/g, '')
332
+ if (!this.isValidPhone(inputVal)) {
333
+ inputVal = inputVal.slice(0, -1)
334
+ }
335
+ this.$emit('input', inputVal)
336
+ return
337
+ }
338
+
339
+ if (this.type === 'idcard') {
340
+ inputVal = val.replace(/[^\dXx]/g, '')
341
+ if (!this.isValidIdCard(inputVal)) {
342
+ inputVal = inputVal.slice(0, -1)
343
+ }
344
+ this.$emit('input', inputVal.toUpperCase())
345
+ return
346
+ }
347
+
348
+ if (this.type === 'email') {
349
+ if (!this.isValidEmail(inputVal)) {
350
+ this.hasError = true
351
+ } else {
352
+ this.hasError = false
353
+ }
354
+ this.$emit('input', inputVal)
355
+ return
356
+ }
357
+
358
+ if (this.isNumberType) {
359
+ if (this.isValidNumber(inputVal)) {
360
+ this.currentStr = inputVal
361
+ const num = this.parseToNumber(inputVal)
362
+ if (num !== undefined) {
363
+ let finalNum = num
364
+ if (this.min !== undefined && num < this.min) {
365
+ finalNum = this.min
366
+ this.currentStr = String(finalNum)
367
+ }
368
+ if (this.max !== undefined && num > this.max) {
369
+ finalNum = this.max
370
+ this.currentStr = String(finalNum)
371
+ }
372
+ this.$emit('input', finalNum)
373
+ this.hasError = false
374
+ } else {
375
+ this.$emit('input', undefined)
376
+ }
377
+ }
378
+ } else {
379
+ if (this.trim) {
380
+ inputVal = inputVal.trim()
381
+ }
382
+ this.$emit('input', inputVal)
383
+ }
384
+ },
385
+ handleChange(val) {
386
+ let changeVal = val
387
+
388
+ if (this.thousandSeparator && this.isNumberType) {
389
+ changeVal = this.parseThousand(val)
390
+ }
391
+
392
+ if (this.isNumberType) {
393
+ const num = this.parseToNumber(changeVal)
394
+ this.$emit('change', num)
395
+ } else {
396
+ if (this.trim) {
397
+ changeVal = changeVal.trim()
398
+ }
399
+ this.$emit('change', changeVal)
400
+ }
401
+ },
402
+ handleFocus(e) {
403
+ this.isFocused = true
404
+ this.$emit('focus', e)
405
+ },
406
+ handleBlur(e) {
407
+ this.isFocused = false
408
+
409
+ if (this.isNumberType) {
410
+ const num = this.parseToNumber(this.currentStr)
411
+ if (num !== undefined) {
412
+ let finalNum = num
413
+ if (this.precision > 0) {
414
+ finalNum = Number(num.toFixed(this.precision))
415
+ }
416
+ this.currentStr = String(finalNum)
417
+ this.$emit('input', finalNum)
418
+ this.$emit('blur', finalNum, e)
419
+ this.hasError = false
420
+ } else {
421
+ if (this.currentStr !== '') {
422
+ this.currentStr = ''
423
+ this.$emit('input', undefined)
424
+ }
425
+ this.$emit('blur', undefined, e)
426
+ this.hasError = false
427
+ }
428
+ } else {
429
+ if (this.type === 'email') {
430
+ if (!this.isValidEmail(this.value)) {
431
+ this.hasError = true
432
+ }
433
+ }
434
+ this.$emit('blur', e)
435
+ }
436
+ },
437
+ handleClear() {
438
+ if (this.isNumberType) {
439
+ this.currentStr = ''
440
+ }
441
+ this.hasError = false
442
+ this.$emit('input', this.isNumberType ? undefined : '')
443
+ this.$emit('clear')
444
+ },
445
+ reset() {
446
+ this.currentStr = ''
447
+ this.hasError = false
448
+ this.$emit('input', this.isNumberType ? undefined : '')
449
+ }
450
+ }
451
+ });
452
+
453
+ // CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=script&lang=js
454
+ /* harmony default export */ var components_xt_inputvue_type_script_lang_js = (xt_inputvue_type_script_lang_js);
455
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
456
+ /* globals __VUE_SSR_CONTEXT__ */
457
+
458
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
459
+ // This module is a runtime utility for cleaner component module output and will
460
+ // be included in the final webpack user bundle.
461
+
462
+ function normalizeComponent(
463
+ scriptExports,
464
+ render,
465
+ staticRenderFns,
466
+ functionalTemplate,
467
+ injectStyles,
468
+ scopeId,
469
+ moduleIdentifier /* server only */,
470
+ shadowMode /* vue-cli only */
471
+ ) {
472
+ // Vue.extend constructor export interop
473
+ var options =
474
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
475
+
476
+ // render functions
477
+ if (render) {
478
+ options.render = render
479
+ options.staticRenderFns = staticRenderFns
480
+ options._compiled = true
481
+ }
482
+
483
+ // functional template
484
+ if (functionalTemplate) {
485
+ options.functional = true
486
+ }
487
+
488
+ // scopedId
489
+ if (scopeId) {
490
+ options._scopeId = 'data-v-' + scopeId
491
+ }
492
+
493
+ var hook
494
+ if (moduleIdentifier) {
495
+ // server build
496
+ hook = function (context) {
497
+ // 2.3 injection
498
+ context =
499
+ context || // cached call
500
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
501
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
502
+ // 2.2 with runInNewContext: true
503
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
504
+ context = __VUE_SSR_CONTEXT__
505
+ }
506
+ // inject component styles
507
+ if (injectStyles) {
508
+ injectStyles.call(this, context)
509
+ }
510
+ // register component module identifier for async chunk inferrence
511
+ if (context && context._registeredComponents) {
512
+ context._registeredComponents.add(moduleIdentifier)
513
+ }
514
+ }
515
+ // used by ssr in case component is cached and beforeCreate
516
+ // never gets called
517
+ options._ssrRegister = hook
518
+ } else if (injectStyles) {
519
+ hook = shadowMode
520
+ ? function () {
521
+ injectStyles.call(
522
+ this,
523
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
524
+ )
525
+ }
526
+ : injectStyles
527
+ }
528
+
529
+ if (hook) {
530
+ if (options.functional) {
531
+ // for template-only hot-reload because in that case the render fn doesn't
532
+ // go through the normalizer
533
+ options._injectStyles = hook
534
+ // register for functional component in vue file
535
+ var originalRender = options.render
536
+ options.render = function renderWithStyleInjection(h, context) {
537
+ hook.call(context)
538
+ return originalRender(h, context)
539
+ }
540
+ } else {
541
+ // inject component registration as beforeCreate hook
542
+ var existing = options.beforeCreate
543
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
544
+ }
545
+ }
546
+
547
+ return {
548
+ exports: scriptExports,
549
+ options: options
550
+ }
551
+ }
552
+
553
+ // CONCATENATED MODULE: ./src/components/xt-input/index.vue
554
+
555
+
556
+
557
+
558
+
559
+ /* normalize component */
560
+
561
+ var component = normalizeComponent(
562
+ components_xt_inputvue_type_script_lang_js,
563
+ render,
564
+ staticRenderFns,
565
+ false,
566
+ null,
567
+ null,
568
+ null
569
+
570
+ )
571
+
572
+ /* harmony default export */ var xt_input = (component.exports);
573
+ // CONCATENATED MODULE: ./src/components/xt-input/index.js
574
+
575
+
576
+
577
+ xt_input.install = function (Vue) {
578
+ Vue.component(xt_input.name, xt_input)
579
+ }
580
+
581
+ /* harmony default export */ var components_xt_input = (xt_input);
582
+
583
+
584
+ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
585
+
586
+
587
+ /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_input);
588
+
589
+
590
+
591
+ /***/ })
592
+
593
+ /******/ });
594
+ });
@@ -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-input"]=e():t["xt-input"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(r,s,function(e){return t[e]}.bind(null,s));return r},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")}({"0563":function(t,e,i){},fb15:function(t,e,i){"use strict";if(i.r(e),i.d(e,"XtInput",(function(){return h})),"undefined"!==typeof window){var r=window.document.currentScript,s=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);s&&(i.p=s[1])}i("0563");var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"xt-input",class:[t.size?"xt-input--"+t.size:"",{"is-disabled":t.disabled},{"is-error":t.hasError}]},[e("el-input",{style:t.inputStyle,attrs:{value:t.displayValue,placeholder:t.placeholder,type:t.inputType,size:t.size,disabled:t.disabled,readonly:t.readonly,maxlength:t.maxlength,"show-word-limit":t.showWordLimit,"prefix-icon":t.prefixIcon,"suffix-icon":t.suffixIcon},on:{input:t.handleInput,change:t.handleChange,focus:t.handleFocus,blur:t.handleBlur,clear:t.handleClear},scopedSlots:t._u([t.$slots.prefix?{key:"prefix",fn:function(){return[t._t("prefix")]},proxy:!0}:null,t.$slots.suffix?{key:"suffix",fn:function(){return[t._t("suffix")]},proxy:!0}:null],null,!0)})],1)},o=[],u={name:"XtInput",props:{value:[String,Number],placeholder:{type:String,default:"请输入内容"},type:{type:String,default:"text",validator:t=>["text","number","integer","decimal","money","phone","email","idcard","password","textarea"].includes(t)},size:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},color:{type:String,default:""},precision:{type:Number,default:2,validator:t=>t>=0&&t<=10},min:{type:Number,default:void 0},max:{type:Number,default:void 0},allowNegative:{type:Boolean,default:!1},thousandSeparator:{type:Boolean,default:!1},maxlength:{type:Number,default:void 0},showWordLimit:{type:Boolean,default:!1},prefixIcon:{type:String,default:""},suffixIcon:{type:String,default:""},trim:{type:Boolean,default:!1}},data(){return{currentStr:"",isFocused:!1,hasError:!1}},computed:{inputType(){return"textarea"===this.type?"textarea":"password"===this.type?"password":(this.isNumberType,"text")},isNumberType(){return["number","integer","decimal","money"].includes(this.type)},displayValue(){return this.isNumberType?this.thousandSeparator&&this.currentStr?this.formatThousand(this.currentStr):this.currentStr:this.value},inputStyle(){const t={};return this.color&&(t["--xt-input-focus-color"]=this.color),t}},watch:{value:{immediate:!0,handler(t){if(this.isNumberType&&!this.isFocused)if(null===t||void 0===t||""===t)this.currentStr="";else{const e=String(t);this.thousandSeparator?this.currentStr=this.parseThousand(e):this.currentStr=e}}}},methods:{isValidNumber(t){if(!t)return!0;const e=this.allowNegative?"[-+]?":"";return"integer"===this.type?new RegExp(`^${e}\\d*$`).test(t):"decimal"===this.type||"number"===this.type?0===this.precision?new RegExp(`^${e}\\d*$`).test(t):new RegExp(`^${e}\\d*\\.?\\d{0,${this.precision}}$`).test(t):"money"!==this.type||new RegExp(`^${e}\\d*\\.?\\d{0,${this.precision}}$`).test(t)},isValidPhone(t){return/^1[3-9]\d{0,9}$/.test(t)},isValidEmail(t){return!t||/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(t)},isValidIdCard(t){return/^[1-9]\d{0,17}$/.test(t)},formatThousand(t){if(!t)return"";const e=t.split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},parseThousand(t){return t.replace(/,/g,"")},parseToNumber(t){if(!t||"+"===t||"-"===t||"."===t||"+."===t||"-."===t||"-."===t)return;const e=parseFloat(t);return isNaN(e)?void 0:e},handleInput(t){let e=t;if(this.thousandSeparator&&this.isNumberType&&(e=this.parseThousand(t)),"phone"===this.type)return e=t.replace(/[^\d]/g,""),this.isValidPhone(e)||(e=e.slice(0,-1)),void this.$emit("input",e);if("idcard"===this.type)return e=t.replace(/[^\dXx]/g,""),this.isValidIdCard(e)||(e=e.slice(0,-1)),void this.$emit("input",e.toUpperCase());if("email"===this.type)return this.isValidEmail(e)?this.hasError=!1:this.hasError=!0,void this.$emit("input",e);if(this.isNumberType){if(this.isValidNumber(e)){this.currentStr=e;const t=this.parseToNumber(e);if(void 0!==t){let e=t;void 0!==this.min&&t<this.min&&(e=this.min,this.currentStr=String(e)),void 0!==this.max&&t>this.max&&(e=this.max,this.currentStr=String(e)),this.$emit("input",e),this.hasError=!1}else this.$emit("input",void 0)}}else this.trim&&(e=e.trim()),this.$emit("input",e)},handleChange(t){let e=t;if(this.thousandSeparator&&this.isNumberType&&(e=this.parseThousand(t)),this.isNumberType){const t=this.parseToNumber(e);this.$emit("change",t)}else this.trim&&(e=e.trim()),this.$emit("change",e)},handleFocus(t){this.isFocused=!0,this.$emit("focus",t)},handleBlur(t){if(this.isFocused=!1,this.isNumberType){const e=this.parseToNumber(this.currentStr);if(void 0!==e){let i=e;this.precision>0&&(i=Number(e.toFixed(this.precision))),this.currentStr=String(i),this.$emit("input",i),this.$emit("blur",i,t),this.hasError=!1}else""!==this.currentStr&&(this.currentStr="",this.$emit("input",void 0)),this.$emit("blur",void 0,t),this.hasError=!1}else"email"===this.type&&(this.isValidEmail(this.value)||(this.hasError=!0)),this.$emit("blur",t)},handleClear(){this.isNumberType&&(this.currentStr=""),this.hasError=!1,this.$emit("input",this.isNumberType?void 0:""),this.$emit("clear")},reset(){this.currentStr="",this.hasError=!1,this.$emit("input",this.isNumberType?void 0:"")}}},a=u;function l(t,e,i,r,s,n,o,u){var a,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=i,l._compiled=!0),r&&(l.functional=!0),n&&(l._scopeId="data-v-"+n),o?(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__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=a):s&&(a=u?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),a)if(l.functional){l._injectStyles=a;var d=l.render;l.render=function(t,e){return a.call(e),d(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,a):[a]}return{exports:t,options:l}}var d=l(a,n,o,!1,null,null,null),h=d.exports;h.install=function(t){t.component(h.name,h)};var p=h;e["default"]=p}})}));
@@ -0,0 +1,10 @@
1
+ <meta charset="utf-8">
2
+ <title>xt-list demo</title>
3
+ <script src="./xt-list.umd.js"></script>
4
+
5
+ <link rel="stylesheet" href="./xt-list.css">
6
+
7
+
8
+ <script>
9
+ console.log(xt-list)
10
+ </script>
@@ -0,0 +1 @@
1
+ module.exports = require('./xt-list.common.js');