@bifrostui/react 1.3.2 → 1.4.0-beta.1
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/ActionSheet/ActionSheet.css +6 -3
- package/dist/ActionSheet/ActionSheetItem.css +10 -6
- package/dist/Alert/index.css +14 -8
- package/dist/Avatar/Avatar.css +13 -9
- package/dist/Avatar/AvatarGroup.css +15 -8
- package/dist/Backdrop/Backdrop.css +2 -1
- package/dist/Badge/Badge.css +27 -17
- package/dist/Breadcrumb/Breadcrumb.css +34 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/dist/Breadcrumb/Breadcrumb.js +128 -0
- package/dist/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/dist/Breadcrumb/Breadcrumb.types.js +15 -0
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/dist/Breadcrumb/BreadcrumbItem.js +78 -0
- package/dist/Breadcrumb/index.d.ts +4 -0
- package/dist/Breadcrumb/index.js +45 -0
- package/dist/Button/Button.css +37 -25
- package/dist/Calendar/Calendar.css +33 -18
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +38 -17
- package/dist/Calendar/Calendar.types.d.ts +21 -0
- package/dist/Card/CardFooter.css +2 -1
- package/dist/Card/CardHeader.css +3 -1
- package/dist/Checkbox/Checkbox.css +7 -5
- package/dist/CitySelector/CitySelector.css +29 -15
- package/dist/CitySelector/CitySelectorCore.js +25 -16
- package/dist/CitySelector/Selector/index.css +4 -4
- package/dist/Collapse/Collapse.css +6 -0
- package/dist/Collapse/Collapse.d.ts +5 -0
- package/dist/Collapse/Collapse.js +165 -0
- package/dist/Collapse/Collapse.types.d.ts +16 -0
- package/dist/Collapse/Collapse.types.js +15 -0
- package/dist/Collapse/index.d.ts +2 -0
- package/dist/Collapse/index.js +41 -0
- package/dist/CollapsePanel/CollapsePanel.css +32 -0
- package/dist/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/dist/CollapsePanel/CollapsePanel.js +159 -0
- package/dist/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/dist/CollapsePanel/CollapsePanel.types.js +15 -0
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/dist/CollapsePanel/CollapsePanelItem.js +112 -0
- package/dist/CollapsePanel/index.d.ts +4 -0
- package/dist/CollapsePanel/index.js +45 -0
- package/dist/Countdown/Countdown.css +2 -1
- package/dist/Dialog/Dialog.d.ts +2 -2
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/Dialog/Dialog.types.d.ts +12 -1
- package/dist/Dialog/FunctionalDialog.js +38 -2
- package/dist/Dialog/index.css +27 -18
- package/dist/Divider/Divider.css +6 -4
- package/dist/IconButton/IconButton.css +9 -7
- package/dist/Image/index.css +2 -1
- package/dist/Input/Input.css +14 -7
- package/dist/List/List.css +3 -0
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItemContent.css +1 -1
- package/dist/Loading/Loading.css +4 -2
- package/dist/NavBar/NavBar.css +9 -5
- package/dist/Picker/Picker.css +25 -29
- package/dist/Picker/Picker.js +31 -11
- package/dist/Picker/Picker.types.d.ts +4 -0
- package/dist/Picker/PickerPanel.css +8 -8
- package/dist/Picker/PickerPanel.js +14 -8
- package/dist/Picker/utils.d.ts +16 -0
- package/dist/Picker/utils.js +32 -2
- package/dist/Popover/Popover.css +94 -0
- package/dist/Popover/Popover.d.ts +5 -0
- package/dist/Popover/Popover.js +209 -0
- package/dist/Popover/Popover.types.d.ts +58 -0
- package/dist/Popover/Popover.types.js +15 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.js +41 -0
- package/dist/Portal/Portal.types.d.ts +5 -1
- package/dist/Portal/PortalCore.js +8 -1
- package/dist/Progress/Progress.css +9 -7
- package/dist/Radio/Radio.css +5 -4
- package/dist/Rating/Rating.css +8 -4
- package/dist/Select/Select.css +21 -10
- package/dist/Select/Select.js +1 -1
- package/dist/Select/SelectOption.js +3 -0
- package/dist/Skeleton/Skeleton.css +5 -5
- package/dist/Slider/Slider.css +29 -18
- package/dist/Steps/Step.css +13 -13
- package/dist/Steps/Steps.css +14 -7
- package/dist/Swiper/Swiper.css +2 -1
- package/dist/Switch/Switch.css +31 -16
- package/dist/TabBar/TabBar.css +7 -3
- package/dist/TabBar/TabBarItem.css +0 -1
- package/dist/Tabs/Tab.css +6 -10
- package/dist/Tabs/Tabs.css +10 -9
- package/dist/Tag/Tag.css +7 -10
- package/dist/Tag/TagGroup.css +9 -1
- package/dist/TextArea/TextArea.css +23 -13
- package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/dist/ThemeProvider/ThemeProvider.js +91 -0
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/dist/ThemeProvider/ThemeProvider.types.js +27 -0
- package/dist/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/dist/ThemeProvider/hooks/ThemeContext.js +35 -0
- package/dist/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/dist/ThemeProvider/hooks/createTheme.js +55 -0
- package/dist/ThemeProvider/hooks/index.d.ts +4 -0
- package/dist/ThemeProvider/hooks/index.js +43 -0
- package/dist/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/dist/ThemeProvider/hooks/useTheme.js +39 -0
- package/dist/ThemeProvider/index.d.ts +4 -0
- package/dist/ThemeProvider/index.js +45 -0
- package/dist/ThemeProvider/utils/constants.d.ts +38 -0
- package/dist/ThemeProvider/utils/constants.js +65 -0
- package/dist/ThemeProvider/utils/index.d.ts +2 -0
- package/dist/ThemeProvider/utils/index.js +23 -0
- package/dist/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/dist/ThemeProvider/utils/mountTokens.js +123 -0
- package/dist/Toast/FunctionalToast.js +18 -0
- package/dist/Toast/Toast.css +18 -20
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +52 -48
- package/dist/Toast/Toast.types.d.ts +15 -1
- package/dist/Tooltip/Tooltip.css +91 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.js +198 -0
- package/dist/Tooltip/Tooltip.types.d.ts +49 -0
- package/dist/Tooltip/Tooltip.types.js +15 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.js +41 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -1
- package/dist/locales/base.d.ts +40 -0
- package/dist/locales/base.js +15 -0
- package/dist/locales/en-US.d.ts +3 -0
- package/dist/locales/en-US.js +69 -0
- package/dist/locales/hooks/useLocaleText.d.ts +3 -0
- package/dist/locales/hooks/useLocaleText.js +43 -0
- package/dist/locales/index.d.ts +5 -0
- package/dist/locales/index.js +49 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +51 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +51 -0
- package/es/ActionSheet/ActionSheet.css +6 -3
- package/es/ActionSheet/ActionSheetItem.css +10 -6
- package/es/Alert/index.css +14 -8
- package/es/Avatar/Avatar.css +13 -9
- package/es/Avatar/AvatarGroup.css +15 -8
- package/es/Backdrop/Backdrop.css +2 -1
- package/es/Badge/Badge.css +27 -17
- package/es/Breadcrumb/Breadcrumb.css +34 -0
- package/es/Breadcrumb/Breadcrumb.d.ts +5 -0
- package/es/Breadcrumb/Breadcrumb.js +101 -0
- package/es/Breadcrumb/Breadcrumb.types.d.ts +49 -0
- package/es/Breadcrumb/Breadcrumb.types.js +1 -0
- package/es/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/es/Breadcrumb/BreadcrumbItem.js +51 -0
- package/es/Breadcrumb/index.d.ts +4 -0
- package/es/Breadcrumb/index.js +9 -0
- package/es/Button/Button.css +37 -25
- package/es/Calendar/Calendar.css +33 -18
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +38 -17
- package/es/Calendar/Calendar.types.d.ts +21 -0
- package/es/Card/CardFooter.css +2 -1
- package/es/Card/CardHeader.css +3 -1
- package/es/Checkbox/Checkbox.css +7 -5
- package/es/CitySelector/CitySelector.css +29 -15
- package/es/CitySelector/CitySelectorCore.js +25 -16
- package/es/CitySelector/Selector/index.css +4 -4
- package/es/Collapse/Collapse.css +6 -0
- package/es/Collapse/Collapse.d.ts +5 -0
- package/es/Collapse/Collapse.js +144 -0
- package/es/Collapse/Collapse.types.d.ts +16 -0
- package/es/Collapse/Collapse.types.js +1 -0
- package/es/Collapse/index.d.ts +2 -0
- package/es/Collapse/index.js +6 -0
- package/es/CollapsePanel/CollapsePanel.css +32 -0
- package/es/CollapsePanel/CollapsePanel.d.ts +5 -0
- package/es/CollapsePanel/CollapsePanel.js +132 -0
- package/es/CollapsePanel/CollapsePanel.types.d.ts +64 -0
- package/es/CollapsePanel/CollapsePanel.types.js +1 -0
- package/es/CollapsePanel/CollapsePanelItem.d.ts +4 -0
- package/es/CollapsePanel/CollapsePanelItem.js +85 -0
- package/es/CollapsePanel/index.d.ts +4 -0
- package/es/CollapsePanel/index.js +9 -0
- package/es/Countdown/Countdown.css +2 -1
- package/es/Dialog/Dialog.d.ts +2 -2
- package/es/Dialog/Dialog.js +20 -8
- package/es/Dialog/Dialog.types.d.ts +12 -1
- package/es/Dialog/FunctionalDialog.js +38 -2
- package/es/Dialog/index.css +27 -18
- package/es/Divider/Divider.css +6 -4
- package/es/IconButton/IconButton.css +9 -7
- package/es/Image/index.css +2 -1
- package/es/Input/Input.css +14 -7
- package/es/List/List.css +3 -0
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItemContent.css +1 -1
- package/es/Loading/Loading.css +4 -2
- package/es/Modal/Modal.miniapp.d.ts +1 -1
- package/es/NavBar/NavBar.css +9 -5
- package/es/Picker/Picker.css +25 -29
- package/es/Picker/Picker.js +32 -12
- package/es/Picker/Picker.types.d.ts +4 -0
- package/es/Picker/PickerPanel.css +8 -8
- package/es/Picker/PickerPanel.js +14 -8
- package/es/Picker/utils.d.ts +16 -0
- package/es/Picker/utils.js +29 -1
- package/es/Popover/Popover.css +94 -0
- package/es/Popover/Popover.d.ts +5 -0
- package/es/Popover/Popover.js +186 -0
- package/es/Popover/Popover.types.d.ts +58 -0
- package/es/Popover/Popover.types.js +1 -0
- package/es/Popover/index.d.ts +2 -0
- package/es/Popover/index.js +6 -0
- package/es/Portal/Portal.types.d.ts +5 -1
- package/es/Portal/PortalCore.js +8 -1
- package/es/Progress/Progress.css +9 -7
- package/es/Radio/Radio.css +5 -4
- package/es/Rating/Rating.css +8 -4
- package/es/Select/Select.css +21 -10
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectOption.js +3 -0
- package/es/Skeleton/Skeleton.css +5 -5
- package/es/Slider/Slider.css +29 -18
- package/es/Steps/Step.css +13 -13
- package/es/Steps/Steps.css +14 -7
- package/es/Swiper/Swiper.css +2 -1
- package/es/Switch/Switch.css +31 -16
- package/es/TabBar/TabBar.css +7 -3
- package/es/TabBar/TabBarItem.css +0 -1
- package/es/Tabs/Tab.css +6 -10
- package/es/Tabs/Tabs.css +10 -9
- package/es/Tag/Tag.css +7 -10
- package/es/Tag/TagGroup.css +9 -1
- package/es/TextArea/TextArea.css +23 -13
- package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/es/ThemeProvider/ThemeProvider.js +62 -0
- package/es/ThemeProvider/ThemeProvider.types.d.ts +127 -0
- package/es/ThemeProvider/ThemeProvider.types.js +1 -0
- package/es/ThemeProvider/hooks/ThemeContext.d.ts +4 -0
- package/es/ThemeProvider/hooks/ThemeContext.js +6 -0
- package/es/ThemeProvider/hooks/createTheme.d.ts +2 -0
- package/es/ThemeProvider/hooks/createTheme.js +38 -0
- package/es/ThemeProvider/hooks/index.d.ts +4 -0
- package/es/ThemeProvider/hooks/index.js +8 -0
- package/es/ThemeProvider/hooks/useTheme.d.ts +1 -0
- package/es/ThemeProvider/hooks/useTheme.js +10 -0
- package/es/ThemeProvider/index.d.ts +4 -0
- package/es/ThemeProvider/index.js +8 -0
- package/es/ThemeProvider/utils/constants.d.ts +38 -0
- package/es/ThemeProvider/utils/constants.js +40 -0
- package/es/ThemeProvider/utils/index.d.ts +2 -0
- package/es/ThemeProvider/utils/index.js +2 -0
- package/es/ThemeProvider/utils/mountTokens.d.ts +26 -0
- package/es/ThemeProvider/utils/mountTokens.js +88 -0
- package/es/Toast/FunctionalToast.js +18 -0
- package/es/Toast/Toast.css +18 -20
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +53 -49
- package/es/Toast/Toast.types.d.ts +15 -1
- package/es/Tooltip/Tooltip.css +91 -0
- package/es/Tooltip/Tooltip.d.ts +5 -0
- package/es/Tooltip/Tooltip.js +175 -0
- package/es/Tooltip/Tooltip.types.d.ts +49 -0
- package/es/Tooltip/Tooltip.types.js +1 -0
- package/es/Tooltip/index.d.ts +2 -0
- package/es/Tooltip/index.js +6 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/locales/base.d.ts +40 -0
- package/es/locales/base.js +0 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/en-US.js +50 -0
- package/es/locales/hooks/useLocaleText.d.ts +3 -0
- package/es/locales/hooks/useLocaleText.js +26 -0
- package/es/locales/index.d.ts +5 -0
- package/es/locales/index.js +11 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +32 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/locales/zh-TW.js +32 -0
- package/package.json +5 -5
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.bui-breadcrumb {
|
|
2
|
+
--margin: var(--bui-breadcrumb-margin, 0);
|
|
3
|
+
--padding: var(--bui-breadcrumb-padding, 0);
|
|
4
|
+
--color: var(--bui-breadcrumb-color, rgba(0, 0, 0, 0.45));
|
|
5
|
+
--item-separator-margin: var(--bui-breadcrumb-item-separator-margin, 0 8px);
|
|
6
|
+
--list-li-color: var(--bui-breadcrumb-list-li-color, rgba(0, 0, 0, 0.88));
|
|
7
|
+
margin: var(--margin);
|
|
8
|
+
padding: var(--padding);
|
|
9
|
+
color: var(--color);
|
|
10
|
+
list-style: none;
|
|
11
|
+
font-size: var(--bui-text-size-1);
|
|
12
|
+
line-height: var(--bui-line-height);
|
|
13
|
+
}
|
|
14
|
+
.bui-breadcrumb-list {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
margin: var(--margin);
|
|
18
|
+
padding: var(--padding);
|
|
19
|
+
list-style: none;
|
|
20
|
+
}
|
|
21
|
+
.bui-breadcrumb-list a {
|
|
22
|
+
color: var(--color);
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
.bui-breadcrumb-list li:last-child {
|
|
27
|
+
color: var(--list-li-color);
|
|
28
|
+
}
|
|
29
|
+
.bui-breadcrumb-item {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
.bui-breadcrumb-item-separator {
|
|
33
|
+
margin: var(--item-separator-margin);
|
|
34
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BreadcrumbProps } from './Breadcrumb.types';
|
|
3
|
+
import './Breadcrumb.less';
|
|
4
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<BreadcrumbProps<"nav", {}>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import React from "react";
|
|
30
|
+
import clsx from "clsx";
|
|
31
|
+
import BreadcrumbItem from "./BreadcrumbItem";
|
|
32
|
+
import "./Breadcrumb.css";
|
|
33
|
+
const prefixCls = "bui-breadcrumb";
|
|
34
|
+
const Breadcrumb = /* @__PURE__ */ React.forwardRef(
|
|
35
|
+
(props, ref) => {
|
|
36
|
+
const _a = props, {
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
items,
|
|
40
|
+
separator = "/",
|
|
41
|
+
children
|
|
42
|
+
} = _a, others = __objRest(_a, [
|
|
43
|
+
"className",
|
|
44
|
+
"style",
|
|
45
|
+
"items",
|
|
46
|
+
"separator",
|
|
47
|
+
"children"
|
|
48
|
+
]);
|
|
49
|
+
const renderList = () => {
|
|
50
|
+
if (items && items.length > 0) {
|
|
51
|
+
return items.map((item, index) => {
|
|
52
|
+
const _a2 = item, { title } = _a2, otherItemProps = __objRest(_a2, ["title"]);
|
|
53
|
+
const isLast = index === items.length - 1;
|
|
54
|
+
return /* @__PURE__ */ React.createElement(
|
|
55
|
+
BreadcrumbItem,
|
|
56
|
+
__spreadValues({
|
|
57
|
+
key: index,
|
|
58
|
+
separator: isLast ? "" : separator
|
|
59
|
+
}, otherItemProps),
|
|
60
|
+
title
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (children) {
|
|
65
|
+
const childrenLength = React.Children.count(children);
|
|
66
|
+
const enhancedChildren = React.Children.map(
|
|
67
|
+
children,
|
|
68
|
+
(child, index) => {
|
|
69
|
+
if (React.isValidElement(child)) {
|
|
70
|
+
const itemSeparator = child.props.separator || separator;
|
|
71
|
+
const newProps = {
|
|
72
|
+
separator: index === childrenLength - 1 ? "" : itemSeparator
|
|
73
|
+
};
|
|
74
|
+
return React.cloneElement(child, newProps);
|
|
75
|
+
}
|
|
76
|
+
return child;
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
return enhancedChildren;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
};
|
|
83
|
+
if (items == null && children == null) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ React.createElement(
|
|
87
|
+
"nav",
|
|
88
|
+
__spreadValues({
|
|
89
|
+
className: clsx(prefixCls, className),
|
|
90
|
+
style,
|
|
91
|
+
ref
|
|
92
|
+
}, others),
|
|
93
|
+
/* @__PURE__ */ React.createElement("ol", { className: `${prefixCls}-list` }, renderList())
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
Breadcrumb.displayName = "BuiBreadcrumb";
|
|
98
|
+
var Breadcrumb_default = Breadcrumb;
|
|
99
|
+
export {
|
|
100
|
+
Breadcrumb_default as default
|
|
101
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type BreadcrumbItemProps<D extends React.ElementType = 'li', P = {}> = OverrideProps<{
|
|
4
|
+
props: P & {
|
|
5
|
+
/**
|
|
6
|
+
* 分隔符自定义
|
|
7
|
+
*/
|
|
8
|
+
separator?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* body 区域内容
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 点击事件
|
|
15
|
+
*/
|
|
16
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
17
|
+
};
|
|
18
|
+
defaultComponent: D;
|
|
19
|
+
}, D>;
|
|
20
|
+
export type BreadcrumbProps<D extends React.ElementType = 'nav', P = {}> = OverrideProps<{
|
|
21
|
+
props: P & {
|
|
22
|
+
/**
|
|
23
|
+
* 路由栈信息
|
|
24
|
+
*/
|
|
25
|
+
items?: Array<{
|
|
26
|
+
/**
|
|
27
|
+
* 名称
|
|
28
|
+
*/
|
|
29
|
+
title?: string;
|
|
30
|
+
/**
|
|
31
|
+
* 分隔符自定义
|
|
32
|
+
*/
|
|
33
|
+
separator?: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* 点击事件
|
|
36
|
+
*/
|
|
37
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* 分隔符自定义
|
|
41
|
+
*/
|
|
42
|
+
separator?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* body 区域内容,使用 CollapseItem 进行渲染
|
|
45
|
+
*/
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
};
|
|
48
|
+
defaultComponent: D;
|
|
49
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import React from "react";
|
|
30
|
+
import clsx from "clsx";
|
|
31
|
+
const prefixCls = "bui-breadcrumb-item";
|
|
32
|
+
const BreadcrumbItem = /* @__PURE__ */ React.forwardRef(
|
|
33
|
+
(props, ref) => {
|
|
34
|
+
const _a = props, { className, style, separator, children, onClick } = _a, others = __objRest(_a, ["className", "style", "separator", "children", "onClick"]);
|
|
35
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
36
|
+
"li",
|
|
37
|
+
__spreadValues({
|
|
38
|
+
className: clsx(`${prefixCls}`, className),
|
|
39
|
+
style,
|
|
40
|
+
ref,
|
|
41
|
+
onClick
|
|
42
|
+
}, others),
|
|
43
|
+
children
|
|
44
|
+
), separator && /* @__PURE__ */ React.createElement("li", { className: `${prefixCls}-separator` }, separator));
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
BreadcrumbItem.displayName = "BuiBreadcrumbItem";
|
|
48
|
+
var BreadcrumbItem_default = BreadcrumbItem;
|
|
49
|
+
export {
|
|
50
|
+
BreadcrumbItem_default as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as default2 } from "./Breadcrumb";
|
|
2
|
+
import { default as default3 } from "./Breadcrumb";
|
|
3
|
+
import { default as default4 } from "./BreadcrumbItem";
|
|
4
|
+
export * from "./Breadcrumb.types";
|
|
5
|
+
export {
|
|
6
|
+
default3 as Breadcrumb,
|
|
7
|
+
default4 as BreadcrumbItem,
|
|
8
|
+
default2 as default
|
|
9
|
+
};
|
package/es/Button/Button.css
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
.bui-btn {
|
|
2
|
+
--border-radius: var(--bui-button-border-radius, 100px);
|
|
2
3
|
--bg-color: var(--bui-button-default-bg-color, var(--bui-color-neutral-5));
|
|
3
|
-
--text-color: var(--bui-button-text-color, var(--bui-color-fg-muted));
|
|
4
4
|
--border-color: var(--bui-button-border-color, var(--bui-color-neutral-4));
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
|
|
5
|
+
--height: var(--bui-button-height, 27px);
|
|
6
|
+
--icon-start-margin-right: var(--bui-button-icon-start-margin-right, var(--bui-spacing-xs));
|
|
7
|
+
--icon-start-margin-left: var(--bui-button-icon-start-margin-left, var(--bui-spacing-xs));
|
|
8
|
+
--default-border: var(--bui-button-default-border, 1px solid transparent);
|
|
9
|
+
--light-border: var(--bui-button-light-border, 1px solid transparent);
|
|
10
|
+
--outlined-default-border: var(--bui-button-outlined-default-border, 1px solid var(--bui-color-neutral-4));
|
|
11
|
+
--disabled-opacity: var(--bui-button-disabled-opacity, 0.5);
|
|
12
|
+
--small-padding: var(--bui-button-small-padding, 0 11px);
|
|
13
|
+
--small-height: var(--bui-button-small-height, 24px);
|
|
14
|
+
--medium-padding: var(--bui-button-medium-padding, 0 14px);
|
|
15
|
+
--large-padding: var(--bui-button-large-padding, 0 14px);
|
|
16
|
+
--large-height: var(--bui-button-large-height, 33px);
|
|
17
|
+
--full-font-size: var(--bui-button-full-font-size, var(--bui-title-size-4));
|
|
18
|
+
--full-height: var(--bui-button-full-height, 42px);
|
|
19
|
+
border: var(--default-border);
|
|
8
20
|
outline: 0;
|
|
9
21
|
background-color: transparent;
|
|
10
22
|
cursor: pointer;
|
|
11
|
-
color: var(--
|
|
23
|
+
color: var(--bui-color-fg-muted);
|
|
12
24
|
box-sizing: border-box;
|
|
13
25
|
position: relative;
|
|
14
26
|
display: inline-flex;
|
|
@@ -17,9 +29,9 @@
|
|
|
17
29
|
justify-content: center;
|
|
18
30
|
white-space: nowrap;
|
|
19
31
|
font-size: var(--bui-text-size-3);
|
|
20
|
-
font-weight: var(--font-weight);
|
|
32
|
+
font-weight: var(--bui-font-weight-medium);
|
|
21
33
|
border-radius: var(--border-radius);
|
|
22
|
-
height:
|
|
34
|
+
height: var(--height);
|
|
23
35
|
line-height: var(--bui-line-height);
|
|
24
36
|
font-family: var(--bui-font-family);
|
|
25
37
|
}
|
|
@@ -55,36 +67,36 @@
|
|
|
55
67
|
display: inline-flex;
|
|
56
68
|
align-self: center;
|
|
57
69
|
flex-shrink: 0;
|
|
58
|
-
margin-right: var(--
|
|
70
|
+
margin-right: var(--icon-start-margin-right);
|
|
59
71
|
}
|
|
60
72
|
.bui-btn-icon-end {
|
|
61
73
|
display: inline-flex;
|
|
62
74
|
align-self: center;
|
|
63
75
|
flex-shrink: 0;
|
|
64
|
-
margin-left: var(--
|
|
76
|
+
margin-left: var(--icon-start-margin-left);
|
|
65
77
|
}
|
|
66
78
|
.bui-btn-disabled {
|
|
67
79
|
pointer-events: none;
|
|
68
|
-
opacity:
|
|
80
|
+
opacity: var(--disabled-opacity);
|
|
69
81
|
}
|
|
70
82
|
.bui-btn-small {
|
|
71
83
|
font-size: var(--bui-text-size-4);
|
|
72
|
-
padding:
|
|
73
|
-
height:
|
|
84
|
+
padding: var(--small-padding);
|
|
85
|
+
height: var(--small-height);
|
|
74
86
|
}
|
|
75
87
|
.bui-btn-medium {
|
|
76
|
-
padding:
|
|
77
|
-
height:
|
|
88
|
+
padding: var(--medium-padding);
|
|
89
|
+
height: var(--height);
|
|
78
90
|
}
|
|
79
91
|
.bui-btn-large {
|
|
80
92
|
font-size: var(--bui-text-size-2);
|
|
81
|
-
padding:
|
|
82
|
-
height:
|
|
93
|
+
padding: var(--large-padding);
|
|
94
|
+
height: var(--large-height);
|
|
83
95
|
}
|
|
84
96
|
.bui-btn-full {
|
|
85
|
-
font-size: var(--
|
|
97
|
+
font-size: var(--full-font-size);
|
|
86
98
|
width: 100%;
|
|
87
|
-
height:
|
|
99
|
+
height: var(--full-height);
|
|
88
100
|
}
|
|
89
101
|
.bui-btn-text.bui-btn-primary {
|
|
90
102
|
color: var(--bui-color-primary);
|
|
@@ -156,7 +168,7 @@
|
|
|
156
168
|
var(--bui-color-vip-end) 100%);
|
|
157
169
|
}
|
|
158
170
|
.bui-btn-outlined {
|
|
159
|
-
border:
|
|
171
|
+
border: var(--outlined-default-border);
|
|
160
172
|
}
|
|
161
173
|
.bui-btn-outlined.bui-btn-primary {
|
|
162
174
|
color: var(--bui-color-primary);
|
|
@@ -185,35 +197,35 @@
|
|
|
185
197
|
.bui-btn-light {
|
|
186
198
|
background-image: none;
|
|
187
199
|
background-color: var(--bui-color-gray-light);
|
|
188
|
-
border:
|
|
200
|
+
border: var(--light-border);
|
|
189
201
|
}
|
|
190
202
|
.bui-btn-light.bui-btn-warning {
|
|
191
203
|
background-image: none;
|
|
192
|
-
border:
|
|
204
|
+
border: var(--light-border);
|
|
193
205
|
color: var(--bui-color-warning);
|
|
194
206
|
background-color: var(--bui-color-warning-light);
|
|
195
207
|
}
|
|
196
208
|
.bui-btn-light.bui-btn-primary {
|
|
197
209
|
background-image: none;
|
|
198
|
-
border:
|
|
210
|
+
border: var(--light-border);
|
|
199
211
|
color: var(--bui-color-primary);
|
|
200
212
|
background-color: var(--bui-color-primary-light);
|
|
201
213
|
}
|
|
202
214
|
.bui-btn-light.bui-btn-info {
|
|
203
215
|
background-image: none;
|
|
204
|
-
border:
|
|
216
|
+
border: var(--light-border);
|
|
205
217
|
color: var(--bui-color-info);
|
|
206
218
|
background-color: var(--bui-color-info-light);
|
|
207
219
|
}
|
|
208
220
|
.bui-btn-light.bui-btn-success {
|
|
209
221
|
background-image: none;
|
|
210
|
-
border:
|
|
222
|
+
border: var(--light-border);
|
|
211
223
|
color: var(--bui-color-success);
|
|
212
224
|
background-color: var(--bui-color-success-light);
|
|
213
225
|
}
|
|
214
226
|
.bui-btn-light.bui-btn-danger {
|
|
215
227
|
background-image: none;
|
|
216
|
-
border:
|
|
228
|
+
border: var(--light-border);
|
|
217
229
|
color: var(--bui-color-danger);
|
|
218
230
|
background-color: var(--bui-color-danger-light);
|
|
219
231
|
}
|
package/es/Calendar/Calendar.css
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
.bui-calendar {
|
|
2
|
+
--padding: var(--bui-calendar-padding, 6px 12px 7px);
|
|
3
|
+
--week-height: var(--bui-calendar-week-height, 30px);
|
|
4
|
+
--handler-height: var(--bui-calendar-handler-height, 28px);
|
|
5
|
+
--handler-margin-bottom: var(--bui-calendar-handler-margin-bottom, 7px);
|
|
6
|
+
--handler-text-width: var(--bui-calendar-handler-text-width, 80px);
|
|
7
|
+
--handler-btn-width: var(--bui-calendar-handler-btn-width, 46px);
|
|
8
|
+
--handler-btn-height: var(--bui-calendar-handler-btn-height, 100%);
|
|
9
|
+
--handler-btn-icon-font-size: var(--bui-calendar-handler-btn-icon-font-size, 28px);
|
|
10
|
+
--day-box-height: var(--bui-calendar-day-box-height, 30px);
|
|
11
|
+
--day-box-margin-bottom: var(--bui-calendar-day-box-margin-bottom, 7px);
|
|
12
|
+
--day-disabled-color: var(--bui-calendar-day-disabled-color, #9c9ca5);
|
|
13
|
+
--middle-color: var(--bui-calendar-middle-color, #000);
|
|
14
|
+
--middle-background-color: var(--bui-calendar-middle-background-color, #ffeaf1);
|
|
15
|
+
--range-both-ends-color: var(--bui-calendar-range-both-ends-color, #000);
|
|
16
|
+
--range-both-ends-background-color: var(--bui-calendar-range-both-ends-background-color, #ffc7da);
|
|
2
17
|
overflow: hidden;
|
|
3
18
|
display: flex;
|
|
4
19
|
flex-direction: column;
|
|
@@ -6,11 +21,11 @@
|
|
|
6
21
|
position: relative;
|
|
7
22
|
width: 100%;
|
|
8
23
|
box-sizing: border-box;
|
|
9
|
-
padding:
|
|
24
|
+
padding: var(--padding);
|
|
10
25
|
font-family: var(--bui-font-family);
|
|
11
26
|
}
|
|
12
27
|
.bui-calendar-week {
|
|
13
|
-
height:
|
|
28
|
+
height: var(--week-height);
|
|
14
29
|
font-size: var(--bui-text-size-2);
|
|
15
30
|
font-weight: var(--bui-font-weight-medium);
|
|
16
31
|
color: var(--bui-color-fg-default);
|
|
@@ -29,29 +44,29 @@
|
|
|
29
44
|
color: var(--bui-color-primary);
|
|
30
45
|
}
|
|
31
46
|
.bui-calendar-handler {
|
|
32
|
-
height:
|
|
47
|
+
height: var(--handler-height);
|
|
33
48
|
display: flex;
|
|
34
49
|
align-items: center;
|
|
35
50
|
justify-content: center;
|
|
36
|
-
margin-bottom:
|
|
51
|
+
margin-bottom: var(--handler-margin-bottom);
|
|
37
52
|
}
|
|
38
53
|
.bui-calendar-handler-text {
|
|
39
|
-
width:
|
|
54
|
+
width: var(--handler-text-width);
|
|
40
55
|
font-size: var(--bui-title-size-3);
|
|
41
56
|
font-weight: var(--bui-font-weight-medium);
|
|
42
57
|
text-align: center;
|
|
43
58
|
}
|
|
44
59
|
.bui-calendar-handler-btn {
|
|
45
60
|
font-size: 16px;
|
|
46
|
-
height:
|
|
47
|
-
width:
|
|
61
|
+
height: var(--handler-btn-height);
|
|
62
|
+
width: var(--handler-btn-width);
|
|
48
63
|
cursor: pointer;
|
|
49
64
|
display: flex;
|
|
50
65
|
align-items: center;
|
|
51
66
|
justify-content: center;
|
|
52
67
|
}
|
|
53
68
|
.bui-calendar-handler-btn-icon {
|
|
54
|
-
font-size:
|
|
69
|
+
font-size: var(--handler-btn-icon-font-size);
|
|
55
70
|
}
|
|
56
71
|
.bui-calendar-month {
|
|
57
72
|
display: flex;
|
|
@@ -60,8 +75,8 @@
|
|
|
60
75
|
}
|
|
61
76
|
.bui-calendar-day-box {
|
|
62
77
|
width: 14.28%;
|
|
63
|
-
height:
|
|
64
|
-
margin-bottom:
|
|
78
|
+
height: var(--day-box-height);
|
|
79
|
+
margin-bottom: var(--day-box-margin-bottom);
|
|
65
80
|
}
|
|
66
81
|
.bui-calendar-highlight-day .bui-calendar-day {
|
|
67
82
|
color: var(--bui-color-primary);
|
|
@@ -72,34 +87,34 @@
|
|
|
72
87
|
display: flex;
|
|
73
88
|
align-items: center;
|
|
74
89
|
justify-content: center;
|
|
75
|
-
border-radius:
|
|
90
|
+
border-radius: var(--bui-shape-radius-default);
|
|
76
91
|
font-size: var(--bui-title-size-4);
|
|
77
92
|
font-weight: var(--bui-font-weight-medium);
|
|
78
93
|
color: var(--bui-color-fg-default);
|
|
79
94
|
cursor: pointer;
|
|
80
95
|
}
|
|
81
96
|
.bui-calendar-day.bui-calendar-disabled {
|
|
82
|
-
color:
|
|
97
|
+
color: var(--day-disabled-color);
|
|
83
98
|
}
|
|
84
99
|
.bui-calendar-today {
|
|
85
100
|
color: var(--bui-color-primary);
|
|
86
101
|
}
|
|
87
102
|
.bui-calendar-middle {
|
|
88
|
-
color:
|
|
103
|
+
color: var(--middle-color);
|
|
89
104
|
border-radius: 0;
|
|
90
|
-
background-color:
|
|
105
|
+
background-color: var(--middle-background-color);
|
|
91
106
|
}
|
|
92
107
|
.bui-calendar-start {
|
|
93
|
-
color:
|
|
94
|
-
background-color:
|
|
108
|
+
color: var(--range-both-ends-color);
|
|
109
|
+
background-color: var(--range-both-ends-background-color);
|
|
95
110
|
}
|
|
96
111
|
.bui-calendar-range {
|
|
97
112
|
border-top-right-radius: 0;
|
|
98
113
|
border-bottom-right-radius: 0;
|
|
99
114
|
}
|
|
100
115
|
.bui-calendar-end {
|
|
101
|
-
color:
|
|
102
|
-
background-color:
|
|
116
|
+
color: var(--range-both-ends-color);
|
|
117
|
+
background-color: var(--range-both-ends-background-color);
|
|
103
118
|
border-top-left-radius: 0;
|
|
104
119
|
border-bottom-left-radius: 0;
|
|
105
120
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './Calendar.less';
|
|
3
2
|
import { CalendarProps } from './Calendar.types';
|
|
3
|
+
import './Calendar.less';
|
|
4
4
|
declare const Calendar: React.ForwardRefExoticComponent<Omit<CalendarProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Calendar;
|
package/es/Calendar/Calendar.js
CHANGED
|
@@ -40,11 +40,11 @@ import React, {
|
|
|
40
40
|
useMemo,
|
|
41
41
|
useState
|
|
42
42
|
} from "react";
|
|
43
|
-
import "./Calendar.css";
|
|
44
43
|
import { formatDate, isRange, isSame } from "./utils";
|
|
44
|
+
import { useLocaleText } from "../locales";
|
|
45
|
+
import "./Calendar.css";
|
|
45
46
|
const Picker = lazy(() => import("../Picker"));
|
|
46
47
|
dayjs.extend(isoWeek);
|
|
47
|
-
const SUNDAY_WEEK_DATA = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
48
48
|
const classes = {
|
|
49
49
|
root: "bui-calendar",
|
|
50
50
|
handler: "bui-calendar-handler",
|
|
@@ -62,6 +62,9 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
62
62
|
maxDate,
|
|
63
63
|
mode,
|
|
64
64
|
hideDaysOutsideCurrentMonth,
|
|
65
|
+
headerBarFormat,
|
|
66
|
+
headerBarLeftIcon,
|
|
67
|
+
headerBarRightIcon,
|
|
65
68
|
disabledDate,
|
|
66
69
|
enableSelectYear,
|
|
67
70
|
highlightDate,
|
|
@@ -78,6 +81,9 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
78
81
|
"maxDate",
|
|
79
82
|
"mode",
|
|
80
83
|
"hideDaysOutsideCurrentMonth",
|
|
84
|
+
"headerBarFormat",
|
|
85
|
+
"headerBarLeftIcon",
|
|
86
|
+
"headerBarRightIcon",
|
|
81
87
|
"disabledDate",
|
|
82
88
|
"enableSelectYear",
|
|
83
89
|
"highlightDate",
|
|
@@ -87,6 +93,16 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
87
93
|
"onYearChange",
|
|
88
94
|
"onChange"
|
|
89
95
|
]);
|
|
96
|
+
const { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } = useLocaleText("calendar");
|
|
97
|
+
const SUNDAY_WEEK_DATA = [
|
|
98
|
+
Sunday,
|
|
99
|
+
Monday,
|
|
100
|
+
Tuesday,
|
|
101
|
+
Wednesday,
|
|
102
|
+
Thursday,
|
|
103
|
+
Friday,
|
|
104
|
+
Saturday
|
|
105
|
+
];
|
|
90
106
|
const isRangeMode = mode === "range";
|
|
91
107
|
const formattedValue = formatDate(mode, value, minDate, maxDate);
|
|
92
108
|
const formattedDefaultValue = formatDate(
|
|
@@ -113,6 +129,22 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
113
129
|
}, [calendarValue]);
|
|
114
130
|
const isMinMonth = dayjs(minDate).isSame(renderMonth, "month");
|
|
115
131
|
const isMaxMonth = dayjs(maxDate).isSame(renderMonth, "month");
|
|
132
|
+
const headerBarIcon = {
|
|
133
|
+
left: headerBarLeftIcon ? headerBarLeftIcon({ isMinMonth }) : /* @__PURE__ */ React.createElement(
|
|
134
|
+
CaretLeftIcon,
|
|
135
|
+
{
|
|
136
|
+
className: `${classes.handler}-btn-icon`,
|
|
137
|
+
htmlColor: isMinMonth && "#cccccc"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
right: headerBarRightIcon ? headerBarRightIcon({ isMaxMonth }) : /* @__PURE__ */ React.createElement(
|
|
141
|
+
CaretRightIcon,
|
|
142
|
+
{
|
|
143
|
+
className: `${classes.handler}-btn-icon`,
|
|
144
|
+
htmlColor: isMaxMonth && "#cccccc"
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
};
|
|
116
148
|
useDidMountEffect(() => {
|
|
117
149
|
const initMonth = formattedValue === void 0 ? formattedDefaultValue == null ? void 0 : formattedDefaultValue[0] : formattedValue == null ? void 0 : formattedValue[0];
|
|
118
150
|
setRenderMonth(dayjs(initMonth || minDate).toDate());
|
|
@@ -249,7 +281,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
249
281
|
setRenderMonth(month);
|
|
250
282
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
251
283
|
type: "prev",
|
|
252
|
-
month: dayjs(month).format(
|
|
284
|
+
month: dayjs(month).format(headerBarFormat)
|
|
253
285
|
});
|
|
254
286
|
}
|
|
255
287
|
};
|
|
@@ -259,7 +291,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
259
291
|
setRenderMonth(month);
|
|
260
292
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
261
293
|
type: "next",
|
|
262
|
-
month: dayjs(month).format(
|
|
294
|
+
month: dayjs(month).format(headerBarFormat)
|
|
263
295
|
});
|
|
264
296
|
}
|
|
265
297
|
};
|
|
@@ -301,19 +333,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
301
333
|
}, others), {
|
|
302
334
|
"data-mode": mode
|
|
303
335
|
}), data),
|
|
304
|
-
/* @__PURE__ */ React.createElement("div", { className: classes.handler }, /* @__PURE__ */ React.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` }, /* @__PURE__ */ React.createElement(
|
|
305
|
-
CaretLeftIcon,
|
|
306
|
-
{
|
|
307
|
-
className: `${classes.handler}-btn-icon`,
|
|
308
|
-
htmlColor: isMinMonth && "#cccccc"
|
|
309
|
-
}
|
|
310
|
-
)), /* @__PURE__ */ React.createElement("div", { className: `${classes.handler}-text`, onClick: onClickDate }, dayjs(renderMonth).format("YYYY/MM")), /* @__PURE__ */ React.createElement("div", { onClick: onClickNext, className: `${classes.handler}-btn` }, /* @__PURE__ */ React.createElement(
|
|
311
|
-
CaretRightIcon,
|
|
312
|
-
{
|
|
313
|
-
className: `${classes.handler}-btn-icon`,
|
|
314
|
-
htmlColor: isMaxMonth && "#cccccc"
|
|
315
|
-
}
|
|
316
|
-
))),
|
|
336
|
+
/* @__PURE__ */ React.createElement("div", { className: classes.handler }, /* @__PURE__ */ React.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` }, headerBarIcon.left), /* @__PURE__ */ React.createElement("div", { className: `${classes.handler}-text`, onClick: onClickDate }, dayjs(renderMonth).format(headerBarFormat)), /* @__PURE__ */ React.createElement("div", { onClick: onClickNext, className: `${classes.handler}-btn` }, headerBarIcon.right)),
|
|
317
337
|
/* @__PURE__ */ React.createElement("div", { className: classes.week }, SUNDAY_WEEK_DATA == null ? void 0 : SUNDAY_WEEK_DATA.map((w) => {
|
|
318
338
|
return weekRender ? weekRender(w) : /* @__PURE__ */ React.createElement("div", { key: w, className: `${classes.week}-item` }, w);
|
|
319
339
|
})),
|
|
@@ -333,6 +353,7 @@ const Calendar = /* @__PURE__ */ React.forwardRef(
|
|
|
333
353
|
Calendar.displayName = "BuiCalendar";
|
|
334
354
|
Calendar.defaultProps = {
|
|
335
355
|
hideDaysOutsideCurrentMonth: false,
|
|
356
|
+
headerBarFormat: "YYYY/MM",
|
|
336
357
|
enableSelectYear: false,
|
|
337
358
|
mode: "single",
|
|
338
359
|
minDate: dayjs(dayjs().format("YYYYMMDD")).add(0, "month").toDate(),
|