@capillarytech/blaze-ui 0.1.6-alpha.4 → 0.1.6-alpha.41

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 (95) hide show
  1. package/.DS_Store +0 -0
  2. package/CapInput/CapInput.js +1 -1
  3. package/CapInput/Number.js +1 -1
  4. package/CapInput/Search.js +1 -1
  5. package/CapInput/TextArea.js +1 -1
  6. package/CapSkeleton/CapSkeleton.js +17 -0
  7. package/CapSkeleton/index.js +1 -0
  8. package/CapSpin/CapSpin.js +23 -0
  9. package/CapSpin/index.js +1 -0
  10. package/CapTable/loadable.js +4 -4
  11. package/CapTable/styles.js +1 -1
  12. package/CapTestSelect/CapTestSelect.js +47 -0
  13. package/CapTestSelect/index.js +1 -0
  14. package/CapUnifiedSelect/CapUnifiedSelect.js +252 -61
  15. package/CapUnifiedSelect/index.js +1 -4
  16. package/CapUnifiedSelect/styles.js +170 -166
  17. package/assets/upload.svg +3 -0
  18. package/index.js +7 -1
  19. package/package.json +7 -11
  20. package/utils/index.js +1 -0
  21. package/utils/withStyles.js +24 -0
  22. package/CapHeading/CapHeading.js +0 -71
  23. package/CapHeading/index.js +0 -1
  24. package/CapHeading/styles.js +0 -125
  25. package/CapInfoNote/CapInfoNote.js +0 -54
  26. package/CapInfoNote/index.js +0 -1
  27. package/CapInfoNote/styles.js +0 -63
  28. package/CapInput/loadable.js +0 -9
  29. package/CapLabel/CapLabel.js +0 -106
  30. package/CapLabel/index.js +0 -1
  31. package/CapLabel/styles.js +0 -221
  32. package/CapRow/CapRow.js +0 -22
  33. package/CapRow/index.js +0 -1
  34. package/CapRow/styles.js +0 -9
  35. package/CapTooltip/CapTooltip.js +0 -36
  36. package/CapTooltip/index.js +0 -1
  37. package/CapTooltip/styles.js +0 -42
  38. package/CapUnifiedSelect/loadable.js +0 -3
  39. package/dist/235.index.js +0 -2
  40. package/dist/235.index.js.LICENSE.txt +0 -29
  41. package/dist/603.index.js +0 -1
  42. package/dist/CapInput/CapInput.js +0 -66
  43. package/dist/CapInput/Number.js +0 -42
  44. package/dist/CapInput/Search.js +0 -35
  45. package/dist/CapInput/TextArea.js +0 -42
  46. package/dist/CapInput/index.js +0 -15
  47. package/dist/CapInput/messages.js +0 -32
  48. package/dist/CapInput/styles.js +0 -11
  49. package/dist/CapTable/CapTable.js +0 -148
  50. package/dist/CapTable/index.js +0 -9
  51. package/dist/CapTable/loadable.js +0 -23
  52. package/dist/CapTable/styles.js +0 -26
  53. package/dist/LocaleHoc/index.js +0 -40
  54. package/dist/esm/CapHeading/CapHeading.js +0 -41
  55. package/dist/esm/CapHeading/index.js +0 -1
  56. package/dist/esm/CapHeading/styles.js +0 -123
  57. package/dist/esm/CapInfoNote/CapInfoNote.js +0 -62
  58. package/dist/esm/CapInfoNote/index.js +0 -1
  59. package/dist/esm/CapInfoNote/styles.js +0 -6
  60. package/dist/esm/CapInput/CapInput.js +0 -57
  61. package/dist/esm/CapInput/Number.js +0 -35
  62. package/dist/esm/CapInput/Search.js +0 -28
  63. package/dist/esm/CapInput/TextArea.js +0 -35
  64. package/dist/esm/CapInput/index.js +0 -8
  65. package/dist/esm/CapInput/loadable.js +0 -9
  66. package/dist/esm/CapInput/messages.js +0 -25
  67. package/dist/esm/CapInput/styles.js +0 -3
  68. package/dist/esm/CapLabel/CapLabel.js +0 -50
  69. package/dist/esm/CapLabel/index.js +0 -1
  70. package/dist/esm/CapLabel/styles.js +0 -219
  71. package/dist/esm/CapRow/CapRow.js +0 -22
  72. package/dist/esm/CapRow/index.js +0 -1
  73. package/dist/esm/CapRow/styles.js +0 -5
  74. package/dist/esm/CapTable/CapTable.js +0 -140
  75. package/dist/esm/CapTable/index.js +0 -2
  76. package/dist/esm/CapTable/loadable.js +0 -12
  77. package/dist/esm/CapTable/styles.js +0 -17
  78. package/dist/esm/CapTooltip/CapTooltip.js +0 -34
  79. package/dist/esm/CapTooltip/index.js +0 -1
  80. package/dist/esm/CapTooltip/styles.js +0 -6
  81. package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +0 -101
  82. package/dist/esm/CapUnifiedSelect/index.js +0 -3
  83. package/dist/esm/CapUnifiedSelect/loadable.js +0 -4
  84. package/dist/esm/CapUnifiedSelect/messages.js +0 -23
  85. package/dist/esm/CapUnifiedSelect/styles.js +0 -15
  86. package/dist/esm/LocaleHoc/index.js +0 -31
  87. package/dist/esm/index.js +0 -11
  88. package/dist/esm/styled/index.js +0 -5
  89. package/dist/esm/styled/variables.js +0 -88
  90. package/dist/esm/translations/en.js +0 -329
  91. package/dist/index.js +0 -39
  92. package/dist/index.js.LICENSE.txt +0 -7
  93. package/dist/styled/index.js +0 -22
  94. package/dist/styled/variables.js +0 -94
  95. package/dist/translations/en.js +0 -335
