ai.touchui-vue 1.33.3 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/lib/affix.js +2 -2
  2. package/lib/ai.touchui-vue.common.js +896 -909
  3. package/lib/align.js +2 -2
  4. package/lib/animation.js +2 -2
  5. package/lib/article.js +2 -2
  6. package/lib/box.js +2 -2
  7. package/lib/button.js +2 -2
  8. package/lib/calendar.js +2 -2
  9. package/lib/card-item.js +19 -19
  10. package/lib/card.js +178 -178
  11. package/lib/cascader.js +2 -2
  12. package/lib/center-scroll.js +2 -2
  13. package/lib/chat.js +4 -4
  14. package/lib/checkbox.js +11 -5
  15. package/lib/checkboxes.js +27 -5
  16. package/lib/collapse.js +768 -768
  17. package/lib/color.js +2 -2
  18. package/lib/countdown.js +2 -2
  19. package/lib/date-picker.js +1486 -1486
  20. package/lib/date-range.js +2 -2
  21. package/lib/dialog.js +27 -23
  22. package/lib/dis.js +2 -2
  23. package/lib/ellipsis.js +2 -2
  24. package/lib/emote.js +2 -2
  25. package/lib/export.js +10 -10
  26. package/lib/filter.js +2 -2
  27. package/lib/fix.js +2 -2
  28. package/lib/float.js +2 -2
  29. package/lib/flow.js +4 -4
  30. package/lib/form.js +2 -2
  31. package/lib/grid.js +2 -2
  32. package/lib/guider.js +2 -2
  33. package/lib/header.js +2 -2
  34. package/lib/hide.js +2 -2
  35. package/lib/icon.js +2 -2
  36. package/lib/import.js +12 -12
  37. package/lib/index.js +1 -1
  38. package/lib/input.js +2 -2
  39. package/lib/ip.js +2 -2
  40. package/lib/line.js +2 -2
  41. package/lib/loading.js +11 -11
  42. package/lib/longtap.js +2 -2
  43. package/lib/menu-icon.js +670 -673
  44. package/lib/message.js +2 -2
  45. package/lib/msg.js +19 -19
  46. package/lib/org.js +706 -706
  47. package/lib/padding.js +2 -2
  48. package/lib/page.js +4 -438
  49. package/lib/param.js +2 -2
  50. package/lib/pic.js +4 -4
  51. package/lib/popup.js +2 -2
  52. package/lib/progress.js +2 -2
  53. package/lib/range.js +1074 -1074
  54. package/lib/rate.js +2 -2
  55. package/lib/reverser.js +2 -2
  56. package/lib/scroll.js +2 -2
  57. package/lib/segment.js +2 -2
  58. package/lib/select.js +2 -2
  59. package/lib/size.js +2 -2
  60. package/lib/skeleton.js +2 -2
  61. package/lib/slide.js +2 -2
  62. package/lib/space.js +2 -2
  63. package/lib/step.js +2 -2
  64. package/lib/submit.js +2 -2
  65. package/lib/switch.js +2 -2
  66. package/lib/tab.js +2 -2
  67. package/lib/table.js +2 -2
  68. package/lib/tag.js +2 -2
  69. package/lib/theme/css/theme/workbench-gz.css +1 -0
  70. package/lib/timeline.js +2 -2
  71. package/lib/tip.js +2 -2
  72. package/lib/tooltip.js +2 -2
  73. package/lib/transfer.js +2 -2
  74. package/lib/tree.js +2 -2
  75. package/lib/upload.js +14 -14
  76. package/package.json +1 -1
  77. package/packages/checkbox/src/checkbox.vue +8 -2
  78. package/packages/checkboxes/src/checkboxes.vue +17 -1
  79. package/packages/dialog/src/dialog.vue +21 -18
  80. package/packages/page/src/page.vue +0 -22
  81. package/packages/tab/.DS_Store +0 -0
  82. package/packages/theme/lib/css/theme/workbench-gz.css +1 -0
  83. package/packages/theme/src/less/theme/workbench-gz.less +159 -0
  84. package/src/index.js +1 -1
