@teambit/component.ui.component-filters.env-filter 0.0.260 → 0.0.262
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/dist/dropdown-item.d.ts +6 -0
- package/dist/dropdown-item.js +31 -0
- package/dist/dropdown-item.js.map +1 -0
- package/dist/envs-filter.d.ts +1 -16
- package/dist/envs-filter.js +8 -33
- package/dist/envs-filter.js.map +1 -1
- package/dist/envs-filter.module.scss +5 -18
- package/dist/types.d.ts +23 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dropdown-item.tsx +48 -0
- package/envs-filter.module.scss +5 -18
- package/envs-filter.tsx +24 -95
- package/package.json +7 -7
- package/types.ts +27 -0
- /package/dist/{preview-1756479098146.js → preview-1757523924602.js} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EnvFilterEnvState } from './types';
|
|
3
|
+
export declare function EnvsPlaceholder({ onClick }: {
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export declare function EnvsDropdownItem({ displayName, icon, description, componentId, id }: EnvFilterEnvState): React.JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EnvsPlaceholder = EnvsPlaceholder;
|
|
7
|
+
exports.EnvsDropdownItem = EnvsDropdownItem;
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
|
|
10
|
+
const design_ui_styles_ellipsis_1 = require("@teambit/design.ui.styles.ellipsis");
|
|
11
|
+
const design_ui_tooltip_1 = require("@teambit/design.ui.tooltip");
|
|
12
|
+
const base_react_navigation_link_1 = require("@teambit/base-react.navigation.link");
|
|
13
|
+
const envs_filter_module_scss_1 = __importDefault(require("./envs-filter.module.scss"));
|
|
14
|
+
function EnvsPlaceholder({ onClick }) {
|
|
15
|
+
return (react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.filterIcon, onClick: onClick },
|
|
16
|
+
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/env.svg" }),
|
|
17
|
+
react_1.default.createElement("span", { className: envs_filter_module_scss_1.default.filterIconLabel }, "Environments"),
|
|
18
|
+
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.dropdownArrow },
|
|
19
|
+
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/fat-arrow-down.svg" }))));
|
|
20
|
+
}
|
|
21
|
+
function EnvsDropdownItem({ displayName, icon, description, componentId, id }) {
|
|
22
|
+
return (react_1.default.createElement(design_ui_tooltip_1.Tooltip, { placement: "right", content: react_1.default.createElement(base_react_navigation_link_1.Link, { className: envs_filter_module_scss_1.default.envLink, href: component_modules_component_url_1.ComponentUrl.toUrl(componentId, { includeVersion: false }), external: true }, id) },
|
|
23
|
+
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItemContainer },
|
|
24
|
+
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItem },
|
|
25
|
+
react_1.default.createElement(design_ui_styles_ellipsis_1.Ellipsis, null, displayName),
|
|
26
|
+
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItemIconContainer },
|
|
27
|
+
react_1.default.createElement("img", { className: envs_filter_module_scss_1.default.envDropdownItemIcon, src: icon }))),
|
|
28
|
+
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.description },
|
|
29
|
+
react_1.default.createElement(design_ui_styles_ellipsis_1.Ellipsis, { className: envs_filter_module_scss_1.default.descriptionText }, description)))));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=dropdown-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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,EAAE,iCAAM,CAAC,eAAe,IAAG,WAAW,CAAY,CACjE,CACF,CACE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/envs-filter.d.ts
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ComponentFilterCriteria } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
3
|
-
type EnvFilterEnvState = {
|
|
4
|
-
active: boolean;
|
|
5
|
-
icon?: string;
|
|
6
|
-
displayName: string;
|
|
7
|
-
id: string;
|
|
8
|
-
description: string;
|
|
9
|
-
componentId: ComponentID;
|
|
10
|
-
};
|
|
11
|
-
export type EnvFilterState = {
|
|
12
|
-
envsState: Map<string, EnvFilterEnvState>;
|
|
13
|
-
dropdownState: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type EnvsFilterCriteria = ComponentFilterCriteria<EnvFilterState>;
|
|
1
|
+
import type { EnvsFilterCriteria } from './types';
|
|
16
2
|
export declare const EnvsFilter: EnvsFilterCriteria;
|
|
17
|
-
export {};
|
package/dist/envs-filter.js
CHANGED
|
@@ -28,17 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.EnvsFilter = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const design_inputs_selectors_multi_select_1 = require("@teambit/design.inputs.selectors.multi-select");
|
|
32
|
-
const component_1 = require("@teambit/component");
|
|
33
|
-
const component_modules_component_url_1 = require("@teambit/component.modules.component-url");
|
|
34
31
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
|
-
const
|
|
36
|
-
const design_ui_tooltip_1 = require("@teambit/design.ui.tooltip");
|
|
37
|
-
const base_react_navigation_link_1 = require("@teambit/base-react.navigation.link");
|
|
32
|
+
const component_1 = require("@teambit/component");
|
|
38
33
|
const component_ui_component_filters_component_filter_context_1 = require("@teambit/component.ui.component-filters.component-filter-context");
|
|
34
|
+
const design_inputs_selectors_checkbox_item_1 = require("@teambit/design.inputs.selectors.checkbox-item");
|
|
35
|
+
const design_inputs_dropdown_1 = require("@teambit/design.inputs.dropdown");
|
|
36
|
+
const dropdown_item_1 = require("./dropdown-item");
|
|
39
37
|
const envs_filter_module_scss_1 = __importDefault(require("./envs-filter.module.scss"));
|
|
40
|
-
// @todo - this will be fixed as part of the @teambit/base-react.navigation.link upgrade to latest
|
|
41
|
-
const Link = base_react_navigation_link_1.Link;
|
|
42
38
|
exports.EnvsFilter = {
|
|
43
39
|
id: 'envs',
|
|
44
40
|
match: ({ component }, filter) => {
|
|
@@ -104,6 +100,7 @@ function envsFilter({ components, className, lanes }) {
|
|
|
104
100
|
const filterContext = (0, component_ui_component_filters_component_filter_context_1.useComponentFilter)(exports.EnvsFilter.id, envsFilterState);
|
|
105
101
|
const envs = envsFilterState.envsState;
|
|
106
102
|
const [currentFilter, updateFilter] = filterContext || [];
|
|
103
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
107
104
|
/**
|
|
108
105
|
* this will not work if other filters in a single re-render
|
|
109
106
|
* result in the same number of components with different ids
|
|
@@ -122,7 +119,7 @@ function envsFilter({ components, className, lanes }) {
|
|
|
122
119
|
icon: state.icon,
|
|
123
120
|
description: state.description,
|
|
124
121
|
checked: !!((_a = currentFilter === null || currentFilter === void 0 ? void 0 : currentFilter.state.envsState.get(state.id)) === null || _a === void 0 ? void 0 : _a.active),
|
|
125
|
-
element: react_1.default.createElement(EnvsDropdownItem, Object.assign({}, state)),
|
|
122
|
+
element: react_1.default.createElement(dropdown_item_1.EnvsDropdownItem, Object.assign({}, state)),
|
|
126
123
|
});
|
|
127
124
|
});
|
|
128
125
|
const onCheck = (value, e) => {
|
|
@@ -151,31 +148,9 @@ function envsFilter({ components, className, lanes }) {
|
|
|
151
148
|
currentState.state.dropdownState = false;
|
|
152
149
|
return currentState;
|
|
153
150
|
});
|
|
154
|
-
|
|
155
|
-
const onDropdownToggled = (event, open) => {
|
|
156
|
-
updateFilter === null || updateFilter === void 0 ? void 0 : updateFilter((currentState) => {
|
|
157
|
-
currentState.state.dropdownState = open;
|
|
158
|
-
return currentState;
|
|
159
|
-
});
|
|
151
|
+
setOpen(false);
|
|
160
152
|
};
|
|
161
153
|
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(envs_filter_module_scss_1.default.envsFilterContainer, className) },
|
|
162
|
-
react_1.default.createElement(
|
|
163
|
-
}
|
|
164
|
-
function EnvsPlaceholder() {
|
|
165
|
-
return (react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.filterIcon },
|
|
166
|
-
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/env.svg" }),
|
|
167
|
-
react_1.default.createElement("span", { className: envs_filter_module_scss_1.default.filterIconLabel }, "Environments"),
|
|
168
|
-
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.dropdownArrow },
|
|
169
|
-
react_1.default.createElement("img", { src: "https://static.bit.dev/bit-icons/fat-arrow-down.svg" }))));
|
|
170
|
-
}
|
|
171
|
-
function EnvsDropdownItem({ displayName, icon, description, componentId, id }) {
|
|
172
|
-
return (react_1.default.createElement(design_ui_tooltip_1.Tooltip, { placement: "right", content: react_1.default.createElement(Link, { className: envs_filter_module_scss_1.default.envLink, href: component_modules_component_url_1.ComponentUrl.toUrl(componentId, { includeVersion: false }), external: true }, id) },
|
|
173
|
-
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItemContainer },
|
|
174
|
-
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItem },
|
|
175
|
-
react_1.default.createElement(design_ui_styles_ellipsis_1.Ellipsis, null, displayName),
|
|
176
|
-
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.envDropdownItemIconContainer },
|
|
177
|
-
react_1.default.createElement("img", { className: envs_filter_module_scss_1.default.envDropdownItemIcon, src: icon }))),
|
|
178
|
-
react_1.default.createElement("div", { className: envs_filter_module_scss_1.default.description },
|
|
179
|
-
react_1.default.createElement(design_ui_styles_ellipsis_1.Ellipsis, { className: envs_filter_module_scss_1.default.descriptionText }, description)))));
|
|
154
|
+
react_1.default.createElement(design_inputs_dropdown_1.Dropdown, { open: open, onClickOutside: () => setOpen(false), placeholderContent: react_1.default.createElement(dropdown_item_1.EnvsPlaceholder, { onClick: () => setOpen(!open) }), bottomPlugin: react_1.default.createElement(design_inputs_dropdown_1.ButtonsPlugin, { onClear: onClear, onSubmit: onSubmit, submitClassName: envs_filter_module_scss_1.default.doneButton }), className: (0, classnames_1.default)(envs_filter_module_scss_1.default.envFilterDropdown), dropClass: (0, classnames_1.default)(envs_filter_module_scss_1.default.envFilterDropdown), position: "bottom" }, selectList.map((option, index) => (react_1.default.createElement(design_inputs_selectors_checkbox_item_1.CheckboxItem, { key: index, checked: option.checked, onInputChanged: (e) => onCheck(option.value, e) }, option.element))))));
|
|
180
155
|
}
|
|
181
156
|
//# sourceMappingURL=envs-filter.js.map
|
package/dist/envs-filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envs-filter.js","sourceRoot":"","sources":["../envs-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"envs-filter.js","sourceRoot":"","sources":["../envs-filter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,4DAAoC;AAEpC,kDAAiD;AAEjD,8IAI0E;AAC1E,0GAA8E;AAC9E,4EAA0E;AAC1E,mDAAoE;AAEpE,wFAA+C;AAElC,QAAA,UAAU,GAAuB;IAC5C,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE;;QAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,MAAM,gBAAgB,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,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c,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAC/F,MAAM,CAAC,OAAO,CACF,CAChB,CAAC,CACO,CACP,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@import '@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';
|
|
2
1
|
.envsFilterContainer {
|
|
3
2
|
> div {
|
|
4
3
|
line-height: 16px;
|
|
@@ -31,15 +30,13 @@
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
.
|
|
33
|
+
.envFilterDropdown {
|
|
35
34
|
width: 100%;
|
|
35
|
+
max-width: 400px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
// otherwise when the dropdown is open it clashes with the content of the tree
|
|
41
|
-
// (this is bizarre, the tree has no position absolute)
|
|
42
|
-
z-index: $nav-z-index;
|
|
38
|
+
.doneButton {
|
|
39
|
+
transition: none;
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
.envDropdownItemContainer {
|
|
@@ -56,34 +53,24 @@
|
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.envDropdownItem {
|
|
59
|
-
padding-left: 8px;
|
|
60
56
|
display: flex;
|
|
61
57
|
justify-content: space-between;
|
|
62
58
|
width: 100%;
|
|
63
59
|
font-size: var(--bit-p-md, 16px);
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
.envDropdownItemLabel,
|
|
67
62
|
.envDropdownItemIcon {
|
|
68
63
|
display: flex;
|
|
69
64
|
justify-content: space-between;
|
|
70
65
|
padding-left: 8px;
|
|
71
66
|
}
|
|
67
|
+
|
|
72
68
|
.description {
|
|
73
69
|
font-size: var(--bit-p-xs, 14px);
|
|
74
|
-
padding-left: 8px;
|
|
75
|
-
padding-right: 16px;
|
|
76
70
|
color: var(--bit-text-color-light, #6c707c);
|
|
77
71
|
width: calc(100% - 24px);
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
.envDropdownItemContainerWithIcon {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: row;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
width: calc(100% - 24px);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
74
|
.descriptionText {
|
|
88
75
|
width: 100%;
|
|
89
76
|
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { ComponentID } from '@teambit/component';
|
|
3
|
+
import type { ComponentFilterCriteria } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
4
|
+
export interface ItemType {
|
|
5
|
+
value: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
description: string;
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
element: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export type EnvFilterEnvState = {
|
|
12
|
+
active: boolean;
|
|
13
|
+
icon?: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
id: string;
|
|
16
|
+
description: string;
|
|
17
|
+
componentId: ComponentID;
|
|
18
|
+
};
|
|
19
|
+
export type EnvFilterState = {
|
|
20
|
+
envsState: Map<string, EnvFilterEnvState>;
|
|
21
|
+
dropdownState: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type EnvsFilterCriteria = ComponentFilterCriteria<EnvFilterState>;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentUrl } from '@teambit/component.modules.component-url';
|
|
3
|
+
import { Ellipsis } from '@teambit/design.ui.styles.ellipsis';
|
|
4
|
+
import { Tooltip } from '@teambit/design.ui.tooltip';
|
|
5
|
+
import { Link } from '@teambit/base-react.navigation.link';
|
|
6
|
+
import type { EnvFilterEnvState } from './types';
|
|
7
|
+
import styles from './envs-filter.module.scss';
|
|
8
|
+
|
|
9
|
+
export function EnvsPlaceholder({ onClick }: { onClick?: () => void }) {
|
|
10
|
+
return (
|
|
11
|
+
<div className={styles.filterIcon} onClick={onClick}>
|
|
12
|
+
<img src="https://static.bit.dev/bit-icons/env.svg" />
|
|
13
|
+
<span className={styles.filterIconLabel}>Environments</span>
|
|
14
|
+
<div className={styles.dropdownArrow}>
|
|
15
|
+
<img src="https://static.bit.dev/bit-icons/fat-arrow-down.svg" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function EnvsDropdownItem({ displayName, icon, description, componentId, id }: EnvFilterEnvState) {
|
|
22
|
+
return (
|
|
23
|
+
<Tooltip
|
|
24
|
+
placement="right"
|
|
25
|
+
content={
|
|
26
|
+
<Link
|
|
27
|
+
className={styles.envLink}
|
|
28
|
+
href={ComponentUrl.toUrl(componentId, { includeVersion: false })}
|
|
29
|
+
external={true}
|
|
30
|
+
>
|
|
31
|
+
{id}
|
|
32
|
+
</Link>
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
<div className={styles.envDropdownItemContainer}>
|
|
36
|
+
<div className={styles.envDropdownItem}>
|
|
37
|
+
<Ellipsis>{displayName}</Ellipsis>
|
|
38
|
+
<div className={styles.envDropdownItemIconContainer}>
|
|
39
|
+
<img className={styles.envDropdownItemIcon} src={icon}></img>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div className={styles.description}>
|
|
43
|
+
<Ellipsis className={styles.descriptionText}>{description}</Ellipsis>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
);
|
|
48
|
+
}
|
package/envs-filter.module.scss
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@import '@teambit/ui-foundation.ui.constants.z-indexes/z-indexes.module.scss';
|
|
2
1
|
.envsFilterContainer {
|
|
3
2
|
> div {
|
|
4
3
|
line-height: 16px;
|
|
@@ -31,15 +30,13 @@
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
.
|
|
33
|
+
.envFilterDropdown {
|
|
35
34
|
width: 100%;
|
|
35
|
+
max-width: 400px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
// otherwise when the dropdown is open it clashes with the content of the tree
|
|
41
|
-
// (this is bizarre, the tree has no position absolute)
|
|
42
|
-
z-index: $nav-z-index;
|
|
38
|
+
.doneButton {
|
|
39
|
+
transition: none;
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
.envDropdownItemContainer {
|
|
@@ -56,34 +53,24 @@
|
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
.envDropdownItem {
|
|
59
|
-
padding-left: 8px;
|
|
60
56
|
display: flex;
|
|
61
57
|
justify-content: space-between;
|
|
62
58
|
width: 100%;
|
|
63
59
|
font-size: var(--bit-p-md, 16px);
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
.envDropdownItemLabel,
|
|
67
62
|
.envDropdownItemIcon {
|
|
68
63
|
display: flex;
|
|
69
64
|
justify-content: space-between;
|
|
70
65
|
padding-left: 8px;
|
|
71
66
|
}
|
|
67
|
+
|
|
72
68
|
.description {
|
|
73
69
|
font-size: var(--bit-p-xs, 14px);
|
|
74
|
-
padding-left: 8px;
|
|
75
|
-
padding-right: 16px;
|
|
76
70
|
color: var(--bit-text-color-light, #6c707c);
|
|
77
71
|
width: calc(100% - 24px);
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
.envDropdownItemContainerWithIcon {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: row;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
width: calc(100% - 24px);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
74
|
.descriptionText {
|
|
88
75
|
width: 100%;
|
|
89
76
|
}
|
package/envs-filter.tsx
CHANGED
|
@@ -1,42 +1,19 @@
|
|
|
1
|
-
import React, { useMemo, useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { MultiSelect } from '@teambit/design.inputs.selectors.multi-select';
|
|
1
|
+
import React, { useMemo, useEffect, useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
4
3
|
import type { ComponentModel } from '@teambit/component';
|
|
5
4
|
import { ComponentID } from '@teambit/component';
|
|
6
|
-
import {
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { Ellipsis } from '@teambit/design.ui.styles.ellipsis';
|
|
9
|
-
import { Tooltip } from '@teambit/design.ui.tooltip';
|
|
10
|
-
import { Link as BaseLink } from '@teambit/base-react.navigation.link';
|
|
11
|
-
import type {
|
|
12
|
-
ComponentFilterCriteria,
|
|
13
|
-
ComponentFilterRenderProps,
|
|
14
|
-
} from '@teambit/component.ui.component-filters.component-filter-context';
|
|
5
|
+
import type { ComponentFilterRenderProps } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
15
6
|
import {
|
|
16
7
|
useComponentFilter,
|
|
17
8
|
useComponentFilters,
|
|
18
9
|
runAllFilters,
|
|
19
10
|
} from '@teambit/component.ui.component-filters.component-filter-context';
|
|
20
|
-
|
|
11
|
+
import { CheckboxItem } from '@teambit/design.inputs.selectors.checkbox-item';
|
|
12
|
+
import { Dropdown, ButtonsPlugin } from '@teambit/design.inputs.dropdown';
|
|
13
|
+
import { EnvsPlaceholder, EnvsDropdownItem } from './dropdown-item';
|
|
14
|
+
import type { EnvsFilterCriteria, EnvFilterEnvState, ItemType } from './types';
|
|
21
15
|
import styles from './envs-filter.module.scss';
|
|
22
16
|
|
|
23
|
-
// @todo - this will be fixed as part of the @teambit/base-react.navigation.link upgrade to latest
|
|
24
|
-
const Link = BaseLink as any;
|
|
25
|
-
|
|
26
|
-
type EnvFilterEnvState = {
|
|
27
|
-
active: boolean;
|
|
28
|
-
icon?: string;
|
|
29
|
-
displayName: string;
|
|
30
|
-
id: string;
|
|
31
|
-
description: string;
|
|
32
|
-
componentId: ComponentID;
|
|
33
|
-
};
|
|
34
|
-
export type EnvFilterState = {
|
|
35
|
-
envsState: Map<string, EnvFilterEnvState>;
|
|
36
|
-
dropdownState: boolean;
|
|
37
|
-
};
|
|
38
|
-
export type EnvsFilterCriteria = ComponentFilterCriteria<EnvFilterState>;
|
|
39
|
-
|
|
40
17
|
export const EnvsFilter: EnvsFilterCriteria = {
|
|
41
18
|
id: 'envs',
|
|
42
19
|
match: ({ component }, filter) => {
|
|
@@ -105,19 +82,15 @@ const deriveEnvsFilterState = (components: ComponentModel[]) => {
|
|
|
105
82
|
function envsFilter({ components, className, lanes }: ComponentFilterRenderProps) {
|
|
106
83
|
const [filters = []] = useComponentFilters() || [];
|
|
107
84
|
const filtersExceptEnv = filters.filter((filter) => filter.id !== EnvsFilter.id);
|
|
108
|
-
|
|
109
85
|
const filteredComponents = useMemo(
|
|
110
86
|
() => runAllFilters(filtersExceptEnv, { components, lanes }),
|
|
111
87
|
[JSON.stringify(filtersExceptEnv), lanes?.viewedLane?.id.toString()]
|
|
112
88
|
);
|
|
113
|
-
|
|
114
89
|
const envsFilterState = deriveEnvsFilterState(filteredComponents);
|
|
115
|
-
|
|
116
90
|
const filterContext = useComponentFilter(EnvsFilter.id, envsFilterState);
|
|
117
|
-
|
|
118
91
|
const envs = envsFilterState.envsState;
|
|
119
|
-
|
|
120
92
|
const [currentFilter, updateFilter] = filterContext || [];
|
|
93
|
+
const [open, setOpen] = useState(false);
|
|
121
94
|
|
|
122
95
|
/**
|
|
123
96
|
* this will not work if other filters in a single re-render
|
|
@@ -173,70 +146,26 @@ function envsFilter({ components, className, lanes }: ComponentFilterRenderProps
|
|
|
173
146
|
currentState.state.dropdownState = false;
|
|
174
147
|
return currentState;
|
|
175
148
|
});
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const onDropdownToggled = (event, open) => {
|
|
179
|
-
updateFilter?.((currentState) => {
|
|
180
|
-
currentState.state.dropdownState = open;
|
|
181
|
-
return currentState;
|
|
182
|
-
});
|
|
149
|
+
setOpen(false);
|
|
183
150
|
};
|
|
184
151
|
|
|
185
152
|
return (
|
|
186
153
|
<div className={classNames(styles.envsFilterContainer, className)}>
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
function EnvsPlaceholder() {
|
|
204
|
-
return (
|
|
205
|
-
<div className={styles.filterIcon}>
|
|
206
|
-
<img src="https://static.bit.dev/bit-icons/env.svg" />
|
|
207
|
-
<span className={styles.filterIconLabel}>Environments</span>
|
|
208
|
-
<div className={styles.dropdownArrow}>
|
|
209
|
-
<img src="https://static.bit.dev/bit-icons/fat-arrow-down.svg" />
|
|
210
|
-
</div>
|
|
154
|
+
<Dropdown
|
|
155
|
+
open={open}
|
|
156
|
+
onClickOutside={() => setOpen(false)}
|
|
157
|
+
placeholderContent={<EnvsPlaceholder onClick={() => setOpen(!open)} />}
|
|
158
|
+
bottomPlugin={<ButtonsPlugin onClear={onClear} onSubmit={onSubmit} submitClassName={styles.doneButton} />}
|
|
159
|
+
className={classNames(styles.envFilterDropdown)}
|
|
160
|
+
dropClass={classNames(styles.envFilterDropdown)}
|
|
161
|
+
position="bottom"
|
|
162
|
+
>
|
|
163
|
+
{selectList.map((option, index) => (
|
|
164
|
+
<CheckboxItem key={index} checked={option.checked} onInputChanged={(e) => onCheck(option.value, e)}>
|
|
165
|
+
{option.element}
|
|
166
|
+
</CheckboxItem>
|
|
167
|
+
))}
|
|
168
|
+
</Dropdown>
|
|
211
169
|
</div>
|
|
212
170
|
);
|
|
213
171
|
}
|
|
214
|
-
|
|
215
|
-
function EnvsDropdownItem({ displayName, icon, description, componentId, id }: EnvFilterEnvState) {
|
|
216
|
-
return (
|
|
217
|
-
<Tooltip
|
|
218
|
-
placement="right"
|
|
219
|
-
content={
|
|
220
|
-
<Link
|
|
221
|
-
className={styles.envLink}
|
|
222
|
-
href={ComponentUrl.toUrl(componentId, { includeVersion: false })}
|
|
223
|
-
external={true}
|
|
224
|
-
>
|
|
225
|
-
{id}
|
|
226
|
-
</Link>
|
|
227
|
-
}
|
|
228
|
-
>
|
|
229
|
-
<div className={styles.envDropdownItemContainer}>
|
|
230
|
-
<div className={styles.envDropdownItem}>
|
|
231
|
-
<Ellipsis>{displayName}</Ellipsis>
|
|
232
|
-
<div className={styles.envDropdownItemIconContainer}>
|
|
233
|
-
<img className={styles.envDropdownItemIcon} src={icon}></img>
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
<div className={styles.description}>
|
|
237
|
-
<Ellipsis className={styles.descriptionText}>{description}</Ellipsis>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</Tooltip>
|
|
241
|
-
);
|
|
242
|
-
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component.ui.component-filters.env-filter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.262",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/ui/component-filters/env-filter",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "ui/component-filters/env-filter",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.262"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"classnames": "2.2.6",
|
|
13
13
|
"core-js": "^3.0.0",
|
|
14
|
-
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.504",
|
|
15
|
-
"@teambit/component.ui.component-filters.component-filter-context": "0.0.239",
|
|
16
|
-
"@teambit/design.inputs.selectors.multi-select": "0.0.20",
|
|
17
14
|
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
18
15
|
"@teambit/design.ui.tooltip": "0.0.381",
|
|
19
|
-
"@teambit/component.
|
|
16
|
+
"@teambit/component.ui.component-filters.component-filter-context": "0.0.239",
|
|
17
|
+
"@teambit/design.inputs.selectors.checkbox-item": "1.2.0",
|
|
18
|
+
"@teambit/design.inputs.dropdown": "1.3.3",
|
|
19
|
+
"@teambit/component.modules.component-url": "0.0.181"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/classnames": "2.2.11",
|
|
23
22
|
"@types/react": "^17.0.8",
|
|
23
|
+
"@types/classnames": "2.2.11",
|
|
24
24
|
"@types/mocha": "9.1.0",
|
|
25
25
|
"@types/node": "12.20.4",
|
|
26
26
|
"@types/react-dom": "^17.0.5",
|
package/types.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { ComponentID } from '@teambit/component';
|
|
3
|
+
import type { ComponentFilterCriteria } from '@teambit/component.ui.component-filters.component-filter-context';
|
|
4
|
+
|
|
5
|
+
export interface ItemType {
|
|
6
|
+
value: string;
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
description: string;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
element: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type EnvFilterEnvState = {
|
|
14
|
+
active: boolean;
|
|
15
|
+
icon?: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
id: string;
|
|
18
|
+
description: string;
|
|
19
|
+
componentId: ComponentID;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type EnvFilterState = {
|
|
23
|
+
envsState: Map<string, EnvFilterEnvState>;
|
|
24
|
+
dropdownState: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type EnvsFilterCriteria = ComponentFilterCriteria<EnvFilterState>;
|
|
File without changes
|