@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.
Files changed (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +9 -7
  3. package/dist/Collector.d.ts +6 -6
  4. package/dist/Collector.js +185 -261
  5. package/dist/Collector.styles.d.ts +17 -17
  6. package/dist/Collector.styles.js +63 -79
  7. package/dist/Collector.types.d.ts +4 -4
  8. package/dist/Collector.types.js +1 -1
  9. package/dist/Elements/ButtonPanel/ButtonPanel.d.ts +2 -2
  10. package/dist/Elements/ButtonPanel/ButtonPanel.js +21 -33
  11. package/dist/Elements/ButtonPanel/ButtonPanel.styles.d.ts +1 -1
  12. package/dist/Elements/ButtonPanel/ButtonPanel.styles.js +6 -3
  13. package/dist/Elements/ButtonPanel/ButtonPanel.types.d.ts +2 -2
  14. package/dist/Elements/ButtonPanel/ButtonPanel.types.js +1 -1
  15. package/dist/Elements/NavigationHint/NavigationHint.d.ts +2 -2
  16. package/dist/Elements/NavigationHint/NavigationHint.js +15 -11
  17. package/dist/Elements/NavigationHint/NavigationHint.types.d.ts +1 -1
  18. package/dist/Elements/NavigationHint/NavigationHint.types.js +1 -1
  19. package/dist/Elements/OptionsDropdown/OptionsDropdown.d.ts +2 -2
  20. package/dist/Elements/OptionsDropdown/OptionsDropdown.js +59 -73
  21. package/dist/Elements/OptionsDropdown/OptionsDropdown.types.d.ts +3 -3
  22. package/dist/Elements/OptionsDropdown/OptionsDropdown.types.js +1 -1
  23. package/dist/Elements/Values/Values.d.ts +2 -2
  24. package/dist/Elements/Values/Values.js +15 -21
  25. package/dist/Elements/Values/Values.types.d.ts +1 -1
  26. package/dist/Elements/Values/Values.types.js +1 -1
  27. package/dist/hooks/useTranslations.d.ts +1 -1
  28. package/dist/hooks/useTranslations.js +17 -26
  29. package/dist/index.js +4 -1
  30. package/dist/modules.d.js +1 -1
  31. package/dist/modules.d.ts +0 -0
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +27 -29
  34. package/package.json +14 -14
@@ -1,23 +1,23 @@
1
- import { type StyledButton } from '@synerise/ds-button';
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("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 & {
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("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, {
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("styled-components").StyledComponent<"div", any, {
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("styled-components").StyledComponent<"input", any, {
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("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, {
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("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, {
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("styled-components").StyledComponent<"div", any, {}, never>;
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("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>;
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>;
@@ -1,122 +1,106 @@
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 { BorderLessInput, ContentAbove, ContentBelow, Description, ErrorText, IconWrapper, InputWrapper, Label, ValueText } from '@synerise/ds-input/dist/InputMultivalue/InputMultivalue.styles';
5
- import DSScrollbar from '@synerise/ds-scrollbar';
6
- export var Container = styled.div.withConfig({
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
- var gradientOverlayStyles = function gradientOverlayStyles() {
11
- return css(["display:block;pointer-events:none;z-index:2;width:100px;height:32px;transition:opacity 0.3s ease-in-out;"]);
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
- export var Scrollbar = styled(DSScrollbar).withConfig({
16
+ const Scrollbar = /* @__PURE__ */ styled(DSScrollbar).withConfig({
18
17
  displayName: "Collectorstyles__Scrollbar",
19
18
  componentId: "sc-14aly5p-2"
20
19
  })(["width:100%;"]);
21
- export var MainContent = styled.div.withConfig({
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:", ";}"], function (props) {
25
- return props.hasValues ? '0' : '2px 0';
26
- }, function (props) {
27
- return props.fixedHeight ? 'nowrap' : 'wrap';
28
- }, function (props) {
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;}"], function (props) {
45
- return props.gradientOverlap ? "''" : 'none';
46
- }, gradientOverlayStyles(), function (props) {
47
- return "-webkit-linear-gradient( right,\n " + (props.focus ? props.theme.palette['blue-050'] : props.theme.palette.white) + " 0%,\n rgba(255,255,255,0) 100%\n )";
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);", " ", ""], function (props) {
53
- return props.hasValues ? '6px 0 6px 12px' : '4px 0 4px 12px';
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
- export var CollectorValue = styled(Value).withConfig({
42
+ const CollectorValue = /* @__PURE__ */ styled(Value).withConfig({
64
43
  displayName: "Collectorstyles__CollectorValue",
65
44
  componentId: "sc-14aly5p-7"
66
- })(["", ""], function (props) {
67
- return props.hasError && css(["&&{background:", ";color:", ";", "{color:", ";}}"], props.theme.palette['red-600'], props.theme.palette.white, IconWrapper, props.theme.palette.white);
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
- export var CustomContentWrapper = styled.div.withConfig({
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
- export var DropdownContent = styled.div.withConfig({
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;"], function (props) {
87
- return props.theme.palette.white;
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:", ";"], function (props) {
93
- return props.theme.palette['grey-500'];
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
- export var DropdownTop = styled.div.withConfig({
66
+ const DropdownTop = /* @__PURE__ */ styled.div.withConfig({
100
67
  displayName: "Collectorstyles__DropdownTop",
101
68
  componentId: "sc-14aly5p-13"
102
69
  })(["padding-right:8px;"]);
103
- export var DividerContainer = styled.div.withConfig({
70
+ const DividerContainer = /* @__PURE__ */ styled.div.withConfig({
104
71
  displayName: "Collectorstyles__DividerContainer",
105
72
  componentId: "sc-14aly5p-14"
106
73
  })(["padding:8px 12px;"]);
107
- export var NavigationWrapper = styled.div.withConfig({
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;}"], function (props) {
111
- return props.theme.palette['grey-100'];
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 type { ReactNode } from 'react';
2
- import type { ButtonProps } from '@synerise/ds-button';
3
- import type { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
4
- import type { DataAttributes } from '@synerise/ds-utils';
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;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ButtonPanelProps } from './ButtonPanel.types';
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
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import Button from '@synerise/ds-button';
4
- import * as S from './ButtonPanel.styles';
5
- var ButtonPanel = function ButtonPanel(_ref) {
6
- var onConfirm = _ref.onConfirm,
7
- onCancel = _ref.onCancel,
8
- disabled = _ref.disabled,
9
- showCancel = _ref.showCancel,
10
- texts = _ref.texts,
11
- addButtonProps = _ref.addButtonProps,
12
- cancelButtonProps = _ref.cancelButtonProps,
13
- buttonPanelPrefix = _ref.buttonPanelPrefix;
14
- return /*#__PURE__*/React.createElement(React.Fragment, null, buttonPanelPrefix && /*#__PURE__*/React.createElement(S.ButtonPanelPrefix, {
15
- onFocus: function onFocus(event) {
16
- return event.stopPropagation();
17
- }
18
- }, buttonPanelPrefix), showCancel && /*#__PURE__*/React.createElement(Button, _extends({
19
- type: "ghost",
20
- disabled: disabled,
21
- onClick: onCancel,
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("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const ButtonPanelPrefix: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,5 +1,8 @@
1
- import styled from 'styled-components';
2
- export var ButtonPanelPrefix = styled.div.withConfig({
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 type { ReactNode } from 'react';
2
- import type { CollectorProps, CollectorTexts } from '../../Collector.types';
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
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type NavigationHintProps } from './NavigationHint.types';
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 React from 'react';
2
- import Icon, { KeyboardEnterM, KeyboardKeysM } from '@synerise/ds-icon';
3
- import * as S from '../../Collector.styles';
4
- var NavigationHint = function NavigationHint(_ref) {
5
- var texts = _ref.texts;
6
- return /*#__PURE__*/React.createElement(S.NavigationWrapper, null, /*#__PURE__*/React.createElement(Icon, {
7
- component: /*#__PURE__*/React.createElement(KeyboardKeysM, null)
8
- }), /*#__PURE__*/React.createElement("span", null, texts == null ? void 0 : texts.toNavigate), /*#__PURE__*/React.createElement(Icon, {
9
- component: /*#__PURE__*/React.createElement(KeyboardEnterM, null)
10
- }), /*#__PURE__*/React.createElement("span", null, texts == null ? void 0 : texts.toSelect));
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,4 +1,4 @@
1
- import { type CollectorTexts } from '../../Collector.types';
1
+ import { CollectorTexts } from '../../Collector.types';
2
2
  export type NavigationHintProps = {
3
3
  texts: CollectorTexts;
4
4
  };
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type OptionsDropdownProps } from './OptionsDropdown.types';
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
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, useEffect, useState } 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 Scrollbar from '@synerise/ds-scrollbar';
7
- import SearchItems from '@synerise/ds-search/dist/Elements/SearchItems/SearchItems';
8
- import * as S from '../../Collector.styles';
9
- import NavigationHint from '../NavigationHint/NavigationHint';
10
- var getRowHeight = function getRowHeight(size) {
11
- if (size === 'large') {
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
- var OptionsDropdown = function OptionsDropdown(_ref) {
17
- var showAddButton = _ref.showAddButton,
18
- options = _ref.options,
19
- visible = _ref.visible,
20
- value = _ref.value,
21
- onSelect = _ref.onSelect,
22
- onClick = _ref.onClick,
23
- width = _ref.width,
24
- onItemAdd = _ref.onItemAdd,
25
- showNavigationHints = _ref.showNavigationHints,
26
- lookupKey = _ref.lookupKey,
27
- texts = _ref.texts,
28
- customContent = _ref.customContent,
29
- renderItem = _ref.renderItem,
30
- dropdownItemHeight = _ref.dropdownItemHeight,
31
- scrollbarProps = _ref.scrollbarProps,
32
- listHeader = _ref.listHeader;
33
- var _useState = useState(0),
34
- scrollTop = _useState[0],
35
- setScrollTop = _useState[1];
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
- var renderItemFn = useCallback(function (itemValue) {
40
- return renderItem ? renderItem(itemValue) : /*#__PURE__*/React.createElement(ListItem, {
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
- var shouldRenderList = !!(options != null && options.length);
47
- return /*#__PURE__*/React.createElement(S.DropdownWrapper, {
48
- onClick: onClick,
49
- "data-testid": "ds-collector-dropdown"
50
- }, visible && (customContent ? /*#__PURE__*/React.createElement(S.CustomContentWrapper, null, customContent) : /*#__PURE__*/React.createElement(S.DropdownContent, null, listHeader, /*#__PURE__*/React.createElement(Scrollbar, _extends({
51
- absolute: true,
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
- }, scrollbarProps), showAddButton && onItemAdd && !!value && /*#__PURE__*/React.createElement(S.DropdownTop, null, /*#__PURE__*/React.createElement(S.DropdownAddButton, {
57
- onClick: function onClick() {
58
- onItemAdd && onItemAdd(value);
59
- },
60
- type: "ghost",
61
- mode: "icon-label"
62
- }, /*#__PURE__*/React.createElement(Icon, {
63
- component: /*#__PURE__*/React.createElement(Add3M, null)
64
- }), /*#__PURE__*/React.createElement("span", null, texts == null ? void 0 : texts.add), /*#__PURE__*/React.createElement("strong", null, value)), shouldRenderList && /*#__PURE__*/React.createElement(S.DividerContainer, null, /*#__PURE__*/React.createElement(Divider, {
65
- dashed: true
66
- }))), shouldRenderList && /*#__PURE__*/React.createElement(SearchItems, {
67
- data: options,
68
- highlight: value,
69
- visibleRows: 6,
70
- onItemClick: onSelect,
71
- itemRender: renderItemFn,
72
- rowHeight: getRowHeight(dropdownItemHeight),
73
- width: width,
74
- listProps: {
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 type React from 'react';
2
- import { type ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
3
- import { type CollectorTexts, type CollectorValue } from '../../Collector.types';
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
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ValuesProps } from './Values.types';
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;