package/lib/collapse.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 348);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 345);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,912 +192,912 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 20:
195
+ /***/ 11:
196
196
  /***/ (function(module, exports, __webpack_require__) {
197
197
 
198
- var content = __webpack_require__(99);
198
+ "use strict";
199
199
 
200
- if (typeof content === 'string') {
201
- content = [[module.i, content, '']];
202
- }
203
200
 
204
- var options = {}
201
+ /*
202
+ MIT License http://www.opensource.org/licenses/mit-license.php
203
+ Author Tobias Koppers @sokra
204
+ */
205
+ // css base code, injected by the css-loader
206
+ // eslint-disable-next-line func-names
207
+ module.exports = function (useSourceMap) {
208
+ var list = []; // return the list of modules as css string
205
209
 
206
- options.insert = "head";
207
- options.singleton = false;
210
+ list.toString = function toString() {
211
+ return this.map(function (item) {
212
+ var content = cssWithMappingToString(item, useSourceMap);
208
213
 
209
- var update = __webpack_require__(8)(content, options);
214
+ if (item[2]) {
215
+ return "@media ".concat(item[2], "{").concat(content, "}");
216
+ }
210
217
 
211
- if (content.locals) {
212
- module.exports = content.locals;
213
- }
218
+ return content;
219
+ }).join('');
220
+ }; // import a list of modules into the list
221
+ // eslint-disable-next-line func-names
214
222
 
215
223
 
216
- /***/ }),
224
+ list.i = function (modules, mediaQuery) {
225
+ if (typeof modules === 'string') {
226
+ // eslint-disable-next-line no-param-reassign
227
+ modules = [[null, modules, '']];
228
+ }
217
229
 
218
- /***/ 348:
219
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
230
+ var alreadyImportedModules = {};
220
231
 
221
- "use strict";
222
- // ESM COMPAT FLAG
223
- __webpack_require__.r(__webpack_exports__);
232
+ for (var i = 0; i < this.length; i++) {
233
+ // eslint-disable-next-line prefer-destructuring
234
+ var id = this[i][0];
224
235
 
225
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=template&id=05720247&scoped=true
226
- var render = function () {
227
- var _vm = this
228
- var _h = _vm.$createElement
229
- var _c = _vm._self._c || _h
230
- return _c(
231
- "div",
232
- { staticClass: "to-collapse", attrs: { id: "collapse" } },
233
- [_vm._t("default")],
234
- 2
235
- )
236
- }
237
- var staticRenderFns = []
238
- render._withStripped = true
236
+ if (id != null) {
237
+ alreadyImportedModules[id] = true;
238
+ }
239
+ }
239
240
 
241
+ for (var _i = 0; _i < modules.length; _i++) {
242
+ var item = modules[_i]; // skip already imported module
243
+ // this implementation is not 100% perfect for weird media query combinations
244
+ // when a module is imported multiple times with different media queries.
245
+ // I hope this will never occur (Hey this way we have smaller bundles)
240
246
 
241
- // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=05720247&scoped=true
247
+ if (item[0] == null || !alreadyImportedModules[item[0]]) {
248
+ if (mediaQuery && !item[2]) {
249
+ item[2] = mediaQuery;
250
+ } else if (mediaQuery) {
251
+ item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
252
+ }
242
253
 
243
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=script&lang=js
244
- //
245
- //
246
- //
247
- //
248
- //
254
+ list.push(item);
255
+ }
256
+ }
257
+ };
249
258
 
250
- /* harmony default export */ var collapsevue_type_script_lang_js = ({
251
- name: 'ToCollapse',
252
- componentName: 'ToCollapse',
253
- model: {
254
- // 当前激活面板改变时触发(如果是手风琴模式,参数 activeNames 类型为string,否则为array)
255
- event: 'change'
256
- },
257
- props: {
258
- value: {
259
- type: [String, Array],
260
- default: ''
261
- },
262
- // 是否默认展开所有
263
- expandAll: {
264
- type: Boolean,
265
- default: false
266
- },
267
- // 当前激活的面板(如果是手风琴模式,绑定值类型需要为string,否则为array)
268
- accordion: {
269
- type: Boolean,
270
- default: false
271
- }
272
- },
273
- data: function data() {
274
- return {
275
- actives: null,
276
- lastActive: null
277
- };
278
- },
259
+ return list;
260
+ };
279
261
 
280
- watch: {
281
- value: {
282
- handler: function handler() {
283
- var actives = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
262
+ function cssWithMappingToString(item, useSourceMap) {
263
+ var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
284
264
 
285
- this.setActives(actives);
286
- },
265
+ var cssMapping = item[3];
287
266
 
288
- immediate: true,
289
- deep: true
290
- },
291
- accordion: {
292
- handler: function handler() {
293
- this.setActives(this.actives);
294
- this.updateActivesModel();
295
- },
267
+ if (!cssMapping) {
268
+ return content;
269
+ }
296
270
 
297
- immediate: true,
298
- deep: true
299
- }
300
- },
301
- created: function created() {
302
- (!this.actives || this.actives.length === 0) && this.expandAll && this.toggleExpandAll();
303
- },
271
+ if (useSourceMap && typeof btoa === 'function') {
272
+ var sourceMapping = toComment(cssMapping);
273
+ var sourceURLs = cssMapping.sources.map(function (source) {
274
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
275
+ });
276
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
277
+ }
304
278
 
305
- methods: {
306
- setActives: function setActives() {
307
- var actives = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
279
+ return [content].join('\n');
280
+ } // Adapted from convert-source-map (MIT)
308
281
 
309
- actives = [].concat(Array.isArray(actives) ? actives : actives ? [actives] : []);
310
- if (this.accordion) {
311
- actives = actives.length > 0 ? [actives[0]] : [];
312
- }
313
- this.actives = actives;
314
- },
315
- updateActivesModel: function updateActivesModel() {
316
- this.$emit('change', this.accordion ? this.actives[0] : this.actives);
317
- },
318
282
 
319
- // 根据传入的数组 收起或展开 collapse-item
320
- toggleExpandAll: function toggleExpandAll() {
321
- var actives = [];
322
- var collapseItem = this.$slots.default || [];
323
- collapseItem.map(function () {
324
- var vnode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
325
- var _vnode$componentOptio = vnode.componentOptions,
326
- componentOptions = _vnode$componentOptio === undefined ? {} : _vnode$componentOptio;
327
- var _componentOptions$pro = componentOptions.propsData,
328
- propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro,
329
- tag = componentOptions.tag;
330
- var name = propsData.name;
283
+ function toComment(sourceMap) {
284
+ // eslint-disable-next-line no-undef
285
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
286
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
287
+ return "/*# ".concat(data, " */");
288
+ }
331
289
 
332
- if (tag === 'to-collapse-item') {
333
- actives.push(name);
334
- }
335
- });
336
- this.setActives(actives);
337
- this.updateActivesModel();
338
- },
290
+ /***/ }),
339
291
 
340
- // collapse 为true时 为收起
341
- change: function change(name, collapse) {
342
- if (this.accordion) {
343
- this.lastActive = this.actives[0];
344
- this.actives = collapse ? [] : name ? [name] : [];
345
- } else {
346
- if (collapse) {
347
- var index = this.actives.findIndex(function (nameItem) {
348
- return name === nameItem;
349
- });
350
- if (index > -1) this.actives.splice(index, 1);
351
- } else {
352
- this.actives.push(name);
353
- }
354
- }
355
- this.updateActivesModel();
356
- }
357
- }
358
- });
359
- // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js
360
- /* harmony default export */ var src_collapsevue_type_script_lang_js = (collapsevue_type_script_lang_js);
361
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
362
- var componentNormalizer = __webpack_require__(0);
292
+ /***/ 12:
293
+ /***/ (function(module, exports, __webpack_require__) {
363
294
 
364
- // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
295
+ "use strict";
365
296
 
366
297
 
298
+ var stylesInDom = {};
367
299
 
300
+ var isOldIE = function isOldIE() {
301
+ var memo;
302
+ return function memorize() {
303
+ if (typeof memo === 'undefined') {
304
+ // Test for IE <= 9 as proposed by Browserhacks
305
+ // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
306
+ // Tests for existence of standard globals is to allow style-loader
307
+ // to operate correctly into non-standard environments
308
+ // @see https://github.com/webpack-contrib/style-loader/issues/177
309
+ memo = Boolean(window && document && document.all && !window.atob);
310
+ }
368
311
 
312
+ return memo;
313
+ };
314
+ }();
369
315
 
370
- /* normalize component */
316
+ var getTarget = function getTarget() {
317
+ var memo = {};
318
+ return function memorize(target) {
319
+ if (typeof memo[target] === 'undefined') {
320
+ var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
371
321
 
372
- var component = Object(componentNormalizer["a" /* default */])(
373
- src_collapsevue_type_script_lang_js,
374
- render,
375
- staticRenderFns,
376
- false,
377
- null,
378
- "05720247",
379
- null
380
-
381
- )
322
+ if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
323
+ try {
324
+ // This will throw an exception if access to iframe is blocked
325
+ // due to cross-origin restrictions
326
+ styleTarget = styleTarget.contentDocument.head;
327
+ } catch (e) {
328
+ // istanbul ignore next
329
+ styleTarget = null;
330
+ }
331
+ }
382
332
 
383
- /* harmony default export */ var collapse = (component.exports);
384
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=template&id=30d49ba6&scoped=true
385
- var collapse_itemvue_type_template_id_30d49ba6_scoped_true_render = function () {
386
- var _vm = this
387
- var _h = _vm.$createElement
388
- var _c = _vm._self._c || _h
389
- return _c(
390
- "div",
391
- {
392
- staticClass: "to-collapse-item",
393
- attrs: { id: "collapse-item", role: "collapseItme", name: _vm.name },
394
- },
395
- [
396
- _c(
397
- "div",
398
- {
399
- directives: [
400
- {
401
- name: "size",
402
- rawName: "v-size",
403
- value: _vm.titleSize,
404
- expression: "titleSize",
405
- },
406
- ],
407
- staticClass:
408
- "to-header to-header-fillet-normal to-collapse-item-header",
409
- on: {
410
- click: function ($event) {
411
- $event.stopPropagation()
412
- return _vm.change()
413
- },
414
- },
415
- },
416
- [
417
- _c(
418
- "div",
419
- {
420
- staticClass: "text to-pointer",
421
- style: {
422
- paddingLeft: _vm.$slots.title ? 0 : "" + _vm.cpadding,
423
- paddingRight: "" + _vm.cpadding,
424
- },
425
- },
426
- [
427
- _c(
428
- "span",
429
- { on: { click: _vm.handleTitleClick } },
430
- [
431
- _vm._t("title", [
432
- _vm._v("\n\t\t\t\t\t" + _vm._s(_vm.title) + "\n\t\t\t\t"),
433
- ]),
434
- ],
435
- 2
436
- ),
437
- ]
438
- ),
439
- _c(
440
- "div",
441
- { staticClass: "fn to-collapse-icon-box" },
442
- [
443
- _vm._t("icon", [
444
- _c(
445
- "div",
446
- {
447
- staticClass: "to-icon-unfold ",
448
- class: {
449
- "to-collapse-item-icon-active": _vm.collapse,
450
- },
451
- style: {
452
- transition: _vm.isReady
453
- ? "transform " + _vm.duration + "ms ease-in-out"
454
- : "none",
455
- },
456
- },
457
- [_c("span")]
458
- ),
459
- ]),
460
- ],
461
- 2
462
- ),
463
- ]
464
- ),
465
- _c(
466
- "div",
467
- {
468
- staticClass: "collapse-item-content",
469
- style: {
470
- height: _vm.collapse ? "0px" : _vm.realHeight,
471
- overflow: "hidden",
472
- transition: _vm.isReady
473
- ? "height " + _vm.duration + "ms ease-in-out"
474
- : "none",
475
- },
476
- },
477
- [
478
- _c(
479
- "div",
480
- { ref: "contentBox", staticClass: "collapse-item-content__box" },
481
- [_vm._t("default")],
482
- 2
483
- ),
484
- ]
485
- ),
486
- _c("div", { staticClass: "to-line to-line-color-lightGray" }),
487
- ]
488
- )
333
+ memo[target] = styleTarget;
334
+ }
335
+
336
+ return memo[target];
337
+ };
338
+ }();
339
+
340
+ function listToStyles(list, options) {
341
+ var styles = [];
342
+ var newStyles = {};
343
+
344
+ for (var i = 0; i < list.length; i++) {
345
+ var item = list[i];
346
+ var id = options.base ? item[0] + options.base : item[0];
347
+ var css = item[1];
348
+ var media = item[2];
349
+ var sourceMap = item[3];
350
+ var part = {
351
+ css: css,
352
+ media: media,
353
+ sourceMap: sourceMap
354
+ };
355
+
356
+ if (!newStyles[id]) {
357
+ styles.push(newStyles[id] = {
358
+ id: id,
359
+ parts: [part]
360
+ });
361
+ } else {
362
+ newStyles[id].parts.push(part);
363
+ }
364
+ }
365
+
366
+ return styles;
489
367
  }
490
- var collapse_itemvue_type_template_id_30d49ba6_scoped_true_staticRenderFns = []
491
- collapse_itemvue_type_template_id_30d49ba6_scoped_true_render._withStripped = true
492
368
 
369
+ function addStylesToDom(styles, options) {
370
+ for (var i = 0; i < styles.length; i++) {
371
+ var item = styles[i];
372
+ var domStyle = stylesInDom[item.id];
373
+ var j = 0;
493
374
 
494
- // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=30d49ba6&scoped=true
375
+ if (domStyle) {
376
+ domStyle.refs++;
495
377
 
496
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js
497
- //
498
- //
499
- //
500
- //
501
- //
502
- //
503
- //
504
- //
505
- //
506
- //
507
- //
508
- //
509
- //
510
- //
511
- //
512
- //
513
- //
514
- //
515
- //
516
- //
517
- //
518
- //
519
- //
520
- //
521
- //
522
- //
523
- //
524
- //
525
- //
526
- //
527
- //
528
- //
529
- //
530
- //
531
- //
532
- //
533
- //
534
- //
535
- //
536
- //
537
- //
538
- //
539
- //
540
- //
541
- //
542
- //
543
- //
544
- //
545
- //
546
- //
547
- //
378
+ for (; j < domStyle.parts.length; j++) {
379
+ domStyle.parts[j](item.parts[j]);
380
+ }
548
381
 
549
- /* harmony default export */ var collapse_itemvue_type_script_lang_js = ({
550
- name: 'ToCollapseItem',
551
- componentName: 'ToCollapseItem',
552
- model: {
553
- event: 'change'
554
- },
555
- props: {
556
- // padding
557
- padding: { type: [Number, String], default: 1 },
558
- // 是否收起
559
- value: {
560
- type: [String, Boolean, Number],
561
- default: true
562
- },
563
- // 唯一标志符
564
- name: {
565
- type: [String, Number],
566
- default: ''
567
- },
568
- // 面板标题
569
- title: {
570
- type: String,
571
- default: ''
572
- },
573
- // 面板标题文字大小
574
- titleSize: {
575
- type: String,
576
- default: 'm'
577
- },
578
- disabled: {
579
- type: Boolean,
580
- default: false
581
- }
582
- },
583
- data: function data() {
584
- return {
585
- isReady: false,
586
- collapse: true,
587
- realHeight: '',
588
- duration: 250,
589
- collapseTimer: null
590
- };
591
- },
382
+ for (; j < item.parts.length; j++) {
383
+ domStyle.parts.push(addStyle(item.parts[j], options));
384
+ }
385
+ } else {
386
+ var parts = [];
592
387
 
593
- computed: {
594
- cpadding: function cpadding() {
595
- return this.toFixedPx(this.padding);
596
- },
597
- valueInParent: function valueInParent() {
598
- if (this.$parent && this.$parent.$vnode && this.$parent.$vnode.componentOptions.tag === 'to-collapse') {
599
- var actives = this.$parent.actives || [];
600
- return !actives.includes(this.name);
601
- } else {
602
- return undefined;
603
- }
604
- }
605
- },
606
- watch: {
607
- valueInParent: {
608
- handler: function handler(collapse) {
609
- this.handleCollapse(collapse);
610
- },
388
+ for (; j < item.parts.length; j++) {
389
+ parts.push(addStyle(item.parts[j], options));
390
+ }
611
391
 
612
- deep: true
613
- },
614
- value: {
615
- handler: function handler(collapse) {
616
- // 父级为to-collapse时
617
- if (this.valueInParent !== undefined) {
618
- collapse = this.valueInParent;
619
- } else {
620
- collapse = !!collapse;
621
- }
622
- this.handleCollapse(collapse);
623
- },
392
+ stylesInDom[item.id] = {
393
+ id: item.id,
394
+ refs: 1,
395
+ parts: parts
396
+ };
397
+ }
398
+ }
399
+ }
624
400
 
625
- immediate: true,
626
- deep: true
627
- }
628
- },
629
- methods: {
630
- handleTitleClick: function handleTitleClick(event) {
631
- this.$emit('titleClicked', event);
632
- },
633
- handleCollapse: function handleCollapse(collapse) {
634
- var _this = this;
401
+ function insertStyleElement(options) {
402
+ var style = document.createElement('style');
635
403
 
636
- if (this.disabled) return;
637
- this.$nextTick(function () {
638
- if (!_this.$refs.contentBox) return;
639
- _this.realHeight = _this.$refs.contentBox.clientHeight + 'px' || false;
640
- var macroTask = null;
641
- macroTask = setTimeout(function () {
642
- _this.collapse = collapse;
643
- clearTimeout(macroTask);
644
- clearTimeout(_this.collapseTimer);
645
- macroTask = null;
646
- _this.collapseTimer = null;
647
- _this.collapseTimer = setTimeout(function () {
648
- _this.isReady = true;
649
- _this.realHeight = 'auto';
650
- }, _this.duration);
651
- });
652
- });
653
- },
654
- change: function change(collapse) {
655
- if (this.disabled) return;
656
- collapse = collapse !== undefined ? collapse : !this.collapse;
657
- this.handleCollapse(collapse);
658
- this.$emit('change', collapse);
659
- typeof this.$parent.change === 'function' && this.$parent.change(this.name, collapse);
660
- },
661
- toFixedPx: function toFixedPx(num) {
662
- if (isNaN(Number(num))) {
663
- if (/(%|px|pt|em|rem)$/.test(num)) {
664
- return num;
665
- } else {
666
- return '100%';
667
- }
668
- } else {
669
- return num + 'em';
670
- }
671
- }
672
- }
673
- });
674
- // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js
675
- /* harmony default export */ var src_collapse_itemvue_type_script_lang_js = (collapse_itemvue_type_script_lang_js);
676
- // EXTERNAL MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=style&index=0&id=30d49ba6&prod&scoped=true&lang=css
677
- var collapse_itemvue_type_style_index_0_id_30d49ba6_prod_scoped_true_lang_css = __webpack_require__(98);
404
+ if (typeof options.attributes.nonce === 'undefined') {
405
+ var nonce = true ? __webpack_require__.nc : undefined;
678
406
 
679
- // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
407
+ if (nonce) {
408
+ options.attributes.nonce = nonce;
409
+ }
410
+ }
680
411
 
412
+ Object.keys(options.attributes).forEach(function (key) {
413
+ style.setAttribute(key, options.attributes[key]);
414
+ });
681
415
 
416
+ if (typeof options.insert === 'function') {
417
+ options.insert(style);
418
+ } else {
419
+ var target = getTarget(options.insert || 'head');
682
420
 
421
+ if (!target) {
422
+ throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
423
+ }
683
424
 
425
+ target.appendChild(style);
426
+ }
684
427
 
428
+ return style;
429
+ }
685
430
 
686
- /* normalize component */
431
+ function removeStyleElement(style) {
432
+ // istanbul ignore if
433
+ if (style.parentNode === null) {
434
+ return false;
435
+ }
687
436
 
688
- var collapse_item_component = Object(componentNormalizer["a" /* default */])(
689
- src_collapse_itemvue_type_script_lang_js,
690
- collapse_itemvue_type_template_id_30d49ba6_scoped_true_render,
691
- collapse_itemvue_type_template_id_30d49ba6_scoped_true_staticRenderFns,
692
- false,
693
- null,
694
- "30d49ba6",
695
- null
696
-
697
- )
437
+ style.parentNode.removeChild(style);
438
+ }
439
+ /* istanbul ignore next */
698
440
 
699
- /* harmony default export */ var collapse_item = (collapse_item_component.exports);
700
- // CONCATENATED MODULE: ./packages/collapse/index.js
701
441
 
442
+ var replaceText = function replaceText() {
443
+ var textStore = [];
444
+ return function replace(index, replacement) {
445
+ textStore[index] = replacement;
446
+ return textStore.filter(Boolean).join('\n');
447
+ };
448
+ }();
702
449
 
450
+ function applyToSingletonTag(style, index, remove, obj) {
451
+ var css = remove ? '' : obj.css; // For old IE
703
452
 
704
- /* istanbul ignore next */
705
- collapse.install = function (Vue) {
706
- Vue.component(collapse.name, collapse);
707
- Vue.component(collapse_item.name, collapse_item);
708
- };
453
+ /* istanbul ignore if */
709
454
 
710
- /* harmony default export */ var packages_collapse = __webpack_exports__["default"] = (collapse);
455
+ if (style.styleSheet) {
456
+ style.styleSheet.cssText = replaceText(index, css);
457
+ } else {
458
+ var cssNode = document.createTextNode(css);
459
+ var childNodes = style.childNodes;
711
460
 
712
- /***/ }),
461
+ if (childNodes[index]) {
462
+ style.removeChild(childNodes[index]);
463
+ }
713
464
 
714
- /***/ 7:
715
- /***/ (function(module, exports, __webpack_require__) {
465
+ if (childNodes.length) {
466
+ style.insertBefore(cssNode, childNodes[index]);
467
+ } else {
468
+ style.appendChild(cssNode);
469
+ }
470
+ }
471
+ }
716
472
 
717
- "use strict";
473
+ function applyToTag(style, options, obj) {
474
+ var css = obj.css;
475
+ var media = obj.media;
476
+ var sourceMap = obj.sourceMap;
718
477
 
478
+ if (media) {
479
+ style.setAttribute('media', media);
480
+ }
719
481
 
720
- /*
721
- MIT License http://www.opensource.org/licenses/mit-license.php
722
- Author Tobias Koppers @sokra
723
- */
724
- // css base code, injected by the css-loader
725
- // eslint-disable-next-line func-names
726
- module.exports = function (useSourceMap) {
727
- var list = []; // return the list of modules as css string
482
+ if (sourceMap && btoa) {
483
+ css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
484
+ } // For old IE
728
485
 
729
- list.toString = function toString() {
730
- return this.map(function (item) {
731
- var content = cssWithMappingToString(item, useSourceMap);
486
+ /* istanbul ignore if */
732
487
 
733
- if (item[2]) {
734
- return "@media ".concat(item[2], "{").concat(content, "}");
488
+
489
+ if (style.styleSheet) {
490
+ style.styleSheet.cssText = css;
491
+ } else {
492
+ while (style.firstChild) {
493
+ style.removeChild(style.firstChild);
494
+ }
495
+
496
+ style.appendChild(document.createTextNode(css));
497
+ }
498
+ }
499
+
500
+ var singleton = null;
501
+ var singletonCounter = 0;
502
+
503
+ function addStyle(obj, options) {
504
+ var style;
505
+ var update;
506
+ var remove;
507
+
508
+ if (options.singleton) {
509
+ var styleIndex = singletonCounter++;
510
+ style = singleton || (singleton = insertStyleElement(options));
511
+ update = applyToSingletonTag.bind(null, style, styleIndex, false);
512
+ remove = applyToSingletonTag.bind(null, style, styleIndex, true);
513
+ } else {
514
+ style = insertStyleElement(options);
515
+ update = applyToTag.bind(null, style, options);
516
+
517
+ remove = function remove() {
518
+ removeStyleElement(style);
519
+ };
520
+ }
521
+
522
+ update(obj);
523
+ return function updateStyle(newObj) {
524
+ if (newObj) {
525
+ if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
526
+ return;
735
527
  }
736
528
 
737
- return content;
738
- }).join('');
739
- }; // import a list of modules into the list
740
- // eslint-disable-next-line func-names
529
+ update(obj = newObj);
530
+ } else {
531
+ remove();
532
+ }
533
+ };
534
+ }
741
535
 
536
+ module.exports = function (list, options) {
537
+ options = options || {};
538
+ options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
539
+ // tags it will allow on a page
742
540
 
743
- list.i = function (modules, mediaQuery) {
744
- if (typeof modules === 'string') {
745
- // eslint-disable-next-line no-param-reassign
746
- modules = [[null, modules, '']];
747
- }
541
+ if (!options.singleton && typeof options.singleton !== 'boolean') {
542
+ options.singleton = isOldIE();
543
+ }
748
544
 
749
- var alreadyImportedModules = {};
545
+ var styles = listToStyles(list, options);
546
+ addStylesToDom(styles, options);
547
+ return function update(newList) {
548
+ var mayRemove = [];
750
549
 
751
- for (var i = 0; i < this.length; i++) {
752
- // eslint-disable-next-line prefer-destructuring
753
- var id = this[i][0];
550
+ for (var i = 0; i < styles.length; i++) {
551
+ var item = styles[i];
552
+ var domStyle = stylesInDom[item.id];
754
553
 
755
- if (id != null) {
756
- alreadyImportedModules[id] = true;
554
+ if (domStyle) {
555
+ domStyle.refs--;
556
+ mayRemove.push(domStyle);
757
557
  }
758
558
  }
759
559
 
760
- for (var _i = 0; _i < modules.length; _i++) {
761
- var item = modules[_i]; // skip already imported module
762
- // this implementation is not 100% perfect for weird media query combinations
763
- // when a module is imported multiple times with different media queries.
764
- // I hope this will never occur (Hey this way we have smaller bundles)
560
+ if (newList) {
561
+ var newStyles = listToStyles(newList, options);
562
+ addStylesToDom(newStyles, options);
563
+ }
765
564
 
766
- if (item[0] == null || !alreadyImportedModules[item[0]]) {
767
- if (mediaQuery && !item[2]) {
768
- item[2] = mediaQuery;
769
- } else if (mediaQuery) {
770
- item[2] = "(".concat(item[2], ") and (").concat(mediaQuery, ")");
565
+ for (var _i = 0; _i < mayRemove.length; _i++) {
566
+ var _domStyle = mayRemove[_i];
567
+
568
+ if (_domStyle.refs === 0) {
569
+ for (var j = 0; j < _domStyle.parts.length; j++) {
570
+ _domStyle.parts[j]();
771
571
  }
772
572
 
773
- list.push(item);
573
+ delete stylesInDom[_domStyle.id];
774
574
  }
775
575
  }
776
576
  };
777
-
778
- return list;
779
577
  };
780
578
 
781
- function cssWithMappingToString(item, useSourceMap) {
782
- var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
783
-
784
- var cssMapping = item[3];
785
-
786
- if (!cssMapping) {
787
- return content;
788
- }
789
-
790
- if (useSourceMap && typeof btoa === 'function') {
791
- var sourceMapping = toComment(cssMapping);
792
- var sourceURLs = cssMapping.sources.map(function (source) {
793
- return "/*# sourceURL=".concat(cssMapping.sourceRoot).concat(source, " */");
794
- });
795
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
796
- }
797
-
798
- return [content].join('\n');
799
- } // Adapted from convert-source-map (MIT)
800
-
801
-
802
- function toComment(sourceMap) {
803
- // eslint-disable-next-line no-undef
804
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
805
- var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
806
- return "/*# ".concat(data, " */");
807
- }
808
-
809
579
  /***/ }),
810
580
 
811
- /***/ 8:
581
+ /***/ 20:
812
582
  /***/ (function(module, exports, __webpack_require__) {
813
583
 
814
- "use strict";
815
-
584
+ var content = __webpack_require__(98);
816
585
 
817
- var stylesInDom = {};
818
-
819
- var isOldIE = function isOldIE() {
820
- var memo;
821
- return function memorize() {
822
- if (typeof memo === 'undefined') {
823
- // Test for IE <= 9 as proposed by Browserhacks
824
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
825
- // Tests for existence of standard globals is to allow style-loader
826
- // to operate correctly into non-standard environments
827
- // @see https://github.com/webpack-contrib/style-loader/issues/177
828
- memo = Boolean(window && document && document.all && !window.atob);
829
- }
586
+ if (typeof content === 'string') {
587
+ content = [[module.i, content, '']];
588
+ }
830
589
 
831
- return memo;
832
- };
833
- }();
590
+ var options = {}
834
591
 
835
- var getTarget = function getTarget() {
836
- var memo = {};
837
- return function memorize(target) {
838
- if (typeof memo[target] === 'undefined') {
839
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
592
+ options.insert = "head";
593
+ options.singleton = false;
840
594
 
841
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
842
- try {
843
- // This will throw an exception if access to iframe is blocked
844
- // due to cross-origin restrictions
845
- styleTarget = styleTarget.contentDocument.head;
846
- } catch (e) {
847
- // istanbul ignore next
848
- styleTarget = null;
849
- }
850
- }
595
+ var update = __webpack_require__(12)(content, options);
851
596
 
852
- memo[target] = styleTarget;
853
- }
597
+ if (content.locals) {
598
+ module.exports = content.locals;
599
+ }
854
600
 
855
- return memo[target];
856
- };
857
- }();
858
601
 
859
- function listToStyles(list, options) {
860
- var styles = [];
861
- var newStyles = {};
602
+ /***/ }),
862
603
 
863
- for (var i = 0; i < list.length; i++) {
864
- var item = list[i];
865
- var id = options.base ? item[0] + options.base : item[0];
866
- var css = item[1];
867
- var media = item[2];
868
- var sourceMap = item[3];
869
- var part = {
870
- css: css,
871
- media: media,
872
- sourceMap: sourceMap
873
- };
604
+ /***/ 345:
605
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
874
606
 
875
- if (!newStyles[id]) {
876
- styles.push(newStyles[id] = {
877
- id: id,
878
- parts: [part]
879
- });
880
- } else {
881
- newStyles[id].parts.push(part);
882
- }
883
- }
607
+ "use strict";
608
+ // ESM COMPAT FLAG
609
+ __webpack_require__.r(__webpack_exports__);
884
610
 
885
- return styles;
611
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=template&id=05720247&scoped=true
612
+ var render = function () {
613
+ var _vm = this
614
+ var _h = _vm.$createElement
615
+ var _c = _vm._self._c || _h
616
+ return _c(
617
+ "div",
618
+ { staticClass: "to-collapse", attrs: { id: "collapse" } },
619
+ [_vm._t("default")],
620
+ 2
621
+ )
886
622
  }
623
+ var staticRenderFns = []
624
+ render._withStripped = true
887
625
 
888
- function addStylesToDom(styles, options) {
889
- for (var i = 0; i < styles.length; i++) {
890
- var item = styles[i];
891
- var domStyle = stylesInDom[item.id];
892
- var j = 0;
893
-
894
- if (domStyle) {
895
- domStyle.refs++;
896
-
897
- for (; j < domStyle.parts.length; j++) {
898
- domStyle.parts[j](item.parts[j]);
899
- }
900
626
 
901
- for (; j < item.parts.length; j++) {
902
- domStyle.parts.push(addStyle(item.parts[j], options));
903
- }
904
- } else {
905
- var parts = [];
627
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=05720247&scoped=true
906
628
 
907
- for (; j < item.parts.length; j++) {
908
- parts.push(addStyle(item.parts[j], options));
909
- }
629
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=script&lang=js
630
+ //
631
+ //
632
+ //
633
+ //
634
+ //
910
635
 
911
- stylesInDom[item.id] = {
912
- id: item.id,
913
- refs: 1,
914
- parts: parts
915
- };
916
- }
917
- }
918
- }
636
+ /* harmony default export */ var collapsevue_type_script_lang_js = ({
637
+ name: 'ToCollapse',
638
+ componentName: 'ToCollapse',
639
+ model: {
640
+ // 当前激活面板改变时触发(如果是手风琴模式,参数 activeNames 类型为string,否则为array)
641
+ event: 'change'
642
+ },
643
+ props: {
644
+ value: {
645
+ type: [String, Array],
646
+ default: ''
647
+ },
648
+ // 是否默认展开所有
649
+ expandAll: {
650
+ type: Boolean,
651
+ default: false
652
+ },
653
+ // 当前激活的面板(如果是手风琴模式,绑定值类型需要为string,否则为array)
654
+ accordion: {
655
+ type: Boolean,
656
+ default: false
657
+ }
658
+ },
659
+ data: function data() {
660
+ return {
661
+ actives: null,
662
+ lastActive: null
663
+ };
664
+ },
919
665
 
920
- function insertStyleElement(options) {
921
- var style = document.createElement('style');
666
+ watch: {
667
+ value: {
668
+ handler: function handler() {
669
+ var actives = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
922
670
 
923
- if (typeof options.attributes.nonce === 'undefined') {
924
- var nonce = true ? __webpack_require__.nc : undefined;
671
+ this.setActives(actives);
672
+ },
925
673
 
926
- if (nonce) {
927
- options.attributes.nonce = nonce;
928
- }
929
- }
674
+ immediate: true,
675
+ deep: true
676
+ },
677
+ accordion: {
678
+ handler: function handler() {
679
+ this.setActives(this.actives);
680
+ this.updateActivesModel();
681
+ },
930
682
 
931
- Object.keys(options.attributes).forEach(function (key) {
932
- style.setAttribute(key, options.attributes[key]);
933
- });
683
+ immediate: true,
684
+ deep: true
685
+ }
686
+ },
687
+ created: function created() {
688
+ (!this.actives || this.actives.length === 0) && this.expandAll && this.toggleExpandAll();
689
+ },
934
690
 
935
- if (typeof options.insert === 'function') {
936
- options.insert(style);
937
- } else {
938
- var target = getTarget(options.insert || 'head');
691
+ methods: {
692
+ setActives: function setActives() {
693
+ var actives = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
939
694
 
940
- if (!target) {
941
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
942
- }
695
+ actives = [].concat(Array.isArray(actives) ? actives : actives ? [actives] : []);
696
+ if (this.accordion) {
697
+ actives = actives.length > 0 ? [actives[0]] : [];
698
+ }
699
+ this.actives = actives;
700
+ },
701
+ updateActivesModel: function updateActivesModel() {
702
+ this.$emit('change', this.accordion ? this.actives[0] : this.actives);
703
+ },
943
704
 
944
- target.appendChild(style);
945
- }
705
+ // 根据传入的数组 收起或展开 collapse-item
706
+ toggleExpandAll: function toggleExpandAll() {
707
+ var actives = [];
708
+ var collapseItem = this.$slots.default || [];
709
+ collapseItem.map(function () {
710
+ var vnode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
711
+ var _vnode$componentOptio = vnode.componentOptions,
712
+ componentOptions = _vnode$componentOptio === undefined ? {} : _vnode$componentOptio;
713
+ var _componentOptions$pro = componentOptions.propsData,
714
+ propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro,
715
+ tag = componentOptions.tag;
716
+ var name = propsData.name;
946
717
 
947
- return style;
948
- }
718
+ if (tag === 'to-collapse-item') {
719
+ actives.push(name);
720
+ }
721
+ });
722
+ this.setActives(actives);
723
+ this.updateActivesModel();
724
+ },
949
725
 
950
- function removeStyleElement(style) {
951
- // istanbul ignore if
952
- if (style.parentNode === null) {
953
- return false;
954
- }
726
+ // collapse 为true时 为收起
727
+ change: function change(name, collapse) {
728
+ if (this.accordion) {
729
+ this.lastActive = this.actives[0];
730
+ this.actives = collapse ? [] : name ? [name] : [];
731
+ } else {
732
+ if (collapse) {
733
+ var index = this.actives.findIndex(function (nameItem) {
734
+ return name === nameItem;
735
+ });
736
+ if (index > -1) this.actives.splice(index, 1);
737
+ } else {
738
+ this.actives.push(name);
739
+ }
740
+ }
741
+ this.updateActivesModel();
742
+ }
743
+ }
744
+ });
745
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js
746
+ /* harmony default export */ var src_collapsevue_type_script_lang_js = (collapsevue_type_script_lang_js);
747
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
748
+ var componentNormalizer = __webpack_require__(0);
955
749
 
956
- style.parentNode.removeChild(style);
957
- }
958
- /* istanbul ignore next */
750
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
959
751
 
960
752
 
961
- var replaceText = function replaceText() {
962
- var textStore = [];
963
- return function replace(index, replacement) {
964
- textStore[index] = replacement;
965
- return textStore.filter(Boolean).join('\n');
966
- };
967
- }();
968
753
 
969
- function applyToSingletonTag(style, index, remove, obj) {
970
- var css = remove ? '' : obj.css; // For old IE
971
754
 
972
- /* istanbul ignore if */
973
755
 
974
- if (style.styleSheet) {
975
- style.styleSheet.cssText = replaceText(index, css);
976
- } else {
977
- var cssNode = document.createTextNode(css);
978
- var childNodes = style.childNodes;
756
+ /* normalize component */
979
757
 
980
- if (childNodes[index]) {
981
- style.removeChild(childNodes[index]);
982
- }
758
+ var component = Object(componentNormalizer["a" /* default */])(
759
+ src_collapsevue_type_script_lang_js,
760
+ render,
761
+ staticRenderFns,
762
+ false,
763
+ null,
764
+ "05720247",
765
+ null
766
+
767
+ )
983
768
 
984
- if (childNodes.length) {
985
- style.insertBefore(cssNode, childNodes[index]);
986
- } else {
987
- style.appendChild(cssNode);
988
- }
989
- }
769
+ /* harmony default export */ var collapse = (component.exports);
770
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=template&id=30d49ba6&scoped=true
771
+ var collapse_itemvue_type_template_id_30d49ba6_scoped_true_render = function () {
772
+ var _vm = this
773
+ var _h = _vm.$createElement
774
+ var _c = _vm._self._c || _h
775
+ return _c(
776
+ "div",
777
+ {
778
+ staticClass: "to-collapse-item",
779
+ attrs: { id: "collapse-item", role: "collapseItme", name: _vm.name },
780
+ },
781
+ [
782
+ _c(
783
+ "div",
784
+ {
785
+ directives: [
786
+ {
787
+ name: "size",
788
+ rawName: "v-size",
789
+ value: _vm.titleSize,
790
+ expression: "titleSize",
791
+ },
792
+ ],
793
+ staticClass:
794
+ "to-header to-header-fillet-normal to-collapse-item-header",
795
+ on: {
796
+ click: function ($event) {
797
+ $event.stopPropagation()
798
+ return _vm.change()
799
+ },
800
+ },
801
+ },
802
+ [
803
+ _c(
804
+ "div",
805
+ {
806
+ staticClass: "text to-pointer",
807
+ style: {
808
+ paddingLeft: _vm.$slots.title ? 0 : "" + _vm.cpadding,
809
+ paddingRight: "" + _vm.cpadding,
810
+ },
811
+ },
812
+ [
813
+ _c(
814
+ "span",
815
+ { on: { click: _vm.handleTitleClick } },
816
+ [
817
+ _vm._t("title", [
818
+ _vm._v("\n\t\t\t\t\t" + _vm._s(_vm.title) + "\n\t\t\t\t"),
819
+ ]),
820
+ ],
821
+ 2
822
+ ),
823
+ ]
824
+ ),
825
+ _c(
826
+ "div",
827
+ { staticClass: "fn to-collapse-icon-box" },
828
+ [
829
+ _vm._t("icon", [
830
+ _c(
831
+ "div",
832
+ {
833
+ staticClass: "to-icon-unfold ",
834
+ class: {
835
+ "to-collapse-item-icon-active": _vm.collapse,
836
+ },
837
+ style: {
838
+ transition: _vm.isReady
839
+ ? "transform " + _vm.duration + "ms ease-in-out"
840
+ : "none",
841
+ },
842
+ },
843
+ [_c("span")]
844
+ ),
845
+ ]),
846
+ ],
847
+ 2
848
+ ),
849
+ ]
850
+ ),
851
+ _c(
852
+ "div",
853
+ {
854
+ staticClass: "collapse-item-content",
855
+ style: {
856
+ height: _vm.collapse ? "0px" : _vm.realHeight,
857
+ overflow: "hidden",
858
+ transition: _vm.isReady
859
+ ? "height " + _vm.duration + "ms ease-in-out"
860
+ : "none",
861
+ },
862
+ },
863
+ [
864
+ _c(
865
+ "div",
866
+ { ref: "contentBox", staticClass: "collapse-item-content__box" },
867
+ [_vm._t("default")],
868
+ 2
869
+ ),
870
+ ]
871
+ ),
872
+ _c("div", { staticClass: "to-line to-line-color-lightGray" }),
873
+ ]
874
+ )
990
875
  }
876
+ var collapse_itemvue_type_template_id_30d49ba6_scoped_true_staticRenderFns = []
877
+ collapse_itemvue_type_template_id_30d49ba6_scoped_true_render._withStripped = true
991
878
 
992
- function applyToTag(style, options, obj) {
993
- var css = obj.css;
994
- var media = obj.media;
995
- var sourceMap = obj.sourceMap;
996
-
997
- if (media) {
998
- style.setAttribute('media', media);
999
- }
1000
-
1001
- if (sourceMap && btoa) {
1002
- css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
1003
- } // For old IE
1004
879
 
1005
- /* istanbul ignore if */
880
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=30d49ba6&scoped=true
1006
881
 
882
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js
883
+ //
884
+ //
885
+ //
886
+ //
887
+ //
888
+ //
889
+ //
890
+ //
891
+ //
892
+ //
893
+ //
894
+ //
895
+ //
896
+ //
897
+ //
898
+ //
899
+ //
900
+ //
901
+ //
902
+ //
903
+ //
904
+ //
905
+ //
906
+ //
907
+ //
908
+ //
909
+ //
910
+ //
911
+ //
912
+ //
913
+ //
914
+ //
915
+ //
916
+ //
917
+ //
918
+ //
919
+ //
920
+ //
921
+ //
922
+ //
923
+ //
924
+ //
925
+ //
926
+ //
927
+ //
928
+ //
929
+ //
930
+ //
931
+ //
932
+ //
933
+ //
1007
934
 
1008
- if (style.styleSheet) {
1009
- style.styleSheet.cssText = css;
1010
- } else {
1011
- while (style.firstChild) {
1012
- style.removeChild(style.firstChild);
1013
- }
935
+ /* harmony default export */ var collapse_itemvue_type_script_lang_js = ({
936
+ name: 'ToCollapseItem',
937
+ componentName: 'ToCollapseItem',
938
+ model: {
939
+ event: 'change'
940
+ },
941
+ props: {
942
+ // padding
943
+ padding: { type: [Number, String], default: 1 },
944
+ // 是否收起
945
+ value: {
946
+ type: [String, Boolean, Number],
947
+ default: true
948
+ },
949
+ // 唯一标志符
950
+ name: {
951
+ type: [String, Number],
952
+ default: ''
953
+ },
954
+ // 面板标题
955
+ title: {
956
+ type: String,
957
+ default: ''
958
+ },
959
+ // 面板标题文字大小
960
+ titleSize: {
961
+ type: String,
962
+ default: 'm'
963
+ },
964
+ disabled: {
965
+ type: Boolean,
966
+ default: false
967
+ }
968
+ },
969
+ data: function data() {
970
+ return {
971
+ isReady: false,
972
+ collapse: true,
973
+ realHeight: '',
974
+ duration: 250,
975
+ collapseTimer: null
976
+ };
977
+ },
1014
978
 
1015
- style.appendChild(document.createTextNode(css));
1016
- }
1017
- }
979
+ computed: {
980
+ cpadding: function cpadding() {
981
+ return this.toFixedPx(this.padding);
982
+ },
983
+ valueInParent: function valueInParent() {
984
+ if (this.$parent && this.$parent.$vnode && this.$parent.$vnode.componentOptions.tag === 'to-collapse') {
985
+ var actives = this.$parent.actives || [];
986
+ return !actives.includes(this.name);
987
+ } else {
988
+ return undefined;
989
+ }
990
+ }
991
+ },
992
+ watch: {
993
+ valueInParent: {
994
+ handler: function handler(collapse) {
995
+ this.handleCollapse(collapse);
996
+ },
1018
997
 
1019
- var singleton = null;
1020
- var singletonCounter = 0;
998
+ deep: true
999
+ },
1000
+ value: {
1001
+ handler: function handler(collapse) {
1002
+ // 父级为to-collapse时
1003
+ if (this.valueInParent !== undefined) {
1004
+ collapse = this.valueInParent;
1005
+ } else {
1006
+ collapse = !!collapse;
1007
+ }
1008
+ this.handleCollapse(collapse);
1009
+ },
1021
1010
 
1022
- function addStyle(obj, options) {
1023
- var style;
1024
- var update;
1025
- var remove;
1011
+ immediate: true,
1012
+ deep: true
1013
+ }
1014
+ },
1015
+ methods: {
1016
+ handleTitleClick: function handleTitleClick(event) {
1017
+ this.$emit('titleClicked', event);
1018
+ },
1019
+ handleCollapse: function handleCollapse(collapse) {
1020
+ var _this = this;
1026
1021
 
1027
- if (options.singleton) {
1028
- var styleIndex = singletonCounter++;
1029
- style = singleton || (singleton = insertStyleElement(options));
1030
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
1031
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
1032
- } else {
1033
- style = insertStyleElement(options);
1034
- update = applyToTag.bind(null, style, options);
1022
+ if (this.disabled) return;
1023
+ this.$nextTick(function () {
1024
+ if (!_this.$refs.contentBox) return;
1025
+ _this.realHeight = _this.$refs.contentBox.clientHeight + 'px' || false;
1026
+ var macroTask = null;
1027
+ macroTask = setTimeout(function () {
1028
+ _this.collapse = collapse;
1029
+ clearTimeout(macroTask);
1030
+ clearTimeout(_this.collapseTimer);
1031
+ macroTask = null;
1032
+ _this.collapseTimer = null;
1033
+ _this.collapseTimer = setTimeout(function () {
1034
+ _this.isReady = true;
1035
+ _this.realHeight = 'auto';
1036
+ }, _this.duration);
1037
+ });
1038
+ });
1039
+ },
1040
+ change: function change(collapse) {
1041
+ if (this.disabled) return;
1042
+ collapse = collapse !== undefined ? collapse : !this.collapse;
1043
+ this.handleCollapse(collapse);
1044
+ this.$emit('change', collapse);
1045
+ typeof this.$parent.change === 'function' && this.$parent.change(this.name, collapse);
1046
+ },
1047
+ toFixedPx: function toFixedPx(num) {
1048
+ if (isNaN(Number(num))) {
1049
+ if (/(%|px|pt|em|rem)$/.test(num)) {
1050
+ return num;
1051
+ } else {
1052
+ return '100%';
1053
+ }
1054
+ } else {
1055
+ return num + 'em';
1056
+ }
1057
+ }
1058
+ }
1059
+ });
1060
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js
1061
+ /* harmony default export */ var src_collapse_itemvue_type_script_lang_js = (collapse_itemvue_type_script_lang_js);
1062
+ // EXTERNAL MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=style&index=0&id=30d49ba6&prod&scoped=true&lang=css
1063
+ var collapse_itemvue_type_style_index_0_id_30d49ba6_prod_scoped_true_lang_css = __webpack_require__(97);
1035
1064
 
1036
- remove = function remove() {
1037
- removeStyleElement(style);
1038
- };
1039
- }
1065
+ // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
1040
1066
 
1041
- update(obj);
1042
- return function updateStyle(newObj) {
1043
- if (newObj) {
1044
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
1045
- return;
1046
- }
1047
1067
 
1048
- update(obj = newObj);
1049
- } else {
1050
- remove();
1051
- }
1052
- };
1053
- }
1054
1068
 
1055
- module.exports = function (list, options) {
1056
- options = options || {};
1057
- options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
1058
- // tags it will allow on a page
1059
1069
 
1060
- if (!options.singleton && typeof options.singleton !== 'boolean') {
1061
- options.singleton = isOldIE();
1062
- }
1063
1070
 
1064
- var styles = listToStyles(list, options);
1065
- addStylesToDom(styles, options);
1066
- return function update(newList) {
1067
- var mayRemove = [];
1068
1071
 
1069
- for (var i = 0; i < styles.length; i++) {
1070
- var item = styles[i];
1071
- var domStyle = stylesInDom[item.id];
1072
+ /* normalize component */
1072
1073
 
1073
- if (domStyle) {
1074
- domStyle.refs--;
1075
- mayRemove.push(domStyle);
1076
- }
1077
- }
1074
+ var collapse_item_component = Object(componentNormalizer["a" /* default */])(
1075
+ src_collapse_itemvue_type_script_lang_js,
1076
+ collapse_itemvue_type_template_id_30d49ba6_scoped_true_render,
1077
+ collapse_itemvue_type_template_id_30d49ba6_scoped_true_staticRenderFns,
1078
+ false,
1079
+ null,
1080
+ "30d49ba6",
1081
+ null
1082
+
1083
+ )
1078
1084
 
1079
- if (newList) {
1080
- var newStyles = listToStyles(newList, options);
1081
- addStylesToDom(newStyles, options);
1082
- }
1085
+ /* harmony default export */ var collapse_item = (collapse_item_component.exports);
1086
+ // CONCATENATED MODULE: ./packages/collapse/index.js
1083
1087
 
1084
- for (var _i = 0; _i < mayRemove.length; _i++) {
1085
- var _domStyle = mayRemove[_i];
1086
1088
 
1087
- if (_domStyle.refs === 0) {
1088
- for (var j = 0; j < _domStyle.parts.length; j++) {
1089
- _domStyle.parts[j]();
1090
- }
1091
1089
 
1092
- delete stylesInDom[_domStyle.id];
1093
- }
1094
- }
1095
- };
1090
+ /* istanbul ignore next */
1091
+ collapse.install = function (Vue) {
1092
+ Vue.component(collapse.name, collapse);
1093
+ Vue.component(collapse_item.name, collapse_item);
1096
1094
  };
1097
1095
 
1096
+ /* harmony default export */ var packages_collapse = __webpack_exports__["default"] = (collapse);
1097
+
1098
1098
  /***/ }),
1099
1099
 
1100
- /***/ 98:
1100
+ /***/ 97:
1101
1101
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1102
1102
 
1103
1103
  "use strict";
@@ -1108,10 +1108,10 @@ module.exports = function (list, options) {
1108
1108
 
1109
1109
  /***/ }),
1110
1110
 
1111
- /***/ 99:
1111
+ /***/ 98:
1112
1112
  /***/ (function(module, exports, __webpack_require__) {
1113
1113
 
1114
- exports = module.exports = __webpack_require__(7)(false);
1114
+ exports = module.exports = __webpack_require__(11)(false);
1115
1115
  // Module
1116
1116
  exports.push([module.i, "\n.to-pointer[data-v-30d49ba6] {\n\tcursor: pointer;\n}\n.to-collapse-item-icon-active[data-v-30d49ba6] {\n\ttransform: rotate(-90deg);\n}\n.to-collapse-icon-box .to-icon-unfold[data-v-30d49ba6] {\n\ttext-align: right !important;\n\twidth: 1em !important;\n}\n.to-collapse-item > .to-header > .text[data-v-30d49ba6]{\n\tfont-size: inherit;\n}\n", ""]);
1117
1117