@bifrostui/react 1.2.9-beta.0 → 1.3.1-beta.0
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 +26 -17
- package/dist/Calendar/Calendar.css +33 -18
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +85 -18
- package/dist/Calendar/Calendar.types.d.ts +33 -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/Countdown/Countdown.js +3 -0
- package/dist/Dialog/Dialog.d.ts +5 -0
- package/dist/Dialog/Dialog.js +152 -0
- package/dist/Dialog/Dialog.types.d.ts +109 -0
- package/dist/Dialog/Dialog.types.js +15 -0
- package/dist/Dialog/FunctionalDialog.d.ts +3 -0
- package/dist/Dialog/FunctionalDialog.js +204 -0
- package/dist/Dialog/index.css +75 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/Dialog/index.js +41 -0
- 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 +10 -5
- 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/Modal/Modal.miniapp.d.ts +1 -1
- 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 +97 -0
- package/dist/Popover/Popover.d.ts +5 -0
- package/dist/Popover/Popover.js +186 -0
- package/dist/Popover/Popover.types.d.ts +60 -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 +4 -0
- package/dist/Portal/PortalCore.js +8 -1
- package/dist/Progress/Progress.css +8 -6
- package/dist/Radio/Radio.css +2 -1
- package/dist/Radio/Radio.js +1 -1
- package/dist/Radio/RadioButtonIcon.d.ts +1 -6
- package/dist/Radio/RadioButtonIcon.js +0 -3
- 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 +3 -2
- package/dist/Slider/Slider.css +24 -13
- package/dist/Steps/Step.css +11 -11
- package/dist/Steps/Steps.css +14 -5
- 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 +2 -6
- package/dist/Tabs/Tabs.css +7 -4
- package/dist/Tag/Tag.css +7 -10
- package/dist/Tag/TagGroup.css +9 -1
- package/dist/TextArea/TextArea.css +14 -8
- package/dist/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/dist/ThemeProvider/ThemeProvider.js +90 -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.d.ts +3 -0
- package/dist/Toast/FunctionalToast.js +177 -0
- package/dist/Toast/Toast.css +56 -0
- package/dist/Toast/Toast.d.ts +5 -0
- package/dist/Toast/Toast.js +121 -0
- package/dist/Toast/Toast.types.d.ts +101 -0
- package/dist/Toast/Toast.types.js +15 -0
- package/dist/Toast/index.d.ts +2 -0
- package/dist/Toast/index.js +41 -0
- package/dist/Tooltip/Tooltip.css +91 -0
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.js +177 -0
- package/dist/Tooltip/Tooltip.types.d.ts +51 -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/Transition/Transition.miniapp.js +7 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +19 -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 +26 -17
- package/es/Calendar/Calendar.css +33 -18
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +91 -19
- package/es/Calendar/Calendar.types.d.ts +33 -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/Countdown/Countdown.js +3 -0
- package/es/Dialog/Dialog.d.ts +5 -0
- package/es/Dialog/Dialog.js +125 -0
- package/es/Dialog/Dialog.types.d.ts +109 -0
- package/es/Dialog/Dialog.types.js +1 -0
- package/es/Dialog/FunctionalDialog.d.ts +3 -0
- package/es/Dialog/FunctionalDialog.js +177 -0
- package/es/Dialog/index.css +75 -0
- package/es/Dialog/index.d.ts +2 -0
- package/es/Dialog/index.js +6 -0
- 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 +10 -5
- 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 +97 -0
- package/es/Popover/Popover.d.ts +5 -0
- package/es/Popover/Popover.js +159 -0
- package/es/Popover/Popover.types.d.ts +60 -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 +4 -0
- package/es/Portal/PortalCore.js +8 -1
- package/es/Progress/Progress.css +8 -6
- package/es/Radio/Radio.css +2 -1
- package/es/Radio/Radio.js +1 -1
- package/es/Radio/RadioButtonIcon.d.ts +1 -6
- package/es/Radio/RadioButtonIcon.js +0 -3
- 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 +3 -2
- package/es/Slider/Slider.css +24 -13
- package/es/Steps/Step.css +11 -11
- package/es/Steps/Steps.css +14 -5
- 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 +2 -6
- package/es/Tabs/Tabs.css +7 -4
- package/es/Tag/Tag.css +7 -10
- package/es/Tag/TagGroup.css +9 -1
- package/es/TextArea/TextArea.css +14 -8
- package/es/ThemeProvider/ThemeProvider.d.ts +4 -0
- package/es/ThemeProvider/ThemeProvider.js +61 -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.d.ts +3 -0
- package/es/Toast/FunctionalToast.js +150 -0
- package/es/Toast/Toast.css +56 -0
- package/es/Toast/Toast.d.ts +5 -0
- package/es/Toast/Toast.js +99 -0
- package/es/Toast/Toast.types.d.ts +101 -0
- package/es/Toast/Toast.types.js +1 -0
- package/es/Toast/index.d.ts +2 -0
- package/es/Toast/index.js +6 -0
- package/es/Tooltip/Tooltip.css +91 -0
- package/es/Tooltip/Tooltip.d.ts +5 -0
- package/es/Tooltip/Tooltip.js +150 -0
- package/es/Tooltip/Tooltip.types.d.ts +51 -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/Transition/Transition.miniapp.js +7 -1
- package/es/index.d.ts +9 -0
- package/es/index.js +9 -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,45 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Breadcrumb_exports = {};
|
|
30
|
+
__export(Breadcrumb_exports, {
|
|
31
|
+
Breadcrumb: () => import_Breadcrumb2.default,
|
|
32
|
+
BreadcrumbItem: () => import_BreadcrumbItem.default,
|
|
33
|
+
default: () => import_Breadcrumb.default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Breadcrumb_exports);
|
|
36
|
+
var import_Breadcrumb = __toESM(require("./Breadcrumb"));
|
|
37
|
+
var import_Breadcrumb2 = __toESM(require("./Breadcrumb"));
|
|
38
|
+
var import_BreadcrumbItem = __toESM(require("./BreadcrumbItem"));
|
|
39
|
+
__reExport(Breadcrumb_exports, require("./Breadcrumb.types"), module.exports);
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
Breadcrumb,
|
|
43
|
+
BreadcrumbItem,
|
|
44
|
+
...require("./Breadcrumb.types")
|
|
45
|
+
});
|
package/dist/Button/Button.css
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
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
|
-
--
|
|
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
|
+
--disabled-opacity: var(--bui-button-disabled-opacity, 0.5);
|
|
9
|
+
--small-padding: var(--bui-button-small-padding, 0 11px);
|
|
10
|
+
--small-height: var(--bui-button-small-height, 24px);
|
|
11
|
+
--medium-padding: var(--bui-button-medium-padding, 0 14px);
|
|
12
|
+
--large-padding: var(--bui-button-large-padding, 0 14px);
|
|
13
|
+
--large-height: var(--bui-button-large-height, 33px);
|
|
14
|
+
--full-font-size: var(--bui-button-full-font-size, var(--bui-title-size-4));
|
|
15
|
+
--full-height: var(--bui-button-full-height, 42px);
|
|
7
16
|
border: 1px solid transparent;
|
|
8
17
|
outline: 0;
|
|
9
18
|
background-color: transparent;
|
|
10
19
|
cursor: pointer;
|
|
11
|
-
color: var(--
|
|
20
|
+
color: var(--bui-color-fg-muted);
|
|
12
21
|
box-sizing: border-box;
|
|
13
22
|
position: relative;
|
|
14
23
|
display: inline-flex;
|
|
@@ -17,9 +26,9 @@
|
|
|
17
26
|
justify-content: center;
|
|
18
27
|
white-space: nowrap;
|
|
19
28
|
font-size: var(--bui-text-size-3);
|
|
20
|
-
font-weight: var(--font-weight);
|
|
29
|
+
font-weight: var(--bui-font-weight-medium);
|
|
21
30
|
border-radius: var(--border-radius);
|
|
22
|
-
height:
|
|
31
|
+
height: var(--height);
|
|
23
32
|
line-height: var(--bui-line-height);
|
|
24
33
|
font-family: var(--bui-font-family);
|
|
25
34
|
}
|
|
@@ -55,36 +64,36 @@
|
|
|
55
64
|
display: inline-flex;
|
|
56
65
|
align-self: center;
|
|
57
66
|
flex-shrink: 0;
|
|
58
|
-
margin-right: var(--
|
|
67
|
+
margin-right: var(--icon-start-margin-right);
|
|
59
68
|
}
|
|
60
69
|
.bui-btn-icon-end {
|
|
61
70
|
display: inline-flex;
|
|
62
71
|
align-self: center;
|
|
63
72
|
flex-shrink: 0;
|
|
64
|
-
margin-left: var(--
|
|
73
|
+
margin-left: var(--icon-start-margin-left);
|
|
65
74
|
}
|
|
66
75
|
.bui-btn-disabled {
|
|
67
76
|
pointer-events: none;
|
|
68
|
-
opacity:
|
|
77
|
+
opacity: var(--disabled-opacity);
|
|
69
78
|
}
|
|
70
79
|
.bui-btn-small {
|
|
71
80
|
font-size: var(--bui-text-size-4);
|
|
72
|
-
padding:
|
|
73
|
-
height:
|
|
81
|
+
padding: var(--small-padding);
|
|
82
|
+
height: var(--small-height);
|
|
74
83
|
}
|
|
75
84
|
.bui-btn-medium {
|
|
76
|
-
padding:
|
|
77
|
-
height:
|
|
85
|
+
padding: var(--medium-padding);
|
|
86
|
+
height: var(--height);
|
|
78
87
|
}
|
|
79
88
|
.bui-btn-large {
|
|
80
89
|
font-size: var(--bui-text-size-2);
|
|
81
|
-
padding:
|
|
82
|
-
height:
|
|
90
|
+
padding: var(--large-padding);
|
|
91
|
+
height: var(--large-height);
|
|
83
92
|
}
|
|
84
93
|
.bui-btn-full {
|
|
85
|
-
font-size: var(--
|
|
94
|
+
font-size: var(--full-font-size);
|
|
86
95
|
width: 100%;
|
|
87
|
-
height:
|
|
96
|
+
height: var(--full-height);
|
|
88
97
|
}
|
|
89
98
|
.bui-btn-text.bui-btn-primary {
|
|
90
99
|
color: var(--bui-color-primary);
|
|
@@ -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;
|
|
@@ -65,10 +65,11 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
65
65
|
var import_dayjs = __toESM(require("dayjs"));
|
|
66
66
|
var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"));
|
|
67
67
|
var import_react = __toESM(require("react"));
|
|
68
|
-
var import_Calendar = require("./Calendar.css");
|
|
69
68
|
var import_utils2 = require("./utils");
|
|
69
|
+
var import_locales = require("../locales");
|
|
70
|
+
var import_Calendar2 = require("./Calendar.css");
|
|
71
|
+
const Picker = (0, import_react.lazy)(() => import("../Picker"));
|
|
70
72
|
import_dayjs.default.extend(import_isoWeek.default);
|
|
71
|
-
const SUNDAY_WEEK_DATA = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
72
73
|
const classes = {
|
|
73
74
|
root: "bui-calendar",
|
|
74
75
|
handler: "bui-calendar-handler",
|
|
@@ -86,11 +87,16 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
86
87
|
maxDate,
|
|
87
88
|
mode,
|
|
88
89
|
hideDaysOutsideCurrentMonth,
|
|
90
|
+
headerBarFormat,
|
|
91
|
+
headerBarLeftIcon,
|
|
92
|
+
headerBarRightIcon,
|
|
89
93
|
disabledDate,
|
|
94
|
+
enableSelectYear,
|
|
90
95
|
highlightDate,
|
|
91
96
|
dateRender,
|
|
92
97
|
weekRender,
|
|
93
98
|
onMonthChange,
|
|
99
|
+
onYearChange,
|
|
94
100
|
onChange
|
|
95
101
|
} = _a, others = __objRest(_a, [
|
|
96
102
|
"className",
|
|
@@ -100,13 +106,28 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
100
106
|
"maxDate",
|
|
101
107
|
"mode",
|
|
102
108
|
"hideDaysOutsideCurrentMonth",
|
|
109
|
+
"headerBarFormat",
|
|
110
|
+
"headerBarLeftIcon",
|
|
111
|
+
"headerBarRightIcon",
|
|
103
112
|
"disabledDate",
|
|
113
|
+
"enableSelectYear",
|
|
104
114
|
"highlightDate",
|
|
105
115
|
"dateRender",
|
|
106
116
|
"weekRender",
|
|
107
117
|
"onMonthChange",
|
|
118
|
+
"onYearChange",
|
|
108
119
|
"onChange"
|
|
109
120
|
]);
|
|
121
|
+
const { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } = (0, import_locales.useLocaleText)("calendar");
|
|
122
|
+
const SUNDAY_WEEK_DATA = [
|
|
123
|
+
Sunday,
|
|
124
|
+
Monday,
|
|
125
|
+
Tuesday,
|
|
126
|
+
Wednesday,
|
|
127
|
+
Thursday,
|
|
128
|
+
Friday,
|
|
129
|
+
Saturday
|
|
130
|
+
];
|
|
110
131
|
const isRangeMode = mode === "range";
|
|
111
132
|
const formattedValue = (0, import_utils2.formatDate)(mode, value, minDate, maxDate);
|
|
112
133
|
const formattedDefaultValue = (0, import_utils2.formatDate)(
|
|
@@ -115,6 +136,7 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
115
136
|
minDate,
|
|
116
137
|
maxDate
|
|
117
138
|
);
|
|
139
|
+
const [openPicker, setOpenPicker] = (0, import_react.useState)(false);
|
|
118
140
|
const [renderMonth, setRenderMonth] = (0, import_react.useState)(() => {
|
|
119
141
|
const initMonth = formattedValue === void 0 ? formattedDefaultValue == null ? void 0 : formattedDefaultValue[0] : formattedValue == null ? void 0 : formattedValue[0];
|
|
120
142
|
return (0, import_dayjs.default)(initMonth || minDate).toDate();
|
|
@@ -132,6 +154,22 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
132
154
|
}, [calendarValue]);
|
|
133
155
|
const isMinMonth = (0, import_dayjs.default)(minDate).isSame(renderMonth, "month");
|
|
134
156
|
const isMaxMonth = (0, import_dayjs.default)(maxDate).isSame(renderMonth, "month");
|
|
157
|
+
const headerBarIcon = {
|
|
158
|
+
left: headerBarLeftIcon ? headerBarLeftIcon({ isMinMonth }) : /* @__PURE__ */ import_react.default.createElement(
|
|
159
|
+
import_icons.CaretLeftIcon,
|
|
160
|
+
{
|
|
161
|
+
className: `${classes.handler}-btn-icon`,
|
|
162
|
+
htmlColor: isMinMonth && "#cccccc"
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
right: headerBarRightIcon ? headerBarRightIcon({ isMaxMonth }) : /* @__PURE__ */ import_react.default.createElement(
|
|
166
|
+
import_icons.CaretRightIcon,
|
|
167
|
+
{
|
|
168
|
+
className: `${classes.handler}-btn-icon`,
|
|
169
|
+
htmlColor: isMaxMonth && "#cccccc"
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
};
|
|
135
173
|
(0, import_utils.useDidMountEffect)(() => {
|
|
136
174
|
const initMonth = formattedValue === void 0 ? formattedDefaultValue == null ? void 0 : formattedDefaultValue[0] : formattedValue == null ? void 0 : formattedValue[0];
|
|
137
175
|
setRenderMonth((0, import_dayjs.default)(initMonth || minDate).toDate());
|
|
@@ -177,6 +215,19 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
177
215
|
});
|
|
178
216
|
return list;
|
|
179
217
|
};
|
|
218
|
+
const getYearsList = () => {
|
|
219
|
+
const result = [];
|
|
220
|
+
let startTime = new Date(minDate).getFullYear();
|
|
221
|
+
const endTime = new Date(maxDate).getFullYear();
|
|
222
|
+
while (endTime - startTime >= 0) {
|
|
223
|
+
result.push({
|
|
224
|
+
label: startTime,
|
|
225
|
+
value: startTime
|
|
226
|
+
});
|
|
227
|
+
startTime += 1;
|
|
228
|
+
}
|
|
229
|
+
return result;
|
|
230
|
+
};
|
|
180
231
|
const getDayClassName = ({ day: itemDate, disabled }) => {
|
|
181
232
|
let result = "";
|
|
182
233
|
if (disabled)
|
|
@@ -255,7 +306,7 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
255
306
|
setRenderMonth(month);
|
|
256
307
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
257
308
|
type: "prev",
|
|
258
|
-
month: (0, import_dayjs.default)(month).format(
|
|
309
|
+
month: (0, import_dayjs.default)(month).format(headerBarFormat)
|
|
259
310
|
});
|
|
260
311
|
}
|
|
261
312
|
};
|
|
@@ -265,10 +316,27 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
265
316
|
setRenderMonth(month);
|
|
266
317
|
onMonthChange == null ? void 0 : onMonthChange(e, {
|
|
267
318
|
type: "next",
|
|
268
|
-
month: (0, import_dayjs.default)(month).format(
|
|
319
|
+
month: (0, import_dayjs.default)(month).format(headerBarFormat)
|
|
269
320
|
});
|
|
270
321
|
}
|
|
271
322
|
};
|
|
323
|
+
const onClickDate = (e) => {
|
|
324
|
+
if (!enableSelectYear) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
e.stopPropagation();
|
|
328
|
+
setOpenPicker(true);
|
|
329
|
+
getYearsList();
|
|
330
|
+
};
|
|
331
|
+
const onClosePicker = (e, data2) => {
|
|
332
|
+
const selectYear = data2.value[0];
|
|
333
|
+
e.stopPropagation();
|
|
334
|
+
setRenderMonth((0, import_dayjs.default)(renderMonth).set("year", selectYear).toDate());
|
|
335
|
+
onYearChange == null ? void 0 : onYearChange(e, {
|
|
336
|
+
year: selectYear
|
|
337
|
+
});
|
|
338
|
+
setOpenPicker(false);
|
|
339
|
+
};
|
|
272
340
|
let data = {};
|
|
273
341
|
if (isRangeMode) {
|
|
274
342
|
data = {
|
|
@@ -290,29 +358,28 @@ const Calendar = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
290
358
|
}, others), {
|
|
291
359
|
"data-mode": mode
|
|
292
360
|
}), data),
|
|
293
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: classes.handler }, /* @__PURE__ */ import_react.default.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` }, /* @__PURE__ */ import_react.default.createElement(
|
|
294
|
-
import_icons.CaretLeftIcon,
|
|
295
|
-
{
|
|
296
|
-
className: `${classes.handler}-btn-icon`,
|
|
297
|
-
htmlColor: isMinMonth && "#cccccc"
|
|
298
|
-
}
|
|
299
|
-
)), /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.handler}-text` }, (0, import_dayjs.default)(renderMonth).format("YYYY/MM")), /* @__PURE__ */ import_react.default.createElement("div", { onClick: onClickNext, className: `${classes.handler}-btn` }, /* @__PURE__ */ import_react.default.createElement(
|
|
300
|
-
import_icons.CaretRightIcon,
|
|
301
|
-
{
|
|
302
|
-
className: `${classes.handler}-btn-icon`,
|
|
303
|
-
htmlColor: isMaxMonth && "#cccccc"
|
|
304
|
-
}
|
|
305
|
-
))),
|
|
361
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: classes.handler }, /* @__PURE__ */ import_react.default.createElement("div", { onClick: onClickPrev, className: `${classes.handler}-btn` }, headerBarIcon.left), /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.handler}-text`, onClick: onClickDate }, (0, import_dayjs.default)(renderMonth).format(headerBarFormat)), /* @__PURE__ */ import_react.default.createElement("div", { onClick: onClickNext, className: `${classes.handler}-btn` }, headerBarIcon.right)),
|
|
306
362
|
/* @__PURE__ */ import_react.default.createElement("div", { className: classes.week }, SUNDAY_WEEK_DATA == null ? void 0 : SUNDAY_WEEK_DATA.map((w) => {
|
|
307
363
|
return weekRender ? weekRender(w) : /* @__PURE__ */ import_react.default.createElement("div", { key: w, className: `${classes.week}-item` }, w);
|
|
308
364
|
})),
|
|
309
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(`${classes.root}-month`) }, renderDayList())
|
|
365
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(`${classes.root}-month`) }, renderDayList()),
|
|
366
|
+
enableSelectYear && /* @__PURE__ */ import_react.default.createElement(import_react.Suspense, { fallback: null }, /* @__PURE__ */ import_react.default.createElement(
|
|
367
|
+
Picker,
|
|
368
|
+
{
|
|
369
|
+
options: [getYearsList()],
|
|
370
|
+
open: openPicker,
|
|
371
|
+
value: [(0, import_dayjs.default)(renderMonth).year()],
|
|
372
|
+
onClose: onClosePicker
|
|
373
|
+
}
|
|
374
|
+
))
|
|
310
375
|
);
|
|
311
376
|
}
|
|
312
377
|
);
|
|
313
378
|
Calendar.displayName = "BuiCalendar";
|
|
314
379
|
Calendar.defaultProps = {
|
|
315
380
|
hideDaysOutsideCurrentMonth: false,
|
|
381
|
+
headerBarFormat: "YYYY/MM",
|
|
382
|
+
enableSelectYear: false,
|
|
316
383
|
mode: "single",
|
|
317
384
|
minDate: (0, import_dayjs.default)((0, import_dayjs.default)().format("YYYYMMDD")).add(0, "month").toDate(),
|
|
318
385
|
maxDate: (0, import_dayjs.default)((0, import_dayjs.default)().format("YYYYMMDD")).add(11, "month").toDate(),
|
|
@@ -12,6 +12,16 @@ export interface ICalendarMonthChangeData {
|
|
|
12
12
|
/** 操作类型,prev: 点击上个月 next: 点击下个月 */
|
|
13
13
|
type: 'prev' | 'next';
|
|
14
14
|
}
|
|
15
|
+
export interface ICalendarYearChangeData {
|
|
16
|
+
/** 切换后的年份 */
|
|
17
|
+
year: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ICustomIconProps {
|
|
20
|
+
/** 是否为可选范围内的最小月份 */
|
|
21
|
+
isMinMonth?: boolean;
|
|
22
|
+
/** 是否为可选范围内的最大月份 */
|
|
23
|
+
isMaxMonth?: boolean;
|
|
24
|
+
}
|
|
15
25
|
export type ICalendarMode = 'single' | 'range';
|
|
16
26
|
export type ICalendarValue = Date | Date[] | null;
|
|
17
27
|
export type CalendarProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
@@ -43,6 +53,21 @@ export type CalendarProps<D extends React.ElementType = 'div', P = {}> = Overrid
|
|
|
43
53
|
* 是否隐藏当前月之外的日期,默认为false
|
|
44
54
|
*/
|
|
45
55
|
hideDaysOutsideCurrentMonth?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 头部操作栏日期显示格式
|
|
58
|
+
* @default YYYY/MM
|
|
59
|
+
*/
|
|
60
|
+
headerBarFormat?: string;
|
|
61
|
+
/**
|
|
62
|
+
* 头部操作栏左边图标
|
|
63
|
+
* @defaultReturn <CaretLeftIcon />
|
|
64
|
+
*/
|
|
65
|
+
headerBarLeftIcon?: (options: ICustomIconProps) => React.ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* 头部操作栏右边图标
|
|
68
|
+
* @defaultReturn <CaretRightIcon />
|
|
69
|
+
*/
|
|
70
|
+
headerBarRightIcon?: (options: ICustomIconProps) => React.ReactNode;
|
|
46
71
|
/**
|
|
47
72
|
* 不可选择的日期
|
|
48
73
|
*/
|
|
@@ -61,6 +86,14 @@ export type CalendarProps<D extends React.ElementType = 'div', P = {}> = Overrid
|
|
|
61
86
|
* 自定义周单元格的内容
|
|
62
87
|
*/
|
|
63
88
|
weekRender?: (week: string) => React.ReactNode;
|
|
89
|
+
/**
|
|
90
|
+
* 是否开启选择年
|
|
91
|
+
*/
|
|
92
|
+
enableSelectYear?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 年份发生变化的回调
|
|
95
|
+
*/
|
|
96
|
+
onYearChange?: (e: React.SyntheticEvent, data: ICalendarYearChangeData) => void;
|
|
64
97
|
/**
|
|
65
98
|
* 月份发生变化的回调
|
|
66
99
|
*/
|
package/dist/Card/CardFooter.css
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.bui-card-footer {
|
|
2
|
+
--padding: var(--bui-card-footer-padding, var(--bui-spacing-md) var(--bui-spacing-lg));
|
|
2
3
|
color: var(--bui-color-fg-muted);
|
|
3
4
|
font-size: var(--bui-text-size-1);
|
|
4
5
|
display: flex;
|
|
5
6
|
align-items: center;
|
|
6
|
-
padding: var(--
|
|
7
|
+
padding: var(--padding);
|
|
7
8
|
font-family: var(--bui-font-family);
|
|
8
9
|
}
|
package/dist/Card/CardHeader.css
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
.bui-card-header {
|
|
2
|
+
--padding: var(--bui-card-header-padding, var(--bui-spacing-md) var(--bui-spacing-lg));
|
|
3
|
+
--end-icon-margin-left: var(--bui-card-header-end-icon-margin-left, 2px);
|
|
2
4
|
display: flex;
|
|
3
5
|
align-items: center;
|
|
4
6
|
flex-direction: row;
|
|
5
7
|
position: relative;
|
|
6
8
|
padding: var(--bui-spacing-md) var(--bui-spacing-lg);
|
|
7
9
|
font-size: var(--bui-title-size-4);
|
|
8
|
-
font-weight:
|
|
10
|
+
font-weight: var(--bui-font-weight-medium);
|
|
9
11
|
color: var(--bui-color-fg-default);
|
|
10
12
|
font-family: var(--bui-font-family);
|
|
11
13
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
.bui-checkbox {
|
|
2
|
-
--label-color: var(--bui-color-fg-default);
|
|
3
|
-
--label-font-size: var(--bui-text-size-1);
|
|
4
|
-
--icon-font-size: var(--bui-title-size-2);
|
|
2
|
+
--label-color: var(--bui-checkbox-label-color, --bui-color-fg-default);
|
|
3
|
+
--label-font-size: var(--bui-checkbox-label-font-size, var(--bui-text-size-1));
|
|
4
|
+
--icon-font-size: var(--bui-checkbox-icon-font-size, var(--bui-title-size-2));
|
|
5
|
+
--disabled-opacity: var(--bui-checkbox-disabled-opacity, 0.5);
|
|
6
|
+
--icon-padding: var(--bui-checkbox-icon-padding, 5px);
|
|
5
7
|
display: inline-flex;
|
|
6
8
|
align-items: center;
|
|
7
9
|
position: relative;
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
}
|
|
10
12
|
.bui-checkbox.bui-checkbox-disabled {
|
|
11
13
|
pointer-events: none;
|
|
12
|
-
opacity:
|
|
14
|
+
opacity: var(--disabled-opacity);
|
|
13
15
|
}
|
|
14
16
|
.bui-checkbox-label-left {
|
|
15
17
|
flex-direction: row-reverse;
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
align-items: center;
|
|
36
38
|
justify-content: center;
|
|
37
39
|
flex-shrink: 0;
|
|
38
|
-
padding:
|
|
40
|
+
padding: var(--icon-padding);
|
|
39
41
|
box-sizing: border-box;
|
|
40
42
|
font-size: var(--icon-font-size);
|
|
41
43
|
}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
.bui-city-selector {
|
|
2
|
+
--select-item-width: var(--bui-city-selector-item-width, 111px);
|
|
3
|
+
--select-item-height: var(--bui-city-selector-item-height, 36px);
|
|
4
|
+
--select-item-border-radius: var(--bui-city-selector-item-border-radius, 20px);
|
|
5
|
+
--select-item-margin: var(--bui-city-selector-item-margin, 4.5px 0 4.5px 9px);
|
|
6
|
+
--title-height: var(--bui-city-selector-title-height, 45px);
|
|
7
|
+
--title-line-height: var(--bui-city-selector-title-line-height, 45px);
|
|
8
|
+
--btn-close-size: var(--bui-city-selector-btn-close-size, 45px);
|
|
9
|
+
--btn-close-font-size: var(--bui-city-selector-btn-close-font-size, 20px);
|
|
10
|
+
--container-with-title-height: var(--bui-city-selector-container-with-title-height, calc(100% - var(--title-height)));
|
|
11
|
+
--city-container-min-height: var(--bui-city-selector-city-container-min-height, 500px);
|
|
12
|
+
--select-city-buttons-padding: var(--bui-city-selector-select-city-buttons-padding, 7.5px 0 0 3px);
|
|
13
|
+
--select-city-title-line-height: var(--bui-city-selector-select-city-title-line-height, 15px);
|
|
14
|
+
--list-item-height: var(--bui-city-selector-list-item-height, 45px);
|
|
15
|
+
--city-index-has-title-top: var(--bui-city-selector-city-index-has-title-top, calc(50% + var(--title-height) / 2));
|
|
16
|
+
--index-item-height: var(--bui-city-selector-index-item-height, 20px);
|
|
2
17
|
font-family: var(--bui-font-family);
|
|
3
18
|
height: 100%;
|
|
4
19
|
position: relative;
|
|
5
20
|
}
|
|
6
21
|
.bui-city-selector-title {
|
|
7
22
|
width: 100%;
|
|
8
|
-
height:
|
|
23
|
+
height: var(--title-height);
|
|
9
24
|
color: var(--bui-color-fg-default);
|
|
10
25
|
font-size: var(--bui-title-size-3);
|
|
11
|
-
line-height:
|
|
26
|
+
line-height: var(--title-line-height);
|
|
12
27
|
text-align: center;
|
|
13
28
|
position: sticky;
|
|
14
29
|
top: 0;
|
|
@@ -20,20 +35,20 @@
|
|
|
20
35
|
position: absolute;
|
|
21
36
|
top: 0;
|
|
22
37
|
right: 0;
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
38
|
+
width: var(--btn-close-size);
|
|
39
|
+
height: var(--btn-close-size);
|
|
25
40
|
color: var(--bui-color-fg-muted);
|
|
26
41
|
text-align: center;
|
|
27
|
-
font-size:
|
|
42
|
+
font-size: var(--btn-close-font-size);
|
|
28
43
|
}
|
|
29
44
|
.bui-city-selector-scroll-view-container {
|
|
30
45
|
height: 100%;
|
|
31
46
|
}
|
|
32
47
|
.bui-city-selector-scroll-view-container.container-has-title {
|
|
33
|
-
height:
|
|
48
|
+
height: var(--container-with-title-height);
|
|
34
49
|
}
|
|
35
50
|
.bui-city-selector-all-city {
|
|
36
|
-
min-height:
|
|
51
|
+
min-height: var(--city-container-min-height);
|
|
37
52
|
font-size: var(--bui-text-size-2);
|
|
38
53
|
width: 100%;
|
|
39
54
|
background: var(--bui-color-bg-view);
|
|
@@ -42,22 +57,21 @@
|
|
|
42
57
|
.bui-city-selector-all-city .select-city-buttons {
|
|
43
58
|
display: flex;
|
|
44
59
|
flex-flow: wrap;
|
|
45
|
-
padding
|
|
46
|
-
padding-top: 7.5px;
|
|
60
|
+
padding: var(--select-city-buttons-padding);
|
|
47
61
|
}
|
|
48
62
|
.bui-city-selector-all-city .select-city-title {
|
|
49
63
|
font-size: var(--bui-title-size-4);
|
|
50
|
-
line-height:
|
|
51
|
-
font-weight:
|
|
64
|
+
line-height: var(--select-city-title-line-height);
|
|
65
|
+
font-weight: var(--bui-font-weight-bold);
|
|
52
66
|
padding-left: var(--bui-spacing-lg);
|
|
53
|
-
padding-top:
|
|
67
|
+
padding-top: var(--bui-spacing-md);
|
|
54
68
|
}
|
|
55
69
|
.bui-city-selector-list {
|
|
56
70
|
padding-left: var(--bui-spacing-lg);
|
|
57
71
|
list-style-type: none;
|
|
58
72
|
}
|
|
59
73
|
.bui-city-selector-list-item {
|
|
60
|
-
height:
|
|
74
|
+
height: var(--list-item-height);
|
|
61
75
|
font-size: var(--bui-title-size-4);
|
|
62
76
|
display: flex;
|
|
63
77
|
align-items: center;
|
|
@@ -81,7 +95,7 @@
|
|
|
81
95
|
transform: translate(0, -50%);
|
|
82
96
|
}
|
|
83
97
|
.bui-city-selector-index-container.city-index-has-title {
|
|
84
|
-
top:
|
|
98
|
+
top: var(--city-index-has-title-top);
|
|
85
99
|
}
|
|
86
100
|
.bui-city-selector-index-container ul {
|
|
87
101
|
margin: 0;
|
|
@@ -92,7 +106,7 @@
|
|
|
92
106
|
}
|
|
93
107
|
.bui-city-selector-index-container li {
|
|
94
108
|
list-style: none;
|
|
95
|
-
height:
|
|
109
|
+
height: var(--index-item-height);
|
|
96
110
|
text-align: center;
|
|
97
111
|
font-size: var(--bui-text-size-3);
|
|
98
112
|
color: var(--bui-color-info, --bui-color-info);
|