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.

587 lines
17 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 = 570);
  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. /***/ 570:
  189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  190. "use strict";
  191. // ESM COMPAT FLAG
  192. __webpack_require__.r(__webpack_exports__);
  193. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  194. var render = function() {
  195. var _vm = this
  196. var _h = _vm.$createElement
  197. var _c = _vm._self._c || _h
  198. return _c(
  199. "label",
  200. {
  201. staticClass: "el-checkbox-button",
  202. class: [
  203. _vm.size ? "el-checkbox-button--" + _vm.size : "",
  204. { "is-disabled": _vm.isDisabled },
  205. { "is-checked": _vm.isChecked },
  206. { "is-focus": _vm.focus }
  207. ],
  208. attrs: {
  209. role: "checkbox",
  210. "aria-checked": _vm.isChecked,
  211. "aria-disabled": _vm.isDisabled
  212. }
  213. },
  214. [
  215. _vm.trueLabel || _vm.falseLabel
  216. ? _c("input", {
  217. directives: [
  218. {
  219. name: "model",
  220. rawName: "v-model",
  221. value: _vm.model,
  222. expression: "model"
  223. }
  224. ],
  225. staticClass: "el-checkbox-button__original",
  226. attrs: {
  227. type: "checkbox",
  228. name: _vm.name,
  229. disabled: _vm.isDisabled,
  230. "true-value": _vm.trueLabel,
  231. "false-value": _vm.falseLabel
  232. },
  233. domProps: {
  234. checked: Array.isArray(_vm.model)
  235. ? _vm._i(_vm.model, null) > -1
  236. : _vm._q(_vm.model, _vm.trueLabel)
  237. },
  238. on: {
  239. change: [
  240. function($event) {
  241. var $$a = _vm.model,
  242. $$el = $event.target,
  243. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  244. if (Array.isArray($$a)) {
  245. var $$v = null,
  246. $$i = _vm._i($$a, $$v)
  247. if ($$el.checked) {
  248. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  249. } else {
  250. $$i > -1 &&
  251. (_vm.model = $$a
  252. .slice(0, $$i)
  253. .concat($$a.slice($$i + 1)))
  254. }
  255. } else {
  256. _vm.model = $$c
  257. }
  258. },
  259. _vm.handleChange
  260. ],
  261. focus: function($event) {
  262. _vm.focus = true
  263. },
  264. blur: function($event) {
  265. _vm.focus = false
  266. }
  267. }
  268. })
  269. : _c("input", {
  270. directives: [
  271. {
  272. name: "model",
  273. rawName: "v-model",
  274. value: _vm.model,
  275. expression: "model"
  276. }
  277. ],
  278. staticClass: "el-checkbox-button__original",
  279. attrs: {
  280. type: "checkbox",
  281. name: _vm.name,
  282. disabled: _vm.isDisabled
  283. },
  284. domProps: {
  285. value: _vm.label,
  286. checked: Array.isArray(_vm.model)
  287. ? _vm._i(_vm.model, _vm.label) > -1
  288. : _vm.model
  289. },
  290. on: {
  291. change: [
  292. function($event) {
  293. var $$a = _vm.model,
  294. $$el = $event.target,
  295. $$c = $$el.checked ? true : false
  296. if (Array.isArray($$a)) {
  297. var $$v = _vm.label,
  298. $$i = _vm._i($$a, $$v)
  299. if ($$el.checked) {
  300. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  301. } else {
  302. $$i > -1 &&
  303. (_vm.model = $$a
  304. .slice(0, $$i)
  305. .concat($$a.slice($$i + 1)))
  306. }
  307. } else {
  308. _vm.model = $$c
  309. }
  310. },
  311. _vm.handleChange
  312. ],
  313. focus: function($event) {
  314. _vm.focus = true
  315. },
  316. blur: function($event) {
  317. _vm.focus = false
  318. }
  319. }
  320. }),
  321. _vm.$slots.default || _vm.label
  322. ? _c(
  323. "span",
  324. {
  325. staticClass: "el-checkbox-button__inner",
  326. style: _vm.isChecked ? _vm.activeStyle : null
  327. },
  328. [_vm._t("default", [_vm._v(_vm._s(_vm.label))])],
  329. 2
  330. )
  331. : _vm._e()
  332. ]
  333. )
  334. }
  335. var staticRenderFns = []
  336. render._withStripped = true
  337. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  338. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  339. var emitter_ = __webpack_require__(13);
  340. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  341. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. //
  387. /* harmony default export */ var checkbox_buttonvue_type_script_lang_js_ = ({
  388. name: 'TisCheckboxButton',
  389. mixins: [emitter_default.a],
  390. inject: {
  391. elForm: {
  392. default: ''
  393. },
  394. elFormItem: {
  395. default: ''
  396. }
  397. },
  398. data: function data() {
  399. return {
  400. selfModel: false,
  401. focus: false,
  402. isLimitExceeded: false
  403. };
  404. },
  405. props: {
  406. value: {},
  407. label: {},
  408. disabled: Boolean,
  409. checked: Boolean,
  410. name: String,
  411. trueLabel: [String, Number],
  412. falseLabel: [String, Number]
  413. },
  414. computed: {
  415. model: {
  416. get: function get() {
  417. return this._checkboxGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  418. },
  419. set: function set(val) {
  420. if (this._checkboxGroup) {
  421. this.isLimitExceeded = false;
  422. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  423. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  424. this.isLimitExceeded === false && this.dispatch('TisCheckboxGroup', 'input', [val]);
  425. } else if (this.value !== undefined) {
  426. this.$emit('input', val);
  427. } else {
  428. this.selfModel = val;
  429. }
  430. }
  431. },
  432. isChecked: function isChecked() {
  433. if ({}.toString.call(this.model) === '[object Boolean]') {
  434. return this.model;
  435. } else if (Array.isArray(this.model)) {
  436. return this.model.indexOf(this.label) > -1;
  437. } else if (this.model !== null && this.model !== undefined) {
  438. return this.model === this.trueLabel;
  439. }
  440. },
  441. _checkboxGroup: function _checkboxGroup() {
  442. var parent = this.$parent;
  443. while (parent) {
  444. if (parent.$options.componentName !== 'TisCheckboxGroup') {
  445. parent = parent.$parent;
  446. } else {
  447. return parent;
  448. }
  449. }
  450. return false;
  451. },
  452. store: function store() {
  453. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  454. },
  455. activeStyle: function activeStyle() {
  456. return {
  457. backgroundColor: this._checkboxGroup.fill || '',
  458. borderColor: this._checkboxGroup.fill || '',
  459. color: this._checkboxGroup.textColor || '',
  460. 'box-shadow': '-1px 0 0 0 ' + this._checkboxGroup.fill
  461. };
  462. },
  463. _elFormItemSize: function _elFormItemSize() {
  464. return (this.elFormItem || {}).elFormItemSize;
  465. },
  466. size: function size() {
  467. return this._checkboxGroup.checkboxGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  468. },
  469. /* used to make the isDisabled judgment under max/min props */
  470. isLimitDisabled: function isLimitDisabled() {
  471. var _checkboxGroup2 = this._checkboxGroup,
  472. max = _checkboxGroup2.max,
  473. min = _checkboxGroup2.min;
  474. return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
  475. },
  476. isDisabled: function isDisabled() {
  477. return this._checkboxGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
  478. }
  479. },
  480. methods: {
  481. addToStore: function addToStore() {
  482. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  483. this.model.push(this.label);
  484. } else {
  485. this.model = this.trueLabel || true;
  486. }
  487. },
  488. handleChange: function handleChange(ev) {
  489. var _this = this;
  490. if (this.isLimitExceeded) return;
  491. var value = void 0;
  492. if (ev.target.checked) {
  493. value = this.trueLabel === undefined ? true : this.trueLabel;
  494. } else {
  495. value = this.falseLabel === undefined ? false : this.falseLabel;
  496. }
  497. this.$emit('change', value, ev);
  498. this.$nextTick(function () {
  499. if (_this._checkboxGroup) {
  500. _this.dispatch('TisCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  501. }
  502. });
  503. }
  504. },
  505. created: function created() {
  506. this.checked && this.addToStore();
  507. }
  508. });
  509. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  510. /* harmony default export */ var src_checkbox_buttonvue_type_script_lang_js_ = (checkbox_buttonvue_type_script_lang_js_);
  511. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  512. var componentNormalizer = __webpack_require__(2);
  513. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue
  514. /* normalize component */
  515. var component = Object(componentNormalizer["a" /* default */])(
  516. src_checkbox_buttonvue_type_script_lang_js_,
  517. render,
  518. staticRenderFns,
  519. false,
  520. null,
  521. null,
  522. null
  523. )
  524. /* hot reload */
  525. if (false) { var api; }
  526. component.options.__file = "packages/checkbox/src/checkbox-button.vue"
  527. /* harmony default export */ var checkbox_button = (component.exports);
  528. // CONCATENATED MODULE: ./packages/checkbox-button/index.js
  529. /* istanbul ignore next */
  530. checkbox_button.install = function (Vue) {
  531. Vue.component(checkbox_button.name, checkbox_button);
  532. };
  533. /* harmony default export */ var packages_checkbox_button = __webpack_exports__["default"] = (checkbox_button);
  534. /***/ })
  535. /******/ });