@synerise/ds-item-picker 1.17.0 → 1.17.2
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/dist/ItemPicker.d.ts +5 -5
- package/dist/ItemPicker.js +13 -17
- package/dist/ItemPicker.styles.d.ts +1 -1
- package/dist/ItemPicker.styles.js +6 -3
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.d.ts +2 -2
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.js +58 -99
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.style.d.ts +7 -7
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.style.js +22 -19
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.types.d.ts +4 -4
- package/dist/components/ItemPickerDropdown/ItemPickerDropdown.types.js +1 -1
- package/dist/components/ItemPickerLegacy/ItemPickerLegacy.d.ts +2 -2
- package/dist/components/ItemPickerLegacy/ItemPickerLegacy.js +89 -152
- package/dist/components/ItemPickerLegacy/ItemPickerLegacy.types.d.ts +8 -8
- package/dist/components/ItemPickerLegacy/ItemPickerLegacy.types.js +1 -1
- package/dist/components/ItemPickerList/ItemPickerList.d.ts +4 -4
- package/dist/components/ItemPickerList/ItemPickerList.js +199 -267
- package/dist/components/ItemPickerList/ItemPickerList.styles.d.ts +18 -18
- package/dist/components/ItemPickerList/ItemPickerList.styles.js +55 -64
- package/dist/components/ItemPickerList/ItemPickerList.types.d.ts +3 -3
- package/dist/components/ItemPickerList/ItemPickerList.types.js +1 -1
- package/dist/components/ItemPickerList/components/EmptyListMessage.d.ts +3 -3
- package/dist/components/ItemPickerList/components/EmptyListMessage.js +27 -40
- package/dist/components/ItemPickerList/components/ErrorItem.d.ts +1 -1
- package/dist/components/ItemPickerList/components/ErrorItem.js +10 -9
- package/dist/components/ItemPickerList/components/ErrorMessage.d.ts +2 -2
- package/dist/components/ItemPickerList/components/ErrorMessage.js +12 -15
- package/dist/components/ItemPickerList/components/InfiniteLoaderItem.d.ts +2 -2
- package/dist/components/ItemPickerList/components/InfiniteLoaderItem.js +19 -17
- package/dist/components/ItemPickerList/components/ItemPickerListFooter.d.ts +3 -3
- package/dist/components/ItemPickerList/components/ItemPickerListFooter.js +21 -20
- package/dist/components/ItemPickerList/components/ItemPickerListRow.d.ts +4 -4
- package/dist/components/ItemPickerList/components/ItemPickerListRow.js +42 -43
- package/dist/components/ItemPickerList/components/ItemPickerListSkeleton.d.ts +1 -1
- package/dist/components/ItemPickerList/components/ItemPickerListSkeleton.js +16 -23
- package/dist/components/ItemPickerList/components/ListSearchInput.d.ts +4 -4
- package/dist/components/ItemPickerList/components/ListSearchInput.js +36 -51
- package/dist/components/ItemPickerList/components/LoadingItem.d.ts +1 -1
- package/dist/components/ItemPickerList/components/LoadingItem.js +10 -9
- package/dist/components/ItemPickerList/components/NoMoreItem.d.ts +1 -1
- package/dist/components/ItemPickerList/components/NoMoreItem.js +10 -9
- package/dist/components/ItemPickerList/components/index.js +14 -6
- package/dist/components/ItemPickerList/constants.d.ts +2 -2
- package/dist/components/ItemPickerList/constants.js +47 -26
- package/dist/components/ItemPickerList/hooks/index.js +8 -3
- package/dist/components/ItemPickerList/hooks/useFlattenFolders.d.ts +2 -2
- package/dist/components/ItemPickerList/hooks/useFlattenFolders.js +40 -61
- package/dist/components/ItemPickerList/hooks/useItemsInSections.d.ts +7 -7
- package/dist/components/ItemPickerList/hooks/useItemsInSections.js +342 -443
- package/dist/components/ItemPickerList/hooks/useItemsInSections.utils.d.ts +5 -5
- package/dist/components/ItemPickerList/hooks/useItemsInSections.utils.js +77 -74
- package/dist/components/ItemPickerList/hooks/useListHeight.d.ts +2 -2
- package/dist/components/ItemPickerList/hooks/useListHeight.js +37 -41
- package/dist/components/ItemPickerList/types/renderMode.js +8 -5
- package/dist/components/ItemPickerList/utils/actionItemsUtils.d.ts +4 -4
- package/dist/components/ItemPickerList/utils/actionItemsUtils.js +92 -92
- package/dist/components/ItemPickerList/utils/createTitleFromTitlePath.d.ts +2 -2
- package/dist/components/ItemPickerList/utils/createTitleFromTitlePath.js +7 -4
- package/dist/components/ItemPickerList/utils/findSectionById.d.ts +1 -1
- package/dist/components/ItemPickerList/utils/findSectionById.js +10 -12
- package/dist/components/ItemPickerList/utils/getContextAwareActions.d.ts +1 -1
- package/dist/components/ItemPickerList/utils/getContextAwareActions.js +19 -15
- package/dist/components/ItemPickerList/utils/getSearchByActionItems.d.ts +2 -2
- package/dist/components/ItemPickerList/utils/getSearchByActionItems.js +28 -29
- package/dist/components/ItemPickerList/utils/index.js +16 -4
- package/dist/components/ItemPickerList/utils/isNavKey.d.ts +1 -1
- package/dist/components/ItemPickerList/utils/isNavKey.js +6 -3
- package/dist/components/ItemPickerList/utils/resolveSectionId.d.ts +2 -2
- package/dist/components/ItemPickerList/utils/resolveSectionId.js +15 -9
- package/dist/components/ItemPickerList/utils/typeguards.utils.d.ts +5 -5
- package/dist/components/ItemPickerList/utils/typeguards.utils.js +23 -14
- package/dist/components/ItemPickerNew/ItemPickerNew.d.ts +4 -4
- package/dist/components/ItemPickerNew/ItemPickerNew.js +55 -100
- package/dist/components/ItemPickerNew/ItemPickerNew.types.d.ts +13 -13
- package/dist/components/ItemPickerNew/ItemPickerNew.types.js +1 -1
- package/dist/components/ItemPickerNew/types/actions.types.d.ts +2 -2
- package/dist/components/ItemPickerNew/types/actions.types.js +10 -6
- package/dist/components/ItemPickerNew/types/baseItemSectionType.types.d.ts +3 -3
- package/dist/components/ItemPickerNew/types/baseItemSectionType.types.js +1 -1
- package/dist/components/ItemPickerNew/types/itemPickerListTexts.types.d.ts +1 -1
- package/dist/components/ItemPickerNew/types/itemPickerListTexts.types.js +1 -1
- package/dist/components/ItemPickerTrigger/Trigger.d.ts +5 -5
- package/dist/components/ItemPickerTrigger/Trigger.js +71 -111
- package/dist/components/ItemPickerTrigger/Trigger.styles.d.ts +12 -12
- package/dist/components/ItemPickerTrigger/Trigger.styles.js +70 -93
- package/dist/components/ItemPickerTrigger/Trigger.types.d.ts +3 -3
- package/dist/components/ItemPickerTrigger/Trigger.types.js +1 -1
- package/dist/hooks/useDefaultTexts.d.ts +1 -1
- package/dist/hooks/useDefaultTexts.js +116 -121
- package/dist/index.js +14 -6
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +25 -25
|
@@ -1,106 +1,97 @@
|
|
|
1
|
-
import { VariableSizeList } from
|
|
2
|
-
import styled, { css } from
|
|
3
|
-
import Dropdown from
|
|
4
|
-
import { Label
|
|
5
|
-
import DSEmptyStates from
|
|
6
|
-
import DSLoader from
|
|
7
|
-
import Scrollbar from
|
|
8
|
-
import { PlaceholderWrapper } from
|
|
9
|
-
import DropdownSkeleton from
|
|
10
|
-
import { LIST_INNER_PADDING } from
|
|
11
|
-
|
|
1
|
+
import { VariableSizeList } from "react-window";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
|
+
import Dropdown from "@synerise/ds-dropdown";
|
|
4
|
+
import { Label } from "@synerise/ds-dropdown/dist/components/BackAction/BackAction.styles";
|
|
5
|
+
import DSEmptyStates from "@synerise/ds-empty-states";
|
|
6
|
+
import DSLoader from "@synerise/ds-loader";
|
|
7
|
+
import Scrollbar from "@synerise/ds-scrollbar";
|
|
8
|
+
import { PlaceholderWrapper } from "@synerise/ds-search-bar/dist/SearchBar.styles";
|
|
9
|
+
import DropdownSkeleton from "@synerise/ds-skeleton";
|
|
10
|
+
import { LIST_INNER_PADDING } from "./constants.js";
|
|
11
|
+
const ListWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
12
12
|
displayName: "ItemPickerListstyles__ListWrapper",
|
|
13
13
|
componentId: "sc-1r33ill-0"
|
|
14
|
-
})(["position:relative;flex:1 0 calc(100% - ", "px);", " ", " ", "{min-width:0;}"],
|
|
15
|
-
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.wrapperHeight !== undefined && "height: " + (props.wrapperHeight + LIST_INNER_PADDING) + "px;";
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.centered && css(["display:flex;flex-direction:column;"]);
|
|
20
|
-
}, DropdownBackActionLabel);
|
|
21
|
-
export var ListContainer = styled(Dropdown.Wrapper).withConfig({
|
|
14
|
+
})(["position:relative;flex:1 0 calc(100% - ", "px);", " ", " ", "{min-width:0;}"], (props) => props.offsetSpace, (props) => props.wrapperHeight !== void 0 && `height: ${props.wrapperHeight + LIST_INNER_PADDING}px;`, (props) => props.centered && css(["display:flex;flex-direction:column;"]), Label);
|
|
15
|
+
const ListContainer = /* @__PURE__ */ styled(Dropdown.Wrapper).withConfig({
|
|
22
16
|
displayName: "ItemPickerListstyles__ListContainer",
|
|
23
17
|
componentId: "sc-1r33ill-1"
|
|
24
|
-
})(["width:100%;height:", ";display:flex;flex-direction:column;", " span{display:flex;gap:8px;align-items:center;}"],
|
|
25
|
-
|
|
26
|
-
}, PlaceholderWrapper);
|
|
27
|
-
export var SearchWrapper = styled.div.withConfig({
|
|
18
|
+
})(["width:100%;height:", ";display:flex;flex-direction:column;", " span{display:flex;gap:8px;align-items:center;}"], (props) => props.wrapperHeight, PlaceholderWrapper);
|
|
19
|
+
const SearchWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
28
20
|
displayName: "ItemPickerListstyles__SearchWrapper",
|
|
29
21
|
componentId: "sc-1r33ill-2"
|
|
30
22
|
})(["flex:0 0 52px;"]);
|
|
31
|
-
|
|
23
|
+
const EmptyStates = /* @__PURE__ */ styled(DSEmptyStates).withConfig({
|
|
32
24
|
displayName: "ItemPickerListstyles__EmptyStates",
|
|
33
25
|
componentId: "sc-1r33ill-3"
|
|
34
26
|
})(["width:260px;margin:auto;"]);
|
|
35
|
-
|
|
27
|
+
const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
36
28
|
displayName: "ItemPickerListstyles__IconWrapper",
|
|
37
29
|
componentId: "sc-1r33ill-4"
|
|
38
|
-
})(["margin-right:4px;svg{fill:", ";}"],
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
export var FooterWrapper = styled.div.withConfig({
|
|
30
|
+
})(["margin-right:4px;svg{fill:", ";}"], (props) => props.theme.palette["grey-600"]);
|
|
31
|
+
const FooterWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
42
32
|
displayName: "ItemPickerListstyles__FooterWrapper",
|
|
43
33
|
componentId: "sc-1r33ill-5"
|
|
44
|
-
})(["background-color:", ";padding:0 8px;height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;color:", ";font-weight:500;border-top:solid 1px ", ";&:hover{color:", ";", "{svg{fill:", ";}}}"],
|
|
45
|
-
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.theme.palette['grey-600'];
|
|
48
|
-
}, function (props) {
|
|
49
|
-
return props.theme.palette['grey-100'];
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return props.theme.palette['blue-600'];
|
|
52
|
-
}, IconWrapper, function (props) {
|
|
53
|
-
return props.theme.palette['blue-600'];
|
|
54
|
-
});
|
|
55
|
-
export var FooterWrapperRight = styled.div.withConfig({
|
|
34
|
+
})(["background-color:", ";padding:0 8px;height:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:space-between;color:", ";font-weight:500;border-top:solid 1px ", ";&:hover{color:", ";", "{svg{fill:", ";}}}"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-100"], (props) => props.theme.palette["blue-600"], IconWrapper, (props) => props.theme.palette["blue-600"]);
|
|
35
|
+
const FooterWrapperRight = /* @__PURE__ */ styled.div.withConfig({
|
|
56
36
|
displayName: "ItemPickerListstyles__FooterWrapperRight",
|
|
57
37
|
componentId: "sc-1r33ill-6"
|
|
58
38
|
})([""]);
|
|
59
|
-
|
|
39
|
+
const FooterWrapperLeft = /* @__PURE__ */ styled.div.withConfig({
|
|
60
40
|
displayName: "ItemPickerListstyles__FooterWrapperLeft",
|
|
61
41
|
componentId: "sc-1r33ill-7"
|
|
62
42
|
})([""]);
|
|
63
|
-
|
|
43
|
+
const ScrollContent = /* @__PURE__ */ styled.div.withConfig({
|
|
64
44
|
displayName: "ItemPickerListstyles__ScrollContent",
|
|
65
45
|
componentId: "sc-1r33ill-8"
|
|
66
46
|
})(["padding-right:", "px;"], LIST_INNER_PADDING);
|
|
67
|
-
|
|
47
|
+
const StyledScrollbar = /* @__PURE__ */ styled(Scrollbar).withConfig({
|
|
68
48
|
displayName: "ItemPickerListstyles__StyledScrollbar",
|
|
69
49
|
componentId: "sc-1r33ill-9"
|
|
70
|
-
})(["padding:", "px 0 0 ", "px;height:", ";&&{.ps__rail-y{left:unset !important;right:0;}}"], LIST_INNER_PADDING, LIST_INNER_PADDING,
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
export var StyledList = styled(VariableSizeList).withConfig({
|
|
50
|
+
})(["padding:", "px 0 0 ", "px;height:", ";&&{.ps__rail-y{left:unset !important;right:0;}}"], LIST_INNER_PADDING, LIST_INNER_PADDING, (props) => props.withSectionHeader ? "calc(100% - 53px)" : "100%");
|
|
51
|
+
const StyledList = /* @__PURE__ */ styled(VariableSizeList).withConfig({
|
|
74
52
|
displayName: "ItemPickerListstyles__StyledList",
|
|
75
53
|
componentId: "sc-1r33ill-10"
|
|
76
|
-
})(["overflow-x:unset;overflow-y:unset;height:auto !important;", " &:after{content:'';height:8px;display:block;}"],
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
export var Skeleton = styled(DropdownSkeleton).withConfig({
|
|
54
|
+
})(["overflow-x:unset;overflow-y:unset;height:auto !important;", " &:after{content:'';height:8px;display:block;}"], (props) => props.maxHeight !== void 0 && `max-height: ${props.maxHeight}px;`);
|
|
55
|
+
const Skeleton = /* @__PURE__ */ styled(DropdownSkeleton).withConfig({
|
|
80
56
|
displayName: "ItemPickerListstyles__Skeleton",
|
|
81
57
|
componentId: "sc-1r33ill-11"
|
|
82
58
|
})(["padding:0;width:70%;"]);
|
|
83
|
-
|
|
59
|
+
const SkeletonWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
84
60
|
displayName: "ItemPickerListstyles__SkeletonWrapper",
|
|
85
61
|
componentId: "sc-1r33ill-12"
|
|
86
|
-
})(["", " display:flex;flex-direction:column;gap:16px;padding:16px;", ":nth-child(odd){width:50%;}"],
|
|
87
|
-
|
|
88
|
-
}, Skeleton);
|
|
89
|
-
export var Title = styled.div.withConfig({
|
|
62
|
+
})(["", " display:flex;flex-direction:column;gap:16px;padding:16px;", ":nth-child(odd){width:50%;}"], (props) => props.wrapperHeight !== void 0 && `height: ${props.wrapperHeight}px;`, Skeleton);
|
|
63
|
+
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
90
64
|
displayName: "ItemPickerListstyles__Title",
|
|
91
65
|
componentId: "sc-1r33ill-13"
|
|
92
|
-
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"],
|
|
93
|
-
|
|
94
|
-
});
|
|
95
|
-
export var SectionTitleWrapper = styled.div.withConfig({
|
|
66
|
+
})(["font-size:10px;line-height:1.6;font-weight:500;text-transform:uppercase;color:", ";padding:8px 12px;"], (props) => props.theme.palette["grey-500"]);
|
|
67
|
+
const SectionTitleWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
96
68
|
displayName: "ItemPickerListstyles__SectionTitleWrapper",
|
|
97
69
|
componentId: "sc-1r33ill-14"
|
|
98
70
|
})([""]);
|
|
99
|
-
|
|
71
|
+
const InfiniteLoaderItemWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
100
72
|
displayName: "ItemPickerListstyles__InfiniteLoaderItemWrapper",
|
|
101
73
|
componentId: "sc-1r33ill-15"
|
|
102
74
|
})([""]);
|
|
103
|
-
|
|
75
|
+
const Loader = /* @__PURE__ */ styled(DSLoader).withConfig({
|
|
104
76
|
displayName: "ItemPickerListstyles__Loader",
|
|
105
77
|
componentId: "sc-1r33ill-16"
|
|
106
|
-
})(["justify-content:flex-start;"]);
|
|
78
|
+
})(["justify-content:flex-start;"]);
|
|
79
|
+
export {
|
|
80
|
+
EmptyStates,
|
|
81
|
+
FooterWrapper,
|
|
82
|
+
FooterWrapperLeft,
|
|
83
|
+
FooterWrapperRight,
|
|
84
|
+
IconWrapper,
|
|
85
|
+
InfiniteLoaderItemWrapper,
|
|
86
|
+
ListContainer,
|
|
87
|
+
ListWrapper,
|
|
88
|
+
Loader,
|
|
89
|
+
ScrollContent,
|
|
90
|
+
SearchWrapper,
|
|
91
|
+
SectionTitleWrapper,
|
|
92
|
+
Skeleton,
|
|
93
|
+
SkeletonWrapper,
|
|
94
|
+
StyledList,
|
|
95
|
+
StyledScrollbar,
|
|
96
|
+
Title
|
|
97
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
+
import { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from '../ItemPickerNew/types/baseItemSectionType.types';
|
|
4
4
|
export type ItemSelectHandler<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = SectionType extends BaseSectionType ? (item: ItemType, section?: BaseSectionTypeWithFolders<BaseSectionType>) => void : (item: ItemType) => void;
|
|
5
5
|
export type TitleListItemProps = Omit<ListItemProps, 'type'> & {
|
|
6
6
|
type: 'title';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { BaseSectionType } from '../../ItemPickerNew/types/baseItemSectionType.types';
|
|
3
|
+
import { ItemPickerListTexts } from '../../ItemPickerNew/types/itemPickerListTexts.types';
|
|
4
4
|
type EmptyListMessageProps = {
|
|
5
5
|
texts: Pick<ItemPickerListTexts, 'noResultsInSection' | 'noResults' | 'noItems' | 'noActions' | 'emptyStateLabel' | 'searchAllFoldersButtonLabel'>;
|
|
6
6
|
hasCurrentSection?: boolean;
|
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Button from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import { SearchNoResultsL, NoData } from "@synerise/ds-icon";
|
|
4
|
+
import { EmptyStates } from "../ItemPickerList.styles.js";
|
|
5
|
+
const EmptyListMessage = ({
|
|
6
|
+
texts,
|
|
7
|
+
listActions,
|
|
8
|
+
isActionSection,
|
|
9
|
+
hasCurrentSection,
|
|
10
|
+
buttonOnClick,
|
|
11
|
+
currentSection,
|
|
12
|
+
searchQuery,
|
|
13
|
+
emptyListIcon,
|
|
14
|
+
noResultsIcon,
|
|
15
|
+
emptyStateComponent,
|
|
16
|
+
noResultsComponent
|
|
17
|
+
}) => {
|
|
17
18
|
if (listActions) {
|
|
18
|
-
return
|
|
19
|
-
customIcon: /*#__PURE__*/React.createElement(SearchNoResultsL, null),
|
|
20
|
-
label: texts.noActions
|
|
21
|
-
});
|
|
19
|
+
return /* @__PURE__ */ jsx(EmptyStates, { customIcon: /* @__PURE__ */ jsx(SearchNoResultsL, {}), label: texts.noActions });
|
|
22
20
|
}
|
|
23
21
|
if (hasCurrentSection && !isActionSection) {
|
|
24
|
-
|
|
25
|
-
return /*#__PURE__*/React.createElement(S.EmptyStates, {
|
|
26
|
-
customIcon: /*#__PURE__*/React.createElement(SearchNoResultsL, null),
|
|
27
|
-
label: (currentSection == null || (_currentSection$texts = currentSection.texts) == null ? void 0 : _currentSection$texts.noResultsInSection) || texts.noResultsInSection,
|
|
28
|
-
button: /*#__PURE__*/React.createElement(Button, {
|
|
29
|
-
type: "primary",
|
|
30
|
-
onClick: buttonOnClick
|
|
31
|
-
}, (currentSection == null || (_currentSection$texts2 = currentSection.texts) == null ? void 0 : _currentSection$texts2.searchAllFoldersButtonLabel) || texts.searchAllFoldersButtonLabel)
|
|
32
|
-
});
|
|
22
|
+
return /* @__PURE__ */ jsx(EmptyStates, { customIcon: /* @__PURE__ */ jsx(SearchNoResultsL, {}), label: currentSection?.texts?.noResultsInSection || texts.noResultsInSection, button: /* @__PURE__ */ jsx(Button, { type: "primary", onClick: buttonOnClick, children: currentSection?.texts?.searchAllFoldersButtonLabel || texts.searchAllFoldersButtonLabel }) });
|
|
33
23
|
}
|
|
34
24
|
if (!searchQuery) {
|
|
35
25
|
if (emptyStateComponent) {
|
|
36
|
-
return
|
|
26
|
+
return /* @__PURE__ */ jsx(Fragment, { children: emptyStateComponent });
|
|
37
27
|
}
|
|
38
|
-
return
|
|
39
|
-
customIcon: emptyListIcon || /*#__PURE__*/React.createElement(NoData, null),
|
|
40
|
-
label: texts.emptyStateLabel
|
|
41
|
-
});
|
|
28
|
+
return /* @__PURE__ */ jsx(EmptyStates, { customIcon: emptyListIcon || /* @__PURE__ */ jsx(NoData, {}), label: texts.emptyStateLabel });
|
|
42
29
|
}
|
|
43
30
|
if (noResultsComponent) {
|
|
44
|
-
return
|
|
31
|
+
return /* @__PURE__ */ jsx(Fragment, { children: noResultsComponent });
|
|
45
32
|
}
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
33
|
+
return /* @__PURE__ */ jsx(EmptyStates, { customIcon: noResultsIcon || /* @__PURE__ */ jsx(SearchNoResultsL, {}), label: texts.noResults });
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
EmptyListMessage
|
|
37
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Alert from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Alert from "@synerise/ds-alert";
|
|
3
|
+
const ErrorItem = ({
|
|
4
|
+
label
|
|
5
|
+
}) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Alert.InlineAlert, { type: "alert", message: label });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
ErrorItem
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemPickerListTexts } from '../../ItemPickerNew/types/itemPickerListTexts.types';
|
|
3
3
|
type ErrorMessageProps = {
|
|
4
4
|
texts: ItemPickerListTexts;
|
|
5
5
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { theme } from
|
|
3
|
-
import { WarningL } from
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
labelPosition: "bottom"
|
|
14
|
-
});
|
|
15
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { theme } from "@synerise/ds-core";
|
|
3
|
+
import { WarningL } from "@synerise/ds-icon";
|
|
4
|
+
import { EmptyStates } from "../ItemPickerList.styles.js";
|
|
5
|
+
const ErrorMessage = ({
|
|
6
|
+
texts
|
|
7
|
+
}) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(EmptyStates, { customIcon: /* @__PURE__ */ jsx(WarningL, { fill: theme.palette["red-600"] }), text: texts.errorMessageTitle, label: texts.errorMessageDetails, labelPosition: "bottom" });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
ErrorMessage
|
|
12
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ItemPickerListTexts } from '../../ItemPickerNew/types/itemPickerListTexts.types';
|
|
3
3
|
export type InfiniteLoaderItemProps = {
|
|
4
4
|
hasError: boolean;
|
|
5
5
|
hasMore: boolean;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ErrorItem } from
|
|
3
|
-
import { LoadingItem } from
|
|
4
|
-
import { NoMoreItem } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
label: texts.infiniteScrollAllLoaded
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorItem } from "./ErrorItem.js";
|
|
3
|
+
import { LoadingItem } from "./LoadingItem.js";
|
|
4
|
+
import { NoMoreItem } from "./NoMoreItem.js";
|
|
5
|
+
const InfiniteLoaderItem = ({
|
|
6
|
+
hasMore,
|
|
7
|
+
isLoading,
|
|
8
|
+
hasError,
|
|
9
|
+
texts
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
isLoading && /* @__PURE__ */ jsx(LoadingItem, { label: texts.infiniteScrollLoadingMore }),
|
|
13
|
+
!isLoading && !hasMore && /* @__PURE__ */ jsx(NoMoreItem, { label: texts.infiniteScrollAllLoaded }),
|
|
14
|
+
!isLoading && hasError && /* @__PURE__ */ jsx(ErrorItem, { label: texts.infiniteScrollLoadingError })
|
|
15
|
+
] });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
InfiniteLoaderItem
|
|
19
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonProps } from '@synerise/ds-button';
|
|
3
|
+
import { ItemPickerListTexts } from '../../ItemPickerNew/types/itemPickerListTexts.types';
|
|
4
4
|
type ItemPickerListFooterProps = {
|
|
5
5
|
texts: ItemPickerListTexts;
|
|
6
6
|
refreshButtonProps?: Partial<ButtonProps>;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
mode: "icon-label",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
import { theme } from "@synerise/ds-core";
|
|
4
|
+
import Icon, { RefreshM } from "@synerise/ds-icon";
|
|
5
|
+
import { FooterWrapper, FooterWrapperLeft, FooterWrapperRight } from "../ItemPickerList.styles.js";
|
|
6
|
+
const ItemPickerListFooter = ({
|
|
7
|
+
texts,
|
|
8
|
+
refreshButtonProps,
|
|
9
|
+
onRefresh
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Fragment, { children: onRefresh && /* @__PURE__ */ jsxs(FooterWrapper, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx(FooterWrapperLeft, {}),
|
|
13
|
+
/* @__PURE__ */ jsx(FooterWrapperRight, { children: /* @__PURE__ */ jsxs(Button, { type: "ghost", mode: "icon-label", onClick: onRefresh, ...refreshButtonProps, children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(RefreshM, {}), size: 24, color: theme.palette["grey-500"] }),
|
|
15
|
+
texts.refreshButtonLabel
|
|
16
|
+
] }) })
|
|
17
|
+
] }) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
ItemPickerListFooter
|
|
21
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { default as React, CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
import { ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
+
import { ItemPickerListTexts } from '../../ItemPickerNew/types/itemPickerListTexts.types';
|
|
4
|
+
import { TitleListItemProps } from '../ItemPickerList.types';
|
|
5
5
|
export type ItemPickerListRowProps = {
|
|
6
6
|
index: number;
|
|
7
7
|
style: CSSProperties;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { isTitle } from
|
|
6
|
-
import { InfiniteLoaderItem } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
dataSource
|
|
13
|
-
classNames
|
|
14
|
-
getItemSize
|
|
15
|
-
infiniteScroll
|
|
16
|
-
texts
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import DSListItem from "@synerise/ds-list-item";
|
|
4
|
+
import { InfiniteLoaderItemWrapper, Title } from "../ItemPickerList.styles.js";
|
|
5
|
+
import { isTitle } from "../utils/typeguards.utils.js";
|
|
6
|
+
import { InfiniteLoaderItem } from "./InfiniteLoaderItem.js";
|
|
7
|
+
const INFINITE_LOADER_ITEM_HEIGHT = 48;
|
|
8
|
+
const ItemPickerListRow = ({
|
|
9
|
+
index,
|
|
10
|
+
style,
|
|
11
|
+
data: {
|
|
12
|
+
dataSource,
|
|
13
|
+
classNames,
|
|
14
|
+
getItemSize,
|
|
15
|
+
infiniteScroll,
|
|
16
|
+
texts
|
|
17
|
+
}
|
|
18
|
+
}) => {
|
|
19
|
+
const listItem = dataSource[index];
|
|
20
|
+
const lastItemHeight = getItemSize(dataSource.length - 1);
|
|
21
|
+
const infiniteLoaderItem = useCallback(() => {
|
|
20
22
|
if (infiniteScroll) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const {
|
|
24
|
+
isLoading,
|
|
25
|
+
hasMore,
|
|
26
|
+
hasError
|
|
27
|
+
} = infiniteScroll;
|
|
28
|
+
const top = `${Number(style.top) + lastItemHeight}px`;
|
|
25
29
|
if (isLoading || hasError || !hasMore) {
|
|
26
|
-
return
|
|
27
|
-
style
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, /*#__PURE__*/React.createElement(InfiniteLoaderItem, {
|
|
33
|
-
hasMore: hasMore,
|
|
34
|
-
isLoading: isLoading,
|
|
35
|
-
hasError: hasError,
|
|
36
|
-
texts: texts
|
|
37
|
-
}));
|
|
30
|
+
return /* @__PURE__ */ jsx(InfiniteLoaderItemWrapper, { style: {
|
|
31
|
+
...style,
|
|
32
|
+
top,
|
|
33
|
+
height: `${INFINITE_LOADER_ITEM_HEIGHT}px`,
|
|
34
|
+
padding: "6px 0"
|
|
35
|
+
}, children: /* @__PURE__ */ jsx(InfiniteLoaderItem, { hasMore, isLoading, hasError, texts }) });
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
return null;
|
|
41
39
|
}, [infiniteScroll, lastItemHeight, style, texts]);
|
|
42
40
|
if (isTitle(listItem)) {
|
|
43
|
-
return
|
|
44
|
-
style: style
|
|
45
|
-
}, listItem.text);
|
|
41
|
+
return /* @__PURE__ */ jsx(Title, { style, children: listItem.text });
|
|
46
42
|
}
|
|
47
|
-
return
|
|
48
|
-
style:
|
|
49
|
-
|
|
50
|
-
})
|
|
51
|
-
};
|
|
43
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsx(DSListItem, { ...listItem, style, className: classNames }),
|
|
45
|
+
index === dataSource.length - 1 && infiniteLoaderItem()
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
ItemPickerListRow
|
|
50
|
+
};
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
numberOfSkeletons: 1,
|
|
9
|
-
size: "M"
|
|
10
|
-
|
|
11
|
-
numberOfSkeletons: 1,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
numberOfSkeletons: 1,
|
|
18
|
-
size: "M"
|
|
19
|
-
}), /*#__PURE__*/React.createElement(S.Skeleton, {
|
|
20
|
-
numberOfSkeletons: 1,
|
|
21
|
-
size: "M"
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SkeletonWrapper, Skeleton } from "../ItemPickerList.styles.js";
|
|
3
|
+
const ItemPickerListSkeleton = ({
|
|
4
|
+
wrapperHeight
|
|
5
|
+
}) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs(SkeletonWrapper, { wrapperHeight, children: [
|
|
7
|
+
/* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "M" }),
|
|
8
|
+
/* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "M" }),
|
|
9
|
+
/* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "M" }),
|
|
10
|
+
/* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "M" }),
|
|
11
|
+
/* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "M" })
|
|
12
|
+
] });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
ItemPickerListSkeleton
|
|
16
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { default as React, MutableRefObject } from 'react';
|
|
2
|
+
import { SearchBarProps } from '@synerise/ds-search-bar';
|
|
3
|
+
import { ItemPickerTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
4
|
+
import { SearchByParamConfig } from '../../ItemPickerNew/types/actions.types';
|
|
5
5
|
type ListSearchInputProps = {
|
|
6
6
|
searchByParamConfig?: SearchByParamConfig;
|
|
7
7
|
clearSearchQuery: () => void;
|