@synerise/ds-collector 1.4.25 → 1.4.27
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/CHANGELOG.md +8 -0
- package/README.md +9 -7
- package/dist/Collector.d.ts +6 -6
- package/dist/Collector.js +185 -261
- package/dist/Collector.styles.d.ts +17 -17
- package/dist/Collector.styles.js +63 -79
- package/dist/Collector.types.d.ts +4 -4
- package/dist/Collector.types.js +1 -1
- package/dist/Elements/ButtonPanel/ButtonPanel.d.ts +2 -2
- package/dist/Elements/ButtonPanel/ButtonPanel.js +21 -33
- package/dist/Elements/ButtonPanel/ButtonPanel.styles.d.ts +1 -1
- package/dist/Elements/ButtonPanel/ButtonPanel.styles.js +6 -3
- package/dist/Elements/ButtonPanel/ButtonPanel.types.d.ts +2 -2
- package/dist/Elements/ButtonPanel/ButtonPanel.types.js +1 -1
- package/dist/Elements/NavigationHint/NavigationHint.d.ts +2 -2
- package/dist/Elements/NavigationHint/NavigationHint.js +15 -11
- package/dist/Elements/NavigationHint/NavigationHint.types.d.ts +1 -1
- package/dist/Elements/NavigationHint/NavigationHint.types.js +1 -1
- package/dist/Elements/OptionsDropdown/OptionsDropdown.d.ts +2 -2
- package/dist/Elements/OptionsDropdown/OptionsDropdown.js +59 -73
- package/dist/Elements/OptionsDropdown/OptionsDropdown.types.d.ts +3 -3
- package/dist/Elements/OptionsDropdown/OptionsDropdown.types.js +1 -1
- package/dist/Elements/Values/Values.d.ts +2 -2
- package/dist/Elements/Values/Values.js +15 -21
- package/dist/Elements/Values/Values.types.d.ts +1 -1
- package/dist/Elements/Values/Values.types.js +1 -1
- package/dist/hooks/useTranslations.d.ts +1 -1
- package/dist/hooks/useTranslations.js +17 -26
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +27 -29
- package/package.json +14 -14
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StyledButton } from '@synerise/ds-button';
|
|
2
2
|
import { ContentAbove, ContentBelow, Description, ErrorText, Label, ValueText } from '@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles';
|
|
3
|
-
export declare const Container: import(
|
|
4
|
-
export declare const CollectorInput: import(
|
|
3
|
+
export declare const Container: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const CollectorInput: import('styled-components').StyledComponent<"div", any, import('@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles').InputWrapperProps & {
|
|
5
5
|
error?: boolean;
|
|
6
6
|
focus?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}, never>;
|
|
9
|
-
export declare const Scrollbar: import(
|
|
10
|
-
export declare const MainContent: import(
|
|
9
|
+
export declare const Scrollbar: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<(import('@synerise/ds-scrollbar').ScrollbarProps | import('@synerise/ds-scrollbar').VirtualScrollbarProps) & import('react').RefAttributes<HTMLElement>>, any, {}, never>;
|
|
10
|
+
export declare const MainContent: import('styled-components').StyledComponent<"div", any, {
|
|
11
11
|
fixedHeight?: boolean;
|
|
12
12
|
hasValues?: boolean;
|
|
13
13
|
gradientOverlap?: boolean;
|
|
14
14
|
focus?: boolean;
|
|
15
15
|
}, never>;
|
|
16
|
-
export declare const RightSide: import(
|
|
16
|
+
export declare const RightSide: import('styled-components').StyledComponent<"div", any, {
|
|
17
17
|
gradientOverlap?: boolean;
|
|
18
18
|
focus?: boolean;
|
|
19
19
|
}, never>;
|
|
20
|
-
export declare const Input: import(
|
|
20
|
+
export declare const Input: import('styled-components').StyledComponent<"input", any, {
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
} & {
|
|
23
23
|
disabled?: boolean;
|
|
@@ -25,8 +25,8 @@ export declare const Input: import("styled-components").StyledComponent<"input",
|
|
|
25
25
|
transparent: boolean;
|
|
26
26
|
hidden: boolean;
|
|
27
27
|
}, never>;
|
|
28
|
-
export declare const SearchWrapper: import(
|
|
29
|
-
export declare const CollectorValue: import(
|
|
28
|
+
export declare const SearchWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
29
|
+
export declare const CollectorValue: import('styled-components').StyledComponent<({ disabled, key, onRemoveClick, value, focused, className, ...rest }: import('@synerise/ds-input/dist/InputMultivalue/Elements/Value.types').ValueProps) => React.JSX.Element, any, {
|
|
30
30
|
hasError?: boolean;
|
|
31
31
|
}, never>;
|
|
32
32
|
export { ContentAbove };
|
|
@@ -35,14 +35,14 @@ export { ContentBelow };
|
|
|
35
35
|
export { Description };
|
|
36
36
|
export { ErrorText };
|
|
37
37
|
export { ValueText };
|
|
38
|
-
export declare const DropdownWrapper: import(
|
|
39
|
-
export declare const CustomContentWrapper: import(
|
|
40
|
-
export declare const DropdownContent: import(
|
|
38
|
+
export declare const DropdownWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
39
|
+
export declare const CustomContentWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
40
|
+
export declare const DropdownContent: import('styled-components').StyledComponent<"div", any, {
|
|
41
41
|
visible?: boolean;
|
|
42
42
|
}, never>;
|
|
43
|
-
export declare const Placeholder: import(
|
|
43
|
+
export declare const Placeholder: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
44
44
|
export declare const DropdownAddButton: StyledButton;
|
|
45
|
-
export declare const DropdownTop: import(
|
|
46
|
-
export declare const DividerContainer: import(
|
|
47
|
-
export declare const NavigationWrapper: import(
|
|
48
|
-
export declare const Counter: import(
|
|
45
|
+
export declare const DropdownTop: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
46
|
+
export declare const DividerContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
47
|
+
export declare const NavigationWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
48
|
+
export declare const Counter: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/Collector.styles.js
CHANGED
|
@@ -1,122 +1,106 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import Button from
|
|
3
|
-
import Value from
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import Value from "@synerise/ds-input/dist/InputMultivalue/Elements/Value";
|
|
4
|
+
import { InputWrapper, IconWrapper, BorderLessInput } from "@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles";
|
|
5
|
+
import { ContentAbove, ContentBelow, Description, ErrorText, Label, ValueText } from "@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles";
|
|
6
|
+
import DSScrollbar from "@synerise/ds-scrollbar";
|
|
7
|
+
const Container = /* @__PURE__ */ styled.div.withConfig({
|
|
7
8
|
displayName: "Collectorstyles__Container",
|
|
8
9
|
componentId: "sc-14aly5p-0"
|
|
9
10
|
})([""]);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export var CollectorInput = styled(InputWrapper).withConfig({
|
|
11
|
+
const gradientOverlayStyles = () => css(["display:block;pointer-events:none;z-index:2;width:100px;height:32px;transition:opacity 0.3s ease-in-out;"]);
|
|
12
|
+
const CollectorInput = /* @__PURE__ */ styled(InputWrapper).withConfig({
|
|
14
13
|
displayName: "Collectorstyles__CollectorInput",
|
|
15
14
|
componentId: "sc-14aly5p-1"
|
|
16
15
|
})(["width:100%;min-height:48px;padding:8px 4px;border-radius:5px;flex-wrap:nowrap;justify-content:space-between;"]);
|
|
17
|
-
|
|
16
|
+
const Scrollbar = /* @__PURE__ */ styled(DSScrollbar).withConfig({
|
|
18
17
|
displayName: "Collectorstyles__Scrollbar",
|
|
19
18
|
componentId: "sc-14aly5p-2"
|
|
20
19
|
})(["width:100%;"]);
|
|
21
|
-
|
|
20
|
+
const MainContent = /* @__PURE__ */ styled.div.withConfig({
|
|
22
21
|
displayName: "Collectorstyles__MainContent",
|
|
23
22
|
componentId: "sc-14aly5p-3"
|
|
24
|
-
})(["display:flex;position:relative;padding:", ";flex:1;align-items:flex-start;flex-wrap:", ";overflow-x:", ";overflow-y:", ";padding-right:", ";::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;.ds-input-value-wrapper{min-width:fit-content;margin:4px 0 4px 8px;right:0;background:", ";}&::before{content:'';opacity:", ";position:fixed;", " background-image:", ";}"],
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return props.fixedHeight ? 'scroll' : 'hidden';
|
|
30
|
-
}, function (props) {
|
|
31
|
-
return props.fixedHeight ? 'hidden' : 'scroll';
|
|
32
|
-
}, function (props) {
|
|
33
|
-
return props.fixedHeight ? '4px' : '12px';
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return props.theme.palette['grey-200'];
|
|
36
|
-
}, function (props) {
|
|
37
|
-
return props.gradientOverlap ? "1" : '0';
|
|
38
|
-
}, gradientOverlayStyles(), function (props) {
|
|
39
|
-
return "-webkit-linear-gradient( left,\n " + (props.focus ? props.theme.palette['blue-050'] : props.theme.palette.white) + " 0%,\n rgba(255,255,255,0) 100%\n )";
|
|
40
|
-
});
|
|
41
|
-
export var RightSide = styled.div.withConfig({
|
|
23
|
+
})(["display:flex;position:relative;padding:", ";flex:1;align-items:flex-start;flex-wrap:", ";overflow-x:", ";overflow-y:", ";padding-right:", ";::-webkit-scrollbar{display:none;}-ms-overflow-style:none;scrollbar-width:none;.ds-input-value-wrapper{min-width:fit-content;margin:4px 0 4px 8px;right:0;background:", ";}&::before{content:'';opacity:", ";position:fixed;", " background-image:", ";}"], (props) => props.hasValues ? "0" : "2px 0", (props) => props.fixedHeight ? "nowrap" : "wrap", (props) => props.fixedHeight ? "scroll" : "hidden", (props) => props.fixedHeight ? "hidden" : "scroll", (props) => props.fixedHeight ? "4px" : "12px", (props) => props.theme.palette["grey-200"], (props) => props.gradientOverlap ? `1` : "0", gradientOverlayStyles(), (props) => `-webkit-linear-gradient( left,
|
|
24
|
+
${props.focus ? props.theme.palette["blue-050"] : props.theme.palette.white} 0%,
|
|
25
|
+
rgba(255,255,255,0) 100%
|
|
26
|
+
)`);
|
|
27
|
+
const RightSide = /* @__PURE__ */ styled.div.withConfig({
|
|
42
28
|
displayName: "Collectorstyles__RightSide",
|
|
43
29
|
componentId: "sc-14aly5p-4"
|
|
44
|
-
})(["display:flex;margin:0 4px;gap:8px;position:relative;&::before{content:", ";", " background-image:", ";position:absolute;left:-102px;}"],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export var Input = styled(BorderLessInput).withConfig({
|
|
30
|
+
})(["display:flex;margin:0 4px;gap:8px;position:relative;&::before{content:", ";", " background-image:", ";position:absolute;left:-102px;}"], (props) => props.gradientOverlap ? `''` : "none", gradientOverlayStyles(), (props) => `-webkit-linear-gradient( right,
|
|
31
|
+
${props.focus ? props.theme.palette["blue-050"] : props.theme.palette.white} 0%,
|
|
32
|
+
rgba(255,255,255,0) 100%
|
|
33
|
+
)`);
|
|
34
|
+
const Input = /* @__PURE__ */ styled(BorderLessInput).withConfig({
|
|
50
35
|
displayName: "Collectorstyles__Input",
|
|
51
36
|
componentId: "sc-14aly5p-5"
|
|
52
|
-
})(["margin:", ";padding:1px 0;min-width:unset;line-height:18px;width:calc(100% - 12px);", " ", ""],
|
|
53
|
-
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.hidden && css(["display:none;"]);
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return props.transparent && css(["color:transparent;"]);
|
|
58
|
-
});
|
|
59
|
-
export var SearchWrapper = styled.div.withConfig({
|
|
37
|
+
})(["margin:", ";padding:1px 0;min-width:unset;line-height:18px;width:calc(100% - 12px);", " ", ""], (props) => props.hasValues ? "6px 0 6px 12px" : "4px 0 4px 12px", (props) => props.hidden && css(["display:none;"]), (props) => props.transparent && css(["color:transparent;"]));
|
|
38
|
+
const SearchWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
60
39
|
displayName: "Collectorstyles__SearchWrapper",
|
|
61
40
|
componentId: "sc-14aly5p-6"
|
|
62
41
|
})(["flex:1 0 auto;position:relative;"]);
|
|
63
|
-
|
|
42
|
+
const CollectorValue = /* @__PURE__ */ styled(Value).withConfig({
|
|
64
43
|
displayName: "Collectorstyles__CollectorValue",
|
|
65
44
|
componentId: "sc-14aly5p-7"
|
|
66
|
-
})(["", ""],
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
export { ContentAbove };
|
|
70
|
-
export { Label };
|
|
71
|
-
export { ContentBelow };
|
|
72
|
-
export { Description };
|
|
73
|
-
export { ErrorText };
|
|
74
|
-
export { ValueText };
|
|
75
|
-
export var DropdownWrapper = styled.div.withConfig({
|
|
45
|
+
})(["", ""], (props) => props.hasError && css(["&&{background:", ";color:", ";", "{color:", ";}}"], props.theme.palette["red-600"], props.theme.palette.white, IconWrapper, props.theme.palette.white));
|
|
46
|
+
const DropdownWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
76
47
|
displayName: "Collectorstyles__DropdownWrapper",
|
|
77
48
|
componentId: "sc-14aly5p-8"
|
|
78
49
|
})(["position:relative;user-select:none;"]);
|
|
79
|
-
|
|
50
|
+
const CustomContentWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
80
51
|
displayName: "Collectorstyles__CustomContentWrapper",
|
|
81
52
|
componentId: "sc-14aly5p-9"
|
|
82
53
|
})(["position:absolute;z-index:99;"]);
|
|
83
|
-
|
|
54
|
+
const DropdownContent = /* @__PURE__ */ styled.div.withConfig({
|
|
84
55
|
displayName: "Collectorstyles__DropdownContent",
|
|
85
56
|
componentId: "sc-14aly5p-10"
|
|
86
|
-
})(["background:", ";border-radius:3px;padding:8px 0 8px 8px;position:absolute;width:100%;top:4px;left:0;box-shadow:0 16px 32px 0 rgba(35,41,54,0.12);z-index:99;"],
|
|
87
|
-
|
|
88
|
-
});
|
|
89
|
-
export var Placeholder = styled.div.withConfig({
|
|
57
|
+
})(["background:", ";border-radius:3px;padding:8px 0 8px 8px;position:absolute;width:100%;top:4px;left:0;box-shadow:0 16px 32px 0 rgba(35,41,54,0.12);z-index:99;"], (props) => props.theme.palette.white);
|
|
58
|
+
const Placeholder = /* @__PURE__ */ styled.div.withConfig({
|
|
90
59
|
displayName: "Collectorstyles__Placeholder",
|
|
91
60
|
componentId: "sc-14aly5p-11"
|
|
92
|
-
})(["position:absolute;ppointer-events:none;top:0;bottom:0;left:12px;right:0;display:flex;align-items:center;gap:4px;color:", ";"],
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
export var DropdownAddButton = styled(Button).withConfig({
|
|
61
|
+
})(["position:absolute;ppointer-events:none;top:0;bottom:0;left:12px;right:0;display:flex;align-items:center;gap:4px;color:", ";"], (props) => props.theme.palette["grey-500"]);
|
|
62
|
+
const DropdownAddButton = /* @__PURE__ */ styled(Button).withConfig({
|
|
96
63
|
displayName: "Collectorstyles__DropdownAddButton",
|
|
97
64
|
componentId: "sc-14aly5p-12"
|
|
98
65
|
})(["white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis;&&{display:flex;justify-content:flex-start;align-items:center;font-weight:400;text-align:left;}.ds-icon{margin-left:16px;margin-right:8px;}strong{font-weight:500;margin:0 0 0 3px;display:block;overflow:hidden;text-overflow:ellipsis;}"]);
|
|
99
|
-
|
|
66
|
+
const DropdownTop = /* @__PURE__ */ styled.div.withConfig({
|
|
100
67
|
displayName: "Collectorstyles__DropdownTop",
|
|
101
68
|
componentId: "sc-14aly5p-13"
|
|
102
69
|
})(["padding-right:8px;"]);
|
|
103
|
-
|
|
70
|
+
const DividerContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
104
71
|
displayName: "Collectorstyles__DividerContainer",
|
|
105
72
|
componentId: "sc-14aly5p-14"
|
|
106
73
|
})(["padding:8px 12px;"]);
|
|
107
|
-
|
|
74
|
+
const NavigationWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
108
75
|
displayName: "Collectorstyles__NavigationWrapper",
|
|
109
76
|
componentId: "sc-14aly5p-15"
|
|
110
|
-
})(["margin-top:8px;border-top:1px solid ", ";background:", ";padding:12px 16px;margin-left:-8px;margin-bottom:-8px;color:", ";display:flex;align-items:center;.ds-icon > svg{fill:", ";}span{margin-left:2px;margin-right:8px;font-weight:500;}"],
|
|
111
|
-
|
|
112
|
-
}, function (props) {
|
|
113
|
-
return props.theme.palette['grey-050'];
|
|
114
|
-
}, function (props) {
|
|
115
|
-
return props.theme.palette['grey-400'];
|
|
116
|
-
}, function (props) {
|
|
117
|
-
return props.theme.palette['grey-400'];
|
|
118
|
-
});
|
|
119
|
-
export var Counter = styled.div.withConfig({
|
|
77
|
+
})(["margin-top:8px;border-top:1px solid ", ";background:", ";padding:12px 16px;margin-left:-8px;margin-bottom:-8px;color:", ";display:flex;align-items:center;.ds-icon > svg{fill:", ";}span{margin-left:2px;margin-right:8px;font-weight:500;}"], (props) => props.theme.palette["grey-100"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-400"]);
|
|
78
|
+
const Counter = /* @__PURE__ */ styled.div.withConfig({
|
|
120
79
|
displayName: "Collectorstyles__Counter",
|
|
121
80
|
componentId: "sc-14aly5p-16"
|
|
122
|
-
})(["display:flex;height:26px;align-items:center;column-gap:4px;"]);
|
|
81
|
+
})(["display:flex;height:26px;align-items:center;column-gap:4px;"]);
|
|
82
|
+
export {
|
|
83
|
+
CollectorInput,
|
|
84
|
+
CollectorValue,
|
|
85
|
+
Container,
|
|
86
|
+
ContentAbove,
|
|
87
|
+
ContentBelow,
|
|
88
|
+
Counter,
|
|
89
|
+
CustomContentWrapper,
|
|
90
|
+
Description,
|
|
91
|
+
DividerContainer,
|
|
92
|
+
DropdownAddButton,
|
|
93
|
+
DropdownContent,
|
|
94
|
+
DropdownTop,
|
|
95
|
+
DropdownWrapper,
|
|
96
|
+
ErrorText,
|
|
97
|
+
Input,
|
|
98
|
+
Label,
|
|
99
|
+
MainContent,
|
|
100
|
+
NavigationWrapper,
|
|
101
|
+
Placeholder,
|
|
102
|
+
RightSide,
|
|
103
|
+
Scrollbar,
|
|
104
|
+
SearchWrapper,
|
|
105
|
+
ValueText
|
|
106
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '@synerise/ds-button';
|
|
3
|
+
import { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
4
|
+
import { DataAttributes } from '@synerise/ds-utils';
|
|
5
5
|
export type CollectorProps = {
|
|
6
6
|
addButtonProps?: Partial<ButtonProps & DataAttributes>;
|
|
7
7
|
buttonPanelPrefix?: ReactNode;
|
package/dist/Collector.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonPanelProps } from './ButtonPanel.types';
|
|
3
3
|
declare const ButtonPanel: ({ onConfirm, onCancel, disabled, showCancel, texts, addButtonProps, cancelButtonProps, buttonPanelPrefix, }: ButtonPanelProps) => React.JSX.Element;
|
|
4
4
|
export default ButtonPanel;
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
onFocus:
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onFocus: function onFocus(e) {
|
|
23
|
-
return e.stopPropagation();
|
|
24
|
-
}
|
|
25
|
-
}, cancelButtonProps), texts == null ? void 0 : texts.cancel), /*#__PURE__*/React.createElement(Button, _extends({
|
|
26
|
-
type: "primary",
|
|
27
|
-
disabled: disabled,
|
|
28
|
-
onClick: onConfirm,
|
|
29
|
-
onFocus: function onFocus(e) {
|
|
30
|
-
return e.stopPropagation();
|
|
31
|
-
}
|
|
32
|
-
}, addButtonProps), texts == null ? void 0 : texts.add));
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import { ButtonPanelPrefix } from "./ButtonPanel.styles.js";
|
|
4
|
+
const ButtonPanel = ({
|
|
5
|
+
onConfirm,
|
|
6
|
+
onCancel,
|
|
7
|
+
disabled,
|
|
8
|
+
showCancel,
|
|
9
|
+
texts,
|
|
10
|
+
addButtonProps,
|
|
11
|
+
cancelButtonProps,
|
|
12
|
+
buttonPanelPrefix
|
|
13
|
+
}) => {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
buttonPanelPrefix && /* @__PURE__ */ jsx(ButtonPanelPrefix, { onFocus: (event) => event.stopPropagation(), children: buttonPanelPrefix }),
|
|
16
|
+
showCancel && /* @__PURE__ */ jsx(Button, { type: "ghost", disabled, onClick: onCancel, onFocus: (e) => e.stopPropagation(), ...cancelButtonProps, children: texts?.cancel }),
|
|
17
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", disabled, onClick: onConfirm, onFocus: (e) => e.stopPropagation(), ...addButtonProps, children: texts?.add })
|
|
18
|
+
] });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
ButtonPanel as default
|
|
33
22
|
};
|
|
34
|
-
export default ButtonPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ButtonPanelPrefix: import(
|
|
1
|
+
export declare const ButtonPanelPrefix: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const ButtonPanelPrefix = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "ButtonPanelstyles__ButtonPanelPrefix",
|
|
4
4
|
componentId: "sc-myq72p-0"
|
|
5
|
-
})([""]);
|
|
5
|
+
})([""]);
|
|
6
|
+
export {
|
|
7
|
+
ButtonPanelPrefix
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CollectorProps, CollectorTexts } from '../../Collector.types';
|
|
3
3
|
export type ButtonPanelProps = {
|
|
4
4
|
onCancel: () => void;
|
|
5
5
|
onConfirm: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NavigationHintProps } from './NavigationHint.types';
|
|
3
3
|
declare const NavigationHint: React.FC<NavigationHintProps>;
|
|
4
4
|
export default NavigationHint;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Icon, {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon, { KeyboardKeysM, KeyboardEnterM } from "@synerise/ds-icon";
|
|
3
|
+
import { NavigationWrapper } from "../../Collector.styles.js";
|
|
4
|
+
const NavigationHint = ({
|
|
5
|
+
texts
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsxs(NavigationWrapper, { children: [
|
|
8
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(KeyboardKeysM, {}) }),
|
|
9
|
+
/* @__PURE__ */ jsx("span", { children: texts?.toNavigate }),
|
|
10
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(KeyboardEnterM, {}) }),
|
|
11
|
+
/* @__PURE__ */ jsx("span", { children: texts?.toSelect })
|
|
12
|
+
] });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
NavigationHint as default
|
|
11
16
|
};
|
|
12
|
-
export default NavigationHint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OptionsDropdownProps } from './OptionsDropdown.types';
|
|
3
3
|
declare const OptionsDropdown: ({ showAddButton, options, visible, value, onSelect, onClick, width, onItemAdd, showNavigationHints, lookupKey, texts, customContent, renderItem, dropdownItemHeight, scrollbarProps, listHeader, }: OptionsDropdownProps) => React.JSX.Element;
|
|
4
4
|
export default OptionsDropdown;
|
|
@@ -1,82 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import Divider from
|
|
4
|
-
import Icon, { Add3M } from
|
|
5
|
-
import ListItem from
|
|
6
|
-
import
|
|
7
|
-
import SearchItems from
|
|
8
|
-
import
|
|
9
|
-
import NavigationHint from
|
|
10
|
-
|
|
11
|
-
if (size ===
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from "react";
|
|
3
|
+
import Divider from "@synerise/ds-divider";
|
|
4
|
+
import Icon, { Add3M } from "@synerise/ds-icon";
|
|
5
|
+
import ListItem from "@synerise/ds-list-item";
|
|
6
|
+
import DSScrollbar from "@synerise/ds-scrollbar";
|
|
7
|
+
import SearchItems from "@synerise/ds-search/dist/Elements/SearchItems/SearchItems";
|
|
8
|
+
import { DropdownWrapper, CustomContentWrapper, DropdownContent, DropdownTop, DropdownAddButton, DividerContainer } from "../../Collector.styles.js";
|
|
9
|
+
import NavigationHint from "../NavigationHint/NavigationHint.js";
|
|
10
|
+
const getRowHeight = (size) => {
|
|
11
|
+
if (size === "large") {
|
|
12
12
|
return 54;
|
|
13
13
|
}
|
|
14
14
|
return 32;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
useEffect(function () {
|
|
16
|
+
const OptionsDropdown = ({
|
|
17
|
+
showAddButton,
|
|
18
|
+
options,
|
|
19
|
+
visible,
|
|
20
|
+
value,
|
|
21
|
+
onSelect,
|
|
22
|
+
onClick,
|
|
23
|
+
width,
|
|
24
|
+
onItemAdd,
|
|
25
|
+
showNavigationHints,
|
|
26
|
+
lookupKey,
|
|
27
|
+
texts,
|
|
28
|
+
customContent,
|
|
29
|
+
renderItem,
|
|
30
|
+
dropdownItemHeight,
|
|
31
|
+
scrollbarProps,
|
|
32
|
+
listHeader
|
|
33
|
+
}) => {
|
|
34
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
35
|
+
useEffect(() => {
|
|
37
36
|
setScrollTop(0);
|
|
38
37
|
}, [visible]);
|
|
39
|
-
|
|
40
|
-
return renderItem ? renderItem(itemValue) :
|
|
41
|
-
tabIndex: -1,
|
|
42
|
-
size: dropdownItemHeight,
|
|
43
|
-
key: "" + itemValue
|
|
44
|
-
}, itemValue[lookupKey]);
|
|
38
|
+
const renderItemFn = useCallback((itemValue) => {
|
|
39
|
+
return renderItem ? renderItem(itemValue) : /* @__PURE__ */ jsx(ListItem, { tabIndex: -1, size: dropdownItemHeight, children: itemValue[lookupKey] }, `${itemValue}`);
|
|
45
40
|
}, [lookupKey, renderItem, dropdownItemHeight]);
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
onScroll: function onScroll(_ref2) {
|
|
53
|
-
var currentTarget = _ref2.currentTarget;
|
|
41
|
+
const shouldRenderList = !!options?.length;
|
|
42
|
+
return /* @__PURE__ */ jsx(DropdownWrapper, { onClick, "data-testid": "ds-collector-dropdown", children: visible && (customContent ? /* @__PURE__ */ jsx(CustomContentWrapper, { children: customContent }) : /* @__PURE__ */ jsxs(DropdownContent, { children: [
|
|
43
|
+
listHeader,
|
|
44
|
+
/* @__PURE__ */ jsxs(DSScrollbar, { absolute: true, onScroll: ({
|
|
45
|
+
currentTarget
|
|
46
|
+
}) => {
|
|
54
47
|
setScrollTop(currentTarget.scrollTop);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
scrollTop: scrollTop
|
|
76
|
-
},
|
|
77
|
-
renderInMenu: false
|
|
78
|
-
})), showNavigationHints && /*#__PURE__*/React.createElement(NavigationHint, {
|
|
79
|
-
texts: texts
|
|
80
|
-
}))));
|
|
48
|
+
}, ...scrollbarProps, children: [
|
|
49
|
+
showAddButton && onItemAdd && !!value && /* @__PURE__ */ jsxs(DropdownTop, { children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(DropdownAddButton, { onClick: () => {
|
|
51
|
+
onItemAdd && onItemAdd(value);
|
|
52
|
+
}, type: "ghost", mode: "icon-label", children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}) }),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { children: texts?.add }),
|
|
55
|
+
/* @__PURE__ */ jsx("strong", { children: value })
|
|
56
|
+
] }),
|
|
57
|
+
shouldRenderList && /* @__PURE__ */ jsx(DividerContainer, { children: /* @__PURE__ */ jsx(Divider, { dashed: true }) })
|
|
58
|
+
] }),
|
|
59
|
+
shouldRenderList && /* @__PURE__ */ jsx(SearchItems, { data: options, highlight: value, visibleRows: 6, onItemClick: onSelect, itemRender: renderItemFn, rowHeight: getRowHeight(dropdownItemHeight), width, listProps: {
|
|
60
|
+
scrollTop
|
|
61
|
+
}, renderInMenu: false })
|
|
62
|
+
] }),
|
|
63
|
+
showNavigationHints && /* @__PURE__ */ jsx(NavigationHint, { texts })
|
|
64
|
+
] })) });
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
OptionsDropdown as default
|
|
81
68
|
};
|
|
82
|
-
export default OptionsDropdown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
3
|
+
import { CollectorTexts, CollectorValue } from '../../Collector.types';
|
|
4
4
|
export type OptionsDropdownProps = {
|
|
5
5
|
showAddButton?: boolean;
|
|
6
6
|
options: CollectorValue[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ValuesProps } from './Values.types';
|
|
3
3
|
declare const Values: ({ values, onDeselect, disabled, focused, displayLookupKey, }: ValuesProps) => React.JSX.Element;
|
|
4
4
|
export default Values;
|