package/.DS_Store ADDED
Binary file
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Input } from 'antd';
3
+ import { Input } from 'antd-v5';
4
4
  import { WarningOutlined, CheckCircleOutlined } from '@ant-design/icons';
5
5
  import styled from 'styled-components';
6
6
  import * as styledVars from '../styled/variables';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { InputNumber } from 'antd';
3
+ import { InputNumber } from 'antd-v5';
4
4
 
5
5
  const CapInputNumber = React.forwardRef((props, ref) => {
6
6
  const { size = 'large', ...rest } = props;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Input } from 'antd';
3
+ import { Input } from 'antd-v5';
4
4
 
5
5
  const { Search } = Input;
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Input } from 'antd';
3
+ import { Input } from 'antd-v5';
4
4
 
5
5
  const { TextArea } = Input;
6
6
 
@@ -0,0 +1,17 @@
1
+ /**
2
+ * CapSkeleton - Migrated to Ant Design v5
3
+ */
4
+ import React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { Skeleton } from 'antd-v5';
7
+
8
+ const CapSkeleton = ({ className, ...rest }) => {
9
+ const combinedClassName = `cap-skeleton-v2 ${className || ''}`.trim();
10
+ return <Skeleton className={combinedClassName} {...rest} />;
11
+ };
12
+
13
+ CapSkeleton.propTypes = {
14
+ className: PropTypes.string
15
+ };
16
+
17
+ export default CapSkeleton;
@@ -0,0 +1 @@
1
+ export { default } from './CapSkeleton';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CapSpin - Migrated to Ant Design v5
3
+ */
4
+ import React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { Spin } from 'antd-v5';
7
+
8
+ const CapSpin = ({ className, ...rest }) => (
9
+ <Spin className={className} {...rest} />
10
+ );
11
+
12
+ CapSpin.propTypes = {
13
+ className: PropTypes.string,
14
+ size: PropTypes.oneOf(['small', 'default', 'large']),
15
+ spinning: PropTypes.bool,
16
+ tip: PropTypes.string,
17
+ delay: PropTypes.number,
18
+ indicator: PropTypes.node,
19
+ fullscreen: PropTypes.bool,
20
+ wrapperClassName: PropTypes.string
21
+ };
22
+
23
+ export default CapSpin;
@@ -0,0 +1 @@
1
+ export { default } from './CapSpin';
@@ -1,12 +1,12 @@
1
- import CapSpin from '@capillarytech/cap-ui-library/CapSpin';
1
+ import CapSkeleton from '../CapSkeleton';
2
2
  import { loadable } from '@capillarytech/cap-ui-utils';
3
3
  import React, { Suspense } from 'react';
4
4
 
5
5
  const LoadableComponent = loadable(() => import('./CapTable'));
6
6
 
