2021-06-21 23:47:23 +08:00

1254 lines
42 KiB
JavaScript

(window.webpackJsonp = window.webpackJsonp || []).push([
[1],
{
'4ivF': function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }), (y.default = void 0);
var v = _(h('f7k8')),
P = _(h('Q5Xz'));
function _(O) {
return O && O.__esModule ? O : { default: O };
}
v.default.Panel = P.default;
var S = v.default;
y.default = S;
},
'5y7D': function(X, y, h) {},
'9m3q': function(X, y, h) {},
'9m51': function(X, y, h) {
'use strict';
h('1Ywk'), h('9m3q');
},
K1Qd: function(X, y, h) {
'use strict';
h('1Ywk'), h('9m51'), h('5y7D');
},
Q5Xz: function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }), (y.default = void 0);
var v = O(h('q1tI')),
P = _(h('TSYQ'));
function _(f) {
return f && f.__esModule ? f : { default: f };
}
function S() {
if (typeof WeakMap != 'function') return null;
var f = new WeakMap();
return (
(S = function() {
return f;
}),
f
);
}
function O(f) {
if (f && f.__esModule) return f;
if (f === null || (I(f) !== 'object' && typeof f != 'function')) return { default: f };
var p = S();
if (p && p.has(f)) return p.get(f);
var l = {},
t = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var i in f)
if (Object.prototype.hasOwnProperty.call(f, i)) {
var e = t ? Object.getOwnPropertyDescriptor(f, i) : null;
e && (e.get || e.set) ? Object.defineProperty(l, i, e) : (l[i] = f[i]);
}
return (l.default = f), p && p.set(f, l), l;
}
function I(f) {
return (
typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
? (I = function(l) {
return typeof l;
})
: (I = function(l) {
return l &&
typeof Symbol == 'function' &&
l.constructor === Symbol &&
l !== Symbol.prototype
? 'symbol'
: typeof l;
}),
I(f)
);
}
function D(f, p, l) {
return (
p in f
? Object.defineProperty(f, p, {
value: l,
enumerable: !0,
configurable: !0,
writable: !0,
})
: (f[p] = l),
f
);
}
function T(f, p) {
if (!(f instanceof p)) throw new TypeError('Cannot call a class as a function');
}
function z(f, p) {
for (var l = 0; l < p.length; l++) {
var t = p[l];
(t.enumerable = t.enumerable || !1),
(t.configurable = !0),
'value' in t && (t.writable = !0),
Object.defineProperty(f, t.key, t);
}
}
function x(f, p, l) {
return p && z(f.prototype, p), l && z(f, l), f;
}
function R(f, p) {
return p && (I(p) === 'object' || typeof p == 'function') ? p : N(f);
}
function N(f) {
if (f === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return f;
}
function U(f) {
return (
(U = Object.setPrototypeOf
? Object.getPrototypeOf
: function(l) {
return l.__proto__ || Object.getPrototypeOf(l);
}),
U(f)
);
}
function W(f, p) {
if (typeof p != 'function' && p !== null)
throw new TypeError('Super expression must either be null or a function');
(f.prototype = Object.create(p && p.prototype, {
constructor: { value: f, writable: !0, configurable: !0 },
})),
p && E(f, p);
}
function E(f, p) {
return (
(E =
Object.setPrototypeOf ||
function(t, i) {
return (t.__proto__ = i), t;
}),
E(f, p)
);
}
var C = (function(f) {
W(p, f);
function p(l) {
var t;
return (
T(this, p), (t = R(this, U(p).call(this, l))), (t.state = { selected: l.selected }), t
);
}
return (
x(
p,
[
{
key: 'render',
value: function() {
var t = this.props,
i = t.prefixCls,
e = t.className,
n = t.children,
s = this.state.selected,
a = (0, P.default)(
''.concat(i, '__panel'),
e,
D({}, ''.concat(i, '__panel--active'), s),
);
return v.default.createElement('div', { className: a, role: 'tabpanel' }, n);
},
},
],
[
{
key: 'getDerivedStateFromProps',
value: function(t) {
return 'selected' in t ? { selected: t.selected } : null;
},
},
],
),
p
);
})(v.PureComponent);
(y.default = C), (C.defaultProps = { prefixCls: 'za-tabs' });
},
UAaW: function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }),
(y.getTransformPropValue = v),
(y.getPxStyle = P);
function v(_) {
return { transform: _, WebkitTransform: _, MozTransform: _ };
}
function P(_) {
var S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'px',
O = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
return (
(_ = O ? '0px, '.concat(_).concat(S, ', 0px') : ''.concat(_).concat(S, ', 0px, 0px')),
'translate3d('.concat(_, ')')
);
}
},
Yec7: function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }), (y.default = void 0);
var v = D(h('q1tI')),
P = O(h('TSYQ')),
_ = O(h('l/UJ')),
S = O(h('sFww'));
function O(l) {
return l && l.__esModule ? l : { default: l };
}
function I() {
if (typeof WeakMap != 'function') return null;
var l = new WeakMap();
return (
(I = function() {
return l;
}),
l
);
}
function D(l) {
if (l && l.__esModule) return l;
if (l === null || (T(l) !== 'object' && typeof l != 'function')) return { default: l };
var t = I();
if (t && t.has(l)) return t.get(l);
var i = {},
e = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var n in l)
if (Object.prototype.hasOwnProperty.call(l, n)) {
var s = e ? Object.getOwnPropertyDescriptor(l, n) : null;
s && (s.get || s.set) ? Object.defineProperty(i, n, s) : (i[n] = l[n]);
}
return (i.default = l), t && t.set(l, i), i;
}
function T(l) {
return (
typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
? (T = function(i) {
return typeof i;
})
: (T = function(i) {
return i &&
typeof Symbol == 'function' &&
i.constructor === Symbol &&
i !== Symbol.prototype
? 'symbol'
: typeof i;
}),
T(l)
);
}
function z(l, t, i) {
return (
t in l
? Object.defineProperty(l, t, {
value: i,
enumerable: !0,
configurable: !0,
writable: !0,
})
: (l[t] = i),
l
);
}
function x(l, t) {
if (!(l instanceof t)) throw new TypeError('Cannot call a class as a function');
}
function R(l, t) {
for (var i = 0; i < t.length; i++) {
var e = t[i];
(e.enumerable = e.enumerable || !1),
(e.configurable = !0),
'value' in e && (e.writable = !0),
Object.defineProperty(l, e.key, e);
}
}
function N(l, t, i) {
return t && R(l.prototype, t), i && R(l, i), l;
}
function U(l, t) {
return t && (T(t) === 'object' || typeof t == 'function') ? t : W(l);
}
function W(l) {
if (l === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return l;
}
function E(l) {
return (
(E = Object.setPrototypeOf
? Object.getPrototypeOf
: function(i) {
return i.__proto__ || Object.getPrototypeOf(i);
}),
E(l)
);
}
function C(l, t) {
if (typeof t != 'function' && t !== null)
throw new TypeError('Super expression must either be null or a function');
(l.prototype = Object.create(t && t.prototype, {
constructor: { value: l, writable: !0, configurable: !0 },
})),
t && f(l, t);
}
function f(l, t) {
return (
(f =
Object.setPrototypeOf ||
function(e, n) {
return (e.__proto__ = n), e;
}),
f(l, t)
);
}
var p = (function(l) {
C(t, l);
function t(i) {
var e;
return (
x(this, t),
(e = U(this, E(t).call(this, i))),
(e.carouselItems = void 0),
(e.moveInterval = void 0),
(e.translateX = 0),
(e.translateY = 0),
(e.onSlideTo = function(n) {
e.onMoveTo(n, e.props.animationDuration);
}),
(e.onJumpTo = function(n) {
e.onMoveTo(n, 0);
}),
(e.onMoveTo = function(n, s) {
var a = e.carouselItems,
u = e.props,
o = u.loop,
r = u.children,
c = u.onChange,
d = r.length,
m = e.state.activeIndex;
(e.translateX = -a.offsetWidth * (n + o)),
(e.translateY = -a.offsetHeight * (n + o)),
e.doTransition({ x: e.translateX, y: e.translateY }, s),
n > d - 1 ? (n = 0) : n < 0 && (n = d - 1);
var g = m !== n;
e.setState({ activeIndex: n, activeIndexChanged: g }),
typeof c == 'function' && g && c(n);
}),
(e.onDragStart = function() {
var n = e.props,
s = n.swipeable,
a = n.children;
if (!s) return !1;
var u = e.state.activeIndex,
o = a.length;
u <= 0 ? e.onJumpTo(0) : u >= o - 1 && e.onJumpTo(o - 1), e.pauseAutoPlay();
}),
(e.onDragMove = function(n, s) {
var a = s.offsetX,
u = s.offsetY,
o = e.props.swipeable;
if (!o) return !1;
var r = Math.abs(a),
c = Math.abs(u);
if (e.isDirectionX() && (r < 5 || (r >= 5 && c >= 1.73 * r))) return !1;
if (!e.isDirectionX() && (c < 5 || (c >= 5 && r >= 1.73 * c))) return !1;
if (!e.props.loop) {
if (
e.isLastIndex() &&
((e.isDirectionX() && a < 0) || (!e.isDirectionX() && u < 0))
)
return !1;
if (
e.isFirstIndex() &&
((e.isDirectionX() && a > 0) || (!e.isDirectionX() && u > 0))
)
return !1;
}
return (
n.preventDefault(),
e.doTransition({ x: e.translateX + a, y: e.translateY + u }, 0),
!0
);
}),
(e.onDragEnd = function(n, s) {
var a = s.offsetX,
u = s.offsetY,
o = s.startTime,
r = e.props.swipeable;
if (!r) return !1;
if (!a && !u) return;
var c = e.props,
d = c.moveDistanceRatio,
m = c.moveTimeSpan,
g = e.state.activeIndex,
b = e.carouselItems,
w = new Date().getTime() - o.getTime(),
Y = e.isDirectionX() ? Math.abs(a / b.offsetWidth) : Math.abs(u / b.offsetHeight);
if (Y >= d || w <= m) {
var M =
(e.isDirectionX() && a > 0) || (!e.isDirectionX() && u > 0) ? 'prev' : 'next';
g = M === 'next' ? g + 1 : g - 1;
}
e.onSlideTo(g), e.startAutoPlay();
}),
(e.startAutoPlay = function() {
var n = e.props,
s = n.direction,
a = n.loop,
u = n.autoPlay,
o = n.autoPlayIntervalTime;
e.moveInterval =
u &&
setInterval(function() {
var r = e.state.activeIndex,
c = ['left', 'up'].indexOf(s) > -1;
if (((r = c ? r + 1 : r - 1), !a && (c ? e.isLastIndex() : e.isFirstIndex()))) {
e.pauseAutoPlay();
return;
}
e.onSlideTo(r);
}, o);
}),
(e.pauseAutoPlay = function() {
e.moveInterval && clearInterval(e.moveInterval);
}),
(e.parseItems = function(n) {
if (n.children.length === 0) return;
var s = [].concat(n.children),
a = s[0],
u = s[s.length - 1];
n.loop && (s.push(a), s.unshift(u));
var o = v.default.Children.map(s, function(r, c) {
return (0,
v.cloneElement)(r, { key: c, className: (0, P.default)(''.concat(n.prefixCls, '__item'), r.props.className) });
});
return o;
}),
(e.resize = function() {
e.onJumpTo(e.state.activeIndex);
}),
(e.doTransition = function(n, s) {
var a = e.carouselItems,
u = 0,
o = 0;
e.isDirectionX() ? (u = n.x) : (o = n.y),
(a.style.WebkitTransformDuration = ''.concat(s, 'ms')),
(a.style.transitionDuration = ''.concat(s, 'ms')),
(a.style.WebkitTransform = 'translate3d('.concat(u, 'px, ').concat(o, 'px, 0)')),
(a.style.transform = 'translate3d('.concat(u, 'px, ').concat(o, 'px, 0)'));
}),
(e.transitionEnd = function() {
var n = e.props.onChangeEnd,
s = e.state,
a = s.activeIndex,
u = s.activeIndexChanged,
o = e.carouselItems;
(e.translateX = -o.offsetWidth * (a + e.props.loop)),
(e.translateY = -o.offsetHeight * (a + e.props.loop)),
e.doTransition({ x: e.translateX, y: e.translateY }, 0),
typeof n == 'function' && u && n(a);
}),
(e.isLastIndex = function() {
return e.state.activeIndex >= e.props.children.length - 1;
}),
(e.isFirstIndex = function() {
return e.state.activeIndex <= 0;
}),
(e.isDirectionX = function() {
return ['left', 'right'].indexOf(e.props.direction) > -1;
}),
(e.renderPaginationItem = function(n, s) {
var a = e.props.prefixCls,
u = (0, P.default)(
''.concat(a, '__pagination__item'),
z({}, ''.concat(a, '__pagination__item--active'), s === e.state.activeIndex),
);
return v.default.createElement('div', {
key: 'pagination-'.concat(s),
className: u,
onClick: function() {
return e.onSlideTo(s);
},
});
}),
(e.renderPagination = function() {
var n = e.props,
s = n.prefixCls,
a = n.showPagination,
u = n.children;
return (
a &&
v.default.createElement(
'div',
{ className: ''.concat(s, '__pagination') },
v.Children.map(u, e.renderPaginationItem),
)
);
}),
(e.state = { activeIndex: i.activeIndex, activeIndexChanged: !1 }),
e
);
}
return (
N(t, [
{
key: 'componentDidMount',
value: function() {
var e = this.props.activeIndex;
_.default.on(window, 'resize', this.resize), this.startAutoPlay(), this.onJumpTo(e);
},
},
{
key: 'componentDidUpdate',
value: function(e) {
var n = this.props.activeIndex;
n !== e.activeIndex && this.onSlideTo(n);
},
},
{
key: 'componentWillUnmount',
value: function() {
this.pauseAutoPlay(),
_.default.off(window, 'resize', this.resize),
_.default.off(this.carouselItems, 'webkitTransitionEnd', this.transitionEnd),
_.default.off(this.carouselItems, 'transitionend', this.transitionEnd);
},
},
{
key: 'render',
value: function() {
var e = this,
n = this.props,
s = n.prefixCls,
a = n.className,
u = n.height,
o = n.style,
r = this.parseItems(this.props),
c = {},
d = this.isDirectionX() ? 'horizontal' : 'vertical',
m = (0, P.default)(s, a, ''.concat(s, '--').concat(d));
this.isDirectionX() || (c.height = u);
var g = v.default.createElement(
'div',
{
ref: function(w) {
e.carouselItems = w;
},
className: ''.concat(s, '__items'),
onTransitionEnd: this.transitionEnd,
style: c,
},
r,
);
return v.default.createElement(
'div',
{ className: m, style: o },
v.default.createElement(
S.default,
{
onDragStart: this.onDragStart,
onDragMove: this.onDragMove,
onDragEnd: this.onDragEnd,
},
g,
),
this.renderPagination(),
);
},
},
]),
t
);
})(v.Component);
(y.default = p),
(p.defaultProps = {
prefixCls: 'za-carousel',
direction: 'left',
height: 160,
loop: !1,
activeIndex: 0,
animationDuration: 300,
swipeable: !0,
autoPlay: !1,
autoPlayIntervalTime: 3e3,
moveDistanceRatio: 0.5,
moveTimeSpan: 300,
showPagination: !0,
});
},
f7k8: function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }), (y.default = void 0);
var v = z(h('q1tI')),
P = D(h('TSYQ')),
_ = D(h('Q5Xz')),
S = D(h('Yec7')),
O = h('UAaW'),
I = h('7OGK');
function D(a) {
return a && a.__esModule ? a : { default: a };
}
function T() {
if (typeof WeakMap != 'function') return null;
var a = new WeakMap();
return (
(T = function() {
return a;
}),
a
);
}
function z(a) {
if (a && a.__esModule) return a;
if (a === null || (x(a) !== 'object' && typeof a != 'function')) return { default: a };
var u = T();
if (u && u.has(a)) return u.get(a);
var o = {},
r = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var c in a)
if (Object.prototype.hasOwnProperty.call(a, c)) {
var d = r ? Object.getOwnPropertyDescriptor(a, c) : null;
d && (d.get || d.set) ? Object.defineProperty(o, c, d) : (o[c] = a[c]);
}
return (o.default = a), u && u.set(a, o), o;
}
function x(a) {
return (
typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
? (x = function(o) {
return typeof o;
})
: (x = function(o) {
return o &&
typeof Symbol == 'function' &&
o.constructor === Symbol &&
o !== Symbol.prototype
? 'symbol'
: typeof o;
}),
x(a)
);
}
function R() {
return (
(R =
Object.assign ||
function(a) {
for (var u = 1; u < arguments.length; u++) {
var o = arguments[u];
for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (a[r] = o[r]);
}
return a;
}),
R.apply(this, arguments)
);
}
function N(a, u) {
var o = Object.keys(a);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(a);
u &&
(r = r.filter(function(c) {
return Object.getOwnPropertyDescriptor(a, c).enumerable;
})),
o.push.apply(o, r);
}
return o;
}
function U(a) {
for (var u = 1; u < arguments.length; u++) {
var o = arguments[u] != null ? arguments[u] : {};
u % 2
? N(Object(o), !0).forEach(function(r) {
W(a, r, o[r]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(a, Object.getOwnPropertyDescriptors(o))
: N(Object(o)).forEach(function(r) {
Object.defineProperty(a, r, Object.getOwnPropertyDescriptor(o, r));
});
}
return a;
}
function W(a, u, o) {
return (
u in a
? Object.defineProperty(a, u, {
value: o,
enumerable: !0,
configurable: !0,
writable: !0,
})
: (a[u] = o),
a
);
}
function E(a, u) {
if (!(a instanceof u)) throw new TypeError('Cannot call a class as a function');
}
function C(a, u) {
for (var o = 0; o < u.length; o++) {
var r = u[o];
(r.enumerable = r.enumerable || !1),
(r.configurable = !0),
'value' in r && (r.writable = !0),
Object.defineProperty(a, r.key, r);
}
}
function f(a, u, o) {
return u && C(a.prototype, u), o && C(a, o), a;
}
function p(a, u) {
return u && (x(u) === 'object' || typeof u == 'function') ? u : l(a);
}
function l(a) {
if (a === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return a;
}
function t(a) {
return (
(t = Object.setPrototypeOf
? Object.getPrototypeOf
: function(o) {
return o.__proto__ || Object.getPrototypeOf(o);
}),
t(a)
);
}
function i(a, u) {
if (typeof u != 'function' && u !== null)
throw new TypeError('Super expression must either be null or a function');
(a.prototype = Object.create(u && u.prototype, {
constructor: { value: a, writable: !0, configurable: !0 },
})),
u && e(a, u);
}
function e(a, u) {
return (
(e =
Object.setPrototypeOf ||
function(r, c) {
return (r.__proto__ = c), r;
}),
e(a, u)
);
}
var n = function(u) {
var o;
return (
v.default.Children.forEach(u, function(r, c) {
r.props && r.props.selected && (o = c);
}),
o
);
},
s = (function(a) {
i(u, a);
function u(o) {
var r;
return (
E(this, u),
(r = p(this, t(u).call(this, o))),
(r.carousel = void 0),
(r.layout = void 0),
(r.setTablistRef = function(c) {
r.layout = c;
}),
(r.setCarouselRef = function(c) {
r.carousel = c;
}),
(r.onTabChange = function(c) {
var d = r.props.onChange;
'value' in r.props || r.setState({ value: c }), typeof d == 'function' && d(c);
}),
(r.onTabClick = function(c, d) {
var m = r.props,
g = m.disabled,
b = m.swipeable;
if (g || c.props.disabled) return;
if (b) {
r.carousel && r.carousel.onSlideTo(d);
return;
}
r.onTabChange(d);
}),
(r.renderTabs = function(c, d) {
var m,
g = r.props,
b = g.prefixCls,
w = g.disabled,
Y = r.state.value,
M = (0, P.default)(
''.concat(b, '__tab'),
c.props.className,
((m = {}),
W(m, ''.concat(b, '__tab--disabled'), w || c.props.disabled),
W(m, ''.concat(b, '__tab--active'), Y === d),
m),
);
return v.default.createElement(
'li',
{
role: 'tab',
key: +d,
className: M,
onClick: function() {
return r.onTabClick(c, d);
},
},
c.props.title,
);
}),
(r.caclLineSizePos = function() {
var c = r.state,
d = c.value,
m = c.itemWidth,
g = r.props,
b = g.children,
w = g.scrollable,
Y = v.default.Children.count(b),
M = 100 * d;
if (w && r.layout) {
var k = r.layout.children[d],
A = k,
J = A.offsetLeft,
Q = J === void 0 ? 0 : J,
q = A.offsetTop,
$ = q === void 0 ? 0 : q;
M = r.isVertical ? $ : Q;
}
var F = w ? ''.concat(m, 'px') : ''.concat(100 / Y, '%'),
L = w
? (0, O.getPxStyle)(M, 'px', r.isVertical)
: (0, O.getPxStyle)(M, '%', r.isVertical),
V = (0, O.getTransformPropValue)(L),
K = r.isVertical ? { height: ''.concat(F) } : { width: ''.concat(F) };
return U({}, V, {}, K);
}),
(r.calculateScorllLeftLocation = function() {
var c = r.props.scrollable;
if (!c) return !1;
var d = r.state.value,
m = r.layout.childNodes[d - 1];
if (c && r.layout && m) {
var g = m,
b = g.offsetTop,
w = b === void 0 ? 0 : b,
Y = g.offsetLeft,
M = Y === void 0 ? 0 : Y;
(0, I.scrollTo)(r.layout, w, M, 0.3);
}
}),
(r.calculateLineWidth = function() {
var c = r.props.scrollable;
if (!c) return;
var d = r.state.value,
m = r.layout.children[d],
g = r.isVertical
? r.getComputedStyle(m, 'height')
: r.getComputedStyle(m, 'width');
r.setState({ itemWidth: parseInt(g, 10) });
}),
(r.getComputedStyle = function(c, d) {
var m = '0';
return (
d in c.style &&
(m = c.style[d] || getComputedStyle(c).getPropertyValue(d) || '0'),
m
);
}),
(r.state = { value: o.value || o.defaultValue || n(o.children) || 0, itemWidth: 0 }),
r
);
}
return (
f(
u,
[
{
key: 'componentDidMount',
value: function() {
this.calculateLineWidth();
},
},
{
key: 'componentDidUpdate',
value: function(r) {
var c = r.value,
d = this.state.value;
c !== d && this.calculateLineWidth(), this.calculateScorllLeftLocation();
},
},
{
key: 'render',
value: function() {
var r = this,
c = this.props,
d = c.prefixCls,
m = c.className,
g = c.lineWidth,
b = c.swipeable,
w = c.children,
Y = c.disabled,
M = c.scrollable,
k = c.direction,
A = this.state.value,
J = (0, P.default)(
d,
m,
''.concat(d, '--').concat(k),
W({}, ''.concat(d, '--scroll'), M),
),
Q = v.default.Children.map(w, this.renderTabs),
q;
b
? (q = v.default.createElement(
S.default,
{
swipeable: !Y,
direction: k === 'vertical' ? 'up' : 'left',
showPagination: !1,
activeIndex: A,
ref: this.setCarouselRef,
onChange: function(V) {
r.onTabChange(V);
},
},
v.default.Children.map(w, function(L, V) {
return v.default.createElement('div', { key: +V }, L.props.children);
}),
))
: (q = v.default.Children.map(w, function(L, V) {
return (
L.props.children &&
v.default.createElement(
_.default,
R({}, L.props, { selected: A === V }),
)
);
}));
var $ = this.caclLineSizePos(),
F;
return (
g &&
(($.backgroundColor = 'transparent'),
(F = v.default.createElement('span', {
className: ''.concat(d, '__line__inner'),
style: { width: g },
}))),
v.default.createElement(
'div',
{ className: J },
v.default.createElement(
'div',
{ className: ''.concat(d, '__header') },
v.default.createElement(
'ul',
{
className: ''.concat(d, '__tablist'),
role: 'tablist',
ref: this.setTablistRef,
},
Q,
v.default.createElement(
'div',
{ className: ''.concat(d, '__line'), style: $ },
F,
),
),
),
v.default.createElement('div', { className: ''.concat(d, '__body') }, q),
)
);
},
},
{
key: 'isVertical',
get: function() {
var r = this.props.direction;
return r === 'vertical';
},
},
],
[
{
key: 'getDerivedStateFromProps',
value: function(r, c) {
return 'value' in r && r.value !== c.prevValue
? { value: r.value, prevValue: r.value }
: null;
},
},
],
),
u
);
})(v.PureComponent);
(y.default = s),
(s.Panel = void 0),
(s.defaultProps = {
prefixCls: 'za-tabs',
disabled: !1,
swipeable: !1,
scrollable: !1,
direction: 'horizontal',
});
},
mZhq: function(X, y, h) {
'use strict';
},
sFww: function(X, y, h) {
'use strict';
Object.defineProperty(y, '__esModule', { value: !0 }),
Object.defineProperty(y, 'DragProps', {
enumerable: !0,
get: function() {
return _.default;
},
}),
Object.defineProperty(y, 'DragEvent', {
enumerable: !0,
get: function() {
return _.DragEvent;
},
}),
Object.defineProperty(y, 'DragState', {
enumerable: !0,
get: function() {
return _.DragState;
},
}),
(y.default = void 0);
var v = h('q1tI'),
P = I(h('l/UJ')),
_ = O(h('mZhq'));
function S() {
if (typeof WeakMap != 'function') return null;
var t = new WeakMap();
return (
(S = function() {
return t;
}),
t
);
}
function O(t) {
if (t && t.__esModule) return t;
if (t === null || (D(t) !== 'object' && typeof t != 'function')) return { default: t };
var i = S();
if (i && i.has(t)) return i.get(t);
var e = {},
n = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var s in t)
if (Object.prototype.hasOwnProperty.call(t, s)) {
var a = n ? Object.getOwnPropertyDescriptor(t, s) : null;
a && (a.get || a.set) ? Object.defineProperty(e, s, a) : (e[s] = t[s]);
}
return (e.default = t), i && i.set(t, e), e;
}
function I(t) {
return t && t.__esModule ? t : { default: t };
}
function D(t) {
return (
typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
? (D = function(e) {
return typeof e;
})
: (D = function(e) {
return e &&
typeof Symbol == 'function' &&
e.constructor === Symbol &&
e !== Symbol.prototype
? 'symbol'
: typeof e;
}),
D(t)
);
}
function T(t, i) {
var e = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(t);
i &&
(n = n.filter(function(s) {
return Object.getOwnPropertyDescriptor(t, s).enumerable;
})),
e.push.apply(e, n);
}
return e;
}
function z(t) {
for (var i = 1; i < arguments.length; i++) {
var e = arguments[i] != null ? arguments[i] : {};
i % 2
? T(Object(e), !0).forEach(function(n) {
x(t, n, e[n]);
})
: Object.getOwnPropertyDescriptors
? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e))
: T(Object(e)).forEach(function(n) {
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n));
});
}
return t;
}
function x(t, i, e) {
return (
i in t
? Object.defineProperty(t, i, {
value: e,
enumerable: !0,
configurable: !0,
writable: !0,
})
: (t[i] = e),
t
);
}
function R(t, i) {
if (!(t instanceof i)) throw new TypeError('Cannot call a class as a function');
}
function N(t, i) {
for (var e = 0; e < i.length; e++) {
var n = i[e];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
function U(t, i, e) {
return i && N(t.prototype, i), e && N(t, e), t;
}
function W(t, i) {
return i && (D(i) === 'object' || typeof i == 'function') ? i : E(t);
}
function E(t) {
if (t === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function C(t) {
return (
(C = Object.setPrototypeOf
? Object.getPrototypeOf
: function(e) {
return e.__proto__ || Object.getPrototypeOf(e);
}),
C(t)
);
}
function f(t, i) {
if (typeof i != 'function' && i !== null)
throw new TypeError('Super expression must either be null or a function');
(t.prototype = Object.create(i && i.prototype, {
constructor: { value: t, writable: !0, configurable: !0 },
})),
i && p(t, i);
}
function p(t, i) {
return (
(p =
Object.setPrototypeOf ||
function(n, s) {
return (n.__proto__ = s), n;
}),
p(t, i)
);
}
var l = (function(t) {
f(i, t);
function i() {
var e, n;
R(this, i);
for (var s = arguments.length, a = new Array(s), u = 0; u < s; u++) a[u] = arguments[u];
return (
(n = W(this, (e = C(i)).call.apply(e, [this].concat(a)))),
(n.currentX = void 0),
(n.currentY = void 0),
(n.dragState = Object.create(null)),
(n.onTouchStart = function(o) {
if (((n.dragState.startTime = new Date()), !o.touches))
(n.dragState.startX = o.clientX),
(n.dragState.startY = o.clientY),
P.default.on(document.body, 'mousemove', n.onTouchMove),
P.default.on(document.body, 'mouseup', n.onTouchEnd);
else {
var r = o.touches[0];
(n.dragState.startX = r.pageX), (n.dragState.startY = r.pageY);
}
var c = z({}, n.dragState),
d = n.props.onDragStart;
typeof d == 'function' && d(o, c);
}),
(n.onTouchMove = function(o) {
if (!n.isDragStart) return !1;
if (!o.touches) (n.currentX = o.clientX), (n.currentY = o.clientY);
else {
var r = o.touches[0];
(n.currentX = r.pageX), (n.currentY = r.pageY);
}
var c = n.currentX - n.dragState.startX,
d = n.currentY - n.dragState.startY,
m = z({}, n.dragState, { offsetX: c, offsetY: d }),
g = n.props.onDragMove;
if (typeof g == 'function' && !g(o, m)) return;
n.dragState = m;
}),
(n.onTouchEnd = function(o) {
if (!n.isDragStart) return !1;
o &&
!o.touches &&
(P.default.off(document.body, 'mousemove', n.onTouchMove),
P.default.off(document.body, 'mouseup', n.onTouchEnd));
var r = n.props.onDragEnd;
typeof r == 'function' && r(o, n.dragState), (n.dragState = Object.create(null));
}),
n
);
}
return (
U(i, [
{
key: 'render',
value: function() {
var n = this.props.children;
return (0, v.cloneElement)(n, {
onTouchStart: this.onTouchStart,
onTouchMove: this.onTouchMove,
onTouchEnd: this.onTouchEnd,
onMouseDown: this.onTouchStart,
onMouseMove: this.onTouchMove,
onMouseUp: this.onTouchEnd,
});
},
},
{
key: 'isDragStart',
get: function() {
return this.dragState.startX !== void 0 && this.dragState.startY !== void 0;
},
},
]),
i
);
})(v.PureComponent);
y.default = l;
},
},
]);
//# sourceMappingURL=1.js.map