app模板、应用模板、组件模板、widget模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2903 lines
76 KiB

4 years ago
  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 = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 516);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 13:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/mixins/emitter");
  92. /***/ }),
  93. /***/ 2:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  97. /* globals __VUE_SSR_CONTEXT__ */
  98. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  99. // This module is a runtime utility for cleaner component module output and will
  100. // be included in the final webpack user bundle.
  101. function normalizeComponent (
  102. scriptExports,
  103. render,
  104. staticRenderFns,
  105. functionalTemplate,
  106. injectStyles,
  107. scopeId,
  108. moduleIdentifier, /* server only */
  109. shadowMode /* vue-cli only */
  110. ) {
  111. // Vue.extend constructor export interop
  112. var options = typeof scriptExports === 'function'
  113. ? scriptExports.options
  114. : scriptExports
  115. // render functions
  116. if (render) {
  117. options.render = render
  118. options.staticRenderFns = staticRenderFns
  119. options._compiled = true
  120. }
  121. // functional template
  122. if (functionalTemplate) {
  123. options.functional = true
  124. }
  125. // scopedId
  126. if (scopeId) {
  127. options._scopeId = 'data-v-' + scopeId
  128. }
  129. var hook
  130. if (moduleIdentifier) { // server build
  131. hook = function (context) {
  132. // 2.3 injection
  133. context =
  134. context || // cached call
  135. (this.$vnode && this.$vnode.ssrContext) || // stateful
  136. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  137. // 2.2 with runInNewContext: true
  138. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  139. context = __VUE_SSR_CONTEXT__
  140. }
  141. // inject component styles
  142. if (injectStyles) {
  143. injectStyles.call(this, context)
  144. }
  145. // register component module identifier for async chunk inferrence
  146. if (context && context._registeredComponents) {
  147. context._registeredComponents.add(moduleIdentifier)
  148. }
  149. }
  150. // used by ssr in case component is cached and beforeCreate
  151. // never gets called
  152. options._ssrRegister = hook
  153. } else if (injectStyles) {
  154. hook = shadowMode
  155. ? function () {
  156. injectStyles.call(
  157. this,
  158. (options.functional ? this.parent : this).$root.$options.shadowRoot
  159. )
  160. }
  161. : injectStyles
  162. }
  163. if (hook) {
  164. if (options.functional) {
  165. // for template-only hot-reload because in that case the render fn doesn't
  166. // go through the normalizer
  167. options._injectStyles = hook
  168. // register for functional component in vue file
  169. var originalRender = options.render
  170. options.render = function renderWithStyleInjection (h, context) {
  171. hook.call(context)
  172. return originalRender(h, context)
  173. }
  174. } else {
  175. // inject component registration as beforeCreate hook
  176. var existing = options.beforeCreate
  177. options.beforeCreate = existing
  178. ? [].concat(existing, hook)
  179. : [hook]
  180. }
  181. }
  182. return {
  183. exports: scriptExports,
  184. options: options
  185. }
  186. }
  187. /***/ }),
  188. /***/ 33:
  189. /***/ (function(module, exports) {
  190. module.exports = require("tis-ui/lib/utils/merge");
  191. /***/ }),
  192. /***/ 34:
  193. /***/ (function(module, exports) {
  194. module.exports = require("tis-ui/lib/utils/vue-popper");
  195. /***/ }),
  196. /***/ 36:
  197. /***/ (function(module, exports) {
  198. module.exports = require("tis-ui/lib/mixins/migrating");
  199. /***/ }),
  200. /***/ 38:
  201. /***/ (function(module, exports) {
  202. module.exports = require("tis-ui/lib/mixins/locale");
  203. /***/ }),
  204. /***/ 4:
  205. /***/ (function(module, exports) {
  206. module.exports = require("vue");
  207. /***/ }),
  208. /***/ 49:
  209. /***/ (function(module, exports) {
  210. module.exports = require("tis-ui/lib/utils/shared");
  211. /***/ }),
  212. /***/ 516:
  213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  214. "use strict";
  215. // ESM COMPAT FLAG
  216. __webpack_require__.r(__webpack_exports__);
  217. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  218. var render = function() {
  219. var _vm = this
  220. var _h = _vm.$createElement
  221. var _c = _vm._self._c || _h
  222. return _c(
  223. "div",
  224. {
  225. directives: [
  226. {
  227. name: "clickoutside",
  228. rawName: "v-clickoutside",
  229. value: _vm.hide,
  230. expression: "hide"
  231. }
  232. ],
  233. class: [
  234. "el-color-picker",
  235. _vm.colorDisabled ? "is-disabled" : "",
  236. _vm.colorSize ? "el-color-picker--" + _vm.colorSize : ""
  237. ]
  238. },
  239. [
  240. _vm.colorDisabled
  241. ? _c("div", { staticClass: "el-color-picker__mask" })
  242. : _vm._e(),
  243. _c(
  244. "div",
  245. {
  246. staticClass: "el-color-picker__trigger",
  247. on: { click: _vm.handleTrigger }
  248. },
  249. [
  250. _c(
  251. "span",
  252. {
  253. staticClass: "el-color-picker__color",
  254. class: { "is-alpha": _vm.showAlpha }
  255. },
  256. [
  257. _c("span", {
  258. staticClass: "el-color-picker__color-inner",
  259. style: {
  260. backgroundColor: _vm.displayedColor
  261. }
  262. }),
  263. !_vm.value && !_vm.showPanelColor
  264. ? _c("span", {
  265. staticClass: "el-color-picker__empty el-icon-close"
  266. })
  267. : _vm._e()
  268. ]
  269. ),
  270. _c("span", {
  271. directives: [
  272. {
  273. name: "show",
  274. rawName: "v-show",
  275. value: _vm.value || _vm.showPanelColor,
  276. expression: "value || showPanelColor"
  277. }
  278. ],
  279. staticClass: "el-color-picker__icon el-icon-arrow-down"
  280. })
  281. ]
  282. ),
  283. _c("picker-dropdown", {
  284. ref: "dropdown",
  285. class: ["el-color-picker__panel", _vm.popperClass || ""],
  286. attrs: {
  287. color: _vm.color,
  288. "show-alpha": _vm.showAlpha,
  289. predefine: _vm.predefine
  290. },
  291. on: { pick: _vm.confirmValue, clear: _vm.clearValue },
  292. model: {
  293. value: _vm.showPicker,
  294. callback: function($$v) {
  295. _vm.showPicker = $$v
  296. },
  297. expression: "showPicker"
  298. }
  299. })
  300. ],
  301. 1
  302. )
  303. }
  304. var staticRenderFns = []
  305. render._withStripped = true
  306. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  307. // CONCATENATED MODULE: ./packages/color-picker/src/color.js
  308. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  309. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  310. var hsv2hsl = function hsv2hsl(hue, sat, val) {
  311. return [hue, sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0, hue / 2];
  312. };
  313. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  314. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  315. var isOnePointZero = function isOnePointZero(n) {
  316. return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
  317. };
  318. var isPercentage = function isPercentage(n) {
  319. return typeof n === 'string' && n.indexOf('%') !== -1;
  320. };
  321. // Take input from [0, n] and return it as [0, 1]
  322. var bound01 = function bound01(value, max) {
  323. if (isOnePointZero(value)) value = '100%';
  324. var processPercent = isPercentage(value);
  325. value = Math.min(max, Math.max(0, parseFloat(value)));
  326. // Automatically convert percentage into number
  327. if (processPercent) {
  328. value = parseInt(value * max, 10) / 100;
  329. }
  330. // Handle floating point rounding errors
  331. if (Math.abs(value - max) < 0.000001) {
  332. return 1;
  333. }
  334. // Convert into [0, 1] range if it isn't already
  335. return value % max / parseFloat(max);
  336. };
  337. var INT_HEX_MAP = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' };
  338. var toHex = function toHex(_ref) {
  339. var r = _ref.r,
  340. g = _ref.g,
  341. b = _ref.b;
  342. var hexOne = function hexOne(value) {
  343. value = Math.min(Math.round(value), 255);
  344. var high = Math.floor(value / 16);
  345. var low = value % 16;
  346. return '' + (INT_HEX_MAP[high] || high) + (INT_HEX_MAP[low] || low);
  347. };
  348. if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
  349. return '#' + hexOne(r) + hexOne(g) + hexOne(b);
  350. };
  351. var HEX_INT_MAP = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 };
  352. var parseHexChannel = function parseHexChannel(hex) {
  353. if (hex.length === 2) {
  354. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  355. }
  356. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  357. };
  358. var hsl2hsv = function hsl2hsv(hue, sat, light) {
  359. sat = sat / 100;
  360. light = light / 100;
  361. var smin = sat;
  362. var lmin = Math.max(light, 0.01);
  363. var sv = void 0;
  364. var v = void 0;
  365. light *= 2;
  366. sat *= light <= 1 ? light : 2 - light;
  367. smin *= lmin <= 1 ? lmin : 2 - lmin;
  368. v = (light + sat) / 2;
  369. sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  370. return {
  371. h: hue,
  372. s: sv * 100,
  373. v: v * 100
  374. };
  375. };
  376. // `rgbToHsv`
  377. // Converts an RGB color value to HSV
  378. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  379. // *Returns:* { h, s, v } in [0,1]
  380. var rgb2hsv = function rgb2hsv(r, g, b) {
  381. r = bound01(r, 255);
  382. g = bound01(g, 255);
  383. b = bound01(b, 255);
  384. var max = Math.max(r, g, b);
  385. var min = Math.min(r, g, b);
  386. var h = void 0,
  387. s = void 0;
  388. var v = max;
  389. var d = max - min;
  390. s = max === 0 ? 0 : d / max;
  391. if (max === min) {
  392. h = 0; // achromatic
  393. } else {
  394. switch (max) {
  395. case r:
  396. h = (g - b) / d + (g < b ? 6 : 0);
  397. break;
  398. case g:
  399. h = (b - r) / d + 2;
  400. break;
  401. case b:
  402. h = (r - g) / d + 4;
  403. break;
  404. }
  405. h /= 6;
  406. }
  407. return { h: h * 360, s: s * 100, v: v * 100 };
  408. };
  409. // `hsvToRgb`
  410. // Converts an HSV color value to RGB.
  411. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  412. // *Returns:* { r, g, b } in the set [0, 255]
  413. var hsv2rgb = function hsv2rgb(h, s, v) {
  414. h = bound01(h, 360) * 6;
  415. s = bound01(s, 100);
  416. v = bound01(v, 100);
  417. var i = Math.floor(h);
  418. var f = h - i;
  419. var p = v * (1 - s);
  420. var q = v * (1 - f * s);
  421. var t = v * (1 - (1 - f) * s);
  422. var mod = i % 6;
  423. var r = [v, q, p, p, t, v][mod];
  424. var g = [t, v, v, q, p, p][mod];
  425. var b = [p, p, t, v, v, q][mod];
  426. return {
  427. r: Math.round(r * 255),
  428. g: Math.round(g * 255),
  429. b: Math.round(b * 255)
  430. };
  431. };
  432. var Color = function () {
  433. function Color(options) {
  434. _classCallCheck(this, Color);
  435. this._hue = 0;
  436. this._saturation = 100;
  437. this._value = 100;
  438. this._alpha = 100;
  439. this.enableAlpha = false;
  440. this.format = 'hex';
  441. this.value = '';
  442. options = options || {};
  443. for (var option in options) {
  444. if (options.hasOwnProperty(option)) {
  445. this[option] = options[option];
  446. }
  447. }
  448. this.doOnChange();
  449. }
  450. Color.prototype.set = function set(prop, value) {
  451. if (arguments.length === 1 && (typeof prop === 'undefined' ? 'undefined' : _typeof(prop)) === 'object') {
  452. for (var p in prop) {
  453. if (prop.hasOwnProperty(p)) {
  454. this.set(p, prop[p]);
  455. }
  456. }
  457. return;
  458. }
  459. this['_' + prop] = value;
  460. this.doOnChange();
  461. };
  462. Color.prototype.get = function get(prop) {
  463. return this['_' + prop];
  464. };
  465. Color.prototype.toRgb = function toRgb() {
  466. return hsv2rgb(this._hue, this._saturation, this._value);
  467. };
  468. Color.prototype.fromString = function fromString(value) {
  469. var _this = this;
  470. if (!value) {
  471. this._hue = 0;
  472. this._saturation = 100;
  473. this._value = 100;
  474. this.doOnChange();
  475. return;
  476. }
  477. var fromHSV = function fromHSV(h, s, v) {
  478. _this._hue = Math.max(0, Math.min(360, h));
  479. _this._saturation = Math.max(0, Math.min(100, s));
  480. _this._value = Math.max(0, Math.min(100, v));
  481. _this.doOnChange();
  482. };
  483. if (value.indexOf('hsl') !== -1) {
  484. var parts = value.replace(/hsla|hsl|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  485. return val !== '';
  486. }).map(function (val, index) {
  487. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  488. });
  489. if (parts.length === 4) {
  490. this._alpha = Math.floor(parseFloat(parts[3]) * 100);
  491. } else if (parts.length === 3) {
  492. this._alpha = 100;
  493. }
  494. if (parts.length >= 3) {
  495. var _hsl2hsv = hsl2hsv(parts[0], parts[1], parts[2]),
  496. h = _hsl2hsv.h,
  497. s = _hsl2hsv.s,
  498. v = _hsl2hsv.v;
  499. fromHSV(h, s, v);
  500. }
  501. } else if (value.indexOf('hsv') !== -1) {
  502. var _parts = value.replace(/hsva|hsv|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  503. return val !== '';
  504. }).map(function (val, index) {
  505. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  506. });
  507. if (_parts.length === 4) {
  508. this._alpha = Math.floor(parseFloat(_parts[3]) * 100);
  509. } else if (_parts.length === 3) {
  510. this._alpha = 100;
  511. }
  512. if (_parts.length >= 3) {
  513. fromHSV(_parts[0], _parts[1], _parts[2]);
  514. }
  515. } else if (value.indexOf('rgb') !== -1) {
  516. var _parts2 = value.replace(/rgba|rgb|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  517. return val !== '';
  518. }).map(function (val, index) {
  519. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  520. });
  521. if (_parts2.length === 4) {
  522. this._alpha = Math.floor(parseFloat(_parts2[3]) * 100);
  523. } else if (_parts2.length === 3) {
  524. this._alpha = 100;
  525. }
  526. if (_parts2.length >= 3) {
  527. var _rgb2hsv = rgb2hsv(_parts2[0], _parts2[1], _parts2[2]),
  528. _h = _rgb2hsv.h,
  529. _s = _rgb2hsv.s,
  530. _v = _rgb2hsv.v;
  531. fromHSV(_h, _s, _v);
  532. }
  533. } else if (value.indexOf('#') !== -1) {
  534. var hex = value.replace('#', '').trim();
  535. if (!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(hex)) return;
  536. var r = void 0,
  537. g = void 0,
  538. b = void 0;
  539. if (hex.length === 3) {
  540. r = parseHexChannel(hex[0] + hex[0]);
  541. g = parseHexChannel(hex[1] + hex[1]);
  542. b = parseHexChannel(hex[2] + hex[2]);
  543. } else if (hex.length === 6 || hex.length === 8) {
  544. r = parseHexChannel(hex.substring(0, 2));
  545. g = parseHexChannel(hex.substring(2, 4));
  546. b = parseHexChannel(hex.substring(4, 6));
  547. }
  548. if (hex.length === 8) {
  549. this._alpha = Math.floor(parseHexChannel(hex.substring(6)) / 255 * 100);
  550. } else if (hex.length === 3 || hex.length === 6) {
  551. this._alpha = 100;
  552. }
  553. var _rgb2hsv2 = rgb2hsv(r, g, b),
  554. _h2 = _rgb2hsv2.h,
  555. _s2 = _rgb2hsv2.s,
  556. _v2 = _rgb2hsv2.v;
  557. fromHSV(_h2, _s2, _v2);
  558. }
  559. };
  560. Color.prototype.compare = function compare(color) {
  561. return Math.abs(color._hue - this._hue) < 2 && Math.abs(color._saturation - this._saturation) < 1 && Math.abs(color._value - this._value) < 1 && Math.abs(color._alpha - this._alpha) < 1;
  562. };
  563. Color.prototype.doOnChange = function doOnChange() {
  564. var _hue = this._hue,
  565. _saturation = this._saturation,
  566. _value = this._value,
  567. _alpha = this._alpha,
  568. format = this.format;
  569. if (this.enableAlpha) {
  570. switch (format) {
  571. case 'hsl':
  572. var hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  573. this.value = 'hsla(' + _hue + ', ' + Math.round(hsl[1] * 100) + '%, ' + Math.round(hsl[2] * 100) + '%, ' + _alpha / 100 + ')';
  574. break;
  575. case 'hsv':
  576. this.value = 'hsva(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%, ' + _alpha / 100 + ')';
  577. break;
  578. default:
  579. var _hsv2rgb = hsv2rgb(_hue, _saturation, _value),
  580. r = _hsv2rgb.r,
  581. g = _hsv2rgb.g,
  582. b = _hsv2rgb.b;
  583. this.value = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + _alpha / 100 + ')';
  584. }
  585. } else {
  586. switch (format) {
  587. case 'hsl':
  588. var _hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  589. this.value = 'hsl(' + _hue + ', ' + Math.round(_hsl[1] * 100) + '%, ' + Math.round(_hsl[2] * 100) + '%)';
  590. break;
  591. case 'hsv':
  592. this.value = 'hsv(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%)';
  593. break;
  594. case 'rgb':
  595. var _hsv2rgb2 = hsv2rgb(_hue, _saturation, _value),
  596. _r = _hsv2rgb2.r,
  597. _g = _hsv2rgb2.g,
  598. _b = _hsv2rgb2.b;
  599. this.value = 'rgb(' + _r + ', ' + _g + ', ' + _b + ')';
  600. break;
  601. default:
  602. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  603. }
  604. }
  605. };
  606. return Color;
  607. }();
  608. /* harmony default export */ var src_color = (Color);
  609. ;
  610. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  611. var picker_dropdownvue_type_template_id_06601625_render = function() {
  612. var _vm = this
  613. var _h = _vm.$createElement
  614. var _c = _vm._self._c || _h
  615. return _c(
  616. "transition",
  617. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  618. [
  619. _c(
  620. "div",
  621. {
  622. directives: [
  623. {
  624. name: "show",
  625. rawName: "v-show",
  626. value: _vm.showPopper,
  627. expression: "showPopper"
  628. }
  629. ],
  630. staticClass: "el-color-dropdown"
  631. },
  632. [
  633. _c(
  634. "div",
  635. { staticClass: "el-color-dropdown__main-wrapper" },
  636. [
  637. _c("hue-slider", {
  638. ref: "hue",
  639. staticStyle: { float: "right" },
  640. attrs: { color: _vm.color, vertical: "" }
  641. }),
  642. _c("sv-panel", { ref: "sl", attrs: { color: _vm.color } })
  643. ],
  644. 1
  645. ),
  646. _vm.showAlpha
  647. ? _c("alpha-slider", { ref: "alpha", attrs: { color: _vm.color } })
  648. : _vm._e(),
  649. _vm.predefine
  650. ? _c("predefine", {
  651. attrs: { color: _vm.color, colors: _vm.predefine }
  652. })
  653. : _vm._e(),
  654. _c(
  655. "div",
  656. { staticClass: "el-color-dropdown__btns" },
  657. [
  658. _c(
  659. "span",
  660. { staticClass: "el-color-dropdown__value" },
  661. [
  662. _c("tis-input", {
  663. attrs: { "validate-event": false, size: "mini" },
  664. on: { blur: _vm.handleConfirm },
  665. nativeOn: {
  666. keyup: function($event) {
  667. if (
  668. !("button" in $event) &&
  669. _vm._k(
  670. $event.keyCode,
  671. "enter",
  672. 13,
  673. $event.key,
  674. "Enter"
  675. )
  676. ) {
  677. return null
  678. }
  679. return _vm.handleConfirm($event)
  680. }
  681. },
  682. model: {
  683. value: _vm.customInput,
  684. callback: function($$v) {
  685. _vm.customInput = $$v
  686. },
  687. expression: "customInput"
  688. }
  689. })
  690. ],
  691. 1
  692. ),
  693. _c(
  694. "tis-button",
  695. {
  696. staticClass: "el-color-dropdown__link-btn",
  697. attrs: { size: "mini", type: "text" },
  698. on: {
  699. click: function($event) {
  700. _vm.$emit("clear")
  701. }
  702. }
  703. },
  704. [
  705. _vm._v(
  706. "\n " +
  707. _vm._s(_vm.t("el.colorpicker.clear")) +
  708. "\n "
  709. )
  710. ]
  711. ),
  712. _c(
  713. "tis-button",
  714. {
  715. staticClass: "el-color-dropdown__btn",
  716. attrs: { plain: "", size: "mini" },
  717. on: { click: _vm.confirmValue }
  718. },
  719. [
  720. _vm._v(
  721. "\n " +
  722. _vm._s(_vm.t("el.colorpicker.confirm")) +
  723. "\n "
  724. )
  725. ]
  726. )
  727. ],
  728. 1
  729. )
  730. ],
  731. 1
  732. )
  733. ]
  734. )
  735. }
  736. var picker_dropdownvue_type_template_id_06601625_staticRenderFns = []
  737. picker_dropdownvue_type_template_id_06601625_render._withStripped = true
  738. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  739. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  740. var sv_panelvue_type_template_id_d8583596_render = function() {
  741. var _vm = this
  742. var _h = _vm.$createElement
  743. var _c = _vm._self._c || _h
  744. return _c(
  745. "div",
  746. {
  747. staticClass: "el-color-svpanel",
  748. style: {
  749. backgroundColor: _vm.background
  750. }
  751. },
  752. [
  753. _c("div", { staticClass: "el-color-svpanel__white" }),
  754. _c("div", { staticClass: "el-color-svpanel__black" }),
  755. _c(
  756. "div",
  757. {
  758. staticClass: "el-color-svpanel__cursor",
  759. style: {
  760. top: _vm.cursorTop + "px",
  761. left: _vm.cursorLeft + "px"
  762. }
  763. },
  764. [_c("div")]
  765. )
  766. ]
  767. )
  768. }
  769. var sv_panelvue_type_template_id_d8583596_staticRenderFns = []
  770. sv_panelvue_type_template_id_d8583596_render._withStripped = true
  771. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  772. // EXTERNAL MODULE: external "vue"
  773. var external_vue_ = __webpack_require__(4);
  774. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  775. // CONCATENATED MODULE: ./packages/color-picker/src/draggable.js
  776. var isDragging = false;
  777. /* harmony default export */ var draggable = (function (element, options) {
  778. if (external_vue_default.a.prototype.$isServer) return;
  779. var moveFn = function moveFn(event) {
  780. if (options.drag) {
  781. options.drag(event);
  782. }
  783. };
  784. var upFn = function upFn(event) {
  785. document.removeEventListener('mousemove', moveFn);
  786. document.removeEventListener('mouseup', upFn);
  787. document.onselectstart = null;
  788. document.ondragstart = null;
  789. isDragging = false;
  790. if (options.end) {
  791. options.end(event);
  792. }
  793. };
  794. element.addEventListener('mousedown', function (event) {
  795. if (isDragging) return;
  796. document.onselectstart = function () {
  797. return false;
  798. };
  799. document.ondragstart = function () {
  800. return false;
  801. };
  802. document.addEventListener('mousemove', moveFn);
  803. document.addEventListener('mouseup', upFn);
  804. isDragging = true;
  805. if (options.start) {
  806. options.start(event);
  807. }
  808. });
  809. });
  810. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  811. //
  812. //
  813. //
  814. //
  815. //
  816. //
  817. //
  818. //
  819. //
  820. //
  821. //
  822. //
  823. //
  824. //
  825. //
  826. //
  827. //
  828. /* harmony default export */ var sv_panelvue_type_script_lang_js_ = ({
  829. name: 'el-sl-panel',
  830. props: {
  831. color: {
  832. required: true
  833. }
  834. },
  835. computed: {
  836. colorValue: function colorValue() {
  837. var hue = this.color.get('hue');
  838. var value = this.color.get('value');
  839. return { hue: hue, value: value };
  840. }
  841. },
  842. watch: {
  843. colorValue: function colorValue() {
  844. this.update();
  845. }
  846. },
  847. methods: {
  848. update: function update() {
  849. var saturation = this.color.get('saturation');
  850. var value = this.color.get('value');
  851. var el = this.$el;
  852. var width = el.clientWidth,
  853. height = el.clientHeight;
  854. this.cursorLeft = saturation * width / 100;
  855. this.cursorTop = (100 - value) * height / 100;
  856. this.background = 'hsl(' + this.color.get('hue') + ', 100%, 50%)';
  857. },
  858. handleDrag: function handleDrag(event) {
  859. var el = this.$el;
  860. var rect = el.getBoundingClientRect();
  861. var left = event.clientX - rect.left;
  862. var top = event.clientY - rect.top;
  863. left = Math.max(0, left);
  864. left = Math.min(left, rect.width);
  865. top = Math.max(0, top);
  866. top = Math.min(top, rect.height);
  867. this.cursorLeft = left;
  868. this.cursorTop = top;
  869. this.color.set({
  870. saturation: left / rect.width * 100,
  871. value: 100 - top / rect.height * 100
  872. });
  873. }
  874. },
  875. mounted: function mounted() {
  876. var _this = this;
  877. draggable(this.$el, {
  878. drag: function drag(event) {
  879. _this.handleDrag(event);
  880. },
  881. end: function end(event) {
  882. _this.handleDrag(event);
  883. }
  884. });
  885. this.update();
  886. },
  887. data: function data() {
  888. return {
  889. cursorTop: 0,
  890. cursorLeft: 0,
  891. background: 'hsl(0, 100%, 50%)'
  892. };
  893. }
  894. });
  895. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  896. /* harmony default export */ var components_sv_panelvue_type_script_lang_js_ = (sv_panelvue_type_script_lang_js_);
  897. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  898. var componentNormalizer = __webpack_require__(2);
  899. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue
  900. /* normalize component */
  901. var component = Object(componentNormalizer["a" /* default */])(
  902. components_sv_panelvue_type_script_lang_js_,
  903. sv_panelvue_type_template_id_d8583596_render,
  904. sv_panelvue_type_template_id_d8583596_staticRenderFns,
  905. false,
  906. null,
  907. null,
  908. null
  909. )
  910. /* hot reload */
  911. if (false) { var api; }
  912. component.options.__file = "packages/color-picker/src/components/sv-panel.vue"
  913. /* harmony default export */ var sv_panel = (component.exports);
  914. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  915. var hue_slidervue_type_template_id_5cdc43b1_render = function() {
  916. var _vm = this
  917. var _h = _vm.$createElement
  918. var _c = _vm._self._c || _h
  919. return _c(
  920. "div",
  921. {
  922. staticClass: "el-color-hue-slider",
  923. class: { "is-vertical": _vm.vertical }
  924. },
  925. [
  926. _c("div", {
  927. ref: "bar",
  928. staticClass: "el-color-hue-slider__bar",
  929. on: { click: _vm.handleClick }
  930. }),
  931. _c("div", {
  932. ref: "thumb",
  933. staticClass: "el-color-hue-slider__thumb",
  934. style: {
  935. left: _vm.thumbLeft + "px",
  936. top: _vm.thumbTop + "px"
  937. }
  938. })
  939. ]
  940. )
  941. }
  942. var hue_slidervue_type_template_id_5cdc43b1_staticRenderFns = []
  943. hue_slidervue_type_template_id_5cdc43b1_render._withStripped = true
  944. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  945. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  946. //
  947. //
  948. //
  949. //
  950. //
  951. //
  952. //
  953. //
  954. //
  955. //
  956. //
  957. //
  958. //
  959. /* harmony default export */ var hue_slidervue_type_script_lang_js_ = ({
  960. name: 'el-color-hue-slider',
  961. props: {
  962. color: {
  963. required: true
  964. },
  965. vertical: Boolean
  966. },
  967. data: function data() {
  968. return {
  969. thumbLeft: 0,
  970. thumbTop: 0
  971. };
  972. },
  973. computed: {
  974. hueValue: function hueValue() {
  975. var hue = this.color.get('hue');
  976. return hue;
  977. }
  978. },
  979. watch: {
  980. hueValue: function hueValue() {
  981. this.update();
  982. }
  983. },
  984. methods: {
  985. handleClick: function handleClick(event) {
  986. var thumb = this.$refs.thumb;
  987. var target = event.target;
  988. if (target !== thumb) {
  989. this.handleDrag(event);
  990. }
  991. },
  992. handleDrag: function handleDrag(event) {
  993. var rect = this.$el.getBoundingClientRect();
  994. var thumb = this.$refs.thumb;
  995. var hue = void 0;
  996. if (!this.vertical) {
  997. var left = event.clientX - rect.left;
  998. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  999. left = Math.max(thumb.offsetWidth / 2, left);
  1000. hue = Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 360);
  1001. } else {
  1002. var top = event.clientY - rect.top;
  1003. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  1004. top = Math.max(thumb.offsetHeight / 2, top);
  1005. hue = Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 360);
  1006. }
  1007. this.color.set('hue', hue);
  1008. },
  1009. getThumbLeft: function getThumbLeft() {
  1010. if (this.vertical) return 0;
  1011. var el = this.$el;
  1012. var hue = this.color.get('hue');
  1013. if (!el) return 0;
  1014. var thumb = this.$refs.thumb;
  1015. return Math.round(hue * (el.offsetWidth - thumb.offsetWidth / 2) / 360);
  1016. },
  1017. getThumbTop: function getThumbTop() {
  1018. if (!this.vertical) return 0;
  1019. var el = this.$el;
  1020. var hue = this.color.get('hue');
  1021. if (!el) return 0;
  1022. var thumb = this.$refs.thumb;
  1023. return Math.round(hue * (el.offsetHeight - thumb.offsetHeight / 2) / 360);
  1024. },
  1025. update: function update() {
  1026. this.thumbLeft = this.getThumbLeft();
  1027. this.thumbTop = this.getThumbTop();
  1028. }
  1029. },
  1030. mounted: function mounted() {
  1031. var _this = this;
  1032. var _$refs = this.$refs,
  1033. bar = _$refs.bar,
  1034. thumb = _$refs.thumb;
  1035. var dragConfig = {
  1036. drag: function drag(event) {
  1037. _this.handleDrag(event);
  1038. },
  1039. end: function end(event) {
  1040. _this.handleDrag(event);
  1041. }
  1042. };
  1043. draggable(bar, dragConfig);
  1044. draggable(thumb, dragConfig);
  1045. this.update();
  1046. }
  1047. });
  1048. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  1049. /* harmony default export */ var components_hue_slidervue_type_script_lang_js_ = (hue_slidervue_type_script_lang_js_);
  1050. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue
  1051. /* normalize component */
  1052. var hue_slider_component = Object(componentNormalizer["a" /* default */])(
  1053. components_hue_slidervue_type_script_lang_js_,
  1054. hue_slidervue_type_template_id_5cdc43b1_render,
  1055. hue_slidervue_type_template_id_5cdc43b1_staticRenderFns,
  1056. false,
  1057. null,
  1058. null,
  1059. null
  1060. )
  1061. /* hot reload */
  1062. if (false) { var hue_slider_api; }
  1063. hue_slider_component.options.__file = "packages/color-picker/src/components/hue-slider.vue"
  1064. /* harmony default export */ var hue_slider = (hue_slider_component.exports);
  1065. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  1066. var alpha_slidervue_type_template_id_068c66cb_render = function() {
  1067. var _vm = this
  1068. var _h = _vm.$createElement
  1069. var _c = _vm._self._c || _h
  1070. return _c(
  1071. "div",
  1072. {
  1073. staticClass: "el-color-alpha-slider",
  1074. class: { "is-vertical": _vm.vertical }
  1075. },
  1076. [
  1077. _c("div", {
  1078. ref: "bar",
  1079. staticClass: "el-color-alpha-slider__bar",
  1080. style: {
  1081. background: _vm.background
  1082. },
  1083. on: { click: _vm.handleClick }
  1084. }),
  1085. _c("div", {
  1086. ref: "thumb",
  1087. staticClass: "el-color-alpha-slider__thumb",
  1088. style: {
  1089. left: _vm.thumbLeft + "px",
  1090. top: _vm.thumbTop + "px"
  1091. }
  1092. })
  1093. ]
  1094. )
  1095. }
  1096. var alpha_slidervue_type_template_id_068c66cb_staticRenderFns = []
  1097. alpha_slidervue_type_template_id_068c66cb_render._withStripped = true
  1098. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  1099. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  1100. //
  1101. //
  1102. //
  1103. //
  1104. //
  1105. //
  1106. //
  1107. //
  1108. //
  1109. //
  1110. //
  1111. //
  1112. //
  1113. //
  1114. //
  1115. //
  1116. //
  1117. //
  1118. //
  1119. /* harmony default export */ var alpha_slidervue_type_script_lang_js_ = ({
  1120. name: 'el-color-alpha-slider',
  1121. props: {
  1122. color: {
  1123. required: true
  1124. },
  1125. vertical: Boolean
  1126. },
  1127. watch: {
  1128. 'color._alpha': function color_alpha() {
  1129. this.update();
  1130. },
  1131. 'color.value': function colorValue() {
  1132. this.update();
  1133. }
  1134. },
  1135. methods: {
  1136. handleClick: function handleClick(event) {
  1137. var thumb = this.$refs.thumb;
  1138. var target = event.target;
  1139. if (target !== thumb) {
  1140. this.handleDrag(event);
  1141. }
  1142. },
  1143. handleDrag: function handleDrag(event) {
  1144. var rect = this.$el.getBoundingClientRect();
  1145. var thumb = this.$refs.thumb;
  1146. if (!this.vertical) {
  1147. var left = event.clientX - rect.left;
  1148. left = Math.max(thumb.offsetWidth / 2, left);
  1149. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  1150. this.color.set('alpha', Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 100));
  1151. } else {
  1152. var top = event.clientY - rect.top;
  1153. top = Math.max(thumb.offsetHeight / 2, top);
  1154. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  1155. this.color.set('alpha', Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 100));
  1156. }
  1157. },
  1158. getThumbLeft: function getThumbLeft() {
  1159. if (this.vertical) return 0;
  1160. var el = this.$el;
  1161. var alpha = this.color._alpha;
  1162. if (!el) return 0;
  1163. var thumb = this.$refs.thumb;
  1164. return Math.round(alpha * (el.offsetWidth - thumb.offsetWidth / 2) / 100);
  1165. },
  1166. getThumbTop: function getThumbTop() {
  1167. if (!this.vertical) return 0;
  1168. var el = this.$el;
  1169. var alpha = this.color._alpha;
  1170. if (!el) return 0;
  1171. var thumb = this.$refs.thumb;
  1172. return Math.round(alpha * (el.offsetHeight - thumb.offsetHeight / 2) / 100);
  1173. },
  1174. getBackground: function getBackground() {
  1175. if (this.color && this.color.value) {
  1176. var _color$toRgb = this.color.toRgb(),
  1177. r = _color$toRgb.r,
  1178. g = _color$toRgb.g,
  1179. b = _color$toRgb.b;
  1180. return 'linear-gradient(to right, rgba(' + r + ', ' + g + ', ' + b + ', 0) 0%, rgba(' + r + ', ' + g + ', ' + b + ', 1) 100%)';
  1181. }
  1182. return null;
  1183. },
  1184. update: function update() {
  1185. this.thumbLeft = this.getThumbLeft();
  1186. this.thumbTop = this.getThumbTop();
  1187. this.background = this.getBackground();
  1188. }
  1189. },
  1190. data: function data() {
  1191. return {
  1192. thumbLeft: 0,
  1193. thumbTop: 0,
  1194. background: null
  1195. };
  1196. },
  1197. mounted: function mounted() {
  1198. var _this = this;
  1199. var _$refs = this.$refs,
  1200. bar = _$refs.bar,
  1201. thumb = _$refs.thumb;
  1202. var dragConfig = {
  1203. drag: function drag(event) {
  1204. _this.handleDrag(event);
  1205. },
  1206. end: function end(event) {
  1207. _this.handleDrag(event);
  1208. }
  1209. };
  1210. draggable(bar, dragConfig);
  1211. draggable(thumb, dragConfig);
  1212. this.update();
  1213. }
  1214. });
  1215. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  1216. /* harmony default export */ var components_alpha_slidervue_type_script_lang_js_ = (alpha_slidervue_type_script_lang_js_);
  1217. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue
  1218. /* normalize component */
  1219. var alpha_slider_component = Object(componentNormalizer["a" /* default */])(
  1220. components_alpha_slidervue_type_script_lang_js_,
  1221. alpha_slidervue_type_template_id_068c66cb_render,
  1222. alpha_slidervue_type_template_id_068c66cb_staticRenderFns,
  1223. false,
  1224. null,
  1225. null,
  1226. null
  1227. )
  1228. /* hot reload */
  1229. if (false) { var alpha_slider_api; }
  1230. alpha_slider_component.options.__file = "packages/color-picker/src/components/alpha-slider.vue"
  1231. /* harmony default export */ var alpha_slider = (alpha_slider_component.exports);
  1232. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  1233. var predefinevue_type_template_id_06e03093_render = function() {
  1234. var _vm = this
  1235. var _h = _vm.$createElement
  1236. var _c = _vm._self._c || _h
  1237. return _c("div", { staticClass: "el-color-predefine" }, [
  1238. _c(
  1239. "div",
  1240. { staticClass: "el-color-predefine__colors" },
  1241. _vm._l(_vm.rgbaColors, function(item, index) {
  1242. return _c(
  1243. "div",
  1244. {
  1245. key: _vm.colors[index],
  1246. staticClass: "el-color-predefine__color-selector",
  1247. class: { selected: item.selected, "is-alpha": item._alpha < 100 },
  1248. on: {
  1249. click: function($event) {
  1250. _vm.handleSelect(index)
  1251. }
  1252. }
  1253. },
  1254. [_c("div", { style: { "background-color": item.value } })]
  1255. )
  1256. }),
  1257. 0
  1258. )
  1259. ])
  1260. }
  1261. var predefinevue_type_template_id_06e03093_staticRenderFns = []
  1262. predefinevue_type_template_id_06e03093_render._withStripped = true
  1263. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  1264. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  1265. //
  1266. //
  1267. //
  1268. //
  1269. //
  1270. //
  1271. //
  1272. //
  1273. //
  1274. //
  1275. //
  1276. //
  1277. //
  1278. //
  1279. //
  1280. /* harmony default export */ var predefinevue_type_script_lang_js_ = ({
  1281. props: {
  1282. colors: { type: Array, required: true },
  1283. color: { required: true }
  1284. },
  1285. data: function data() {
  1286. return {
  1287. rgbaColors: this.parseColors(this.colors, this.color)
  1288. };
  1289. },
  1290. methods: {
  1291. handleSelect: function handleSelect(index) {
  1292. this.color.fromString(this.colors[index]);
  1293. },
  1294. parseColors: function parseColors(colors, color) {
  1295. return colors.map(function (value) {
  1296. var c = new src_color();
  1297. c.enableAlpha = true;
  1298. c.format = 'rgba';
  1299. c.fromString(value);
  1300. c.selected = c.value === color.value;
  1301. return c;
  1302. });
  1303. }
  1304. },
  1305. watch: {
  1306. '$parent.currentColor': function $parentCurrentColor(val) {
  1307. var color = new src_color();
  1308. color.fromString(val);
  1309. this.rgbaColors.forEach(function (item) {
  1310. item.selected = color.compare(item);
  1311. });
  1312. },
  1313. colors: function colors(newVal) {
  1314. this.rgbaColors = this.parseColors(newVal, this.color);
  1315. },
  1316. color: function color(newVal) {
  1317. this.rgbaColors = this.parseColors(this.colors, newVal);
  1318. }
  1319. }
  1320. });
  1321. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  1322. /* harmony default export */ var components_predefinevue_type_script_lang_js_ = (predefinevue_type_script_lang_js_);
  1323. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue
  1324. /* normalize component */
  1325. var predefine_component = Object(componentNormalizer["a" /* default */])(
  1326. components_predefinevue_type_script_lang_js_,
  1327. predefinevue_type_template_id_06e03093_render,
  1328. predefinevue_type_template_id_06e03093_staticRenderFns,
  1329. false,
  1330. null,
  1331. null,
  1332. null
  1333. )
  1334. /* hot reload */
  1335. if (false) { var predefine_api; }
  1336. predefine_component.options.__file = "packages/color-picker/src/components/predefine.vue"
  1337. /* harmony default export */ var predefine = (predefine_component.exports);
  1338. // EXTERNAL MODULE: external "tis-ui/lib/utils/vue-popper"
  1339. var vue_popper_ = __webpack_require__(34);
  1340. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  1341. // EXTERNAL MODULE: external "tis-ui/lib/mixins/locale"
  1342. var locale_ = __webpack_require__(38);
  1343. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  1344. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  1345. var input = __webpack_require__(52);
  1346. // EXTERNAL MODULE: ./packages/button/index.js + 5 modules
  1347. var packages_button = __webpack_require__(70);
  1348. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  1349. //
  1350. //
  1351. //
  1352. //
  1353. //
  1354. //
  1355. //
  1356. //
  1357. //
  1358. //
  1359. //
  1360. //
  1361. //
  1362. //
  1363. //
  1364. //
  1365. //
  1366. //
  1367. //
  1368. //
  1369. //
  1370. //
  1371. //
  1372. //
  1373. //
  1374. //
  1375. //
  1376. //
  1377. //
  1378. //
  1379. //
  1380. //
  1381. //
  1382. //
  1383. //
  1384. //
  1385. //
  1386. //
  1387. //
  1388. //
  1389. /* harmony default export */ var picker_dropdownvue_type_script_lang_js_ = ({
  1390. name: 'el-color-picker-dropdown',
  1391. mixins: [vue_popper_default.a, locale_default.a],
  1392. components: {
  1393. SvPanel: sv_panel,
  1394. HueSlider: hue_slider,
  1395. AlphaSlider: alpha_slider,
  1396. ElInput: input["default"],
  1397. ElButton: packages_button["default"],
  1398. Predefine: predefine
  1399. },
  1400. props: {
  1401. color: {
  1402. required: true
  1403. },
  1404. showAlpha: Boolean,
  1405. predefine: Array
  1406. },
  1407. data: function data() {
  1408. return {
  1409. customInput: ''
  1410. };
  1411. },
  1412. computed: {
  1413. currentColor: function currentColor() {
  1414. var parent = this.$parent;
  1415. return !parent.value && !parent.showPanelColor ? '' : parent.color.value;
  1416. }
  1417. },
  1418. methods: {
  1419. confirmValue: function confirmValue() {
  1420. this.$emit('pick');
  1421. },
  1422. handleConfirm: function handleConfirm() {
  1423. this.color.fromString(this.customInput);
  1424. }
  1425. },
  1426. mounted: function mounted() {
  1427. this.$parent.popperElm = this.popperElm = this.$el;
  1428. this.referenceElm = this.$parent.$el;
  1429. },
  1430. watch: {
  1431. showPopper: function showPopper(val) {
  1432. var _this = this;
  1433. if (val === true) {
  1434. this.$nextTick(function () {
  1435. var _$refs = _this.$refs,
  1436. sl = _$refs.sl,
  1437. hue = _$refs.hue,
  1438. alpha = _$refs.alpha;
  1439. sl && sl.update();
  1440. hue && hue.update();
  1441. alpha && alpha.update();
  1442. });
  1443. }
  1444. },
  1445. currentColor: {
  1446. immediate: true,
  1447. handler: function handler(val) {
  1448. this.customInput = val;
  1449. }
  1450. }
  1451. }
  1452. });
  1453. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  1454. /* harmony default export */ var components_picker_dropdownvue_type_script_lang_js_ = (picker_dropdownvue_type_script_lang_js_);
  1455. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue
  1456. /* normalize component */
  1457. var picker_dropdown_component = Object(componentNormalizer["a" /* default */])(
  1458. components_picker_dropdownvue_type_script_lang_js_,
  1459. picker_dropdownvue_type_template_id_06601625_render,
  1460. picker_dropdownvue_type_template_id_06601625_staticRenderFns,
  1461. false,
  1462. null,
  1463. null,
  1464. null
  1465. )
  1466. /* hot reload */
  1467. if (false) { var picker_dropdown_api; }
  1468. picker_dropdown_component.options.__file = "packages/color-picker/src/components/picker-dropdown.vue"
  1469. /* harmony default export */ var picker_dropdown = (picker_dropdown_component.exports);
  1470. // EXTERNAL MODULE: external "tis-ui/lib/utils/clickoutside"
  1471. var clickoutside_ = __webpack_require__(61);
  1472. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1473. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  1474. var emitter_ = __webpack_require__(13);
  1475. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  1476. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  1477. //
  1478. //
  1479. //
  1480. //
  1481. //
  1482. //
  1483. //
  1484. //
  1485. //
  1486. //
  1487. //
  1488. //
  1489. //
  1490. //
  1491. //
  1492. //
  1493. //
  1494. //
  1495. //
  1496. //
  1497. //
  1498. //
  1499. //
  1500. //
  1501. //
  1502. //
  1503. //
  1504. //
  1505. //
  1506. //
  1507. //
  1508. //
  1509. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  1510. name: 'TisColorPicker',
  1511. mixins: [emitter_default.a],
  1512. props: {
  1513. value: String,
  1514. showAlpha: Boolean,
  1515. colorFormat: String,
  1516. disabled: Boolean,
  1517. size: String,
  1518. popperClass: String,
  1519. predefine: Array
  1520. },
  1521. inject: {
  1522. elForm: {
  1523. default: ''
  1524. },
  1525. elFormItem: {
  1526. default: ''
  1527. }
  1528. },
  1529. directives: { Clickoutside: clickoutside_default.a },
  1530. computed: {
  1531. displayedColor: function displayedColor() {
  1532. if (!this.value && !this.showPanelColor) {
  1533. return 'transparent';
  1534. }
  1535. return this.displayedRgb(this.color, this.showAlpha);
  1536. },
  1537. _elFormItemSize: function _elFormItemSize() {
  1538. return (this.elFormItem || {}).elFormItemSize;
  1539. },
  1540. colorSize: function colorSize() {
  1541. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1542. },
  1543. colorDisabled: function colorDisabled() {
  1544. return this.disabled || (this.elForm || {}).disabled;
  1545. }
  1546. },
  1547. watch: {
  1548. value: function value(val) {
  1549. if (!val) {
  1550. this.showPanelColor = false;
  1551. } else if (val && val !== this.color.value) {
  1552. this.color.fromString(val);
  1553. }
  1554. },
  1555. color: {
  1556. deep: true,
  1557. handler: function handler() {
  1558. this.showPanelColor = true;
  1559. }
  1560. },
  1561. displayedColor: function displayedColor(val) {
  1562. if (!this.showPicker) return;
  1563. var currentValueColor = new src_color({
  1564. enableAlpha: this.showAlpha,
  1565. format: this.colorFormat
  1566. });
  1567. currentValueColor.fromString(this.value);
  1568. var currentValueColorRgb = this.displayedRgb(currentValueColor, this.showAlpha);
  1569. if (val !== currentValueColorRgb) {
  1570. this.$emit('active-change', val);
  1571. }
  1572. }
  1573. },
  1574. methods: {
  1575. handleTrigger: function handleTrigger() {
  1576. if (this.colorDisabled) return;
  1577. this.showPicker = !this.showPicker;
  1578. },
  1579. confirmValue: function confirmValue() {
  1580. var value = this.color.value;
  1581. this.$emit('input', value);
  1582. this.$emit('change', value);
  1583. this.dispatch('ElFormItem', 'el.form.change', value);
  1584. this.showPicker = false;
  1585. },
  1586. clearValue: function clearValue() {
  1587. this.$emit('input', null);
  1588. this.$emit('change', null);
  1589. if (this.value !== null) {
  1590. this.dispatch('ElFormItem', 'el.form.change', null);
  1591. }
  1592. this.showPanelColor = false;
  1593. this.showPicker = false;
  1594. this.resetColor();
  1595. },
  1596. hide: function hide() {
  1597. this.showPicker = false;
  1598. this.resetColor();
  1599. },
  1600. resetColor: function resetColor() {
  1601. var _this = this;
  1602. this.$nextTick(function (_) {
  1603. if (_this.value) {
  1604. _this.color.fromString(_this.value);
  1605. } else {
  1606. _this.showPanelColor = false;
  1607. }
  1608. });
  1609. },
  1610. displayedRgb: function displayedRgb(color, showAlpha) {
  1611. if (!(color instanceof src_color)) {
  1612. throw Error('color should be instance of Color Class');
  1613. }
  1614. var _color$toRgb = color.toRgb(),
  1615. r = _color$toRgb.r,
  1616. g = _color$toRgb.g,
  1617. b = _color$toRgb.b;
  1618. return showAlpha ? 'rgba(' + r + ', ' + g + ', ' + b + ', ' + color.get('alpha') / 100 + ')' : 'rgb(' + r + ', ' + g + ', ' + b + ')';
  1619. }
  1620. },
  1621. mounted: function mounted() {
  1622. var value = this.value;
  1623. if (value) {
  1624. this.color.fromString(value);
  1625. }
  1626. this.popperElm = this.$refs.dropdown.$el;
  1627. },
  1628. data: function data() {
  1629. var color = new src_color({
  1630. enableAlpha: this.showAlpha,
  1631. format: this.colorFormat
  1632. });
  1633. return {
  1634. color: color,
  1635. showPicker: false,
  1636. showPanelColor: false
  1637. };
  1638. },
  1639. components: {
  1640. PickerDropdown: picker_dropdown
  1641. }
  1642. });
  1643. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  1644. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  1645. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue
  1646. /* normalize component */
  1647. var main_component = Object(componentNormalizer["a" /* default */])(
  1648. src_mainvue_type_script_lang_js_,
  1649. render,
  1650. staticRenderFns,
  1651. false,
  1652. null,
  1653. null,
  1654. null
  1655. )
  1656. /* hot reload */
  1657. if (false) { var main_api; }
  1658. main_component.options.__file = "packages/color-picker/src/main.vue"
  1659. /* harmony default export */ var main = (main_component.exports);
  1660. // CONCATENATED MODULE: ./packages/color-picker/index.js
  1661. /* istanbul ignore next */
  1662. main.install = function (Vue) {
  1663. Vue.component(main.name, main);
  1664. };
  1665. /* harmony default export */ var color_picker = __webpack_exports__["default"] = (main);
  1666. /***/ }),
  1667. /***/ 52:
  1668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1669. "use strict";
  1670. // ESM COMPAT FLAG
  1671. __webpack_require__.r(__webpack_exports__);
  1672. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=343dd774&
  1673. var render = function() {
  1674. var _vm = this
  1675. var _h = _vm.$createElement
  1676. var _c = _vm._self._c || _h
  1677. return _c(
  1678. "div",
  1679. {
  1680. class: [
  1681. _vm.type === "textarea" ? "el-textarea" : "el-input",
  1682. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  1683. {
  1684. "is-disabled": _vm.inputDisabled,
  1685. "is-exceed": _vm.inputExceed,
  1686. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  1687. "el-input-group--append": _vm.$slots.append,
  1688. "el-input-group--prepend": _vm.$slots.prepend,
  1689. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  1690. "el-input--suffix":
  1691. _vm.$slots.suffix ||
  1692. _vm.suffixIcon ||
  1693. _vm.clearable ||
  1694. _vm.showPassword
  1695. }
  1696. ],
  1697. on: {
  1698. mouseenter: function($event) {
  1699. _vm.hovering = true
  1700. },
  1701. mouseleave: function($event) {
  1702. _vm.hovering = false
  1703. }
  1704. }
  1705. },
  1706. [
  1707. _vm.type !== "textarea"
  1708. ? [
  1709. _vm.$slots.prepend
  1710. ? _c(
  1711. "div",
  1712. { staticClass: "el-input-group__prepend" },
  1713. [_vm._t("prepend")],
  1714. 2
  1715. )
  1716. : _vm._e(),
  1717. _vm.type !== "textarea"
  1718. ? _c(
  1719. "input",
  1720. _vm._b(
  1721. {
  1722. ref: "input",
  1723. staticClass: "el-input__inner",
  1724. attrs: {
  1725. tabindex: _vm.tabindex,
  1726. type: _vm.showPassword
  1727. ? _vm.passwordVisible
  1728. ? "text"
  1729. : "password"
  1730. : _vm.type,
  1731. disabled: _vm.inputDisabled,
  1732. readonly: _vm.readonly,
  1733. autocomplete: _vm.autoComplete || _vm.autocomplete,
  1734. "aria-label": _vm.label
  1735. },
  1736. on: {
  1737. compositionstart: _vm.handleCompositionStart,
  1738. compositionupdate: _vm.handleCompositionUpdate,
  1739. compositionend: _vm.handleCompositionEnd,
  1740. input: _vm.handleInput,
  1741. focus: _vm.handleFocus,
  1742. blur: _vm.handleBlur,
  1743. change: _vm.handleChange
  1744. }
  1745. },
  1746. "input",
  1747. _vm.$attrs,
  1748. false
  1749. )
  1750. )
  1751. : _vm._e(),
  1752. _vm.$slots.prefix || _vm.prefixIcon
  1753. ? _c(
  1754. "span",
  1755. { staticClass: "el-input__prefix" },
  1756. [
  1757. _vm._t("prefix"),
  1758. _vm.prefixIcon
  1759. ? _c("i", {
  1760. staticClass: "el-input__icon",
  1761. class: _vm.prefixIcon
  1762. })
  1763. : _vm._e()
  1764. ],
  1765. 2
  1766. )
  1767. : _vm._e(),
  1768. _vm.getSuffixVisible()
  1769. ? _c("span", { staticClass: "el-input__suffix" }, [
  1770. _c(
  1771. "span",
  1772. { staticClass: "el-input__suffix-inner" },
  1773. [
  1774. !_vm.showClear ||
  1775. !_vm.showPwdVisible ||
  1776. !_vm.isWordLimitVisible
  1777. ? [
  1778. _vm._t("suffix"),
  1779. _vm.suffixIcon
  1780. ? _c("i", {
  1781. staticClass: "el-input__icon",
  1782. class: _vm.suffixIcon
  1783. })
  1784. : _vm._e()
  1785. ]
  1786. : _vm._e(),
  1787. _vm.showClear
  1788. ? _c("i", {
  1789. staticClass:
  1790. "el-input__icon el-icon-circle-close el-input__clear",
  1791. on: {
  1792. mousedown: function($event) {
  1793. $event.preventDefault()
  1794. },
  1795. click: _vm.clear
  1796. }
  1797. })
  1798. : _vm._e(),
  1799. _vm.showPwdVisible
  1800. ? _c("i", {
  1801. staticClass:
  1802. "el-input__icon el-icon-view el-input__clear",
  1803. on: { click: _vm.handlePasswordVisible }
  1804. })
  1805. : _vm._e(),
  1806. _vm.isWordLimitVisible
  1807. ? _c("span", { staticClass: "el-input__count" }, [
  1808. _c(
  1809. "span",
  1810. { staticClass: "el-input__count-inner" },
  1811. [
  1812. _vm._v(
  1813. "\n " +
  1814. _vm._s(_vm.textLength) +
  1815. "/" +
  1816. _vm._s(_vm.upperLimit) +
  1817. "\n "
  1818. )
  1819. ]
  1820. )
  1821. ])
  1822. : _vm._e()
  1823. ],
  1824. 2
  1825. ),
  1826. _vm.validateState
  1827. ? _c("i", {
  1828. staticClass: "el-input__icon",
  1829. class: ["el-input__validateIcon", _vm.validateIcon]
  1830. })
  1831. : _vm._e()
  1832. ])
  1833. : _vm._e(),
  1834. _vm.$slots.append
  1835. ? _c(
  1836. "div",
  1837. { staticClass: "el-input-group__append" },
  1838. [_vm._t("append")],
  1839. 2
  1840. )
  1841. : _vm._e()
  1842. ]
  1843. : _c(
  1844. "textarea",
  1845. _vm._b(
  1846. {
  1847. ref: "textarea",
  1848. staticClass: "el-textarea__inner",
  1849. style: _vm.textareaStyle,
  1850. attrs: {
  1851. tabindex: _vm.tabindex,
  1852. disabled: _vm.inputDisabled,
  1853. readonly: _vm.readonly,
  1854. autocomplete: _vm.autoComplete || _vm.autocomplete,
  1855. "aria-label": _vm.label
  1856. },
  1857. on: {
  1858. compositionstart: _vm.handleCompositionStart,
  1859. compositionupdate: _vm.handleCompositionUpdate,
  1860. compositionend: _vm.handleCompositionEnd,
  1861. input: _vm.handleInput,
  1862. focus: _vm.handleFocus,
  1863. blur: _vm.handleBlur,
  1864. change: _vm.handleChange
  1865. }
  1866. },
  1867. "textarea",
  1868. _vm.$attrs,
  1869. false
  1870. )
  1871. ),
  1872. _vm.isWordLimitVisible && _vm.type === "textarea"
  1873. ? _c("span", { staticClass: "el-input__count" }, [
  1874. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  1875. ])
  1876. : _vm._e()
  1877. ],
  1878. 2
  1879. )
  1880. }
  1881. var staticRenderFns = []
  1882. render._withStripped = true
  1883. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  1884. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  1885. var emitter_ = __webpack_require__(13);
  1886. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  1887. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  1888. var migrating_ = __webpack_require__(36);
  1889. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  1890. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  1891. var hiddenTextarea = void 0;
  1892. var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
  1893. var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
  1894. function calculateNodeStyling(targetElement) {
  1895. var style = window.getComputedStyle(targetElement);
  1896. var boxSizing = style.getPropertyValue('box-sizing');
  1897. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  1898. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  1899. var contextStyle = CONTEXT_STYLE.map(function (name) {
  1900. return name + ':' + style.getPropertyValue(name);
  1901. }).join(';');
  1902. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  1903. }
  1904. function calcTextareaHeight(targetElement) {
  1905. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  1906. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  1907. if (!hiddenTextarea) {
  1908. hiddenTextarea = document.createElement('textarea');
  1909. document.body.appendChild(hiddenTextarea);
  1910. }
  1911. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  1912. paddingSize = _calculateNodeStyling.paddingSize,
  1913. borderSize = _calculateNodeStyling.borderSize,
  1914. boxSizing = _calculateNodeStyling.boxSizing,
  1915. contextStyle = _calculateNodeStyling.contextStyle;
  1916. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  1917. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  1918. var height = hiddenTextarea.scrollHeight;
  1919. var result = {};
  1920. if (boxSizing === 'border-box') {
  1921. height = height + borderSize;
  1922. } else if (boxSizing === 'content-box') {
  1923. height = height - paddingSize;
  1924. }
  1925. hiddenTextarea.value = '';
  1926. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  1927. if (minRows !== null) {
  1928. var minHeight = singleRowHeight * minRows;
  1929. if (boxSizing === 'border-box') {
  1930. minHeight = minHeight + paddingSize + borderSize;
  1931. }
  1932. height = Math.max(minHeight, height);
  1933. result.minHeight = minHeight + 'px';
  1934. }
  1935. if (maxRows !== null) {
  1936. var maxHeight = singleRowHeight * maxRows;
  1937. if (boxSizing === 'border-box') {
  1938. maxHeight = maxHeight + paddingSize + borderSize;
  1939. }
  1940. height = Math.min(maxHeight, height);
  1941. }
  1942. result.height = height + 'px';
  1943. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  1944. hiddenTextarea = null;
  1945. return result;
  1946. };
  1947. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  1948. var merge_ = __webpack_require__(33);
  1949. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  1950. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  1951. var shared_ = __webpack_require__(49);
  1952. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
  1953. //
  1954. //
  1955. //
  1956. //
  1957. //
  1958. //
  1959. //
  1960. //
  1961. //
  1962. //
  1963. //
  1964. //
  1965. //
  1966. //
  1967. //
  1968. //
  1969. //
  1970. //
  1971. //
  1972. //
  1973. //
  1974. //
  1975. //
  1976. //
  1977. //
  1978. //
  1979. //
  1980. //
  1981. //
  1982. //
  1983. //
  1984. //
  1985. //
  1986. //
  1987. //
  1988. //
  1989. //
  1990. //
  1991. //
  1992. //
  1993. //
  1994. //
  1995. //
  1996. //
  1997. //
  1998. //
  1999. //
  2000. //
  2001. //
  2002. //
  2003. //
  2004. //
  2005. //
  2006. //
  2007. //
  2008. //
  2009. //
  2010. //
  2011. //
  2012. //
  2013. //
  2014. //
  2015. //
  2016. //
  2017. //
  2018. //
  2019. //
  2020. //
  2021. //
  2022. //
  2023. //
  2024. //
  2025. //
  2026. //
  2027. //
  2028. //
  2029. //
  2030. //
  2031. //
  2032. //
  2033. //
  2034. //
  2035. //
  2036. //
  2037. //
  2038. //
  2039. //
  2040. //
  2041. //
  2042. //
  2043. //
  2044. //
  2045. //
  2046. //
  2047. //
  2048. //
  2049. //
  2050. //
  2051. //
  2052. //
  2053. //
  2054. //
  2055. //
  2056. //
  2057. //
  2058. //
  2059. //
  2060. //
  2061. //
  2062. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  2063. name: 'TisInput',
  2064. componentName: 'TisInput',
  2065. mixins: [emitter_default.a, migrating_default.a],
  2066. inheritAttrs: false,
  2067. inject: {
  2068. elForm: {
  2069. default: ''
  2070. },
  2071. elFormItem: {
  2072. default: ''
  2073. }
  2074. },
  2075. data: function data() {
  2076. return {
  2077. textareaCalcStyle: {},
  2078. hovering: false,
  2079. focused: false,
  2080. isComposing: false,
  2081. passwordVisible: false
  2082. };
  2083. },
  2084. props: {
  2085. value: [String, Number],
  2086. size: String,
  2087. resize: String,
  2088. form: String,
  2089. disabled: Boolean,
  2090. readonly: Boolean,
  2091. type: {
  2092. type: String,
  2093. default: 'text'
  2094. },
  2095. autosize: {
  2096. type: [Boolean, Object],
  2097. default: false
  2098. },
  2099. autocomplete: {
  2100. type: String,
  2101. default: 'off'
  2102. },
  2103. /** @Deprecated in next major version */
  2104. autoComplete: {
  2105. type: String,
  2106. validator: function validator(val) {
  2107. false && false;
  2108. return true;
  2109. }
  2110. },
  2111. validateEvent: {
  2112. type: Boolean,
  2113. default: true
  2114. },
  2115. suffixIcon: String,
  2116. prefixIcon: String,
  2117. label: String,
  2118. clearable: {
  2119. type: Boolean,
  2120. default: false
  2121. },
  2122. showPassword: {
  2123. type: Boolean,
  2124. default: false
  2125. },
  2126. showWordLimit: {
  2127. type: Boolean,
  2128. default: false
  2129. },
  2130. tabindex: String
  2131. },
  2132. computed: {
  2133. _elFormItemSize: function _elFormItemSize() {
  2134. return (this.elFormItem || {}).elFormItemSize;
  2135. },
  2136. validateState: function validateState() {
  2137. return this.elFormItem ? this.elFormItem.validateState : '';
  2138. },
  2139. needStatusIcon: function needStatusIcon() {
  2140. return this.elForm ? this.elForm.statusIcon : false;
  2141. },
  2142. validateIcon: function validateIcon() {
  2143. return {
  2144. validating: 'el-icon-loading',
  2145. success: 'el-icon-circle-check',
  2146. error: 'el-icon-circle-close'
  2147. }[this.validateState];
  2148. },
  2149. textareaStyle: function textareaStyle() {
  2150. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  2151. },
  2152. inputSize: function inputSize() {
  2153. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  2154. },
  2155. inputDisabled: function inputDisabled() {
  2156. return this.disabled || (this.elForm || {}).disabled;
  2157. },
  2158. nativeInputValue: function nativeInputValue() {
  2159. return this.value === null || this.value === undefined ? '' : String(this.value);
  2160. },
  2161. showClear: function showClear() {
  2162. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  2163. },
  2164. showPwdVisible: function showPwdVisible() {
  2165. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  2166. },
  2167. isWordLimitVisible: function isWordLimitVisible() {
  2168. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  2169. },
  2170. upperLimit: function upperLimit() {
  2171. return this.$attrs.maxlength;
  2172. },
  2173. textLength: function textLength() {
  2174. if (typeof this.value === 'number') {
  2175. return String(this.value).length;
  2176. }
  2177. return (this.value || '').length;
  2178. },
  2179. inputExceed: function inputExceed() {
  2180. // show exceed style if length of initial value greater then maxlength
  2181. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  2182. }
  2183. },
  2184. watch: {
  2185. value: function value(val) {
  2186. this.$nextTick(this.resizeTextarea);
  2187. if (this.validateEvent) {
  2188. this.dispatch('ElFormItem', 'el.form.change', [val]);
  2189. }
  2190. },
  2191. // native input value is set explicitly
  2192. // do not use v-model / :value in template
  2193. // see: https://github.com/ElemeFE/element/issues/14521
  2194. nativeInputValue: function nativeInputValue() {
  2195. this.setNativeInputValue();
  2196. },
  2197. // when change between <input> and <textarea>,
  2198. // update DOM dependent value and styles
  2199. // https://github.com/ElemeFE/element/issues/14857
  2200. type: function type() {
  2201. var _this = this;
  2202. this.$nextTick(function () {
  2203. _this.setNativeInputValue();
  2204. _this.resizeTextarea();
  2205. _this.updateIconOffset();
  2206. });
  2207. }
  2208. },
  2209. methods: {
  2210. focus: function focus() {
  2211. this.getInput().focus();
  2212. },
  2213. blur: function blur() {
  2214. this.getInput().blur();
  2215. },
  2216. getMigratingConfig: function getMigratingConfig() {
  2217. return {
  2218. props: {
  2219. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  2220. 'on-icon-click': 'on-icon-click is removed.'
  2221. },
  2222. events: {
  2223. 'click': 'click is removed.'
  2224. }
  2225. };
  2226. },
  2227. handleBlur: function handleBlur(event) {
  2228. this.focused = false;
  2229. this.$emit('blur', event);
  2230. if (this.validateEvent) {
  2231. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  2232. }
  2233. },
  2234. select: function select() {
  2235. this.getInput().select();
  2236. },
  2237. resizeTextarea: function resizeTextarea() {
  2238. if (this.$isServer) return;
  2239. var autosize = this.autosize,
  2240. type = this.type;
  2241. if (type !== 'textarea') return;
  2242. if (!autosize) {
  2243. this.textareaCalcStyle = {
  2244. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  2245. };
  2246. return;
  2247. }
  2248. var minRows = autosize.minRows;
  2249. var maxRows = autosize.maxRows;
  2250. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  2251. },
  2252. setNativeInputValue: function setNativeInputValue() {
  2253. var input = this.getInput();
  2254. if (!input) return;
  2255. if (input.value === this.nativeInputValue) return;
  2256. input.value = this.nativeInputValue;
  2257. },
  2258. handleFocus: function handleFocus(event) {
  2259. this.focused = true;
  2260. this.$emit('focus', event);
  2261. },
  2262. handleCompositionStart: function handleCompositionStart() {
  2263. this.isComposing = true;
  2264. },
  2265. handleCompositionUpdate: function handleCompositionUpdate(event) {
  2266. var text = event.target.value;
  2267. var lastCharacter = text[text.length - 1] || '';
  2268. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  2269. },
  2270. handleCompositionEnd: function handleCompositionEnd(event) {
  2271. if (this.isComposing) {
  2272. this.isComposing = false;
  2273. this.handleInput(event);
  2274. }
  2275. },
  2276. handleInput: function handleInput(event) {
  2277. // should not emit input during composition
  2278. // see: https://github.com/ElemeFE/element/issues/10516
  2279. if (this.isComposing) return;
  2280. // hack for https://github.com/ElemeFE/element/issues/8548
  2281. // should remove the following line when we don't support IE
  2282. if (event.target.value === this.nativeInputValue) return;
  2283. this.$emit('input', event.target.value);
  2284. // ensure native input value is controlled
  2285. // see: https://github.com/ElemeFE/element/issues/12850
  2286. this.$nextTick(this.setNativeInputValue);
  2287. },
  2288. handleChange: function handleChange(event) {
  2289. this.$emit('change', event.target.value);
  2290. },
  2291. calcIconOffset: function calcIconOffset(place) {
  2292. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  2293. if (!elList.length) return;
  2294. var el = null;
  2295. for (var i = 0; i < elList.length; i++) {
  2296. if (elList[i].parentNode === this.$el) {
  2297. el = elList[i];
  2298. break;
  2299. }
  2300. }
  2301. if (!el) return;
  2302. var pendantMap = {
  2303. suffix: 'append',
  2304. prefix: 'prepend'
  2305. };
  2306. var pendant = pendantMap[place];
  2307. if (this.$slots[pendant]) {
  2308. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  2309. } else {
  2310. el.removeAttribute('style');
  2311. }
  2312. },
  2313. updateIconOffset: function updateIconOffset() {
  2314. this.calcIconOffset('prefix');
  2315. this.calcIconOffset('suffix');
  2316. },
  2317. clear: function clear() {
  2318. this.$emit('input', '');
  2319. this.$emit('change', '');
  2320. this.$emit('clear');
  2321. },
  2322. handlePasswordVisible: function handlePasswordVisible() {
  2323. this.passwordVisible = !this.passwordVisible;
  2324. this.focus();
  2325. },
  2326. getInput: function getInput() {
  2327. return this.$refs.input || this.$refs.textarea;
  2328. },
  2329. getSuffixVisible: function getSuffixVisible() {
  2330. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  2331. }
  2332. },
  2333. created: function created() {
  2334. this.$on('inputSelect', this.select);
  2335. },
  2336. mounted: function mounted() {
  2337. this.setNativeInputValue();
  2338. this.resizeTextarea();
  2339. this.updateIconOffset();
  2340. },
  2341. updated: function updated() {
  2342. this.$nextTick(this.updateIconOffset);
  2343. }
  2344. });
  2345. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  2346. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  2347. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2348. var componentNormalizer = __webpack_require__(2);
  2349. // CONCATENATED MODULE: ./packages/input/src/input.vue
  2350. /* normalize component */
  2351. var component = Object(componentNormalizer["a" /* default */])(
  2352. src_inputvue_type_script_lang_js_,
  2353. render,
  2354. staticRenderFns,
  2355. false,
  2356. null,
  2357. null,
  2358. null
  2359. )
  2360. /* hot reload */
  2361. if (false) { var api; }
  2362. component.options.__file = "packages/input/src/input.vue"
  2363. /* harmony default export */ var input = (component.exports);
  2364. // CONCATENATED MODULE: ./packages/input/index.js
  2365. /* istanbul ignore next */
  2366. input.install = function (Vue) {
  2367. Vue.component(input.name, input);
  2368. };
  2369. /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
  2370. /***/ }),
  2371. /***/ 61:
  2372. /***/ (function(module, exports) {
  2373. module.exports = require("tis-ui/lib/utils/clickoutside");
  2374. /***/ }),
  2375. /***/ 70:
  2376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2377. "use strict";
  2378. // ESM COMPAT FLAG
  2379. __webpack_require__.r(__webpack_exports__);
  2380. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  2381. var render = function() {
  2382. var _vm = this
  2383. var _h = _vm.$createElement
  2384. var _c = _vm._self._c || _h
  2385. return _c(
  2386. "button",
  2387. {
  2388. staticClass: "el-button",
  2389. class: [
  2390. _vm.type ? "el-button--" + _vm.type : "",
  2391. _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
  2392. {
  2393. "is-disabled": _vm.buttonDisabled,
  2394. "is-loading": _vm.loading,
  2395. "is-plain": _vm.plain,
  2396. "is-round": _vm.round,
  2397. "is-circle": _vm.circle
  2398. }
  2399. ],
  2400. attrs: {
  2401. disabled: _vm.buttonDisabled || _vm.loading,
  2402. autofocus: _vm.autofocus,
  2403. type: _vm.nativeType
  2404. },
  2405. on: { click: _vm.handleClick }
  2406. },
  2407. [
  2408. _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
  2409. _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
  2410. _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e()
  2411. ]
  2412. )
  2413. }
  2414. var staticRenderFns = []
  2415. render._withStripped = true
  2416. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  2417. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js&
  2418. //
  2419. //
  2420. //
  2421. //
  2422. //
  2423. //
  2424. //
  2425. //
  2426. //
  2427. //
  2428. //
  2429. //
  2430. //
  2431. //
  2432. //
  2433. //
  2434. //
  2435. //
  2436. //
  2437. //
  2438. //
  2439. //
  2440. //
  2441. //
  2442. /* harmony default export */ var buttonvue_type_script_lang_js_ = ({
  2443. name: 'TisButton',
  2444. inject: {
  2445. elForm: {
  2446. default: ''
  2447. },
  2448. elFormItem: {
  2449. default: ''
  2450. }
  2451. },
  2452. props: {
  2453. type: {
  2454. type: String,
  2455. default: 'default'
  2456. },
  2457. size: String,
  2458. icon: {
  2459. type: String,
  2460. default: ''
  2461. },
  2462. nativeType: {
  2463. type: String,
  2464. default: 'button'
  2465. },
  2466. loading: Boolean,
  2467. disabled: Boolean,
  2468. plain: Boolean,
  2469. autofocus: Boolean,
  2470. round: Boolean,
  2471. circle: Boolean
  2472. },
  2473. computed: {
  2474. _elFormItemSize: function _elFormItemSize() {
  2475. return (this.elFormItem || {}).elFormItemSize;
  2476. },
  2477. buttonSize: function buttonSize() {
  2478. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  2479. },
  2480. buttonDisabled: function buttonDisabled() {
  2481. return this.disabled || (this.elForm || {}).disabled;
  2482. }
  2483. },
  2484. methods: {
  2485. handleClick: function handleClick(evt) {
  2486. this.$emit('click', evt);
  2487. }
  2488. }
  2489. });
  2490. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
  2491. /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
  2492. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2493. var componentNormalizer = __webpack_require__(2);
  2494. // CONCATENATED MODULE: ./packages/button/src/button.vue
  2495. /* normalize component */
  2496. var component = Object(componentNormalizer["a" /* default */])(
  2497. src_buttonvue_type_script_lang_js_,
  2498. render,
  2499. staticRenderFns,
  2500. false,
  2501. null,
  2502. null,
  2503. null
  2504. )
  2505. /* hot reload */
  2506. if (false) { var api; }
  2507. component.options.__file = "packages/button/src/button.vue"
  2508. /* harmony default export */ var src_button = (component.exports);
  2509. // CONCATENATED MODULE: ./packages/button/index.js
  2510. /* istanbul ignore next */
  2511. src_button.install = function (Vue) {
  2512. Vue.component(src_button.name, src_button);
  2513. };
  2514. /* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
  2515. /***/ })
  2516. /******/ });