@nutui/nutui-react 3.0.10 → 3.0.11

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +19 -13
  2. package/dist/cjs/locales/base.d.ts +2 -0
  3. package/dist/cjs/locales/en-US.js +3 -1
  4. package/dist/cjs/locales/id-ID.js +3 -1
  5. package/dist/cjs/locales/tr-TR.js +3 -1
  6. package/dist/cjs/locales/zh-CN.js +3 -1
  7. package/dist/cjs/locales/zh-TW.js +3 -1
  8. package/dist/cjs/locales/zh-UG.js +3 -1
  9. package/dist/cjs/packages/address/address.js +80 -55
  10. package/dist/cjs/packages/address/{customRender.d.ts → cascaderRender.d.ts} +1 -1
  11. package/dist/cjs/packages/address/{customRender.js → cascaderRender.js} +5 -5
  12. package/dist/cjs/packages/address/elevatorRender.d.ts +14 -0
  13. package/dist/cjs/packages/address/elevatorRender.js +262 -0
  14. package/dist/cjs/packages/address/existRender.js +2 -2
  15. package/dist/cjs/packages/address/style/address.scss +0 -5
  16. package/dist/cjs/packages/address/style/style.css +0 -4
  17. package/dist/cjs/packages/address/style-jmapp/address.scss +0 -5
  18. package/dist/cjs/packages/address/style-jmapp/style.css +0 -4
  19. package/dist/cjs/packages/address/style-jrkf/address.scss +0 -5
  20. package/dist/cjs/packages/address/style-jrkf/style.css +0 -4
  21. package/dist/cjs/packages/address/utils.d.ts +5 -0
  22. package/dist/cjs/packages/address/utils.js +93 -0
  23. package/dist/cjs/packages/elevator/elevator.js +2 -1
  24. package/dist/cjs/packages/elevator/style/css.js +2 -0
  25. package/dist/cjs/packages/elevator/style/elevator.scss +95 -116
  26. package/dist/cjs/packages/elevator/style/index.js +2 -0
  27. package/dist/cjs/packages/elevator/style/style.css +83 -98
  28. package/dist/cjs/packages/elevator/style-jmapp/css.js +2 -0
  29. package/dist/cjs/packages/elevator/style-jmapp/elevator.scss +95 -116
  30. package/dist/cjs/packages/elevator/style-jmapp/index.js +2 -0
  31. package/dist/cjs/packages/elevator/style-jmapp/style.css +83 -98
  32. package/dist/cjs/packages/elevator/style-jrkf/css.js +2 -0
  33. package/dist/cjs/packages/elevator/style-jrkf/elevator.scss +95 -116
  34. package/dist/cjs/packages/elevator/style-jrkf/index.js +2 -0
  35. package/dist/cjs/packages/elevator/style-jrkf/style.css +83 -98
  36. package/dist/cjs/packages/picker/style/picker.scss +0 -1
  37. package/dist/cjs/packages/picker/style/style.css +0 -1
  38. package/dist/cjs/packages/picker/style-jmapp/picker.scss +0 -1
  39. package/dist/cjs/packages/picker/style-jmapp/style.css +0 -1
  40. package/dist/cjs/packages/picker/style-jrkf/picker.scss +0 -1
  41. package/dist/cjs/packages/picker/style-jrkf/style.css +0 -1
  42. package/dist/cjs/types/spec/address/base.d.ts +3 -12
  43. package/dist/cjs/types/spec/cascader/base.d.ts +1 -0
  44. package/dist/es/locales/base.d.ts +2 -0
  45. package/dist/es/locales/en-US.js +3 -1
  46. package/dist/es/locales/id-ID.js +3 -1
  47. package/dist/es/locales/tr-TR.js +3 -1
  48. package/dist/es/locales/zh-CN.js +3 -1
  49. package/dist/es/locales/zh-TW.js +3 -1
  50. package/dist/es/locales/zh-UG.js +3 -1
  51. package/dist/es/packages/address/address.js +81 -56
  52. package/dist/es/packages/address/{customRender.d.ts → cascaderRender.d.ts} +1 -1
  53. package/dist/es/packages/address/{customRender.js → cascaderRender.js} +3 -3
  54. package/dist/es/packages/address/elevatorRender.d.ts +14 -0
  55. package/dist/es/packages/address/elevatorRender.js +250 -0
  56. package/dist/es/packages/address/existRender.js +2 -2
  57. package/dist/es/packages/address/style/address.scss +0 -5
  58. package/dist/es/packages/address/style/style.css +0 -4
  59. package/dist/es/packages/address/style-jmapp/address.scss +0 -5
  60. package/dist/es/packages/address/style-jmapp/style.css +0 -4
  61. package/dist/es/packages/address/style-jrkf/address.scss +0 -5
  62. package/dist/es/packages/address/style-jrkf/style.css +0 -4
  63. package/dist/es/packages/address/utils.d.ts +5 -0
  64. package/dist/es/packages/address/utils.js +75 -0
  65. package/dist/es/packages/elevator/elevator.js +2 -1
  66. package/dist/es/packages/elevator/style/css.js +2 -0
  67. package/dist/es/packages/elevator/style/elevator.scss +95 -116
  68. package/dist/es/packages/elevator/style/index.js +2 -0
  69. package/dist/es/packages/elevator/style/style.css +83 -98
  70. package/dist/es/packages/elevator/style-jmapp/css.js +2 -0
  71. package/dist/es/packages/elevator/style-jmapp/elevator.scss +95 -116
  72. package/dist/es/packages/elevator/style-jmapp/index.js +2 -0
  73. package/dist/es/packages/elevator/style-jmapp/style.css +83 -98
  74. package/dist/es/packages/elevator/style-jrkf/css.js +2 -0
  75. package/dist/es/packages/elevator/style-jrkf/elevator.scss +95 -116
  76. package/dist/es/packages/elevator/style-jrkf/index.js +2 -0
  77. package/dist/es/packages/elevator/style-jrkf/style.css +83 -98
  78. package/dist/es/packages/picker/style/picker.scss +0 -1
  79. package/dist/es/packages/picker/style/style.css +0 -1
  80. package/dist/es/packages/picker/style-jmapp/picker.scss +0 -1
  81. package/dist/es/packages/picker/style-jmapp/style.css +0 -1
  82. package/dist/es/packages/picker/style-jrkf/picker.scss +0 -1
  83. package/dist/es/packages/picker/style-jrkf/style.css +0 -1
  84. package/dist/es/types/spec/address/base.d.ts +7 -13
  85. package/dist/es/types/spec/cascader/base.d.ts +1 -0
  86. package/dist/nutui.react.umd.js +463 -127
  87. package/dist/style-jmapp.css +1 -1
  88. package/dist/style-jmapp.scss +41 -41
  89. package/dist/style-jrkf.css +1 -1
  90. package/dist/style-jrkf.scss +44 -44
  91. package/dist/style.css +1 -1
  92. package/dist/style.scss +37 -37
  93. package/package.json +1 -1
