@geotab/zenith 1.18.0 → 1.19.0-beta.1
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/README.md +7 -0
- package/dist/dropdown/dropdown.d.ts +27 -9
- package/dist/dropdown/dropdown.js +105 -42
- package/dist/dropdown/dropdownHelper.d.ts +4 -3
- package/dist/dropdown/dropdownHelper.js +16 -7
- package/dist/dropdown/dropdownSearchableTrigger.js +2 -1
- package/dist/dropdown/stateReducer/stateAction.d.ts +19 -3
- package/dist/dropdown/stateReducer/stateActionType.d.ts +4 -1
- package/dist/dropdown/stateReducer/stateActionType.js +3 -0
- package/dist/dropdown/stateReducer/stateReducer.d.ts +11 -3
- package/dist/dropdown/stateReducer/stateReducer.js +70 -15
- package/dist/filterButton/filterButton.js +2 -1
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.d.ts +13 -2
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.js +34 -9
- package/dist/filtersBar/filtersBar.d.ts +2 -2
- package/dist/filtersBar/filtersBarInterfaces.d.ts +3 -2
- package/dist/groupsFilter/groupsFilter.js +9 -2
- package/dist/groupsFilter/groupsFilterTrigger.js +1 -1
- package/dist/icons/iconCalendar2.d.ts +4 -0
- package/dist/icons/iconCalendar2.js +4 -0
- package/dist/icons/iconClock2.js +1 -1
- package/dist/icons/iconCornerUpLeft.d.ts +4 -0
- package/dist/icons/iconCornerUpLeft.js +17 -0
- package/dist/icons/iconCornerUpRight2.d.ts +4 -0
- package/dist/icons/iconCornerUpRight2.js +4 -0
- package/dist/icons/iconCup.d.ts +3 -0
- package/dist/icons/iconCup.js +3 -0
- package/dist/icons/iconDriver.js +1 -1
- package/dist/icons/iconImac2.d.ts +4 -0
- package/dist/icons/iconImac2.js +4 -0
- package/dist/icons/iconInbox2.d.ts +4 -0
- package/dist/icons/iconInbox2.js +4 -0
- package/dist/icons/iconLab.d.ts +4 -0
- package/dist/icons/iconLab.js +4 -0
- package/dist/icons/iconMenuCircle2.d.ts +4 -0
- package/dist/icons/iconMenuCircle2.js +4 -0
- package/dist/icons/iconShare2.d.ts +4 -0
- package/dist/icons/iconShare2.js +4 -0
- package/dist/icons/iconVolumeOf.d.ts +4 -0
- package/dist/icons/iconVolumeOf.js +4 -0
- package/dist/icons/iconVolumeOn.d.ts +4 -0
- package/dist/icons/iconVolumeOn.js +17 -0
- package/dist/index.css +9 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +14 -9
- package/dist/textareaRaw/textareaRaw.d.ts +2 -0
- package/dist/textareaRaw/textareaRaw.js +3 -2
- package/package.json +4 -4
|
@@ -5,11 +5,11 @@ const stateActionType_1 = require("./stateActionType");
|
|
|
5
5
|
const stateReducerHelper_1 = require("./stateReducerHelper");
|
|
6
6
|
const groupsFilterHelper_1 = require("../../groupsFilter/groupsFilterHelper");
|
|
7
7
|
const groupsHelper_1 = require("../../groupsFilter/groupsHelper");
|
|
8
|
-
const getInitialState = (comboItems, selection, defaultValue) => {
|
|
8
|
+
const getInitialState = (isFullSelectionMode, comboItems, selection, defaultValue, isAllSelected, defaultValueIsAllSelected) => {
|
|
9
9
|
const updatedGroupsMapSelected = new Map();
|
|
10
10
|
const updatedGroupsMap = comboItems.length ? (0, groupsFilterHelper_1.createGroupsMap)(comboItems, groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID) : {};
|
|
11
11
|
const namelessIds = new Set();
|
|
12
|
-
if (selection
|
|
12
|
+
if (selection.length > 0) {
|
|
13
13
|
selection.forEach(id => {
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
15
15
|
const item = updatedGroupsMap[id];
|
|
@@ -22,10 +22,11 @@ const getInitialState = (comboItems, selection, defaultValue) => {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
const isCurrentListNested = Object.keys(updatedGroupsMap).length > 0 && (updatedGroupsMap[groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID].children || []).some(el => el.children && el.children.length);
|
|
25
26
|
return {
|
|
26
27
|
groupsMap: updatedGroupsMap,
|
|
27
|
-
selectedIds: selection
|
|
28
|
-
globalSelectedIds: selection
|
|
28
|
+
selectedIds: selection,
|
|
29
|
+
globalSelectedIds: selection,
|
|
29
30
|
defaultValue: defaultValue || [],
|
|
30
31
|
listData: [],
|
|
31
32
|
currentId: undefined,
|
|
@@ -35,10 +36,14 @@ const getInitialState = (comboItems, selection, defaultValue) => {
|
|
|
35
36
|
inputValue: "",
|
|
36
37
|
isOpenCombo: false,
|
|
37
38
|
hasDataProblem: false,
|
|
38
|
-
isDisableStateProhibited: Object.keys(updatedGroupsMap).length > 0 && (updatedGroupsMap[groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID].children || []).some(el => el.children && el.children.length),
|
|
39
39
|
groupsMapSelected: updatedGroupsMapSelected,
|
|
40
40
|
namelessIds: namelessIds,
|
|
41
|
-
pendingNamelessIds: false
|
|
41
|
+
pendingNamelessIds: false,
|
|
42
|
+
isNestedList: isCurrentListNested,
|
|
43
|
+
isFullSelectionMode: isFullSelectionMode,
|
|
44
|
+
isAllSelected: isAllSelected,
|
|
45
|
+
globalIsAllSelected: isFullSelectionMode ? isAllSelected || false : undefined,
|
|
46
|
+
defaultValueIsAllSelected: isFullSelectionMode ? defaultValueIsAllSelected || false : undefined
|
|
42
47
|
};
|
|
43
48
|
};
|
|
44
49
|
exports.getInitialState = getInitialState;
|
|
@@ -64,7 +69,8 @@ function stateReducer(state, action) {
|
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
}
|
|
67
|
-
|
|
72
|
+
const isCurrentListNested = Object.keys(updatedGroupsMap).length > 0 && (updatedGroupsMap[groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID].children || []).some(el => el.children && el.children.length);
|
|
73
|
+
return Object.assign(Object.assign({}, state), { groupsMap: updatedGroupsMap, namelessIds: newNamelessIds, isNestedList: state.isNestedList ? state.isNestedList : isCurrentListNested });
|
|
68
74
|
}
|
|
69
75
|
case stateActionType_1.StateActionType.SetListData: {
|
|
70
76
|
state.selectedIds.forEach(id => {
|
|
@@ -74,7 +80,8 @@ function stateReducer(state, action) {
|
|
|
74
80
|
item && state.namelessIds.delete(id);
|
|
75
81
|
}
|
|
76
82
|
});
|
|
77
|
-
|
|
83
|
+
const isCurrentDataNested = payload.some(el => el.children && el.children.length > 0);
|
|
84
|
+
return Object.assign(Object.assign({}, state), { listData: payload, hasDataProblem: Object.keys(state.groupsMap).length === 0 && isCurrentDataNested, isNestedList: isCurrentDataNested ? isCurrentDataNested : state.isNestedList });
|
|
78
85
|
}
|
|
79
86
|
case stateActionType_1.StateActionType.SetDataProblem:
|
|
80
87
|
return Object.assign(Object.assign({}, state), { hasDataProblem: payload });
|
|
@@ -83,9 +90,9 @@ function stateReducer(state, action) {
|
|
|
83
90
|
case stateActionType_1.StateActionType.SetIsOpenCombo:
|
|
84
91
|
return Object.assign(Object.assign({}, state), { isOpenCombo: payload });
|
|
85
92
|
case stateActionType_1.StateActionType.ResetSelection:
|
|
86
|
-
return Object.assign(Object.assign({}, state), { selectedIds: [...state.defaultValue] });
|
|
93
|
+
return Object.assign(Object.assign({}, state), { selectedIds: [...state.defaultValue], isAllSelected: state.defaultValueIsAllSelected });
|
|
87
94
|
case stateActionType_1.StateActionType.ResetStateToGlobal:
|
|
88
|
-
return Object.assign(Object.assign({}, state), { selectedIds: [...state.globalSelectedIds] });
|
|
95
|
+
return Object.assign(Object.assign({}, state), { selectedIds: [...state.globalSelectedIds], isAllSelected: state.globalIsAllSelected });
|
|
89
96
|
case stateActionType_1.StateActionType.NothingToShow:
|
|
90
97
|
return Object.assign(Object.assign({}, state), { showWaiting: false, showEmptyList: false, showList: false });
|
|
91
98
|
case stateActionType_1.StateActionType.Show:
|
|
@@ -100,7 +107,7 @@ function stateReducer(state, action) {
|
|
|
100
107
|
return Object.assign(Object.assign({}, state), { inputValue: payload });
|
|
101
108
|
case stateActionType_1.StateActionType.SetState: {
|
|
102
109
|
const newNamelessIds = new Set(state.namelessIds);
|
|
103
|
-
payload.forEach(id => {
|
|
110
|
+
payload.selected.forEach(id => {
|
|
104
111
|
if (!state.groupsMapSelected.has(id)) {
|
|
105
112
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
106
113
|
const item = state.groupsMap[id];
|
|
@@ -110,7 +117,7 @@ function stateReducer(state, action) {
|
|
|
110
117
|
!item && newNamelessIds.add(id);
|
|
111
118
|
}
|
|
112
119
|
});
|
|
113
|
-
return Object.assign(Object.assign({}, state), { selectedIds: payload, namelessIds: newNamelessIds });
|
|
120
|
+
return Object.assign(Object.assign({}, state), { selectedIds: payload.selected, namelessIds: newNamelessIds, isAllSelected: payload.isAllSelected });
|
|
114
121
|
}
|
|
115
122
|
case stateActionType_1.StateActionType.UpdateNamelessItems: {
|
|
116
123
|
if (state.pendingNamelessIds) {
|
|
@@ -148,7 +155,7 @@ function stateReducer(state, action) {
|
|
|
148
155
|
return Object.assign(Object.assign({}, state), { pendingNamelessIds: payload });
|
|
149
156
|
}
|
|
150
157
|
case stateActionType_1.StateActionType.SetGlobalState:
|
|
151
|
-
return Object.assign(Object.assign({}, state), { globalSelectedIds: payload });
|
|
158
|
+
return Object.assign(Object.assign({}, state), { globalSelectedIds: payload.selected, globalIsAllSelected: payload.isAllSelected });
|
|
152
159
|
case stateActionType_1.StateActionType.SetDefaultValue: {
|
|
153
160
|
const newNamelessIds = new Set(state.namelessIds);
|
|
154
161
|
payload.forEach(id => {
|
|
@@ -163,6 +170,9 @@ function stateReducer(state, action) {
|
|
|
163
170
|
});
|
|
164
171
|
return Object.assign(Object.assign({}, state), { defaultValue: payload, namelessIds: newNamelessIds });
|
|
165
172
|
}
|
|
173
|
+
case stateActionType_1.StateActionType.SetDefaultAllSelected: {
|
|
174
|
+
return Object.assign(Object.assign({}, state), { defaultValueIsAllSelected: payload });
|
|
175
|
+
}
|
|
166
176
|
case stateActionType_1.StateActionType.ChangeSingleSelection: {
|
|
167
177
|
const newSelectedId = payload.value ? payload.value : state.defaultValue[0];
|
|
168
178
|
if (newSelectedId && !state.groupsMapSelected.has(newSelectedId)) {
|
|
@@ -215,11 +225,12 @@ function stateReducer(state, action) {
|
|
|
215
225
|
case stateActionType_1.StateActionType.SelectAllChildren: {
|
|
216
226
|
const currentEl = state.groupsMap[payload];
|
|
217
227
|
const newSelected = new Set(state.selectedIds);
|
|
228
|
+
const isDisableStateProhibited = state.isNestedList;
|
|
218
229
|
(currentEl.children || []).forEach(el => {
|
|
219
230
|
var _a, _b;
|
|
220
231
|
if (!newSelected.has(el.id)) {
|
|
221
232
|
// select when isDisableStateProhibited, or when disabled elements are allowed to be displayed, and this element is not disabled
|
|
222
|
-
(
|
|
233
|
+
(isDisableStateProhibited || !el.disabled) && newSelected.add(el.id);
|
|
223
234
|
// deselect parent
|
|
224
235
|
const parentForDeselect = [];
|
|
225
236
|
let parent = (_a = state.groupsMap[el.id].parent) === null || _a === void 0 ? void 0 : _a.id;
|
|
@@ -249,12 +260,56 @@ function stateReducer(state, action) {
|
|
|
249
260
|
});
|
|
250
261
|
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected) });
|
|
251
262
|
}
|
|
263
|
+
case stateActionType_1.StateActionType.DeselectItemsFromAllSelected: {
|
|
264
|
+
const currentEl = state.groupsMap[groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID];
|
|
265
|
+
// action not submitted for disabled item, other items, even if disabled, not change their state
|
|
266
|
+
const deselectedItems = payload ? new Set([payload]) : new Set(state.listData.filter(elem => !elem.disabled).map(el => el.id));
|
|
267
|
+
const newSelected = new Set();
|
|
268
|
+
(currentEl.children || []).forEach(el => {
|
|
269
|
+
if (!newSelected.has(el.id) && !deselectedItems.has(el.id)) {
|
|
270
|
+
newSelected.add(el.id);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
state.listData.forEach(el => {
|
|
274
|
+
if (!newSelected.has(el.id) && !deselectedItems.has(el.id)) {
|
|
275
|
+
newSelected.add(el.id);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
newSelected.forEach(id => {
|
|
279
|
+
if (!state.groupsMapSelected.has(id)) {
|
|
280
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
281
|
+
const item = state.groupsMap[id] || state.listData.find(el => el.id === id);
|
|
282
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
283
|
+
item && state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
return Object.assign(Object.assign({}, state), { selectedIds: Array.from(newSelected), isAllSelected: state.isFullSelectionMode ? false : undefined });
|
|
287
|
+
}
|
|
288
|
+
case stateActionType_1.StateActionType.ToggleValueForAllSelected: {
|
|
289
|
+
const currentEl = state.groupsMap[groupsHelper_1.ENTIRE_ORGANIZATION_GROUP_ID];
|
|
290
|
+
const newSelected = new Set();
|
|
291
|
+
state.isAllSelected && (currentEl.children || []).forEach(el => {
|
|
292
|
+
if (!newSelected.has(el.id) && el.disabled) {
|
|
293
|
+
newSelected.add(el.id);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
newSelected.forEach(id => {
|
|
297
|
+
if (!state.groupsMapSelected.has(id)) {
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
299
|
+
const item = state.groupsMap[id] || state.listData.find(el => el.id === id);
|
|
300
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
301
|
+
item && state.groupsMapSelected.set(id, Object.assign(Object.assign({ id }, (item.name ? { name: item.name } : {})), (item.color ? { color: item.color } : {})));
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
return Object.assign(Object.assign({}, state), { selectedIds: state.isAllSelected ? Array.from(newSelected) : [], isAllSelected: state.isFullSelectionMode ? !state.isAllSelected : undefined });
|
|
305
|
+
}
|
|
252
306
|
case stateActionType_1.StateActionType.DeselectAllChildren: {
|
|
253
307
|
const childrenForDeselect = [];
|
|
254
308
|
const currentChild = (0, stateReducerHelper_1.getChildList)(state.groupsMap[payload].children);
|
|
309
|
+
const isDisableStateProhibited = state.isNestedList;
|
|
255
310
|
currentChild.forEach(el => {
|
|
256
311
|
// deselect when isDisableStateProhibited, or when disabled elements are allowed to be displayed, and this element is not disabled
|
|
257
|
-
(
|
|
312
|
+
(isDisableStateProhibited || !el.disabled) && childrenForDeselect.push(el.id);
|
|
258
313
|
});
|
|
259
314
|
const newSelected = new Set(state.selectedIds);
|
|
260
315
|
childrenForDeselect.forEach(childId => newSelected.delete(childId));
|
|
@@ -25,6 +25,7 @@ exports.FilterButton = (0, react_1.forwardRef)((function FilterButton(_a, ref) {
|
|
|
25
25
|
const driveComponentClass = (0, useDriveClassName_1.useDriveClassName)("zen-filter-button");
|
|
26
26
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
27
27
|
const hasQuantity = typeof quantity === "number";
|
|
28
|
+
const isLargeNumber = hasQuantity && quantity > 99;
|
|
28
29
|
const onClickEvent = (0, react_1.useMemo)(() => onClick
|
|
29
30
|
? (e) => onClick(e.nativeEvent)
|
|
30
31
|
: () => { }, [onClick]);
|
|
@@ -36,5 +37,5 @@ exports.FilterButton = (0, react_1.forwardRef)((function FilterButton(_a, ref) {
|
|
|
36
37
|
className || "",
|
|
37
38
|
isActive ? "zen-filter-button--active" : "",
|
|
38
39
|
fullWidth ? "zen-filter-button--full-width" : ""
|
|
39
|
-
]), onClick: onClickEvent, onMouseOver: onMouseOver, onMouseOut: onMouseOut, ref: ref, htmlType: "button", "aria-label": ariaLabel }, inlineStyle, other, { children: [children ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-filter-button__label", "zen-ellipsis", fullWidth ? "zen-filter-button__label--full-width" : ""]), children: children }) : null, (0, jsx_runtime_1.jsxs)("div", { className: "zen-filter-button__tags", children: [hasQuantity ? (0, jsx_runtime_1.jsx)("div", { className: "zen-filter-button__quantity", children: quantity }) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-filter-button__icon", children: (0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { size: isDrive ? "huge" : "large" }) })] })] }));
|
|
40
|
+
]), onClick: onClickEvent, onMouseOver: onMouseOver, onMouseOut: onMouseOut, ref: ref, htmlType: "button", "aria-label": ariaLabel }, inlineStyle, other, { children: [children ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-filter-button__label", "zen-ellipsis", fullWidth ? "zen-filter-button__label--full-width" : ""]), children: children }) : null, (0, jsx_runtime_1.jsxs)("div", { className: "zen-filter-button__tags", children: [hasQuantity ? (0, jsx_runtime_1.jsx)("div", { className: "zen-filter-button__quantity", children: isLargeNumber ? "99+" : quantity }) : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-filter-button__icon", children: (0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { size: isDrive ? "huge" : "large" }) })] })] }));
|
|
40
41
|
}));
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./filtersBarDropdown.less";
|
|
3
3
|
import { IFiltersBarItem } from "../interfaces";
|
|
4
|
-
import { IDropdown } from "../../../dropdown/dropdown";
|
|
4
|
+
import { IDropdown, IDropdownFullSelection } from "../../../dropdown/dropdown";
|
|
5
5
|
export interface IFiltersBarDropdownState {
|
|
6
6
|
selectedOption: string[];
|
|
7
7
|
}
|
|
8
|
+
export interface IFiltersBarDropdownFullSelectionState {
|
|
9
|
+
selected: string[];
|
|
10
|
+
isAllSelected: boolean;
|
|
11
|
+
}
|
|
8
12
|
interface IFiltersBarDropdownProps extends Omit<IDropdown, "value" | "onChange" | "getNamedItems" | "buttonType" | "alignment" | "error" | "className" | "children"> {
|
|
9
13
|
}
|
|
14
|
+
interface IFiltersBarDropdownFullSelectionProps extends Omit<IDropdownFullSelection, "value" | "onChange" | "getNamedItems" | "buttonType" | "alignment" | "error" | "className" | "children"> {
|
|
15
|
+
}
|
|
10
16
|
export interface IFiltersBarDropdown extends IFiltersBarItem<IFiltersBarDropdownState, IFiltersBarDropdownProps> {
|
|
11
17
|
className?: string;
|
|
12
18
|
props: IFiltersBarDropdownProps;
|
|
13
19
|
sidePanelMaxGroupedItemsLength?: number;
|
|
14
20
|
}
|
|
15
|
-
export
|
|
21
|
+
export interface IFiltersBarDropdownFullSelectionMode extends IFiltersBarItem<IFiltersBarDropdownFullSelectionState, IFiltersBarDropdownFullSelectionProps> {
|
|
22
|
+
className?: string;
|
|
23
|
+
props: IFiltersBarDropdownFullSelectionProps;
|
|
24
|
+
sidePanelMaxGroupedItemsLength?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const FiltersBarDropdown: React.FC<IFiltersBarDropdown | IFiltersBarDropdownFullSelectionMode>;
|
|
16
27
|
export declare const TRANSLATIONS: string[];
|
|
17
28
|
export {};
|
|
@@ -13,9 +13,13 @@ const classNames_1 = require("../../../commonHelpers/classNames/classNames");
|
|
|
13
13
|
const groupsHelper_1 = require("../../../groupsFilter/groupsHelper");
|
|
14
14
|
const useLanguage_1 = require("../../../utils/localization/useLanguage");
|
|
15
15
|
const dropdownHelper_1 = require("../../../dropdown/dropdownHelper");
|
|
16
|
+
// eslint-disable-next-line complexity
|
|
16
17
|
const FiltersBarDropdown = ({ sidePanelTitle, className, props, state, useSidePanelView, sidePanelMaxGroupedItemsLength = 5, onChange }) => {
|
|
17
18
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
18
|
-
const
|
|
19
|
+
const isFullSelectionMode = (0, react_1.useMemo)(() => "isAllSelected" in state && typeof (state).isAllSelected === "boolean", [state]);
|
|
20
|
+
const selection = (0, react_1.useMemo)(() => new Set(isFullSelectionMode ? state.selected
|
|
21
|
+
: state.selectedOption), [isFullSelectionMode, state]);
|
|
22
|
+
const isCurrentAllSelected = (0, react_1.useMemo)(() => isFullSelectionMode ? state.isAllSelected : undefined, [isFullSelectionMode, state]);
|
|
19
23
|
const [_, setNamedFnReady] = (0, react_1.useState)(false);
|
|
20
24
|
const namedItemsFnRef = (0, react_1.useRef)(items => items.map(el => ({ id: el, name: "..." })));
|
|
21
25
|
const dropdownId = (0, useUniqueId_1.useUniqueId)();
|
|
@@ -24,18 +28,33 @@ const FiltersBarDropdown = ({ sidePanelTitle, className, props, state, useSidePa
|
|
|
24
28
|
const dropdownLabelledId = (0, useUniqueId_1.useUniqueId)();
|
|
25
29
|
const sortedItems = (0, react_1.useMemo)(() => (0, dropdownHelper_1.sortDropdownItemArray)(props.dataItems || [], props.sortFn), [props.sortFn, props.dataItems]);
|
|
26
30
|
const handleRemove = (0, react_1.useCallback)((removedId) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
if (isFullSelectionMode) {
|
|
32
|
+
const isAllSelected = state.isAllSelected;
|
|
33
|
+
if (isAllSelected) {
|
|
34
|
+
onChange({ selected: sortedItems.map(el => el.id).filter(el => el !== removedId), isAllSelected: false });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
onChange({ selected: Array.from(selection).filter(el => el !== removedId), isAllSelected: false });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
onChange({ selectedOption: Array.from(selection).filter(el => el !== removedId) });
|
|
41
|
+
}
|
|
42
|
+
}, [isFullSelectionMode, onChange, selection, sortedItems, state]);
|
|
43
|
+
const component = isFullSelectionMode ? (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, props, { width: useSidePanelView ? undefined : props.width, inputId: props.inputId && useSidePanelView ? `${props.inputId}-side-panel` : props.inputId, className: (0, classNames_1.classNames)([className || "", useSidePanelView ? "zen-filters-bar-dropdown--side-panel" : "", !useSidePanelView && !props.width ? "zen-filters-bar-dropdown--toolbar" : ""]), classNamePopup: (0, classNames_1.classNames)(["zen-filters-bar-dropdown-popup", props.classNamePopup || ""]), value: { selected: Array.from(selection), isAllSelected: isCurrentAllSelected || false }, onChange: (newValue) => {
|
|
44
|
+
onChange({ selected: newValue.selected.map(el => el.id), isAllSelected: newValue.isAllSelected || false });
|
|
31
45
|
}, error: undefined, fullWidthTriggerButton: useSidePanelView ? true : props.fullWidthTriggerButton, hasApplyButton: useSidePanelView ? false : props.hasApplyButton, getNamedItems: useSidePanelView ? (fn) => {
|
|
32
46
|
namedItemsFnRef.current = fn;
|
|
33
47
|
setNamedFnReady(val => !val);
|
|
34
|
-
} : undefined }))
|
|
48
|
+
} : undefined, defaultValue: props.defaultValue, multiselect: true, selectAllButton: true })) : (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, props, { width: useSidePanelView ? undefined : props.width, inputId: props.inputId && useSidePanelView ? `${props.inputId}-side-panel` : props.inputId, className: (0, classNames_1.classNames)([className || "", useSidePanelView ? "zen-filters-bar-dropdown--side-panel" : "", !useSidePanelView && !props.width ? "zen-filters-bar-dropdown--toolbar" : ""]), classNamePopup: (0, classNames_1.classNames)(["zen-filters-bar-dropdown-popup", props.classNamePopup || ""]), value: Array.from(selection), onChange: (newValue) => {
|
|
49
|
+
onChange({ selectedOption: newValue.map(el => el.id) });
|
|
50
|
+
}, error: undefined, fullWidthTriggerButton: useSidePanelView ? true : props.fullWidthTriggerButton, hasApplyButton: useSidePanelView ? false : props.hasApplyButton, getNamedItems: useSidePanelView ? (fn) => {
|
|
51
|
+
namedItemsFnRef.current = fn;
|
|
52
|
+
setNamedFnReady(val => !val);
|
|
53
|
+
} : undefined, defaultValue: props.defaultValue }));
|
|
35
54
|
if (!useSidePanelView) {
|
|
36
55
|
return component;
|
|
37
56
|
}
|
|
38
|
-
if (props.multiselect === false && props.dataItems && props.dataItems.length < sidePanelMaxGroupedItemsLength) {
|
|
57
|
+
if (!isFullSelectionMode && props.multiselect === false && props.dataItems && props.dataItems.length < sidePanelMaxGroupedItemsLength) {
|
|
39
58
|
return (0, jsx_runtime_1.jsx)(sidePanelCell_1.SidePanelCell, { title: sidePanelTitle, role: "group", labelledBy: radioGroupLabelledId, titleId: radioGroupLabelledId, children: (0, jsx_runtime_1.jsx)(filtersBarSidePanelRadioGroup_1.FiltersBarSidePanelRadioGroup, Object.assign({}, props, { direction: "vertical", items: sortedItems.map((item) => ({
|
|
40
59
|
id: `${dropdownId}_${item.id}`,
|
|
41
60
|
value: item.id,
|
|
@@ -51,8 +70,14 @@ const FiltersBarDropdown = ({ sidePanelTitle, className, props, state, useSidePa
|
|
|
51
70
|
disabled: item.disabled,
|
|
52
71
|
children: (0, jsx_runtime_1.jsx)("span", { className: "strecthed", children: (0, groupsHelper_1.getGroupDescription)(item, translate) })
|
|
53
72
|
})), onChange: selectedItems => {
|
|
54
|
-
|
|
55
|
-
|
|
73
|
+
if (isFullSelectionMode) {
|
|
74
|
+
onChange({ selected: selectedItems, isAllSelected: selectedItems.length === sortedItems.length });
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
onChange({ selectedOption: selectedItems });
|
|
78
|
+
}
|
|
79
|
+
}, selectedItems: isFullSelectionMode ? (state.isAllSelected ? sortedItems.map(el => el.id)
|
|
80
|
+
: state.selected) : state.selectedOption })) });
|
|
56
81
|
}
|
|
57
82
|
const namedPills = namedItemsFnRef.current(Array.from(selection)).map(el => (el.name ? el : Object.assign(Object.assign({}, el), { name: "..." })));
|
|
58
83
|
return (0, jsx_runtime_1.jsx)(sidePanelCell_1.SidePanelCell, { title: sidePanelTitle, role: "group", labelledBy: dropdownLabelledId, titleId: dropdownLabelledId, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [component, props.multiselect && (0, jsx_runtime_1.jsx)(pillBox_1.PillBox, { className: "zen-filters-bar-dropdown__pill-box", selectedPills: namedPills, onRemove: handleRemove })] }) });
|
|
@@ -6,7 +6,7 @@ import { IFiltersBarSearch } from "./components/filtersBarSearch/filtersBarSearc
|
|
|
6
6
|
import { IFiltersBarGroupButton } from "./components/filtersBarGroupButton/filtersBarGroupButton";
|
|
7
7
|
import { IFiltersBarGroupsFilter } from "./components/filtersBarGroupsFilter/filtersBarGroupsFilter";
|
|
8
8
|
import { IFiltersBarPeriodPicker, IFiltersBarPeriodPickerUnsetValue } from "./components/filtersBarPeriodPicker/filtersBarPeriodPicker";
|
|
9
|
-
import { IFiltersBarDropdown } from "./components/filtersBarDropdown/filtersBarDropdown";
|
|
9
|
+
import { IFiltersBarDropdown, IFiltersBarDropdownFullSelectionMode } from "./components/filtersBarDropdown/filtersBarDropdown";
|
|
10
10
|
import { IFiltersBarRange } from "./components/filtersBarRange/filtersBarRange";
|
|
11
11
|
import { IFiltersBarChildrenState } from "./filtersBarInterfaces";
|
|
12
12
|
export interface IFiltersBar extends IZenComponentProps {
|
|
@@ -46,7 +46,7 @@ export interface IFiltersBar extends IZenComponentProps {
|
|
|
46
46
|
}
|
|
47
47
|
interface IFiltersBarComponents {
|
|
48
48
|
Search: React.FC<IFiltersBarSearch>;
|
|
49
|
-
Dropdown: React.FC<IFiltersBarDropdown>;
|
|
49
|
+
Dropdown: React.FC<IFiltersBarDropdown | IFiltersBarDropdownFullSelectionMode>;
|
|
50
50
|
GroupButton: React.FC<IFiltersBarGroupButton>;
|
|
51
51
|
GroupsFilter: React.FC<IFiltersBarGroupsFilter>;
|
|
52
52
|
PeriodPicker: React.FC<IFiltersBarPeriodPicker | IFiltersBarPeriodPickerUnsetValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FiltersBarDropdown, IFiltersBarDropdown } from "./components/filtersBarDropdown/filtersBarDropdown";
|
|
2
|
+
import { FiltersBarDropdown, IFiltersBarDropdown, IFiltersBarDropdownFullSelectionMode } from "./components/filtersBarDropdown/filtersBarDropdown";
|
|
3
3
|
import { FiltersBarGroupButton, IFiltersBarGroupButton } from "./components/filtersBarGroupButton/filtersBarGroupButton";
|
|
4
4
|
import { FiltersBarGroupsFilter, IFiltersBarGroupsFilter } from "./components/filtersBarGroupsFilter/filtersBarGroupsFilter";
|
|
5
5
|
import { FiltersBarPeriodPicker, IFiltersBarPeriodPicker, IFiltersBarPeriodPickerUnsetValue } from "./components/filtersBarPeriodPicker/filtersBarPeriodPicker";
|
|
@@ -7,6 +7,7 @@ import { FiltersBarSearch, IFiltersBarSearch } from "./components/filtersBarSear
|
|
|
7
7
|
import { FiltersBarRange, IFiltersBarRange } from "./components/filtersBarRange/filtersBarRange";
|
|
8
8
|
export type TFiltersBarComponents = typeof FiltersBarDropdown | typeof FiltersBarSearch | typeof FiltersBarGroupButton | typeof FiltersBarGroupsFilter | typeof FiltersBarPeriodPicker | typeof FiltersBarRange;
|
|
9
9
|
export type IFiltersBarDropdownState = Pick<IFiltersBarDropdown, "state">["state"];
|
|
10
|
+
export type IFiltersBarDropdownFullSelectionModeState = Pick<IFiltersBarDropdownFullSelectionMode, "state">["state"];
|
|
10
11
|
export type IFiltersBarSearchState = Pick<IFiltersBarSearch, "state">["state"];
|
|
11
12
|
export type IFiltersBarGroupButtonState = Pick<IFiltersBarGroupButton, "state">["state"];
|
|
12
13
|
export type IFiltersBarRangeState = Pick<IFiltersBarRange, "state">["state"];
|
|
@@ -14,7 +15,7 @@ export type IFiltersBarGroupsFilterState = Pick<IFiltersBarGroupsFilter, "state"
|
|
|
14
15
|
export type IFiltersBarPeriodPickerState = Pick<IFiltersBarPeriodPicker, "state">["state"];
|
|
15
16
|
export type IFiltersBarPeriodPickerUnsetValueState = Pick<IFiltersBarPeriodPickerUnsetValue, "state">["state"];
|
|
16
17
|
export type TFiltersBarCommonComponent = React.ReactComponentElement<TFiltersBarComponents>[];
|
|
17
|
-
export type TFiltersBarComponentsState = IFiltersBarDropdownState | IFiltersBarSearchState | IFiltersBarGroupButtonState | IFiltersBarRangeState | IFiltersBarGroupsFilterState | IFiltersBarPeriodPickerState | IFiltersBarPeriodPickerUnsetValueState | {
|
|
18
|
+
export type TFiltersBarComponentsState = IFiltersBarDropdownState | IFiltersBarDropdownFullSelectionModeState | IFiltersBarSearchState | IFiltersBarGroupButtonState | IFiltersBarRangeState | IFiltersBarGroupsFilterState | IFiltersBarPeriodPickerState | IFiltersBarPeriodPickerUnsetValueState | {
|
|
18
19
|
value: unknown;
|
|
19
20
|
};
|
|
20
21
|
export interface IFiltersBarComponentWithError<T = TFiltersBarComponentsState> {
|
|
@@ -27,6 +27,7 @@ const advancedGroupsFilter_1 = require("../advancedGroupsFilter/advancedGroupsFi
|
|
|
27
27
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
28
28
|
const GroupsFilter = ({ fullSize, className, dataLoader, errorHandler, isWithColor, onChange, initialFilterState, options = {}, listLimit = 500 }) => {
|
|
29
29
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
30
|
+
const [groupPlaceHolder, setGroupPlaceHolder] = (0, react_1.useState)(options.placeholder || translate("Groups"));
|
|
30
31
|
const [state, dispatchState] = (0, react_1.useReducer)(stateReducer_1.stateReducer, (0, stateReducer_1.getInitialState)(translate, initialFilterState));
|
|
31
32
|
const [uiState, dispatchUiState] = (0, react_1.useReducer)(uiStateReducer_1.uiStateReducer, uiStateReducer_1.uiInitialGroupsFilterState);
|
|
32
33
|
const [dataItems, setDataItems] = (0, react_1.useState)([]);
|
|
@@ -144,6 +145,10 @@ const GroupsFilter = ({ fullSize, className, dataLoader, errorHandler, isWithCol
|
|
|
144
145
|
errorHandler(e);
|
|
145
146
|
});
|
|
146
147
|
}, [dataLoader, errorHandler]);
|
|
148
|
+
(0, react_1.useEffect)(() => {
|
|
149
|
+
const selectedValues = dataItems.filter((item) => { var _a; return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find((id) => id === item.id); }).map((item) => item.name);
|
|
150
|
+
setGroupPlaceHolder(selectedValues.length > 0 ? selectedValues.join(", ") : options.placeholder || translate("Groups"));
|
|
151
|
+
}, [dataItems, state.frozenState.simpleFilterState, translate, options.placeholder]);
|
|
147
152
|
const getGroupsBox = () => (0, jsx_runtime_1.jsx)(groupsFilterBox_1.GroupsFilterBox, { step: uiState.step, currentId: uiState.currentAdjustmentId, isWithColor: isWithColor || false, state: state, search: uiState.searchValue, blocks: uiState.searchValue && uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial ? [] : blocksMap[uiState.step], onChange: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? handleCheckboxItemAdjustmentClick : handleCheckboxChange, onClick: handleCheckboxItemClick, uncheckedItems: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdjustmentIds : [], uncheckedAdvancedState: uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected ? uiState.uncheckedAdvancedState : undefined, listLimit: listLimit });
|
|
148
153
|
const onSideWideChange = (newState) => { dispatchState({ type: stateActionType_1.StateActionType.SideWide, payload: newState }); };
|
|
149
154
|
const onRelationChange = (newRelation) => { dispatchState({ type: stateActionType_1.StateActionType.Relation, payload: newRelation }); };
|
|
@@ -163,9 +168,11 @@ const GroupsFilter = ({ fullSize, className, dataLoader, errorHandler, isWithCol
|
|
|
163
168
|
if ((initialFilterState === null || initialFilterState === void 0 ? void 0 : initialFilterState.sideWide) === state.frozenSideWideState && (0, groupsFilterHelper_1.comparePreparedFilters)((0, groupsFilterHelper_1.prepareFilters)(initialFilterState.groups), state.frozenState)) {
|
|
164
169
|
return;
|
|
165
170
|
}
|
|
171
|
+
const selectedValues = dataItems.filter(item => { var _a; return (_a = state.frozenState.simpleFilterState) === null || _a === void 0 ? void 0 : _a.find(id => id === item.id); }).map(item => item.name);
|
|
172
|
+
setGroupPlaceHolder(selectedValues.length > 0 ? selectedValues.join(", ") : options.placeholder || translate("Groups"));
|
|
166
173
|
onChange(Object.assign({}, newState));
|
|
167
174
|
dispatchState({ type: stateActionType_1.StateActionType.TurnOfGlobalChanges, payload: undefined });
|
|
168
|
-
}, [state.globalChanges, state.frozenState, state.frozenSideWideState, onChange, initialFilterState === null || initialFilterState === void 0 ? void 0 : initialFilterState.sideWide, initialFilterState]);
|
|
175
|
+
}, [state.globalChanges, dataItems, translate, state.frozenState, state.frozenSideWideState, options.placeholder, onChange, initialFilterState === null || initialFilterState === void 0 ? void 0 : initialFilterState.sideWide, initialFilterState]);
|
|
169
176
|
(0, react_1.useEffect)(() => {
|
|
170
177
|
var _a;
|
|
171
178
|
if (((_a = prevInitialState.current) === null || _a === void 0 ? void 0 : _a.sideWide) === (initialFilterState === null || initialFilterState === void 0 ? void 0 : initialFilterState.sideWide)
|
|
@@ -216,7 +223,7 @@ const GroupsFilter = ({ fullSize, className, dataLoader, errorHandler, isWithCol
|
|
|
216
223
|
(0, useEscape_1.useEscape)(triggerRef, handleEscape, uiState.isOpen);
|
|
217
224
|
const selectedCount = (0, stateReducerHelper_1.getFrozenCount)(state);
|
|
218
225
|
const isStateHasData = Object.keys(state.groupsMap).length > 0;
|
|
219
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(groupsFilterTrigger_1.GroupsFilterTrigger, { value: uiState.searchValue, onChange: onSearchChange, isOpenPopup: uiState.isOpen, count: selectedCount, withGlobeIcon: state.frozenSideWideState && selectedCount > 0, inputRef: inputRef, handleClick: handleTriggerClick, ref: triggerRef, fullSize: fullSize, placeholder:
|
|
226
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(groupsFilterTrigger_1.GroupsFilterTrigger, { value: uiState.searchValue, onChange: onSearchChange, isOpenPopup: uiState.isOpen, count: selectedCount, withGlobeIcon: state.frozenSideWideState && selectedCount > 0, inputRef: inputRef, handleClick: handleTriggerClick, ref: triggerRef, fullSize: fullSize, placeholder: groupPlaceHolder }), (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, { isOpen: uiState.isOpen, className: (0, classNames_1.classNames)(["zen-groups-filter__popup", uiState.isOpenAdvancedFilter ? "zen-groups-filter__popup--inactive" : "", className ? className : ""]), onOpenChange: onOptionsToggle, useTrapFocusWithTrigger: uiState.isOpenAdvancedFilter ? "off" : "withTrigger", shouldHoldScroll: true, triggerRef: triggerRef, ariaLabel: translate("Organization groups filter"), recalculateOnScroll: true, children: (0, jsx_runtime_1.jsxs)("div", { className: "zen-groups-filter-menu", ref: menuRef, children: [isStateHasData && !uiState.isLoadWithError && (0, jsx_runtime_1.jsxs)(groupsFilterMenu_1.GroupsFilterMenu, { onCancelClick: handleCancel, onApplyClick: handleApply, onResetClick: handleReset, isApplyDisabled: !(0, stateReducerHelper_1.isStateChanged)(state), children: [uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Initial && (0, jsx_runtime_1.jsx)(groupsFilterInitialState_1.GroupsFilterInitialState, { siteWideState: state.sideWideState, onDialogButtonClick: handleAdvancedDialogOpen, count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state), onSiteWideChange: onSideWideChange, onCurrentlySelectedClick: handleCurrentlySelectedClick, searchResult: uiState.searchValue ? getSearchResult() : "", children: getGroupsBox() }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.Adjustment && (0, jsx_runtime_1.jsx)(groupsFilterAdjustmentState_1.GroupsFilterAdjustmentState, { onBackButtonClick: handleBackButtonClick, onHomeButtonClick: handleHomeButtonClick, onSelectAllClick: selectAllHandler, backButtonName: (0, groupsFilterStatesHelper_1.getBackButtonName)(state, uiState.currentAdjustmentId), isAllSelected: (0, groupsFilterStatesHelper_1.isAllChildrenSelected)(state, uiState.currentAdjustmentId), children: getGroupsBox() }), uiState.step === groupsFilterInterfaces_1.FilterMenuStep.CurrentlySelected && (0, jsx_runtime_1.jsx)(groupsFilterCurrentlySelectedState_1.GroupsFilterCurrentlySelectedState, { siteWideState: state.sideWideState, relation: state.relation, count: (0, stateReducerHelper_1.getCurrentlySelectedCount)(state), onBackButtonClick: basicHandleBackButtonClick, onSiteWideChange: onSideWideChange, onRelationChange: onRelationChange, children: getGroupsBox() })] }), !uiState.isLoadWithError && !isStateHasData && (0, jsx_runtime_1.jsx)(waiting_1.Waiting, { className: "zen-groups-filter__waiting", isLoading: !Object.keys(state.groupsMap).length, delay: 100 })] }) }), uiState.isOpenAdvancedFilter && getAdvancedDialog] });
|
|
220
227
|
};
|
|
221
228
|
exports.GroupsFilter = GroupsFilter;
|
|
222
229
|
exports.TRANSLATIONS = [
|
|
@@ -57,7 +57,7 @@ exports.GroupsFilterTrigger = react_1.default.forwardRef((_a, ref) => {
|
|
|
57
57
|
}
|
|
58
58
|
handleClick();
|
|
59
59
|
};
|
|
60
|
-
return (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classNames_1.classNames)(["zen-groups-filter"]), ref: ref }, otherProps, { onClick: clickHandler, role: "combobox", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-groups-filter__search-container", fullSize ? "zen-groups-filter__search-container--full-size" : "", className]), children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-groups-filter__input-container", onKeyDown: handleKeydown, children: (0, jsx_runtime_1.jsx)(textInputRaw_1.TextInputRaw, { value: value, placeholder: placeholder || translate("Filter by group"), className: "zen-groups-filter__input", onChange: onChange, disabled: false, type: "text", ref: inputRef, id: groupsFilterId }) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-groups-filter__search-input zen-groups-filter__search-input--post", children: (0, jsx_runtime_1.jsx)(groupsFilterLabelBox_1.GroupsFilterLabelBox, { count: count, withGlobeIcon: withGlobeIcon }) })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "zen-groups-filter__popup-trigger", title: translate("Open filter"), children: (0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { className: isOpenPopup ? "zen-groups-filter__arrow-icon--up" : "zen-groups-filter__arrow-icon--down", size: "large" }) })] }));
|
|
60
|
+
return (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classNames_1.classNames)(["zen-groups-filter"]), ref: ref }, otherProps, { onClick: clickHandler, role: "combobox", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-groups-filter__search-container", fullSize ? "zen-groups-filter__search-container--full-size" : "", className]), children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-groups-filter__input-container", onKeyDown: handleKeydown, children: (0, jsx_runtime_1.jsx)(textInputRaw_1.TextInputRaw, { value: value, placeholder: placeholder || translate("Filter by group"), className: (0, classNames_1.classNames)(["zen-groups-filter__input", count > 0 ? "zen-groups-filter__input--selected" : ""]), onChange: onChange, disabled: false, type: "text", ref: inputRef, id: groupsFilterId }) }), (0, jsx_runtime_1.jsx)("div", { className: "zen-groups-filter__search-input zen-groups-filter__search-input--post", children: (0, jsx_runtime_1.jsx)(groupsFilterLabelBox_1.GroupsFilterLabelBox, { count: count, withGlobeIcon: withGlobeIcon }) })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "zen-groups-filter__popup-trigger", title: translate("Open filter"), children: (0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { className: isOpenPopup ? "zen-groups-filter__arrow-icon--up" : "zen-groups-filter__arrow-icon--down", size: "large" }) })] }));
|
|
61
61
|
});
|
|
62
62
|
exports.GroupsFilterTrigger.displayName = "GroupsFilterTrigger";
|
|
63
63
|
exports.TRANSLATIONS = [
|
|
@@ -5,6 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
7
|
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
/**
|
|
9
|
+
@deprecated - will be removed in future releases.
|
|
10
|
+
duplicate of **IconCalendar**, please use that instead
|
|
11
|
+
*/
|
|
8
12
|
const IconCalendar2 = ({ className, size, title, description, focusable = false }) => {
|
|
9
13
|
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
14
|
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
package/dist/icons/iconClock2.js
CHANGED
|
@@ -12,6 +12,6 @@ const IconClock2 = ({ className, size, title, description, focusable = false })
|
|
|
12
12
|
(size ? `zen-icon--${size}` : ""),
|
|
13
13
|
className !== null && className !== void 0 ? className : ""
|
|
14
14
|
]), [size, className]);
|
|
15
|
-
return (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24
|
|
15
|
+
return (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "IconClock2", children: [title ? (0, jsx_runtime_1.jsx)("title", { id: uniqueId, children: title }) : null, description ? (0, jsx_runtime_1.jsx)("desc", { children: description }) : null, (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8m0 2a6 6 0 1 0 0-12 6 6 0 0 0 0 12", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M12 9a1 1 0 0 1 1 1v1.586l1.207 1.207a1 1 0 0 1-1.414 1.414l-1.5-1.5A1 1 0 0 1 11 12v-2a1 1 0 0 1 1-1", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm2 1v14h14V5z", clipRule: "evenodd" })] });
|
|
16
16
|
};
|
|
17
17
|
exports.IconClock2 = IconClock2;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IconCornerUpLeft = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
|
+
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
const IconCornerUpLeft = ({ className, size, title, description, focusable = false }) => {
|
|
9
|
+
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
|
+
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
|
11
|
+
"zen-icon",
|
|
12
|
+
(size ? `zen-icon--${size}` : ""),
|
|
13
|
+
className !== null && className !== void 0 ? className : ""
|
|
14
|
+
]), [size, className]);
|
|
15
|
+
return (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "IconCornerUpLeft", children: [title ? (0, jsx_runtime_1.jsx)("title", { id: uniqueId, children: title }) : null, description ? (0, jsx_runtime_1.jsx)("desc", { children: description }) : null, (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M20 20a1 1 0 0 1-1-1v-9H6.414l2.293 2.293a1 1 0 1 1-1.414 1.414l-4-4a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 1.414L6.414 8H20a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1", clipRule: "evenodd" })] });
|
|
16
|
+
};
|
|
17
|
+
exports.IconCornerUpLeft = IconCornerUpLeft;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./icon.less";
|
|
3
3
|
import { IIcon } from "./icon";
|
|
4
|
+
/**
|
|
5
|
+
@deprecated - will be removed in future releases
|
|
6
|
+
duplicate of **IconCornerUpLeft**, please use that instead
|
|
7
|
+
*/
|
|
4
8
|
export declare const IconCornerUpRight2: React.FC<IIcon>;
|
|
@@ -5,6 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
7
|
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
/**
|
|
9
|
+
@deprecated - will be removed in future releases
|
|
10
|
+
duplicate of **IconCornerUpLeft**, please use that instead
|
|
11
|
+
*/
|
|
8
12
|
const IconCornerUpRight2 = ({ className, size, title, description, focusable = false }) => {
|
|
9
13
|
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
14
|
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
package/dist/icons/iconCup.d.ts
CHANGED
package/dist/icons/iconCup.js
CHANGED
|
@@ -5,6 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
7
|
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
/**
|
|
9
|
+
@deprecated - will be removed in future releases
|
|
10
|
+
*/
|
|
8
11
|
const IconCup = ({ className, size, title, description, focusable = false }) => {
|
|
9
12
|
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
13
|
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
package/dist/icons/iconDriver.js
CHANGED
|
@@ -12,6 +12,6 @@ const IconDriver = ({ className, size, title, description, focusable = false })
|
|
|
12
12
|
(size ? `zen-icon--${size}` : ""),
|
|
13
13
|
className !== null && className !== void 0 ? className : ""
|
|
14
14
|
]), [size, className]);
|
|
15
|
-
return (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "IconDriver", children: [title ? (0, jsx_runtime_1.jsx)("title", { id: uniqueId, children: title }) : null, description ? (0, jsx_runtime_1.jsx)("desc", { children: description }) : null, (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd",
|
|
15
|
+
return (0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", focusable: focusable ? "true" : undefined, tabIndex: focusable ? 0 : undefined, role: focusable || title || description ? undefined : "presentation", className: classes, "aria-labelledby": title && focusable ? uniqueId : undefined, "data-name": "IconDriver", children: [title ? (0, jsx_runtime_1.jsx)("title", { id: uniqueId, children: title }) : null, description ? (0, jsx_runtime_1.jsx)("desc", { children: description }) : null, (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M7.5 6.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0M12 4a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M22 17a6 6 0 1 0-12 0 6 6 0 0 0 12 0m-9.874-1a4.002 4.002 0 0 1 7.748 0h-2.142a2 2 0 0 0-3.464 0zm0 2h2.142c.175.304.428.557.732.732v2.142A4.01 4.01 0 0 1 12.126 18M17 20.874v-2.142a2 2 0 0 0 .732-.732h2.142A4.01 4.01 0 0 1 17 20.874", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.913 14.663a1 1 0 0 0-.826-1.821q-.286.13-.561.278a9 9 0 0 0-1.879 1.346 8.5 8.5 0 0 0-1.969 2.759 8.1 8.1 0 0 0-.675 2.704A1 1 0 0 0 4 21h4.466a1 1 0 1 0 0-2H5.172q.126-.493.335-.965c.347-.784.858-1.501 1.507-2.108a7 7 0 0 1 1.9-1.264" })] });
|
|
16
16
|
};
|
|
17
17
|
exports.IconDriver = IconDriver;
|
package/dist/icons/iconImac2.js
CHANGED
|
@@ -5,6 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
7
|
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
/**
|
|
9
|
+
@deprecated - will be removed in future releases
|
|
10
|
+
duplicate of **IconImac**, please use that instead
|
|
11
|
+
*/
|
|
8
12
|
const IconImac2 = ({ className, size, title, description, focusable = false }) => {
|
|
9
13
|
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
14
|
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
package/dist/icons/iconInbox2.js
CHANGED
|
@@ -5,6 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
7
7
|
const useUniqueId_1 = require("../commonHelpers/useUniqueId");
|
|
8
|
+
/**
|
|
9
|
+
@deprecated - will be removed in future releases
|
|
10
|
+
duplicate of **IconInbox**, please use that instead
|
|
11
|
+
*/
|
|
8
12
|
const IconInbox2 = ({ className, size, title, description, focusable = false }) => {
|
|
9
13
|
const uniqueId = (0, useUniqueId_1.useUniqueId)();
|
|
10
14
|
const classes = (0, react_1.useMemo)(() => (0, classNames_1.classNames)([
|
package/dist/icons/iconLab.d.ts
CHANGED