@capillarytech/blaze-ui 6.4.0 → 6.5.0
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/CapDateRangePicker/index.d.ts.map +1 -1
- package/CapDateRangePicker/index.js +5 -1
- package/CapDateRangePicker/styles.css +28 -0
- package/CapDateRangePicker/styles.module.scss.js +2 -1
- package/CapDateRangePicker/styles.scss +37 -0
- package/CapDateRangePicker/types.d.ts +5 -0
- package/CapDateRangePicker/types.d.ts.map +1 -1
- package/CapDragAndDrop/index.d.ts +19 -3
- package/CapDragAndDrop/index.d.ts.map +1 -1
- package/CapDragAndDrop/index.js +29 -24
- package/CapDragAndDrop/styles.css +15 -17
- package/CapDragAndDrop/styles.scss +16 -18
- package/CapMobileDateRangePicker/DateRangeInputSelectors.d.ts +7 -0
- package/CapMobileDateRangePicker/DateRangeInputSelectors.d.ts.map +1 -0
- package/CapMobileDateRangePicker/DateRangeInputSelectors.js +68 -0
- package/CapMobileDateRangePicker/ReactMobileDatePickerModule.d.ts.map +1 -1
- package/CapMobileDateRangePicker/ReactMobileDatePickerModule.js +2 -1
- package/CapMobileDateRangePicker/index.d.ts +5 -21
- package/CapMobileDateRangePicker/index.d.ts.map +1 -1
- package/CapMobileDateRangePicker/index.js +256 -309
- package/CapMobileDateRangePicker/messages.d.ts +17 -0
- package/CapMobileDateRangePicker/messages.d.ts.map +1 -0
- package/CapMobileDateRangePicker/messages.js +20 -0
- package/CapMobileDateRangePicker/styles.css +107 -144
- package/CapMobileDateRangePicker/styles.module.scss.js +21 -0
- package/CapMobileDateRangePicker/styles.scss +188 -192
- package/CapMobileDateRangePicker/tests/CapMobileDateRangePicker.mockData.d.ts +18 -0
- package/CapMobileDateRangePicker/tests/CapMobileDateRangePicker.mockData.d.ts.map +1 -0
- package/CapMobileDateRangePicker/types.d.ts +95 -0
- package/CapMobileDateRangePicker/types.d.ts.map +1 -0
- package/CapMobileDateRangePicker/utils.d.ts +3 -0
- package/CapMobileDateRangePicker/utils.d.ts.map +1 -0
- package/CapMobileDateRangePicker/utils.js +5 -0
- package/CapPopoverTree/index.d.ts +3 -40
- package/CapPopoverTree/index.d.ts.map +1 -1
- package/CapPopoverTree/index.js +72 -82
- package/CapPopoverTree/style.d.ts +5 -1
- package/CapPopoverTree/style.d.ts.map +1 -1
- package/CapPopoverTree/styles.css +119 -18
- package/CapPopoverTree/styles.module.scss.js +26 -0
- package/CapPopoverTree/styles.scss +179 -31
- package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts +22 -0
- package/CapPopoverTree/tests/CapPopoverTree.mockData.d.ts.map +1 -0
- package/CapPopoverTree/types.d.ts +62 -0
- package/CapPopoverTree/types.d.ts.map +1 -0
- package/CapTimeline/CapTimelineCard.d.ts +27 -4
- package/CapTimeline/CapTimelineCard.d.ts.map +1 -1
- package/CapTimeline/CapTimelineCard.js +157 -40
- package/CapTimeline/CapTimelinePanesWrapper.d.ts +25 -4
- package/CapTimeline/CapTimelinePanesWrapper.d.ts.map +1 -1
- package/CapTimeline/CapTimelinePanesWrapper.js +20 -24
- package/CapTimeline/index.d.ts +17 -2
- package/CapTimeline/index.d.ts.map +1 -1
- package/CapTimeline/index.js +23 -62
- package/CapTimeline/styles.css +40 -40
- package/CapTimeline/styles.scss +57 -76
- package/CapVirtualSelect/actions.d.ts +16 -0
- package/CapVirtualSelect/actions.d.ts.map +1 -0
- package/CapVirtualSelect/actions.js +21 -0
- package/CapVirtualSelect/constants.d.ts +13 -0
- package/CapVirtualSelect/constants.d.ts.map +1 -0
- package/CapVirtualSelect/constants.js +26 -0
- package/CapVirtualSelect/index.d.ts +169 -0
- package/CapVirtualSelect/index.d.ts.map +1 -0
- package/CapVirtualSelect/index.js +409 -0
- package/CapVirtualSelect/messages.d.ts +9 -0
- package/CapVirtualSelect/messages.d.ts.map +1 -0
- package/CapVirtualSelect/messages.js +12 -0
- package/CapVirtualSelect/reducer.d.ts +4 -0
- package/CapVirtualSelect/reducer.d.ts.map +1 -0
- package/CapVirtualSelect/reducer.js +63 -0
- package/CapVirtualSelect/saga.d.ts +40 -0
- package/CapVirtualSelect/saga.d.ts.map +1 -0
- package/CapVirtualSelect/saga.js +91 -0
- package/CapVirtualSelect/selectors.d.ts +28 -0
- package/CapVirtualSelect/selectors.d.ts.map +1 -0
- package/CapVirtualSelect/selectors.js +30 -0
- package/CapVirtualSelect/styles.css +110 -0
- package/CapVirtualSelect/styles.scss +106 -0
- package/CapVirtualSelect/tests/mockData.d.ts +7 -0
- package/CapVirtualSelect/tests/mockData.d.ts.map +1 -0
- package/CapVirtualSelect/utils.d.ts +2 -0
- package/CapVirtualSelect/utils.d.ts.map +1 -0
- package/CapVirtualSelect/utils.js +12 -0
- package/index.d.ts +2 -4
- package/index.d.ts.map +1 -1
- package/index.js +97 -99
- package/package.json +1 -1
- package/utils/dayjs.d.ts +29 -0
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +30 -0
- package/utils/getCapThemeConfig.d.ts.map +1 -1
- package/utils/getCapThemeConfig.js +1 -9
- package/CapDragAndDrop/messages.d.ts +0 -25
- package/CapDragAndDrop/messages.d.ts.map +0 -1
- package/CapDragAndDrop/messages.js +0 -28
- package/CapDragAndDrop/styles.module.scss.js +0 -21
- package/CapDragAndDrop/types.d.ts +0 -17
- package/CapDragAndDrop/types.d.ts.map +0 -1
- package/CapTimeline/messages.d.ts +0 -21
- package/CapTimeline/messages.d.ts.map +0 -1
- package/CapTimeline/messages.js +0 -24
- package/CapTimeline/styles.module.scss.js +0 -30
- package/CapTimeline/tests/CapTimeline.mockData.d.ts +0 -14
- package/CapTimeline/tests/CapTimeline.mockData.d.ts.map +0 -1
- package/CapTimeline/types.d.ts +0 -60
- package/CapTimeline/types.d.ts.map +0 -1
- /package/{CapDragAndDrop → CapMobileDateRangePicker}/types.js +0 -0
- /package/{CapTimeline → CapPopoverTree}/types.js +0 -0
package/CapPopoverTree/index.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { InfoCircleOutlined } from "@ant-design-v5/icons";
|
|
3
|
+
import { Tree, Input, Tooltip } from "antd-v5";
|
|
3
4
|
import classNames from "classnames";
|
|
4
|
-
import PropTypes from "prop-types";
|
|
5
5
|
import { useState, useEffect } from "react";
|
|
6
|
+
import CapColumn from "../CapColumn/index.js";
|
|
6
7
|
import CapHeadingWithStatic from "../CapHeading/index.js";
|
|
7
|
-
import
|
|
8
|
+
import CapIcon from "../CapIcon/index.js";
|
|
8
9
|
import CapPopover from "../CapPopover/index.js";
|
|
9
10
|
import CapRow from "../CapRow/index.js";
|
|
10
11
|
import CapSpin from "../CapSpin/index.js";
|
|
11
12
|
import CapTooltip from "../CapTooltip/index.js";
|
|
13
|
+
import CapTree from "../CapTree/index.js";
|
|
12
14
|
import LocaleHoc from "../LocaleHoc/index.js";
|
|
13
|
-
import
|
|
14
|
-
import './styles.css';/* empty css */
|
|
15
|
+
import styles from "./styles.module.scss.js";
|
|
15
16
|
const { TreeNode } = Tree;
|
|
16
|
-
const { Search } = InputFinal;
|
|
17
17
|
const clsPrefix = "cap-popover-tree-v2";
|
|
18
18
|
const CapPopoverTree = (props) => {
|
|
19
19
|
var _a;
|
|
20
20
|
const {
|
|
21
21
|
treeData: propsTreeData = [],
|
|
22
22
|
overlayClassName,
|
|
23
|
-
trigger,
|
|
23
|
+
trigger = "click",
|
|
24
24
|
TriggerComponent,
|
|
25
25
|
componentText,
|
|
26
26
|
triggerProps,
|
|
27
27
|
isTriggerDisabled,
|
|
28
28
|
triggerDisabledText,
|
|
29
29
|
tooltipText,
|
|
30
|
-
isLoadingData,
|
|
30
|
+
isLoadingData = false,
|
|
31
31
|
loadingTip,
|
|
32
|
-
placement,
|
|
33
|
-
switcherIcon,
|
|
32
|
+
placement = "rightBottom",
|
|
33
|
+
switcherIcon = /* @__PURE__ */ jsx(CapIcon, { className: styles.expandIcon, size: "m", type: "chevron-down" }),
|
|
34
34
|
className,
|
|
35
|
-
defaultExpandAll,
|
|
35
|
+
defaultExpandAll = false,
|
|
36
36
|
onSelect,
|
|
37
37
|
selectedKey: propsSelectedKey,
|
|
38
38
|
emptyDataMessage,
|
|
39
39
|
searchPlaceholder,
|
|
40
|
-
renderOnKeyChange,
|
|
40
|
+
renderOnKeyChange = false,
|
|
41
41
|
...rest
|
|
42
42
|
} = props || {};
|
|
43
|
-
const defaultExpandKey = (propsTreeData == null ? void 0 : propsTreeData.length) === 1 && ((_a = propsTreeData[0]) == null ? void 0 : _a.key);
|
|
43
|
+
const defaultExpandKey = (propsTreeData == null ? void 0 : propsTreeData.length) === 1 && ((_a = propsTreeData[0]) == null ? void 0 : _a.key) ? propsTreeData[0].key : null;
|
|
44
44
|
const [searchText, setSearchText] = useState(null);
|
|
45
45
|
const [showPopover, setShowPopover] = useState(null);
|
|
46
46
|
const [filteredTreeData, setFilteredTreeData] = useState(propsTreeData || []);
|
|
47
|
-
const [expandedKeys, setExpandedKeys] = useState(
|
|
47
|
+
const [expandedKeys, setExpandedKeys] = useState(
|
|
48
|
+
defaultExpandKey ? [defaultExpandKey] : []
|
|
49
|
+
);
|
|
48
50
|
useEffect(() => {
|
|
49
51
|
setFilteredTreeData(propsTreeData);
|
|
50
|
-
setExpandedKeys([defaultExpandKey]);
|
|
51
|
-
}, [propsTreeData]);
|
|
52
|
+
setExpandedKeys(defaultExpandKey ? [defaultExpandKey] : []);
|
|
53
|
+
}, [propsTreeData, defaultExpandKey]);
|
|
52
54
|
const handleSearch = (e) => {
|
|
53
55
|
const { value } = e.target;
|
|
54
56
|
setSearchText(value);
|
|
@@ -63,13 +65,15 @@ const CapPopoverTree = (props) => {
|
|
|
63
65
|
}
|
|
64
66
|
setExpandedKeys(keys);
|
|
65
67
|
};
|
|
66
|
-
const handleSelect = (selectedKey,
|
|
67
|
-
const {
|
|
68
|
+
const handleSelect = (selectedKey, info) => {
|
|
69
|
+
const { node } = info;
|
|
70
|
+
const nodeProps = node == null ? void 0 : node.props;
|
|
71
|
+
const { isLeafNode, eventKey, expanded } = nodeProps || {};
|
|
68
72
|
if (isLeafNode) {
|
|
69
73
|
setShowPopover(false);
|
|
70
|
-
onSelect(selectedKey);
|
|
74
|
+
onSelect == null ? void 0 : onSelect(selectedKey);
|
|
71
75
|
} else {
|
|
72
|
-
const key = expanded ? [] : [eventKey];
|
|
76
|
+
const key = expanded ? [] : eventKey !== void 0 ? [eventKey] : [];
|
|
73
77
|
handleOnExpand(key);
|
|
74
78
|
}
|
|
75
79
|
};
|
|
@@ -78,25 +82,38 @@ const CapPopoverTree = (props) => {
|
|
|
78
82
|
var _a2, _b;
|
|
79
83
|
const { title, key, icon, children = [], info } = data;
|
|
80
84
|
if (title) {
|
|
81
|
-
const
|
|
85
|
+
const titleString = typeof title === "string" ? title : String(title);
|
|
86
|
+
const itemName = (_a2 = titleString == null ? void 0 : titleString.toLowerCase()) == null ? void 0 : _a2.trim();
|
|
82
87
|
const searchValue = (_b = searchText == null ? void 0 : searchText.toLowerCase()) == null ? void 0 : _b.trim();
|
|
83
|
-
const searchIndex = searchValue &&
|
|
84
|
-
const beforeString =
|
|
85
|
-
const afterString =
|
|
86
|
-
|
|
88
|
+
const searchIndex = searchValue && itemName ? itemName.indexOf(searchValue) : -1;
|
|
89
|
+
const beforeString = titleString == null ? void 0 : titleString.substr(0, searchIndex >= 0 ? searchIndex : 0);
|
|
90
|
+
const afterString = titleString == null ? void 0 : titleString.substr(
|
|
91
|
+
(searchIndex >= 0 ? searchIndex : 0) + ((searchValue == null ? void 0 : searchValue.length) || 0)
|
|
92
|
+
);
|
|
93
|
+
const matchedSearch = titleString == null ? void 0 : titleString.substr(
|
|
94
|
+
searchIndex >= 0 ? searchIndex : 0,
|
|
95
|
+
(searchValue == null ? void 0 : searchValue.length) || 0
|
|
96
|
+
);
|
|
87
97
|
const searchResult = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
98
|
+
/* @__PURE__ */ jsx(CapColumn, { className: styles.styledCapColumn, children: beforeString }),
|
|
99
|
+
/* @__PURE__ */ jsx(CapColumn, { className: classNames(styles.styledCapColumn, styles.matchedSearch), children: matchedSearch }),
|
|
100
|
+
/* @__PURE__ */ jsx(CapColumn, { className: styles.styledCapColumn, children: afterString })
|
|
91
101
|
] });
|
|
92
102
|
const treeNodeProps = {
|
|
93
|
-
title: /* @__PURE__ */ jsxs(
|
|
103
|
+
title: /* @__PURE__ */ jsxs(CapHeadingWithStatic, { className: classNames(styles.styledCapHeading, "tree-node-title"), children: [
|
|
94
104
|
searchIndex > -1 ? searchResult : title,
|
|
95
|
-
info && /* @__PURE__ */ jsx("span", { className: "info-tooltip", children: /* @__PURE__ */ jsx(Tooltip, { placement: "right", title: info, children: /* @__PURE__ */ jsx(
|
|
105
|
+
info && /* @__PURE__ */ jsx("span", { className: "info-tooltip", children: /* @__PURE__ */ jsx(Tooltip, { placement: "right", title: info, children: /* @__PURE__ */ jsx(InfoCircleOutlined, { className: "info-icon" }) }) })
|
|
96
106
|
] }),
|
|
97
107
|
key,
|
|
98
108
|
isLeafNode: !(children == null ? void 0 : children.length),
|
|
99
|
-
icon: icon && /* @__PURE__ */ jsx(
|
|
109
|
+
icon: icon && /* @__PURE__ */ jsx(
|
|
110
|
+
CapIcon,
|
|
111
|
+
{
|
|
112
|
+
className: classNames(styles.styledIcon, "tree-node-icon"),
|
|
113
|
+
size: "s",
|
|
114
|
+
type: icon
|
|
115
|
+
}
|
|
116
|
+
)
|
|
100
117
|
};
|
|
101
118
|
result.push(
|
|
102
119
|
/* @__PURE__ */ jsx(TreeNode, { ...treeNodeProps, children: (children == null ? void 0 : children.length) && getTreeData(children) })
|
|
@@ -114,15 +131,15 @@ const CapPopoverTree = (props) => {
|
|
|
114
131
|
return;
|
|
115
132
|
}
|
|
116
133
|
const filteredData = propsTreeData.reduce((result, currentData) => {
|
|
117
|
-
var _a3
|
|
118
|
-
const
|
|
134
|
+
var _a3;
|
|
135
|
+
const titleString = typeof (currentData == null ? void 0 : currentData.title) === "string" ? currentData.title : String((currentData == null ? void 0 : currentData.title) || "");
|
|
136
|
+
const parentName = titleString == null ? void 0 : titleString.toLowerCase();
|
|
119
137
|
const isParent = (parentName == null ? void 0 : parentName.indexOf(searchString)) > -1;
|
|
120
|
-
const childItems = (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
138
|
+
const childItems = (_a3 = currentData == null ? void 0 : currentData.children) == null ? void 0 : _a3.filter((childItem) => {
|
|
139
|
+
var _a4;
|
|
140
|
+
const childTitleString = typeof (childItem == null ? void 0 : childItem.title) === "string" ? childItem.title : String((childItem == null ? void 0 : childItem.title) || "");
|
|
141
|
+
return ((_a4 = childTitleString == null ? void 0 : childTitleString.toLowerCase()) == null ? void 0 : _a4.indexOf(searchString)) > -1;
|
|
142
|
+
});
|
|
126
143
|
const hasChildren = !!(childItems == null ? void 0 : childItems.length);
|
|
127
144
|
const currentDataCopy = { ...currentData };
|
|
128
145
|
if (hasChildren) {
|
|
@@ -141,16 +158,18 @@ const CapPopoverTree = (props) => {
|
|
|
141
158
|
/* @__PURE__ */ jsx(
|
|
142
159
|
CapPopover,
|
|
143
160
|
{
|
|
144
|
-
visible: showPopover,
|
|
145
|
-
onVisibleChange: setShowPopover,
|
|
161
|
+
visible: showPopover ?? void 0,
|
|
162
|
+
onVisibleChange: (visible) => setShowPopover(visible),
|
|
146
163
|
trigger,
|
|
147
164
|
placement,
|
|
148
165
|
overlayClassName: classNames(`${clsPrefix}`, overlayClassName),
|
|
149
166
|
...rest,
|
|
150
167
|
content: /* @__PURE__ */ jsx(CapRow, { className: "search-and-tree-wrapper", children: /* @__PURE__ */ jsxs(CapSpin, { spinning: isLoadingData, tip: loadingTip, children: [
|
|
151
168
|
/* @__PURE__ */ jsx(
|
|
152
|
-
|
|
169
|
+
Input,
|
|
153
170
|
{
|
|
171
|
+
prefix: /* @__PURE__ */ jsx(CapIcon, { type: "search", size: "s" }),
|
|
172
|
+
variant: "borderless",
|
|
154
173
|
placeholder: searchPlaceholder,
|
|
155
174
|
onChange: handleSearch,
|
|
156
175
|
className: "search-tree-node"
|
|
@@ -158,7 +177,7 @@ const CapPopoverTree = (props) => {
|
|
|
158
177
|
),
|
|
159
178
|
/* @__PURE__ */ jsx("div", { className: "divider" }),
|
|
160
179
|
(filteredTreeData == null ? void 0 : filteredTreeData.length) ? /* @__PURE__ */ jsx(
|
|
161
|
-
|
|
180
|
+
CapTree,
|
|
162
181
|
{
|
|
163
182
|
showIcon: true,
|
|
164
183
|
blockNode: true,
|
|
@@ -168,8 +187,11 @@ const CapPopoverTree = (props) => {
|
|
|
168
187
|
onExpand: handleOnExpand,
|
|
169
188
|
onSelect: handleSelect,
|
|
170
189
|
switcherIcon,
|
|
171
|
-
|
|
172
|
-
|
|
190
|
+
className: classNames(
|
|
191
|
+
styles.styledCapTree,
|
|
192
|
+
(expandedKeys == null ? void 0 : expandedKeys.length) && !searchText && styles.isExpanded,
|
|
193
|
+
className
|
|
194
|
+
),
|
|
173
195
|
...renderOnKeyChange ? { key: JSON.stringify(filteredTreeData) } : {},
|
|
174
196
|
...rest,
|
|
175
197
|
children: getTreeData(searchText ? filteredTreeData : propsTreeData)
|
|
@@ -178,44 +200,12 @@ const CapPopoverTree = (props) => {
|
|
|
178
200
|
] }) })
|
|
179
201
|
}
|
|
180
202
|
),
|
|
181
|
-
/* @__PURE__ */ jsx(CapRow, { children: !isTriggerDisabled ? /* @__PURE__ */ jsx(CapTooltip, { title: tooltipText, overlayClassName: "add-condition-tooltip", children: /* @__PURE__ */ jsx(TriggerComponent, { ...triggerProps, onClick: () => setShowPopover(true), children: componentText }) }) : /* @__PURE__ */ jsx(CapTooltip, { title: triggerDisabledText, children: /* @__PURE__ */ jsx("span", { className: "button-disabled-tooltip-wrapper", children: /* @__PURE__ */ jsx(TriggerComponent, { ...triggerProps, children: componentText }) }) }) })
|
|
203
|
+
/* @__PURE__ */ jsx(CapRow, { children: !isTriggerDisabled ? /* @__PURE__ */ jsx(CapTooltip, { title: tooltipText, overlayClassName: "add-condition-tooltip", children: TriggerComponent && /* @__PURE__ */ jsx(TriggerComponent, { ...triggerProps, onClick: () => setShowPopover(true), children: componentText }) }) : /* @__PURE__ */ jsx(CapTooltip, { title: triggerDisabledText, children: /* @__PURE__ */ jsx("span", { className: "button-disabled-tooltip-wrapper", children: TriggerComponent && /* @__PURE__ */ jsx(TriggerComponent, { ...triggerProps, children: componentText }) }) }) })
|
|
182
204
|
] });
|
|
183
205
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
showIcon: true,
|
|
188
|
-
blockNode: true,
|
|
189
|
-
defaultExpandAll: false,
|
|
190
|
-
isLoadingData: false,
|
|
191
|
-
switcherIcon: /* @__PURE__ */ jsx(ExpandIcon, { size: "m", type: "chevron-down" }),
|
|
192
|
-
renderOnKeyChange: false
|
|
193
|
-
};
|
|
194
|
-
CapPopoverTree.propTypes = {
|
|
195
|
-
trigger: PropTypes.string,
|
|
196
|
-
placement: PropTypes.string,
|
|
197
|
-
className: PropTypes.string,
|
|
198
|
-
defaultExpandAll: PropTypes.bool,
|
|
199
|
-
overlayClassName: PropTypes.string,
|
|
200
|
-
showIcon: PropTypes.bool,
|
|
201
|
-
blockNode: PropTypes.bool,
|
|
202
|
-
propsTreeData: PropTypes.array,
|
|
203
|
-
switcherIcon: PropTypes.node,
|
|
204
|
-
TriggerComponent: PropTypes.node,
|
|
205
|
-
componentText: PropTypes.string,
|
|
206
|
-
triggerProps: PropTypes.object,
|
|
207
|
-
isTriggerDisabled: PropTypes.bool,
|
|
208
|
-
triggerDisabledText: PropTypes.string,
|
|
209
|
-
tooltipText: PropTypes.string,
|
|
210
|
-
onSelect: PropTypes.func,
|
|
211
|
-
propsSelectedKey: PropTypes.array,
|
|
212
|
-
isLoadingData: PropTypes.bool,
|
|
213
|
-
loadingTip: PropTypes.string,
|
|
214
|
-
searchPlaceholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
215
|
-
emptyDataMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
216
|
-
renderOnKeyChange: PropTypes.bool
|
|
217
|
-
};
|
|
218
|
-
const index = LocaleHoc(CapPopoverTree, { key: "CapPopoverTree" });
|
|
206
|
+
const index = LocaleHoc(CapPopoverTree, {
|
|
207
|
+
key: "CapPopoverTree"
|
|
208
|
+
});
|
|
219
209
|
export {
|
|
220
210
|
CapPopoverTree,
|
|
221
211
|
index as default
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
interface StyledCapTreeProps {
|
|
2
|
+
isExpanded?: boolean;
|
|
3
|
+
}
|
|
1
4
|
export declare const ExpandIcon: import("styled-components").StyledComponent<import("../CapIcon").CapIconComponent, any, {}, never>;
|
|
2
5
|
export declare const StyledIcon: import("styled-components").StyledComponent<import("../CapIcon").CapIconComponent, any, {}, never>;
|
|
3
6
|
export declare const StyledCapHeading: import("styled-components").StyledComponent<import("../CapHeading/types").CapHeadingComponent, any, {}, never>;
|
|
4
7
|
export declare const StyledCapColumn: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../CapColumn").CapColumnProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
5
|
-
export declare const StyledCapTree: import("styled-components").StyledComponent<import("react").FC<import("../CapTree").CapTreeProps>, any,
|
|
8
|
+
export declare const StyledCapTree: import("styled-components").StyledComponent<import("react").FC<import("../CapTree").CapTreeProps>, any, StyledCapTreeProps, never>;
|
|
9
|
+
export {};
|
|
6
10
|
//# sourceMappingURL=style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../components/CapPopoverTree/style.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,oGAMtB,CAAC;AAEF,eAAO,MAAM,UAAU,oGAItB,CAAC;AAEF,eAAO,MAAM,gBAAgB,gHAI5B,CAAC;AAEF,eAAO,MAAM,eAAe,+LAE3B,CAAC;AAEF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../components/CapPopoverTree/style.ts"],"names":[],"mappings":"AAQA,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,oGAMtB,CAAC;AAEF,eAAO,MAAM,UAAU,oGAItB,CAAC;AAEF,eAAO,MAAM,gBAAgB,gHAI5B,CAAC;AAEF,eAAO,MAAM,eAAe,+LAE3B,CAAC;AAEF,eAAO,MAAM,aAAa,oIA6DzB,CAAC"}
|
|
@@ -6,31 +6,132 @@
|
|
|
6
6
|
/* Border Width */
|
|
7
7
|
/* Transition */
|
|
8
8
|
/* Timezones Footer */
|
|
9
|
-
.
|
|
10
|
-
|
|
9
|
+
.expandIcon {
|
|
10
|
+
margin-top: 0.714rem;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
}
|
|
13
|
+
.expandIcon svg {
|
|
14
|
+
height: 1.714rem;
|
|
15
|
+
width: 1.714rem;
|
|
16
|
+
}
|
|
17
|
+
.styledIcon {
|
|
18
|
+
z-index: 1;
|
|
19
|
+
padding: 0.286rem;
|
|
20
|
+
border-radius: 0.571rem;
|
|
21
|
+
background: #ebecf0;
|
|
22
|
+
}
|
|
23
|
+
.styledCapHeading {
|
|
24
|
+
display: inline;
|
|
25
|
+
margin-left: 0.286rem;
|
|
26
|
+
}
|
|
27
|
+
.styledCapColumn {
|
|
28
|
+
display: inline;
|
|
29
|
+
}
|
|
30
|
+
.matchedSearch {
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
}
|
|
33
|
+
.styledCapTree.ant-tree.cap-tree-v2 {
|
|
34
|
+
min-height: 8.857rem;
|
|
35
|
+
}
|
|
36
|
+
.styledCapTree.ant-tree.cap-tree-v2 li {
|
|
11
37
|
padding: 0;
|
|
12
|
-
min-height: 176px;
|
|
13
38
|
}
|
|
14
|
-
.ant-
|
|
15
|
-
|
|
39
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper {
|
|
40
|
+
height: 2.857rem;
|
|
41
|
+
padding: 0.643rem 0 0.786rem 0.286rem;
|
|
16
42
|
}
|
|
17
|
-
.ant-
|
|
18
|
-
|
|
19
|
-
margin-
|
|
20
|
-
padding:
|
|
43
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper:hover {
|
|
44
|
+
background-color: #faf9f4;
|
|
45
|
+
margin-left: -2.857rem;
|
|
46
|
+
padding-left: 3.143rem;
|
|
47
|
+
}
|
|
48
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-node-selected .tree-node-title {
|
|
49
|
+
color: #1d61ee;
|
|
50
|
+
}
|
|
51
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper-open {
|
|
52
|
+
margin-left: -2.857rem;
|
|
53
|
+
padding-left: 3.143rem;
|
|
54
|
+
width: 23.143rem;
|
|
55
|
+
}
|
|
56
|
+
.styledCapTree.ant-tree.cap-tree-v2.isExpanded .ant-tree-node-content-wrapper-open {
|
|
57
|
+
background: #e9f0fe;
|
|
58
|
+
border-left: 0.143rem solid #2466ea;
|
|
59
|
+
}
|
|
60
|
+
.styledCapTree.ant-tree.cap-tree-v2.isExpanded .ant-tree-node-content-wrapper-open:hover {
|
|
61
|
+
background-color: #e9f0fe;
|
|
62
|
+
}
|
|
63
|
+
.styledCapTree.ant-tree.cap-tree-v2.isExpanded .ant-tree-node-content-wrapper-open .tree-node-title {
|
|
64
|
+
color: #1d61ee;
|
|
65
|
+
}
|
|
66
|
+
.styledCapTree.ant-tree.cap-tree-v2.isExpanded .ant-tree-node-content-wrapper-open .tree-node-icon {
|
|
67
|
+
z-index: 1;
|
|
68
|
+
background: #2466ea;
|
|
69
|
+
color: #ffffff;
|
|
70
|
+
}
|
|
71
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-child-tree .ant-tree-node-content-wrapper {
|
|
72
|
+
position: relative;
|
|
73
|
+
margin-left: 1.143rem;
|
|
74
|
+
padding-left: 0;
|
|
75
|
+
width: 17.857rem;
|
|
76
|
+
}
|
|
77
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-child-tree .ant-tree-node-selected {
|
|
78
|
+
background-color: #e9f0fe;
|
|
79
|
+
}
|
|
80
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-child-tree .ant-tree-title {
|
|
81
|
+
margin-left: -0.857rem;
|
|
82
|
+
}
|
|
83
|
+
.styledCapTree.ant-tree.cap-tree-v2 .ant-tree-child-tree .ant-tree-title .info-icon {
|
|
84
|
+
position: absolute;
|
|
85
|
+
right: 1.786rem;
|
|
86
|
+
top: 1rem;
|
|
87
|
+
}
|
|
88
|
+
.isExpanded.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper-open {
|
|
89
|
+
background: #e9f0fe;
|
|
90
|
+
border-left: 0.143rem solid #2466ea;
|
|
91
|
+
}
|
|
92
|
+
.isExpanded.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper-open:hover {
|
|
93
|
+
background-color: #e9f0fe;
|
|
94
|
+
}
|
|
95
|
+
.isExpanded.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper-open .tree-node-title {
|
|
96
|
+
color: #1d61ee;
|
|
97
|
+
}
|
|
98
|
+
.isExpanded.ant-tree.cap-tree-v2 .ant-tree-node-content-wrapper-open .tree-node-icon {
|
|
99
|
+
z-index: 1;
|
|
100
|
+
background: #2466ea;
|
|
101
|
+
color: #ffffff;
|
|
102
|
+
}
|
|
103
|
+
.ant-popover.cap-popover-tree-v2 {
|
|
104
|
+
width: 23.857rem;
|
|
105
|
+
}
|
|
106
|
+
.ant-popover.cap-popover-tree-v2 .ant-popover-content {
|
|
107
|
+
padding: 0;
|
|
108
|
+
min-height: 12.571rem;
|
|
21
109
|
}
|
|
22
110
|
.ant-popover.cap-popover-tree-v2 .ant-popover-inner-content {
|
|
23
|
-
padding: 0 0
|
|
111
|
+
padding: 0 0 0.857rem 0;
|
|
112
|
+
}
|
|
113
|
+
.ant-popover.cap-popover-tree-v2 .search-and-tree-wrapper {
|
|
114
|
+
display: block;
|
|
115
|
+
}
|
|
116
|
+
.ant-popover.cap-popover-tree-v2 .search-and-tree-wrapper .ant-spin-container {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
.ant-popover.cap-popover-tree-v2 .search-tree-node.ant-input-affix-wrapper {
|
|
120
|
+
width: 100%;
|
|
121
|
+
padding: 0.571rem 0.857rem;
|
|
122
|
+
border-bottom: 0.071rem solid #dfe2e7;
|
|
24
123
|
}
|
|
25
|
-
.ant-popover.cap-popover-tree-v2 .search-tree-node
|
|
26
|
-
|
|
27
|
-
margin-left: 12px;
|
|
124
|
+
.ant-popover.cap-popover-tree-v2 .search-tree-node.ant-input-affix-wrapper .ant-input {
|
|
125
|
+
margin-left: 0.286rem;
|
|
28
126
|
}
|
|
29
|
-
.ant-popover.cap-popover-tree-v2 .
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
127
|
+
.ant-popover.cap-popover-tree-v2 .divider {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.ant-popover.cap-popover-tree-v2 .empty-data-text {
|
|
131
|
+
text-align: center;
|
|
132
|
+
margin-top: 0.857rem;
|
|
133
|
+
padding: 0.714rem 0.857rem;
|
|
33
134
|
}
|
|
34
135
|
.add-condition-tooltip .ant-tooltip-inner {
|
|
35
|
-
width:
|
|
136
|
+
width: 27.571rem;
|
|
36
137
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import './styles.css';const expandIcon = "expandIcon";
|
|
2
|
+
const styledIcon = "styledIcon";
|
|
3
|
+
const styledCapHeading = "styledCapHeading";
|
|
4
|
+
const styledCapColumn = "styledCapColumn";
|
|
5
|
+
const matchedSearch = "matchedSearch";
|
|
6
|
+
const styledCapTree = "styledCapTree";
|
|
7
|
+
const isExpanded = "isExpanded";
|
|
8
|
+
const styles = {
|
|
9
|
+
expandIcon,
|
|
10
|
+
styledIcon,
|
|
11
|
+
styledCapHeading,
|
|
12
|
+
styledCapColumn,
|
|
13
|
+
matchedSearch,
|
|
14
|
+
styledCapTree,
|
|
15
|
+
isExpanded
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
styles as default,
|
|
19
|
+
expandIcon,
|
|
20
|
+
isExpanded,
|
|
21
|
+
matchedSearch,
|
|
22
|
+
styledCapColumn,
|
|
23
|
+
styledCapHeading,
|
|
24
|
+
styledCapTree,
|
|
25
|
+
styledIcon
|
|
26
|
+
};
|
|
@@ -2,38 +2,186 @@
|
|
|
2
2
|
|
|
3
3
|
$popoverTree: cap-popover-tree-v2;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
5
|
+
// ExpandIcon styles
|
|
6
|
+
.expandIcon {
|
|
7
|
+
margin-top: 0.714rem; // 10px / 14
|
|
8
|
+
z-index: 1;
|
|
9
|
+
|
|
10
|
+
svg {
|
|
11
|
+
height: 1.714rem; // 24px / 14
|
|
12
|
+
width: 1.714rem; // 24px / 14
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// StyledIcon styles
|
|
17
|
+
.styledIcon {
|
|
18
|
+
z-index: 1;
|
|
19
|
+
padding: 0.286rem; // 4px / 14
|
|
20
|
+
border-radius: 0.571rem; // 8px / 14
|
|
21
|
+
background: $CAP_G08;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// StyledCapHeading styles
|
|
25
|
+
.styledCapHeading {
|
|
26
|
+
display: inline;
|
|
27
|
+
margin-left: 0.286rem; // 4px / 14
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// StyledCapColumn styles
|
|
31
|
+
.styledCapColumn {
|
|
32
|
+
display: inline;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.matchedSearch {
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// StyledCapTree styles
|
|
40
|
+
.styledCapTree {
|
|
41
|
+
&.ant-tree.cap-tree-v2 {
|
|
42
|
+
min-height: 8.857rem; // 124px / 14
|
|
43
|
+
|
|
44
|
+
li {
|
|
45
|
+
padding: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ant-tree-node-content-wrapper {
|
|
49
|
+
height: 2.857rem; // 40px / 14
|
|
50
|
+
padding: 0.643rem 0 0.786rem 0.286rem; // 9px 0 11px 4px / 14
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: $BG_01;
|
|
54
|
+
margin-left: -2.857rem; // -40px / 14
|
|
55
|
+
padding-left: 3.143rem; // 44px / 14
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ant-tree-node-selected {
|
|
60
|
+
.tree-node-title {
|
|
61
|
+
color: $CAP_COLOR_17; // #1d61ee
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ant-tree-node-content-wrapper-open {
|
|
66
|
+
margin-left: -2.857rem; // -40px / 14
|
|
67
|
+
padding-left: 3.143rem; // 44px / 14
|
|
68
|
+
width: 23.143rem; // 324px / 14
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.isExpanded {
|
|
72
|
+
.ant-tree-node-content-wrapper-open {
|
|
73
|
+
background: $CAP_PALE_GREY;
|
|
74
|
+
border-left: 0.143rem solid $FONT_COLOR_05; // 2px / 14
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: $CAP_PALE_GREY;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tree-node-title {
|
|
81
|
+
color: $CAP_COLOR_17; // #1d61ee
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tree-node-icon {
|
|
85
|
+
z-index: 1;
|
|
86
|
+
background: $FONT_COLOR_05;
|
|
87
|
+
color: $CAP_WHITE;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ant-tree-child-tree {
|
|
93
|
+
.ant-tree-node-content-wrapper {
|
|
94
|
+
position: relative;
|
|
95
|
+
margin-left: 1.143rem; // 16px / 14
|
|
96
|
+
padding-left: 0;
|
|
97
|
+
width: 17.857rem; // 250px / 14
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ant-tree-node-selected {
|
|
101
|
+
background-color: $CAP_PALE_GREY;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ant-tree-title {
|
|
105
|
+
margin-left: -0.857rem; // -12px / 14
|
|
106
|
+
|
|
107
|
+
.info-icon {
|
|
108
|
+
position: absolute;
|
|
109
|
+
right: 1.786rem; // 25px / 14
|
|
110
|
+
top: 1rem; // 14px / 14
|
|
32
111
|
}
|
|
112
|
+
}
|
|
33
113
|
}
|
|
114
|
+
}
|
|
34
115
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
116
|
+
|
|
117
|
+
// IsExpanded styles - exported as separate class for CSS module
|
|
118
|
+
.isExpanded {
|
|
119
|
+
&.ant-tree.cap-tree-v2 {
|
|
120
|
+
.ant-tree-node-content-wrapper-open {
|
|
121
|
+
background: $CAP_PALE_GREY;
|
|
122
|
+
border-left: 0.143rem solid $FONT_COLOR_05; // 2px / 14
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
background-color: $CAP_PALE_GREY;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.tree-node-title {
|
|
129
|
+
color: $CAP_COLOR_17; // #1d61ee
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.tree-node-icon {
|
|
133
|
+
z-index: 1;
|
|
134
|
+
background: $FONT_COLOR_05;
|
|
135
|
+
color: $CAP_WHITE;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ant-popover.#{$popoverTree} {
|
|
142
|
+
width: 23.857rem; // 334px / 14
|
|
143
|
+
.ant-popover-content {
|
|
144
|
+
padding: 0;
|
|
145
|
+
min-height: 12.571rem; // 176px / 14
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ant-popover-inner-content {
|
|
149
|
+
padding: 0 0 $CAP_SPACE_12 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.search-and-tree-wrapper {
|
|
153
|
+
display: block;
|
|
154
|
+
|
|
155
|
+
.ant-spin-container {
|
|
156
|
+
width: 100%;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.search-tree-node {
|
|
161
|
+
&.ant-input-affix-wrapper {
|
|
162
|
+
width: 100%;
|
|
163
|
+
padding: 0.571rem $CAP_SPACE_12; // 8px 12px / 14
|
|
164
|
+
border-bottom: 0.071rem solid $CAP_G07; // 1px / 14
|
|
165
|
+
|
|
166
|
+
.ant-input {
|
|
167
|
+
margin-left: 0.286rem; // 4px / 14
|
|
38
168
|
}
|
|
39
|
-
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.divider {
|
|
173
|
+
display: none; // replaced by search input bottom border
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.empty-data-text {
|
|
177
|
+
text-align: center;
|
|
178
|
+
margin-top: 0.857rem; // 12px / 14
|
|
179
|
+
padding: 0.714rem $CAP_SPACE_12; // 10px 12px / 14
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.add-condition-tooltip {
|
|
184
|
+
.ant-tooltip-inner {
|
|
185
|
+
width: 27.571rem; // 386px / 14
|
|
186
|
+
}
|
|
187
|
+
}
|