@bifrostui/react 1.3.0 → 1.3.1-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 +26 -17
- 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 +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 +59 -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/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 +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 +15 -14
- 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 +175 -0
- package/dist/Tooltip/Tooltip.types.d.ts +50 -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 +26 -17
- 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 +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 +163 -0
- package/es/Popover/Popover.types.d.ts +59 -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/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 +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 +15 -14
- 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 +152 -0
- package/es/Tooltip/Tooltip.types.d.ts +50 -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
package/es/Picker/PickerPanel.js
CHANGED
|
@@ -33,25 +33,31 @@ import "./PickerPanel.css";
|
|
|
33
33
|
const prefixCls = "bui-picker-panel";
|
|
34
34
|
const PickerPanel = /* @__PURE__ */ React.forwardRef(
|
|
35
35
|
(props, ref) => {
|
|
36
|
+
var _b;
|
|
36
37
|
const _a = props, {
|
|
37
38
|
options = [],
|
|
38
39
|
defaultValue,
|
|
39
40
|
onSelect,
|
|
40
|
-
columnIndex
|
|
41
|
+
columnIndex,
|
|
42
|
+
pickerStyle
|
|
41
43
|
} = _a, others = __objRest(_a, [
|
|
42
44
|
"options",
|
|
43
45
|
"defaultValue",
|
|
44
46
|
"onSelect",
|
|
45
|
-
"columnIndex"
|
|
47
|
+
"columnIndex",
|
|
48
|
+
"pickerStyle"
|
|
46
49
|
]);
|
|
47
50
|
const touch = useTouch();
|
|
48
51
|
let timer;
|
|
49
52
|
const INERTIA_TIME = 200;
|
|
50
53
|
const INERTIA_DISTANCE = 15;
|
|
51
54
|
const DEFAULT_DURATION = 200;
|
|
52
|
-
const LINE_SPACING = 36;
|
|
53
55
|
const ROTATION = 20;
|
|
54
56
|
const TOUCH_END = "end";
|
|
57
|
+
const DEFAULT_LINE_SPACING = 36;
|
|
58
|
+
const LINE_SPACING_STR = (_b = ((pickerStyle == null ? void 0 : pickerStyle["--option-height"]) ? `${pickerStyle == null ? void 0 : pickerStyle["--option-height"]}` : `${DEFAULT_LINE_SPACING}`).match(/\d+/)) == null ? void 0 : _b[0];
|
|
59
|
+
const LINE_SPACING = parseInt(LINE_SPACING_STR, 10);
|
|
60
|
+
const INDICATOR_OFFSET = LINE_SPACING * 108 / DEFAULT_LINE_SPACING;
|
|
55
61
|
const [startY, setStartY] = useState(0);
|
|
56
62
|
const [currIndex, setCurrIndex] = useState(1);
|
|
57
63
|
const [startTime, setStartTime] = useState(0);
|
|
@@ -167,17 +173,17 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
|
|
|
167
173
|
}, 0);
|
|
168
174
|
};
|
|
169
175
|
useEffect(() => {
|
|
170
|
-
var _a2,
|
|
176
|
+
var _a2, _b2, _c;
|
|
171
177
|
(_a2 = PickerPanelRef.current) == null ? void 0 : _a2.addEventListener("touchstart", panelTouchStart);
|
|
172
|
-
(
|
|
178
|
+
(_b2 = PickerPanelRef.current) == null ? void 0 : _b2.addEventListener("touchmove", panelTouchMove);
|
|
173
179
|
(_c = PickerPanelRef.current) == null ? void 0 : _c.addEventListener("touchend", panelTouchEnd);
|
|
174
180
|
return () => {
|
|
175
|
-
var _a3,
|
|
181
|
+
var _a3, _b3, _c2;
|
|
176
182
|
(_a3 = PickerPanelRef.current) == null ? void 0 : _a3.removeEventListener(
|
|
177
183
|
"touchstart",
|
|
178
184
|
panelTouchStart
|
|
179
185
|
);
|
|
180
|
-
(
|
|
186
|
+
(_b3 = PickerPanelRef.current) == null ? void 0 : _b3.removeEventListener(
|
|
181
187
|
"touchmove",
|
|
182
188
|
panelTouchMove
|
|
183
189
|
);
|
|
@@ -223,7 +229,7 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
|
|
|
223
229
|
}),
|
|
224
230
|
key: `${item == null ? void 0 : item.value}-${i}`,
|
|
225
231
|
style: {
|
|
226
|
-
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px,
|
|
232
|
+
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${INDICATOR_OFFSET}px)`
|
|
227
233
|
}
|
|
228
234
|
},
|
|
229
235
|
item == null ? void 0 : item.label
|
package/es/Picker/utils.d.ts
CHANGED
|
@@ -11,3 +11,19 @@ export declare const formatCascade: (columns: ICascadePickerOptionItem[], values
|
|
|
11
11
|
* 统一options数据格式
|
|
12
12
|
*/
|
|
13
13
|
export declare const formatOptions: (internalValue: any, options?: any[]) => any[];
|
|
14
|
+
/**
|
|
15
|
+
* 在格式化后的数据源中是否存在等长子项的value
|
|
16
|
+
*/
|
|
17
|
+
export declare const existSameLengthValue: (value: any, formatted: any) => any;
|
|
18
|
+
/**
|
|
19
|
+
* 关闭选择器时,纠正value和格式化数据
|
|
20
|
+
* 取决于formatted后的options有几列,若value为格式化后数据源(formatted)的等长子集,则取value,否则执行纠正逻辑
|
|
21
|
+
*/
|
|
22
|
+
export declare const safeData: ({ value, formatted, options }: {
|
|
23
|
+
value: any;
|
|
24
|
+
formatted: any;
|
|
25
|
+
options: any;
|
|
26
|
+
}) => {
|
|
27
|
+
safeValue: any[];
|
|
28
|
+
safeFormatted: any[];
|
|
29
|
+
};
|
package/es/Picker/utils.js
CHANGED
|
@@ -39,8 +39,36 @@ const formatOptions = (internalValue, options = []) => {
|
|
|
39
39
|
return options;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
const existSameLengthValue = (value, formatted) => {
|
|
43
|
+
const result = formatted.every(
|
|
44
|
+
(item, idx) => item.some((i) => (value == null ? void 0 : value[idx]) === (i == null ? void 0 : i.value))
|
|
45
|
+
);
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
const safeData = ({ value, formatted, options }) => {
|
|
49
|
+
let safeValue = [];
|
|
50
|
+
let safeFormatted = [];
|
|
51
|
+
const existValidChildren = existSameLengthValue(value, formatted);
|
|
52
|
+
if (existValidChildren) {
|
|
53
|
+
safeValue = value;
|
|
54
|
+
safeFormatted = formatted;
|
|
55
|
+
} else {
|
|
56
|
+
formatted.forEach((item, index) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const childIndex = item.findIndex((i) => i.value === value[index]);
|
|
59
|
+
safeValue[index] = ((_a = item == null ? void 0 : item[childIndex]) == null ? void 0 : _a.value) || ((_b = item == null ? void 0 : item[0]) == null ? void 0 : _b.value);
|
|
60
|
+
});
|
|
61
|
+
safeFormatted = formatOptions(safeValue, options);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
safeValue,
|
|
65
|
+
safeFormatted
|
|
66
|
+
};
|
|
67
|
+
};
|
|
42
68
|
export {
|
|
69
|
+
existSameLengthValue,
|
|
43
70
|
formatCascade,
|
|
44
71
|
formatOptions,
|
|
45
|
-
pickerPanelType
|
|
72
|
+
pickerPanelType,
|
|
73
|
+
safeData
|
|
46
74
|
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.bui-popover {
|
|
2
|
+
--arrow-size: var(--bui-popover-arrow-size, 8px);
|
|
3
|
+
--localtion-position: var(--bui-popover-localtion-position, 8px);
|
|
4
|
+
--max-width: var(--bui-popover-max-width, 350px);
|
|
5
|
+
--content-min-width: var(--bui-popover-content-min-width, 30px);
|
|
6
|
+
--content-min-height: var(--bui-popover-content-min-height, 32px);
|
|
7
|
+
--content-padding: var(--bui-popover-content-padding, 6px 8px);
|
|
8
|
+
max-width: var(--max-width);
|
|
9
|
+
font-size: var(--bui-text-size-1);
|
|
10
|
+
position: absolute;
|
|
11
|
+
visibility: hidden;
|
|
12
|
+
z-index: var(--bui-z-index-tooltip);
|
|
13
|
+
}
|
|
14
|
+
.bui-popover .bui-popover-arrow {
|
|
15
|
+
width: 0;
|
|
16
|
+
height: 0;
|
|
17
|
+
position: absolute;
|
|
18
|
+
}
|
|
19
|
+
.bui-popover .bui-popover-arrow.location-left {
|
|
20
|
+
left: var(--localtion-position);
|
|
21
|
+
}
|
|
22
|
+
.bui-popover .bui-popover-arrow.location-right {
|
|
23
|
+
right: var(--localtion-position);
|
|
24
|
+
}
|
|
25
|
+
.bui-popover .bui-popover-arrow.location-top {
|
|
26
|
+
top: var(--localtion-position);
|
|
27
|
+
}
|
|
28
|
+
.bui-popover .bui-popover-arrow.location-bottom {
|
|
29
|
+
bottom: var(--localtion-position);
|
|
30
|
+
}
|
|
31
|
+
.bui-popover.popover-top .location-center,
|
|
32
|
+
.bui-popover.popover-bottom .location-center {
|
|
33
|
+
left: 50%;
|
|
34
|
+
transform: translateX(-50%);
|
|
35
|
+
}
|
|
36
|
+
.bui-popover.popover-left .location-center,
|
|
37
|
+
.bui-popover.popover-right .location-center {
|
|
38
|
+
top: 50%;
|
|
39
|
+
transform: translateY(-50%);
|
|
40
|
+
}
|
|
41
|
+
.bui-popover.popover-top {
|
|
42
|
+
padding-bottom: var(--arrow-size);
|
|
43
|
+
}
|
|
44
|
+
.bui-popover.popover-top .bui-popover-arrow {
|
|
45
|
+
border-left: var(--arrow-size) solid transparent;
|
|
46
|
+
border-right: var(--arrow-size) solid transparent;
|
|
47
|
+
border-top: var(--arrow-size) solid var(--bui-color-bg-view);
|
|
48
|
+
bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
.bui-popover.popover-bottom {
|
|
51
|
+
padding-top: var(--arrow-size);
|
|
52
|
+
}
|
|
53
|
+
.bui-popover.popover-bottom .bui-popover-arrow {
|
|
54
|
+
border-left: var(--arrow-size) solid transparent;
|
|
55
|
+
border-right: var(--arrow-size) solid transparent;
|
|
56
|
+
border-bottom: var(--arrow-size) solid var(--bui-color-bg-view);
|
|
57
|
+
top: 0;
|
|
58
|
+
}
|
|
59
|
+
.bui-popover.popover-left {
|
|
60
|
+
padding-right: var(--arrow-size);
|
|
61
|
+
}
|
|
62
|
+
.bui-popover.popover-left .bui-popover-arrow {
|
|
63
|
+
border-top: var(--arrow-size) solid transparent;
|
|
64
|
+
border-bottom: var(--arrow-size) solid transparent;
|
|
65
|
+
border-left: var(--arrow-size) solid var(--bui-color-bg-view);
|
|
66
|
+
right: 0;
|
|
67
|
+
}
|
|
68
|
+
.bui-popover.popover-right {
|
|
69
|
+
padding-left: var(--arrow-size);
|
|
70
|
+
}
|
|
71
|
+
.bui-popover.popover-right .bui-popover-arrow {
|
|
72
|
+
border-top: var(--arrow-size) solid transparent;
|
|
73
|
+
border-bottom: var(--arrow-size) solid transparent;
|
|
74
|
+
border-right: var(--arrow-size) solid var(--bui-color-bg-view);
|
|
75
|
+
left: 0;
|
|
76
|
+
}
|
|
77
|
+
.bui-popover .bui-popover-title {
|
|
78
|
+
font-weight: var(--bui-font-weight-bold);
|
|
79
|
+
}
|
|
80
|
+
.bui-popover .bui-popover-content {
|
|
81
|
+
min-width: var(--content-min-width);
|
|
82
|
+
min-height: var(--content-min-height);
|
|
83
|
+
padding: var(--content-padding);
|
|
84
|
+
color: var(--bui-color-fg-muted);
|
|
85
|
+
text-align: left;
|
|
86
|
+
text-decoration: none;
|
|
87
|
+
word-wrap: break-word;
|
|
88
|
+
background-color: var(--bui-color-bg-popover);
|
|
89
|
+
border-radius: var(--bui-shape-radius-poster);
|
|
90
|
+
box-shadow:
|
|
91
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
92
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
93
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
94
|
+
}
|
|
95
|
+
.bui-popover .bui-popover-content div:nth-child(2) {
|
|
96
|
+
margin-top: var(--bui-spacing-md);
|
|
97
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import clsx from "clsx";
|
|
33
|
+
import React, { useState, useRef } from "react";
|
|
34
|
+
import {
|
|
35
|
+
getStylesAndLocation,
|
|
36
|
+
triggerEventTransform,
|
|
37
|
+
useUniqueId
|
|
38
|
+
} from "@bifrostui/utils";
|
|
39
|
+
import Portal from "../Portal";
|
|
40
|
+
import "./Popover.css";
|
|
41
|
+
const prefixCls = "bui-popover";
|
|
42
|
+
const Popover = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
43
|
+
const _a = props, {
|
|
44
|
+
className,
|
|
45
|
+
style,
|
|
46
|
+
children,
|
|
47
|
+
title,
|
|
48
|
+
content,
|
|
49
|
+
defaultOpen,
|
|
50
|
+
placement = "top",
|
|
51
|
+
trigger,
|
|
52
|
+
onOpenChange,
|
|
53
|
+
open,
|
|
54
|
+
hideArrow,
|
|
55
|
+
PortalProps
|
|
56
|
+
} = _a, others = __objRest(_a, [
|
|
57
|
+
"className",
|
|
58
|
+
"style",
|
|
59
|
+
"children",
|
|
60
|
+
"title",
|
|
61
|
+
"content",
|
|
62
|
+
"defaultOpen",
|
|
63
|
+
"placement",
|
|
64
|
+
"trigger",
|
|
65
|
+
"onOpenChange",
|
|
66
|
+
"open",
|
|
67
|
+
"hideArrow",
|
|
68
|
+
"PortalProps"
|
|
69
|
+
]);
|
|
70
|
+
const positionArr = placement.split(/([A-Z])/);
|
|
71
|
+
const direction = positionArr[0];
|
|
72
|
+
let location;
|
|
73
|
+
if (positionArr.length > 1) {
|
|
74
|
+
positionArr.splice(0, 1);
|
|
75
|
+
location = positionArr.join("").toLowerCase();
|
|
76
|
+
} else {
|
|
77
|
+
location = "center";
|
|
78
|
+
}
|
|
79
|
+
const childrenRef = useRef();
|
|
80
|
+
const [openStatus, setOpenStatus] = useState(defaultOpen);
|
|
81
|
+
const [arrowDirection, setArrowDirection] = useState(direction);
|
|
82
|
+
const [arrowLocation, setArrowLocation] = useState(location);
|
|
83
|
+
const [tooltyles, setTooltyles] = useState({});
|
|
84
|
+
const ttId = useUniqueId();
|
|
85
|
+
const onRootElementMouted = () => {
|
|
86
|
+
const result = getStylesAndLocation({
|
|
87
|
+
childrenRef,
|
|
88
|
+
arrowDirection,
|
|
89
|
+
arrowLocation,
|
|
90
|
+
selector: `[data-id="tt_${ttId}"]`
|
|
91
|
+
});
|
|
92
|
+
if (!result)
|
|
93
|
+
return;
|
|
94
|
+
const { styles, newArrowDirection, newArrowLocation } = result;
|
|
95
|
+
if (newArrowDirection !== arrowDirection) {
|
|
96
|
+
setArrowDirection(newArrowDirection);
|
|
97
|
+
}
|
|
98
|
+
if (newArrowLocation !== arrowLocation) {
|
|
99
|
+
setArrowLocation(newArrowLocation);
|
|
100
|
+
}
|
|
101
|
+
setTooltyles(styles);
|
|
102
|
+
};
|
|
103
|
+
const changeOpenStatus = (event, status) => {
|
|
104
|
+
if (open)
|
|
105
|
+
return;
|
|
106
|
+
setOpenStatus(status);
|
|
107
|
+
onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
|
|
108
|
+
};
|
|
109
|
+
const triggerClick = (event) => {
|
|
110
|
+
const targetStatus = !openStatus;
|
|
111
|
+
changeOpenStatus(event, targetStatus);
|
|
112
|
+
};
|
|
113
|
+
const hidePopover = (event) => {
|
|
114
|
+
changeOpenStatus(event, false);
|
|
115
|
+
};
|
|
116
|
+
const showPopover = (event) => {
|
|
117
|
+
changeOpenStatus(event, true);
|
|
118
|
+
};
|
|
119
|
+
if (!title && !content)
|
|
120
|
+
return null;
|
|
121
|
+
const triggerEventOption = triggerEventTransform({
|
|
122
|
+
trigger,
|
|
123
|
+
click: triggerClick,
|
|
124
|
+
show: showPopover,
|
|
125
|
+
hide: hidePopover
|
|
126
|
+
});
|
|
127
|
+
const childrenOptions = __spreadValues({
|
|
128
|
+
ref: childrenRef
|
|
129
|
+
}, triggerEventOption);
|
|
130
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, open || openStatus ? /* @__PURE__ */ React.createElement(
|
|
131
|
+
Portal,
|
|
132
|
+
__spreadProps(__spreadValues({
|
|
133
|
+
onRootElementMouted
|
|
134
|
+
}, PortalProps), {
|
|
135
|
+
ref
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ React.createElement(
|
|
138
|
+
"div",
|
|
139
|
+
__spreadValues({
|
|
140
|
+
className: clsx(prefixCls, className, `popover-${arrowDirection}`, {
|
|
141
|
+
"bui-popover-arrow-hide": hideArrow
|
|
142
|
+
}),
|
|
143
|
+
"data-id": `tt_${ttId}`,
|
|
144
|
+
style: __spreadValues(__spreadValues({}, style), tooltyles)
|
|
145
|
+
}, others),
|
|
146
|
+
!hideArrow ? /* @__PURE__ */ React.createElement(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: clsx(
|
|
150
|
+
"bui-popover-arrow",
|
|
151
|
+
`location-${arrowLocation}`
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
) : null,
|
|
155
|
+
/* @__PURE__ */ React.createElement("div", { className: "bui-popover-content" }, title ? /* @__PURE__ */ React.createElement("div", { className: "bui-popover-title" }, title) : null, content ? /* @__PURE__ */ React.createElement("div", { className: "bui-popover-inner-content" }, content) : null)
|
|
156
|
+
)
|
|
157
|
+
) : null, React.isValidElement(children) ? React.cloneElement(children, childrenOptions) : children);
|
|
158
|
+
});
|
|
159
|
+
Popover.displayName = "BuiPopover";
|
|
160
|
+
var Popover_default = Popover;
|
|
161
|
+
export {
|
|
162
|
+
Popover_default as default
|
|
163
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
+
import { PortalCoreProps } from '../Portal/Portal.types';
|
|
4
|
+
type triggerType = 'click' | 'hover';
|
|
5
|
+
export type PopoverProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
6
|
+
props: P & {
|
|
7
|
+
/**
|
|
8
|
+
* 默认是否显隐
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 用于手动控制浮层显隐
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 浮层的标题
|
|
19
|
+
*/
|
|
20
|
+
title?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* 浮层的内容
|
|
23
|
+
*/
|
|
24
|
+
content?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* 是否展示箭头
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
hideArrow?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 气泡框位置
|
|
32
|
+
* @default 'top'
|
|
33
|
+
*/
|
|
34
|
+
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
35
|
+
/**
|
|
36
|
+
* 触发行为
|
|
37
|
+
* - click: 点击触发
|
|
38
|
+
* - hover: hover触发
|
|
39
|
+
* - 或者是他们的数组
|
|
40
|
+
* @default 'click'
|
|
41
|
+
*/
|
|
42
|
+
trigger?: triggerType | triggerType[];
|
|
43
|
+
/**
|
|
44
|
+
* Portal组件的属性
|
|
45
|
+
*/
|
|
46
|
+
PortalProps?: PortalCoreProps;
|
|
47
|
+
/**
|
|
48
|
+
* 点击事件回调方法
|
|
49
|
+
* - event 触发事件
|
|
50
|
+
* - data.open 浮层显隐状态
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
onOpenChange?: (event: React.SyntheticEvent, data: {
|
|
54
|
+
open: boolean;
|
|
55
|
+
}) => void;
|
|
56
|
+
};
|
|
57
|
+
defaultComponent: D;
|
|
58
|
+
}, D>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/Portal/PortalCore.js
CHANGED
|
@@ -6,7 +6,13 @@ function getContainer(container) {
|
|
|
6
6
|
}
|
|
7
7
|
const PortalCore = /* @__PURE__ */ React.forwardRef(
|
|
8
8
|
function Portal(props, ref) {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
container,
|
|
12
|
+
disablePortal = false,
|
|
13
|
+
rootElement,
|
|
14
|
+
onRootElementMouted
|
|
15
|
+
} = props;
|
|
10
16
|
const [mountNode, setMountNode] = React.useState(null);
|
|
11
17
|
const handleRef = useForkRef(
|
|
12
18
|
// @ts-expect-error will upstream fix
|
|
@@ -21,6 +27,7 @@ const PortalCore = /* @__PURE__ */ React.forwardRef(
|
|
|
21
27
|
useLayoutEffect(() => {
|
|
22
28
|
if (mountNode && !disablePortal) {
|
|
23
29
|
setRef(ref, mountNode);
|
|
30
|
+
onRootElementMouted == null ? void 0 : onRootElementMouted(mountNode);
|
|
24
31
|
return () => {
|
|
25
32
|
setRef(ref, null);
|
|
26
33
|
};
|
package/es/Progress/Progress.css
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
.bui-progress {
|
|
2
2
|
--fill-color: var(--bui-color-primary);
|
|
3
|
-
--trail-color: rgba(156, 156, 165, 0.2);
|
|
4
|
-
--stroke-width: 8px;
|
|
5
|
-
width: 100
|
|
3
|
+
--trail-color: var(--bui-progress-trail-color, rgba(156, 156, 165, 0.2));
|
|
4
|
+
--stroke-width: var(--bui-progress-stroke-width, 8px);
|
|
5
|
+
--width: var(--bui-progress-width, 100%);
|
|
6
|
+
--border-radius: var(--bui-progress-border-radius, 100px);
|
|
7
|
+
width: var(--width);
|
|
6
8
|
font-family: var(--bui-font-family);
|
|
7
9
|
}
|
|
8
10
|
.bui-progress-inner {
|
|
9
11
|
position: relative;
|
|
10
12
|
display: inline-block;
|
|
11
|
-
width:
|
|
13
|
+
width: var(--width);
|
|
12
14
|
overflow: hidden;
|
|
13
15
|
vertical-align: middle;
|
|
14
16
|
background-color: var(--trail-color);
|
|
15
|
-
border-radius:
|
|
17
|
+
border-radius: var(--border-radius);
|
|
16
18
|
}
|
|
17
19
|
.bui-progress-bg {
|
|
18
20
|
position: relative;
|
|
19
|
-
border-radius:
|
|
21
|
+
border-radius: var(--border-radius);
|
|
20
22
|
background-color: var(--fill-color);
|
|
21
23
|
height: var(--stroke-width);
|
|
22
24
|
}
|
package/es/Radio/Radio.css
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
--label-color: var(--bui-color-fg-default);
|
|
3
3
|
--label-font-size: var(--bui-text-size-1);
|
|
4
4
|
--icon-font-size: var(--bui-title-size-2);
|
|
5
|
+
--icon-padding: var(--bui-radio-icon-padding, 5px);
|
|
5
6
|
display: inline-flex;
|
|
6
7
|
align-items: center;
|
|
7
8
|
position: relative;
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
align-items: center;
|
|
36
37
|
justify-content: center;
|
|
37
38
|
flex-shrink: 0;
|
|
38
|
-
padding:
|
|
39
|
+
padding: var(--icon-padding);
|
|
39
40
|
box-sizing: border-box;
|
|
40
41
|
}
|
|
41
42
|
.bui-radio-label {
|
package/es/Rating/Rating.css
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
.bui-rating {
|
|
2
|
+
--small-margin-right: var(--bui-rating-small-margin-right, 0.5px);
|
|
3
|
+
--medium-margin-right: var(--bui-rating-medium-margin-right, 1px);
|
|
4
|
+
--large-margin-right: var(--bui-rating-large-margin-right, 2px);
|
|
5
|
+
--large-font-size: var(--bui-rating-large-font-size, 22px);
|
|
2
6
|
display: flex;
|
|
3
7
|
flex-wrap: wrap;
|
|
4
8
|
font-family: var(--bui-font-family);
|
|
@@ -19,15 +23,15 @@
|
|
|
19
23
|
}
|
|
20
24
|
.bui-rating-container-small {
|
|
21
25
|
font-size: var(--bui-text-size-1);
|
|
22
|
-
margin-right:
|
|
26
|
+
margin-right: var(--small-margin-right);
|
|
23
27
|
}
|
|
24
28
|
.bui-rating-container-medium {
|
|
25
29
|
font-size: var(--bui-title-size-3);
|
|
26
|
-
margin-right:
|
|
30
|
+
margin-right: var(--small-medium-right);
|
|
27
31
|
}
|
|
28
32
|
.bui-rating-container-large {
|
|
29
|
-
font-size:
|
|
30
|
-
margin-right:
|
|
33
|
+
font-size: var(--large-font-size);
|
|
34
|
+
margin-right: var(--large-margin-right);
|
|
31
35
|
}
|
|
32
36
|
.bui-rating-item {
|
|
33
37
|
display: flex;
|
package/es/Select/Select.css
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
.bui-select {
|
|
2
|
+
--height: var(--bui-select-height, 27px);
|
|
3
|
+
--mini-width: var(--bui-select-min-width, 100px);
|
|
4
|
+
--font-size: var(--bui-select-font-size, var(--bui-title-size-3));
|
|
5
|
+
--padding: var(--bui-select-selector-container, 0 14px);
|
|
6
|
+
--option-container-padding: var(--bui-select-option-container-padding, 3px 0);
|
|
7
|
+
--option-margin-top: var(--bui-select-option-margin-top, 6px);
|
|
8
|
+
--option-padding: var(--bui-select-option-padding, 0 14px);
|
|
9
|
+
--option-margin: var(--bui-select-option-margin, 0 3px);
|
|
10
|
+
--option-height: var(--bui-select-option-height, 27px);
|
|
11
|
+
--option-active-font-weight: var(--bui-select-option-active-font-weight, 500);
|
|
2
12
|
position: relative;
|
|
3
13
|
cursor: pointer;
|
|
4
|
-
height:
|
|
5
|
-
min-width:
|
|
6
|
-
font-size: var(--
|
|
14
|
+
height: var(--height);
|
|
15
|
+
min-width: var(--mini-width);
|
|
16
|
+
font-size: var(--font-size);
|
|
7
17
|
border-radius: 5px;
|
|
8
18
|
background-color: var(--bui-color-bg-view);
|
|
9
19
|
font-family: var(--bui-font-family);
|
|
@@ -15,7 +25,7 @@
|
|
|
15
25
|
.bui-select-selector-container {
|
|
16
26
|
display: flex;
|
|
17
27
|
align-items: center;
|
|
18
|
-
padding:
|
|
28
|
+
padding: var(--padding);
|
|
19
29
|
height: 100%;
|
|
20
30
|
}
|
|
21
31
|
.bui-select-input {
|
|
@@ -32,7 +42,7 @@
|
|
|
32
42
|
justify-content: space-between;
|
|
33
43
|
align-items: center;
|
|
34
44
|
flex: 1;
|
|
35
|
-
height:
|
|
45
|
+
height: var(--bui-select-height);
|
|
36
46
|
background-color: transparent;
|
|
37
47
|
outline: none;
|
|
38
48
|
border: 0;
|
|
@@ -47,24 +57,25 @@
|
|
|
47
57
|
left: 0;
|
|
48
58
|
width: 100%;
|
|
49
59
|
z-index: var(--bui-z-index-dropdown);
|
|
50
|
-
margin-top:
|
|
60
|
+
margin-top: var(--option-container-margin-top);
|
|
61
|
+
border-radius: 3px;
|
|
51
62
|
background-color: var(--bui-color-bg-view);
|
|
52
63
|
padding: 2px;
|
|
53
64
|
overflow: hidden;
|
|
54
65
|
}
|
|
55
66
|
.bui-select-option-main {
|
|
56
67
|
border-radius: 3px;
|
|
57
|
-
padding:
|
|
68
|
+
padding: var(--option-container-padding);
|
|
58
69
|
box-shadow: 0 0 0 2px var(--bui-color-bg-default);
|
|
59
70
|
overflow: hidden;
|
|
60
71
|
}
|
|
61
72
|
.bui-select-option {
|
|
62
73
|
display: flex;
|
|
63
74
|
align-items: center;
|
|
64
|
-
height:
|
|
65
|
-
padding:
|
|
75
|
+
height: var(--option-height);
|
|
76
|
+
padding: var(--option-padding);
|
|
66
77
|
border-radius: 5px;
|
|
67
|
-
margin:
|
|
78
|
+
margin: var(--option-margin);
|
|
68
79
|
}
|
|
69
80
|
.bui-select-option:hover {
|
|
70
81
|
background-color: var(---bui-select-options-active-bg, #fff2f0);
|
package/es/Select/Select.js
CHANGED
|
@@ -112,7 +112,7 @@ const Select = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
112
112
|
};
|
|
113
113
|
const selectContext = useMemo(
|
|
114
114
|
() => ({ selectValue, setRenderValue, handleOptionClick }),
|
|
115
|
-
[selectValue]
|
|
115
|
+
[selectValue, onChange, setRenderValue]
|
|
116
116
|
);
|
|
117
117
|
useEffect(() => {
|
|
118
118
|
if (open !== void 0)
|