1302 lines
65 KiB
JavaScript
1302 lines
65 KiB
JavaScript
"use strict";
|
|
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/activityList/index"],{
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/cell/index.js":
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/cell/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export Cell */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _common_jumpLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/jumpLink */ "./node_modules/@antmjs/vantui/es/common/jumpLink.js");
|
|
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icon */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/cell/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
|
|
|
|
|
|
var _excluded = ["url", "linkType", "size", "center", "required", "border", "isLink", "clickable", "icon", "titleWidth", "titleStyle", "title", "label", "value", "arrowDirection", "onClick", "renderIcon", "renderTitle", "renderLabel", "renderRightIcon", "renderExtra", "children", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Cell(props) {
|
|
var url = props.url,
|
|
linkType = props.linkType,
|
|
size = props.size,
|
|
center = props.center,
|
|
required = props.required,
|
|
_props$border = props.border,
|
|
border = _props$border === void 0 ? true : _props$border,
|
|
isLink = props.isLink,
|
|
clickable = props.clickable,
|
|
icon = props.icon,
|
|
titleWidth = props.titleWidth,
|
|
titleStyle = props.titleStyle,
|
|
title = props.title,
|
|
label = props.label,
|
|
value = props.value,
|
|
arrowDirection = props.arrowDirection,
|
|
onClick = props.onClick,
|
|
renderIcon = props.renderIcon,
|
|
renderTitle = props.renderTitle,
|
|
renderLabel = props.renderLabel,
|
|
renderRightIcon = props.renderRightIcon,
|
|
renderExtra = props.renderExtra,
|
|
children = props.children,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__["default"])(props, _excluded);
|
|
|
|
var _click = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (event) {
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
if (url) (0,_common_jumpLink__WEBPACK_IMPORTED_MODULE_3__.jumpLink)(url, linkType);
|
|
}, [linkType, onClick, url]);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, _objectSpread(_objectSpread({
|
|
className: ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('cell', [size, {
|
|
center: center,
|
|
required: required,
|
|
borderless: !border,
|
|
clickable: isLink || clickable
|
|
}]) + " ".concat(className || ''),
|
|
hoverClass: "van-cell--hover hover-class",
|
|
hoverStayTime: 70,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([style]),
|
|
onClick: _click
|
|
}, others), {}, {
|
|
children: [icon ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
|
|
name: icon,
|
|
className: "van-cell__left-icon-wrap van-cell__left-icon"
|
|
}) : renderIcon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
style: _wxs__WEBPACK_IMPORTED_MODULE_5__.titleStyle({
|
|
titleWidth: titleWidth,
|
|
titleStyle: titleStyle
|
|
}),
|
|
className: "van-cell__title title-class",
|
|
children: [title || title === 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
|
children: title
|
|
}) : renderTitle, (label || renderLabel) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-cell__label label-class",
|
|
children: renderLabel || label && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
|
children: label
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
className: "van-cell__value value-class",
|
|
children: value || value === 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
|
children: value
|
|
}) : children
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: isLink ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon__WEBPACK_IMPORTED_MODULE_4__.Icon, {
|
|
name: arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow',
|
|
className: "van-cell__right-icon-wrap right-icon-class van-cell__right-icon"
|
|
}) : renderRightIcon
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_8__.View, {
|
|
children: renderExtra
|
|
})]
|
|
}));
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Cell);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/cell/wxs.js":
|
|
/*!****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/cell/wxs.js ***!
|
|
\****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "titleStyle": function() { return /* binding */ titleStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/style */ "./node_modules/@antmjs/vantui/es/wxs/style.js");
|
|
/* harmony import */ var _wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/add-unit */ "./node_modules/@antmjs/vantui/es/wxs/add-unit.js");
|
|
|
|
|
|
|
|
function titleStyle(data) {
|
|
return (0,_wxs_style__WEBPACK_IMPORTED_MODULE_1__.style)([{
|
|
'max-width': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.titleWidth),
|
|
'min-width': (0,_wxs_add_unit__WEBPACK_IMPORTED_MODULE_0__.addUnit)(data.titleWidth)
|
|
}, data.titleStyle]);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/dropdown-item/index.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/dropdown-item/index.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export DropdownItem */
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
|
|
/* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _icon_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon/index */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _cell__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cell */ "./node_modules/@antmjs/vantui/es/cell/index.js");
|
|
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../popup */ "./node_modules/@antmjs/vantui/es/popup/index.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
|
|
|
|
|
|
var _excluded = ["title", "titleClass", "value", "popupStyle", "disabled", "setChildrenInstance", "parentInstance", "index", "onOpen", "onOpened", "onClose", "onClosed", "onChange", "options", "className", "style"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Index(props, ref) {
|
|
var title = props.title,
|
|
titleClass = props.titleClass,
|
|
value = props.value,
|
|
popupStyle = props.popupStyle,
|
|
_props$disabled = props.disabled,
|
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
setChildrenInstance = props.setChildrenInstance,
|
|
parentInstance = props.parentInstance,
|
|
index = props.index,
|
|
onOpen = props.onOpen,
|
|
onOpened = props.onOpened,
|
|
onClose = props.onClose,
|
|
onClosed = props.onClosed,
|
|
_props$onChange = props.onChange,
|
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
_props$options = props.options,
|
|
options = _props$options === void 0 ? [] : _props$options,
|
|
_props$className = props.className,
|
|
className = _props$className === void 0 ? '' : _props$className,
|
|
style = props.style,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_7__["default"])(props, _excluded);
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState, 2),
|
|
wrapperStyle = _useState2[0],
|
|
setWrapperStyle = _useState2[1];
|
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
|
|
_useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState3, 2),
|
|
transition = _useState4[0],
|
|
setTransition = _useState4[1];
|
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
_useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState5, 2),
|
|
showPopup = _useState6[0],
|
|
setShowPopup = _useState6[1];
|
|
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
|
|
_useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState7, 2),
|
|
showWrapper = _useState8[0],
|
|
setShowWrapper = _useState8[1];
|
|
|
|
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
|
_useState10 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState9, 2),
|
|
displayTitle = _useState10[0],
|
|
setDisplayTitle = _useState10[1];
|
|
|
|
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
|
_useState12 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__["default"])(_useState11, 2),
|
|
value_ = _useState12[0],
|
|
setValue = _useState12[1];
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
setValue(value);
|
|
}, [value]);
|
|
var rerender = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
(0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.nextTick)(function () {
|
|
if (parentInstance) {
|
|
parentInstance.updateItemListData();
|
|
}
|
|
});
|
|
}, [parentInstance]);
|
|
var toggle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (show) {
|
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
|
|
if (typeof show !== 'boolean') {
|
|
show = !showPopup;
|
|
}
|
|
|
|
if (show === showPopup) {
|
|
return;
|
|
}
|
|
|
|
setTransition(!options.immediate);
|
|
setShowPopup(show);
|
|
|
|
if (show) {
|
|
!parentInstance ? void 0 : parentInstance.getChildWrapperStyle().then(function (wrapperStyle) {
|
|
var rect = wrapperStyle.rect;
|
|
delete wrapperStyle.rect;
|
|
|
|
if (wrapperStyle) {
|
|
wrapperStyle.width = '100vw';
|
|
wrapperStyle.position = 'absolute';
|
|
}
|
|
|
|
if (parentInstance.direction === 'down') {
|
|
wrapperStyle.top = rect.height + 'PX';
|
|
wrapperStyle.height = '100vh';
|
|
setWrapperStyle(wrapperStyle);
|
|
setShowWrapper(true);
|
|
rerender();
|
|
}
|
|
|
|
if (parentInstance.direction === 'up') {
|
|
wrapperStyle.height = '100vh';
|
|
wrapperStyle.top = 0;
|
|
wrapperStyle.transform = 'translateY(-100%)';
|
|
wrapperStyle.WebkitTransform = 'translateY(-100%)';
|
|
wrapperStyle.MozTransform = 'translateY(-100%)';
|
|
wrapperStyle.OTransform = 'translateY(-100%)';
|
|
setWrapperStyle(wrapperStyle);
|
|
setShowWrapper(true);
|
|
rerender();
|
|
}
|
|
});
|
|
} else {
|
|
rerender();
|
|
}
|
|
}, [showPopup, parentInstance, rerender]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
setChildrenInstance(index, {
|
|
title: title,
|
|
titleClass: titleClass,
|
|
disabled: disabled,
|
|
transition: transition,
|
|
showPopup: showPopup,
|
|
index: index,
|
|
setDisplayTitle: setDisplayTitle,
|
|
displayTitle: displayTitle,
|
|
options: options,
|
|
value: value_,
|
|
toggle: toggle
|
|
});
|
|
}, [title, titleClass, index, setChildrenInstance, disabled, transition, showPopup, setDisplayTitle, displayTitle, options, value_, toggle]);
|
|
var onClosed_ = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
if (onClosed) onClosed();
|
|
setTimeout(function () {
|
|
setShowWrapper(false);
|
|
}, 10);
|
|
}, [onClosed]);
|
|
|
|
var onOptionTap = function onOptionTap(_event, option) {
|
|
var shouldEmitChange = value_ !== option.value;
|
|
setShowPopup(false);
|
|
setValue(option.value);
|
|
if (onClose) onClose();
|
|
rerender();
|
|
|
|
if (shouldEmitChange) {
|
|
onChange(option.value);
|
|
}
|
|
};
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, function () {
|
|
return {
|
|
toggle: toggle
|
|
};
|
|
});
|
|
return showWrapper ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
className: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('dropdown-item', parentInstance.direction) + ' ' + className,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([wrapperStyle, style]),
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_popup__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
show: showPopup,
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([{
|
|
position: 'absolute'
|
|
}, popupStyle]),
|
|
overlayStyle: "position: absolute;",
|
|
overlay: !!parentInstance.overlay,
|
|
position: parentInstance.direction === 'down' ? 'top' : 'bottom',
|
|
duration: transition ? parentInstance.duration : 0,
|
|
closeOnClickOverlay: parentInstance.closeOnClickOverlay,
|
|
onEnter: onOpen,
|
|
onLeave: onClose,
|
|
onClose: toggle,
|
|
onAfterEnter: onOpened,
|
|
onAfterLeave: onClosed_,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
children: [(options || []).map(function (item, index) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_cell__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
|
"data-option": item,
|
|
className: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('dropdown-item__option', {
|
|
active: item.value === value_
|
|
}),
|
|
clickable: true,
|
|
icon: item.icon,
|
|
onClick: function onClick(e) {
|
|
return onOptionTap(e, item);
|
|
},
|
|
renderTitle: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
className: "van-dropdown-item__title",
|
|
style: item.value === value_ ? 'color:' + parentInstance.activeColor : '',
|
|
children: item.text
|
|
})
|
|
}),
|
|
children: item.value === value_ && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_icon_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
name: "success",
|
|
className: "van-dropdown-item__icon",
|
|
color: parentInstance.activeColor
|
|
})
|
|
}, "".concat(index, "VanCell"));
|
|
}), others.children]
|
|
})
|
|
})
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {});
|
|
}
|
|
|
|
var DropdownItem = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)( /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(Index));
|
|
|
|
/* harmony default export */ __webpack_exports__["default"] = (DropdownItem);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/dropdown-menu/index.js":
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/dropdown-menu/index.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export DropdownMenu */
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/utils */ "./node_modules/@antmjs/vantui/es/common/utils.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/dropdown-menu/wxs.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
|
|
var _excluded = ["activeColor", "overlay", "zIndex", "duration", "direction", "closeOnClickOverlay", "closeOnClickOutside", "className", "style"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ARRAY = [];
|
|
function DropdownMenu(props) {
|
|
var activeColor = props.activeColor,
|
|
_props$overlay = props.overlay,
|
|
overlay = _props$overlay === void 0 ? true : _props$overlay,
|
|
zIndex = props.zIndex,
|
|
_props$duration = props.duration,
|
|
duration = _props$duration === void 0 ? 200 : _props$duration,
|
|
_props$direction = props.direction,
|
|
direction = _props$direction === void 0 ? 'down' : _props$direction,
|
|
_props$closeOnClickOv = props.closeOnClickOverlay,
|
|
closeOnClickOverlay = _props$closeOnClickOv === void 0 ? true : _props$closeOnClickOv,
|
|
_props$closeOnClickOu = props.closeOnClickOutside,
|
|
closeOnClickOutside = _props$closeOnClickOu === void 0 ? true : _props$closeOnClickOu,
|
|
className = props.className,
|
|
style = props.style,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_4__["default"])(props, _excluded);
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState, 2),
|
|
itemListData = _useState2[0],
|
|
setItemListData = _useState2[1];
|
|
|
|
var childrenInstance = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
|
|
var TimerKey = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
var indexRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)("".concat(+new Date()).concat(Math.ceil(Math.random() * 10000)));
|
|
var close = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
childrenInstance.current.forEach(function (child) {
|
|
child.toggle(false, {
|
|
immediate: true
|
|
});
|
|
});
|
|
}, []);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(function () {
|
|
TimerKey.current = new Date();
|
|
ARRAY.push({
|
|
closeOnClickOutside: closeOnClickOutside,
|
|
TimerKey: TimerKey,
|
|
close: close
|
|
});
|
|
}, [closeOnClickOutside, close]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect)(function () {
|
|
updateItemListData();
|
|
}, [others.children]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
return function () {
|
|
ARRAY = (ARRAY || []).filter(function (item) {
|
|
return item && item.TimerKey !== TimerKey;
|
|
});
|
|
};
|
|
}, []);
|
|
|
|
var updateItemListData = function updateItemListData() {
|
|
setTimeout(function () {
|
|
if (childrenInstance.current) {
|
|
setItemListData(childrenInstance.current.map(function (child) {
|
|
return child;
|
|
}));
|
|
}
|
|
}, 333);
|
|
};
|
|
|
|
var toggleItem = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (active) {
|
|
childrenInstance.current.forEach(function (item, index) {
|
|
var showPopup = item.showPopup;
|
|
|
|
if (index === Number(active)) {
|
|
item.toggle();
|
|
} else if (showPopup) {
|
|
item.toggle(false, {
|
|
immediate: true
|
|
});
|
|
}
|
|
});
|
|
}, []);
|
|
var onTitleTap = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
|
|
var index = event.currentTarget.dataset.index;
|
|
var child = childrenInstance.current[index];
|
|
|
|
if (!child.disabled) {
|
|
ARRAY.forEach(function (menuItem) {
|
|
if (menuItem && menuItem.closeOnClickOutside && menuItem.TimerKey !== TimerKey) {
|
|
menuItem.close();
|
|
}
|
|
});
|
|
setTimeout(function () {
|
|
toggleItem(index);
|
|
});
|
|
}
|
|
}, [toggleItem]);
|
|
var setChildrenInstance = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (index, instance) {
|
|
childrenInstance.current[index] = instance;
|
|
}, []);
|
|
var getChildWrapperStyle = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
return (0,_common_utils__WEBPACK_IMPORTED_MODULE_1__.getRect)(null, ".van-dropdown-menu".concat(indexRef.current)).then(function (rect) {
|
|
var wrapperStyle = {
|
|
rect: rect
|
|
};
|
|
|
|
if (typeof zIndex === 'number') {
|
|
wrapperStyle.zIndex = zIndex;
|
|
}
|
|
|
|
return wrapperStyle;
|
|
});
|
|
}, [zIndex]);
|
|
var ResetChildren = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
var res = [];
|
|
react__WEBPACK_IMPORTED_MODULE_0__.Children.map(others.children, function (children, index) {
|
|
res.push( /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(children, {
|
|
direction: direction,
|
|
key: index,
|
|
setChildrenInstance: setChildrenInstance,
|
|
index: index,
|
|
parentInstance: {
|
|
overlay: overlay,
|
|
duration: duration,
|
|
activeColor: activeColor,
|
|
closeOnClickOverlay: closeOnClickOverlay,
|
|
direction: direction,
|
|
getChildWrapperStyle: getChildWrapperStyle,
|
|
updateItemListData: updateItemListData
|
|
}
|
|
}));
|
|
});
|
|
return res;
|
|
}, [activeColor, closeOnClickOverlay, direction, duration, getChildWrapperStyle, others.children, overlay, setChildrenInstance]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
className: "van-dropdown-menu van-dropdown-menu".concat(indexRef.current, " van-dropdown-menu--top-bottom ").concat(className),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([style, {
|
|
position: 'relative'
|
|
}]),
|
|
children: [(itemListData || []).map(function (item, index) {
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
"data-index": index,
|
|
className: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('dropdown-menu__item', {
|
|
disabled: item.disabled
|
|
}),
|
|
onClick: onTitleTap,
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
className: item.titleClass + ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('dropdown-menu__title', {
|
|
active: item.showPopup,
|
|
down: item.showPopup === (direction === 'down')
|
|
}),
|
|
style: item.showPopup ? 'color:' + activeColor : '',
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, {
|
|
className: "van-ellipsis ".concat(item.titleClass || ''),
|
|
children: _wxs__WEBPACK_IMPORTED_MODULE_7__.displayTitle(item)
|
|
})
|
|
})
|
|
}, item.index);
|
|
}), ResetChildren]
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (DropdownMenu);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/dropdown-menu/wxs.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/dropdown-menu/wxs.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "displayTitle": function() { return /* binding */ displayTitle; }
|
|
/* harmony export */ });
|
|
/* eslint-disable */
|
|
function displayTitle(item) {
|
|
var match = (item.options || []).filter(function (option) {
|
|
return option.value === item.value;
|
|
});
|
|
var displayTitle = match.length ? match[0].text : '';
|
|
|
|
if (displayTitle === null || displayTitle === undefined || displayTitle === '') {
|
|
return item.title || '';
|
|
}
|
|
|
|
return displayTitle;
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/mixins/transition.js":
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/mixins/transition.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "useTransition": function() { return /* binding */ useTransition; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _common_validator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../common/validator */ "./node_modules/@antmjs/vantui/es/common/validator.js");
|
|
/* provided dependency */ var requestAnimationFrame = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["requestAnimationFrame"];
|
|
|
|
|
|
|
|
|
|
var getClassNames = function getClassNames(name) {
|
|
return {
|
|
enter: "van-".concat(name, "-enter van-").concat(name, "-enter-active enter-class enter-active-class"),
|
|
'enter-to': "van-".concat(name, "-enter-to van-").concat(name, "-enter-active enter-to-class enter-active-class"),
|
|
leave: "van-".concat(name, "-leave van-").concat(name, "-leave-active leave-class leave-active-class"),
|
|
'leave-to': "van-".concat(name, "-leave-to van-").concat(name, "-leave-active leave-to-class leave-active-class")
|
|
};
|
|
};
|
|
|
|
function useTransition(_ref) {
|
|
var _ref$show = _ref.show,
|
|
show = _ref$show === void 0 ? false : _ref$show,
|
|
_ref$duration = _ref.duration,
|
|
duration = _ref$duration === void 0 ? 300 : _ref$duration,
|
|
_ref$name = _ref.name,
|
|
name = _ref$name === void 0 ? 'fade' : _ref$name,
|
|
onBeforeEnter = _ref.onBeforeEnter,
|
|
onBeforeLeave = _ref.onBeforeLeave,
|
|
onAfterEnter = _ref.onAfterEnter,
|
|
onAfterLeave = _ref.onAfterLeave,
|
|
onEnter = _ref.onEnter,
|
|
onLeave = _ref.onLeave,
|
|
enterClass = _ref.enterClass,
|
|
enterActiveClass = _ref.enterActiveClass,
|
|
enterToClass = _ref.enterToClass,
|
|
leaveClass = _ref.leaveClass,
|
|
leaveActiveClass = _ref.leaveActiveClass,
|
|
leaveToClass = _ref.leaveToClass;
|
|
var transitionEnded = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
|
|
var status = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)('');
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_useState, 2),
|
|
display = _useState2[0],
|
|
setDisplay = _useState2[1];
|
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
|
_useState4 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_useState3, 2),
|
|
inited = _useState4[0],
|
|
setInited = _useState4[1];
|
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),
|
|
_useState6 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_useState5, 2),
|
|
currentDuration = _useState6[0],
|
|
setCurrentDuration = _useState6[1];
|
|
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
|
_useState8 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__["default"])(_useState7, 2),
|
|
classes = _useState8[0],
|
|
setClasses = _useState8[1];
|
|
|
|
var classNames = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
var names = getClassNames(name);
|
|
|
|
if (!name) {
|
|
names['enter'] += " ".concat(enterClass !== null && enterClass !== void 0 ? enterClass : '');
|
|
names['enter-to'] += "".concat(enterToClass !== null && enterToClass !== void 0 ? enterToClass : '', " ").concat(enterActiveClass !== null && enterActiveClass !== void 0 ? enterActiveClass : '', " ");
|
|
names['leave'] += " ".concat(leaveClass !== null && leaveClass !== void 0 ? leaveClass : '');
|
|
names['leave-to'] += " ".concat(leaveToClass !== null && leaveToClass !== void 0 ? leaveToClass : '', " ").concat(leaveActiveClass !== null && leaveActiveClass !== void 0 ? leaveActiveClass : '');
|
|
}
|
|
|
|
return names;
|
|
}, [enterActiveClass, enterClass, enterToClass, leaveActiveClass, leaveClass, leaveToClass, name]);
|
|
var onTransitionEnd = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
if (transitionEnded.current) {
|
|
return;
|
|
}
|
|
|
|
transitionEnded.current = true;
|
|
|
|
if (status.current === 'enter') {
|
|
onAfterEnter === null || onAfterEnter === void 0 ? void 0 : onAfterEnter();
|
|
} else {
|
|
onAfterLeave === null || onAfterLeave === void 0 ? void 0 : onAfterLeave();
|
|
}
|
|
|
|
if (!show && display) {
|
|
// this.setData({ display: false })
|
|
setDisplay(false);
|
|
}
|
|
}, [display, onAfterEnter, onAfterLeave, show]);
|
|
|
|
var _enter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
// debugger
|
|
// const { duration, name } = this.data
|
|
var currentDuration = (0,_common_validator__WEBPACK_IMPORTED_MODULE_2__.isObj)(duration) ? duration.enter : duration;
|
|
status.current = 'enter'; // this.$emit('before-enter')
|
|
|
|
onBeforeEnter === null || onBeforeEnter === void 0 ? void 0 : onBeforeEnter();
|
|
requestAnimationFrame(function () {
|
|
if (status.current !== 'enter') {
|
|
return;
|
|
}
|
|
|
|
onEnter === null || onEnter === void 0 ? void 0 : onEnter();
|
|
setInited(true);
|
|
setDisplay(true);
|
|
setClasses(classNames.enter);
|
|
setCurrentDuration(currentDuration);
|
|
requestAnimationFrame(function () {
|
|
if (status.current !== 'enter') {
|
|
return;
|
|
}
|
|
|
|
transitionEnded.current = false;
|
|
setTimeout(function () {
|
|
return onTransitionEnd();
|
|
}, currentDuration);
|
|
setClasses(classNames['enter-to']);
|
|
});
|
|
});
|
|
}, [duration, onBeforeEnter, onEnter, classNames, onTransitionEnd]);
|
|
|
|
var _leave = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
if (!display) {
|
|
return;
|
|
}
|
|
|
|
var currentDuration = (0,_common_validator__WEBPACK_IMPORTED_MODULE_2__.isObj)(duration) ? duration.leave : duration;
|
|
status.current = 'leave';
|
|
onBeforeLeave === null || onBeforeLeave === void 0 ? void 0 : onBeforeLeave();
|
|
requestAnimationFrame(function () {
|
|
if (status.current !== 'leave') {
|
|
return;
|
|
} // this.$emit('leave')
|
|
|
|
|
|
onLeave === null || onLeave === void 0 ? void 0 : onLeave();
|
|
setClasses(classNames.leave);
|
|
setCurrentDuration(currentDuration);
|
|
requestAnimationFrame(function () {
|
|
if (status.current !== 'leave') {
|
|
return;
|
|
}
|
|
|
|
transitionEnded.current = false;
|
|
setTimeout(function () {
|
|
return onTransitionEnd();
|
|
}, currentDuration);
|
|
setClasses(classNames['leave-to']);
|
|
});
|
|
});
|
|
}, [classNames, display, duration, onBeforeLeave, onLeave, onTransitionEnd]);
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
if (show && (!classes || !classes.includes(classNames['enter-to']))) {
|
|
_enter();
|
|
}
|
|
|
|
if (!show) {
|
|
_leave();
|
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [show]);
|
|
return {
|
|
display: display,
|
|
inited: inited,
|
|
currentDuration: currentDuration,
|
|
classes: classes,
|
|
onTransitionEnd: onTransitionEnd
|
|
};
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/overlay/index.js":
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/overlay/index.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export Overlay */
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../transition */ "./node_modules/@antmjs/vantui/es/transition/index.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
|
|
|
|
|
var _excluded = ["show", "zIndex", "style", "className", "lockScroll", "duration", "setOuterShow", "children"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function OverlayInner(props) {
|
|
var show = props.show,
|
|
zIndex = props.zIndex,
|
|
style = props.style,
|
|
className = props.className,
|
|
_props$lockScroll = props.lockScroll,
|
|
lockScroll = _props$lockScroll === void 0 ? true : _props$lockScroll,
|
|
_props$duration = props.duration,
|
|
duration = _props$duration === void 0 ? 300 : _props$duration,
|
|
setOuterShow = props.setOuterShow,
|
|
children = props.children,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__["default"])(props, _excluded);
|
|
|
|
var _noop = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (event) {
|
|
event.stopPropagation();
|
|
event.preventDefault();
|
|
}, []);
|
|
|
|
return lockScroll ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_transition__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread(_objectSpread({
|
|
show: show,
|
|
className: 'van-overlay' + " ".concat(className),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([{
|
|
'z-index': zIndex
|
|
}, style]),
|
|
duration: duration,
|
|
onTouchMove: _noop,
|
|
onAfterLeave: function onAfterLeave() {
|
|
setTimeout(function () {
|
|
setOuterShow(false);
|
|
}, 0);
|
|
}
|
|
}, others), {}, {
|
|
children: children
|
|
})) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_transition__WEBPACK_IMPORTED_MODULE_3__["default"], _objectSpread(_objectSpread({
|
|
show: show,
|
|
className: 'van-overlay' + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([{
|
|
'z-index': zIndex
|
|
}, style]),
|
|
duration: duration,
|
|
onAfterLeave: function onAfterLeave() {
|
|
return setOuterShow(false);
|
|
}
|
|
}, others), {}, {
|
|
children: children
|
|
}));
|
|
}
|
|
|
|
function Overlay(props) {
|
|
var show = props.show;
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_6__["default"])(_useState, 2),
|
|
innerShow = _useState2[0],
|
|
setInnerShow = _useState2[1];
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
if (show) {
|
|
setInnerShow(true);
|
|
}
|
|
}, [show]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
|
children: innerShow ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(OverlayInner, _objectSpread({
|
|
setOuterShow: setInnerShow
|
|
}, props)) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {})
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Overlay);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/popup/index.js":
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/popup/index.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export Popup */
|
|
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../icon */ "./node_modules/@antmjs/vantui/es/icon/index.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/popup/wxs.js");
|
|
/* harmony import */ var _mixins_transition__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../mixins/transition */ "./node_modules/@antmjs/vantui/es/mixins/transition.js");
|
|
/* harmony import */ var _overlay__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../overlay */ "./node_modules/@antmjs/vantui/es/overlay/index.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
|
|
|
|
|
|
|
|
var _excluded = ["show", "duration", "round", "closeable", "transition", "zIndex", "closeIcon", "closeIconPosition", "position", "safeAreaInsetBottom", "safeAreaInsetTop", "children", "onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave", "onEnter", "onLeave", "onClose", "setOuterShow", "style", "className"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
/* eslint-disable react/prop-types */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function PopupInner(props) {
|
|
var show = props.show,
|
|
_props$duration = props.duration,
|
|
duration = _props$duration === void 0 ? 300 : _props$duration,
|
|
round = props.round,
|
|
closeable = props.closeable,
|
|
transition = props.transition,
|
|
zIndex = props.zIndex,
|
|
_props$closeIcon = props.closeIcon,
|
|
closeIcon = _props$closeIcon === void 0 ? 'cross' : _props$closeIcon,
|
|
_props$closeIconPosit = props.closeIconPosition,
|
|
closeIconPosition = _props$closeIconPosit === void 0 ? 'top-right' : _props$closeIconPosit,
|
|
_props$position = props.position,
|
|
position = _props$position === void 0 ? 'center' : _props$position,
|
|
_props$safeAreaInsetB = props.safeAreaInsetBottom,
|
|
safeAreaInsetBottom = _props$safeAreaInsetB === void 0 ? true : _props$safeAreaInsetB,
|
|
_props$safeAreaInsetT = props.safeAreaInsetTop,
|
|
safeAreaInsetTop = _props$safeAreaInsetT === void 0 ? false : _props$safeAreaInsetT,
|
|
children = props.children,
|
|
onBeforeEnter = props.onBeforeEnter,
|
|
onBeforeLeave = props.onBeforeLeave,
|
|
onAfterEnter = props.onAfterEnter,
|
|
onAfterLeave = props.onAfterLeave,
|
|
onEnter = props.onEnter,
|
|
onLeave = props.onLeave,
|
|
onClose = props.onClose,
|
|
setOuterShow = props.setOuterShow,
|
|
style = props.style,
|
|
className = props.className,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_8__["default"])(props, _excluded);
|
|
|
|
var _onAfterLeave = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
|
onAfterLeave === null || onAfterLeave === void 0 ? void 0 : onAfterLeave();
|
|
setTimeout(function () {
|
|
setOuterShow === null || setOuterShow === void 0 ? void 0 : setOuterShow(false);
|
|
}, 0);
|
|
}, [onAfterLeave, setOuterShow]);
|
|
|
|
var _onClickCloseIcon = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
}, [onClose]);
|
|
|
|
var _useTransition = (0,_mixins_transition__WEBPACK_IMPORTED_MODULE_5__.useTransition)({
|
|
show: show,
|
|
duration: transition === 'none' ? 0 : duration,
|
|
name: transition || position,
|
|
onBeforeEnter: onBeforeEnter,
|
|
onBeforeLeave: onBeforeLeave,
|
|
onAfterEnter: onAfterEnter,
|
|
onAfterLeave: _onAfterLeave,
|
|
onEnter: onEnter,
|
|
onLeave: onLeave
|
|
}),
|
|
inited = _useTransition.inited,
|
|
currentDuration = _useTransition.currentDuration,
|
|
classes = _useTransition.classes,
|
|
display = _useTransition.display,
|
|
onTransitionEnd = _useTransition.onTransitionEnd;
|
|
|
|
var getClassName = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (name) {
|
|
return name.replace(/([A-Z])/g, function (_, $1) {
|
|
return '-' + ($1 === null || $1 === void 0 ? void 0 : $1.toLowerCase());
|
|
});
|
|
}, []);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
|
|
children: inited && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, _objectSpread(_objectSpread({
|
|
className: classes + ' ' + _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.bem('popup', [position, {
|
|
round: round,
|
|
safe: safeAreaInsetBottom,
|
|
safeTop: safeAreaInsetTop
|
|
}]) + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_2__.style([_wxs__WEBPACK_IMPORTED_MODULE_4__.popupStyle({
|
|
zIndex: zIndex,
|
|
currentDuration: currentDuration,
|
|
display: display
|
|
}), style]),
|
|
onTransitionEnd: onTransitionEnd
|
|
}, others), {}, {
|
|
children: [children, closeable &&
|
|
/*#__PURE__*/
|
|
// @ts-check
|
|
(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_icon__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
name: closeIcon,
|
|
className: 'close-icon-class van-popup__close-icon van-popup__close-icon--' + getClassName(closeIconPosition),
|
|
onClick: _onClickCloseIcon
|
|
})]
|
|
}))
|
|
});
|
|
}
|
|
|
|
function Popup(props) {
|
|
var show = props.show,
|
|
_props$duration2 = props.duration,
|
|
duration = _props$duration2 === void 0 ? 300 : _props$duration2,
|
|
zIndex = props.zIndex,
|
|
_props$overlay = props.overlay,
|
|
overlay = _props$overlay === void 0 ? true : _props$overlay,
|
|
_props$lockScroll = props.lockScroll,
|
|
lockScroll = _props$lockScroll === void 0 ? true : _props$lockScroll,
|
|
overlayStyle = props.overlayStyle,
|
|
_props$closeOnClickOv = props.closeOnClickOverlay,
|
|
closeOnClickOverlay = _props$closeOnClickOv === void 0 ? true : _props$closeOnClickOv,
|
|
onClickOverlay = props.onClickOverlay,
|
|
onClose = props.onClose;
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
|
_useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__["default"])(_useState, 2),
|
|
innerShow = _useState2[0],
|
|
setInnerShow = _useState2[1];
|
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
if (show) {
|
|
setInnerShow(true);
|
|
}
|
|
}, [show]);
|
|
|
|
var _onClickOverlay = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
|
onClickOverlay === null || onClickOverlay === void 0 ? void 0 : onClickOverlay();
|
|
|
|
if (closeOnClickOverlay) {
|
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
}
|
|
}, [closeOnClickOverlay, onClickOverlay, onClose]);
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
children: overlay && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_overlay__WEBPACK_IMPORTED_MODULE_6__["default"], {
|
|
show: show,
|
|
zIndex: zIndex,
|
|
style: overlayStyle,
|
|
duration: duration,
|
|
onClick: _onClickOverlay,
|
|
lockScroll: lockScroll
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_9__.View, {
|
|
children: innerShow ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(PopupInner, _objectSpread({
|
|
setOuterShow: setInnerShow
|
|
}, props)) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {})
|
|
})]
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Popup);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/popup/wxs.js":
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/popup/wxs.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "popupStyle": function() { return /* binding */ popupStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* eslint-disable */
|
|
|
|
|
|
function popupStyle(data) {
|
|
return _wxs_utils__WEBPACK_IMPORTED_MODULE_0__.style([{
|
|
'z-index': data.zIndex,
|
|
'-webkit-transition-duration': data.currentDuration + 'ms',
|
|
'transition-duration': data.currentDuration + 'ms'
|
|
}, data.display ? null : 'display: none']);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/transition/index.js":
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/transition/index.js ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* unused harmony export Transition */
|
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
|
|
/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* harmony import */ var _wxs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wxs */ "./node_modules/@antmjs/vantui/es/transition/wxs.js");
|
|
/* harmony import */ var _mixins_transition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../mixins/transition */ "./node_modules/@antmjs/vantui/es/mixins/transition.js");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
|
|
|
var _excluded = ["onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave", "onEnter", "onLeave", "duration", "name", "show", "children", "style", "className", "enterClass", "enterActiveClass", "enterToClass", "leaveClass", "leaveActiveClass", "leaveToClass"];
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Transition(props) {
|
|
var onBeforeEnter = props.onBeforeEnter,
|
|
onBeforeLeave = props.onBeforeLeave,
|
|
onAfterEnter = props.onAfterEnter,
|
|
onAfterLeave = props.onAfterLeave,
|
|
onEnter = props.onEnter,
|
|
onLeave = props.onLeave,
|
|
duration = props.duration,
|
|
name = props.name,
|
|
show = props.show,
|
|
children = props.children,
|
|
style = props.style,
|
|
className = props.className,
|
|
enterClass = props.enterClass,
|
|
enterActiveClass = props.enterActiveClass,
|
|
enterToClass = props.enterToClass,
|
|
leaveClass = props.leaveClass,
|
|
leaveActiveClass = props.leaveActiveClass,
|
|
leaveToClass = props.leaveToClass,
|
|
others = (0,_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__["default"])(props, _excluded);
|
|
|
|
var _useTransition = (0,_mixins_transition__WEBPACK_IMPORTED_MODULE_3__.useTransition)({
|
|
show: show,
|
|
duration: duration,
|
|
name: name,
|
|
enterClass: enterClass,
|
|
enterActiveClass: enterActiveClass,
|
|
enterToClass: enterToClass,
|
|
leaveClass: leaveClass,
|
|
leaveActiveClass: leaveActiveClass,
|
|
leaveToClass: leaveToClass,
|
|
onBeforeEnter: onBeforeEnter,
|
|
onBeforeLeave: onBeforeLeave,
|
|
onAfterEnter: onAfterEnter,
|
|
onAfterLeave: onAfterLeave,
|
|
onEnter: onEnter,
|
|
onLeave: onLeave
|
|
}),
|
|
currentDuration = _useTransition.currentDuration,
|
|
classes = _useTransition.classes,
|
|
display = _useTransition.display;
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_6__.View, _objectSpread(_objectSpread({
|
|
className: 'van-transition ' + classes + " ".concat(className || ''),
|
|
style: _wxs_utils__WEBPACK_IMPORTED_MODULE_1__.style([_wxs__WEBPACK_IMPORTED_MODULE_2__.rootStyle({
|
|
currentDuration: currentDuration,
|
|
display: display
|
|
}), style])
|
|
}, others), {}, {
|
|
// @ts-ignore
|
|
catchMove: true,
|
|
children: children
|
|
}))
|
|
});
|
|
}
|
|
/* harmony default export */ __webpack_exports__["default"] = (Transition);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/@antmjs/vantui/es/transition/wxs.js":
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/@antmjs/vantui/es/transition/wxs.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "rootStyle": function() { return /* binding */ rootStyle; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _wxs_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wxs/utils */ "./node_modules/@antmjs/vantui/es/wxs/utils.js");
|
|
/* eslint-disable */
|
|
|
|
|
|
function rootStyle(data) {
|
|
return _wxs_utils__WEBPACK_IMPORTED_MODULE_0__.style([{
|
|
'-webkit-transition-duration': data.currentDuration + 'ms',
|
|
'transition-duration': data.currentDuration + 'ms'
|
|
}, data.display ? null : 'display: none', data.style]);
|
|
}
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/activityList/index.tsx":
|
|
/*!***************************************************************************************************************!*\
|
|
!*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/activityList/index.tsx ***!
|
|
\***************************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _antmjs_vantui_es_dropdown_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antmjs/vantui/es/dropdown-menu */ "./node_modules/@antmjs/vantui/es/dropdown-menu/index.js");
|
|
/* harmony import */ var _antmjs_vantui_es_dropdown_item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antmjs/vantui/es/dropdown-item */ "./node_modules/@antmjs/vantui/es/dropdown-item/index.js");
|
|
/* harmony import */ var _Users_eric_Desktop_citynew_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
|
|
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var activityList = function activityList() {
|
|
var _react$useState = react__WEBPACK_IMPORTED_MODULE_2___default().useState({
|
|
option1: [{
|
|
text: "全部商品",
|
|
value: 0
|
|
}, {
|
|
text: "新款商品",
|
|
value: 1
|
|
}, {
|
|
text: "活动商品",
|
|
value: 2
|
|
}],
|
|
option2: [{
|
|
text: "默认排序",
|
|
value: "a"
|
|
}, {
|
|
text: "好评排序",
|
|
value: "b"
|
|
}, {
|
|
text: "销量排序",
|
|
value: "c"
|
|
}],
|
|
value1: 0,
|
|
value2: "a"
|
|
}),
|
|
_react$useState2 = (0,_Users_eric_Desktop_citynew_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_react$useState, 2),
|
|
state = _react$useState2[0],
|
|
setState = _react$useState2[1];
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
|
|
children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_antmjs_vantui_es_dropdown_menu__WEBPACK_IMPORTED_MODULE_0__["default"], {
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_antmjs_vantui_es_dropdown_item__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
value: state.value1,
|
|
options: state.option1
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_antmjs_vantui_es_dropdown_item__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
value: state.value2,
|
|
options: state.option2
|
|
})]
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ __webpack_exports__["default"] = (activityList);
|
|
|
|
/***/ }),
|
|
|
|
/***/ "./src/pages/activityList/index.tsx":
|
|
/*!******************************************!*\
|
|
!*** ./src/pages/activityList/index.tsx ***!
|
|
\******************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
|
|
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_index_tsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./index.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/activityList/index.tsx");
|
|
|
|
|
|
var config = {};
|
|
|
|
|
|
var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig)(_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_index_tsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/activityList/index', {root:{cn:[]}}, config || {}))
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
},
|
|
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
|
/******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/activityList/index.tsx"); });
|
|
/******/ var __webpack_exports__ = __webpack_require__.O();
|
|
/******/ }
|
|
]);
|
|
//# sourceMappingURL=index.js.map
|