y-design-ssr 0.0.21 → 0.0.24
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.
- package/libs/button.js +6 -17
- package/libs/cell.js +6 -18
- package/libs/checkbox.css +2 -0
- package/libs/checkbox.js +197 -43
- package/libs/checkboxGroup.js +85 -109
- package/libs/col.css +2 -0
- package/libs/col.js +175 -41
- package/libs/countdown.js +6 -18
- package/libs/dialog.js +10 -21
- package/libs/empty.js +9 -20
- package/libs/form.js +32 -51
- package/libs/formItem.js +788 -45
- package/libs/icon.js +6 -18
- package/libs/input.js +6 -18
- package/libs/list.js +6 -18
- package/libs/loading.js +9 -24
- package/libs/mask.js +6 -18
- package/libs/popup.js +6 -18
- package/libs/progress.js +6 -18
- package/libs/pullrefresh.js +8 -20
- package/libs/row.js +40 -66
- package/libs/slider.js +6 -18
- package/libs/stepper.js +6 -18
- package/libs/style.js +6 -22
- package/libs/swipe.js +84 -87
- package/libs/swipeItem.css +2 -0
- package/libs/swipeItem.js +733 -42
- package/libs/switch.js +6 -18
- package/libs/tab.css +4 -0
- package/libs/tab.js +2051 -62
- package/libs/tabs.css +2 -0
- package/libs/tabs.js +165 -169
- package/libs/toast.js +9 -20
- package/libs/tooltip.js +9 -20
- package/libs/yui.css +4 -4
- package/libs/yui.js +332 -404
- package/package.json +1 -1
- package/libs/locale.js +0 -1166
package/libs/tab.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
3
|
module.exports = factory(require("vue"));
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define(["vue"], factory);
|
|
6
|
-
else
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
define("yui-lib", ["vue"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["yui-lib"] = factory(require("vue"));
|
|
8
|
+
else
|
|
9
|
+
root["yui-lib"] = factory(root["vue"]);
|
|
10
10
|
})(this, function(__WEBPACK_EXTERNAL_MODULE__4103__) {
|
|
11
11
|
return /******/ (function() { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
@@ -30,6 +30,51 @@ function _arrayLikeToArray(arr, len) {
|
|
|
30
30
|
|
|
31
31
|
/***/ }),
|
|
32
32
|
|
|
33
|
+
/***/ 2137:
|
|
34
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
|
+
|
|
36
|
+
"use strict";
|
|
37
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
38
|
+
/* harmony export */ "Z": function() { return /* binding */ _asyncToGenerator; }
|
|
39
|
+
/* harmony export */ });
|
|
40
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
41
|
+
try {
|
|
42
|
+
var info = gen[key](arg);
|
|
43
|
+
var value = info.value;
|
|
44
|
+
} catch (error) {
|
|
45
|
+
reject(error);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (info.done) {
|
|
50
|
+
resolve(value);
|
|
51
|
+
} else {
|
|
52
|
+
Promise.resolve(value).then(_next, _throw);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _asyncToGenerator(fn) {
|
|
57
|
+
return function () {
|
|
58
|
+
var self = this,
|
|
59
|
+
args = arguments;
|
|
60
|
+
return new Promise(function (resolve, reject) {
|
|
61
|
+
var gen = fn.apply(self, args);
|
|
62
|
+
|
|
63
|
+
function _next(value) {
|
|
64
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _throw(err) {
|
|
68
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_next(undefined);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/***/ }),
|
|
77
|
+
|
|
33
78
|
/***/ 6156:
|
|
34
79
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
80
|
|
|
@@ -115,6 +160,44 @@ function _slicedToArray(arr, i) {
|
|
|
115
160
|
|
|
116
161
|
/***/ }),
|
|
117
162
|
|
|
163
|
+
/***/ 7329:
|
|
164
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
165
|
+
|
|
166
|
+
"use strict";
|
|
167
|
+
|
|
168
|
+
// EXPORTS
|
|
169
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
170
|
+
"Z": function() { return /* binding */ _toConsumableArray; }
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
174
|
+
var arrayLikeToArray = __webpack_require__(676);
|
|
175
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
176
|
+
|
|
177
|
+
function _arrayWithoutHoles(arr) {
|
|
178
|
+
if (Array.isArray(arr)) return (0,arrayLikeToArray/* default */.Z)(arr);
|
|
179
|
+
}
|
|
180
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
|
181
|
+
function _iterableToArray(iter) {
|
|
182
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
183
|
+
}
|
|
184
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
|
185
|
+
var unsupportedIterableToArray = __webpack_require__(2961);
|
|
186
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
|
187
|
+
function _nonIterableSpread() {
|
|
188
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
189
|
+
}
|
|
190
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
function _toConsumableArray(arr) {
|
|
196
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || (0,unsupportedIterableToArray/* default */.Z)(arr) || _nonIterableSpread();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/***/ }),
|
|
200
|
+
|
|
118
201
|
/***/ 2961:
|
|
119
202
|
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
120
203
|
|
|
@@ -133,6 +216,14 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
133
216
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__/* .default */ .Z)(o, minLen);
|
|
134
217
|
}
|
|
135
218
|
|
|
219
|
+
/***/ }),
|
|
220
|
+
|
|
221
|
+
/***/ 7757:
|
|
222
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
223
|
+
|
|
224
|
+
module.exports = __webpack_require__(5666);
|
|
225
|
+
|
|
226
|
+
|
|
136
227
|
/***/ }),
|
|
137
228
|
|
|
138
229
|
/***/ 874:
|
|
@@ -142,11 +233,14 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
142
233
|
|
|
143
234
|
// EXPORTS
|
|
144
235
|
__webpack_require__.d(__webpack_exports__, {
|
|
236
|
+
"tG": function() { return /* reexport */ setRelation; },
|
|
145
237
|
"jQ": function() { return /* reexport */ useRelation; }
|
|
146
238
|
});
|
|
147
239
|
|
|
148
|
-
// UNUSED EXPORTS: filterChildren,
|
|
240
|
+
// UNUSED EXPORTS: filterChildren, sortChildren
|
|
149
241
|
|
|
242
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
243
|
+
var defineProperty = __webpack_require__(6156);
|
|
150
244
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
|
|
151
245
|
var web_dom_collections_for_each = __webpack_require__(4747);
|
|
152
246
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.sort.js
|
|
@@ -172,7 +266,7 @@ var external_vue_ = __webpack_require__(4103);
|
|
|
172
266
|
|
|
173
267
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
174
268
|
|
|
175
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) {
|
|
269
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
176
270
|
|
|
177
271
|
|
|
178
272
|
|
|
@@ -199,7 +293,7 @@ var filterChildren = function filterChildren(children) {
|
|
|
199
293
|
var _filterChildren = function _filterChildren(childrens) {
|
|
200
294
|
if (Array.isArray(childrens)) {
|
|
201
295
|
childrens.forEach(function (child) {
|
|
202
|
-
if (isVNode(child)) {
|
|
296
|
+
if ((0,external_vue_.isVNode)(child)) {
|
|
203
297
|
var _child$component;
|
|
204
298
|
|
|
205
299
|
vnodes.push(child);
|
|
@@ -227,8 +321,8 @@ var sortChildren = function sortChildren(childrens, instance) {
|
|
|
227
321
|
});
|
|
228
322
|
};
|
|
229
323
|
var setRelation = function setRelation(key) {
|
|
230
|
-
var instance = getCurrentInstance();
|
|
231
|
-
var childrens = reactive([]);
|
|
324
|
+
var instance = (0,external_vue_.getCurrentInstance)();
|
|
325
|
+
var childrens = (0,external_vue_.reactive)([]);
|
|
232
326
|
|
|
233
327
|
var initProvide = function initProvide(value) {
|
|
234
328
|
var addChild = function addChild(child) {
|
|
@@ -243,7 +337,7 @@ var setRelation = function setRelation(key) {
|
|
|
243
337
|
childrens.splice(index, 1);
|
|
244
338
|
};
|
|
245
339
|
|
|
246
|
-
provide(key, _objectSpread({
|
|
340
|
+
(0,external_vue_.provide)(key, _objectSpread({
|
|
247
341
|
addChild: addChild,
|
|
248
342
|
removeChild: removeChild,
|
|
249
343
|
childrens: childrens
|
|
@@ -375,27 +469,43 @@ var langs = (0,external_vue_.reactive)({
|
|
|
375
469
|
|
|
376
470
|
/***/ }),
|
|
377
471
|
|
|
378
|
-
/***/
|
|
472
|
+
/***/ 279:
|
|
379
473
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
380
474
|
|
|
381
475
|
"use strict";
|
|
382
476
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
383
|
-
/* harmony export */ "pB": function() { return /*
|
|
477
|
+
/* harmony export */ "pB": function() { return /* reexport safe */ _src_swipe__WEBPACK_IMPORTED_MODULE_1__.p; }
|
|
384
478
|
/* harmony export */ });
|
|
385
|
-
/*
|
|
386
|
-
/* harmony import */ var
|
|
387
|
-
/* harmony import */ var
|
|
388
|
-
/* harmony import */ var
|
|
389
|
-
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
390
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1539);
|
|
391
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
392
|
-
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9653);
|
|
393
|
-
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
479
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8309);
|
|
480
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
481
|
+
/* harmony import */ var _src_swipe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7832);
|
|
482
|
+
/* harmony import */ var _src_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2530);
|
|
394
483
|
|
|
395
484
|
|
|
396
485
|
|
|
397
486
|
|
|
398
|
-
|
|
487
|
+
_src_swipe__WEBPACK_IMPORTED_MODULE_1__/* .default.install */ .Z.install = function (Vue) {
|
|
488
|
+
var name = _src_swipe__WEBPACK_IMPORTED_MODULE_1__/* .default.name */ .Z.name;
|
|
489
|
+
Vue.component(name, _src_swipe__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z);
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
/***/ }),
|
|
496
|
+
|
|
497
|
+
/***/ 2530:
|
|
498
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
499
|
+
|
|
500
|
+
"use strict";
|
|
501
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
502
|
+
/* harmony export */ "Ly": function() { return /* binding */ Position; },
|
|
503
|
+
/* harmony export */ "xM": function() { return /* binding */ Align; },
|
|
504
|
+
/* harmony export */ "Gn": function() { return /* binding */ swipeProps; }
|
|
505
|
+
/* harmony export */ });
|
|
506
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9653);
|
|
507
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
508
|
+
|
|
399
509
|
var Position;
|
|
400
510
|
|
|
401
511
|
(function (Position) {
|
|
@@ -482,6 +592,583 @@ var swipeProps = {
|
|
|
482
592
|
|
|
483
593
|
/***/ }),
|
|
484
594
|
|
|
595
|
+
/***/ 7832:
|
|
596
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
597
|
+
|
|
598
|
+
"use strict";
|
|
599
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
600
|
+
/* harmony export */ "p": function() { return /* binding */ SWIPE_PROVIDE_KEY; }
|
|
601
|
+
/* harmony export */ });
|
|
602
|
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7329);
|
|
603
|
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4699);
|
|
604
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4103);
|
|
605
|
+
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
|
|
606
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2526);
|
|
607
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
608
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1817);
|
|
609
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
610
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1539);
|
|
611
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
612
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9653);
|
|
613
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
614
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1249);
|
|
615
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
616
|
+
/* harmony import */ var core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3290);
|
|
617
|
+
/* harmony import */ var core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
618
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4105);
|
|
619
|
+
/* harmony import */ var _swipeItem_src_swipeItem__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7481);
|
|
620
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2530);
|
|
621
|
+
/* harmony import */ var _context_relation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(874);
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
/* eslint-disable max-statements */
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
var _createNamespace = (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .createNamespace */ .do)('swipe'),
|
|
640
|
+
_createNamespace2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_11__/* .default */ .Z)(_createNamespace, 2),
|
|
641
|
+
name = _createNamespace2[0],
|
|
642
|
+
bem = _createNamespace2[1];
|
|
643
|
+
|
|
644
|
+
var SWIPE_PROVIDE_KEY = Symbol(name);
|
|
645
|
+
/* harmony default export */ __webpack_exports__["Z"] = ((0,vue__WEBPACK_IMPORTED_MODULE_0__.defineComponent)({
|
|
646
|
+
name: name,
|
|
647
|
+
components: {
|
|
648
|
+
YSwipeItem: _swipeItem_src_swipeItem__WEBPACK_IMPORTED_MODULE_8__/* .default */ .Z
|
|
649
|
+
},
|
|
650
|
+
props: _constants__WEBPACK_IMPORTED_MODULE_9__/* .swipeProps */ .Gn,
|
|
651
|
+
setup: function setup(props, _ref) {
|
|
652
|
+
var slots = _ref.slots,
|
|
653
|
+
emit = _ref.emit,
|
|
654
|
+
expose = _ref.expose;
|
|
655
|
+
|
|
656
|
+
var _setRelation = (0,_context_relation__WEBPACK_IMPORTED_MODULE_10__/* .setRelation */ .tG)(SWIPE_PROVIDE_KEY),
|
|
657
|
+
initProvide = _setRelation.initProvide; // swipe item列表
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
var itemList = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]); // 当前Index
|
|
661
|
+
|
|
662
|
+
var activeIndex = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(Number(props.initIndex)); // 元素详情
|
|
663
|
+
|
|
664
|
+
var itemDetail = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({
|
|
665
|
+
// 元素尺寸
|
|
666
|
+
size: 0,
|
|
667
|
+
// 间距
|
|
668
|
+
space: 0,
|
|
669
|
+
// 元素宽度比swipe小,占满整个视窗
|
|
670
|
+
isFillViewport: false
|
|
671
|
+
}); // track轨道
|
|
672
|
+
|
|
673
|
+
var trackDetail = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({
|
|
674
|
+
// 偏移量
|
|
675
|
+
offset: 0,
|
|
676
|
+
// 视窗大小
|
|
677
|
+
viewportSize: 0,
|
|
678
|
+
// 重复节点个数
|
|
679
|
+
cloneNodeCount: 0
|
|
680
|
+
});
|
|
681
|
+
var swipeRef = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
|
|
682
|
+
var swipeTrackRef = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
|
|
683
|
+
/* -----------懒加载-------------*/
|
|
684
|
+
|
|
685
|
+
var getBooleanList = function getBooleanList() {
|
|
686
|
+
var l = itemList.length;
|
|
687
|
+
var result = [];
|
|
688
|
+
|
|
689
|
+
for (var i = 0; i < l; i++) {
|
|
690
|
+
result.push(!props.lazy);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
return result;
|
|
694
|
+
}; // 检查某个位置是否已经加载,如果没有,进行加载
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
var checkItemShowed = function checkItemShowed() {
|
|
698
|
+
if (!props.lazy) return;
|
|
699
|
+
var itemSizeSpace = itemDetail.size + itemDetail.space;
|
|
700
|
+
var trackSize = itemList.length * itemSizeSpace; // 视窗左边相对track的距离
|
|
701
|
+
|
|
702
|
+
var viewportLeft = -(trackDetail.offset + dragDetail.offset) - trackDetail.cloneNodeCount * itemSizeSpace;
|
|
703
|
+
|
|
704
|
+
if (viewportLeft < 0) {
|
|
705
|
+
viewportLeft += trackSize;
|
|
706
|
+
} // 视窗右边相对track的距离
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
var viewportRight = viewportLeft + trackDetail.viewportSize;
|
|
710
|
+
|
|
711
|
+
for (var i = 0; i < itemList.length; i++) {
|
|
712
|
+
if (!itemShowedList.list[i]) {
|
|
713
|
+
// 元素相对track的距离
|
|
714
|
+
var left = itemSizeSpace * i;
|
|
715
|
+
var right = left + itemDetail.size; // 如果出现在视窗内
|
|
716
|
+
|
|
717
|
+
if (left >= viewportLeft && left < viewportRight || right > viewportLeft && right < viewportRight || left < viewportLeft && right > viewportRight) {
|
|
718
|
+
itemShowedList.list[i] = true;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}; // items是否加载
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
var itemShowedList = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({
|
|
726
|
+
list: getBooleanList()
|
|
727
|
+
}); // 初始化加载情况
|
|
728
|
+
|
|
729
|
+
var initItemShowList = function initItemShowList() {
|
|
730
|
+
itemShowedList.list = getBooleanList();
|
|
731
|
+
checkItemShowed();
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
(0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
|
|
735
|
+
return (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_12__/* .default */ .Z)(itemList);
|
|
736
|
+
}, initItemShowList);
|
|
737
|
+
/* -----------初始化-------------*/
|
|
738
|
+
// 计算初始的滑块/容器/间距宽度
|
|
739
|
+
|
|
740
|
+
var setItemSize = function setItemSize(itemSize, viewportSize) {
|
|
741
|
+
if (itemSize) {
|
|
742
|
+
itemDetail.size = (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .parsePercent */ .GM)(itemSize, viewportSize);
|
|
743
|
+
} else {
|
|
744
|
+
itemDetail.size = viewportSize;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
itemDetail.space = Number(props.itemSpace) || 0;
|
|
748
|
+
itemDetail.isFillViewport = itemDetail.size >= viewportSize;
|
|
749
|
+
trackDetail.viewportSize = viewportSize;
|
|
750
|
+
trackDetail.cloneNodeCount = getCloneNodeCount();
|
|
751
|
+
}; // 得到重复元素数量
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
var getCloneNodeCount = function getCloneNodeCount() {
|
|
755
|
+
if (needLoop.value) {
|
|
756
|
+
// 除去当前显示,滑动过程中最大可能显示的宽度
|
|
757
|
+
var sizeSpace = itemDetail.size + itemDetail.space;
|
|
758
|
+
if (sizeSpace === 0) return 0;
|
|
759
|
+
var freeSize = trackDetail.viewportSize * 2 - sizeSpace;
|
|
760
|
+
var count = Math.ceil(freeSize / sizeSpace);
|
|
761
|
+
return Math.min(count, itemList.length - 1);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return 0;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
var resize = function resize() {
|
|
768
|
+
if (!swipeRef.value) return; // 获取容器Size,itemSize
|
|
769
|
+
|
|
770
|
+
var _swipeRef$value$getBo = swipeRef.value.getBoundingClientRect(),
|
|
771
|
+
width = _swipeRef$value$getBo.width,
|
|
772
|
+
height = _swipeRef$value$getBo.height;
|
|
773
|
+
|
|
774
|
+
if (props.vertical) {
|
|
775
|
+
setItemSize(props.itemSize, height);
|
|
776
|
+
} else {
|
|
777
|
+
setItemSize(props.itemSize, width);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
activeIndex.value = activeIndex.value >= itemList.length ? itemList.length - 1 : activeIndex.value;
|
|
781
|
+
|
|
782
|
+
if (activeIndex.value < 0) {
|
|
783
|
+
activeIndex.value = 0;
|
|
784
|
+
} // 初始化offset
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
updateTransform(activeIndex.value); // 初始化item加载情况
|
|
788
|
+
|
|
789
|
+
initItemShowList(); // 开始自动播放
|
|
790
|
+
|
|
791
|
+
startAutoplay();
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
(0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
|
|
795
|
+
(0,vue__WEBPACK_IMPORTED_MODULE_0__.nextTick)(resize).catch(function () {// do nothing
|
|
796
|
+
}); // 初始化事件监听
|
|
797
|
+
|
|
798
|
+
if (props.touchable && swipeRef.value) {
|
|
799
|
+
var swipeEl = swipeRef.value;
|
|
800
|
+
swipeEl.addEventListener('touchstart', onTouchStart, false);
|
|
801
|
+
swipeEl.addEventListener('mousedown', onTouchStart, false);
|
|
802
|
+
swipeEl.addEventListener('touchmove', onTouch, false);
|
|
803
|
+
swipeEl.addEventListener('mousemove', onTouch, false);
|
|
804
|
+
swipeEl.addEventListener('touchend', onTouchEnd, false);
|
|
805
|
+
swipeEl.addEventListener('mouseup', onTouchEnd, false);
|
|
806
|
+
swipeEl.addEventListener('mouseleave', onTouchEnd, false);
|
|
807
|
+
swipeEl.addEventListener('touchcancel', onTouchEnd, false);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
window.addEventListener('resize', resize, false);
|
|
811
|
+
window.addEventListener('orientationchange', resize, false);
|
|
812
|
+
});
|
|
813
|
+
(0,vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeUnmount)(function () {
|
|
814
|
+
stopAutoPlay();
|
|
815
|
+
|
|
816
|
+
if (props.touchable && swipeRef.value) {
|
|
817
|
+
var swipeEl = swipeRef.value;
|
|
818
|
+
swipeEl.removeEventListener('touchstart', onTouchStart, false);
|
|
819
|
+
swipeEl.removeEventListener('mousedown', onTouchStart, false);
|
|
820
|
+
swipeEl.removeEventListener('mousemove', onTouch, false);
|
|
821
|
+
swipeEl.removeEventListener('touchmove', onTouch, false);
|
|
822
|
+
swipeEl.removeEventListener('mouseup', onTouchEnd, false);
|
|
823
|
+
swipeEl.removeEventListener('touchend', onTouchEnd, false);
|
|
824
|
+
swipeEl.removeEventListener('mouseleave', onTouchEnd, false);
|
|
825
|
+
swipeEl.removeEventListener('touchcancel', onTouchEnd, false);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
window.removeEventListener('resize', resize, false);
|
|
829
|
+
window.removeEventListener('orientationchange', resize, false);
|
|
830
|
+
});
|
|
831
|
+
/* -----------更新index-------------*/
|
|
832
|
+
// 滑块整体的对齐偏移,根据对齐方式计算
|
|
833
|
+
|
|
834
|
+
var positionOffset = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
835
|
+
var offset = 0;
|
|
836
|
+
|
|
837
|
+
switch (props.align) {
|
|
838
|
+
case _constants__WEBPACK_IMPORTED_MODULE_9__/* .Align.start */ .xM.start:
|
|
839
|
+
offset = 0;
|
|
840
|
+
break;
|
|
841
|
+
|
|
842
|
+
case _constants__WEBPACK_IMPORTED_MODULE_9__/* .Align.center */ .xM.center:
|
|
843
|
+
offset = (trackDetail.viewportSize - itemDetail.size) / 2;
|
|
844
|
+
break;
|
|
845
|
+
|
|
846
|
+
case _constants__WEBPACK_IMPORTED_MODULE_9__/* .Align.end */ .xM.end:
|
|
847
|
+
offset = trackDetail.viewportSize - itemDetail.size;
|
|
848
|
+
break;
|
|
849
|
+
|
|
850
|
+
default:
|
|
851
|
+
offset = 0;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
return offset;
|
|
855
|
+
});
|
|
856
|
+
var needLoop = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
857
|
+
return props.loop && itemList.length > 1;
|
|
858
|
+
}); // 如果当前显示的是clone的item则会返回到原本item的位置
|
|
859
|
+
|
|
860
|
+
var updateTransform = function updateTransform(index) {
|
|
861
|
+
var itemSizeSpace = itemDetail.size + itemDetail.space;
|
|
862
|
+
|
|
863
|
+
if (needLoop.value) {
|
|
864
|
+
// track开始部分,重复元素数量
|
|
865
|
+
trackDetail.offset = -itemSizeSpace * (index + trackDetail.cloneNodeCount) + positionOffset.value;
|
|
866
|
+
} else {
|
|
867
|
+
trackDetail.offset = -itemSizeSpace * index + positionOffset.value; // 非循环类型并且非center的边缘item不留白
|
|
868
|
+
|
|
869
|
+
if (props.align !== 'center') {
|
|
870
|
+
if (index === 0) {
|
|
871
|
+
trackDetail.offset = 0;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
if (index === itemList.length - 1) {
|
|
875
|
+
trackDetail.offset = -itemSizeSpace * index + trackDetail.viewportSize - itemDetail.size;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
var afterChange = function afterChange() {
|
|
882
|
+
updateTransform(activeIndex.value);
|
|
883
|
+
emit('afterChange', activeIndex.value);
|
|
884
|
+
}; // 循环时index可能会超出列表范围,这里找到对应的index
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
var getIndex = function getIndex(index) {
|
|
888
|
+
return (itemList.length + index) % itemList.length;
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
var moveTo = function moveTo(index) {
|
|
892
|
+
var withAnimation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
893
|
+
activeIndex.value = getIndex(index);
|
|
894
|
+
updateTransform(index);
|
|
895
|
+
checkItemShowed();
|
|
896
|
+
emit('change', activeIndex.value);
|
|
897
|
+
|
|
898
|
+
if (withAnimation) {
|
|
899
|
+
dragDetail.transitionEnabled = true;
|
|
900
|
+
|
|
901
|
+
if (swipeTrackRef.value) {
|
|
902
|
+
swipeTrackRef.value.addEventListener('transitionend', function () {
|
|
903
|
+
dragDetail.transitionEnabled = false;
|
|
904
|
+
afterChange();
|
|
905
|
+
}, {
|
|
906
|
+
once: true
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
} else {
|
|
910
|
+
afterChange();
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
var prev = function prev() {
|
|
915
|
+
var withAnimation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
916
|
+
moveTo(activeIndex.value - 1, withAnimation);
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
var next = function next() {
|
|
920
|
+
var withAnimation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
921
|
+
moveTo(activeIndex.value + 1, withAnimation);
|
|
922
|
+
};
|
|
923
|
+
/* -----------自动播放-------------*/
|
|
924
|
+
// 停止自动轮播
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
var timer = null;
|
|
928
|
+
|
|
929
|
+
var stopAutoPlay = function stopAutoPlay() {
|
|
930
|
+
if (props.autoplayTime && timer) {
|
|
931
|
+
clearInterval(timer);
|
|
932
|
+
}
|
|
933
|
+
}; // 重置自动轮播
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
var startAutoplay = function startAutoplay() {
|
|
937
|
+
if (props.autoplayTime && itemList.length > 1) {
|
|
938
|
+
if (timer) {
|
|
939
|
+
clearInterval(timer);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
timer = setInterval(function () {
|
|
943
|
+
next();
|
|
944
|
+
}, Number(props.autoplayTime));
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
/* -----------拖拽-------------*/
|
|
948
|
+
// 拖拽详情
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
var dragDetail = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({
|
|
952
|
+
// 拖拽中
|
|
953
|
+
isDragging: false,
|
|
954
|
+
// 是否首次拖动
|
|
955
|
+
isFirstTouch: true,
|
|
956
|
+
// 拖拽起始位置X
|
|
957
|
+
startX: 0,
|
|
958
|
+
// 拖拽起始位置Y
|
|
959
|
+
startY: 0,
|
|
960
|
+
// 拖拽距离
|
|
961
|
+
offset: 0,
|
|
962
|
+
// 开始拖动时间
|
|
963
|
+
startTime: new Date(),
|
|
964
|
+
// 是否在执行动画
|
|
965
|
+
transitionEnabled: false
|
|
966
|
+
}); // 开始拖动
|
|
967
|
+
|
|
968
|
+
var onTouchStart = function onTouchStart(e) {
|
|
969
|
+
// 在执行动画期间,不允许滑动
|
|
970
|
+
if (dragDetail.transitionEnabled) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
var clientX = 0;
|
|
975
|
+
var clientY = 0;
|
|
976
|
+
|
|
977
|
+
if ('touches' in e) {
|
|
978
|
+
clientX = e.touches[0].clientX;
|
|
979
|
+
clientY = e.touches[0].clientY;
|
|
980
|
+
} else {
|
|
981
|
+
clientX = e.clientX;
|
|
982
|
+
clientY = e.clientY;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
dragDetail.startX = clientX;
|
|
986
|
+
dragDetail.startY = clientY;
|
|
987
|
+
dragDetail.isDragging = true;
|
|
988
|
+
dragDetail.isFirstTouch = true;
|
|
989
|
+
dragDetail.startTime = new Date();
|
|
990
|
+
}; // 拖拽中
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
var onTouch = function onTouch(e) {
|
|
994
|
+
if (!dragDetail.isDragging) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
var clientX = 0;
|
|
999
|
+
var clientY = 0;
|
|
1000
|
+
|
|
1001
|
+
if ('touches' in e) {
|
|
1002
|
+
clientX = e.touches[0].clientX;
|
|
1003
|
+
clientY = e.touches[0].clientY;
|
|
1004
|
+
} else {
|
|
1005
|
+
clientX = e.clientX;
|
|
1006
|
+
clientY = e.clientY;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
var offsetX = clientX - dragDetail.startX;
|
|
1010
|
+
var offsetY = clientY - dragDetail.startY;
|
|
1011
|
+
|
|
1012
|
+
if (dragDetail.isFirstTouch) {
|
|
1013
|
+
dragDetail.isFirstTouch = false; // 根据首次滑动水平/垂直距离得到滑动方向
|
|
1014
|
+
|
|
1015
|
+
var isVerticalTouch = Math.abs(offsetX) < Math.abs(offsetY); // 若滑动方向不是轮播的方向,则停止滑动
|
|
1016
|
+
|
|
1017
|
+
if (isVerticalTouch !== props.vertical) {
|
|
1018
|
+
dragDetail.isDragging = false;
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
e.preventDefault();
|
|
1024
|
+
dragDetail.offset = props.vertical ? offsetY : offsetX;
|
|
1025
|
+
checkItemShowed();
|
|
1026
|
+
emit('dragging', {
|
|
1027
|
+
percent: dragDetail.offset / (itemDetail.size + itemDetail.space),
|
|
1028
|
+
offset: dragDetail.offset
|
|
1029
|
+
});
|
|
1030
|
+
}; // 拖动结束
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
var onTouchEnd = function onTouchEnd() {
|
|
1034
|
+
if (!dragDetail.isDragging) {
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
dragDetail.isDragging = false;
|
|
1039
|
+
var now = new Date();
|
|
1040
|
+
var dragTime = now.getTime() - dragDetail.startTime.getTime();
|
|
1041
|
+
|
|
1042
|
+
if (canGoForward() && (Math.abs(dragDetail.offset) > minSwipeDistance.value || Math.abs(dragDetail.offset) / dragTime > 0.5)) {
|
|
1043
|
+
// 滑动距离/速度足够,跳转到下一个位置
|
|
1044
|
+
dragDetail.offset > 0 ? prev() : next();
|
|
1045
|
+
dragDetail.offset = 0;
|
|
1046
|
+
} else {
|
|
1047
|
+
// 滑动距离不够,退回到之前的位置
|
|
1048
|
+
dragDetail.offset = 0;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
startAutoplay();
|
|
1052
|
+
}; // 最小滑动距离
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
var minSwipeDistance = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
1056
|
+
return (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .parsePercent */ .GM)(props.minSwipeDistance, itemDetail.size + itemDetail.space);
|
|
1057
|
+
}); // 是否能滑动到下一个
|
|
1058
|
+
|
|
1059
|
+
var canGoForward = function canGoForward() {
|
|
1060
|
+
if (needLoop.value) {
|
|
1061
|
+
return true;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
var nextIndex = dragDetail.offset > 0 ? activeIndex.value - 1 : activeIndex.value + 1;
|
|
1065
|
+
return nextIndex >= 0 && nextIndex < itemList.length;
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1068
|
+
var trackStyle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
1069
|
+
var offset = dragDetail.isDragging && !props.isFollowHand ? trackDetail.offset : trackDetail.offset + dragDetail.offset;
|
|
1070
|
+
var style = {};
|
|
1071
|
+
|
|
1072
|
+
if (props.vertical) {
|
|
1073
|
+
style.transform = "translate3d(0, ".concat(offset, "px, 0)");
|
|
1074
|
+
style.transitionDuration = dragDetail.transitionEnabled ? "".concat(props.duration, "ms") : '0ms';
|
|
1075
|
+
} else {
|
|
1076
|
+
style.transform = "translate3d(".concat(offset, "px, 0, 0)");
|
|
1077
|
+
style.transitionDuration = dragDetail.transitionEnabled ? "".concat(props.duration, "ms") : '0ms';
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
if (dragDetail.isDragging) {
|
|
1081
|
+
style.transition = 'none';
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
if (props.vertical) {
|
|
1085
|
+
style.flexDirection = 'column';
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
if (props.autoHeight) {
|
|
1089
|
+
style.display = 'block';
|
|
1090
|
+
style.whiteSpace = 'nowrap';
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
return style;
|
|
1094
|
+
});
|
|
1095
|
+
var dotsClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
|
|
1096
|
+
var position = props.dotsPosition || (props.vertical ? _constants__WEBPACK_IMPORTED_MODULE_9__/* .Position.left */ .Ly.left : _constants__WEBPACK_IMPORTED_MODULE_9__/* .Position.bottom */ .Ly.bottom);
|
|
1097
|
+
return ['y-swipe__dots', "y-swipe__dots--".concat(position)];
|
|
1098
|
+
});
|
|
1099
|
+
expose({
|
|
1100
|
+
moveTo: moveTo,
|
|
1101
|
+
next: next,
|
|
1102
|
+
prev: prev,
|
|
1103
|
+
resize: resize
|
|
1104
|
+
});
|
|
1105
|
+
/* -----------provide-------------*/
|
|
1106
|
+
|
|
1107
|
+
var tabs = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)({
|
|
1108
|
+
children: itemList,
|
|
1109
|
+
activeIndex: activeIndex,
|
|
1110
|
+
props: props,
|
|
1111
|
+
itemDetail: itemDetail,
|
|
1112
|
+
itemShowedList: itemShowedList
|
|
1113
|
+
});
|
|
1114
|
+
initProvide(tabs);
|
|
1115
|
+
|
|
1116
|
+
var renderDots = function renderDots() {
|
|
1117
|
+
if (props.dots) {
|
|
1118
|
+
return (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", {
|
|
1119
|
+
"class": dotsClass.value
|
|
1120
|
+
}, [itemList.map(function (_, index) {
|
|
1121
|
+
var className = bem('dot', {
|
|
1122
|
+
active: index === activeIndex.value
|
|
1123
|
+
});
|
|
1124
|
+
return (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", {
|
|
1125
|
+
"class": className,
|
|
1126
|
+
"style": {
|
|
1127
|
+
backgroundColor: props.dotsColor
|
|
1128
|
+
},
|
|
1129
|
+
"key": index
|
|
1130
|
+
}, null);
|
|
1131
|
+
})]);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
return null;
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
return function () {
|
|
1138
|
+
var _slots$default;
|
|
1139
|
+
|
|
1140
|
+
return (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", {
|
|
1141
|
+
"class": bem(),
|
|
1142
|
+
"ref": swipeRef
|
|
1143
|
+
}, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", {
|
|
1144
|
+
"class": bem('track'),
|
|
1145
|
+
"style": trackStyle.value,
|
|
1146
|
+
"ref": swipeTrackRef
|
|
1147
|
+
}, [Array(trackDetail.cloneNodeCount).fill('').map(function (_, index) {
|
|
1148
|
+
var _itemList$nodeIndex, _itemList$nodeIndex$s, _itemList$nodeIndex$s2;
|
|
1149
|
+
|
|
1150
|
+
var nodeIndex = getIndex(index - trackDetail.cloneNodeCount);
|
|
1151
|
+
var item = (_itemList$nodeIndex = itemList[nodeIndex]) === null || _itemList$nodeIndex === void 0 ? void 0 : (_itemList$nodeIndex$s = (_itemList$nodeIndex$s2 = _itemList$nodeIndex.slots).default) === null || _itemList$nodeIndex$s === void 0 ? void 0 : _itemList$nodeIndex$s.call(_itemList$nodeIndex$s2);
|
|
1152
|
+
return item ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_swipeItem_src_swipeItem__WEBPACK_IMPORTED_MODULE_8__/* .default */ .Z, {
|
|
1153
|
+
"clonenNode": item,
|
|
1154
|
+
"index": nodeIndex
|
|
1155
|
+
}, null) : null;
|
|
1156
|
+
}), (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots), Array(trackDetail.cloneNodeCount).fill('').map(function (_, index) {
|
|
1157
|
+
var _itemList$nodeIndex2, _itemList$nodeIndex2$, _itemList$nodeIndex2$2;
|
|
1158
|
+
|
|
1159
|
+
var nodeIndex = getIndex(index);
|
|
1160
|
+
var item = (_itemList$nodeIndex2 = itemList[nodeIndex]) === null || _itemList$nodeIndex2 === void 0 ? void 0 : (_itemList$nodeIndex2$ = (_itemList$nodeIndex2$2 = _itemList$nodeIndex2.slots).default) === null || _itemList$nodeIndex2$ === void 0 ? void 0 : _itemList$nodeIndex2$.call(_itemList$nodeIndex2$2);
|
|
1161
|
+
return item ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_swipeItem_src_swipeItem__WEBPACK_IMPORTED_MODULE_8__/* .default */ .Z, {
|
|
1162
|
+
"clonenNode": item,
|
|
1163
|
+
"index": nodeIndex
|
|
1164
|
+
}, null) : null;
|
|
1165
|
+
})]), slots.dots ? slots.dots() : renderDots()]);
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
}));
|
|
1169
|
+
|
|
1170
|
+
/***/ }),
|
|
1171
|
+
|
|
485
1172
|
/***/ 7481:
|
|
486
1173
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
487
1174
|
|
|
@@ -493,9 +1180,9 @@ var swipeProps = {
|
|
|
493
1180
|
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
494
1181
|
/* harmony import */ var core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4553);
|
|
495
1182
|
/* harmony import */ var core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
496
|
-
/* harmony import */ var
|
|
497
|
-
/* harmony import */ var
|
|
498
|
-
/* harmony import */ var
|
|
1183
|
+
/* harmony import */ var _context_relation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(874);
|
|
1184
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4105);
|
|
1185
|
+
/* harmony import */ var _swipe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(279);
|
|
499
1186
|
|
|
500
1187
|
|
|
501
1188
|
|
|
@@ -505,7 +1192,7 @@ var swipeProps = {
|
|
|
505
1192
|
|
|
506
1193
|
|
|
507
1194
|
|
|
508
|
-
var _createNamespace = (0,
|
|
1195
|
+
var _createNamespace = (0,_utils__WEBPACK_IMPORTED_MODULE_4__/* .createNamespace */ .do)('swipe-item'),
|
|
509
1196
|
_createNamespace2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6__/* .default */ .Z)(_createNamespace, 2),
|
|
510
1197
|
name = _createNamespace2[0],
|
|
511
1198
|
bem = _createNamespace2[1];
|
|
@@ -526,7 +1213,7 @@ var _createNamespace = (0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .createNamespace
|
|
|
526
1213
|
var slots = _ref.slots;
|
|
527
1214
|
var instance = (0,vue__WEBPACK_IMPORTED_MODULE_0__.getCurrentInstance)();
|
|
528
1215
|
|
|
529
|
-
var _useRelation = (0,
|
|
1216
|
+
var _useRelation = (0,_context_relation__WEBPACK_IMPORTED_MODULE_3__/* .useRelation */ .jQ)(_swipe__WEBPACK_IMPORTED_MODULE_5__/* .SWIPE_PROVIDE_KEY */ .pB),
|
|
530
1217
|
parent = _useRelation.parent;
|
|
531
1218
|
|
|
532
1219
|
if (!props.clonenNode && instance) {
|
|
@@ -579,27 +1266,140 @@ var _createNamespace = (0,_utils__WEBPACK_IMPORTED_MODULE_5__/* .createNamespace
|
|
|
579
1266
|
|
|
580
1267
|
/***/ }),
|
|
581
1268
|
|
|
582
|
-
/***/
|
|
1269
|
+
/***/ 463:
|
|
583
1270
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
584
1271
|
|
|
585
1272
|
"use strict";
|
|
586
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
587
|
-
/* harmony export */ "R7": function() { return /* binding */ TABS_KEY; }
|
|
588
|
-
/* harmony export */ });
|
|
589
|
-
/* unused harmony exports unknownProp, acceptProps */
|
|
590
|
-
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2526);
|
|
591
|
-
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
592
|
-
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1817);
|
|
593
|
-
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
594
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1539);
|
|
595
|
-
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
596
|
-
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9653);
|
|
597
|
-
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
598
1273
|
|
|
1274
|
+
// EXPORTS
|
|
1275
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1276
|
+
"R7": function() { return /* reexport */ TABS_KEY; }
|
|
1277
|
+
});
|
|
599
1278
|
|
|
1279
|
+
// UNUSED EXPORTS: acceptProps, default, unknownProp
|
|
600
1280
|
|
|
1281
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
|
|
1282
|
+
var es_function_name = __webpack_require__(8309);
|
|
1283
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
1284
|
+
var defineProperty = __webpack_require__(6156);
|
|
1285
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
1286
|
+
var asyncToGenerator = __webpack_require__(2137);
|
|
1287
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
|
1288
|
+
var slicedToArray = __webpack_require__(4699);
|
|
1289
|
+
// EXTERNAL MODULE: external "vue"
|
|
1290
|
+
var external_vue_ = __webpack_require__(4103);
|
|
1291
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
|
1292
|
+
var regenerator = __webpack_require__(7757);
|
|
1293
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
1294
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
|
|
1295
|
+
var es_symbol = __webpack_require__(2526);
|
|
1296
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
|
|
1297
|
+
var es_symbol_description = __webpack_require__(1817);
|
|
1298
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
|
|
1299
|
+
var es_object_to_string = __webpack_require__(1539);
|
|
1300
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find-index.js
|
|
1301
|
+
var es_array_find_index = __webpack_require__(4553);
|
|
1302
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.map.js
|
|
1303
|
+
var es_array_map = __webpack_require__(1249);
|
|
1304
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
|
|
1305
|
+
var es_object_keys = __webpack_require__(7941);
|
|
1306
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
|
|
1307
|
+
var es_array_filter = __webpack_require__(7327);
|
|
1308
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptor.js
|
|
1309
|
+
var es_object_get_own_property_descriptor = __webpack_require__(5003);
|
|
1310
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.for-each.js
|
|
1311
|
+
var web_dom_collections_for_each = __webpack_require__(4747);
|
|
1312
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.get-own-property-descriptors.js
|
|
1313
|
+
var es_object_get_own_property_descriptors = __webpack_require__(9337);
|
|
1314
|
+
// EXTERNAL MODULE: ./packages/utils/index.ts + 4 modules
|
|
1315
|
+
var utils = __webpack_require__(4105);
|
|
1316
|
+
// EXTERNAL MODULE: ./packages/swipe/src/swipe.tsx
|
|
1317
|
+
var swipe = __webpack_require__(7832);
|
|
1318
|
+
// EXTERNAL MODULE: ./packages/context/relation/index.ts + 2 modules
|
|
1319
|
+
var relation = __webpack_require__(874);
|
|
1320
|
+
;// CONCATENATED MODULE: ./packages/tabs/src/title.tsx
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1332
|
+
|
|
1333
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1334
|
+
|
|
1335
|
+
/* eslint-disable max-statements */
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
var _createNamespace = (0,utils/* createNamespace */.do)('tabs-title'),
|
|
1342
|
+
_createNamespace2 = (0,slicedToArray/* default */.Z)(_createNamespace, 2),
|
|
1343
|
+
title_name = _createNamespace2[0],
|
|
1344
|
+
bem = _createNamespace2[1];
|
|
1345
|
+
|
|
1346
|
+
/* harmony default export */ var title = ((0,external_vue_.defineComponent)({
|
|
1347
|
+
name: title_name,
|
|
1348
|
+
props: {
|
|
1349
|
+
active: {
|
|
1350
|
+
type: Boolean,
|
|
1351
|
+
default: false
|
|
1352
|
+
},
|
|
1353
|
+
scrollable: {
|
|
1354
|
+
type: Boolean,
|
|
1355
|
+
default: false
|
|
1356
|
+
},
|
|
1357
|
+
title: {
|
|
1358
|
+
type: String,
|
|
1359
|
+
default: null
|
|
1360
|
+
},
|
|
1361
|
+
titleSlot: {
|
|
1362
|
+
type: Function,
|
|
1363
|
+
default: null
|
|
1364
|
+
},
|
|
1365
|
+
disabled: {
|
|
1366
|
+
type: Boolean,
|
|
1367
|
+
default: false
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
setup: function setup(props) {
|
|
1371
|
+
var _useRelation = (0,relation/* useRelation */.jQ)(TABS_KEY),
|
|
1372
|
+
parent = _useRelation.parent;
|
|
1373
|
+
|
|
1374
|
+
var titleClass = (0,external_vue_.computed)(function () {
|
|
1375
|
+
return [{
|
|
1376
|
+
'y-el--clickable': !props.disabled
|
|
1377
|
+
}, bem({
|
|
1378
|
+
scrollable: props.scrollable,
|
|
1379
|
+
disabled: props.disabled
|
|
1380
|
+
}), bem("".concat((parent === null || parent === void 0 ? void 0 : parent.props.size) || 'middle'), {
|
|
1381
|
+
active: props.active
|
|
1382
|
+
}), parent === null || parent === void 0 ? void 0 : parent.props.titleClass, props.active ? parent === null || parent === void 0 ? void 0 : parent.props.titleActiveClass : ''];
|
|
1383
|
+
});
|
|
1384
|
+
var titleStyle = (0,external_vue_.computed)(function () {
|
|
1385
|
+
return _objectSpread(_objectSpread({}, parent === null || parent === void 0 ? void 0 : parent.props.titleStyle), props.active ? _objectSpread({}, parent === null || parent === void 0 ? void 0 : parent.props.titleActiveStyle) : {});
|
|
1386
|
+
});
|
|
1387
|
+
return function () {
|
|
1388
|
+
var title = props.title,
|
|
1389
|
+
titleSlot = props.titleSlot;
|
|
1390
|
+
return (0,external_vue_.createVNode)("div", {
|
|
1391
|
+
"class": titleClass.value,
|
|
1392
|
+
"title": title,
|
|
1393
|
+
"style": titleStyle.value,
|
|
1394
|
+
"role": 'presentation'
|
|
1395
|
+
}, [titleSlot ? titleSlot() : title]);
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
}));
|
|
1399
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
|
|
1400
|
+
var es_number_constructor = __webpack_require__(9653);
|
|
1401
|
+
;// CONCATENATED MODULE: ./packages/tabs/src/constants.ts
|
|
601
1402
|
|
|
602
|
-
var TABS_KEY = Symbol('tabs');
|
|
603
1403
|
var unknownProp = null;
|
|
604
1404
|
var acceptProps = {
|
|
605
1405
|
initIndex: {
|
|
@@ -668,6 +1468,374 @@ var acceptProps = {
|
|
|
668
1468
|
default: 'center'
|
|
669
1469
|
}
|
|
670
1470
|
};
|
|
1471
|
+
;// CONCATENATED MODULE: ./packages/tabs/src/tabs.tsx
|
|
1472
|
+
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
function tabs_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
1478
|
+
|
|
1479
|
+
function tabs_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { tabs_ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { tabs_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1480
|
+
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
/* eslint-disable max-statements */
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
function _isSlot(s) {
|
|
1503
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_.isVNode)(s);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
var tabs_createNamespace = (0,utils/* createNamespace */.do)('tabs'),
|
|
1507
|
+
tabs_createNamespace2 = (0,slicedToArray/* default */.Z)(tabs_createNamespace, 2),
|
|
1508
|
+
tabs_name = tabs_createNamespace2[0],
|
|
1509
|
+
tabs_bem = tabs_createNamespace2[1];
|
|
1510
|
+
|
|
1511
|
+
var TABS_KEY = Symbol(tabs_name);
|
|
1512
|
+
/* harmony default export */ var tabs = ((0,external_vue_.defineComponent)({
|
|
1513
|
+
name: tabs_name,
|
|
1514
|
+
components: {
|
|
1515
|
+
YTabTitle: title
|
|
1516
|
+
},
|
|
1517
|
+
props: acceptProps,
|
|
1518
|
+
setup: function setup(props, _ref) {
|
|
1519
|
+
var slots = _ref.slots,
|
|
1520
|
+
emit = _ref.emit,
|
|
1521
|
+
expose = _ref.expose;
|
|
1522
|
+
|
|
1523
|
+
var _setRelation = (0,relation/* setRelation */.tG)(TABS_KEY),
|
|
1524
|
+
initProvide = _setRelation.initProvide;
|
|
1525
|
+
|
|
1526
|
+
var inited = (0,external_vue_.ref)(false);
|
|
1527
|
+
var childrenList = (0,external_vue_.reactive)([]);
|
|
1528
|
+
var swiperRef = (0,external_vue_.ref)(); // tabTitle 是否可滚动
|
|
1529
|
+
|
|
1530
|
+
var isTabScrollable = (0,external_vue_.computed)(function () {
|
|
1531
|
+
return childrenList.length > props.titleScrollThreshold;
|
|
1532
|
+
}); // ----------------- index -----------------
|
|
1533
|
+
// 获取指定 title 所在的 index
|
|
1534
|
+
|
|
1535
|
+
var getCurIndexByName = function getCurIndexByName(titleName) {
|
|
1536
|
+
return childrenList.findIndex(function (node) {
|
|
1537
|
+
return (node.$props ? node.$props.name : '') === titleName;
|
|
1538
|
+
});
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1541
|
+
var activeIndex = (0,external_vue_.ref)(props.initName ? getCurIndexByName(props.initName) : props.initIndex); // 更新 activeIndex 的值,并滑动对应 tab
|
|
1542
|
+
|
|
1543
|
+
var scrollTo = function scrollTo(index) {
|
|
1544
|
+
activeIndex.value = index;
|
|
1545
|
+
var swiper = swiperRef.value;
|
|
1546
|
+
Boolean(swiper) && (swiper === null || swiper === void 0 ? void 0 : swiper.moveTo(index, props.changeWithAnimation));
|
|
1547
|
+
}; // ----------------- public methods -----------------
|
|
1548
|
+
|
|
1549
|
+
/**
|
|
1550
|
+
* @description: 切换到指定 tab
|
|
1551
|
+
* @param {number} index: tab 的索引值
|
|
1552
|
+
* @return {*}
|
|
1553
|
+
*/
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
var scrollToByIndex = function scrollToByIndex(index) {
|
|
1557
|
+
scrollTo(index);
|
|
1558
|
+
};
|
|
1559
|
+
/**
|
|
1560
|
+
* @description: 切换到指定 tab
|
|
1561
|
+
* @param {string} tabName: tab 的唯一标识符
|
|
1562
|
+
* @return {*}
|
|
1563
|
+
*/
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
var scrollToByName = function scrollToByName(tabName) {
|
|
1567
|
+
var curIndex = getCurIndexByName(tabName);
|
|
1568
|
+
scrollTo(curIndex);
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
expose({
|
|
1572
|
+
scrollToByIndex: scrollToByIndex,
|
|
1573
|
+
scrollToByName: scrollToByName
|
|
1574
|
+
}); // ----------------- title -----------------
|
|
1575
|
+
|
|
1576
|
+
var titlesRef = (0,external_vue_.ref)([]);
|
|
1577
|
+
var tabListRef = (0,external_vue_.ref)();
|
|
1578
|
+
|
|
1579
|
+
var getTitlesRef = function getTitlesRef(index) {
|
|
1580
|
+
return function (titleRef) {
|
|
1581
|
+
titlesRef.value[index] = titleRef;
|
|
1582
|
+
};
|
|
1583
|
+
}; // 点击 title 的时候,emit 出 click 事件,并滑动到对应的 tab
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
var clickTitle = function clickTitle(index) {
|
|
1587
|
+
var _ref2 = childrenList[index].$props || {},
|
|
1588
|
+
title = _ref2.title,
|
|
1589
|
+
clickedName = _ref2.name,
|
|
1590
|
+
disabled = _ref2.disabled;
|
|
1591
|
+
|
|
1592
|
+
if (activeIndex.value === index) return;
|
|
1593
|
+
emit(disabled ? 'disabledClick' : 'click', index, title, clickedName);
|
|
1594
|
+
if (disabled) return;
|
|
1595
|
+
scrollTo(index);
|
|
1596
|
+
}; // 更新 title 的偏移量
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
var titleScrollToView = /*#__PURE__*/function () {
|
|
1600
|
+
var _ref3 = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee() {
|
|
1601
|
+
return regenerator_default().wrap(function _callee$(_context) {
|
|
1602
|
+
while (1) {
|
|
1603
|
+
switch (_context.prev = _context.next) {
|
|
1604
|
+
case 0:
|
|
1605
|
+
_context.next = 2;
|
|
1606
|
+
return (0,external_vue_.nextTick)(function () {
|
|
1607
|
+
if (!isTabScrollable.value || !tabListRef.value) return;
|
|
1608
|
+
var tabListEl = tabListRef.value;
|
|
1609
|
+
if (!tabListEl || !titlesRef.value[activeIndex.value]) return;
|
|
1610
|
+
var curTitleEl = titlesRef.value[activeIndex.value].$el;
|
|
1611
|
+
var scrollDistance = curTitleEl.offsetLeft - (tabListEl.offsetWidth - curTitleEl.offsetWidth) / 2 - tabListEl.scrollLeft;
|
|
1612
|
+
tabListEl.scrollBy({
|
|
1613
|
+
left: scrollDistance,
|
|
1614
|
+
behavior: 'smooth'
|
|
1615
|
+
});
|
|
1616
|
+
});
|
|
1617
|
+
|
|
1618
|
+
case 2:
|
|
1619
|
+
case "end":
|
|
1620
|
+
return _context.stop();
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
}, _callee);
|
|
1624
|
+
}));
|
|
1625
|
+
|
|
1626
|
+
return function titleScrollToView() {
|
|
1627
|
+
return _ref3.apply(this, arguments);
|
|
1628
|
+
};
|
|
1629
|
+
}(); // 确保在每次更新之前重置 titlesRef
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
(0,external_vue_.onBeforeUpdate)(function () {
|
|
1633
|
+
titlesRef.value = [];
|
|
1634
|
+
}); // ----------------- line -----------------
|
|
1635
|
+
|
|
1636
|
+
var lintState = (0,external_vue_.reactive)({
|
|
1637
|
+
transform: 'translateX(50%)',
|
|
1638
|
+
transition: 'all 0ms ease-out'
|
|
1639
|
+
}); // 更新下划线的偏移量
|
|
1640
|
+
|
|
1641
|
+
var updateLineStyle = /*#__PURE__*/function () {
|
|
1642
|
+
var _ref4 = (0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee2() {
|
|
1643
|
+
return regenerator_default().wrap(function _callee2$(_context2) {
|
|
1644
|
+
while (1) {
|
|
1645
|
+
switch (_context2.prev = _context2.next) {
|
|
1646
|
+
case 0:
|
|
1647
|
+
_context2.next = 2;
|
|
1648
|
+
return (0,external_vue_.nextTick)(function () {
|
|
1649
|
+
if (!titlesRef.value || titlesRef.value.length === 0) return; // 如果传递的 activeIndex 不存在或者大于当前的长度,则设置为默认值
|
|
1650
|
+
|
|
1651
|
+
// 如果传递的 activeIndex 不存在或者大于当前的长度,则设置为默认值
|
|
1652
|
+
var curIndex = activeIndex.value >= titlesRef.value.length ? 0 : activeIndex.value; // 获取当前 active 的 title
|
|
1653
|
+
|
|
1654
|
+
// 获取当前 active 的 title
|
|
1655
|
+
var curTitle = titlesRef.value[curIndex].$el;
|
|
1656
|
+
var left = curTitle.offsetLeft + curTitle.offsetWidth / 2;
|
|
1657
|
+
lintState.transform = "translateX(".concat(left, "px) translateX(-50%)"); // 如果已经初始化了,则给下划线加上动画
|
|
1658
|
+
|
|
1659
|
+
// 如果已经初始化了,则给下划线加上动画
|
|
1660
|
+
if (inited.value) {
|
|
1661
|
+
lintState.transition = "all ".concat(props.duration, "ms ease-out");
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
inited.value = true;
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
|
+
case 2:
|
|
1668
|
+
case "end":
|
|
1669
|
+
return _context2.stop();
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}, _callee2);
|
|
1673
|
+
}));
|
|
1674
|
+
|
|
1675
|
+
return function updateLineStyle() {
|
|
1676
|
+
return _ref4.apply(this, arguments);
|
|
1677
|
+
};
|
|
1678
|
+
}(); // ----------------- swiper -----------------
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
var swipeChange = function swipeChange(index) {
|
|
1682
|
+
var _ref5 = childrenList[index].$props || {},
|
|
1683
|
+
title = _ref5.title,
|
|
1684
|
+
swiperedName = _ref5.name;
|
|
1685
|
+
|
|
1686
|
+
emit('change', index, title, swiperedName);
|
|
1687
|
+
activeIndex.value = index;
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1690
|
+
var swipeAfterChange = function swipeAfterChange(index) {
|
|
1691
|
+
var _ref6 = childrenList[index].$props || {},
|
|
1692
|
+
title = _ref6.title,
|
|
1693
|
+
afterSwiperedName = _ref6.name;
|
|
1694
|
+
|
|
1695
|
+
emit('afterChange', index, title, afterSwiperedName);
|
|
1696
|
+
activeIndex.value = index;
|
|
1697
|
+
}; // ----------------- provide -----------------
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
var tabs = (0,external_vue_.reactive)({
|
|
1701
|
+
children: childrenList,
|
|
1702
|
+
activeIndex: activeIndex,
|
|
1703
|
+
props: props
|
|
1704
|
+
});
|
|
1705
|
+
initProvide(tabs); // ----------------- methods -----------------
|
|
1706
|
+
|
|
1707
|
+
var getSize = function getSize(value) {
|
|
1708
|
+
if (isString(value)) return /^\d+(\.\d+)?$/.test(value) ? "".concat(value, "px") : value;
|
|
1709
|
+
return value;
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
var isString = function isString(value) {
|
|
1713
|
+
return Object.prototype.toString.call(value) === "[object String]";
|
|
1714
|
+
}; // ----------------- 生命周期 -----------------
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
(0,external_vue_.onMounted)( /*#__PURE__*/(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee3() {
|
|
1718
|
+
return regenerator_default().wrap(function _callee3$(_context3) {
|
|
1719
|
+
while (1) {
|
|
1720
|
+
switch (_context3.prev = _context3.next) {
|
|
1721
|
+
case 0:
|
|
1722
|
+
_context3.next = 2;
|
|
1723
|
+
return updateLineStyle();
|
|
1724
|
+
|
|
1725
|
+
case 2:
|
|
1726
|
+
case "end":
|
|
1727
|
+
return _context3.stop();
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}, _callee3);
|
|
1731
|
+
}))); // 监听 activeIndex 的变化
|
|
1732
|
+
|
|
1733
|
+
(0,external_vue_.watch)(function () {
|
|
1734
|
+
return activeIndex.value;
|
|
1735
|
+
}, /*#__PURE__*/(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee4() {
|
|
1736
|
+
return regenerator_default().wrap(function _callee4$(_context4) {
|
|
1737
|
+
while (1) {
|
|
1738
|
+
switch (_context4.prev = _context4.next) {
|
|
1739
|
+
case 0:
|
|
1740
|
+
_context4.next = 2;
|
|
1741
|
+
return updateLineStyle();
|
|
1742
|
+
|
|
1743
|
+
case 2:
|
|
1744
|
+
_context4.next = 4;
|
|
1745
|
+
return titleScrollToView();
|
|
1746
|
+
|
|
1747
|
+
case 4:
|
|
1748
|
+
case "end":
|
|
1749
|
+
return _context4.stop();
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}, _callee4);
|
|
1753
|
+
}))); // 监听 slots.default 的 length 变化
|
|
1754
|
+
|
|
1755
|
+
(0,external_vue_.watch)(function () {
|
|
1756
|
+
var _slots$default;
|
|
1757
|
+
|
|
1758
|
+
return (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.length;
|
|
1759
|
+
}, /*#__PURE__*/(0,asyncToGenerator/* default */.Z)( /*#__PURE__*/regenerator_default().mark(function _callee5() {
|
|
1760
|
+
return regenerator_default().wrap(function _callee5$(_context5) {
|
|
1761
|
+
while (1) {
|
|
1762
|
+
switch (_context5.prev = _context5.next) {
|
|
1763
|
+
case 0:
|
|
1764
|
+
_context5.next = 2;
|
|
1765
|
+
return updateLineStyle();
|
|
1766
|
+
|
|
1767
|
+
case 2:
|
|
1768
|
+
case "end":
|
|
1769
|
+
return _context5.stop();
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
}, _callee5);
|
|
1773
|
+
})));
|
|
1774
|
+
return function () {
|
|
1775
|
+
var _slot;
|
|
1776
|
+
|
|
1777
|
+
var _bem;
|
|
1778
|
+
|
|
1779
|
+
return (0,external_vue_.createVNode)("div", {
|
|
1780
|
+
"class": tabs_name
|
|
1781
|
+
}, [(0,external_vue_.createVNode)("div", {
|
|
1782
|
+
"class": tabs_bem('list')
|
|
1783
|
+
}, [(0,external_vue_.createVNode)("div", {
|
|
1784
|
+
"ref": tabListRef,
|
|
1785
|
+
"class": tabs_bem('list-child-wrapper', (_bem = {
|
|
1786
|
+
scrollable: isTabScrollable.value
|
|
1787
|
+
}, (0,defineProperty/* default */.Z)(_bem, props.size, props.size), (0,defineProperty/* default */.Z)(_bem, props.align, props.align), _bem))
|
|
1788
|
+
}, [childrenList.length > 0 && childrenList.map(function (node, index) {
|
|
1789
|
+
return (0,external_vue_.createVNode)(title, {
|
|
1790
|
+
"title": node.title,
|
|
1791
|
+
"disabled": node.disabled,
|
|
1792
|
+
"title-slot": node.$slots.title,
|
|
1793
|
+
"key": index,
|
|
1794
|
+
"ref": getTitlesRef(index),
|
|
1795
|
+
"active": activeIndex.value === index,
|
|
1796
|
+
"scrollable": isTabScrollable.value,
|
|
1797
|
+
"onClick": function onClick() {
|
|
1798
|
+
return clickTitle(index);
|
|
1799
|
+
}
|
|
1800
|
+
}, null);
|
|
1801
|
+
}), (0,external_vue_.createVNode)("div", {
|
|
1802
|
+
"class": tabs_bem('line'),
|
|
1803
|
+
"style": tabs_objectSpread(tabs_objectSpread({}, lintState), {}, {
|
|
1804
|
+
width: getSize(props.lineWidth),
|
|
1805
|
+
height: getSize(props.lineHeight),
|
|
1806
|
+
backgroundColor: props.lineColor
|
|
1807
|
+
})
|
|
1808
|
+
}, null)])]), slots.default ? (0,external_vue_.createVNode)(swipe/* default */.Z, {
|
|
1809
|
+
"ref": swiperRef,
|
|
1810
|
+
"dots": false,
|
|
1811
|
+
"loop": false,
|
|
1812
|
+
"initIndex": activeIndex.value,
|
|
1813
|
+
"lazy": props.lazy,
|
|
1814
|
+
"touchable": props.touchable,
|
|
1815
|
+
"duration": props.duration,
|
|
1816
|
+
"is-follow-hand": props.changeWithAnimation,
|
|
1817
|
+
"onChange": swipeChange,
|
|
1818
|
+
"onAfterChange": swipeAfterChange
|
|
1819
|
+
}, _isSlot(_slot = slots.default()) ? _slot : {
|
|
1820
|
+
default: function _default() {
|
|
1821
|
+
return [_slot];
|
|
1822
|
+
}
|
|
1823
|
+
}) : null]);
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
}));
|
|
1827
|
+
;// CONCATENATED MODULE: ./packages/tabs/index.ts
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
|
|
1832
|
+
tabs.install = function (Vue) {
|
|
1833
|
+
var name = tabs.name;
|
|
1834
|
+
Vue.component(name, tabs);
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
|
|
1838
|
+
|
|
671
1839
|
|
|
672
1840
|
/***/ }),
|
|
673
1841
|
|
|
@@ -678,10 +1846,11 @@ var acceptProps = {
|
|
|
678
1846
|
|
|
679
1847
|
// EXPORTS
|
|
680
1848
|
__webpack_require__.d(__webpack_exports__, {
|
|
681
|
-
"do": function() { return /* reexport */ createNamespace; }
|
|
1849
|
+
"do": function() { return /* reexport */ createNamespace; },
|
|
1850
|
+
"GM": function() { return /* reexport */ parsePercent; }
|
|
682
1851
|
});
|
|
683
1852
|
|
|
684
|
-
// UNUSED EXPORTS: Direction, Horizontal, Location, Position, Size, Vertical, createLocale, isArguments, isDate, isError, isFunction, isMap, isNumber, isObject, isPromise, isRegExp, isSet, isString, isSymbol, isWeakMap, isWeakSet, parseFlexDirection,
|
|
1853
|
+
// UNUSED EXPORTS: Direction, Horizontal, Location, Position, Size, Vertical, createLocale, isArguments, isDate, isError, isFunction, isMap, isNumber, isObject, isPromise, isRegExp, isSet, isString, isSymbol, isWeakMap, isWeakSet, parseFlexDirection, parseUnit
|
|
685
1854
|
|
|
686
1855
|
// EXTERNAL MODULE: ./packages/utils/is.ts
|
|
687
1856
|
var is = __webpack_require__(3703);
|
|
@@ -991,6 +2160,31 @@ module.exports = function (it) {
|
|
|
991
2160
|
};
|
|
992
2161
|
|
|
993
2162
|
|
|
2163
|
+
/***/ }),
|
|
2164
|
+
|
|
2165
|
+
/***/ 1285:
|
|
2166
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2167
|
+
|
|
2168
|
+
"use strict";
|
|
2169
|
+
|
|
2170
|
+
var toObject = __webpack_require__(7908);
|
|
2171
|
+
var toAbsoluteIndex = __webpack_require__(1400);
|
|
2172
|
+
var toLength = __webpack_require__(7466);
|
|
2173
|
+
|
|
2174
|
+
// `Array.prototype.fill` method implementation
|
|
2175
|
+
// https://tc39.es/ecma262/#sec-array.prototype.fill
|
|
2176
|
+
module.exports = function fill(value /* , start = 0, end = @length */) {
|
|
2177
|
+
var O = toObject(this);
|
|
2178
|
+
var length = toLength(O.length);
|
|
2179
|
+
var argumentsLength = arguments.length;
|
|
2180
|
+
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
|
|
2181
|
+
var end = argumentsLength > 2 ? arguments[2] : undefined;
|
|
2182
|
+
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
|
|
2183
|
+
while (endPos > index) O[index++] = value;
|
|
2184
|
+
return O;
|
|
2185
|
+
};
|
|
2186
|
+
|
|
2187
|
+
|
|
994
2188
|
/***/ }),
|
|
995
2189
|
|
|
996
2190
|
/***/ 8533:
|
|
@@ -3251,6 +4445,25 @@ $({ target: 'Array', proto: true, forced: FORCED }, {
|
|
|
3251
4445
|
});
|
|
3252
4446
|
|
|
3253
4447
|
|
|
4448
|
+
/***/ }),
|
|
4449
|
+
|
|
4450
|
+
/***/ 3290:
|
|
4451
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
4452
|
+
|
|
4453
|
+
var $ = __webpack_require__(2109);
|
|
4454
|
+
var fill = __webpack_require__(1285);
|
|
4455
|
+
var addToUnscopables = __webpack_require__(1223);
|
|
4456
|
+
|
|
4457
|
+
// `Array.prototype.fill` method
|
|
4458
|
+
// https://tc39.es/ecma262/#sec-array.prototype.fill
|
|
4459
|
+
$({ target: 'Array', proto: true }, {
|
|
4460
|
+
fill: fill
|
|
4461
|
+
});
|
|
4462
|
+
|
|
4463
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
4464
|
+
addToUnscopables('fill');
|
|
4465
|
+
|
|
4466
|
+
|
|
3254
4467
|
/***/ }),
|
|
3255
4468
|
|
|
3256
4469
|
/***/ 7327:
|
|
@@ -3355,6 +4568,29 @@ $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
|
|
3355
4568
|
});
|
|
3356
4569
|
|
|
3357
4570
|
|
|
4571
|
+
/***/ }),
|
|
4572
|
+
|
|
4573
|
+
/***/ 1249:
|
|
4574
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
4575
|
+
|
|
4576
|
+
"use strict";
|
|
4577
|
+
|
|
4578
|
+
var $ = __webpack_require__(2109);
|
|
4579
|
+
var $map = __webpack_require__(2092).map;
|
|
4580
|
+
var arrayMethodHasSpeciesSupport = __webpack_require__(1194);
|
|
4581
|
+
|
|
4582
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
|
4583
|
+
|
|
4584
|
+
// `Array.prototype.map` method
|
|
4585
|
+
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
4586
|
+
// with adding support of @@species
|
|
4587
|
+
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
4588
|
+
map: function map(callbackfn /* , thisArg */) {
|
|
4589
|
+
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
4590
|
+
}
|
|
4591
|
+
});
|
|
4592
|
+
|
|
4593
|
+
|
|
3358
4594
|
/***/ }),
|
|
3359
4595
|
|
|
3360
4596
|
/***/ 5827:
|
|
@@ -4266,6 +5502,761 @@ for (var COLLECTION_NAME in DOMIterables) {
|
|
|
4266
5502
|
}
|
|
4267
5503
|
|
|
4268
5504
|
|
|
5505
|
+
/***/ }),
|
|
5506
|
+
|
|
5507
|
+
/***/ 5666:
|
|
5508
|
+
/***/ (function(module) {
|
|
5509
|
+
|
|
5510
|
+
/**
|
|
5511
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
5512
|
+
*
|
|
5513
|
+
* This source code is licensed under the MIT license found in the
|
|
5514
|
+
* LICENSE file in the root directory of this source tree.
|
|
5515
|
+
*/
|
|
5516
|
+
|
|
5517
|
+
var runtime = (function (exports) {
|
|
5518
|
+
"use strict";
|
|
5519
|
+
|
|
5520
|
+
var Op = Object.prototype;
|
|
5521
|
+
var hasOwn = Op.hasOwnProperty;
|
|
5522
|
+
var undefined; // More compressible than void 0.
|
|
5523
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
5524
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
5525
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
5526
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
5527
|
+
|
|
5528
|
+
function define(obj, key, value) {
|
|
5529
|
+
Object.defineProperty(obj, key, {
|
|
5530
|
+
value: value,
|
|
5531
|
+
enumerable: true,
|
|
5532
|
+
configurable: true,
|
|
5533
|
+
writable: true
|
|
5534
|
+
});
|
|
5535
|
+
return obj[key];
|
|
5536
|
+
}
|
|
5537
|
+
try {
|
|
5538
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
5539
|
+
define({}, "");
|
|
5540
|
+
} catch (err) {
|
|
5541
|
+
define = function(obj, key, value) {
|
|
5542
|
+
return obj[key] = value;
|
|
5543
|
+
};
|
|
5544
|
+
}
|
|
5545
|
+
|
|
5546
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
5547
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
5548
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
5549
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
5550
|
+
var context = new Context(tryLocsList || []);
|
|
5551
|
+
|
|
5552
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
5553
|
+
// .throw, and .return methods.
|
|
5554
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
5555
|
+
|
|
5556
|
+
return generator;
|
|
5557
|
+
}
|
|
5558
|
+
exports.wrap = wrap;
|
|
5559
|
+
|
|
5560
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
5561
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
5562
|
+
// have been (and was previously) designed to take a closure to be
|
|
5563
|
+
// invoked without arguments, but in all the cases we care about we
|
|
5564
|
+
// already have an existing method we want to call, so there's no need
|
|
5565
|
+
// to create a new function object. We can even get away with assuming
|
|
5566
|
+
// the method takes exactly one argument, since that happens to be true
|
|
5567
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
5568
|
+
// only additional allocation required is the completion record, which
|
|
5569
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
5570
|
+
function tryCatch(fn, obj, arg) {
|
|
5571
|
+
try {
|
|
5572
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
|
5573
|
+
} catch (err) {
|
|
5574
|
+
return { type: "throw", arg: err };
|
|
5575
|
+
}
|
|
5576
|
+
}
|
|
5577
|
+
|
|
5578
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
5579
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
5580
|
+
var GenStateExecuting = "executing";
|
|
5581
|
+
var GenStateCompleted = "completed";
|
|
5582
|
+
|
|
5583
|
+
// Returning this object from the innerFn has the same effect as
|
|
5584
|
+
// breaking out of the dispatch switch statement.
|
|
5585
|
+
var ContinueSentinel = {};
|
|
5586
|
+
|
|
5587
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
5588
|
+
// .constructor.prototype properties for functions that return Generator
|
|
5589
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
5590
|
+
// minifier not to mangle the names of these two functions.
|
|
5591
|
+
function Generator() {}
|
|
5592
|
+
function GeneratorFunction() {}
|
|
5593
|
+
function GeneratorFunctionPrototype() {}
|
|
5594
|
+
|
|
5595
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
5596
|
+
// don't natively support it.
|
|
5597
|
+
var IteratorPrototype = {};
|
|
5598
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
5599
|
+
return this;
|
|
5600
|
+
};
|
|
5601
|
+
|
|
5602
|
+
var getProto = Object.getPrototypeOf;
|
|
5603
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
5604
|
+
if (NativeIteratorPrototype &&
|
|
5605
|
+
NativeIteratorPrototype !== Op &&
|
|
5606
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
5607
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
5608
|
+
// of the polyfill.
|
|
5609
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
5610
|
+
}
|
|
5611
|
+
|
|
5612
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
|
5613
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
|
5614
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
5615
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
5616
|
+
GeneratorFunction.displayName = define(
|
|
5617
|
+
GeneratorFunctionPrototype,
|
|
5618
|
+
toStringTagSymbol,
|
|
5619
|
+
"GeneratorFunction"
|
|
5620
|
+
);
|
|
5621
|
+
|
|
5622
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
5623
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
5624
|
+
function defineIteratorMethods(prototype) {
|
|
5625
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
5626
|
+
define(prototype, method, function(arg) {
|
|
5627
|
+
return this._invoke(method, arg);
|
|
5628
|
+
});
|
|
5629
|
+
});
|
|
5630
|
+
}
|
|
5631
|
+
|
|
5632
|
+
exports.isGeneratorFunction = function(genFun) {
|
|
5633
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
5634
|
+
return ctor
|
|
5635
|
+
? ctor === GeneratorFunction ||
|
|
5636
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
5637
|
+
// do is to check its .name property.
|
|
5638
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
5639
|
+
: false;
|
|
5640
|
+
};
|
|
5641
|
+
|
|
5642
|
+
exports.mark = function(genFun) {
|
|
5643
|
+
if (Object.setPrototypeOf) {
|
|
5644
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
5645
|
+
} else {
|
|
5646
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
5647
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
5648
|
+
}
|
|
5649
|
+
genFun.prototype = Object.create(Gp);
|
|
5650
|
+
return genFun;
|
|
5651
|
+
};
|
|
5652
|
+
|
|
5653
|
+
// Within the body of any async function, `await x` is transformed to
|
|
5654
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
5655
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
5656
|
+
// meant to be awaited.
|
|
5657
|
+
exports.awrap = function(arg) {
|
|
5658
|
+
return { __await: arg };
|
|
5659
|
+
};
|
|
5660
|
+
|
|
5661
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
5662
|
+
function invoke(method, arg, resolve, reject) {
|
|
5663
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
5664
|
+
if (record.type === "throw") {
|
|
5665
|
+
reject(record.arg);
|
|
5666
|
+
} else {
|
|
5667
|
+
var result = record.arg;
|
|
5668
|
+
var value = result.value;
|
|
5669
|
+
if (value &&
|
|
5670
|
+
typeof value === "object" &&
|
|
5671
|
+
hasOwn.call(value, "__await")) {
|
|
5672
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
5673
|
+
invoke("next", value, resolve, reject);
|
|
5674
|
+
}, function(err) {
|
|
5675
|
+
invoke("throw", err, resolve, reject);
|
|
5676
|
+
});
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5679
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
5680
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
5681
|
+
// the .value of the Promise<{value,done}> result for the
|
|
5682
|
+
// current iteration.
|
|
5683
|
+
result.value = unwrapped;
|
|
5684
|
+
resolve(result);
|
|
5685
|
+
}, function(error) {
|
|
5686
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
5687
|
+
// into the async generator function so it can be handled there.
|
|
5688
|
+
return invoke("throw", error, resolve, reject);
|
|
5689
|
+
});
|
|
5690
|
+
}
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5693
|
+
var previousPromise;
|
|
5694
|
+
|
|
5695
|
+
function enqueue(method, arg) {
|
|
5696
|
+
function callInvokeWithMethodAndArg() {
|
|
5697
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
5698
|
+
invoke(method, arg, resolve, reject);
|
|
5699
|
+
});
|
|
5700
|
+
}
|
|
5701
|
+
|
|
5702
|
+
return previousPromise =
|
|
5703
|
+
// If enqueue has been called before, then we want to wait until
|
|
5704
|
+
// all previous Promises have been resolved before calling invoke,
|
|
5705
|
+
// so that results are always delivered in the correct order. If
|
|
5706
|
+
// enqueue has not been called before, then it is important to
|
|
5707
|
+
// call invoke immediately, without waiting on a callback to fire,
|
|
5708
|
+
// so that the async generator function has the opportunity to do
|
|
5709
|
+
// any necessary setup in a predictable way. This predictability
|
|
5710
|
+
// is why the Promise constructor synchronously invokes its
|
|
5711
|
+
// executor callback, and why async functions synchronously
|
|
5712
|
+
// execute code before the first await. Since we implement simple
|
|
5713
|
+
// async functions in terms of async generators, it is especially
|
|
5714
|
+
// important to get this right, even though it requires care.
|
|
5715
|
+
previousPromise ? previousPromise.then(
|
|
5716
|
+
callInvokeWithMethodAndArg,
|
|
5717
|
+
// Avoid propagating failures to Promises returned by later
|
|
5718
|
+
// invocations of the iterator.
|
|
5719
|
+
callInvokeWithMethodAndArg
|
|
5720
|
+
) : callInvokeWithMethodAndArg();
|
|
5721
|
+
}
|
|
5722
|
+
|
|
5723
|
+
// Define the unified helper method that is used to implement .next,
|
|
5724
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
5725
|
+
this._invoke = enqueue;
|
|
5726
|
+
}
|
|
5727
|
+
|
|
5728
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
5729
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
5730
|
+
return this;
|
|
5731
|
+
};
|
|
5732
|
+
exports.AsyncIterator = AsyncIterator;
|
|
5733
|
+
|
|
5734
|
+
// Note that simple async functions are implemented on top of
|
|
5735
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
5736
|
+
// the final result produced by the iterator.
|
|
5737
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
5738
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
5739
|
+
|
|
5740
|
+
var iter = new AsyncIterator(
|
|
5741
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
|
5742
|
+
PromiseImpl
|
|
5743
|
+
);
|
|
5744
|
+
|
|
5745
|
+
return exports.isGeneratorFunction(outerFn)
|
|
5746
|
+
? iter // If outerFn is a generator, return the full iterator.
|
|
5747
|
+
: iter.next().then(function(result) {
|
|
5748
|
+
return result.done ? result.value : iter.next();
|
|
5749
|
+
});
|
|
5750
|
+
};
|
|
5751
|
+
|
|
5752
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
5753
|
+
var state = GenStateSuspendedStart;
|
|
5754
|
+
|
|
5755
|
+
return function invoke(method, arg) {
|
|
5756
|
+
if (state === GenStateExecuting) {
|
|
5757
|
+
throw new Error("Generator is already running");
|
|
5758
|
+
}
|
|
5759
|
+
|
|
5760
|
+
if (state === GenStateCompleted) {
|
|
5761
|
+
if (method === "throw") {
|
|
5762
|
+
throw arg;
|
|
5763
|
+
}
|
|
5764
|
+
|
|
5765
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
5766
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
5767
|
+
return doneResult();
|
|
5768
|
+
}
|
|
5769
|
+
|
|
5770
|
+
context.method = method;
|
|
5771
|
+
context.arg = arg;
|
|
5772
|
+
|
|
5773
|
+
while (true) {
|
|
5774
|
+
var delegate = context.delegate;
|
|
5775
|
+
if (delegate) {
|
|
5776
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
5777
|
+
if (delegateResult) {
|
|
5778
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
5779
|
+
return delegateResult;
|
|
5780
|
+
}
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
if (context.method === "next") {
|
|
5784
|
+
// Setting context._sent for legacy support of Babel's
|
|
5785
|
+
// function.sent implementation.
|
|
5786
|
+
context.sent = context._sent = context.arg;
|
|
5787
|
+
|
|
5788
|
+
} else if (context.method === "throw") {
|
|
5789
|
+
if (state === GenStateSuspendedStart) {
|
|
5790
|
+
state = GenStateCompleted;
|
|
5791
|
+
throw context.arg;
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
context.dispatchException(context.arg);
|
|
5795
|
+
|
|
5796
|
+
} else if (context.method === "return") {
|
|
5797
|
+
context.abrupt("return", context.arg);
|
|
5798
|
+
}
|
|
5799
|
+
|
|
5800
|
+
state = GenStateExecuting;
|
|
5801
|
+
|
|
5802
|
+
var record = tryCatch(innerFn, self, context);
|
|
5803
|
+
if (record.type === "normal") {
|
|
5804
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
5805
|
+
// GenStateExecuting and loop back for another invocation.
|
|
5806
|
+
state = context.done
|
|
5807
|
+
? GenStateCompleted
|
|
5808
|
+
: GenStateSuspendedYield;
|
|
5809
|
+
|
|
5810
|
+
if (record.arg === ContinueSentinel) {
|
|
5811
|
+
continue;
|
|
5812
|
+
}
|
|
5813
|
+
|
|
5814
|
+
return {
|
|
5815
|
+
value: record.arg,
|
|
5816
|
+
done: context.done
|
|
5817
|
+
};
|
|
5818
|
+
|
|
5819
|
+
} else if (record.type === "throw") {
|
|
5820
|
+
state = GenStateCompleted;
|
|
5821
|
+
// Dispatch the exception by looping back around to the
|
|
5822
|
+
// context.dispatchException(context.arg) call above.
|
|
5823
|
+
context.method = "throw";
|
|
5824
|
+
context.arg = record.arg;
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
};
|
|
5828
|
+
}
|
|
5829
|
+
|
|
5830
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
5831
|
+
// result, either by returning a { value, done } result from the
|
|
5832
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
5833
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
5834
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
5835
|
+
var method = delegate.iterator[context.method];
|
|
5836
|
+
if (method === undefined) {
|
|
5837
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
5838
|
+
// method always terminates the yield* loop.
|
|
5839
|
+
context.delegate = null;
|
|
5840
|
+
|
|
5841
|
+
if (context.method === "throw") {
|
|
5842
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
5843
|
+
if (delegate.iterator["return"]) {
|
|
5844
|
+
// If the delegate iterator has a return method, give it a
|
|
5845
|
+
// chance to clean up.
|
|
5846
|
+
context.method = "return";
|
|
5847
|
+
context.arg = undefined;
|
|
5848
|
+
maybeInvokeDelegate(delegate, context);
|
|
5849
|
+
|
|
5850
|
+
if (context.method === "throw") {
|
|
5851
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
5852
|
+
// "return" to "throw", let that override the TypeError below.
|
|
5853
|
+
return ContinueSentinel;
|
|
5854
|
+
}
|
|
5855
|
+
}
|
|
5856
|
+
|
|
5857
|
+
context.method = "throw";
|
|
5858
|
+
context.arg = new TypeError(
|
|
5859
|
+
"The iterator does not provide a 'throw' method");
|
|
5860
|
+
}
|
|
5861
|
+
|
|
5862
|
+
return ContinueSentinel;
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
5866
|
+
|
|
5867
|
+
if (record.type === "throw") {
|
|
5868
|
+
context.method = "throw";
|
|
5869
|
+
context.arg = record.arg;
|
|
5870
|
+
context.delegate = null;
|
|
5871
|
+
return ContinueSentinel;
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5874
|
+
var info = record.arg;
|
|
5875
|
+
|
|
5876
|
+
if (! info) {
|
|
5877
|
+
context.method = "throw";
|
|
5878
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
5879
|
+
context.delegate = null;
|
|
5880
|
+
return ContinueSentinel;
|
|
5881
|
+
}
|
|
5882
|
+
|
|
5883
|
+
if (info.done) {
|
|
5884
|
+
// Assign the result of the finished delegate to the temporary
|
|
5885
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
5886
|
+
context[delegate.resultName] = info.value;
|
|
5887
|
+
|
|
5888
|
+
// Resume execution at the desired location (see delegateYield).
|
|
5889
|
+
context.next = delegate.nextLoc;
|
|
5890
|
+
|
|
5891
|
+
// If context.method was "throw" but the delegate handled the
|
|
5892
|
+
// exception, let the outer generator proceed normally. If
|
|
5893
|
+
// context.method was "next", forget context.arg since it has been
|
|
5894
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
5895
|
+
// "return", allow the original .return call to continue in the
|
|
5896
|
+
// outer generator.
|
|
5897
|
+
if (context.method !== "return") {
|
|
5898
|
+
context.method = "next";
|
|
5899
|
+
context.arg = undefined;
|
|
5900
|
+
}
|
|
5901
|
+
|
|
5902
|
+
} else {
|
|
5903
|
+
// Re-yield the result returned by the delegate method.
|
|
5904
|
+
return info;
|
|
5905
|
+
}
|
|
5906
|
+
|
|
5907
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
5908
|
+
// the outer generator.
|
|
5909
|
+
context.delegate = null;
|
|
5910
|
+
return ContinueSentinel;
|
|
5911
|
+
}
|
|
5912
|
+
|
|
5913
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
5914
|
+
// unified ._invoke helper method.
|
|
5915
|
+
defineIteratorMethods(Gp);
|
|
5916
|
+
|
|
5917
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
5918
|
+
|
|
5919
|
+
// A Generator should always return itself as the iterator object when the
|
|
5920
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
5921
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
5922
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
5923
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
5924
|
+
Gp[iteratorSymbol] = function() {
|
|
5925
|
+
return this;
|
|
5926
|
+
};
|
|
5927
|
+
|
|
5928
|
+
Gp.toString = function() {
|
|
5929
|
+
return "[object Generator]";
|
|
5930
|
+
};
|
|
5931
|
+
|
|
5932
|
+
function pushTryEntry(locs) {
|
|
5933
|
+
var entry = { tryLoc: locs[0] };
|
|
5934
|
+
|
|
5935
|
+
if (1 in locs) {
|
|
5936
|
+
entry.catchLoc = locs[1];
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5939
|
+
if (2 in locs) {
|
|
5940
|
+
entry.finallyLoc = locs[2];
|
|
5941
|
+
entry.afterLoc = locs[3];
|
|
5942
|
+
}
|
|
5943
|
+
|
|
5944
|
+
this.tryEntries.push(entry);
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
function resetTryEntry(entry) {
|
|
5948
|
+
var record = entry.completion || {};
|
|
5949
|
+
record.type = "normal";
|
|
5950
|
+
delete record.arg;
|
|
5951
|
+
entry.completion = record;
|
|
5952
|
+
}
|
|
5953
|
+
|
|
5954
|
+
function Context(tryLocsList) {
|
|
5955
|
+
// The root entry object (effectively a try statement without a catch
|
|
5956
|
+
// or a finally block) gives us a place to store values thrown from
|
|
5957
|
+
// locations where there is no enclosing try statement.
|
|
5958
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
|
5959
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
5960
|
+
this.reset(true);
|
|
5961
|
+
}
|
|
5962
|
+
|
|
5963
|
+
exports.keys = function(object) {
|
|
5964
|
+
var keys = [];
|
|
5965
|
+
for (var key in object) {
|
|
5966
|
+
keys.push(key);
|
|
5967
|
+
}
|
|
5968
|
+
keys.reverse();
|
|
5969
|
+
|
|
5970
|
+
// Rather than returning an object with a next method, we keep
|
|
5971
|
+
// things simple and return the next function itself.
|
|
5972
|
+
return function next() {
|
|
5973
|
+
while (keys.length) {
|
|
5974
|
+
var key = keys.pop();
|
|
5975
|
+
if (key in object) {
|
|
5976
|
+
next.value = key;
|
|
5977
|
+
next.done = false;
|
|
5978
|
+
return next;
|
|
5979
|
+
}
|
|
5980
|
+
}
|
|
5981
|
+
|
|
5982
|
+
// To avoid creating an additional object, we just hang the .value
|
|
5983
|
+
// and .done properties off the next function object itself. This
|
|
5984
|
+
// also ensures that the minifier will not anonymize the function.
|
|
5985
|
+
next.done = true;
|
|
5986
|
+
return next;
|
|
5987
|
+
};
|
|
5988
|
+
};
|
|
5989
|
+
|
|
5990
|
+
function values(iterable) {
|
|
5991
|
+
if (iterable) {
|
|
5992
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
5993
|
+
if (iteratorMethod) {
|
|
5994
|
+
return iteratorMethod.call(iterable);
|
|
5995
|
+
}
|
|
5996
|
+
|
|
5997
|
+
if (typeof iterable.next === "function") {
|
|
5998
|
+
return iterable;
|
|
5999
|
+
}
|
|
6000
|
+
|
|
6001
|
+
if (!isNaN(iterable.length)) {
|
|
6002
|
+
var i = -1, next = function next() {
|
|
6003
|
+
while (++i < iterable.length) {
|
|
6004
|
+
if (hasOwn.call(iterable, i)) {
|
|
6005
|
+
next.value = iterable[i];
|
|
6006
|
+
next.done = false;
|
|
6007
|
+
return next;
|
|
6008
|
+
}
|
|
6009
|
+
}
|
|
6010
|
+
|
|
6011
|
+
next.value = undefined;
|
|
6012
|
+
next.done = true;
|
|
6013
|
+
|
|
6014
|
+
return next;
|
|
6015
|
+
};
|
|
6016
|
+
|
|
6017
|
+
return next.next = next;
|
|
6018
|
+
}
|
|
6019
|
+
}
|
|
6020
|
+
|
|
6021
|
+
// Return an iterator with no values.
|
|
6022
|
+
return { next: doneResult };
|
|
6023
|
+
}
|
|
6024
|
+
exports.values = values;
|
|
6025
|
+
|
|
6026
|
+
function doneResult() {
|
|
6027
|
+
return { value: undefined, done: true };
|
|
6028
|
+
}
|
|
6029
|
+
|
|
6030
|
+
Context.prototype = {
|
|
6031
|
+
constructor: Context,
|
|
6032
|
+
|
|
6033
|
+
reset: function(skipTempReset) {
|
|
6034
|
+
this.prev = 0;
|
|
6035
|
+
this.next = 0;
|
|
6036
|
+
// Resetting context._sent for legacy support of Babel's
|
|
6037
|
+
// function.sent implementation.
|
|
6038
|
+
this.sent = this._sent = undefined;
|
|
6039
|
+
this.done = false;
|
|
6040
|
+
this.delegate = null;
|
|
6041
|
+
|
|
6042
|
+
this.method = "next";
|
|
6043
|
+
this.arg = undefined;
|
|
6044
|
+
|
|
6045
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
6046
|
+
|
|
6047
|
+
if (!skipTempReset) {
|
|
6048
|
+
for (var name in this) {
|
|
6049
|
+
// Not sure about the optimal order of these conditions:
|
|
6050
|
+
if (name.charAt(0) === "t" &&
|
|
6051
|
+
hasOwn.call(this, name) &&
|
|
6052
|
+
!isNaN(+name.slice(1))) {
|
|
6053
|
+
this[name] = undefined;
|
|
6054
|
+
}
|
|
6055
|
+
}
|
|
6056
|
+
}
|
|
6057
|
+
},
|
|
6058
|
+
|
|
6059
|
+
stop: function() {
|
|
6060
|
+
this.done = true;
|
|
6061
|
+
|
|
6062
|
+
var rootEntry = this.tryEntries[0];
|
|
6063
|
+
var rootRecord = rootEntry.completion;
|
|
6064
|
+
if (rootRecord.type === "throw") {
|
|
6065
|
+
throw rootRecord.arg;
|
|
6066
|
+
}
|
|
6067
|
+
|
|
6068
|
+
return this.rval;
|
|
6069
|
+
},
|
|
6070
|
+
|
|
6071
|
+
dispatchException: function(exception) {
|
|
6072
|
+
if (this.done) {
|
|
6073
|
+
throw exception;
|
|
6074
|
+
}
|
|
6075
|
+
|
|
6076
|
+
var context = this;
|
|
6077
|
+
function handle(loc, caught) {
|
|
6078
|
+
record.type = "throw";
|
|
6079
|
+
record.arg = exception;
|
|
6080
|
+
context.next = loc;
|
|
6081
|
+
|
|
6082
|
+
if (caught) {
|
|
6083
|
+
// If the dispatched exception was caught by a catch block,
|
|
6084
|
+
// then let that catch block handle the exception normally.
|
|
6085
|
+
context.method = "next";
|
|
6086
|
+
context.arg = undefined;
|
|
6087
|
+
}
|
|
6088
|
+
|
|
6089
|
+
return !! caught;
|
|
6090
|
+
}
|
|
6091
|
+
|
|
6092
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
6093
|
+
var entry = this.tryEntries[i];
|
|
6094
|
+
var record = entry.completion;
|
|
6095
|
+
|
|
6096
|
+
if (entry.tryLoc === "root") {
|
|
6097
|
+
// Exception thrown outside of any try block that could handle
|
|
6098
|
+
// it, so set the completion value of the entire function to
|
|
6099
|
+
// throw the exception.
|
|
6100
|
+
return handle("end");
|
|
6101
|
+
}
|
|
6102
|
+
|
|
6103
|
+
if (entry.tryLoc <= this.prev) {
|
|
6104
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
6105
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
6106
|
+
|
|
6107
|
+
if (hasCatch && hasFinally) {
|
|
6108
|
+
if (this.prev < entry.catchLoc) {
|
|
6109
|
+
return handle(entry.catchLoc, true);
|
|
6110
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
6111
|
+
return handle(entry.finallyLoc);
|
|
6112
|
+
}
|
|
6113
|
+
|
|
6114
|
+
} else if (hasCatch) {
|
|
6115
|
+
if (this.prev < entry.catchLoc) {
|
|
6116
|
+
return handle(entry.catchLoc, true);
|
|
6117
|
+
}
|
|
6118
|
+
|
|
6119
|
+
} else if (hasFinally) {
|
|
6120
|
+
if (this.prev < entry.finallyLoc) {
|
|
6121
|
+
return handle(entry.finallyLoc);
|
|
6122
|
+
}
|
|
6123
|
+
|
|
6124
|
+
} else {
|
|
6125
|
+
throw new Error("try statement without catch or finally");
|
|
6126
|
+
}
|
|
6127
|
+
}
|
|
6128
|
+
}
|
|
6129
|
+
},
|
|
6130
|
+
|
|
6131
|
+
abrupt: function(type, arg) {
|
|
6132
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
6133
|
+
var entry = this.tryEntries[i];
|
|
6134
|
+
if (entry.tryLoc <= this.prev &&
|
|
6135
|
+
hasOwn.call(entry, "finallyLoc") &&
|
|
6136
|
+
this.prev < entry.finallyLoc) {
|
|
6137
|
+
var finallyEntry = entry;
|
|
6138
|
+
break;
|
|
6139
|
+
}
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6142
|
+
if (finallyEntry &&
|
|
6143
|
+
(type === "break" ||
|
|
6144
|
+
type === "continue") &&
|
|
6145
|
+
finallyEntry.tryLoc <= arg &&
|
|
6146
|
+
arg <= finallyEntry.finallyLoc) {
|
|
6147
|
+
// Ignore the finally entry if control is not jumping to a
|
|
6148
|
+
// location outside the try/catch block.
|
|
6149
|
+
finallyEntry = null;
|
|
6150
|
+
}
|
|
6151
|
+
|
|
6152
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
6153
|
+
record.type = type;
|
|
6154
|
+
record.arg = arg;
|
|
6155
|
+
|
|
6156
|
+
if (finallyEntry) {
|
|
6157
|
+
this.method = "next";
|
|
6158
|
+
this.next = finallyEntry.finallyLoc;
|
|
6159
|
+
return ContinueSentinel;
|
|
6160
|
+
}
|
|
6161
|
+
|
|
6162
|
+
return this.complete(record);
|
|
6163
|
+
},
|
|
6164
|
+
|
|
6165
|
+
complete: function(record, afterLoc) {
|
|
6166
|
+
if (record.type === "throw") {
|
|
6167
|
+
throw record.arg;
|
|
6168
|
+
}
|
|
6169
|
+
|
|
6170
|
+
if (record.type === "break" ||
|
|
6171
|
+
record.type === "continue") {
|
|
6172
|
+
this.next = record.arg;
|
|
6173
|
+
} else if (record.type === "return") {
|
|
6174
|
+
this.rval = this.arg = record.arg;
|
|
6175
|
+
this.method = "return";
|
|
6176
|
+
this.next = "end";
|
|
6177
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
6178
|
+
this.next = afterLoc;
|
|
6179
|
+
}
|
|
6180
|
+
|
|
6181
|
+
return ContinueSentinel;
|
|
6182
|
+
},
|
|
6183
|
+
|
|
6184
|
+
finish: function(finallyLoc) {
|
|
6185
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
6186
|
+
var entry = this.tryEntries[i];
|
|
6187
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
6188
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
6189
|
+
resetTryEntry(entry);
|
|
6190
|
+
return ContinueSentinel;
|
|
6191
|
+
}
|
|
6192
|
+
}
|
|
6193
|
+
},
|
|
6194
|
+
|
|
6195
|
+
"catch": function(tryLoc) {
|
|
6196
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
6197
|
+
var entry = this.tryEntries[i];
|
|
6198
|
+
if (entry.tryLoc === tryLoc) {
|
|
6199
|
+
var record = entry.completion;
|
|
6200
|
+
if (record.type === "throw") {
|
|
6201
|
+
var thrown = record.arg;
|
|
6202
|
+
resetTryEntry(entry);
|
|
6203
|
+
}
|
|
6204
|
+
return thrown;
|
|
6205
|
+
}
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
// The context.catch method must only be called with a location
|
|
6209
|
+
// argument that corresponds to a known catch block.
|
|
6210
|
+
throw new Error("illegal catch attempt");
|
|
6211
|
+
},
|
|
6212
|
+
|
|
6213
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
6214
|
+
this.delegate = {
|
|
6215
|
+
iterator: values(iterable),
|
|
6216
|
+
resultName: resultName,
|
|
6217
|
+
nextLoc: nextLoc
|
|
6218
|
+
};
|
|
6219
|
+
|
|
6220
|
+
if (this.method === "next") {
|
|
6221
|
+
// Deliberately forget the last sent value so that we don't
|
|
6222
|
+
// accidentally pass it on to the delegate.
|
|
6223
|
+
this.arg = undefined;
|
|
6224
|
+
}
|
|
6225
|
+
|
|
6226
|
+
return ContinueSentinel;
|
|
6227
|
+
}
|
|
6228
|
+
};
|
|
6229
|
+
|
|
6230
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
6231
|
+
// or not, return the runtime object so that we can declare the variable
|
|
6232
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
6233
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
6234
|
+
return exports;
|
|
6235
|
+
|
|
6236
|
+
}(
|
|
6237
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
6238
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
6239
|
+
// object. Either way, the resulting object will be used to initialize
|
|
6240
|
+
// the regeneratorRuntime variable at the top of this file.
|
|
6241
|
+
true ? module.exports : 0
|
|
6242
|
+
));
|
|
6243
|
+
|
|
6244
|
+
try {
|
|
6245
|
+
regeneratorRuntime = runtime;
|
|
6246
|
+
} catch (accidentalStrictMode) {
|
|
6247
|
+
// This module should not be running in strict mode, so the above
|
|
6248
|
+
// assignment should always work unless something is misconfigured. Just
|
|
6249
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
6250
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
6251
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
6252
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
6253
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
6254
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
6255
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
6256
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
6257
|
+
}
|
|
6258
|
+
|
|
6259
|
+
|
|
4269
6260
|
/***/ }),
|
|
4270
6261
|
|
|
4271
6262
|
/***/ 4103:
|
|
@@ -4344,24 +6335,11 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__4103__;
|
|
|
4344
6335
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
4345
6336
|
/******/ }();
|
|
4346
6337
|
/******/
|
|
4347
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
4348
|
-
/******/ !function() {
|
|
4349
|
-
/******/ // define __esModule on exports
|
|
4350
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
4351
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
4352
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4353
|
-
/******/ }
|
|
4354
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4355
|
-
/******/ };
|
|
4356
|
-
/******/ }();
|
|
4357
|
-
/******/
|
|
4358
6338
|
/************************************************************************/
|
|
4359
6339
|
var __webpack_exports__ = {};
|
|
4360
6340
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
4361
6341
|
!function() {
|
|
4362
6342
|
"use strict";
|
|
4363
|
-
// ESM COMPAT FLAG
|
|
4364
|
-
__webpack_require__.r(__webpack_exports__);
|
|
4365
6343
|
|
|
4366
6344
|
// EXPORTS
|
|
4367
6345
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -4370,6 +6348,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
4370
6348
|
|
|
4371
6349
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
|
|
4372
6350
|
var es_function_name = __webpack_require__(8309);
|
|
6351
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
|
6352
|
+
var slicedToArray = __webpack_require__(4699);
|
|
4373
6353
|
// EXTERNAL MODULE: external "vue"
|
|
4374
6354
|
var external_vue_ = __webpack_require__(4103);
|
|
4375
6355
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
|
|
@@ -4382,18 +6362,21 @@ var es_object_to_string = __webpack_require__(1539);
|
|
|
4382
6362
|
var swipeItem = __webpack_require__(7481);
|
|
4383
6363
|
// EXTERNAL MODULE: ./packages/context/relation/index.ts + 2 modules
|
|
4384
6364
|
var relation = __webpack_require__(874);
|
|
4385
|
-
// EXTERNAL MODULE: ./packages/
|
|
4386
|
-
var
|
|
6365
|
+
// EXTERNAL MODULE: ./packages/utils/index.ts + 4 modules
|
|
6366
|
+
var utils = __webpack_require__(4105);
|
|
6367
|
+
// EXTERNAL MODULE: ./packages/tabs/index.ts + 3 modules
|
|
6368
|
+
var tabs = __webpack_require__(463);
|
|
4387
6369
|
;// CONCATENATED MODULE: ./packages/tab/src/tab.tsx
|
|
4388
6370
|
|
|
4389
6371
|
|
|
4390
6372
|
|
|
4391
6373
|
|
|
4392
6374
|
|
|
6375
|
+
|
|
4393
6376
|
/*
|
|
4394
6377
|
* @Author: yanmeng
|
|
4395
6378
|
* @Date: 2021-05-10 16:00:46
|
|
4396
|
-
* @LastEditTime: 2022-08-
|
|
6379
|
+
* @LastEditTime: 2022-08-11 15:14:23
|
|
4397
6380
|
* @LastEditors: ruan fei
|
|
4398
6381
|
* @Description: In User Settings Edit
|
|
4399
6382
|
* @FilePath: /yui-vue/packages/tab/src/tab.tsx
|
|
@@ -4405,12 +6388,17 @@ var constants = __webpack_require__(4621);
|
|
|
4405
6388
|
|
|
4406
6389
|
|
|
4407
6390
|
|
|
6391
|
+
|
|
4408
6392
|
function _isSlot(s) {
|
|
4409
6393
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_.isVNode)(s);
|
|
4410
6394
|
}
|
|
4411
6395
|
|
|
6396
|
+
var _createNamespace = (0,utils/* createNamespace */.do)('tab'),
|
|
6397
|
+
_createNamespace2 = (0,slicedToArray/* default */.Z)(_createNamespace, 1),
|
|
6398
|
+
tab_name = _createNamespace2[0];
|
|
6399
|
+
|
|
4412
6400
|
/* harmony default export */ var tab = ((0,external_vue_.defineComponent)({
|
|
4413
|
-
name:
|
|
6401
|
+
name: tab_name,
|
|
4414
6402
|
props: {
|
|
4415
6403
|
title: {
|
|
4416
6404
|
type: String,
|
|
@@ -4428,7 +6416,7 @@ function _isSlot(s) {
|
|
|
4428
6416
|
setup: function setup(_, _ref) {
|
|
4429
6417
|
var slots = _ref.slots;
|
|
4430
6418
|
|
|
4431
|
-
var _useRelation = (0,relation/* useRelation */.jQ)(
|
|
6419
|
+
var _useRelation = (0,relation/* useRelation */.jQ)(tabs/* TABS_KEY */.R7),
|
|
4432
6420
|
parent = _useRelation.parent;
|
|
4433
6421
|
|
|
4434
6422
|
var instance = (0,external_vue_.getCurrentInstance)();
|
|
@@ -4469,6 +6457,7 @@ tab.install = function (Vue) {
|
|
|
4469
6457
|
|
|
4470
6458
|
/* harmony default export */ var packages_tab = (tab);
|
|
4471
6459
|
}();
|
|
6460
|
+
__webpack_exports__ = __webpack_exports__.default;
|
|
4472
6461
|
/******/ return __webpack_exports__;
|
|
4473
6462
|
/******/ })()
|
|
4474
6463
|
;
|