@@ -0,0 +1,250 @@
1
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
+ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
4
+ import React, { useEffect, useMemo, useState } from "react";
5
+ import Popup from "../popup";
6
+ import Elevator from "../elevator";
7
+ import { normalizeListOptions, normalizeOptions } from "../cascader/utils";
8
+ import { transformData, findDataByName } from "./utils";
9
+ import { ComponentDefaults } from "../../utils/typings";
10
+ import { mergeProps } from "../../utils/merge-props";
11
+ import { usePropsValue } from "../../hooks/use-props-value";
12
+ import { isEmpty } from "../../utils/is-empty";
13
+ import { useConfig } from "../configprovider";
14
+ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
15
+ visible: false,
16
+ type: 'elevator',
17
+ options: [],
18
+ optionKey: {
19
+ textKey: 'text',
20
+ valueKey: 'value',
21
+ childrenKey: 'children'
22
+ },
23
+ format: {},
24
+ height: '200px',
25
+ activeColor: '',
26
+ activeIcon: 'checklist',
27
+ popup: true,
28
+ closeable: false,
29
+ closeIconPosition: 'top-right',
30
+ closeIcon: 'close',
31
+ lazy: false,
32
+ hotList: [],
33
+ onClose: function() {},
34
+ onChange: function() {},
35
+ onPathChange: function() {}
36
+ });
37
+ export var ElevatorRender = function(props) {
38
+ var _mergeProps = mergeProps(defaultProps, props), hotList = _mergeProps.hotList, title = _mergeProps.title, left = _mergeProps.left, optionKey = _mergeProps.optionKey, format = _mergeProps.format, onClose = _mergeProps.onClose, onChange = _mergeProps.onChange, onPathChange = _mergeProps.onPathChange, popup = _mergeProps.popup, _mergeProps_popupProps = _mergeProps.popupProps, popupProps = _mergeProps_popupProps === void 0 ? {} : _mergeProps_popupProps, outerVisible = _mergeProps.visible, outerOptions = _mergeProps.options, outerValue = _mergeProps.value, outerDefaultValue = _mergeProps.defaultValue, closeable = _mergeProps.closeable, closeIconPosition = _mergeProps.closeIconPosition, closeIcon = _mergeProps.closeIcon;
39
+ var _useConfig = useConfig(), _useConfig_locale = _useConfig.locale, select = _useConfig_locale.select, _useConfig_locale_address = _useConfig_locale.address, hotCity = _useConfig_locale_address.hotCity, selectProvince = _useConfig_locale_address.selectProvince;
40
+ var classPrefix = 'nut-address';
41
+ var MAX_LENGTH = 10;
42
+ var _usePropsValue = _sliced_to_array(usePropsValue({
43
+ value: outerValue,
44
+ defaultValue: outerDefaultValue,
45
+ finalValue: [],
46
+ onChange: function(value) {
47
+ onChange(value, []);
48
+ onPathChange(value, []);
49
+ }
50
+ }), 2), value = _usePropsValue[0], setValue = _usePropsValue[1];
51
+ var _useState = _sliced_to_array(useState(outerOptions), 2), innerOptions = _useState[0], setInnerOptions = _useState[1];
52
+ var _useState1 = _sliced_to_array(useState(value), 2), innerValue = _useState1[0], setInnerValue = _useState1[1];
53
+ var _useState2 = _sliced_to_array(useState([]), 2), elevatorOptions = _useState2[0], setElevatorOptions = _useState2[1];
54
+ var _useState3 = _sliced_to_array(useState(selectProvince), 2), addressTip = _useState3[0], setAddressTip = _useState3[1];
55
+ var _useState4 = _sliced_to_array(useState(0), 2), levelIndex = _useState4[0], setLevelIndex = _useState4[1];
56
+ var _useState5 = _sliced_to_array(useState(0), 2), tabActiveIndex = _useState5[0], setTabActiveIndex = _useState5[1];
57
+ // 初始化数据,只格式化一次;动态数据todo
58
+ var options = useMemo(function() {
59
+ if (!isEmpty(format)) {
60
+ return transformData(normalizeListOptions(innerOptions, format));
61
+ }
62
+ if (!isEmpty(optionKey)) {
63
+ return transformData(normalizeOptions(innerOptions, optionKey) || []);
64
+ }
65
+ return transformData(innerOptions);
66
+ }, [
67
+ innerOptions,
68
+ optionKey,
69
+ format
70
+ ]);
71
+ useEffect(function() {
72
+ setElevatorOptions(options);
73
+ }, [
74
+ options
75
+ ]);
76
+ var levels = useMemo(function() {
77
+ var next = [];
78
+ var end = false;
79
+ var currentOptions = options;
80
+ innerValue.forEach(function(val, index) {
81
+ var opt = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.flatMap(function(o) {
82
+ return o.list.find(function(item) {
83
+ return item.name === val;
84
+ });
85
+ }).filter(function(item) {
86
+ return item !== undefined;
87
+ })[0];
88
+ next.push({
89
+ name: val,
90
+ children: currentOptions,
91
+ levelIndex: index,
92
+ current: index === tabActiveIndex
93
+ });
94
+ if (opt === null || opt === void 0 ? void 0 : opt.children) {
95
+ currentOptions = opt.children;
96
+ } else {
97
+ end = true;
98
+ }
99
+ });
100
+ if (!end) {
101
+ next.push({
102
+ name: null,
103
+ children: currentOptions,
104
+ levels: -1,
105
+ current: false
106
+ });
107
+ }
108
+ return next;
109
+ }, [
110
+ innerValue,
111
+ options,
112
+ tabActiveIndex
113
+ ]);
114
+ var _usePropsValue1 = _sliced_to_array(usePropsValue({
115
+ value: outerVisible,
116
+ defaultValue: undefined,
117
+ onChange: function(value) {
118
+ if (value === false) onClose();
119
+ }
120
+ }), 2), visible = _usePropsValue1[0], setVisible = _usePropsValue1[1];
121
+ useEffect(function() {
122
+ if (!visible) setInnerValue(value);
123
+ }, [
124
+ visible,
125
+ value
126
+ ]);
127
+ useEffect(function() {
128
+ setInnerOptions(outerOptions);
129
+ }, [
130
+ outerOptions
131
+ ]);
132
+ useEffect(function() {
133
+ setTabActiveIndex(levels.length - 1);
134
+ setAddressTip(innerValue.length ? select : selectProvince);
135
+ }, [
136
+ innerValue
137
+ ]);
138
+ var handleElevatorItemClick = function(elevatorItem, levelIndex) {
139
+ var _elevatorItem_children;
140
+ var nextValue = innerValue.slice(0, levelIndex);
141
+ if (elevatorItem.name) {
142
+ nextValue[levelIndex] = elevatorItem.name;
143
+ }
144
+ setInnerValue(nextValue);
145
+ if ((_elevatorItem_children = elevatorItem.children) === null || _elevatorItem_children === void 0 ? void 0 : _elevatorItem_children.length) {
146
+ setElevatorOptions(elevatorItem.children);
147
+ setLevelIndex(levelIndex + 1);
148
+ } else {
149
+ setVisible(false);
150
+ setValue(nextValue);
151
+ }
152
+ };
153
+ var handleHotItemClick = function(hotItem) {
154
+ // 通过修改 innerValue 构造 level 数据
155
+ var distData = findDataByName(options, hotItem.name);
156
+ // 热门城市主要是一级城市和二级城市,可以扩展。TODO
157
+ if (distData) {
158
+ var nextValue = [
159
+ distData.pName,
160
+ distData.name
161
+ ].filter(function(item) {
162
+ return item !== '';
163
+ });
164
+ setInnerValue(nextValue);
165
+ setElevatorOptions(distData.children);
166
+ setLevelIndex(nextValue.length);
167
+ }
168
+ };
169
+ var renderTabs = function() {
170
+ if (!levels.length || !levels[0].name) return null;
171
+ return /*#__PURE__*/ React.createElement("div", {
172
+ className: "".concat(classPrefix, "-selected")
173
+ }, levels.map(function(item, index) {
174
+ var _levels_;
175
+ return /*#__PURE__*/ React.createElement(React.Fragment, {
176
+ key: "adtabs-".concat(index)
177
+ }, item.name && /*#__PURE__*/ React.createElement("div", {
178
+ className: "".concat(classPrefix, "-selected-item ").concat(item.current ? 'active' : ''),
179
+ onClick: function() {
180
+ var _props_onTabsChange;
181
+ (_props_onTabsChange = props.onTabsChange) === null || _props_onTabsChange === void 0 ? void 0 : _props_onTabsChange.call(props, index);
182
+ setTabActiveIndex(index);
183
+ setLevelIndex(index);
184
+ setElevatorOptions(item.children);
185
+ }
186
+ }, item.name), ((_levels_ = levels[index + 1]) === null || _levels_ === void 0 ? void 0 : _levels_.name) && /*#__PURE__*/ React.createElement("div", {
187
+ className: "".concat(classPrefix, "-selected-border")
188
+ }, "-"));
189
+ }));
190
+ };
191
+ var renderHotCity = function() {
192
+ if (levels.length && tabActiveIndex !== 0) return null;
193
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
194
+ className: "".concat(classPrefix, "-title")
195
+ }, hotCity), /*#__PURE__*/ React.createElement("div", {
196
+ className: "".concat(classPrefix, "-hotlist ").concat(hotList.length > MAX_LENGTH ? 'hotlist-more' : '')
197
+ }, hotList.map(function(item, index) {
198
+ return /*#__PURE__*/ React.createElement("div", {
199
+ className: "".concat(classPrefix, "-hotlist-item"),
200
+ key: "hot-".concat(index),
201
+ onClick: function() {
202
+ return handleHotItemClick(item);
203
+ }
204
+ }, item.name);
205
+ })));
206
+ };
207
+ var renderArea = function() {
208
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
209
+ className: "".concat(classPrefix, "-title")
210
+ }, addressTip), /*#__PURE__*/ React.createElement(Elevator, {
211
+ className: "".concat(classPrefix, "-elevator"),
212
+ list: elevatorOptions,
213
+ onItemClick: function(key, item) {
214
+ return handleElevatorItemClick(item, levelIndex);
215
+ },
216
+ style: {
217
+ height: '100%'
218
+ },
219
+ height: "93%"
220
+ }));
221
+ };
222
+ var renderContent = function() {
223
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, renderTabs(), /*#__PURE__*/ React.createElement("div", {
224
+ style: {
225
+ height: innerValue.length ? '80%' : '93%',
226
+ overflowY: levels.length && tabActiveIndex !== 0 ? 'hidden' : 'auto'
227
+ }
228
+ }, renderHotCity(), renderArea()));
229
+ };
230
+ return popup ? /*#__PURE__*/ React.createElement(Popup, _object_spread_props(_object_spread({}, popupProps), {
231
+ visible: visible,
232
+ position: "bottom",
233
+ style: {
234
+ height: '89%'
235
+ },
236
+ round: true,
237
+ closeIcon: closeIcon,
238
+ closeable: closeable,
239
+ closeIconPosition: closeIconPosition,
240
+ title: title,
241
+ left: left,
242
+ onOverlayClick: function() {
243
+ return setVisible(false);
244
+ },
245
+ onCloseIconClick: function() {
246
+ return setVisible(false);
247
+ }
248
+ }), renderContent()) : renderContent();
249
+ };
250
+ ElevatorRender.displayName = 'NutElevatorRender';
@@ -4,7 +4,7 @@ import React from "react";
4
4
  import { Check, Location } from "@nutui/icons-react";
