iglooform 2.5.2 → 2.5.3
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/es/checkbox/index.d.ts +7 -7
- package/es/checkbox/index.js +85 -5
- package/es/form/elements.js +3 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en-US/messages.json +4 -0
- package/es/locale/id-ID/messages.json +4 -0
- package/es/locale/th-TH/messages.json +4 -0
- package/es/locale/vi-VN/messages.json +4 -0
- package/es/locale/zh-CN/messages.json +4 -0
- package/es/locale/zh-TW/messages.json +5 -0
- package/es/radio/index.d.ts +6 -6
- package/es/radio/index.js +79 -22
- package/es/radio/radio-group-with-other.d.ts +1 -1
- package/es/radio/radio-group-with-other.js +41 -4
- package/es/radio/style/empty.svg +12 -0
- package/es/search-box/index.d.ts +31 -0
- package/es/search-box/index.js +266 -0
- package/es/search-box/style/index.d.ts +1 -0
- package/es/search-box/style/index.js +1 -0
- package/es/search-box/style/index.less +162 -0
- package/es/select/attached-select.d.ts +2 -12
- package/es/select/attached-select.js +28 -198
- package/es/utils/option-utils.d.ts +24 -0
- package/es/utils/option-utils.js +233 -0
- package/lib/checkbox/index.d.ts +7 -7
- package/lib/checkbox/index.js +87 -5
- package/lib/form/elements.js +4 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +9 -0
- package/lib/locale/en-US/messages.json +4 -0
- package/lib/locale/id-ID/messages.json +4 -0
- package/lib/locale/th-TH/messages.json +4 -0
- package/lib/locale/vi-VN/messages.json +4 -0
- package/lib/locale/zh-CN/messages.json +4 -0
- package/lib/locale/zh-TW/messages.json +5 -0
- package/lib/radio/index.d.ts +6 -6
- package/lib/radio/index.js +83 -22
- package/lib/radio/radio-group-with-other.d.ts +1 -1
- package/lib/radio/radio-group-with-other.js +41 -3
- package/lib/radio/style/empty.svg +12 -0
- package/lib/search-box/index.d.ts +31 -0
- package/lib/search-box/index.js +287 -0
- package/lib/search-box/style/index.d.ts +1 -0
- package/lib/search-box/style/index.js +3 -0
- package/lib/search-box/style/index.less +162 -0
- package/lib/select/attached-select.d.ts +2 -12
- package/lib/select/attached-select.js +27 -198
- package/lib/utils/option-utils.d.ts +24 -0
- package/lib/utils/option-utils.js +250 -0
- package/package.json +10 -9
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("antd/es/grid/style");
|
|
9
|
+
|
|
10
|
+
var _grid = _interopRequireDefault(require("antd/es/grid"));
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _iglooicon = require("iglooicon");
|
|
17
|
+
|
|
18
|
+
var _modal = _interopRequireDefault(require("@/modal"));
|
|
19
|
+
|
|
20
|
+
var _input = _interopRequireDefault(require("@/input"));
|
|
21
|
+
|
|
22
|
+
var _checkbox = _interopRequireDefault(require("@/checkbox"));
|
|
23
|
+
|
|
24
|
+
var _typography = _interopRequireDefault(require("@/typography"));
|
|
25
|
+
|
|
26
|
+
var _button = _interopRequireDefault(require("@/button"));
|
|
27
|
+
|
|
28
|
+
var _locale = require("../locale");
|
|
29
|
+
|
|
30
|
+
var _react = require("react");
|
|
31
|
+
|
|
32
|
+
require("./style");
|
|
33
|
+
|
|
34
|
+
var _optionUtils = require("../utils/option-utils");
|
|
35
|
+
|
|
36
|
+
var _excluded = ["value", "className", "options", "onSearch", "multiple", "modalTitle", "placeHolder", "modalPlaceHolder", "clearWhenOptionsUpdated", "okButtonProps", "cancelButtonProps", "optionsUpdating"];
|
|
37
|
+
|
|
38
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
+
|
|
42
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
43
|
+
|
|
44
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
45
|
+
|
|
46
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
47
|
+
|
|
48
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
49
|
+
|
|
50
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
51
|
+
|
|
52
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
+
|
|
54
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
55
|
+
|
|
56
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
57
|
+
|
|
58
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
59
|
+
|
|
60
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
|
+
|
|
62
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
63
|
+
|
|
64
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
65
|
+
|
|
66
|
+
var IglooSearchBox = function IglooSearchBox(_ref) {
|
|
67
|
+
var valueProp = _ref.value,
|
|
68
|
+
className = _ref.className,
|
|
69
|
+
_ref$options = _ref.options,
|
|
70
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
71
|
+
onSearch = _ref.onSearch,
|
|
72
|
+
_ref$multiple = _ref.multiple,
|
|
73
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
74
|
+
modalTitle = _ref.modalTitle,
|
|
75
|
+
placeHolder = _ref.placeHolder,
|
|
76
|
+
modalPlaceHolder = _ref.modalPlaceHolder,
|
|
77
|
+
_ref$clearWhenOptions = _ref.clearWhenOptionsUpdated,
|
|
78
|
+
clearWhenOptionsUpdated = _ref$clearWhenOptions === void 0 ? false : _ref$clearWhenOptions,
|
|
79
|
+
okButtonProps = _ref.okButtonProps,
|
|
80
|
+
cancelButtonProps = _ref.cancelButtonProps,
|
|
81
|
+
searching = _ref.optionsUpdating,
|
|
82
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
83
|
+
|
|
84
|
+
var _useContext = (0, _react.useContext)(_locale.LocaleContext),
|
|
85
|
+
formatMessage = _useContext.formatMessage;
|
|
86
|
+
|
|
87
|
+
var modalTitleProps = modalTitle || formatMessage({
|
|
88
|
+
id: 'Search'
|
|
89
|
+
});
|
|
90
|
+
var useBreakpoint = _grid.default.useBreakpoint;
|
|
91
|
+
|
|
92
|
+
var _useBreakpoint = useBreakpoint(),
|
|
93
|
+
md = _useBreakpoint.md;
|
|
94
|
+
|
|
95
|
+
var _useState = (0, _react.useState)(false),
|
|
96
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
97
|
+
modalVisible = _useState2[0],
|
|
98
|
+
setModalVisible = _useState2[1];
|
|
99
|
+
|
|
100
|
+
var _useState3 = (0, _react.useState)([]),
|
|
101
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
102
|
+
selected = _useState4[0],
|
|
103
|
+
setSelected = _useState4[1];
|
|
104
|
+
|
|
105
|
+
var _useState5 = (0, _react.useState)(''),
|
|
106
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
107
|
+
modalInputValue = _useState6[0],
|
|
108
|
+
setModalInputValue = _useState6[1];
|
|
109
|
+
|
|
110
|
+
(0, _react.useEffect)(function () {
|
|
111
|
+
var setFieldValue = rest.setFieldValue;
|
|
112
|
+
|
|
113
|
+
if (clearWhenOptionsUpdated) {
|
|
114
|
+
typeof setFieldValue === 'function' && setFieldValue();
|
|
115
|
+
} else {
|
|
116
|
+
var foundValue = options.find(function (option) {
|
|
117
|
+
return Array.isArray(valueProp) ? valueProp.includes(option.value) : option.value === valueProp;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (!foundValue && valueProp !== undefined) {
|
|
121
|
+
typeof setFieldValue === 'function' && setFieldValue();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, [options]);
|
|
125
|
+
(0, _react.useEffect)(function () {
|
|
126
|
+
setSelected(Array.isArray(valueProp) ? valueProp : [valueProp]);
|
|
127
|
+
}, [valueProp]);
|
|
128
|
+
|
|
129
|
+
function beginSearch() {
|
|
130
|
+
onSearch && onSearch(modalInputValue);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function handleSelect(value) {
|
|
134
|
+
if (multiple) {
|
|
135
|
+
selected.includes(value) ? setSelected(selected.filter(function (o) {
|
|
136
|
+
return o !== value;
|
|
137
|
+
})) : setSelected([].concat(_toConsumableArray(selected), [value]));
|
|
138
|
+
} else {
|
|
139
|
+
setSelected([value]);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function selectAll() {
|
|
144
|
+
setSelected(options.map(function (o) {
|
|
145
|
+
return o.value;
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function cancelAll() {
|
|
150
|
+
setSelected([]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var mobileModalTile = function mobileModalTile() {
|
|
154
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
155
|
+
className: "igloo-search-box-modal-mobile-title",
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
setModalVisible(false);
|
|
158
|
+
setModalInputValue('');
|
|
159
|
+
onSearch && onSearch('');
|
|
160
|
+
},
|
|
161
|
+
children: [(0, _jsxRuntime.jsx)(_iglooicon.ArrowLeftOutlined, {}), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
162
|
+
level: "h4",
|
|
163
|
+
children: modalTitleProps || formatMessage({
|
|
164
|
+
id: 'Search'
|
|
165
|
+
})
|
|
166
|
+
})]
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var DisPlayOptions = function DisPlayOptions() {
|
|
171
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
172
|
+
className: "igloo-search-box-modal-options",
|
|
173
|
+
children: options === null || options === void 0 ? void 0 : options.map(function (o) {
|
|
174
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
175
|
+
onClick: function onClick(e) {
|
|
176
|
+
return handleSelect(o.value);
|
|
177
|
+
},
|
|
178
|
+
className: (0, _classnames2.default)('igloo-search-box-modal-select-item', _defineProperty({}, 'igloo-search-box-active-select-item', selected.includes(o.value))),
|
|
179
|
+
children: [multiple && (0, _jsxRuntime.jsx)(_checkbox.default, {
|
|
180
|
+
className: 'igloo-search-box-modal-select-item-checkbox',
|
|
181
|
+
checked: selected.includes(o.value)
|
|
182
|
+
}), (0, _jsxRuntime.jsx)(_typography.default, {
|
|
183
|
+
level: 'body1',
|
|
184
|
+
children: o.label
|
|
185
|
+
})]
|
|
186
|
+
}, o.value);
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}; // ...
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
var inputDisplayedValue = (0, _react.useMemo)(function () {
|
|
193
|
+
return options.filter(function (o) {
|
|
194
|
+
return selected.includes(o.value);
|
|
195
|
+
}).map(function (o) {
|
|
196
|
+
return o.label;
|
|
197
|
+
}).join(',');
|
|
198
|
+
}, [options, selected]);
|
|
199
|
+
var modalDom = (0, _jsxRuntime.jsxs)(_modal.default, {
|
|
200
|
+
closable: md,
|
|
201
|
+
maskClosable: false,
|
|
202
|
+
visible: modalVisible,
|
|
203
|
+
title: md ? modalTitleProps : mobileModalTile(),
|
|
204
|
+
className: (0, _classnames2.default)(md ? 'igloo-search-box-modal-container' : 'igloo-search-box-modal-container-mobile', className),
|
|
205
|
+
onCancel: function onCancel() {
|
|
206
|
+
setModalVisible(false);
|
|
207
|
+
setModalInputValue('');
|
|
208
|
+
onSearch && onSearch('');
|
|
209
|
+
},
|
|
210
|
+
onOk: function onOk() {
|
|
211
|
+
onSearch && onSearch('');
|
|
212
|
+
setModalInputValue('');
|
|
213
|
+
setModalVisible(false);
|
|
214
|
+
typeof rest.onChange === 'function' && valueProp !== selected && rest.onChange(multiple ? selected : selected[0]);
|
|
215
|
+
},
|
|
216
|
+
okText: formatMessage({
|
|
217
|
+
id: 'Done'
|
|
218
|
+
}),
|
|
219
|
+
cancelButtonProps: cancelButtonProps,
|
|
220
|
+
okButtonProps: okButtonProps,
|
|
221
|
+
children: [(0, _jsxRuntime.jsx)(_input.default, {
|
|
222
|
+
className: "igloo-search-box-modal-input",
|
|
223
|
+
value: modalInputValue,
|
|
224
|
+
onChange: function onChange(e) {
|
|
225
|
+
return setModalInputValue(e.target.value);
|
|
226
|
+
},
|
|
227
|
+
placeholder: modalPlaceHolder,
|
|
228
|
+
suffix: (0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
229
|
+
style: {
|
|
230
|
+
fontSize: 24
|
|
231
|
+
},
|
|
232
|
+
onClick: beginSearch
|
|
233
|
+
}),
|
|
234
|
+
onPressEnter: beginSearch
|
|
235
|
+
}), !!options.length && (0, _jsxRuntime.jsx)("div", {
|
|
236
|
+
style: {
|
|
237
|
+
marginBottom: 32
|
|
238
|
+
}
|
|
239
|
+
}), !!options.length && multiple && (0, _jsxRuntime.jsxs)("div", {
|
|
240
|
+
className: 'igloo-search-box-modal-multiple-top',
|
|
241
|
+
children: [(0, _jsxRuntime.jsx)(_button.default, {
|
|
242
|
+
type: "link",
|
|
243
|
+
onClick: selectAll,
|
|
244
|
+
children: formatMessage({
|
|
245
|
+
id: 'Select All'
|
|
246
|
+
})
|
|
247
|
+
}), (0, _jsxRuntime.jsx)(_button.default, {
|
|
248
|
+
type: "link",
|
|
249
|
+
onClick: cancelAll,
|
|
250
|
+
children: formatMessage({
|
|
251
|
+
id: 'Clear All'
|
|
252
|
+
})
|
|
253
|
+
})]
|
|
254
|
+
}), searching ? (0, _jsxRuntime.jsxs)("div", {
|
|
255
|
+
className: "igloo-search-box-searching",
|
|
256
|
+
children: [(0, _jsxRuntime.jsx)(_iglooicon.LoadingOutlined, {}), ' ', (0, _jsxRuntime.jsx)(_typography.default, {
|
|
257
|
+
level: "body1",
|
|
258
|
+
children: formatMessage({
|
|
259
|
+
id: 'Searching...'
|
|
260
|
+
})
|
|
261
|
+
})]
|
|
262
|
+
}) : options.length ? (0, _jsxRuntime.jsx)(DisPlayOptions, {}) : null]
|
|
263
|
+
});
|
|
264
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
|
265
|
+
children: [(0, _jsxRuntime.jsx)(_input.default, {
|
|
266
|
+
placeholder: placeHolder,
|
|
267
|
+
suffix: (0, _jsxRuntime.jsx)(_iglooicon.SearchOutlined, {
|
|
268
|
+
style: {
|
|
269
|
+
fontSize: 24
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
onClick: function onClick() {
|
|
273
|
+
return setModalVisible(true);
|
|
274
|
+
},
|
|
275
|
+
value: inputDisplayedValue
|
|
276
|
+
}), modalDom]
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
var SearchBox = (0, _optionUtils.optionsHOC)(IglooSearchBox);
|
|
281
|
+
|
|
282
|
+
SearchBox.formItemPropsHandler = function (config) {
|
|
283
|
+
return {};
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
var _default = SearchBox;
|
|
287
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
.igloo-search-box-modal-container {
|
|
2
|
+
.ant-modal-body {
|
|
3
|
+
.igloo-search-box-modal-options {
|
|
4
|
+
max-height: calc(100vh - 340px - 172px);
|
|
5
|
+
overflow: scroll;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ant-input-affix-wrapper-status-error {
|
|
9
|
+
border-color: #d9d9d9 !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.igloo-search-box-modal-multiple-top {
|
|
13
|
+
padding: 8px;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.igloo-search-box-searching {
|
|
20
|
+
margin-top: 24px;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
|
|
24
|
+
@keyframes rotation {
|
|
25
|
+
from {
|
|
26
|
+
transform: rotate(0deg);
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
transform: rotate(360deg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& > .igloo-icon {
|
|
34
|
+
font-size: 24px;
|
|
35
|
+
color: #5858ff;
|
|
36
|
+
margin-right: 8px;
|
|
37
|
+
animation: rotation 3s linear infinite;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.igloo-search-box-modal-select-item {
|
|
42
|
+
padding: 8px;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
|
|
46
|
+
.igloo-search-box-modal-select-item-checkbox {
|
|
47
|
+
margin-right: 10px;
|
|
48
|
+
|
|
49
|
+
.ant-checkbox-checked .ant-checkbox-inner {
|
|
50
|
+
background-color: #666666;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
background: #f9f9f9;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.igloo-search-box-active-select-item {
|
|
61
|
+
background-color: #f6f6ff;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.igloo-search-box-modal-container-mobile {
|
|
67
|
+
top: 0px !important;
|
|
68
|
+
margin: 0px !important;
|
|
69
|
+
width: 100vw !important;
|
|
70
|
+
max-width: 100vw !important;
|
|
71
|
+
height: 100vh !important;
|
|
72
|
+
|
|
73
|
+
.igloo-search-box-modal-mobile-title {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
width: 100%;
|
|
77
|
+
background-color: white;
|
|
78
|
+
|
|
79
|
+
.igloo-icon {
|
|
80
|
+
font-size: 24px;
|
|
81
|
+
margin-right: 8px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ant-modal-content {
|
|
86
|
+
position: relative;
|
|
87
|
+
height: 100%;
|
|
88
|
+
|
|
89
|
+
.ant-modal-body {
|
|
90
|
+
height: 100%;
|
|
91
|
+
max-height: calc(100vh - 140px - 60px);
|
|
92
|
+
padding: 24px 16px 0px 16px;
|
|
93
|
+
|
|
94
|
+
.igloo-search-box-modal-options {
|
|
95
|
+
max-height: calc(100vh - 140px - 60px - 150px);
|
|
96
|
+
overflow: scroll;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ant-input-affix-wrapper-status-error {
|
|
100
|
+
border-color: #d9d9d9 !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.igloo-search-box-modal-multiple-top {
|
|
104
|
+
padding: 8px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.igloo-search-box-searching {
|
|
111
|
+
margin-top: 24px;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
|
|
115
|
+
@keyframes rotation {
|
|
116
|
+
from {
|
|
117
|
+
transform: rotate(0deg);
|
|
118
|
+
}
|
|
119
|
+
to {
|
|
120
|
+
transform: rotate(360deg);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
& > .igloo-icon {
|
|
125
|
+
font-size: 24px;
|
|
126
|
+
color: #5858ff;
|
|
127
|
+
margin-right: 8px;
|
|
128
|
+
animation: rotation 3s linear infinite;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.igloo-search-box-modal-select-item {
|
|
133
|
+
padding: 8px;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
|
|
137
|
+
.igloo-search-box-modal-select-item-checkbox {
|
|
138
|
+
margin-right: 10px;
|
|
139
|
+
|
|
140
|
+
.ant-checkbox-checked .ant-checkbox-inner {
|
|
141
|
+
background-color: #666666;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:hover {
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
background: #f9f9f9;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.igloo-search-box-active-select-item {
|
|
152
|
+
background-color: #f6f6ff;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ant-modal-footer {
|
|
157
|
+
position: absolute;
|
|
158
|
+
bottom: 0px;
|
|
159
|
+
width: 100%;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { SelectProps, SelectValue } from 'antd/es/select';
|
|
2
2
|
import { FC, IglooComponentProps } from '../types';
|
|
3
|
-
import { FormInstance } from 'antd/es/form';
|
|
4
3
|
import './style';
|
|
5
|
-
import {
|
|
4
|
+
import { ComponentProps } from '../utils/option-utils';
|
|
6
5
|
export declare const Option: import("rc-select/lib/Option").OptionFC, OptGroup: import("rc-select/lib/OptGroup").OptionGroupFC;
|
|
7
6
|
declare type Props = SelectProps<SelectValue> & IglooComponentProps & {
|
|
8
|
-
getOptions?: (form: FormInstance) => any[];
|
|
9
7
|
multiple?: boolean;
|
|
10
|
-
|
|
11
|
-
optionGroups?: {
|
|
12
|
-
parentKey: string;
|
|
13
|
-
options: Props['options'];
|
|
14
|
-
}[];
|
|
15
|
-
datasourceKey?: string;
|
|
16
|
-
datasourceApi?: string;
|
|
17
|
-
dependField?: NamePath;
|
|
18
|
-
};
|
|
8
|
+
} & ComponentProps;
|
|
19
9
|
declare type OptionType = typeof Option;
|
|
20
10
|
declare type OptGroupType = typeof OptGroup;
|
|
21
11
|
interface IglooSelectType extends FC<Props> {
|