@capillarytech/blaze-ui 0.1.6-alpha.28 → 0.1.6-alpha.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/CapHeading/CapHeading.js +71 -0
- package/CapHeading/index.js +1 -0
- package/CapHeading/styles.js +125 -0
- package/CapInfoNote/CapInfoNote.js +54 -0
- package/CapInfoNote/index.js +1 -0
- package/CapInfoNote/styles.js +63 -0
- package/CapInput/loadable.js +9 -0
- package/CapLabel/CapLabel.js +106 -0
- package/CapLabel/index.js +1 -0
- package/CapLabel/styles.js +221 -0
- package/CapRow/CapRow.js +22 -0
- package/CapRow/index.js +1 -0
- package/CapRow/styles.js +9 -0
- package/CapTable/loadable.js +4 -4
- package/CapTooltip/CapTooltip.js +36 -0
- package/CapTooltip/index.js +1 -0
- package/CapTooltip/styles.js +42 -0
- package/CapUnifiedSelect/CapUnifiedSelect.js +51 -304
- package/CapUnifiedSelect/index.js +4 -1
- package/CapUnifiedSelect/loadable.js +3 -0
- package/CapUnifiedSelect/styles.js +174 -62
- package/dist/235.index.js +2 -0
- package/dist/235.index.js.LICENSE.txt +29 -0
- package/dist/603.index.js +1 -0
- package/dist/CapTable/loadable.js +4 -4
- package/dist/esm/CapHeading/CapHeading.js +41 -0
- package/dist/esm/CapHeading/index.js +1 -0
- package/dist/esm/CapHeading/styles.js +123 -0
- package/dist/esm/CapInfoNote/CapInfoNote.js +62 -0
- package/dist/esm/CapInfoNote/index.js +1 -0
- package/dist/esm/CapInfoNote/styles.js +6 -0
- package/dist/esm/CapInput/loadable.js +9 -0
- package/dist/esm/CapLabel/CapLabel.js +50 -0
- package/dist/esm/CapLabel/index.js +1 -0
- package/dist/esm/CapLabel/styles.js +219 -0
- package/dist/esm/{CapSkeleton/CapSkeleton.js → CapRow/CapRow.js} +12 -12
- package/dist/esm/CapRow/index.js +1 -0
- package/dist/esm/CapRow/styles.js +5 -0
- package/dist/esm/CapTable/loadable.js +4 -4
- package/dist/esm/CapTooltip/CapTooltip.js +34 -0
- package/dist/esm/CapTooltip/index.js +1 -0
- package/dist/esm/CapTooltip/styles.js +6 -0
- package/dist/esm/CapUnifiedSelect/CapUnifiedSelect.js +38 -335
- package/dist/esm/CapUnifiedSelect/index.js +3 -1
- package/dist/esm/CapUnifiedSelect/loadable.js +4 -0
- package/dist/esm/CapUnifiedSelect/styles.js +3 -19
- package/dist/esm/index.js +1 -5
- package/dist/index.js +0 -27
- package/dist/index.js.LICENSE.txt +7 -0
- package/index.js +1 -5
- package/package.json +10 -8
- package/CapSkeleton/CapSkeleton.js +0 -17
- package/CapSkeleton/index.js +0 -1
- package/CapSpin/CapSpin.js +0 -23
- package/CapSpin/index.js +0 -1
- package/CapTestSelect/CapTestSelect.js +0 -47
- package/CapTestSelect/index.js +0 -1
- package/components/CapInput/CapInput.js +0 -67
- package/components/CapInput/Number.js +0 -38
- package/components/CapInput/Search.js +0 -32
- package/components/CapInput/TextArea.js +0 -45
- package/components/CapInput/index.js +0 -10
- package/components/CapInput/messages.js +0 -27
- package/components/CapInput/styles.js +0 -81
- package/components/CapSkeleton/CapSkeleton.js +0 -17
- package/components/CapSkeleton/index.js +0 -1
- package/components/CapSpin/CapSpin.js +0 -23
- package/components/CapSpin/index.js +0 -1
- package/components/CapTable/CapTable.js +0 -146
- package/components/CapTable/index.js +0 -3
- package/components/CapTable/loadable.js +0 -13
- package/components/CapTable/styles.js +0 -134
- package/components/CapTestSelect/CapTestSelect.js +0 -47
- package/components/CapTestSelect/index.js +0 -1
- package/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -374
- package/components/CapUnifiedSelect/index.js +0 -1
- package/components/CapUnifiedSelect/messages.js +0 -24
- package/components/CapUnifiedSelect/styles.js +0 -111
- package/components/LocaleHoc/index.js +0 -38
- package/components/index.js +0 -14
- package/components/styled/index.js +0 -6
- package/components/styled/variables.js +0 -89
- package/components/translations/en.js +0 -331
- package/dist/CapSkeleton/CapSkeleton.js +0 -29
- package/dist/CapSkeleton/index.js +0 -13
- package/dist/CapSpin/CapSpin.js +0 -35
- package/dist/CapSpin/index.js +0 -13
- package/dist/CapTestSelect/CapTestSelect.js +0 -40
- package/dist/CapTestSelect/index.js +0 -13
- package/dist/CapUnifiedSelect/CapUnifiedSelect.js +0 -405
- package/dist/CapUnifiedSelect/index.js +0 -13
- package/dist/CapUnifiedSelect/messages.js +0 -29
- package/dist/CapUnifiedSelect/styles.js +0 -39
- package/dist/components/CapInput/CapInput.js +0 -66
- package/dist/components/CapInput/Number.js +0 -42
- package/dist/components/CapInput/Search.js +0 -35
- package/dist/components/CapInput/TextArea.js +0 -42
- package/dist/components/CapInput/index.js +0 -15
- package/dist/components/CapInput/messages.js +0 -32
- package/dist/components/CapInput/styles.js +0 -11
- package/dist/components/CapSkeleton/CapSkeleton.js +0 -29
- package/dist/components/CapSkeleton/index.js +0 -13
- package/dist/components/CapSpin/CapSpin.js +0 -35
- package/dist/components/CapSpin/index.js +0 -13
- package/dist/components/CapTable/CapTable.js +0 -148
- package/dist/components/CapTable/index.js +0 -9
- package/dist/components/CapTable/loadable.js +0 -23
- package/dist/components/CapTable/styles.js +0 -26
- package/dist/components/CapTestSelect/CapTestSelect.js +0 -40
- package/dist/components/CapTestSelect/index.js +0 -13
- package/dist/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -406
- package/dist/components/CapUnifiedSelect/index.js +0 -13
- package/dist/components/CapUnifiedSelect/messages.js +0 -29
- package/dist/components/CapUnifiedSelect/styles.js +0 -39
- package/dist/components/LocaleHoc/index.js +0 -40
- package/dist/components/index.js +0 -66
- package/dist/components/styled/index.js +0 -22
- package/dist/components/styled/variables.js +0 -94
- package/dist/components/translations/en.js +0 -335
- package/dist/esm/CapSkeleton/index.js +0 -1
- package/dist/esm/CapSpin/CapSpin.js +0 -28
- package/dist/esm/CapSpin/index.js +0 -1
- package/dist/esm/CapTestSelect/CapTestSelect.js +0 -34
- package/dist/esm/CapTestSelect/index.js +0 -1
- package/dist/esm/components/CapInput/CapInput.js +0 -57
- package/dist/esm/components/CapInput/Number.js +0 -35
- package/dist/esm/components/CapInput/Search.js +0 -28
- package/dist/esm/components/CapInput/TextArea.js +0 -35
- package/dist/esm/components/CapInput/index.js +0 -8
- package/dist/esm/components/CapInput/messages.js +0 -25
- package/dist/esm/components/CapInput/styles.js +0 -3
- package/dist/esm/components/CapSkeleton/CapSkeleton.js +0 -22
- package/dist/esm/components/CapSkeleton/index.js +0 -1
- package/dist/esm/components/CapSpin/CapSpin.js +0 -28
- package/dist/esm/components/CapSpin/index.js +0 -1
- package/dist/esm/components/CapTable/CapTable.js +0 -140
- package/dist/esm/components/CapTable/index.js +0 -2
- package/dist/esm/components/CapTable/loadable.js +0 -12
- package/dist/esm/components/CapTable/styles.js +0 -17
- package/dist/esm/components/CapTestSelect/CapTestSelect.js +0 -34
- package/dist/esm/components/CapTestSelect/index.js +0 -1
- package/dist/esm/components/CapUnifiedSelect/CapUnifiedSelect.js +0 -398
- package/dist/esm/components/CapUnifiedSelect/index.js +0 -1
- package/dist/esm/components/CapUnifiedSelect/messages.js +0 -23
- package/dist/esm/components/CapUnifiedSelect/styles.js +0 -31
- package/dist/esm/components/LocaleHoc/index.js +0 -31
- package/dist/esm/components/index.js +0 -15
- package/dist/esm/components/styled/index.js +0 -5
- package/dist/esm/components/styled/variables.js +0 -88
- package/dist/esm/components/translations/en.js +0 -329
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/withStyles.js +0 -23
- package/dist/esm/withStyles.js +0 -23
- package/dist/utils/index.js +0 -13
- package/dist/utils/withStyles.js +0 -29
- package/dist/withStyles.js +0 -29
- package/utils/index.js +0 -1
- package/utils/withStyles.js +0 -24
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import * as styledVars from '../styled/variables';
|
|
3
|
+
export var TooltipWrapper = styled.span.withConfig({
|
|
4
|
+
displayName: "TooltipWrapper",
|
|
5
|
+
componentId: "sc-17x5zp5-0"
|
|
6
|
+
})([".cap-tooltip{max-width:324px;.ant-tooltip-inner{background-color:", ";font-size:", ";font-weight:", ";padding:6px 8px;min-height:32px;border-radius:", ";}&.cap-bgcolor-tooltip{.ant-tooltip-inner{background-color:", ";}}&.hide-tooltip-pointer{.ant-tooltip-arrow{display:none;}}}.button-disabled-tooltip-wrapper{display:inline-flex;cursor:not-allowed;.cap-button.ant-btn[disabled]{pointer-events:none;& > *{pointer-events:auto;cursor:not-allowed;}}}"], styledVars.FONT_COLOR_01, styledVars.FONT_SIZE_M, styledVars.FONT_WEIGHT_MEDIUM, styledVars.RADIUS_04, styledVars.FONT_COLOR_05);
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
-
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."); }
|
|
10
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
-
// Enhanced CapUnifiedSelect supporting 4 scenarios with advanced features
|
|
15
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
+
// CapUnifiedSelect component using Ant Design v5 Select and TreeSelect directly
|
|
3
|
+
import React from 'react';
|
|
16
4
|
import PropTypes from 'prop-types';
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
import styled from 'styled-components';
|
|
23
|
-
var CapUnifiedSelect = function CapUnifiedSelect(_ref) {
|
|
5
|
+
import { Select, TreeSelect } from 'antd';
|
|
6
|
+
import { SelectWrapper, HeaderWrapper, StyledInfoIcon } from './styles';
|
|
7
|
+
import CapLabel from '../CapLabel';
|
|
8
|
+
import CapTooltip from '../CapTooltip';
|
|
9
|
+
function CapUnifiedSelect(_ref) {
|
|
24
10
|
var type = _ref.type,
|
|
25
11
|
_ref$options = _ref.options,
|
|
26
12
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
@@ -31,45 +17,14 @@ var CapUnifiedSelect = function CapUnifiedSelect(_ref) {
|
|
|
31
17
|
placeholder = _ref$placeholder === void 0 ? 'Select an option' : _ref$placeholder,
|
|
32
18
|
className = _ref.className,
|
|
33
19
|
style = _ref.style,
|
|
34
|
-
status = _ref.status,
|
|
35
|
-
statusMessage = _ref.statusMessage,
|
|
36
20
|
_ref$allowClear = _ref.allowClear,
|
|
37
21
|
allowClear = _ref$allowClear === void 0 ? false : _ref$allowClear,
|
|
22
|
+
_ref$showSearch = _ref.showSearch,
|
|
23
|
+
showSearch = _ref$showSearch === void 0 ? false : _ref$showSearch,
|
|
38
24
|
label = _ref.label,
|
|
39
25
|
tooltip = _ref.tooltip,
|
|
40
26
|
_ref$disabled = _ref.disabled,
|
|
41
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
42
|
-
_ref$treeCheckable = _ref.treeCheckable,
|
|
43
|
-
treeCheckable = _ref$treeCheckable === void 0 ? false : _ref$treeCheckable,
|
|
44
|
-
_ref$customPopupRende = _ref.customPopupRender,
|
|
45
|
-
customPopupRender = _ref$customPopupRende === void 0 ? false : _ref$customPopupRende,
|
|
46
|
-
onConfirm = _ref.onConfirm,
|
|
47
|
-
onCancel = _ref.onCancel;
|
|
48
|
-
var StyledSelect = styled(Select).withConfig({
|
|
49
|
-
displayName: "StyledSelect",
|
|
50
|
-
componentId: "sc-wsphu8-0"
|
|
51
|
-
})(["", ""], selectStyles);
|
|
52
|
-
var StyledTreeSelect = styled(TreeSelect).withConfig({
|
|
53
|
-
displayName: "StyledTreeSelect",
|
|
54
|
-
componentId: "sc-wsphu8-1"
|
|
55
|
-
})(["", ""], selectStyles);
|
|
56
|
-
var _useState = useState(''),
|
|
57
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
-
searchText = _useState2[0],
|
|
59
|
-
setSearchText = _useState2[1];
|
|
60
|
-
var _useState3 = useState(value),
|
|
61
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
-
tempValue = _useState4[0],
|
|
63
|
-
setTempValue = _useState4[1];
|
|
64
|
-
var _useState5 = useState(false),
|
|
65
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
66
|
-
allSelected = _useState6[0],
|
|
67
|
-
setAllSelected = _useState6[1];
|
|
68
|
-
|
|
69
|
-
// Update tempValue when value changes
|
|
70
|
-
useEffect(function () {
|
|
71
|
-
setTempValue(value);
|
|
72
|
-
}, [value]);
|
|
27
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
73
28
|
var selectVirtualizationProps = {
|
|
74
29
|
listHeight: 256
|
|
75
30
|
};
|
|
@@ -77,299 +32,52 @@ var CapUnifiedSelect = function CapUnifiedSelect(_ref) {
|
|
|
77
32
|
listHeight: 256,
|
|
78
33
|
listItemHeight: 32
|
|
79
34
|
};
|
|
80
|
-
|
|
81
|
-
// No results component
|
|
82
|
-
var NoResult = function NoResult() {
|
|
83
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
style: {
|
|
85
|
-
display: 'flex',
|
|
86
|
-
flexDirection: 'column',
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
justifyContent: 'center',
|
|
89
|
-
height: 200,
|
|
90
|
-
color: '#8c8c8c',
|
|
91
|
-
fontSize: 14
|
|
92
|
-
}
|
|
93
|
-
}, /*#__PURE__*/React.createElement(WarningFilled, {
|
|
94
|
-
style: {
|
|
95
|
-
fontSize: 36,
|
|
96
|
-
marginBottom: 8,
|
|
97
|
-
color: '#bfbfbf'
|
|
98
|
-
}
|
|
99
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
style: {
|
|
101
|
-
fontWeight: 500
|
|
102
|
-
}
|
|
103
|
-
}, "No results found"));
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Filter tree data based on search text
|
|
107
|
-
var getFilteredTreeData = function getFilteredTreeData(data, search) {
|
|
108
|
-
if (!search) return data;
|
|
109
|
-
var filterNode = function filterNode(node) {
|
|
110
|
-
var _node$title, _node$label;
|
|
111
|
-
var titleText = ((_node$title = node.title) === null || _node$title === void 0 ? void 0 : _node$title.toLowerCase()) || '';
|
|
112
|
-
var labelText = ((_node$label = node.label) === null || _node$label === void 0 ? void 0 : _node$label.toLowerCase()) || '';
|
|
113
|
-
return titleText.includes(search.toLowerCase()) || labelText.includes(search.toLowerCase());
|
|
114
|
-
};
|
|
115
|
-
var _loop = function loop(data) {
|
|
116
|
-
return data.map(function (item) {
|
|
117
|
-
var children = item.children ? _loop(item.children) : [];
|
|
118
|
-
if (filterNode(item) || children.length) {
|
|
119
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
120
|
-
children: children
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return null;
|
|
124
|
-
}).filter(Boolean);
|
|
125
|
-
};
|
|
126
|
-
return _loop(data);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// Get all leaf node values from tree data
|
|
130
|
-
var _flattenedLeafValues = function flattenedLeafValues(nodes) {
|
|
131
|
-
return (nodes === null || nodes === void 0 ? void 0 : nodes.flatMap(function (node) {
|
|
132
|
-
return node.children ? _flattenedLeafValues(node.children) : [node.value];
|
|
133
|
-
})) || [];
|
|
134
|
-
};
|
|
135
|
-
var filteredTree = getFilteredTreeData(treeData || options, searchText);
|
|
136
|
-
var filteredOptions = !searchText ? options : options.filter(function (opt) {
|
|
137
|
-
var _opt$label;
|
|
138
|
-
return (_opt$label = opt.label) === null || _opt$label === void 0 ? void 0 : _opt$label.toLowerCase().includes(searchText.toLowerCase());
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// All available leaf values for the current filtered tree data
|
|
142
|
-
var leafValues = _flattenedLeafValues(filteredTree);
|
|
143
|
-
|
|
144
|
-
// Handles select all checkbox click
|
|
145
|
-
var handleSelectAll = function handleSelectAll() {
|
|
146
|
-
var isTree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
147
|
-
var availableValues = isTree ? leafValues : filteredOptions.map(function (opt) {
|
|
148
|
-
return opt.value;
|
|
149
|
-
});
|
|
150
|
-
if (allSelected) {
|
|
151
|
-
setTempValue([]);
|
|
152
|
-
} else {
|
|
153
|
-
setTempValue(availableValues);
|
|
154
|
-
}
|
|
155
|
-
setAllSelected(!allSelected);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// Update allSelected state when value changes
|
|
159
|
-
useEffect(function () {
|
|
160
|
-
var isMultipleMode = type === 'multiSelect' || type === 'multiTreeSelect';
|
|
161
|
-
if (isMultipleMode && Array.isArray(tempValue)) {
|
|
162
|
-
var availableValues = type.includes('tree') ? leafValues : filteredOptions.map(function (opt) {
|
|
163
|
-
return opt.value;
|
|
164
|
-
});
|
|
165
|
-
setAllSelected(tempValue.length > 0 && tempValue.length === availableValues.length);
|
|
166
|
-
}
|
|
167
|
-
}, [tempValue, filteredOptions, leafValues, type]);
|
|
168
|
-
|
|
169
|
-
// Handle confirmation
|
|
170
|
-
var handleConfirm = function handleConfirm() {
|
|
171
|
-
if (onConfirm) {
|
|
172
|
-
onConfirm(tempValue);
|
|
173
|
-
} else {
|
|
174
|
-
onChange(tempValue);
|
|
175
|
-
}
|
|
176
|
-
setSearchText('');
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// Handle cancellation
|
|
180
|
-
var handleCancel = function handleCancel() {
|
|
181
|
-
if (onCancel) {
|
|
182
|
-
onCancel();
|
|
183
|
-
}
|
|
184
|
-
setTempValue(value);
|
|
185
|
-
setSearchText('');
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// Handle temporary value change
|
|
189
|
-
var handleTempChange = function handleTempChange(newValue) {
|
|
190
|
-
setTempValue(newValue);
|
|
191
|
-
};
|
|
192
|
-
var suffix = (type === "multiTreeSelect" || type === "multiSelect") && Array.isArray(value) && value.length > 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, "+", value.length - 1, " more", /*#__PURE__*/React.createElement(DownOutlined, null))) : /*#__PURE__*/React.createElement(DownOutlined, null);
|
|
193
|
-
var prefix = function prefix() {
|
|
194
|
-
if ((type === "multiTreeSelect" || type === "multiSelect") && Array.isArray(value) && value.length > 0) {
|
|
195
|
-
var selectedLabels = options.filter(function (opt) {
|
|
196
|
-
return value.includes(opt.value);
|
|
197
|
-
}).map(function (opt) {
|
|
198
|
-
return opt.label;
|
|
199
|
-
});
|
|
200
|
-
return selectedLabels[0];
|
|
201
|
-
} else {
|
|
202
|
-
return null;
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
35
|
var renderHeader = function renderHeader() {
|
|
206
36
|
if (!label && !tooltip) return null;
|
|
207
37
|
return /*#__PURE__*/React.createElement(HeaderWrapper, {
|
|
208
38
|
className: disabled ? 'disabled' : ''
|
|
209
|
-
}, label && /*#__PURE__*/React.createElement(
|
|
39
|
+
}, label && /*#__PURE__*/React.createElement(CapLabel, {
|
|
210
40
|
type: "label16",
|
|
211
41
|
className: disabled ? 'disabled' : ''
|
|
212
|
-
}, label), tooltip && /*#__PURE__*/React.createElement(
|
|
42
|
+
}, label), tooltip && /*#__PURE__*/React.createElement(CapTooltip, {
|
|
213
43
|
title: tooltip
|
|
214
|
-
}, /*#__PURE__*/React.createElement(
|
|
215
|
-
className: disabled ? 'disabled' : ''
|
|
216
|
-
style: {
|
|
217
|
-
color: '#B3BAC5'
|
|
218
|
-
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(StyledInfoIcon, {
|
|
45
|
+
className: disabled ? 'disabled' : ''
|
|
219
46
|
})));
|
|
220
47
|
};
|
|
221
48
|
var renderDropdown = function renderDropdown() {
|
|
222
|
-
var isMultipleSelect = type === 'multiSelect' || type === 'multiTreeSelect';
|
|
223
|
-
var isTreeMode = type === 'treeSelect' || type === 'multiTreeSelect';
|
|
224
|
-
var currentItems = isTreeMode ? filteredTree : filteredOptions;
|
|
225
|
-
var selectedCount = Array.isArray(tempValue) ? tempValue.length : tempValue ? 1 : 0;
|
|
226
|
-
|
|
227
|
-
// Custom dropdown render for both Select and TreeSelect
|
|
228
|
-
var renderCustomDropdown = function renderCustomDropdown(menu) {
|
|
229
|
-
if (!customPopupRender) return menu;
|
|
230
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
231
|
-
style: {
|
|
232
|
-
borderBottom: '1px solid #f0f0f0'
|
|
233
|
-
}
|
|
234
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
235
|
-
prefix: /*#__PURE__*/React.createElement(SearchOutlined, {
|
|
236
|
-
style: {
|
|
237
|
-
color: "#B3BAC5"
|
|
238
|
-
}
|
|
239
|
-
}),
|
|
240
|
-
placeholder: "Search",
|
|
241
|
-
variant: "borderless",
|
|
242
|
-
value: searchText,
|
|
243
|
-
onChange: function onChange(e) {
|
|
244
|
-
return setSearchText(e.target.value);
|
|
245
|
-
},
|
|
246
|
-
onKeyDown: function onKeyDown(e) {
|
|
247
|
-
return e.stopPropagation();
|
|
248
|
-
}
|
|
249
|
-
})), isMultipleSelect && currentItems.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
250
|
-
style: {
|
|
251
|
-
padding: '8px 12px',
|
|
252
|
-
cursor: 'pointer',
|
|
253
|
-
display: 'flex',
|
|
254
|
-
alignItems: 'center',
|
|
255
|
-
borderBottom: '1px solid #f0f0f0'
|
|
256
|
-
},
|
|
257
|
-
onClick: function onClick(e) {
|
|
258
|
-
// Prevent event propagation to keep dropdown open
|
|
259
|
-
e.stopPropagation();
|
|
260
|
-
handleSelectAll(isTreeMode);
|
|
261
|
-
}
|
|
262
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
263
|
-
type: "checkbox",
|
|
264
|
-
checked: allSelected,
|
|
265
|
-
readOnly: true,
|
|
266
|
-
style: {
|
|
267
|
-
cursor: 'pointer'
|
|
268
|
-
},
|
|
269
|
-
onClick: function onClick(e) {
|
|
270
|
-
return e.stopPropagation();
|
|
271
|
-
}
|
|
272
|
-
}), /*#__PURE__*/React.createElement("label", {
|
|
273
|
-
style: {
|
|
274
|
-
marginLeft: 8,
|
|
275
|
-
cursor: 'pointer'
|
|
276
|
-
}
|
|
277
|
-
}, "Select all")), currentItems.length === 0 ? /*#__PURE__*/React.createElement(NoResult, null) : menu, currentItems.length > 0 && isMultipleSelect && /*#__PURE__*/React.createElement("div", {
|
|
278
|
-
style: {
|
|
279
|
-
display: 'flex',
|
|
280
|
-
justifyContent: 'space-between',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
padding: '8px 12px',
|
|
283
|
-
borderTop: '1px solid #f0f0f0'
|
|
284
|
-
}
|
|
285
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
286
|
-
type: "primary",
|
|
287
|
-
size: "small",
|
|
288
|
-
style: {
|
|
289
|
-
marginRight: 8
|
|
290
|
-
},
|
|
291
|
-
onClick: function onClick(e) {
|
|
292
|
-
e.stopPropagation();
|
|
293
|
-
handleConfirm();
|
|
294
|
-
}
|
|
295
|
-
}, "Confirm"), /*#__PURE__*/React.createElement(Button, {
|
|
296
|
-
type: "text",
|
|
297
|
-
size: "small",
|
|
298
|
-
onClick: function onClick(e) {
|
|
299
|
-
e.stopPropagation();
|
|
300
|
-
handleCancel();
|
|
301
|
-
}
|
|
302
|
-
}, "Cancel")), selectedCount > 0 && /*#__PURE__*/React.createElement("span", {
|
|
303
|
-
style: {
|
|
304
|
-
color: '#8c8c8c',
|
|
305
|
-
fontSize: '14px'
|
|
306
|
-
}
|
|
307
|
-
}, selectedCount, " selected")));
|
|
308
|
-
};
|
|
309
49
|
if (type === 'treeSelect' || type === 'multiTreeSelect') {
|
|
310
|
-
return /*#__PURE__*/React.createElement(
|
|
311
|
-
treeData:
|
|
312
|
-
value:
|
|
313
|
-
onChange:
|
|
50
|
+
return /*#__PURE__*/React.createElement(TreeSelect, _extends({
|
|
51
|
+
treeData: treeData || options,
|
|
52
|
+
value: value,
|
|
53
|
+
onChange: onChange,
|
|
314
54
|
placeholder: placeholder,
|
|
315
|
-
|
|
316
|
-
maxTagPlaceholder: function maxTagPlaceholder() {
|
|
317
|
-
return null;
|
|
318
|
-
},
|
|
319
|
-
prefix: type === "multiTreeSelect" && value.length > 0 && prefix(),
|
|
320
|
-
suffixIcon: suffix,
|
|
321
|
-
className: classnames("cap-unified-tree-select ".concat(className || '')),
|
|
55
|
+
className: className,
|
|
322
56
|
style: style,
|
|
323
|
-
status: status,
|
|
324
57
|
allowClear: allowClear,
|
|
325
|
-
showSearch:
|
|
326
|
-
multiple: type === 'multiTreeSelect',
|
|
327
|
-
treeCheckable: treeCheckable,
|
|
328
|
-
showCheckedStrategy: TreeSelect.SHOW_PARENT,
|
|
58
|
+
showSearch: showSearch,
|
|
59
|
+
multiple: type === 'multiTreeSelect' ? true : false,
|
|
329
60
|
virtual: true,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}, treeSelectVirtualizationProps
|
|
333
|
-
popupRender: renderCustomDropdown
|
|
334
|
-
})), status === 'error' && /*#__PURE__*/React.createElement("div", {
|
|
335
|
-
style: {
|
|
336
|
-
color: '#E83135'
|
|
337
|
-
},
|
|
338
|
-
className: "cap-unified-select-status"
|
|
339
|
-
}, statusMessage));
|
|
61
|
+
treeDefaultExpandAll: true,
|
|
62
|
+
disabled: disabled
|
|
63
|
+
}, treeSelectVirtualizationProps));
|
|
340
64
|
}
|
|
341
|
-
return /*#__PURE__*/React.createElement(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
onChange: customPopupRender ? handleTempChange : onChange,
|
|
65
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
66
|
+
value: value,
|
|
67
|
+
onChange: onChange,
|
|
345
68
|
placeholder: placeholder,
|
|
346
|
-
|
|
347
|
-
maxTagPlaceholder: function maxTagPlaceholder() {
|
|
348
|
-
return null;
|
|
349
|
-
},
|
|
350
|
-
prefix: type === "multiSelect" && value.length > 0 && prefix(),
|
|
351
|
-
suffixIcon: suffix,
|
|
352
|
-
className: classnames('cap-unified-select', className),
|
|
69
|
+
className: className,
|
|
353
70
|
style: style,
|
|
354
71
|
allowClear: allowClear,
|
|
355
|
-
showSearch:
|
|
72
|
+
showSearch: showSearch,
|
|
73
|
+
options: options,
|
|
356
74
|
mode: type === 'multiSelect' ? 'multiple' : undefined,
|
|
357
75
|
virtual: true,
|
|
358
|
-
disabled: disabled
|
|
359
|
-
|
|
360
|
-
}, selectVirtualizationProps, {
|
|
361
|
-
popupRender: renderCustomDropdown
|
|
362
|
-
})), status === 'error' && /*#__PURE__*/React.createElement("div", {
|
|
363
|
-
style: {
|
|
364
|
-
color: '#E83135'
|
|
365
|
-
},
|
|
366
|
-
className: "cap-unified-select-status"
|
|
367
|
-
}, statusMessage));
|
|
76
|
+
disabled: disabled
|
|
77
|
+
}, selectVirtualizationProps));
|
|
368
78
|
};
|
|
369
|
-
return /*#__PURE__*/React.createElement(SelectWrapper,
|
|
370
|
-
|
|
371
|
-
}, renderHeader(), renderDropdown());
|
|
372
|
-
};
|
|
79
|
+
return /*#__PURE__*/React.createElement(SelectWrapper, null, renderHeader(), renderDropdown());
|
|
80
|
+
}
|
|
373
81
|
CapUnifiedSelect.propTypes = {
|
|
374
82
|
type: PropTypes.oneOf(['select', 'multiSelect', 'treeSelect', 'multiTreeSelect']),
|
|
375
83
|
options: PropTypes.array,
|
|
@@ -380,19 +88,14 @@ CapUnifiedSelect.propTypes = {
|
|
|
380
88
|
className: PropTypes.string,
|
|
381
89
|
style: PropTypes.object,
|
|
382
90
|
allowClear: PropTypes.bool,
|
|
91
|
+
showSearch: PropTypes.bool,
|
|
383
92
|
label: PropTypes.string,
|
|
384
93
|
tooltip: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
385
|
-
disabled: PropTypes.bool
|
|
386
|
-
treeCheckable: PropTypes.bool,
|
|
387
|
-
customPopupRender: PropTypes.bool,
|
|
388
|
-
onConfirm: PropTypes.func,
|
|
389
|
-
onCancel: PropTypes.func
|
|
94
|
+
disabled: PropTypes.bool
|
|
390
95
|
};
|
|
391
96
|
CapUnifiedSelect.defaultProps = {
|
|
392
97
|
type: 'select',
|
|
393
98
|
allowClear: false,
|
|
394
|
-
|
|
395
|
-
treeCheckable: false,
|
|
396
|
-
className: ''
|
|
99
|
+
showSearch: false
|
|
397
100
|
};
|
|
398
|
-
export default
|
|
101
|
+
export default CapUnifiedSelect;
|
|
@@ -8,24 +8,8 @@ export var HeaderWrapper = styled.div.withConfig({
|
|
|
8
8
|
displayName: "HeaderWrapper",
|
|
9
9
|
componentId: "sc-3v7xpu-1"
|
|
10
10
|
})(["display:flex;align-items:center;gap:4px;&.disabled{opacity:0.5;cursor:not-allowed;}"]);
|
|
11
|
-
export var DropdownFooter = styled.div.withConfig({
|
|
12
|
-
displayName: "DropdownFooter",
|
|
13
|
-
componentId: "sc-3v7xpu-2"
|
|
14
|
-
})(["display:flex;justify-content:space-between;align-items:center;padding:8px;border-top:1px solid #f0f0f0;.footer-buttons{display:flex;align-items:center;gap:8px;}.total-count{color:#8c8c8c;font-size:12px;}"]);
|
|
15
|
-
export var SearchInputWrapper = styled.div.withConfig({
|
|
16
|
-
displayName: "SearchInputWrapper",
|
|
17
|
-
componentId: "sc-3v7xpu-3"
|
|
18
|
-
})(["padding:8px;border-bottom:1px solid #f0f0f0;"]);
|
|
19
|
-
export var SelectAllCheckbox = styled.div.withConfig({
|
|
20
|
-
displayName: "SelectAllCheckbox",
|
|
21
|
-
componentId: "sc-3v7xpu-4"
|
|
22
|
-
})(["display:flex;align-items:center;padding:8px 12px;cursor:pointer;font-weight:500;border-bottom:1px solid #f0f0f0;user-select:none;input[type=\"checkbox\"]{cursor:pointer;}"]);
|
|
23
|
-
export var NoResultWrapper = styled.div.withConfig({
|
|
24
|
-
displayName: "NoResultWrapper",
|
|
25
|
-
componentId: "sc-3v7xpu-5"
|
|
26
|
-
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;color:#8c8c8c;font-size:14px;"]);
|
|
27
11
|
export var StyledInfoIcon = styled.span.withConfig({
|
|
28
12
|
displayName: "StyledInfoIcon",
|
|
29
|
-
componentId: "sc-3v7xpu-
|
|
30
|
-
})(["color:", ";font-size:16px;cursor:help
|
|
31
|
-
export var selectStyles = css(["&.cap-unified-select{width:100%;font-family:", ";}
|
|
13
|
+
componentId: "sc-3v7xpu-2"
|
|
14
|
+
})(["color:", ";font-size:16px;cursor:help;&:hover{color:", ";}&.disabled{cursor:not-allowed;&:hover{color:", ";}}"], styledVars.CAP_G2, styledVars.CAP_G1, styledVars.CAP_G2);
|
|
15
|
+
export var selectStyles = css(["&.cap-unified-select{width:100%;font-family:", ";.ant-select-selector{border-radius:", ";transition:", ";padding:0 12px;min-height:32px;display:flex;align-items:center;&:hover{border-color:", ";}}.cap-unified-select-right-slot{display:flex;align-items:center;gap:8px;margin-left:8px;}&.ant-select-focused{.ant-select-selector{border-color:", " !important;box-shadow:none !important;}}&.ant-select-status-error{.ant-select-selector{border-color:", ";}}&.ant-select-disabled{.ant-select-selector{background-color:", ";cursor:not-allowed;}}.ant-select-dropdown{padding:4px;border-radius:", ";box-shadow:0 2px 8px rgba(0,0,0,0.15);.ant-select-item{border-radius:", ";padding:8px 12px;transition:", ";&-option-selected{background-color:", ";color:", ";font-weight:500;}&-option-active{background-color:", ";}}.ant-select-search{padding:8px;input{border-radius:", ";transition:", ";&:focus{border-color:", ";box-shadow:none;}}}}&.ant-select-multiple{.ant-select-selection-item{background-color:", ";border-color:", ";border-radius:", ";color:", ";margin:2px 4px 2px 0;padding:0 8px;height:24px;line-height:22px;&-remove{color:", ";&:hover{color:", ";}}}.ant-select-selection-overflow{flex-wrap:wrap;gap:4px;}}.ant-select-tree{padding:4px 0;.ant-select-tree-node-content-wrapper{padding:4px 8px;border-radius:", ";transition:", ";&:hover{background-color:", ";}&.ant-select-tree-node-selected{background-color:", ";color:", ";font-weight:500;}}.ant-select-tree-switcher{width:24px;height:24px;line-height:24px;}.ant-select-tree-checkbox{margin:4px 8px 4px 0;}}&.ant-select-lg{.ant-select-selector{height:40px;padding:0 16px;}.ant-select-selection-item{height:28px;line-height:26px;}}&.ant-select-sm{.ant-select-selector{height:24px;padding:0 8px;}.ant-select-selection-item{height:20px;line-height:18px;}}&.ant-select-loading{.ant-select-arrow{.anticon-loading{color:", ";}}}}"], styledVars.FONT_FAMILY, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_G11, styledVars.CAP_G01, styledVars.CAP_RED, styledVars.CAP_G08, styledVars.RADIUS_04, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_PRIMARY.light, styledVars.CAP_PRIMARY.base, styledVars.CAP_G08, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_G01, styledVars.CAP_PRIMARY.light, styledVars.CAP_PRIMARY.light, styledVars.RADIUS_04, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.hover, styledVars.RADIUS_04, styledVars.TRANSITION_ALL, styledVars.CAP_G08, styledVars.CAP_PRIMARY.light, styledVars.CAP_PRIMARY.base, styledVars.CAP_PRIMARY.base);
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Import and export all components
|
|
2
2
|
export { default as CapInput } from './CapInput';
|
|
3
3
|
export { default as CapTable } from './CapTable';
|
|
4
|
-
export { default as CapTestSelect } from './CapTestSelect'; // Test component for Ant Design v5 integration
|
|
5
4
|
|
|
6
5
|
// Export utilities
|
|
7
6
|
export { default as LocaleHoc } from './LocaleHoc';
|
|
@@ -9,7 +8,4 @@ export { default as LocaleHoc } from './LocaleHoc';
|
|
|
9
8
|
// Export styled utilities
|
|
10
9
|
import * as _styledVars from './styled/variables';
|
|
11
10
|
export { _styledVars as styledVars };
|
|
12
|
-
export { default as styled } from './styled';
|
|
13
|
-
|
|
14
|
-
// Export utils
|
|
15
|
-
export * from '../utils';
|
|
11
|
+
export { default as styled } from './styled';
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
var _exportNames = {
|
|
8
|
-
CapInput: true,
|
|
9
|
-
CapTable: true,
|
|
10
|
-
CapTestSelect: true,
|
|
11
|
-
LocaleHoc: true,
|
|
12
|
-
styledVars: true,
|
|
13
|
-
styled: true
|
|
14
|
-
};
|
|
15
7
|
Object.defineProperty(exports, "CapInput", {
|
|
16
8
|
enumerable: true,
|
|
17
9
|
get: function get() {
|
|
@@ -24,12 +16,6 @@ Object.defineProperty(exports, "CapTable", {
|
|
|
24
16
|
return _CapTable["default"];
|
|
25
17
|
}
|
|
26
18
|
});
|
|
27
|
-
Object.defineProperty(exports, "CapTestSelect", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _CapTestSelect["default"];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
19
|
Object.defineProperty(exports, "LocaleHoc", {
|
|
34
20
|
enumerable: true,
|
|
35
21
|
get: function get() {
|
|
@@ -45,22 +31,9 @@ Object.defineProperty(exports, "styled", {
|
|
|
45
31
|
exports.styledVars = void 0;
|
|
46
32
|
var _CapInput = _interopRequireDefault(require("./CapInput"));
|
|
47
33
|
var _CapTable = _interopRequireDefault(require("./CapTable"));
|
|
48
|
-
var _CapTestSelect = _interopRequireDefault(require("./CapTestSelect"));
|
|
49
34
|
var _LocaleHoc = _interopRequireDefault(require("./LocaleHoc"));
|
|
50
35
|
var _styledVars = _interopRequireWildcard(require("./styled/variables"));
|
|
51
36
|
exports.styledVars = _styledVars;
|
|
52
37
|
var _styled = _interopRequireDefault(require("./styled"));
|
|
53
|
-
var _utils = require("../utils");
|
|
54
|
-
Object.keys(_utils).forEach(function (key) {
|
|
55
|
-
if (key === "default" || key === "__esModule") return;
|
|
56
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
57
|
-
if (key in exports && exports[key] === _utils[key]) return;
|
|
58
|
-
Object.defineProperty(exports, key, {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function get() {
|
|
61
|
-
return _utils[key];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
38
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
66
39
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** */
|
|
2
|
+
|
|
3
|
+
/** */
|
|
4
|
+
|
|
5
|
+
/** */
|
|
6
|
+
|
|
7
|
+
/** */
|
package/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// Import and export all components
|
|
2
2
|
export { default as CapInput } from './CapInput';
|
|
3
3
|
export { default as CapTable } from './CapTable';
|
|
4
|
-
export { default as CapTestSelect } from './CapTestSelect'; // Test component for Ant Design v5 integration
|
|
5
4
|
|
|
6
5
|
// Export utilities
|
|
7
6
|
export { default as LocaleHoc } from './LocaleHoc';
|
|
8
7
|
|
|
9
8
|
// Export styled utilities
|
|
10
9
|
export * as styledVars from './styled/variables';
|
|
11
|
-
export { default as styled } from './styled';
|
|
12
|
-
|
|
13
|
-
// Export utils
|
|
14
|
-
export * from '../utils';
|
|
10
|
+
export { default as styled } from './styled';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/blaze-ui",
|
|
3
3
|
"author": "Capillary Technologies",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
5
|
-
"description": "Capillary UI component library
|
|
6
|
-
"main": "./dist/
|
|
7
|
-
"module": "./dist/esm/
|
|
8
|
-
"jsnext:main": "./dist/esm/
|
|
4
|
+
"version": "0.1.6-alpha.3",
|
|
5
|
+
"description": "Capillary UI component library",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"jsnext:main": "./dist/esm/index.js",
|
|
9
9
|
"sideEffects": [
|
|
10
10
|
"*.css",
|
|
11
11
|
"*.less",
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
"!**/tests"
|
|
27
27
|
],
|
|
28
28
|
"homepage": "https://github.com/Capillary/blaze-ui",
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
31
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
32
|
+
},
|
|
29
33
|
"dependencies": {
|
|
30
|
-
"@ant-design/icons": "^5.2.6",
|
|
31
34
|
"@capillarytech/cap-ui-utils": "^3.0.4",
|
|
32
|
-
"antd": "^5.12.0",
|
|
33
35
|
"prop-types": "^15.8.1",
|
|
34
36
|
"styled-components": "^5.3.11",
|
|
35
|
-
"react-intl": "
|
|
37
|
+
"react-intl": "^6.5.0"
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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';
|
|
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;
|
package/CapSkeleton/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CapSkeleton';
|