ai.touchui-vue 1.34.1 → 1.34.2

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.
@@ -31,6 +31,14 @@
31
31
  <slot>
32
32
  <to-button v-if="cancelButtonText" icon="close" fillet="normal" @click="cancel">{{ cancelButtonText }}</to-button>
33
33
  <to-button v-if="confirmButtonText" icon="ok" color="primary" fillet="normal" @click="confirm">{{ confirmButtonText }}</to-button>
34
+ <to-button
35
+ v-for="(btn, index) in buttons"
36
+ :key="index"
37
+ v-bind="btn.attrs"
38
+ @click="handleButtonClick(btn)"
39
+ >
40
+ {{ btn.label }}
41
+ </to-button>
34
42
  </slot>
35
43
  </div>
36
44
  </div>
@@ -112,7 +120,13 @@ export default {
112
120
  default: 0
113
121
  },
114
122
  global: Boolean,
115
- show: Boolean
123
+ show: Boolean,
124
+ buttons: {
125
+ type: Array,
126
+ default: () => {
127
+ return []
128
+ }
129
+ }
116
130
  },
117
131
  data() {
118
132
  return {
@@ -221,6 +235,11 @@ export default {
221
235
  cancel() {
222
236
  this.visible = false
223
237
  this.$emit('close')
238
+ },
239
+ handleButtonClick(btn) {
240
+ if (typeof btn.fn === 'function') {
241
+ btn.fn()
242
+ }
224
243
  }
225
244
  }
226
245
  };
@@ -119,10 +119,10 @@ export default {
119
119
  return
120
120
  }
121
121
  this.animate = true
122
- if (this.dis > 0) {
122
+ if (this.dis > 10) {
123
123
  this.prev()
124
124
  this.dis = 0
125
- } else {
125
+ } else if (this.dis < -10) {
126
126
  this.next()
127
127
  this.dis = 0
128
128
  }
@@ -25,7 +25,7 @@ export default {
25
25
  },
26
26
  computed: {
27
27
  setStyle() {
28
- if (this.type === 'inline') {
28
+ if (this.type === 'inline' || this.inline) {
29
29
  return {
30
30
  width: this.value + 'em'
31
31
  }
@@ -83,7 +83,7 @@
83
83
  <template v-if="column._isFirst && dataItem._level">
84
84
  <to-space v-for="spaceIndex in (dataItem._level - 1)" :key="spaceIndex" :value="1.5" type="inline"></to-space>
85
85
  </template>
86
- <to-icon v-if="dataItem._hasChild && column._isFirst" class="folder" fillet="normal" :value="dataItem._showChild ? 'unfold':'next'" color="info" mode="none" link @click.stop="toggleFold(dataItem,dataIndex)"></to-icon>
86
+ <to-icon v-if="dataItem._hasChild && column._isFirst" class="folder" fillet="normal" :value="dataItem._showChild ? 'unfold':'next'" color="info" mode="none" link @click.stop="toggleFold(dataItem,dataIndex,true)"></to-icon>
87
87
  <slot :name="column.prop" :row="dataItem" :column="column" :index="dataIndex">
88
88
  <template v-if="typeof column.formatter === 'function'">
89
89
  <div v-html="column.formatter(dataItem,column,dataItem[column.prop],dataIndex)"></div>
@@ -227,7 +227,7 @@ export default {
227
227
  },
228
228
  inject: ['ToTable'],
229
229
  methods: {
230
- toggleFold(item, index) {
230
+ toggleFold(item, index, type) {
231
231
  let that = this
232
232
  if (!item._showChild) {
233
233
  item._showChild = true
@@ -238,7 +238,11 @@ export default {
238
238
  const el = this.data[i];
239
239
  if (item._showChild) {
240
240
  if (el._level === item._level + 1) {
241
- el._show = true
241
+ if (type) {
242
+ el._show = true
243
+ } else {
244
+ show(el, i)
245
+ }
242
246
  } else if (el._level <= item._level) {
243
247
  break
244
248
  }
@@ -264,6 +268,84 @@ export default {
264
268
  }
265
269
  }
266
270
  }
271
+ function show(tr, index) {
272
+ tr._show = true
273
+ tr._showChild = true
274
+ if (tr._hasChild) {
275
+ for (let i = index + 1; i < that.data.length; i++) {
276
+ const el = that.data[i];
277
+ if (el._level === tr._level + 1) {
278
+ show(el, i)
279
+ } else {
280
+ break
281
+ }
282
+ }
283
+ }
284
+ }
285
+ this.ToTable.adjust()
286
+ },
287
+ // 展开全部
288
+ expandAll(item, index, type) {
289
+ let that = this
290
+ item._showChild = true
291
+ for (let i = index + 1; i < this.data.length; i++) {
292
+ const el = this.data[i];
293
+ if (item._showChild) {
294
+ if (el._level === item._level + 1) {
295
+ if (type) {
296
+ el._show = true
297
+ } else {
298
+ show(el, i)
299
+ }
300
+ } else if (el._level <= item._level) {
301
+ break
302
+ }
303
+ }
304
+ }
305
+ function show(tr, index) {
306
+ tr._show = true
307
+ tr._showChild = true
308
+ if (tr._hasChild) {
309
+ for (let i = index + 1; i < that.data.length; i++) {
310
+ const el = that.data[i];
311
+ if (el._level === tr._level + 1) {
312
+ show(el, i)
313
+ } else {
314
+ break
315
+ }
316
+ }
317
+ }
318
+ }
319
+ this.ToTable.adjust()
320
+ },
321
+ // 收起全部
322
+ collapseAll(item, index) {
323
+ let that = this
324
+ item._showChild = false
325
+ for (let i = index + 1; i < this.data.length; i++) {
326
+ const el = this.data[i];
327
+ if (!item._showChild) {
328
+ if (el._level === item._level + 1) {
329
+ hide(el, i)
330
+ } else if (el._level <= item._level) {
331
+ break
332
+ }
333
+ }
334
+ }
335
+ function hide(tr, index) {
336
+ tr._show = false
337
+ tr._showChild = false
338
+ if (tr._hasChild) {
339
+ for (let i = index + 1; i < that.data.length; i++) {
340
+ const el = that.data[i];
341
+ if (el._level === tr._level + 1) {
342
+ hide(el, i)
343
+ } else {
344
+ break
345
+ }
346
+ }
347
+ }
348
+ }
267
349
  this.ToTable.adjust()
268
350
  },
269
351
  clickHandle(event) {
@@ -72,7 +72,11 @@
72
72
  <template slot="toTitle" slot-scope="{row,index}">
73
73
  <slot name="toTitle" :row="row" :index="index"></slot>
74
74
  </template>
75
- <template v-for="columnx in flatColumns" :slot="columnx.prop" slot-scope="{row,column,index}">
75
+ <template
76
+ v-for="columnx in flatColumns"
77
+ :slot="columnx.prop"
78
+ slot-scope="{row,column,index}"
79
+ >
76
80
  <slot :name="columnx.prop" :row="row" :column="column" :index="index"></slot>
77
81
  </template>
78
82
  </table-body>
@@ -365,7 +369,8 @@ export default {
365
369
  fixed: false,
366
370
  isStartLongtap: false,
367
371
  longtapTimer: null,
368
- stopClick: false
372
+ stopClick: false,
373
+ expandFlag: true
369
374
  };
370
375
  },
371
376
  computed: {
@@ -1452,6 +1457,37 @@ export default {
1452
1457
  },
1453
1458
  columnChangeHandle(data) {
1454
1459
  this.$emit('update:columns', data)
1460
+ },
1461
+ toggleFold(item, index) {
1462
+ this.$refs.tbody.toggleFold(item, index, false)
1463
+ },
1464
+ // 展开所有
1465
+ expandAll() {
1466
+ if (this.iData.length > 0) {
1467
+ this.iData.forEach((item, index) => {
1468
+ if (item._hasChild && item._level === 1 && item._show === true) {
1469
+ this.$refs.tbody.expandAll(item, index, false)
1470
+ }
1471
+ })
1472
+ }
1473
+ },
1474
+ // 折叠所有
1475
+ collapseAll() {
1476
+ if (this.iData.length > 0) {
1477
+ this.iData.forEach((item, index) => {
1478
+ if (item._hasChild && item._level === 1 && item._show === true) {
1479
+ this.$refs.tbody.collapseAll(item, index, false)
1480
+ }
1481
+ })
1482
+ }
1483
+ },
1484
+ toggleFoldAll() {
1485
+ if (this.expandFlag) {
1486
+ this.expandAll()
1487
+ } else {
1488
+ this.collapseAll()
1489
+ }
1490
+ this.expandFlag = !this.expandFlag
1455
1491
  }
1456
1492
  }
1457
1493
  }
Binary file
package/src/index.js CHANGED
@@ -455,7 +455,7 @@ if (typeof window !== 'undefined' && window.Vue) {
455
455
  }
456
456
 
457
457
  export default {
458
- version: '1.34.1',
458
+ version: '1.34.2',
459
459
  locale: locale.use,
460
460
  i18n: locale.i18n,
461
461
  install,
package/src/msg/index.js CHANGED
@@ -62,8 +62,15 @@ export default function() {
62
62
  container.setAttribute('id', uuid)
63
63
  body.appendChild(container)
64
64
  const props = {}
65
- Object.keys(options).map(key => {
66
- props[key] = {default: options[key]}
65
+ Object.keys(options).forEach(function(key) {
66
+ const value = options[key]
67
+ props[key] = {
68
+ default: (typeof value === 'object' && value !== null)
69
+ ? function() {
70
+ return Array.isArray(value) ? value.slice() : Object.assign({}, value)
71
+ }
72
+ : value
73
+ }
67
74
  })
68
75
  // eslint-disable-next-line no-unused-vars
69
76
  let MsgItem = new ToMsgCom({
@@ -1,13 +1,12 @@
1
- var __extends = (this && this.__extends) || (function() {
2
- var extendStatics = function(d, b) {
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function(d, b) { d.__proto__ = b; }) ||
5
- function(d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
- return function(d, b) {
9
- if (typeof b !== 'function' && b !== null)
10
- {throw new TypeError('Class extends value ' + String(b) + ' is not a constructor or null');}
8
+ return function (d, b) {
9
+ if (typeof b !== 'function' && b !== null) { throw new TypeError('Class extends value ' + String(b) + ' is not a constructor or null'); }
11
10
  extendStatics(d, b);
12
11
  function __() { this.constructor = d; }
13
12
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -27,7 +26,7 @@ import { KJUR } from './jselib/jsrsasign/asn1-1.0';
27
26
  * the parameters needed to build a RSAKey object.
28
27
  * @constructor
29
28
  */
30
- var JSEncryptRSAKey = /** @class */ (function(_super) {
29
+ var JSEncryptRSAKey = /** @class */ (function (_super) {
31
30
  __extends(JSEncryptRSAKey, _super);
32
31
  function JSEncryptRSAKey(key) {
33
32
  var _this = _super.call(this) || this;
@@ -40,7 +39,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
40
39
  _this.parseKey(key);
41
40
  }
42
41
  else if (JSEncryptRSAKey.hasPrivateKeyProperty(key) ||
43
- JSEncryptRSAKey.hasPublicKeyProperty(key)) {
42
+ JSEncryptRSAKey.hasPublicKeyProperty(key)) {
44
43
  // Set the values for the key.
45
44
  _this.parsePropertiesFrom(key);
46
45
  }
@@ -75,7 +74,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
75
74
  * @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer
76
75
  * @private
77
76
  */
78
- JSEncryptRSAKey.prototype.parseKey = function(pem) {
77
+ JSEncryptRSAKey.prototype.parseKey = function (pem) {
79
78
  try {
80
79
  var modulus = 0;
81
80
  var public_exponent = 0;
@@ -150,7 +149,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
150
149
  * @returns {string} DER Encoded String representing the rsa private key
151
150
  * @private
152
151
  */
153
- JSEncryptRSAKey.prototype.getPrivateBaseKey = function() {
152
+ JSEncryptRSAKey.prototype.getPrivateBaseKey = function () {
154
153
  var options = {
155
154
  array: [
156
155
  new KJUR.asn1.DERInteger({ int: 0 }),
@@ -172,7 +171,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
172
171
  * @returns {string} pem encoded representation without header and footer
173
172
  * @public
174
173
  */
175
- JSEncryptRSAKey.prototype.getPrivateBaseKeyB64 = function() {
174
+ JSEncryptRSAKey.prototype.getPrivateBaseKeyB64 = function () {
176
175
  return hex2b64(this.getPrivateBaseKey());
177
176
  };
178
177
  /**
@@ -195,7 +194,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
195
194
  * @returns {string} DER Encoded String representing the rsa public key
196
195
  * @private
197
196
  */
198
- JSEncryptRSAKey.prototype.getPublicBaseKey = function() {
197
+ JSEncryptRSAKey.prototype.getPublicBaseKey = function () {
199
198
  var first_sequence = new KJUR.asn1.DERSequence({
200
199
  array: [
201
200
  new KJUR.asn1.DERObjectIdentifier({ oid: '1.2.840.113549.1.1.1' }),
@@ -221,7 +220,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
221
220
  * @returns {string} pem encoded representation without header and footer
222
221
  * @public
223
222
  */
224
- JSEncryptRSAKey.prototype.getPublicBaseKeyB64 = function() {
223
+ JSEncryptRSAKey.prototype.getPublicBaseKeyB64 = function () {
225
224
  return hex2b64(this.getPublicBaseKey());
226
225
  };
227
226
  /**
@@ -232,7 +231,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
232
231
  * @returns {string}
233
232
  * @private
234
233
  */
235
- JSEncryptRSAKey.wordwrap = function(str, width) {
234
+ JSEncryptRSAKey.wordwrap = function (str, width) {
236
235
  width = width || 64;
237
236
  if (!str) {
238
237
  return str;
@@ -245,7 +244,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
245
244
  * @returns {string} the pem encoded private key with header/footer
246
245
  * @public
247
246
  */
248
- JSEncryptRSAKey.prototype.getPrivateKey = function() {
247
+ JSEncryptRSAKey.prototype.getPrivateKey = function () {
249
248
  var key = '-----BEGIN RSA PRIVATE KEY-----\n';
250
249
  key += JSEncryptRSAKey.wordwrap(this.getPrivateBaseKeyB64()) + '\n';
251
250
  key += '-----END RSA PRIVATE KEY-----';
@@ -256,7 +255,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
256
255
  * @returns {string} the pem encoded public key with header/footer
257
256
  * @public
258
257
  */
259
- JSEncryptRSAKey.prototype.getPublicKey = function() {
258
+ JSEncryptRSAKey.prototype.getPublicKey = function () {
260
259
  var key = '-----BEGIN PUBLIC KEY-----\n';
261
260
  key += JSEncryptRSAKey.wordwrap(this.getPublicBaseKeyB64()) + '\n';
262
261
  key += '-----END PUBLIC KEY-----';
@@ -273,7 +272,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
273
272
  * be a parseable integer number
274
273
  * @private
275
274
  */
276
- JSEncryptRSAKey.hasPublicKeyProperty = function(obj) {
275
+ JSEncryptRSAKey.hasPublicKeyProperty = function (obj) {
277
276
  obj = obj || {};
278
277
  return obj.hasOwnProperty('n') && obj.hasOwnProperty('e');
279
278
  };
@@ -286,16 +285,16 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
286
285
  * should be parseable bigint objects, the public exponent should be a parseable integer number
287
286
  * @private
288
287
  */
289
- JSEncryptRSAKey.hasPrivateKeyProperty = function(obj) {
288
+ JSEncryptRSAKey.hasPrivateKeyProperty = function (obj) {
290
289
  obj = obj || {};
291
290
  return (obj.hasOwnProperty('n') &&
292
- obj.hasOwnProperty('e') &&
293
- obj.hasOwnProperty('d') &&
294
- obj.hasOwnProperty('p') &&
295
- obj.hasOwnProperty('q') &&
296
- obj.hasOwnProperty('dmp1') &&
297
- obj.hasOwnProperty('dmq1') &&
298
- obj.hasOwnProperty('coeff'));
291
+ obj.hasOwnProperty('e') &&
292
+ obj.hasOwnProperty('d') &&
293
+ obj.hasOwnProperty('p') &&
294
+ obj.hasOwnProperty('q') &&
295
+ obj.hasOwnProperty('dmp1') &&
296
+ obj.hasOwnProperty('dmq1') &&
297
+ obj.hasOwnProperty('coeff'));
299
298
  };
300
299
  /**
301
300
  * Parse the properties of obj in the current rsa object. Obj should AT LEAST
@@ -303,7 +302,7 @@ var JSEncryptRSAKey = /** @class */ (function(_super) {
303
302
  * @param {Object} obj - the object containing rsa parameters
304
303
  * @private
305
304
  */
306
- JSEncryptRSAKey.prototype.parsePropertiesFrom = function(obj) {
305
+ JSEncryptRSAKey.prototype.parsePropertiesFrom = function (obj) {
307
306
  this.n = obj.n;
308
307
  this.e = obj.e;
309
308
  if (obj.hasOwnProperty('d')) {
@@ -1,63 +1,63 @@
1
1
  export var YAHOO = {};
2
2
  YAHOO.lang = {
3
- /**
4
- * Utility to set up the prototype, constructor and superclass properties to
5
- * support an inheritance strategy that can chain constructors and methods.
6
- * Static members will not be inherited.
7
- *
8
- * @method extend
9
- * @static
10
- * @param {Function} subc the object to modify
11
- * @param {Function} superc the object to inherit
12
- * @param {Object} overrides additional properties/methods to add to the
13
- * subclass prototype. These will override the
14
- * matching items obtained from the superclass
15
- * if present.
16
- */
17
- extend: function (subc, superc, overrides) {
18
- if (!superc || !subc) {
19
- throw new Error("YAHOO.lang.extend failed, please check that " +
20
- "all dependencies are included.");
21
- }
22
- var F = function () { };
23
- F.prototype = superc.prototype;
24
- subc.prototype = new F();
25
- subc.prototype.constructor = subc;
26
- subc.superclass = superc.prototype;
27
- if (superc.prototype.constructor == Object.prototype.constructor) {
28
- superc.prototype.constructor = superc;
29
- }
30
- if (overrides) {
31
- var i;
32
- for (i in overrides) {
33
- subc.prototype[i] = overrides[i];
34
- }
35
- /*
36
- * IE will not enumerate native functions in a derived object even if the
37
- * function was overridden. This is a workaround for specific functions
38
- * we care about on the Object prototype.
39
- * @property _IEEnumFix
40
- * @param {Function} r the object to receive the augmentation
41
- * @param {Function} s the object that supplies the properties to augment
42
- * @static
43
- * @private
44
- */
45
- var _IEEnumFix = function () { }, ADD = ["toString", "valueOf"];
46
- try {
47
- if (/MSIE/.test(navigator.userAgent)) {
48
- _IEEnumFix = function (r, s) {
49
- for (i = 0; i < ADD.length; i = i + 1) {
50
- var fname = ADD[i], f = s[fname];
51
- if (typeof f === 'function' && f != Object.prototype[fname]) {
52
- r[fname] = f;
53
- }
54
- }
55
- };
56
- }
57
- }
58
- catch (ex) { }
59
- ;
60
- _IEEnumFix(subc.prototype, overrides);
61
- }
62
- }
3
+ /**
4
+ * Utility to set up the prototype, constructor and superclass properties to
5
+ * support an inheritance strategy that can chain constructors and methods.
6
+ * Static members will not be inherited.
7
+ *
8
+ * @method extend
9
+ * @static
10
+ * @param {Function} subc the object to modify
11
+ * @param {Function} superc the object to inherit
12
+ * @param {Object} overrides additional properties/methods to add to the
13
+ * subclass prototype. These will override the
14
+ * matching items obtained from the superclass
15
+ * if present.
16
+ */
17
+ extend: function (subc, superc, overrides) {
18
+ if (!superc || !subc) {
19
+ throw new Error("YAHOO.lang.extend failed, please check that " +
20
+ "all dependencies are included.");
21
+ }
22
+ var F = function () { };
23
+ F.prototype = superc.prototype;
24
+ subc.prototype = new F();
25
+ subc.prototype.constructor = subc;
26
+ subc.superclass = superc.prototype;
27
+ if (superc.prototype.constructor == Object.prototype.constructor) {
28
+ superc.prototype.constructor = superc;
29
+ }
30
+ if (overrides) {
31
+ var i;
32
+ for (i in overrides) {
33
+ subc.prototype[i] = overrides[i];
34
+ }
35
+ /*
36
+ * IE will not enumerate native functions in a derived object even if the
37
+ * function was overridden. This is a workaround for specific functions
38
+ * we care about on the Object prototype.
39
+ * @property _IEEnumFix
40
+ * @param {Function} r the object to receive the augmentation
41
+ * @param {Function} s the object that supplies the properties to augment
42
+ * @static
43
+ * @private
44
+ */
45
+ var _IEEnumFix = function () { }, ADD = ["toString", "valueOf"];
46
+ try {
47
+ if (/MSIE/.test(navigator.userAgent)) {
48
+ _IEEnumFix = function (r, s) {
49
+ for (i = 0; i < ADD.length; i = i + 1) {
50
+ var fname = ADD[i], f = s[fname];
51
+ if (typeof f === 'function' && f != Object.prototype[fname]) {
52
+ r[fname] = f;
53
+ }
54
+ }
55
+ };
56
+ }
57
+ }
58
+ catch (ex) { }
59
+ ;
60
+ _IEEnumFix(subc.prototype, overrides);
61
+ }
62
+ }
63
63
  };