7
- const CapTableLoadable = () => (
8
- <Suspense fallback={<CapSpin />}>
9
- <LoadableComponent />
7
+ const CapTableLoadable = (props) => (
8
+ <Suspense fallback={<CapSkeleton />}>
9
+ <LoadableComponent {...props} />
10
10
  </Suspense>
11
11
  );
12
12
 
@@ -1,4 +1,4 @@
1
- import { Table } from 'antd';
1
+ import { Table } from 'antd-v5';
2
2
  import styled from 'styled-components';
3
3
  import * as styledVars from '../styled/variables';
4
4
 
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Select } from 'antd-v5';
4
+
5
+ /**
6
+ * Test component to verify Ant Design v5 Select integration
7
+ * This is a simple wrapper for testing purposes only
8
+ */
9
+ const CapTestSelect = (props) => {
10
+ return <Select {...props} />;
11
+ };
12
+
13
+ CapTestSelect.propTypes = {
14
+ // Common Select props from antd
15
+ allowClear: PropTypes.bool,
16
+ defaultValue: PropTypes.oneOfType([
17
+ PropTypes.string,
18
+ PropTypes.number,
19
+ PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
20
+ ]),
21
+ disabled: PropTypes.bool,
22
+ loading: PropTypes.bool,
23
+ mode: PropTypes.oneOf(['multiple', 'tags']),
24
+ placeholder: PropTypes.string,
25
+ showSearch: PropTypes.bool,
26
+ value: PropTypes.oneOfType([
27
+ PropTypes.string,
28
+ PropTypes.number,
29
+ PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
30
+ ]),
31
+ options: PropTypes.arrayOf(
32
+ PropTypes.shape({
33
+ label: PropTypes.node,
34
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
35
+ disabled: PropTypes.bool
36
+ })
37
+ )
38
+ };
39
+
40
+ CapTestSelect.defaultProps = {
41
+ allowClear: false,
42
+ disabled: false,
43
+ loading: false,
44
+ showSearch: false
45
+ };
46
+
47
+ export default CapTestSelect;
@@ -0,0 +1 @@
1
+ export { default } from './CapTestSelect';
@@ -1,121 +1,312 @@
1
- // CapUnifiedSelect component using Ant Design v5 Select and TreeSelect directly
2
- import React from 'react';
1
+ // Enhanced CapUnifiedSelect supporting 4 scenarios with advanced features in a single TreeSelect
2
+ import React, { useState, useEffect, useMemo, useCallback, memo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { Select, TreeSelect } from 'antd';
5
- import { SelectWrapper, HeaderWrapper, StyledInfoIcon } from './styles';
6
- import CapLabel from '../CapLabel';
7
- import CapTooltip from '../CapTooltip';
4
+ import classnames from 'classnames';
5
+ import { TreeSelect, Tooltip, Input, Button } from 'antd-v5';
6
+ import styled from 'styled-components';
7
+ import * as styledVars from '../styled/variables';
8
+ import uploadIcon from '../assets/upload.svg';
8
9
 
9
- function CapUnifiedSelect({
10
+ import { InfoCircleOutlined, SearchOutlined, WarningFilled, DownOutlined } from '@ant-design/icons';
11
+
12
+ import withStyles from '../utils/withStyles';
13
+ import { SelectWrapper, HeaderWrapper, selectStyles } from './styles';
14
+
15
+ const StyledTreeSelect = styled(TreeSelect)`
16
+ ${selectStyles}
17
+ `;
18
+
19
+ const CapUnifiedSelect = ({
10
20
  type,
11
21
  options = [],
12
- treeData,
13
22
  value,
14
23
  onChange,
15
24
  placeholder = 'Select an option',
16
25
  className,
17
26
  style,
27
+ isError = false,
28
+ errorMessage,
29
+ popupClassName,
18
30
  allowClear = false,
19
- showSearch = false,
20
- label,
31
+ headerLabel,
21
32
  tooltip,
33
+ bylineText,
22
34
  disabled = false,
23
- }) {
24
- const selectVirtualizationProps = {
25
- listHeight: 256,
26
- };
35
+ showUpload = false,
36
+ customPopupRender = true,
37
+ showSearch = true,
38
+ searchBasedOn = 'label',
39
+ onConfirm,
40
+ onCancel,
41
+ noResultText = 'No results found',
42
+ ...rest
43
+ }) => {
44
+
45
+ const [searchText, setSearchText] = useState('');
46
+ const [tempValue, setTempValue] = useState(value);
47
+ const [allSelected, setAllSelected] = useState(false);
48
+
49
+
50
+ useEffect(() => {
51
+ setTempValue(value);
52
+ }, [value]);
27
53
 
28
54
  const treeSelectVirtualizationProps = {
29
55
  listHeight: 256,
30
56
  listItemHeight: 32,
31
57
  };
32
58
 
33
- const renderHeader = () => {
34
- if (!label && !tooltip) return null;
35
-
59
+ const NoResult = memo(({ noResultText, className }) => (
60
+ <div className={classnames(className, "cap-unified-select-no-result")}>
61
+ <WarningFilled className="cap-unified-select-no-result-icon" />
62
+ <div className="cap-unified-select-no-result-text">{noResultText}</div>
63
+ </div>
64
+ ));
65
+
66
+ const getFilteredTreeData = useCallback((data, search) => {
67
+ if (!search) return data;
68
+
69
+ const filterNode = node => {
70
+ if (searchBasedOn === 'value') {
71
+ const valueText = String(node.value || '').toLowerCase();
72
+ return valueText.includes(search.toLowerCase());
73
+ } else if (searchBasedOn === 'key') {
74
+ const keyText = String(node.key || '').toLowerCase();
75
+ return keyText.includes(search.toLowerCase());
76
+ } else {
77
+ const labelText = node.label?.toLowerCase() || '';
78
+ return labelText.includes(search.toLowerCase());
79
+ }
80
+ };
81
+
82
+ const loop = data =>
83
+ data.map(item => {
84
+ const children = item.children ? loop(item.children) : [];
85
+ if (filterNode(item) || children.length) {
86
+ return { ...item, children };
87
+ }
88
+ return null;
89
+ }).filter(Boolean);
90
+
91
+ return loop(data);
92
+ }, [searchBasedOn]);
93
+
94
+ const flattenLeafValues = useCallback(nodes =>
95
+ nodes?.flatMap(node => node.children ? flattenLeafValues(node.children) : [node.value]) || [], []);
96
+
97
+ const isMulti = useMemo(() => type === 'multiSelect' || type === 'multiTreeSelect', [type]);
98
+ const isTree = useMemo(() => type === 'treeSelect' || type === 'multiTreeSelect', [type]);
99
+
100
+ const dataSource = useMemo(() => {
101
+ return isTree ? options : options.map(opt => ({ title: opt.label, value: opt.value, key: opt.key || opt.value }));
102
+ }, [isTree, options]);
103
+
104
+ const filteredTree = useMemo(() => getFilteredTreeData(dataSource, searchText), [dataSource, searchText]);
105
+ const leafValues = useMemo(() => flattenLeafValues(filteredTree), [filteredTree]);
106
+
107
+ const handleSelectAll = useCallback(() => {
108
+ const availableValues = leafValues;
109
+ if (allSelected) {
110
+ setTempValue([]);
111
+ setAllSelected(false);
112
+ } else {
113
+ setTempValue(availableValues);
114
+ setAllSelected(true);
115
+ }
116
+ }, [allSelected, leafValues]);
117
+
118
+ useEffect(() => {
119
+ if (isMulti && Array.isArray(tempValue)) {
120
+ const allItemsSelected = tempValue.length > 0 && leafValues.length > 0 && tempValue.length === leafValues.length;
121
+ setAllSelected(allItemsSelected);
122
+ }
123
+ }, [tempValue, leafValues, isMulti]);
124
+
125
+ const handleConfirm = useCallback(() => {
126
+ if (onChange) onChange(tempValue);
127
+ }, [onChange, tempValue]);
128
+
129
+ const handleCancel = useCallback(() => {
130
+ setTempValue(value);
131
+ }, [value]);
132
+
133
+ const handleTempChange = useCallback(newValue => {
134
+ setTempValue(newValue);
135
+ }, []);
136
+
137
+ const suffix = useMemo(() => {
138
+ return isMulti && Array.isArray(value) && value?.length > 1 ? (
139
+ <>
140
+ <span>+{value.length - 1} more <DownOutlined /></span>
141
+ </>
142
+ ) : (
143
+ <DownOutlined />
144
+ );
145
+ }, [isMulti, value]);
146
+
147
+ const prefix = useMemo(() => {
148
+ if (isMulti && Array.isArray(value) && value?.length > 0) {
149
+ const selectedLabels = options.filter(opt => value.includes(opt.value)).map(opt => opt.label);
150
+ return selectedLabels[0];
151
+ }
152
+ return null;
153
+ }, [isMulti, value, options]);
154
+
155
+ const renderHeader = useCallback(() => {
156
+ if (!headerLabel && !tooltip) return null;
36
157
  return (
37
- <HeaderWrapper className={disabled ? 'disabled' : ''}>
38
- {label && (
39
- <CapLabel type="label16" className={disabled ? 'disabled' : ''}>
40
- {label}
41
- </CapLabel>
42
- )}
158
+ <>
159
+ <HeaderWrapper className={classnames(disabled ? 'disabled' : '', 'cap-unified-select-header')}>
160
+ {headerLabel && <label type="label16" className={classnames(disabled ? 'disabled' : '', 'cap-unified-select-header-label')}>{headerLabel}</label>}
43
161
  {tooltip && (
44
- <CapTooltip title={tooltip}>
45
- <StyledInfoIcon className={disabled ? 'disabled' : ''} />
46
- </CapTooltip>
162
+ <Tooltip title={tooltip} rootClassName="cap-unified-tooltip" className={classnames(disabled ? 'disabled' : '', 'cap-unified-select-header-tooltip')}>
163
+ <InfoCircleOutlined />
164
+ </Tooltip>
47
165
  )}
48
166
  </HeaderWrapper>
167
+ <div className="cap-unified-select-header-byline-text">
168
+ {bylineText && <label className={classnames(disabled ? 'disabled' : '', 'cap-unified-select-header-byline-text')}>{bylineText}</label>}
169
+ </div>
170
+ </>
49
171
  );
50
- };
172
+ }, [headerLabel, tooltip, bylineText, disabled]);
51
173
 
52
174
  const renderDropdown = () => {
53
- if (type === 'treeSelect' || type === 'multiTreeSelect') {
175
+ const currentItems = filteredTree;
176
+ const selectedCount = Array.isArray(tempValue)
177
+ ? isTree
178
+ ? tempValue.filter(val => leafValues.includes(val)).length
179
+ : tempValue.length
180
+ : (tempValue ? 1 : 0);
181
+
182
+ const renderCustomDropdown = menu => {
183
+ if (!customPopupRender) return menu;
184
+
54
185
  return (
55
- <TreeSelect
56
- treeData={treeData || options}
57
- value={value}
58
- onChange={onChange}
186
+ <div className={classnames(popupClassName, `${type}-popup-container`)}>
187
+ {showSearch && (
188
+ <div className={classnames("cap-unified-select-search-container")}>
189
+ <Input
190
+ prefix={<SearchOutlined style={{ color: styledVars.CAP_G06 }} />}
191
+ placeholder="Search"
192
+ variant="borderless"
193
+ value={searchText}
194
+ onChange={e => setSearchText(e.target.value)}
195
+ onKeyDown={e => e.stopPropagation()}
196
+ />
197
+ </div>
198
+ )}
199
+ {isMulti && showUpload && (
200
+ <div className={classnames("cap-unified-select-upload-container")}>
201
+ <Button
202
+ type="link"
203
+ icon={<img src={uploadIcon} alt="upload" />}
204
+ onClick={() => {}}
205
+ className={classnames("cap-unified-select-upload-button")}
206
+ >
207
+ Upload
208
+ </Button>
209
+ </div>
210
+ )}
211
+ {isMulti && currentItems.length > 0 && (
212
+ <div className={classnames("cap-unified-select-select-all-container")} onClick={e => { e.stopPropagation(); handleSelectAll(); }}>
213
+ <input type="checkbox" checked={allSelected} className={classnames("cap-unified-select-select-all-checkbox")} onClick={e => e.stopPropagation()} />
214
+ <label className={classnames("cap-unified-select-select-all-label")}>Select all</label>
215
+ </div>
216
+ )}
217
+
218
+ {currentItems.length === 0 ? <NoResult noResultText={noResultText} className={classnames(className, "cap-unified-select-no-result")}/> : menu}
219
+
220
+ {currentItems.length > 0 && isMulti && (
221
+ <div className={classnames("cap-unified-select-confirm-container")}>
222
+ <div>
223
+ <Button type="primary" size="small" className={classnames("cap-unified-select-confirm-button")} onClick={e => { e.stopPropagation(); handleConfirm(); }}>Confirm</Button>
224
+ <Button type="text" size="small" onClick={e => { e.stopPropagation(); handleCancel(); }}>Cancel</Button>
225
+ </div>
226
+ {selectedCount > 0 && <span className={classnames("cap-unified-select-selected-count")}>{selectedCount} selected</span>}
227
+ </div>
228
+ )}
229
+ </div>
230
+ );
231
+ };
232
+
233
+ return (
234
+ <>
235
+ <StyledTreeSelect
236
+ {...rest}
237
+ type={type}
238
+ treeData={filteredTree}
239
+ value={customPopupRender ? tempValue : value}
240
+ onChange={customPopupRender ? handleTempChange : onChange}
59
241
  placeholder={placeholder}
60
- className={className}
242
+ showSearch={false}
243
+ maxTagCount={0}
244
+ maxTagPlaceholder={() => null}
245
+ prefix={isMulti && value.length > 0 && prefix}
246
+ suffixIcon={suffix}
247
+ className={classnames(`cap-unified-tree-select ${className || ''}`)}
61
248
  style={style}
249
+ status={isError ? 'error' : ''}
62
250
  allowClear={allowClear}
63
- showSearch={showSearch}
64
- multiple={type === 'multiTreeSelect' ? true : false}
251
+ multiple={isMulti}
252
+ treeCheckable={isMulti}
253
+ showCheckedStrategy={TreeSelect.SHOW_PARENT}
65
254
  virtual
66
- treeDefaultExpandAll
67
255
  disabled={disabled}
256
+ filterTreeNode={false}
68
257
  {...treeSelectVirtualizationProps}
258
+ popupRender={renderCustomDropdown}
69
259
  />
70
- );
71
- }
72
-
73
- return (
74
- <Select
75
- value={value}
76
- onChange={onChange}
77
- placeholder={placeholder}
78
- className={className}
79
- style={style}
80
- allowClear={allowClear}
81
- showSearch={showSearch}
82
- options={options}
83
- mode={type === 'multiSelect' ? 'multiple' : undefined}
84
- virtual
85
- disabled={disabled}
86
- {...selectVirtualizationProps}
87
- />
260
+ {isError && <div className={classnames("cap-unified-select-status")}>{errorMessage}</div>}
261
+ </>
88
262
  );
89
263
  };
90
264
 
91
265
  return (
92
- <SelectWrapper>
266
+ <SelectWrapper className={classnames(className, 'cap-unified-select-container')}>
93
267
  {renderHeader()}
94
268
  {renderDropdown()}
95
269
  </SelectWrapper>
96
270
  );
97
- }
271
+ };
98
272
 
99
273
  CapUnifiedSelect.propTypes = {
100
274
  type: PropTypes.oneOf(['select', 'multiSelect', 'treeSelect', 'multiTreeSelect']),
101
275
  options: PropTypes.array,
102
- treeData: PropTypes.array,
103
276
  value: PropTypes.any,
104
277
  onChange: PropTypes.func,
105
278
  placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
106
279
  className: PropTypes.string,
107
280
  style: PropTypes.object,
108
281
  allowClear: PropTypes.bool,
109
- showSearch: PropTypes.bool,
110
- label: PropTypes.string,
282
+ headerLabel: PropTypes.string,
111
283
  tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
284
  disabled: PropTypes.bool,
285
+ customPopupRender: PropTypes.bool,
286
+ showSearch: PropTypes.bool,
287
+ searchBasedOn: PropTypes.oneOf(['label', 'value', 'key']),
288
+ onConfirm: PropTypes.func,
289
+ onCancel: PropTypes.func,
290
+ isError: PropTypes.bool,
291
+ errorMessage: PropTypes.string,
292
+ popupClassName: PropTypes.string,
293
+ showUpload: PropTypes.bool,
113
294
  };
114
295
 
115
296
  CapUnifiedSelect.defaultProps = {
116
297
  type: 'select',
298
+ options: [],
299
+ placeholder: 'Select an option',
117
300
  allowClear: false,
118
- showSearch: false,
301
+ customPopupRender: true,
302
+ showSearch: true,
303
+ searchBasedOn: 'label',
304
+ className: '',
305
+ popupClassName: '',
306
+ disabled: false,
307
+ showUpload: false,
308
+ isError: false,
309
+ noResultText: 'No results found'
119
310
  };
120
311
 
121
- export default CapUnifiedSelect;
312
+ export default withStyles(CapUnifiedSelect, selectStyles);
@@ -1,4 +1 @@
1
- import CapUnifiedSelect from './CapUnifiedSelect';
2
- import CapUnifiedSelectLoadable from './loadable';
3
-
4
- export default CapUnifiedSelectLoadable;
1
+ export { default } from './CapUnifiedSelect';