@trionesdev/antd-taro-react 0.0.2-beta.12 → 0.0.2-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Calendar/touchable-calendar-grid.js +16 -16
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +4 -4
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +144 -48
- package/dist/CalendarDatetimePicker/style.scss +52 -14
- package/dist/CalendarDatetimePicker/types.d.ts +4 -0
- package/dist/CalendarDatetimePicker/types.js +6 -1
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +9 -0
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +60 -0
- package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
- package/dist/CalendarDatetimePickerCell/index.js +2 -0
- package/dist/CalendarPicker/CalendarPicker.d.ts +4 -0
- package/dist/{CalendarPopup/CalendarPopup.js → CalendarPicker/CalendarPicker.js} +3 -2
- package/dist/CalendarPicker/CalendarRangePicker.d.ts +4 -0
- package/dist/{CalendarPopup/CalendarRangePopup.js → CalendarPicker/CalendarRangePicker.js} +3 -2
- package/dist/CalendarPicker/index.d.ts +8 -0
- package/dist/CalendarPicker/index.js +5 -0
- package/dist/{CalendarPopup → CalendarPicker}/style.scss +2 -2
- package/dist/{CalendarPopup → CalendarPicker}/types.d.ts +3 -3
- package/dist/CalendarPicker/types.js +1 -0
- package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
- package/dist/CalendarPickerCell/index.d.ts +8 -0
- package/dist/CalendarPickerCell/index.js +5 -0
- package/dist/{CascaderPopup/cascader-popup.d.ts → CascaderPicker/cascader-picker.d.ts} +2 -2
- package/dist/{CascaderPopup/cascader-popup.js → CascaderPicker/cascader-picker.js} +8 -8
- package/dist/CascaderPicker/index.d.ts +1 -1
- package/dist/CascaderPicker/index.js +1 -1
- package/dist/CascaderPicker/style.scss +33 -12
- package/dist/{CascaderPicker/CascaderPicker.d.ts → CascaderPickerCell/CascaderPickerCell.d.ts} +4 -9
- package/dist/{CascaderPicker/CascaderPicker.js → CascaderPickerCell/CascaderPickerCell.js} +6 -14
- package/dist/CascaderPickerCell/index.d.ts +3 -0
- package/dist/CascaderPickerCell/index.js +2 -0
- package/dist/DatePicker/DatePicker.d.ts +10 -7
- package/dist/DatePicker/DatePicker.js +276 -51
- package/dist/DatePicker/index.d.ts +2 -1
- package/dist/DatePicker/style.scss +1 -24
- package/dist/DatePickerCell/DatePickerCell.d.ts +16 -0
- package/dist/DatePickerCell/DatePickerCell.js +78 -0
- package/dist/DatePickerCell/index.d.ts +3 -0
- package/dist/DatePickerCell/index.js +2 -0
- package/dist/FloatButton/FloatButton.d.ts +19 -0
- package/dist/FloatButton/FloatButton.js +60 -0
- package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
- package/dist/FloatButton/FloatButtonGroup.js +141 -0
- package/dist/FloatButton/context.d.ts +10 -0
- package/dist/FloatButton/context.js +2 -0
- package/dist/FloatButton/index.d.ts +10 -0
- package/dist/FloatButton/index.js +5 -0
- package/dist/FloatButton/style.scss +126 -0
- package/dist/Input/taro-input.js +5 -2
- package/dist/Input/types.d.ts +1 -0
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/index.js +2 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.js +7 -3
- package/dist/utils/dayjs.d.ts +2 -1
- package/dist/utils/dayjs.js +13 -0
- package/package.json +4 -4
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.d.ts +0 -11
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.js +0 -164
- package/dist/CalendarDatetimePopup/index.d.ts +0 -3
- package/dist/CalendarDatetimePopup/index.js +0 -2
- package/dist/CalendarDatetimePopup/style.scss +0 -62
- package/dist/CalendarDatetimePopup/types.d.ts +0 -5
- package/dist/CalendarDatetimePopup/types.js +0 -6
- package/dist/CalendarPopup/CalendarPopup.d.ts +0 -4
- package/dist/CalendarPopup/CalendarRangePopup.d.ts +0 -4
- package/dist/CalendarPopup/index.d.ts +0 -8
- package/dist/CalendarPopup/index.js +0 -5
- package/dist/CalendarPopup/types.js +0 -1
- package/dist/CascaderPopup/index.d.ts +0 -3
- package/dist/CascaderPopup/index.js +0 -2
- package/dist/CascaderPopup/style.scss +0 -45
- package/dist/DatePicker/DatePickerPopup.d.ts +0 -18
- package/dist/DatePicker/DatePickerPopup.js +0 -329
- /package/dist/{CalendarDatetimePopup → CalendarDatetimePicker}/DateTimeSwitch.d.ts +0 -0
- /package/dist/{CalendarDatetimePopup → CalendarDatetimePicker}/DateTimeSwitch.js +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { CloseOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
15
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
|
+
import { FloatButton } from "./FloatButton";
|
|
17
|
+
import { FloatButtonGroupContext } from "./context";
|
|
18
|
+
import "./style.scss";
|
|
19
|
+
import { RootPortal, View } from "@tarojs/components";
|
|
20
|
+
import { useTaro } from "../hooks";
|
|
21
|
+
var groupCls = 'triones-antm-float-button-group';
|
|
22
|
+
export var FloatButtonGroup = function FloatButtonGroup(_ref) {
|
|
23
|
+
var _ref$shape = _ref.shape,
|
|
24
|
+
shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
|
|
25
|
+
_ref$type = _ref.type,
|
|
26
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
27
|
+
icon = _ref.icon,
|
|
28
|
+
trigger = _ref.trigger,
|
|
29
|
+
openProp = _ref.open,
|
|
30
|
+
onOpenChange = _ref.onOpenChange,
|
|
31
|
+
closeIcon = _ref.closeIcon,
|
|
32
|
+
_ref$placement = _ref.placement,
|
|
33
|
+
placement = _ref$placement === void 0 ? 'top' : _ref$placement,
|
|
34
|
+
onClick = _ref.onClick,
|
|
35
|
+
className = _ref.className,
|
|
36
|
+
style = _ref.style,
|
|
37
|
+
children = _ref.children,
|
|
38
|
+
_ref$right = _ref.right,
|
|
39
|
+
right = _ref$right === void 0 ? 24 : _ref$right,
|
|
40
|
+
_ref$bottom = _ref.bottom,
|
|
41
|
+
bottom = _ref$bottom === void 0 ? 24 : _ref$bottom,
|
|
42
|
+
_ref$zIndex = _ref.zIndex,
|
|
43
|
+
zIndex = _ref$zIndex === void 0 ? 100 : _ref$zIndex;
|
|
44
|
+
var _useTaro = useTaro(),
|
|
45
|
+
isTaroWeb = _useTaro.isTaroWeb,
|
|
46
|
+
isTaroEnv = _useTaro.isTaroEnv;
|
|
47
|
+
var rootRef = useRef(null);
|
|
48
|
+
var isMenu = trigger === 'click' || trigger === 'hover';
|
|
49
|
+
var _useState = useState(false),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
uncontrolledOpen = _useState2[0],
|
|
52
|
+
setUncontrolledOpen = _useState2[1];
|
|
53
|
+
var mergedOpen = openProp !== null && openProp !== void 0 ? openProp : uncontrolledOpen;
|
|
54
|
+
var setOpen = useCallback(function (next) {
|
|
55
|
+
if (openProp === undefined) {
|
|
56
|
+
setUncontrolledOpen(next);
|
|
57
|
+
}
|
|
58
|
+
onOpenChange === null || onOpenChange === void 0 || onOpenChange(next);
|
|
59
|
+
}, [openProp, onOpenChange]);
|
|
60
|
+
var triggerOpen = useCallback(function (next) {
|
|
61
|
+
if (mergedOpen !== next) {
|
|
62
|
+
setOpen(next);
|
|
63
|
+
}
|
|
64
|
+
}, [mergedOpen, setOpen]);
|
|
65
|
+
|
|
66
|
+
/** H5:document 捕获点击;小程序无 document,见下方全屏透明遮罩 */
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
if (!isMenu || trigger !== 'click' || !isTaroWeb) return;
|
|
69
|
+
var onDoc = function onDoc(e) {
|
|
70
|
+
var _rootRef$current;
|
|
71
|
+
if ((_rootRef$current = rootRef.current) !== null && _rootRef$current !== void 0 && _rootRef$current.contains(e.target)) return;
|
|
72
|
+
triggerOpen(false);
|
|
73
|
+
};
|
|
74
|
+
document.addEventListener('click', onDoc, true);
|
|
75
|
+
return function () {
|
|
76
|
+
document.removeEventListener('click', onDoc, true);
|
|
77
|
+
};
|
|
78
|
+
}, [isMenu, trigger, triggerOpen, isTaroWeb]);
|
|
79
|
+
|
|
80
|
+
/** 小程序:页面没有全局 tap 回调,用全屏透明层(zIndex 低于按钮组)模拟「点击页面其它区域」关闭 */
|
|
81
|
+
var showWeappOutsideMask = !isTaroWeb && !!isTaroEnv && isMenu && trigger === 'click' && mergedOpen;
|
|
82
|
+
var onMouseEnter = function onMouseEnter() {
|
|
83
|
+
if (trigger === 'hover') triggerOpen(true);
|
|
84
|
+
};
|
|
85
|
+
var onMouseLeave = function onMouseLeave() {
|
|
86
|
+
if (trigger === 'hover') triggerOpen(false);
|
|
87
|
+
};
|
|
88
|
+
var onTriggerClick = function onTriggerClick(e) {
|
|
89
|
+
if (trigger === 'click') {
|
|
90
|
+
triggerOpen(!mergedOpen);
|
|
91
|
+
}
|
|
92
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
93
|
+
};
|
|
94
|
+
var mergedCloseIcon = closeIcon !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/React.createElement(CloseOutline, null);
|
|
95
|
+
var listVisible = !isMenu || mergedOpen;
|
|
96
|
+
var listNode = /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: classNames("".concat(groupCls, "-list"), _defineProperty({}, "".concat(groupCls, "-list--hidden"), !listVisible)),
|
|
98
|
+
"aria-hidden": !listVisible
|
|
99
|
+
}, children);
|
|
100
|
+
var triggerNode = /*#__PURE__*/React.createElement(FloatButton, {
|
|
101
|
+
type: type,
|
|
102
|
+
shape: shape,
|
|
103
|
+
icon: mergedOpen ? mergedCloseIcon : icon,
|
|
104
|
+
onClick: onTriggerClick
|
|
105
|
+
});
|
|
106
|
+
var ctxValue = useMemo(function () {
|
|
107
|
+
return {
|
|
108
|
+
inGroup: true,
|
|
109
|
+
shape: shape,
|
|
110
|
+
individual: shape === 'circle'
|
|
111
|
+
};
|
|
112
|
+
}, [shape]);
|
|
113
|
+
var rootClass = classNames(groupCls, "".concat(groupCls, "--placement-").concat(placement), _defineProperty({}, "".concat(groupCls, "--menu"), isMenu), className);
|
|
114
|
+
return /*#__PURE__*/React.createElement(RootPortal, null, showWeappOutsideMask && /*#__PURE__*/React.createElement(View, {
|
|
115
|
+
className: "".concat(groupCls, "-weapp-outside-mask"),
|
|
116
|
+
style: {
|
|
117
|
+
position: 'fixed',
|
|
118
|
+
left: 0,
|
|
119
|
+
top: 0,
|
|
120
|
+
right: 0,
|
|
121
|
+
bottom: 0,
|
|
122
|
+
zIndex: zIndex - 1
|
|
123
|
+
},
|
|
124
|
+
catchMove: true,
|
|
125
|
+
onClick: function onClick() {
|
|
126
|
+
return triggerOpen(false);
|
|
127
|
+
}
|
|
128
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
ref: rootRef,
|
|
130
|
+
className: rootClass,
|
|
131
|
+
style: _objectSpread({
|
|
132
|
+
zIndex: zIndex,
|
|
133
|
+
right: "".concat(right, "Px"),
|
|
134
|
+
bottom: "calc(".concat(bottom, "Px + env(safe-area-inset-bottom, 0px))")
|
|
135
|
+
}, style),
|
|
136
|
+
onMouseEnter: onMouseEnter,
|
|
137
|
+
onMouseLeave: onMouseLeave
|
|
138
|
+
}, /*#__PURE__*/React.createElement(FloatButtonGroupContext.Provider, {
|
|
139
|
+
value: ctxValue
|
|
140
|
+
}, isMenu ? /*#__PURE__*/React.createElement(React.Fragment, null, placement === 'bottom' ? /*#__PURE__*/React.createElement(React.Fragment, null, triggerNode, listNode) : placement === 'right' ? /*#__PURE__*/React.createElement(React.Fragment, null, triggerNode, listNode) : /*#__PURE__*/React.createElement(React.Fragment, null, listNode, triggerNode)) : children)));
|
|
141
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type FloatButtonGroupContextValue = {
|
|
3
|
+
/** 是否在 FloatButton.Group 内(组内子按钮不使用 fixed 定位) */
|
|
4
|
+
inGroup: boolean;
|
|
5
|
+
/** 组级 shape,覆盖子项 */
|
|
6
|
+
shape?: 'circle' | 'square';
|
|
7
|
+
/** 与 antd 一致:circle 组为 true */
|
|
8
|
+
individual?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const FloatButtonGroupContext: React.Context<FloatButtonGroupContextValue | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FloatButton as InternalFloatButton, FloatButtonProps } from "./FloatButton";
|
|
2
|
+
import { FloatButtonGroup } from "./FloatButtonGroup";
|
|
3
|
+
type InternalFloatButtonType = typeof InternalFloatButton;
|
|
4
|
+
type CompoundedComponent = InternalFloatButtonType & {
|
|
5
|
+
Group: typeof FloatButtonGroup;
|
|
6
|
+
};
|
|
7
|
+
declare const FloatButton: CompoundedComponent;
|
|
8
|
+
export type { FloatButtonProps };
|
|
9
|
+
export type { FloatButtonGroupProps } from "./FloatButtonGroup";
|
|
10
|
+
export default FloatButton;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
$floatButtonCls: "triones-antm-float-button";
|
|
4
|
+
$floatButtonGroupCls: "triones-antm-float-button-group";
|
|
5
|
+
|
|
6
|
+
$floatButtonSize: 48Px;
|
|
7
|
+
$floatButtonShadow: 0 6Px 16Px 0 rgba(0, 0, 0, 0.08),
|
|
8
|
+
0 3Px 6Px -4Px rgba(0, 0, 0, 0.12), 0 9Px 28Px 8Px rgba(0, 0, 0, 0.05);
|
|
9
|
+
|
|
10
|
+
.#{$floatButtonCls} {
|
|
11
|
+
position: fixed;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
|
|
16
|
+
&--embedded {
|
|
17
|
+
position: relative;
|
|
18
|
+
right: auto;
|
|
19
|
+
bottom: auto;
|
|
20
|
+
z-index: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-body {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
gap: 8Px;
|
|
31
|
+
min-width: $floatButtonSize;
|
|
32
|
+
min-height: $floatButtonSize;
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
font-size: 20Px;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
color: rgba(0, 0, 0, 0.88);
|
|
39
|
+
background: #fff;
|
|
40
|
+
box-shadow: $floatButtonShadow;
|
|
41
|
+
transition: color 0.2s, background 0.2s, box-shadow 0.2s;
|
|
42
|
+
-webkit-tap-highlight-color: transparent;
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
|
|
45
|
+
&:active {
|
|
46
|
+
filter: brightness(0.95);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--shape-square &-body {
|
|
51
|
+
border-radius: variable.$trionesBorderRadius;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--has-content &-body {
|
|
55
|
+
min-height: $floatButtonSize;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&--type-primary &-body {
|
|
63
|
+
color: #fff;
|
|
64
|
+
background: variable.$trionesColorPrimary;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&-icon {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-content {
|
|
74
|
+
font-size: variable.$trionesFontSizeSm;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.#{$floatButtonGroupCls} {
|
|
81
|
+
position: fixed;
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: 12Px;
|
|
84
|
+
align-items: flex-end;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
|
|
87
|
+
&--placement {
|
|
88
|
+
&-top {
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
}
|
|
91
|
+
&-bottom {
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
}
|
|
94
|
+
&-left {
|
|
95
|
+
flex-direction: row;
|
|
96
|
+
}
|
|
97
|
+
&-right {
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--menu {
|
|
103
|
+
align-items: center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-list {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
gap: 12Px;
|
|
110
|
+
align-items: flex-end;
|
|
111
|
+
|
|
112
|
+
&--hidden {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--placement-left &-list,
|
|
118
|
+
&--placement-right &-list {
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** 小程序点击外部关闭:全屏遮罩;极淡背景避免部分机型不响应 tap */
|
|
123
|
+
&-weapp-outside-mask {
|
|
124
|
+
background: rgba(0, 0, 0, 0.001);
|
|
125
|
+
}
|
|
126
|
+
}
|
package/dist/Input/taro-input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["value", "onChange", "type", "size"];
|
|
1
|
+
var _excluded = ["value", "onChange", "type", "size", "align"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -17,6 +17,8 @@ export var TaroInput = function TaroInput(_ref) {
|
|
|
17
17
|
type = _ref.type,
|
|
18
18
|
_ref$size = _ref.size,
|
|
19
19
|
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
20
|
+
_ref$align = _ref.align,
|
|
21
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
20
22
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
23
|
var _React$useState = React.useState(value),
|
|
22
24
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -39,7 +41,8 @@ export var TaroInput = function TaroInput(_ref) {
|
|
|
39
41
|
}
|
|
40
42
|
}), /*#__PURE__*/React.createElement(InternalTaroInput, {
|
|
41
43
|
style: {
|
|
42
|
-
flex: 1
|
|
44
|
+
flex: 1,
|
|
45
|
+
textAlign: align
|
|
43
46
|
},
|
|
44
47
|
type: type,
|
|
45
48
|
defaultValue: rest.defaultValue,
|
package/dist/Input/types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -12,16 +12,18 @@ export { default as Calendar, CalendarGrid, TouchableCalendarGrid, } from './Cal
|
|
|
12
12
|
export type { CalendarGridProps, CalendarProps } from './Calendar';
|
|
13
13
|
export { default as CalendarDatetimePicker } from './CalendarDatetimePicker';
|
|
14
14
|
export type { CalendarDatetimePickerProps } from './CalendarDatetimePicker';
|
|
15
|
-
export { default as
|
|
16
|
-
export type {
|
|
17
|
-
export { default as
|
|
18
|
-
export type {
|
|
15
|
+
export { default as CalendarDatetimePickerCell } from './CalendarDatetimePickerCell';
|
|
16
|
+
export type { CalendarDatetimePickerCellProps } from './CalendarDatetimePickerCell';
|
|
17
|
+
export { default as CalendarPicker } from './CalendarPicker';
|
|
18
|
+
export type { CalendarPickerProps, CalendarPickerRangeProps } from './CalendarPicker';
|
|
19
|
+
export { default as CalendarPickerCell } from './CalendarPickerCell';
|
|
20
|
+
export type { CalendarPickerCellProps, CalendarRangePickerCellProps } from './CalendarPickerCell';
|
|
19
21
|
export { default as Card } from './Card';
|
|
20
22
|
export type { CardProps } from './Card';
|
|
23
|
+
export { default as CascaderPickerCell } from './CascaderPickerCell';
|
|
24
|
+
export type { CascaderPickerCellProps } from './CascaderPickerCell';
|
|
21
25
|
export { default as CascaderPicker } from './CascaderPicker';
|
|
22
26
|
export type { CascaderPickerProps } from './CascaderPicker';
|
|
23
|
-
export { default as CascaderPopup } from './CascaderPopup';
|
|
24
|
-
export type { CascaderPopupProps } from './CascaderPopup';
|
|
25
27
|
export { default as CascaderView } from './CascaderView';
|
|
26
28
|
export type { CascaderViewProps } from './CascaderView';
|
|
27
29
|
export { default as Cell } from './Cell';
|
|
@@ -31,6 +33,9 @@ export type { CheckboxProps } from './Checkbox';
|
|
|
31
33
|
export { default as ConfigProvider } from './ConfigProvider';
|
|
32
34
|
export type { ConfigProviderProps } from './ConfigProvider';
|
|
33
35
|
export { default as DatePicker } from './DatePicker';
|
|
36
|
+
export type { DatePickerPops } from './DatePicker';
|
|
37
|
+
export { default as DatePickerCell } from './DatePickerCell';
|
|
38
|
+
export type { DatePickerCellPops } from './DatePickerCell';
|
|
34
39
|
export { default as Descriptions } from "./Descriptions";
|
|
35
40
|
export type { DescriptionsProps } from "./Descriptions";
|
|
36
41
|
export { default as Divider } from './Divider';
|
|
@@ -41,6 +46,8 @@ export { default as Empty } from './Empty';
|
|
|
41
46
|
export type { EmptyProps } from './Empty';
|
|
42
47
|
export { default as ErrorBlock } from './ErrorBlock';
|
|
43
48
|
export type { ErrorBlockStatus, ErrorBlockProps } from './ErrorBlock';
|
|
49
|
+
export { default as FloatButton } from './FloatButton';
|
|
50
|
+
export type { FloatButtonProps } from './FloatButton';
|
|
44
51
|
export { default as Footer } from './Footer';
|
|
45
52
|
export type { FooterProps } from './Footer';
|
|
46
53
|
export { default as Form } from './Form';
|
|
@@ -85,6 +92,8 @@ export { default as Scaffold } from './Scaffold';
|
|
|
85
92
|
export type { ScaffoldProps } from './Scaffold';
|
|
86
93
|
export { default as ScrollView } from './ScrollView';
|
|
87
94
|
export type { ScrollViewProps } from './ScrollView';
|
|
95
|
+
export { default as Segmented } from './Segmented';
|
|
96
|
+
export type { SegmentedProps } from './Segmented';
|
|
88
97
|
export { default as SideBar } from './SideBar';
|
|
89
98
|
export type { SideBarProps } from './SideBar';
|
|
90
99
|
export { default as Space } from './Space';
|
package/dist/index.js
CHANGED
|
@@ -5,21 +5,24 @@ export { default as Badge } from "./Badge";
|
|
|
5
5
|
export { default as Button } from "./Button";
|
|
6
6
|
export { default as Calendar, CalendarGrid, TouchableCalendarGrid } from "./Calendar";
|
|
7
7
|
export { default as CalendarDatetimePicker } from "./CalendarDatetimePicker";
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
8
|
+
export { default as CalendarDatetimePickerCell } from "./CalendarDatetimePickerCell";
|
|
9
|
+
export { default as CalendarPicker } from "./CalendarPicker";
|
|
10
|
+
export { default as CalendarPickerCell } from "./CalendarPickerCell";
|
|
10
11
|
export { default as Card } from "./Card";
|
|
12
|
+
export { default as CascaderPickerCell } from "./CascaderPickerCell";
|
|
11
13
|
export { default as CascaderPicker } from "./CascaderPicker";
|
|
12
|
-
export { default as CascaderPopup } from "./CascaderPopup";
|
|
13
14
|
export { default as CascaderView } from "./CascaderView";
|
|
14
15
|
export { default as Cell } from "./Cell";
|
|
15
16
|
export { default as Checkbox } from "./Checkbox";
|
|
16
17
|
export { default as ConfigProvider } from "./ConfigProvider";
|
|
17
18
|
export { default as DatePicker } from "./DatePicker";
|
|
19
|
+
export { default as DatePickerCell } from "./DatePickerCell";
|
|
18
20
|
export { default as Descriptions } from "./Descriptions";
|
|
19
21
|
export { default as Divider } from "./Divider";
|
|
20
22
|
export { default as Ellipsis } from "./Ellipsis";
|
|
21
23
|
export { default as Empty } from "./Empty";
|
|
22
24
|
export { default as ErrorBlock } from "./ErrorBlock";
|
|
25
|
+
export { default as FloatButton } from "./FloatButton";
|
|
23
26
|
export { default as Footer } from "./Footer";
|
|
24
27
|
export { default as Form } from "./Form";
|
|
25
28
|
export { default as Grid } from "./Grid";
|
|
@@ -42,6 +45,7 @@ export { default as Result } from "./Result";
|
|
|
42
45
|
export { default as SafeArea } from "./SafeArea";
|
|
43
46
|
export { default as Scaffold } from "./Scaffold";
|
|
44
47
|
export { default as ScrollView } from "./ScrollView";
|
|
48
|
+
export { default as Segmented } from "./Segmented";
|
|
45
49
|
export { default as SideBar } from "./SideBar";
|
|
46
50
|
export { default as Space } from "./Space";
|
|
47
51
|
export { default as SpinLoading } from "./SpinLoading";
|
package/dist/utils/dayjs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import dayjs, { OpUnitType } from "dayjs";
|
|
2
|
-
export declare const toDayjsArray: (dateArr?:
|
|
2
|
+
export declare const toDayjsArray: (dateArr?: (dayjs.Dayjs | Date)[]) => dayjs.Dayjs[] | undefined;
|
|
3
3
|
export declare const isSame: (x?: dayjs.Dayjs | Date, y?: dayjs.Dayjs | Date, unit?: OpUnitType) => boolean;
|
|
4
|
+
export declare const isSameArray: (x?: (dayjs.Dayjs | Date)[], y?: (dayjs.Dayjs | Date)[], unit?: OpUnitType) => boolean;
|
package/dist/utils/dayjs.js
CHANGED
|
@@ -26,4 +26,17 @@ export var isSame = function isSame(x, y, unit) {
|
|
|
26
26
|
var _dayjs;
|
|
27
27
|
return Boolean((_dayjs = dayjs(x)) === null || _dayjs === void 0 ? void 0 : _dayjs.isSame(y, unit));
|
|
28
28
|
}
|
|
29
|
+
};
|
|
30
|
+
export var isSameArray = function isSameArray(x, y, unit) {
|
|
31
|
+
var xa = x !== null && x !== void 0 ? x : [];
|
|
32
|
+
var ya = y !== null && y !== void 0 ? y : [];
|
|
33
|
+
if (xa.length === 0 && ya.length === 0) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (xa.length !== ya.length) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return xa.every(function (date, index) {
|
|
40
|
+
return isSame(date, ya[index], unit);
|
|
41
|
+
});
|
|
29
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trionesdev/antd-taro-react",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.14",
|
|
4
4
|
"description": "antd taro react",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@tarojs/components": "^4.1.8",
|
|
59
|
-
"@trionesdev/antd-mobile-base-react": "^0.0.2-beta.
|
|
59
|
+
"@trionesdev/antd-mobile-base-react": "^0.0.2-beta.14",
|
|
60
60
|
"crypto-js": "^4.2.0",
|
|
61
61
|
"dayjs": "^1.11.19",
|
|
62
62
|
"rc-field-form": "^2.7.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
66
|
"@trionesdev/antd-mobile-base-react": "workspace:*",
|
|
67
|
-
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.
|
|
67
|
+
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.14"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5d9e7dbf380ca19c5e35509f0a31865ec5bdcc06"
|
|
70
70
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
export type CalendarDatetimePopupProps = {
|
|
5
|
-
open?: boolean;
|
|
6
|
-
afterOpenChange?: (open: boolean) => void;
|
|
7
|
-
value?: dayjs.Dayjs | Date;
|
|
8
|
-
onOk?: (value?: dayjs.Dayjs) => void;
|
|
9
|
-
onClose?: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const CalendarDatetimePopup: FC<CalendarDatetimePopupProps>;
|