@griddo/ax 11.2.12 → 11.3.0
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/package.json +3 -2
- package/src/__tests__/components/SideModal/SideModal.test.tsx +15 -11
- package/src/api/images.tsx +17 -2
- package/src/api/pages.tsx +49 -2
- package/src/api/selects.tsx +7 -5
- package/src/components/Browser/index.tsx +8 -1
- package/src/components/Button/style.tsx +7 -2
- package/src/components/ConfigPanel/Form/ConnectedField/NavConnectedField/index.tsx +6 -3
- package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/index.tsx +8 -3
- package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/index.tsx +20 -6
- package/src/components/ConfigPanel/NavigationForm/Field/index.tsx +1 -1
- package/src/components/ErrorCenter/index.tsx +6 -5
- package/src/components/Fields/AsyncSelect/index.tsx +3 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/AddItemButton/index.tsx +1 -1
- package/src/components/Fields/ComponentArray/MixableComponentArray/index.tsx +18 -15
- package/src/components/Fields/ComponentArray/SameComponentArray/index.tsx +6 -7
- package/src/components/Fields/ComponentArray/helpers.tsx +19 -11
- package/src/components/Fields/ComponentContainer/EmptyContainer/index.tsx +10 -3
- package/src/components/Fields/ComponentContainer/index.tsx +15 -3
- package/src/components/Fields/FormContainer/FormModal/index.tsx +217 -0
- package/src/components/Fields/FormContainer/FormModal/style.tsx +129 -0
- package/src/components/Fields/FormContainer/index.tsx +96 -0
- package/src/components/Fields/FormContainer/style.tsx +74 -0
- package/src/components/Fields/HiddenField/index.tsx +8 -5
- package/src/components/Fields/HiddenField/style.tsx +28 -18
- package/src/components/Fields/IntegrationsField/index.tsx +8 -2
- package/src/components/Fields/LinkField/index.tsx +1 -1
- package/src/components/Fields/TextField/index.tsx +3 -3
- package/src/components/Fields/UrlField/utils.tsx +2 -2
- package/src/components/Fields/index.tsx +2 -0
- package/src/components/FieldsBehavior/index.tsx +7 -4
- package/src/components/FileGallery/index.tsx +5 -5
- package/src/components/FloatingButton/index.tsx +34 -0
- package/src/components/FloatingButton/style.tsx +76 -0
- package/src/components/FloatingPanel/style.tsx +1 -2
- package/src/components/Gallery/index.tsx +1 -1
- package/src/components/MainWrapper/AppBar/index.tsx +2 -2
- package/src/components/MainWrapper/index.tsx +2 -2
- package/src/components/MainWrapper/style.tsx +1 -0
- package/src/components/Modal/index.tsx +3 -3
- package/src/components/OcassionalToast/index.tsx +25 -0
- package/src/components/OcassionalToast/style.tsx +33 -0
- package/src/components/SearchField/index.tsx +4 -3
- package/src/components/SideModal/SideModalOption/index.tsx +1 -3
- package/src/components/SideModal/index.tsx +67 -44
- package/src/components/SideModal/style.tsx +67 -23
- package/src/components/TableFilters/CategoryFilter/index.tsx +14 -3
- package/src/components/TableFilters/CategoryFilter/style.tsx +2 -2
- package/src/components/Toast/index.tsx +6 -4
- package/src/components/index.tsx +8 -0
- package/src/containers/Forms/actions.tsx +92 -51
- package/src/containers/Gallery/actions.tsx +2 -5
- package/src/containers/Navigation/Defaults/actions.tsx +6 -4
- package/src/containers/Navigation/Defaults/utils.tsx +1 -43
- package/src/containers/PageEditor/actions.tsx +53 -34
- package/src/containers/PageEditor/reducer.tsx +1 -1
- package/src/containers/PageEditor/utils.tsx +22 -9
- package/src/forms/editor.tsx +20 -1
- package/src/forms/elements.tsx +3 -0
- package/src/forms/index.tsx +2 -0
- package/src/forms/validators.tsx +56 -33
- package/src/helpers/containerEvaluations.tsx +1 -1
- package/src/helpers/fields.tsx +1 -1
- package/src/helpers/images.tsx +71 -1
- package/src/helpers/index.tsx +5 -1
- package/src/helpers/schemas.tsx +10 -7
- package/src/helpers/themes.tsx +2 -2
- package/src/hooks/forms.tsx +2 -2
- package/src/hooks/modals.tsx +2 -2
- package/src/modules/Categories/CategoriesList/CategoryPanel/index.tsx +4 -7
- package/src/modules/Categories/CategoriesList/index.tsx +1 -3
- package/src/modules/FileDrive/atoms.tsx +2 -2
- package/src/modules/FileDrive/index.tsx +9 -9
- package/src/modules/Forms/FormCategoriesList/CategoryItem/index.tsx +30 -10
- package/src/modules/Forms/FormCategoriesList/CategoryPanel/index.tsx +1 -0
- package/src/modules/Forms/FormCategoriesList/index.tsx +45 -21
- package/src/modules/Forms/FormEditor/Editor/FormConfigPanel/Form/ConnectedField/Field/index.tsx +3 -0
- package/src/modules/Forms/FormEditor/Editor/FormConfigPanel/Form/ConnectedField/TemplateManager/index.tsx +9 -6
- package/src/modules/Forms/FormEditor/Editor/FormConfigPanel/Form/ConnectedField/index.tsx +20 -4
- package/src/modules/Forms/FormEditor/Editor/FormConfigPanel/Form/index.tsx +17 -2
- package/src/modules/Forms/FormEditor/Editor/FormConfigPanel/index.tsx +7 -1
- package/src/modules/Forms/FormEditor/Editor/index.tsx +8 -2
- package/src/modules/Forms/FormEditor/PageBrowser/index.tsx +20 -16
- package/src/modules/Forms/FormEditor/PageBrowser/style.tsx +9 -0
- package/src/modules/Forms/FormEditor/index.tsx +126 -30
- package/src/modules/Forms/FormEditor/style.tsx +1 -1
- package/src/modules/Forms/FormList/FormItem/index.tsx +114 -36
- package/src/modules/Forms/FormList/FormItem/style.tsx +4 -2
- package/src/modules/Forms/FormList/TemplateModal/index.tsx +67 -20
- package/src/modules/Forms/FormList/TemplateModal/style.tsx +28 -2
- package/src/modules/Forms/FormList/index.tsx +114 -34
- package/src/modules/Forms/FormList/style.tsx +10 -2
- package/src/modules/Forms/FormUseModal/index.tsx +219 -0
- package/src/modules/Forms/FormUseModal/style.tsx +81 -0
- package/src/modules/Forms/FormUseModal/utils.tsx +39 -0
- package/src/modules/Forms/atoms.tsx +38 -3
- package/src/modules/PageEditor/index.tsx +2 -2
- package/src/modules/Redirects/index.tsx +10 -12
- package/src/modules/Settings/ContentTypes/DataPacks/Config/Form/TemplateConfig/TemplateEditor/Editor/ConfigPanel/NavigationField/index.tsx +1 -1
- package/src/modules/StructuredData/StructuredDataList/GlobalPageItem/index.tsx +1 -1
- package/src/modules/Users/UserCreate/index.tsx +5 -4
- package/src/routes/multisite.tsx +18 -0
- package/src/routes/site.tsx +5 -0
- package/src/schemas/pages/FormPage.tsx +3 -2
- package/src/types/forms.tsx +4 -2
- package/src/types/index.tsx +20 -3
|
@@ -4,7 +4,7 @@ import { createPortal } from "react-dom";
|
|
|
4
4
|
import { useHandleClickOutside } from "@ax/hooks";
|
|
5
5
|
import { getDisplayName, filterByCategory } from "@ax/helpers";
|
|
6
6
|
import SideModalOption from "@ax/components/SideModal/SideModalOption";
|
|
7
|
-
import { MenuItem, SearchField, IconAction } from "@ax/components";
|
|
7
|
+
import { MenuItem, SearchField, IconAction, FloatingButton } from "@ax/components";
|
|
8
8
|
import { ModuleCategoryInfo } from "@ax/types";
|
|
9
9
|
|
|
10
10
|
import * as S from "./style";
|
|
@@ -17,7 +17,7 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
17
17
|
toggleModal,
|
|
18
18
|
componentOptions,
|
|
19
19
|
categories,
|
|
20
|
-
|
|
20
|
+
onClick,
|
|
21
21
|
current,
|
|
22
22
|
showSearch,
|
|
23
23
|
theme,
|
|
@@ -36,6 +36,7 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
36
36
|
|
|
37
37
|
const [options, setOptions] = useState(filteredValues);
|
|
38
38
|
const [searchQuery, setSearchQuery] = useState("");
|
|
39
|
+
const node = useRef<HTMLDivElement | null>(null);
|
|
39
40
|
|
|
40
41
|
useEffect(() => {
|
|
41
42
|
if (componentOptions) {
|
|
@@ -58,19 +59,24 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
58
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
60
|
}, [current, whiteList]);
|
|
60
61
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
const handleClick = (moduleType: string) => {
|
|
63
|
+
if (onClick) {
|
|
64
|
+
onClick(moduleType);
|
|
65
|
+
}
|
|
66
|
+
!hasFieldsStyle && handleCloseModal();
|
|
64
67
|
};
|
|
65
68
|
|
|
66
|
-
const
|
|
69
|
+
const handleCloseModal = () => {
|
|
70
|
+
setSearchQuery("");
|
|
71
|
+
isOpen && toggleModal();
|
|
72
|
+
};
|
|
67
73
|
|
|
68
74
|
const handleClickOutside = (e: any) => {
|
|
69
|
-
if (node.current
|
|
75
|
+
if (node.current?.contains(e.target) || hasFieldsStyle) {
|
|
70
76
|
return;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
|
|
79
|
+
handleCloseModal();
|
|
74
80
|
};
|
|
75
81
|
|
|
76
82
|
useHandleClickOutside(isOpen, handleClickOutside);
|
|
@@ -134,7 +140,6 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
134
140
|
<SideModalOption
|
|
135
141
|
option={option}
|
|
136
142
|
handleClick={handleClick}
|
|
137
|
-
toggleModal={handleToggleModal}
|
|
138
143
|
key={`${option}${i}`}
|
|
139
144
|
theme={theme}
|
|
140
145
|
smallMargin={hasFieldsStyle}
|
|
@@ -144,40 +149,58 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
|
|
|
144
149
|
);
|
|
145
150
|
});
|
|
146
151
|
|
|
147
|
-
return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
152
|
+
return createPortal(
|
|
153
|
+
<>
|
|
154
|
+
<S.Wrapper
|
|
155
|
+
ref={node}
|
|
156
|
+
optionsType={optionsType}
|
|
157
|
+
isOpen={isOpen}
|
|
158
|
+
data-testid="side-modal"
|
|
159
|
+
className={hasFieldsStyle ? "form-fields" : ""}
|
|
160
|
+
>
|
|
161
|
+
<S.Header>
|
|
162
|
+
{!hasFieldsStyle && <S.Title data-testid="side-modal-title">{optionsType}</S.Title>}
|
|
163
|
+
{showSearch && optionsType !== "components" && (
|
|
164
|
+
<S.SearchWrapper>
|
|
165
|
+
<SearchField
|
|
166
|
+
onChange={setSearchQuery}
|
|
167
|
+
closeOnInactive={!hasFieldsStyle}
|
|
168
|
+
small={!filters}
|
|
169
|
+
placeholder={hasFieldsStyle ? "Search field" : ""}
|
|
170
|
+
/>
|
|
171
|
+
</S.SearchWrapper>
|
|
172
|
+
)}
|
|
173
|
+
{!showSearch && (
|
|
174
|
+
<S.ButtonWrapper data-testid="side-modal-close-button">
|
|
175
|
+
<IconAction icon="close" onClick={handleCloseModal} />
|
|
176
|
+
</S.ButtonWrapper>
|
|
177
|
+
)}
|
|
178
|
+
</S.Header>
|
|
179
|
+
<S.ColumnsWrapper>
|
|
180
|
+
{hasFieldsStyle && (
|
|
181
|
+
<S.FloatingButtonWrapper>
|
|
182
|
+
<FloatingButton icon="leftArrow" size="S" onClick={handleCloseModal} />
|
|
183
|
+
</S.FloatingButtonWrapper>
|
|
184
|
+
)}
|
|
185
|
+
{(filters || featuredFilters) && (
|
|
186
|
+
<S.Content>
|
|
187
|
+
{featuredFilters && <S.FeaturedWrapper>{featuredFilters}</S.FeaturedWrapper>}
|
|
188
|
+
{filters && <div>{filters}</div>}
|
|
189
|
+
</S.Content>
|
|
190
|
+
)}
|
|
191
|
+
<S.Content>{filteredOptions}</S.Content>
|
|
192
|
+
</S.ColumnsWrapper>
|
|
193
|
+
</S.Wrapper>
|
|
194
|
+
{hasFieldsStyle && (
|
|
195
|
+
<S.ClosedWrapper isOpen={!isOpen}>
|
|
196
|
+
<S.ClosedFloatingButtonWrapper>
|
|
197
|
+
<FloatingButton text="fields" icon="rightArrow" size="S" onClick={toggleModal} />
|
|
198
|
+
</S.ClosedFloatingButtonWrapper>
|
|
199
|
+
</S.ClosedWrapper>
|
|
200
|
+
)}
|
|
201
|
+
</>,
|
|
202
|
+
document.body
|
|
203
|
+
);
|
|
181
204
|
};
|
|
182
205
|
|
|
183
206
|
export interface ISideModalProps {
|
|
@@ -186,7 +209,7 @@ export interface ISideModalProps {
|
|
|
186
209
|
categories?: ModuleCategoryInfo[];
|
|
187
210
|
optionsType: string;
|
|
188
211
|
toggleModal: () => void;
|
|
189
|
-
|
|
212
|
+
onClick?: (moduleType: string) => void;
|
|
190
213
|
componentOptions?: any;
|
|
191
214
|
current?: any;
|
|
192
215
|
showSearch?: boolean;
|
|
@@ -2,28 +2,15 @@ import styled from "styled-components";
|
|
|
2
2
|
|
|
3
3
|
const placeRight = ["components", "headers", "footers"];
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
position: fixed;
|
|
7
|
-
left: ${(p) => (p.optionsType && placeRight.includes(p.optionsType) ? "unset" : 0)};
|
|
8
|
-
right: ${(p) => (p.optionsType && placeRight.includes(p.optionsType) ? 0 : "unset")};
|
|
9
|
-
top: 0;
|
|
10
|
-
z-index: 1000;
|
|
11
|
-
margin-top: ${(p) => (p.hasFieldsStyle ? p.theme.spacing.xl : "0")};
|
|
12
|
-
height: 100vh;
|
|
13
|
-
background: ${(p) => p.theme.colors.uiBackground01};
|
|
14
|
-
box-shadow: ${(p) =>
|
|
15
|
-
p.optionsType && placeRight.includes(p.optionsType) ? p.theme.shadow.rightPanel : p.theme.shadow.leftPanel};
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
const Header = styled.div<{ hasFieldsStyle: boolean }>`
|
|
5
|
+
const Header = styled.div`
|
|
19
6
|
display: flex;
|
|
20
7
|
align-items: center;
|
|
21
8
|
justify-content: space-between;
|
|
22
9
|
height: ${(p) => p.theme.spacing.xl};
|
|
23
10
|
width: 100%;
|
|
24
|
-
padding: ${(p) =>
|
|
25
|
-
background-color: ${(p) =>
|
|
26
|
-
border-bottom: ${(p) =>
|
|
11
|
+
padding: ${(p) => `0 ${p.theme.spacing.m}`};
|
|
12
|
+
background-color: ${(p) => p.theme.colors.uiBackground02};
|
|
13
|
+
border-bottom: ${(p) => `1px solid ${p.theme.colors.uiLine}`};
|
|
27
14
|
h6 {
|
|
28
15
|
${(p) => p.theme.textStyle.headingM}
|
|
29
16
|
color: ${(p) => p.theme.colors.textHighEmphasis};
|
|
@@ -31,12 +18,6 @@ const Header = styled.div<{ hasFieldsStyle: boolean }>`
|
|
|
31
18
|
}
|
|
32
19
|
`;
|
|
33
20
|
|
|
34
|
-
const Title = styled.h6``;
|
|
35
|
-
|
|
36
|
-
const ColumnsWrapper = styled.div`
|
|
37
|
-
display: flex;
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
21
|
const Content = styled.div`
|
|
41
22
|
list-style: none;
|
|
42
23
|
padding: ${(p) => p.theme.spacing.m};
|
|
@@ -50,6 +31,41 @@ const Content = styled.div`
|
|
|
50
31
|
}
|
|
51
32
|
`;
|
|
52
33
|
|
|
34
|
+
const Wrapper = styled.div<{ optionsType?: string; isOpen: boolean }>`
|
|
35
|
+
position: fixed;
|
|
36
|
+
left: ${(p) => (p.optionsType && placeRight.includes(p.optionsType) ? "unset" : p.isOpen ? 0 : "-999px")};
|
|
37
|
+
right: ${(p) => (p.optionsType && placeRight.includes(p.optionsType) ? (p.isOpen ? 0 : "-999px") : "unset")};
|
|
38
|
+
top: 0;
|
|
39
|
+
z-index: 1000;
|
|
40
|
+
margin-top: 0;
|
|
41
|
+
height: 100vh;
|
|
42
|
+
background: ${(p) => p.theme.colors.uiBackground01};
|
|
43
|
+
box-shadow: ${(p) =>
|
|
44
|
+
p.optionsType && placeRight.includes(p.optionsType) ? p.theme.shadow.rightPanel : p.theme.shadow.leftPanel};
|
|
45
|
+
transition: all 0.5s ease-in-out;
|
|
46
|
+
|
|
47
|
+
&.form-fields {
|
|
48
|
+
margin-top: ${(p) => p.theme.spacing.xl};
|
|
49
|
+
|
|
50
|
+
${Header} {
|
|
51
|
+
padding: ${(p) => `${p.theme.spacing.s} ${p.theme.spacing.s} 0`};
|
|
52
|
+
background-color: transparent;
|
|
53
|
+
border-bottom: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${Content} {
|
|
57
|
+
padding: ${(p) => p.theme.spacing.s};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const Title = styled.h6``;
|
|
63
|
+
|
|
64
|
+
const ColumnsWrapper = styled.div`
|
|
65
|
+
position: relative;
|
|
66
|
+
display: flex;
|
|
67
|
+
`;
|
|
68
|
+
|
|
53
69
|
const NavLink = styled.a``;
|
|
54
70
|
|
|
55
71
|
const FeaturedWrapper = styled.div`
|
|
@@ -70,6 +86,31 @@ const ButtonWrapper = styled.div`
|
|
|
70
86
|
margin: 0 0 0 auto;
|
|
71
87
|
`;
|
|
72
88
|
|
|
89
|
+
const FloatingButtonWrapper = styled.div`
|
|
90
|
+
position: absolute;
|
|
91
|
+
right: -16px;
|
|
92
|
+
top: ${(p) => `-${p.theme.spacing.xs}`};
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
const ClosedWrapper = styled.div<{ isOpen: boolean }>`
|
|
96
|
+
position: fixed;
|
|
97
|
+
background-color: ${(p) => p.theme.colors.uiBackground02};
|
|
98
|
+
width: ${(p) => p.theme.spacing.xs};
|
|
99
|
+
border-right: ${(p) => `2px solid ${p.theme.colors.interactive01}`};
|
|
100
|
+
left: ${(p) => (p.isOpen ? "0" : "-999px")};
|
|
101
|
+
top: 0;
|
|
102
|
+
z-index: 1000;
|
|
103
|
+
margin-top: ${(p) => p.theme.spacing.xl};
|
|
104
|
+
height: 100vh;
|
|
105
|
+
transition: ${(p) => (p.isOpen ? "left 1s ease-in-out" : "left 0s ease-out")};
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
const ClosedFloatingButtonWrapper = styled.div`
|
|
109
|
+
position: absolute;
|
|
110
|
+
right: -77px;
|
|
111
|
+
top: 56px;
|
|
112
|
+
`;
|
|
113
|
+
|
|
73
114
|
export {
|
|
74
115
|
Wrapper,
|
|
75
116
|
Content,
|
|
@@ -81,4 +122,7 @@ export {
|
|
|
81
122
|
SearchWrapper,
|
|
82
123
|
Link,
|
|
83
124
|
ButtonWrapper,
|
|
125
|
+
FloatingButtonWrapper,
|
|
126
|
+
ClosedWrapper,
|
|
127
|
+
ClosedFloatingButtonWrapper,
|
|
84
128
|
};
|
|
@@ -8,7 +8,16 @@ import { IFilterValue, IQueryValue } from "@ax/types";
|
|
|
8
8
|
import * as S from "./style";
|
|
9
9
|
|
|
10
10
|
const CategoryFilter = (props: ICategoryFilterProps): JSX.Element => {
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
filterItems,
|
|
13
|
+
value,
|
|
14
|
+
structuredData,
|
|
15
|
+
siteID,
|
|
16
|
+
formCategory,
|
|
17
|
+
pointer = "categories",
|
|
18
|
+
autoWidth = false,
|
|
19
|
+
menuPosition = "left",
|
|
20
|
+
} = props;
|
|
12
21
|
|
|
13
22
|
const filters: IFilterValue[] = [
|
|
14
23
|
{
|
|
@@ -76,7 +85,7 @@ const CategoryFilter = (props: ICategoryFilterProps): JSX.Element => {
|
|
|
76
85
|
const isActive = !areEquals(selectedValue, [selectAllOption]);
|
|
77
86
|
|
|
78
87
|
const Header = () => (
|
|
79
|
-
<S.HeaderWrapper isActive={isActive}>
|
|
88
|
+
<S.HeaderWrapper isActive={isActive} autoWidth={autoWidth} className="headerWrapper">
|
|
80
89
|
{trimText(title, 23)}
|
|
81
90
|
<S.IconsWrapper>
|
|
82
91
|
{isActive ? <Icon name="Filter" size="16" /> : <Icon name="DownArrow" size="16" />}
|
|
@@ -85,7 +94,7 @@ const CategoryFilter = (props: ICategoryFilterProps): JSX.Element => {
|
|
|
85
94
|
);
|
|
86
95
|
|
|
87
96
|
return (
|
|
88
|
-
<FloatingMenu Button={Header} position=
|
|
97
|
+
<FloatingMenu Button={Header} position={menuPosition} closeOnSelect={false} isCheckGroup={true}>
|
|
89
98
|
<ListTitle data-testid="category-filter-title">Filter by Category</ListTitle>
|
|
90
99
|
<S.ChecksWrapper>
|
|
91
100
|
<CheckGroup options={options} value={selectedValue} onChange={setQuery} selectAllOption={selectAllOption} />
|
|
@@ -101,6 +110,8 @@ export interface ICategoryFilterProps {
|
|
|
101
110
|
siteID: number | null;
|
|
102
111
|
formCategory?: { value: string; label: string };
|
|
103
112
|
pointer?: string;
|
|
113
|
+
autoWidth?: boolean;
|
|
114
|
+
menuPosition?: string;
|
|
104
115
|
}
|
|
105
116
|
|
|
106
117
|
export default CategoryFilter;
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { Header } from "@ax/components/TableList/style";
|
|
4
4
|
|
|
5
|
-
const HeaderWrapper = styled((props) => <Header {...props} />)<{ isActive: boolean }>`
|
|
6
|
-
width: 215px;
|
|
5
|
+
const HeaderWrapper = styled((props) => <Header {...props} />)<{ isActive: boolean; autoWidth: boolean }>`
|
|
6
|
+
width: ${(p) => (p.autoWidth ? "auto" : "215px")};
|
|
7
7
|
justify-content: center;
|
|
8
8
|
&:hover {
|
|
9
9
|
color: ${(p) => p.theme.color.interactive01};
|
|
@@ -8,17 +8,19 @@ import * as S from "./style";
|
|
|
8
8
|
|
|
9
9
|
const Toast = (props: IToastProps): JSX.Element => {
|
|
10
10
|
const { action, message, setIsVisible } = props;
|
|
11
|
-
const toast = useRef<
|
|
11
|
+
const toast = useRef<HTMLDivElement>(null);
|
|
12
12
|
|
|
13
13
|
const { pathname } = useLocation();
|
|
14
14
|
const isEditor = pathname.includes("/editor");
|
|
15
15
|
|
|
16
|
-
let temp:
|
|
16
|
+
let temp: NodeJS.Timeout;
|
|
17
17
|
const setTemp = (time: number) => (temp = setTimeout(() => setIsVisible(false), time));
|
|
18
18
|
|
|
19
19
|
const close = () => {
|
|
20
|
-
toast.current
|
|
21
|
-
|
|
20
|
+
if (toast.current) {
|
|
21
|
+
toast.current.classList.add("close-animation");
|
|
22
|
+
setTemp(1000);
|
|
23
|
+
}
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
useEffect(() => {
|
package/src/components/index.tsx
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
FieldGroup,
|
|
13
13
|
FieldsDivider,
|
|
14
14
|
FileField,
|
|
15
|
+
FormCategorySelect,
|
|
16
|
+
FormContainer,
|
|
15
17
|
FormFieldArray,
|
|
16
18
|
HeadingField,
|
|
17
19
|
HiddenField,
|
|
@@ -79,6 +81,7 @@ import FieldsBehavior from "./FieldsBehavior";
|
|
|
79
81
|
import FileGallery from "./FileGallery";
|
|
80
82
|
import FilterTagsBar from "./FilterTagsBar";
|
|
81
83
|
import Flag from "./Flag";
|
|
84
|
+
import FloatingButton from "./FloatingButton";
|
|
82
85
|
import FloatingMenu from "./FloatingMenu";
|
|
83
86
|
import FloatingPanel from "./FloatingPanel";
|
|
84
87
|
import Gallery from "./Gallery";
|
|
@@ -97,6 +100,7 @@ import MenuGroup from "./MenuGroup";
|
|
|
97
100
|
import Modal from "./Modal";
|
|
98
101
|
import Nav from "./Nav";
|
|
99
102
|
import Notification from "./Notification";
|
|
103
|
+
import OcassionalToast from "./OcassionalToast";
|
|
100
104
|
import PageFinder from "./PageFinder";
|
|
101
105
|
import Pagination from "./Pagination";
|
|
102
106
|
import ProgressBar from "./ProgressBar";
|
|
@@ -129,6 +133,8 @@ export {
|
|
|
129
133
|
FieldGroup,
|
|
130
134
|
FieldsDivider,
|
|
131
135
|
FileField,
|
|
136
|
+
FormCategorySelect,
|
|
137
|
+
FormContainer,
|
|
132
138
|
FormFieldArray,
|
|
133
139
|
HeadingField,
|
|
134
140
|
HiddenField,
|
|
@@ -196,6 +202,7 @@ export {
|
|
|
196
202
|
FileGallery,
|
|
197
203
|
FilterTagsBar,
|
|
198
204
|
Flag,
|
|
205
|
+
FloatingButton,
|
|
199
206
|
FloatingMenu,
|
|
200
207
|
FloatingPanel,
|
|
201
208
|
Gallery,
|
|
@@ -214,6 +221,7 @@ export {
|
|
|
214
221
|
Modal,
|
|
215
222
|
Nav,
|
|
216
223
|
Notification,
|
|
224
|
+
OcassionalToast,
|
|
217
225
|
PageFinder,
|
|
218
226
|
Pagination,
|
|
219
227
|
ProgressBar,
|