5
5
  import { useConfig } from "../configprovider";
6
6
  var defaultProps = {
7
- type: 'custom',
7
+ type: 'exist',
8
8
  existList: [],
9
9
  defaultIcon: null,
10
10
  selectIcon: null,
@@ -34,7 +34,7 @@ export var ExistRender = function(props) {
34
34
  var onClick = function(e) {
35
35
  e.stopPropagation();
36
36
  onSwitch && onSwitch({
37
- type: type === 'exist' ? 'custom' : 'exist'
37
+ type: type === 'exist' ? 'cascader' : 'exist'
38
38
  });
39
39
  };
40
40
  return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("ul", {
@@ -1,9 +1,4 @@
1
1
  .nut-address {
2
- &-elevator {
3
- display: flex;
4
- margin-top: 20px;
5
- }
6
-
7
2
  &-exist {
8
3
  display: block;
9
4
  padding: 15px 20px 0;
@@ -2,10 +2,6 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-address-elevator {
6
- display: flex;
7
- margin-top: 20px;
8
- }
9
5
  .nut-address-exist {
10
6
  display: block;
11
7
  padding: 15px 20px 0;
@@ -1,9 +1,4 @@
1
1
  .nut-address {
2
- &-elevator {
3
- display: flex;
4
- margin-top: 20px;
5
- }
6
-
7
2
  &-exist {
8
3
  display: block;
9
4
  padding: 15px 20px 0;
@@ -2,10 +2,6 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-address-elevator {
6
- display: flex;
7
- margin-top: 20px;
8
- }
9
5
  .nut-address-exist {
10
6
  display: block;
11
7
  padding: 15px 20px 0;
@@ -1,9 +1,4 @@
1
1
  .nut-address {
2
- &-elevator {
3
- display: flex;
4
- margin-top: 20px;
5
- }
6
-
7
2
  &-exist {
8
3
  display: block;
9
4
  padding: 15px 20px 0;
@@ -2,10 +2,6 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-address-elevator {
6
- display: flex;
7
- margin-top: 20px;
8
- }
9
5
  .nut-address-exist {
10
6
  display: block;
11
7
  padding: 15px 20px 0;
@@ -0,0 +1,5 @@
1
+ export declare const transformData: (data: any) => {
2
+ title: string;
3
+ list: any;
4
+ }[];
5
+ export declare const findDataByName: any;
@@ -0,0 +1,75 @@
1
+ var generateId = function(name) {
2
+ return name.split('').reduce(function(sum, char) {
3
+ return sum + char.charCodeAt(0);
4
+ }, 0) // 使用字符的 Unicode 值作为 ID
5
+ ;
6
+ };
7
+ export var transformData = function(data) {
8
+ var groupByWordCode = function(data, parentId, parentName) {
9
+ return data === null || data === void 0 ? void 0 : data.reduce(function(acc, item) {
10
+ var wordCode = item.wordCode;
11
+ if (!acc[wordCode]) {
12
+ acc[wordCode] = [];
13
+ }
14
+ var currentId = generateId(item.value);
15
+ acc[wordCode].push({
16
+ name: item.value,
17
+ wordCode: item.wordCode,
18
+ id: currentId,
19
+ pId: parentId,
20
+ pName: parentName,
21
+ children: item.children && groupByWordCode(item.children, currentId, item.text) || null
22
+ });
23
+ return acc;
24
+ }, {});
25
+ };
26
+ var extractTitles = function(obj) {
27
+ return Object.keys(obj).map(function(key) {
28
+ return {
29
+ title: key,
30
+ list: obj[key].map(function(item) {
31
+ if (item.children) {
32
+ item.children = extractTitles(item.children);
33
+ }
34
+ return item;
35
+ })
36
+ };
37
+ });
38
+ };
39
+ var middleData = groupByWordCode(data, '', '');
40
+ var resultData = extractTitles(middleData);
41
+ return resultData;
42
+ };
43
+ export var findDataByName = function(data, name) {
44
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
45
+ try {
46
+ for(var _iterator = data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
47
+ var item = _step.value;
48
+ var _item_name;
49
+ if (((_item_name = item.name) === null || _item_name === void 0 ? void 0 : _item_name.indexOf(name)) === 0) return item;
50
+ if (item.children) {
51
+ var found = findDataByName(item.children, name);
52
+ if (found) return found;
53
+ }
54
+ if (item.list) {
55
+ var found1 = findDataByName(item.list, name);
56
+ if (found1) return found1;
57
+ }
58
+ }
59
+ } catch (err) {
60
+ _didIteratorError = true;
61
+ _iteratorError = err;
62
+ } finally{
63
+ try {
64
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
65
+ _iterator.return();
66
+ }
67
+ } finally{
68
+ if (_didIteratorError) {
69
+ throw _iteratorError;
70
+ }
71
+ }
72
+ }
73
+ return null // 如果没有找到,返回 null
74
+ ;
75
+ };
@@ -204,9 +204,10 @@ export var Elevator = function(props) {
204
204
  touchAction: 'pan-y'
205
205
  }
206
206
  }), list.map(function(item, index) {
207
+ var _list_currentIndex;
207
208
  var _obj;
208
209
  return /*#__PURE__*/ React.createElement("div", {
209
- className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-bars-inner-item"), true), _define_property(_obj, "".concat(classPrefix, "-bars-inner-item-active"), item[floorKey] === list[currentIndex][floorKey]), _obj)),
210
+ className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-bars-inner-item"), true), _define_property(_obj, "".concat(classPrefix, "-bars-inner-item-active"), item[floorKey] === ((_list_currentIndex = list[currentIndex]) === null || _list_currentIndex === void 0 ? void 0 : _list_currentIndex[floorKey])), _obj)),
210
211
  "data-index": index,
211
212
  key: index,
212
213
  onClick: function() {
@@ -1 +1,3 @@
1
+ import '../../elevator/style/css';
2
+ import '../../cascader/style/css';
1
3
  import './style.css';
@@ -1,134 +1,113 @@
1
- .nut-elevator {
2
- width: 100%;
3
- display: block;
4
- position: relative;
5
- overflow: hidden;
6
-
7
- &-list {
8
- display: block;
9
- position: relative;
10
- top: 0;
11
- overflow: hidden;
12
- font-size: $elevator-list-font-size;
13
- color: $elevator-list-color;
14
-
15
- &-inner {
16
- height: 100%;
17
- width: 100%;
18
- display: block;
19
- background-color: $elevator-list-bg-color;
20
- overflow: auto;
21
- }
22
-
1
+ .nut-address {
2
+ &-title {
3
+ font-size: 14px;
4
+ font-weight: 500;
5
+ padding: 16px 16px 12px 16px;
6
+ }
7
+ &-hotlist {
8
+ padding: 0 16px;
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ align-items: flex-start;
23
12
  &-item {
24
- display: block;
25
-
26
- &-code {
27
- display: flex;
28
- position: relative;
29
- height: $elevator-list-item-code-height;
30
- line-height: $elevator-list-item-code-line-height;
31
- font-size: $elevator-list-item-code-font-size;
32
- color: $elevator-list-item-code-color;
33
- padding: $elevator-list-item-padding;
34
- font-weight: $elevator-list-item-code-font-weight;
35
- box-sizing: border-box;
36
- border-bottom: $elevator-list-item-code-border-bottom;
37
- background-color: $elevator-list-item-code-background-color;
38
- }
39
-
40
- &-name {
41
- display: flex;
42
- align-items: center;
43
- padding: $elevator-list-item-padding;
44
- height: $elevator-list-item-name-height;
45
- line-height: $elevator-list-item-name-line-height;
46
-
47
- &-highcolor {
48
- color: $color-primary;
49
- }
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ width: 63px;
17
+ height: 28px;
18
+ font-size: 12px;
19
+ border-radius: 4px;
20
+ margin-bottom: 7px;
21
+ /* #ifdef harmony*/
22
+ margin-right: 6px;
23
+ /* #endif */
24
+ /* #ifndef harmony*/
25
+ margin-right: 7px;
26
+ /* #endif */
27
+ background-color: $color-background-sunken;
28
+ color: $color-title;
29
+ &:nth-child(5n) {
30
+ margin-right: 0;
50
31
  }
51
32
  }
52
33
 
53
- &-fixed {
54
- display: flex;
55
- align-items: center;
56
- width: 100%;
57
- position: absolute;
58
- top: 0;
59
- left: 0;
60
- z-index: 1;
61
- padding: $elevator-list-item-padding;
62
- height: $elevator-list-item-code-height;
63
- background-color: $elevator-list-fixed-bg-color;
64
- box-sizing: border-box;
65
- box-shadow: $elevator-list-fixed-box-shadow;
66
- &-title {
67
- font-size: $elevator-list-item-code-font-size;
68
- color: $elevator-list-fixed-color;
69
- font-weight: $elevator-list-item-code-font-weight;
34
+ &.hotlist-more {
35
+ .nut-address-hotlist-item {
36
+ width: auto;
37
+ padding: 0 16px;
38
+ margin-right: 7px;
70
39
  }
71
40
  }
72
41
  }
73
42
 
74
- &-code-current {
75
- position: absolute;
76
- right: $elevator-list-item-code-current-right;
77
- top: $elevator-list-item-code-current-top;
78
- transform: $elevator-bars-transform;
79
- width: $elevator-list-item-code-current-width;
80
- height: $elevator-list-item-code-current-height;
81
- line-height: $elevator-list-item-code-current-line-height;
82
- border-radius: $elevator-list-item-code-current-border-radius;
83
- background: $elevator-list-item-code-current-bg-color;
84
- box-shadow: $elevator-list-item-code-current-box-shadow;
85
- text-align: $elevator-list-item-code-current-text-align;
86
- }
43
+ &-selected {
44
+ width: 100%;
45
+ height: 60px;
46
+ padding: 0 16px;
47
+ display: flex;
48
+ align-items: center;
49
+ border-bottom: 1px solid $color-border;
50
+ &-item {
51
+ font-size: 12px;
52
+ display: inline-block;
53
+ height: 28px;
54
+ line-height: 28px;
55
+ padding: 0 12px;
56
+ border-radius: 4px;
57
+ background-color: $color-background-sunken;
87
58
 
88
- &-bars {
89
- position: absolute;
90
- right: $elevator-bars-right;
91
- top: $elevator-bars-top;
92
- color: $color-text-help;
93
- font-size: $elevator-bars-font-size;
94
- transform: $elevator-bars-transform;
95
- padding: $elevator-bars-padding;
96
- background-color: $elevator-bars-background-color;
97
- border-radius: $elevator-bars-border-radius;
98
- text-align: center;
99
- z-index: $elevator-bars-z-index;
59
+ &.active {
60
+ border: 1px solid $color-primary;
61
+ background-color: $color-primary-light-pressed;
62
+ color: $color-primary;
63
+ }
64
+ }
65
+ &-border {
66
+ margin: 0 2px;
67
+ color: $color-text-disabled;
68
+ }
69
+ }
100
70
 
101
- &-inner {
71
+ &-elevator {
72
+ margin-top: 0;
73
+ .nut-elevator-list {
102
74
  &-item {
103
- display: block;
104
- padding: $elevator-bars-inner-item-padding;
105
- cursor: pointer;
75
+ position: relative;
76
+ padding-left: 20px;
77
+ }
78
+ &-item-code {
79
+ display: inline;
80
+ position: absolute;
81
+ left: 0;
82
+ top: 0;
83
+ height: 30px;
84
+ line-height: 30px;
85
+ border-bottom: 0;
86
+ color: $color-text-help;
87
+ font-weight: 500;
88
+ }
89
+ }
90
+ .nut-elevator-bars {
91
+ top: 40%;
92
+ padding: 0;
93
+ background: none;
106
94
 
95
+ &-inner-item {
96
+ display: flex;
97
+ justify-content: center;
98
+ align-items: center;
99
+ width: 16px;
100
+ height: 16px;
101
+ font-size: 10px;
102
+ border-radius: 16px;
103
+ margin-bottom: 2px;
104
+ color: $color-text-help;
107
105
  &-active {
108
- font-weight: $font-weight-bold;
109
- color: $elevator-bars-active-color;
106
+ background-color: $color-primary;
107
+ color: $color-background-overlay;
108
+ font-weight: 400;
110
109
  }
111
110
  }
112
111
  }
113
112
  }
114
113
  }
115
-
116
- [dir='rtl'] .nut-elevator,
117
- .nut-rtl .nut-elevator {
118
- &-list {
119
- &-fixed {
120
- left: auto;
121
- right: 0;
122
- }
123
- }
124
-
125
- &-code-current {
126
- right: auto;
127
- left: $elevator-list-item-code-current-right;
128
- }
129
-
130
- &-bars {
131
- right: auto;
132
- left: $elevator-bars-right;
133
- }
134
- }
@@ -1 +1,3 @@
1
+ import '../../elevator/style';
2
+ import '../../cascader/style';
1
3
  import './elevator.scss';