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.

556 lines
15 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 = 536);
  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. /***/ 36:
  189. /***/ (function(module, exports) {
  190. module.exports = require("tis-ui/lib/mixins/migrating");
  191. /***/ }),
  192. /***/ 536:
  193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  194. "use strict";
  195. // ESM COMPAT FLAG
  196. __webpack_require__.r(__webpack_exports__);
  197. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  198. var render = function() {
  199. var _vm = this
  200. var _h = _vm.$createElement
  201. var _c = _vm._self._c || _h
  202. return _c(
  203. "div",
  204. {
  205. staticClass: "el-switch",
  206. class: { "is-disabled": _vm.switchDisabled, "is-checked": _vm.checked },
  207. attrs: {
  208. role: "switch",
  209. "aria-checked": _vm.checked,
  210. "aria-disabled": _vm.switchDisabled
  211. },
  212. on: {
  213. click: function($event) {
  214. $event.preventDefault()
  215. return _vm.switchValue($event)
  216. }
  217. }
  218. },
  219. [
  220. _c("input", {
  221. ref: "input",
  222. staticClass: "el-switch__input",
  223. attrs: {
  224. type: "checkbox",
  225. id: _vm.id,
  226. name: _vm.name,
  227. "true-value": _vm.activeValue,
  228. "false-value": _vm.inactiveValue,
  229. disabled: _vm.switchDisabled
  230. },
  231. on: {
  232. change: _vm.handleChange,
  233. keydown: function($event) {
  234. if (
  235. !("button" in $event) &&
  236. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  237. ) {
  238. return null
  239. }
  240. return _vm.switchValue($event)
  241. }
  242. }
  243. }),
  244. _vm.inactiveIconClass || _vm.inactiveText
  245. ? _c(
  246. "span",
  247. {
  248. class: [
  249. "el-switch__label",
  250. "el-switch__label--left",
  251. !_vm.checked ? "is-active" : ""
  252. ]
  253. },
  254. [
  255. _vm.inactiveIconClass
  256. ? _c("i", { class: [_vm.inactiveIconClass] })
  257. : _vm._e(),
  258. !_vm.inactiveIconClass && _vm.inactiveText
  259. ? _c("span", { attrs: { "aria-hidden": _vm.checked } }, [
  260. _vm._v(_vm._s(_vm.inactiveText))
  261. ])
  262. : _vm._e()
  263. ]
  264. )
  265. : _vm._e(),
  266. _c("span", {
  267. ref: "core",
  268. staticClass: "el-switch__core",
  269. style: { width: _vm.coreWidth + "px" }
  270. }),
  271. _vm.activeIconClass || _vm.activeText
  272. ? _c(
  273. "span",
  274. {
  275. class: [
  276. "el-switch__label",
  277. "el-switch__label--right",
  278. _vm.checked ? "is-active" : ""
  279. ]
  280. },
  281. [
  282. _vm.activeIconClass
  283. ? _c("i", { class: [_vm.activeIconClass] })
  284. : _vm._e(),
  285. !_vm.activeIconClass && _vm.activeText
  286. ? _c("span", { attrs: { "aria-hidden": !_vm.checked } }, [
  287. _vm._v(_vm._s(_vm.activeText))
  288. ])
  289. : _vm._e()
  290. ]
  291. )
  292. : _vm._e()
  293. ]
  294. )
  295. }
  296. var staticRenderFns = []
  297. render._withStripped = true
  298. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  299. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  300. var emitter_ = __webpack_require__(13);
  301. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  302. // EXTERNAL MODULE: external "tis-ui/lib/mixins/focus"
  303. var focus_ = __webpack_require__(88);
  304. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  305. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  306. var migrating_ = __webpack_require__(36);
  307. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  308. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/switch/src/component.vue?vue&type=script&lang=js&
  309. //
  310. //
  311. //
  312. //
  313. //
  314. //
  315. //
  316. //
  317. //
  318. //
  319. //
  320. //
  321. //
  322. //
  323. //
  324. //
  325. //
  326. //
  327. //
  328. //
  329. //
  330. //
  331. //
  332. //
  333. //
  334. //
  335. //
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. /* harmony default export */ var componentvue_type_script_lang_js_ = ({
  347. name: 'TisSwitch',
  348. mixins: [focus_default()('input'), migrating_default.a, emitter_default.a],
  349. inject: {
  350. elForm: {
  351. default: ''
  352. }
  353. },
  354. props: {
  355. value: {
  356. type: [Boolean, String, Number],
  357. default: false
  358. },
  359. disabled: {
  360. type: Boolean,
  361. default: false
  362. },
  363. width: {
  364. type: Number,
  365. default: 40
  366. },
  367. activeIconClass: {
  368. type: String,
  369. default: ''
  370. },
  371. inactiveIconClass: {
  372. type: String,
  373. default: ''
  374. },
  375. activeText: String,
  376. inactiveText: String,
  377. activeColor: {
  378. type: String,
  379. default: ''
  380. },
  381. inactiveColor: {
  382. type: String,
  383. default: ''
  384. },
  385. activeValue: {
  386. type: [Boolean, String, Number],
  387. default: true
  388. },
  389. inactiveValue: {
  390. type: [Boolean, String, Number],
  391. default: false
  392. },
  393. name: {
  394. type: String,
  395. default: ''
  396. },
  397. validateEvent: {
  398. type: Boolean,
  399. default: true
  400. },
  401. id: String
  402. },
  403. data: function data() {
  404. return {
  405. coreWidth: this.width
  406. };
  407. },
  408. created: function created() {
  409. if (!~[this.activeValue, this.inactiveValue].indexOf(this.value)) {
  410. this.$emit('input', this.inactiveValue);
  411. }
  412. },
  413. computed: {
  414. checked: function checked() {
  415. return this.value === this.activeValue;
  416. },
  417. switchDisabled: function switchDisabled() {
  418. return this.disabled || (this.elForm || {}).disabled;
  419. }
  420. },
  421. watch: {
  422. checked: function checked() {
  423. this.$refs.input.checked = this.checked;
  424. if (this.activeColor || this.inactiveColor) {
  425. this.setBackgroundColor();
  426. }
  427. if (this.validateEvent) {
  428. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  429. }
  430. }
  431. },
  432. methods: {
  433. handleChange: function handleChange(event) {
  434. var _this = this;
  435. var val = this.checked ? this.inactiveValue : this.activeValue;
  436. this.$emit('input', val);
  437. this.$emit('change', val);
  438. this.$nextTick(function () {
  439. // set input's checked property
  440. // in case parent refuses to change component's value
  441. _this.$refs.input.checked = _this.checked;
  442. });
  443. },
  444. setBackgroundColor: function setBackgroundColor() {
  445. var newColor = this.checked ? this.activeColor : this.inactiveColor;
  446. this.$refs.core.style.borderColor = newColor;
  447. this.$refs.core.style.backgroundColor = newColor;
  448. },
  449. switchValue: function switchValue() {
  450. !this.switchDisabled && this.handleChange();
  451. },
  452. getMigratingConfig: function getMigratingConfig() {
  453. return {
  454. props: {
  455. 'on-color': 'on-color is renamed to active-color.',
  456. 'off-color': 'off-color is renamed to inactive-color.',
  457. 'on-text': 'on-text is renamed to active-text.',
  458. 'off-text': 'off-text is renamed to inactive-text.',
  459. 'on-value': 'on-value is renamed to active-value.',
  460. 'off-value': 'off-value is renamed to inactive-value.',
  461. 'on-icon-class': 'on-icon-class is renamed to active-icon-class.',
  462. 'off-icon-class': 'off-icon-class is renamed to inactive-icon-class.'
  463. }
  464. };
  465. }
  466. },
  467. mounted: function mounted() {
  468. /* istanbul ignore if */
  469. this.coreWidth = this.width || 40;
  470. if (this.activeColor || this.inactiveColor) {
  471. this.setBackgroundColor();
  472. }
  473. this.$refs.input.checked = this.checked;
  474. }
  475. });
  476. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=script&lang=js&
  477. /* harmony default export */ var src_componentvue_type_script_lang_js_ = (componentvue_type_script_lang_js_);
  478. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  479. var componentNormalizer = __webpack_require__(2);
  480. // CONCATENATED MODULE: ./packages/switch/src/component.vue
  481. /* normalize component */
  482. var component = Object(componentNormalizer["a" /* default */])(
  483. src_componentvue_type_script_lang_js_,
  484. render,
  485. staticRenderFns,
  486. false,
  487. null,
  488. null,
  489. null
  490. )
  491. /* hot reload */
  492. if (false) { var api; }
  493. component.options.__file = "packages/switch/src/component.vue"
  494. /* harmony default export */ var src_component = (component.exports);
  495. // CONCATENATED MODULE: ./packages/switch/index.js
  496. /* istanbul ignore next */
  497. src_component.install = function (Vue) {
  498. Vue.component(src_component.name, src_component);
  499. };
  500. /* harmony default export */ var packages_switch = __webpack_exports__["default"] = (src_component);
  501. /***/ }),
  502. /***/ 88:
  503. /***/ (function(module, exports) {
  504. module.exports = require("tis-ui/lib/mixins/focus");
  505. /***/ })
  506. /******/ });