@capillarytech/blaze-ui 6.1.0 → 6.1.1
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/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.css +21 -0
- package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.module.scss.js +8 -0
- package/CapEventCalendar/CalendarCanvas/calendarCanvasStyles.scss +17 -0
- package/CapEventCalendar/CalendarCanvas/index.d.ts +3 -52
- package/CapEventCalendar/CalendarCanvas/index.d.ts.map +1 -1
- package/CapEventCalendar/CalendarCanvas/index.js +31 -50
- package/CapEventCalendar/CalendarCanvas/utils.d.ts +5 -9
- package/CapEventCalendar/CalendarCanvas/utils.d.ts.map +1 -1
- package/CapEventCalendar/CalendarCanvas/utils.js +6 -6
- package/CapEventCalendar/components/DayDropdown/index.d.ts +3 -13
- package/CapEventCalendar/components/DayDropdown/index.d.ts.map +1 -1
- package/CapEventCalendar/components/DayDropdown/index.js +32 -14
- package/CapEventCalendar/components/MonthHeader/index.d.ts +3 -9
- package/CapEventCalendar/components/MonthHeader/index.d.ts.map +1 -1
- package/CapEventCalendar/components/MonthHeader/index.js +4 -9
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.css +20 -0
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.module.scss.js +7 -0
- package/CapEventCalendar/components/MonthHeader/monthHeaderStyles.scss +15 -0
- package/CapEventCalendar/drawUtils.d.ts +9 -71
- package/CapEventCalendar/drawUtils.d.ts.map +1 -1
- package/CapEventCalendar/drawUtils.js +12 -4
- package/CapEventCalendar/index.d.ts +4 -80
- package/CapEventCalendar/index.d.ts.map +1 -1
- package/CapEventCalendar/index.js +60 -85
- package/CapEventCalendar/messages.d.ts +25 -0
- package/CapEventCalendar/messages.d.ts.map +1 -0
- package/CapEventCalendar/messages.js +28 -0
- package/CapEventCalendar/styles.css +9 -81
- package/CapEventCalendar/styles.module.scss.js +12 -0
- package/CapEventCalendar/styles.scss +34 -107
- package/CapEventCalendar/tests/types.d.ts +26 -0
- package/CapEventCalendar/tests/types.d.ts.map +1 -0
- package/CapEventCalendar/types.d.ts +188 -0
- package/CapEventCalendar/types.d.ts.map +1 -0
- package/CapEventCalendar/types.js +1 -0
- package/CapEventCalendar/utils.d.ts +11 -9
- package/CapEventCalendar/utils.d.ts.map +1 -1
- package/CapEventCalendar/utils.js +10 -7
- package/CapMobileDatePicker/index.d.ts +3 -14
- package/CapMobileDatePicker/index.d.ts.map +1 -1
- package/CapMobileDatePicker/index.js +28 -20
- package/CapMobileDatePicker/styles.css +28 -11
- package/CapMobileDatePicker/styles.module.scss.js +10 -0
- package/CapMobileDatePicker/styles.scss +37 -16
- package/CapMobileDatePicker/tests/CapMobileDatePicker.mockData.d.ts +41 -0
- package/CapMobileDatePicker/tests/CapMobileDatePicker.mockData.d.ts.map +1 -0
- package/CapMobileDatePicker/types.d.ts +17 -0
- package/CapMobileDatePicker/types.d.ts.map +1 -0
- package/CapMobileDatePicker/types.js +1 -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/CapPopoverTree/types.js +1 -0
- package/CapSelectFilter/index.d.ts.map +1 -1
- package/CapSelectFilter/index.js +11 -10
- package/CapSelectFilter/styles.css +10 -11
- package/CapSelectFilter/styles.module.scss.js +10 -8
- package/CapSelectFilter/styles.scss +8 -11
- package/CapSelectFilter/types.d.ts +1 -1
- package/CapSelectFilter/types.d.ts.map +1 -1
- package/CapTabV3/tests/CapTabV3.mockData.d.ts +26 -26
- package/CapTabV3/tests/CapTabV3.mockData.d.ts.map +1 -1
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -1
- package/index.js +227 -221
- package/package.json +1 -1
- package/utils/dayjs.d.ts +2 -0
- package/utils/dayjs.d.ts.map +1 -1
- package/utils/dayjs.js +2 -0
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CapPopoverTreeProps, TreeNodeData } from '../types';
|
|
2
|
+
export declare const basicTreeData: TreeNodeData[];
|
|
3
|
+
export declare const treeDataWithIcons: TreeNodeData[];
|
|
4
|
+
export declare const singleNodeTreeData: TreeNodeData[];
|
|
5
|
+
export declare const emptyTreeData: TreeNodeData[];
|
|
6
|
+
export declare const nestedTreeData: TreeNodeData[];
|
|
7
|
+
export declare const mockOnSelect: jest.Mock<any, any, any>;
|
|
8
|
+
export declare const defaultProps: CapPopoverTreeProps;
|
|
9
|
+
export declare const propsWithSelectedKey: CapPopoverTreeProps;
|
|
10
|
+
export declare const propsWithDisabledTrigger: CapPopoverTreeProps;
|
|
11
|
+
export declare const propsWithTooltip: CapPopoverTreeProps;
|
|
12
|
+
export declare const propsWithLoading: CapPopoverTreeProps;
|
|
13
|
+
export declare const propsWithEmptyMessage: CapPopoverTreeProps;
|
|
14
|
+
export declare const propsWithSearchPlaceholder: CapPopoverTreeProps;
|
|
15
|
+
export declare const propsWithDefaultExpandAll: CapPopoverTreeProps;
|
|
16
|
+
export declare const propsWithCustomClassName: CapPopoverTreeProps;
|
|
17
|
+
export declare const propsWithRenderOnKeyChange: CapPopoverTreeProps;
|
|
18
|
+
export declare const propsWithTriggerProps: CapPopoverTreeProps;
|
|
19
|
+
export declare const propsWithPlacement: CapPopoverTreeProps;
|
|
20
|
+
export declare const propsWithTriggerHover: CapPopoverTreeProps;
|
|
21
|
+
export declare const propsWithTriggerFocus: CapPopoverTreeProps;
|
|
22
|
+
//# sourceMappingURL=CapPopoverTree.mockData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapPopoverTree.mockData.d.ts","sourceRoot":"","sources":["../../../components/CapPopoverTree/tests/CapPopoverTree.mockData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAElE,eAAO,MAAM,aAAa,EAAE,YAAY,EAcvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAW3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,EAM5C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAAY,EAAO,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,YAAY,EAYxC,CAAC;AAEF,eAAO,MAAM,YAAY,0BAAY,CAAC;AAEtC,eAAO,MAAM,YAAY,EAAE,mBAK1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,mBAGlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAItC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,mBAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,mBAI9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,mBAInC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,mBAGvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAItC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,mBAGhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,mBAGnC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { TreeProps } from 'antd-v5';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { CapPopoverProps } from '../CapPopover/types';
|
|
4
|
+
export interface TreeNodeData {
|
|
5
|
+
title: string | React.ReactNode;
|
|
6
|
+
key: string;
|
|
7
|
+
children?: TreeNodeData[];
|
|
8
|
+
icon?: string;
|
|
9
|
+
info?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for CapPopoverTree component
|
|
14
|
+
*
|
|
15
|
+
* @deprecated Props inherited from CapPopoverProps (Ant Design Popover component):
|
|
16
|
+
* - `overlayClassName` - Use `classNames.root` on CapPopover instead
|
|
17
|
+
* - `visible` - Use `open` instead (not recommended for public API - component manages popover state internally)
|
|
18
|
+
* - `onVisibleChange` - Use `onOpenChange` instead (not recommended for public API - component manages popover state internally)
|
|
19
|
+
*
|
|
20
|
+
* These deprecated props are handled internally by CapPopover with backward compatibility.
|
|
21
|
+
* They will show deprecation warnings in development mode.
|
|
22
|
+
*
|
|
23
|
+
* Note: `visible` and `onVisibleChange` are inherited from CapPopoverProps but are not recommended
|
|
24
|
+
* for use as the component manages popover state internally. Use `overlayClassName` if needed for styling.
|
|
25
|
+
*/
|
|
26
|
+
export interface CapPopoverTreeProps extends Omit<TreeProps, 'treeData' | 'onSelect' | 'className' | 'classNames' | 'styles' | 'motion'>, Omit<CapPopoverProps, 'content' | 'classNames' | 'motion'> {
|
|
27
|
+
/** Tree data structure */
|
|
28
|
+
treeData?: TreeNodeData[];
|
|
29
|
+
/** Component to use as trigger */
|
|
30
|
+
TriggerComponent?: React.ComponentType<Record<string, unknown>>;
|
|
31
|
+
/** Text to display in trigger component */
|
|
32
|
+
componentText?: string;
|
|
33
|
+
/** Props to pass to trigger component */
|
|
34
|
+
triggerProps?: Record<string, unknown>;
|
|
35
|
+
/** Whether trigger is disabled */
|
|
36
|
+
isTriggerDisabled?: boolean;
|
|
37
|
+
/** Text to show when trigger is disabled */
|
|
38
|
+
triggerDisabledText?: string;
|
|
39
|
+
/** Tooltip text */
|
|
40
|
+
tooltipText?: string;
|
|
41
|
+
/** Whether data is loading */
|
|
42
|
+
isLoadingData?: boolean;
|
|
43
|
+
/** Loading tip text */
|
|
44
|
+
loadingTip?: string;
|
|
45
|
+
/** Custom switcher icon */
|
|
46
|
+
switcherIcon?: React.ReactNode;
|
|
47
|
+
/** Additional CSS class name */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Expand all nodes by default */
|
|
50
|
+
defaultExpandAll?: boolean;
|
|
51
|
+
/** Callback when node is selected */
|
|
52
|
+
onSelect?: (selectedKey: string[]) => void;
|
|
53
|
+
/** Currently selected key */
|
|
54
|
+
selectedKey?: string[];
|
|
55
|
+
/** Message to show when tree data is empty */
|
|
56
|
+
emptyDataMessage?: string | React.ReactNode;
|
|
57
|
+
/** Placeholder text for search input */
|
|
58
|
+
searchPlaceholder?: string | React.ReactNode;
|
|
59
|
+
/** Whether to re-render tree on key change */
|
|
60
|
+
renderOnKeyChange?: boolean;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapPopoverTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBACf,SAAQ,IAAI,CACR,SAAS,EACT,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAC3E,EACD,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC5D,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC3C,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC5C,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC7C,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAM7E,eAAO,MAAM,cAAc,GAAI,OAAO,uBAAuB,EAAE,EAAE,gBAAgB,MAAM;;;;;GAStF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,KAAK,CAAC,SAAS,EACrB,oBAAoB,MAAM,EAC1B,gBAAgB,MAAM,4CAcvB,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAM7E,eAAO,MAAM,cAAc,GAAI,OAAO,uBAAuB,EAAE,EAAE,gBAAgB,MAAM;;;;;GAStF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,MAAM,KAAK,CAAC,SAAS,EACrB,oBAAoB,MAAM,EAC1B,gBAAgB,MAAM,4CAcvB,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0DnD,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,YAAY,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC"}
|
package/CapSelectFilter/index.js
CHANGED
|
@@ -11,8 +11,8 @@ const renderMenuItem = (items, selectedValue) => {
|
|
|
11
11
|
return items.map((item) => ({
|
|
12
12
|
key: item.key,
|
|
13
13
|
label: /* @__PURE__ */ jsx(CapHeadingWithStatic, { type: "h5", children: item.label }),
|
|
14
|
-
className: classNames(styles[
|
|
15
|
-
[styles[
|
|
14
|
+
className: classNames(styles["menu-item"], {
|
|
15
|
+
[styles["menu-item-selected"]]: item.value === selectedValue
|
|
16
16
|
}),
|
|
17
17
|
"data-value": item.value
|
|
18
18
|
}));
|
|
@@ -21,7 +21,7 @@ const renderDropdownMenu = (menu, dropdownMaxHeight, dropdownWidth) => {
|
|
|
21
21
|
return /* @__PURE__ */ jsx(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
|
-
className: styles[
|
|
24
|
+
className: styles["menu-wrapper"],
|
|
25
25
|
style: {
|
|
26
26
|
maxHeight: dropdownMaxHeight,
|
|
27
27
|
width: dropdownWidth,
|
|
@@ -34,11 +34,11 @@ const renderDropdownMenu = (menu, dropdownMaxHeight, dropdownWidth) => {
|
|
|
34
34
|
const CapSelectFilter = ({
|
|
35
35
|
className,
|
|
36
36
|
overlayClassName,
|
|
37
|
-
triggerClass,
|
|
38
37
|
onSelect,
|
|
39
38
|
selectedValue,
|
|
40
39
|
placeholder,
|
|
41
40
|
placement = "bottomLeft",
|
|
41
|
+
width = "fit-content",
|
|
42
42
|
dropdownMaxHeight = "320px",
|
|
43
43
|
dropdownWidth = "228px",
|
|
44
44
|
data = [],
|
|
@@ -67,21 +67,22 @@ const CapSelectFilter = ({
|
|
|
67
67
|
trigger: ["click"],
|
|
68
68
|
menu: { items: renderMenuItem(data, selectedValue), onClick: handleMenuClick },
|
|
69
69
|
className: classNames(styles[clsPrefix]),
|
|
70
|
-
overlayClassName: classNames(
|
|
70
|
+
overlayClassName: classNames(`${clsPrefix}-overlay`, overlayClassName),
|
|
71
71
|
dropdownRender: (menu) => renderDropdownMenu(menu, dropdownMaxHeight, dropdownWidth),
|
|
72
72
|
getPopupContainer: (trigger) => trigger.parentNode,
|
|
73
73
|
...rest,
|
|
74
74
|
children: /* @__PURE__ */ jsxs(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
className: classNames(styles[
|
|
78
|
-
[styles[
|
|
79
|
-
[styles[
|
|
77
|
+
className: classNames(styles["styled-div"], className, {
|
|
78
|
+
[styles["styled-div-selected"]]: selectedValue,
|
|
79
|
+
[styles["styled-div-with-badge"]]: Boolean(showBadge) && Boolean(selectedValue)
|
|
80
80
|
}),
|
|
81
|
+
style: { width },
|
|
81
82
|
children: [
|
|
82
83
|
/* @__PURE__ */ jsx(CapLabelInline, { type: "label9", children: placeholder }),
|
|
83
|
-
showBadge && selectedValue && /* @__PURE__ */ jsx("div", { className: styles[
|
|
84
|
-
/* @__PURE__ */ jsx(CapIcon, { className: styles[
|
|
84
|
+
showBadge && selectedValue && /* @__PURE__ */ jsx("div", { className: styles["badge"], children: [selectedValue].length }),
|
|
85
|
+
/* @__PURE__ */ jsx(CapIcon, { className: styles["dropdown-icon"], type: "down", size: "s" })
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
)
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
.cap-select-filter-v2 {
|
|
10
10
|
display: inline-block;
|
|
11
11
|
}
|
|
12
|
-
.
|
|
13
|
-
width: fit-content;
|
|
12
|
+
.styled-div {
|
|
14
13
|
position: relative;
|
|
15
14
|
display: flex;
|
|
16
15
|
align-items: center;
|
|
@@ -22,32 +21,32 @@
|
|
|
22
21
|
cursor: pointer;
|
|
23
22
|
transition: all 0.3s ease;
|
|
24
23
|
}
|
|
25
|
-
.
|
|
24
|
+
.styled-div:hover {
|
|
26
25
|
border-color: #091e42;
|
|
27
26
|
}
|
|
28
|
-
.
|
|
27
|
+
.styled-div.styled-div-selected {
|
|
29
28
|
border: none;
|
|
30
29
|
background-color: #ecece7;
|
|
31
30
|
}
|
|
32
|
-
.
|
|
31
|
+
.styled-div.ant-dropdown-open {
|
|
33
32
|
border-color: #091e42;
|
|
34
33
|
}
|
|
35
|
-
.
|
|
34
|
+
.menu-wrapper {
|
|
36
35
|
border: 0.071rem solid #e8e8e8;
|
|
37
36
|
}
|
|
38
|
-
.
|
|
37
|
+
.menu-wrapper .ant-dropdown-menu {
|
|
39
38
|
border: none;
|
|
40
39
|
box-shadow: none;
|
|
41
40
|
}
|
|
42
|
-
.
|
|
41
|
+
.menu-item {
|
|
43
42
|
background-color: transparent;
|
|
44
43
|
border-left: 0.214rem solid transparent;
|
|
45
44
|
}
|
|
46
|
-
.
|
|
45
|
+
.menu-item.menu-item-selected {
|
|
47
46
|
background-color: #e9f0fe;
|
|
48
47
|
border-left-color: #2466ea;
|
|
49
48
|
}
|
|
50
|
-
.
|
|
49
|
+
.badge {
|
|
51
50
|
display: flex;
|
|
52
51
|
align-items: center;
|
|
53
52
|
justify-content: center;
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
font-weight: 500;
|
|
62
61
|
line-height: normal;
|
|
63
62
|
}
|
|
64
|
-
.
|
|
63
|
+
.dropdown-icon {
|
|
65
64
|
position: relative;
|
|
66
65
|
width: 1.786rem;
|
|
67
66
|
min-width: 1.786rem;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import './styles.css';const
|
|
1
|
+
import './styles.css';const badge = "badge";
|
|
2
|
+
const styles = {
|
|
2
3
|
"cap-select-filter-v2": "cap-select-filter-v2",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
4
|
+
"styled-div": "styled-div",
|
|
5
|
+
"styled-div-selected": "styled-div-selected",
|
|
5
6
|
"ant-dropdown-open": "ant-dropdown-open",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
7
|
+
"menu-wrapper": "menu-wrapper",
|
|
8
|
+
"menu-item": "menu-item",
|
|
9
|
+
"menu-item-selected": "menu-item-selected",
|
|
10
|
+
badge,
|
|
11
|
+
"dropdown-icon": "dropdown-icon"
|
|
11
12
|
};
|
|
12
13
|
export {
|
|
14
|
+
badge,
|
|
13
15
|
styles as default
|
|
14
16
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
@import '../styles/_variables';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.#{$cap-select-filter-v2-prefix} {
|
|
3
|
+
.cap-select-filter-v2 {
|
|
6
4
|
display: inline-block;
|
|
7
5
|
}
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
width: fit-content;
|
|
7
|
+
.styled-div {
|
|
11
8
|
position: relative;
|
|
12
9
|
display: flex;
|
|
13
10
|
align-items: center;
|
|
@@ -23,7 +20,7 @@ $cap-select-filter-v2-prefix: 'cap-select-filter-v2';
|
|
|
23
20
|
border-color: $cap-g01;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
&.styled-div-selected {
|
|
27
24
|
border: none;
|
|
28
25
|
background-color: $cap-g13;
|
|
29
26
|
}
|
|
@@ -33,7 +30,7 @@ $cap-select-filter-v2-prefix: 'cap-select-filter-v2';
|
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
.menu-wrapper {
|
|
37
34
|
border: $border-width-1 solid $cap-g12;
|
|
38
35
|
|
|
39
36
|
:global(.ant-dropdown-menu) {
|
|
@@ -42,17 +39,17 @@ $cap-select-filter-v2-prefix: 'cap-select-filter-v2';
|
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
.menu-item {
|
|
46
43
|
background-color: transparent;
|
|
47
44
|
border-left: 0.214rem solid transparent;
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
&.menu-item-selected {
|
|
50
47
|
background-color: $cap-pale-grey;
|
|
51
48
|
border-left-color: $font-color-05;
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
.badge {
|
|
56
53
|
display: flex;
|
|
57
54
|
align-items: center;
|
|
58
55
|
justify-content: center;
|
|
@@ -67,7 +64,7 @@ $cap-select-filter-v2-prefix: 'cap-select-filter-v2';
|
|
|
67
64
|
line-height: $normal-line-height;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
.dropdown-icon {
|
|
71
68
|
position: relative;
|
|
72
69
|
width: 1.786rem; // 25px
|
|
73
70
|
min-width: 1.786rem;
|
|
@@ -8,12 +8,12 @@ export interface CapSelectFilterMenuItem {
|
|
|
8
8
|
export interface CapSelectFilterProps extends Omit<DropdownProps, 'menu' | 'overlay' | 'overlayStyle' | 'onOpenChange'> {
|
|
9
9
|
className?: string;
|
|
10
10
|
overlayClassName?: string;
|
|
11
|
-
triggerClass?: string;
|
|
12
11
|
onSelect?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
13
12
|
onOpenChange?: (open: boolean) => void;
|
|
14
13
|
selectedValue?: string;
|
|
15
14
|
placeholder?: string | React.ReactNode;
|
|
16
15
|
placement?: 'bottomLeft' | 'bottom' | 'bottomRight' | 'topLeft' | 'top' | 'topRight';
|
|
16
|
+
width?: string;
|
|
17
17
|
dropdownMaxHeight?: string;
|
|
18
18
|
dropdownWidth?: string;
|
|
19
19
|
data?: CapSelectFilterMenuItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapSelectFilter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,CAAC;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|