@bifrostui/react 1.0.5 → 1.1.5
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.less +31 -0
- package/dist/ActionSheet/ActionSheetItem.less +62 -0
- package/dist/Alert/index.less +112 -0
- package/dist/Avatar/Avatar.less +52 -0
- package/dist/Avatar/AvatarGroup.less +39 -0
- package/dist/Backdrop/{Backdrop.css → Backdrop.less} +4 -3
- package/dist/Badge/Badge.less +118 -0
- package/dist/Button/Button.less +244 -0
- package/dist/Calendar/Calendar.less +126 -0
- package/{es/Card/Card.css → dist/Card/Card.less} +1 -0
- package/dist/Card/CardHeader.less +53 -0
- package/dist/Checkbox/Checkbox.less +55 -0
- package/dist/CitySelector/CitySelector.d.ts +4 -0
- package/dist/CitySelector/CitySelector.js +36 -0
- package/dist/CitySelector/CitySelector.less +122 -0
- package/dist/CitySelector/CitySelector.miniapp.d.ts +5 -0
- package/dist/CitySelector/CitySelector.miniapp.js +79 -0
- package/dist/CitySelector/CitySelector.types.d.ts +47 -0
- package/dist/CitySelector/CitySelector.types.js +5 -0
- package/dist/CitySelector/CitySelectorCore.d.ts +5 -0
- package/dist/CitySelector/CitySelectorCore.js +183 -0
- package/dist/CitySelector/Selector/index.d.ts +9 -0
- package/dist/CitySelector/Selector/index.js +22 -0
- package/dist/CitySelector/Selector/index.less +13 -0
- package/dist/CitySelector/index.d.ts +2 -0
- package/dist/CitySelector/index.js +34 -0
- package/dist/CitySelector/miniapp.less +4 -0
- package/dist/Countdown/Countdown.less +39 -0
- package/dist/Divider/Divider.less +50 -0
- package/dist/Drawer/Drawer.less +40 -0
- package/dist/IconButton/IconButton.less +167 -0
- package/dist/Image/index.less +40 -0
- package/dist/Input/Input.less +72 -0
- package/dist/List/{List.css → List.less} +1 -0
- package/dist/List/{ListItem.css → ListItem.less} +17 -6
- package/dist/List/{ListItemContent.css → ListItemContent.less} +7 -2
- package/dist/List/{ListItemFooter.css → ListItemFooter.less} +4 -3
- package/dist/Loading/Loading.less +40 -0
- package/dist/Modal/{Modal.css → Modal.less} +8 -6
- package/dist/Modal/Modal.miniapp.d.ts +16 -0
- package/dist/Modal/Modal.miniapp.js +73 -0
- package/dist/NavBar/NavBar.less +67 -0
- package/dist/Picker/Picker.d.ts +5 -0
- package/dist/Picker/Picker.js +155 -0
- package/dist/Picker/Picker.less +62 -0
- package/dist/Picker/Picker.types.d.ts +98 -0
- package/dist/Picker/Picker.types.js +5 -0
- package/dist/Picker/PickerPanel.d.ts +5 -0
- package/dist/Picker/PickerPanel.js +210 -0
- package/dist/Picker/PickerPanel.less +67 -0
- package/dist/Picker/index.d.ts +2 -0
- package/dist/Picker/index.js +34 -0
- package/dist/Picker/utils.d.ts +13 -0
- package/dist/Picker/utils.js +66 -0
- package/dist/Progress/Progress.less +24 -0
- package/dist/Radio/Radio.less +81 -0
- package/dist/Rating/Rating.less +64 -0
- package/dist/ScrollView/{ScrollView.css → ScrollView.less} +4 -0
- package/dist/Select/Select.less +105 -0
- package/dist/Skeleton/Skeleton.less +72 -0
- package/dist/Slider/Slider.less +108 -0
- package/dist/Stack/demo/index.less +27 -0
- package/dist/Steps/Step.less +228 -0
- package/{es/Steps/Steps.css → dist/Steps/Steps.less} +5 -3
- package/dist/Swiper/Swiper.less +25 -0
- package/dist/Switch/Switch.less +177 -0
- package/dist/TabBar/TabBarItem.less +54 -0
- package/dist/Tabs/Tab.js +1 -1
- package/dist/Tabs/Tab.less +60 -0
- package/dist/Tabs/TabPanel.less +11 -0
- package/dist/Tabs/Tabs.less +77 -0
- package/dist/Tag/Tag.less +119 -0
- package/dist/Tag/TagGroup.less +52 -0
- package/dist/TextArea/{TextArea.css → TextArea.less} +27 -19
- package/dist/index.d.ts +2 -0
- package/dist/index.js +22 -0
- package/es/ActionSheet/ActionSheet.less +31 -0
- package/es/ActionSheet/ActionSheetItem.less +62 -0
- package/es/Alert/index.less +112 -0
- package/es/Avatar/Avatar.less +52 -0
- package/es/Avatar/AvatarGroup.less +39 -0
- package/es/Backdrop/{Backdrop.css → Backdrop.less} +4 -3
- package/es/Badge/Badge.less +118 -0
- package/es/Button/Button.less +244 -0
- package/es/Calendar/Calendar.less +126 -0
- package/{dist/Card/Card.css → es/Card/Card.less} +1 -0
- package/es/Card/CardHeader.less +53 -0
- package/es/Checkbox/Checkbox.less +55 -0
- package/es/CitySelector/CitySelector.d.ts +4 -0
- package/es/CitySelector/CitySelector.js +36 -0
- package/es/CitySelector/CitySelector.less +122 -0
- package/es/CitySelector/CitySelector.miniapp.d.ts +5 -0
- package/es/CitySelector/CitySelector.miniapp.js +77 -0
- package/es/CitySelector/CitySelector.types.d.ts +47 -0
- package/es/CitySelector/CitySelector.types.js +1 -0
- package/es/CitySelector/CitySelectorCore.d.ts +5 -0
- package/es/CitySelector/CitySelectorCore.js +194 -0
- package/es/CitySelector/Selector/index.d.ts +9 -0
- package/es/CitySelector/Selector/index.js +13 -0
- package/es/CitySelector/Selector/index.less +13 -0
- package/es/CitySelector/index.d.ts +2 -0
- package/es/CitySelector/index.js +2 -0
- package/es/CitySelector/miniapp.less +4 -0
- package/es/Countdown/Countdown.less +39 -0
- package/es/Divider/Divider.less +50 -0
- package/es/Drawer/Drawer.less +40 -0
- package/es/IconButton/IconButton.less +167 -0
- package/es/Image/index.less +40 -0
- package/es/Input/Input.less +72 -0
- package/es/List/{List.css → List.less} +1 -0
- package/es/List/{ListItem.css → ListItem.less} +17 -6
- package/es/List/{ListItemContent.css → ListItemContent.less} +7 -2
- package/es/List/{ListItemFooter.css → ListItemFooter.less} +4 -3
- package/es/Loading/Loading.less +40 -0
- package/es/Modal/{Modal.css → Modal.less} +8 -6
- package/es/Modal/Modal.miniapp.d.ts +16 -0
- package/es/Modal/Modal.miniapp.js +78 -0
- package/es/NavBar/NavBar.less +67 -0
- package/es/Picker/Picker.d.ts +5 -0
- package/es/Picker/Picker.js +171 -0
- package/es/Picker/Picker.less +62 -0
- package/es/Picker/Picker.types.d.ts +98 -0
- package/es/Picker/Picker.types.js +1 -0
- package/es/Picker/PickerPanel.d.ts +5 -0
- package/es/Picker/PickerPanel.js +234 -0
- package/es/Picker/PickerPanel.less +67 -0
- package/es/Picker/index.d.ts +2 -0
- package/es/Picker/index.js +2 -0
- package/es/Picker/utils.d.ts +13 -0
- package/es/Picker/utils.js +65 -0
- package/es/Progress/Progress.less +24 -0
- package/es/Radio/Radio.less +81 -0
- package/es/Rating/Rating.less +64 -0
- package/es/ScrollView/{ScrollView.css → ScrollView.less} +4 -0
- package/es/Select/Select.less +105 -0
- package/es/Skeleton/Skeleton.less +72 -0
- package/es/Slider/Slider.less +108 -0
- package/es/Stack/demo/index.less +27 -0
- package/es/Steps/Step.less +228 -0
- package/{dist/Steps/Steps.css → es/Steps/Steps.less} +5 -3
- package/es/Swiper/Swiper.less +25 -0
- package/es/Switch/Switch.less +177 -0
- package/es/TabBar/TabBarItem.less +54 -0
- package/es/Tabs/Tab.js +1 -1
- package/es/Tabs/Tab.less +60 -0
- package/es/Tabs/TabPanel.less +11 -0
- package/es/Tabs/Tabs.less +77 -0
- package/es/Tag/Tag.less +119 -0
- package/es/Tag/TagGroup.less +52 -0
- package/es/TextArea/{TextArea.css → TextArea.less} +27 -19
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/package.json +6 -6
- package/dist/ActionSheet/ActionSheet.css +0 -27
- package/dist/ActionSheet/ActionSheetItem.css +0 -51
- package/dist/Alert/index.css +0 -89
- package/dist/Avatar/Avatar.css +0 -43
- package/dist/Avatar/AvatarGroup.css +0 -31
- package/dist/Badge/Badge.css +0 -95
- package/dist/Button/Button.css +0 -200
- package/dist/Calendar/Calendar.css +0 -105
- package/dist/Card/CardHeader.css +0 -45
- package/dist/Checkbox/Checkbox.css +0 -45
- package/dist/Countdown/Countdown.css +0 -28
- package/dist/Divider/Divider.css +0 -41
- package/dist/Drawer/Drawer.css +0 -35
- package/dist/IconButton/IconButton.css +0 -130
- package/dist/Image/index.css +0 -35
- package/dist/Input/Input.css +0 -59
- package/dist/Loading/Loading.css +0 -31
- package/dist/NavBar/NavBar.css +0 -57
- package/dist/Progress/Progress.css +0 -22
- package/dist/Radio/Radio.css +0 -65
- package/dist/Rating/Rating.css +0 -52
- package/dist/Select/Select.css +0 -89
- package/dist/Skeleton/Skeleton.css +0 -54
- package/dist/Slider/Slider.css +0 -95
- package/dist/Stack/demo/index.css +0 -23
- package/dist/Steps/Step.css +0 -174
- package/dist/Swiper/Swiper.css +0 -20
- package/dist/Switch/Switch.css +0 -127
- package/dist/TabBar/TabBarItem.css +0 -38
- package/dist/Tabs/Tab.css +0 -52
- package/dist/Tabs/TabPanel.css +0 -9
- package/dist/Tabs/Tabs.css +0 -56
- package/dist/Tag/Tag.css +0 -97
- package/dist/Tag/TagGroup.css +0 -43
- package/es/ActionSheet/ActionSheet.css +0 -27
- package/es/ActionSheet/ActionSheetItem.css +0 -51
- package/es/Alert/index.css +0 -89
- package/es/Avatar/Avatar.css +0 -43
- package/es/Avatar/AvatarGroup.css +0 -31
- package/es/Badge/Badge.css +0 -95
- package/es/Button/Button.css +0 -200
- package/es/Calendar/Calendar.css +0 -105
- package/es/Card/CardHeader.css +0 -45
- package/es/Checkbox/Checkbox.css +0 -45
- package/es/Countdown/Countdown.css +0 -28
- package/es/Divider/Divider.css +0 -41
- package/es/Drawer/Drawer.css +0 -35
- package/es/IconButton/IconButton.css +0 -130
- package/es/Image/index.css +0 -35
- package/es/Input/Input.css +0 -59
- package/es/Loading/Loading.css +0 -31
- package/es/NavBar/NavBar.css +0 -57
- package/es/Progress/Progress.css +0 -22
- package/es/Radio/Radio.css +0 -65
- package/es/Rating/Rating.css +0 -52
- package/es/Select/Select.css +0 -89
- package/es/Skeleton/Skeleton.css +0 -54
- package/es/Slider/Slider.css +0 -95
- package/es/Stack/demo/index.css +0 -23
- package/es/Steps/Step.css +0 -174
- package/es/Swiper/Swiper.css +0 -20
- package/es/Switch/Switch.css +0 -127
- package/es/TabBar/TabBarItem.css +0 -38
- package/es/Tabs/Tab.css +0 -52
- package/es/Tabs/TabPanel.css +0 -9
- package/es/Tabs/Tabs.css +0 -56
- package/es/Tag/Tag.css +0 -97
- package/es/Tag/TagGroup.css +0 -43
- /package/dist/Card/{CardContent.css → CardContent.less} +0 -0
- /package/dist/Card/{CardFooter.css → CardFooter.less} +0 -0
- /package/dist/List/{ListItemExtra.css → ListItemExtra.less} +0 -0
- /package/dist/List/{ListItemHeader.css → ListItemHeader.less} +0 -0
- /package/dist/Stack/{Stack.css → Stack.less} +0 -0
- /package/dist/TabBar/{TabBar.css → TabBar.less} +0 -0
- /package/es/Card/{CardContent.css → CardContent.less} +0 -0
- /package/es/Card/{CardFooter.css → CardFooter.less} +0 -0
- /package/es/List/{ListItemExtra.css → ListItemExtra.less} +0 -0
- /package/es/List/{ListItemHeader.css → ListItemHeader.less} +0 -0
- /package/es/Stack/{Stack.css → Stack.less} +0 -0
- /package/es/TabBar/{TabBar.css → TabBar.less} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _utils = require("@bifrostui/utils");
|
|
10
|
+
var _ScrollView = require("../ScrollView");
|
|
11
|
+
var _Selector = _interopRequireDefault(require("./Selector"));
|
|
12
|
+
require("./CitySelector.css");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
// 误差偏移量
|
|
18
|
+
const DEVIATION_HEIGHT = '6vmin';
|
|
19
|
+
const GPS_TYPE = {
|
|
20
|
+
title: '定位',
|
|
21
|
+
code: 'GPS'
|
|
22
|
+
};
|
|
23
|
+
const CURRENT_TYPE = {
|
|
24
|
+
title: '当前',
|
|
25
|
+
code: 'CRRT'
|
|
26
|
+
};
|
|
27
|
+
const HOT_CITY_TYPE = {
|
|
28
|
+
title: '热门',
|
|
29
|
+
code: 'HOT'
|
|
30
|
+
};
|
|
31
|
+
const prefixCls = 'bui-city-selector';
|
|
32
|
+
const CitySelector = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
33
|
+
const {
|
|
34
|
+
className,
|
|
35
|
+
title: pageTitle,
|
|
36
|
+
selectedCity,
|
|
37
|
+
selectedCityGroupName = '当前城市',
|
|
38
|
+
currentCity,
|
|
39
|
+
currentCityGroupName = '定位城市',
|
|
40
|
+
hotCities,
|
|
41
|
+
hotCitiesGroupName = '热门城市',
|
|
42
|
+
cities,
|
|
43
|
+
disableIndex,
|
|
44
|
+
touchHandler,
|
|
45
|
+
height,
|
|
46
|
+
onSelect,
|
|
47
|
+
onClose,
|
|
48
|
+
...others
|
|
49
|
+
} = props;
|
|
50
|
+
const cityRef = (0, _react.useRef)(null);
|
|
51
|
+
const nodeRef = (0, _utils.useForkRef)(ref, cityRef);
|
|
52
|
+
(0, _utils.useTouchEmulator)(cityRef.current);
|
|
53
|
+
const [codeGroup, setCodeGroup] = (0, _react.useState)([]);
|
|
54
|
+
const [codeShow, setCodeShow] = (0, _react.useState)(false);
|
|
55
|
+
const [targetId, setTargetId] = (0, _react.useState)('');
|
|
56
|
+
|
|
57
|
+
// 提取字母
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
if (!cities || cities?.length === 0 || codeGroup.length !== 0 || disableIndex) return;
|
|
60
|
+
const newGroup = [];
|
|
61
|
+
if (selectedCity) {
|
|
62
|
+
newGroup.push(CURRENT_TYPE);
|
|
63
|
+
}
|
|
64
|
+
if (currentCity) {
|
|
65
|
+
newGroup.push(GPS_TYPE);
|
|
66
|
+
}
|
|
67
|
+
if (hotCities) {
|
|
68
|
+
newGroup.push(HOT_CITY_TYPE);
|
|
69
|
+
}
|
|
70
|
+
cities.forEach(item => {
|
|
71
|
+
newGroup.push(item.groupName.toUpperCase());
|
|
72
|
+
});
|
|
73
|
+
setCodeGroup(newGroup);
|
|
74
|
+
}, [cities, selectedCity, currentCity, hotCities]);
|
|
75
|
+
|
|
76
|
+
// 计算每个code的top
|
|
77
|
+
(0, _react.useEffect)(() => {
|
|
78
|
+
if (codeGroup.length === 0) return;
|
|
79
|
+
setCodeShow(true);
|
|
80
|
+
}, [codeGroup]);
|
|
81
|
+
const selectHandler = (e, city) => {
|
|
82
|
+
onSelect(e, {
|
|
83
|
+
city
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const scrollToCode = targetCode => {
|
|
87
|
+
if (!targetCode) return;
|
|
88
|
+
setTargetId(oldCode => {
|
|
89
|
+
if (targetCode !== oldCode) return targetCode;
|
|
90
|
+
return oldCode;
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
const touchCbk = e => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
touchHandler?.(e, scrollToCode, codeGroup);
|
|
96
|
+
};
|
|
97
|
+
const codeClickHandler = rightCode => {
|
|
98
|
+
setTargetId(rightCode);
|
|
99
|
+
};
|
|
100
|
+
const scrollHandler = (0, _utils.throttle)(() => {
|
|
101
|
+
if (targetId) {
|
|
102
|
+
setTargetId(undefined);
|
|
103
|
+
}
|
|
104
|
+
}, 500);
|
|
105
|
+
const closeHandler = e => {
|
|
106
|
+
onClose?.(e);
|
|
107
|
+
};
|
|
108
|
+
const renderTitile = (title, titleCode) => {
|
|
109
|
+
const parseTitle = (titleCode || title).toUpperCase();
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
111
|
+
className: "select-city-title",
|
|
112
|
+
id: disableIndex ? '' : parseTitle
|
|
113
|
+
}, title.toUpperCase());
|
|
114
|
+
};
|
|
115
|
+
const renderCity = (citys, title, titleCode) => {
|
|
116
|
+
return /*#__PURE__*/_react.default.createElement("div", null, renderTitile(title, titleCode), /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
+
className: "select-city-buttons"
|
|
118
|
+
}, citys.map((city, index) => {
|
|
119
|
+
return /*#__PURE__*/_react.default.createElement(_Selector.default, {
|
|
120
|
+
key: index,
|
|
121
|
+
city: city,
|
|
122
|
+
onSelect: selectHandler
|
|
123
|
+
});
|
|
124
|
+
})));
|
|
125
|
+
};
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
127
|
+
className: (0, _clsx.default)(prefixCls, className),
|
|
128
|
+
ref: nodeRef
|
|
129
|
+
}, others), pageTitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
+
className: `${prefixCls}-title`
|
|
131
|
+
}, pageTitle, /*#__PURE__*/_react.default.createElement("div", {
|
|
132
|
+
className: `${prefixCls}-btn-close`,
|
|
133
|
+
onClick: closeHandler
|
|
134
|
+
}, "\u2715")) : null, /*#__PURE__*/_react.default.createElement(_ScrollView.ScrollView, {
|
|
135
|
+
scrollIntoView: targetId,
|
|
136
|
+
scrollY: true,
|
|
137
|
+
className: (0, _clsx.default)(`${prefixCls}-scroll-view-container tph`, {
|
|
138
|
+
'container-has-title': pageTitle
|
|
139
|
+
}),
|
|
140
|
+
onScroll: scrollHandler
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
+
className: `${prefixCls}-all-city`
|
|
143
|
+
}, selectedCity ? renderCity([selectedCity], selectedCityGroupName, CURRENT_TYPE.code) : null, currentCity ? renderCity([currentCity], currentCityGroupName, GPS_TYPE.code) : null, hotCities?.length > 0 ? renderCity(hotCities, hotCitiesGroupName, HOT_CITY_TYPE.code) : null, cities?.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
144
|
+
className: `${prefixCls}-list-container`
|
|
145
|
+
}, cities.map((item, cityGroupIndex) => {
|
|
146
|
+
if (!item?.groupName) return null;
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
key: cityGroupIndex
|
|
149
|
+
}, renderTitile(item.groupName, item.groupName), /*#__PURE__*/_react.default.createElement("ul", {
|
|
150
|
+
className: `${prefixCls}-list`
|
|
151
|
+
}, item.cities.map((city, cityIndex) => {
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
153
|
+
className: `${prefixCls}-list-item`,
|
|
154
|
+
key: cityIndex,
|
|
155
|
+
onClick: e => {
|
|
156
|
+
selectHandler(e, city);
|
|
157
|
+
}
|
|
158
|
+
}, city.name);
|
|
159
|
+
})));
|
|
160
|
+
})) : null)), codeGroup?.length > 0 && height ? /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
+
className: (0, _clsx.default)(`${prefixCls}-index-container`, {
|
|
162
|
+
'left-in': codeShow,
|
|
163
|
+
'city-index-has-title': pageTitle
|
|
164
|
+
})
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
166
|
+
onTouchMove: touchCbk,
|
|
167
|
+
className: `${prefixCls}-index-list`
|
|
168
|
+
}, codeGroup.map((item, chartIndex) => {
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
170
|
+
className: `${prefixCls}-index-item`,
|
|
171
|
+
key: chartIndex,
|
|
172
|
+
"data-code": item.code || item,
|
|
173
|
+
onClick: () => {
|
|
174
|
+
codeClickHandler(item.code || item);
|
|
175
|
+
},
|
|
176
|
+
style: {
|
|
177
|
+
maxHeight: `calc((${height} - ${DEVIATION_HEIGHT}) / ${codeGroup.length})`
|
|
178
|
+
}
|
|
179
|
+
}, item.title || item);
|
|
180
|
+
}))) : null);
|
|
181
|
+
});
|
|
182
|
+
CitySelector.displayName = 'BuiCitySelector';
|
|
183
|
+
var _default = exports.default = CitySelector;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cityType } from '../CitySelector.types';
|
|
3
|
+
import './index.less';
|
|
4
|
+
type propsType = {
|
|
5
|
+
city: cityType;
|
|
6
|
+
onSelect: (e: React.SyntheticEvent, city: cityType) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const Selector: (props: propsType) => React.JSX.Element;
|
|
9
|
+
export default Selector;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
require("./index.css");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const Selector = props => {
|
|
11
|
+
const {
|
|
12
|
+
city,
|
|
13
|
+
onSelect
|
|
14
|
+
} = props;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
16
|
+
className: "bui-city-selector-item",
|
|
17
|
+
onClick: e => {
|
|
18
|
+
onSelect?.(e, city);
|
|
19
|
+
}
|
|
20
|
+
}, city.name);
|
|
21
|
+
};
|
|
22
|
+
var _default = exports.default = Selector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import '~@bifrostui/styles/mixins/index.less';
|
|
2
|
+
|
|
3
|
+
.bui-city-selector-item {
|
|
4
|
+
width: 111px;
|
|
5
|
+
height: 36px;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
margin: 4.5px 0 4.5px 9px;
|
|
11
|
+
background-color: var(--bui-color-bg-default);
|
|
12
|
+
font-size: var(--bui-text-size-2);
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
CitySelector: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "CitySelector", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _CitySelector.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "default", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _CitySelector.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _CitySelector = _interopRequireDefault(require("./CitySelector"));
|
|
22
|
+
var _CitySelector2 = require("./CitySelector.types");
|
|
23
|
+
Object.keys(_CitySelector2).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _CitySelector2[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _CitySelector2[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@import '~@bifrostui/styles/mixins/index.less';
|
|
2
|
+
|
|
3
|
+
.bui-countdown {
|
|
4
|
+
--font-size: var(--bui-countdown-font-size, var(--bui-text-size-1));
|
|
5
|
+
--color: var(--bui-countdown-color, var(--bui-color-fg-default));
|
|
6
|
+
--font-weight: var(
|
|
7
|
+
--bui-countdown-font-weight,
|
|
8
|
+
var(--bui-font-weight-normal)
|
|
9
|
+
);
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
font-size: var(--font-size);
|
|
14
|
+
color: var(--color);
|
|
15
|
+
font-weight: var(--font-weight);
|
|
16
|
+
font-family: var(--bui-font-family);
|
|
17
|
+
|
|
18
|
+
&-slice {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
align-items: center;
|
|
22
|
+
|
|
23
|
+
&-item {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-value {
|
|
30
|
+
font-family: 'Helvetica Neue', helvetica, 'PingFang SC', 'Chinese Quote',
|
|
31
|
+
'Segoe UI', roboto, 'Hiragino Sans GB', 'Microsoft YaHei', arial,
|
|
32
|
+
sans-serif;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-unit {
|
|
36
|
+
margin: 0 2px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.bui-divider {
|
|
2
|
+
--height: var(--bui-divider-height, 100%);
|
|
3
|
+
--width: var(--bui-divider-width, 100%);
|
|
4
|
+
|
|
5
|
+
border-color: var(--bui-color-border-default);
|
|
6
|
+
font-family: var(--bui-font-family);
|
|
7
|
+
|
|
8
|
+
&-vertical {
|
|
9
|
+
height: var(--height);
|
|
10
|
+
display: inline-block;
|
|
11
|
+
border-right-width: 1px;
|
|
12
|
+
border-right-style: solid;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-horizontal {
|
|
16
|
+
width: var(--width);
|
|
17
|
+
border-bottom-width: 1px;
|
|
18
|
+
border-bottom-style: solid;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-vertical-dashed {
|
|
22
|
+
border-right-style: dashed;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-horizontal-dashed {
|
|
26
|
+
border-bottom-style: dashed;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-content {
|
|
30
|
+
width: 100%;
|
|
31
|
+
// border-width 设置border粗细
|
|
32
|
+
border-width: 0;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-line {
|
|
39
|
+
width: 40px;
|
|
40
|
+
border-bottom-width: 1px;
|
|
41
|
+
border-bottom-style: solid;
|
|
42
|
+
border-color: var(--bui-color-border-default);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-text {
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
color: var(--bui-color-fg-subtle);
|
|
48
|
+
font-size: var(--bui-text-size-2);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.bui-drawer {
|
|
2
|
+
font-family: var(--bui-font-family);
|
|
3
|
+
|
|
4
|
+
&-content {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex: 1 0 auto;
|
|
9
|
+
position: fixed;
|
|
10
|
+
top: 0;
|
|
11
|
+
outline: 0;
|
|
12
|
+
background-color: var(--bui-color-bg-view);
|
|
13
|
+
|
|
14
|
+
&-left {
|
|
15
|
+
left: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-top {
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
height: auto;
|
|
23
|
+
max-height: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-right {
|
|
27
|
+
right: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-bottom {
|
|
31
|
+
bottom: 0;
|
|
32
|
+
top: auto;
|
|
33
|
+
left: 0;
|
|
34
|
+
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
|
|
35
|
+
right: 0;
|
|
36
|
+
height: auto;
|
|
37
|
+
max-height: 100%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
@import '~@bifrostui/styles/mixins/index.less';
|
|
2
|
+
|
|
3
|
+
.btn-icon-default(@color) {
|
|
4
|
+
color: var(~'--bui-color-@{color}');
|
|
5
|
+
}
|
|
6
|
+
.btn-icon-outline(@color) {
|
|
7
|
+
color: var(~'--bui-color-@{color}');
|
|
8
|
+
border-color: var(~'--bui-color-@{color}');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.btn-icon-contained(@color) {
|
|
12
|
+
color: var(--bui-color-white);
|
|
13
|
+
.linear-gradient(var(~'--bui-color-@{color}-start'), var(~'--bui-color-@{color}-end'));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bui-icon-btn {
|
|
17
|
+
--bg-color: var(--bui-color-neutral-5);
|
|
18
|
+
--color: var(--bui-color-fg-muted);
|
|
19
|
+
--icon-size: 17px;
|
|
20
|
+
--user-area: 5px;
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
height: auto;
|
|
24
|
+
margin: 0;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
border: 1px solid transparent;
|
|
29
|
+
color: var(--color);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
font-family: var(--bui-font-family);
|
|
32
|
+
|
|
33
|
+
&::before {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 50%;
|
|
36
|
+
left: 50%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
background-color: var(--bui-color-black);
|
|
40
|
+
border: inherit;
|
|
41
|
+
border-color: var(--bui-color-black);
|
|
42
|
+
border-radius: inherit;
|
|
43
|
+
transform: translate(-50%, -50%);
|
|
44
|
+
opacity: 0;
|
|
45
|
+
content: ' ';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active::before {
|
|
49
|
+
opacity: 0.04;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::after {
|
|
53
|
+
border: 0;
|
|
54
|
+
}
|
|
55
|
+
font-size: var(--icon-size);
|
|
56
|
+
padding: var(--user-area);
|
|
57
|
+
|
|
58
|
+
&-small {
|
|
59
|
+
font-size: var(--bui-text-size-4);
|
|
60
|
+
padding: var(--bui-spacing-xs);
|
|
61
|
+
|
|
62
|
+
&.bui-icon-btn-outlined,
|
|
63
|
+
&.bui-icon-btn-contained {
|
|
64
|
+
padding: var(--bui-spacing-xs);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-medium {
|
|
69
|
+
&.bui-icon-btn-outlined,
|
|
70
|
+
&.bui-icon-btn-contained {
|
|
71
|
+
padding: 5px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-large {
|
|
76
|
+
font-size: 23px;
|
|
77
|
+
padding: var(--bui-spacing-sm);
|
|
78
|
+
|
|
79
|
+
&.bui-icon-btn-outlined,
|
|
80
|
+
&.bui-icon-btn-contained {
|
|
81
|
+
padding: var(--bui-spacing-sm);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&-disabled {
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
opacity: 0.5;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-circular {
|
|
91
|
+
border-radius: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&-rounded {
|
|
95
|
+
border-radius: var(--bui-shape-radius-default);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-square {
|
|
99
|
+
border-radius: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-default {
|
|
103
|
+
&.bui-icon-btn-primary {
|
|
104
|
+
.btn-icon-default(primary);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.bui-icon-btn-success {
|
|
108
|
+
.btn-icon-default(success);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.bui-icon-btn-info {
|
|
112
|
+
.btn-icon-default(info);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.bui-icon-btn-warning {
|
|
116
|
+
.btn-icon-default(warning);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&-outlined {
|
|
121
|
+
border: solid 1px;
|
|
122
|
+
|
|
123
|
+
&.bui-icon-btn-primary {
|
|
124
|
+
.btn-icon-outline(primary);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.bui-icon-btn-success {
|
|
128
|
+
.btn-icon-outline(success);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&.bui-icon-btn-info {
|
|
132
|
+
.btn-icon-outline(info);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.bui-icon-btn-warning {
|
|
136
|
+
.btn-icon-outline(warning);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.bui-icon-btn-danger {
|
|
140
|
+
.btn-icon-outline(danger);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&-contained {
|
|
145
|
+
background-color: var(--bg-color);
|
|
146
|
+
|
|
147
|
+
&.bui-icon-btn-primary {
|
|
148
|
+
.btn-icon-contained(primary);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.bui-icon-btn-success {
|
|
152
|
+
.btn-icon-contained(success);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&.bui-icon-btn-info {
|
|
156
|
+
.btn-icon-contained(info);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.bui-icon-btn-warning {
|
|
160
|
+
.btn-icon-contained(warning);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.bui-icon-btn-danger {
|
|
164
|
+
.btn-icon-contained(danger);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.bui-image {
|
|
2
|
+
width: auto;
|
|
3
|
+
height: auto;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
font-family: var(--bui-font-family);
|
|
8
|
+
|
|
9
|
+
.bui-image-img {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
display: block;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
|
|
16
|
+
&.bui-image-loaded {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-default-icon-wrap {
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
opacity: 1;
|
|
26
|
+
position: absolute;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
|
|
30
|
+
&.bui-image-loaded {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-default-icon-item {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
background-color: rgba(127, 127, 127, 0.2);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@import '~@bifrostui/styles/mixins/index.less';
|
|
2
|
+
|
|
3
|
+
.bui-input {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
height: 32px;
|
|
8
|
+
padding: 4px 10px;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
border-radius: var(--bui-shape-radius-default);
|
|
11
|
+
border: 1px solid var(--bui-color-border-default);
|
|
12
|
+
font-family: var(--bui-font-family);
|
|
13
|
+
|
|
14
|
+
&-icon {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
color: var(--bui-color-fg-subtle);
|
|
18
|
+
font-size: var(--bui-title-size-3);
|
|
19
|
+
|
|
20
|
+
&-start {
|
|
21
|
+
margin-right: 3px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&-end {
|
|
25
|
+
margin-left: 3px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-input {
|
|
30
|
+
flex: 1;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
padding: 0;
|
|
34
|
+
height: 100%;
|
|
35
|
+
color: var(--bui-color-fg-default);
|
|
36
|
+
border: none;
|
|
37
|
+
outline: none;
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
font-size: var(--bui-text-size-2);
|
|
40
|
+
|
|
41
|
+
&::placeholder {
|
|
42
|
+
color: var(--bui-color-fg-subtle);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-disabled {
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
49
|
+
|
|
50
|
+
.bui-input-input {
|
|
51
|
+
color: var(--bui-color-fg-disabled);
|
|
52
|
+
|
|
53
|
+
&::placeholder {
|
|
54
|
+
color: var(--bui-color-fg-disabled);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-clear {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
color: var(--bui-color-fg-disabled);
|
|
64
|
+
height: 100%;
|
|
65
|
+
font-size: var(--bui-title-size-3);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bui-mini-placeholder {
|
|
69
|
+
// 处理小程序placeholder较长被截断问题
|
|
70
|
+
width: auto;
|
|
71
|
+
}
|
|
72
|
+
}
|