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.
- package/lib/index.common.js +267 -61
- package/lib/index.css +1 -1
- package/lib/index.umd.js +267 -61
- package/lib/index.umd.min.js +1 -1
- package/lib/xt-badge/demo.html +10 -0
- package/lib/xt-badge/index.js +1 -0
- package/lib/xt-badge/xt-badge.common.js +335 -0
- package/lib/xt-badge/xt-badge.css +1 -0
- package/lib/xt-badge/xt-badge.umd.js +345 -0
- package/lib/xt-badge/xt-badge.umd.min.js +1 -0
- package/lib/xt-button/demo.html +10 -0
- package/lib/xt-button/index.js +1 -0
- package/lib/xt-button/xt-button.common.js +331 -0
- package/lib/xt-button/xt-button.css +1 -0
- package/lib/xt-button/xt-button.umd.js +341 -0
- package/lib/xt-button/xt-button.umd.min.js +1 -0
- package/lib/xt-card/demo.html +10 -0
- package/lib/xt-card/index.js +1 -0
- package/lib/xt-card/xt-card.common.js +325 -0
- package/lib/xt-card/xt-card.css +1 -0
- package/lib/xt-card/xt-card.umd.js +335 -0
- package/lib/xt-card/xt-card.umd.min.js +1 -0
- package/lib/xt-card-item/demo.html +10 -0
- package/lib/xt-card-item/index.js +1 -0
- package/lib/xt-card-item/xt-card-item.common.js +291 -0
- package/lib/xt-card-item/xt-card-item.css +1 -0
- package/lib/xt-card-item/xt-card-item.umd.js +301 -0
- package/lib/xt-card-item/xt-card-item.umd.min.js +1 -0
- package/lib/xt-chart/demo.html +10 -0
- package/lib/xt-chart/index.js +1 -0
- package/lib/xt-chart/xt-chart.common.js +109203 -0
- package/lib/xt-chart/xt-chart.css +1 -0
- package/lib/xt-chart/xt-chart.umd.js +109213 -0
- package/lib/xt-chart/xt-chart.umd.min.js +1 -0
- package/lib/xt-config-provider/demo.html +10 -0
- package/lib/xt-config-provider/index.js +1 -0
- package/lib/xt-config-provider/xt-config-provider.common.js +108388 -0
- package/lib/xt-config-provider/xt-config-provider.css +1 -0
- package/lib/xt-config-provider/xt-config-provider.umd.js +108398 -0
- package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -0
- package/lib/xt-date-picker/demo.html +10 -0
- package/lib/xt-date-picker/index.js +1 -0
- package/lib/xt-date-picker/xt-date-picker.common.js +768 -0
- package/lib/xt-date-picker/xt-date-picker.css +1 -0
- package/lib/xt-date-picker/xt-date-picker.umd.js +778 -0
- package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -0
- package/lib/xt-flex-box/demo.html +10 -0
- package/lib/xt-flex-box/index.js +1 -0
- package/lib/xt-flex-box/xt-flex-box.common.js +303 -0
- package/lib/xt-flex-box/xt-flex-box.css +1 -0
- package/lib/xt-flex-box/xt-flex-box.umd.js +313 -0
- package/lib/xt-flex-box/xt-flex-box.umd.min.js +1 -0
- package/lib/xt-form-schema/demo.html +10 -0
- package/lib/xt-form-schema/index.js +1 -0
- package/lib/xt-form-schema/xt-form-schema.common.js +510 -0
- package/lib/xt-form-schema/xt-form-schema.css +1 -0
- package/lib/xt-form-schema/xt-form-schema.umd.js +520 -0
- package/lib/xt-form-schema/xt-form-schema.umd.min.js +1 -0
- package/lib/xt-grid-box/demo.html +10 -0
- package/lib/xt-grid-box/index.js +1 -0
- package/lib/xt-grid-box/xt-grid-box.common.js +404 -0
- package/lib/xt-grid-box/xt-grid-box.css +1 -0
- package/lib/xt-grid-box/xt-grid-box.umd.js +414 -0
- package/lib/xt-grid-box/xt-grid-box.umd.min.js +1 -0
- package/lib/xt-grid-item/demo.html +10 -0
- package/lib/xt-grid-item/index.js +1 -0
- package/lib/xt-grid-item/xt-grid-item.common.js +381 -0
- package/lib/xt-grid-item/xt-grid-item.css +1 -0
- package/lib/xt-grid-item/xt-grid-item.umd.js +391 -0
- package/lib/xt-grid-item/xt-grid-item.umd.min.js +1 -0
- package/lib/xt-icon/demo.html +10 -0
- package/lib/xt-icon/index.js +1 -0
- package/lib/xt-icon/xt-icon.common.js +430 -0
- package/lib/xt-icon/xt-icon.css +1 -0
- package/lib/xt-icon/xt-icon.umd.js +440 -0
- package/lib/xt-icon/xt-icon.umd.min.js +1 -0
- package/lib/xt-input/demo.html +10 -0
- package/lib/xt-input/index.js +1 -0
- package/lib/xt-input/xt-input.common.js +584 -0
- package/lib/xt-input/xt-input.css +1 -0
- package/lib/xt-input/xt-input.umd.js +594 -0
- package/lib/xt-input/xt-input.umd.min.js +1 -0
- package/lib/xt-list/demo.html +10 -0
- package/lib/xt-list/index.js +1 -0
- package/lib/xt-list/xt-list.common.js +714 -0
- package/lib/xt-list/xt-list.css +1 -0
- package/lib/xt-list/xt-list.umd.js +724 -0
- package/lib/xt-list/xt-list.umd.min.js +1 -0
- package/lib/xt-map/demo.html +10 -0
- package/lib/xt-map/index.js +1 -0
- package/lib/xt-map/xt-map.common.js +1951 -0
- package/lib/xt-map/xt-map.css +1 -0
- package/lib/xt-map/xt-map.umd.js +1961 -0
- package/lib/xt-map/xt-map.umd.min.js +1 -0
- package/lib/xt-map-provider/demo.html +10 -0
- package/lib/xt-map-provider/index.js +1 -0
- package/lib/xt-map-provider/xt-map-provider.common.js +644 -0
- package/lib/xt-map-provider/xt-map-provider.css +1 -0
- package/lib/xt-map-provider/xt-map-provider.umd.js +654 -0
- package/lib/xt-map-provider/xt-map-provider.umd.min.js +1 -0
- package/lib/xt-page/demo.html +10 -0
- package/lib/xt-page/index.js +1 -0
- package/lib/xt-page/xt-page.common.js +353 -0
- package/lib/xt-page/xt-page.css +1 -0
- package/lib/xt-page/xt-page.umd.js +363 -0
- package/lib/xt-page/xt-page.umd.min.js +1 -0
- package/lib/xt-progress/demo.html +10 -0
- package/lib/xt-progress/index.js +1 -0
- package/lib/xt-progress/xt-progress.common.js +327 -0
- package/lib/xt-progress/xt-progress.css +1 -0
- package/lib/xt-progress/xt-progress.umd.js +337 -0
- package/lib/xt-progress/xt-progress.umd.min.js +1 -0
- package/lib/xt-scroll-arrow/demo.html +10 -0
- package/lib/xt-scroll-arrow/index.js +1 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +495 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +505 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -0
- package/lib/xt-select-tree/demo.html +10 -0
- package/lib/xt-select-tree/index.js +1 -0
- package/lib/xt-select-tree/xt-select-tree.common.js +1791 -0
- package/lib/xt-select-tree/xt-select-tree.css +1 -0
- package/lib/xt-select-tree/xt-select-tree.umd.js +1801 -0
- package/lib/xt-select-tree/xt-select-tree.umd.min.js +1 -0
- package/lib/xt-step-price/demo.html +10 -0
- package/lib/xt-step-price/index.js +1 -0
- package/lib/xt-step-price/xt-step-price.common.js +800 -0
- package/lib/xt-step-price/xt-step-price.css +1 -0
- package/lib/xt-step-price/xt-step-price.umd.js +810 -0
- package/lib/xt-step-price/xt-step-price.umd.min.js +1 -0
- package/lib/xt-step-price-item/demo.html +10 -0
- package/lib/xt-step-price-item/index.js +1 -0
- package/lib/xt-step-price-item/xt-step-price-item.common.js +417 -0
- package/lib/xt-step-price-item/xt-step-price-item.umd.js +427 -0
- package/lib/xt-step-price-item/xt-step-price-item.umd.min.js +1 -0
- package/lib/xt-tab-pane/demo.html +10 -0
- package/lib/xt-tab-pane/index.js +1 -0
- package/lib/xt-tab-pane/xt-tab-pane.common.js +309 -0
- package/lib/xt-tab-pane/xt-tab-pane.umd.js +319 -0
- package/lib/xt-tab-pane/xt-tab-pane.umd.min.js +1 -0
- package/lib/xt-table/demo.html +10 -0
- package/lib/xt-table/index.js +1 -0
- package/lib/xt-table/xt-table.common.js +1027 -0
- package/lib/xt-table/xt-table.css +1 -0
- package/lib/xt-table/xt-table.umd.js +1037 -0
- package/lib/xt-table/xt-table.umd.min.js +1 -0
- package/lib/xt-tabs/demo.html +10 -0
- package/lib/xt-tabs/index.js +1 -0
- package/lib/xt-tabs/xt-tabs.common.js +463 -0
- package/lib/xt-tabs/xt-tabs.css +1 -0
- package/lib/xt-tabs/xt-tabs.umd.js +473 -0
- package/lib/xt-tabs/xt-tabs.umd.min.js +1 -0
- package/lib/xt-text/demo.html +10 -0
- package/lib/xt-text/index.js +1 -0
- package/lib/xt-text/xt-text.common.js +536 -0
- package/lib/xt-text/xt-text.css +1 -0
- package/lib/xt-text/xt-text.umd.js +546 -0
- package/lib/xt-text/xt-text.umd.min.js +1 -0
- package/lib/xt-time/demo.html +10 -0
- package/lib/xt-time/index.js +1 -0
- package/lib/xt-time/xt-time.common.js +555 -0
- package/lib/xt-time/xt-time.css +1 -0
- package/lib/xt-time/xt-time.umd.js +565 -0
- package/lib/xt-time/xt-time.umd.min.js +1 -0
- package/lib/xt-transfer-tree/demo.html +10 -0
- package/lib/xt-transfer-tree/index.js +1 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.common.js +594 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.css +1 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +604 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.umd.min.js +1 -0
- package/lib/xt-upload/demo.html +10 -0
- package/lib/xt-upload/index.js +1 -0
- package/lib/xt-upload/xt-upload.common.js +1292 -0
- package/lib/xt-upload/xt-upload.css +1 -0
- package/lib/xt-upload/xt-upload.umd.js +1302 -0
- package/lib/xt-upload/xt-upload.umd.min.js +1 -0
- package/package.json +4 -2
- package/src/components/xt-badge/index.js +8 -7
- package/src/components/xt-button/index.js +1 -0
- package/src/components/xt-card/index.js +1 -0
- package/src/components/xt-card-item/index.js +1 -0
- package/src/components/xt-config-provider/index.js +1 -0
- package/src/components/xt-flex-box/index.js +1 -0
- package/src/components/xt-grid-box/index.js +1 -0
- package/src/components/xt-icon/index.js +1 -0
- package/src/components/xt-input/index.js +1 -0
- package/src/components/xt-map/index.js +1 -0
- package/src/components/xt-progress/index.js +8 -7
- package/src/components/xt-scroll-arrow/index.js +8 -7
- package/src/components/xt-step-price/index.js +1 -0
- package/src/components/xt-tabs/index.js +9 -8
- package/src/components/xt-text/index.js +1 -0
- package/src/components/xt-time/index.js +1 -0
- package/src/index.js +32 -2
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ "0563":
|
|
91
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
92
|
+
|
|
93
|
+
// extracted by mini-css-extract-plugin
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ "fb15":
|
|
98
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
|
+
|
|
100
|
+
"use strict";
|
|
101
|
+
// ESM COMPAT FLAG
|
|
102
|
+
__webpack_require__.r(__webpack_exports__);
|
|
103
|
+
|
|
104
|
+
// EXPORTS
|
|
105
|
+
__webpack_require__.d(__webpack_exports__, "XtInput", function() { return /* reexport */ xt_input; });
|
|
106
|
+
|
|
107
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
108
|
+
// This file is imported into lib/wc client bundles.
|
|
109
|
+
|
|
110
|
+
if (typeof window !== 'undefined') {
|
|
111
|
+
var currentScript = window.document.currentScript
|
|
112
|
+
if (false) { var getCurrentScript; }
|
|
113
|
+
|
|
114
|
+
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
115
|
+
if (src) {
|
|
116
|
+
__webpack_require__.p = src[1] // eslint-disable-line
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Indicate to webpack that this file can be concatenated
|
|
121
|
+
/* harmony default export */ var setPublicPath = (null);
|
|
122
|
+
|
|
123
|
+
// EXTERNAL MODULE: ./src/components/xt-input/style/index.scss
|
|
124
|
+
var style = __webpack_require__("0563");
|
|
125
|
+
|
|
126
|
+
// 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
|
|
127
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-input",class:[
|
|
128
|
+
_vm.size ? 'xt-input--' + _vm.size : '',
|
|
129
|
+
{ 'is-disabled': _vm.disabled },
|
|
130
|
+
{ 'is-error': _vm.hasError }
|
|
131
|
+
]},[_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)
|
|
132
|
+
}
|
|
133
|
+
var staticRenderFns = []
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
// CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=template&id=6a24ab05
|
|
137
|
+
|
|
138
|
+
// 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
|
|
139
|
+
|
|
140
|
+
/* harmony default export */ var xt_inputvue_type_script_lang_js = ({
|
|
141
|
+
name: 'XtInput',
|
|
142
|
+
props: {
|
|
143
|
+
value: [String, Number],
|
|
144
|
+
placeholder: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: '请输入内容'
|
|
147
|
+
},
|
|
148
|
+
type: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: 'text',
|
|
151
|
+
validator: (val) => ['text', 'number', 'integer', 'decimal', 'money', 'phone', 'email', 'idcard', 'password', 'textarea'].includes(val)
|
|
152
|
+
},
|
|
153
|
+
size: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: ''
|
|
156
|
+
},
|
|
157
|
+
disabled: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default: false
|
|
160
|
+
},
|
|
161
|
+
readonly: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: false
|
|
164
|
+
},
|
|
165
|
+
color: {
|
|
166
|
+
type: String,
|
|
167
|
+
default: ''
|
|
168
|
+
},
|
|
169
|
+
precision: {
|
|
170
|
+
type: Number,
|
|
171
|
+
default: 2,
|
|
172
|
+
validator: (val) => val >= 0 && val <= 10
|
|
173
|
+
},
|
|
174
|
+
min: {
|
|
175
|
+
type: Number,
|
|
176
|
+
default: undefined
|
|
177
|
+
},
|
|
178
|
+
max: {
|
|
179
|
+
type: Number,
|
|
180
|
+
default: undefined
|
|
181
|
+
},
|
|
182
|
+
allowNegative: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: false
|
|
185
|
+
},
|
|
186
|
+
thousandSeparator: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: false
|
|
189
|
+
},
|
|
190
|
+
maxlength: {
|
|
191
|
+
type: Number,
|
|
192
|
+
default: undefined
|
|
193
|
+
},
|
|
194
|
+
showWordLimit: {
|
|
195
|
+
type: Boolean,
|
|
196
|
+
default: false
|
|
197
|
+
},
|
|
198
|
+
prefixIcon: {
|
|
199
|
+
type: String,
|
|
200
|
+
default: ''
|
|
201
|
+
},
|
|
202
|
+
suffixIcon: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: ''
|
|
205
|
+
},
|
|
206
|
+
trim: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: false
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
data() {
|
|
212
|
+
return {
|
|
213
|
+
currentStr: '',
|
|
214
|
+
isFocused: false,
|
|
215
|
+
hasError: false
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
computed: {
|
|
219
|
+
inputType() {
|
|
220
|
+
if (this.type === 'textarea') {
|
|
221
|
+
return 'textarea'
|
|
222
|
+
}
|
|
223
|
+
if (this.type === 'password') {
|
|
224
|
+
return 'password'
|
|
225
|
+
}
|
|
226
|
+
if (this.isNumberType) {
|
|
227
|
+
return 'text'
|
|
228
|
+
}
|
|
229
|
+
return 'text'
|
|
230
|
+
},
|
|
231
|
+
isNumberType() {
|
|
232
|
+
return ['number', 'integer', 'decimal', 'money'].includes(this.type)
|
|
233
|
+
},
|
|
234
|
+
displayValue() {
|
|
235
|
+
if (this.isNumberType) {
|
|
236
|
+
if (this.thousandSeparator && this.currentStr) {
|
|
237
|
+
return this.formatThousand(this.currentStr)
|
|
238
|
+
}
|
|
239
|
+
return this.currentStr
|
|
240
|
+
}
|
|
241
|
+
return this.value
|
|
242
|
+
},
|
|
243
|
+
inputStyle() {
|
|
244
|
+
const style = {}
|
|
245
|
+
if (this.color) {
|
|
246
|
+
style['--xt-input-focus-color'] = this.color
|
|
247
|
+
}
|
|
248
|
+
return style
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
watch: {
|
|
252
|
+
value: {
|
|
253
|
+
immediate: true,
|
|
254
|
+
handler(val) {
|
|
255
|
+
if (this.isNumberType && !this.isFocused) {
|
|
256
|
+
if (val === null || val === undefined || val === '') {
|
|
257
|
+
this.currentStr = ''
|
|
258
|
+
} else {
|
|
259
|
+
const strVal = String(val)
|
|
260
|
+
if (this.thousandSeparator) {
|
|
261
|
+
this.currentStr = this.parseThousand(strVal)
|
|
262
|
+
} else {
|
|
263
|
+
this.currentStr = strVal
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
methods: {
|
|
271
|
+
isValidNumber(str) {
|
|
272
|
+
if (!str) return true
|
|
273
|
+
const negativePattern = this.allowNegative ? '[-+]?' : ''
|
|
274
|
+
if (this.type === 'integer') {
|
|
275
|
+
return new RegExp(`^${negativePattern}\\d*$`).test(str)
|
|
276
|
+
}
|
|
277
|
+
if (this.type === 'decimal' || this.type === 'number') {
|
|
278
|
+
if (this.precision === 0) {
|
|
279
|
+
return new RegExp(`^${negativePattern}\\d*$`).test(str)
|
|
280
|
+
}
|
|
281
|
+
return new RegExp(`^${negativePattern}\\d*\\.?\\d{0,${this.precision}}$`).test(str)
|
|
282
|
+
}
|
|
283
|
+
if (this.type === 'money') {
|
|
284
|
+
return new RegExp(`^${negativePattern}\\d*\\.?\\d{0,${this.precision}}$`).test(str)
|
|
285
|
+
}
|
|
286
|
+
return true
|
|
287
|
+
},
|
|
288
|
+
isValidPhone(str) {
|
|
289
|
+
return /^1[3-9]\d{0,9}$/.test(str)
|
|
290
|
+
},
|
|
291
|
+
isValidEmail(str) {
|
|
292
|
+
if (!str) return true
|
|
293
|
+
return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(str)
|
|
294
|
+
},
|
|
295
|
+
isValidIdCard(str) {
|
|
296
|
+
return /^[1-9]\d{0,17}$/.test(str)
|
|
297
|
+
},
|
|
298
|
+
formatThousand(str) {
|
|
299
|
+
if (!str) return ''
|
|
300
|
+
const parts = str.split('.')
|
|
301
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
302
|
+
return parts.join('.')
|
|
303
|
+
},
|
|
304
|
+
parseThousand(str) {
|
|
305
|
+
return str.replace(/,/g, '')
|
|
306
|
+
},
|
|
307
|
+
parseToNumber(str) {
|
|
308
|
+
if (!str || str === '+' || str === '-' || str === '.' || str === '+.' || str === '-.' || str === '-.') {
|
|
309
|
+
return undefined
|
|
310
|
+
}
|
|
311
|
+
const num = parseFloat(str)
|
|
312
|
+
return isNaN(num) ? undefined : num
|
|
313
|
+
},
|
|
314
|
+
handleInput(val) {
|
|
315
|
+
let inputVal = val
|
|
316
|
+
|
|
317
|
+
if (this.thousandSeparator && this.isNumberType) {
|
|
318
|
+
inputVal = this.parseThousand(val)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (this.type === 'phone') {
|
|
322
|
+
inputVal = val.replace(/[^\d]/g, '')
|
|
323
|
+
if (!this.isValidPhone(inputVal)) {
|
|
324
|
+
inputVal = inputVal.slice(0, -1)
|
|
325
|
+
}
|
|
326
|
+
this.$emit('input', inputVal)
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (this.type === 'idcard') {
|
|
331
|
+
inputVal = val.replace(/[^\dXx]/g, '')
|
|
332
|
+
if (!this.isValidIdCard(inputVal)) {
|
|
333
|
+
inputVal = inputVal.slice(0, -1)
|
|
334
|
+
}
|
|
335
|
+
this.$emit('input', inputVal.toUpperCase())
|
|
336
|
+
return
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (this.type === 'email') {
|
|
340
|
+
if (!this.isValidEmail(inputVal)) {
|
|
341
|
+
this.hasError = true
|
|
342
|
+
} else {
|
|
343
|
+
this.hasError = false
|
|
344
|
+
}
|
|
345
|
+
this.$emit('input', inputVal)
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (this.isNumberType) {
|
|
350
|
+
if (this.isValidNumber(inputVal)) {
|
|
351
|
+
this.currentStr = inputVal
|
|
352
|
+
const num = this.parseToNumber(inputVal)
|
|
353
|
+
if (num !== undefined) {
|
|
354
|
+
let finalNum = num
|
|
355
|
+
if (this.min !== undefined && num < this.min) {
|
|
356
|
+
finalNum = this.min
|
|
357
|
+
this.currentStr = String(finalNum)
|
|
358
|
+
}
|
|
359
|
+
if (this.max !== undefined && num > this.max) {
|
|
360
|
+
finalNum = this.max
|
|
361
|
+
this.currentStr = String(finalNum)
|
|
362
|
+
}
|
|
363
|
+
this.$emit('input', finalNum)
|
|
364
|
+
this.hasError = false
|
|
365
|
+
} else {
|
|
366
|
+
this.$emit('input', undefined)
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
if (this.trim) {
|
|
371
|
+
inputVal = inputVal.trim()
|
|
372
|
+
}
|
|
373
|
+
this.$emit('input', inputVal)
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
handleChange(val) {
|
|
377
|
+
let changeVal = val
|
|
378
|
+
|
|
379
|
+
if (this.thousandSeparator && this.isNumberType) {
|
|
380
|
+
changeVal = this.parseThousand(val)
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (this.isNumberType) {
|
|
384
|
+
const num = this.parseToNumber(changeVal)
|
|
385
|
+
this.$emit('change', num)
|
|
386
|
+
} else {
|
|
387
|
+
if (this.trim) {
|
|
388
|
+
changeVal = changeVal.trim()
|
|
389
|
+
}
|
|
390
|
+
this.$emit('change', changeVal)
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
handleFocus(e) {
|
|
394
|
+
this.isFocused = true
|
|
395
|
+
this.$emit('focus', e)
|
|
396
|
+
},
|
|
397
|
+
handleBlur(e) {
|
|
398
|
+
this.isFocused = false
|
|
399
|
+
|
|
400
|
+
if (this.isNumberType) {
|
|
401
|
+
const num = this.parseToNumber(this.currentStr)
|
|
402
|
+
if (num !== undefined) {
|
|
403
|
+
let finalNum = num
|
|
404
|
+
if (this.precision > 0) {
|
|
405
|
+
finalNum = Number(num.toFixed(this.precision))
|
|
406
|
+
}
|
|
407
|
+
this.currentStr = String(finalNum)
|
|
408
|
+
this.$emit('input', finalNum)
|
|
409
|
+
this.$emit('blur', finalNum, e)
|
|
410
|
+
this.hasError = false
|
|
411
|
+
} else {
|
|
412
|
+
if (this.currentStr !== '') {
|
|
413
|
+
this.currentStr = ''
|
|
414
|
+
this.$emit('input', undefined)
|
|
415
|
+
}
|
|
416
|
+
this.$emit('blur', undefined, e)
|
|
417
|
+
this.hasError = false
|
|
418
|
+
}
|
|
419
|
+
} else {
|
|
420
|
+
if (this.type === 'email') {
|
|
421
|
+
if (!this.isValidEmail(this.value)) {
|
|
422
|
+
this.hasError = true
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
this.$emit('blur', e)
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
handleClear() {
|
|
429
|
+
if (this.isNumberType) {
|
|
430
|
+
this.currentStr = ''
|
|
431
|
+
}
|
|
432
|
+
this.hasError = false
|
|
433
|
+
this.$emit('input', this.isNumberType ? undefined : '')
|
|
434
|
+
this.$emit('clear')
|
|
435
|
+
},
|
|
436
|
+
reset() {
|
|
437
|
+
this.currentStr = ''
|
|
438
|
+
this.hasError = false
|
|
439
|
+
this.$emit('input', this.isNumberType ? undefined : '')
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// CONCATENATED MODULE: ./src/components/xt-input/index.vue?vue&type=script&lang=js
|
|
445
|
+
/* harmony default export */ var components_xt_inputvue_type_script_lang_js = (xt_inputvue_type_script_lang_js);
|
|
446
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
447
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
448
|
+
|
|
449
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
450
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
451
|
+
// be included in the final webpack user bundle.
|
|
452
|
+
|
|
453
|
+
function normalizeComponent(
|
|
454
|
+
scriptExports,
|
|
455
|
+
render,
|
|
456
|
+
staticRenderFns,
|
|
457
|
+
functionalTemplate,
|
|
458
|
+
injectStyles,
|
|
459
|
+
scopeId,
|
|
460
|
+
moduleIdentifier /* server only */,
|
|
461
|
+
shadowMode /* vue-cli only */
|
|
462
|
+
) {
|
|
463
|
+
// Vue.extend constructor export interop
|
|
464
|
+
var options =
|
|
465
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
466
|
+
|
|
467
|
+
// render functions
|
|
468
|
+
if (render) {
|
|
469
|
+
options.render = render
|
|
470
|
+
options.staticRenderFns = staticRenderFns
|
|
471
|
+
options._compiled = true
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// functional template
|
|
475
|
+
if (functionalTemplate) {
|
|
476
|
+
options.functional = true
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// scopedId
|
|
480
|
+
if (scopeId) {
|
|
481
|
+
options._scopeId = 'data-v-' + scopeId
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
var hook
|
|
485
|
+
if (moduleIdentifier) {
|
|
486
|
+
// server build
|
|
487
|
+
hook = function (context) {
|
|
488
|
+
// 2.3 injection
|
|
489
|
+
context =
|
|
490
|
+
context || // cached call
|
|
491
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
492
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
493
|
+
// 2.2 with runInNewContext: true
|
|
494
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
495
|
+
context = __VUE_SSR_CONTEXT__
|
|
496
|
+
}
|
|
497
|
+
// inject component styles
|
|
498
|
+
if (injectStyles) {
|
|
499
|
+
injectStyles.call(this, context)
|
|
500
|
+
}
|
|
501
|
+
// register component module identifier for async chunk inferrence
|
|
502
|
+
if (context && context._registeredComponents) {
|
|
503
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// used by ssr in case component is cached and beforeCreate
|
|
507
|
+
// never gets called
|
|
508
|
+
options._ssrRegister = hook
|
|
509
|
+
} else if (injectStyles) {
|
|
510
|
+
hook = shadowMode
|
|
511
|
+
? function () {
|
|
512
|
+
injectStyles.call(
|
|
513
|
+
this,
|
|
514
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
515
|
+
)
|
|
516
|
+
}
|
|
517
|
+
: injectStyles
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (hook) {
|
|
521
|
+
if (options.functional) {
|
|
522
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
523
|
+
// go through the normalizer
|
|
524
|
+
options._injectStyles = hook
|
|
525
|
+
// register for functional component in vue file
|
|
526
|
+
var originalRender = options.render
|
|
527
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
528
|
+
hook.call(context)
|
|
529
|
+
return originalRender(h, context)
|
|
530
|
+
}
|
|
531
|
+
} else {
|
|
532
|
+
// inject component registration as beforeCreate hook
|
|
533
|
+
var existing = options.beforeCreate
|
|
534
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return {
|
|
539
|
+
exports: scriptExports,
|
|
540
|
+
options: options
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
// CONCATENATED MODULE: ./src/components/xt-input/index.vue
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
/* normalize component */
|
|
551
|
+
|
|
552
|
+
var component = normalizeComponent(
|
|
553
|
+
components_xt_inputvue_type_script_lang_js,
|
|
554
|
+
render,
|
|
555
|
+
staticRenderFns,
|
|
556
|
+
false,
|
|
557
|
+
null,
|
|
558
|
+
null,
|
|
559
|
+
null
|
|
560
|
+
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
/* harmony default export */ var xt_input = (component.exports);
|
|
564
|
+
// CONCATENATED MODULE: ./src/components/xt-input/index.js
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
xt_input.install = function (Vue) {
|
|
569
|
+
Vue.component(xt_input.name, xt_input)
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/* harmony default export */ var components_xt_input = (xt_input);
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_input);
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
/***/ })
|
|
583
|
+
|
|
584
|
+
/******/ });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xt-input{--xt-input-bg-color:var(--xt-fill-color-blank,#fff);--xt-input-text-color:var(--xt-text-color-regular,#606266);--xt-input-border-color:var(--xt-border-color,#dcdfe6);--xt-input-border-color-hover:var(--xt-border-color-dark,#c0c4cc);--xt-input-border-color-focus:var(--xt-color-primary,#1890ff);--xt-input-placeholder-color:var(--xt-text-color-placeholder,#c0c4cc);--xt-input-disabled-bg-color:var(--xt-fill-color-light,#f5f7fa);--xt-input-disabled-text-color:var(--xt-text-color-placeholder,#c0c4cc);--xt-input-disabled-border-color:var(--xt-border-color-light,#e4e7ed);--xt-input-focus-color:var(--xt-color-primary,#1890ff);--xt-input-border-radius:var(--xt-border-radius-small,4px);--xt-input-font-size:var(--xt-font-size-base,14px);--xt-input-height:32px;--xt-input-padding-x:15px}.xt-input--small{--xt-input-height:28px;--xt-input-font-size:var(--xt-font-size-small,12px);--xt-input-padding-x:10px}.xt-input--medium{--xt-input-height:32px;--xt-input-font-size:var(--xt-font-size-base,14px);--xt-input-padding-x:15px}.xt-input--large{--xt-input-height:40px;--xt-input-font-size:var(--xt-font-size-large,16px);--xt-input-padding-x:16px}.xt-input .el-input,.xt-input .el-input__inner{height:var(--xt-input-height)}.xt-input .el-input__inner{background-color:var(--xt-input-bg-color);border-color:var(--xt-input-border-color);color:var(--xt-input-text-color);font-size:var(--xt-input-font-size);border-radius:var(--xt-input-border-radius);line-height:var(--xt-input-height);padding:0 var(--xt-input-padding-x);transition:border-color var(--xt-transition-duration-fast,.2s) ease}.xt-input .el-input__inner::-moz-placeholder{color:var(--xt-input-placeholder-color)}.xt-input .el-input__inner::-ms-input-placeholder{color:var(--xt-input-placeholder-color)}.xt-input .el-input__inner::placeholder{color:var(--xt-input-placeholder-color)}.xt-input .el-input__inner:hover{border-color:var(--xt-input-border-color-hover)}.xt-input .el-input__inner:focus{border-color:var(--xt-input-border-color-focus);box-shadow:0 0 0 2px color-mix(in srgb,var(--xt-input-focus-color) 20%,transparent)}.xt-input.is-disabled .el-input__inner{background-color:var(--xt-input-disabled-bg-color);border-color:var(--xt-input-disabled-border-color);color:var(--xt-input-disabled-text-color);cursor:not-allowed}.xt-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--xt-input-disabled-text-color)}.xt-input.is-disabled .el-input__inner::-ms-input-placeholder{color:var(--xt-input-disabled-text-color)}.xt-input.is-disabled .el-input__inner::placeholder{color:var(--xt-input-disabled-text-color)}.xt-input.is-error .el-input__inner,.xt-input.is-error .el-input__inner:focus{border-color:var(--xt-color-danger,#f56c6c)}.xt-input.is-error .el-input__inner:focus{box-shadow:0 0 0 2px color-mix(in srgb,var(--xt-color-danger,#f56c6c) 20%,transparent)}
|